Browse Source

党员管理

shibei_master
13176889840 3 years ago
parent
commit
0a47e1e159
  1. 2
      src/utils/request.js
  2. 220
      src/views/modules/communityParty/members/cpts/points.vue
  3. 222
      src/views/modules/communityParty/members/cpts/record.vue
  4. 186
      src/views/modules/communityParty/members/crateForm.vue
  5. 69
      src/views/modules/communityParty/members/index.vue

2
src/utils/request.js

@ -21,7 +21,7 @@ http.interceptors.request.use(config => {
// 默认参数
var defaults = {}
// 防止缓存,GET请求默认带_t参数
if (config.method === 'get') {
if (config.method == 'get') {
config.params = {
...config.params,
...{ '_t': new Date().getTime() }

220
src/views/modules/communityParty/members/cpts/points.vue

@ -1,68 +1,87 @@
<template>
<div class="p-wr">
<div class="flex-div mb20 pdl74">
<div class="mr10">评分周期</div>
<div class="mr10">
<el-date-picker
v-model="form.year"
type="year"
placeholder="选择年">
</el-date-picker>
</div>
<div class="mr10">
<el-select v-model="form.quarter" placeholder="请选择" class="input-width" clearable>
<el-option
v-for="item in quarterList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div>
<el-button
type="primary"
size="small"
>保存</el-button>
</div>
</div>
<el-form label-width="140px" :model="form" :inline="true" ref="ruleForm"
<el-form label-width="140px" :model="form" :inline="true"
:disabled="disabled" :rules="rules" ref="ruleForm"
class="form-wr">
<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"
:disabled="btnDisabled"
@click="hadnleSubmitbase"
>保存</el-button>
</div>
</div>
</el-form-item>
<el-form-item label="基础积分分值" prop="basePoint">
<el-input v-model="form.basePoint" placeholder="请输入" class="input-width" clearable />
<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.label" :value="item.value" />
<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" placeholder="请输入" class="input-width" clearable></el-input>
<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.label" :value="item.value" />
<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" placeholder="请输入" class="input-width" clearable />
<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.label" :value="item.value" />
<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" placeholder="请输入" class="input-width" clearable />
<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.label" :value="item.value" />
<el-checkbox v-for="item in jinshiOptions" :key="item.value" :label="item.value">
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</div>
@ -73,8 +92,21 @@
<script>
export default {
props: {
partyId: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
btnDisabled: false,
year: '',
quarter: '',
form: {
partyMemberId: '',
year: '',
@ -88,34 +120,38 @@ export default {
warnPoint: '',
warnOptions: [],
},
rules: {
year: [{ required: true, message: '年度不能为空', trigger: 'blur' }],
quarter: [{ required: true, message: '季度不能为空', trigger: 'blur' }]
},
formItemWd: '500px',
quarterList: [
{
label: '第一季度',
value: 1
value: '1'
},
{
label: '第二季度',
value: 2
value: '2'
},
{
label: '第三季度',
value: 3
value: '3'
},
{
label: '第四季度',
value: 4
value: '4'
}
],
baseOptions: [
{
label: '参加三会一课',
value: 1
value: '1'
},
{
label: '参加主题党日',
value: 2
value: '2'
},
{
@ -124,80 +160,152 @@ export default {
},
{
label: '积极参加学习培训',
value: 4
value: '4'
},
{
label: '自觉执行党组织会议',
value: 5
value: '5'
},
{
label: '严守党的政治纪律和政治规矩',
value: 6
value: '6'
},
],
jiliOptions: [
{
label: '发挥先锋模范作用',
value: 1
value: '1'
},
{
label: '维护社会和谐稳定',
value: 2
value: '2'
},
{
label: '参与社会治理',
value: 3
value: '3'
},
{
label: '联系服务群众',
value: 4
value: '4'
}
],
jinshiOptions: [
{
label: '不服从党组织安排',
value: 1
value: '1'
},
{
label: '不按时足额缴纳党费',
value: 2
value: '2'
},
{
label: '无故长期脱离组织管理',
value: 3
value: '3'
},
{
label: '在工作中出现不良影响',
value: 4
value: '4'
},
{
label: '违反党的纪律',
value: 5
value: '5'
}
],
pyiOptions: [
{
label: '个人自评',
value: 1
value: '1'
},
{
label: '党员互评',
value: 2
value: '2'
},
{
label: '民主测评',
value: 3
value: '3'
}
]
}
},
watch: {
partyId: {
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: {
handleQuaterChange(val) {
if (this.form.year) {
this.getInfo()
}
this.quarter = val
},
handleYearChange(val) {
this.year = val
},
hadnleSubmitbase() {
if (!this.partyId) return
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.$emit('save', { ...this.form, partyMemberId: this.partyId })
} else {
console.log('error submit!!');
return false;
}
});
},
async getInfo() {
const params = {
year: this.form.year,
quarter: this.form.quarter,
partyMemberId: this.partyId
}
await this.$http
.post('/resi/partymember/icPartyMemberPoint/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>

222
src/views/modules/communityParty/members/cpts/record.vue

@ -1,7 +1,8 @@
<template>
<div>
<div style="padding-right: 20px;">
<div class="mt10">
<el-button size="small" class="diy-button--add" @click="handleAdd">新增</el-button>
<el-button size="small" class="diy-button--add" :disabled="btnDisabled || disabled"
@click="handleAdd">新增</el-button>
</div>
<el-table
:data="tableData"
@ -25,9 +26,10 @@
v-if="scope.row.isEdit"
v-model="scope.row.payDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
<div v-else class="div-content">{{ scope.row.payTime }}</div>
<div v-else class="div-content">{{ scope.row.payDate }}</div>
</template>
</el-table-column>
<el-table-column
@ -37,7 +39,7 @@
width="180px"
>
<template slot-scope="scope">
<el-input v-if="scope.row.isEdit" v-model="scope.row.money" placeholder="请输入"
<el-input v-if="scope.row.isEdit" type="number" v-model="scope.row.money" placeholder="请输入"
class="input-width" clearable></el-input>
<div v-else class="div-content">{{ scope.row.money }}</div>
</template>
@ -46,36 +48,62 @@
prop="name"
label="缴费年度"
align="center"
min-width="250px"
>
<template slot-scope="scope">
<el-date-picker
v-if="scope.row.isEdit"
v-model="scope.row.timeRange"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
end-placeholder="结束日期"
@change="handleTimeChangePay($event, scope.row)">
</el-date-picker>
<div v-else class="div-content">{{ scope.row.timeRange }}</div>
<div v-else class="div-content">{{ scope.row.startDate + ' - ' + scope.row.endDate }}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button
v-if="scope.row.isEdit"
@click="handleEdit(scope.row, 'save')"
<template v-if="scope.row.isEdit">
<el-button
@click="handleEdit(scope.row)"
type="text"
size="small"
class="btn-color-edit"
>保存</el-button>
<el-button
v-else
@click="handleEdit(scope.row, 'edit')"
<el-button
@click="handleChange(scope.row, 'cancle')"
type="text"
size="small"
class="btn-color-edit"
>取消</el-button>
</template>
<template v-else>
<el-button
@click="handleChange(scope.row, 'edit')"
type="text"
size="small"
:disabled="disabled"
class="btn-color-edit"
>修改</el-button>
<el-button type="text" size="small" class="btn-color-del">删除</el-button>
<el-popconfirm
title="删除之后无法恢复,确认删除?"
@onConfirm="del(scope.row)"
>
<el-button
slot="reference"
type="text"
size="small"
class="btn-color-del"
style="margin-left: 10px;"
>删除</el-button
>
</el-popconfirm>
<!-- <el-button type="text" size="small" :disabled="disabled" class="btn-color-del"
@click="del(scope.row)">删除</el-button> -->
</template>
</template>
</el-table-column>
</el-table>
@ -84,24 +112,88 @@
<script>
export default {
props: {
partyId: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
tableData: []
btnDisabled: false,
btnType: 'add',
isEdit: false,
tableData: [],
tempRow: {}
}
},
watch: {
partyId: {
handler(val) {
console.log('val------points', val)
if (val.length > 0) {
this.btnDisabled = false
this.getList()
} else this.btnDisabled = true
},
immediate: true
}
},
created() {
// if (this.partyId) this.getList()
},
methods: {
getRowClass({ rowIndex, columnIndex }) {
if (rowIndex === 0) {
return 'background: #2195fe; color: #fff;'
}
},
handleEdit(row) {
row.isEdit = !row.isEdit
handleChange(row, type) {
console.log('type----', type)
if (type == 'cancle') {
row = { ...this.tempRow }
row.isEdit = false
row.timeRange = []
if (this.btnType == 'add') this.tableData.pop()
console.log('row----', row)
} else {
this.tempRow = { ...row }
row.isEdit = true
row.timeRange = [row.startDate, row.endDate]
}
this.btnType = type
this.isEdit = !this.isEdit
},
handleTimeChangePay(val, row) {
console.log('vall', val)
console.log('varowll', row)
if (val != null && val.length > 0) {
row.startDate = val[0]
row.endDate = val[1]
} else {
row.startDate = ''
row.endDate = ''
row.timeRange = []
}
},
async handleEdit(row) {
if (this.btnType == 'add') this.save(row)
else this.edit(row)
},
handleAdd() {
this.btnType = 'add'
this.isEdit = true
const item = {
isEdit: true,
partyMemberId: '',
partyMemberId: this.partyId,
payDate: '',
money: '',
startDate: '',
@ -109,7 +201,99 @@ export default {
timeRange: ''
}
this.tableData.push(item)
}
},
async save(row) {
const params = {
partyMemberId: this.partyId,
payDate: row.payDate,
money: row.money,
startDate: row.startDate,
endDate: row.endDate,
}
await this.$http
.post('/resi/partymember/icPartyMemberPayRecord/save', params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.$message.success('保存成功')
row.isEdit = false
this.isEdit = false
this.getList()
}
})
.catch(err => {
console.log('err', err)
return this.$message.error('网络错误')
})
},
async edit(row) {
const params = {
...row
}
await this.$http
.post('/resi/partymember/icPartyMemberPayRecord/update', params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.$message.success('保存成功')
row.isEdit = false
this.isEdit = false
this.getList()
}
})
.catch(err => {
console.log('err', err)
return this.$message.error('网络错误')
})
},
async del(row) {
const params = {
...row
}
await this.$http
.post('/resi/partymember/icPartyMemberPayRecord/delete', [row.id])
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.$message.success('删除成功')
this.getList()
}
})
.catch(err => {
console.log('err', err)
return this.$message.error('网络错误')
})
},
async getList() {
const params = {
page: 1,
limit: 9999,
partyMemberId: this.partyId
}
await this.$http
.get('/resi/partymember/icPartyMemberPayRecord/page', { params: params, } )
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.tableData = res.data.list.map(item => {
return {
...item,
isEdit: false,
timeRange: []
}
})
}
})
.catch(err => {
console.log('err', err)
return this.$message.error('网络错误')
})
},
}
}
</script>

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

