zenglf
2023-09-19 3457909638c660c0cfcb521b6104ab64c679b914
src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue
@@ -19,7 +19,7 @@
              :wrapperCol='wrapperCol'
            >
              <a-input
                :disabled="disableSubmit"
                :disabled="true"
                placeholder='请输单据号'
                v-decorator="['num', validatorRules.num]"
              />
@@ -31,19 +31,12 @@
              :labelCol='labelCol'
              :wrapperCol='wrapperCol'
            >
<!--              <j-dict-select-tag
                allow-clear
                :disabled='disableSubmit'
                :placeholder="disableSubmit?'':'请选择领用部门'"
                :triggerChange='true'
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-decorator="['departId', validatorRules.departId]"
              />-->
              <a-select
                :placeholder="'请选择领用部门'"
                :options="this.departs"
                :disabled="disableSubmit"
              <a-tree-select
                style="width: 100%"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择领用部门"
                tree-default-expand-all
                v-model='model.departId'
              />
            </a-form-item>
@@ -172,6 +165,7 @@
  data() {
    return {
      departId:[],
      treeData:[],
      columns: [
        {
          title: '#',
@@ -237,7 +231,7 @@
          dataIndex: 'warehouseLocationNum'
        },
        {
          title: '主单位',
          title: '单位',
          align: 'center',
          dataIndex: 'mainUnitName'
        },
@@ -246,11 +240,11 @@
          align: 'center',
          dataIndex: 'outboundMainQuantity'
        },
        {
        /* {
          title: '辅单位',
          align: 'center',
          dataIndex: 'auxiliaryUnitName'
        },
        }, */
        {
          title: '退库数量',
          align: 'center',
@@ -310,6 +304,8 @@
      url: {
        add: '/spare/sparePartCancellingStocks/add',
        getSysDeparts: "/eam/equipment/getSysDeparts",
        getNum: '/eam/sysIdentity/getNumNew',
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        edit: '/spare/sparePartCancellingStocks/edit'
      },
@@ -332,9 +328,6 @@
          model: data[i].model,
          mainUnitId: data[i].mainUnitId,
          mainUnitName: data[i].mainUnitName,
          auxiliaryUnitId: data[i].auxiliaryUnitId,
          auxiliaryUnitName: data[i].auxiliaryUnitName,
          conversionRatio: data[i].conversionRatio,
          constructorId: data[i].constructorId,
          constructorName: data[i].constructorName,
          supplierId: data[i].supplierId,
@@ -350,10 +343,18 @@
    })
  },
  created() {
    this.getSysDeparts()
  },
  methods: {
    initOptions() {
      getAction(this.url.loadOptions).then(res => {
        if (res.success) {
          this.treeData = res.result
        } else {
          this.$message.warning(res.message)
        }
      })
    },
    getSysDeparts() {
      getAction(this.url.getSysDeparts).then((res) => {
        if (res.success) {
@@ -387,6 +388,7 @@
      that.form.resetFields()
      that.model = Object.assign({}, record)
      that.visible = true
      that.initOptions()
      that.warehouseId = record.warehouseId
      if (record.sparePartCancellingStocksDetailList != undefined) {
        const temp = [...record.sparePartCancellingStocksDetailList]
@@ -399,6 +401,13 @@
        this.codeDisable = true
      } else {
        this.codeDisable = false
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },