loulijun2021
2023-03-06 5c5bc1e6e73a2b421fc5132796a081d5fdda6e36
src/views/zzmx/jpgj.vue
@@ -344,25 +344,29 @@
          />
          <el-table-column
            prop="eqpcode"
            label="设备编码"
            :label="eqpTable.steptype==='W'?'供应商编码':'设备编码'"
            sortable="custom"
            min-width="110"
            show-tooltip-when-overflow
            min-width="120"
          />
          <el-table-column
            prop="eqpname"
            label="设备名称"
            min-width="110"
            :label="eqpTable.steptype==='W'?'供应商名称':'设备名称'"
            min-width="120"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="wksp_name"
            sortable="custom"
            label="生产车间"
            show-tooltip-when-overflow
            min-width="110"
          />
          <el-table-column
            sortable="custom"
            prop="eqp_value"
            show-tooltip-when-overflow
            label="设备节拍"
            width="110"
          >
@@ -431,10 +435,10 @@
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button v-show="row.isVisible===1" type="text" @click="saveRow(row)">保存</el-button>
                <el-button v-show="row.isVisible===1" type="text" @click="cancelRow(row)">取消</el-button>
                <el-button v-show="row.isVisible===0" type="text" @click="editRow(row)">编辑</el-button>
                <el-button v-show="row.isVisible===0" type="text" @click="copyRow(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="copyRow(row)">复制</el-button>
              </div>
            </template>
          </el-table-column>
@@ -533,6 +537,7 @@
        partcode: '',
        routecode: '',
        stepcode: '',
        steptype: '',
        page: 1,
        rows: 10,
        prop: 'eqpcode',
@@ -669,11 +674,13 @@
    },
    async getEqpTable(val) {
      if (typeof val === 'string') {
        this.eqpTable.steptype = this.stepDialogArr.find(item => item.name === val).flag
        this.eqpTable.partcode = this.dialogForm.partcode
        this.eqpTable.routecode = this.dialogForm.routecode
        this.eqpTable.stepcode = this.stepDialogArr.find(item => item.name === val).code
        // } else if (typeof val === 'number') {
      } else {
        this.eqpTable.steptype = this.stepDialogArr[0].flag
        this.eqpTable.partcode = this.dialogForm.partcode
        this.eqpTable.routecode = this.dialogForm.routecode
        this.eqpTable.stepcode = this.stepDialogArr[0].code
@@ -691,6 +698,9 @@
    },
    // 保存行
    async saveRow(row) {
      if (parseFloat(row.unprice) <= 0 && this.eqpTable.steptype !== 'W') {
        return this.$message.info('计件单价必须大于零!')
      }
      const data = {
        partcode: this.eqpTable.partcode, //  产品编码
        routecode: this.eqpTable.routecode, //  工艺路线编码
@@ -714,6 +724,8 @@
    // 取消行
    cancelRow(row) {
      this.getEqpTable()
      this.radioChange(this.radioChangeTempValue)
      this.dialogForm.stepcode = this.radioChangeTempValue
      this.isEqpTableEdit = true
    },
    // 编辑行