Browse Source

益寿缘医生端-增加拒方逻辑

cgp 5 days ago
parent
commit
9651888c79
2 changed files with 41 additions and 0 deletions
  1. 14 0
      src/api/his/prescribe.js
  2. 27 0
      src/views/his/prescribe/index.vue

+ 14 - 0
src/api/his/prescribe.js

@@ -25,6 +25,20 @@ export function confirmPrescribe(payload) {
   })
 }
 
+/**
+ * 拒方
+ * @param payload
+ * @returns {*}
+ */
+export function handleReject(payload) {
+
+  return request({
+    url: '/his/prescribe/handleReject',
+    method: 'put',
+    data: payload
+  })
+}
+
 // 查询处方详细
 export function getPrescribe(prescribeId) {
   return request({

+ 27 - 0
src/views/his/prescribe/index.vue

@@ -102,6 +102,9 @@
           <el-button v-if="scope.row.doctorConfirm == 0" size="mini" type="text" icon="el-icon-edit"
                      @click="handleUpdate(scope.row)">开方
           </el-button>
+          <el-button v-if="scope.row.doctorConfirm == 0" size="mini" type="text" icon="el-icon-delete"
+                     @click="handleReject(scope.row)">拒方
+          </el-button>
           <el-button v-if="scope.row.doctorConfirm == 1" size="mini" type="text"
                      @click="handleUpdate(scope.row)">查看
           </el-button>
@@ -496,6 +499,7 @@ import {
 } from '@/api/his/prescribe'
 import {listPrescribeDrug, addPrescribeDrug, updatePrescribeDrug, deletePrescribeDrug} from "@/api/his/prescribeDrug";
 import {getCollectionByUserId} from "@/api/collection";
+import {handleReject} from '@/api/his/prescribe'
 
 export default {
   components: {
@@ -930,6 +934,29 @@ export default {
       this.title = "新增处方";
       this.activeTab = 'basic';
     },
+    /** 拒方弹窗 */
+    handleReject(row) {
+      this.$prompt('请输入拒方原因', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputPlaceholder: '请输入备注(不可为空)',
+        // 至少输入1个非空白字符
+        inputPattern: /\S+/,
+        inputErrorMessage: '拒方原因不能为空'
+      }).then(({ value }) => {
+        const remark = value.trim();
+        handleReject({
+          prescribeId: row.prescribeId,
+          remark: remark
+        }).then(() => {
+          this.$message.success('拒方成功');
+        }).catch(() => {
+          this.$message.error('拒方失败');
+        });
+      }).catch(() => {
+        this.$message.info('已取消拒方');
+      });
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();