Przeglądaj źródła

在本地专家和协定房保存的时候传入owmtype加以区分类型,以及本地专家页操作列的编辑和删除按钮非本人不可操作限制

张田田 1 tydzień temu
rodzic
commit
71e359bc6d

+ 17 - 2
src/views/business/LocalExpertTech.vue

@@ -106,8 +106,16 @@
             <el-table-column label="操作" width="180" align="center">
               <template slot-scope="scope">
                 <div class="flex-center">
-                  <div class="find-detail find-fill" @click="openEditDialog(scope.row)">编辑</div>
-                  <div class="find-detail find-fill1" @click="handleDelete(scope.row)">删除</div>
+                  <div
+                    class="find-detail find-fill"
+                    :class="{ 'is-disabled': scope.row.createUser != currentUserId }"
+                    @click="scope.row.createUser == currentUserId && openEditDialog(scope.row)"
+                  >编辑</div>
+                  <div
+                    class="find-detail find-fill1"
+                    :class="{ 'is-disabled': scope.row.createUser != currentUserId }"
+                    @click="scope.row.createUser == currentUserId && handleDelete(scope.row)"
+                  >删除</div>
                   <div class="find-detail find-fill2" @click="handleView(scope.row)">查看</div>
                 </div>
               </template>
@@ -318,6 +326,7 @@
           :detailTypes.sync="editData.detailTypes"
           :statistics.sync="editData.statistics"
           :showGuide="true"
+          :ownerType="'2'"
           @save="onAcupointSave"
         />
         </div>
@@ -1293,6 +1302,12 @@ export default {
       color: #fff !important;
       border: 1px solid #68a8ff;
     }
+
+    .find-detail.is-disabled {
+      opacity: 0.5;
+      cursor: not-allowed;
+      pointer-events: none;
+    }
   }
 }
 </style>

+ 1 - 0
src/views/business/SuitableTech.vue

@@ -508,6 +508,7 @@
             :detailTypes.sync="editData.detailTypes"
             :statistics.sync="editData.statistics"
             :showGuide="true"
+            :ownerType="'1'"
             @save="onAcupointSave"
           />
         </div>

+ 12 - 16
src/views/business/components/AcupointTable.vue

@@ -731,6 +731,14 @@ export default {
       type: Boolean,
       default: false,
     },
+    reportAddRecipe: {
+      type: Boolean,
+      default: false,
+    },
+    useIsUpdateLock: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {
@@ -795,7 +803,7 @@ export default {
   },
   computed: {
     isLocked() {
-      return this.innerIsEditable === "0";
+      return this.useIsUpdateLock && this.innerIsEditable === "0";
     },
     activeDetailTypes() {
       const validTypes = ["穴位", "经络", "耳穴", "部位", "其他详情"];
@@ -936,7 +944,6 @@ export default {
       }
       this.$nextTick(() => {
         this._isLoadingTab = false;
-        // 加载完毕后,如果是自动计算模式,触发一次初始计算
         if (this.currentSingleNumber !== "0") {
           this.updatePrice();
         }
@@ -1069,12 +1076,10 @@ export default {
 
       // 价格
       const price = detailData.price || 0;
-      // 保存旧 tab 数据
       if (this.prescriptions.length > 0) {
         this.saveCurrentTabData();
       }
 
-      // 从 itemOptions 中获取选中项的 classify
       const selectedItem = this.itemOptions.find(
         (i) => i.id === this.addForm.itemId,
       );
@@ -1111,6 +1116,7 @@ export default {
       this.showAddDialog = false;
       this.addLoading = false;
       this.$emit("prescriptions-change", this.prescriptions);
+      if (this.reportAddRecipe) this.$emit('add-recipe');
     },
     removePrescription(index) {
       this.$confirm("确认删除该处方?", "提示", {
@@ -1347,7 +1353,6 @@ export default {
       this.addDetailRow(scope, detailType);
     },
     onDetailInput(scope, detailType) {
-      // 其他详情输入文字后自动新增一行
       if (scope.row.name) {
         this.addDetailRow(scope, detailType);
       }
@@ -1370,13 +1375,11 @@ export default {
       this.searchByType("", detailType);
     },
     isDeleteDisabled(row, detailType) {
-      // 当 isLocked 为 true 时(isUpdate === "0"),限制删除操作
       if (this.isLocked) {
-        // 穴位:主穴不可删除,配穴可以删除
         if (detailType === '穴位') {
           return row.mainType === '1'; // 主穴不可删除
         }
-        // 耳穴、经络、部位、其他详情:全部不可删除
+        
         return true;
       }
       return false;
@@ -1495,7 +1498,6 @@ export default {
         this.$message.warning("请输入单次数量");
         return false;
       }
-      // 当 requiredTreatFields 为 true 时,验证治疗次数和频次必填
       if (this.requiredTreatFields) {
         if (!this.treatCount || this.treatCount <= 0) {
           this.$message.warning("请输入治疗次数");
@@ -1596,7 +1598,7 @@ export default {
           command: d.command || "",
           pointMatchGuide: d.pointMatchGuide || "",
           seqn: index + 1,
-          ownerType: "1",
+          ownerType: this.ownerType || "1",
           detailPoint,
           detailMeridian,
           detailEarPoint,
@@ -1648,7 +1650,6 @@ export default {
           item.detailOther || [],
         );
 
-        // 按 type 分组到 detailTables
         const detailTables = {
           穴位: [],
           经络: [],
@@ -1703,7 +1704,6 @@ export default {
           }
         }
 
-        // 构造 tab 数据
         const singleNumber = item.basisStitutionsnondrug?.singleNumber || "0";
         this.prescriptionDataMap[index] = {
           detailTables,
@@ -1777,7 +1777,6 @@ export default {
   flex-direction: column;
   height: 100%;
 
-  // tab + 按钮同一行
   .prescription-header {
     display: flex;
     align-items: center;
@@ -1832,7 +1831,6 @@ export default {
     margin-left: auto;
   }
 
-  // 底部金额 - 固定在最底部
   .table-b-bottom {
     flex-shrink: 0;
     padding: 10px;
@@ -1859,7 +1857,6 @@ export default {
   flex: 1;
   min-height: 0;
 
-  // 工具栏
   .table-toolbar {
     margin-bottom: 10px;
     padding: 0 5px;
@@ -2005,7 +2002,6 @@ export default {
   height: 33px !important;
 }
 
-// 详情弹窗样式(scoped 内)
 .drug-body {
   padding: 10px;
 

+ 2 - 1
src/views/diagnosis/Prescribing.vue

@@ -478,10 +478,11 @@
           :showEntrust="true"
           :showAgreementTotal="false"
           :useIsUpdateLock="true"
-          :ownerType="'2'"
           :requiredTreatFields="true"
+          :report-add-recipe="true"
           @save="submitRecipe1()"
           @clear="clearContainer('2')"
+          @add-recipe="addRecipeFrom('3')"
         />
       </div>
     </div>