NurseStationOperateUI/src/views/system/order/indexjs.js

337 lines
10 KiB
JavaScript
Raw Normal View History

2022-11-17 16:48:25 +08:00
import {
appointmentOrderDetailsList,
Detailed,
deldetailed,
getPerson,
dispatchsubmit,
xylWeChatRefundNotify,
appointmentOrderDetails,
} from "@/api/system/order";
import { getListByUser } from "@/api/system/userlist.js";
2022-11-18 12:50:42 +08:00
import baseurl from '@/api/baseurl.js'
2022-11-17 16:48:25 +08:00
export default {
name: "order",
data() {
return {
2022-11-18 12:50:42 +08:00
baseurl: null,
2022-11-17 16:48:25 +08:00
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();
2022-11-18 12:50:42 +08:00
this.baseurl = baseurl
2022-11-17 16:48:25 +08:00
},
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`
);
},
},
};