Commit fe334527 authored by jiangqihao's avatar jiangqihao

select组件

parent b79a7d8a
......@@ -605,6 +605,12 @@ export default {
Object.keys(val).forEach(key => {
this.$set(this.formData, key, val[key])
})
} else if (this.formDescData[field].type === 'select' && Object.prototype.toString.call(val) === '[object Object]') {
this.$set(this.formData, field, val.value)
var text = this.formDescData[field].value
if (text) {
this.$set(this.formData, text, val.text)
}
} else {
this.$set(this.formData, field, val)
}
......@@ -656,9 +662,11 @@ export default {
// 保存现在的数据作为老数据
this.formDescData[field]._oldValue['type-' + formItem._type] =
formData[field]
const val = {
value: newVal
}
// 类型改变, 则删除原数据
this.handleChange(field, newVal)
this.handleChange(field, val)
this.setDefaultvalue(this.formDescData[field], field)
}
......
......@@ -68,30 +68,30 @@ export default {
},
methods: {
// 变化处理
// handleChange(value) {
// var result = {}
// if (!this.attrs.multiple) {
// this.options.forEach(item => {
// if (item.value === value) {
// result = item.value
// }
// })
// } else {
// result = {
// value: [],
// text: []
// }
// this.options.forEach(item => {
// value.forEach(jtem => {
// if (item.value === jtem) {
// result.value.push(item.value)
// result.text.push(item.text)
// }
// })
// })
// }
// this.$emit('input', result)
// },
handleChange(value) {
var result = {}
if (!this.attrs.multiple) {
this.options.forEach(item => {
if (item.value === value) {
result = item
}
})
} else {
result = {
value: [],
text: []
}
this.options.forEach(item => {
value.forEach(jtem => {
if (item.value === jtem) {
result.value.push(item.value)
result.text.push(item.text)
}
})
})
}
this.$emit('input', result)
},
changeOptions(q) {
if (this.remoteMethod) {
this.loading = true
......
......@@ -98,7 +98,7 @@ const actions = {
var permissions = []
var paths = []
treeToArray(menus, permissions, paths)
console.log(paths)
// console.log(paths)
localStorage.setItem('PERMISSIONS', JSON.stringify(permissions))
localStorage.setItem('PATHS', JSON.stringify(paths))
commit('SET_PERMISSIONS', permissions)
......
......@@ -76,7 +76,7 @@ export default {
type: 'input',
label: '社会统一信用代码',
layout: 12,
disabled: this.displayBtn
disabled: true
},
ExtRegisteredCapital_SDK: {
type: 'input',
......@@ -105,6 +105,10 @@ export default {
type: 'select',
label: '省份',
layout: 12,
value: 'ExtProvinceName_SDK',
attrs: {
multiple: false
},
options: async data => {
const res = await provinceSearch({})
var result = res.results.map(item => {
......@@ -122,6 +126,10 @@ export default {
label: '地市',
layout: 12,
isOptions: true,
value: 'ExtCityName_SDK',
attrs: {
multiple: false
},
optionsLinkageFields: ['ExtProvince_SDK'],
options: async data => {
if (!data.ExtProvince_SDK) {
......@@ -145,6 +153,10 @@ export default {
label: '县市',
layout: 12,
isOptions: true,
attrs: {
multiple: false
},
value: 'ExtDistrictName_SDK',
optionsLinkageFields: ['ExtProvince_SDK', 'ExtCity_SDK'],
options: async data => {
if (!data.ExtCity_SDK) {
......@@ -240,8 +252,8 @@ export default {
// ExtRegisteredCapital_SDK: {required: true, message: '注册资本必填' },
ExtCorporateName_SDK: { required: true, message: '法人必填' },
ExtProvince_SDK: { required: true, message: '省份必填' },
ExtDistrict_SDK: {required: true, message: '城市必填' },
ExtCity_SDK: { required: true, message: '县区必填' },
ExtCity_SDK: {required: true, message: '地市必填' },
ExtDistrict_SDK: { required: true, message: '县区必填' },
ExtLeader_SDK: { required: true, message: '公司负责人姓名' },
ExtLeaderPhone_SDK: { required: true, message: '公司负责人联系方式' },
ExtLeaderEmail_SDK: { required: true, message: '公司负责人邮箱' },
......@@ -265,7 +277,7 @@ export default {
methods: {
handleSubmit (data) {
const formData = this.$translateToC4CData(data)
formData.extCustomerType_SDK = '121'
console.log(formData)
this.loading = true
customerCreate(this.paramsToFormData(formData)).then(res => {
this.addBtnStart = true
......
......@@ -23,7 +23,7 @@
</el-button>
</div>
<div>
<PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode" :isShowBtn='isShowBtn' :isShowEditBtn="isShowEditBtn"/>
<PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode" :isShowBtn='isShowBtn' :isShowEditBtn="isShowEditBtn" @showAuthentication="showStart"/>
</div>
<!-- <PersonalInFo :addBtnStart='addBtnStart' :dedeleBtnStart="dedeleBtnStart" :type-code="typeCode" :isShowEditBtn='btn'/> -->
</div>
......@@ -63,7 +63,7 @@ export default {
formData: {},
isShowSubmitBtn: false,
isShowBackBtn: false,
showAuthentication: false,
showAuthentication: true,
sections: [
{
title: '基本信息',
......@@ -300,7 +300,7 @@ export default {
rules: {}
}
},
// watch: {
watch: {
// 'formData.ExtSocialUnifiedCreditCode_SDK': {
// handler(newValue) {
// console.log("单个属性监听", newValue)
......@@ -310,8 +310,9 @@ export default {
// })
// }
// }
// },
},
created() {
console.log(this.$refs)
this.getOneData()
},
methods: {
......@@ -331,6 +332,9 @@ export default {
});
return formData;
},
showStart(val) {
this.showAuthentication = val
},
getOneData() {
this.loading = true
const dataId = this.$route.query.objectID
......
......@@ -143,6 +143,7 @@ export default {
}
},
created() {
console.log(this.$refs.eleTable)
this.tableConfig.columns.handle.vif = this.isShowBtn
constant.tableConfig.initialParams = {
BusinessObjectID: this.objectID || this.$route.query.objectID,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment