护理站所属区域

This commit is contained in:
闫晓茹 2022-11-04 09:55:48 +08:00
parent 1e2531f95b
commit 2f1e347b70

View File

@ -142,7 +142,7 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:station:edit']" v-hasPermi="['system:station:edit']"
>修改</el-button >修改</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -154,7 +154,7 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:station:remove']" v-hasPermi="['system:station:remove']"
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -165,7 +165,7 @@
size="mini" size="mini"
@click="handledata" @click="handledata"
v-hasPermi="['system:station:importData']" v-hasPermi="['system:station:importData']"
>导入</el-button >导入</el-button
> >
</el-col> </el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
@ -211,11 +211,23 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所属区域" align="center" prop="area"> <el-table-column label="所属区域" align="center" prop="area">
<!-- <span>{{ scope.row.sysAreaVOList[0].provinceName }}-</span>  
<span>{{ scope.row.sysAreaVOList[0].cityName }}-</span> <template slot-scope="scope">
<span>{{ scope.row.sysAreaVOList[0].streetName }}</span> -->
<span>{{
scope.row.areaName !== "null-null-null-null"
? scope.row.areaName
: ""
}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="护理站地址" align="center" prop="address" :show-overflow-tooltip="true"/> <el-table-column
label="护理站地址"
align="center"
prop="address"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column <!-- <el-table-column
label="护理站简介" label="护理站简介"
align="center" align="center"
@ -245,7 +257,7 @@
type="text" type="text"
icon="el-icon-search" icon="el-icon-search"
@click="looknurseStationLabelList(scope.row)" @click="looknurseStationLabelList(scope.row)"
>查看标签信息</el-button >查看标签信息</el-button
> >
<el-button <el-button
size="mini" size="mini"
@ -253,7 +265,7 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:station:edit']" v-hasPermi="['system:station:edit']"
>修改</el-button >修改</el-button
> >
<el-button <el-button
size="mini" size="mini"
@ -261,7 +273,7 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:station:remove']" v-hasPermi="['system:station:remove']"
>删除</el-button >删除</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
@ -295,7 +307,7 @@
</el-table> </el-table>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" plain @click="typeopen = false" size="small" <el-button type="primary" plain @click="typeopen = false" size="small"
>关闭窗口</el-button >关闭窗口</el-button
> >
</div> </div>
</el-dialog> </el-dialog>
@ -322,7 +334,7 @@
plain plain
@click="nurseStationLabelopen = false" @click="nurseStationLabelopen = false"
size="small" size="small"
>关闭窗口</el-button >关闭窗口</el-button
> >
</div> </div>
</el-dialog> </el-dialog>
@ -602,340 +614,340 @@
</template> </template>
<script> <script>
import { import {
listStation, listStation,
getStation, getStation,
delStation, delStation,
addStation, addStation,
updateStation, updateStation,
getFirstLevelInfo, getFirstLevelInfo,
getSecondaryLevelInfo, getSecondaryLevelInfo,
getSubordinateRegions, getSubordinateRegions,
getInfoLists, getInfoLists,
nurseStationlabel, nurseStationlabel,
getLabelList, getLabelList,
} from "@/api/system/station"; } from "@/api/system/station";
import { getInfoList } from "@/api/system/nurseItem"; import { getInfoList } from "@/api/system/nurseItem";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import { getListByUser } from "@/api/system/userlist.js"; import { getListByUser } from "@/api/system/userlist.js";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import editor from "@/components/Editor"; import editor from "@/components/Editor";
export default { export default {
components: { stationAcatar, editor }, components: { stationAcatar, editor },
name: "Station", name: "Station",
data() { data() {
var checkMobile = (rule, value, cb) => { var checkMobile = (rule, value, cb) => {
// //
const regMobile = const regMobile =
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/; /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/;
if (regMobile.test(value)) {
return cb();
}
cb(new Error("请输入正确的联系电话"));
};
//
var checkMobile2 = (rule, value, cb) => {
//
const regMobile =
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/;
if (!value) {
//callback
return cb();
} else {
if (regMobile.test(value)) { if (regMobile.test(value)) {
return cb(); return cb();
}
cb(new Error("请输入正确的联系电话"));
};
//
var checkMobile2 = (rule, value, cb) => {
//
const regMobile =
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/;
if (!value) {
//callback
return cb();
} else { } else {
if (regMobile.test(value)) { cb(new Error("请输入正确的联系电话"));
return cb();
} else {
cb(new Error("请输入正确的联系电话"));
}
} }
}; }
return { };
imageUrl: "", return {
imageUrl2: "", imageUrl: "",
// imageUrl2: "",
upload: { //
// upload: {
open: false, //
//
title: "",
//
isUploading: false,
//
headers: { Authorization: "Bearer " + getToken() },
//
url:
process.env.VUE_APP_BASE_API +
"/system/station/insertNurseStationImportList",
},
//
nurseTypeCode: "nurse_type_code",
nurseStationTypelist: [],
nurseStationType2: null,
//shengshiqu
value3: "",
value2: "",
value1: "",
value: "",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
total2: 0,
//
typelooks: [],
//
looknurseStationLabel: [
{
labelDescription: "",
sort: "",
ids: 1,
},
],
//
stationList: [
{
sysAreaVOList: [
{
provinceName: null,
cityName: null,
streetName: null,
},
],
},
],
nurseStationlist: [],
//
title: "",
//
open: false, open: false,
typeopen: false, //
nurseStationLabelopen: false, title: "",
// //
getListByUserquery: { isUploading: false,
pageNum: 1, //
pageSize: 10, headers: { Authorization: "Bearer " + getToken() },
//
url:
process.env.VUE_APP_BASE_API +
"/system/station/insertNurseStationImportList",
},
//
nurseTypeCode: "nurse_type_code",
nurseStationTypelist: [],
nurseStationType2: null,
//shengshiqu
value3: "",
value2: "",
value1: "",
value: "",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
total2: 0,
//
typelooks: [],
//
looknurseStationLabel: [
{
labelDescription: "",
sort: "",
ids: 1,
}, },
// ],
queryParams: { //
pageNum: 1, stationList: [
pageSize: 10, {
areaCode: null, sysAreaVOList: [
userId: null,
nurseStationCode: null,
nurseStationName: null,
id: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
sort: null,
},
//
form: {},
ids: 1,
provincelist: [],
arealist: [],
citylist: [],
streetlist: [],
resid: null,
//
rules: {
agencyIntroduce: [
{ required: true, message: "请输入护理站简介", trigger: "blur" },
],
stationIntroducePcitureUrl: [
{ required: true, message: "请上传护理站简介头像", trigger: "blur" },
],
stationPictureUrl: [
{ required: true, message: "请上传护理站头像", trigger: "blur" },
],
nurseStationDescription: [
{ required: true, message: "护理站总概述不能为空", trigger: "blur" },
],
phone: [
{ {
required: true, provinceName: null,
validator: checkMobile, cityName: null,
trigger: "blur", streetName: null,
message: "",
}, },
// { required: true, message: "", trigger: "blur" },
],
// dutyPerson: [
// { required: true, message: "", trigger: "blur" },
// ],
dutyPhone: [
{
validator: checkMobile2,
trigger: "blur",
message: "",
},
// { required: false, message: "", trigger: "blur" },
],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }],
address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
longitude: [
{ required: true, message: "经度不能为空", trigger: "blur" },
],
latitude: [
{ required: true, message: "纬度不能为空", trigger: "blur" },
],
areaCode: [
{ required: true, message: "所属区域不能为空", trigger: "blur" },
],
nurseStationName: [
{ required: true, message: "护理站名称不能为空", trigger: "blur" },
],
nurseStationType: [
{ required: true, message: "请选择护理站类型", trigger: "blur" },
], ],
}, },
}; ],
nurseStationlist: [],
//
title: "",
//
open: false,
typeopen: false,
nurseStationLabelopen: false,
//
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
areaCode: null,
userId: null,
nurseStationCode: null,
nurseStationName: null,
id: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
sort: null,
},
//
form: {},
ids: 1,
provincelist: [],
arealist: [],
citylist: [],
streetlist: [],
resid: null,
//
rules: {
agencyIntroduce: [
{ required: true, message: "请输入护理站简介", trigger: "blur" },
],
stationIntroducePcitureUrl: [
{ required: true, message: "请上传护理站简介头像", trigger: "blur" },
],
stationPictureUrl: [
{ required: true, message: "请上传护理站头像", trigger: "blur" },
],
nurseStationDescription: [
{ required: true, message: "护理站总概述不能为空", trigger: "blur" },
],
phone: [
{
required: true,
validator: checkMobile,
trigger: "blur",
message: "",
},
// { required: true, message: "", trigger: "blur" },
],
// dutyPerson: [
// { required: true, message: "", trigger: "blur" },
// ],
dutyPhone: [
{
validator: checkMobile2,
trigger: "blur",
message: "",
},
// { required: false, message: "", trigger: "blur" },
],
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }],
address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
longitude: [
{ required: true, message: "经度不能为空", trigger: "blur" },
],
latitude: [
{ required: true, message: "纬度不能为空", trigger: "blur" },
],
areaCode: [
{ required: true, message: "所属区域不能为空", trigger: "blur" },
],
nurseStationName: [
{ required: true, message: "护理站名称不能为空", trigger: "blur" },
],
nurseStationType: [
{ required: true, message: "请选择护理站类型", trigger: "blur" },
],
},
};
},
created() {
this.getList();
this.info();
},
methods: {
imgUrl(imgUrl) {
console.log(imgUrl);
this.form.stationPictureUrl = imgUrl;
}, },
created() { imgUrl2(imgUrl) {
this.getList(); console.log(imgUrl);
this.info(); this.form.stationIntroducePcitureUrl = imgUrl;
}, },
methods: { delnurseStationLabelList(item) {
imgUrl(imgUrl) { console.log(item);
console.log(imgUrl); if (item.ids && !item.id) {
this.form.stationPictureUrl = imgUrl; if (this.looknurseStationLabel.length == 1) {
}, this.$message.error("最后一条不可删除");
imgUrl2(imgUrl) {
console.log(imgUrl);
this.form.stationIntroducePcitureUrl = imgUrl;
},
delnurseStationLabelList(item) {
console.log(item);
if (item.ids && !item.id) {
if (this.looknurseStationLabel.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.looknurseStationLabel = this.looknurseStationLabel.filter(
(e) => e.ids != item.ids
);
}
} else if (!item.ids && item.id) {
if (this.looknurseStationLabel.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.looknurseStationLabel = this.looknurseStationLabel.filter(
(e) => e.id != item.id
);
}
}
console.log(this.form.nurseStationLabelList);
},
addnurseStationLabelList() {
if (this.looknurseStationLabel.length == 5) {
this.$message.error("最多只能5条");
} else { } else {
this.ids++; this.looknurseStationLabel = this.looknurseStationLabel.filter(
var obj = { (e) => e.ids != item.ids
labelDescription: "", );
sort: "",
ids: this.ids,
};
this.looknurseStationLabel.push(obj);
} }
} else if (!item.ids && item.id) {
if (this.looknurseStationLabel.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.looknurseStationLabel = this.looknurseStationLabel.filter(
(e) => e.id != item.id
);
}
}
console.log(this.form.nurseStationLabelList);
},
addnurseStationLabelList() {
if (this.looknurseStationLabel.length == 5) {
this.$message.error("最多只能5条");
} else {
this.ids++;
var obj = {
labelDescription: "",
sort: "",
ids: this.ids,
};
this.looknurseStationLabel.push(obj);
}
console.log(this.looknurseStationLabel);
},
//
looknurseStationLabelList(item) {
console.log(item);
nurseStationlabel(item.id).then((res) => {
this.looknurseStationLabel = res.rows;
this.nurseStationLabelopen = true;
console.log(this.looknurseStationLabel); console.log(this.looknurseStationLabel);
}, });
// },
looknurseStationLabelList(item) { //
console.log(item); looktype(item) {
nurseStationlabel(item.id).then((res) => { // console.log(item);
this.looknurseStationLabel = res.rows; this.typelooks = [];
this.nurseStationLabelopen = true; getInfoLists(item.nurseStationType).then((res) => {
console.log(this.looknurseStationLabel); console.log(res);
}); this.typelooks = res.data;
}, this.typeopen = true;
// });
looktype(item) { },
// console.log(item); //
this.typelooks = []; clickstreet(item) {
getInfoLists(item.nurseStationType).then((res) => { this.form.areaCode = item.areaCode;
console.log(res); this.value3 = item.areaCode;
this.typelooks = res.data; console.log(this.form);
this.typeopen = true; },
}); //
}, clickarea(item) {
// this.value3 = "";
clickstreet(item) { console.log(item);
this.form.areaCode = item.areaCode; getSecondaryLevelInfo(item.id).then((res) => {
this.value3 = item.areaCode; console.log(res);
console.log(this.form); this.streetlist = res.data;
}, });
// },
clickarea(item) { //
this.value3 = ""; clickcity(item) {
console.log(item); this.value2 = "";
getSecondaryLevelInfo(item.id).then((res) => { this.value3 = "";
console.log(res); console.log(item);
this.streetlist = res.data; getSecondaryLevelInfo(item.id).then((res) => {
}); console.log(res);
}, this.arealist = res.data;
// });
clickcity(item) { },
this.value2 = ""; //
this.value3 = ""; province(item) {
console.log(item); this.value1 = "";
getSecondaryLevelInfo(item.id).then((res) => { this.value2 = "";
console.log(res); this.value3 = "";
this.arealist = res.data; getSecondaryLevelInfo(item.id).then((res) => {
}); this.citylist = res.data;
}, });
// },
province(item) { /** 查询护理站信息列表 */
this.value1 = ""; getList() {
this.value2 = ""; this.liststationinfo();
this.value3 = ""; getFirstLevelInfo().then((res) => {
getSecondaryLevelInfo(item.id).then((res) => { this.provincelist = res.data;
this.citylist = res.data; });
}); getInfoList().then((res) => {
}, this.nurseStationTypelist = res.data;
/** 查询护理站信息列表 */ });
getList() { this.loading = true;
this.liststationinfo(); },
getFirstLevelInfo().then((res) => { //
this.provincelist = res.data; cancel() {
}); this.open = false;
getInfoList().then((res) => { this.reset();
this.nurseStationTypelist = res.data; this.value3 = "";
}); this.value2 = "";
this.loading = true; this.value1 = "";
}, this.value = "";
// },
cancel() { //
this.open = false; reset() {
this.reset(); this.nurseStationType2 = [];
this.value3 = ""; this.form = {
this.value2 = ""; id: null,
this.value1 = ""; areaCode: null,
this.value = ""; nurseStationCode: null,
}, nurseStationName: null,
// nurseStationType: null,
reset() {
this.nurseStationType2 = [];
this.form = {
id: null,
areaCode: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null, agencyIntroduce: null,
nurseStationDescription: null, nurseStationDescription: null,
@ -955,19 +967,6 @@
/** 搜索按钮操作 */ /** 搜索按钮操作 */
liststationinfo() { liststationinfo() {
listStation(this.queryParams).then((response) => { listStation(this.queryParams).then((response) => {
response.rows.forEach((e) => {
if (e.provinceName) {
e.area =
e.provinceName +
"-" +
e.cityName +
"-" +
e.regionName +
"-" +
e.streetName;
}
} );
this.stationList = response.rows; this.stationList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;