value
2024-05-28 e09a106e6a0cad070f2c846b450b111e21bafb03
修改了光纤配置
已修改4个文件
277 ■■■■ 文件已修改
src/assets/api/controller.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/add.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/fiberoptic-config.vue 240 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-inspection-order.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -193,6 +193,7 @@
  getStandardTree2: "/standardTree/getStandardTree2", //获取产品架构
  upStandardProducts: "/standardTree/upStandardProducts", //获取产品架构
  selectStandardProductEnumByMethodId: "/standardTree/selectStandardProductEnumByMethodId", //批量编辑查询所有检验项目和检验子项枚举
  getStandTreeBySampleType: "/standardTree/getStandTreeBySampleType", //仅获取光纤的型号
}
const standardMethod = {
src/components/do/b1-ins-order/add.vue
@@ -92,7 +92,7 @@
<template>
  <div class="ins_order_add">
    <div>
    <div v-show="!configShow">
      <el-row class="title">
        <el-col :span="6" style="padding-left: 20px;">委托单信息</el-col>
        <el-col :span="18" style="text-align: right;">
@@ -120,7 +120,7 @@
        </el-col>
      </el-row>
    </div>
    <div class="search">
    <div class="search" v-show="!configShow">
      <el-row>
        <el-col class="search_thing" :span="6">
          <div class="search_label">委托编号:</div>
@@ -278,7 +278,7 @@
        </el-col>
      </el-row>
    </div>
    <div>
    <div v-show="!configShow">
      <el-table class="el-table sampleTable" ref="sampleTable" :data="sampleList" height="250px" tooltip-effect="dark"
        border @selection-change="selectSample" highlight-current-row @row-click="rowClick" style="margin-top: 10px;">
        <el-table-column type="selection" width="60" :selectable="selectable" v-if="active==1"></el-table-column>
@@ -540,14 +540,17 @@
        </el-row>
      </span>
    </el-dialog>
    <fiberOpticConfig :currentId="currentId" v-if="configShow"/>
  </div>
</template>
<script>
  import ValueTable from '../../tool/value-table.vue'
  import fiberOpticConfig from './fiberoptic-config.vue'
  export default {
    components: {
      ValueTable
      ValueTable,
      fiberOpticConfig
    },
    props: {
      active: {
@@ -666,7 +669,8 @@
        noLoading: false,
        orderType: [],
        filters: [],
        formType: []
        formType: [],
        configShow: false
      }
    },
    watch: {
@@ -1320,8 +1324,11 @@
        return row[property] === value;
      },
      openConfig(){
        this.$parent.playOrder(4)
        console.log(this.sampleIds);
        if(this.sampleIds.length===0){
          this.$message.error("未选择样品")
          return
        }
        this.configShow = true
      }
    }
  }
src/components/do/b1-ins-order/fiberoptic-config.vue
@@ -5,7 +5,7 @@
        <el-col :span="6" style="padding-left: 20px;">光纤配置</el-col>
        <el-col :span="18" style="text-align: right;">
          <el-button size="medium" type="primary" @click="save" :loading="saveLoad">保 存</el-button>
          <el-button size="medium" @click="$parent.playOrder(1)">
          <el-button size="medium" @click="outConfig">
            <span style="color: #3A7BFA;">取 消</span>
          </el-button>
        </el-col>