@ -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('网络错误')
})
}
}
}

69
src/views/modules/communityParty/members/index.vue

@ -110,7 +110,7 @@
<div class="resi-row-btn">
<el-button class="diy-button--add" size="small" @click="handleAdd">新增</el-button>
<el-button
<!-- <el-button
class="diy-button--export"
size="small"
@click="handleExportModule('room')">下载模板</el-button>
@ -129,7 +129,7 @@
>
<el-button size="small" class="diy-button--delete" :loading="importLoading">{{importBtnTitle}}</el-button>
</el-upload>
<el-button class="diy-button--reset" size="small" :loading="exportBtn" @click="handleExport">{{ exportBtnTitle }}</el-button>
<el-button class="diy-button--reset" size="small" :loading="exportBtn" @click="handleExport">{{ exportBtnTitle }}</el-button> -->
</div>
@ -294,7 +294,9 @@
:close-on-click-modal="false"
:before-close="handlerCancle"
>
<crate-form :partyList="optionsG" />
<crate-form v-if="dialogVisible" :info="detailInfo" :partyList="optionsG"
:disabled="disabled"
@saveBase="handleSearch" @cancle="handlerCancle" />
</el-dialog>
</div>
@ -410,6 +412,7 @@ export default {
payStatrDate: '',
payEndDate: ''
},
detailInfo: {},
partyProps: {
label: 'partyOrgName',
value: 'partyOrgCode'
@ -684,10 +687,7 @@ export default {
},
handlerCancle() {
for(const n in this.form) {
this.form[n] = ''
if (n === 'imageList') this.form[n] = []
}
this.detailInfo = {}
this.disabled = false
this.dialogVisible = false
},
@ -698,62 +698,25 @@ export default {
async handleEdit(row, addType) {
// this.form = { ...row }
await this.getDetail(row.id)
// this.dialogVisible = true
},
async addNew() {
const { user } = await this.$store.state
const _form = {
...this.form,
agencyId: user.agencyId
}
await this.$http
.post('/resi/partymember/icpartymemberstyle/save', _form)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.$message.success('操作成功')
this.handlerCancle()
this.getTableData()
}
})
.catch(err => {
console.log('err', err)
return this.$message.error('网络错误')
})
this.btnLoading = false
this.dialogVisible = true
},
handleSUbmit() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
this.btnLoading = true
this.addNew()
} else {
console.log('error submit!!');
return false;
}
});
},
handleDel(row) {
let params = {
id: row.id
ids: [row.id]
}
console.log('row1', row)
this.$http
.post('/resi/partymember/icpartymemberstyle/delete', params)
.post('/resi/partymember/icPartyMember/delete', [row.id])
.then(({ data: res }) => {
console.log('row2', row)
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('row3', row)
this.$message.success('删除成功')
this.getTableData()
}
})
.catch((err) => {
console.log('row4', err)
return this.$message.error('网络错误')
})
},
@ -762,18 +725,12 @@ export default {
id,
}
this.$http
.post('/resi/partymember/icpartymemberstyle/detail', params)
.post(`/resi/partymember/icPartyMember/${id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.form = { ...res.data }
const _arr = this.optionsEditC.map(item => item.categoryId)
if (!_arr.includes(res.data.categoryId) && !this.disabled) this.form.categoryId = ''
// this.optionsEditC.forEach(item => {
// if (item.categoryId === res.data.categoryId)
// })
this.detailInfo = { ...res.data }
this.dialogVisible = true
}
})
@ -787,7 +744,7 @@ export default {
console.log('user---ppp', user)
// addorupdate query
await this.$http
.get('/resi/partymember/icPartyOrg/getTreelist', { agencyId: agencyId || user.agencyId, })
.get('/resi/partymember/icPartyOrg/getTreelist', { params: {agencyId: agencyId || user.agencyId} })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)

Loading…
Cancel
Save