|
@@ -84,6 +84,7 @@
|
|
:treeData="storeTreeDate"
|
|
:treeData="storeTreeDate"
|
|
:treeNodeFilterProp="'title'"
|
|
:treeNodeFilterProp="'title'"
|
|
:showSearch="true"
|
|
:showSearch="true"
|
|
|
|
+ @change="handleAreaChange"
|
|
v-decorator="['parentId', {rules: [{required: true, message: '上层仓库不能为空'}]}]"
|
|
v-decorator="['parentId', {rules: [{required: true, message: '上层仓库不能为空'}]}]"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
>
|
|
>
|
|
@@ -224,26 +225,28 @@
|
|
v-decorator="['remark', {rules: [{required: false, message: '备注不能为空'}]}]"/>
|
|
v-decorator="['remark', {rules: [{required: false, message: '备注不能为空'}]}]"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
- <row-item>
|
|
|
|
- <a-form-item
|
|
|
|
- label="是否存在库位"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
- <a-switch
|
|
|
|
- @change="val=>existPosition=val"
|
|
|
|
- v-decorator="['existPosition', {initialValue: true,valuePropName: 'checked',rules: [{required: false, message: '备注不能为空'}]}]"/>
|
|
|
|
- </a-form-item>
|
|
|
|
- </row-item>
|
|
|
|
- <row-item v-if="existPosition">
|
|
|
|
- <a-form-item
|
|
|
|
- label="库位图"
|
|
|
|
- :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
- >
|
|
|
|
- <Upload :files="fileList" :maxSize="1" @catchFile="catchFile"/>
|
|
|
|
- </a-form-item>
|
|
|
|
- </row-item>
|
|
|
|
|
|
+ <template v-if="level===1">
|
|
|
|
+ <row-item>
|
|
|
|
+ <a-form-item
|
|
|
|
+ label="是否存在库位"
|
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
+ >
|
|
|
|
+ <a-switch
|
|
|
|
+ @change="val=>existPosition=val"
|
|
|
|
+ v-decorator="['existPosition', {initialValue: true,valuePropName: 'checked',rules: [{required: false, message: '备注不能为空'}]}]"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </row-item>
|
|
|
|
+ <row-item v-if="existPosition">
|
|
|
|
+ <a-form-item
|
|
|
|
+ label="库位图"
|
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
|
+ >
|
|
|
|
+ <Upload :files="fileList" :maxSize="1" @catchFile="catchFile"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </row-item>
|
|
|
|
+ </template>
|
|
</row-list>
|
|
</row-list>
|
|
|
|
|
|
</a-form>
|
|
</a-form>
|
|
@@ -256,7 +259,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import pick from 'lodash.pick'
|
|
import pick from 'lodash.pick'
|
|
-import { addStore, updateStore, fetchStoreTree } from '@/api/store/store'
|
|
|
|
|
|
+import { addStore, updateStore, fetchStoreTree, fetchStore } from '@/api/store/store'
|
|
import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
|
|
import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
|
|
import { queryUser, queryUsersByParentDeptNatureAll } from '@/api/upms/user'
|
|
import { queryUser, queryUsersByParentDeptNatureAll } from '@/api/upms/user'
|
|
import { querySbPosition, fetchSbPosition } from '@/api/sb/position'
|
|
import { querySbPosition, fetchSbPosition } from '@/api/sb/position'
|
|
@@ -314,25 +317,30 @@ export default {
|
|
this.modalTitle = '复制'
|
|
this.modalTitle = '复制'
|
|
}
|
|
}
|
|
this.modal = record
|
|
this.modal = record
|
|
- const params = { includeMy: true }
|
|
|
|
- params.deptId = record.useCompany
|
|
|
|
- this.level = record.level
|
|
|
|
- params.nature = this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI
|
|
|
|
|
|
+ // const params = { includeMy: true }
|
|
|
|
+ // params.deptId = record.useCompany
|
|
|
|
+ // params.nature = this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI
|
|
// params.code = this.DictCache.VALUE.SYS_DEPT_CODE.CANG_KU
|
|
// params.code = this.DictCache.VALUE.SYS_DEPT_CODE.CANG_KU
|
|
- queryUsersByParentDeptNatureAll(params).then(res => {
|
|
|
|
- this.userList = res.data
|
|
|
|
- })
|
|
|
|
|
|
+ // queryUsersByParentDeptNatureAll(params).then(res => {
|
|
|
|
+ // this.userList = res.data
|
|
|
|
+ // })
|
|
const { form: { setFieldsValue } } = this
|
|
const { form: { setFieldsValue } } = this
|
|
record.existPosition = Boolean(record.existPosition)
|
|
record.existPosition = Boolean(record.existPosition)
|
|
this.existPosition = record.existPosition
|
|
this.existPosition = record.existPosition
|
|
- this.fileList = [{
|
|
|
|
- uid: '-1',
|
|
|
|
- name: record.no,
|
|
|
|
- status: 'done',
|
|
|
|
- url: record.backGroundMap
|
|
|
|
- }]
|
|
|
|
|
|
+ this.level = record.level
|
|
|
|
+ if (this.level === 1) {
|
|
|
|
+ this.handleAreaChange(record.factoryArea)
|
|
|
|
+ } else {
|
|
|
|
+ this.handleAreaChange(record.parentId)
|
|
|
|
+ }
|
|
// 日期处理
|
|
// 日期处理
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
|
+ this.fileList = [{
|
|
|
|
+ uid: '-1',
|
|
|
|
+ name: record.name,
|
|
|
|
+ status: 'done',
|
|
|
|
+ url: record.backGroundMap
|
|
|
|
+ }]
|
|
setFieldsValue(Object.assign(pick(record, [
|
|
setFieldsValue(Object.assign(pick(record, [
|
|
'id',
|
|
'id',
|
|
'useCompany',
|
|
'useCompany',
|
|
@@ -389,6 +397,7 @@ export default {
|
|
this.level = null
|
|
this.level = null
|
|
this.fileList = []
|
|
this.fileList = []
|
|
this.existPosition = true
|
|
this.existPosition = true
|
|
|
|
+ this.opcImg = ''
|
|
this.form.resetFields()
|
|
this.form.resetFields()
|
|
if (this.BaseTool.Object.isNotBlank(values)) {
|
|
if (this.BaseTool.Object.isNotBlank(values)) {
|
|
this.$emit('ok', values)
|
|
this.$emit('ok', values)
|
|
@@ -422,7 +431,7 @@ export default {
|
|
getDeptsAllByParentId({ deptId: record.useCompany, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
|
|
getDeptsAllByParentId({ deptId: record.useCompany, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
|
|
this.projectList = res.data
|
|
this.projectList = res.data
|
|
})
|
|
})
|
|
- queryUser({ deptId: record.useProject }).then(res => {
|
|
|
|
|
|
+ queryUser().then(res => {
|
|
this.userList = res.data
|
|
this.userList = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -455,9 +464,15 @@ export default {
|
|
// })
|
|
// })
|
|
},
|
|
},
|
|
handleAreaChange (id) {
|
|
handleAreaChange (id) {
|
|
- fetchSbPosition({ id }).then(res => {
|
|
|
|
- this.opcImg = res.data.opcImg
|
|
|
|
- })
|
|
|
|
|
|
+ if (this.level === 1) {
|
|
|
|
+ fetchSbPosition({ id }).then(res => {
|
|
|
|
+ this.opcImg = res.data.opcImg
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ fetchStore({ id }).then(res => {
|
|
|
|
+ this.opcImg = res.data.backGroundMap
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|