Browse Source

03100056 反参与删除按钮的逻辑优化

yanqiliang 2 weeks ago
parent
commit
b2c9554850
1 changed files with 9 additions and 4 deletions
  1. 9 4
      src/pages/entryWrite/page/Entry/prescription/prescription.vue

+ 9 - 4
src/pages/entryWrite/page/Entry/prescription/prescription.vue

@@ -652,13 +652,18 @@ export default {
             });
         },
 
-        // 已确认项目是否允许删除:已支付、审核中 不显示删除按钮
+        // 已确认项目是否允许删除:
+        // 药品处方(prescNo 以 OPN 开头)审核通过后不可删除;
+        // 非药品处方已支付后不可删除。
         canDeleteDefault: function (item) {
-            if (!item || !item.prescState) {
+            if (!item) {
                 return true;
             }
-            const state = String(item.prescState);
-            return !(state.indexOf('已支付') !== -1 ); // || state.indexOf('审核中') !== -1
+            const prescNo = String(item.prescNo || '').trim();
+            const prescState = String(item.prescState || '').trim();
+            const isMedicinePrescription = prescNo.startsWith('OPN');
+
+            return isMedicinePrescription ? prescState !== '处方审核通过' : prescState !== '已支付';
         },
 
         attached: function () {},