qushaowei
2024-07-12 336dcb70c156c947530eab0f0a96ee17de477929
src/views/eam/modules/repairorder/moudles/RepairOrderActualMaterialReport.vue
@@ -39,9 +39,10 @@
                :value='text'
                v-if="col.dataIndex == 'outboundOrderId'"
                dictCode="material_type"
                :disabled="true"
            :disabled="false"
                style="width: 100%;"
                @change='(e)=>handleChange(e, record.key, col, index)'/>
            @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,
          // 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' }
        }
      ],
@@ -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')
@@ -349,6 +317,9 @@
      } 
      if ('actualQuantity' == column.dataIndex) {
        target['actualQuantity'] = value
      }
      if ('outboundOrderId' == column.dataIndex) {
        target['outboundOrderId'] = value
      } 
    },
    clearList() {
@@ -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) {