cuijian
2025-06-05 34feb4908ec7b7e5b51adf6355603978c67bd3a4
src/views/tms/modules/inboundOrder/InboundOrderModel.vue
@@ -55,7 +55,7 @@
                v-if="!barcodeCurrentType"
                placeholder="请选择经手人"
                v-decorator="['handler', { rules: [{ required: false, message: '请选择经手人' }] }]"
                dict="sys_user,realname,id,del_flag=0"
                dict="sys_user,realname,username,del_flag=0"
                @change="selectCurrentUserChange"
              />
            </a-form-item>
@@ -64,10 +64,10 @@
          <a-col :span="24 / 2">
            <a-form-item label="审核人" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-search-select-tag
                :disabled="true"
                :disabled="disableSubmit"
                placeholder="请选择审核人"
                v-decorator="['reviewer', validatorRules.reviewer]"
                dict="sys_user,realname,id,del_flag=0"
                dict="sys_user,realname,username,del_flag=0"
                @change="selectCurrentUserChange"
              />
            </a-form-item>
@@ -127,7 +127,7 @@
        <div :key="col.dataIndex">
          <a-input-number
            v-if="col.dataIndex == 'inStorageQuantity'"
            :disabled="quantityDisable"
            :disabled="record.accuracyClass == '1'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
@@ -166,6 +166,7 @@
import { filterObj } from '@/utils/util'
import JSelectReturnListModal from './JSelectReturnListModal'
import JSelectSharpenListModal from './JSelectSharpenListModal'
import store from '@/store'
export default {
  name: 'InboundOrderModel',
@@ -176,6 +177,7 @@
    JSelectReturnListModal,
    JSearchSelectTag,
    JSelectSharpenListModal,
    store
  },
  data() {
    return {
@@ -259,6 +261,14 @@
            },
          ],
        },
        reviewer: {
          rules: [
            {
              required: true,
              message: '请选择审核人!',
            },
          ],
        },
      },
      url: {
        add: '/tms/inboundOrder/add',
@@ -326,6 +336,7 @@
      return filterObj(this.param)
    },
    add() {
      this.handle = store.getters.userInfo.username
      this.edit({})
    },
    edit(record) {
@@ -346,7 +357,6 @@
        this.inboundOrderId = record.id
        this.detailList(this.inboundOrderId)
      }
      this.initOptions()
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'inboundNum', 'inStorehouseType', 'inboundTime', 'applicationReason', 'handler','approvalDate','reviewer','approvalOpinion','remark')
@@ -359,6 +369,14 @@
      const target = temp.filter(item => key === item.key)[index];
      if (target) {
        target[column.dataIndex] = value
        if(column.dataIndex === 'inStorageQuantity'){
          if(target['quantity']<value){
            this.$message.error('入库数量不能大于出库数量!')
            this.isDisabled = true
          }else{
            this.isDisabled = false
          }
        }
        this.dataSource = temp
      }
    },
@@ -417,7 +435,7 @@
    selectTooling: function () {
      let ids = []
      for (let i = 0; i < this.dataSource.length; i++) {
        ids.push(this.dataSource[i].toolCodeId)
        ids.push(this.dataSource[i].id)
      }
      this.$refs.toolingModalForm.showModal(ids)
      this.$refs.toolingModalForm.title = '选择工具'
@@ -447,14 +465,6 @@
      this.dataSource.splice(index, 1)
    },
    onChange() {},
    //控制扫码或手选
    selectCurrentUserType(e) {
      if (e == '0') {
        this.barcodeCurrentType = true
      } else {
        this.barcodeCurrentType = false
      }
    },
    //手选人员值
    selectCurrentUserChange(e) {
      console.log('当前手选', e)
@@ -492,52 +502,12 @@
      }
      
    },
    //添加工具按钮
    addTooling() {
      const temp = [...this.dataSource];
      temp.push({ indexId: temp.length + 1 });
      this.dataSource = temp;
    },
    detailList(inboundOrderId) {
      this.param.inboundOrderId = inboundOrderId
      getAction(this.url.detailList, this.getQueryParams()).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total;
        }
      })
    },
    initOptions() {
      ajaxGetDictItems("mes_base_warehouse,name,id,del_flag!='1' order by num asc", null).then((res) => {
        if (res.success) {
          if (res.result) {
            for (let i = 0; i < res.result.length; i++) {
              res.result[i].label = res.result[i].title;
            }
          }
          this.warehouseOptions = res.result;
        }
      })
      ajaxGetDictItems("mes_base_storage_area,name,id,del_flag!='1'", null).then((res) => {
        if (res.success) {
          if (res.result) {
            for (let i = 0; i < res.result.length; i++) {
              res.result[i].label = res.result[i].title;
            }
          }
          this.locationOptions = res.result;
        }
      })
       ajaxGetDictItems("mes_base_tooling,num,id,del_flag!='1'", null).then((res) => {
        if (res.success) {
          if (res.result) {
            for (let i = 0; i < res.result.length; i++) {
              res.result[i].label = res.result[i].title;
              res.result[i].toolingName = res.result[i].name
            }
          }
          this.toolingOptions = res.result;
        }
      })
    },
@@ -553,13 +523,16 @@
      //getCurrSelected 事件 接收组件传递的参数
      for (let i = 0; i < data.length; i++) {
        this.dataSource.push({
          toolCodeId:data[i].id,
          id:data[i].id,
          toolCodeId: data[i].toolCodeId,
          toolCode: data[i].toolCode,
          chineseName: data[i].chineseName || data[i].toolName,
          chineseName: data[i].chineseName,
          toolModel: data[i].toolModel,
          applicationType: data[i].applicationTypeName,
          onlyCode:data[i].toolNum,
          inStorageQuantity:data[i].storageQuantity || data[i].quantity
          onlyCode:data[i].onlyCode,
          quantity:data[i].quantity,
          inStorageQuantity:data[i].storageQuantity || data[i].quantity,
          accuracyClass:data[i].accuracyClass
        })
      }
      //this.ipaginationm.total = this.dataSource.length