|
@@ -58,7 +58,7 @@
|
|
|
>
|
|
|
</a-tree-select>
|
|
|
</a-form-item>
|
|
|
-<!-- <a-form-item
|
|
|
+ <!-- <a-form-item
|
|
|
label="父子关联编码"
|
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
@@ -90,16 +90,30 @@
|
|
|
:min="1"
|
|
|
v-decorator="['sort', {initialValue:1,rules: [{required: true, message: '排序不能为空'}]}]" />
|
|
|
</a-form-item>
|
|
|
+ <a-form-item
|
|
|
+ label="是否OPC展示"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
+ >
|
|
|
+ <a-select v-decorator="['opcFlag', {initialValue:DictCache.VALUE.DELFLAG.NORMAL, rules: [{required: true, message: '是否OPC展示不能为空'}]}]" placeholder="请选择">
|
|
|
+ <a-select-option
|
|
|
+ v-for="(label,value) in yesNoMap"
|
|
|
+ :key="value"
|
|
|
+ :label="label"
|
|
|
+ :value="parseInt(value)">{{ label }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
<row-item>
|
|
|
<a-form-item
|
|
|
label="图片"
|
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
- <upload-spare-file
|
|
|
+ <upload-position-img
|
|
|
ref="imageUpload"
|
|
|
@catchImage="catchImage"
|
|
|
- ></upload-spare-file>
|
|
|
+ ></upload-position-img>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<a-form-item
|
|
@@ -135,19 +149,21 @@
|
|
|
import pick from 'lodash.pick'
|
|
|
import { addSbPosition, updateSbPosition, getSbPositionTree } from '@/api/sb/position'
|
|
|
import { queryRepairUser } from '@/api/upms/user-dept'
|
|
|
-
|
|
|
+import UploadPositionImg from '@/components/Upload/UploadPositionImg'
|
|
|
export default {
|
|
|
name: 'BaseSbPosition',
|
|
|
+ components: { UploadPositionImg },
|
|
|
data () {
|
|
|
return {
|
|
|
confirmLoading: false,
|
|
|
modalTitle: null,
|
|
|
form: this.$form.createForm(this),
|
|
|
visible: false,
|
|
|
- img: '',
|
|
|
+ opcImg: '',
|
|
|
positionTypeMap: {},
|
|
|
delFlagMap: {},
|
|
|
userList: {},
|
|
|
+ yesNoMap: {},
|
|
|
treeData: []
|
|
|
}
|
|
|
},
|
|
@@ -155,6 +171,7 @@ export default {
|
|
|
},
|
|
|
created () {
|
|
|
this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
|
|
|
+ this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
|
|
|
this.positionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBPOSITION_TYPE)
|
|
|
const params = { roleType: 3, deptId: null, queryType: 1 }
|
|
|
queryRepairUser(params).then(res => {
|
|
@@ -183,28 +200,29 @@ export default {
|
|
|
'type',
|
|
|
'code',
|
|
|
'sort',
|
|
|
+ 'opcFlag',
|
|
|
'delFlag',
|
|
|
'parentId',
|
|
|
'userId',
|
|
|
'remark'
|
|
|
])))
|
|
|
})
|
|
|
- this.img = record.img
|
|
|
+ this.opcImg = record.opcImg
|
|
|
const fileList = []
|
|
|
- if (record.img) {
|
|
|
+ if (record.opcImg) {
|
|
|
fileList.push({
|
|
|
uid: '-1',
|
|
|
name: record.name,
|
|
|
status: 'done',
|
|
|
- url: this.BaseTool.Constant.FILE_URL + record.img,
|
|
|
- originUrl: record.img
|
|
|
+ url: this.BaseTool.Constant.FILE_URL + record.opcImg,
|
|
|
+ originUrl: record.opcImg
|
|
|
})
|
|
|
}
|
|
|
this.$refs.imageUpload.base(1, fileList)
|
|
|
},
|
|
|
catchImage (fileList) {
|
|
|
if (fileList.length !== 0) {
|
|
|
- this.img = fileList[0].url
|
|
|
+ this.opcImg = fileList[0].url
|
|
|
}
|
|
|
},
|
|
|
save () {
|
|
@@ -215,7 +233,7 @@ export default {
|
|
|
this.confirmLoading = false
|
|
|
return
|
|
|
}
|
|
|
- values.img = this.img
|
|
|
+ values.opcImg = this.opcImg
|
|
|
if (this.BaseTool.String.isBlank(values.id)) {
|
|
|
addSbPosition(values)
|
|
|
.then(() => {
|