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

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

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

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

@ -129,59 +129,8 @@
></el-input> ></el-input>
</el-form-item> </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 <el-form-item
class="block" style="display: block"
label="附件" label="附件"
label-width="150px" label-width="150px"
prop="attach" prop="attach"

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

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

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

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

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

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

Loading…
Cancel
Save