|
|
@ -1,30 +1,23 @@ |
|
|
|
<template> |
|
|
|
<div class="dialog-h-content scroll-h pd0"> |
|
|
|
<el-form label-width="120px" :model="form" :inline="true" :rules="rules" ref="ruleForm" |
|
|
|
<el-form label-width="120px" :model="form" :inline="true" |
|
|
|
:disabled="disabled":rules="rules" ref="ruleForm" |
|
|
|
class="form-wr"> |
|
|
|
<div class="flex-div"> |
|
|
|
<el-form-item label="所属党组织" prop="sszb" class="wd50"> |
|
|
|
<el-cascader |
|
|
|
v-model="form.sszb" |
|
|
|
:options="optionsG" |
|
|
|
v-model="partyOrgs" |
|
|
|
:options="partyList" |
|
|
|
:props="partyProps" |
|
|
|
clearable |
|
|
|
class="input-width" |
|
|
|
@change="handlePartyChange"></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="党员中心户" prop="isDyzxh" class="wd50"> |
|
|
|
<el-radio-group v-model="form.isDyzxh"> |
|
|
|
<el-radio label="是" value="1"></el-radio> |
|
|
|
<el-radio label="否" value="0"></el-radio> |
|
|
|
<el-radio label="1">是</el-radio> |
|
|
|
<el-radio label="0">否</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
<!-- <el-select v-model="form.isDyzxh" filterable |
|
|
|
:disabled="disabled" placeholder="请选择" class="input-width" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in optionsEditG" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> --> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<div class="flex-div"> |
|
|
@ -33,8 +26,8 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="免学习" prop="isMxx" class="wd50"> |
|
|
|
<el-radio-group v-model="form.isMxx"> |
|
|
|
<el-radio label="是" value="1"></el-radio> |
|
|
|
<el-radio label="否" value="0"></el-radio> |
|
|
|
<el-radio label="1">是</el-radio> |
|
|
|
<el-radio label="0">否</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
@ -89,8 +82,8 @@ |
|
|
|
<div class="flex-div"> |
|
|
|
<el-form-item label="流动党员" prop="isLd" class="wd50"> |
|
|
|
<el-radio-group v-model="form.isLd" class="input-width"> |
|
|
|
<el-radio label="是" value="1"></el-radio> |
|
|
|
<el-radio label="否" value="0"></el-radio> |
|
|
|
<el-radio label="1">是</el-radio> |
|
|
|
<el-radio label="0">否</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="流动党员号" prop="ldzh" class="wd50"> |
|
|
@ -102,13 +95,13 @@ |
|
|
|
</el-form-item> |
|
|
|
<div :style="'width:' + formItemWd" > |
|
|
|
<div style="margin-top: 20px; text-align: center;"> |
|
|
|
<el-button size="small">取消</el-button> |
|
|
|
<el-button size="small" @click="handleCancle">取消</el-button> |
|
|
|
<el-button |
|
|
|
v-if="!disabled" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
>提交</el-button |
|
|
|
> |
|
|
|
@click="hadnleSubmitbase" |
|
|
|
>提交</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
@ -116,10 +109,10 @@ |
|
|
|
<div class="pdl40"> |
|
|
|
<el-tabs v-model="activesName"> |
|
|
|
<el-tab-pane label="量化积分" name="first"> |
|
|
|
<pointsInfo /> |
|
|
|
<pointsInfo :partyId="partymenberid" :disabled="disabled" @save="handleSavePoints" /> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="缴费记录" name="second"> |
|
|
|
<record /> |
|
|
|
<record :partyId="partymenberid" :disabled="disabled" /> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
<!-- <el-button-group> |
|
|
@ -157,6 +150,14 @@ export default { |
|
|
|
partyList: { |
|
|
|
type: Array, |
|
|
|
default: () => [] |
|
|
|
}, |
|
|
|
info: { |
|
|
|
type: Object, |
|
|
|
default: () => {} |
|
|
|
}, |
|
|
|
disabled: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
@ -182,12 +183,12 @@ export default { |
|
|
|
} |
|
|
|
return { |
|
|
|
activesName: 'first', |
|
|
|
disabled: false, |
|
|
|
isAuto: false, |
|
|
|
formItemWd: '100%', |
|
|
|
partymenberid: '', |
|
|
|
partyProps: { |
|
|
|
label: 'partyOrgName', |
|
|
|
value: 'partyOrgCode' |
|
|
|
value: 'id' |
|
|
|
}, |
|
|
|
zwList: [ |
|
|
|
{ |
|
|
@ -229,7 +230,21 @@ export default { |
|
|
|
name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }], |
|
|
|
mobile: [{ required: true, validator: checkMObile, trigger: 'blur' }], |
|
|
|
idCard: [{ required: true, validator: checkIdCard, trigger: 'blur' }], |
|
|
|
} |
|
|
|
}, |
|
|
|
partyOrgs: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
info: { |
|
|
|
handler(val) { |
|
|
|
if (Object.keys(val).length > 0) { |
|
|
|
this.form = { ...val } |
|
|
|
console.log('val----------in', val) |
|
|
|
this.partyOrgs = val.orgPids.split(',') |
|
|
|
this.partymenberid = val.id |
|
|
|
} |
|
|
|
}, |
|
|
|
immediate: true |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -239,9 +254,20 @@ export default { |
|
|
|
const w = document.getElementsByClassName('dialog-h-content')[0] |
|
|
|
this.formItemWd = w.clientWidth + 'px' |
|
|
|
}, |
|
|
|
destroyed() { |
|
|
|
// this.$refs['ruleForm'].resetFields() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleCancle() { |
|
|
|
this.$refs['ruleForm'].resetFields() |
|
|
|
this.$emit('cancle') |
|
|
|
}, |
|
|
|
handlePartyChange(val) { |
|
|
|
console.log('val------pp', val) |
|
|
|
if (val.length > 0) { |
|
|
|
const i = val.length - 1 |
|
|
|
this.form.sszb = val[i] |
|
|
|
} else this.form.sszb = '' |
|
|
|
}, |
|
|
|
handleValidBlur(n) { |
|
|
|
if (!isCard(this.form.idCard)) return |
|
|
@ -287,6 +313,114 @@ export default { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
hadnleSubmitbase() { |
|
|
|
this.$refs['ruleForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (Object.keys(this.info).length > 0) this.editBase() |
|
|
|
else this.saveBase() |
|
|
|
} else { |
|
|
|
console.log('error submit!!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleSavePoints(data) { |
|
|
|
|
|
|
|
const _data = { ...data } |
|
|
|
const params = { |
|
|
|
..._data, |
|
|
|
baseOptions: data.baseOptions.length > 0 ? data.baseOptions.toString() : '', |
|
|
|
reviewOptions: data.reviewOptions.length > 0 ? data.reviewOptions.toString() : '', |
|
|
|
inspireOptions: data.inspireOptions.length > 0 ? data.inspireOptions.toString() : '', |
|
|
|
warnOptions: data.warnOptions.length > 0 ? data.warnOptions.toString() : '' |
|
|
|
} |
|
|
|
this.savePoints(params) |
|
|
|
}, |
|
|
|
async saveBase() { |
|
|
|
const params = { |
|
|
|
...this.form |
|
|
|
} |
|
|
|
await this.$http |
|
|
|
.post('/resi/partymember/icPartyMember/save', params) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.$message.success('保存成功') |
|
|
|
this.partymenberid = res.data |
|
|
|
this.$emit('saveBase', true) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
async editBase() { |
|
|
|
const params = { |
|
|
|
...this.form |
|
|
|
} |
|
|
|
await this.$http |
|
|
|
.post('/resi/partymember/icPartyMember/update', params) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.$message.success('保存成功') |
|
|
|
this.partymenberid = res.data |
|
|
|
this.$emit('saveBase', true) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
async savePoints(form) { |
|
|
|
const params = { |
|
|
|
...form, |
|
|
|
partyMemberId: this.partymenberid |
|
|
|
} |
|
|
|
let url = '' |
|
|
|
if (form.id) url = '/resi/partymember/icPartyMemberPoint/update' |
|
|
|
else url = '/resi/partymember/icPartyMemberPoint/save' |
|
|
|
await this.$http |
|
|
|
.post(url, params) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.$message.success('保存成功') |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
async saveRecord(form) { |
|
|
|
const params = { |
|
|
|
...form, |
|
|
|
partyMemberId: this.partymenberid |
|
|
|
} |
|
|
|
await this.$http |
|
|
|
.post('/resi/partymember/icPartyMemberPoint/save', params) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.$message.success('保存成功') |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|