loulijun2021
2022-12-20 b58dc818feacbfc6bf01453b0db8ad3306c8d6dd
src/views/zzmx/wlqd.vue
@@ -3,7 +3,7 @@
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <!--        <el-button icon="el-icon-download" @click="upload">导入</el-button>-->
        <el-button icon="el-icon-download" @click="upload">导入</el-button>
      </div>
      <div class="bodyTopFormGroup">
@@ -172,6 +172,7 @@
            prop="startdate"
            label="启用日期"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          >
            <template slot-scope="{row}">
@@ -196,6 +197,7 @@
          <el-table-column
            prop="lm_date"
            label="创建时间"
            show-tooltip-when-overflow
            width="110"
            sortable="custom"
          >
@@ -269,6 +271,7 @@
              placeholder="请选择"
              :popper-append-to-body="false"
              :disabled="operation!=='add'"
              filterable
              @change="partSelectChange"
            >
              <el-option
@@ -284,6 +287,7 @@
              v-model="dialogForm.parentpartname"
              style="width: 200px"
              placeholder="请选择"
              filterable
              :disabled="operation!=='add'"
              :popper-append-to-body="false"
              @change="partSelectChange"
@@ -312,24 +316,10 @@
            <!--            />-->
            <!--          </el-select>-->
          </el-form-item>
          <el-form-item label="计量单位" prop="uomcode">
            <el-select
              v-model="dialogForm.uomcode"
              disabled
              style="width: 200px"
              placeholder="请选择"
              :popper-append-to-body="false"
            >
              <el-option
                v-for="item in openTypeArr"
                :key="item.partcode"
                :label="item.uom_code"
                :value="item.partcode"
              />
            </el-select>
            <!--            <el-input v-model="dialogForm.uomcode" readonly style="width: 200px" />-->
          <el-form-item label="计量单位">
            <el-input v-model="dialogForm.uomname" disabled style="width: 200px" />
          </el-form-item>
          <!--          <el-form-item label="存货类型" prop="uomcode">-->
          <!--          <el-form-item label="存货类型">-->
          <!--            <el-input v-model="dialogForm.chlx" readonly style="width: 200px" />-->
          <!--          </el-form-item>-->
          <el-form-item label="基础数量" prop="quantity">
@@ -344,6 +334,7 @@
            <el-select
              v-model="dialogForm.status"
              style="width: 200px"
              filterable
              placeholder="请选择"
              :disabled="operation==='preview'"
              :popper-append-to-body="false"
@@ -412,6 +403,7 @@
            <el-select
              v-if="row.isVisible===1"
              v-model="row.SMATERIRL_CODE"
              filterable
              placeholder="请选择"
              @change="val=>tableChange(val,row)"
            >
@@ -428,7 +420,7 @@
        <el-table-column
          prop="SMATERIRL_NAME"
          label="子件名称"
          filterable
          show-tooltip-when-overflow
        >
@@ -456,14 +448,16 @@
          show-tooltip-when-overflow
        />
        <el-table-column
          prop="uomcode"
          prop="uomname"
          label="计量单位"
          width="110"
          show-tooltip-when-overflow
        />
        <el-table-column
          prop="BASE_QUANTITY"
          label="基本用量"
          width="110"
          show-tooltip-when-overflow
        >
          <template slot-scope="{row}">
            <el-input
@@ -479,6 +473,7 @@
        <el-table-column
          prop="LOSS_QUANTITY"
          label="损耗率%"
          show-tooltip-when-overflow
          width="110"
        >
          <template slot-scope="{row}">
@@ -495,11 +490,13 @@
        <el-table-column
          prop="TOTAL_QUANTITY"
          label="实际用量"
          show-tooltip-when-overflow
          width="110"
        />
        <el-table-column
          prop="PN_TYPE"
          label="属性"
          show-tooltip-when-overflow
          width="110"
        >
          <template slot-scope="{row}">
@@ -618,6 +615,7 @@
        parentpartname: '',
        parentpartspec: '',
        uomcode: '',
        uomname: '',
        // chlx: '',
        quantity: '',
        status: '',