@@ -20,42 +20,42 @@
              style="display: flex;align-items: center;justify-content: space-between;padding: 0 12px;box-sizing: border-box;">
              <div class="search-item">
                <label style="width: 70px;">样品型号</label>
                <span style="font-size: 14px;">GYTA53</span>
                <span style="font-size: 14px;">{{models}}</span>
              </div>
              <el-radio-group v-model="packageInfo.radio" size="small">
              <el-radio-group v-model="packageInfo.radio" size="small" @change="upNum()">
                <el-radio :label="0">全检</el-radio>
                <el-radio :label="1">抽检</el-radio>
              </el-radio-group>
            </div>
            <div class="search-item" style="margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;">
              <label style="width: 70px;">样品编号</label>
              <el-input v-model="packageInfo.input" placeholder="请输入" size="small"></el-input>
            </div>
            <div
              style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;">
              <div class="search-item" style="margin-right: 10px;">
                <label>套管数目</label>
                <el-input v-model="packageInfo.input" placeholder="请输入" size="small"></el-input>
                <el-input v-model="packageInfo.num1" placeholder="请输入" size="small" @change="upNum"></el-input>
              </div>
              <div class="search-item" style="margin-right: 10px;">
                <label style="width: 70px;">标准量</label>
                <el-input v-model="packageInfo.input" placeholder="请输入" size="small"></el-input>
                <el-input v-model="packageInfo.num2" placeholder="请输入" size="small" @change="upNum"></el-input>
              </div>
              <div class="search-item">
                <label style="width: 70px;">检测量</label>
                <el-input v-model="packageInfo.input" placeholder="请输入" size="small"></el-input>
                <el-input v-model="packageInfo.num3" placeholder="请输入" size="small" @change="upNum" :disabled="packageInfo.radio===0"></el-input>
              </div>
            </div>
            <el-table ref="table0" :data="tableData" tooltip-effect="dark" style="width: 100%" height="150px"
              size="small" @selection-change="handleSelectionChange">
              <el-table-column type="selection" width="55">
            <el-table ref="table0" :data="bushing" tooltip-effect="dark" style="width: 100%" height="203px"
              size="small" @selection-change="handleSelectionChange1">
              <el-table-column type="selection" width="45">
              </el-table-column>
              <el-table-column label="管色标" show-overflow-tooltip>
                <template slot-scope="scope">{{ scope.row.date }}</template>
                <template slot-scope="scope">
                  <el-select v-model="scope.row.color" size="mini">
                    <el-option v-for="(color,i) in colors" :key="i" :label="color.lable" :value="color.value"></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column prop="name" label="标量" show-overflow-tooltip>
              <el-table-column prop="num2" label="标量" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="address" label="测试量" show-overflow-tooltip>
              <el-table-column prop="num3" label="测试量" show-overflow-tooltip>
              </el-table-column>
            </el-table>
          </div>
@@ -63,7 +63,7 @@
        <el-col :span="15">
          <div class="grid-content">
            <h5>检测项信息</h5>
            <el-table ref="table1" :data="tableData" tooltip-effect="dark" style="width: 100%" height="274px"
            <el-table ref="table1" :data="tableData" tooltip-effect="dark" style="width: 100%" height="282px"
              size="small" @selection-change="handleSelectionChange">
              <el-table-column type="selection" width="55">
              </el-table-column>
@@ -91,16 +91,12 @@
      <el-row :gutter="10">
        <el-col :span="12">
          <div class="grid-content">
            <h5>光纤带</h5>
            <div class="btns">
              <el-button size="small" type="primary">生成光纤带</el-button>
              <el-button size="small" type="primary">保存光纤带项目</el-button>
            </div>
            <h5>光纤带<el-button size="mini" type="primary" class="btns">生成光纤带</el-button></h5>
            <div
              style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;">
              style="display: flex;align-items: center;justify-content: space-between;margin:4px 0 6px 0;padding: 0 12px;box-sizing: border-box;">
              <div class="search-item" style="width: 50%;margin-right: 16px;">
                <label style="width: 80px;">纤带类型</label>
                <el-select v-model="tape.value" placeholder="请选择" size="small" style="width: 100%;">
                <el-select v-model="tape.value" placeholder="请选择" size="small" style="width: 100%;" :disabled="selectBushing.length===0">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
