cuijian
2025-06-16 aa2f510e46e826b9851f9b5d21e642134d63e956
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" @change="handleTypeChange" type="list" v-model="model.outStorehouseType" dictCode="out_storehouse_type" placeholder="请选择出库类型"/>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -75,7 +75,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"
@@ -98,6 +99,21 @@
            @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"
          />
        </div>
      </template>
      <span slot="action" v-if="disableSubmit === false" slot-scope="text, record, index">
@@ -111,7 +127,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 +138,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 +147,8 @@
    name: "OutboundOrderModal",
    components: {
      OutboundDetailList,
      JSelectOutboundToolModal
      JSelectBorrowOutboundToolModal,
      JSelectSharpenOutboundToolModal
    },
    data () {
      return {
@@ -140,6 +159,7 @@
        isDisabled: false,
        addShow: true,
        selectBorrowTool: false,
        selectSharpenTool: false,
        model:{
        },
        labelCol: {
@@ -201,6 +221,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",
@@ -264,15 +296,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) {
@@ -296,7 +336,7 @@
          this.dataSource = temp
        }
      },
      selectOutBoundTool() {
      selectBorrowOutBoundTool() {
        console.log(this.dataSource)
        let ids = ''
        if (this.title === '新增') {
@@ -305,7 +345,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
@@ -322,16 +373,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
              }
            }
@@ -344,6 +399,7 @@
        this.$emit('close');
        this.addShow = true
        this.selectBorrowTool = false
        this.selectSharpenTool = false
        this.visible = false;
        this.$refs.form.clearValidate();
      },