病案管理新增打回按钮和自动刷新
This commit is contained in:
@@ -61,3 +61,12 @@ export function updateSend(data) {
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 打回病案申请
|
||||
export function rejectnxexpress(data) {
|
||||
return request({
|
||||
url: '/system/nxexpress/reject',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -131,6 +131,15 @@
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:nxexpress:update']"
|
||||
>审核</el-button>
|
||||
<!-- 打回按钮(待审核状态) -->
|
||||
<el-button
|
||||
v-if="scope.row.status === 3"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-circle-close"
|
||||
@click="handleReject(scope.row)"
|
||||
v-hasPermi="['system:nxexpress:update']"
|
||||
>打回</el-button>
|
||||
<!-- 基于领取方式的操作按钮(已支付状态) -->
|
||||
<el-button
|
||||
v-if="scope.row.status === 2 && scope.row.send === 0"
|
||||
@@ -335,7 +344,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createnxexpress, updatenxexpress, deletenxexpress, getnxexpress, getnxexpressPage, exportnxexpressExcel,updateSend } from "@/api/system/nxexpress";
|
||||
import { createnxexpress, updatenxexpress, deletenxexpress, getnxexpress, getnxexpressPage, exportnxexpressExcel,updateSend, rejectnxexpress } from "@/api/system/nxexpress";
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
|
||||
export default {
|
||||
@@ -435,6 +444,20 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 开始自动刷新 */
|
||||
startAutoRefresh() {
|
||||
// 每10秒直接调用一次getList()方法
|
||||
this.autoRefreshTimer = setInterval(() => {
|
||||
this.getList();
|
||||
}, 10000);
|
||||
},
|
||||
/** 停止自动刷新 */
|
||||
stopAutoRefresh() {
|
||||
if (this.autoRefreshTimer) {
|
||||
clearInterval(this.autoRefreshTimer);
|
||||
this.autoRefreshTimer = null;
|
||||
}
|
||||
},
|
||||
// 页数变化时自动计算支付金额
|
||||
calcAmount() {
|
||||
// 保证 pages 是数字
|
||||
@@ -507,6 +530,30 @@ export default {
|
||||
this.title = "修改病案申请";
|
||||
});
|
||||
},
|
||||
/** 打回按钮操作 */
|
||||
handleReject(row) {
|
||||
this.$modal.confirm('是否确认打回该申请?').then(() => {
|
||||
// 使用专门的打回接口,只需要传递id
|
||||
const rejectData = {
|
||||
id: row.id
|
||||
};
|
||||
|
||||
console.log('打回操作提交的数据:', rejectData);
|
||||
return rejectnxexpress(rejectData);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("打回成功");
|
||||
this.getList();
|
||||
}).catch(error => {
|
||||
console.error('打回操作失败:', error);
|
||||
// 解析错误信息
|
||||
if (error.response && error.response.data) {
|
||||
console.error('后端返回的错误:', error.response.data);
|
||||
this.$modal.msgError(error.response.data.msg || "打回失败,请稍后重试");
|
||||
} else {
|
||||
this.$modal.msgError("打回失败,请稍后重试");
|
||||
}
|
||||
});
|
||||
},
|
||||
/**邮寄/自取按钮操作 */
|
||||
handleSend(row) {
|
||||
this.reset();
|
||||
|
||||
Reference in New Issue
Block a user