loulijun2021
2023-04-28 6c850cd09c1af59ec7977042cea8453d01d9b15e
src/views/zzmx/jpgj.vue
@@ -16,21 +16,20 @@
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label-width="70px" label="产品名称" style=" display: flex;">
            <el-form-item label="产品名称/编码" style=" display: flex;">
              <el-select
                v-model="form.partcode"
                filterable
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
                @change="partChange"
              >
                <!--                @focus="getPartSelect"-->
                <el-option
                  v-for="item in partArr"
                  :key="item.partcode"
                  :label="item.partname"
                  :label="item.partname+' / '+item.partcode"
                  :value="item.partcode"
                />
              </el-select>
@@ -131,8 +130,9 @@
          <el-table-column
            prop="partname"
            label="产品名称"
            min-width="160"
            min-width="300"
            sortable="custom"
            show-tooltip-when-overflow
          />
          <el-table-column
            prop="partspec"
@@ -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
    },
    // 编辑行