Merge remote-tracking branch 'origin/dev'

# Conflicts:
#	src/api/baseurl.js
#	src/main.js
This commit is contained in:
纪寒 2022-11-18 14:39:33 +08:00
commit b186d2675f
21 changed files with 4648 additions and 5155 deletions

View File

@ -2,8 +2,8 @@ import request from '@/utils/request'
export function getListByUser(query) {
return request({
url: '/system/user/getListByUser',
url: '/system/station/list',
method: 'GET',
params: query
})
}
}

View File

@ -2,272 +2,300 @@
* 通用css样式布局处理
* Copyright (c) 2019 xinyilu
*/
/** 基础通用 **/
.pt5 {
padding-top: 5px;
}
.pr5 {
padding-right: 5px;
}
.pb5 {
padding-bottom: 5px;
}
.mt5 {
margin-top: 5px;
}
.mr5 {
margin-right: 5px;
}
.mb5 {
margin-bottom: 5px;
}
.mb8 {
margin-bottom: 8px;
}
.ml5 {
margin-left: 5px;
}
.mt10 {
margin-top: 10px;
}
.mr10 {
margin-right: 10px;
}
.mb10 {
margin-bottom: 10px;
}
.ml10 {
margin-left: 10px;
}
.mt20 {
margin-top: 20px;
}
.mr20 {
margin-right: 20px;
}
.mb20 {
margin-bottom: 20px;
}
.ml20 {
margin-left: 20px;
}
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
.pt5 {
padding-top: 5px;
}
.el-dialog:not(.is-fullscreen) {
margin-top: 6vh !important;
}
.pr5 {
padding-right: 5px;
}
.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body {
overflow: auto;
overflow-x: hidden;
max-height: 70vh;
padding: 10px 20px 0;
}
.pb5 {
padding-bottom: 5px;
}
.el-table {
.el-table__header-wrapper, .el-table__fixed-header-wrapper {
th {
word-break: break-word;
background-color: #f8f8f9;
color: #515a6e;
height: 40px;
font-size: 13px;
}
}
.el-table__body-wrapper {
.el-button [class*="el-icon-"] + span {
margin-left: 1px;
}
}
}
.mt5 {
margin-top: 5px;
}
/** 表单布局 **/
.form-header {
font-size:15px;
color:#6379bb;
border-bottom:1px solid #ddd;
margin:8px 10px 25px 10px;
padding-bottom:5px
}
.mr5 {
margin-right: 5px;
}
/** 表格布局 **/
.pagination-container {
position: relative;
height: 25px;
margin-bottom: 10px;
margin-top: 15px;
padding: 10px 20px !important;
}
.mb5 {
margin-bottom: 5px;
}
/* tree border */
.tree-border {
margin-top: 5px;
border: 1px solid #e5e6e7;
background: #FFFFFF none;
border-radius:4px;
}
.mb8 {
margin-bottom: 8px;
}
.pagination-container .el-pagination {
right: 0;
position: absolute;
}
.ml5 {
margin-left: 5px;
}
@media ( max-width : 768px) {
.pagination-container .el-pagination > .el-pagination__jump {
display: none !important;
}
.pagination-container .el-pagination > .el-pagination__sizes {
display: none !important;
}
}
.mt10 {
margin-top: 10px;
}
.el-table .fixed-width .el-button--mini {
padding-left: 0;
padding-right: 0;
width: inherit;
}
.mr10 {
margin-right: 10px;
}
/** 表格更多操作下拉样式 */
.el-table .el-dropdown-link {
cursor: pointer;
color: #409EFF;
margin-left: 5px;
}
.mb10 {
margin-bottom: 10px;
}
.el-table .el-dropdown, .el-icon-arrow-down {
font-size: 12px;
}
.ml10 {
margin-left: 10px;
}
.el-tree-node__content > .el-checkbox {
margin-right: 8px;
}
.mt20 {
margin-top: 20px;
}
.list-group-striped > .list-group-item {
border-left: 0;
border-right: 0;
border-radius: 0;
padding-left: 0;
padding-right: 0;
}
.mr20 {
margin-right: 20px;
}
.list-group {
padding-left: 0px;
list-style: none;
}
.mb20 {
margin-bottom: 20px;
}
.list-group-item {
border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec;
margin-bottom: -1px;
padding: 11px 0px;
font-size: 13px;
}
.ml20 {
margin-left: 20px;
}
.pull-right {
float: right !important;
}
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
.el-card__header {
padding: 14px 15px 7px;
min-height: 40px;
}
.el-dialog:not(.is-fullscreen) {
margin-top: 6vh !important;
}
.el-card__body {
padding: 15px 20px 20px 20px;
}
.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body {
overflow: auto;
overflow-x: hidden;
max-height: 70vh;
padding: 10px 20px 0;
}
.card-box {
padding-right: 15px;
padding-left: 15px;
margin-bottom: 10px;
}
.el-table {
.el-table__header-wrapper,
.el-table__fixed-header-wrapper {
th {
word-break: break-word;
background-color: #f8f8f9;
color: #515a6e;
height: 40px;
font-size: 13px;
}
}
.el-table__body-wrapper {
.el-button [class*="el-icon-"]+span {
margin-left: 1px;
}
}
}
/** 表单布局 **/
/* button color */
.el-button--cyan.is-active,
.el-button--cyan:active {
background: #20B2AA;
border-color: #20B2AA;
color: #FFFFFF;
}
.form-header {
font-size: 15px;
color: #6379bb;
border-bottom: 1px solid #ddd;
margin: 8px 10px 25px 10px;
padding-bottom: 5px
}
/** 表格布局 **/
.el-button--cyan:focus,
.el-button--cyan:hover {
background: #48D1CC;
border-color: #48D1CC;
color: #FFFFFF;
}
.pagination-container {
position: relative;
height: 25px;
margin-bottom: 10px;
margin-top: 15px;
padding: 10px 20px !important;
}
/* tree border */
.el-button--cyan {
background-color: #20B2AA;
border-color: #20B2AA;
color: #FFFFFF;
}
.tree-border {
margin-top: 5px;
border: 1px solid #e5e6e7;
background: #FFFFFF none;
border-radius: 4px;
}
/* text color */
.text-navy {
color: #1ab394;
}
.pagination-container .el-pagination {
right: 0;
position: absolute;
}
.text-primary {
color: inherit;
}
@media ( max-width: 768px) {
.pagination-container .el-pagination>.el-pagination__jump {
display: none !important;
}
.pagination-container .el-pagination>.el-pagination__sizes {
display: none !important;
}
}
.text-success {
color: #1c84c6;
}
.el-table .fixed-width .el-button--mini {
padding-left: 0;
padding-right: 0;
width: inherit;
}
/** 表格更多操作下拉样式 */
.text-info {
color: #23c6c8;
}
.el-table .el-dropdown-link {
cursor: pointer;
color: #409EFF;
margin-left: 5px;
}
.text-warning {
color: #f8ac59;
}
.el-table .el-dropdown,
.el-icon-arrow-down {
font-size: 12px;
}
.text-danger {
color: #ed5565;
}
.el-tree-node__content>.el-checkbox {
margin-right: 8px;
}
.text-muted {
color: #888888;
}
.list-group-striped>.list-group-item {
border-left: 0;
border-right: 0;
border-radius: 0;
padding-left: 0;
padding-right: 0;
}
/* image */
.img-circle {
border-radius: 50%;
}
.list-group {
padding-left: 0px;
list-style: none;
}
.img-lg {
width: 120px;
height: 120px;
}
.list-group-item {
border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec;
margin-bottom: -1px;
padding: 11px 0px;
font-size: 13px;
}
.avatar-upload-preview {
position: absolute;
top: 50%;
transform: translate(50%, -50%);
width: 200px;
height: 200px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
.pull-right {
float: right !important;
}
/* 拖拽列样式 */
.sortable-ghost{
opacity: .8;
color: #fff!important;
background: #42b983!important;
}
.el-card__header {
padding: 14px 15px 7px;
min-height: 40px;
}
.top-right-btn {
position: relative;
float: right;
}
.el-card__body {
padding: 15px 20px 20px 20px;
}
.card-box {
padding-right: 15px;
padding-left: 15px;
margin-bottom: 10px;
}
/* button color */
.el-button--cyan.is-active,
.el-button--cyan:active {
background: #20B2AA;
border-color: #20B2AA;
color: #FFFFFF;
}
.el-button--cyan:focus,
.el-button--cyan:hover {
background: #48D1CC;
border-color: #48D1CC;
color: #FFFFFF;
}
.el-button--cyan {
background-color: #20B2AA;
border-color: #20B2AA;
color: #FFFFFF;
}
/* text color */
.text-navy {
color: #1ab394;
}
.text-primary {
color: inherit;
}
.text-success {
color: #1c84c6;
}
.text-info {
color: #23c6c8;
}
.text-warning {
color: #f8ac59;
}
.text-danger {
color: #ed5565;
}
.text-muted {
color: #888888;
}
/* image */
.img-circle {
border-radius: 50%;
}
.img-lg {
width: 120px;
height: 120px;
}
.avatar-upload-preview {
position: absolute;
top: 50%;
transform: translate(50%, -50%);
width: 200px;
height: 200px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
/* 拖拽列样式 */
.sortable-ghost {
opacity: .8;
color: #fff!important;
background: #42b983!important;
}
.top-right-btn {
position: relative;
float: right;
}

View File

@ -1,14 +0,0 @@
import Vue from 'vue'
Vue.directive('loadmore', {
bind(el, binding) {
// 获取element-ui定义好的scroll盒子
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
SELECTWRAP_DOM.addEventListener('scroll', function() {
const CONDITION = this.scrollHeight - this.scrollTop === this.clientHeight;
if (CONDITION == false) {
binding.value()
}
})
}
})

View File

@ -9,19 +9,9 @@
label-width="100px"
>
<el-form-item label="所属护理站" prop="nurseStationName">
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
queryParams.nurseStationName
}}</el-button>
</el-form-item>
<el-form-item label="商品名称" prop="goodsName">
<el-input
@ -66,7 +56,6 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@ -292,7 +281,6 @@
:type="'goodsPictureUrl'"
/>
</el-form-item>
<el-table
ref="goodDetailsLists"
:data="goodDetailsLists"
@ -371,7 +359,6 @@
></editor>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
@ -379,7 +366,7 @@
</el-dialog>
<!-- 新增护理站名称弹框 -->
<el-dialog
:title="title"
title="选择护理站"
:visible.sync="innerVisible"
width="1000px"
append-to-body
@ -481,508 +468,16 @@
</template>
<script>
import {
getGoodsInfo,
delGoodsInfo,
addGoodsInfo,
updateGoodsInfo,
updatePicture,
goodsInfoList,
goodsCategory,
editGoodsWhetherShelf,
stationList,
} from "@/api/system/OperateGoodsInfo";
import editor from "@/components/Editor";
import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl.js";
export default {
components: { stationAcatar, editor },
name: "OperateGoodsInfo",
data() {
return {
imgone: "",
imageUrl: "", //
value: "",
datas: null,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
total2: 0,
//
goodsInfoList: [],
//
nurseStationlist: [],
//
goodsCategorylist: [],
//
title: "",
//
open: false,
// open2: false,
innerVisible: false,
StationName: "请选择所属护理站",
nursetotal: 0,
nurseStationId: null,
goods: [
{
value: "BUSINESS",
label: "买卖",
},
{
value: "LEASE",
label: "租赁",
},
],
options: [
{
value: 0,
label: "否",
},
{
value: 1,
label: "是",
},
],
// goodAttributeDetailsLists:[],
goodDetailsLists: [],
ids: 9999999,
//
shangjia: {
id: null,
whetherShelf: null,
},
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
queryParams: {
id: null,
pageNum: 1,
pageSize: 10,
storeInfoId: null,
nurseStationId: null,
goodsCategoryId: null,
goodsName: null,
// goodsCode: null,
whetherShelf: null,
shelfTime: null,
goodsPictureUrl: null,
goodsRemark: null,
goodsUnit: null,
goodsPurpose: null,
sort: null,
},
//
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
//
form: {
nurseStationId: null,
},
//
rules: {
goodsName: [
{ required: true, message: "请输入商品名称", trigger: "blur" },
],
goodsCategoryId: [
{ required: true, message: "请选择商品分类名称", trigger: "blur" },
],
goodsPurpose: [
{ required: true, message: "请选择商品用途", trigger: "blur" },
],
goodsUnit: [
{ required: true, message: "请输入商品度量单位", trigger: "blur" },
],
goodsPictureUrl: [
{ required: true, message: "请输入选择图片", trigger: "blur" },
],
},
};
},
created() {
this.getList();
this.info();
// this.getList2();
},
methods: {
upwhetherShelf(row) {
console.log(row);
if (row.whetherShelf == false) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 0,
};
} else if (row.whetherShelf == true) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 1,
};
}
editGoodsWhetherShelf(obj).then((res) => {
console.log(obj);
if (obj.whetherShelf == 0) {
this.$modal.msgSuccess("已修改上架状态为未上架");
} else {
this.$modal.msgSuccess("已修改上架状态为上架");
}
this.getList();
});
},
/** 查询商品基本信息列表 */
getList() {
this.loading = true;
goodsInfoList(this.queryParams).then((response) => {
response.rows.forEach((e) => {
if (e.whetherShelf == 1) {
e.whetherShelf = true;
} else if (e.whetherShelf == 0) {
e.whetherShelf = false;
}
});
this.goodsInfoList = response.rows;
console.log(this.goodsInfoList);
this.total = response.total;
this.loading = false;
});
},
//
addgoodAttributeDetail() {
console.log(this.goodDetailsLists);
if (this.goodDetailsLists.length == 5) {
this.$message.error("最多只能5条");
} else {
this.ids++;
var obj = {
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: this.ids,
};
this.goodDetailsLists.push(obj);
}
},
//
delgoodAttributeDetail(item) {
console.log(item);
if (item.ids && !item.attributeDetailsId) {
if (this.goodDetailsLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.goodDetailsLists = this.goodDetailsLists.filter(
(e) => e.ids != item.ids
);
}
} else if (!item.ids && item.attributeDetailsId) {
if (this.goodDetailsLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.goodDetailsLists = this.goodDetailsLists.filter(
(e) => e.attributeDetailsId != item.attributeDetailsId
);
}
}
console.log(this.goodDetailsLists);
},
//
cancel() {
console.log(this.form);
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.form.goodsPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.open = false;
this.reset();
this.StationName = "请选择所属护理站";
this.goodDetailsLists = [
{
attributeName: "",
goodAttributeDetailsLists: [
{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
},
],
},
];
},
clickinnerVisible() {
this.innerVisible = true;
},
nurseclick(row) {
// console.log(this.form);
console.log(row);
this.form.nurseStationId = row.id;
this.StationName = row.nurseStationName;
this.innerVisible = false;
},
handleQuery2() {
// this.getListByUserquery.pageNum = 1;
this.info();
},
// getList2() {
// stationList(this.getListByUserquery).then((res) => {
// this.total2 = res.total;
// this.nurseStationlist = res.rows;
// });
// },
resetQuery2() {
this.resetForm("queryForm");
(this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
}),
this.handleQuery2();
},
addcancel() {
this.innerVisible = false;
this.resetQuery2();
},
//
reset() {
this.form = {
id: null,
storeInfoId: null,
nurseStationId: null,
goodsCategoryId: null,
goodsName: null,
// goodsCode: null,
whetherShelf: null,
shelfTime: null,
goodsPictureUrl: null,
goodsRemark: null,
goodsUnit: null,
goodsPurpose: null,
sort: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.goodDetailsLists = [
{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999999,
},
];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
goodsName: null,
goodsCategoryName: null,
goodsPurpose: null,
};
this.handleQuery();
},
//
handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.goodsInfoId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.nurseStationId = "";
this.title = "商品基本信息";
// this.nurseName = "";
this.StationName = "请选择所属护理站";
this.goodDetailsLists = [
{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999999,
},
];
this.open = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.goodsInfoId || this.ids;
this.StationName = row.nurseStationName;
if (this.StationName == null) {
this.StationName = "请选择所属护理站";
}
console.log(this.StationName);
getGoodsInfo(id).then((response) => {
this.form = response.data[0];
this.imgone = this.form.goodsPictureUrl;
if (response.data[0].goodAttributeDetailsLists) {
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
}
this.open = true;
this.title = "修改商品基本信息";
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form);
console.log(this.goodDetailsLists);
this.form.goodAttributeDetailsLists = [];
this.form.goodDetailsLists = this.goodDetailsLists;
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.goodsInfoId != null) {
this.form.id = this.form.goodsInfoId;
updateGoodsInfo(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
// this.nurseStationId=this.form.nurseStationId
addGoodsInfo(this.form).then((response) => {
console.log(this.form);
this.$modal.msgSuccess("新增成功");
this.StationName = "请选择所属护理站";
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
console.log("row :>> ", row);
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delGoodsInfo(row.goodsInfoId).then((res) => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.goodsPictureUrl);
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.$message.success("删除成功");
this.getList();
});
})
.catch(() => {});
},
imgUrl(imgUrl) {
console.log(imgUrl);
this.form.goodsPictureUrl = imgUrl;
},
attributePitureUrl(imgUrl) {
console.log(imgUrl);
// this.form.attributePitureUrl = imgUrl;
},
attributePitureitem(item) {
let items = JSON.parse(item);
if (items.ids && !items.id) {
this.goodDetailsLists.forEach((e) => {
if (e.ids == items.ids) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
} else if (!items.ids && items.attributeDetailsId) {
this.goodDetailsLists.forEach((e) => {
if (e.attributeDetailsId == items.attributeDetailsId) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
}
},
//
info() {
goodsCategory().then((res) => {
console.log(this.form);
this.goodsCategorylist = res.rows;
});
stationList(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.total2 = res.total;
console.log(res);
// if (res.rows[0].isAdmin == "1") {
// this.nurseStationlist = res.rows;
// this.total2 = res.total;
// } else {
// this.total2 = res.total;
// this.nurseStationlist = res.rows;
// this.queryParams.nurseStationId = res.rows[0].id;
// this.form.nurseStationId = res.rows[0].id;
// this.handleQuery();
// }
});
},
//
loadMore() {
var a = Math.ceil(this.total2 / 10);
if (this.nurseStationlist.length + 1 >= this.total2) {
} else {
if (this.getListByUserquery.pageNum >= a) {
} else {
this.getListByUserquery.pageNum++;
stationList(this.getListByUserquery).then((res) => {
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
},
};
import indexjs from './indexjs.js'
export default indexjs
</script>
<style lang="scss" scoped>
.stationbtn {
width: 208px;
text-align: left;
height: 32px;
overflow: hidden;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,471 @@
import {
getGoodsInfo,
delGoodsInfo,
addGoodsInfo,
updateGoodsInfo,
updatePicture,
goodsInfoList,
goodsCategory,
editGoodsWhetherShelf,
stationList,
} from "@/api/system/OperateGoodsInfo";
import editor from "@/components/Editor";
import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl.js";
export default {
components: { stationAcatar, editor },
name: "OperateGoodsInfo",
data() {
return {
imgone: "",
imageUrl: "", //商品图片
value: "",
datas: null,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
total2: 0,
// 商品基本信息表格数据
goodsInfoList: [],
// 护理站列表
nurseStationlist: [],
// 查询商品分类列表
goodsCategorylist: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// open2: false,
innerVisible: false,
StationName: "请选择所属护理站",
nursetotal: 0,
nurseStationId: null,
goods: [{
value: "BUSINESS",
label: "买卖",
},
{
value: "LEASE",
label: "租赁",
},
],
options: [{
value: 0,
label: "否",
},
{
value: 1,
label: "是",
},
],
// goodAttributeDetailsLists:[],
goodDetailsLists: [],
ids: 9999999,
// 查询参数
shangjia: {
id: null,
whetherShelf: null,
},
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
queryParams: {
id: null,
pageNum: 1,
pageSize: 10,
storeInfoId: null,
nurseStationId: null,
goodsCategoryId: null,
goodsName: null,
// goodsCode: null,
whetherShelf: null,
shelfTime: null,
goodsPictureUrl: null,
goodsRemark: null,
goodsUnit: null,
goodsPurpose: null,
sort: null,
},
//权限查询
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
// 表单参数
form: {
nurseStationId: null,
},
// 表单校验
rules: {
goodsName: [
{ required: true, message: "请输入商品名称", trigger: "blur" },
],
goodsCategoryId: [
{ required: true, message: "请选择商品分类名称", trigger: "blur" },
],
goodsPurpose: [
{ required: true, message: "请选择商品用途", trigger: "blur" },
],
goodsUnit: [
{ required: true, message: "请输入商品度量单位", trigger: "blur" },
],
goodsPictureUrl: [
{ required: true, message: "请输入选择图片", trigger: "blur" },
],
},
homestation: null,
};
},
created() {
this.getList();
this.goodsCategoryinfo();
},
methods: {
upwhetherShelf(row) {
console.log(row);
if (row.whetherShelf == false) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 0,
};
} else if (row.whetherShelf == true) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 1,
};
}
editGoodsWhetherShelf(obj).then((res) => {
console.log(obj);
if (obj.whetherShelf == 0) {
this.$modal.msgSuccess("已修改上架状态为未上架");
} else {
this.$modal.msgSuccess("已修改上架状态为上架");
}
this.getList();
});
},
/** 查询商品基本信息列表 */
getList() {
this.loading = true;
goodsInfoList(this.queryParams).then((response) => {
response.rows.forEach((e) => {
if (e.whetherShelf == 1) {
e.whetherShelf = true;
} else if (e.whetherShelf == 0) {
e.whetherShelf = false;
}
});
this.goodsInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 添加
addgoodAttributeDetail() {
console.log(this.goodDetailsLists);
if (this.goodDetailsLists.length == 5) {
this.$message.error("最多只能5条");
} else {
this.ids++;
var obj = {
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: this.ids,
};
this.goodDetailsLists.push(obj);
}
},
// 删除
delgoodAttributeDetail(item) {
console.log(item);
if (item.ids && !item.attributeDetailsId) {
if (this.goodDetailsLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.goodDetailsLists = this.goodDetailsLists.filter(
(e) => e.ids != item.ids
);
}
} else if (!item.ids && item.attributeDetailsId) {
if (this.goodDetailsLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.goodDetailsLists = this.goodDetailsLists.filter(
(e) => e.attributeDetailsId != item.attributeDetailsId
);
}
}
console.log(this.goodDetailsLists);
},
// 取消按钮
cancel() {
console.log(this.form);
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.form.goodsPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.open = false;
this.reset();
this.StationName = "请选择所属护理站";
this.goodDetailsLists = [{
attributeName: "",
goodAttributeDetailsLists: [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
}, ],
}, ];
},
//页面所属护理站
ParamsStation(item) {
this.info();
this.homestation = item
this.innerVisible = true
this.form.nurseStationId = this.queryParams.nurseStationId
},
//选择护理站
clickinnerVisible() {
this.info();
this.innerVisible = true;
},
nurseclick(row) {
if (this.homestation) {
this.queryParams.nurseStationName = row.nurseStationName;
this.queryParams.nurseStationId = row.id;
} else {
this.form.nurseStationId = row.id;
this.StationName = row.nurseStationName;
}
this.innerVisible = false;
},
handleQuery2() {
this.info();
},
resetQuery2() {
this.resetForm("queryForm");
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
}
this.handleQuery2();
},
addcancel() {
this.innerVisible = false;
this.resetQuery2();
},
// 表单重置
reset() {
this.form = {
id: null,
storeInfoId: null,
nurseStationId: null,
goodsCategoryId: null,
goodsName: null,
// goodsCode: null,
whetherShelf: null,
shelfTime: null,
goodsPictureUrl: null,
goodsRemark: null,
goodsUnit: null,
goodsPurpose: null,
sort: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.goodDetailsLists = [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999999,
}, ];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
goodsName: null,
goodsCategoryName: null,
goodsPurpose: null,
};
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.goodsInfoId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.homestation = null;
this.nurseStationId = "";
this.title = "商品基本信息";
// this.nurseName = "请选择护理员";
this.StationName = "请选择所属护理站";
this.goodDetailsLists = [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999999,
}, ];
this.open = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.homestation = null;
const id = row.goodsInfoId || this.ids;
this.StationName = row.nurseStationName;
if (this.StationName == null) {
this.StationName = "请选择所属护理站";
}
console.log(this.StationName);
getGoodsInfo(id).then((response) => {
this.form = response.data[0];
this.imgone = this.form.goodsPictureUrl;
if (response.data[0].goodAttributeDetailsLists) {
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
}
this.open = true;
this.title = "修改商品基本信息";
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form);
console.log(this.goodDetailsLists);
this.form.goodAttributeDetailsLists = [];
this.form.goodDetailsLists = this.goodDetailsLists;
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.goodsInfoId != null) {
this.form.id = this.form.goodsInfoId;
updateGoodsInfo(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
// this.nurseStationId=this.form.nurseStationId
addGoodsInfo(this.form).then((response) => {
console.log(this.form);
this.$modal.msgSuccess("新增成功");
this.StationName = "请选择所属护理站";
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
console.log("row :>> ", row);
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delGoodsInfo(row.goodsInfoId).then((res) => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.goodsPictureUrl);
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.$message.success("删除成功");
this.getList();
});
})
.catch(() => {});
},
imgUrl(imgUrl) {
console.log(imgUrl);
this.form.goodsPictureUrl = imgUrl;
},
attributePitureUrl(imgUrl) {
console.log(imgUrl);
// this.form.attributePitureUrl = imgUrl;
},
attributePitureitem(item) {
let items = JSON.parse(item);
if (items.ids && !items.id) {
this.goodDetailsLists.forEach((e) => {
if (e.ids == items.ids) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
} else if (!items.ids && items.attributeDetailsId) {
this.goodDetailsLists.forEach((e) => {
if (e.attributeDetailsId == items.attributeDetailsId) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
}
},
//商品分类
goodsCategoryinfo() {
goodsCategory().then((res) => {
console.log(this.form);
this.goodsCategorylist = res.rows;
});
},
//护理站
info() {
stationList(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.total2 = res.total;
});
},
},
};

View File

@ -8,41 +8,10 @@
v-show="showSearch"
label-width="68px"
>
<el-form-item
label="护理站"
prop="nurseStationId"
v-if="nurseStationlist.find((e) => e.isAdmin == '1')"
>
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="护理站" prop="nurseStationId" v-else>
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
<el-form-item label="护理站" prop="nurseStationId">
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
queryParams.nurseStationName
}}</el-button>
</el-form-item>
<el-form-item label="科室编码" prop="departmentCode">
<el-input
@ -172,6 +141,7 @@
:visible.sync="addopen"
width="800px"
append-to-body
:before-close="cancel"
>
<el-form
ref="form"
@ -203,7 +173,6 @@
"
>{{ item.nurseStationName }}</el-button
>
<!-- @click="clickinnerVisible(item, index)" -->
<el-button
@click="clickinnerVisible(item, index)"
type=""
@ -217,22 +186,6 @@
"
>{{ item.nurseStationName }}</el-button
>
<!-- <el-select
v-model="item.nurseStationId"
clearable
placeholder="请选择护理站"
v-loadmore="loadMore"
style="width: 250px"
@click="nurseinfo"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select> -->
</el-form-item>
<el-form-item
label="科室名称"
@ -303,7 +256,6 @@
style="width: 250px"
disabled
/>
</el-form-item>
<el-form-item label="科室名称" prop="departmentName">
<el-input
@ -334,7 +286,7 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 新增护理站名称弹框 -->
<!-- 选择护理站 -->
<el-dialog
title="选择护理站"
:visible.sync="innerVisible"
@ -358,7 +310,7 @@
v-model="nurseStationqueryParams.nurseStationCode"
placeholder="请输入护理站编码"
clearable
@keyup.enter.native="addhd"
@keyup.enter.native="info"
/>
</el-form-item>
<el-form-item
@ -370,7 +322,7 @@
v-model="nurseStationqueryParams.nurseStationName"
placeholder="请输入护理站名称"
clearable
@keyup.enter.native="addhd"
@keyup.enter.native="info"
/>
</el-form-item>
<el-form-item>
@ -378,7 +330,7 @@
type="primary"
icon="el-icon-search"
size="mini"
@click="addhd"
@click="info"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="addresetQuery"
@ -386,7 +338,12 @@
>
</el-form-item>
</el-form>
<el-table :data="nurseStationlist" @cell-dblclick="nurseclick">
<el-table
:data="nurseStationlist"
@cell-dblclick="nurseclick"
v-loading="loading"
>
<el-table-column label="请选择" width="100" align="center">
<template slot-scope="scope">
<el-button
@ -438,383 +395,15 @@
</div>
</template>
<script>
import {
listStationDepartment,
getStationDepartment,
delStationDepartment,
addStationDepartment,
updateStationDepartment,
} from "@/api/system/StationDepartment";
import { getListByUser } from "@/api/system/userlist.js";
export default {
name: "StationDepartment",
data() {
//
var checkMobile = (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 (regMobile.test(value)) {
return cb();
}
cb(new Error("请输入正确的联系电话"));
};
return {
nurseStationlist: [],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
total2: 0,
//
StationDepartmentList: [],
//
title: "",
//
open: false,
addopen: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
departmentName: null,
departmentPerson: null,
phone: null,
nurseStationName: null,
nurseStationDepartmentList: [
{
nurseStationId: "",
departmentCode: "",
departmentName: "",
departmentPerson: "",
phone: "",
},
],
},
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {},
//
rules: {
nurseStationDepartmentList: {
nurseStationId: [
{
required: true,
message: "请选择所属护理站",
trigger: "blur",
},
],
departmentName: [
{
required: true,
message: "请选择科室名称",
trigger: "blur",
},
],
departmentPerson: [
{
required: true,
message: "请选择科室负责人",
trigger: "blur",
},
],
phone: [
{
required: true,
validator: checkMobile,
trigger: "blur",
message: "",
},
],
},
nurseStationId: [
{
required: true,
message: "请选择所属护理站",
trigger: "blur",
},
],
departmentName: [
{
required: true,
message: "请选择科室名称",
trigger: "blur",
},
],
departmentPerson: [
{
required: true,
message: "请选择科室负责人",
trigger: "blur",
},
],
phone: [
{
required: true,
validator: checkMobile,
trigger: "blur",
message: "",
},
],
},
index: "",
stationid: "",
innerVisible: false,
};
},
created() {
this.getList();
// this.listinfo();
this.info();
},
methods: {
// add
nurseclick(row) {
console.log(row);
this.stationid = row.id;
this.innerVisible = false;
this.form.nurseStationDepartmentList[this.index].nurseStationName =
row.nurseStationName;
this.form.nurseStationDepartmentList[this.index].nurseStationId = row.id;
},
//
clickinnerVisible(item, index) {
this.stationid = item.nurseStationId;
this.innerVisible = true;
this.index = index;
},
//deldisease
deldisease(index) {
this.form.nurseStationDepartmentList.splice(index, 1);
console.log(this.form.nurseStationDepartmentList);
},
adddisease() {
var obj = {
nurseStationId: "",
departmentCode: "",
departmentName: "",
departmentPerson: "",
phone: "",
nurseStationName: "请选择所属护理站",
};
if (this.form.nurseStationDepartmentList.length == 5) {
this.$message.error("最多只能5条");
} else {
this.form.nurseStationDepartmentList.push(obj);
}
},
//
getList() {
this.loading = true;
listStationDepartment(this.queryParams).then((response) => {
this.nurseStationDepartmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
loadMore() {
var a = Math.ceil(this.total2 / 10);
if (this.nurseStationlist.length + 1 >= this.total2) {
} else {
if (this.nurseStationqueryParams.pageNum >= a) {
} else {
this.nurseStationqueryParams.pageNum++;
console.log(this.nurseStationqueryParams.pageNum);
getListByUser(this.nurseStationqueryParams).then((res) => {
console.log(res);
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
/** 查询护理站部门信息列表 */
getList() {
this.loading = true;
listStationDepartment(this.queryParams).then((response) => {
this.StationDepartmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.addopen = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
nurseStationId: null,
departmentCode: null,
departmentName: null,
departmentPerson: null,
phone: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
nurseStationName: null,
nurseStationId: null,
nurseStationDepartmentList: [
{
nurseStationId: "",
departmentCode: "",
departmentName: "",
departmentPerson: "",
phone: "",
nurseStationName: "请选择所属护理站",
},
],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
innerVisiblecancel() {
this.innerVisible = false;
this.addresetQuery();
},
/** 重置按钮操作 */
resetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
departmentName: null,
departmentPerson: null,
phone: null,
nurseStationName: null,
};
this.handleQuery();
} else {
console.log(1);
this.queryParams.departmentCode = null;
this.queryParams.pageSize = 10;
this.queryParams.pageNum = 1;
this.queryParams.departmentName = null;
this.handleQuery();
}
},
addhd() {
getListByUser(this.nurseStationqueryParams).then((res) => {
this.total2 = res.total;
this.nurseStationlist = res.rows;
});
},
addresetQuery() {
this.nurseStationqueryParams = {
pageNum: 1,
pageSize: 10,
};
this.addhd();
},
//
info() {
getListByUser(this.nurseStationqueryParams).then((res) => {
if (res.rows[0].isAdmin == "1") {
this.nurseStationlist = res.rows;
this.total2 = res.total;
} else {
this.total2 = res.total;
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.handleQuery();
}
});
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.addopen = true;
// this.nurseStationName="",
this.title = "添加护理站部门信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getStationDepartment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改护理站部门信息";
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateStationDepartment(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStationDepartment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.addopen = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除护理站部门信息的数据项?")
.then(function () {
return delStationDepartment(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/StationDepartment/export",
{
...this.queryParams,
},
`StationDepartment_${new Date().getTime()}.xlsx`
);
},
},
};
import indexjs from "./indexjs.js";
export default indexjs;
</script>
<style scoped lang="scss">
.stationbtn {
width: 208px;
text-align: left;
height: 32px;
overflow: hidden;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,312 @@
import {
listStationDepartment,
getStationDepartment,
delStationDepartment,
addStationDepartment,
updateStationDepartment,
} from "@/api/system/StationDepartment";
import { getListByUser } from "@/api/system/userlist.js";
export default {
name: "StationDepartment",
data() {
// 验证手机号的规则
var checkMobile = (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 (regMobile.test(value)) {
return cb();
}
cb(new Error("请输入正确的联系电话"));
};
return {
nurseStationlist: [],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
total2: 0,
// 护理站部门信息表格数据
StationDepartmentList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
addopen: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
departmentName: null,
departmentPerson: null,
phone: null,
nurseStationName: null,
},
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
},
// 表单参数
form: {},
// 表单校验
rules: {
nurseStationDepartmentList: {
nurseStationId: [{
required: true,
message: "请选择所属护理站",
trigger: "blur",
}, ],
departmentName: [{
required: true,
message: "请选择科室名称",
trigger: "blur",
}, ],
departmentPerson: [{
required: true,
message: "请选择科室负责人",
trigger: "blur",
}, ],
phone: [{
required: true,
validator: checkMobile,
trigger: "blur",
message: "",
}, ],
},
nurseStationId: [{
required: true,
message: "请选择所属护理站",
trigger: "blur",
}, ],
departmentName: [{
required: true,
message: "请选择科室名称",
trigger: "blur",
}, ],
departmentPerson: [{
required: true,
message: "请选择科室负责人",
trigger: "blur",
}, ],
phone: [{
required: true,
validator: checkMobile,
trigger: "blur",
message: "",
}, ],
},
index: "",
stationid: null,
innerVisible: false,
homenumber: null,
};
},
created() {
this.getList();
},
methods: {
ParamsStation(item) {
this.info();
this.innerVisible = true
this.homenumber = item
this.stationid = this.queryParams.nurseStationId;
},
// add点击护理站名称
nurseclick(row) {
if (this.homenumber) {
this.stationid = this.queryParams.nurseStationId
this.queryParams.nurseStationName = row.nurseStationName;
this.queryParams.nurseStationId = row.id;
} else {
this.stationid = row.id;
this.form.nurseStationDepartmentList[this.index].nurseStationName =
row.nurseStationName;
this.form.nurseStationDepartmentList[this.index].nurseStationId = row.id;
}
this.innerVisible = false;
},
// 新增护理站按钮
clickinnerVisible(item, index) {
this.addresetQuery();
this.stationid = item.nurseStationId;
this.index = index;
this.innerVisible = true;
},
//删除deldisease
deldisease(index) {
this.form.nurseStationDepartmentList.splice(index, 1);
},
adddisease() {
var obj = {
nurseStationId: "",
departmentCode: "",
departmentName: "",
departmentPerson: "",
phone: "",
nurseStationName: "请选择所属护理站",
};
if (this.form.nurseStationDepartmentList.length == 5) {
this.$message.error("最多只能5条");
} else {
this.form.nurseStationDepartmentList.push(obj);
}
},
/** 查询护理站部门信息列表 */
getList() {
this.loading = true;
listStationDepartment(this.queryParams).then((response) => {
this.StationDepartmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.addopen = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
nurseStationId: null,
departmentCode: null,
departmentName: null,
departmentPerson: null,
phone: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
nurseStationName: null,
nurseStationId: null,
nurseStationDepartmentList: [{
nurseStationId: "",
departmentCode: "",
departmentName: "",
departmentPerson: "",
phone: "",
nurseStationName: "请选择所属护理站",
}, ],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
innerVisiblecancel() {
this.innerVisible = false;
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
departmentName: null,
departmentPerson: null,
phone: null,
nurseStationName: null,
};
this.handleQuery();
},
addresetQuery() {
this.nurseStationqueryParams = {
pageNum: 1,
pageSize: 10,
};
this.info();
},
//护理站list
info() {
this.loading = true
getListByUser(this.nurseStationqueryParams).then((res) => {
this.nurseStationlist = res.rows;
this.total2 = res.total;
this.loading = false
});
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.homenumber = null
this.reset();
this.addopen = true;
// this.nurseStationName="",
this.title = "添加护理站部门信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
const id = row.id || this.ids;
getStationDepartment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改护理站部门信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateStationDepartment(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStationDepartment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.addopen = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除护理站部门信息的数据项?")
.then(function() {
return delStationDepartment(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/StationDepartment/export", {
...this.queryParams,
},
`StationDepartment_${new Date().getTime()}.xlsx`
);
},
},
};

View File

@ -9,19 +9,9 @@
label-width="100px"
>
<el-form-item label="所属护理站" prop="nurseStationName">
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
queryParams.nurseStationName
}}</el-button>
</el-form-item>
<el-form-item label="商品名称" prop="goodsName">
<el-input
@ -31,7 +21,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商品分类名称" prop="goodsCategoryName">
<el-input
v-model="queryParams.goodsCategoryName"
@ -40,7 +29,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商品用途" prop="goodsPurpose">
<el-select
v-model="queryParams.goodsPurpose"
@ -55,7 +43,6 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否上架" prop="whetherShelf">
<el-select v-model="queryParams.whetherShelf" placeholder="请选择">
<el-option
@ -67,7 +54,6 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@ -81,7 +67,7 @@
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
@ -110,7 +96,7 @@
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
</el-row> -->
<el-table
v-loading="loading"
:data="goodsInfoList"
@ -143,13 +129,19 @@
</el-table-column>
<el-table-column label="上架状态" align="center" prop="whetherShelf">
<template slot-scope="scope">
<el-switch
<el-button type="primary" v-if="scope.row.whetherShelf == '1'"
>已上架</el-button
>
<el-button type="danger" v-if="scope.row.whetherShelf == '0'"
>未上架</el-button
>
<!-- <el-switch
v-model="scope.row.whetherShelf"
active-color="#13ce66"
inactive-color="#ff4949"
@change="upwhetherShelf(scope.row)"
>
</el-switch>
</el-switch> -->
</template>
</el-table-column>
<el-table-column
@ -166,7 +158,7 @@
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column
<!-- <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
@ -189,7 +181,7 @@
>删除</el-button
>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<pagination
v-show="total > 0"
@ -212,14 +204,6 @@
label-width="120px"
:inline="true"
>
<el-form-item label="商品名称" prop="goodsName">
<el-input
v-model="form.goodsName"
placeholder="请输入商品名称"
maxlength="40"
style="width: 210px"
/>
</el-form-item>
<el-form-item label="护理站名称" prop="nurseStationName">
<el-input
v-model="form.nurseStationName"
@ -229,7 +213,14 @@
disabled
/>
</el-form-item>
<el-form-item label="商品名称" prop="goodsName">
<el-input
v-model="form.goodsName"
placeholder="请输入商品名称"
maxlength="40"
style="width: 210px"
/>
</el-form-item>
<el-form-item label="商品分类名称" prop="goodsCategoryId">
<el-select
style="width: 210px"
@ -295,6 +286,7 @@
<el-input
v-model="scope.row.goodsPrice"
type="number"
min="0"
oninput=" if(value.length>7){value=value.slice(0,7)}"
></el-input>
</template>
@ -304,6 +296,7 @@
<el-input
v-model="scope.row.goodsStock"
type="number"
min="0"
oninput="if(value.length>9){value=value.slice(0,9)}"
></el-input>
</template>
@ -360,13 +353,13 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 新增护理站名称弹框 -->
<!-- <el-dialog
<!-- 护理站名称弹框 -->
<el-dialog
:title="title"
:visible.sync="innerVisible"
width="1000px"
append-to-body
:before-close="addcancel"
:before-close="addcancel"
>
<el-form
ref="queryForm"
@ -416,7 +409,7 @@
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="nurseStationId == scope.row.id"
v-if="stationid == scope.row.id"
circle
@click="nurseclick(scope.row)"
></el-button>
@ -457,546 +450,23 @@
:total="total2"
:page.sync="getListByUserquery.pageNum"
:limit.sync="getListByUserquery.pageSize"
@pagination="handleQuery2"
@pagination="info"
/>
</el-dialog> -->
</el-dialog>
</div>
</template>
<script>
import {
getGoodsInfo,
delGoodsInfo,
addGoodsInfo,
updateGoodsInfo,
updatePicture,
goodsInfoList,
goodsCategory,
editGoodsWhetherShelf,
} from "@/api/system/goodsInfo";
import editor from "@/components/Editor";
import { getListByUser } from "@/api/system/userlist.js";
import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl.js";
export default {
components: { stationAcatar, editor },
name: "OperateGoodsInfo",
data() {
return {
imgone: "",
imageUrl: "", //
value: "",
datas: null,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
total2: 0,
//
goodsInfoList: [],
//
nurseStationlist: [],
//
goodsCategorylist: [],
//
title: "",
//
open: false,
// open2: false,
innerVisible: false,
// StationName: "",
nursetotal: 0,
nurseStationId: null,
goods: [
{
value: "BUSINESS",
label: "买卖",
},
{
value: "LEASE",
label: "租赁",
},
],
options: [
{
value: 0,
label: "否",
},
{
value: 1,
label: "是",
},
],
// goodAttributeDetailsLists:[],
goodDetailsLists: [],
ids: 9999999,
//
shangjia: {
id: null,
whetherShelf: null,
},
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
queryParams: {
id: null,
pageNum: 1,
pageSize: 10,
storeInfoId: null,
nurseStationId: null,
goodsCategoryId: null,
goodsName: null,
// goodsCode: null,
whetherShelf: null,
shelfTime: null,
goodsPictureUrl: null,
goodsRemark: null,
goodsUnit: null,
goodsPurpose: null,
sort: null,
// mame:null,
},
//
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
//
form: {
nurseStationName: "",
nurseStationId: "",
},
//
rules: {
goodsName: [
{ required: true, message: "请输入商品名称", trigger: "blur" },
],
goodsCategoryId: [
{ required: true, message: "请选择商品分类名称", trigger: "blur" },
],
nurseStationId: [
{ required: true, message: "请选择所属护理站", trigger: "blur" },
],
goodsPurpose: [
{ required: true, message: "请选择商品用途", trigger: "blur" },
],
goodsUnit: [
{ required: true, message: "请输入商品度量单位", trigger: "blur" },
],
goodsPictureUrl: [
{ required: true, message: "请输入选择图片", trigger: "blur" },
],
},
};
},
created() {
this.getList();
this.info();
// this.getList2();
},
methods: {
upwhetherShelf(row) {
console.log(row);
if (row.whetherShelf == false) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 0,
};
} else if (row.whetherShelf == true) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 1,
};
}
editGoodsWhetherShelf(obj).then((res) => {
console.log(obj);
if (obj.whetherShelf == 0) {
this.$modal.msgSuccess("已修改上架状态为未上架");
} else {
this.$modal.msgSuccess("已修改上架状态为上架");
}
this.getList();
});
},
/** 查询商品基本信息列表 */
getList() {
this.loading = true;
goodsInfoList(this.queryParams).then((response) => {
response.rows.forEach((e) => {
if (e.whetherShelf == 1) {
e.whetherShelf = true;
} else if (e.whetherShelf == 0) {
e.whetherShelf = false;
}
});
this.goodsInfoList = response.rows;
console.log(this.goodsInfoList);
this.total = response.total;
this.loading = false;
});
},
//
addgoodAttributeDetail() {
console.log(this.goodDetailsLists);
if (this.goodDetailsLists.length == 5) {
this.$message.error("最多只能5条");
} else {
this.ids++;
var obj = {
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: this.ids,
};
this.goodDetailsLists.push(obj);
}
},
//
delgoodAttributeDetail(item) {
console.log(item);
if (item.ids && !item.attributeDetailsId) {
if (this.goodDetailsLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.goodDetailsLists = this.goodDetailsLists.filter(
(e) => e.ids != item.ids
);
}
} else if (!item.ids && item.attributeDetailsId) {
if (this.goodDetailsLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.goodDetailsLists = this.goodDetailsLists.filter(
(e) => e.attributeDetailsId != item.attributeDetailsId
);
}
}
console.log(this.goodDetailsLists);
},
//
cancel() {
console.log(this.form);
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.form.goodsPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.open = false;
this.reset();
this.StationName = "请选择所属护理站";
this.goodDetailsLists = [
{
attributeName: "",
goodAttributeDetailsLists: [
{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
},
],
},
];
},
// clickinnerVisible() {
// this.innerVisible = true;
// },
// nurseclick(row) {
// console.log(this.form);
// console.log(row);
// this.form.nurseStationId = row.id;
// this.StationName = row.nurseStationName;
// this.innerVisible = false;
// },
handleQuery2() {
// this.getListByUserquery.pageNum = 1;
this.getList2();
},
getList2() {
getListByUser(this.getListByUserquery).then((res) => {
this.total2 = res.total;
this.nurseStationlist = res.rows;
});
},
resetQuery2() {
this.resetForm("queryForm");
(this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
}),
this.handleQuery2();
},
addcancel() {
// this.innerVisible = false;
// this.innerVisiblexg = false;
this.resetQuery2();
},
//
reset() {
this.form = {
id: null,
storeInfoId: null,
nurseStationId: null,
goodsCategoryId: null,
goodsName: null,
// goodsCode: null,
whetherShelf: null,
shelfTime: null,
goodsPictureUrl: null,
goodsRemark: null,
goodsUnit: null,
goodsPurpose: null,
sort: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.goodDetailsLists = [
{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999999,
},
];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
};
} else {
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 10;
this.queryParams.goodsName = null;
this.queryParams.goodsCategoryName = null;
this.queryParams.goodsPurpose = null;
this.queryParams.whetherShelf = null;
}
this.handleQuery();
},
//
handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.goodsInfoId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.form.nurseStationName = this.nurseStationlist[0].nurseStationName;
this.form.nurseStationId = this.nurseStationlist[0].id;
this.title = "商品基本信息";
this.StationName = "请选择所属护理站";
this.goodDetailsLists = [
{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999999,
},
];
this.open = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log(row);
// this.reset();
const id = row.goodsInfoId || this.ids;
getGoodsInfo(id).then((response) => {
console.log(response);
this.form = response.data[0];
this.form.nurseStationName = row.nurseStationName;
this.imgone = this.form.goodsPictureUrl;
if (response.data[0].goodAttributeDetailsLists) {
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
}
this.open = true;
this.title = "修改商品基本信息";
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form);
console.log(this.goodDetailsLists);
this.form.goodAttributeDetailsLists = [];
this.form.goodDetailsLists = this.goodDetailsLists;
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.goodsInfoId != null) {
this.form.id = this.form.goodsInfoId;
updateGoodsInfo(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
// this.nurseStationId=this.form.nurseStationId
addGoodsInfo(this.form).then((response) => {
console.log(this.form);
this.$modal.msgSuccess("新增成功");
// this.StationName = "";
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
console.log("row :>> ", row);
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.goodsPictureUrl);
updatePicture(obj).then((res) => {
console.log(res);
});
delGoodsInfo(row.goodsInfoId).then((res) => {
this.$message.success("删除成功");
this.getList();
// console.log('this.OrderDetailsList :>> ', this.OrderDetailsList);
});
})
.catch(() => {});
},
// handleDelete(row) {
// const ids = row.id || this.ids;
// this.$modal
// .confirm("")
// .then(function () {
// return delGoodsInfo(ids);
// })
// .then(() => {
// this.getList();
// this.$modal.msgSuccess("");
// })
// .catch(() => {});
// },
// /** */
// handleExport() {
// this.download(
// "system/goodsInfo/export",
// {
// ...this.queryParams,
// },
// `goodsInfo_${new Date().getTime()}.xlsx`
// );
// },
imgUrl(imgUrl) {
console.log(imgUrl);
this.form.goodsPictureUrl = imgUrl;
},
attributePitureUrl(imgUrl) {
console.log(imgUrl);
// this.form.attributePitureUrl = imgUrl;
},
attributePitureitem(item) {
let items = JSON.parse(item);
if (items.ids && !items.id) {
this.goodDetailsLists.forEach((e) => {
if (e.ids == items.ids) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
} else if (!items.ids && items.attributeDetailsId) {
this.goodDetailsLists.forEach((e) => {
if (e.attributeDetailsId == items.attributeDetailsId) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
}
},
//
info() {
goodsCategory().then((res) => {
console.log(res);
console.log(this.form);
this.goodsCategorylist = res.rows;
});
getListByUser(this.getListByUserquery).then((res) => {
console.log(res);
if (res.rows[0].isAdmin == "1") {
this.nurseStationlist = res.rows;
// console.log(this.queryParams)
this.total2 = res.total;
} else {
this.total2 = res.total;
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.handleQuery();
}
});
},
//
loadMore() {
var a = Math.ceil(this.total2 / 10);
if (this.nurseStationlist.length + 1 >= this.total2) {
} else {
if (this.getListByUserquery.pageNum >= a) {
} else {
this.getListByUserquery.pageNum++;
getListByUser(this.getListByUserquery).then((res) => {
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
},
};
import indexjs from "./indexjs.js";
export default indexjs;
</script>
<style lang="scss" scoped>
.stationbtn {
width: 208px;
text-align: left;
height: 32px;
overflow: hidden;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,422 @@
import {
getGoodsInfo,
delGoodsInfo,
addGoodsInfo,
updateGoodsInfo,
updatePicture,
goodsInfoList,
goodsCategory,
editGoodsWhetherShelf,
} from "@/api/system/goodsInfo";
import editor from "@/components/Editor";
import { getListByUser } from "@/api/system/userlist.js";
import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl.js";
export default {
components: { stationAcatar, editor },
name: "OperateGoodsInfo",
data() {
return {
imgone: "",
imageUrl: "", //商品图片
value: "",
datas: null,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
total2: 0,
// 商品基本信息表格数据
goodsInfoList: [],
// 护理站列表
nurseStationlist: [],
// 查询商品分类列表
goodsCategorylist: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// open2: false,
innerVisible: false,
// StationName: "请选择所属护理站",
nursetotal: 0,
nurseStationId: null,
goods: [{
value: "BUSINESS",
label: "买卖",
},
{
value: "LEASE",
label: "租赁",
},
],
options: [{
value: 0,
label: "否",
},
{
value: 1,
label: "是",
},
],
goodDetailsLists: [],
ids: 9999999,
// 查询参数
shangjia: {
id: null,
whetherShelf: null,
},
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
queryParams: {
id: null,
pageNum: 1,
pageSize: 10,
storeInfoId: null,
nurseStationId: null,
goodsCategoryId: null,
goodsName: null,
whetherShelf: null,
shelfTime: null,
goodsPictureUrl: null,
goodsRemark: null,
goodsUnit: null,
goodsPurpose: null,
sort: null,
// mame:null,
},
//权限查询
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
// 表单参数
form: {
nurseStationName: "",
nurseStationId: "",
},
// 表单校验
rules: {
goodsName: [
{ required: true, message: "请输入商品名称", trigger: "blur" },
],
goodsCategoryId: [
{ required: true, message: "请选择商品分类名称", trigger: "blur" },
],
nurseStationId: [
{ required: true, message: "请选择所属护理站", trigger: "blur" },
],
goodsPurpose: [
{ required: true, message: "请选择商品用途", trigger: "blur" },
],
goodsUnit: [
{ required: true, message: "请输入商品度量单位", trigger: "blur" },
],
goodsPictureUrl: [
{ required: true, message: "请输入选择图片", trigger: "blur" },
],
},
stationid: null,
};
},
created() {
this.getList();
this.info();
},
methods: {
addcancel() {
this.innerVisible = false
},
upwhetherShelf(row) {
if (row.whetherShelf == false) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 0,
};
} else if (row.whetherShelf == true) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 1,
};
}
editGoodsWhetherShelf(obj).then((res) => {
if (obj.whetherShelf == 0) {
this.$modal.msgSuccess("已修改上架状态为未上架");
} else {
this.$modal.msgSuccess("已修改上架状态为上架");
}
this.getList();
});
},
/** 查询商品基本信息列表 */
getList() {
this.loading = true;
goodsInfoList(this.queryParams).then((response) => {
response.rows.forEach((e) => {
if (e.whetherShelf == 1) {
e.whetherShelf = true;
} else if (e.whetherShelf == 0) {
e.whetherShelf = false;
}
});
this.goodsInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 添加
addgoodAttributeDetail() {
if (this.goodDetailsLists.length == 5) {
this.$message.error("最多只能5条");
} else {
this.ids++;
var obj = {
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: this.ids,
};
this.goodDetailsLists.push(obj);
}
},
// 删除
delgoodAttributeDetail(item) {
if (item.ids && !item.attributeDetailsId) {
if (this.goodDetailsLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.goodDetailsLists = this.goodDetailsLists.filter(
(e) => e.ids != item.ids
);
}
} else if (!item.ids && item.attributeDetailsId) {
if (this.goodDetailsLists.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.goodDetailsLists = this.goodDetailsLists.filter(
(e) => e.attributeDetailsId != item.attributeDetailsId
);
}
}
},
// 取消按钮
cancel() {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.form.goodsPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.open = false;
this.reset();
this.StationName = "请选择所属护理站";
this.goodDetailsLists = [{
attributeName: "",
goodAttributeDetailsLists: [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
}, ],
}, ];
},
//护理站页面选择护理站
nurseclick(item) {
this.queryParams.nurseStationName = item.nurseStationName;
this.queryParams.nurseStationId = item.id;
this.stationid = item.id
this.innerVisible = false;
},
//页面所属护理站
ParamsStation(item) {
this.title = '选择护理站'
this.innerVisible = true
this.stationid = this.queryParams.nurseStationId;
},
//护理站列表
info() {
goodsCategory().then((res) => {
this.goodsCategorylist = res.rows;
});
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.total2 = res.total;
});
},
handleQuery2() {
this.info();
},
resetQuery2() {
this.resetForm("queryForm");
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
}
this.handleQuery2();
},
// 表单重置
reset() {
this.form = {
id: null,
storeInfoId: null,
nurseStationId: null,
goodsCategoryId: null,
goodsName: null,
// goodsCode: null,
whetherShelf: null,
shelfTime: null,
goodsPictureUrl: null,
goodsRemark: null,
goodsUnit: null,
goodsPurpose: null,
sort: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.goodDetailsLists = [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999999,
}, ];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
};
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.goodsInfoId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.form.nurseStationName = this.nurseStationlist[0].nurseStationName;
this.form.nurseStationId = this.nurseStationlist[0].id;
this.title = "商品基本信息";
this.StationName = "请选择所属护理站";
this.goodDetailsLists = [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999999,
}, ];
this.open = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
const id = row.goodsInfoId || this.ids;
getGoodsInfo(id).then((response) => {
this.form = response.data[0];
this.form.nurseStationName = row.nurseStationName;
this.imgone = this.form.goodsPictureUrl;
if (response.data[0].goodAttributeDetailsLists) {
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
}
this.open = true;
this.title = "修改商品基本信息";
});
},
/** 提交按钮 */
submitForm() {
this.form.goodAttributeDetailsLists = [];
this.form.goodDetailsLists = this.goodDetailsLists;
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.goodsInfoId != null) {
this.form.id = this.form.goodsInfoId;
updateGoodsInfo(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
// this.nurseStationId=this.form.nurseStationId
addGoodsInfo(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.goodsPictureUrl);
updatePicture(obj).then((res) => {});
delGoodsInfo(row.goodsInfoId).then((res) => {
this.$message.success("删除成功");
this.getList();
});
})
.catch(() => {});
},
imgUrl(imgUrl) {
this.form.goodsPictureUrl = imgUrl;
},
attributePitureUrl(imgUrl) {},
attributePitureitem(item) {
let items = JSON.parse(item);
if (items.ids && !items.id) {
this.goodDetailsLists.forEach((e) => {
if (e.ids == items.ids) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
} else if (!items.ids && items.attributeDetailsId) {
this.goodDetailsLists.forEach((e) => {
if (e.attributeDetailsId == items.attributeDetailsId) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
}
},
},
};

View File

@ -8,21 +8,11 @@
v-show="showSearch"
label-width="90px"
>
<el-form-item label="所属护理站" prop="nurseStationName">
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属护理站" prop="nurseStationName">
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
queryParams.nurseStationName
}}</el-button>
</el-form-item>
<el-form-item label="订单编号" prop="orderNo">
<el-input
v-model="queryParams.orderNo"
@ -57,9 +47,6 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
<el-button type="success" icon="el-icon-refresh-right" size="mini" @click="resetQuery"
>刷新商品订单</el-button
>
</el-form-item>
</el-form>
@ -80,15 +67,10 @@
prop="orderNo"
width="190"
/>
<el-table-column
label="商品名称"
align="center"
prop="goodsName"
/>
<el-table-column label="商品名称" align="center" prop="goodsName" />
<el-table-column label="订单总金额" align="center" prop="totalPrice" />
<el-table-column label="订单状态" align="center" prop="orderStatus">
<el-table-column label="订单状态" align="center" prop="orderStatus">
<template slot-scope="scope">
<!-- {{ orderStatus(scope.row.orderStatus) }} -->
<el-button v-if="scope.row.orderStatus == 'WAIT_PAY'"
@ -147,7 +129,10 @@
<el-table-column label="录入物流单号" align="center" prop="remark">
<template slot-scope="scope">
<el-button
v-if="scope.row.orderStatus == 'WAIT_RECEIVED_GOODS'&&scope.row.expressNo"
v-if="
scope.row.orderStatus == 'WAIT_RECEIVED_GOODS' &&
scope.row.expressNo
"
size="mini"
type="text"
icon="el-icon-edit"
@ -156,7 +141,10 @@
>修改物流单号</el-button
>
<el-button
v-if="scope.row.orderStatus == 'WAIT_RECEIVED_GOODS'&&scope.row.expressNo==''"
v-if="
scope.row.orderStatus == 'WAIT_RECEIVED_GOODS' &&
scope.row.expressNo == ''
"
size="mini"
type="text"
icon="el-icon-edit"
@ -165,7 +153,10 @@
>录入物流单号</el-button
>
<el-button
v-if="scope.row.orderStatus == 'WAIT_RECEIVED_GOODS'&&scope.row.expressNo==null"
v-if="
scope.row.orderStatus == 'WAIT_RECEIVED_GOODS' &&
scope.row.expressNo == null
"
size="mini"
type="text"
icon="el-icon-edit"
@ -173,15 +164,6 @@
v-hasPermi="['system:goodsOrder:editExpressNo']"
>录入物流单号</el-button
>
<el-button
v-if="scope.row.orderStatus != 'WAIT_RECEIVED_GOODS'"
size="mini"
type="text"
icon="el-icon-edit"
disabled
v-hasPermi="['system:goodsOrder:editExpressNo']"
>不可录入物流单号</el-button
>
</template>
</el-table-column>
<el-table-column
@ -248,7 +230,7 @@
style="width: 240px"
/>
</el-form-item>
<el-form-item label="商品名称" prop="goodsName">
<el-form-item label="商品名称" prop="goodsName">
<el-input
v-model="orderList.goodsName"
clearable
@ -257,7 +239,7 @@
style="width: 240px"
/>
</el-form-item>
<el-form-item label="订单金额" prop="totalPrice">
<el-form-item label="订单金额" prop="totalPrice">
<el-input
v-model="orderList.totalPrice"
clearable
@ -266,7 +248,7 @@
style="width: 240px"
/>
</el-form-item>
<el-form-item label="收货人" prop="receiveAddress">
<el-form-item label="收货人" prop="receiveAddress">
<el-input
v-model="orderList.receiver"
clearable
@ -284,7 +266,7 @@
style="width: 240px"
/>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-form-item label="手机号" prop="phone">
<el-input
v-model="orderList.phone"
clearable
@ -294,7 +276,6 @@
/>
</el-form-item>
<!-- <el-form-item label="商品属性" prop="goodsAttributeName">
<el-input
v-model="orderList.goodsAttributeName"
@ -532,6 +513,100 @@
<el-button type="primary" @click="submitRefundOrder"> </el-button>
</div>
</el-dialog>
<!-- 护理站 -->
<el-dialog
title="选择护理站"
:visible.sync="nurseStationshow"
width="1100px"
append-to-body
:before-close="clicknurseStationshow"
>
<el-form
ref="form"
:model="getListByUserquery"
label-width="110px"
:inline="true"
>
<el-form-item label="护理站编码" prop="nurseStationCode">
<el-input
v-model="getListByUserquery.nurseStationCode"
placeholder="请输入护理站编码"
/>
</el-form-item>
<el-form-item label="护理站名称" prop="nurseStationName">
<el-input
v-model="getListByUserquery.nurseStationName"
placeholder="请输入护理站名称"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="info"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="stationcancel"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="nurseStationlist"
@cell-dblclick="choicestationid"
>
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
circle
@click="choicestationid(scope.row)"
v-if="queryParams.nurseStationId == scope.row.id"
></el-button>
<el-button
style="width: 15px; height: 15px"
circle
v-else
@click="choicestationid(scope.row)"
>
</el-button>
</template>
</el-table-column>
<el-table-column
property="nurseStationCode"
label="护理站编码"
align="center"
>
</el-table-column>
<el-table-column
property="nurseStationName"
label="护理站名称"
align="center"
>
</el-table-column>
<el-table-column property="phone" label="联系电话" align="center">
</el-table-column>
<el-table-column
property="address"
label="护理站地址"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
<pagination
v-show="stationtotal > 0"
:total="stationtotal"
:page.sync="getListByUserquery.pageNum"
:limit.sync="getListByUserquery.pageSize"
@pagination="info"
/>
</el-dialog>
<!-- 查看物流详细信息弹框 -->
<!-- <el-dialog
title="查看订单信息"
@ -588,448 +663,18 @@
</template>
<script>
import {
listGoodsOrder,
getGoodsOrder,
delGoodsOrder,
addGoodsOrder,
updateGoodsOrder,
getGoodsOrderlist,
goodsOrderRefundinfo,
editExpressNo,
goodsOrderrefund,
weChatRefundOrderApply,
} from "@/api/system/goodsOrder";
import { getListByUser } from "@/api/system/userlist.js";
export default {
name: "GoodsOrder",
data() {
return {
//
innerorder: false,
//
innerlogistics: false,
// 退
innerrefund: false,
orderList: [],
refundlist: [],
nurseStationlist: [],
orderStatuslist: [
{
value: "WAIT_PAY",
label: "待付款",
},
{
value: "PAY",
label: "待发货",
},
{
value: "WAIT_RECEIVED_GOODS",
label: "待收货",
},
{
value: "RECEIVED_GOODS",
label: "交易完成",
},
{
value: "CANCEL",
label: "已取消",
},
{
value: "WAIT_RETURNED_GOODS",
label: "待退货",
},
{
value: "RETURNED_GOODS",
label: "已退货",
},
{
value: "WAIT_REFUND",
label: "退款中",
},
{
value: "REFUNDED",
label: "退款成功",
},
],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
goodsOrderList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
patientId: null,
orderNo: null,
orderStatus: null,
totalPrice: null,
receiver: null,
receiveAddress: null,
phone: null,
orderTime: null,
orderChannel: null,
},
queryexpressNo: {
id: "",
expressNo: null,
},
//
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
refundinfo: {
id: "",
},
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
this.info();
},
methods: {
// 退
refundTypeStatus(refundType) {
switch (refundType) {
case "REFUND_MONEY_GOODS":
return "退款退货";
case "ONLY_REFUND_MONEY":
return "仅退款";
default:
break;
}
},
//
orderStatusinfo(orderStatus) {
switch (orderStatus) {
case "WAIT_PAY":
return "待付款";
case "PAY":
return "已付款";
case "CANCEL":
return "已取消";
case "WAIT_RECEIVED_GOODS":
return "待收货";
case "RECEIVED_GOODS":
return "已收货";
case "WAIT_REFUND":
return "退款中";
case "REFUNDED":
return "退款成功";
case "WAIT_RETURNED_GOODS":
return "待退货";
case "RETURNED_GOODS":
return "已退货";
default:
break;
}
},
//
orderChannelinfo(orderChannel) {
switch (orderChannel) {
case "MOBILE_APP":
return "手机APP";
case "WECHAT_APPLET":
return "微信小程序";
case "ALI_PAY_APPLET":
return "支付宝小程序";
default:
break;
}
},
//
buySourceinfo(buySource) {
switch (buySource) {
case "NURSE_STATION":
return "护理站";
case "SHOPPING_MALL":
return "商城";
default:
break;
}
},
/** 查询商品订单列表 */
getList() {
this.loading = true;
listGoodsOrder(this.queryParams).then((response) => {
this.goodsOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
seeOrder(row) {
console.log(row);
const id = row.orderNo;
getGoodsOrderlist(id).then((res) => {
this.orderList = res.data;
this.innerorder = true;
});
},
//
seelogistics(row) {
// console.log(id);
// this.queryexpressNo.id = row.id;
this.queryexpressNo = JSON.parse(JSON.stringify(row));
this.innerlogistics = true;
},
//
searchlogistics() {
console.log(this.queryexpressNo);
editExpressNo(this.queryexpressNo).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("录入成功");
}
this.queryexpressNo.expressNo = "";
this.getList();
this.innerlogistics = false;
});
},
//
cencellogistics() {
this.innerlogistics = false;
this.queryexpressNo.expressNo = "";
},
// 退
refund(id) {
console.log(id);
goodsOrderRefundinfo(id).then((res) => {
this.refundlist = res.data;
console.log(this.refundlist);
this.innerrefund = true;
// this.getList();
});
},
//退
submitRefundOrder() {
var obj = {};
obj.orderNo = this.refundlist.goOrderNo;
obj.refundReason = this.refundlist.dictLabel;
obj.refundPrice = this.refundlist.godTotalPrice;
obj.remark = this.refundlist.refundReasonRemark;
obj.goodsStatus = this.refundlist.orderStatus;
weChatRefundOrderApply(obj).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("退款有延迟,请耐心等待");
}
this.getList();
this.innerrefund = false;
});
},
// refund(id){
// console.log(id);
// this.$confirm('退?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
// this.refundinfo.id=id
// goodsOrderrefund(this.refundinfo).then((res) => {
// this.$message({
// type: 'success',
// message: '退'
// });
// this.getList();
// });
// }).catch(() => {
// this.$message({
// type: 'info',
// message: '退'
// });
// });
// },
//
cancel() {
this.open = false;
this.reset();
},
//退
refundcancel() {
this.innerrefund = false;
},
//
reset() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
patientId: null,
orderNo: null,
orderStatus: null,
totalPrice: null,
receiver: null,
receiveAddress: null,
phone: null,
orderTime: null,
orderChannel: null,
};
this.form = {
id: null,
nurseStationId: null,
patientId: null,
orderNo: null,
totalPrice: null,
receiver: null,
receiveAddress: null,
phone: null,
orderTime: null,
orderChannel: null,
remark: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
orderStatus: "",
};
this.resetForm("queryParams");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
};
} else {
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 10;
this.queryParams.orderNo = null;
this.queryParams.orderStatus = null;
}
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加商品订单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getGoodsOrder(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改商品订单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateGoodsOrder(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addGoodsOrder(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除商品订单编号为"' + ids + '"的数据项?')
.then(function () {
return delGoodsOrder(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/goodsOrder/export",
{
...this.queryParams,
},
`goodsOrder_${new Date().getTime()}.xlsx`
);
},
//
info() {
// goodsCategory().then((res) => {
// console.log(this.form);
// this.goodsCategorylist = res.rows;
// });
getListByUser(this.getListByUserquery).then((res) => {
if (res.rows[0].isAdmin == "1") {
this.nurseStationlist = res.rows;
this.total2 = res.total;
} else {
this.total2 = res.total;
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.handleQuery();
}
});
},
//
loadMore() {
var a = Math.ceil(this.total2 / 10);
if (this.nurseStationlist.length + 1 >= this.total2) {
} else {
if (this.getListByUserquery.pageNum >= a) {
} else {
this.getListByUserquery.pageNum++;
getListByUser(this.getListByUserquery).then((res) => {
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
},
};
import indexjs from "./indexjs.js";
export default indexjs;
</script>
<style lang='scss' scoped>
.stationbtn {
width: 208px;
text-align: left;
height: 32px;
overflow: hidden;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,417 @@
import {
listGoodsOrder,
getGoodsOrder,
delGoodsOrder,
addGoodsOrder,
updateGoodsOrder,
getGoodsOrderlist,
goodsOrderRefundinfo,
editExpressNo,
goodsOrderrefund,
weChatRefundOrderApply,
} from "@/api/system/goodsOrder";
import { getListByUser } from "@/api/system/userlist.js";
export default {
name: "GoodsOrder",
data() {
return {
// 查看商品信息
innerorder: false,
// 查看物流信息
innerlogistics: false,
// 确认退款
innerrefund: false,
orderList: [],
refundlist: [],
orderStatuslist: [{
value: "WAIT_PAY",
label: "待付款",
},
{
value: "PAY",
label: "待发货",
},
{
value: "WAIT_RECEIVED_GOODS",
label: "待收货",
},
{
value: "RECEIVED_GOODS",
label: "交易完成",
},
{
value: "CANCEL",
label: "已取消",
},
{
value: "WAIT_RETURNED_GOODS",
label: "待退货",
},
{
value: "RETURNED_GOODS",
label: "已退货",
},
{
value: "WAIT_REFUND",
label: "退款中",
},
{
value: "REFUNDED",
label: "退款成功",
},
],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
//护理站
stationtotal: 0,
nurseStationlist: [],
nurseStationshow: false,
// 商品订单表格数据
goodsOrderList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
patientId: null,
orderNo: null,
orderStatus: null,
totalPrice: null,
receiver: null,
receiveAddress: null,
phone: null,
orderTime: null,
orderChannel: null,
},
queryexpressNo: {
id: "",
expressNo: null,
},
//权限查询
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
refundinfo: {
id: "",
},
// 表单参数
form: {},
// 表单校验
rules: {},
};
},
created() {
this.getList();
},
methods: {
clicknurseStationshow() {
this.nurseStationshow = false;
},
//护理站重置
stationcancel() {
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
};
this.info();
},
//护理站页面选择护理站
choicestationid(item) {
this.queryParams.nurseStationName = item.nurseStationName;
this.queryParams.nurseStationId = item.id;
this.nurseStationshow = false;
},
//护理站list
info() {
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.stationtotal = res.total;
});
},
//页面所属护理站
ParamsStation(item) {
console.log(this.getListByUserquery)
this.info();
this.nurseStationshow = true
},
//护理站权限列表
info() {
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.stationtotal = res.total;
});
},
// 退款类型
refundTypeStatus(refundType) {
switch (refundType) {
case "REFUND_MONEY_GOODS":
return "退款退货";
case "ONLY_REFUND_MONEY":
return "仅退款";
default:
break;
}
},
// 订单状态
orderStatusinfo(orderStatus) {
switch (orderStatus) {
case "WAIT_PAY":
return "待付款";
case "PAY":
return "已付款";
case "CANCEL":
return "已取消";
case "WAIT_RECEIVED_GOODS":
return "待收货";
case "RECEIVED_GOODS":
return "已收货";
case "WAIT_REFUND":
return "退款中";
case "REFUNDED":
return "退款成功";
case "WAIT_RETURNED_GOODS":
return "待退货";
case "RETURNED_GOODS":
return "已退货";
default:
break;
}
},
// 下单方式
orderChannelinfo(orderChannel) {
switch (orderChannel) {
case "MOBILE_APP":
return "手机APP";
case "WECHAT_APPLET":
return "微信小程序";
case "ALI_PAY_APPLET":
return "支付宝小程序";
default:
break;
}
},
// 购买来源
buySourceinfo(buySource) {
switch (buySource) {
case "NURSE_STATION":
return "护理站";
case "SHOPPING_MALL":
return "商城";
default:
break;
}
},
/** 查询商品订单列表 */
getList() {
this.loading = true;
listGoodsOrder(this.queryParams).then((response) => {
this.goodsOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 查看商品信息
seeOrder(row) {
console.log(row);
const id = row.orderNo;
getGoodsOrderlist(id).then((res) => {
this.orderList = res.data;
this.innerorder = true;
});
},
// 查看录入物流单号弹框
seelogistics(row) {
// console.log(id);
// this.queryexpressNo.id = row.id;
this.queryexpressNo = JSON.parse(JSON.stringify(row));
this.innerlogistics = true;
},
// 确定按钮
searchlogistics() {
console.log(this.queryexpressNo);
editExpressNo(this.queryexpressNo).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("录入成功");
}
this.queryexpressNo.expressNo = "";
this.getList();
this.innerlogistics = false;
});
},
// 取消按钮
cencellogistics() {
this.innerlogistics = false;
this.queryexpressNo.expressNo = "";
},
// 确认退款
refund(id) {
console.log(id);
goodsOrderRefundinfo(id).then((res) => {
this.refundlist = res.data;
console.log(this.refundlist);
this.innerrefund = true;
// this.getList();
});
},
//确认退款 确定按钮
submitRefundOrder() {
var obj = {};
obj.orderNo = this.refundlist.goOrderNo;
obj.refundReason = this.refundlist.dictLabel;
obj.refundPrice = this.refundlist.godTotalPrice;
obj.remark = this.refundlist.refundReasonRemark;
obj.goodsStatus = this.refundlist.orderStatus;
weChatRefundOrderApply(obj).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("退款有延迟,请耐心等待");
}
this.getList();
this.innerrefund = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
//退款取消按钮
refundcancel() {
this.innerrefund = false;
},
// 表单重置
reset() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
patientId: null,
orderNo: null,
orderStatus: null,
totalPrice: null,
receiver: null,
receiveAddress: null,
phone: null,
orderTime: null,
orderChannel: null,
};
this.form = {
id: null,
nurseStationId: null,
patientId: null,
orderNo: null,
totalPrice: null,
receiver: null,
receiveAddress: null,
phone: null,
orderTime: null,
orderChannel: null,
remark: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
orderStatus: "",
};
this.resetForm("queryParams");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
};
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加商品订单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getGoodsOrder(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改商品订单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateGoodsOrder(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addGoodsOrder(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除商品订单编号为"' + ids + '"的数据项?')
.then(function() {
return delGoodsOrder(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/goodsOrder/export", {
...this.queryParams,
},
`goodsOrder_${new Date().getTime()}.xlsx`
);
},
},
};

View File

@ -9,19 +9,9 @@
label-width="90px"
>
<el-form-item label="所属护理站" prop="nurseStationName">
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
queryParams.nurseStationName
}}</el-button>
</el-form-item>
<el-form-item label="订单编号" prop="orderNo">
<el-input
@ -64,13 +54,6 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
<el-button
type="success"
icon="el-icon-refresh-right"
size="mini"
@click="resetQuery"
>刷新预约订单</el-button
>
</el-form-item>
</el-form>
<el-table
@ -119,11 +102,9 @@
<el-button type="warning" v-if="scope.row.orderStatus == 'REFUNDED'"
>退款成功</el-button
>
<el-button type="danger" v-if="scope.row.orderStatus == 'CANCEL'"
>已取消</el-button
>
</template>
</el-table-column>
<el-table-column label="会员名称" align="center" prop="patientName" />
@ -151,15 +132,6 @@
v-if="scope.row.orderStatus == 'WAIT_DISPATCH'"
>派单</el-button
>
<el-button
size="mini"
type="text"
disabled
icon="el-icon-s-promotion"
@click="dispatch(scope.row)"
v-else
>派单</el-button
>
<el-button
size="mini"
type="text"
@ -169,15 +141,6 @@
v-hasPermi="['system:appointmentOrder:confirmCancel']"
>取消预约</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-error"
v-else
disabled
v-hasPermi="['system:appointmentOrder:confirmCancel']"
>取消预约</el-button
>
<!-- <el-button
size="mini"
type="text"
@ -201,85 +164,86 @@
title="查看预约订单信息"
:visible.sync="innerVisible4"
append-to-body
width="1100px"
width="1280px"
>
<el-form
:inline="true"
ref="form"
:model="query"
:rules="rules"
label-width="120px"
class="orderInfo"
label-width="130px"
>
<el-form-item label="订单编号" prop="orderNo">
<el-input
v-model="query.orderNo"
:disabled="true"
style="width: 190px"
/>
<el-input v-model="query.orderNo" disabled style="width: 250px" />
</el-form-item>
<el-form-item label="订单状态" prop="orderStatus">
<el-input
:value="switchOrderStatus(query.orderStatus)"
style="width: 250px"
disabled
style="width: 180px"
>
</el-input>
</el-form-item>
<el-form-item label="订单总金额" prop="totalPrice">
<el-input
v-model="query.totalPrice"
clearable
:disabled="true"
style="width: 240px"
/>
<el-input v-model="query.totalPrice" disabled style="width: 250px" />
</el-form-item>
<el-form-item label="订单数量" prop="orderCount">
<el-input
v-model="query.orderCount"
clearable
:disabled="true"
style="width: 190px"
/>
<el-input v-model="query.orderCount" disabled style="width: 250px" />
</el-form-item>
<el-form-item label="护理项目名称" prop="nurseItemName">
<el-input
v-model="query.nurseItemName"
clearable
:disabled="true"
style="width: 180px"
disabled
style="width: 250px"
/>
</el-form-item>
<el-form-item label="服务时间" prop="time">
<el-input
v-model="query.time"
clearable
:disabled="true"
style="width: 240px"
/>
<el-input v-model="query.time" disabled style="width: 250px" />
</el-form-item>
<el-form-item label="护理项目时长" prop="itemServeDurationUnit">
<el-input
v-model="query.itemServeDurationUnit"
clearable
:disabled="true"
style="width: 190px"
disabled
style="width: 250px"
/>
</el-form-item>
<el-form-item label="护理站名称" prop="nurseStationName">
<el-input
v-model="query.nurseStationName"
clearable
:disabled="true"
style="width: 180px"
disabled
style="width: 250px"
/>
</el-form-item>
<el-form-item label="服务地址" prop="serviceAddress">
<el-input
v-model="query.serviceAddress"
clearable
:disabled="true"
style="width: 240px"
disabled
style="width: 250px"
/>
</el-form-item>
<el-form-item
label="服务到岗照片"
prop="onDutyPictureUrl"
v-if="query.orderStatus == 'COMPLETE'"
>
<img class="img" :src="baseurl + query.onDutyPictureUrl" alt="" />
</el-form-item>
<el-form-item
label="服务结束照片"
prop="serviceEndPictureUrl"
v-if="query.orderStatus == 'COMPLETE'"
>
<img class="img" :src="baseurl + query.serviceEndPictureUrl" alt="" />
</el-form-item>
<el-form-item
label="用户确认签名"
prop="userSignaturePictureUrl"
v-if="query.orderStatus == 'COMPLETE'"
>
<img
class="img"
:src="baseurl + query.userSignaturePictureUrl"
alt=""
/>
</el-form-item>
<el-table
@ -290,21 +254,18 @@
<el-table-column
prop="orderConsumableName"
label="耗材包名称"
width="200"
align="center"
>
</el-table-column>
<el-table-column
prop="orderConsumableCount"
label="耗材包数量"
width="200"
align="center"
>
</el-table-column>
<el-table-column
prop="orderConsumablePrice"
label="耗材包价格"
width="200"
align="center"
>
</el-table-column>
@ -507,355 +468,118 @@
@pagination="handleQuery2"
/>
</el-dialog>
<!-- 护理站 -->
<el-dialog
title="选择护理站"
:visible.sync="nurseStationshow"
width="1100px"
append-to-body
:before-close="clicknurseStationshow"
>
<el-form
ref="form"
:model="getListByUserquery"
label-width="110px"
:inline="true"
>
<el-form-item label="护理站编码" prop="nurseStationCode">
<el-input
v-model="getListByUserquery.nurseStationCode"
placeholder="请输入护理站编码"
/>
</el-form-item>
<el-form-item label="护理站名称" prop="nurseStationName">
<el-input
v-model="getListByUserquery.nurseStationName"
placeholder="请输入护理站名称"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="info"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="stationcancel"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="nurseStationlist"
@cell-dblclick="choicestationid"
>
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
circle
@click="choicestationid(scope.row)"
v-if="queryParams.nurseStationId == scope.row.id"
></el-button>
<el-button
style="width: 15px; height: 15px"
circle
v-else
@click="choicestationid(scope.row)"
>
</el-button>
</template>
</el-table-column>
<el-table-column
property="nurseStationCode"
label="护理站编码"
align="center"
>
</el-table-column>
<el-table-column
property="nurseStationName"
label="护理站名称"
align="center"
>
</el-table-column>
<el-table-column property="phone" label="联系电话" align="center">
</el-table-column>
<el-table-column
property="address"
label="护理站地址"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
<pagination
v-show="stationtotal > 0"
:total="stationtotal"
:page.sync="getListByUserquery.pageNum"
:limit.sync="getListByUserquery.pageSize"
@pagination="info"
/>
</el-dialog>
</div>
</template>
<script>
import {
appointmentOrderDetailsList,
Detailed,
deldetailed,
getPerson,
dispatchsubmit,
xylWeChatRefundNotify,
appointmentOrderDetails,
} from "@/api/system/order";
import { getListByUser } from "@/api/system/userlist.js";
export default {
name: "order",
data() {
return {
orderStatuslist: [
{
value: "WAIT_PAY",
label: "待付款",
},
{
value: "PAY",
label: "已付款",
},
{
value: "CANCEL",
label: "已取消",
},
{
value: "WAIT_DISPATCH",
label: "待派单",
},
{
value: "REFUNDED",
label: "已退款",
},
{
value: "WAIT_REFUND",
label: "退款中",
},
{
value: "COMPLETE",
label: "服务完成",
},
{
value: "NOT_FINISH",
label: "未完成",
},
],
value: "",
//
loading: true,
innerVisible4: false,
innerrefund: false,
//
innerdispatch: false,
//
nursePersonNameinfo: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
input: "",
//
total: 0,
//
OrderDetailsList: [],
dispatchlist: [],
nurseName: "请选择护理员",
nursePersonid: "",
// querynursecencel:{
// appointmentOrderId:"",
// },
appointmentOrderId: "",
nurseStationPersonId: "",
total2: 0,
nurseStationlist: [],
//
title: "",
//
open: false,
open2: false,
//
queryParams: {
patientName: null,
orderNo: null,
nurseStationId: null,
// orderStatus: null,
orderStatus: "",
pageNum: 1,
pageSize: 10,
},
querynursePersonname: {
orderNo: "",
nursePersonName: null,
nursePersonType: null,
departmentName: null,
pageNum: 1,
pageSize: 10,
},
query: [],
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
this.info();
},
methods: {
//
ordercacenl() {
var obj = {
orderNo: this.query.orderNo,
refundPrice: this.query.totalPrice,
refundReason: this.query.cancelAppointmentReason,
};
xylWeChatRefundNotify(obj).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("退款有延迟,请耐心等待");
}
this.getList();
this.innerrefund = false;
console.log(res);
});
},
//
cencelbtn() {
this.innerrefund = false;
},
switchOrderStatus(orderStatus) {
switch (orderStatus) {
case "WAIT_PAY":
return "待付款";
case "WAIT_DISPATCH":
return "待派单";
case "NOT_FINISH":
return "未完成";
case "COMPLETE":
return "服务完成";
case "PAY":
return "已付款";
case "WAIT_REFUND":
return "退款中";
case "CANCEL":
return "已取消";
case "REFUNDED":
return "已退款";
default:
break;
}
},
//
seeLook(row) {
const id = row.orderNo;
appointmentOrderDetails(id).then((res) => {
res.data.forEach((e) => {
if (e.serviceDate) {
e.time =
e.serviceDate + "-" + e.serviceStartTime + "-" + e.serviceEndTime;
}
});
this.query = res.data[0];
this.innerVisible4 = true;
console.log(this.query);
});
},
//
dispatch(row) {
console.log(row);
this.querynursePersonname.orderNo = row.orderNo;
this.nurseName = "请选择护理员";
this.innerdispatch = true;
this.nursePersonid = "";
},
//
clicknursePersonName() {
getPerson(this.querynursePersonname).then((res) => {
this.dispatchlist = res.rows;
this.total2 = res.total;
this.nursePersonNameinfo = true;
});
},
//
submitForm() {
let params = {
nurseStationPersonId: this.nursePersonid,
orderNo: this.querynursePersonname.orderNo,
};
dispatchsubmit(params).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("派单成功");
}
this.innerdispatch = false;
this.getList();
this.nurseName = "请选择护理员";
});
},
//
nursePersonclick(row) {
this.nursePersonid = row.nurseStationPersonId;
this.nurseName = row.nursePersonName;
this.nursePersonNameinfo = false;
console.log(row);
},
//
cencel(row) {
Detailed(row.orderNo).then((res) => {
this.query = res.data;
this.innerrefund = true;
});
},
/** 查询护理类型信息列表 */
getList() {
this.loading = true;
appointmentOrderDetailsList(this.queryParams).then((response) => {
this.OrderDetailsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
patientName: "",
orderNo: "",
orderStatus: "",
createTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
handleQuery2() {
getPerson(this.querynursePersonname).then((res) => {
this.dispatchlist = res.rows;
console.log(this.querynursePersonname);
// this.innerdispatch = true;
});
},
/** 重置按钮操作 */
resetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
};
} else {
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 10;
this.queryParams.orderNo = null
this.queryParams.orderStatus = null
this.queryParams.patientName=null
}
this.handleQuery();
},
//
info() {
getListByUser(this.queryParams).then((res) => {
if (res.rows[0].isAdmin == "1") {
this.nurseStationlist = res.rows;
this.total = res.total;
} else {
this.total = res.total;
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.handleQuery();
}
});
},
//
loadMore() {
var a = Math.ceil(this.total / 10);
if (this.nurseStationlist.length + 1 >= this.total) {
} else {
if (this.queryParams.pageNum >= a) {
} else {
this.queryParams.pageNum++;
getListByUser(this.queryParams).then((res) => {
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
resetQuery2() {
this.resetForm("queryForm");
this.handleQuery2();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 删除按钮操作 */
handleDelete(row) {
// console.log('row :>> ', row);
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deldetailed(row.appointmentOrderId).then((res) => {
this.$message.success("删除成功");
this.getList();
});
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/nurseType/export",
{
...this.queryParams,
},
`nurseType_${new Date().getTime()}.xlsx`
);
},
},
};
import indexjs from "./indexjs.js";
export default indexjs;
</script>
<style scoped>
::v-deep .orderInfo {
height: 350px;
overflow-y: scroll;
<style lang='scss' scoped>
.stationbtn {
width: 208px;
text-align: left;
height: 32px;
overflow: hidden;
font-size: 14px;
}
.img {
width: 250px;
height: 250px;
}
</style>

View File

@ -0,0 +1,337 @@
import {
appointmentOrderDetailsList,
Detailed,
deldetailed,
getPerson,
dispatchsubmit,
xylWeChatRefundNotify,
appointmentOrderDetails,
} from "@/api/system/order";
import { getListByUser } from "@/api/system/userlist.js";
import baseurl from '@/api/baseurl.js'
export default {
name: "order",
data() {
return {
baseurl: null,
orderStatuslist: [{
value: "WAIT_PAY",
label: "待付款",
},
{
value: "PAY",
label: "已付款",
},
{
value: "CANCEL",
label: "已取消",
},
{
value: "WAIT_DISPATCH",
label: "待派单",
},
{
value: "REFUNDED",
label: "已退款",
},
{
value: "WAIT_REFUND",
label: "退款中",
},
{
value: "COMPLETE",
label: "服务完成",
},
{
value: "NOT_FINISH",
label: "未完成",
},
],
value: "",
// 遮罩层
loading: true,
innerVisible4: false,
innerrefund: false,
// 派单弹框
innerdispatch: false,
// 姓名弹框
nursePersonNameinfo: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
input: "",
// 总条数
total: 0,
// 护理类型信息表格数据
OrderDetailsList: [],
dispatchlist: [],
nurseName: "请选择护理员",
nursePersonid: "",
// querynursecencel:{
// appointmentOrderId:"",
// },
appointmentOrderId: "",
nurseStationPersonId: "",
total2: 0,
//护理站
stationtotal: 0,
nurseStationlist: [],
nurseStationshow: false,
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
open2: false,
// 查询参数
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
queryParams: {
patientName: null,
orderNo: null,
nurseStationId: null,
// orderStatus: null,
orderStatus: "",
pageNum: 1,
pageSize: 10,
},
querynursePersonname: {
orderNo: "",
nursePersonName: null,
nursePersonType: null,
departmentName: null,
pageNum: 1,
pageSize: 10,
},
query: [],
// 表单参数
form: {},
// 表单校验
rules: {},
};
},
created() {
this.getList();
this.baseurl = baseurl
},
methods: {
//取消预约确定按钮
ordercacenl() {
var obj = {
orderNo: this.query.orderNo,
refundPrice: this.query.totalPrice,
refundReason: this.query.cancelAppointmentReason,
};
xylWeChatRefundNotify(obj).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("退款有延迟,请耐心等待");
}
this.getList();
this.innerrefund = false;
console.log(res);
});
},
// 取消按钮
cencelbtn() {
this.innerrefund = false;
},
switchOrderStatus(orderStatus) {
switch (orderStatus) {
case "WAIT_PAY":
return "待付款";
case "WAIT_DISPATCH":
return "待派单";
case "NOT_FINISH":
return "未完成";
case "COMPLETE":
return "服务完成";
case "PAY":
return "已付款";
case "WAIT_REFUND":
return "退款中";
case "CANCEL":
return "已取消";
case "REFUNDED":
return "已退款";
default:
break;
}
},
// 查看
seeLook(row) {
const id = row.orderNo;
appointmentOrderDetails(id).then((res) => {
res.data.forEach((e) => {
if (e.serviceDate) {
e.time =
e.serviceDate + "-" + e.serviceStartTime + "-" + e.serviceEndTime;
}
});
this.query = res.data[0];
this.innerVisible4 = true;
});
},
// 派单
dispatch(row) {
console.log(row);
this.querynursePersonname.orderNo = row.orderNo;
this.nurseName = "请选择护理员";
this.innerdispatch = true;
this.nursePersonid = "";
},
// 姓名弹框
clicknursePersonName() {
getPerson(this.querynursePersonname).then((res) => {
this.dispatchlist = res.rows;
this.total2 = res.total;
this.nursePersonNameinfo = true;
});
},
// 姓名弹框确定按钮
submitForm() {
let params = {
nurseStationPersonId: this.nursePersonid,
orderNo: this.querynursePersonname.orderNo,
};
dispatchsubmit(params).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("派单成功");
}
this.innerdispatch = false;
this.getList();
this.nurseName = "请选择护理员";
});
},
// 选择姓名按钮
nursePersonclick(row) {
this.nursePersonid = row.nurseStationPersonId;
this.nurseName = row.nursePersonName;
this.nursePersonNameinfo = false;
console.log(row);
},
// 确认取消预约
cencel(row) {
Detailed(row.orderNo).then((res) => {
this.query = res.data;
this.innerrefund = true;
});
},
clicknurseStationshow() {
this.nurseStationshow = false;
},
//护理站重置
stationcancel() {
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
};
this.info();
},
//护理站页面选择护理站
choicestationid(item) {
this.queryParams.nurseStationName = item.nurseStationName;
this.queryParams.nurseStationId = item.id;
this.nurseStationshow = false;
},
//护理站list
info() {
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.stationtotal = res.total;
});
},
//页面所属护理站
ParamsStation(item) {
this.info();
this.nurseStationshow = true
},
/** 查询护理类型信息列表 */
getList() {
this.loading = true;
appointmentOrderDetailsList(this.queryParams).then((response) => {
this.OrderDetailsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
patientName: "",
orderNo: "",
orderStatus: "",
createTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
handleQuery2() {
getPerson(this.querynursePersonname).then((res) => {
this.dispatchlist = res.rows;
console.log(this.querynursePersonname);
// this.innerdispatch = true;
});
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
};
this.handleQuery();
},
resetQuery2() {
this.resetForm("queryForm");
this.handleQuery2();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 删除按钮操作 */
handleDelete(row) {
// console.log('row :>> ', row);
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deldetailed(row.appointmentOrderId).then((res) => {
this.$message.success("删除成功");
this.getList();
});
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/nurseType/export", {
...this.queryParams,
},
`nurseType_${new Date().getTime()}.xlsx`
);
},
},
};

View File

@ -6,43 +6,12 @@
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
label-width="70px"
>
<el-form-item
label="护理站"
prop="nurseStationId"
v-if="nurseStationlist.find((e) => e.isAdmin == '1')"
>
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
@keyup.enter.native="handleQuery"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="护理站" prop="nurseStationId" v-else>
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
<el-form-item label="护理站" prop="nurseStationId">
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
queryParams.nurseStationName
}}</el-button>
</el-form-item>
<el-form-item
label="所属科室"
@ -77,7 +46,6 @@
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -121,7 +89,7 @@
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['system:person:export']"
v-hasPermi="['system:person:importStationPerson']"
>导入</el-button
>
</el-col>
@ -130,7 +98,6 @@
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="nurseStationPersonList"
@ -189,7 +156,6 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
@ -197,7 +163,6 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加护理站人员信息对话框 -->
<el-dialog
:title="title"
@ -933,656 +898,15 @@
</template>
<script>
import {
listPerson,
getPerson,
delPerson,
addPerson,
updatePerson,
stationList,
StationDepartmentList,
} from "@/api/system/person";
import { getToken } from "@/utils/auth";
import { getListByUser } from "@/api/system/userlist.js";
export default {
name: "Person",
data() {
//
var checkMobile = (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 (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 (regMobile.test(value)) {
return cb();
}
cb(new Error("请输入正确的联系电话"));
};
return {
//
sexs: [
{
label: "男",
value: "MALE",
},
{
label: "女",
value: "FEMALE",
},
],
nursePersonTypes: [
{
label: "护士",
value: "NURSE",
},
{
label: "护理师",
value: "NURSE_TEACHER",
},
],
innerVisible: false,
innerVisible2: false,
innerVisiblexg: false,
innerVisiblexg2: false,
//
loading: true,
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
headers: { Authorization: "Bearer " + getToken() },
//
url:
process.env.VUE_APP_BASE_API +
"/system/person/insertNurseStationPersonImportList",
},
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
departtotal: 0,
nursetotal: 0,
//
nurseStationPersonList: [],
//
stationLists: [],
//
StationDepartmentLists: [],
nurseStationlist: [],
stationid: "",
stationid2: "",
departid: "",
nurseStationName: "请选择所属护理站",
departmentName: "请选择所属科室",
//
title: "",
title2: "",
title3: "",
//
open: false,
//
open2: false,
//
//
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
userId: null,
departmentName: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
phone: null,
address: null,
},
queryParams2: {
pageNum: 1,
pageSize: 10,
nurseStationName: null,
departmentName: null,
id: null,
nurseStationId: null,
},
queryParams3: {
pageNum: 1,
pageSize: 10,
nurseStationName: null,
id: null,
departmentCode: null,
departmentName: null,
nurseStationId: null,
},
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
},
StationqueryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {},
index: "",
//
rules: {
nurseStationId: [
{ required: true, message: "请选择所属护理站", trigger: "blur" },
],
departmentName: [
{ required: true, message: "所属科室不能为空", trigger: "blur" },
],
nursePersonName: [
{ required: true, message: "护理人姓名不能为空", trigger: "blur" },
],
nursePersonType: [
{ required: true, message: "护理人职称不能为空", trigger: "blur" },
],
sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
phone: [
{
required: true,
validator: checkMobile2,
message: "",
trigger: "blur",
},
],
address: [
{ required: true, message: "居住地址不能为空", trigger: "blur" },
],
nurseStationPersonList: {
nursePersonName: [
{
required: true,
message: "请选择所属护理站",
trigger: "blur",
},
],
departmentCode: [
{ required: true, message: "所属科室不能为空", trigger: "blur" },
],
nurseStationId: [
{ required: true, message: "请选择所属护理站", trigger: "blur" },
],
nursePersonName: [
{ required: true, message: "护理人姓名不能为空", trigger: "blur" },
],
nursePersonType: [
{ required: true, message: "护理人职称不能为空", trigger: "blur" },
],
sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
phone: [
{
required: true,
validator: checkMobile,
message: "",
trigger: "blur",
},
],
address: [
{ required: true, message: "居住地址不能为空", trigger: "blur" },
],
},
},
};
},
created() {
this.getList();
this.info();
},
methods: {
// //
departclick(item, index) {
if (this.form.nurseStationId != null) {
this.getList3();
console.log(item);
this.departid = item.departmentCode;
this.innerVisible2 = true;
this.index = index;
} else {
// this.innerVisible2 = false;
this.$message.error('请先选择所属护理站');
}
},
// //
departclick2() {
console.log(this.form.nurseStationId)
if (this.form.nurseStationId != null) {
this.getList3();
this.departid2 = this.form.departmentCode;
this.innerVisiblexg2 = true;
} else {
// this.innerVisible2 = false;
this.$message.error('请先选择所属护理站');
}
},
//
departclickxg() {
this.info();
this.stationid2 = this.form.nurseStationId;
this.innerVisiblexg = true;
// this.index = index;
},
//
clickinnerVisible(item, index) {
this.info();
this.stationid = item.nurseStationId;
this.innerVisible = true;
this.index = index;
},
//
nurseclick2(row) {
console.log(row);
this.nurseStationName = row.nurseStationName;
this.stationid2 = row.id;
this.form.nurseStationId = row.id;
this.queryParams3.nurseStationId = row.id;
this.innerVisiblexg = false;
this.form.nursename = row.nurseStationName;
},
//deldisease
// deldisease(index) {
// this.form.nurseStationPersonList.splice(index, 1);
// console.log(this.form.nurseStationPersonList);
// },
// adddisease() {
// this.form.nurseStationId = null
// var obj = {
// nursePersonCode: "",
// nursePersonCode: "",
// nursePersonName: "",
// nursePersonType: "",
// phone: "",
// address: "",
// sex: "",
// nurseStationId: "",
// departmentName: "",
// // departname: "",
// nurseStationName: "",
// };
// if (this.form.nurseStationPersonList.length == 5) {
// this.$message.error("5");
// } else {
// this.form.nurseStationPersonList.push(obj);
// }
// },
//
nurseclick(row) {
console.log(row);
this.nursename = row.nurseStationName;
this.stationid = row.id;
this.form.nurseStationId = row.id;
this.queryParams3.nurseStationId = row.id;
console.log(this.form.nurseStationId);
console.log(this.form);
this.innerVisible = false;
this.form.nursename = row.nurseStationName;
this.form.nurseStationPersonList[this.index].nurseStationName =
row.nurseStationName;
this.form.nurseStationPersonList[this.index].nurseStationId = row.id;
},
//
StationDepartmentclick(row) {
console.log(row);
this.departname = row.departmentName;
this.departid = row.departmentCode;
console.log(this.departid);
this.departmentCode = row.departmentCode;
// this.form.nurseStationId = row.id;
this.innerVisible2 = false;
this.form.departname = row.departmentName;
this.form.nurseStationPersonList[this.index].departmentName =
row.departmentName;
this.form.nurseStationPersonList[this.index].departmentCode =
row.departmentCode;
console.log(this.form);
},
//
StationDepartmentclick2(row) {
console.log(row);
this.departmentName = row.departmentName;
this.form.departmentCode = row.departmentCode;
this.departid2 = row.departmentCode;
this.form.departmentName = row.id;
this.innerVisiblexg2 = false;
},
/** 查询护理站人员信息列表 */
getList() {
//
this.loading = true;
listPerson(this.queryParams).then((response) => {
this.nurseStationPersonList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// getList2() {
// this.loading = true;
// getListByUser(this.StationqueryParams).then((res) => {
// this.nursetotal = res.total;
// this.nurseStationlist = res.rows;
// this.loading = false;
// });
// },
getList3() {
this.loading = true;
StationDepartmentList(this.queryParams3).then((res) => {
this.StationDepartmentLists = res.rows;
this.departtotal = res.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.open2 = false;
this.nurseStationName = "请选择所属护理站";
this.departmentName = "请选择所属科室";
// this.upload.open=false;
this.reset();
},
//
reset() {
this.form = {
id: null,
nurseStationId: null,
departmentCode: null,
userId: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
phone: null,
address: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
nurseStationName: "请选择所属护理站",
departmentName: "请选择所属科室",
nurseStationPersonList: [
{
id: "",
nurseStationId: "",
departmentCode: "",
nursePersonCode: "",
nursePersonName: "",
nursePersonType: "",
nurseStationName: "请选择所属护理站",
phone: "",
address: "",
sex: "",
departmentName: "请选择所属科室",
},
],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery2() {
this.nurseStationqueryParams.pageNum = 1;
this.info();
},
//
handleQuery4() {
this.nurseStationqueryParams.pageNum = 1;
this.info();
},
//
handleQuery3() {
this.queryParams3.pageNum = 1;
this.getList3();
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
addcancel() {
this.innerVisible = false;
this.innerVisiblexg = false;
this.resetQuery2();
},
departcancel() {
this.innerVisible2 = false;
this.innerVisiblexg2 = false;
// this.resetQuery3();
},
resetQuery2() {
this.resetForm("queryForm");
this.nurseStationqueryParams = {
pageNum: 1,
pageSize: 10,
};
this.handleQuery2();
},
resetQuery4() {
this.resetForm("queryForm");
this.nurseStationqueryParams = {
pageNum: 1,
pageSize: 10,
};
this.handleQuery4();
},
resetQuery3() {
this.queryParams3.pageNum = 1;
this.queryParams3.pageSize = 10;
this.queryParams3.departmentName = null;
this.queryParams3.departmentCode = null;
this.handleQuery3();
},
resetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
userId: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
phone: null,
address: null,
};
this.handleQuery();
} else {
console.log(1);
console.log(this.nurseStationlist);
this.queryParams.departmentName = null;
this.queryParams.pageSize = 10;
this.queryParams.pageNum = 1;
this.queryParams.nursePersonName = null;
this.handleQuery();
}
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.queryParams3.nurseStationId=null
this.reset();
this.open2 = true;
this.title = "添加护理站人员信息";
this.title2 = "请选择所属护理站";
this.title3 = "请选择科室";
},
/** 修改按钮操作 */
handleUpdate(row) {
const id = row.id || this.ids;
getPerson(id).then((response) => {
console.log(response);
this.departmentName = response.data.departmentName;
this.nurseStationName = response.data.nurseStationName;
this.form = response.data;
this.queryParams3.nurseStationId=response.data.nurseStationId
this.open = true;
this.title = "修改护理站人员信息";
if (this.departmentName == null && this.departmentName == undefined) {
this.departmentName = "请选择所属科室";
} else {
this.departmentName = response.data.departmentName;
}
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updatePerson(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPerson(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open2 = false;
this.getList();
this.nurseStationName = "请选择所属护理站";
this.departmentName = "请选择所属科室";
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除护理站人员信息的数据项?")
.then(function () {
return delPerson(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => { });
},
/** 导入按钮操作 */
handleImport() {
this.upload.open = true;
this.upload.title = "护理站人员导入";
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/station/downloadTemplate?fileType=nurseStationPerson",
{},
`护理站人员基本信息导入模板.xlsx`
);
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/person/export",
{
...this.queryParams,
},
`person_${new Date().getTime()}.xlsx`
);
},
//
info() {
getListByUser(this.nurseStationqueryParams).then((res) => {
console.log(res);
if (res.rows[0].isAdmin == "1") {
console.log(true);
this.nurseStationlist = res.rows;
this.nursetotal = res.total;
} else {
this.nursetotal = res.total;
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.queryParams3.nurseStationId = res.rows[0].id;
this.handleQuery();
}
});
},
//
loadMore() {
var a = Math.ceil(this.nursetotal / 10);
if (this.nurseStationlist.length + 1 >= this.nursetotal) {
} else {
if (this.nurseStationqueryParams.pageNum >= a) {
} else {
this.nurseStationqueryParams.pageNum++;
console.log(this.nurseStationqueryParams.pageNum);
getListByUser(this.nurseStationqueryParams).then((res) => {
console.log(res);
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
},
};
import indexjs from "./indexjs.js";
export default indexjs;
</script>
<style scoped>
.stationbtn {
width: 208px;
text-align: left;
height: 32px;
overflow: hidden;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,580 @@
import {
listPerson,
getPerson,
delPerson,
addPerson,
updatePerson,
stationList,
StationDepartmentList,
} from "@/api/system/person";
import { getToken } from "@/utils/auth";
import { getListByUser } from "@/api/system/userlist.js";
export default {
name: "Person",
data() {
// 验证手机号的规则
var checkMobile = (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 (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 (regMobile.test(value)) {
return cb();
}
cb(new Error("请输入正确的联系电话"));
};
return {
//男女选择
sexs: [{
label: "男",
value: "MALE",
},
{
label: "女",
value: "FEMALE",
},
],
nursePersonTypes: [{
label: "护士",
value: "NURSE",
},
{
label: "护理师",
value: "NURSE_TEACHER",
},
],
innerVisible: false,
innerVisible2: false,
innerVisiblexg: false,
innerVisiblexg2: false,
// 遮罩层
loading: true,
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API +
"/system/person/insertNurseStationPersonImportList",
},
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
departtotal: 0,
nursetotal: 0,
// 护理站人员信息表格数据
nurseStationPersonList: [],
// 护理站名称
stationLists: [],
// 所属科室
StationDepartmentLists: [],
nurseStationlist: [],
stationid: "",
stationid2: "",
departid: "",
nurseStationName: "请选择所属护理站",
departmentName: "请选择所属科室",
// 弹出层标题
title: "",
title2: "",
title3: "",
// 修改弹出层
open: false,
// 添加弹出层
open2: false,
//权限查询
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
userId: null,
departmentName: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
nurseStationName: null,
phone: null,
address: null,
},
queryParams2: {
pageNum: 1,
pageSize: 10,
nurseStationName: null,
departmentName: null,
id: null,
nurseStationId: null,
},
queryParams3: {
pageNum: 1,
pageSize: 10,
nurseStationName: null,
id: null,
departmentCode: null,
departmentName: null,
nurseStationId: null,
},
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
},
StationqueryParams: {
pageNum: 1,
pageSize: 10,
},
// 表单参数
form: {},
index: "",
// 表单校验
rules: {
nurseStationId: [
{ required: true, message: "请选择所属护理站", trigger: "blur" },
],
departmentName: [
{ required: true, message: "所属科室不能为空", trigger: "blur" },
],
nursePersonName: [
{ required: true, message: "护理人姓名不能为空", trigger: "blur" },
],
nursePersonType: [
{ required: true, message: "护理人职称不能为空", trigger: "blur" },
],
sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
phone: [{
required: true,
validator: checkMobile2,
message: "",
trigger: "blur",
}, ],
address: [
{ required: true, message: "居住地址不能为空", trigger: "blur" },
],
nurseStationPersonList: {
nursePersonName: [{
required: true,
message: "请选择所属护理站",
trigger: "blur",
}, ],
departmentCode: [
{ required: true, message: "所属科室不能为空", trigger: "blur" },
],
nurseStationId: [
{ required: true, message: "请选择所属护理站", trigger: "blur" },
],
nursePersonName: [
{ required: true, message: "护理人姓名不能为空", trigger: "blur" },
],
nursePersonType: [
{ required: true, message: "护理人职称不能为空", trigger: "blur" },
],
sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
phone: [{
required: true,
validator: checkMobile,
message: "",
trigger: "blur",
}, ],
address: [
{ required: true, message: "居住地址不能为空", trigger: "blur" },
],
},
},
homenumber: null,
};
},
created() {
this.getList();
},
methods: {
// // 新增所属科室按钮
departclick(item, index) {
if (this.form.nurseStationId != null) {
this.getList3();
console.log(item);
this.departid = item.departmentCode;
this.innerVisible2 = true;
this.index = index;
} else {
// this.innerVisible2 = false;
this.$message.error('请先选择所属护理站');
}
},
// // 修改所属科室按钮
departclick2() {
if (this.form.nurseStationId != null) {
this.getList3();
this.departid2 = this.form.departmentCode;
this.innerVisiblexg2 = true;
} else {
// this.innerVisible2 = false;
this.$message.error('请先选择所属护理站');
}
},
//修改护理站按钮
departclickxg() {
this.info();
this.stationid2 = this.form.nurseStationId;
this.innerVisiblexg = true;
// this.index = index;
},
// 新增护理站按钮
clickinnerVisible(item, index) {
this.info();
this.stationid = item.nurseStationId;
this.innerVisible = true;
this.index = index;
},
// 修改护理站
nurseclick2(row) {
if (this.homenumber) {
this.queryParams.nurseStationName = row.nurseStationName;
this.queryParams.nurseStationId = row.id;
} else {
this.nurseStationName = row.nurseStationName;
this.stationid2 = row.id;
this.form.nurseStationId = row.id;
this.queryParams3.nurseStationId = row.id;
this.form.nursename = row.nurseStationName;
}
this.innerVisiblexg = false;
},
// 护理站名称
nurseclick(row) {
console.log(row);
this.nursename = row.nurseStationName;
this.stationid = row.id;
this.form.nurseStationId = row.id;
this.queryParams3.nurseStationId = row.id;
console.log(this.form.nurseStationId);
console.log(this.form);
this.innerVisible = false;
this.form.nursename = row.nurseStationName;
this.form.nurseStationPersonList[this.index].nurseStationName =
row.nurseStationName;
this.form.nurseStationPersonList[this.index].nurseStationId = row.id;
},
// 所属科室
StationDepartmentclick(row) {
console.log(row);
this.departname = row.departmentName;
this.departid = row.departmentCode;
console.log(this.departid);
this.departmentCode = row.departmentCode;
// this.form.nurseStationId = row.id;
this.innerVisible2 = false;
this.form.departname = row.departmentName;
this.form.nurseStationPersonList[this.index].departmentName =
row.departmentName;
this.form.nurseStationPersonList[this.index].departmentCode =
row.departmentCode;
console.log(this.form);
},
// 修改科室
StationDepartmentclick2(row) {
this.departmentName = row.departmentName;
this.form.departmentCode = row.departmentCode;
this.departid2 = row.departmentCode;
this.form.departmentName = row.id;
this.innerVisiblexg2 = false;
},
//主页面打开护理站列表
ParamsStation(item) {
this.info();
this.innerVisiblexg = true
this.title2 = '选择护理站'
this.homenumber = item
this.stationid2 = this.queryParams.nurseStationId;
},
//护理站列表
info() {
this.loading = true;
getListByUser(this.nurseStationqueryParams).then((res) => {
this.nurseStationlist = res.rows;
this.nursetotal = res.total;
this.loading = false;
});
},
/** 查询护理站人员信息列表 */
getList() {
// 护理站名称
this.loading = true;
listPerson(this.queryParams).then((response) => {
this.nurseStationPersonList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getList3() {
this.loading = true;
StationDepartmentList(this.queryParams3).then((res) => {
this.StationDepartmentLists = res.rows;
this.departtotal = res.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.open2 = false;
this.nurseStationName = "请选择所属护理站";
this.departmentName = "请选择所属科室";
// this.upload.open=false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
nurseStationId: null,
departmentCode: null,
userId: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
phone: null,
address: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
nurseStationName: "请选择所属护理站",
departmentName: "请选择所属科室",
nurseStationPersonList: [{
id: "",
nurseStationId: "",
departmentCode: "",
nursePersonCode: "",
nursePersonName: "",
nursePersonType: "",
nurseStationName: "请选择所属护理站",
phone: "",
address: "",
sex: "",
departmentName: "请选择所属科室",
}, ],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery2() {
this.nurseStationqueryParams.pageNum = 1;
this.info();
},
// 修改护理站弹框的搜索
handleQuery4() {
this.nurseStationqueryParams.pageNum = 1;
this.info();
},
//修改所属科室
handleQuery3() {
this.queryParams3.pageNum = 1;
this.getList3();
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
addcancel() {
this.innerVisible = false;
this.innerVisiblexg = false;
this.resetQuery4();
},
departcancel() {
this.innerVisible2 = false;
this.innerVisiblexg2 = false;
this.resetQuery3();
},
resetQuery2() {
this.resetForm("queryForm");
this.nurseStationqueryParams = {
pageNum: 1,
pageSize: 10,
};
this.handleQuery2();
},
resetQuery4() {
this.resetForm("queryForm");
this.nurseStationqueryParams = {
pageNum: 1,
pageSize: 10,
};
this.handleQuery4();
},
resetQuery3() {
this.queryParams3.pageNum = 1;
this.queryParams3.pageSize = 10;
this.queryParams3.departmentName = null;
this.queryParams3.departmentCode = null;
this.handleQuery3();
},
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
departmentCode: null,
userId: null,
nursePersonCode: null,
nursePersonName: null,
nursePersonType: null,
phone: null,
address: null,
};
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.queryParams3.nurseStationId = null
this.reset();
this.open2 = true;
this.title = "添加护理站人员信息";
this.title2 = "请选择所属护理站";
this.title3 = "请选择科室";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.homenumber = null;
const id = row.id || this.ids;
getPerson(id).then((response) => {
console.log(response);
this.departmentName = response.data.departmentName;
this.nurseStationName = response.data.nurseStationName;
this.form = response.data;
this.queryParams3.nurseStationId = response.data.nurseStationId
this.open = true;
this.title = "修改护理站人员信息";
if (this.departmentName == null && this.departmentName == undefined) {
this.departmentName = "请选择所属科室";
} else {
this.departmentName = response.data.departmentName;
}
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updatePerson(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPerson(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open2 = false;
this.getList();
this.nurseStationName = "请选择所属护理站";
this.departmentName = "请选择所属科室";
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除护理站人员信息的数据项?")
.then(function() {
return delPerson(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导入按钮操作 */
handleImport() {
this.upload.open = true;
this.upload.title = "护理站人员导入";
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/station/downloadTemplate?fileType=nurseStationPerson", {},
`护理站人员基本信息导入模板.xlsx`
);
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果", { dangerouslyUseHTMLString: true }
);
this.getList();
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/person/export", {
...this.queryParams,
},
`person_${new Date().getTime()}.xlsx`
);
},
},
};

View File

@ -1,57 +1,29 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
:model="getListByUserquery"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item
label="护理站名称"
prop="nurseStationName"
v-if="nurseStationlist.find((e) => e.isAdmin == '1')"
>
<el-select
v-model="queryParams.id"
clearable
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属护理站" prop="nurseStationName" v-else>
<el-select
v-model="queryParams.id"
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="护理站编号" prop="nurseStationCode">
<el-input
v-model="queryParams.nurseStationCode"
v-model="getListByUserquery.nurseStationCode"
placeholder="请输入护理站编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="护理站名称" prop="nurseStationName">
<el-input
v-model="getListByUserquery.nurseStationName"
placeholder="请输入护理站名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@ -65,7 +37,6 @@
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -98,7 +69,7 @@
icon="el-icon-upload2"
size="mini"
@click="handledata"
v-hasPermi="['system:station:importData']"
v-hasPermi="['system:station:importStationInfo']"
>导入</el-button
>
</el-col>
@ -108,10 +79,9 @@
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="stationList"
:data="nurseStationlist"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
@ -127,13 +97,6 @@
prop="nurseStationName"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column label="护理站类型" align="center" prop="nurseTypeName">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="looktype(scope.row)"
>查看</el-button
>
</template>
</el-table-column> -->
<el-table-column label="所属区域" align="center" prop="area">
<template slot-scope="scope">
<span>{{
@ -149,7 +112,6 @@
prop="address"
:show-overflow-tooltip="true"
/>
<el-table-column label="护理站经度" align="center" prop="longitude" />
<el-table-column label="护理站纬度" align="center" prop="latitude" />
<el-table-column label="联系电话" align="center" prop="phone" />
@ -182,40 +144,13 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="liststationinfo"
v-show="total2 > 0"
:total="total2"
:page.sync="getListByUserquery.pageNum"
:limit.sync="getListByUserquery.pageSize"
@pagination="info"
/>
<!-- 查看护理类型 -->
<el-dialog
title="护理类型"
:visible.sync="typeopen"
width="700px"
append-to-body
>
<el-table v-loading="loading" :data="typelooks">
<el-table-column
label="护理类型名称"
align="center"
prop="nurseTypeName"
/>
<el-table-column
label="护理类型编号"
align="center"
prop="nurseTypeCode"
/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" plain @click="typeopen = false" size="small"
>关闭窗口</el-button
>
</div>
</el-dialog>
<!-- 新增护理站信息对话框 -->
<el-dialog
:title="title"
@ -487,558 +422,6 @@
</template>
<script>
import {
listStation,
getStation,
delStation,
addStation,
updateStation,
getFirstLevelInfo,
getSecondaryLevelInfo,
getInfoLists,
updatePicture,
} from "@/api/system/station";
import { getInfoList } from "@/api/system/nurseItem";
import stationAcatar from "../stationAvatar/index.vue";
import { getListByUser } from "@/api/system/userlist.js";
import { getToken } from "@/utils/auth";
import editor from "@/components/Editor";
export default {
components: { stationAcatar, editor },
name: "Station",
data() {
var checkMobile = (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 (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)) {
return cb();
} else {
cb(new Error("请输入正确的联系电话"));
}
}
};
return {
imageUrl: "",
imageUrl2: "",
imgtwo: "",
imgone: "",
//
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,
//
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,
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: "",
},
],
dutyPhone: [
{
validator: checkMobile2,
trigger: "blur",
message: "",
},
],
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.getaddress();
this.info();
},
methods: {
imgUrl(imgUrl) {
this.form.stationPictureUrl = imgUrl;
},
imgUrl2(imgUrl) {
this.form.stationIntroducePcitureUrl = imgUrl;
},
delnurseStationLabelList(index, item) {
console.log(index, item);
console.log();
// this.looknurseStationLabel.splice(index,1)
if (this.looknurseStationLabel.length === 1) {
this.looknurseStationLabel = [
{
labelDescription: "",
sort: "",
ids: 1,
},
];
} else {
this.looknurseStationLabel.splice(index, 1);
}
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);
},
//
looktype(item) {
// console.log(item);
this.typelooks = [];
getInfoLists(item.nurseStationType).then((res) => {
console.log(res);
this.typelooks = res.data;
this.typeopen = true;
});
},
//
clickstreet(item) {
this.form.areaCode = item.areaCode;
console.log(item, this.form);
},
//
clickarea(item) {
this.form.areaCode = "";
this.form.streetCode = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.streetlist = res.data;
});
},
//
clickcity(item) {
this.form.regionName = "";
this.form.areaCode = "";
this.form.streetCode = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.arealist = res.data;
});
},
//
province(item) {
this.form.cityName = "";
this.form.regionName = "";
this.form.areaCode = "";
this.form.streetCode = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.citylist = res.data;
});
},
/** 查询护理站信息列表 */
getaddress() {
getFirstLevelInfo().then((res) => {
this.provincelist = res.data;
});
},
getList() {
this.liststationinfo();
// getInfoList().then((res) => {
// this.nurseStationTypelist = res.data;
// });
this.loading = true;
},
//
cancel() {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.stationIntroducePcitureUrl) {
obj.pictureUrlList.push(this.form.stationIntroducePcitureUrl);
}
if (this.imgtwo != this.form.stationPictureUrl) {
obj.pictureUrlList.push(this.form.stationPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.open = false;
this.reset();
},
//
reset() {
this.nurseStationType2 = [];
this.form = {
id: null,
areaCode: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
stationIntroducePcitureUrl: null,
sort: null,
nurseStationLabelList: [],
streetCode: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
liststationinfo() {
listStation(this.queryParams).then((response) => {
this.stationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleQuery() {
this.loading = true;
this.queryParams.pageNum = 1;
this.liststationinfo();
},
/** 重置按钮操作 */
resetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.queryParams = {
pageNum: 1,
pageSize: 10,
areaCode: null,
userId: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
sort: null,
};
this.resetForm("queryForm");
this.handleQuery();
} else {
// console.log(1);
this.queryParams.pageSize = 10;
this.queryParams.pageNum = 1;
this.queryParams.nurseStationCode = null;
this.handleQuery();
}
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.looknurseStationLabel = [
{
labelDescription: "",
sort: "",
ids: 1,
},
];
this.title = "添加护理站信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.loading = true;
const id = row.id || this.ids;
getStation(id).then((response) => {
this.form = response.data;
this.form.streetCode = this.form.streetName;
this.imgone = this.form.stationIntroducePcitureUrl;
this.imgtwo = this.form.stationPictureUrl;
this.looknurseStationLabel = response.data.nurseStationLabel;
this.open = true;
this.loading = false;
console.log(this.form);
});
},
/** 提交按钮 */
submitForm() {
this.form.nurseStationLabelList = this.looknurseStationLabel;
this.form.nurseStationType = this.nurseStationType2;
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.areaCode = Number(this.form.areaCode);
this.form.nurseStationType = this.nurseStationType2.join(",");
if (this.form.id != null) {
updateStation(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.stationIntroducePcitureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (this.imgtwo != this.form.stationPictureUrl) {
obj.pictureUrlList.push(this.imgtwo);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStation(this.form).then((response) => {
if (response.code) {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
} else {
this.form.nurseStationType = obj;
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除此护理站信息?")
.then(function () {
return delStation(ids);
})
.then(() => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.stationIntroducePcitureUrl);
obj.pictureUrlList.push(row.stationPictureUrl);
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/station/export",
{
...this.queryParams,
},
`station_${new Date().getTime()}.xlsx`
);
},
/** 导入按钮操作 */
handledata() {
this.upload.title = "护理站信息导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/station/downloadTemplate?fileType=nurseStation",
{},
`护理站信息导入模板.xlsx`
);
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
info() {
getListByUser(this.getListByUserquery).then((res) => {
if (res.rows[0].isAdmin == "1") {
this.nurseStationlist = res.rows;
this.total2 = res.total;
} else {
this.total2 = res.total;
this.nurseStationlist = res.rows;
this.queryParams.id = res.rows[0].id;
this.handleQuery();
}
});
},
//
loadMore() {
var a = Math.ceil(this.total2 / 10);
if (this.nurseStationlist.length + 1 >= this.total2) {
} else {
if (this.getListByUserquery.pageNum >= a) {
} else {
this.getListByUserquery.pageNum++;
console.log(this.getListByUserquery.pageNum);
getListByUser(this.getListByUserquery).then((res) => {
console.log(res);
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
},
};
import stationjs from "./stationjs";
export default stationjs;
</script>

View File

@ -0,0 +1,452 @@
import {
listStation,
getStation,
delStation,
addStation,
updateStation,
getFirstLevelInfo,
getSecondaryLevelInfo,
updatePicture,
} from "@/api/system/station";
import stationAcatar from "../stationAvatar/index.vue";
import { getListByUser } from "@/api/system/userlist.js";
import { getToken } from "@/utils/auth";
import editor from "@/components/Editor";
export default {
components: { stationAcatar, editor },
name: "Station",
data() {
var checkMobile = (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 (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)) {
return cb();
} else {
cb(new Error("请输入正确的联系电话"));
}
}
};
return {
imageUrl: "",
imageUrl2: "",
imgtwo: "",
imgone: "",
// 用户导入参数
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,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total2: 0,
//所属标签
looknurseStationLabel: [{
labelDescription: "",
sort: "",
ids: 1,
}, ],
// 护理站信息表格数据
stationList: [{
sysAreaVOList: [{
provinceName: null,
cityName: null,
streetName: null,
}, ],
}, ],
nurseStationlist: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
//权限查询
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
// 表单参数
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: "",
}, ],
dutyPhone: [{
validator: checkMobile2,
trigger: "blur",
message: "",
}, ],
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.getaddress();
this.info();
},
methods: {
imgUrl(imgUrl) {
this.form.stationPictureUrl = imgUrl;
},
imgUrl2(imgUrl) {
this.form.stationIntroducePcitureUrl = imgUrl;
},
delnurseStationLabelList(index, item) {
console.log(index, item);
console.log();
// this.looknurseStationLabel.splice(index,1)
if (this.looknurseStationLabel.length === 1) {
this.looknurseStationLabel = [{
labelDescription: "",
sort: "",
ids: 1,
}, ];
} else {
this.looknurseStationLabel.splice(index, 1);
}
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);
},
//点击街道
clickstreet(item) {
this.form.areaCode = item.areaCode;
console.log(item, this.form);
},
//点击区县城
clickarea(item) {
this.form.areaCode = "";
this.form.streetCode = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.streetlist = res.data;
});
},
//点击市
clickcity(item) {
this.form.regionName = "";
this.form.areaCode = "";
this.form.streetCode = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.arealist = res.data;
});
},
//点击省
province(item) {
this.form.cityName = "";
this.form.regionName = "";
this.form.areaCode = "";
this.form.streetCode = "";
getSecondaryLevelInfo(item.id).then((res) => {
this.citylist = res.data;
});
},
/** 获取省列表 */
getaddress() {
getFirstLevelInfo().then((res) => {
this.provincelist = res.data;
});
},
getList() {
this.info();
},
// 取消按钮
cancel() {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.stationIntroducePcitureUrl) {
obj.pictureUrlList.push(this.form.stationIntroducePcitureUrl);
}
if (this.imgtwo != this.form.stationPictureUrl) {
obj.pictureUrlList.push(this.form.stationPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.nurseStationType2 = [];
this.form = {
id: null,
areaCode: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
stationIntroducePcitureUrl: null,
sort: null,
nurseStationLabelList: [],
streetCode: null,
};
this.resetForm("form");
},
//护理站列表
info() {
this.loading = true
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.total2 = res.total;
this.loading = false
});
},
handleQuery() {
this.loading = true;
this.getListByUserquery.pageNum = 1;
this.info();
},
/** 重置按钮操作 */
resetQuery() {
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
areaCode: null,
userId: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
sort: null,
};
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.looknurseStationLabel = [{
labelDescription: "",
sort: "",
ids: 1,
}, ];
this.title = "添加护理站信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.loading = true;
const id = row.id || this.ids;
getStation(id).then((response) => {
this.form = response.data;
this.form.streetCode = this.form.streetName;
this.imgone = this.form.stationIntroducePcitureUrl;
this.imgtwo = this.form.stationPictureUrl;
this.looknurseStationLabel = response.data.nurseStationLabel;
this.open = true;
this.loading = false;
console.log(this.form);
});
},
/** 提交按钮 */
submitForm() {
this.form.nurseStationLabelList = this.looknurseStationLabel;
this.form.nurseStationType = this.nurseStationType2;
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.areaCode = Number(this.form.areaCode);
this.form.nurseStationType = this.nurseStationType2.join(",");
if (this.form.id != null) {
updateStation(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.stationIntroducePcitureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (this.imgtwo != this.form.stationPictureUrl) {
obj.pictureUrlList.push(this.imgtwo);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStation(this.form).then((response) => {
if (response.code) {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
} else {
this.form.nurseStationType = obj;
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除此护理站信息?")
.then(function() {
return delStation(ids);
})
.then(() => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.stationIntroducePcitureUrl);
obj.pictureUrlList.push(row.stationPictureUrl);
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/station/export", {
...this.getListByUserquery,
},
`station_${new Date().getTime()}.xlsx`
);
},
/** 导入按钮操作 */
handledata() {
this.upload.title = "护理站信息导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/station/downloadTemplate?fileType=nurseStation", {},
`护理站信息导入模板.xlsx`
);
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果", { dangerouslyUseHTMLString: true }
);
this.getList();
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
},
};

View File

@ -13,36 +13,9 @@
prop=""
v-if="nurseStationlist.find((e) => e.isAdmin == '1')"
>
<el-select
v-model="queryParams.nurseStationId"
clearable
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="护理站名称" prop="" v-else>
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
queryParams.nurseStationName
}}</el-button>
</el-form-item>
<el-form-item label="耗材包编号" prop="consumableCode">
<el-input
@ -52,10 +25,10 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="耗材包详情" prop="consumableDetail">
<el-form-item label="耗材包名称" prop="consumableDetail">
<el-input
v-model="queryParams.consumableDetail"
placeholder="请输入服务项目耗材包详情"
placeholder="请输入耗材包名称"
clearable
@keyup.enter.native="handleQuery"
/>
@ -133,6 +106,7 @@
icon="el-icon-upload2"
size="mini"
@click="handleport"
v-hasPermi="['system:stationConsumable:importStationConsumable']"
>导入</el-button
>
</el-col>
@ -160,7 +134,7 @@
prop="consumableCode"
/>
<el-table-column
label="耗材包详情"
label="耗材包名称"
align="center"
prop="consumableDetail"
/>
@ -236,10 +210,10 @@
{{ form.nurseStationName }}
</el-button>
</el-form-item>
<el-form-item label="耗材包详情" prop="consumableDetail">
<el-form-item label="耗材包名称" prop="consumableDetail">
<el-input
v-model="form.consumableDetail"
placeholder="请输入服务项目耗材包详情"
placeholder="请输入服务项目耗材包名称"
maxlength="100"
/>
</el-form-item>
@ -253,7 +227,7 @@
<el-form-item label="耗材包价格(元)" prop=" ">
<el-input
v-model="form.consumablePrice"
placeholder="请输入耗材包价格"
placeholder="请输入耗材包价格"
type="number"
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>7){value=value.slice(0,7)}"
min="0"
@ -274,7 +248,6 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 添加护理站耗材信息对话框 -->
<el-dialog
:title="title"
@ -326,13 +299,13 @@
</el-button>
</el-form-item>
<el-form-item
label="耗材包详情"
label="耗材包名称"
:rules="rules.nurseStationConsumables.consumableDetail"
:prop="`nurseStationConsumables.${index}.consumableDetail`"
>
<el-input
v-model="item.consumableDetail"
placeholder="请输入服务项目耗材包详情"
placeholder="请输入服务项目耗材包名称"
maxlength="50"
/>
</el-form-item>
@ -413,6 +386,15 @@
:inline="true"
label-width="90px"
>
<el-form-item label="护理站编码">
<el-input
style="width: 180px"
v-model="getListByUserquery.nurseStationCode"
placeholder="请输入护理站编码"
clearable
@keyup.enter.native="handleQuery2"
/>
</el-form-item>
<el-form-item label="护理站名称">
<el-input
style="width: 180px"
@ -422,15 +404,6 @@
@keyup.enter.native="handleQuery2"
/>
</el-form-item>
<el-form-item label="护理站编号">
<el-input
style="width: 180px"
v-model="getListByUserquery.nurseStationCode"
placeholder="请输入护理站编号"
clearable
@keyup.enter.native="handleQuery2"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@ -456,7 +429,7 @@
style="width: 15px; height: 15px"
circle
@click="clicknurseStation2(scope.row)"
v-if="form.nurseStationId == scope.row.id"
v-if="stationid == scope.row.id"
></el-button>
<el-button
style="width: 15px; height: 15px"
@ -466,19 +439,17 @@
></el-button>
</template>
</el-table-column>
<el-table-column
label="护理站编码"
align="center"
prop="nurseStationCode"
/>
<el-table-column
label="护理站名称"
align="center"
prop="nurseStationName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="护理站编号"
align="center"
prop="nurseStationCode"
/>
<el-table-column label="护理站经度" align="center" prop="longitude" />
<el-table-column label="护理站纬度" align="center" prop="latitude" />
<el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column
label="护理站地址"
@ -486,8 +457,6 @@
prop="address"
:show-overflow-tooltip="true"
/>
<el-table-column label="负责人" align="center" prop="dutyPerson" />
<el-table-column label="负责人电话" align="center" prop="dutyPhone" />
</el-table>
<pagination
@ -513,7 +482,6 @@
:inline="true"
label-width="90px"
>
<el-form-item label="护理站编码" prop="nurseStationCode">
<el-input
style="width: 180px"
@ -523,7 +491,7 @@
@keyup.enter.native="handleQuery2"
/>
</el-form-item>
<el-form-item label="护理站名称" prop="nurseStationName">
<el-form-item label="护理站名称" prop="nurseStationName">
<el-input
style="width: 180px"
v-model="getListByUserquery.nurseStationName"
@ -583,7 +551,6 @@
:show-overflow-tooltip="true"
/>
<el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column
label="护理站地址"
@ -591,7 +558,6 @@
prop="address"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
@ -643,480 +609,15 @@
</template>
<script>
import {
listStationConsumable,
getStationConsumable,
delStationConsumable,
addStationConsumable,
updateStationConsumable,
list,
} from "@/api/system/stationConsumable";
import { getListByUser } from "@/api/system/userlist.js";
import { getToken } from "@/utils/auth";
export default {
name: "StationConsumable",
data() {
return {
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
headers: { Authorization: "Bearer " + getToken() },
//
url:
process.env.VUE_APP_BASE_API + "/system/stationConsumable/importData",
},
value: "",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
total2: 0,
total3: 0,
//
stationConsumableList: [],
nurseStationlist: [],
nurseStationlist2: [],
//
title: "",
//
open: false,
open2: false,
open3: false,
xgopen: false,
index: "",
//
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
//
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
areaCode: null,
userId: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
sort: null,
},
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: "",
userId: null,
consumableCode: null,
consumableDetail: null,
consumableUnit: null,
consumablePrice: null,
sort: null,
},
//
form: {},
//
rules: {
nurseStationId: [
{
required: true,
message: "请选择所属护理站",
trigger: "blur",
},
],
consumableDetail: [
{
required: true,
message: "请输入耗材包详情",
trigger: "blur",
},
],
consumableUnit: [
{
required: true,
message: "请输入耗材包单位",
trigger: "blur",
},
],
consumablePrice: [
{
required: true,
message: "请输入耗材包价格",
trigger: "blur",
},
],
sort: [
{
required: true,
message: "请输入排序",
trigger: "blur",
},
],
nurseStationConsumables: {
consumableDetail: [
{
required: true,
message: "请输入耗材包详情",
trigger: "blur",
},
],
nurseStationId: [
{
required: true,
message: "请选择所属护理站",
trigger: "blur",
},
],
consumableUnit: [
{
required: true,
message: "请输入耗材包单位",
trigger: "blur",
},
],
consumablePrice: [
{
required: true,
message: "请输入耗材包价格",
trigger: "blur",
},
],
sort: [
{
required: true,
message: "请输入排序",
trigger: "blur",
},
],
},
},
};
},
created() {
this.getList();
this.info();
// this.listinfo();
},
methods: {
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/stationItem/downloadTemplate?fileType=2",
{},
`护理站耗材信息导入模板.xlsx`
);
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
delnurseStationConsumables(index) {
this.form.nurseStationConsumables.splice(index, 1);
console.log(this.form.nurseStationConsumables);
},
addnurseStationConsumables() {
var obj = {
nurseStationId: "",
consumableUnit: null,
sort: "",
consumablePrice: "",
consumableDetail: null,
nurseStationName: "请选择所属护理站",
};
if (this.form.nurseStationConsumables.length == 5) {
this.$message.error("最多只能5条");
} else {
this.form.nurseStationConsumables.push(obj);
}
},
choicenurseStation(item, index) {
console.log(item);
this.index = index;
this.open2 = true;
},
//
clicknurseStation2(item) {
this.form.nurseStationId = item.id;
this.form.nurseStationName = item.nurseStationName;
this.open3 = false;
this.reset2();
},
clicknurseStation(item) {
console.log(item);
console.log(this.index);
console.log(this.form);
this.form.nurseStationConsumables[this.index].nurseStationId = item.id;
this.form.nurseStationConsumables[this.index].nurseStationName =
item.nurseStationName;
this.open2 = false;
this.reset2();
},
/** 查询护理站耗材信息列表 */
getList() {
this.loading = true;
this.listStationConsumableinfo();
},
//
cancel() {
this.open = false;
this.xgopen = false;
this.nurseStationName = "请选择所属护理站";
this.reset();
},
cancel2() {
this.open2 = false;
this.open3 = false;
this.reset2();
},
//
reset2() {
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
areaCode: null,
userId: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
sort: null,
};
},
reset() {
this.form = {
id: null,
consumablePrice: null,
sort: null,
nurseStationId: "",
nurseStationConsumables: [
{
nurseStationId: "",
consumableUnit: null,
sort: "",
consumablePrice: "",
consumableDetail: null,
nurseStationName: "请选择所属护理站",
},
],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
listStationConsumableinfo() {
listStationConsumable(this.queryParams).then((response) => {
this.stationConsumableList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleQuery() {
this.loading = true;
this.queryParams.pageNum = 1;
this.listStationConsumableinfo();
},
//
// listinfo() {
// list(this.nurseStationqueryParams).then((res) => {
// this.nurseStationlist2 = res.rows;
// console.log(this.nurseStationlist2);
// this.total2 = res.total;
// });
// },
//
handleQuery2() {
this.getListByUserquery.pageNum = 1;
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.total3 = res.total;
});
},
/** 重置按钮操作 */
sresetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: "",
userId: null,
consumableCode: null,
consumableDetail: null,
consumableUnit: null,
consumablePrice: null,
sort: null,
};
this.handleQuery();
} else {
this.queryParams.pageNum = 1;
this.queryParams.consumableCode = null;
this.queryParams.consumableDetail = null;
this.queryParams.consumableUnit = null;
this.queryParams.consumablePrice = null;
this.handleQuery();
}
},
//
resetQuery() {
this.reset2();
this.handleQuery2();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加护理站耗材信息";
this.cancel2();
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids;
getStationConsumable(id).then((response) => {
this.form = response.data;
this.xgopen = true;
this.title = "修改护理站耗材信息";
this.loading = false;
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateStationConsumable(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.xgopen = false;
this.getList();
});
} else {
addStationConsumable(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.nurseStationName = "请选择所属护理站";
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除?")
.then(function () {
return delStationConsumable(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/stationConsumable/export",
{
...this.queryParams,
},
`stationConsumable_${new Date().getTime()}.xlsx`
);
},
/** 导入按钮操作 */
handleport() {
this.upload.title = "护理站耗材导入";
this.upload.open = true;
},
//
info() {
getListByUser(this.getListByUserquery).then((res) => {
console.log(res);
if (res.rows[0].isAdmin == "1") {
console.log(true);
this.nurseStationlist = res.rows;
this.total3 = res.total;
} else {
this.total3 = res.total;
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.handleQuery();
}
});
},
loadMore() {
console.log(1);
var a = Math.ceil(this.total3 / 10);
if (this.nurseStationlist.length + 1 >= this.total3) {
} else {
if (this.getListByUserquery.pageNum >= a) {
} else {
this.getListByUserquery.pageNum++;
getListByUser(this.getListByUserquery).then((res) => {
console.log(res);
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
},
};
import indexjs from "./indexjs.js";
export default indexjs;
</script>
<style lang="scss" scoped>
.stationbtn {
width: 208px;
text-align: left;
height: 32px;
overflow: hidden;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,411 @@
import {
listStationConsumable,
getStationConsumable,
delStationConsumable,
addStationConsumable,
updateStationConsumable,
list,
} from "@/api/system/stationConsumable";
import { getListByUser } from "@/api/system/userlist.js";
import { getToken } from "@/utils/auth";
export default {
name: "StationConsumable",
data() {
return {
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/stationConsumable/importData",
},
value: "",
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
total2: 0,
total3: 0,
// 护理站耗材信息表格数据
stationConsumableList: [],
nurseStationlist: [],
nurseStationlist2: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
open2: false,
open3: false,
xgopen: false,
index: "",
//权限查询
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
// 查询参数
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
areaCode: null,
userId: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
sort: null,
},
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
nurseStationName: null,
userId: null,
consumableCode: null,
consumableDetail: null,
consumableUnit: null,
consumablePrice: null,
sort: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
nurseStationId: [{
required: true,
message: "请选择所属护理站",
trigger: "blur",
}, ],
consumableDetail: [{
required: true,
message: "请输入耗材包名称",
trigger: "blur",
}, ],
consumableUnit: [{
required: true,
message: "请输入耗材包单位",
trigger: "blur",
}, ],
consumablePrice: [{
required: true,
message: "请输入耗材包价格",
trigger: "blur",
}, ],
sort: [{
required: true,
message: "请输入排序",
trigger: "blur",
}, ],
nurseStationConsumables: {
consumableDetail: [{
required: true,
message: "请输入耗材包名称",
trigger: "blur",
}, ],
nurseStationId: [{
required: true,
message: "请选择所属护理站",
trigger: "blur",
}, ],
consumableUnit: [{
required: true,
message: "请输入耗材包单位",
trigger: "blur",
}, ],
consumablePrice: [{
required: true,
message: "请输入耗材包价格",
trigger: "blur",
}, ],
sort: [{
required: true,
message: "请输入排序",
trigger: "blur",
}, ],
},
},
homenumber: null,
stationid: null,
};
},
created() {
this.getList();
// this.listinfo();
},
methods: {
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/stationItem/downloadTemplate?fileType=2", {},
`护理站耗材信息导入模板.xlsx`
);
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果", { dangerouslyUseHTMLString: true }
);
this.getList();
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
delnurseStationConsumables(index) {
this.form.nurseStationConsumables.splice(index, 1);
},
addnurseStationConsumables() {
var obj = {
nurseStationId: "",
consumableUnit: null,
sort: "",
consumablePrice: "",
consumableDetail: null,
nurseStationName: "请选择所属护理站",
};
if (this.form.nurseStationConsumables.length == 5) {
this.$message.error("最多只能5条");
} else {
this.form.nurseStationConsumables.push(obj);
}
},
choicenurseStation(item, index) {
this.index = index;
this.open2 = true;
this.info();
},
//页面所属护理站
ParamsStation(item) {
console.log(this.queryParams)
this.open3 = true
this.homenumber = item
this.stationid = this.queryParams.nurseStationId;
},
//点击护理站左侧按钮
clicknurseStation2(item) {
this.queryParams.nurseStationName = item.nurseStationName
this.queryParams.nurseStationId = item.id
this.form.nurseStationId = item.id;
this.form.nurseStationName = item.nurseStationName;
this.open3 = false;
this.reset2();
},
clicknurseStation(item) {
this.form.nurseStationConsumables[this.index].nurseStationId = item.id;
this.form.nurseStationConsumables[this.index].nurseStationName =
item.nurseStationName;
this.open2 = false;
this.reset2();
},
/** 查询护理站耗材信息列表 */
getList() {
this.loading = true;
this.listStationConsumableinfo();
},
// 取消按钮
cancel() {
this.open = false;
this.xgopen = false;
this.nurseStationName = "请选择所属护理站";
this.reset();
},
cancel2() {
this.open2 = false;
this.open3 = false;
this.reset2();
},
// 表单重置
reset2() {
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
areaCode: null,
userId: null,
nurseStationCode: null,
nurseStationName: null,
nurseStationType: null,
agencyIntroduce: null,
nurseStationDescription: null,
longitude: null,
latitude: null,
phone: null,
address: null,
dutyPerson: null,
dutyPhone: null,
stationPictureUrl: null,
sort: null,
};
},
reset() {
this.form = {
id: null,
consumablePrice: null,
sort: null,
nurseStationId: "",
nurseStationConsumables: [{
nurseStationId: "",
consumableUnit: null,
sort: "",
consumablePrice: "",
consumableDetail: null,
nurseStationName: "请选择所属护理站",
}, ],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
listStationConsumableinfo() {
listStationConsumable(this.queryParams).then((response) => {
this.stationConsumableList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleQuery() {
this.loading = true;
this.queryParams.pageNum = 1;
this.listStationConsumableinfo();
},
//护理站搜索
handleQuery2() {
this.getListByUserquery.pageNum = 1;
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.total3 = res.total;
});
},
/** 重置按钮操作 */
sresetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
userId: null,
consumableCode: null,
consumableDetail: null,
consumableUnit: null,
consumablePrice: null,
sort: null,
};
this.handleQuery();
},
//护理站重置
resetQuery() {
this.reset2();
this.handleQuery2();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加护理站耗材信息";
this.cancel2();
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids;
getStationConsumable(id).then((response) => {
this.form = response.data;
this.xgopen = true;
this.title = "修改护理站耗材信息";
this.loading = false;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateStationConsumable(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.xgopen = false;
this.getList();
});
} else {
addStationConsumable(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.nurseStationName = "请选择所属护理站";
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除?")
.then(function() {
return delStationConsumable(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/stationConsumable/export", {
...this.queryParams,
},
`stationConsumable_${new Date().getTime()}.xlsx`
);
},
/** 导入按钮操作 */
handleport() {
this.upload.title = "护理站耗材导入";
this.upload.open = true;
},
//护理站列表
info() {
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.total3 = res.total;
});
},
},
};

View File

@ -12,45 +12,11 @@
label="护理站名称"
prop="nurseStationId"
label-width="100px"
v-if="nurseStationlist.find((e) => e.isAdmin == '1')"
>
<el-select
v-model="queryParams.nurseStationId"
clearable
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
queryParams.nurseStationName
}}</el-button>
</el-form-item>
<el-form-item
label="所属护理站"
prop="nurseStationId"
label-width="100px"
v-else
>
<el-select
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
v-loadmore="loadMore"
>
<el-option
v-for="item in nurseStationlist"
:key="item.id"
:label="item.nurseStationName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="护理项目编号" prop="nurseItemCode">
<el-input
v-model="queryParams.nurseItemCode"
@ -123,6 +89,7 @@
icon="el-icon-upload2"
size="mini"
@click="handleExport"
v-hasPermi="['system:stationItem:importStationItem']"
>导入</el-button
>
</el-col>
@ -231,12 +198,11 @@
label-width="130px"
:inline="true"
>
<!-- prop="nurseStationItem.nurseStationId" -->
<el-form-item label="所属护理站" required>
<el-form-item label="所属护理站" required v-if="addxg == 'add'">
<template>
<el-button
type=""
@click="nurseStationshow = true"
@click="nurseStationshowclick"
style="
width: 208px;
text-align: left;
@ -251,7 +217,7 @@
>
<el-button
type=""
@click="nurseStationshow = true"
@click="nurseStationshowclick"
v-else
style="
width: 208px;
@ -266,6 +232,24 @@
>
</template>
</el-form-item>
<el-form-item label="所属护理站" required v-else>
<template>
<el-button
type=""
disabled
style="
width: 208px;
text-align: left;
height: 36px;
padding-left: -10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>{{ form.nurseStationItem.nurseStationName }}</el-button
>
</template>
</el-form-item>
<el-form-item
label="护理项目名称"
prop="nurseStationItem.nurseItemName"
@ -343,6 +327,7 @@
v-model="scope.row.price"
placeholder="小数点后两位(元)"
type="number"
min="0"
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>6){value=value.slice(0,6)}"
></el-input>
</template>
@ -373,7 +358,6 @@
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="护理项目耗材">
<el-button
type="primary"
@ -406,6 +390,7 @@
<el-input
v-model="scope.row.consumableCount"
placeholder="不可输入小数点"
min="0"
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+0)} if(value.length>10){value=value.slice(0,10)}"
type="number"
></el-input>
@ -478,7 +463,7 @@
type="primary"
icon="el-icon-search"
size="mini"
@click="stationlist"
@click="info"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="stationcancel"
@ -498,7 +483,7 @@
style="width: 15px; height: 15px"
circle
@click="choicestationid(scope.row)"
v-if="form.nurseStationItem.nurseStationId == scope.row.id"
v-if="stationid == scope.row.id"
></el-button>
<el-button
@ -538,7 +523,7 @@
:total="total4"
:page.sync="getListByUserquery.pageNum"
:limit.sync="getListByUserquery.pageSize"
@pagination="stationlist"
@pagination="info"
/>
</el-dialog>
<!-- 耗材弹框 -->
@ -555,10 +540,10 @@
label-width="110px"
:inline="true"
>
<el-form-item label="耗材包详情" prop="nurseStationId">
<el-form-item label="耗材包名称" prop="nurseStationId">
<el-input
v-model="StationConsumablequeryParams.consumableDetail"
placeholder="请输入耗材包详情"
placeholder="请输入耗材包名称"
/>
</el-form-item>
<el-form-item>
@ -595,7 +580,6 @@
)
"
></el-button>
<el-button
style="width: 15px; height: 15px"
circle
@ -615,7 +599,7 @@
prop="consumableCode"
/>
<el-table-column
label="服务项目耗材包详情"
label="耗材包名称"
align="center"
prop="consumableDetail"
/>
@ -690,560 +674,9 @@
</el-dialog>
</div>
</template>
<script>
import { listStationConsumable } from "@/api/system/stationConsumable";
import stationAcatar from "../stationAvatar/index.vue";
import {
list,
getNurseItem,
delNurseItem,
addNurseItem,
updateNurseItem,
getInfoList,
liststation,
updatePicture,
} from "@/api/system/nurseItem";
import { getToken } from "@/utils/auth";
import { getListByUser } from "@/api/system/userlist.js";
export default {
components: { stationAcatar },
name: "NurseItem",
data() {
return {
imageUrl: "",
imgone: "",
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/system/stationItem/importData",
},
//
loading: true,
stationConsumableshow: false,
nurseStationshow: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
total2: 0,
total3: 0,
total4: 0,
//
stationConsumableList: [],
//
nurseItemList: [],
//
typelist: [],
//
title: "",
//
open: false,
//
nurseStationlist: [],
nurseStationlist2: [],
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
nurseTypeId: null,
userId: null,
nurseItemCode: null,
nurseItemName: null,
nurseItemContent: null,
advanceAppointDuration: null,
sort: null,
},
//
StationConsumablequeryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
consumableDetail: null,
},
//
form: {
nurseStationItem: {
nurseStationId: null,
nurseTypeId: null,
nurseItemName: "",
nurseItemContent: "",
advanceAppointDuration: "",
itemPictureUrl: "",
sort: "",
nurseStationName: "请选择所属护理站",
},
},
ids: 1,
//
rules: {
"nurseStationItem.nurseItemName": [
{ required: true, message: "护理项目名称不能为空", trigger: "blur" },
],
"nurseStationItem.nurseItemContent": [
{ required: true, message: "项目内容简介不能为空", trigger: "blur" },
],
"nurseStationItem.sort": [
{ required: true, message: "排序不能为空", trigger: "blur" },
],
"nurseStationItem.advanceAppointDuration": [
{ required: true, message: "提前预约时长不能为空", trigger: "blur" },
],
"nurseStationItem.itemPictureUrl": [
{
required: true,
trigger: "blur",
message: "请选择项目头像",
},
],
nurseStationId: [
{ required: true, trigger: "blur", message: "请选择所属护理站" },
],
nurseTypeId: [
{ required: true, message: "请选择护理类型", trigger: "blur" },
],
},
};
},
created() {
this.getList();
this.info();
this.getInfoListinfo();
// this.stationlist();
// this.listStationConsumableinfo();
},
methods: {
imgUrl(imgUrl) {
console.log(imgUrl);
this.form.nurseStationItem.itemPictureUrl = imgUrl;
},
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/stationItem/downloadTemplate?fileType=1",
{},
`护理站项目信息导入模板.xlsx`
);
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
stationConsumablechoiceok() {
this.form.nurseStationItemConsumables.forEach((e) => {
e.nurseStationConsumableId = e.id;
});
this.stationConsumableshow = false;
},
//
delConsumable(item) {
this.form.nurseStationItemConsumables =
this.form.nurseStationItemConsumables.filter((e) => e.id != item.id);
},
//
cellchoiceConsumable(item) {
if (this.form.nurseStationItemConsumables.find((e) => e.id == item.id)) {
console.log(1);
this.form.nurseStationItemConsumables =
this.form.nurseStationItemConsumables.filter((e) => e.id != item.id);
} else {
console.log(2);
this.form.nurseStationItemConsumables.push(item);
}
console.log(this.form.nurseStationItemConsumables);
},
//
choiceConsumable(item) {
console.log(item);
this.form.nurseStationItemConsumables.push(item);
console.log(this.form.nurseStationItemConsumables);
},
//
choicestationid(item) {
this.form.nurseStationItem.nurseStationId = item.id;
// this.form.nurseStationId = item.id;
this.form.nurseStationItem.nurseStationName = item.nurseStationName;
this.StationConsumablequeryParams.nurseStationId = item.id;
// console.log(item);
this.nurseStationshow = false;
this.stationcancel();
},
//
clicknurseStationshow() {
this.stationcancel();
this.nurseStationshow = false;
},
//
clickstationConsumableshow() {
this.listStationConsumableinfocancel();
this.stationConsumableshow = false;
},
//
listStationConsumableinfocancel() {
this.StationConsumablequeryParams.consumableDetail = null;
this.StationConsumablequeryParams.pageNum = 1;
this.StationConsumablequeryParams.pageSize = 10;
this.listStationConsumable();
},
//
stationcancel() {
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
};
this.stationlist();
},
//
stationlist() {
getListByUser(this.getListByUserquery).then((res) => {
this.total4 = res.total;
this.nurseStationlist = res.rows;
});
},
//
getInfoListinfo() {
getInfoList().then((res) => {
this.typelist = res.data;
});
},
/** 耗材列表 */
listStationConsumable() {
listStationConsumable(this.StationConsumablequeryParams).then(
(response) => {
this.stationConsumableList = response.rows;
this.total3 = response.total;
}
);
},
listStationConsumableinfo() {
if (this.form.nurseStationItem.nurseStationId != null) {
listStationConsumable(this.StationConsumablequeryParams).then(
(response) => {
this.stationConsumableList = response.rows;
this.total3 = response.total;
this.stationConsumableshow = true;
}
);
} else {
this.$message.error("请先选择护理站");
}
},
/** 查询护理站护理项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
response.rows.forEach((e) => {
this.typelist.forEach((el) => {
if (e.nurseTypeId == el.id) {
e.nurseTypeName = el.nurseTypeName;
}
});
});
this.nurseItemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
console.log(this.form.nurseStationItem);
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
obj.pictureUrlList.push(this.form.nurseStationItem.itemPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.open = false;
this.reset();
},
//
addnurseStationItemPrices(item, index) {
if (this.form.nurseStationItemPrices.length == 5) {
this.$message.error("最多只能5条");
} else {
this.ids++;
var obj = {
serveDurationUnit: "",
price: "",
description: "",
ids: this.ids,
};
this.form.nurseStationItemPrices.push(obj);
}
},
delnurseStationItemPrices(item) {
if (item.ids && !item.id) {
if (this.form.nurseStationItemPrices.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.form.nurseStationItemPrices =
this.form.nurseStationItemPrices.filter((e) => e.ids != item.ids);
}
} else if (!item.ids && item.id) {
if (this.form.nurseStationItemPrices.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.form.nurseStationItemPrices =
this.form.nurseStationItemPrices.filter((e) => e.id != item.id);
}
}
},
//
reset() {
this.form = {
nurseStationItem: {
nurseStationId: null,
nurseTypeId: null,
nurseItemName: null,
nurseItemContent: null,
advanceAppointDuration: null,
itemPictureUrl: null,
sort: null,
nurseStationName: "请选择所属护理站",
},
nurseStationItemConsumables: [
// {
// nurseStationConsumableId: "",
// consumableCount: "",
// consumablePrice: "",
// },
],
nurseStationItemPrices: [
{
serveDurationUnit: null,
price: null,
description: null,
ids: this.ids,
},
],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
if (this.nurseStationlist[0].isAdmin == "1") {
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
nurseTypeId: null,
userId: null,
nurseItemCode: null,
nurseItemName: null,
nurseItemContent: null,
advanceAppointDuration: null,
sort: null,
};
this.handleQuery();
} else {
this.queryParams.pageNum = 1;
this.queryParams.nurseTypeId = null;
this.queryParams.nurseItemCode = null;
this.queryParams.nurseItemName = null;
this.handleQuery();
}
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.StationConsumablequeryParams.nurseStationId = null;
this.title = "添加护理站护理项目";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.StationConsumablequeryParams.nurseStationId = null;
const id = row.id || this.ids;
getNurseItem(id).then((response) => {
console.log(response);
this.form = response.data;
this.StationConsumablequeryParams.nurseStationId =
response.data.nurseStationItem.nurseStationId;
this.imgone = this.form.nurseStationItem.itemPictureUrl;
if (this.form.nurseStationItemPrices == []) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
ids: this.ids,
};
this.form.nurseStationItemPrices.push(obj);
} else if (this.form.nurseStationItemPrices.length == 0) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
ids: this.ids,
};
this.form.nurseStationItemPrices.push(obj);
} else if (this.form.nurseStationItemPrices == null) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
ids: this.ids,
};
this.form.nurseStationItemPrices.push(obj);
}
this.open = true;
this.title = "修改护理站护理项目";
});
},
/** 提交按钮 */
submitForm() {
this.form.nurseStationItemConsumables.forEach((e) => {
e.nurseStationConsumableId = e.id;
});
this.form.nurseStationItem.nurseTypeId = this.form.nurseTypeId;
// this.form.nurseStationItem.nurseStationId = this.form.nurseStationId;
console.log(this.form);
this.$refs["form"].validate((valid) => {
console.log(valid);
if (valid) {
if (this.form.nurseStationItem.id != null) {
updateNurseItem(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {
console.log(res);
});
}
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNurseItem(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.$forceUpdate();
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除此护理站护理项目?")
.then(function () {
return delNurseItem(ids);
})
.then(() => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.nurseStationItem.itemPictureUrl);
updatePicture(obj).then((res) => {
console.log(res);
});
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导入按钮操作 */
handleExport() {
this.upload.title = "护理站护理项目导入";
this.upload.open = true;
},
//
info() {
getListByUser(this.getListByUserquery).then((res) => {
console.log(res);
if (res.rows[0].isAdmin == "1") {
console.log(true);
this.nurseStationlist = res.rows;
this.total4 = res.total;
} else {
this.total4 = res.total;
this.nurseStationlist = res.rows;
this.queryParams.nurseStationId = res.rows[0].id;
this.handleQuery();
}
});
},
loadMore() {
var a = Math.ceil(this.total4 / 10);
if (this.nurseStationlist.length + 1 >= this.total4s) {
} else {
if (this.getListByUserquery.pageNum >= a) {
} else {
this.getListByUserquery.pageNum++;
getListByUser(this.getListByUserquery).then((res) => {
res.rows.forEach((e) => {
this.nurseStationlist.push(e);
});
});
}
}
},
},
};
import stationItemjs from "./stationItemjs";
export default stationItemjs;
</script>
<style lang="scss" scoped>
::v-deep .el-table__cell .el-form-item--medium .el-form-item__content {
@ -1275,4 +708,11 @@ export default {
height: 178px;
display: block;
}
.stationbtn {
width: 208px;
text-align: left;
height: 32px;
overflow: hidden;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,506 @@
import { listStationConsumable } from "@/api/system/stationConsumable";
import stationAcatar from "../stationAvatar/index.vue";
import {
list,
getNurseItem,
delNurseItem,
addNurseItem,
updateNurseItem,
updatePicture,
} from "@/api/system/nurseItem";
import { getToken } from "@/utils/auth";
import { getListByUser } from "@/api/system/userlist.js";
export default {
components: { stationAcatar },
name: "NurseItem",
data() {
return {
imageUrl: "",
imgone: "",
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/stationItem/importData",
},
// 遮罩层
loading: true,
stationConsumableshow: false,
nurseStationshow: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
total2: 0,
total3: 0,
total4: 0,
//耗材
stationConsumableList: [],
// 护理站护理项目表格数据
nurseItemList: [],
//护理站类型表
typelist: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
//权限查询
nurseStationlist: [],
nurseStationlist2: [],
getListByUserquery: {
pageNum: 1,
pageSize: 10,
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
nurseTypeId: null,
userId: null,
nurseItemCode: null,
nurseItemName: null,
nurseItemContent: null,
advanceAppointDuration: null,
sort: null,
},
// 查询参数
StationConsumablequeryParams: {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
consumableDetail: null,
},
// 表单参数
form: {
nurseStationItem: {
nurseStationId: null,
nurseTypeId: null,
nurseItemName: "",
nurseItemContent: "",
advanceAppointDuration: "",
itemPictureUrl: "",
sort: "",
nurseStationName: "请选择所属护理站",
},
},
ids: 1,
// 表单校验
rules: {
"nurseStationItem.nurseItemName": [
{ required: true, message: "护理项目名称不能为空", trigger: "blur" },
],
"nurseStationItem.nurseItemContent": [
{ required: true, message: "项目内容简介不能为空", trigger: "blur" },
],
"nurseStationItem.sort": [
{ required: true, message: "排序不能为空", trigger: "blur" },
],
"nurseStationItem.advanceAppointDuration": [
{ required: true, message: "提前预约时长不能为空", trigger: "blur" },
],
"nurseStationItem.itemPictureUrl": [{
required: true,
trigger: "blur",
message: "请选择项目头像",
}, ],
nurseStationId: [
{ required: true, trigger: "blur", message: "请选择所属护理站" },
],
nurseTypeId: [
{ required: true, message: "请选择护理类型", trigger: "blur" },
],
},
homenumber: null,
stationid: null,
addxg: null,
};
},
created() {
this.getList();
},
methods: {
imgUrl(imgUrl) {
this.form.nurseStationItem.itemPictureUrl = imgUrl;
},
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/stationItem/downloadTemplate?fileType=1", {},
`护理站项目信息导入模板.xlsx`
);
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果", { dangerouslyUseHTMLString: true }
);
this.getList();
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//耗材包选择完成
stationConsumablechoiceok() {
this.form.nurseStationItemConsumables.forEach((e) => {
e.nurseStationConsumableId = e.id;
});
this.stationConsumableshow = false;
},
//删除已经选择的耗材包
delConsumable(item) {
this.form.nurseStationItemConsumables =
this.form.nurseStationItemConsumables.filter((e) => e.id != item.id);
},
//双击耗材包
cellchoiceConsumable(item) {
if (this.form.nurseStationItemConsumables.find((e) => e.id == item.id)) {
this.form.nurseStationItemConsumables =
this.form.nurseStationItemConsumables.filter((e) => e.id != item.id);
} else {
this.form.nurseStationItemConsumables.push(item);
}
},
//选择耗材宝
choiceConsumable(item) {
this.form.nurseStationItemConsumables.push(item);
},
//页面所属护理站
ParamsStation(item) {
this.info();
this.nurseStationshow = true
this.homenumber = item
this.stationid = this.queryParams.nurseStationId;
},
//打开护理站列表
nurseStationshowclick() {
this.stationcancel();
this.stationid = this.form.nurseStationItem.nurseStationId
this.nurseStationshow = true
},
//护理站页面选择护理站
choicestationid(item) {
if (this.homenumber) {
this.queryParams.nurseStationName = item.nurseStationName;
this.queryParams.nurseStationId = item.id;
} else {
this.stationid = item.id
this.form.nurseStationItem.nurseStationId = item.id;
this.form.nurseStationItem.nurseStationName = item.nurseStationName;
this.StationConsumablequeryParams.nurseStationId = item.id;
}
this.nurseStationshow = false;
this.stationcancel();
},
//关闭护理站页面
clicknurseStationshow() {
this.nurseStationshow = false;
},
//耗材包关闭
clickstationConsumableshow() {
this.listStationConsumableinfocancel();
this.stationConsumableshow = false;
},
// 耗材重置
listStationConsumableinfocancel() {
this.StationConsumablequeryParams.consumableDetail = null;
this.StationConsumablequeryParams.pageNum = 1;
this.StationConsumablequeryParams.pageSize = 10;
this.listStationConsumable();
},
//护理站重置
stationcancel() {
this.getListByUserquery = {
pageNum: 1,
pageSize: 10,
};
this.info();
},
/** 耗材列表 */
listStationConsumable() {
listStationConsumable(this.StationConsumablequeryParams).then(
(response) => {
this.stationConsumableList = response.rows;
this.total3 = response.total;
}
);
},
listStationConsumableinfo() {
if (this.form.nurseStationItem.nurseStationId != null) {
listStationConsumable(this.StationConsumablequeryParams).then(
(response) => {
this.stationConsumableList = response.rows;
this.total3 = response.total;
this.stationConsumableshow = true;
}
);
} else {
this.$message.error("请先选择护理站");
}
},
/** 查询护理站护理项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.nurseItemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//护理站list
info() {
getListByUser(this.getListByUserquery).then((res) => {
this.nurseStationlist = res.rows;
this.total4 = res.total;
});
},
// 取消按钮
cancel() {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
obj.pictureUrlList.push(this.form.nurseStationItem.itemPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
this.open = false;
this.reset();
},
//时长价格
addnurseStationItemPrices(item, index) {
if (this.form.nurseStationItemPrices.length == 5) {
this.$message.error("最多只能5条");
} else {
this.ids++;
var obj = {
serveDurationUnit: "",
price: "",
description: "",
ids: this.ids,
};
this.form.nurseStationItemPrices.push(obj);
}
},
delnurseStationItemPrices(item) {
if (item.ids && !item.nurseItemPriceId) {
if (this.form.nurseStationItemPrices.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.form.nurseStationItemPrices =
this.form.nurseStationItemPrices.filter((e) => e.ids != item.ids);
}
} else if (!item.ids && item.nurseItemPriceId) {
if (this.form.nurseStationItemPrices.length == 1) {
this.$message.error("最后一条不可删除");
} else {
this.form.nurseStationItemPrices =
this.form.nurseStationItemPrices.filter(
(e) => e.nurseItemPriceId != item.nurseItemPriceId
);
}
}
},
// 表单重置
reset() {
this.form = {
nurseStationItem: {
nurseStationId: null,
nurseTypeId: null,
nurseItemName: null,
nurseItemContent: null,
advanceAppointDuration: null,
itemPictureUrl: null,
sort: null,
nurseStationName: "请选择所属护理站",
},
nurseStationItemConsumables: [
// {
// nurseStationConsumableId: "",
// consumableCount: "",
// consumablePrice: "",
// },
],
nurseStationItemPrices: [{
serveDurationUnit: null,
price: null,
description: null,
ids: this.ids,
}, ],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
nurseStationId: null,
nurseTypeId: null,
userId: null,
nurseItemCode: null,
nurseItemName: null,
nurseItemContent: null,
advanceAppointDuration: null,
sort: null,
};
this.stationid = null
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.addxg = 'add'
this.homenumber = null;
this.reset();
this.open = true;
this.StationConsumablequeryParams.nurseStationId = null;
this.title = "添加护理站护理项目";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.addxg = 'xg';
this.homenumber = null;
this.reset();
this.StationConsumablequeryParams.nurseStationId = null;
const id = row.id || this.ids;
getNurseItem(id).then((response) => {
if (response.data.nurseStationItemConsumables) {
response.data.nurseStationItemConsumables.forEach(e => {
e.id = e.nurseStationConsumableId
})
} else {
response.data.nurseStationItemConsumables = []
}
this.form = response.data;
this.StationConsumablequeryParams.nurseStationId =
response.data.nurseStationItem.nurseStationId;
this.imgone = this.form.nurseStationItem.itemPictureUrl;
if (this.form.nurseStationItemPrices == []) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
ids: this.ids,
};
this.form.nurseStationItemPrices.push(obj);
} else if (this.form.nurseStationItemPrices.length == 0) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
ids: this.ids,
};
this.form.nurseStationItemPrices.push(obj);
} else if (this.form.nurseStationItemPrices == null) {
var obj = {
serveDurationUnit: "",
price: "",
description: "",
ids: this.ids,
};
this.form.nurseStationItemPrices.push(obj);
}
console.log(this.form)
this.open = true;
this.title = "修改护理站护理项目";
});
},
/** 提交按钮 */
submitForm() {
this.form.nurseStationItemConsumables.forEach((e) => {
e.nurseStationConsumableId = e.id;
});
this.form.nurseStationItem.nurseTypeId = this.form.nurseTypeId;
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.nurseStationItem.id != null) {
this.form.nurseStationItemPrices.forEach((e) => {
e.nurseStationItemId = this.form.nurseStationItem.id;
});
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
}
updateNurseItem(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNurseItem(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.$forceUpdate();
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
var that = this;
this.$modal
.confirm("是否确认删除此护理站护理项目?")
.then(function() {
delNurseItem(ids).then(res => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.itemPictureUrl);
updatePicture(obj).then((res) => {});
that.getList();
that.$modal.msgSuccess("删除成功");
})
})
.catch(() => {});
},
/** 导入按钮操作 */
handleExport() {
this.upload.title = "护理站护理项目导入";
this.upload.open = true;
},
},
};