Browse Source

dd

shibei_master
13176889840 3 years ago
parent
commit
fcec3fa4f5
  1. 34
      src/views/components/resiForm.vue
  2. 11
      src/views/modules/communityParty/members/crateForm.vue

34
src/views/components/resiForm.vue

@ -297,18 +297,27 @@ export default {
let initForm = (obj, arr) => { let initForm = (obj, arr) => {
let _form = {} let _form = {}
console.log('formInfo---obj', obj) console.log('formInfo---obj', obj)
if (Object.keys(obj).length > 0) { // if (Object.keys(obj).length > 0) {
for(const n in obj) { // for(const n in obj) {
if (obj[n] == null) obj[n] = '' // if (obj[n] == null) obj[n] = ''
} // }
_form = { ...obj } // _form = { ...obj }
return _form // return _form
} // }
const len = Object.keys(obj).length
arr.forEach(item => { arr.forEach(item => {
if (len) {
if (item.multiSelect) _form[item.columnName] = [] if (obj[item.columnName]) {
else if (item.itemType == 'radio' && item.defaultValue == '0') _form[item.columnName] = item.defaultValue _form[item.columnName] = obj[item.columnName]
else _form[item.columnName] = '' item.isChange = true
}
} else {
if (item.multiSelect) _form[item.columnName] = []
else if (item.itemType == 'radio' && item.defaultValue == '0') _form[item.columnName] = item.defaultValue
else _form[item.columnName] = ''
}
// if (item.optionSourceType === 'remote') { // if (item.optionSourceType === 'remote') {
// this.getOptionsLists(item.optionSourceValue).then(res => { // this.getOptionsLists(item.optionSourceValue).then(res => {
@ -343,9 +352,10 @@ export default {
let rules = initRules(this.formList) let rules = initRules(this.formList)
console.log('rulessss', rules) console.log('rulessss', rules)
let tempFormList = [ ...this.formList ].map(item => { let tempFormList = [ ...this.formList ].map(item => {
const isChange = (item.itemType == 'radio' && item.defaultValue == '0') && true
return { return {
...item, ...item,
isChange: (item.itemType == 'radio' && item.defaultValue == '0') ? true : false isChange: isChange || item.isChange || false
} }
}) })
let constForm = { let constForm = {

11
src/views/modules/communityParty/members/crateForm.vue

@ -6,7 +6,7 @@
<div class="flex-div"> <div class="flex-div">
<el-form-item label="所属党组织" prop="sszb" class="wd50"> <el-form-item label="所属党组织" prop="sszb" class="wd50">
<el-cascader <el-cascader
v-model="partyOrgs" v-model="form.sszb"
:options="partyList" :options="partyList"
:props="partyProps" :props="partyProps"
clearable clearable
@ -252,6 +252,7 @@ export default {
}, },
created() { created() {
this.getEduList() this.getEduList()
console.log('partyList', this.partyList)
}, },
mounted() { mounted() {
const w = document.getElementsByClassName('dialog-h-content')[0] const w = document.getElementsByClassName('dialog-h-content')[0]
@ -267,10 +268,10 @@ export default {
}, },
handlePartyChange(val) { handlePartyChange(val) {
console.log('val------pp', val) console.log('val------pp', val)
if (val.length > 0) { // if (val.length > 0) {
const i = val.length - 1 // const i = val.length - 1
this.form.sszb = val[i] // this.form.sszb = val[i]
} else this.form.sszb = '' // } else this.form.sszb = ''
}, },
handleValidBlur(n) { handleValidBlur(n) {
if (!isCard(this.form.idCard)) return if (!isCard(this.form.idCard)) return

Loading…
Cancel
Save