+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-

-

+ @click="delRule(ruleIndex)">
+
+
+

+
保存为常用查询条件
+
@@ -243,17 +206,13 @@ export default {
personChecked: false,
houseChecked: false,
- houseSel: true,
- personSel: false,
-
- selSmartType: 'fangwu',
- smartList1: [
+ smartList: [
{
- value: 'fangwu',
+ value: 'house',
label: '房屋信息'
},
{
- value: 'jumin',
+ value: 'person',
label: '居民信息'
}
],
@@ -271,55 +230,53 @@ export default {
],
houseItemList: [],//房屋信息第二列
- resiRuleList: [
- {
- ruleDesc: '',//规则描述文字,例如:基础信息性别等于女
- nextLogicalRel: '',//与上一条的关系;and、or
- itemGroupId: '',
- itemId: '',
- queryType: '',
- colTable: '',
- colKey: '',
- colVal: '',
+ okflag: false,
- itemList: [],
- colType: '',//详细参数的组件类型
- colOption: [],
- itemGroupName: '',
- itemLabel: '',
- queryTypeName: '',
- colValLabel: '',
- nextLogicalRelName: '',
- }
- ],
+ showPersonList: false,
+ ruleList: {},
- houseRuleList: [
+ smartRuleList: [
{
- ruleDesc: '',
+ selSmartType: 'house',
nextLogicalRel: '',//与上一条的关系;and、or
- queryType: '',
- colTable: '',
- colKey: '',
- colVal: '',
-
- titleName: '房屋信息',
- colType: '',//详细参数的组件类型
- colOption: [],
- itemGroupName: '房屋信息',
- itemLabel: '',
- queryTypeName: '',
- colValLabel: '',
nextLogicalRelName: '',
- }
- ],
- houseTitleName: '房屋信息',
-
- okflag: false,
+ houseRule: {
+ ruleDesc: '',
+ queryType: '',
+ colTable: '',
+ colKey: '',
+ colVal: '',
+
+ titleName: '房屋信息',
+ colType: '',//详细参数的组件类型
+ colOption: [],
+ itemGroupName: '房屋信息',
+ itemLabel: '',
+ queryTypeName: '',
+ colValLabel: '',
+
+ },
+ personRule: {
+ ruleDesc: '',//规则描述文字,例如:基础信息性别等于女
+ itemGroupId: '',
+ itemId: '',
+ queryType: '',
+ colTable: '',
+ colKey: '',
+ colVal: '',
+
+ itemList: [],
+ colType: '',//详细参数的组件类型
+ colOption: [],
+ itemGroupName: '',
+ itemLabel: '',
+ queryTypeName: '',
+ colValLabel: '',
- showPersonList: false,
- ruleList: {},
+ }
+ },
- smartRuleList: [],
+ ],
}
},
@@ -340,194 +297,231 @@ export default {
methods: {
- handleSelSmartType (value) {
- if (value === '房屋') {
- this.houseSel = true
- this.personSel = false
- } else {
- this.houseSel = false
- this.personSel = true
+ handleSelSmartType (ruleIndex, item) {
+ let oneData = this.smartRuleList[ruleIndex]
+
+ // if (item.value === 'house') {
+ oneData.houseRule = {
+ ruleDesc: '',
+ queryType: '',
+ colTable: '',
+ colKey: '',
+ colVal: '',
+
+ titleName: '房屋信息',
+ colType: '',//详细参数的组件类型
+ colOption: [],
+ itemGroupName: '房屋信息',
+ itemLabel: '',
+ queryTypeName: '',
+ colValLabel: '',
+
}
- },
- async setRule (resiRuleList, houseRuleList) {
- // this.startLoading()
- if (this.groupList.length == 0 || this.houseItemList.length === 0) {
- setTimeout(() => {
- this.setRule(resiRuleList, houseRuleList);
- }, 500);
- return false
+ oneData.personRule = {
+ ruleDesc: '',//规则描述文字,例如:基础信息性别等于女
+ itemGroupId: '',
+ itemId: '',
+ queryType: '',
+ colTable: '',
+ colKey: '',
+ colVal: '',
+
+ itemList: [],
+ colType: '',//详细参数的组件类型
+ colOption: [],
+ itemGroupName: '',
+ itemLabel: '',
+ queryTypeName: '',
+ colValLabel: '',
+
}
+ // } else {
- this.resiRuleList = resiRuleList
- if (this.resiRuleList && this.resiRuleList.length > 0) {
- this.personChecked = true
- for (let i = 0; i < this.resiRuleList.length; i++) {
- let element = this.resiRuleList[i]
+ // }
- let selGroup = this.groupList.filter((item) =>
- element.itemGroupId === item.id
- );
- console.log(selGroup)
+ this.$set(this.smartRuleList, ruleIndex, oneData)
+ console.log(this.smartRuleList)
+ },
+ // async setRule (smartRuleList, smartRuleList) {
+ // // this.startLoading()
+ // if (this.groupList.length == 0 || this.houseItemList.length === 0) {
+ // setTimeout(() => {
+ // this.setRule(smartRuleList, smartRuleList);
+ // }, 500);
+ // return false
+ // }
- if (selGroup.length > 0) {
- await this.handleSelGroup(i, selGroup[0], true)
+ // this.smartRuleList = smartRuleList
+ // if (this.smartRuleList && this.smartRuleList.length > 0) {
+ // this.personChecked = true
+ // for (let i = 0; i < this.smartRuleList.length; i++) {
+ // let element = this.smartRuleList[i]
- let selItem = element.itemList.filter((item) =>
- element.itemId === item.itemId);
- if (selItem.length > 0) {
- await this.handleSelGroupItem(i, selItem[0], true)
- }
+ // let selGroup = this.groupList.filter((item) =>
+ // element.itemGroupId === item.id
+ // );
+ // console.log(selGroup)
- }
- }
- }
+ // if (selGroup.length > 0) {
+ // await this.handleSelGroup(i, selGroup[0], true)
- this.houseRuleList = houseRuleList
- if (this.houseRuleList && this.houseRuleList.length > 0) {
- this.houseChecked = true
- this.houseRuleList.forEach((element, index) => {
- let selHouseItem = this.houseItemList.filter((item) =>
- element.colKey === item.colKey
- );
+ // let selItem = element.itemList.filter((item) =>
+ // element.itemId === item.itemId);
+ // if (selItem.length > 0) {
+ // await this.handleSelGroupItem(i, selItem[0], true)
+ // }
- if (selHouseItem.length > 0) {
- this.handleSelHouseItem(index, selHouseItem[0], true)
- }
+ // }
+ // }
+ // }
- });
- }
+ // this.smartRuleList = smartRuleList
+ // if (this.smartRuleList && this.smartRuleList.length > 0) {
+ // this.houseChecked = true
+ // this.smartRuleList.forEach((element, index) => {
- },
+ // let selHouseItem = this.houseItemList.filter((item) =>
+ // element.colKey === item.colKey
+ // );
- getRule () {
- this.okflag = false
+ // if (selHouseItem.length > 0) {
+ // this.handleSelHouseItem(index, selHouseItem[0], true)
+ // }
- let messageObj = this.validateRule(this.personChecked, this.houseChecked)
+ // });
+ // }
- // console.log('resiRuleList', this.resiRuleList)
- // console.log('houseRuleList', this.houseRuleList)
+ // },
+
+ getRule () {
+ this.okflag = false
+ let messageObj = this.validateRule()
if (messageObj) {
this.$message.error(messageObj)
} else {
- if (this.resiRuleList.length > 0) {
- this.resiRuleList[this.resiRuleList.length - 1].nextLogicalRel = ''
- }
-
- if (this.houseRuleList.length > 0) {
- this.houseRuleList[this.houseRuleList.length - 1].nextLogicalRel = ''
+ if (this.smartRuleList.length > 0) {
+ this.smartRuleList[this.smartRuleList.length - 1].nextLogicalRel = ''
}
-
-
+ console.log('smartRuleList', this.smartRuleList)
this.okflag = true
}
},
- validateRule (valPerson, valHouse) {
+ validateRule () {
let message = ''
- if (valPerson) {
- this.resiRuleList.forEach((item, index) => {
+ this.smartRuleList.forEach((item, index) => {
+ if (item.selSmartType === 'person') {
- if (item.itemGroupId === '' ||
- item.itemId === '' ||
- item.queryType === '' ||
- item.colKey === ''
+ if (item.personRule.itemGroupId === '' ||
+ item.personRule.itemId === '' ||
+ item.personRule.queryType === '' ||
+ item.personRule.colKey === ''
) {
- message = '匹配规则' + (this.index + 1) + '人员信息不完整,请填写完整!'
- return message
- }
- if ((index != this.resiRuleList.length - 1) && item.nextLogicalRel === '') {
- message = '匹配规则' + (this.index + 1) + '人员信息不完整,请填写完整!'
+ message = '第' + (index + 1) + '行人员信息不完整,请填写完整!'
return message
}
- if ((item.queryType !== 'is_null' && item.queryType !== 'is_not_null') && item.colVal === '') {
- message = '匹配规则' + (this.index + 1) + '人员信息不完整,请填写完整!'
+ if ((item.personRule.queryType !== 'is_null' && item.personRule.queryType !== 'is_not_null') && item.personRule.colVal === '') {
+ message = '第' + (index + 1) + '行人员信息不完整,请填写完整!'
return message
}
+ }
- });
-
-
- }
-
- if (valHouse) {
+ if (item.selSmartType === 'house') {
- this.houseRuleList.forEach((item, index) => {
- if (item.itemGroupId === '' ||
- item.itemId === '' ||
- item.queryType === '' ||
- item.colKey === ''
+ if (item.houseRule.itemGroupId === '' ||
+ item.houseRule.itemId === '' ||
+ item.houseRule.queryType === '' ||
+ item.houseRule.colKey === ''
) {
- message = '匹配规则' + (this.index + 1) + '房屋信息不完整,请填写完整!'
- return message
- }
- if ((index != this.houseRuleList.length - 1) && item.nextLogicalRel === '') {
- message = '匹配规则' + (this.index + 1) + '房屋信息不完整,请填写完整!'
+ message = '第' + (index + 1) + '行房屋信息不完整,请填写完整!'
return message
}
- if ((item.queryType !== 'is_null' && item.queryType !== 'is_not_null') && item.colVal === '') {
- message = '匹配规则' + (this.index + 1) + '房屋信息不完整,请填写完整!'
+
+ if ((item.houseRule.queryType !== 'is_null' && item.houseRule.queryType !== 'is_not_null') && item.houseRule.colVal === '') {
+ message = '第' + (index + 1) + '行房屋信息不完整,请填写完整!'
return message
}
+ }
- });
- }
-
-
-
+ if ((index != this.smartRuleList.length - 1) && item.nextLogicalRel === '') {
+ message = '第' + (index + 1) + '行逻辑选项不能为空!'
+ return message
+ }
+ });
return message
},
- handlePreview () {
- if (!this.personChecked && !this.houseChecked) {
- this.$message.info('请勾选要预览的规则')
- return false
- }
+ handleClose () {
+ this.showPersonList = false
+ },
- this.getRule()
- if (!this.okflag) {
- return false
- }
- this.ruleList = {}
- this.ruleList = {
- resiRuleList: [],
- houseRuleList: [],
+ addRule () {
- }
+ let obj = {
+ selSmartType: 'house',
+ nextLogicalRel: '',//与上一条的关系;and、or
+ nextLogicalRelName: '',
+ houseRule: {
+ ruleDesc: '',
+ queryType: '',
+ colTable: '',
+ colKey: '',
+ colVal: '',
- if (this.personChecked) {
- this.ruleList.resiRuleList = this.resiRuleList
- }
- if (this.houseChecked) {
- this.ruleList.houseRuleList = this.houseRuleList
- }
+ titleName: '房屋信息',
+ colType: '',//详细参数的组件类型
+ colOption: [],
+ itemGroupName: '房屋信息',
+ itemLabel: '',
+ queryTypeName: '',
+ colValLabel: '',
+ },
+ personRule: {
+ ruleDesc: '',//规则描述文字,例如:基础信息性别等于女
+ itemGroupId: '',
+ itemId: '',
+ queryType: '',
+ colTable: '',
+ colKey: '',
+ colVal: '',
- this.showPersonList = true
- },
+ itemList: [],
+ colType: '',//详细参数的组件类型
+ colOption: [],
+ itemGroupName: '',
+ itemLabel: '',
+ queryTypeName: '',
+ colValLabel: '',
+ }
+ }
- handleClose () {
- this.showPersonList = false
+ this.smartRuleList.push(obj)
+ },
+ delRule (index) {
+ this.smartRuleList.splice(index, 1);
},
+
//选择人员信息第一列下拉框
- async handleSelGroup (personIndex, item, isSet) {
+ async handleSelGroup (ruleIndex, item, isSet) {
const url = '/oper/customize/icformitem/getItemListV2'
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/isServiceProject/service/serviceScopeTree'
let params = {
@@ -540,20 +534,20 @@ export default {
if (code === 0) {
- let oneData = this.resiRuleList[personIndex]
- oneData.itemGroupName = item.label
- oneData.itemList = data
- oneData.colTable = item.tableName
+ let oneData = this.smartRuleList[ruleIndex]
+ oneData.personRule.itemGroupName = item.label
+ oneData.personRule.itemList = data
+ oneData.personRule.colTable = item.tableName
if (!isSet) {//如果是详情,赋值,不需要置空
- oneData.nextLogicalRel = ''
- oneData.itemId = ''
- oneData.queryType = ''
- oneData.colKey = ''
- oneData.colVal = ''
+
+ oneData.personRule.itemId = ''
+ oneData.personRule.queryType = ''
+ oneData.personRule.colKey = ''
+ oneData.personRule.colVal = ''
}
- this.$set(this.resiRuleList, personIndex, oneData)
+ this.$set(this.smartRuleList, ruleIndex, oneData)
} else {
this.$message.error(msg)
@@ -561,18 +555,18 @@ export default {
},
//选择人员信息第二列下拉框
- async handleSelGroupItem (personIndex, item, isSet) {
+ async handleSelGroupItem (ruleIndex, item, isSet) {
- let oneData = this.resiRuleList[personIndex]
+ let oneData = this.smartRuleList[ruleIndex]
- oneData.colKey = item.columnName
- oneData.colType = item.itemType
- oneData.itemLabel = item.label
+ oneData.personRule.colKey = item.columnName
+ oneData.personRule.colType = item.itemType
+ oneData.personRule.itemLabel = item.label
if (!isSet) {//如果是详情,赋值,不需要置空
- oneData.nextLogicalRel = ''
- oneData.queryType = ''
- oneData.colVal = ''
+
+ oneData.personRule.queryType = ''
+ oneData.personRule.colVal = ''
}
if (item.optionSourceType === 'remote') {
@@ -583,61 +577,54 @@ export default {
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
- oneData.colOption = data
+ oneData.personRule.colOption = data
} else {
this.$message.error(msg)
}
} else {
- oneData.colOption = item.options
+ oneData.personRule.colOption = item.options
}
- this.$set(this.resiRuleList, personIndex, oneData)
+ this.$set(this.smartRuleList, ruleIndex, oneData)
},
//选择人员信息第三列
- handleSelPersonQuery (personIndex, item) {
- let oneData = this.resiRuleList[personIndex]
- oneData.queryTypeName = item.label
+ handleSelPersonQuery (ruleIndex, item) {
+ let oneData = this.smartRuleList[ruleIndex]
+ oneData.personRule.queryTypeName = item.label
- oneData.nextLogicalRel = ''
- oneData.colVal = ''
- oneData.colValLabel = ''
- this.$set(this.resiRuleList, personIndex, oneData)
+ oneData.personRule.colVal = ''
+ oneData.personRule.colValLabel = ''
+
+ this.$set(this.smartRuleList, ruleIndex, oneData)
},
//选择人员信息第四列
- handleSelPersonValue (personIndex, item) {
- let oneData = this.resiRuleList[personIndex]
+ handleSelPersonValue (ruleIndex, item) {
+ let oneData = this.smartRuleList[ruleIndex]
- oneData.colValLabel = item.label
- oneData.nextLogicalRel = ''
+ oneData.personRule.colValLabel = item.label
- this.$set(this.resiRuleList, personIndex, oneData)
- },
- //选择人员信息第五列
- handleSelPersonLogical (personIndex, item) {
- let oneData = this.resiRuleList[personIndex]
- oneData.nextLogicalRelName = item.label
-
- this.$set(this.resiRuleList, personIndex, oneData)
+ this.$set(this.smartRuleList, ruleIndex, oneData)
},
+
//选择房屋信息第二列下拉框
- async handleSelHouseItem (houseIndex, item, isSet) {
+ async handleSelHouseItem (ruleIndex, item, isSet) {
- let oneData = this.houseRuleList[houseIndex]
+ let oneData = this.smartRuleList[ruleIndex]
- oneData.colTable = item.tableName
- oneData.colType = item.itemType
- oneData.itemLabel = item.label
+ oneData.houseRule.colTable = item.tableName
+ oneData.houseRule.colType = item.itemType
+ oneData.houseRule.itemLabel = item.label
if (!isSet) {//如果是详情,赋值,不需要置空
- oneData.nextLogicalRel = ''
- oneData.queryType = ''
- oneData.colVal = ''
+
+ oneData.houseRule.queryType = ''
+ oneData.houseRule.colVal = ''
}
if (item.optionSourceType === 'remote') {
@@ -652,133 +639,47 @@ export default {
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
- oneData.colOption = data
+ oneData.houseRule.colOption = data
} else {
this.$message.error(msg)
}
} else {
- oneData.colOption = []
+ oneData.houseRule.colOption = []
}
- this.$set(this.houseRuleList, houseIndex, oneData)
+ this.$set(this.smartRuleList, ruleIndex, oneData)
},
//选择房屋第三列
- handleSelHouseQuery (houseIndex, item) {
- let oneData = this.houseRuleList[houseIndex]
- oneData.queryTypeName = item.label
+ handleSelHouseQuery (ruleIndex, item) {
+ let oneData = this.smartRuleList[ruleIndex]
+ oneData.houseRule.queryTypeName = item.label
- oneData.nextLogicalRel = ''
- oneData.colVal = ''
- oneData.colValLabel = ''
- this.$set(this.houseRuleList, houseIndex, oneData)
- },
- //选择房屋第四列
- handleSelHouseValue (houseIndex, item) {
- let oneData = this.houseRuleList[houseIndex]
- oneData.colValLabel = item.label
- oneData.nextLogicalRel = ''
+ oneData.houseRule.colVal = ''
+ oneData.houseRule.colValLabel = ''
- this.$set(this.houseRuleList, houseIndex, oneData)
+ this.$set(this.smartRuleList, ruleIndex, oneData)
},
- //选择房屋第五列
- handleSelHouseLogical (houseIndex, item) {
- let oneData = this.houseRuleList[houseIndex]
- oneData.nextLogicalRelName = item.label
-
- this.$set(this.houseRuleList, houseIndex, oneData)
- },
-
-
-
- clickTab (type) {
- if (type === 'person') {
- this.personSel = true
- this.houseSel = false
-
- }
- if (type === 'house') {
- this.personSel = false
- this.houseSel = true
-
- }
-
- },
-
- addRule () {
- if (this.personSel) {
- this.addPerson()
- }
-
- if (this.houseSel) {
- this.addHouse()
- }
-
-
- },
-
- addPerson () {
-
- let obj = {
- ruleDesc: '',//规则描述文字,例如:基础信息性别等于女
- nextLogicalRel: '',//与上一条的关系;and、or
- itemGroupId: '',
- itemId: '',
- queryType: '',
- colTable: '',
- colKey: '',
- colVal: '',
-
- itemList: [],
- colType: '',//详细参数的组件类型
- colOption: [],
- itemGroupName: '',
- itemLabel: '',
- queryTypeName: '',
- colValLabel: '',
- nextLogicalRelName: '',
- }
+ //选择房屋第四列
+ handleSelHouseValue (ruleIndex, item) {
+ let oneData = this.smartRuleList[ruleIndex]
+ oneData.houseRule.colValLabel = item.label
- this.resiRuleList.push(obj)
- },
- delPerson (index) {
- this.resiRuleList.splice(index, 1);
+ this.$set(this.smartRuleList, ruleIndex, oneData)
},
- addHouse () {
-
- let obj = {
- ruleDesc: '',
- nextLogicalRel: '',//与上一条的关系;and、or
- queryType: '',
- colTable: '',
- colKey: '',
- colVal: '',
-
- titleName: '房屋信息',
- colType: '',//详细参数的组件类型
- colOption: [],
- itemGroupName: '房屋信息',
- itemLabel: '',
- queryTypeName: '',
- colValLabel: '',
- nextLogicalRelName: '',
- }
-
- this.houseRuleList.push(obj)
- },
+ //选择第五列:逻辑
+ handleSelLogical (ruleIndex, item) {
+ let oneData = this.smartRuleList[ruleIndex]
+ oneData.nextLogicalRelName = item.label
- delHouse (index) {
- this.houseRuleList.splice(index, 1);
+ this.$set(this.smartRuleList, ruleIndex, oneData)
},
-
-
-
// 获取人员信息---第一列
async loadPersonGroup () {
const url = '/oper/customize/icformitemgroup/list'
@@ -850,45 +751,6 @@ export default {
}
},
computed: {
- dataRule () {
- return {
-
-
- serviceTimeStart: [
- { required: true, message: '服务时间不能为空', trigger: 'blur' }
- ],
- serviceScope: [
- { required: true, message: '服务范围不能为空', trigger: 'blur' }
- ],
-
- }
- },
- feedbackDataRule () {
- return {
-
-
- serviceGoal: [
- { required: true, message: '服务目标不能为空', trigger: 'blur' }
- ],
-
- serviceEffect: [
- { required: true, message: '服务效果不能为空', trigger: 'blur' }
- ],
- servicePeopleNumber: [
- { required: true, message: '服务人数不能为空', trigger: 'blur' }
- ],
- serviceStatus: [
- { required: true, message: '服务状态不能为空', trigger: 'blur' }
- ],
- satisfaction: [
- { required: true, message: '满意度不能为空', trigger: 'blur' }
- ],
- address: [
- { required: true, message: '地址不能为空', trigger: 'blur' }
- ]
- }
- },
-
},
props: {
@@ -896,10 +758,7 @@ export default {
type: String,
required: 'true'
},
- index: {
- type: Number,
- default: 1
- },
+
}
}
@@ -908,7 +767,7 @@ export default {