|
|
@@ -11,7 +11,27 @@
|
|
|
<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"
|
|
|
+ icon="el-icon-position"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ >处理
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-finished"
|
|
|
+ @click=""
|
|
|
+ >历史订单
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-more"
|
|
|
+ @click=""
|
|
|
+ >处理记录
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -24,25 +44,101 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
|
|
|
- <!-- 添加或修改医生会员搭销对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="企业外部联系人id" prop="exId">
|
|
|
- <el-input v-model="form.exId" placeholder="请输入企业外部联系人id" />
|
|
|
+ <!-- 修改医生会员搭销对话框 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="open"
|
|
|
+ width="40%"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
+ <!-- 处理类型选择 -->
|
|
|
+ <el-form-item label="处理方式" prop="handleType">
|
|
|
+ <el-radio-group v-model="form.handleType" @change="onProcessTypeChange">
|
|
|
+ <el-radio label=1>签收</el-radio>
|
|
|
+ <el-radio label=2>设置提醒时间</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="会员id" prop="fsUserId">
|
|
|
- <el-input v-model="form.fsUserId" placeholder="请输入会员id" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="销售id" prop="companyUserId">
|
|
|
- <el-input v-model="form.companyUserId" placeholder="请输入销售id" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="销售公司" prop="companyId">
|
|
|
- <el-input v-model="form.companyId" placeholder="请输入销售公司" />
|
|
|
+
|
|
|
+ <!-- 签收模式:订单选择 -->
|
|
|
+ <div v-if="form.handleType == 1">
|
|
|
+ <el-form-item label="订单号搜索">
|
|
|
+ <el-input
|
|
|
+ v-model="orderSearchKeyword"
|
|
|
+ placeholder="请输入订单号"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="searchOrders"
|
|
|
+ @clear="searchOrders"
|
|
|
+ style="width: 300px"
|
|
|
+ >
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="searchOrders" />
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <!-- 选择订单 -->
|
|
|
+ <el-form-item label="选择订单">
|
|
|
+ <el-table
|
|
|
+ :data="orderList"
|
|
|
+ height="200"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ highlight-current-row
|
|
|
+ @row-click="(row) => form.selectedOrderNo = row.orderCode"
|
|
|
+ :row-key="row => row.orderId"
|
|
|
+ >
|
|
|
+ <!-- 手动单选列 - 优化:只显示单选按钮,隐藏文本 -->
|
|
|
+ <el-table-column label="选择" width="60" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-radio
|
|
|
+ v-model="form.selectedOrderNo"
|
|
|
+ :label="scope.row.orderCode"
|
|
|
+ :key="scope.row.orderCode"
|
|
|
+ @change="() => {}"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="orderCode" label="订单号" width="160" />
|
|
|
+ <el-table-column prop="createTime" label="创建时间" width="100" />
|
|
|
+ <el-table-column prop="packageName" label="商品" width="100" />
|
|
|
+ <el-table-column prop="status" label="状态" />
|
|
|
+ </el-table>
|
|
|
+ <!-- 添加加载状态指示 -->
|
|
|
+ <div v-if="orderLoading" style="text-align: center; padding: 10px;">
|
|
|
+ <i class="el-icon-loading"></i> 加载中...
|
|
|
+ </div>
|
|
|
+ <!-- 显示无数据或搜索无结果 -->
|
|
|
+ <div v-if="!orderList.length && orderSearched && !orderLoading" style="text-align: center; color: #999; margin-top: 10px;">
|
|
|
+ {{ orderSearchKeyword ? '未找到相关订单' : '暂无订单数据' }}
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 设置提醒时间模式 -->
|
|
|
+ <el-form-item
|
|
|
+ v-if="form.handleType == 2"
|
|
|
+ label="提醒天数"
|
|
|
+ prop="sendDays"
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ v-model="form.sendDays"
|
|
|
+ :min="1"
|
|
|
+ :max="99"
|
|
|
+ placeholder="请输入天数"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="医生id" prop="doctorId">
|
|
|
- <el-input v-model="form.doctorId" placeholder="请输入医生id" />
|
|
|
+
|
|
|
+ <!-- 公共:处理结果 -->
|
|
|
+ <el-form-item label="处理结果" prop="remark">
|
|
|
+ <el-input
|
|
|
+ v-model="form.remark"
|
|
|
+ type="textarea"
|
|
|
+ :rows="4"
|
|
|
+ placeholder="请输入处理结果说明"
|
|
|
+ />
|
|
|
</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>
|
|
|
@@ -52,15 +148,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { taskList,} from "@/api/his/doctorTask";
|
|
|
+import { taskList, submitDoctorTask, getNoReceiveOrderList } from "@/api/his/doctorTask";
|
|
|
|
|
|
export default {
|
|
|
name: "unprocessed",
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
userName: null,
|
|
|
phone: null,
|
|
|
+ fsUserId: null, // 保存用户ID
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 导出遮罩层
|
|
|
@@ -88,17 +184,39 @@ export default {
|
|
|
status: null,
|
|
|
},
|
|
|
// 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
+ form: {
|
|
|
+ id: null,
|
|
|
+ handleType: 1,
|
|
|
+ sendDays: null, // 改名
|
|
|
+ remark: '',
|
|
|
+ selectedOrderNo: '',
|
|
|
+ doctorMemberSalesId: null
|
|
|
+ },
|
|
|
+
|
|
|
+ // 订单相关
|
|
|
+ orderSearchKeyword: '',
|
|
|
+ orderList: [],
|
|
|
+ selectedOrder: null,
|
|
|
+ orderSearched: false,
|
|
|
+ orderLoading: false, // 添加加载状态
|
|
|
+
|
|
|
+ // 表单校验规则(可选增强)
|
|
|
rules: {
|
|
|
+ handleType: [{ required: true, message: '请选择处理方式', trigger: 'change' }],
|
|
|
+ sendDays: [ // 校验规则改名
|
|
|
+ { required: true, message: '请输入提醒天数', trigger: 'blur' },
|
|
|
+ { type: 'number', min: 1, max: 99, message: '天数必须在 1 到 99 之间', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ remark: [{ required: true, message: '请输入处理结果', trigger: 'blur' }]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.queryParams.status= this.$route.query.status;
|
|
|
+ this.queryParams.status = this.$route.query.status;
|
|
|
this.queryParams.doctorMemberSalesId = this.$route.query.id;
|
|
|
this.userName = this.$route.query.userName;
|
|
|
this.phone = this.$route.query.phone;
|
|
|
+ this.fsUserId = this.$route.query.fsUserId;
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -120,15 +238,16 @@ export default {
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
- exId: null,
|
|
|
- fsUserId: null,
|
|
|
- createTime: null,
|
|
|
- updateTime: null,
|
|
|
- companyUserId: null,
|
|
|
- companyId: null,
|
|
|
- doctorId: null
|
|
|
+ handleType: 1,
|
|
|
+ sendDays: null, // 改名
|
|
|
+ remark: '',
|
|
|
+ selectedOrderNo: '',
|
|
|
+ doctorMemberSalesId: null
|
|
|
};
|
|
|
- this.resetForm("form");
|
|
|
+ this.orderSearchKeyword = '';
|
|
|
+ this.orderList = [];
|
|
|
+ this.orderSearched = false;
|
|
|
+ this.orderLoading = false; // 重置加载状态
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
@@ -143,59 +262,140 @@ export default {
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
+ this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
-
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.id != null) {
|
|
|
- updateMemberSales(this.form).then(response => {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addMemberSales(this.form).then(response => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
this.$confirm('是否确认删除医生会员搭销编号为"' + ids + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delMemberSales(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function () {
|
|
|
+ // return delMemberSales(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ }).catch(() => { });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
const queryParams = this.queryParams;
|
|
|
this.$confirm('是否确认导出所有医生会员搭销数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- this.exportLoading = true;
|
|
|
- return exportMemberSales(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- this.exportLoading = false;
|
|
|
- }).catch(() => {});
|
|
|
- }
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ // return exportMemberSales(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ // this.download(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ }).catch(() => { });
|
|
|
+ },
|
|
|
+ /** 打开修改对话框 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.form = {
|
|
|
+ id: row.id,
|
|
|
+ handleType: 1,
|
|
|
+ sendDays: null,
|
|
|
+ remark: '',
|
|
|
+ selectedOrderNo: '',
|
|
|
+ doctorMemberSalesId: row.doctorMemberSalesId
|
|
|
+ };
|
|
|
+
|
|
|
+ this.orderSearchKeyword = '';
|
|
|
+ this.orderList = [];
|
|
|
+ this.selectedOrder = null;
|
|
|
+ this.orderSearched = false;
|
|
|
+ this.orderLoading = false; // 确保打开对话框时加载状态为 false
|
|
|
+ // 默认加载该用户的未签收订单
|
|
|
+ this.searchOrders();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "处理医生会员搭销";
|
|
|
+ },
|
|
|
+ /** 切换处理类型时重置相关字段 */
|
|
|
+ onProcessTypeChange(val) {
|
|
|
+ if (val == 1) {
|
|
|
+ this.form.sendDays = null; // 改名
|
|
|
+ this.form.selectedOrderNo = '';
|
|
|
+ // 切换到签收时,重新加载订单列表
|
|
|
+ this.searchOrders();
|
|
|
+ } else if (val == 2) {
|
|
|
+ this.form.selectedOrderNo = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 搜索订单(调用真实接口) */
|
|
|
+ searchOrders() {
|
|
|
+ // 构建搜索参数,可能包含关键字
|
|
|
+ const keyword = this.orderSearchKeyword.trim();
|
|
|
+ // 设置加载状态
|
|
|
+ this.orderLoading = true;
|
|
|
+ this.orderSearched = true; // 标记已执行过搜索操作
|
|
|
+ console.log("当前会员id:"+this.fsUserId)
|
|
|
+ // 调用API
|
|
|
+ getNoReceiveOrderList(this.fsUserId) // 使用实例上的 fsUserId
|
|
|
+ .then(response => {
|
|
|
+ let orders = response.data || []; // 获取订单列表
|
|
|
+
|
|
|
+ // 如果有搜索关键词,则在前端进行过滤
|
|
|
+ if (keyword) {
|
|
|
+ orders = orders.filter(item => item.orderCode && item.orderCode.includes(keyword));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 更新订单列表
|
|
|
+ this.orderList = orders;
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error('获取订单列表失败:', error);
|
|
|
+ this.$message.error('获取订单列表失败,请稍后重试');
|
|
|
+ this.orderList = []; // 出错时清空列表
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ // 无论成功与否,都要关闭加载状态
|
|
|
+ this.orderLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 提交处理 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (!valid) return;
|
|
|
+
|
|
|
+ const submitData = {
|
|
|
+ id: this.form.id,
|
|
|
+ handleType: Number(this.form.handleType),
|
|
|
+ remark: this.form.remark,
|
|
|
+ doctorMemberSalesId: this.form.doctorMemberSalesId,
|
|
|
+ };
|
|
|
+
|
|
|
+ if (submitData.handleType === 1) {
|
|
|
+ if (!this.form.selectedOrderNo) {
|
|
|
+ this.$message.warning('请先选择一条订单');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ submitData.orderCode = this.form.selectedOrderNo;
|
|
|
+ } else if (submitData.handleType === 2) {
|
|
|
+ // 注意:这里校验的是 form.sendDays,因为 rules 是针对 form 的
|
|
|
+ if (this.form.sendDays === null || this.form.sendDays === undefined) {
|
|
|
+ this.$message.warning('请先填写提醒天数');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 提交时发送数字类型的 sendDays
|
|
|
+ submitData.sendDays = Number(this.form.sendDays);
|
|
|
+ }
|
|
|
+ submitDoctorTask(submitData).then(() => {
|
|
|
+ this.$message.success('提交成功');
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('提交失败');
|
|
|
+ });
|
|
|
+
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|