|
@@ -37,16 +37,34 @@
|
|
|
</row-item>
|
|
|
<row-item>
|
|
|
<a-form-item
|
|
|
- label="项目部"
|
|
|
+ label="设备类型"
|
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
- <a-select @change="handleProjectChange" v-decorator="['storeId', {rules: [{required: true, message: '项目不能为空'}]}]" placeholder="请选择">
|
|
|
+ <a-tree-select
|
|
|
+ style="width: 100%"
|
|
|
+ :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
+ :treeData="treeData"
|
|
|
+ :treeNodeFilterProp="'title'"
|
|
|
+ :showSearch="true"
|
|
|
+ v-decorator="['spareType', {rules: [{required: false, message: '设备类型不能为空'}]}]"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ </a-tree-select>
|
|
|
+ </a-form-item>
|
|
|
+ </row-item>
|
|
|
+ <row-item>
|
|
|
+ <a-form-item
|
|
|
+ label="盘点区域"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
+ >
|
|
|
+ <a-select v-decorator="['storeId', {rules: [{required: false, message: '盘点区域不能为空'}]}]" placeholder="请选择">
|
|
|
<a-select-option
|
|
|
- v-for="({deptId, name}) in projectList"
|
|
|
- :key="deptId"
|
|
|
+ v-for="({id,name}) in sbPositionData"
|
|
|
+ :key="id"
|
|
|
:label="name"
|
|
|
- :value="deptId">{{ name }}
|
|
|
+ :value="id">{{ name }}
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
@@ -133,8 +151,9 @@
|
|
|
<script>
|
|
|
import pick from 'lodash.pick'
|
|
|
import { addCheckPlan, updateCheckPlan } from '@/api/sb/sbstorecheckplan'
|
|
|
-import { queryDept } from '@/api/upms/dept'
|
|
|
-import { queryUsersByParentDeptNatureAll } from '@/api/upms/user'
|
|
|
+import { queryUser } from '@/api/upms/user'
|
|
|
+import { fetchSbTypeTree } from '@/api/sb/type'
|
|
|
+import { querySbPosition } from '@/api/sb/position'
|
|
|
|
|
|
export default {
|
|
|
name: 'BaseCheckPlan',
|
|
@@ -157,10 +176,11 @@ export default {
|
|
|
visible: false,
|
|
|
// 下拉框map
|
|
|
typeMap: {},
|
|
|
+ treeData: [],
|
|
|
+ sbPositionData: [],
|
|
|
periodTypeMap: {},
|
|
|
checkUserTypeMap: {},
|
|
|
validTimeTypeMap: {},
|
|
|
- projectList: {},
|
|
|
userList: {},
|
|
|
enableMap: {},
|
|
|
rowSelection: {
|
|
@@ -193,8 +213,11 @@ export default {
|
|
|
this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
|
|
|
this.validTimeTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
|
|
|
this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
|
|
|
- queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
|
|
|
- this.projectList = res.data
|
|
|
+ fetchSbTypeTree().then(res => {
|
|
|
+ this.treeData = res.data
|
|
|
+ })
|
|
|
+ querySbPosition().then(res => {
|
|
|
+ this.sbPositionData = res.data
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -206,10 +229,8 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.modalTitle = '编辑'
|
|
|
- const params = { includeMy: true }
|
|
|
- params.deptId = record.storeId
|
|
|
- params.nature = this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU
|
|
|
- queryUsersByParentDeptNatureAll(params).then(res => {
|
|
|
+ const params = { }
|
|
|
+ queryUser(params).then(res => {
|
|
|
this.userList = res.data
|
|
|
})
|
|
|
const { form: { setFieldsValue } } = this
|
|
@@ -267,19 +288,6 @@ export default {
|
|
|
this.$emit('ok', values)
|
|
|
}
|
|
|
},
|
|
|
- handleProjectChange (value) {
|
|
|
- const params = { includeMy: true }
|
|
|
- if (this.BaseTool.Object.isBlank(value)) {
|
|
|
- this.$message.info('请先选择项目部')
|
|
|
- return
|
|
|
- } else {
|
|
|
- params.deptId = value
|
|
|
- }
|
|
|
- params.nature = this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU
|
|
|
- queryUsersByParentDeptNatureAll(params).then(res => {
|
|
|
- this.userList = res.data
|
|
|
- })
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
}
|