cuilei
2025-06-16 1b8b8bafca4fe4c3556bda5e66e3ff6252bd7acc
src/views/tms/modules/outBound/OutboundOrderModal.vue
@@ -18,7 +18,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="出库类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outStorehouseType">
              <j-dict-select-tag :disabled="disableSubmit" @change="handleTypeChange" type="list" v-model="model.outStorehouseType" dictCode="out_storehouse_type" placeholder="请选择出库类型" />
              <j-dict-select-tag :disabled="disableSubmit || addShow" @change="handleTypeChange" type="list" v-model="model.outStorehouseType" dictCode="out_storehouse_type" placeholder="请选择出库类型"/>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -36,8 +36,56 @@
        </a-row>
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="零件图号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partDrawingNo">
              <a-input :disabled="disableSubmit" v-model="model.partDrawingNo" placeholder="请输入零件图号" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="零件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partName">
              <a-input :disabled="disableSubmit" v-model="model.partName" placeholder="请输入零件名称" ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="零件材料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partMaterial">
              <a-input :disabled="disableSubmit" v-model="model.partMaterial" placeholder="请输入零件材料" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工序(工步号)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionProcessesNo">
              <a-input :disabled="disableSubmit" v-model="model.productionProcessesNo" placeholder="请输入工序(工步号)" ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="加工批次" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchCode">
              <a-input :disabled="disableSubmit" v-model="model.batchCode" placeholder="请输入加工批次" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="加工数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="machiningCount">
              <a-input-number :disabled="disableSubmit" v-model="model.machiningCount" placeholder="请输入加工数量" :min="1" style="width: 100%"></a-input-number>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="加工设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentCode">
              <a-input :disabled="disableSubmit" v-model="model.equipmentCode" placeholder="请输入加工设备" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="程序名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ncName">
              <a-input :disabled="disableSubmit" v-model="model.ncName" placeholder="请输入程序名" ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="审核人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="reviewer">
              <j-select-user-by-dep :disabled="disableSubmit" v-model="model.reviewer" :store="'id'" :text="'realname'" :multi="false" />
              <j-select-user-by-dep :disabled="disableSubmit" v-model="model.reviewer" :store="'username'" :text="'realname'" :multi="false" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -54,7 +102,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item v-if="addShow" label="审核时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="auditDate">
              <j-date placeholder="请选择审核时间" v-model="model.auditDate" style="width: 100%" disabled/>
              <j-date placeholder="请选择审核时间" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" v-model="model.auditDate" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -75,7 +123,8 @@
      </a-form-model>
    </a-spin>
    <a-button v-show="selectBorrowTool" type="primary" :style="{ marginBottom: '8px' }" @click="selectOutBoundTool">选择出库工具</a-button>
    <a-button v-show="selectBorrowTool" type="primary" :style="{ marginBottom: '8px' }" @click="selectBorrowOutBoundTool">选择出库工具</a-button>
    <a-button v-show="selectSharpenTool" type="primary" :style="{ marginBottom: '8px' }" @click="selectSharpenOutBoundTool">选择刃磨工具</a-button>
    <a-table
      ref="table"
      size="middle"
@@ -93,7 +142,22 @@
        <div :key="col.dataIndex">
          <a-input-number
            v-if="col.dataIndex === 'outboundQuantity'"
            :disabled="record.quantity <= 1"
            :disabled="record.accuracyClass === '1'"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
          />
          <a-input-number
            v-if="col.dataIndex === 'ratedLife'"
            :disabled="record.quantity > 1"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
          />
          <a-input-number
            v-if="col.dataIndex === 'useLife'"
            :disabled="record.quantity > 1"
            :value="text"
            @change="(e) => handleChange(e, record.key, col, index)"
            :min="1"
@@ -111,7 +175,8 @@
      <a-button @click="handleOk" :disabled="isDisabled" type="primary">确定</a-button>
    </template>
    <j-select-outbound-tool-modal ref="selectOutBoundToolModal"></j-select-outbound-tool-modal>
    <j-select-borrow-outbound-tool-modal ref="selectBorrowOutBoundToolModal"></j-select-borrow-outbound-tool-modal>
    <j-select-sharpen-outbound-tool-modal ref="selectSharpenOutBoundToolModal"></j-select-sharpen-outbound-tool-modal>
  </j-modal>
