loulijun2021
2022-10-15 ab263c5fb0e0b273563391bd0c2d7b3710b03d4c
src/views/zzmx/wlqd.vue
@@ -15,7 +15,7 @@
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label-width="70px" label="母件编码" style=" display: flex;">
            <el-form-item label="母件编码" label-width="70px" style=" display: flex;">
              <el-input v-model="form.parentpartcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="母件名称" style=" display: flex;">
@@ -503,7 +503,13 @@
          width="110"
        >
          <template slot-scope="{row}">
            <el-select v-if="row.isVisible===1" v-model="row.PN_TYPE" placeholder="请选择">
            <el-select
              v-if="row.isVisible===1"
              v-model="row.PN_TYPE"
              :disabled="row.PN_TYPE==='Z'"
              placeholder="请选择"
              @change="val=>changeType(val,row)"
            >
              <el-option
                v-for="item in sxArr"
                :key="item.code"
@@ -522,7 +528,7 @@
        >
          <template slot-scope="{row}">
            <div class="operationClass">
              <el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">保存</el-button>
              <el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">确定</el-button>
              <el-button v-if="row.isVisible===1" type="text" @click="cancelRow(row)">取消</el-button>
              <el-button v-if="row.isVisible===0" type="text" @click="editRow(row)">编辑</el-button>
              <el-button v-if="row.isVisible===0" type="text" @click="delRow(row)">删除</el-button>
@@ -541,7 +547,7 @@
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >确 定</el-button>
          >保存</el-button>
        </div>
      </span>
    </el-dialog>
@@ -678,7 +684,6 @@
    handleRequest() {
      this.getBoIventorySelect().then(res => {
        if (res.code === '200') {
          // this.getPartSelect()
          this.getStockTypeSelect()
        }
      })
@@ -859,6 +864,12 @@
      //   this.PartSelectArr.splice(index, 1)
      // })
    },
    // 物料清单属性类型值改变时触发
    changeType(val, row) {
      this.dialogTableDataArr.forEach(item => {
        item.PN_TYPE = item.SMATERIRL_CODE === row.SMATERIRL_CODE ? 'Z' : 'F'
      })
    },
    addDialog() {
      if (this.dialogTableDataArr.find(item => item.isVisible === 1)) {
        return this.$message.info('请先保存本条记录!')
@@ -877,7 +888,7 @@
        BASE_QUANTITY: '',
        LOSS_QUANTITY: '',
        TOTAL_QUANTITY: '',
        PN_TYPE: ''
        PN_TYPE: this.dialogTableDataArr.length === 0 ? 'Z' : 'F'
      })
    },
    saveRow(row) {
@@ -906,6 +917,10 @@
      })
    },
    delRow(row) {
      if (row.PN_TYPE === 'Z') {
        return this.$message.info('主料不可删除!')
      }
      this.PartSelectArrAll.forEach(item => {
        if (item.partcode === row.SMATERIRL_CODE) {
          this.PartSelectArr.unshift(item)
@@ -982,7 +997,7 @@
            worklist: this.dialogTableDataArr,
            opertype: this.operation === 'add' ? 'Add' : 'Update'
          }
          console.log(data, 89)
          this.$store.state.app.buttonIsDisabled = true
          AddUpdateBoIventory(data).then(res => {
            if (res.code === '200') {