@@ -131,40 +127,41 @@
        </el-col>
        <el-col :span="12">
          <div class="grid-content">
            <h5>光纤</h5>
            <div class="btns">
              <el-button size="small" type="primary">光纤配色</el-button>
              <el-button size="small" type="primary">保存光纤项目</el-button>
            </div>
            <h5>光纤<el-button size="mini" type="primary" class="btns" @click="addFiber" :disabled="mireModel===null||mireStandard===null">光纤配色</el-button></h5>
            <div
              style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;">
              style="display: flex;align-items: center;justify-content: space-between;margin: 4px 0 6px 0;padding: 0 12px;box-sizing: border-box;">
              <div class="search-item" style="width: 50%;margin-right: 16px;">
                <label style="width: 80px;">光纤类型</label>
                <el-select v-model="tape.value" placeholder="请选择" size="small" style="width: 100%;">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                <el-select v-model="mireModel" placeholder="请选择" size="small" style="width: 100%;" :disabled="selectBushing.length===0">
                  <el-option v-for="(item,a) in mireModels" :key="a" :label="item.label" :value="item.value">
                  </el-option>
                </el-select>
              </div>
              <div class="search-item" style="width: 50%;">
                <label style="width: 80px;">参考标准</label>
                <el-select v-model="tape.value" placeholder="请选择" size="small" style="width: 100%;">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                <el-select v-model="mireStandard" placeholder="请选择" size="small" style="width: 100%;" :disabled="mireModel===null"
                @focus="selectsStandardMethodByFLSSM()" @change="(value)=>methodChange(value)">
                  <el-option v-for="item in mireStandards" :key="item.id" :label="item.code" :value="item.id">
                  </el-option>
                </el-select>
              </div>
            </div>
            <el-table ref="table3" :data="tableData" tooltip-effect="dark" style="width: 100%" height="270px"
            <el-table ref="table3" :data="fiberList" tooltip-effect="dark" style="width: 100%" height="270px"
              size="small" @selection-change="handleSelectionChange">
              <el-table-column type="selection" width="55">
              </el-table-column>
              <el-table-column label="管套色标" show-overflow-tooltip>
                <template slot-scope="scope">{{ scope.row.date }}</template>
              <el-table-column prop="bushColor" label="管套色标" width="90" align="center">
              </el-table-column>
              <el-table-column prop="name" label="光纤色标" show-overflow-tooltip>
              <el-table-column prop="color" label="光纤色标" width="120">
                <template slot-scope="scope">
                  <el-select v-model="scope.row.color" size="mini">
                    <el-option v-for="(color,i) in colors" :key="i" :label="color.lable" :value="color.value"></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column prop="address" label="光纤规格" show-overflow-tooltip>
              <el-table-column prop="model" label="光纤规格" show-overflow-tooltip align="center">
              </el-table-column>
              <el-table-column prop="address" label="参考标准" show-overflow-tooltip>
              <el-table-column prop="standard" label="参考标准" show-overflow-tooltip align="center">
              </el-table-column>
            </el-table>
          </div>
@@ -181,18 +178,175 @@
        saveLoad: false,
        packageInfo: {
          radio: 1,
          input: ''
          num1: null,
          num2: null,
          num3: null,
          ismiers: false
        },
        tableData: [],
        tape: {
          value: ''
        },
        options: []
        options: [],
        sample: [],
        models: '',
        colors: [],
        wires: [],
        bushing: [],
        mireModels: [],
        mireModel: null,
        mireStandard: [],
        mireStandards: null,
        selectBushing: [],
        productList: [],
        fiberList: []
      }
    },
    mounted() {
      this.$parent.sampleIds.forEach(a=>{
        for (var i = 0; i < this.$parent.sampleList.length; i++) {
          if (this.$parent.sampleList[i].id == a) {
            this.sample.push(this.$parent.sampleList[i])
            this.models+=(','+this.$parent.sampleList[i].model)
            break
          }
        }
      })
      this.models = this.models.replace(',','')
      this.getTypeDicts1()
      this.getTypeDicts2()
      this.getStandTreeBySampleType()
    },
    methods: {
      save() {},
      handleSelectionChange(val) {}
      handleSelectionChange(val) {},
      handleSelectionChange1(val){
        this.selectBushing = val
      },
      outConfig(){
        this.$parent.configShow = false
      },
      getTypeDicts1() {
          this.$axios.post(this.$api.enums.selectEnumByCategory, {
              category: "色标"
          }).then(res => {
          this.colors = res.data
          })
      },
      getTypeDicts2() {
          this.$axios.post(this.$api.enums.selectEnumByCategory, {
              category: "线芯"
          }).then(res => {
          this.wires = res.data
          })
      },
      upNum(){
        if(this.packageInfo.radio === 0){
          this.packageInfo.num3 = this.packageInfo.num2
        }
        if(parseInt(this.packageInfo.num2) < parseInt(this.packageInfo.num3)){
          this.packageInfo.num3 = this.packageInfo.num2
        }
        if(this.packageInfo.num1!==null&&this.packageInfo.num1!==''
        &&this.packageInfo.num2!==null&&this.packageInfo.num2!==''
        &&this.packageInfo.num3!=null&&this.packageInfo.num3!==''){
          let colors2 = []
          if(this.packageInfo.num1 / this.colors.length > 1){
            let num = this.packageInfo.num1 / this.colors.length
            if(this.packageInfo.num1 % this.colors.length > 0) num+=1
            for (var i = 0; i < num; i++) {
              colors2 = colors2.concat(this.colors)
            }
          }else{
            colors2 = colors2.concat(this.colors)
          }
          this.bushing = []
          for (var i = 0; i < this.packageInfo.num1; i++) {
            let bushing = {
              color: colors2[i].label,
              num2: this.packageInfo.num2,
              num3: this.packageInfo.num3,
              ismiers: this.packageInfo.ismiers,
              fibers: [],
              fiber: []
            }
            this.bushing.push(bushing)
          }
        }else{
          this.bushing = []
        }
      },
      getStandTreeBySampleType(){
        this.$axios.get(this.$api.standardTree.getStandTreeBySampleType).then(res=>{
          this.mireModels = []
          res.data.forEach(a=>{
            this.mireModels.push({
              label: a.model,
              value: a.sample + ' - ' + a.model
            })
          })
        })
      },
      selectsStandardMethodByFLSSM() {
        this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, {
          tree: '中天科技检测中心 - 通信产品实验室 - 光纤 - ' + this.mireModel
        }).then(res => {
          this.mireStandards = res.data.standardMethodList
        })
      },
      methodChange(val) {
        if(val===null||val==='')return
        this.$axios.post(this.$api.standardTree.selectStandardProductList, {
          model: this.mireModel.split(' - ')[1],
          standardMethodListId: val,
          factory: ''
        }, {
          headers: {
            'Content-Type': 'application/json'
          }
        }).then(res => {
          res.data.forEach(a => {
            a.state = 0
          })
          this.productList = res.data
          setTimeout(() => {
            this.productList.forEach(a => {
              if (a.state == 1) this.toggleSelection(a)
            })
          }, 200)
        })
      },
      addFiber(){
        let colors2 = []
        if(this.packageInfo.num1 / this.colors.length > 1){
          let num = this.packageInfo.num1 / this.colors.length
          if(this.packageInfo.num1 % this.colors.length > 0) num+=1
          for (var i = 0; i < num; i++) {
            colors2 = colors2.concat(this.colors)
          }
        }else{
          colors2 = colors2.concat(this.colors)
        }
        this.fiberList = []
        let model = this.mireModel.split(' - ')[1]
        let standard = this.mireStandards.find(a=>a.id == this.mireStandard).code
        this.selectBushing.forEach(a=>{
          for (var i = 0; i < a.num3; i++) {
            if(this.packageInfo.ismiers){
            }else{
              let fiber = {
                bushColor: a.color,
                color: colors2[i].label,
                model: model,
                standard: standard
              }
              a.fiber.push(fiber)
              this.fiberList.push(fiber)
            }
          }
        })
      }
    }
  }
