Bläddra i källkod

新增功能-医生暂不开方

cgp 22 timmar sedan
förälder
incheckning
cc5d65fdab
1 ändrade filer med 33 tillägg och 8 borttagningar
  1. 33 8
      src/views/his/scrmPrescribe/index.vue

+ 33 - 8
src/views/his/scrmPrescribe/index.vue

@@ -151,13 +151,13 @@
             @click="handleOpenPrescribe(scope.row)"
           >开方</el-button>
           <!-- 暂不开方 -->
-          <el-button
-            v-if="scope.row.recipeType === 1 &&scope.row.doctorConfirm === 0 && scope.row.isDocument===0"
-            type="text"
-            size="mini"
-            icon="el-icon-remove-outline"
-            @click="handleNotPrescribe(scope.row)"
-          >暂不开方</el-button>
+<!--          <el-button-->
+<!--            v-if="scope.row.recipeType === 1 &&scope.row.doctorConfirm === 0 && scope.row.isDocument===0"-->
+<!--            type="text"-->
+<!--            size="mini"-->
+<!--            icon="el-icon-remove-outline"-->
+<!--            @click="handleNotPrescribe(scope.row)"-->
+<!--          >暂不开方</el-button>-->
           <!-- 拒方 -->
           <el-button
             v-if="scope.row.doctorConfirm === 0 && scope.row.isDocument===0"
@@ -305,12 +305,37 @@ export default {
           cancelButtonText: '取消',
           type: 'info'
         }).then(() => {
+          // 用户点击“确定”,打开开方弹窗
           this.prescribeDialogVisible = true;
         }).catch(() => {
+          // 用户点击“取消”,二次确认是否暂不开方(防止误触)
+          this.$confirm('确认暂不开方吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            // 二次确认通过,调用暂不开方接口(无需理由)
+            if (!this.currentPrescribeId) {
+              this.$message.error('处方ID缺失,操作失败');
+              return;
+            }
+            doctorNotPrescribe({
+              prescribeId: this.currentPrescribeId,
+              notPrescribeReason: '暂不开方' // 可传空字符串或固定文案
+            }).then(() => {
+              this.$message.success('已暂不开方');
+              this.getList();
+            }).catch(error => {
+              this.$message.error(error.message || '操作失败');
+            });
+          }).catch(() => {
+            // 用户取消二次确认,不做任何操作
+            this.$message.info('已取消操作');
+          });
         });
       }
     },
-    // 暂不开方
+    // 暂不开方(主动点击按钮,需输入理由)
     handleNotPrescribe(row) {
       this.$prompt('请输入暂不开方的原因', '暂不开方', {
         confirmButtonText: '确定',