Browse Source

智能导入路由跳转方式修改,居民智能查询接口联调

feature
mk 2 years ago
parent
commit
3077c6cde5
  1. 82
      src/views/modules/base/smartImport.vue
  2. 4
      src/views/modules/communityService/commonDemand/addForm.vue
  3. 53
      src/views/modules/communityService/policy/addPolicy.vue
  4. 476
      src/views/modules/shequ/chaxun.vue
  5. 897
      src/views/modules/shequ/cpts/smatr-rules.vue
  6. 2
      src/views/modules/shequzhili/event/cpts/process-form-replay.vue

82
src/views/modules/base/smartImport.vue

@ -64,7 +64,7 @@
></el-table-column>
<el-table-column
prop="srcField"
prop="userTableHeader"
header-align="center"
align="center"
label="表格信息"
@ -79,9 +79,7 @@
min-width="110"
>
<template slot-scope="scope">
<span v-if="scope.row.exist">{{ scope.row.field }}</span>
<div v-else>
<div >
<el-select
class="item_width_sel"
v-model="scope.row.itemGroupId"
@ -100,7 +98,7 @@
<el-select
class="item_width_sel"
v-model="scope.row.field"
v-model="scope.row.locTableHeader"
size="small"
style="margin-left: 10px"
placeholder="请选择"
@ -147,33 +145,25 @@ export default {
tableParams: {
customerId: "",
},
// tableHeight: 500,
search: "",
dataList: [
// {
// index: "key1",
// srcField: "",
// exist: true,
// field: "",
// },
// {
// index: "key2",
// srcField: "",
// exist: true,
// field: "",
// },
// {
// index: "key3",
// srcField: "",
// exist: false,
// field: "",
// },
// {
// index: "key4",
// srcField: "",
// exist: false,
// field: "",
// },
{
userTableHeader: "所属房屋",
field: "所属房屋",
},
{
index: "key2",
userTableHeader: "基础信息",
field: "基础信息",
},
{
userTableHeader: "房屋信息",
field: "房屋信息",
},
{
userTableHeader: "本地户籍",
field: "本地户籍",
},
],
dataListLoading: false,
total: 0,
@ -406,35 +396,19 @@ export default {
this.importBtnTitle = "正在上传中...";
const formData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); //
formData.append("code", ""); //
formData.append("flieModel", "flieModel"); //
await this.$http
.post("/actual/base/residentBaseInfo/importExcel", formData)
.post("http://127.0.0.1:4523/mock2/2515967/97869993", formData)
.then((res) => {
console.log("res-up", res);
if (res.data.code == 0 && res.data.msg == "success") {
if (res.data.code == 0 ) {
console.log(res.data.data);
const data = res.data.data;
this.afterSuccess();
this.dataList = [
...Object.keys(data.option.exist).map((k) => {
return {
index: k,
srcField: data.option.exist[k],
exist: true,
field: data.option.exist[k],
};
}),
...Object.keys(data.option.notExist).map((k) => {
return {
index: k,
srcField: data.option.notExist[k],
exist: false,
field: "",
};
}),
];
this.importOption = data.option;
this.importCode = data.code;
this.dataList = data
console.log(this.dataList);
// this.importOption = data.option;
this.importCode = res.importCode;
this.fileData = file;
} else this.$message.error(res.data.msg);
})
@ -515,7 +489,7 @@ export default {
});
let than = this;
document.getElementById("clickA").addEventListener("click", function () {
than.$router.replace("/main/importRecord-index");
than.$router.push("/main/importRecord-index");
});
this.dataList = [];
this.importOption = {};

4
src/views/modules/communityService/commonDemand/addForm.vue

@ -485,13 +485,13 @@ export default {
dataRule() {
return {
serviceTypeLevel2Id: [
{ required: true, message: "政策类型不能为空", trigger: "change" },
{ required: true, message: "服务类别不能为空", trigger: "change" },
],
serviceName: [
{ required: true, message: "服务事项不能为空", trigger: "change" },
],
serviceOrgId: [
{ required: true, message: "服务组织不能为空", trigger: "change" },
{ required: true, message: "服务不能为空", trigger: "change" },
],
serviceTimeStart: [

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

@ -129,59 +129,8 @@
></el-input>
</el-form-item>
<!-- <div v-for="(item,index) in formData.ruleList"
:key="index"
style="margin-bottom:15px">
<el-form-item :label="'政策细则'+(index+1)"
:prop="`ruleList.${index}.ruleName`"
:rules="[
{ required: true, message: '政策细则'+(index+1)+'不能为空', trigger: 'change' },
]"
label-width="150px"
style="display: block">
<el-input class="item_width_short"
placeholder="请输入政策细则名称"
v-model="item.ruleName">
</el-input>
<el-button v-if="index!==0"
type="danger"
size="mini"
plain
style="margin-left:20px"
@click="delRule(index)">删除细则</el-button>
</el-form-item>
<div class="item_rule">
<div class="item_label">{{'匹配规则'+(index+1)}}</div>
<rule :ref="'ref_rule'+index"
:formType="formType"
:index="index"></rule>
</div>
</div> -->
<!-- <div class="btn-add-rule">
<el-button type="primary"
size="mini"
@click="addRule">增加细则</el-button>
</div> -->
<!-- <el-form-item label="匹配资源类型"
prop="serviceScope"
label-width="150px"
style="display: block">
<el-cascader class="item_width_1"
ref="myCascader"
v-model="demandIdArray"
:options="demandOptions"
:props="optionProps"
@change="handleCateSlect"></el-cascader>
</el-form-item> -->
<el-form-item
class="block"
style="display: block"
label="附件"
label-width="150px"
prop="attach"

476
src/views/modules/shequ/chaxun.vue

@ -3,25 +3,37 @@
<div class="m-box m-search">
<div class="wrap">
<div class="title">
<span>{{ smatrFlag ? '智能查询' : '社区查询' }}</span>
<span>{{ smatrFlag ? "智能查询" : "社区查询" }}</span>
</div>
<div class="tabs">
<div :class="searchData.type == 'jumin' ? 'z-on' : ''" @click="handelClickTab('jumin')">
<div
:class="searchData.type == 'jumin' ? 'z-on' : ''"
@click="handelClickTab('jumin')"
>
查居民
</div>
<div :class="searchData.type == 'fangwu' ? 'z-on' : ''" @click="handelClickTab('fangwu')">
<div
:class="searchData.type == 'fangwu' ? 'z-on' : ''"
@click="handelClickTab('fangwu')"
>
查房屋
</div>
</div>
<!-- -->
<div class="search">
<div class="search-input">
<div class="input">
<input type="text" :placeholder="typePlaceholder[searchData.type]" v-model="searchData.searchKey"
@keyup.enter="handleClickSearchBtn" />
<div class="close-btn" v-if="searchData.searchKey != ''"
@click="searchData.searchKey = '', childrenRulesData = []">
<input
type="text"
:placeholder="typePlaceholder[searchData.type]"
v-model="searchData.searchKey"
@keyup.enter="handleClickSearchBtn"
/>
<div
class="close-btn"
v-if="searchData.searchKey != ''"
@click="(searchData.searchKey = ''), (childrenRulesData = [])"
>
<img src="@/assets/img/shequ/close.png" />
</div>
</div>
@ -29,182 +41,210 @@
</div>
<div class="btn2" @click="handleClickSmartSearchBtn">
<img src="@/assets/images/index/i-search.png" />
{{ smatrFlag ? '关闭智能查询' : '智能查询' }}
{{ smatrFlag ? "关闭智能查询" : "智能查询" }}
</div>
</div>
<p v-show="smatrFlag && searchStatus == 'ing'" class="rules_box">
已显示{{ searchData.type == 'fangwu' ? '房屋' : '居民' }}状态为{{ searchData.searchKey }}的搜索结果如不满足需求 <el-button
type="text" @click="handleClickEditRules">请点击此处调整</el-button>
已显示{{ searchData.type == "fangwu" ? "房屋" : "居民" }}状态为{{
searchData.searchKey
}}的搜索结果如不满足需求
<el-button type="text" @click="handleClickEditRules"
>请点击此处调整</el-button
>
</p>
</div>
</div>
<div class="m-box" v-if="searchStatus == 'ing'">
<div class="m-tb" v-if="searchData.type == 'jumin' &&
searchData.searchKey != '' &&
searchStatus == 'ing'
">
<div
class="m-tb"
v-if="
searchData.type == 'jumin' &&
searchData.searchKey != '' &&
searchStatus == 'ing'
"
>
<div class="tb">
<el-table class="m-table" v-loading="searchJumin.loading" :data="searchJumin.list" border style="width: 100%"
:max-height="1000">
<el-table-column label="序号" type="index" align="center" width="50" />
<el-table-column v-for="item in searchJumin.header" :key="item.columnName" :prop="item.columnName"
:label="item.label" align="center" :show-overflow-tooltip="true" :width="item.itemType === 'radio' ? computedWidth(item.label) : 180
">
<el-table
class="m-table"
v-loading="searchJumin.loading"
:data="searchJumin.list"
:height="maxTableHeight"
border
style="width: 100%"
:max-height="1000"
>
<el-table-column
label="序号"
type="index"
align="center"
width="50"
/>
<el-table-column
v-for="item in searchJumin.header"
:key="item.columnName"
:prop="item.columnName"
:label="item.label"
align="center"
:show-overflow-tooltip="true"
:width="
item.itemType === 'radio' ? computedWidth(item.label) : 180
"
>
<template slot-scope="scope">
<span>{{ handleFilterSpan(scope.row, item) }}</span>
</template>
</el-table-column>
<el-table-column label="居民分类" align="center" :show-overflow-tooltip="true">
<el-table-column
label="居民分类"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<template v-if="scope.row.categoryInfo">
{{
scope.row.categoryInfo.bereavedPersonFlag ==
1
? "特扶人员 "
: ""
scope.row.categoryInfo.bereavedPersonFlag == 1
? "特扶人员 "
: ""
}}
{{
scope.row.categoryInfo.chronicDiseaseFlag ==
1
? "慢病 "
: ""
scope.row.categoryInfo.chronicDiseaseFlag == 1
? "慢病 "
: ""
}}
{{
scope.row.categoryInfo.dementedFlag == 1
? "失智老人 "
: ""
scope.row.categoryInfo.dementedFlag == 1 ? "失智老人 " : ""
}}
{{
scope.row.categoryInfo.disabilityFlag == 1
? "残疾 "
: ""
scope.row.categoryInfo.disabilityFlag == 1 ? "残疾 " : ""
}}
{{
scope.row.categoryInfo.disabledFlag == 1
? "失能老人 "
: ""
scope.row.categoryInfo.disabledFlag == 1 ? "失能老人 " : ""
}}
{{
scope.row.categoryInfo.emptyNesterFlag == 1
? "空巢老人 "
: ""
? "空巢老人 "
: ""
}}
{{
scope.row.categoryInfo.ensureHouseFlag == 1
? "保障房人员 "
: ""
? "保障房人员 "
: ""
}}
{{
scope.row.categoryInfo.fertileWomanFlag == 1
? "育龄妇女 "
: ""
}}
{{
scope.row.categoryInfo.floatingFlag == 1
? "流动人口 "
: ""
? "育龄妇女 "
: ""
}}
{{
scope.row.categoryInfo.liveAloneFlag == 1
? "独居老人 "
: ""
scope.row.categoryInfo.floatingFlag == 1 ? "流动人口 " : ""
}}
{{
scope.row.categoryInfo.oldPeopleFlag == 1
? "老年人 "
: ""
scope.row.categoryInfo.liveAloneFlag == 1 ? "独居老人 " : ""
}}
{{
scope.row.categoryInfo.partyFlag == 1
? "党员 "
: ""
scope.row.categoryInfo.oldPeopleFlag == 1 ? "老年人 " : ""
}}
{{ scope.row.categoryInfo.partyFlag == 1 ? "党员 " : "" }}
{{
scope.row.categoryInfo
.petitionOfficerFlag == 1
? "信访人员 "
: ""
scope.row.categoryInfo.petitionOfficerFlag == 1
? "信访人员 "
: ""
}}
{{
scope.row.categoryInfo.seriousIllnessFlag ==
1
? "大病 "
: ""
scope.row.categoryInfo.seriousIllnessFlag == 1
? "大病 "
: ""
}}
{{
scope.row.categoryInfo.specialCrowdFlag == 1
? "特殊人群 "
: ""
}}
{{
scope.row.categoryInfo
.subsistenceAllowanceFlag == 1
? "低保人员 "
: ""
? "特殊人群 "
: ""
}}
{{
scope.row.categoryInfo.tenantFlag == 1
? "租户 "
: ""
scope.row.categoryInfo.subsistenceAllowanceFlag == 1
? "低保人员 "
: ""
}}
{{ scope.row.categoryInfo.tenantFlag == 1 ? "租户 " : "" }}
{{
scope.row.categoryInfo.unemployedFlag == 1
? "失业 "
: ""
scope.row.categoryInfo.unemployedFlag == 1 ? "失业 " : ""
}}
{{
scope.row.categoryInfo.unitedFrontFlag == 1
? "统战人员 "
: ""
? "统战人员 "
: ""
}}
{{
scope.row.categoryInfo.veteranFlag == 1
? "退役军人 "
: ""
scope.row.categoryInfo.veteranFlag == 1 ? "退役军人 " : ""
}}
{{
scope.row.categoryInfo.volunteerFlag == 1
? "志愿者 "
: ""
scope.row.categoryInfo.volunteerFlag == 1 ? "志愿者 " : ""
}}
</template>
</template>
</el-table-column>
<el-table-column label="备注" align="center" :show-overflow-tooltip="true">
<el-table-column
label="备注"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope" label="备注">
{{ scope.row.remark }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template slot-scope="scope">
<el-button class="f-fc" @click="handleWatchSearchJumin(scope.$index)" type="text"
size="small">查看</el-button>
<el-button
class="f-fc"
@click="handleWatchSearchJumin(scope.$index)"
type="text"
size="small"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChangeSearchJumin" @current-change="handleCurrentChangeSearchJumin"
:current-page.sync="searchJumin.pageNo" :page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(searchJumin.pageSize)" layout="sizes, prev, pager, next, total"
:total="searchJumin.total">
<el-pagination
@size-change="handleSizeChangeSearchJumin"
@current-change="handleCurrentChangeSearchJumin"
:current-page.sync="searchJumin.pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(searchJumin.pageSize)"
layout="sizes, prev, pager, next, total"
:total="searchJumin.total"
>
</el-pagination>
</div>
</div>
</div>
<div class="m-tb" v-if="searchData.type == 'fangwu' &&
searchData.searchKey != '' &&
searchStatus == 'ing'
">
<div
class="m-tb"
v-if="
searchData.type == 'fangwu' &&
searchData.searchKey != '' &&
searchStatus == 'ing'
"
>
<div class="tb">
<el-table class="m-table" :data="searchFangwu.list" v-loading="searchFangwu.loading" border :max-height="1000"
style="width: 100%">
<el-table-column label="序号" type="index" align="center" width="50" />
<el-table
class="m-table"
:data="searchFangwu.list"
v-loading="searchFangwu.loading"
border
:max-height="1000"
style="width: 100%"
>
<el-table-column
label="序号"
type="index"
align="center"
width="50"
/>
<el-table-column prop="houseName" label="房屋名称" width="120">
</el-table-column>
<el-table-column prop="quartersName" label="所属小区" width="160">
@ -224,30 +264,69 @@
</el-table-column>
<el-table-column prop="ownerIdCard" label="证件号" width="170">
</el-table-column>
<el-table-column label="操作" fixed="right" header-align="center" align="center" class="operate">
<el-table-column
label="操作"
fixed="right"
header-align="center"
align="center"
class="operate"
>
<template slot-scope="scope">
<el-button class="f-fc" type="text" size="small"
@click="handleWatchSearchFangwu(scope.$index)">查看</el-button>
<el-button
class="f-fc"
type="text"
size="small"
@click="handleWatchSearchFangwu(scope.$index)"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChangeSearchFangwu" @current-change="handleCurrentChangeSearchFangwu"
:current-page.sync="searchFangwu.pageNo" :page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(searchFangwu.pageSize)" layout="sizes, prev, pager, next" :total="searchFangwu.total">
<el-pagination
@size-change="handleSizeChangeSearchFangwu"
@current-change="handleCurrentChangeSearchFangwu"
:current-page.sync="searchFangwu.pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(searchFangwu.pageSize)"
layout="sizes, prev, pager, next"
:total="searchFangwu.total"
>
</el-pagination>
</div>
</div>
</div>
</div>
<resi-info v-if="showedResiInfo && currentResiId" :resi-id="currentResiId" @close="showedResiInfo = false" />
<house-info v-if="showedHouseInfo && currentHouseId" :house-id="currentHouseId" @close="showedHouseInfo = false" />
<el-dialog v-if="showSmatrForm" :visible.sync="showSmatrForm" :append-to-body="true" :close-on-click-modal="false"
:close-on-press-escape="false" :title="'修改条件'" width="880px" top="5vh" class="dialog-h"
@closed="showSmatrForm = false">
<smatr-rules ref="smatr_rules_form" @dialogCancle="dialogCancle" @dialogOk="dialogOk" :rulesData="rulesData">
<resi-info
v-if="showedResiInfo && currentResiId"
:resi-id="currentResiId"
@close="showedResiInfo = false"
/>
<house-info
v-if="showedHouseInfo && currentHouseId"
:house-id="currentHouseId"
@close="showedHouseInfo = false"
/>
<el-dialog
v-if="showSmatrForm"
:visible.sync="showSmatrForm"
:append-to-body="true"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'修改条件'"
width="880px"
top="5vh"
class="dialog-h"
@closed="showSmatrForm = false"
>
<smatr-rules
ref="smatr_rules_form"
@dialogCancle="dialogCancle"
@dialogOk="dialogOk"
:rulesData="rulesData"
>
</smatr-rules>
</el-dialog>
</div>
@ -261,12 +340,12 @@ import getQueryPara from "dai-js/modules/getQueryPara";
import resiInfo from "@/views/modules/cpts/resi/info";
import houseInfo from "@/views/modules/cpts/house/info";
import smatrRules from "./cpts/smatr-rules.vue";
import { requestGet } from '../../../js/dai/request';
import { requestGet } from "../../../js/dai/request";
export default {
components: {
resiInfo,
houseInfo,
smatrRules
smatrRules,
},
props: {
@ -356,7 +435,6 @@ export default {
width: 110,
options: [],
},
],
pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
@ -372,7 +450,6 @@ export default {
list: [],
},
//
showedResiInfo: false,
@ -388,15 +465,16 @@ export default {
showSmatrForm: false,
rulesData: [],
childrenRulesData: []
childrenRulesData: [],
};
},
computed: {
maxTableHeight() {
// return this.clientHeight - 450;
return 420;
return this.$store.state.inIframe
? this.clientHeight - 540 + this.iframeHeigh
: this.clientHeight - 540;
},
...mapGetters(["clientHeight"]),
...mapGetters(["clientHeight", "iframeHeight"]),
},
watch: {
"searchData.searchKey": function (val) {
@ -412,15 +490,17 @@ export default {
},
methods: {
firstSearch() {
this.searchData.searchKey = localStorage.getItem('homeSearchKey') || ''
this.searchData.type = localStorage.getItem('homeSearchType') || ''
this.searchData.searchKey = localStorage.getItem("homeSearchKey") || "";
this.searchData.type = localStorage.getItem("homeSearchType") || "";
this.handleClickSearchBtn();
},
handleClickEditRules() {
this.showSmatrForm = true
this.showSmatrForm = true;
this.$nextTick(() => {
this.$refs.smatr_rules_form.initForm(this.rulesData.length == 0 ? this.childrenRulesData : this.rulesData)
})
this.$refs.smatr_rules_form.initForm(
this.rulesData.length == 0 ? this.childrenRulesData : this.rulesData
);
});
},
computedWidth(label) {
const wd = 20 * label.length;
@ -434,12 +514,12 @@ export default {
});
}
if (row.mobile != '' && row.mobile) {
row.mobile = row.mobile.substr(0, 3) + '****' + row.mobile.substr(7, 4)
} else if (row.mobile == '' || row.mobile == '--') {
row.mobile = ""
if (row.mobile != "" && row.mobile) {
row.mobile = row.mobile.substr(0, 3) + "****" + row.mobile.substr(7, 4);
} else if (row.mobile == "" || row.mobile == "--") {
row.mobile = "";
}
row.idNum = row.idNum.substr(0, 11) + '*****' + row.idNum.substr(16, 2)
row.idNum = row.idNum.substr(0, 11) + "*****" + row.idNum.substr(16, 2);
return _val || row[item.columnName];
},
@ -447,10 +527,10 @@ export default {
const {
searchData: { type, searchKey },
} = this;
localStorage.setItem('homeSearchType', type)
localStorage.setItem('homeSearchKey', searchKey)
if (!searchKey) return
if (!this.smatrFlag) this.childrenRulesData = []
localStorage.setItem("homeSearchType", type);
localStorage.setItem("homeSearchKey", searchKey);
if (!searchKey) return;
if (!this.smatrFlag) this.childrenRulesData = [];
if (type == "jumin") {
this.searchJumin.pageNo = 1;
@ -462,29 +542,34 @@ export default {
this.getSearchFangwu();
}
if (this.smatrFlag && this.childrenRulesData.length === 0) {
this.getRulesList()
this.getRulesList();
}
this.searchStatus = "ing";
},
async getRulesList() {
//MOCK http://127.0.0.1:4523/mock2/2515967/96358430
let url = 'http://127.0.0.1:4523/mock2/2515967/96358430'
let par = {
keyWord: this.searchData.searchKey,
type: this.searchData.type
}
const { data, code, msg } = await requestGet(url, par)
let url = "/actual/base/residentBaseInfo/residentSearchRules";
let formData = new FormData();
formData.append("searchKey", this.searchData.searchKey);
formData.append("type", this.searchData.type);
const { data, code, msg } = await requestPost(url, formData);
if (code == 0) {
this.rulesData = data
this.rulesData = data;
console.log(this.rulesData);
} else {
console.log(msg);
}
},
handleClickSmartSearchBtn() {
this.smatrFlag = !this.smatrFlag
this.searchData.searchKey = ''
this.smatrFlag = !this.smatrFlag;
if (!this.searchData.searchKey) return;
if (this.searchData.type == "jumin") {
this.getSearchJumin();
} else {
this.getSearchFangwu();
}
if (this.smatrFlag) {
this.getRulesList();
}
},
handleSizeChangeSearchJumin(val) {
console.log(`每页 ${val}`);
@ -523,22 +608,22 @@ export default {
this.showedHouseInfo = true;
},
getApiData() { },
getApiData() {},
async getSearchJumin() {
const url = "/actual/base/residentBaseInfo/communitySearch";
let url = this.smatrFlag
? "/actual/base/residentBaseInfo/residentSearch"
: "/actual/base/residentBaseInfo/communitySearch";
const {
searchData: { searchKey },
searchJumin: { pageSize, pageNo },
} = this;
console.log(this.rulesData);
console.log(this.childrenRulesData);
this.searchJumin.loading = true;
const { data, code, msg } = await requestPost(url, {
searchKey,
pageSize,
pageNo,
smartSearchRules: this.childrenRulesData || null
smartSearchRules: this.childrenRulesData || null,
});
this.searchJumin.loading = false;
if (code === 0) {
@ -546,11 +631,12 @@ export default {
this.searchJumin.total = data.total || 0;
this.searchJumin.list = data.list
? data.list.map((item) => {
item = { ...item, ...item.categoryInfo };
return item;
})
item = { ...item, ...item.categoryInfo };
return item;
})
: [];
} else {
this.$message.error(msg);
}
},
@ -565,7 +651,7 @@ export default {
searchKey,
pageSize,
pageNo,
smartSearchRules: this.childrenRulesData || null
smartSearchRules: this.childrenRulesData || null,
});
this.searchFangwu.loading = false;
if (code === 0) {
@ -573,55 +659,55 @@ export default {
this.searchFangwu.total = data.total || 0;
this.searchFangwu.list = data.list
? data.list.map((item) => {
const { houseType, rentFlag, purpose } = item;
item.houseType = {
1: "楼房",
2: "平房",
3: "别墅",
}[houseType];
item.rentFlag = {
0: "自住",
1: "出租",
2: "闲置",
3: "未售出",
}[rentFlag];
item.purpose = {
1: "住宅",
2: "商业",
3: "办公",
4: "工业",
5: "存储",
6: "商住混用",
7: "其它",
}[purpose];
return item;
})
const { houseType, rentFlag, purpose } = item;
item.houseType = {
1: "楼房",
2: "平房",
3: "别墅",
}[houseType];
item.rentFlag = {
0: "自住",
1: "出租",
2: "闲置",
3: "未售出",
}[rentFlag];
item.purpose = {
1: "住宅",
2: "商业",
3: "办公",
4: "工业",
5: "存储",
6: "商住混用",
7: "其它",
}[purpose];
return item;
})
: [];
} else {
}
},
handelClickTab(type) {
console.log(type)
console.log(type);
this.searchData.type = type;
this.handleClickSearchBtn()
this.handleClickSearchBtn();
// this.searchData.searchKey = ''
},
dialogCancle() {
this.showSmatrForm = false
this.showSmatrForm = false;
},
dialogOk(rulesData) {
this.showSmatrForm = false
this.rulesData = []
this.showSmatrForm = false;
this.rulesData = [];
if (rulesData) {
this.childrenRulesData = rulesData || null
this.handleClickSearchBtn()
this.childrenRulesData = rulesData || null;
this.handleClickSearchBtn();
}
}
},
},
destroyed() {
localStorage.removeItem('homeSearchKey')
localStorage.removeItem('homeSearchType')
localStorage.removeItem("homeSearchKey");
localStorage.removeItem("homeSearchType");
},
};
</script>
@ -684,7 +770,7 @@ export default {
display: flex;
align-items: center;
>div {
> div {
position: relative;
margin-right: 30px;
width: 56px;

897
src/views/modules/shequ/cpts/smatr-rules.vue

@ -1,437 +1,488 @@
<template>
<div class="my_form">
<el-table border :data="tableData" style="width: 100%" height="200">
<el-table-column label="选择数据源" align="center" width="120">
<template slot-scope="scope">
<el-select v-model="scope.row.dataSource" placeholder="请选择"
@change="handleChangeSource(scope.row, scope.$index)" clearable>
<el-option v-for="item in dataSourceOpction" :label="item.label" :value="item.value"
:key="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="字段类别" align="center" width="120">
<template slot-scope="scope" v-if="scope.row.dataSource == 'resi'">
<el-select v-model="scope.row.itemGroupId" placeholder="请选择" clearable
@change="handleChangeFieldsType(scope.row, scope.$index)">
<el-option v-for="item in scope.row.itemGroupIdOpction" :label="item.label" :value="item.id"
:key="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="字段名称" align="center" width="120">
<template slot-scope="scope">
<el-select v-model="scope.row.itemId" placeholder="请选择"
@change="handleChangeFieldsName(scope.row, scope.$index)"
@clear="handleClearItemId(scope.row, scope.$index)" clearable>
<el-option v-for="item in scope.row.itemIdOpction" :label="item.label" :value="scope.row.dataSource == 'resi' ? item.itemId : item.colKey
" :key="scope.row.dataSource == 'resi' ? item.itemId : item.colKey">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="比较符" align="center" width="120">
<template slot-scope="scope">
<el-select v-model="scope.row.queryType" placeholder="请选择" clearable>
<el-option v-for="item in queryTypeOpction" :label="item.label" :value="item.value"
:key="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="对应值" width="120" align="center">
<template slot-scope="scope">
<template v-for="item in scope.row.correspondingOpction">
<el-select v-if="item.itemType == 'select' ||
item.itemType == 'radio' ||
item.itemType == 'checkbox'
" v-model="scope.row.colVal" placeholder="请选择" clearable>
<el-option v-for="items in item.options" :label="items.label" :value="items.value"
:key="items.label">
</el-option>
</el-select>
<el-input v-else-if="item.itemType === 'input' || item.itemType === 'textarea'
" v-model="scope.row.colVal" placeholder="请输入" clearable>
</el-input>
<el-input-number v-else-if="item.itemType === 'inputNum'" class="item_width_2"
v-model="scope.row.colVal" :min="0" size="mini" label="请输入"></el-input-number>
<el-date-picker v-else-if="item.itemType === 'datepicker' || item.itemType === 'date'
" v-model="scope.row.colVal" class="item_width_2" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd HH:mm:ss" placeholder="开始时间">
</el-date-picker>
<el-input v-else class="item_width_2" size="mini" placeholder="请输入" v-model="personItem.colVal">
</el-input>
</template>
</template>
</el-table-column>
<el-table-column label="条件关系" align="center" width="100">
<template slot-scope="scope" v-if="scope.$index != tableData.length - 1">
<el-select v-model="scope.row.nextLogicalRel" placeholder="请选择" clearable disabled>
<el-option v-for="item in nextLogicalRelOpction" :label="item.label" :value="item.value"
:key="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="primary" @click="handleClickAddRow" v-if="scope.$index == tableData.length - 1"
size="small" icon="el-icon-plus" circle></el-button>
<div class="my_form">
<el-table border :data="tableData" style="width: 100%" height="200">
<el-table-column label="选择数据源" align="center" width="120">
<template slot-scope="scope">
<el-select
v-model="scope.row.dataSource"
placeholder="请选择"
@change="handleChangeSource(scope.row, scope.$index)"
clearable
>
<el-option
v-for="item in dataSourceOpction"
:label="item.label"
:value="item.value"
:key="item.value"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="字段类别" align="center" width="120">
<template slot-scope="scope" v-if="scope.row.dataSource == 'resi'">
<el-select
v-model="scope.row.itemGroupId"
placeholder="请选择"
clearable
@change="handleChangeFieldsType(scope.row, scope.$index)"
>
<el-option
v-for="item in scope.row.itemGroupIdOpction"
:label="item.label"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="字段名称" align="center" width="120">
<template slot-scope="scope">
<el-select
v-model="scope.row.itemId"
placeholder="请选择"
@change="handleChangeFieldsName(scope.row, scope.$index)"
@clear="handleClearItemId(scope.row, scope.$index)"
clearable
>
<el-option
v-for="item in scope.row.itemIdOpction"
:label="item.label"
:value="
scope.row.dataSource == 'resi' ? item.itemId : item.colKey
"
:key="scope.row.dataSource == 'resi' ? item.itemId : item.colKey"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="比较符" align="center" width="120">
<template slot-scope="scope">
<el-select
v-model="scope.row.queryType"
placeholder="请选择"
clearable
>
<el-option
v-for="item in queryTypeOpction"
:label="item.label"
:value="item.value"
:key="item.value"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="对应值" width="120" align="center">
<template slot-scope="scope">
<template v-for="item in scope.row.correspondingOpction">
<el-select
v-if="
item.itemType == 'select' ||
item.itemType == 'radio' ||
item.itemType == 'checkbox'
"
v-model="scope.row.colVal"
placeholder="请选择"
clearable
>
<el-option
v-for="items in item.options"
:label="items.label"
:value="items.value"
:key="items.label"
>
</el-option>
</el-select>
<el-input
v-else-if="
item.itemType === 'input' || item.itemType === 'textarea'
"
v-model="scope.row.colVal"
placeholder="请输入"
clearable
>
</el-input>
<el-input-number
v-else-if="item.itemType === 'inputNum'"
class="item_width_2"
v-model="scope.row.colVal"
:min="0"
size="mini"
label="请输入"
></el-input-number>
<el-date-picker
v-else-if="
item.itemType === 'datepicker' || item.itemType === 'date'
"
v-model="scope.row.colVal"
class="item_width_2"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd HH:mm:ss"
placeholder="开始时间"
>
</el-date-picker>
<el-input
v-else
class="item_width_2"
size="mini"
placeholder="请输入"
v-model="personItem.colVal"
>
</el-input>
</template>
</template>
</el-table-column>
<el-table-column label="条件关系" align="center" width="100">
<template
slot-scope="scope"
v-if="scope.$index != tableData.length - 1"
>
<el-select
v-model="scope.row.nextLogicalRel"
placeholder="请选择"
clearable
disabled
>
<el-option
v-for="item in nextLogicalRelOpction"
:label="item.label"
:value="item.value"
:key="item.value"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button
type="primary"
@click="handleClickAddRow"
v-if="scope.$index == tableData.length - 1"
size="small"
icon="el-icon-plus"
circle
></el-button>
<el-button type="danger" @click="handleClickDelete(scope.$index)"
v-if="scope.$index != tableData.length - 1 || (tableData.length - 1 >= 1 && scope.$index != '0')"
size="small" icon="el-icon-minus" circle> </el-button>
</template>
</el-table-column>
</el-table>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" type="primary" @click="handleComfirm"> </el-button>
</div>
<el-button
type="danger"
@click="handleClickDelete(scope.$index)"
v-if="
scope.$index != tableData.length - 1 ||
(tableData.length - 1 >= 1 && scope.$index != '0')
"
size="small"
icon="el-icon-minus"
circle
>
</el-button>
</template>
</el-table-column>
</el-table>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" type="primary" @click="handleComfirm"
> </el-button
>
</div>
</div>
</template>
<script>
import { requestPost, requestGet } from "@/js/dai/request";
export default {
data() {
return {
tableData: [
{
dataSource: "", //
itemGroupId: "", //
itemId: "", //
queryType: "", //
colVal: "", //
nextLogicalRel: "and", //,
tableName: "", //
colKey: "",
itemIdOpction: [],
itemGroupIdOpction: [],
correspondingOpction: [],
},
],
dataSourceOpction: [
{ label: "人员信息", value: "resi" },
{ label: "房屋信息", value: "house" },
],
queryTypeOpction: [],
nextLogicalRelOpction: [
{ label: "并且", value: "and" },
{ label: "或者", value: "or" },
],
};
},
created() { },
async mounted() {
},
methods: {
async initForm(data) {
// await this.getFormEdit();
this.tableData = data
console.log(data);
for (let i in this.tableData) {
this.handleChangeSource(this.tableData[i], [i]);
this.handleChangeFieldsType(this.tableData[i], [i]);
setTimeout(() => {
this.handleChangeFieldsName(this.tableData[i], [i]);
}, 300);
}
data() {
return {
tableData: [
{
dataSource: "", //
itemGroupId: "", //
itemId: "", //
queryType: "", //
colVal: "", //
nextLogicalRel: "and", //,
tableName: "", //
colKey: "",
itemIdOpction: [],
itemGroupIdOpction: [],
correspondingOpction: [],
},
],
dataSourceOpction: [
{ label: "人员信息", value: "resi" },
{ label: "房屋信息", value: "house" },
],
queryTypeOpction: [],
nextLogicalRelOpction: [
{ label: "并且", value: "and" },
{ label: "或者", value: "or" },
],
};
},
created() {},
async mounted() {},
methods: {
async initForm(data) {
this.tableData = data;
for (let i in this.tableData) {
this.handleChangeSource(this.tableData[i], [i], "init");
this.handleChangeFieldsType(this.tableData[i], [i], "init");
setTimeout(() => {
this.handleChangeFieldsName(this.tableData[i], [i], "init");
}, 300);
}
},
//
async handleChangeSource(row, index, type) {
let url, params;
//
async handleChangeSource(row, index) {
console.log(row);
if (row.dataSource == "resi") {
let url = "/oper/customize/icformitemgroup/list";
let params = {
formCode: "resi_base_info",
policyFlag: "1",
};
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.$set(this.tableData[index], "itemGroupIdOpction", data);
console.log(this.tableData[index].itemGroupIdOpction);
} else {
this.$message.error(msg);
}
this.hadeleClearForm(this.tableData[index], index);
// if (!type) {
// this.tableData[index].itemGroupId = "";
// this.tableData[index].itemId = "";
// this.tableData[index].colKey = "";
// this.tableData[index].colVal = "";
// this.tableData[index].nextLogicalRel = "";
// this.tableData[index].queryType = "";
// this.tableData[index].itemIdOpction = [];
// }
} else if (row.dataSource == "house") {
let url = "/governance/policy/item-list/house";
let params = {};
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.tableData[index].itemIdOpction = data;
} else {
this.$message.error(msg);
}
this.hadeleClearForm(this.tableData[index], index);
// if (!type) {
// this.tableData[index].itemGroupId = "";
// this.tableData[index].itemId = "";
// this.tableData[index].colKey = "";
// this.tableData[index].colVal = "";
// this.tableData[index].nextLogicalRel = "";
// this.tableData[index].queryType = "";
// }
} else if (row.dataSource == "stat") {
let url = "/governance/policy/item-list/stat";
let params = {};
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.tableData[index].itemIdOpction = data;
} else {
this.$message.error(msg);
}
this.hadeleClearForm(this.tableData[index], index);
// if (!type) {
// this.tableData[index].itemGroupId = "";
// this.tableData[index].itemId = "";
// this.tableData[index].colKey = "";
// this.tableData[index].colVal = "";
// this.tableData[index].nextLogicalRel = "";
// this.tableData[index].queryType = "";
// }
} else {
this.hadeleClearForm(this.tableData[index], index);
this.tableData[index].itemGroupId = "";
this.tableData[index].itemId = "";
this.tableData[index].colKey = "";
this.tableData[index].colVal = "";
this.tableData[index].nextLogicalRel = "";
this.tableData[index].queryType = "";
this.tableData[index].itemIdOpction = [];
}
if (row.dataSource === "resi") {
url = "/oper/customize/icformitemgroup/list";
params = {
formCode: "resi_base_info",
policyFlag: "1",
};
} else if (row.dataSource === "house") {
url = "/governance/policy/item-list/house";
params = {};
}
this.getCompareList();
},
if (url && params) {
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$set(this.tableData[index], "itemGroupIdOpction", data);
console.log(this.tableData[index].itemGroupIdOpction);
} else {
this.$message.error(msg);
}
}
this.hadeleClearForm(this.tableData[index], index);
if (!type) {
this.tableData[index].itemGroupId = "";
this.tableData[index].itemId = "";
this.tableData[index].colKey = "";
this.tableData[index].colVal = "";
this.tableData[index].nextLogicalRel = "and";
this.tableData[index].queryType = "";
//
async handleChangeFieldsType(row, index) {
console.log(row, index, "字段类别row");
if (row.dataSource != "resi") return;
const url = "/oper/customize/icformitem/getItemListV2";
let params = {
groupId: row.itemGroupId,
policyFlag: "1",
};
this.hadeleClearForm(this.tableData[index], index);
// if (!type) {
// this.tableData[index].itemId = "";
// this.tableData[index].colKey = "";
// this.tableData[index].colVal = "";
// this.tableData[index].nextLogicalRel = "";
// this.tableData[index].queryType = "";
// this.tableData[index].itemIdOpction = [];
// }
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.$set(this.tableData[index], "itemIdOpction", data);
console.log(this.tableData[index].itemIdOpction, "see");
} else {
this.$message.error(msg);
}
},
//
async handleChangeFieldsName(row, index) {
console.log(row, "字段名称row");
var arr = [];
// colKeycolumnName
if (row.dataSource == "house" || row.dataSource == "stat") {
arr = row.itemIdOpction.filter((item) => item.colKey == row.itemId);
this.tableData[index].tableName = arr[0].tableName;
this.tableData[index].colKey = arr[0].colKey;
// if (!type) {
// this.tableData[index].colVal = "";
// this.tableData[index].nextLogicalRel = "";
// this.tableData[index].queryType = "";
// }
// this.tableData[index].colVal = ''
// this.tableData[index].queryType = ''
} else if (row.dataSource == "resi" && row.itemId != "") {
arr = row.itemIdOpction.filter((item) => item.itemId == row.itemId);
this.tableData[index].tableName = arr[0].tableName;
this.tableData[index].colKey = arr[0].columnName;
// if (!type) {
// this.tableData[index].colVal = "";
// this.tableData[index].nextLogicalRel = "";
// this.tableData[index].queryType = "";
// }
// this.tableData[index].colVal = ''
// this.tableData[index].queryType = ''
}
if (row.itemId == "") return;
// optionoptionSourceType
console.log(arr[0].optionSourceType);
if (arr[0].optionSourceType == "remote") {
let url = "";
let params = {};
if (row.dataSource == "house") {
url = arr[0].optionSourceUrl;
params = JSON.parse(arr[0].optionSourceParam);
} else {
url = arr[0].optionSourceValue;
}
if (row.dataSource === "house") {
this.tableData[index].itemIdOpction = [];
}
}
this.getCompareList();
},
const { data, code, msg } = await requestPost(url, params);
if (code == 0) {
arr[0].options = data;
this.$set(this.tableData[index], "correspondingOpction", arr);
} else {
this.$message.error(msg);
}
} else {
this.$set(this.tableData[index], "correspondingOpction", arr);
}
//
async handleChangeFieldsType(row, index, type) {
console.log(row, index, "字段类别row");
if (row.dataSource != "resi") return;
const url = "/oper/customize/icformitem/getItemListV2";
let params = {
groupId: row.itemGroupId,
policyFlag: "1",
};
console.log(this.tableData[index], index);
this.hadeleClearForm(this.tableData[index], index);
if (!type) {
this.tableData[index].itemId = "";
this.tableData[index].colKey = "";
this.tableData[index].colVal = "";
this.tableData[index].nextLogicalRel = "and";
this.tableData[index].queryType = "";
this.tableData[index].itemIdOpction = [];
}
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.$set(this.tableData[index], "itemIdOpction", data);
console.log(this.tableData[index].itemIdOpction, "see");
} else {
this.$message.error(msg);
}
},
//
async handleChangeFieldsName(row, index) {
console.log(row, "字段名称row");
var arr = [];
// colKeycolumnName
if (row.dataSource == "house" || row.dataSource == "stat") {
arr = row.itemIdOpction.filter((item) => item.colKey == row.itemId);
this.tableData[index].tableName = arr[0].tableName;
this.tableData[index].colKey = arr[0].colKey;
} else if (row.dataSource == "resi" && row.itemId != "") {
arr = row.itemIdOpction.filter((item) => item.itemId == row.itemId);
this.tableData[index].tableName = arr[0].tableName;
this.tableData[index].colKey = arr[0].columnName;
}
if (row.itemId == "") return;
// optionoptionSourceType
console.log(arr[0].optionSourceType);
if (arr[0].optionSourceType == "remote") {
let url = "";
let params = {};
if (row.dataSource == "house") {
url = arr[0].optionSourceUrl;
params = JSON.parse(arr[0].optionSourceParam);
} else {
url = arr[0].optionSourceValue;
}
console.log(this.tableData);
},
async getCompareList() {
const url = "/sys/dict/data/dictlist";
let params = {
dictType: "sql_query_type",
};
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.queryTypeOpction = data;
} else if (code >= 8000) {
this.$message.error(msg);
}
},
//
hadeleClearForm(row, index) {
let obj = {};
obj = {
dataSource: row.dataSource ? row.dataSource : "",
itemId: row.itemId ? row.itemId : "",
queryType: row.queryType ? row.queryType : "",
colVal: row.colVal ? row.colVal : "",
colKey: row.colKey ? row.colKey : "",
nextLogicalRel: row.nextLogicalRel ? row.nextLogicalRel : "",
tableName: row.tableName ? row.tableName : "",
itemGroupId: row.itemGroupId ? row.itemGroupId : "",
itemIdOpction: row.itemIdOpction ? row.itemIdOpction : [],
itemGroupIdOpction: row.itemGroupIdOpction
? row.itemGroupIdOpction
: [],
};
this.$set(this.tableData, index, obj);
},
async handleComfirm() {
let messageObj = {};
messageObj = this.validateRule(this.tableData);
if (messageObj) {
this.$message.error(messageObj);
return;
}
for (let i in this.tableData) {
for (let j in this.tableData[i]) {
if (
typeof this.tableData[i][j] != "string" &&
typeof this.tableData[i][j] != "number"
) {
this.$delete(this.tableData[i], j);
}
}
}
this.$emit("dialogOk", this.tableData);
const { data, code, msg } = await requestPost(url, params);
if (code == 0) {
arr[0].options = data;
this.$set(this.tableData[index], "correspondingOpction", arr);
} else {
this.$message.error(msg);
}
} else {
this.$set(this.tableData[index], "correspondingOpction", arr);
}
// this.addSubmit();
},
handleCancle() {
this.$emit("dialogCancle");
},
validateRule(tabList) {
console.log(tabList);
let message = "";
tabList.forEach((item, index) => {
if (
(item.itemGroupId === "" && item.dataSource == "resi") ||
item.itemId === "" ||
item.queryType === "" ||
item.colKey === ""
) {
message = `匹配规则${item.dataSource == "resi"
? "人员"
: item.dataSource == "house"
? "房屋"
: item.dataSource == "stat"
? "统计"
: ""
}信息不完整请填写完整 !`;
return message;
}
if (index != this.tableData.length - 1 && item.nextLogicalRel === "") {
message = `匹配规则${item.dataSource == "resi"
? "人员"
: item.dataSource == "house"
? "房屋"
: item.dataSource == "stat"
? "统计"
: ""
}信息不完整请填写完整 !`;
console.log(item);
return message;
}
if (
item.queryType !== "is_null" &&
item.queryType !== "is_not_null" &&
item.colVal === ""
) {
message = `匹配规则${item.dataSource == "resi"
? "人员"
: item.dataSource == "house"
? "房屋"
: item.dataSource == "stat"
? "统计"
: ""
}信息不完整请填写完整 !`;
console.log(this.tableData);
},
async getCompareList() {
const url = "/sys/dict/data/dictlist";
let params = {
dictType: "sql_query_type",
};
let { data, code, msg } = await requestPost(url, params);
if (code == 0) {
this.queryTypeOpction = data;
} else if (code >= 8000) {
this.$message.error(msg);
}
},
//
hadeleClearForm(row, index) {
console.log(row, index);
let obj = {};
obj = {
dataSource: row.dataSource ? row.dataSource : "",
itemId: row.itemId ? row.itemId : "",
queryType: row.queryType ? row.queryType : "",
colVal: row.colVal ? row.colVal : "",
colKey: row.colKey ? row.colKey : "",
nextLogicalRel: row.nextLogicalRel ? row.nextLogicalRel : "",
tableName: row.tableName ? row.tableName : "",
itemGroupId: row.itemGroupId ? row.itemGroupId : "",
itemIdOpction: row.itemIdOpction ? row.itemIdOpction : [],
itemGroupIdOpction: row.itemGroupIdOpction
? row.itemGroupIdOpction
: [],
};
this.$set(this.tableData, index, obj);
console.log(this.tableData);
},
async handleComfirm() {
let messageObj = {};
messageObj = this.validateRule(this.tableData);
if (messageObj) {
this.$message.error(messageObj);
return;
}
for (let i in this.tableData) {
for (let j in this.tableData[i]) {
if (
typeof this.tableData[i][j] != "string" &&
typeof this.tableData[i][j] != "number"
) {
this.$delete(this.tableData[i], j);
}
}
}
this.$emit("dialogOk", this.tableData);
return message;
}
});
return message;
},
handleClickAddRow() {
if (this.tableData === undefined) this.tableData = [];
let obj = {};
obj.dataSource = "";
obj.itemGroupId = "";
obj.itemId = "";
obj.queryType = "";
obj.colVal = "";
obj.nextLogicalRel = "and";
obj.itemIdOpction = [];
this.tableData.push(obj);
},
//
handleClickDelete(index) {
this.tableData.splice(index, 1);
},
handleClearItemId(row, index) {
this.tableData[index].colVal = "";
this.tableData[index].queryType = "";
},
// this.addSubmit();
},
props: {
rulesData: {
type: Array,
default: () => []
handleCancle() {
this.$emit("dialogCancle");
},
validateRule(tabList) {
console.log(tabList);
let message = "";
tabList.forEach((item, index) => {
if (
(item.itemGroupId === "" && item.dataSource == "resi") ||
item.itemId === "" ||
item.queryType === "" ||
item.colKey === ""
) {
message = `匹配规则${
item.dataSource == "resi"
? "人员"
: item.dataSource == "house"
? "房屋"
: item.dataSource == "stat"
? "统计"
: ""
}信息不完整请填写完整 !`;
return message;
}
if (index != this.tableData.length - 1 && item.nextLogicalRel === "") {
message = `匹配规则${
item.dataSource == "resi"
? "人员"
: item.dataSource == "house"
? "房屋"
: item.dataSource == "stat"
? "统计"
: ""
}信息不完整请填写完整 !`;
console.log(item);
return message;
}
if (
item.queryType !== "is_null" &&
item.queryType !== "is_not_null" &&
item.colVal === ""
) {
message = `匹配规则${
item.dataSource == "resi"
? "人员"
: item.dataSource == "house"
? "房屋"
: item.dataSource == "stat"
? "统计"
: ""
}信息不完整请填写完整 !`;
return message;
}
});
return message;
},
handleClickAddRow() {
if (this.tableData === undefined) this.tableData = [];
let obj = {};
obj.dataSource = "";
obj.itemGroupId = "";
obj.itemId = "";
obj.queryType = "";
obj.colVal = "";
obj.nextLogicalRel = "and";
obj.itemIdOpction = [];
this.tableData.push(obj);
},
//
handleClickDelete(index) {
this.tableData.splice(index, 1);
},
handleClearItemId(row, index) {
this.tableData[index].colVal = "";
this.tableData[index].queryType = "";
},
},
props: {
rulesData: {
type: Array,
default: () => [],
},
computed: {},
watch: {},
},
computed: {},
watch: {},
};
</script>
@ -439,20 +490,20 @@ export default {
@import "@/assets/scss/modules/management/list-main.scss";
.imgBtn {
width: 25px;
height: 25px;
margin-top: 3px;
cursor: pointer;
width: 25px;
height: 25px;
margin-top: 3px;
cursor: pointer;
}
.div_btn {
display: flex;
justify-content: flex-end;
margin-top: 10px;
display: flex;
justify-content: flex-end;
margin-top: 10px;
}
.my_form {
padding: 10px 20px 0;
padding: 10px 20px 0;
}
</style>

2
src/views/modules/shequzhili/event/cpts/process-form-replay.vue

@ -189,8 +189,6 @@ export default {
},
handleChangeCate(obj) {
// console.log(this.$refs["myCascader"].getCheckedNodes()[0].data)
// this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
if(obj){
this.selCateObj = obj;
this.formData.categoryList = [];

Loading…
Cancel
Save