</script>
src/components/view/b1-inspection-order.vue
@@ -77,7 +77,6 @@
                <el-row class="title">
                    <el-col :span="12" style="padding-left: 20px;">检验下单</el-col>
                    <el-col :span="12" style="text-align: right;">
            <el-button size="medium" type="primary" @click="playOrder(4)">光纤配置</el-button>
                        <el-button size="medium" type="primary" @click="playOrder(1)" v-if="addPower">下单</el-button>
                    </el-col>
                </el-row>
@@ -228,8 +227,7 @@
            </el-dialog>
        </div>
        <div style="width: 100%;height: 100%;" v-if="active >0">
            <Add :active="active" :currentId="currentId" v-show="active<4" />
      <fiberOpticConfig :currentId="currentId" v-if="active==4" />
            <Add :active="active" :currentId="currentId" v-if="active<4" />
        </div>
    </div>
</template>
@@ -237,12 +235,10 @@
<script>
    import ValueTable from '../tool/value-table.vue'
    import Add from '../do/b1-ins-order/add.vue'
  import fiberOpticConfig from '../do/b1-ins-order/fiberoptic-config.vue'
    export default {
        components: {
            ValueTable,
            Add,
      fiberOpticConfig
            Add
        },
        data() {
            return {
@@ -496,6 +492,7 @@
                let up = false
                let del = false
                let add = false
        let revoke = false
                for (var i = 0; i < power.length; i++) {
                    if (power[i].menuMethod == 'upInsOrder') {
                        up = true
@@ -503,10 +500,16 @@
                    if (power[i].menuMethod == 'addInsOrder') {
                        add = true
                    }
          if (power[i].menuMethod == 'updateStatus') {
              revoke = true
          }
                }
                if (!up) {
                    this.componentData.do.splice(4, 1)
                }
        if (!revoke) {
            this.componentData.do.splice(3, 1)
        }
                this.addPower = add
            },
            handleClose() {