Commit fe334527 authored by jiangqihao's avatar jiangqihao

select组件

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