5 changed files with 957 additions and 54 deletions
@ -0,0 +1,456 @@ |
|||
<template> |
|||
<el-dialog v-if="dlgVisible" |
|||
:visible="dlgVisible" |
|||
@close="handleDlgClosed" |
|||
:close-on-click-modal="false" |
|||
:title="'量化积分'"> |
|||
|
|||
<el-form> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="所属党组织"> |
|||
<el-input disabled v-model="partyOrgName" style="width: 240px"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="党员姓名"> |
|||
<el-input disabled v-model="partyMemberName" style="width: 240px"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="联系电话"> |
|||
<el-input disabled v-model="mobile" style="width: 240px"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="证件号"> |
|||
<el-input disabled v-model="idCard" style="width: 240px"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
|
|||
<el-form label-width="140px" :model="form" :inline="true" |
|||
:rules="rules" ref="ruleForm" |
|||
class="form-wr"> |
|||
<div> |
|||
<el-form-item label="评分周期" prop="year"> |
|||
<div class="flex-div"> |
|||
<!-- <div class="mr10">评分周期</div> --> |
|||
<div class="mr10"> |
|||
<el-date-picker |
|||
v-model="form.year" |
|||
type="year" |
|||
value-format="yyyy" |
|||
placeholder="选择年" |
|||
@change="handleYearChange"> |
|||
</el-date-picker> |
|||
</div> |
|||
<div class="mr10"> |
|||
<el-form-item prop="quarter"> |
|||
<el-select v-model="form.quarter" placeholder="请选择" class="input-width" clearable |
|||
@change="handleQuaterChange"> |
|||
<el-option |
|||
v-for="item in quarterList" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-button |
|||
type="primary" |
|||
size="small" |
|||
@click="hadnleSubmitbase" |
|||
>保存 |
|||
</el-button> |
|||
</div> |
|||
</div> |
|||
</el-form-item> |
|||
</div> |
|||
<el-form-item label="基础积分分值" prop="basePoint"> |
|||
<el-input v-model="form.basePoint" type="number" placeholder="请输入" class="input-width" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="基础积分选项" prop="baseOptions" class="wd-wr" :style="'width:' + formItemWd"> |
|||
<el-checkbox-group v-model="form.baseOptions"> |
|||
<el-checkbox v-for="item in baseOptions" :key="item.value" :label="item.value"> |
|||
{{ item.label }} |
|||
</el-checkbox> |
|||
</el-checkbox-group> |
|||
</el-form-item> |
|||
<div> |
|||
<el-form-item label="民主评议积分分值" prop="reviewPoint"> |
|||
<el-input v-model="form.reviewPoint" type="number" placeholder="请输入" class="input-width" |
|||
clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="民主评议积分选项" prop="reviewOptions" class="wd-wr" :style="'width:' + formItemWd"> |
|||
<el-checkbox-group v-model="form.reviewOptions"> |
|||
<el-checkbox v-for="item in pyiOptions" :key="item.value" :label="item.value"> |
|||
{{ item.label }} |
|||
</el-checkbox> |
|||
</el-checkbox-group> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-form-item label="激励积分分值" prop="inspirePoint"> |
|||
<el-input v-model="form.inspirePoint" type="number" placeholder="请输入" class="input-width" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="激励积分选项" prop="inspireOptions" class="wd-wr" :style="'width:' + formItemWd"> |
|||
<el-checkbox-group v-model="form.inspireOptions"> |
|||
<el-checkbox v-for="item in jiliOptions" :key="item.value" :label="item.value"> |
|||
{{ item.label }} |
|||
</el-checkbox> |
|||
</el-checkbox-group> |
|||
</el-form-item> |
|||
</div> |
|||
<div> |
|||
<el-form-item label="警示扣分分值" prop="warnPoint"> |
|||
<el-input v-model="form.warnPoint" type="number" placeholder="请输入" class="input-width" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="警示扣分选项" prop="warnOptions" class="wd-wr" :style="'width:' + formItemWd"> |
|||
<el-checkbox-group v-model="form.warnOptions"> |
|||
<el-checkbox v-for="item in jinshiOptions" :key="item.value" :label="item.value"> |
|||
{{ item.label }} |
|||
</el-checkbox> |
|||
</el-checkbox-group> |
|||
</el-form-item> |
|||
</div> |
|||
</el-form> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
// props: { |
|||
// partyId: { |
|||
// type: String, |
|||
// default: '' |
|||
// }, |
|||
// disabled: { |
|||
// type: Boolean, |
|||
// default: false |
|||
// } |
|||
// }, |
|||
data () { |
|||
return { |
|||
dlgVisible: false, |
|||
btnDisabled: false, |
|||
partyOrgName: null, |
|||
partyMemberName: null, |
|||
mobile: null, |
|||
idCard: null, |
|||
year: '', |
|||
quarter: '', |
|||
form: { |
|||
id: null, |
|||
partyMemberId: null, |
|||
year: '', |
|||
quarter: '', |
|||
basePoint: '', |
|||
baseOptions: [], |
|||
reviewPoint: '', |
|||
reviewOptions: [], |
|||
inspirePoint: '', |
|||
inspireOptions: [], |
|||
warnPoint: '', |
|||
warnOptions: [], |
|||
}, |
|||
formClear: null, // form备份 |
|||
rules: { |
|||
year: [{ required: true, message: '年度不能为空', trigger: 'blur' }], |
|||
quarter: [{ required: true, message: '季度不能为空', trigger: 'blur' }] |
|||
}, |
|||
formItemWd: '500px', |
|||
quarterList: [ |
|||
{ |
|||
label: '第一季度', |
|||
value: '1' |
|||
}, |
|||
{ |
|||
label: '第二季度', |
|||
value: '2' |
|||
}, |
|||
|
|||
{ |
|||
label: '第三季度', |
|||
value: '3' |
|||
}, |
|||
{ |
|||
label: '第四季度', |
|||
value: '4' |
|||
} |
|||
], |
|||
baseOptions: [ |
|||
{ |
|||
label: '参加三会一课', |
|||
value: '1' |
|||
}, |
|||
{ |
|||
label: '参加主题党日', |
|||
value: '2' |
|||
}, |
|||
|
|||
{ |
|||
label: '足额缴纳党费', |
|||
value: 3 |
|||
}, |
|||
{ |
|||
label: '积极参加学习培训', |
|||
value: '4' |
|||
}, |
|||
{ |
|||
label: '自觉执行党组织会议', |
|||
value: '5' |
|||
}, |
|||
{ |
|||
label: '严守党的政治纪律和政治规矩', |
|||
value: '6' |
|||
}, |
|||
], |
|||
jiliOptions: [ |
|||
{ |
|||
label: '发挥先锋模范作用', |
|||
value: '1' |
|||
}, |
|||
{ |
|||
label: '维护社会和谐稳定', |
|||
value: '2' |
|||
}, |
|||
|
|||
{ |
|||
label: '参与社会治理', |
|||
value: '3' |
|||
}, |
|||
{ |
|||
label: '联系服务群众', |
|||
value: '4' |
|||
} |
|||
], |
|||
jinshiOptions: [ |
|||
{ |
|||
label: '不服从党组织安排', |
|||
value: '1' |
|||
}, |
|||
{ |
|||
label: '不按时足额缴纳党费', |
|||
value: '2' |
|||
}, |
|||
|
|||
{ |
|||
label: '无故长期脱离组织管理', |
|||
value: '3' |
|||
}, |
|||
{ |
|||
label: '在工作中出现不良影响', |
|||
value: '4' |
|||
}, |
|||
{ |
|||
label: '违反党的纪律', |
|||
value: '5' |
|||
} |
|||
], |
|||
pyiOptions: [ |
|||
{ |
|||
label: '个人自评', |
|||
value: '1' |
|||
}, |
|||
{ |
|||
label: '党员互评', |
|||
value: '2' |
|||
}, |
|||
|
|||
{ |
|||
label: '民主测评', |
|||
value: '3' |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
watch: { |
|||
// partyMemberId: { |
|||
// handler (val) { |
|||
// console.log('val------points', val) |
|||
// if (val.length > 0) { |
|||
// this.btnDisabled = false |
|||
// } else { |
|||
// this.btnDisabled = true |
|||
// } |
|||
// }, |
|||
// immediate: true |
|||
// } |
|||
}, |
|||
mounted () { |
|||
// const w = document.getElementsByClassName('p-wr')[0] |
|||
// this.formItemWd = w.clientWidth - 360 + 'px' |
|||
// console.log('www----', w) |
|||
}, |
|||
methods: { |
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
// init (partyMemberId, partyOrgName, partyMemberName, mobile, idCard) { |
|||
// this.dlgVisible = true; |
|||
// this.partyMemberId = partyMemberId; |
|||
// this.partyOrgName = partyOrgName; |
|||
// this.partyMemberName = partyMemberName; |
|||
// this.mobile = mobile; |
|||
// this.idCard = idCard; |
|||
// }, |
|||
initDlg (partyMemberId, partyOrgName, partyMemberName, mobile, idCard) { |
|||
this.formClear = JSON.parse(JSON.stringify(this.form)) |
|||
this.dlgVisible = true |
|||
this.form.partyMemberId = partyMemberId |
|||
this.partyOrgName = partyOrgName |
|||
this.partyMemberName = partyMemberName |
|||
this.mobile = mobile |
|||
this.idCard = idCard |
|||
}, |
|||
|
|||
/** |
|||
* 对话框关闭事件 |
|||
*/ |
|||
handleDlgClosed () { |
|||
this.form = this.formClear |
|||
this.dlgVisible = false |
|||
}, |
|||
|
|||
handleQuaterChange (val) { |
|||
if (this.form.year) { |
|||
this.getInfo() |
|||
} |
|||
this.quarter = val |
|||
}, |
|||
handleYearChange (val) { |
|||
this.year = val |
|||
}, |
|||
hadnleSubmitbase () { |
|||
if (!this.form.partyMemberId) return |
|||
this.$refs['ruleForm'].validate((valid) => { |
|||
if (valid) { |
|||
const params = { |
|||
...this.form, |
|||
baseOptions: this.form.baseOptions.length > 0 ? this.form.baseOptions.toString() : '', |
|||
reviewOptions: this.form.reviewOptions.length > 0 ? this.form.reviewOptions.toString() : '', |
|||
inspireOptions: this.form.inspireOptions.length > 0 ? this.form.inspireOptions.toString() : '', |
|||
warnOptions: this.form.warnOptions.length > 0 ? this.form.warnOptions.toString() : '' |
|||
} |
|||
this.savePoints(params) |
|||
} else { |
|||
console.log('error submit!!') |
|||
return false |
|||
} |
|||
}) |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 保存积分 |
|||
* @param form |
|||
* @returns {Promise<void>} |
|||
*/ |
|||
async savePoints (params) { |
|||
let url = null |
|||
if (!this.form.id) { |
|||
// 新增 |
|||
url = '/actual/base/party/member/point/save' |
|||
} else { |
|||
url = '/actual/base/party/member/point/update' |
|||
} |
|||
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 getInfo () { |
|||
const params = { |
|||
year: this.form.year, |
|||
quarter: this.form.quarter, |
|||
partyMemberId: this.form.partyMemberId |
|||
} |
|||
await this.$http |
|||
.post('/actual/base/party/member/point/echoPartyMemberPoint', params) |
|||
.then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} else { |
|||
if (res.data.length > 0) { |
|||
let _info = res.data[0] |
|||
const info = { |
|||
..._info, |
|||
baseOptions: _info.baseOptions.length > 0 ? _info.baseOptions.split(',') : [], |
|||
reviewOptions: _info.reviewOptions.length > 0 ? _info.reviewOptions.split(',') : [], |
|||
inspireOptions: _info.inspireOptions.length > 0 ? _info.inspireOptions.split(',') : [], |
|||
warnOptions: _info.warnOptions.length > 0 ? _info.warnOptions.split(',') : [] |
|||
} |
|||
for (const n in info) { |
|||
this.form[n] = info[n] |
|||
} |
|||
} else { |
|||
this.$refs['ruleForm'].resetFields() |
|||
this.form.quarter = this.quarter |
|||
this.form.year = this.year |
|||
} |
|||
} |
|||
}) |
|||
.catch(err => { |
|||
console.log('err', err) |
|||
return this.$message.error('网络错误') |
|||
}) |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.flex-div { |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
|
|||
.mb20 { |
|||
margin-bottom: 20px; |
|||
} |
|||
|
|||
.mr10 { |
|||
margin-right: 10px; |
|||
} |
|||
|
|||
.pdl74 { |
|||
padding-left: 74px; |
|||
} |
|||
|
|||
.wd-wr { |
|||
/deep/ .el-form-item__content { |
|||
width: calc(100% - 140px); |
|||
} |
|||
|
|||
/deep/ .el-checkbox { |
|||
margin-right: 10px; |
|||
font-weight: 400; |
|||
// line-height: 20px; |
|||
.el-checkbox__label { |
|||
padding-left: 5px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.input-width { |
|||
width: 160px; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,389 @@ |
|||
<template> |
|||
<div> |
|||
<el-dialog :title="'党员中心户'" |
|||
:visible="dlgShow" |
|||
:close-on-click-modal="false" |
|||
@close="handleDlgClose"> |
|||
<div> |
|||
<el-button type="primary" @click="handleAddBtnClick">新增</el-button> |
|||
</div> |
|||
<el-table :data="bindingDatas" |
|||
row-key="id" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column label="党员中心户" align="center" prop="partyMemberName"> |
|||
<template slot-scope="scope"> |
|||
<el-select v-model="scope.row.partyMemberId" |
|||
v-if="scope.row.isEdit" |
|||
filterable> |
|||
<el-option v-for="cm in centerMemberSelectorOptions" |
|||
:key="cm.id" |
|||
:value="cm.id" |
|||
:label="cm.name"> |
|||
</el-option> |
|||
</el-select> |
|||
<div v-else>{{ scope.row.partyMemberName }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="联系家庭" align="center" prop="partyMemberName"> |
|||
<template slot-scope="scope"> |
|||
|
|||
<!--v-model="scope.row.bindedHouses"--> |
|||
<el-cascader :options="bindingHouseOptions" |
|||
clearable |
|||
style="width: 300px" |
|||
placeholder="请选择" |
|||
v-if="scope.row.isEdit" |
|||
@change="" |
|||
:props="bindingProps"> |
|||
</el-cascader> |
|||
<div v-else>{{ scope.row.bindedHousesStr }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="联系家庭" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" @click="handleSaveBtnClicked(scope.row)" v-if="scope.row.isEdit">保存</el-button> |
|||
<el-button type="primary" @click="handleCancelBtnClicked(scope.row)" v-if="scope.row.isEdit">取消 |
|||
</el-button> |
|||
<el-button type="primary" @click="handleDeleteBtnClicked(scope.row)" v-if="!scope.row.isEdit">删除 |
|||
</el-button> |
|||
<el-button type="primary" @click="handleEditBtnClicked(scope.row)" v-if="!scope.row.isEdit">编辑</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
|
|||
import { requestGet, requestPost } from '@/js/dai/request' |
|||
import { EpmetResultResolver } from '@/js/epmet-result-resolver' |
|||
|
|||
export default { |
|||
mounted () { |
|||
// 初始化结果解析器 |
|||
this.epmetResultResolver = new EpmetResultResolver(this) |
|||
}, |
|||
data () { |
|||
return { |
|||
dlgShow: false, |
|||
partyOrgId: null, |
|||
epmetResultResolver: null, |
|||
bindingDatas: [], // 党员中心户列表 |
|||
centerMemberSelectorOptions: [], // 中心户下拉框选择器 |
|||
bindingHouseOptions: [], // 联系家庭下拉框选择器 |
|||
rowInEdit: null, // 编辑中的行 |
|||
bindingProps: { |
|||
lazy: true, |
|||
lazyLoad: ((node, resolve) => { |
|||
this.handleTreeNodeClick(node, resolve) |
|||
}), |
|||
value: 'value', |
|||
label: 'label', |
|||
checkStrictly: false, |
|||
multiple: true |
|||
}, |
|||
formData: { |
|||
partyMemberId: null, |
|||
bindingHouseIds: [] |
|||
} |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
/** |
|||
* 初始化 |
|||
*/ |
|||
init (partyOrgId) { |
|||
this.dlgShow = true |
|||
this.partyOrgId = partyOrgId |
|||
// 加载党员中心户列表 |
|||
this.$nextTick(async () => { |
|||
// await this.loadCenterMember4Selector(partyOrgId) |
|||
// await this.loadHousesTree4Select(partyOrgId) |
|||
await this.loadBindedDatas(partyOrgId) |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* "添加"按钮点击事件 |
|||
*/ |
|||
handleAddBtnClick () { |
|||
// 先检查是否已经有新增了但是没有填写的行 |
|||
let lastRow = this.bindingDatas[this.bindingDatas.length - 1] |
|||
if (lastRow && lastRow.isEdit) { |
|||
this.$message.warning('请逐行填写') |
|||
return |
|||
} |
|||
|
|||
// 添加新行上去 |
|||
let newRow = { |
|||
partyMemberId: null, |
|||
bindedHouses: [], |
|||
isEdit: true |
|||
} |
|||
|
|||
this.bindingDatas.push(newRow); |
|||
|
|||
this.$nextTick(async () => { |
|||
// 加载下拉框 |
|||
await this.loadCenterMember4Selector(this.partyOrgId, 'create') |
|||
await this.loadHousesTree4Select(this.partyOrgId) |
|||
}) |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 关联家庭级联下拉框选中事件 |
|||
* @returns {Promise<void>} |
|||
*/ |
|||
async handleTreeNodeClick(node, resolve) { |
|||
debugger |
|||
console.log('要编辑的数据:', this.rowInEdit) |
|||
|
|||
if (node.root) { |
|||
this.loadHousesTree4Select(this.partyOrgId) |
|||
} else { |
|||
node.children.length = 0 |
|||
let rstArr = await this.loadNextBindingHouseTreeLevel(node.data.nodeType, node.value) |
|||
console.log('返回的下一级数据:', rstArr); |
|||
resolve(rstArr) |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 加载关联家庭的树 |
|||
* @param partyOrgId |
|||
* @returns {Promise<void>} |
|||
*/ |
|||
async loadHousesTree4Select (partyOrgId) { |
|||
let url = '/actual/base/party/org/centerMember/listQuarterOptionsByPartyOrgId' |
|||
|
|||
let rst = await requestGet(url, { |
|||
partyOrgId: partyOrgId |
|||
}) |
|||
|
|||
this.epmetResultResolver.success((data) => { |
|||
for (let e of data) { |
|||
// 级别为小区 |
|||
e.nodeType = 'quarters' |
|||
} |
|||
this.bindingHouseOptions = data |
|||
}).parse(rst) |
|||
}, |
|||
|
|||
/** |
|||
* 加载关联家庭列表 |
|||
*/ |
|||
async loadNextBindingHouseTreeLevel(currNodeType, nodeValue) { |
|||
|
|||
let url |
|||
let param |
|||
let nextNodeType |
|||
|
|||
if (currNodeType === 'quarters') { |
|||
url = '/actual/base/communityBuilding/buildingoption' |
|||
nextNodeType = 'building' |
|||
param = { |
|||
quartersId: nodeValue |
|||
} |
|||
} else if (currNodeType === 'building') { |
|||
url = '/actual/base/communityBuildingUnit/unitoption' |
|||
nextNodeType = 'unit' |
|||
param = { |
|||
buildingId: nodeValue |
|||
} |
|||
} else if (currNodeType === 'unit') { |
|||
url = '/actual/base/communityHouse/listHouses' |
|||
nextNodeType = 'house' |
|||
param = { |
|||
buildingUnitId: nodeValue |
|||
} |
|||
} else { |
|||
return [] |
|||
} |
|||
|
|||
console.log('节点数据:', currNodeType, nodeValue); |
|||
|
|||
let rst = await requestPost(url, param) |
|||
|
|||
let childrenNodes ; |
|||
|
|||
this.epmetResultResolver.success((data) => { |
|||
if (nextNodeType === 'house') { |
|||
data = data.list |
|||
} |
|||
|
|||
for (let e of data) { |
|||
// 级别 |
|||
e.nodeType = nextNodeType |
|||
if (nextNodeType === 'house') { |
|||
e.label = e.houseName |
|||
e.value = e.houseId |
|||
e.leaf = true |
|||
} |
|||
} |
|||
// node.children.length = 0 |
|||
childrenNodes = data; |
|||
}).parse(rst); |
|||
|
|||
return childrenNodes; |
|||
}, |
|||
|
|||
/** |
|||
* 关联家庭下拉框选中变更事件 |
|||
*/ |
|||
// handlebindingCascaderChange (selectedNodes) { |
|||
// this.formData.bindingHouseIds = selectedNodes.map(n => { |
|||
// return n[n.length - 1] |
|||
// }) |
|||
// }, |
|||
|
|||
/** |
|||
* 保存按钮点击事件 |
|||
*/ |
|||
handleSaveBtnClicked (row) { |
|||
let bindedHouseIds = row.bindedHouses.map(h => h[h.length - 1]) |
|||
|
|||
this.saveCenterMemberbindingHome(row.partyMemberId, bindedHouseIds) |
|||
}, |
|||
|
|||
/** |
|||
* 取消按钮点击事件 |
|||
*/ |
|||
handleCancelBtnClicked (row) { |
|||
console.log(row) |
|||
if (row.isNew) { |
|||
// 如果是新数据,就去掉 |
|||
this.bindingDatas.pop() |
|||
} else { |
|||
// 如果是旧数据,就切换编辑状态 |
|||
row.isEdit = false |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 删除按钮点击事件 |
|||
*/ |
|||
async handleDeleteBtnClicked (row) { |
|||
this.$confirm('删除后无法恢复,是否确定?', '警告').then(async () => { |
|||
let url = '/actual/base/party/member/centerMember/deleteByPartyMemberId/' + row.partyMemberId |
|||
let rst = await requestPost(url, {}) |
|||
this.epmetResultResolver.success((data) => { |
|||
this.$message.success('删除成功') |
|||
this.loadBindedDatas(this.partyOrgId) |
|||
}).parse(rst) |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 编辑按钮点击事件 |
|||
*/ |
|||
async handleEditBtnClicked (row) { |
|||
await this.loadHousesTree4Select(this.partyOrgId) |
|||
await this.loadCenterMember4Selector(this.partyOrgId, 'edit')// 以编辑模式重新加载中心户下拉框 |
|||
row.isEdit = true |
|||
|
|||
this.rowInEdit = row; |
|||
|
|||
// for (let house of row.bindedHouses) { |
|||
// let pathIds = house.bindedHouses.pathIds; |
|||
// // this.rescureLoadTree(pathIds, 0); |
|||
// } |
|||
}, |
|||
|
|||
/** |
|||
* 递归加载 |
|||
*/ |
|||
// rescureLoadTree(pathIds, currDepth) { |
|||
// let objectId = pathIds[currDepth]; |
|||
// let currNodeType; |
|||
// if (currDepth === 0) { |
|||
// currNodeType = 'quarters'; |
|||
// } else if (currDepth === 1) { |
|||
// currNodeType = 'building'; |
|||
// } else if (currDepth === 2) { |
|||
// currNodeType = 'unit'; |
|||
// } else if (currDepth === 3) { |
|||
// currNodeType = 'house'; |
|||
// } |
|||
// |
|||
// let childrenNodes = this.loadNextBindingHouseTreeLevel(currNodeType, objectId); |
|||
// |
|||
// }, |
|||
|
|||
/** |
|||
* 打扫战场 |
|||
*/ |
|||
handleDlgClose () { |
|||
this.dlgShow = false |
|||
this.bindingDatas.length = 0 |
|||
this.centerMemberSelectorOptions.length = 0 |
|||
}, |
|||
|
|||
/** |
|||
* 为中心户下拉框提供选项 |
|||
* bindingHomeOptions |
|||
*/ |
|||
async loadCenterMember4Selector (partyOrgId, purpose) { |
|||
let url = '/actual/base/party/member/centerMember/centerMemberList4CreateSelect' |
|||
|
|||
let rst = await requestGet(url, { |
|||
partyOrgId: partyOrgId, |
|||
purpose: purpose |
|||
}) |
|||
|
|||
this.epmetResultResolver.success((data) => { |
|||
this.centerMemberSelectorOptions = data |
|||
}).parse(rst) |
|||
}, |
|||
|
|||
/** |
|||
* 加载已经绑定的数据 |
|||
* @returns {Promise<void>} |
|||
*/ |
|||
async loadBindedDatas (partyOrgId) { |
|||
let url = '/actual/base/party/member/centerMember/listCenterMemberBindingHouses' |
|||
|
|||
let rst = await requestGet(url, { |
|||
partyOrgId: partyOrgId |
|||
}) |
|||
|
|||
this.epmetResultResolver.success((data) => { |
|||
|
|||
for (let row of data) { |
|||
let bindedHouses = row.bindedHouses |
|||
let houseNames = bindedHouses.map(e => e.houseName) |
|||
row.bindedHousesStr = houseNames.join(',') |
|||
row.isEdit = false |
|||
row.isNew = false |
|||
} |
|||
|
|||
this.bindingDatas = data; |
|||
}).parse(rst) |
|||
}, |
|||
|
|||
/** |
|||
* 保存党员中心户-家庭绑定关系 |
|||
* @param partyMemberId |
|||
* @param bindedHouseIds |
|||
*/ |
|||
async saveCenterMemberbindingHome (partyMemberId, bindedHouseIds) { |
|||
let url = '/actual/base/party/member/centerMember/createCenterMemberBindingHome' |
|||
let rst = await requestPost(url, { |
|||
partyMemberId: partyMemberId, |
|||
partyOrgId: this.partyOrgId, |
|||
bindedHouseIds: bindedHouseIds |
|||
}) |
|||
|
|||
this.epmetResultResolver.success(async (data) => { |
|||
await this.loadBindedDatas(this.partyOrgId) |
|||
// 重新加载中心户下拉框 + 房屋级联框 |
|||
await this.loadCenterMember4Selector(this.partyOrgId, 'create') |
|||
await this.loadHousesTree4Select(this.partyOrgId) |
|||
}).parse(rst) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
Loading…
Reference in new issue