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. 372
      src/views/modules/shequ/chaxun.vue
  5. 309
      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"

372
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,62 +41,85 @@
</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
class="m-tb"
v-if="
searchData.type == 'jumin' &&
searchData.searchKey != '' && searchData.searchKey != '' &&
searchStatus == 'ing' 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
@ -102,34 +137,22 @@
: "" : ""
}} }}
{{ {{
scope.row.categoryInfo.floatingFlag == 1 scope.row.categoryInfo.floatingFlag == 1 ? "流动人口 " : ""
? "流动人口 "
: ""
}} }}
{{ {{
scope.row.categoryInfo.liveAloneFlag == 1 scope.row.categoryInfo.liveAloneFlag == 1 ? "独居老人 " : ""
? "独居老人 "
: ""
}} }}
{{ {{
scope.row.categoryInfo.oldPeopleFlag == 1 scope.row.categoryInfo.oldPeopleFlag == 1 ? "老年人 " : ""
? "老年人 "
: ""
}} }}
{{ scope.row.categoryInfo.partyFlag == 1 ? "党员 " : "" }}
{{ {{
scope.row.categoryInfo.partyFlag == 1 scope.row.categoryInfo.petitionOfficerFlag == 1
? "党员 "
: ""
}}
{{
scope.row.categoryInfo
.petitionOfficerFlag == 1
? "信访人员 " ? "信访人员 "
: "" : ""
}} }}
{{ {{
scope.row.categoryInfo.seriousIllnessFlag == scope.row.categoryInfo.seriousIllnessFlag == 1
1
? "大病 " ? "大病 "
: "" : ""
}} }}
@ -139,20 +162,13 @@
: "" : ""
}} }}
{{ {{
scope.row.categoryInfo scope.row.categoryInfo.subsistenceAllowanceFlag == 1
.subsistenceAllowanceFlag == 1
? "低保人员 " ? "低保人员 "
: "" : ""
}} }}
{{ scope.row.categoryInfo.tenantFlag == 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
@ -160,51 +176,75 @@
: "" : ""
}} }}
{{ {{
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
class="m-tb"
v-if="
searchData.type == 'fangwu' &&
searchData.searchKey != '' && searchData.searchKey != '' &&
searchStatus == 'ing' 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}`);
@ -526,19 +611,19 @@ export default {
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) {
@ -551,6 +636,7 @@ export default {
}) })
: []; : [];
} 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) {
@ -601,27 +687,27 @@ export default {
} }
}, },
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>

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

@ -3,40 +3,74 @@
<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)"
clearable
>
<el-option
v-for="item in dataSourceOpction"
:label="item.label"
:value="item.value"
:key="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="字段类别" align="center" width="120"> <el-table-column label="字段类别" align="center" width="120">
<template slot-scope="scope" v-if="scope.row.dataSource == 'resi'"> <template slot-scope="scope" v-if="scope.row.dataSource == 'resi'">
<el-select v-model="scope.row.itemGroupId" placeholder="请选择" clearable <el-select
@change="handleChangeFieldsType(scope.row, scope.$index)"> v-model="scope.row.itemGroupId"
<el-option v-for="item in scope.row.itemGroupIdOpction" :label="item.label" :value="item.id" placeholder="请选择"
:key="item.id"> 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-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<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.itemId" placeholder="请选择" <el-select
v-model="scope.row.itemId"
placeholder="请选择"
@change="handleChangeFieldsName(scope.row, scope.$index)" @change="handleChangeFieldsName(scope.row, scope.$index)"
@clear="handleClearItemId(scope.row, scope.$index)" clearable> @clear="handleClearItemId(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 clearable
" :key="scope.row.dataSource == 'resi' ? item.itemId : item.colKey"> >
<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>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<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.queryType" placeholder="请选择" clearable> <el-select
<el-option v-for="item in queryTypeOpction" :label="item.label" :value="item.value" v-model="scope.row.queryType"
:key="item.value"> placeholder="请选择"
clearable
>
<el-option
v-for="item in queryTypeOpction"
:label="item.label"
:value="item.value"
:key="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
@ -44,51 +78,116 @@
<el-table-column label="对应值" width="120" align="center"> <el-table-column label="对应值" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-for="item in scope.row.correspondingOpction"> <template v-for="item in scope.row.correspondingOpction">
<el-select v-if="item.itemType == 'select' || <el-select
v-if="
item.itemType == 'select' ||
item.itemType == 'radio' || item.itemType == 'radio' ||
item.itemType == 'checkbox' item.itemType == 'checkbox'
" v-model="scope.row.colVal" placeholder="请选择" clearable> "
<el-option v-for="items in item.options" :label="items.label" :value="items.value" v-model="scope.row.colVal"
:key="items.label"> placeholder="请选择"
clearable
>
<el-option
v-for="items in item.options"
:label="items.label"
:value="items.value"
:key="items.label"
>
</el-option> </el-option>
</el-select> </el-select>
<el-input v-else-if="item.itemType === 'input' || item.itemType === 'textarea' <el-input
" v-model="scope.row.colVal" placeholder="请输入" clearable> v-else-if="
item.itemType === 'input' || item.itemType === 'textarea'
"
v-model="scope.row.colVal"
placeholder="请输入"
clearable
>
</el-input> </el-input>
<el-input-number v-else-if="item.itemType === 'inputNum'" class="item_width_2" <el-input-number
v-model="scope.row.colVal" :min="0" size="mini" label="请输入"></el-input-number> v-else-if="item.itemType === 'inputNum'"
<el-date-picker v-else-if="item.itemType === 'datepicker' || item.itemType === 'date' class="item_width_2"
" v-model="scope.row.colVal" class="item_width_2" type="datetime" v-model="scope.row.colVal"
value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd HH:mm:ss" placeholder="开始时间"> :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-date-picker>
<el-input v-else class="item_width_2" size="mini" placeholder="请输入" v-model="personItem.colVal"> <el-input
v-else
class="item_width_2"
size="mini"
placeholder="请输入"
v-model="personItem.colVal"
>
</el-input> </el-input>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="条件关系" align="center" width="100"> <el-table-column label="条件关系" align="center" width="100">
<template slot-scope="scope" v-if="scope.$index != tableData.length - 1"> <template
<el-select v-model="scope.row.nextLogicalRel" placeholder="请选择" clearable disabled> slot-scope="scope"
<el-option v-for="item in nextLogicalRelOpction" :label="item.label" :value="item.value" v-if="scope.$index != tableData.length - 1"
:key="item.value"> >
<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-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 fixed="right" label="操作" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" @click="handleClickAddRow" v-if="scope.$index == tableData.length - 1" <el-button
size="small" icon="el-icon-plus" circle></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)"
v-if="
scope.$index != tableData.length - 1 ||
(tableData.length - 1 >= 1 && scope.$index != '0')
"
size="small"
icon="el-icon-minus"
circle
>
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="div_btn"> <div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button> <el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" type="primary" @click="handleComfirm"> </el-button> <el-button size="small" type="primary" @click="handleComfirm"
> </el-button
>
</div> </div>
</div> </div>
</template> </template>
@ -125,100 +224,60 @@ export default {
}; };
}, },
created() {}, created() {},
async mounted() { async mounted() {},
},
methods: { methods: {
async initForm(data) { async initForm(data) {
// await this.getFormEdit(); this.tableData = data;
this.tableData = data
console.log(data);
for (let i in this.tableData) { for (let i in this.tableData) {
this.handleChangeSource(this.tableData[i], [i]); this.handleChangeSource(this.tableData[i], [i], "init");
this.handleChangeFieldsType(this.tableData[i], [i]); this.handleChangeFieldsType(this.tableData[i], [i], "init");
setTimeout(() => { setTimeout(() => {
this.handleChangeFieldsName(this.tableData[i], [i]); this.handleChangeFieldsName(this.tableData[i], [i], "init");
}, 300); }, 300);
} }
}, },
// //
async handleChangeSource(row, index) { async handleChangeSource(row, index, type) {
console.log(row); let url, params;
if (row.dataSource == "resi") {
let url = "/oper/customize/icformitemgroup/list"; if (row.dataSource === "resi") {
let params = { url = "/oper/customize/icformitemgroup/list";
params = {
formCode: "resi_base_info", formCode: "resi_base_info",
policyFlag: "1", policyFlag: "1",
}; };
let { data, code, msg } = await requestPost(url, params); } else if (row.dataSource === "house") {
if (code == 0) { url = "/governance/policy/item-list/house";
params = {};
}
if (url && params) {
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$set(this.tableData[index], "itemGroupIdOpction", data); this.$set(this.tableData[index], "itemGroupIdOpction", data);
console.log(this.tableData[index].itemGroupIdOpction); console.log(this.tableData[index].itemGroupIdOpction);
} else { } else {
this.$message.error(msg); 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); this.hadeleClearForm(this.tableData[index], index);
// if (!type) { 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].itemGroupId = "";
this.tableData[index].itemId = ""; this.tableData[index].itemId = "";
this.tableData[index].colKey = ""; this.tableData[index].colKey = "";
this.tableData[index].colVal = ""; this.tableData[index].colVal = "";
this.tableData[index].nextLogicalRel = ""; this.tableData[index].nextLogicalRel = "and";
this.tableData[index].queryType = ""; this.tableData[index].queryType = "";
if (row.dataSource === "house") {
this.tableData[index].itemIdOpction = []; this.tableData[index].itemIdOpction = [];
} }
}
this.getCompareList(); this.getCompareList();
}, },
// //
async handleChangeFieldsType(row, index) { async handleChangeFieldsType(row, index, type) {
console.log(row, index, "字段类别row"); console.log(row, index, "字段类别row");
if (row.dataSource != "resi") return; if (row.dataSource != "resi") return;
const url = "/oper/customize/icformitem/getItemListV2"; const url = "/oper/customize/icformitem/getItemListV2";
@ -226,15 +285,16 @@ export default {
groupId: row.itemGroupId, groupId: row.itemGroupId,
policyFlag: "1", policyFlag: "1",
}; };
console.log(this.tableData[index], index);
this.hadeleClearForm(this.tableData[index], index); this.hadeleClearForm(this.tableData[index], index);
// if (!type) { if (!type) {
// this.tableData[index].itemId = ""; this.tableData[index].itemId = "";
// this.tableData[index].colKey = ""; this.tableData[index].colKey = "";
// this.tableData[index].colVal = ""; this.tableData[index].colVal = "";
// this.tableData[index].nextLogicalRel = ""; this.tableData[index].nextLogicalRel = "and";
// this.tableData[index].queryType = ""; this.tableData[index].queryType = "";
// this.tableData[index].itemIdOpction = []; this.tableData[index].itemIdOpction = [];
// } }
let { data, code, msg } = await requestPost(url, params); let { data, code, msg } = await requestPost(url, params);
if (code == 0) { if (code == 0) {
this.$set(this.tableData[index], "itemIdOpction", data); this.$set(this.tableData[index], "itemIdOpction", data);
@ -252,24 +312,10 @@ export default {
arr = row.itemIdOpction.filter((item) => item.colKey == row.itemId); arr = row.itemIdOpction.filter((item) => item.colKey == row.itemId);
this.tableData[index].tableName = arr[0].tableName; this.tableData[index].tableName = arr[0].tableName;
this.tableData[index].colKey = arr[0].colKey; 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 != "") { } else if (row.dataSource == "resi" && row.itemId != "") {
arr = row.itemIdOpction.filter((item) => item.itemId == row.itemId); arr = row.itemIdOpction.filter((item) => item.itemId == row.itemId);
this.tableData[index].tableName = arr[0].tableName; this.tableData[index].tableName = arr[0].tableName;
this.tableData[index].colKey = arr[0].columnName; 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; if (row.itemId == "") return;
// optionoptionSourceType // optionoptionSourceType
@ -311,6 +357,7 @@ export default {
}, },
// //
hadeleClearForm(row, index) { hadeleClearForm(row, index) {
console.log(row, index);
let obj = {}; let obj = {};
obj = { obj = {
dataSource: row.dataSource ? row.dataSource : "", dataSource: row.dataSource ? row.dataSource : "",
@ -327,6 +374,7 @@ export default {
: [], : [],
}; };
this.$set(this.tableData, index, obj); this.$set(this.tableData, index, obj);
console.log(this.tableData);
}, },
async handleComfirm() { async handleComfirm() {
let messageObj = {}; let messageObj = {};
@ -362,7 +410,8 @@ export default {
item.queryType === "" || item.queryType === "" ||
item.colKey === "" item.colKey === ""
) { ) {
message = `匹配规则${item.dataSource == "resi" message = `匹配规则${
item.dataSource == "resi"
? "人员" ? "人员"
: item.dataSource == "house" : item.dataSource == "house"
? "房屋" ? "房屋"
@ -373,7 +422,8 @@ export default {
return message; return message;
} }
if (index != this.tableData.length - 1 && item.nextLogicalRel === "") { if (index != this.tableData.length - 1 && item.nextLogicalRel === "") {
message = `匹配规则${item.dataSource == "resi" message = `匹配规则${
item.dataSource == "resi"
? "人员" ? "人员"
: item.dataSource == "house" : item.dataSource == "house"
? "房屋" ? "房屋"
@ -389,7 +439,8 @@ export default {
item.queryType !== "is_not_null" && item.queryType !== "is_not_null" &&
item.colVal === "" item.colVal === ""
) { ) {
message = `匹配规则${item.dataSource == "resi" message = `匹配规则${
item.dataSource == "resi"
? "人员" ? "人员"
: item.dataSource == "house" : item.dataSource == "house"
? "房屋" ? "房屋"
@ -427,8 +478,8 @@ export default {
props: { props: {
rulesData: { rulesData: {
type: Array, type: Array,
default: () => [] default: () => [],
} },
}, },
computed: {}, computed: {},
watch: {}, watch: {},

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