feat: There is no way the, TO optimize the query
This commit is contained in:
+67
-62
@@ -2669,71 +2669,76 @@ export default {
|
||||
window.open(routeUrl.href, '_blank')
|
||||
},
|
||||
// 编辑
|
||||
selectStandardPro (item, state) {
|
||||
this.drawerTitle = '修改企业标准'
|
||||
this.modalshowflag = true
|
||||
this.resolveFormFieldList(true)
|
||||
this.$nextTick(() => {
|
||||
Promise.all([this.queryDisplayLocation()]).then((values) => {
|
||||
const [displayLocation] = values
|
||||
const dynamicFormField = this.sarBussionessStandEO
|
||||
const formFieldList = this.formFieldList
|
||||
formFieldList.forEach((field) => {
|
||||
displayLocation.forEach((location) => {
|
||||
let value = dynamicFormField[field.attrField]
|
||||
let valueName = ''
|
||||
if (value && typeof value === 'number') {
|
||||
value = this.$dateFormat(value, 'yyyy-MM-dd')
|
||||
}
|
||||
field['value'] = value
|
||||
// 追加用户名称和部门名称
|
||||
if (field.selVal === 'ORGLIST' || field.selVal === 'USERLIST' || field.attrField === 'SVPPS') {
|
||||
let attrFieldName = field.attrField + 'Name'
|
||||
valueName = dynamicFormField[attrFieldName]
|
||||
}
|
||||
field['valueName'] = valueName
|
||||
if (field.showRegionId === location.value) {
|
||||
if (!location.child) {
|
||||
location['child'] = []
|
||||
selectStandardPro (row, state) {
|
||||
this.$http.get('lawss/sarBussionessStand/getStandInfoUpdateById', {id: row.id}, {
|
||||
_this: this
|
||||
}, res => {
|
||||
const item = res.data || {}
|
||||
this.drawerTitle = '修改企业标准'
|
||||
this.modalshowflag = true
|
||||
this.resolveFormFieldList(true)
|
||||
this.$nextTick(() => {
|
||||
Promise.all([this.queryDisplayLocation()]).then((values) => {
|
||||
const [displayLocation] = values
|
||||
const dynamicFormField = this.sarBussionessStandEO
|
||||
const formFieldList = this.formFieldList
|
||||
formFieldList.forEach((field) => {
|
||||
displayLocation.forEach((location) => {
|
||||
let value = dynamicFormField[field.attrField]
|
||||
let valueName = ''
|
||||
if (value && typeof value === 'number') {
|
||||
value = this.$dateFormat(value, 'yyyy-MM-dd')
|
||||
}
|
||||
field['value'] = value
|
||||
// 追加用户名称和部门名称
|
||||
if (field.selVal === 'ORGLIST' || field.selVal === 'USERLIST' || field.attrField === 'SVPPS') {
|
||||
let attrFieldName = field.attrField + 'Name'
|
||||
valueName = dynamicFormField[attrFieldName]
|
||||
}
|
||||
field['valueName'] = valueName
|
||||
if (field.showRegionId === location.value) {
|
||||
if (!location.child) {
|
||||
location['child'] = []
|
||||
}
|
||||
location['child'].push(field)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.dynamicFormField = displayLocation
|
||||
this.loading = false
|
||||
})
|
||||
this.sarBussionessStandEO = JSON.parse(JSON.stringify(item))
|
||||
this.sarBussionessStandEO["XCSJBUSS"] = this.dateFormatter()
|
||||
this.standStatus = JSON.parse(JSON.stringify(this.sarBussionessStandEO.standStatus))
|
||||
let subClass = item.standSubclass
|
||||
this.sarBussionessStandEO.standSubclass = subClass
|
||||
if (this.sarBussionessStandEO.issueTime != null && this.sarBussionessStandEO.issueTime !== '') {
|
||||
this.sarBussionessStandEO.issueTime = new Date(this.sarBussionessStandEO.issueTime)
|
||||
}
|
||||
if (this.sarBussionessStandEO.putTime != null && this.sarBussionessStandEO.putTime !== '') {
|
||||
this.sarBussionessStandEO.putTime = new Date(this.sarBussionessStandEO.putTime)
|
||||
}
|
||||
Object.keys(item.attrInfoMap || {}).forEach((key) => {
|
||||
if (item.attrInfoMap[key]) {
|
||||
// this.sarStandardsInfoEO[key] = item.attrInfoMap[key]
|
||||
this.$set(this.sarBussionessStandEO, key, item.attrInfoMap[key])
|
||||
}
|
||||
})
|
||||
this.sarBussionessStandEO['id'] = item.id
|
||||
if (state === 'show') {
|
||||
this.formdisableflag = true
|
||||
} else {
|
||||
// this.standGeneraSelectChange() // 负责细类初始化
|
||||
// this.getOrgTreeSource()
|
||||
this.addOrUPdateFlag = 2
|
||||
this.formdisableflag = false
|
||||
this.saveOldNum = item.standCode // 记录修改之前的标准编号
|
||||
this.saveOldReplaceNum = item.replaceStandNum // 记录修改之前的代替标准编号
|
||||
// let selectNode = this.getTreeNameByid(this.sarBussionessStandEO.responsibleUnit)
|
||||
this.sarBussionessStandEO.orgName = item.responsibleUnitShow
|
||||
}
|
||||
location['child'].push(field)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.dynamicFormField = displayLocation
|
||||
this.loading = false
|
||||
})
|
||||
this.sarBussionessStandEO = JSON.parse(JSON.stringify(item))
|
||||
this.sarBussionessStandEO["XCSJBUSS"] = this.dateFormatter()
|
||||
this.standStatus = JSON.parse(JSON.stringify(this.sarBussionessStandEO.standStatus))
|
||||
let subClass = item.standSubclass
|
||||
this.sarBussionessStandEO.standSubclass = subClass
|
||||
if (this.sarBussionessStandEO.issueTime != null && this.sarBussionessStandEO.issueTime !== '') {
|
||||
this.sarBussionessStandEO.issueTime = new Date(this.sarBussionessStandEO.issueTime)
|
||||
}
|
||||
if (this.sarBussionessStandEO.putTime != null && this.sarBussionessStandEO.putTime !== '') {
|
||||
this.sarBussionessStandEO.putTime = new Date(this.sarBussionessStandEO.putTime)
|
||||
}
|
||||
Object.keys(item.attrInfoMap || {}).forEach((key) => {
|
||||
if (item.attrInfoMap[key]) {
|
||||
// this.sarStandardsInfoEO[key] = item.attrInfoMap[key]
|
||||
this.$set(this.sarBussionessStandEO, key, item.attrInfoMap[key])
|
||||
}
|
||||
})
|
||||
this.sarBussionessStandEO['id'] = item.id
|
||||
if (state === 'show') {
|
||||
this.formdisableflag = true
|
||||
} else {
|
||||
// this.standGeneraSelectChange() // 负责细类初始化
|
||||
// this.getOrgTreeSource()
|
||||
this.addOrUPdateFlag = 2
|
||||
this.formdisableflag = false
|
||||
this.saveOldNum = item.standCode // 记录修改之前的标准编号
|
||||
this.saveOldReplaceNum = item.replaceStandNum // 记录修改之前的代替标准编号
|
||||
// let selectNode = this.getTreeNameByid(this.sarBussionessStandEO.responsibleUnit)
|
||||
this.sarBussionessStandEO.orgName = item.responsibleUnitShow
|
||||
}
|
||||
})
|
||||
},
|
||||
// 部门树结构,通过id,查出对应的树节点
|
||||
getTreeNameByid (treeid) {
|
||||
|
||||
Reference in New Issue
Block a user