|
@@ -12,24 +12,20 @@
|
|
|
<a-input v-decorator="['id']" type="hidden"/>
|
|
|
</a-form-item>
|
|
|
<a-form-item
|
|
|
- label="仓库id"
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
- v-show="false"
|
|
|
- >
|
|
|
- <a-input
|
|
|
- v-decorator="['storeId', {rules: [{required: true, message: '仓库id不能为空'}]}]" />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item
|
|
|
- label="仓库名称"
|
|
|
+ label="仓库"
|
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
- <a-input
|
|
|
- style="width: 70%"
|
|
|
- disabled
|
|
|
- v-decorator="['storeName', {rules: [{required: true, message: '仓库名称不能为空'}]}]" />
|
|
|
- <a-button type="primary" @click="handleStoreSelect">选择仓库</a-button>
|
|
|
+ <a-tree-select
|
|
|
+ style="width: 100%"
|
|
|
+ :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
+ :treeData="storeTreeDate"
|
|
|
+ :treeNodeFilterProp="'title'"
|
|
|
+ :showSearch="true"
|
|
|
+ v-decorator="['storeId', {rules: [{required: false, message: '仓库库位不能为空'}]}]"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ </a-tree-select>
|
|
|
</a-form-item>
|
|
|
<a-form-item
|
|
|
label="备件id"
|
|
@@ -139,6 +135,7 @@ import pick from 'lodash.pick'
|
|
|
import { addSpareStore, updateSpareStore } from '@/api/store/sparestore'
|
|
|
import StoreSelectModal from '@/views/store/store/modules/StoreSelectModal'
|
|
|
import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
|
|
|
+import { fetchStoreTree } from '@/api/store/store'
|
|
|
|
|
|
export default {
|
|
|
name: 'BaseSpareStore',
|
|
@@ -148,6 +145,7 @@ export default {
|
|
|
modalTitle: null,
|
|
|
form: this.$form.createForm(this),
|
|
|
visible: false,
|
|
|
+ storeTreeDate: [],
|
|
|
// 下拉框map
|
|
|
delFlagMap: {}
|
|
|
}
|
|
@@ -159,10 +157,26 @@ export default {
|
|
|
props: {
|
|
|
},
|
|
|
created () {
|
|
|
+ this.setTree()
|
|
|
// 下拉框map
|
|
|
this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 设置仓库、备件类别树
|
|
|
+ */
|
|
|
+ setTree () {
|
|
|
+ fetchStoreTree().then(res => {
|
|
|
+ this.storeTreeDate = this.BaseTool.TREE.treeFilter(res.data, (item) => {
|
|
|
+ console.log(item.title + ',,' + item.level)
|
|
|
+ if (item.level === this.DictCache.VALUE.STORE_LEVEL.ZONGCANG) {
|
|
|
+ console.log(false)
|
|
|
+ item.selectable = false
|
|
|
+ item.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
base (record) {
|
|
|
this.visible = true
|
|
|
// 如果是空标识添加
|