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

725 lines
20 KiB
Vue
Raw Normal View History

2022-10-31 08:57:36 +08:00
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="订单编号" prop="orderNo">
<el-input
v-model="queryParams.orderNo"
placeholder="请输入订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="收货人" prop="receiver">
<el-input
v-model="queryParams.receiver"
placeholder="请输入收货人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
2022-11-02 15:48:04 +08:00
<el-form-item label="订单状态" prop="orderStatus">
<el-select
v-model="queryParams.orderStatus"
placeholder="请选择订单状态"
>
<el-option
v-for="item in orderStatuslist"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
2022-10-31 08:57:36 +08:00
</el-form-item>
<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>
<el-table
v-loading="loading"
:data="goodsOrderList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="订单编号" align="center" prop="orderNo" />
<el-table-column label="订单状态" align="center" prop="orderStatus">
<template slot-scope="scope">
{{ scope.row.orderStatus == "WAIT_PAY" ? "待付款" : "" }}
{{ scope.row.orderStatus == "PAY" ? "已付款" : "" }}
{{ scope.row.orderStatus == "CANCEL" ? "已取消" : "" }}
2022-11-02 15:48:04 +08:00
{{ scope.row.orderStatus == "WAIT_RECEIVED_GOODS" ? "待收货" : "" }}
{{ scope.row.orderStatus == "RECEIVED_GOODS" ? "已收货" : "" }}
{{ scope.row.orderStatus == "WAIT_REFUND" ? "退款中" : "" }}
2022-10-31 08:57:36 +08:00
{{ scope.row.orderStatus == "REFUNDED" ? "已退款" : "" }}
2022-11-02 15:48:04 +08:00
{{ scope.row.orderStatus == "WAIT_RETURNED_GOODS" ? "待退货" : "" }}
{{ scope.row.orderStatus == "RETURNED_GOODS" ? "已退货" : "" }}
2022-10-31 08:57:36 +08:00
</template>
</el-table-column>
<el-table-column label="订单总金额" align="center" prop="totalPrice" />
<el-table-column label="收货人" align="center" prop="receiver" />
<el-table-column label="收货地址" align="center" prop="receiveAddress" />
<el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column
label="下单时间"
align="center"
prop="orderTime"
width="180"
/>
2022-11-02 15:48:04 +08:00
<el-table-column label="下单方式" align="center" prop="orderChannel">
<template slot-scope="scope">
2022-10-31 08:57:36 +08:00
{{ scope.row.orderChannel == "MOBILE_APP" ? "手机APP" : "" }}
{{ scope.row.orderChannel == "WECHAT_APPLET" ? "微信小程序" : "" }}
{{ scope.row.orderChannel == "ALI_PAY_APPLET" ? "支付宝" : "" }}
</template>
</el-table-column>
<el-table-column label="备注信息" align="center" prop="remark" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
2022-11-02 15:48:04 +08:00
<el-button
2022-10-31 08:57:36 +08:00
size="mini"
type="text"
icon="el-icon-edit"
@click="seeOrder(scope.row)"
v-hasPermi="['system:nurseType:edit']"
2022-11-02 15:48:04 +08:00
>查看商品信息</el-button
>
<el-button
v-if="scope.row.orderStatus == 'PAY'"
size="mini"
type="text"
icon="el-icon-edit"
@click="seelogistics(scope.row.id)"
v-hasPermi="['system:nurseType:edit']"
>录入物流单号</el-button
>
<!-- <el-button
v-if="scope.row.orderStatus == 'WAIT_REFUND'"
size="mini"
type="text"
icon="el-icon-edit"
@click="refund(scope.row.id)"
v-hasPermi="['system:nurseType:edit']"
>确认退款</el-button
> -->
<el-button
v-if="scope.row.orderStatus == 'WAIT_REFUND'"
size="mini"
type="text"
icon="el-icon-edit"
@click="refund(scope.row.id)"
v-hasPermi="['system:nurseType:edit']"
>确认退款</el-button
2022-10-31 08:57:36 +08:00
>
2022-11-02 15:48:04 +08:00
<!-- <el-button
v-else
size="mini"
type="text"
icon="el-icon-edit"
@click="seelogistics(scope.row)"
v-hasPermi="['system:nurseType:edit']"
>确认退款</el-button
> -->
2022-10-31 08:57:36 +08:00
<!-- <el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:goodsOrder:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:goodsOrder: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-02 15:48:04 +08:00
<!-- 查看商品信息弹框 -->
2022-10-31 08:57:36 +08:00
<el-dialog
title="查看订单信息"
:visible.sync="innerorder"
append-to-body
width="1048px"
>
2022-11-02 15:48:04 +08:00
<el-table
:data="orderList"
align="center"
style="margin: 10px 0 20px 0; padding-bottom: 20px"
>
<el-table-column
prop="orderNo"
label="订单编号"
width="120"
align="center"
>
</el-table-column>
<el-table-column
prop="receiveAddress"
label="地址"
width="120"
align="center"
>
</el-table-column>
<el-table-column
prop="receiver"
label="收货人"
width="120"
align="center"
>
</el-table-column>
<el-table-column prop="phone" label="手机号" width="120" align="center">
</el-table-column>
<el-table-column
prop="goodsName"
label="商品名称"
width="120"
align="center"
>
</el-table-column>
<el-table-column
prop="goodsAttributeName"
label="商品属性"
width="120"
align="center"
>
</el-table-column>
<el-table-column
prop="goodsPrice"
label="商品价格"
width="120"
align="center"
>
</el-table-column>
</el-table>
2022-10-31 08:57:36 +08:00
</el-dialog>
2022-11-02 15:48:04 +08:00
<!-- 查看物流信息弹框 -->
<el-dialog
title="查看物流信息"
:visible.sync="innerlogistics"
append-to-body
width="500px"
style="margin-top: 10%"
>
<el-form
:model="queryexpressNo"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="物流单号" prop="orderNo">
2022-10-31 08:57:36 +08:00
<el-input
2022-11-02 15:48:04 +08:00
v-model="queryexpressNo.expressNo"
placeholder="请输入物流单号"
clearable
@keyup.enter.native="handleQuery"
2022-10-31 08:57:36 +08:00
/>
</el-form-item>
2022-11-02 15:48:04 +08:00
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="searchlogistics()"
>确认</el-button
>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="cencellogistics"
>取消</el-button
>
2022-10-31 08:57:36 +08:00
</el-form-item>
2022-11-02 15:48:04 +08:00
</el-form>
</el-dialog>
<!-- 退款弹框 -->
<el-dialog
title="退款信息"
:visible.sync="innerrefund"
append-to-body
width="700px"
style="margin-top: 10%"
>
<el-form
:model="refundlist"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="110px"
>
<el-form-item label="商品名称" prop="goodsName">
<el-input
v-model="refundlist.goodsName"
placeholder=""
clearable
@keyup.enter.native="handleQuery"
disabled
/>
2022-10-31 08:57:36 +08:00
</el-form-item>
2022-11-02 15:48:04 +08:00
<el-form-item label="退款类型" prop="refundType">
2022-10-31 08:57:36 +08:00
<el-input
2022-11-02 15:48:04 +08:00
:value="refundTypeStatus(refundlist.refundType)"
disabled
style="width: 205px"
2022-10-31 08:57:36 +08:00
/>
2022-11-02 15:48:04 +08:00
<!-- <el-input
v-model="refundlist.refundType"
placeholder=""
clearable
@keyup.enter.native="handleQuery"
/> -->
2022-10-31 08:57:36 +08:00
</el-form-item>
2022-11-02 15:48:04 +08:00
<el-form-item label="退款原因" prop="dictLabel">
<el-input
v-model="refundlist.dictLabel"
placeholder=""
clearable
@keyup.enter.native="handleQuery"
disabled
/>
2022-10-31 08:57:36 +08:00
</el-form-item>
2022-11-02 15:48:04 +08:00
<el-form-item label="退款金额" prop="godTotalPrice">
<el-input
v-model="refundlist.godTotalPrice"
placeholder=""
2022-10-31 08:57:36 +08:00
clearable
2022-11-02 15:48:04 +08:00
@keyup.enter.native="handleQuery"
disabled
/>
2022-10-31 08:57:36 +08:00
</el-form-item>
<el-form-item
2022-11-02 15:48:04 +08:00
label="补充描述和凭证"
prop="refundReasonRemark"
label-width="110px"
2022-10-31 08:57:36 +08:00
>
<el-input
2022-11-02 15:48:04 +08:00
v-model="refundlist.refundReasonRemark"
placeholder=""
clearable
@keyup.enter.native="handleQuery"
type="textarea"
:rows="2"
disabled
2022-10-31 08:57:36 +08:00
/>
2022-11-02 15:48:04 +08:00
<!-- <textarea cols="50" rows="10" v-model="refundlist.refundReasonRemark">
</textarea> -->
<!-- <editor
:min-height="70"
style="width: 90%; margin: 0 auto"
v-model="refundlist.refundReasonRemark"
></editor> -->
2022-10-31 08:57:36 +08:00
</el-form-item>
2022-11-02 15:48:04 +08:00
<el-form-item>
<!--
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="searchlogistics()"
>确认</el-button
>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="cencellogistics"
>取消</el-button
> -->
2022-10-31 08:57:36 +08:00
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
2022-11-02 15:48:04 +08:00
<el-button @click="refundcancel"> </el-button>
2022-10-31 08:57:36 +08:00
<el-button type="primary" @click="submitForm"> </el-button>
</div>
2022-11-02 15:48:04 +08:00
</el-dialog>
<!-- 查看物流详细信息弹框 -->
<!-- <el-dialog
title="查看订单信息"
:visible.sync="innerlogisticsinfo"
append-to-body
width="1048px"
>
<el-table
:data="orderList"
align="center"
style="margin: 10px 0 20px 0; padding-bottom: 20px"
>
<el-table-column
prop="orderNo"
label="订单编号"
width="120"
align="center"
>
</el-table-column>
<el-table-column
prop="receiver"
label="收货人"
width="120"
align="center"
>
</el-table-column>
<el-table-column prop="phone" label="手机号" width="120" align="center">
</el-table-column>
<el-table-column
prop="goodsName"
label="商品名称"
width="120"
align="center"
>
</el-table-column>
<el-table-column
prop="goodsAttributeName"
label="商品属性"
width="120"
align="center"
>
</el-table-column>
<el-table-column
prop="goodsPrice"
label="商品价格"
width="120"
align="center"
>
</el-table-column>
</el-table>
2022-10-31 08:57:36 +08:00
</el-dialog> -->
</div>
</template>
<script>
2022-11-02 15:48:04 +08:00
import { listGoodsOrder, getGoodsOrder, delGoodsOrder, addGoodsOrder, updateGoodsOrder, getGoodsOrderlist, goodsOrderRefundinfo, editExpressNo, goodsOrderrefund } from "@/api/system/goodsOrder";
2022-10-31 08:57:36 +08:00
export default {
name: "GoodsOrder",
data() {
return {
2022-11-02 15:48:04 +08:00
// 查看商品信息
innerorder: false,
// 查看物流信息
innerlogistics: false,
// 确认退款
innerrefund: false,
orderList: [],
refundlist: [],
orderStatuslist: [
{
value: "WAIT_PAY",
label: "待付款",
},
{
value: "PAY",
label: "已付款",
},
{
value: "CANCEL",
label: "已取消",
},
{
value: "WAIT_RECEIVED_GOODS",
label: "待收货",
},
{
value: "RECEIVED_GOODS",
label: "已收货",
},
{
value: "WAIT_REFUND",
label: "退款中",
},
{
value: "REFUNDED",
label: "已退款",
},
{
value: "WAIT_RETURNED_GOODS",
label: "待退货",
},
{
value: "RETURNED_GOODS",
label: "已退货",
},
],
2022-10-31 08:57:36 +08:00
// 遮罩层
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,
},
2022-11-02 15:48:04 +08:00
queryexpressNo: {
id: "",
expressNo: null,
},
refundinfo: {
id: "",
},
2022-10-31 08:57:36 +08:00
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
2022-11-02 15:48:04 +08:00
// 退款类型
// refundTypeStatus(refundlist.refundType)
refundTypeStatus(refundType) {
switch (refundType) {
case "REFUND_MONEY_GOODS":
return "退款退货";
case "ONLY_REFUND_MONEY":
return "仅退款";
default:
break;
}
},
2022-10-31 08:57:36 +08:00
/** 查询商品订单列表 */
getList() {
this.loading = true;
listGoodsOrder(this.queryParams).then(response => {
this.goodsOrderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
2022-11-02 15:48:04 +08:00
// 查看商品信息
seeOrder(row) {
2022-10-31 08:57:36 +08:00
console.log(row);
2022-11-02 15:48:04 +08:00
this.innerorder = true
2022-10-31 08:57:36 +08:00
const id = row.orderNo;
2022-11-02 15:48:04 +08:00
getGoodsOrderlist(id).then(res => {
this.orderList = [res.data]
})
},
// 查看录入物流单号弹框
seelogistics(id) {
// console.log(id);
this.queryexpressNo.id = id
console.log(this.queryexpressNo)
this.innerlogistics = true
},
// 确定按钮
searchlogistics() {
console.log(this.queryexpressNo)
editExpressNo(this.queryexpressNo).then(res => {
this.queryexpressNo.expressNo = ""
this.innerlogistics = false
console.log(res)
2022-10-31 08:57:36 +08:00
})
},
// 取消按钮
2022-11-02 15:48:04 +08:00
cencellogistics() {
this.innerlogistics = false
this.queryexpressNo.expressNo = ""
},
// 确认退款
refund(id) {
console.log(id);
this.innerrefund = true
goodsOrderRefundinfo(id).then(res => {
this.refundlist = res.data;
console.log(this.refundlist)
})
},
// 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: '已取消退款'
// });
// });
// },
// 取消按钮
2022-10-31 08:57:36 +08:00
cancel() {
this.open = false;
this.reset();
},
2022-11-02 15:48:04 +08:00
//退款取消按钮
refundcancel() {
this.innerrefund = false
},
2022-10-31 08:57:36 +08:00
// 表单重置
reset() {
this.form = {
id: null,
nurseStationId: null,
patientId: null,
orderNo: null,
orderStatus: "0",
totalPrice: null,
receiver: null,
receiveAddress: null,
phone: null,
orderTime: null,
orderChannel: null,
remark: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
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.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`)
}
}
};
</script>