jiangyy 3 years ago
parent
commit
d7dcb318fd
  1. 95
      src/views/components/resiSearch.vue
  2. 572
      src/views/components/smartSearchRule.vue

95
src/views/components/resiSearch.vue

@ -190,9 +190,8 @@
</el-col> </el-col>
<el-col> <el-col>
<smart-search-rule :ref="'ref_rule'+selBtnIndex" <smart-search-rule ref="ref_rule"
:formType="formType" :formType="formType"></smart-search-rule>
:index="selBtnIndex"></smart-search-rule>
</el-col> </el-col>
</el-row> </el-row>
@ -369,15 +368,92 @@ export default {
btnList: [ btnList: [
{ {
name: '智能查询', name: '智能查询',
index: 1 index: 1,
}, },
{ {
name: '租户', name: '租户',
index: 2 index: 2,
ruleList: [
{
selSmartType: 'house',
nextLogicalRel: "",
nextLogicalRelName: "",
personRule: {
ruleDesc: '',//
itemGroupId: '',
itemId: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
itemList: [],
colType: '',//
colOption: [],
itemGroupName: '',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
},
houseRule: {
colKey: "RENT_FLAG",
colTable: "ic_house",
colVal: "1",
colValLabel: "出租",
itemGroupId: null,
itemGroupName: "房屋信息",
itemId: null,
itemLabel: "房屋状态",
nextLogicalRel: "",
nextLogicalRelName: "",
queryType: "=",
queryTypeName: "等于",
ruleDesc: "房屋信息房屋状态等于出租",
},
},
]
}, },
{ {
name: '第一党支部党员', name: '第一党支部党员',
index: 3 index: 3,
ruleList: [
{
selSmartType: 'person',
nextLogicalRel: "",
nextLogicalRelName: "",
personRule: {
colKey: "IS_BDHJ",
colTable: "ic_resi_user",
colVal: "1",
colValLabel: "是",
itemGroupId: "45687aa479955f9d06204d415238f7cc_0",
itemGroupName: "基础信息",
itemId: "20220422102809_1005",
itemLabel: "本地户籍",
queryType: "=",
queryTypeName: "等于",
ruleDesc: "基础信息本地户籍等于是",
},
houseRule: {
ruleDesc: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
titleName: '房屋信息',
colType: '',//
colOption: [],
itemGroupName: '房屋信息',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
},
},
]
} }
] ]
@ -483,6 +559,11 @@ export default {
// this.orgOptions = []; // this.orgOptions = [];
}, },
handleSearch () { handleSearch () {
if (this.showSmartSearchForm) {
let refObj = this.$refs['ref_rule']
refObj.getRule()
} else {
// console.log('formmmmm---', this.form) // console.log('formmmmm---', this.form)
const itemTypes = ['daterange', 'timerange', 'checkbox'] const itemTypes = ['daterange', 'timerange', 'checkbox']
let a = this.tempFormList.filter(item => item.itemType != 'inputRange') let a = this.tempFormList.filter(item => item.itemType != 'inputRange')
@ -510,6 +591,8 @@ export default {
let arr3 = [...arr1, ...arr2] let arr3 = [...arr1, ...arr2]
this.$emit('search', arr3) this.$emit('search', arr3)
return arr3 return arr3
}
}, },
handleOpenSearch () { handleOpenSearch () {
this.openSearch = !this.openSearch this.openSearch = !this.openSearch

572
src/views/components/smartSearchRule.vue

@ -3,13 +3,13 @@
<div class="m-main"> <div class="m-main">
<div v-for="(ruleItem,ruleIndex) in smartRuleList" <div v-for="(ruleItem,ruleIndex) in smartRuleList"
:key="ruleIndex" :key="ruleIndex">
class="row-item"> <div class="row-item">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="ruleItem.selSmartType" v-model="ruleItem.selSmartType"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in smartList1" <el-option v-for="item in smartList"
@click.native="handleSelSmartType(ruleIndex,item)" @click.native="handleSelSmartType(ruleIndex,item)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
@ -81,67 +81,65 @@
</div> </div>
<div v-if="ruleItem.selSmartType==='person'"> <div v-if="ruleItem.selSmartType==='person'"
<div v-for="(personItem,personIndex) in resiRuleList"
:key="personIndex"
class="row-item-one"> class="row-item-one">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="personItem.itemGroupId" v-model="ruleItem.personRule.itemGroupId"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in groupList" <el-option v-for="item in groupList"
@click.native="handleSelGroup(personIndex,item)" @click.native="handleSelGroup(ruleIndex,item)"
:key="item.id" :key="item.id"
:label="item.label" :label="item.label"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="personItem.itemId" v-model="ruleItem.personRule.itemId"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in personItem.itemList" <el-option v-for="item in ruleItem.personRule.itemList"
@click.native="handleSelGroupItem(personIndex,item)" @click.native="handleSelGroupItem(ruleIndex,item)"
:key="item.itemId" :key="item.itemId"
:label="item.label" :label="item.label"
:value="item.itemId"> :value="item.itemId">
</el-option> </el-option>
</el-select> </el-select>
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="personItem.queryType" v-model="ruleItem.personRule.queryType"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in queryList" <el-option v-for="item in queryList"
@click.native="handleSelPersonQuery(personIndex,item)" @click.native="handleSelPersonQuery(ruleIndex,item)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<div v-if="personItem.queryType!=='is_null'&&personItem.queryType!=='is_not_null'"> <div v-if="ruleItem.personRule.queryType!=='is_null'&&ruleItem.personRule.queryType!=='is_not_null'">
<el-select v-if="personItem.colType==='select'||personItem.colType==='radio'||personItem.colType==='checkbox'" <el-select v-if="ruleItem.personRule.colType==='select'||ruleItem.personRule.colType==='radio'||ruleItem.personRule.colType==='checkbox'"
class="item_width_2" class="item_width_2"
v-model="personItem.colVal" v-model="ruleItem.personRule.colVal"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in personItem.colOption" <el-option v-for="item in ruleItem.personRule.colOption"
@click.native="handleSelPersonValue(personIndex,item)" @click.native="handleSelPersonValue(ruleIndex,item)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<el-input-number v-else-if="personItem.colType==='inputNum'" <el-input-number v-else-if="ruleItem.personRule.colType==='inputNum'"
class="item_width_2" class="item_width_2"
v-model="personItem.colVal" v-model="ruleItem.personRule.colVal"
:min="0" :min="0"
size="small" size="small"
label="请输入"></el-input-number> label="请输入"></el-input-number>
<el-date-picker v-else-if="personItem.colType==='datepicker'||personItem.colType==='date'" <el-date-picker v-else-if="ruleItem.personRule.colType==='datepicker'||ruleItem.personRule.colType==='date'"
v-model="personItem.colVal" v-model="ruleItem.personRule.colVal"
class="item_width_2" class="item_width_2"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
@ -152,22 +150,20 @@
class="item_width_2" class="item_width_2"
size="small" size="small"
placeholder="请输入" placeholder="请输入"
v-model="personItem.colVal"> v-model="ruleItem.personRule.colVal">
</el-input> </el-input>
</div> </div>
</div> </div>
</div>
<el-select v-if="ruleIndex<(smartRuleList.length-1)" <el-select v-if="ruleIndex<(smartRuleList.length-1)"
class="item_width_1" class="item_width_1"
v-model="ruleItem.houseRule.nextLogicalRel" v-model="ruleItem.nextLogicalRel"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in logicalList" <el-option v-for="item in logicalList"
@click.native="handleSelPersonLogical(ruleIndex,item)" @click.native="handleSelLogical(ruleIndex,item)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
@ -177,11 +173,17 @@
<img v-if=" ruleIndex<smartRuleList.length-1" <img v-if=" ruleIndex<smartRuleList.length-1"
class="img_del" class="img_del"
src="@/assets/img/icon-del.png" src="@/assets/img/icon-del.png"
@click="delHouse(ruleIndex)"> @click="delRule(ruleIndex)">
<img v-if=" ruleIndex==smartRuleList.length-1"
class="img_del" <div v-if=" ruleIndex==smartRuleList.length-1"
class="d-icon">
<img class="img_del"
src="@/assets/img/icon-add.png" src="@/assets/img/icon-add.png"
@click="addHouse(ruleIndex)"> @click="addRule(ruleIndex)">
<div class="d-save">保存为常用查询条件</div>
</div>
</div>
</div> </div>
@ -204,11 +206,7 @@ export default {
personChecked: false, personChecked: false,
houseChecked: false, houseChecked: false,
houseSel: true, smartList: [
personSel: false,
smartList1: [
{ {
value: 'house', value: 'house',
label: '房屋信息' label: '房屋信息'
@ -232,32 +230,18 @@ export default {
], ],
houseItemList: [],// houseItemList: [],//
resiRuleList: [ okflag: false,
{
ruleDesc: '',//
nextLogicalRel: '',//andor
itemGroupId: '',
itemId: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
itemList: [], showPersonList: false,
colType: '',// ruleList: {},
colOption: [],
itemGroupName: '',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
nextLogicalRelName: '',
}
],
houseRuleList: [ smartRuleList: [
{ {
ruleDesc: '', selSmartType: 'house',
nextLogicalRel: '',//andor nextLogicalRel: '',//andor
nextLogicalRelName: '',
houseRule: {
ruleDesc: '',
queryType: '', queryType: '',
colTable: '', colTable: '',
colKey: '', colKey: '',
@ -270,38 +254,28 @@ export default {
itemLabel: '', itemLabel: '',
queryTypeName: '', queryTypeName: '',
colValLabel: '', colValLabel: '',
nextLogicalRelName: '',
}
],
okflag: false, },
personRule: {
showPersonList: false, ruleDesc: '',//
ruleList: {}, itemGroupId: '',
itemId: '',
smartRuleList: [
{
selSmartType: 'house',
houseRule: {
ruleDesc: '',
nextLogicalRel: '',//andor
queryType: '', queryType: '',
colTable: '', colTable: '',
colKey: '', colKey: '',
colVal: '', colVal: '',
titleName: '房屋信息', itemList: [],
colType: '',// colType: '',//
colOption: [], colOption: [],
itemGroupName: '房屋信息', itemGroupName: '',
itemLabel: '', itemLabel: '',
queryTypeName: '', queryTypeName: '',
colValLabel: '', colValLabel: '',
nextLogicalRelName: '',
} }
}, },
], ],
} }
@ -326,10 +300,9 @@ export default {
handleSelSmartType (ruleIndex, item) { handleSelSmartType (ruleIndex, item) {
let oneData = this.smartRuleList[ruleIndex] let oneData = this.smartRuleList[ruleIndex]
if (item.value === 'house') { // if (item.value === 'house') {
oneData.houseRule = { oneData.houseRule = {
ruleDesc: '', ruleDesc: '',
nextLogicalRel: '',//andor
queryType: '', queryType: '',
colTable: '', colTable: '',
colKey: '', colKey: '',
@ -342,13 +315,10 @@ export default {
itemLabel: '', itemLabel: '',
queryTypeName: '', queryTypeName: '',
colValLabel: '', colValLabel: '',
nextLogicalRelName: '',
}
} else { }
oneData.personRule = { oneData.personRule = {
ruleDesc: '',// ruleDesc: '',//
nextLogicalRel: '',//andor
itemGroupId: '', itemGroupId: '',
itemId: '', itemId: '',
queryType: '', queryType: '',
@ -363,191 +333,195 @@ export default {
itemLabel: '', itemLabel: '',
queryTypeName: '', queryTypeName: '',
colValLabel: '', colValLabel: '',
nextLogicalRelName: '',
}
} }
// } else {
// }
this.$set(this.smartRuleList, ruleIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
console.log(this.smartRuleList)
}, },
async setRule (resiRuleList, houseRuleList) { // async setRule (smartRuleList, smartRuleList) {
// this.startLoading() // // this.startLoading()
if (this.groupList.length == 0 || this.houseItemList.length === 0) { // if (this.groupList.length == 0 || this.houseItemList.length === 0) {
setTimeout(() => { // setTimeout(() => {
this.setRule(resiRuleList, houseRuleList); // this.setRule(smartRuleList, smartRuleList);
}, 500); // }, 500);
return false // return false
} // }
this.resiRuleList = resiRuleList // this.smartRuleList = smartRuleList
if (this.resiRuleList && this.resiRuleList.length > 0) { // if (this.smartRuleList && this.smartRuleList.length > 0) {
this.personChecked = true // this.personChecked = true
for (let i = 0; i < this.resiRuleList.length; i++) { // for (let i = 0; i < this.smartRuleList.length; i++) {
let element = this.resiRuleList[i] // let element = this.smartRuleList[i]
let selGroup = this.groupList.filter((item) => // let selGroup = this.groupList.filter((item) =>
element.itemGroupId === item.id // element.itemGroupId === item.id
); // );
console.log(selGroup) // console.log(selGroup)
if (selGroup.length > 0) { // if (selGroup.length > 0) {
await this.handleSelGroup(i, selGroup[0], true) // await this.handleSelGroup(i, selGroup[0], true)
let selItem = element.itemList.filter((item) => // let selItem = element.itemList.filter((item) =>
element.itemId === item.itemId); // element.itemId === item.itemId);
if (selItem.length > 0) { // if (selItem.length > 0) {
await this.handleSelGroupItem(i, selItem[0], true) // await this.handleSelGroupItem(i, selItem[0], true)
} // }
} // }
} // }
} // }
this.houseRuleList = houseRuleList // this.smartRuleList = smartRuleList
if (this.houseRuleList && this.houseRuleList.length > 0) { // if (this.smartRuleList && this.smartRuleList.length > 0) {
this.houseChecked = true // this.houseChecked = true
this.houseRuleList.forEach((element, index) => { // this.smartRuleList.forEach((element, index) => {
let selHouseItem = this.houseItemList.filter((item) => // let selHouseItem = this.houseItemList.filter((item) =>
element.colKey === item.colKey // element.colKey === item.colKey
); // );
if (selHouseItem.length > 0) { // if (selHouseItem.length > 0) {
this.handleSelHouseItem(index, selHouseItem[0], true) // this.handleSelHouseItem(index, selHouseItem[0], true)
} // }
}); // });
} // }
}, // },
getRule () { getRule () {
this.okflag = false this.okflag = false
let messageObj = this.validateRule()
let messageObj = this.validateRule(this.personChecked, this.houseChecked)
// console.log('resiRuleList', this.resiRuleList)
// console.log('houseRuleList', this.houseRuleList)
if (messageObj) { if (messageObj) {
this.$message.error(messageObj) this.$message.error(messageObj)
} else { } else {
if (this.resiRuleList.length > 0) { if (this.smartRuleList.length > 0) {
this.resiRuleList[this.resiRuleList.length - 1].nextLogicalRel = '' this.smartRuleList[this.smartRuleList.length - 1].nextLogicalRel = ''
} }
console.log('smartRuleList', this.smartRuleList)
if (this.houseRuleList.length > 0) {
this.houseRuleList[this.houseRuleList.length - 1].nextLogicalRel = ''
}
this.okflag = true this.okflag = true
} }
}, },
validateRule (valPerson, valHouse) { validateRule () {
let message = '' let message = ''
if (valPerson) {
this.resiRuleList.forEach((item, index) => { this.smartRuleList.forEach((item, index) => {
if (item.selSmartType === 'person') {
if (item.itemGroupId === '' || if (item.personRule.itemGroupId === '' ||
item.itemId === '' || item.personRule.itemId === '' ||
item.queryType === '' || item.personRule.queryType === '' ||
item.colKey === '' item.personRule.colKey === ''
) { ) {
message = '匹配规则' + (this.index + 1) + '人员信息不完整,请填写完整!' message = '第' + (index + 1) + '行人员信息不完整,请填写完整!'
return message
}
if ((index != this.resiRuleList.length - 1) && item.nextLogicalRel === '') {
message = '匹配规则' + (this.index + 1) + '人员信息不完整,请填写完整!'
return message return message
} }
if ((item.queryType !== 'is_null' && item.queryType !== 'is_not_null') && item.colVal === '') { if ((item.personRule.queryType !== 'is_null' && item.personRule.queryType !== 'is_not_null') && item.personRule.colVal === '') {
message = '匹配规则' + (this.index + 1) + '人员信息不完整,请填写完整!' message = '' + (index + 1) + '人员信息不完整,请填写完整!'
return message return message
} }
});
} }
if (valHouse) { if (item.selSmartType === 'house') {
this.houseRuleList.forEach((item, index) => {
if (item.itemGroupId === '' || if (item.houseRule.itemGroupId === '' ||
item.itemId === '' || item.houseRule.itemId === '' ||
item.queryType === '' || item.houseRule.queryType === '' ||
item.colKey === '' item.houseRule.colKey === ''
) { ) {
message = '匹配规则' + (this.index + 1) + '房屋信息不完整,请填写完整!' message = '第' + (index + 1) + '行房屋信息不完整,请填写完整!'
return message
}
if ((index != this.houseRuleList.length - 1) && item.nextLogicalRel === '') {
message = '匹配规则' + (this.index + 1) + '房屋信息不完整,请填写完整!'
return message 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 return message
} }
});
} }
if ((index != this.smartRuleList.length - 1) && item.nextLogicalRel === '') {
message = '第' + (index + 1) + '行逻辑选项不能为空!'
return message
}
});
return message return message
}, },
handlePreview () { handleClose () {
if (!this.personChecked && !this.houseChecked) { this.showPersonList = false
this.$message.info('请勾选要预览的规则') },
return false
}
this.getRule() addRule () {
if (!this.okflag) {
return false
}
this.ruleList = {}
this.ruleList = {
resiRuleList: [],
houseRuleList: [],
} let obj = {
selSmartType: 'house',
nextLogicalRel: '',//andor
nextLogicalRelName: '',
houseRule: {
ruleDesc: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
titleName: '房屋信息',
colType: '',//
colOption: [],
itemGroupName: '房屋信息',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
},
personRule: {
ruleDesc: '',//
itemGroupId: '',
itemId: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
if (this.personChecked) { itemList: [],
this.ruleList.resiRuleList = this.resiRuleList colType: '',//
colOption: [],
itemGroupName: '',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
} }
if (this.houseChecked) {
this.ruleList.houseRuleList = this.houseRuleList
} }
this.smartRuleList.push(obj)
this.showPersonList = true
}, },
handleClose () { delRule (index) {
this.showPersonList = false this.smartRuleList.splice(index, 1);
}, },
// //
async handleSelGroup (personIndex, item, isSet) { async handleSelGroup (ruleIndex, item, isSet) {
const url = '/oper/customize/icformitem/getItemListV2' const url = '/oper/customize/icformitem/getItemListV2'
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/isServiceProject/service/serviceScopeTree' // const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/isServiceProject/service/serviceScopeTree'
let params = { let params = {
@ -560,20 +534,20 @@ export default {
if (code === 0) { if (code === 0) {
let oneData = this.resiRuleList[personIndex] let oneData = this.smartRuleList[ruleIndex]
oneData.itemGroupName = item.label oneData.personRule.itemGroupName = item.label
oneData.itemList = data oneData.personRule.itemList = data
oneData.colTable = item.tableName oneData.personRule.colTable = item.tableName
if (!isSet) {// if (!isSet) {//
oneData.nextLogicalRel = ''
oneData.itemId = '' oneData.personRule.itemId = ''
oneData.queryType = '' oneData.personRule.queryType = ''
oneData.colKey = '' oneData.personRule.colKey = ''
oneData.colVal = '' oneData.personRule.colVal = ''
} }
this.$set(this.resiRuleList, personIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -581,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.personRule.colKey = item.columnName
oneData.colType = item.itemType oneData.personRule.colType = item.itemType
oneData.itemLabel = item.label oneData.personRule.itemLabel = item.label
if (!isSet) {// if (!isSet) {//
oneData.nextLogicalRel = ''
oneData.queryType = '' oneData.personRule.queryType = ''
oneData.colVal = '' oneData.personRule.colVal = ''
} }
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
@ -603,61 +577,54 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
oneData.colOption = data oneData.personRule.colOption = data
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
} else { } 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) { handleSelPersonQuery (ruleIndex, item) {
let oneData = this.resiRuleList[personIndex] let oneData = this.smartRuleList[ruleIndex]
oneData.queryTypeName = item.label oneData.personRule.queryTypeName = item.label
oneData.nextLogicalRel = '' oneData.personRule.colVal = ''
oneData.colVal = '' oneData.personRule.colValLabel = ''
oneData.colValLabel = ''
this.$set(this.resiRuleList, personIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
}, },
// //
handleSelPersonValue (personIndex, item) { handleSelPersonValue (ruleIndex, item) {
let oneData = this.resiRuleList[personIndex] let oneData = this.smartRuleList[ruleIndex]
oneData.colValLabel = item.label oneData.personRule.colValLabel = item.label
oneData.nextLogicalRel = ''
this.$set(this.resiRuleList, personIndex, oneData)
},
//
handleSelPersonLogical (personIndex, item) {
let oneData = this.resiRuleList[personIndex]
oneData.nextLogicalRelName = item.label this.$set(this.smartRuleList, ruleIndex, oneData)
this.$set(this.resiRuleList, personIndex, 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.houseRule.colTable = item.tableName
oneData.colType = item.itemType oneData.houseRule.colType = item.itemType
oneData.itemLabel = item.label oneData.houseRule.itemLabel = item.label
if (!isSet) {// if (!isSet) {//
oneData.nextLogicalRel = ''
oneData.queryType = '' oneData.houseRule.queryType = ''
oneData.colVal = '' oneData.houseRule.colVal = ''
} }
if (item.optionSourceType === 'remote') { if (item.optionSourceType === 'remote') {
@ -672,47 +639,47 @@ export default {
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
oneData.colOption = data oneData.houseRule.colOption = data
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
} else { } else {
oneData.colOption = [] oneData.houseRule.colOption = []
} }
this.$set(this.houseRuleList, houseIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
}, },
// //
handleSelHouseQuery (houseIndex, item) { handleSelHouseQuery (ruleIndex, item) {
let oneData = this.houseRuleList[houseIndex] let oneData = this.smartRuleList[ruleIndex]
oneData.queryTypeName = item.label oneData.houseRule.queryTypeName = item.label
oneData.nextLogicalRel = '' oneData.houseRule.colVal = ''
oneData.colVal = '' oneData.houseRule.colValLabel = ''
oneData.colValLabel = ''
this.$set(this.houseRuleList, houseIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
}, },
// //
handleSelHouseValue (houseIndex, item) { handleSelHouseValue (ruleIndex, item) {
let oneData = this.houseRuleList[houseIndex] let oneData = this.smartRuleList[ruleIndex]
oneData.colValLabel = item.label oneData.houseRule.colValLabel = item.label
oneData.nextLogicalRel = ''
this.$set(this.houseRuleList, houseIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
}, },
//
handleSelHouseLogical (houseIndex, item) { //:
let oneData = this.houseRuleList[houseIndex] handleSelLogical (ruleIndex, item) {
let oneData = this.smartRuleList[ruleIndex]
oneData.nextLogicalRelName = item.label oneData.nextLogicalRelName = item.label
this.$set(this.houseRuleList, houseIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
}, },
// --- // ---
async loadPersonGroup () { async loadPersonGroup () {
const url = '/oper/customize/icformitemgroup/list' const url = '/oper/customize/icformitemgroup/list'
@ -784,45 +751,6 @@ export default {
} }
}, },
computed: { 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: { props: {
@ -830,10 +758,7 @@ export default {
type: String, type: String,
required: 'true' required: 'true'
}, },
index: {
type: Number,
default: 1
},
} }
} }
@ -842,7 +767,7 @@ export default {
<style lang="scss" scoped > <style lang="scss" scoped >
.m-main { .m-main {
display: flex; // display: flex;
margin-top: 15px; margin-top: 15px;
} }
@ -864,7 +789,7 @@ export default {
display: flex; display: flex;
} }
.item_width_1 { .item_width_1 {
width: 120px; width: 200px;
margin-right: 10px; margin-right: 10px;
} }
.item_width_2 { .item_width_2 {
@ -878,6 +803,9 @@ export default {
/deep/.el-checkbox:last-of-type { /deep/.el-checkbox:last-of-type {
margin-right: 10px; margin-right: 10px;
} }
.d-icon {
display: flex;
}
.img_del { .img_del {
width: 25px; width: 25px;
@ -885,4 +813,30 @@ export default {
margin-top: 3px; margin-top: 3px;
cursor: pointer; cursor: pointer;
} }
.d-save {
position: relative;
margin-top: 3px;
margin-left: 10px;
width: 138px;
height: 25px;
background: #dde8f3;
text-align: center;
border-radius: 3px;
font-size: 12px;
font-family: Source Han Serif CN;
font-weight: 600;
color: #0043c8;
line-height: 26px;
cursor: pointer;
&::before {
position: absolute;
left: 0;
top: 9px;
width: 8px;
height: 8px;
background: #006ecd;
border-radius: 50%;
}
}
</style> </style>

Loading…
Cancel
Save