qushaowei
2023-08-21 f5e8a1a00baf276c281d4a6335b2d39a8beba91a
src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue
@@ -20,6 +20,7 @@
            >
              <a-input
                placeholder="请输申请单编码"
                :disabled="disableSubmit"
                v-decorator="['num', validatorRules.num]"
              />
            </a-form-item>
@@ -30,12 +31,21 @@
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-select
              <a-tree-select
                style="width: 100%"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择领用部门"
                tree-default-expand-all
                v-decorator="['departId', validatorRules.departId]"
              />
<!--              <a-select
                :placeholder="'请选择领用部门'"
                :disabled="disableSubmit"
                :options="this.departs"
                style="width: 100%"
                v-decorator="['departId', validatorRules.departId]"
              />
              />-->
<!--              <j-dict-select-tag
                allow-clear
                :disabled="disableSubmit"
@@ -85,6 +95,7 @@
    </a-spin>
    <a-button
      type="primary"
      :disabled="disableSubmit"
      :style="{ marginRight: '8px',marginBottom:'8px' }"
      :loading="confirmLoading"
      @click="selectSparePartInventory()"
@@ -106,8 +117,10 @@
        <div :key="col.dataIndex">
          <a-input-number
            :value="text"
            v-if="col.dataIndex == 'outboundMainQuantity'"
            :min="0"
            :disabled="disableSubmit"
            :max="record.mainQuantity"
            @change="(e)=>handleChange(e, record.key, col, index)"
          />
@@ -117,9 +130,12 @@
      <span
        slot="action"
        slot-scope="text, record, index"
      >
        <a-popconfirm
          title="确定删除吗?"
          :disabled="disableSubmit"
          @confirm="() => handleDelete(text,record, index)"
        >
          <a>删除</a>
@@ -136,6 +152,7 @@
      <a-button
        @click="handleOk()"
        :disabled="disableSubmit"
        type="primary"
        :loading="confirmLoading"
      >确定</a-button>
@@ -162,6 +179,8 @@
  },
  data() {
    return {
      disabled:false,
      treeData:[],
      departs: [],
      columns: [
        {
@@ -307,6 +326,7 @@
      },
      url: {
        add: "/spare/sparePartOutbound/add",
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getSysDeparts: "/eam/equipment/getSysDeparts",
        edit: "/spare/sparePartOutbound/edit",
      },
@@ -348,7 +368,6 @@
  },
created() {
  this.getSysDeparts();
},
  methods: {
    getSysDeparts() {
@@ -384,6 +403,7 @@
      that.form.resetFields();
      that.model = Object.assign({}, record);
      that.visible = true;
      that.initOptions()
      that.warehouseId = record.warehouseId
      if (record.sparePartOutboundDetailList != undefined) {
        const temp = [...record.sparePartOutboundDetailList];
@@ -398,7 +418,15 @@
        this.codeDisable = false;
      }
    },
    initOptions() {
      getAction(this.url.loadOptions).then(res => {
        if (res.success) {
          this.treeData = res.result
        } else {
          this.$message.warning(res.message)
        }
      })
    },
    close() {
      this.$emit('close');
      this.visible = false;