@@ -641,9 +639,6 @@
        quantity: [
          { required: true, message: '请输入基础数量', trigger: ['blur', 'change'] }
        ],
        // uomcode: [
        //   { required: true, message: '请输入计量单位', trigger: ['blur', 'change'] }
        // ],
        // version: [
        //   { required: true, message: '请输入版本号', trigger: ['blur', 'change'] }
        // ],
@@ -660,8 +655,8 @@
        { code: 'F', name: '辅料' }
      ],
      title_value: '数据导入 / 点检部位',
      code: '4',
      title_value: '数据导入 / 物料清单',
      code: '21',
      shows: false
    }
@@ -731,7 +726,8 @@
      this.dialogForm.parentpartcode = res.partcode
      this.dialogForm.parentpartname = res.partname
      this.dialogForm.parentpartspec = res.partspec
      this.dialogForm.uomcode = res.uom_code
      // this.dialogForm.uomcode = res.uom_code
      this.dialogForm.uomname = res.uom_name
      if (this.PartSelectArrTemp.length > 0) {
        this.PartSelectArr.unshift(this.PartSelectArrTemp[0])
@@ -795,7 +791,6 @@
      this.getPartSelect()
      this.dialogForm.startdate = handleDatetime(new Date())
      console.log(this.dialogForm.startdate, 7)
    },
    // 修改按钮
    async edit(operation, row) {
@@ -821,7 +816,8 @@
            SMATERIRL_CODE: item.partcode,
            SMATERIRL_NAME: item.partname,
            SMATERIRL_SPEC: item.partspec,
            uomcode: item.uom_name,
            uomcode: item.uom_code,
            uomname: item.uom_name,
            BASE_QUANTITY: item.base_quantity,
            LOSS_QUANTITY: item.loss_quantity,
            TOTAL_QUANTITY: item.total_quantity,
@@ -836,6 +832,7 @@
          this.dialogForm.parentpartname = row.partname
          this.dialogForm.parentpartspec = row.partspec
          this.dialogForm.uomcode = row.uom_code
          this.dialogForm.uomname = row.uom_name
          this.dialogForm.startdate = row.startdate
          this.dialogForm.status = row.status
          this.dialogForm.quantity = row.quantity
@@ -859,6 +856,7 @@
      row.SMATERIRL_NAME = res.partname
      row.SMATERIRL_SPEC = res.partspec
      row.uomcode = res.uom_code
      row.uomname = res.uom_name
      // this.PartSelectArr.forEach((item, index) => {
      //   this.PartSelectArr.splice(index, 1)
@@ -885,6 +883,7 @@
        SMATERIRL_NAME: '',
        SMATERIRL_SPEC: '',
        uomcode: '',
        uomname: '',
        BASE_QUANTITY: '',
        LOSS_QUANTITY: '',
        TOTAL_QUANTITY: '',
@@ -961,6 +960,7 @@
      this.dialogForm.parentpartname = ''
      this.dialogForm.parentpartspec = ''
      this.dialogForm.uomcode = ''
      this.dialogForm.uomname = ''
      // this.dialogForm.chlx = ''
      this.dialogForm.quantity = ''
      this.dialogForm.status = ''
@@ -989,7 +989,7 @@
            parentpartcode: this.dialogForm.parentpartcode,
            parentpartname: this.dialogForm.parentpartname,
            parentpartspec: this.dialogForm.parentpartspec,
            uomcode: this.dialogForm.uomcode,
            uomcode: this.PartSelectArrTemp.length > 0 ? this.PartSelectArrTemp[0].uom_code : this.dialogForm.uomcode,
            quantity: this.dialogForm.quantity,
            status: this.dialogForm.status,
            startdate: this.dialogForm.startdate,
@@ -997,6 +997,7 @@
            worklist: this.dialogTableDataArr,
            opertype: this.operation === 'add' ? 'Add' : 'Update'
          }
          // console.log(data)
          this.$store.state.app.buttonIsDisabled = true
          AddUpdateBoIventory(data).then(res => {