Browse Source

Merge branch 'dev-policy0718' into dev

test
jiangyy 3 years ago
parent
commit
6aa5b872a3
  1. BIN
      src/assets/img/icon-del.png
  2. 89
      src/views/modules/communityService/policy/addPolicy.vue
  3. 2
      src/views/modules/communityService/policy/personList.vue
  4. 143
      src/views/modules/communityService/policy/personListItem.vue
  5. 12
      src/views/modules/communityService/policy/policyList.vue
  6. 732
      src/views/modules/communityService/policy/rule.vue

BIN
src/assets/img/icon-del.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

89
src/views/modules/communityService/policy/addPolicy.vue

@ -10,9 +10,10 @@
class="div_form">
<el-form-item label="政策级别"
style="display: block"
label-width="150px"
prop="policyLevel">
<el-select class="item_width_1"
<el-select class="item_width_2"
v-model="formData.policyLevel"
placeholder="全部"
clearable>
@ -26,6 +27,7 @@
</el-form-item>
<el-form-item label="政策日期"
style="display: block"
label-width="150px"
prop="startDate">
<el-date-picker v-model="formData.startDate"
@ -92,13 +94,13 @@
prop="principalName"
label-width="150px"
style="display: block">
<rule :ref="'ref_rule'+index"></rule>
<rule :ref="'ref_rule'+index"
:formType="formType"></rule>
</el-form-item>
<div v-if="index===(ruleList.length-1)"
class="btn-add-rule">
<el-button type="primary"
size="mini"
plain
@click="addRule">增加细则</el-button>
</div>
</div>
@ -146,7 +148,7 @@
size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
@click="handleAdd"> </el-button>
</div>
</div>
</template>
@ -287,9 +289,14 @@ export default {
this.formData = data
if (data.attachmentList) {
this.fileList = data.attachmentList
}
this.$nextTick(() => {
data.ruleList.forEach((element, index) => {
this.$refs['ref_rule' + index][0].setRule(element.resiRuleList, element.houseRuleList, element.statRuleList)
});
})
@ -363,28 +370,66 @@ export default {
},
async handleComfirm () {
this.handleAdd()
},
async handleAdd () {
let isOk = false
this.ruleList.forEach((oneRule, index) => {
if (!oneRule.ruleName) {
this.$message.error('政策细则不能为空')
isOk = false
}
// if (!oneRule.ruleName) {
// this.$message.error('')
// isOk = false
// }
let refObj = this.$refs['ref_rule' + index][0]
refObj.getRule()
refObj.getRule(true, true, true)
if (refObj.okflag) {
oneRule.resiRuleList = refObj.resiRuleList
oneRule.resiRuleList.forEach(element => {
element.itemList = []
element.colOption = []
if (!element.colValLabel) {
element.colValLabel = element.colVal
}
if (!element.nextLogicalRelName) {
element.nextLogicalRelName = ''
}
element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName
});
oneRule.houseRuleList = refObj.houseRuleList
oneRule.houseRuleList.forEach(element => {
element.itemList = []
element.colOption = []
if (!element.colValLabel) {
element.colValLabel = element.colVal
}
if (!element.nextLogicalRelName) {
element.nextLogicalRelName = ''
}
element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName
});
oneRule.statRuleList = refObj.statRuleList
oneRule.statRuleList.forEach(element => {
element.itemList = []
element.colOption = []
if (!element.colValLabel) {
element.colValLabel = element.colVal
}
if (!element.nextLogicalRelName) {
element.nextLogicalRelName = ''
}
element.ruleDesc = element.itemGroupName + element.itemLabel + element.queryTypeName + element.colValLabel + element.nextLogicalRelName
});
isOk = true
} else {
@ -393,16 +438,21 @@ export default {
}
});
if (!isOk) {
return false
}
this.formData.ruleList = this.ruleList
console.log(this.formData.ruleList)
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
}, 5000)
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
@ -418,6 +468,7 @@ export default {
async addFuwu () {
console.log(this.formData)
this.formData.attachmentList = [...this.fileList]
let url = '/heart/policy/add'
if (this.formType === 'add') {
@ -440,6 +491,7 @@ export default {
this.resetData()
this.$emit('handleOk')
} else {
this.btnDisable = false
this.$message.error(msg)
}
},
@ -616,8 +668,9 @@ export default {
@import "@/assets/scss/modules/management/form-main.scss";
.btn-add-rule {
margin-left: 150px;
display: flex;
justify-content: center;
justify-content: flex-start;
margin-bottom: 20px;
}

2
src/views/modules/communityService/policy/personList.vue

@ -1,5 +1,5 @@
<template>
<div class="div_main">
<div class="dialog-h-content scroll-h div_main">
<div v-for="(item,index) in ruleList"
:key="index">
<div class="div_name">{{'政策细则'+(index+1)}}{{item.ruleName}}</div>

143
src/views/modules/communityService/policy/personListItem.vue

@ -7,20 +7,15 @@
ref="ref_searchform"
:label-width="'90px'">
<div>
<el-form-item label="所属网格"
<el-form-item label="所属组织"
prop="orgId">
<el-select v-model.trim="formData.orgId"
placeholder="请选择"
size="small"
clearable
class="item_width_2"
@change="handleChangeGrid">
<el-option v-for="item in optionsG"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-cascader class="customer_cascader"
ref="myCascader"
v-model="agencyIdArray"
:options="orgOptions"
:props="orgOptionProps"
:show-all-levels="false"
@change="handleChangeAgency"></el-cascader>
</el-form-item>
@ -127,7 +122,7 @@
class="diy-button--reset"
@click="resetSearch">重置</el-button>
<el-button style="margin-left:10px"
class="diy-button--reset"
class="diy-button--add"
size="small"
@click="handleExport">导出</el-button>
</div>
@ -226,13 +221,16 @@ export default {
],
formData: {
gridId: '',
agencyId: '',
orgId: '',
orgType: '',
ruleId: '',
ruleList: {},
name: '',
mobile: '',
idCard: '',
remark: '',
reason: '',
neighborHoodId: '',
buildingId: '',
unitId: '',
@ -243,9 +241,18 @@ export default {
optionsH: [],
optionsD: [],
optionsG: [],
orgOptions: [],
agencyIdArray: [],
tableData: [],
orgOptionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
}
}
},
components: {
@ -259,7 +266,7 @@ export default {
},
async mounted () {
this.getGridList()
this.getOrgTreeList()
await this.loadTable()
@ -274,7 +281,7 @@ export default {
async loadTable () {
this.tableLoading = true
const url = "/heart/policy/resiuserlist"
const url = "/data/aggregator/icuser/listByPolicyRules"
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icEpidemicSpecialAttention/list"
let params = {
pageSize: this.pageSize,
@ -296,14 +303,38 @@ export default {
this.tableLoading = false
},
handleChangeGrid (val) {
console.log('val', val)
handleChangeAgency (val) {
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data
if (obj) {
if (obj.level === 'grid') {
this.formData.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.orgType = 'grid'
this.formData.gridId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.agencyId = ''
} else {
this.formData.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.orgType = 'agency'
this.formData.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.formData.gridId = ''
}
} else {
this.formData.orgId = ''
this.formData.orgType = ''
this.formData.agencyId = ''
this.formData.gridId = ''
}
this.formData.neighborHoodId = ''
this.formData.buildingId = ''
this.formData.unitId = ''
this.formData.houseId = ''
this.getValiheList()
},
handleChangeV (val) {
console.log('val', val)
this.formData.buildingId = ''
@ -324,16 +355,17 @@ export default {
this.formData.houseId = ''
this.getHouseList()
},
getGridList () {
getOrgTreeList () {
const { user } = this.$store.state
this.$http
.post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' })
.post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
this.optionsG = res.data
console.log('获取组织树成功', res.data)
this.orgOptions = []
this.orgOptions.push(res.data)
}
})
.catch(() => {
@ -343,7 +375,7 @@ export default {
getValiheList () {
const { user } = this.$store.state
this.$http
.post('/gov/org/icneighborhood/neighborhoodoption', { orgId: this.formData.GRID_ID, agencyId: user.agencyId })
.post('/gov/org/icneighborhood/neighborhoodoption', { gridId: this.formData.gridId, agencyId: this.formData.agencyId })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
@ -405,15 +437,16 @@ export default {
//
resetSearch () {
this.agencyIdArray = []
this.formData = {
orgId: '',
orgType: '',
ruleId: '',
ruleList: [],
ruleList: {},
name: '',
mobile: '',
idCard: '',
remark: '',
reason: '',
neighborHoodId: '',
buildingId: '',
unitId: '',
@ -437,21 +470,41 @@ export default {
//
async handleExport () {
let title = '核酸检测关注名单'
const url = "/epmetuser/icEpidemicSpecialAttention/vaccination-export"
this.exportBtn = true
this.exportBtnTitle = '正在导出...'
let params = {
...this.formData
}
app.ajax.exportFilePost(
url,
this.formData,
(data, rspMsg) => {
this.download(data, title + '.xlsx')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
}
);
await this.$http({
method: 'POST',
url: '/heart/policy/export-resiuser',
responseType: 'blob',
data: params
})
.then(res => {
console.log('resllll', res)
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1])
console.log('filename', fileName)
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
var url = window.URL.createObjectURL(blob)
var aLink = document.createElement('a')
aLink.style.display = 'none'
aLink.href = url
aLink.setAttribute('download', fileName)
document.body.appendChild(aLink)
aLink.click()
document.body.removeChild(aLink) //
window.URL.revokeObjectURL(url) //blob
})
.catch((err) => {
console.log('获取导出情失败', err)
this.$message.error('获取导出失败')
})
this.exportBtnTitle = '导出'
this.exportBtn = false
},
@ -520,9 +573,9 @@ export default {
required: ''
},
ruleList: {
type: Array,
type: Object,
default () {
return []
return {}
}
},

12
src/views/modules/communityService/policy/policyList.vue

@ -131,7 +131,7 @@
<el-button @click="handleDetail(scope.row)"
type="text"
size="small"
class=".div-table-button--detail">详情</el-button>
class="div-table-button--detail">详情</el-button>
<el-button @click="handleEdit(scope.row)"
type="text"
size="small"
@ -355,13 +355,13 @@ export default {
this.policyId = row.policyId
this.$confirm("确认取消服务?", "提示", {
this.$confirm("确认删除政策?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.cancelFuwu()
this.delPolicy()
})
.catch(err => {
if (err == "cancel") {
@ -370,18 +370,14 @@ export default {
// message: ""
// });
}
});
},
async cancelFuwu () {
async delPolicy () {
const url = `/heart/policy/delete/${this.policyId}`;
const { data, code, msg } = await requestPost(url, {});
if (code === 0) {

732
src/views/modules/communityService/policy/rule.vue

File diff suppressed because it is too large
Loading…
Cancel
Save