Просмотр исходного кода

添加调配类型字段
添加人工 / 设备调配方法

kumu 1 год назад
Родитель
Сommit
7b521a9936
2 измененных файлов с 99 добавлено и 22 удалено
  1. 13 0
      src/api/pharmacy/blend.js
  2. 86 22
      src/views/pharmacyManagement/business/blend/index.vue

+ 13 - 0
src/api/pharmacy/blend.js

@@ -74,3 +74,16 @@ export function selectOralPreList(query) {
     params: query,
   });
 }
+
+// 更新调配类型
+export function updateAllocateType(data) {
+  const url = {
+    1: '/yfc-admin/prescription/prescriptionCore/artificialAllocate',
+    2: '/yfc-admin/prescription/prescriptionCore/machineAllocation',
+  }[data.allocateType]
+  return request({
+    url,
+    method: 'post',
+    data: data.prescriptionId,
+  });
+}

+ 86 - 22
src/views/pharmacyManagement/business/blend/index.vue

@@ -41,7 +41,7 @@
           </el-form-item>
           <el-form-item label="" prop="isAllocation">
             <el-select v-model="queryParams.isAllocation" placeholder="调配状态"
-                       style="width:160px"
+                       style="width:160px" clearable
             >
               <el-option
                 v-for="item in deployStateArr"
@@ -51,6 +51,18 @@
               ></el-option>
             </el-select>
           </el-form-item>
+          <el-form-item label="" prop="allocateType">
+            <el-select v-model="queryParams.allocateType" placeholder="调配类型"
+                       style="width:160px" clearable
+            >
+              <el-option
+                v-for="item in allocateTypeArr"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item label="" prop="allocateNickName">
             <el-input
               v-model="queryParams.allocateNickName"
@@ -111,6 +123,11 @@
       <el-table-column label="剂数" align="center" prop="number"/>
       <el-table-column label="审核人" align="center" prop="checkBy"/>
       <el-table-column label="审核时间" align="center" prop="checkTime"/>
+      <el-table-column label="调配类型" align="center" width="78" prop="allocateType">
+        <template slot-scope="scope">
+          {{ allocateTypeRefData[ scope.row.allocateType ] || '' }}
+        </template>
+      </el-table-column>
       <el-table-column label="调配状态" align="center" width="78" prop="isAllocation">
         <template slot-scope="scope">
           {{ isAllocationRefData[ scope.row.isAllocation ] || '' }}
@@ -123,7 +140,7 @@
         label="操作"
         align="center"
         class-name="small-padding fixed-width"
-        width="200"
+        width="220"
         fixed="right"
       >
         <template slot-scope="scope">
@@ -134,26 +151,38 @@
             @click="handleUpdate(1, scope.row)"
             v-hasPermi="['rescription:prescriptionCore:query']"
           >详情
-          </el-button
-          >
-          <el-button
-            size="mini"
-            type="primary"
-            style="width: 40px;background-color: #1ab394;"
-            v-if="scope.row.isAllocation!=1"
-            @click="handleTop(scope.row)"
-            v-hasPermi="['rescription:prescriptionCore:top']"
-          >置顶
-          </el-button>
-          <el-button
-            size="mini"
-            type="primary"
-            style="width: 80px;background: #409eff;"
-            v-if="scope.row.isAllocation!=1"
-            @click="handleAssign(scope.row)"
-            v-hasPermi="['rescription:prescriptionCore:allocate']"
-          >指定调配师
           </el-button>
+          <template v-if="+scope.row.allocateType === 1">
+            <el-button
+              size="mini"
+              type="primary"
+              style="width: 40px;background-color: #1ab394;"
+              v-if="scope.row.isAllocation!=1"
+              @click="handleTop(scope.row)"
+              v-hasPermi="['rescription:prescriptionCore:top']"
+            >置顶
+            </el-button>
+            <el-button
+              size="mini"
+              type="primary"
+              style="width: 80px;background: #409eff;"
+              v-if="scope.row.isAllocation!=1"
+              @click="handleAssign(scope.row)"
+              v-hasPermi="['rescription:prescriptionCore:allocate']"
+            >指定调配师
+            </el-button>
+          </template>
+          <template v-else-if="+scope.row.allocateType === 2"></template>
+          <template v-else>
+            <el-button size="mini" type="primary"
+                       style="width: 60px;background-color: #1ab394;" v-hasPermi="['rescription:prescriptionCore:allocateType1']"
+                       @click="updateAllocateType('1', scope.row, scope.$index)"
+            >人工调配</el-button>
+            <el-button size="mini" type="primary"
+                       style="width: 60px;background: #409eff;" v-hasPermi="['rescription:prescriptionCore:allocateType2']"
+                       @click="updateAllocateType('2', scope.row, scope.$index)"
+            >设备调配</el-button>
+          </template>
         </template>
       </el-table-column>
     </el-table>
@@ -398,7 +427,14 @@
 <script>
 import { getPrescriptionCore } from '@/api/prescription/prescriptionCore';
 import { listMedicalMechanism } from '@/api/medical/mechanism';
-import { assignAndPinOrder, assignOrder, listAllocateCore, listDispatcher, pinOrder } from '@/api/pharmacy/blend';
+import {
+  assignAndPinOrder,
+  assignOrder,
+  listAllocateCore,
+  listDispatcher,
+  pinOrder,
+  updateAllocateType,
+} from '@/api/pharmacy/blend';
 import dayjs from 'dayjs'
 export default {
   name: 'BlendCore',
@@ -412,10 +448,18 @@ export default {
         {name: '待调配', id: 0},
         {name: '已调配', id: 1},
       ],
+      allocateTypeArr: [
+        {name: '人工调配', id: 1},
+        {name: '设备调配', id: 2},
+      ],
       isAllocationRefData: {
         0: '待调配',
         1: '已调配',
       },
+      allocateTypeRefData: {
+        1: '人工调配',
+        2: '设备调配',
+      },
       remarks: '',
       btnState: 1,
       rowId: null,
@@ -446,6 +490,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         isAllocation: null,
+        allocateType: null,
         appId: null,
         yljgId: null,
         timeStamp: null,
@@ -647,6 +692,25 @@ export default {
         this.title = '查看处方调配';
       });
     },
+
+    async updateAllocateType(type, row, index) {
+      const ids = row? row.id : this.ids;
+      if (this.singleOperation) return;
+      this.singleOperation = true;
+      try {
+        await updateAllocateType({prescriptionId: Array.isArray(ids) ? ids : [ids], allocateType: type});
+        if (row) {
+          this.$set(this.allocateAllocate, index, {
+            ...row,
+            allocateType: type,
+          });
+        } else {
+          this.handleQuery();
+        }
+        this.$message.success('操作成功');
+      } catch (error) {}
+      this.singleOperation = false;
+    }
   },
 };
 </script>