Преглед изворни кода

处方审核添加复制操作

cc12458 пре 1 година
родитељ
комит
9353003ac8

+ 12 - 5
src/views/rescription/prescriptionCore/edit.vue

@@ -36,7 +36,7 @@ export default {
         expressExecutor: [{required: true, message: '请选择配送方式'}],
         consignee: [{validator: locationValidator('请输入收件电话')}],
         contactNumber: [{validator: locationValidator('请输入收件电话')}],
-        location: [{validator: locationValidator('请选择所属地域')}],
+        // location: [{validator: locationValidator('请选择所属地域')}],
         address: [{required: true, message: '请输入详细地址'}],
       },
 
@@ -151,6 +151,10 @@ export default {
         const {medicines, ...model} = await getPrescriptionCore2(this.$props.id);
         this.medicines = medicines.map(medicine => Object.assign(medicine, {subtotalMoney: this.calculationMedicinePrice(medicine)}));
         this.model = transformNestedObjectToFlat(model);
+        if (!this.isCheck) {
+          this.model.id = null;
+          this.model.tackleTime = '';
+        }
       } catch (e) {
         this.cancel();
       }
@@ -545,7 +549,7 @@ export default {
             <el-col v-if="showPharmacy" :span="8">
               <el-form-item label="药房" prop="yfId">
                 <el-select v-model="model.yfId" placeholder="请选择药房" clearable>
-                  <el-option v-for="item in pharmacyList" :key="dict.id" :label="dict.name" :value="dict.id"
+                  <el-option v-for="item in pharmacyList" :key="item.id" :label="item.name" :value="item.id"
                              :disabled="item.disabled"></el-option>
                 </el-select>
               </el-form-item>
@@ -934,9 +938,12 @@ export default {
   }
 }
 
-.el-input-number--medium:not(.full) {
-  width: min-content;
-  min-width: 100px;
+.el-input-number--medium {
+  width: auto;
+  &:not(.full) {
+    width: min-content;
+    min-width: 100px;
+  }
 }
 
 .el-form, .el-input, .el-select, .el-cascader {

+ 12 - 7
src/views/rescription/prescriptionCore/index.vue

@@ -142,7 +142,7 @@
               >搜索</el-button
             >
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-            <el-button icon="el-icon-circle-plus-outline" v-hasPermi="['rescription:prescriptionCore:add']" size="mini" @click="handleUpdate(2, {})">新增处方</el-button>
+            <el-button icon="el-icon-circle-plus-outline" v-hasPermi="['rescription:prescriptionCore:add']" size="mini" @click="handleUpdate(2, {});recipeEditMode='edit';">新增处方</el-button>
           </el-form-item>
         </div>
       </div>
@@ -203,7 +203,7 @@
             type="primary"
             style="width: 40px"
             v-if="scope.row.checkState == 0"
-            @click="handleUpdate(2, scope.row)"
+            @click="handleUpdate(2, scope.row);recipeEditMode='check';"
             v-hasPermi="['rescription:prescriptionCore:check']"
             >审核</el-button
           >
@@ -212,9 +212,9 @@
             type="primary"
             style="width: 40px"
             v-if="scope.row.checkState == 1"
-            @click="handleRelease(scope.row)"
-            v-hasPermi="['rescription:prescriptionCore:check']"
-            >释放</el-button
+            @click="handleUpdate(2, scope.row);recipeEditMode='edit';"
+            v-hasPermi="['rescription:prescriptionCore:add']"
+            >复制</el-button
           >
           <el-button
             size="mini"
@@ -1275,10 +1275,10 @@
       </div>
     </el-dialog>
 
-    <el-dialog :fullscreen="true" :title="recipeEditId ? '处方审核查看' : '新增处方'" :visible.sync="recipeEditOpen"
+    <el-dialog :fullscreen="true" :title="recipeEditTitle" :visible.sync="recipeEditOpen"
                custom-class="prescription-core-edit-container" width="1180px" size="mini"
                append-to-body destroy-on-close @closed="recipeEditId = null;recipeEditShow = false">
-      <edit v-if="recipeEditShow" :id="recipeEditId" :mode="recipeEditId ? 'check' : 'edit'" @close="recipeEditOpen = false;$event && getList()"></edit>
+      <edit v-if="recipeEditShow" :id="recipeEditId" :mode="recipeEditMode" @close="recipeEditOpen = false;$event && getList()"></edit>
     </el-dialog>
 
     <el-dialog title="打印预览" :visible.sync="showPrint" @closed="showPrintId = ''">
@@ -1347,6 +1347,7 @@ export default {
   data() {
     const now = dayjs().format("YYYY-MM-DD");
     return {
+      recipeEditMode: 'edit',
       recipeEditId: null,
       recipeEditOpen: false,
       recipeEditShow: false,
@@ -1574,6 +1575,10 @@ export default {
         return "否";
       }
     },
+    recipeEditTitle() {
+      if (this.recipeEditMode === 'check') return '处方审核查看'
+      return this.recipeEditId ? '复制处方' : '新增处方';
+    }
   },
   methods: {
     countDose() {