</template>
@@ -121,7 +186,8 @@
  import { httpAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  import OutboundDetailList from '../../OutboundDetailList.vue'
  import JSelectOutboundToolModal from './JSelectOutboundToolModal.vue'
  import JSelectBorrowOutboundToolModal from './JSelectBorrowOutboundToolModal.vue'
  import JSelectSharpenOutboundToolModal from './JSelectSharpenOutboundToolModal.vue'
  import { getAction } from '../../../../api/manage'
  import title from 'ant-design-vue/lib/skeleton/Title'
@@ -129,7 +195,8 @@
    name: "OutboundOrderModal",
    components: {
      OutboundDetailList,
      JSelectOutboundToolModal
      JSelectBorrowOutboundToolModal,
      JSelectSharpenOutboundToolModal
    },
    data () {
      return {
@@ -140,6 +207,7 @@
        isDisabled: false,
        addShow: true,
        selectBorrowTool: false,
        selectSharpenTool: false,
        model:{
        },
        labelCol: {
@@ -201,6 +269,18 @@
            align:"center",
            dataIndex: 'outboundLocation'
          },
        //    {
        //   title:'额定寿命',
        //   align:"center",
        //   dataIndex: 'ratedLife',
        //   scopedSlots: { customRender: 'ratedLife' },
        // },
        // {
        //   title:'使用寿命',
        //   align:"center",
        //   dataIndex: 'useLife',
        //   scopedSlots: { customRender: 'useLife' },
        // },
          // {
          //   title:'出库状态;1.未出库;2.部分出库;3.出库完成',
          //   align:"center",
@@ -218,10 +298,16 @@
        confirmLoading: false,
        validatorRules: {
           outStorehouseType: [
              { required: true, message: '请输入出库类型!'},
              { required: true, message: '请选择出库类型!'},
           ],
           subjectMatter: [
              { required: true, message: '请输入领用事由!'},
           ],
          reviewer: [
              { required: true, message: '请选择审核人!'},
           ],
          outboundTime: [
              { required: true, message: '请选择出库时间!'},
           ],
        },
        url: {
@@ -248,7 +334,8 @@
            outboundQuantity: data[i].quantity,
            storageLocation: data[i].warehouseId,
            warehouseName: data[i].warehouseName,
            outboundLocation: data[i].positionCode
            outboundLocation: data[i].positionCode,
            accuracyClass:data[i].accuracyClass
          })
        }
        this.ipagination.total = this.dataSource.length
@@ -258,15 +345,23 @@
      handleTypeChange(value) {
        if (value === '1') {
          this.selectBorrowTool = true
          this.selectSharpenTool = false
          this.dataSource = []
        }
        if (value === '2') {
          this.selectBorrowTool = false
          this.selectSharpenTool = false
          this.dataSource = []
        }
        if (value === '3') {
          this.selectBorrowTool = false
          this.selectSharpenTool = false
          this.dataSource = []
        }
        if (value === '4') {
          this.selectBorrowTool = false
          this.selectSharpenTool = true
          this.dataSource = []
        }
      },
      handleDelete(record, index) {
@@ -290,7 +385,7 @@
          this.dataSource = temp
        }
      },
      selectOutBoundTool() {
      selectBorrowOutBoundTool() {
        console.log(this.dataSource)
        let ids = ''
        if (this.title === '新增') {
@@ -299,7 +394,18 @@
        if (this.title === '编辑') {
         ids = this.dataSource.map(item => item.toolLedgerDetailId).join(',')
        }
        this.$refs.selectOutBoundToolModal.showModal(ids)
        this.$refs.selectBorrowOutBoundToolModal.showOrderModal(ids)
      },
      selectSharpenOutBoundTool() {
        console.log(this.dataSource)
        let ids = ''
        if (this.title === '新增') {
          ids = this.dataSource.map(item => item.id).join(',')
        }
        if (this.title === '编辑') {
          ids = this.dataSource.map(item => item.toolSharpeningId).join(',')
        }
        this.$refs.selectSharpenOutBoundToolModal.showOrderModal(ids)
      },
      add () {
        this.addShow = false
@@ -316,16 +422,20 @@
              const type = record.outStorehouseType
              switch (type) {
                case '1':
                  this.handleTypeChange('1')
                  this.selectBorrowTool = true
                  this.selectSharpenTool = false
                  break
                case '2':
                  this.handleTypeChange('2')
                  this.selectBorrowTool = false
                  this.selectSharpenTool = false
                  break
                case '3':
                  this.handleTypeChange('3')
                  this.selectBorrowTool = false
                  this.selectSharpenTool = false
                  break
                case '4':
                  this.handleTypeChange('4')
                  this.selectBorrowTool = false
                  this.selectSharpenTool = true
                  break
              }
            }
@@ -338,6 +448,7 @@
        this.$emit('close');
        this.addShow = true
        this.selectBorrowTool = false
        this.selectSharpenTool = false
        this.visible = false;
        this.$refs.form.clearValidate();
      },
@@ -349,6 +460,10 @@
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            if (this.dataSource == null || this.dataSource.length === 0) {
              this.$message.warning('请选择出库工具!');
              return
            }
            this.model.outboundDetailList = this.dataSource
            that.confirmLoading = true;
            let httpurl = '';