qushaowei
2024-07-12 336dcb70c156c947530eab0f0a96ee17de477929
src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue
@@ -20,28 +20,29 @@
      >
        <div :key="col.dataIndex">
          <a-input
               :value="text"
               v-if="col.dataIndex == 'sparePartId'"
               auto-size
               placeholder="请输入物料名称"
               @change="(e)=>handleChange(e, record.key, col, index)"
               :disabled="record.disabled"
            :value="text"
            v-if="col.dataIndex == 'sparePartId'"
            auto-size
            placeholder="请输入物料名称"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="record.disabled"
          />
          <a-input
               :value="text"
               v-if="col.dataIndex == 'repairOrderAmUda1'"
               auto-size
               placeholder="请输入单位"
               @change="(e)=>handleChange(e, record.key, col, index)"
               :disabled="record.disabled"
            :value="text"
            v-if="col.dataIndex == 'repairOrderAmUda1'"
            auto-size
            placeholder="请输入单位"
            @change="(e)=>handleChange(e, record.key, col, index)"
            :disabled="record.disabled"
          />
          <j-dict-select-tag
                :value='text'
                v-if="col.dataIndex == 'outboundOrderId'"
                dictCode="material_type"
                :disabled="true"
                style="width: 100%;"
                @change='(e)=>handleChange(e, record.key, col, index)'/>
          <j-dict-select-tag
            :value='text'
            v-if="col.dataIndex == 'outboundOrderId'"
            dictCode="material_type"
            :disabled="false"
            style="width: 100%;"
            @change='(e)=>handleChange(e, record.key, col, index)'
          />
          <a-input-number
            :value="text"
            v-if="col.dataIndex == 'actualQuantity'"
@@ -95,8 +96,9 @@
      type="dashed"
      icon="plus"
      @click="addMaterial"
      :disabled="mainId.status!='3'||( mainId.repairOrderUda1!='needPart'&&mainId.repairOrderUda1!='needSpare')"
      :disabled="mainId.status!='3'"
    >添加实际用料</a-button>
    <!-- :disabled="mainId.status!='3'||( mainId.repairOrderUda1!='needPart'&&mainId.repairOrderUda1!='needSpare')" -->
    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
      <a-row :style="{textAlign:'right'}">
        <a-button
@@ -201,74 +203,39 @@
            return parseInt(index) + 1;
          }
        },
        // {
        //   title: '领料出库单',
        //   dataIndex: 'num',
        //   align: "center",
        //   width: 150,
        // },
        // {
        //   title: '备件编码',
        //   dataIndex: 'sparePartNum',
        //   align: "center",
        // },
        {
          title: '物料名称',
          dataIndex: 'sparePartId',
          scopedSlots: { customRender: 'sparePartId' },
          align: "center",
           className: 'red',
          width: 250,
          className: 'red',
          // width: 250,
        },
        {
          title: '物料种类',
          dataIndex: 'outboundOrderId',
          scopedSlots: { customRender: 'outboundOrderId' },
          align: "center",
          width: 250,
          // width: 250,
        },
        // {
        //   title: '型号',
        //   dataIndex: 'sparePartModel',
        //   align: "center",
        // },
        // {
        //   title: '制造商',
        //   dataIndex: 'constructorName',
        //   align: "center",
        // },
        {
          title: '单位',
          dataIndex: 'repairOrderAmUda1',
          scopedSlots: { customRender: 'repairOrderAmUda1' },
          align: "center",
          className: 'red',
          width: 250,
        },
        // {
        //   title: '主数量',
        //   align: 'center',
        //   dataIndex: 'mainQuantity'
        // },
        // {
        //   title: '可用数量',
        //   align: 'center',
        //   dataIndex: 'availableQuantity'
        // },
        {
          title: '使用数量',
          dataIndex: 'actualQuantity',
          align: "center",
          scopedSlots: { customRender: 'actualQuantity' },
          className: 'red',
          width: 250,
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 250,
          scopedSlots: { customRender: 'action' }
        }
      ],
@@ -286,7 +253,7 @@
  watch: {
    mainId: {
      immediate: true,
      deep:true,
      deep: true,
      handler(val) {
        console.log(val)
        if (!this.mainId.id) {
@@ -314,7 +281,8 @@
      // this.$refs.JSelectSparePartModal.showModals(ids);
      // this.$refs.JSelectSparePartModal.title = '选择备件信息'
      // this.$refs.JSelectSparePartModal.disableSubmit = false
      this.dataSource.push({ sparePartId: '', outboundOrderId: this.mainId.repairOrderUda1,repairOrderAmUda1: '', actualQuantity:'',repairOrderId:this.mainId.id })
      // this.dataSource.push({ sparePartId: '', outboundOrderId: this.mainId.repairOrderUda1, repairOrderAmUda1: '', actualQuantity: '', repairOrderId: this.mainId.id })
      this.dataSource.push({ sparePartId: '', outboundOrderId: '', repairOrderAmUda1: '', actualQuantity: '', repairOrderId: this.mainId.id })
    },
    handleCancel() {
      this.$bus.$emit('closeDrawer')
@@ -342,14 +310,17 @@
      //   this.dataSource = temp
      // }
      if ('sparePartId' == column.dataIndex) {
          target['sparePartId'] = value.target.value
        target['sparePartId'] = value.target.value
      }
      if ('repairOrderAmUda1' == column.dataIndex) {
          target['repairOrderAmUda1'] = value.target.value
      }
        target['repairOrderAmUda1'] = value.target.value
      }
      if ('actualQuantity' == column.dataIndex) {
        target['actualQuantity'] = value
      }
      }
      if ('outboundOrderId' == column.dataIndex) {
        target['outboundOrderId'] = value
      }
    },
    clearList() {
      this.dataSource = [];
@@ -448,6 +419,10 @@
            that.$message.warning('请填写第' + (i + 1) + '行使用数量!')
            return false
          }
          if (workHoursDataSource[i].outboundOrderId == undefined || workHoursDataSource[i].outboundOrderId == null || workHoursDataSource[i].outboundOrderId == '') {
            that.$message.warning('请填写第' + (i + 1) + '行物料种类!')
            return false
          }
        }
      }
      if (that.dataSource.length === 0) {