老产品前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1392 lines
47 KiB

<template>
<div class="epidemic-form">
<div class="dialog-h-content scroll-h">
3 years ago
<el-tabs v-model="activeName"
type="card"
class="main_tab"
@tab-click="handleClick">
<el-tab-pane label="逐个添加"
name="first">
<el-form ref="ref_form1"
:inline="true"
:model="formData1"
:rules="dataRule1"
class="form">
<el-form-item label="姓名"
prop="name"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入姓名"
clearable
v-model="formData1.name">
</el-input>
</el-form-item>
3 years ago
<el-form-item label="手机号"
prop="mobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入手机号"
clearable
v-model="formData1.mobile">
</el-input>
</el-form-item>
3 years ago
<el-form-item label="证件号"
prop="idCard"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入身份证号或证件号"
clearable
v-model="formData1.idCard">
</el-input>
</el-form-item>
3 years ago
<el-form-item :label="reasonTitle"
3 years ago
prop="reason"
label-width="220px"
style="display: block">
<el-input class="item_width_1"
3 years ago
:placeholder="'请输入'+reasonTitle"
3 years ago
clearable
v-model="formData1.reason">
3 years ago
</el-input>
</el-form-item>
3 years ago
<el-form-item label="隔离状态"
prop="isolatedState"
label-width="220px"
style="display: block">
<el-select v-model="formData1.isolatedState"
class="item_width_4"
placeholder="请选择"
clearable>
<el-option v-for="item in options.isolatedState"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<div v-if="isPanshi">
<el-form-item label="管控时间"
prop="gkStartTime"
label-width="220px"
style="display: block">
<el-date-picker v-model="gkTimeRange1"
size="small"
type="daterange"
@change="handleGkTimeChange1"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="镇(街)干部"
prop="gbName"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入镇(街)干部"
clearable
v-model="formData1.gbName">
</el-input>
</el-form-item>
<el-form-item label="镇(街)干部联系方式"
prop="gbMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入镇(街)干部联系方式"
clearable
v-model="formData1.gbMobile">
</el-input>
</el-form-item>
<el-form-item label="村(社区)网格管理员"
prop="gridManager"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入村(社区)网格管理员"
clearable
v-model="formData1.gridManager">
</el-input>
</el-form-item>
<el-form-item label="村(社区)网格管理员联系方式"
prop="gridManagerMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入村(社区)网格管理员联系方式"
clearable
v-model="formData1.gridManagerMobile">
</el-input>
</el-form-item>
<el-form-item label="基层医务工作者"
prop="healthWorker"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入基层医务工作者"
clearable
v-model="formData1.healthWorker">
</el-input>
</el-form-item>
<el-form-item label="基层医务工作者联系方式"
prop="healthWorkerMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入基层医务工作者联系方式"
clearable
v-model="formData1.healthWorkerMobile">
</el-input>
</el-form-item>
<el-form-item label="民警"
prop="policeName"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入民警"
clearable
v-model="formData1.policeName">
</el-input>
</el-form-item>
<el-form-item label="民警及联系方式"
prop="policeMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入民警及联系方式"
clearable
v-model="formData1.policeMobile">
</el-input>
</el-form-item>
<el-form-item label="志愿者"
prop="volunteerName"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入志愿者"
clearable
v-model="formData1.volunteerName">
</el-input>
</el-form-item>
<el-form-item label="志愿者联系方式"
prop="volunteerMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入志愿者联系方式"
clearable
v-model="formData1.volunteerMobile">
</el-input>
</el-form-item>
</div>
<el-form-item label="备注"
prop="remark"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
3 years ago
type="textarea"
maxlength="500"
show-word-limit
:autosize="{ minRows: 2, maxRows: 5 }"
clearable
placeholder="请输入通知备注"
v-model="formData1.remark"></el-input>
</el-form-item>
3 years ago
<el-form-item label="通知渠道"
prop="channel"
label-width="220px"
style="display: block">
<el-checkbox v-model="formData1.isSelChannel"
@change="handleChannelChange2"
key="0"
label="0">小程序通知</el-checkbox>
<!-- <el-checkbox-group v-model="formData1.channel">
<el-checkbox key="1"
label="1">小程序通知</el-checkbox>
<el-checkbox key="2"
label="2">短信通知</el-checkbox>
</el-checkbox-group> -->
</el-form-item>
3 years ago
<el-form-item v-if="formData1.isSelChannel"
label="通知内容"
prop="content"
label-width="220px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
placeholder="请输入通知内容"
v-model="formData1.content"></el-input>
</el-form-item>
</el-form>
</el-tab-pane>
3 years ago
<el-tab-pane label="批量添加"
name="second">
<div class="div-mult-table">
3 years ago
<el-form :inline="true"
:model="formDataSearch"
ref="ref_formSearch"
label-width="90px">
<el-form-item label="所属网格">
3 years ago
<el-select class="item_width_3"
v-model.trim="formDataSearch.gridId"
placeholder="请选择"
size="mini"
clearable
@change="handleChangeGrid">
<el-option v-for="item in gridList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="所属小区"
prop="neighborId">
<el-select v-model.trim="formDataSearch.neighborId"
placeholder="请选择小区"
size="small"
clearable
class="resi-cell-select"
@clear="handleClearVillage"
@change="handleChangeV">
<el-option v-for="item in optionsV"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
3 years ago
<el-select v-model.trim="formDataSearch.buildingId"
placeholder="楼号"
size="small"
clearable
style="width: 120px"
class="resi-cell-select"
@clear="handleClearBuild"
@change="handleChangeB">
<el-option v-for="item in optionsB"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
3 years ago
<el-select v-model.trim="formDataSearch.unitId"
placeholder="单元"
size="small"
clearable
style="width: 120px"
class="resi-cell-select"
@click="handleClearDan"
@change="handleChangeD">
<el-option v-for="item in optionsD"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
3 years ago
<el-select v-model.trim="formDataSearch.houseId"
placeholder="房号"
size="small"
clearable
style="width: 120px"
class="resi-cell-select">
<el-option v-for="item in optionsH"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="姓名"
prop="name">
<el-input v-model="formDataSearch.name"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入姓名">
</el-input>
</el-form-item>
3 years ago
<el-form-item label="手机号"
prop="mobile">
<el-input v-model="formDataSearch.mobile"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入手机号">
</el-input>
</el-form-item>
3 years ago
<el-form-item label="证件号"
prop="idCard">
<el-input v-model="formDataSearch.idCard"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入身份证号或护照号">
</el-input>
</el-form-item>
3 years ago
<el-form-item label="年龄"
prop="age">
<inputRange v-model="formDataSearch.age"
type="num"
@change="handleAgeChange" />
</el-form-item>
3 years ago
<el-form-item label="核酸检测次数小于"
label-width="220px">
<el-input-number class="item_width_3"
v-model="formDataSearch.natCount"
size="mini"
:min="0"
:max="20"
label="核酸检测次数小于"></el-input-number>
3 years ago
</el-form-item>
3 years ago
<el-form-item label="检测时间"
prop="startTime">
<el-date-picker v-model="timeRange"
size="mini"
type="daterange"
@change="handleTimeChange"
format="yyyy-MM-dd"
value-format="yyyyMMdd"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
3 years ago
</el-date-picker>
</el-form-item>
3 years ago
3 years ago
<el-button style="margin-left: 30px"
size="mini"
class="diy-button--search"
@click="handleSearch">查询</el-button>
<el-button style="margin-left: 10px"
size="mini"
class="diy-button--reset"
@click="resetSearch">重置</el-button>
</el-form>
3 years ago
<el-table ref="ref_table"
class="table"
size="mini"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:reserve-selection="true"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
@select="handleSelectTable"
@select-all="handleSelAll"
style="width: 100%">
<el-table-column type="selection"
width="55"></el-table-column>
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="name"
header-align="center"
align="center"
label="姓名"
width="90">
</el-table-column>
3 years ago
<el-table-column prop="mobile"
header-align="center"
align="center"
label="手机号"
width="110">
</el-table-column>
3 years ago
<el-table-column prop="idCard"
header-align="center"
align="center"
label="证件号"
min-width="170">
</el-table-column>
3 years ago
<el-table-column prop="houseName"
header-align="center"
align="center"
label="所属房屋"
min-width="170">
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="natCount"
header-align="center"
align="center"
label="核酸检测次数"
min-width="100">
</el-table-column>
</el-table>
<div>
3 years ago
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
3 years ago
<div class="div_selcount">
<span> 已选择人数</span>
<span style="color: red"> {{ selectionAll.length }}</span>
3 years ago
</div>
</div>
<div class="div-mult-form">
<!-- <div class="div_person">
<div class="person_title">已选居民</div>
<div v-if="selectionAll.length>0">
<el-tag class="tag_item"
v-for="(tag,index) in selectionAll"
:key="index"
:disable-transitions="false"
@close="handleCloseTag(tag,index)"
closable>
{{tag.name}}
</el-tag>
</div>
<div v-else
class="tag_tip">请从列表中选择居民</div>
</div> -->
3 years ago
<el-form :inline="true"
:model="formData2"
ref="ref_form2"
label-width="90px"
:rules="dataRule1">
3 years ago
<el-form-item :label="reasonTitle"
3 years ago
prop="reason"
label-width="220px"
style="display: block">
<el-input class="item_width_1"
3 years ago
:placeholder="'请输入'+reasonTitle"
3 years ago
clearable
v-model="formData2.reason">
3 years ago
</el-input>
</el-form-item>
3 years ago
<el-form-item label="隔离状态"
prop="isolatedState"
label-width="220px"
style="display: block">
<el-select v-model="formData2.isolatedState"
placeholder="请选择"
clearable>
<el-option v-for="item in options.isolatedState"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<div v-if="isPanshi">
<el-form-item label="管控时间"
prop="gkStartTime"
label-width="220px"
style="display: block">
<el-date-picker v-model="gkTimeRange1"
size="small"
type="daterange"
@change="handleGkTimeChange2"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="镇(街)干部"
prop="gbName"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入镇(街)干部"
clearable
v-model="formData2.gbName">
</el-input>
</el-form-item>
<el-form-item label="镇(街)干部联系方式"
prop="gbMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入镇(街)干部联系方式"
clearable
v-model="formData2.gbMobile">
</el-input>
</el-form-item>
<el-form-item label="村(社区)网格管理员"
prop="gridManager"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入村(社区)网格管理员"
clearable
v-model="formData2.gridManager">
</el-input>
</el-form-item>
<el-form-item label="村(社区)网格管理员联系方式"
prop="gridManagerMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入村(社区)网格管理员联系方式"
clearable
v-model="formData2.gridManagerMobile">
</el-input>
</el-form-item>
<el-form-item label="基层医务工作者"
prop="healthWorker"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入基层医务工作者"
clearable
v-model="formData2.healthWorker">
</el-input>
</el-form-item>
<el-form-item label="基层医务工作者联系方式"
prop="healthWorkerMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入基层医务工作者联系方式"
clearable
v-model="formData2.healthWorkerMobile">
</el-input>
</el-form-item>
<el-form-item label="民警"
prop="policeName"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入民警"
clearable
v-model="formData2.policeName">
</el-input>
</el-form-item>
<el-form-item label="民警及联系方式"
prop="policeMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入民警及联系方式"
clearable
v-model="formData2.policeMobile">
</el-input>
</el-form-item>
<el-form-item label="志愿者"
prop="volunteerName"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入志愿者"
clearable
v-model="formData2.volunteerName">
</el-input>
</el-form-item>
<el-form-item label="志愿者联系方式"
prop="volunteerMobile"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
placeholder="请输入志愿者联系方式"
clearable
v-model="formData2.volunteerMobile">
</el-input>
</el-form-item>
</div>
<el-form-item label="备注"
prop="remark"
label-width="220px"
style="display: block">
<el-input class="item_width_4"
3 years ago
type="textarea"
maxlength="500"
show-word-limit
:autosize="{ minRows: 2, maxRows: 5 }"
clearable
placeholder="请输入通知备注"
v-model="formData2.remark"></el-input>
</el-form-item>
3 years ago
<el-form-item label="通知渠道"
prop="channel"
label-width="220px"
style="display: block">
<el-checkbox v-model="formData2.isSelChannel"
@change="handleChannelChange2"
key="0"
label="0">小程序通知</el-checkbox>
<!-- <el-checkbox-group v-model="formData2.channel">
<el-checkbox key="0"
label="0">小程序通知</el-checkbox>
<el-checkbox key="1"
label="1">短信通知</el-checkbox>
</el-checkbox-group> -->
</el-form-item>
3 years ago
<el-form-item v-if="formData2.isSelChannel"
label="通知内容"
prop="content"
label-width="100px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
placeholder="请输入通知内容"
v-model="formData2.content"></el-input>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
</div>
<div class="form_div_btn">
3 years ago
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { Loading } from "element-ui"; // 引入Loading服务
import { requestPost } from "@/js/dai/request";
import { mapGetters } from "vuex";
import inputRange from "@/views/components/rangeInput.vue";
let loading; // 加载动画
export default {
3 years ago
data () {
return {
activeName: "first",
gridList: [],
btnDisable: false,
formDataSearch: {
gridId: "",
3 years ago
natCount: undefined,
startDate: "",
endDate: "",
attentionType: 2,
neighborId: "",
buildingId: "",
unitId: "",
houseId: "",
name: "",
mobile: "",
idCard: "",
age: {},
startBirthDay: "",
endBirthDay: "",
},
3 years ago
timeRange: [],
optionsV: [],
optionsB: [],
optionsH: [],
optionsD: [],
optionsG: [],
formData1: {
3 years ago
attentionType: 2,
name: "",
idCard: "",
mobile: "",
reason: "",
remark: "",
isSelChannel: false,
channel: [],
content: "",
isolatedState: "",
3 years ago
gkStartTime: '',
gkEndTime: '',
gbName: '',
gbMobile: '',
gridManager: '',
gridManagerMobile: '',
healthWorker: '',
healthWorkerMobile: '',
policeName: '',
policeMobile: '',
volunteerName: '',
volunteerMobile: '',
},
3 years ago
gkTimeRange1: [],
gkTimeRange2: [],
formData2: {
3 years ago
attentionType: 2,
reason: "",
remark: "",
isSelChannel: false,
channel: [],
content: "",
isolatedState: "",
3 years ago
gkStartTime: '',
gkEndTime: '',
gbName: '',
gbMobile: '',
gridManager: '',
gridManagerMobile: '',
healthWorker: '',
healthWorkerMobile: '',
policeName: '',
policeMobile: '',
volunteerName: '',
volunteerMobile: '',
},
tableData: [],
total: 0,
pageSize: 20,
pageNo: 1,
tableLoading: false,
selectionAll: [], //选中的人员
options: {
isolatedState: [],
},
};
},
components: { inputRange },
3 years ago
async mounted () {
const { user } = this.$store.state;
this.agencyId = user.agencyId;
//获取网格下拉框数据
await this.loadGrid();
this.getFmOptions("isolatedState", "/sys/dict/data/dictlist", {
dictType: "isolatedState",
});
},
methods: {
3 years ago
handleGkTimeChange1 (time) {
if (time) {
this.formData1.gkStartTime = time[0];
this.formData1.gkEndTime = time[1];
} else {
this.formData1.gkStartTime = "";
this.formData1.gkEndTime = "";
}
},
handleGkTimeChange2 (time) {
if (time) {
this.formData2.gkStartTime = time[0];
this.formData2.gkEndTime = time[1];
} else {
this.formData2.gkStartTime = "";
this.formData2.gkEndTime = "";
}
},
handleChannelChange1 (val) {
this.formData1.content = "";
3 years ago
},
3 years ago
handleChannelChange2 (val) {
this.formData2.content = "";
3 years ago
},
3 years ago
async initForm () {
this.tableData = [];
this.$refs["ref_form1"].resetFields();
this.$refs["ref_form2"].resetFields();
3 years ago
// await this.loadTable()
},
3 years ago
handleSearch () {
this.selectionAll = [];
this.loadTable();
},
3 years ago
async loadTable () {
this.tableLoading = true;
const url = "/epmetuser/epidemicPrevention/user-list";
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formDataSearch,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.total = data.total;
data.list.forEach((element) => {
element.isSel = false;
});
this.tableData = data.list;
this.analysisTableSelection();
} else {
this.$message.error(msg);
}
this.tableLoading = false;
},
3 years ago
handleTimeChange (time) {
3 years ago
if (time) {
this.formData.startDate = time[0];
this.formData.endDate = time[1];
3 years ago
} else {
this.formData.startDate = "";
this.formData.endDate = "";
3 years ago
}
},
3 years ago
handleSelectTable (selection, row) {
row.isSel = !row.isSel;
if (row.isSel) {
this.selectionAll.push(row);
} else {
for (let i = 0; i < this.selectionAll.length; i++) {
let item = this.selectionAll[i];
if (item.idCard === row.idCard) {
this.selectionAll.splice(i, 1);
break;
}
}
}
},
3 years ago
handleSelAll (selection) {
let selFlag = selection.length > 0; //全选选中 还是 全选不选中
for (let i = 0; i < this.tableData.length; i++) {
let tableItem = this.tableData[i];
tableItem.isSel = selFlag;
let isHasItem = false;
for (let j = 0; j < this.selectionAll.length; j++) {
let selectionItem = this.selectionAll[j];
if (selectionItem.idCard === tableItem.idCard) {
isHasItem = true;
if (!selFlag) {
this.selectionAll.splice(j, 1);
break;
}
}
}
if (!isHasItem && selFlag) {
this.selectionAll.push(tableItem);
}
}
},
//删除标签
3 years ago
handleCloseTag (tag, index) {
for (let i = 0; i < this.tableData.length; i++) {
let tableItem = this.tableData[i];
if (tag.idCard === tableItem.idCard) {
//如果表中存在这个数据
tableItem.isSel = false;
this.$refs.ref_table.toggleRowSelection(tableItem);
break;
}
}
for (let i = 0; i < this.selectionAll.length; i++) {
let item = this.selectionAll[i];
if (item.idCard === tag.idCard) {
this.selectionAll.splice(i, 1);
break;
}
}
},
//回显列表选中的行
3 years ago
analysisTableSelection () {
this.$nextTick(() => {
this.tableData.forEach((tableItem) => {
for (let j = 0; j < this.selectionAll.length; j++) {
let selectionItem = this.selectionAll[j];
if (selectionItem.idCard === tableItem.idCard) {
tableItem.isSel = true;
break;
}
}
if (tableItem.isSel) {
this.$refs.ref_table.toggleRowSelection(tableItem);
}
});
});
},
3 years ago
handleClick () { },
3 years ago
handleAgeChange (val) {
console.log("val----age---", val);
if (val.start) {
const e = this.computedBirth(val.start);
this.formDataSearch.endBirthDay = e;
} else {
this.formDataSearch.endBirthDay = "";
}
if (val.end) {
const s = this.computedBirth(val.end);
this.formDataSearch.startBirthDay = s;
} else {
this.formDataSearch.startBirthDay = "";
}
},
3 years ago
computedBirth (age) {
let now = new Date();
let nowYear = now.getFullYear();
let nowMonth = now.getMonth() + 1;
let nowDay = now.getDate(); // 按照减法原理,先day相减,不够向month借;然后month相减,不够向year借;最后year相减。
let subYear = nowYear - age;
if (nowMonth < 10) {
nowMonth = "0" + nowMonth;
}
if (nowDay < 10) {
nowDay = "0" + nowDay;
}
console.log(subYear + "-" + nowMonth + "-" + nowDay);
return subYear + "-" + nowMonth + "-" + nowDay;
},
3 years ago
handleClearVillage () {
this.formDataSearch.buildingId = "";
this.formDataSearch.unitId = "";
this.formDataSearch.houseId = "";
},
3 years ago
handleClearBuild () {
this.formDataSearch.buildingId = "";
this.formDataSearch.unitId = "";
this.formDataSearch.houseId = "";
},
3 years ago
handleClearDan () {
this.formDataSearch.unitId = "";
this.formDataSearch.houseId = "";
},
3 years ago
handleChangeGrid (val) {
console.log("val", val);
this.formDataSearch.neighborId = "";
this.formDataSearch.buildingId = "";
this.formDataSearch.unitId = "";
this.formDataSearch.houseId = "";
this.getValiheList();
},
3 years ago
handleChangeV (val) {
console.log("val", val);
this.formDataSearch.buildingId = "";
this.formDataSearch.unitId = "";
this.formDataSearch.houseId = "";
this.getBuildList();
},
3 years ago
handleChangeB (val) {
console.log("val", val);
this.formDataSearch.unitId = "";
this.formDataSearch.houseId = "";
this.getUniList();
},
3 years ago
handleChangeD (val) {
console.log("val", val);
this.formDataSearch.houseId = "";
this.getHouseList();
},
3 years ago
async loadGrid () {
const url = "/gov/org/customergrid/gridoption";
let params = {
agencyId: this.agencyId,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.gridList = data;
} else {
this.$message.error(msg);
}
},
3 years ago
getValiheList () {
const { user } = this.$store.state;
this.$http
.post("/gov/org/icneighborhood/neighborhoodoption", {
gridId: this.formDataSearch.gridId,
agencyId: "",
// agencyId: user.agencyId
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log("获取查询详情成功", res.data);
this.optionsV = res.data;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
3 years ago
getBuildList () {
this.$http
.post("/gov/org/icbuilding/buildingoption", {
neighborHoodId: this.formDataSearch.neighborId,
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log("获取查询详情成功", res.data);
this.optionsB = res.data;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
3 years ago
getUniList () {
this.$http
.post("/gov/org/icbuildingunit/unitoption", {
buildingId: this.formDataSearch.buildingId,
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log("获取查询详情成功", res.data);
this.optionsD = res.data;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
3 years ago
getHouseList () {
this.$http
.post("/gov/org/ichouse/houseoption", {
unitId: this.formDataSearch.unitId,
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log("获取查询详情成功", res.data);
this.optionsH = res.data;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
3 years ago
handleComfirm () {
if (this.activeName === "first") {
this.$refs["ref_form1"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
} else {
this.handleVero();
}
});
} else {
this.$refs["ref_form2"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
} else {
this.handleVero();
}
});
}
},
3 years ago
async handleVero () {
let list = [];
if (this.activeName === "first") {
list.push(this.formData1);
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //手机号码
if (regPhone.test(this.formData1.mobile) === false) {
this.btnDisable = false;
this.$message({
type: "warning",
message: "请输入正确的手机号码",
});
return false;
}
const regCard = /(^\d{15}$)|(^\d{17}(\d|X)$)|(^[a-zA-Z0-9]{8,9}$)/; //证件号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
if (regCard.test(this.formData1.idCard) === false) {
this.btnDisable = false;
this.$message({
type: "warning",
message: "请输入正确的证件号码",
});
return false;
}
if (this.formData1.isSelChannel) {
if (!this.formData1.content) {
this.$message({
type: "warning",
message: "请填写通知内容",
});
return false;
} else {
this.formData1.channel = ["0"];
}
} else {
this.formData1.channel = [];
}
} else {
if (this.selectionAll.length === 0) {
this.$message.info("请选择批量添加的人员");
return false;
}
if (this.formData2.isSelChannel) {
if (!this.formData2.content) {
this.$message({
type: "warning",
message: "请填写通知内容",
});
return false;
} else {
this.formData2.channel = ["0"];
}
} else {
this.formData2.channel = [];
}
this.selectionAll.forEach((element) => {
let obj = {
name: element.name,
idCard: element.idCard,
mobile: element.mobile,
...this.formData2,
};
list.push(obj);
});
}
console.log(list);
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
}, 5000);
let url = "/epmetuser/icEpidemicSpecialAttention/vaccination-add";
// url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/save"
let params = {
list: list,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$message({
type: "success",
message: "操作成功",
});
this.resetData();
this.$emit("dialogOk");
this.btnDisable = false;
} else {
this.btnDisable = false;
this.$message.error(msg);
}
},
3 years ago
async getFmOptions (field, url, params, cookFn) {
const { data, code, msg } = await requestPost(url, {
...params,
});
if (code === 0) {
this.options[field] =
typeof cookFn == "function" ? cookFn(data) : data || [];
} else {
this.$message.error("请求基础数据失败!");
}
},
3 years ago
handleCancle () {
this.resetData();
this.$emit("dialogCancle");
},
3 years ago
resetSearch () {
this.formDataSearch = {
gridId: "",
3 years ago
natCount: undefined,
startDate: "",
endDate: "",
attentionType: 2,
};
this.timeRange = [];
},
3 years ago
resetData () {
this.formData1 = {
name: "",
idCard: "",
mobile: "",
reason: "",
remark: "",
isSelChannel: false,
channel: [],
content: "",
3 years ago
attentionType: 2,
isolatedState: "",
3 years ago
gkStartTime: '',
gkEndTime: '',
gbName: '',
gbMobile: '',
gridManager: '',
gridManagerMobile: '',
healthWorker: '',
healthWorkerMobile: '',
policeName: '',
policeMobile: '',
volunteerName: '',
volunteerMobile: '',
};
3 years ago
this.gkTimeRange1 = [];
this.formData2 = {
3 years ago
attentionType: 2,
reason: "",
remark: "",
isSelChannel: false,
channel: [],
content: "",
isolatedState: "",
3 years ago
gkStartTime: '',
gkEndTime: '',
gbName: '',
gbMobile: '',
gridManager: '',
gridManagerMobile: '',
healthWorker: '',
healthWorkerMobile: '',
policeName: '',
policeMobile: '',
volunteerName: '',
volunteerMobile: '',
};
3 years ago
this.gkTimeRange2 = [];
this.formDataSearch = {
gridId: "",
3 years ago
natCount: undefined,
};
this.selectionAll = []; //选中的人员
},
3 years ago
handleSizeChange (val) {
this.pageSize = val;
this.pageNo = 1;
this.loadTable();
},
3 years ago
handleCurrentChange (val) {
this.pageNo = val;
this.loadTable();
},
// 开启加载动画
3 years ago
startLoading () {
loading = Loading.service({
lock: true, // 是否锁定
text: "正在加载……", // 加载中需要显示的文字
background: "rgba(0,0,0,.7)", // 背景颜色
});
},
// 结束加载动画
3 years ago
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
computed: {
3 years ago
tableHeight () {
return 300;
},
...mapGetters(["clientHeight", "iframeHeight"]),
3 years ago
dataRule1 () {
return {
name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
idCard: [
{ required: true, message: "证件号不能为空", trigger: "blur" },
],
mobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" },
],
isolatedState: [
{ required: true, message: "隔离状态必填", trigger: "blur" },
],
};
},
},
props: {
3 years ago
isPanshi: {
type: Boolean,
default: false
},
3 years ago
reasonTitle: {
type: String,
default: '关注原因'
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/epidemic.scss";
</style>