NurseStationUI/src/views/system/order/index.vue

741 lines
21 KiB
Vue
Raw Normal View History

<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
2022-09-28 14:29:43 +08:00
<el-form-item label="客户" prop="patientName" style="margin-left:-4%">
<el-input
2022-09-20 10:35:10 +08:00
v-model="queryParams.patientName"
placeholder="请输入客户"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
2022-09-20 10:35:10 +08:00
<el-form-item label="订单编号" prop="orderNo">
<el-input
2022-09-20 10:35:10 +08:00
v-model="queryParams.orderNo"
placeholder="请输入订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
2022-09-20 10:35:10 +08:00
<el-form-item label="订单状态" prop="orderStatus">
2022-09-20 10:35:10 +08:00
<el-select
v-model="queryParams.orderStatus"
2022-09-20 10:35:10 +08:00
placeholder="请选择订单状态"
>
<el-option
v-for="item in orderStatuslist"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
2022-09-20 10:35:10 +08:00
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
2022-09-28 14:29:43 +08:00
2022-09-20 10:35:10 +08:00
<el-table
v-loading="loading"
:data="OrderDetailsList"
@selection-change="handleSelectionChange"
>
2022-11-07 17:45:48 +08:00
<el-table-column label="所属护理站" align="center" prop="nurseStationName" />
2022-11-08 14:44:07 +08:00
2022-11-07 17:45:48 +08:00
2022-11-04 14:00:14 +08:00
<el-table-column label="会员名称" align="center" prop="patientName" />
<el-table-column label="订单编号" align="center" prop="orderNo" />
2022-11-07 17:45:48 +08:00
<el-table-column label="护理项目名称" align="center" prop="nurseItemName" />
<el-table-column label="订单总金额" align="center" prop="totalPrice" />
<el-table-column label="订单状态" align="center" prop="orderStatus">
<template slot-scope="scope">
{{ scope.row.orderStatus == "WAIT_PAY" ? "待付款" : "" }}
{{ scope.row.orderStatus == "WAIT_DISPATCH" ? "待派单" : "" }}
{{ scope.row.orderStatus == "NOT_FINISH" ? "未完成" : "" }}
{{ scope.row.orderStatus == "COMPLETE" ? "服务完成" : "" }}
</template>
</el-table-column>
2022-11-04 14:00:14 +08:00
<el-table-column label="下单时间" align="center" prop="createTime" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
2022-11-04 17:42:19 +08:00
icon="el-icon-zoom-in"
@click="seeLook(scope.row)"
2022-11-08 13:36:52 +08:00
v-hasPermi="['system:appointmentOrder:query']"
>查看</el-button
>
2022-11-04 14:00:14 +08:00
<el-button
size="mini"
type="text"
2022-11-04 17:42:19 +08:00
icon="el-icon-s-promotion"
2022-11-04 14:00:14 +08:00
@click="dispatch(scope.row)"
2022-11-08 13:36:52 +08:00
v-hasPermi="['system:appointmentOrder:dispatch']"
2022-11-07 17:45:48 +08:00
v-if="scope.row.orderStatus=='WAIT_DISPATCH'"
2022-11-04 14:00:14 +08:00
>派单</el-button
>
<el-button
size="mini"
type="text"
2022-11-04 17:42:19 +08:00
icon="el-icon-error"
2022-11-04 14:00:14 +08:00
@click="cencel(scope.row.appointmentOrderId)"
2022-11-08 13:36:52 +08:00
v-hasPermi="['system:appointmentOrder:confirmCancel']"
2022-11-04 14:00:14 +08:00
>取消预约</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:nurseType:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
2022-11-04 10:09:39 +08:00
2022-11-04 14:00:14 +08:00
<!-- 查看弹框 -->
<el-dialog
title="查看订单信息"
2022-11-04 14:00:14 +08:00
:visible.sync="innerVisible4"
append-to-body
width="1048px"
2022-11-08 14:44:07 +08:00
>
<el-form
:inline="true"
ref="form"
:model="form"
:rules="rules"
label-width="120px"
2022-11-08 14:44:07 +08:00
class="orderInfo"
>
2022-11-04 10:09:39 +08:00
2022-09-20 10:35:10 +08:00
<div v-for="(item, index) in query" :key="index">
<el-form-item label="订单编号" prop="orderNo">
<el-input
v-model="item.orderNo"
:disabled="true"
style="width: 190px"
2022-09-20 10:35:10 +08:00
/>
</el-form-item>
<el-form-item label="订单状态" prop="orderStatus">
<el-input
:value="switchOrderStatus(item.orderStatus)"
disabled
style="width: 150px"
>
</el-input>
</el-form-item>
<el-form-item label="护理站名称" prop="nurseStationName">
<el-input
v-model="item.nurseStationName"
clearable
@keyup.enter.native="handleQuery"
:disabled="true"
style="width: 240px"
2022-09-20 10:35:10 +08:00
/>
</el-form-item>
<el-form-item label="订单数量" prop="orderCount">
<el-input
v-model="item.orderCount"
clearable
@keyup.enter.native="handleQuery"
:disabled="true"
style="width: 190px"
2022-09-20 10:35:10 +08:00
/>
</el-form-item>
2022-11-04 14:00:14 +08:00
2022-11-04 10:09:39 +08:00
<el-form-item label="护理项目名称" prop="nurseItemName">
2022-09-20 10:35:10 +08:00
<el-input
2022-11-04 10:09:39 +08:00
v-model="item.nurseItemName"
2022-09-20 10:35:10 +08:00
clearable
@keyup.enter.native="handleQuery"
:disabled="true"
style="width: 150px"
/>
</el-form-item>
2022-11-04 10:09:39 +08:00
<el-form-item label="服务时间" prop="time">
2022-09-20 10:35:10 +08:00
<el-input
2022-11-04 10:09:39 +08:00
v-model="item.time"
2022-09-20 10:35:10 +08:00
clearable
@keyup.enter.native="handleQuery"
:disabled="true"
style="width: 240px"
2022-09-20 10:35:10 +08:00
/>
</el-form-item>
2022-11-04 10:09:39 +08:00
<el-form-item label="护理项目时长" prop="itemServeDurationUnit">
2022-09-20 10:35:10 +08:00
<el-input
2022-11-04 10:09:39 +08:00
v-model="item.itemServeDurationUnit"
2022-09-20 10:35:10 +08:00
clearable
@keyup.enter.native="handleQuery"
:disabled="true"
style="width: 190px"
2022-09-20 10:35:10 +08:00
/>
</el-form-item>
2022-11-04 14:00:14 +08:00
2022-09-20 10:35:10 +08:00
<el-form-item label="护理项目价格" prop="nurseItemPrice">
<el-input
v-model="item.nurseItemPrice"
clearable
@keyup.enter.native="handleQuery"
:disabled="true"
style="width: 150px"
/>
</el-form-item>
2022-11-04 10:09:39 +08:00
<el-form-item label="服务地址" prop="serviceAddress">
2022-09-20 10:35:10 +08:00
<el-input
2022-11-04 10:09:39 +08:00
v-model="item.serviceAddress"
2022-09-20 10:35:10 +08:00
clearable
@keyup.enter.native="handleQuery"
:disabled="true"
style="width: 240px"
2022-09-20 10:35:10 +08:00
/>
</el-form-item>
<el-table
:data="item.appointmentOrderConsumableList"
align="center"
2022-09-20 10:35:10 +08:00
style="margin: 10px 0 20px 0; padding-bottom: 20px"
>
2022-09-20 10:35:10 +08:00
<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>
</el-table>
</div>
</el-form>
</el-dialog>
2022-11-04 14:00:14 +08:00
<!-- 派单弹框 -->
<el-dialog
title="派单"
:visible.sync="innerdispatch"
append-to-body
width="500px"
height="100px"
>
2022-11-04 17:42:19 +08:00
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
2022-11-04 14:00:14 +08:00
<el-form-item label="护理员姓名" prop="nursePersonName">
<el-button
type=""
v-if="nurseName == '请选择护理员'"
style="width: 200px; text-align: left; height: 36px; color: #c0c4cc"
@click="clicknursePersonName()"
>{{ nurseName }}</el-button
>
<el-button
type=""
@click="clicknursePersonName()"
v-else
style="
width: 362px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ nurseName }}</el-button
>
</el-form-item>
<!-- <el-button
type=""
@click="departclick(item, index)"
v-else
style="
width: 200px;
text-align: left;
height: 36px;
padding-left: -10px;
"
>{{ item.departmentName }}</el-button
> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<!-- <el-button @click="cancel"> </el-button> -->
</div>
</el-dialog>
<!-- 姓名弹框 -->
<el-dialog
:visible.sync="nursePersonNameinfo"
width="1000px"
append-to-body
>
<el-form
ref="queryForm"
2022-11-04 17:42:19 +08:00
:model="querynursePersonname"
2022-11-04 14:00:14 +08:00
:rules="rules"
label-width="80px"
:inline="true"
>
<el-form-item label="姓名" prop="nursePersonName" label-width="120">
<el-input
2022-11-04 17:42:19 +08:00
v-model="querynursePersonname.nursePersonName"
2022-11-04 14:00:14 +08:00
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
2022-11-04 17:42:19 +08:00
<!-- <el-form-item label="手机号" prop="phone" label-width="120">
2022-11-04 14:00:14 +08:00
<el-input
2022-11-04 17:42:19 +08:00
v-model="querynursePersonname.phone"
2022-11-04 14:00:14 +08:00
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
2022-11-04 17:42:19 +08:00
</el-form-item> -->
2022-11-04 14:00:14 +08:00
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery2"
>搜索</el-button
>
2022-11-04 17:42:19 +08:00
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery2"
2022-11-04 14:00:14 +08:00
>重置</el-button
>
</el-form-item>
</el-form>
<el-table :data="dispatchlist">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
2022-11-04 17:42:19 +08:00
type="primary"
2022-11-04 14:00:14 +08:00
style="width: 15px; height: 15px; overflow: hidden"
2022-11-04 17:42:19 +08:00
v-if="nursePersonid == scope.row.nurseStationPersonId"
2022-11-04 14:00:14 +08:00
circle
@click="nursePersonclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px; overflow: hidden"
circle
@click="nursePersonclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="nursePersonCode"
label="护理员编号"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="nursePersonName"
2022-11-04 17:42:19 +08:00
label="护理站人员姓名"
2022-11-04 14:00:14 +08:00
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="nursePersonType"
label="护理站人员类型"
width="150"
align="center"
>
<template slot-scope="scope">
{{ scope.row.nursePersonType == "NURSE" ? "护士" : "" }}
{{ scope.row.nursePersonType == "NURSE_TEACHER" ? "护理师" : "" }}
</template>
</el-table-column>
<el-table-column
property="phone"
label="手机号"
width="150"
align="center"
>
</el-table-column>
<el-table-column label="性别" align="center" prop="sex">
<template slot-scope="scope">
{{ scope.row.sex == "MALE" ? "男" : "" }}
{{ scope.row.sex == "FEMALE" ? "女" : "" }}
</template>
</el-table-column>
</el-table>
2022-11-04 17:42:19 +08:00
<pagination
2022-11-04 14:00:14 +08:00
v-show="total2 > 0"
:total="total2"
2022-11-04 17:42:19 +08:00
:page.sync="querynursePersonname.pageNum"
:limit.sync="querynursePersonname.pageSize"
2022-11-04 14:00:14 +08:00
@pagination="handleQuery2"
2022-11-04 17:42:19 +08:00
/>
2022-11-04 14:00:14 +08:00
</el-dialog>
</div>
</template>
<script>
2022-09-20 10:35:10 +08:00
import {
appointmentOrderDetailsList,
Detailed,
deldetailed,
2022-11-04 14:00:14 +08:00
getPerson,
dispatchsubmit,
confirmCancel
2022-09-20 10:35:10 +08:00
} from "@/api/system/order";
export default {
name: "order",
data() {
return {
2022-09-20 10:35:10 +08:00
orderStatuslist: [
{
value: "WAIT_PAY",
label: "待付款",
},
{
value: "WAIT_DISPATCH",
label: "待派单",
},
{
value: "NOT_FINISH",
label: "未完成",
},
{
value: "COMPLETE",
label: "服务完成",
},
],
value: "",
// 遮罩层
loading: true,
2022-11-04 14:00:14 +08:00
innerVisible4: false,
// 派单弹框
innerdispatch: false,
// 姓名弹框
nursePersonNameinfo: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
input: "",
// 总条数
total: 0,
// 护理类型信息表格数据
OrderDetailsList: [],
OrderDetailsLists: [],
2022-11-04 14:00:14 +08:00
dispatchlist: [],
nurseName: "请选择护理员",
nursePersonid: "",
2022-11-04 17:42:19 +08:00
// querynursecencel:{
// appointmentOrderId:"",
// },
appointmentOrderId:"",
nurseStationPersonId :"",
total2: 0,
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
open2: false,
// 查询参数
queryParams: {
patientName: null,
orderNo: null,
// orderStatus: null,
orderStatus: "",
pageNum: 1,
pageSize: 10,
},
2022-11-04 17:42:19 +08:00
// querynursePerson: {
// nursePersonName: null,
// phone: null,
// pageNum: 1,
// pageSize: 10,
// },
2022-11-04 14:00:14 +08:00
querynursePersonname: {
2022-11-04 17:42:19 +08:00
orderNo:"",
nursePersonName:null,
2022-11-04 14:00:14 +08:00
nursePersonType: null,
departmentName: null,
2022-11-04 17:42:19 +08:00
pageNum: 1,
pageSize: 10,
2022-11-08 14:44:07 +08:00
2022-11-04 17:42:19 +08:00
// detailsId: "",
// nursePersonName: null,
2022-11-08 14:44:07 +08:00
2022-11-04 14:00:14 +08:00
},
2022-09-20 10:35:10 +08:00
query: [],
// 表单参数
form: {},
// 表单校验
rules: {},
};
},
created() {
this.getList();
},
methods: {
2022-09-20 10:35:10 +08:00
switchOrderStatus(orderStatus) {
switch (orderStatus) {
case "WAIT_PAY":
return "待付款";
case "WAIT_DISPATCH":
return "待派单";
case "NOT_FINISH":
return "未完成";
case "COMPLETE":
return "服务完成";
default:
break;
}
},
2022-11-04 14:00:14 +08:00
// 查看
seeLook(row) {
2022-11-04 17:42:19 +08:00
this.innerVisible4 = true;
const id = row.orderNo;
2022-09-20 10:35:10 +08:00
// console.log(row);
Detailed(id).then((res) => {
2022-11-04 10:09:39 +08:00
res.data.forEach((e) => {
if (e.serviceDate) {
e.time =
e.serviceDate +
"-" +
e.serviceStartTime +
"-" +
2022-11-04 14:00:14 +08:00
e.serviceEndTime
2022-11-04 10:09:39 +08:00
}
} );
this.OrderDetailsLists = res.data;
2022-09-20 10:35:10 +08:00
this.query = res.data;
console.log(this.query);
});
},
2022-11-04 14:00:14 +08:00
// 派单
dispatch(row) {
console.log(row)
2022-11-04 17:42:19 +08:00
this.querynursePersonname.orderNo = row.orderNo
console.log(this.querynursePersonname.orderNo);
2022-11-04 14:00:14 +08:00
// console.log(row)
this.nurseName = "请选择护理员";
this.innerdispatch = true;
2022-11-04 17:42:19 +08:00
this.nursePersonid =""
2022-11-04 14:00:14 +08:00
},
// 姓名弹框
clicknursePersonName() {
// console.log(this.dispatchlist);
getPerson(this.querynursePersonname).then((res) => {
this.dispatchlist = res.rows;
2022-11-04 17:42:19 +08:00
this.total2 = res.total;
2022-11-04 14:00:14 +08:00
console.log(this.dispatchlist);
this.nursePersonNameinfo = true;
});
},
// 姓名弹框确定按钮
submitForm() {
2022-11-04 17:42:19 +08:00
// console.log(this.querynursePersonname)
// var obj = {}
// obj.nurseStationPersonId = nurseStationPersonId
// obj.orderNo = this.querynursePersonname.orderNo
let params={
nurseStationPersonId:this.nursePersonid,
orderNo:this.querynursePersonname.orderNo
}
dispatchsubmit(params).then((res) => {
if(res.code == 200){
this.$modal.msgSuccess("派单成功");
}
2022-11-04 14:00:14 +08:00
this.nurseName = "请选择护理员";
this.innerdispatch = false;
2022-11-04 17:42:19 +08:00
// this.nursePersonid =""
2022-11-04 14:00:14 +08:00
})
},
// 选择姓名按钮
nursePersonclick(row) {
2022-11-04 17:42:19 +08:00
this.nursePersonid = row.nurseStationPersonId
2022-11-04 14:00:14 +08:00
this.nurseName = row.nursePersonName
this.nursePersonNameinfo = false;
console.log(row)
},
2022-11-08 14:44:07 +08:00
2022-11-04 14:00:14 +08:00
// cencel(appointmentOrderId) {
// confirmCancel(appointmentOrderId).then((res) => {
// // this.nurseName="请选择护理员";
// // this.innerdispatch = false;
// })
// console.log(appointmentOrderId)
// },
2022-11-04 17:42:19 +08:00
// console.log(row.appointmentOrderId)
// this.appointmentOrderId = row.appointmentOrderId
// console.log('row :>> ', this.querynursecencel.appointmentOrderId);
2022-11-04 14:00:14 +08:00
// obj.appointmentOrderId=row.appointmentOrderId
2022-11-04 17:42:19 +08:00
// 确认取消预约
cencel(appointmentOrderId) {
2022-11-04 14:00:14 +08:00
this.$confirm(
'是否确认取消订单',
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
2022-11-04 17:42:19 +08:00
console.log(appointmentOrderId)
let params={
appointmentOrderId:appointmentOrderId
}
confirmCancel(params).then((res) => {
2022-11-04 14:00:14 +08:00
this.$message.success("取消成功");
2022-11-04 17:42:19 +08:00
// this.getList();
2022-11-04 14:00:14 +08:00
// console.log('this.OrderDetailsList :>> ', this.OrderDetailsList);
});
2022-11-08 14:44:07 +08:00
2022-11-04 14:00:14 +08:00
})
.catch(() => { });
2022-11-04 17:42:19 +08:00
},
/** 查询护理类型信息列表 */
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();
},
2022-11-04 14:00:14 +08:00
handleQuery2() {
2022-11-04 17:42:19 +08:00
getPerson(this.querynursePersonname).then((res) => {
this.dispatchlist = res.rows;
console.log(this.querynursePersonname);
// this.innerdispatch = true;
2022-11-04 14:00:14 +08:00
});
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
2022-11-04 17:42:19 +08:00
},
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) {
2022-09-26 11:37:58 +08:00
// console.log('row :>> ', row);
2022-11-04 14:00:14 +08:00
this.$confirm(
'是否确认删除订单信息的数据项?',
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
2022-09-26 11:37:58 +08:00
deldetailed(row.appointmentOrderId).then((res) => {
2022-09-20 10:35:10 +08:00
this.$message.success("删除成功");
this.getList();
2022-09-26 11:37:58 +08:00
// console.log('this.OrderDetailsList :>> ', this.OrderDetailsList);
});
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/nurseType/export",
{
...this.queryParams,
},
`nurseType_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style scoped>
2022-11-08 14:44:07 +08:00
::v-deep .orderInfo{
height: 350px;
overflow-y: scroll;
2022-11-08 14:44:07 +08:00
}
2022-09-26 11:37:58 +08:00
</style>