添加 属性字符串

dev
张同海 2 years ago
parent 92ca606161
commit ff2689625e

@ -312,8 +312,20 @@ export default {
mounted() {
DjyCustomerDetail({ id: this.RowData.id }).then(res => {
this.Data = res.data
console.log(res.data)
let WpropString = []
res.data.propString.split(']').forEach(item => {
if (item.split('[')[1]) {
WpropString.push(item.split('[')[1])
}
})
res.data.contacts.forEach((item, index) => {
item.WebKey = index + 1
})
this.ContactsData = res.data.contacts
this.form.setFieldsValue({
...res.data
...res.data,
WpropString
})
})
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => {
@ -387,7 +399,14 @@ export default {
values[key] = JSON.stringify(values[key])
}
}
DjyCustomerEdit({ ...this.Data, ...values, contacts: this.ContactsData })
let propString = ''
values.WpropString.split('["')[1]
.split('"]')[0]
.split('","')
.forEach(item2 => {
propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
})
DjyCustomerEdit({ ...this.Data, ...values, propString: propString, contacts: this.ContactsData })
.then(res => {
if (res.success) {
this.$message.success('编辑成功')

Loading…
Cancel
Save