src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue
@@ -20,6 +20,7 @@
            >
              <a-input
                placeholder='请输入库单编号'
                :disabled="disableSubmit"
                v-decorator="['num', validatorRules.num]"
              />
            </a-form-item>
@@ -38,12 +39,21 @@
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                v-decorator="['departId', validatorRules.departId]"
              />-->
              <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="'请选择采购部门'"
                :options="this.departs"
                style="width: 100%"
                :disabled="disableSubmit"
                v-decorator="['departId', validatorRules.departId]"
              />
              />-->
            </a-form-item>
          </a-col>
        </a-row>
@@ -89,6 +99,7 @@
      type='primary'
      :style="{ marginRight: '8px',marginBottom:'8px' }"
      :loading='confirmLoading'
      :disabled="disableSubmit"
      @click='selectSparePart()'
    >增加备件信息
    </a-button>
@@ -113,15 +124,17 @@
            :options='record.suppliers'
            @change='(e) => handleChange(e, record.key, col, index)'
            style='width: 100%'
            :disabled='false'
            :disabled="disableSubmit"
          />
          <a-select
            v-if="col.dataIndex == 'warehouseAreaId'"
            :value='text'
            :disabled="disableSubmit"
            :options='record.warehouseAreas'
            @change='(e) => handleChange(e, record.key, col, index)'
            style='width: 100%'
            :disabled='false'
          />
          <a-select
            v-if="col.dataIndex == 'warehouseLocationId'"
@@ -129,22 +142,25 @@
            :options='record.warehouseLocations'
            @change='(e) => handleChange(e, record.key, col, index)'
            style='width: 100%'
            :disabled='false'
            :disabled="disableSubmit"
          />
          <a-input-number
            :value='text'
            v-if="col.dataIndex == 'mainQuantity'"
            :min='0'
            :disabled="disableSubmit"
            :max='record.wastageRate'
            @change='(e)=>handleChange(e, record.key, col, index)'
          />
          <a-input
            :value='text'
            :disabled="disableSubmit"
            v-if="col.dataIndex == 'batchNum'"
            @change='(e)=>handleChange(e, record.key, col, index)'
          />
          <a-date-picker
            :value='text'
            :disabled="disableSubmit"
            v-if="col.dataIndex == 'manufactureDate'"
            format='YYYY-MM-DD'
            @change='(e)=>handleChange(e, record.key, col, index)'
@@ -159,6 +175,7 @@
      >
        <a-popconfirm
          title='确定删除吗?'
          :disabled="disableSubmit"
          @confirm='() => handleDelete(text,record, index)'
        >
          <a>删除</a>
@@ -176,6 +193,7 @@
      <a-button
        @click='handleOk()'
        type='primary'
        :disabled="disableSubmit"
        :loading='confirmLoading'
      >确定
      </a-button>
@@ -204,6 +222,7 @@
  },
  data() {
    return {
      treeData:[],
      departs: [],
      columns: [
        {
@@ -344,6 +363,7 @@
        getSysDeparts: "/eam/equipment/getSysDeparts",
        add: '/spare/sparePartPurchaseStorage/add',
        edit: '/spare/sparePartPurchaseStorage/edit',
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getSuppliers: '/spare/sparePartPurchaseStorageDeatil/getSuppliers',
        getWarehouseAreas: '/spare/sparePartPurchaseStorageDeatil/getWarehouseAreas',
        getWarehouseLocations: '/spare/sparePartPurchaseStorageDeatil/getWarehouseLocations',
@@ -380,9 +400,7 @@
    })
  },
  created() {
    this.getSysDeparts();
  },
  created() {},
  methods: {
    getSysDeparts() {
      getAction(this.url.getSysDeparts).then((res) => {
@@ -414,6 +432,7 @@
      that.form.resetFields()
      that.model = Object.assign({}, record)
      that.visible = true
      that.initOptions();
      if (record.sparePartPurchaseStorageDeatilList != undefined) {
        const temp = [...record.sparePartPurchaseStorageDeatilList]
        that.dataSource = temp
@@ -427,7 +446,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