jiangyy 3 years ago
parent
commit
b693d443a7
  1. BIN
      src/assets/img/icon-del.png
  2. 9
      src/views/modules/communityService/policy/addPolicy.vue
  3. 87
      src/views/modules/communityService/policy/personListItem.vue
  4. 50
      src/views/modules/communityService/policy/rule.vue

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

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

@ -289,6 +289,10 @@ export default {
this.formData = data this.formData = data
if (data.attachmentList) {
this.fileList = data.attachmentList
}
this.$nextTick(() => { this.$nextTick(() => {
data.ruleList.forEach((element, index) => { data.ruleList.forEach((element, index) => {
@ -375,7 +379,7 @@ export default {
// } // }
let refObj = this.$refs['ref_rule' + index][0] let refObj = this.$refs['ref_rule' + index][0]
refObj.getRule() refObj.getRule(true, true, true)
if (refObj.okflag) { if (refObj.okflag) {
oneRule.resiRuleList = refObj.resiRuleList oneRule.resiRuleList = refObj.resiRuleList
oneRule.resiRuleList.forEach(element => { oneRule.resiRuleList.forEach(element => {
@ -464,6 +468,7 @@ export default {
async addFuwu () { async addFuwu () {
console.log(this.formData) console.log(this.formData)
this.formData.attachmentList = [...this.fileList]
let url = '/heart/policy/add' let url = '/heart/policy/add'
if (this.formType === 'add') { if (this.formType === 'add') {
@ -663,7 +668,7 @@ export default {
@import "@/assets/scss/modules/management/form-main.scss"; @import "@/assets/scss/modules/management/form-main.scss";
.btn-add-rule { .btn-add-rule {
margin-left: 70px; margin-left: 150px;
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
margin-bottom: 20px; margin-bottom: 20px;

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

@ -7,20 +7,15 @@
ref="ref_searchform" ref="ref_searchform"
:label-width="'90px'"> :label-width="'90px'">
<div> <div>
<el-form-item label="所属网格" <el-form-item label="所属组织"
prop="orgId"> prop="orgId">
<el-select v-model.trim="formData.orgId" <el-cascader class="customer_cascader"
placeholder="请选择" ref="myCascader"
size="small" v-model="agencyIdArray"
clearable :options="orgOptions"
class="item_width_2" :props="orgOptionProps"
@change="handleChangeGrid"> :show-all-levels="false"
<el-option v-for="item in optionsG" @change="handleChangeAgency"></el-cascader>
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item> </el-form-item>
@ -226,13 +221,16 @@ export default {
], ],
formData: { formData: {
gridId: '',
agencyId: '',
orgId: '',
orgType: '',
ruleId: '', ruleId: '',
ruleList: {}, ruleList: {},
name: '', name: '',
mobile: '', mobile: '',
idCard: '', idCard: '',
remark: '',
reason: '',
neighborHoodId: '', neighborHoodId: '',
buildingId: '', buildingId: '',
unitId: '', unitId: '',
@ -243,9 +241,18 @@ export default {
optionsH: [], optionsH: [],
optionsD: [], optionsD: [],
optionsG: [], optionsG: [],
orgOptions: [],
agencyIdArray: [],
tableData: [], tableData: [],
orgOptionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
}
} }
}, },
components: { components: {
@ -259,7 +266,7 @@ export default {
}, },
async mounted () { async mounted () {
this.getGridList() this.getOrgTreeList()
await this.loadTable() await this.loadTable()
@ -296,14 +303,38 @@ export default {
this.tableLoading = false 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.neighborHoodId = ''
this.formData.buildingId = '' this.formData.buildingId = ''
this.formData.unitId = '' this.formData.unitId = ''
this.formData.houseId = '' this.formData.houseId = ''
this.getValiheList() this.getValiheList()
}, },
handleChangeV (val) { handleChangeV (val) {
console.log('val', val) console.log('val', val)
this.formData.buildingId = '' this.formData.buildingId = ''
@ -324,16 +355,17 @@ export default {
this.formData.houseId = '' this.formData.houseId = ''
this.getHouseList() this.getHouseList()
}, },
getGridList () { getOrgTreeList () {
const { user } = this.$store.state const { user } = this.$store.state
this.$http this.$http
.post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' }) .post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} else { } else {
console.log('获取查询详情成功', res.data) console.log('获取组织树成功', res.data)
this.optionsG = res.data this.orgOptions = []
this.orgOptions.push(res.data)
} }
}) })
.catch(() => { .catch(() => {
@ -343,7 +375,7 @@ export default {
getValiheList () { getValiheList () {
const { user } = this.$store.state const { user } = this.$store.state
this.$http 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 }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -405,15 +437,16 @@ export default {
// //
resetSearch () { resetSearch () {
this.agencyIdArray = []
this.formData = { this.formData = {
orgId: '',
orgType: '',
ruleId: '', ruleId: '',
ruleList: {}, ruleList: {},
name: '', name: '',
mobile: '', mobile: '',
idCard: '', idCard: '',
remark: '',
reason: '',
neighborHoodId: '', neighborHoodId: '',
buildingId: '', buildingId: '',
unitId: '', unitId: '',

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

@ -107,10 +107,9 @@
</el-option> </el-option>
</el-select> </el-select>
<el-button icon="el-icon-remove-outline" <img class="img_del"
circle src="@/assets/img/icon-del.png"
@click="delPerson(personIndex)" @click="delPerson(personIndex)">
type="danger"></el-button>
</div> </div>
@ -198,10 +197,13 @@
</el-option> </el-option>
</el-select> </el-select>
<el-button icon="el-icon-remove-outline" <img class="img_del"
src="@/assets/img/icon-del.png"
@click="delHouse(houseIndex)">
<!-- <el-button icon="el-icon-remove-outline"
circle circle
@click="delHouse(houseIndex)" @click="delHouse(houseIndex)"
type="danger"></el-button> type="danger"></el-button> -->
</div> </div>
@ -288,10 +290,9 @@
</el-option> </el-option>
</el-select> </el-select>
<el-button icon="el-icon-remove-outline" <img class="img_del"
circle src="@/assets/img/icon-del.png"
@click="delStatic(staticIndex)" @click="delStatic(staticIndex)">
type="danger"></el-button>
</div> </div>
</div> </div>
@ -502,10 +503,10 @@ export default {
}, },
getRule () { getRule (valPerson, valHouse, valStatic) {
this.okflag = false this.okflag = false
let messageObj = this.validateRule() let messageObj = this.validateRule(valPerson, valHouse, valStatic)
// console.log('resiRuleList', this.resiRuleList) // console.log('resiRuleList', this.resiRuleList)
// console.log('houseRuleList', this.houseRuleList) // console.log('houseRuleList', this.houseRuleList)
@ -533,10 +534,10 @@ export default {
}, },
validateRule () { validateRule (valPerson, valHouse, valStatic) {
let message = '' let message = ''
if (valPerson) {
this.resiRuleList.forEach((item, index) => { this.resiRuleList.forEach((item, index) => {
if (index === this.resiRuleList.length - 1) { if (index === this.resiRuleList.length - 1) {
@ -563,6 +564,10 @@ export default {
} }
}); });
}
if (valHouse) {
this.houseRuleList.forEach((item, index) => { this.houseRuleList.forEach((item, index) => {
@ -586,7 +591,9 @@ export default {
} }
} }
}); });
}
if (valStatic) {
this.statRuleList.forEach((item, index) => { this.statRuleList.forEach((item, index) => {
if (index === this.statRuleList.length - 1) { if (index === this.statRuleList.length - 1) {
if (item.queryType === '' || if (item.queryType === '' ||
@ -607,13 +614,19 @@ export default {
} }
} }
}); });
}
return message return message
}, },
handlePreview () { handlePreview () {
this.getRule() if (!this.personChecked && !this.houseChecked && !this.staticChecked) {
this.$message.info('请勾选要预览的规则')
return false
}
this.getRule(this.personChecked, this.houseChecked, this.staticChecked)
if (!this.okflag) { if (!this.okflag) {
return false return false
} }
@ -1148,4 +1161,11 @@ export default {
/deep/.el-checkbox:last-of-type { /deep/.el-checkbox:last-of-type {
margin-right: 10px; margin-right: 10px;
} }
.img_del {
width: 25px;
height: 25px;
margin-top: 6px;
cursor: pointer;
}
</style> </style>

Loading…
Cancel
Save