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

统建处方更改为平台药品源

cc12458 1 год назад
Родитель
Сommit
3fda04c8cf

+ 30 - 1
src/api/diagnosis.js

@@ -48,7 +48,36 @@ export function getPatiensBasisM(data) {
 };
 
 // 获取表格 药品列表
-export function getTableDrug(data) {
+export function getTableDrug(data, isPurposeType = false) {
+    if (isPurposeType) {
+        data.name = data.key;
+        return request({
+            url: '/basis/stitutionsdrugMgr/materialQuery',
+            method: 'post',
+            data
+        }).then(res => {
+            const data = Array.isArray(res.Data) ? res.Data : [];
+            res.Data = {
+                TotalRecordCount: data.length,
+                TotalPageCount: 1,
+                PageSize: data.length,
+                ButtonRight: "",
+                CurrentPageSize: data.length,
+                PageIndex: 1,
+                Items: data.map(item => {
+                    return {
+                        pid: item.drugId,
+                        matid: item.drugId,
+                        ypmc: item.name,
+                        gg: item.gg,
+                        dw: item.dw,
+                        price: item.price || '',
+                    }
+                })
+            };
+            return res;
+        })
+    }
     return request({
         url: '/test/outpatient/selectDrug?page=' + data.page + '&limit=' + data.limit,
         method: 'post',

+ 7 - 2
src/components/MedicineAccord.vue

@@ -21,7 +21,7 @@
           </div>
         </div>
         <!-- @change="getPharmacyID" -->
-        <div class="t-con-radio flex-vertical-center-l">
+        <div class="t-con-radio flex-vertical-center-l" v-if="!isPurposeType">
           <div class="t-radio-group">
             <el-radio-group
               v-model="recipe_tabs[recipe_tabs_c].radio"
@@ -554,6 +554,10 @@ export default {
     accompanied
   },
   props: {
+    isPurposeType: {
+      type: Boolean,
+      default: false
+    },
     isShrink: {
       type: Boolean,
       default: false
@@ -1306,6 +1310,7 @@ export default {
         key: "",
         search_i: index,
         medid: item.pid, // 药品id
+        matid: item.matid, // 知识库id
         originname: item.cdmc, // 产地名称
         showSearch: false,
         showDoseSection: false // 展示剂量区间
@@ -2007,7 +2012,7 @@ export default {
         type: type,
         pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID
       };
-      let res = await getTableDrug(params);
+      let res = await getTableDrug(params, this.isPurposeType);
       if (this.index !== index) return;
 
       if (res.ResultCode == 0) {

+ 10 - 3
src/views/business/AccordEdit.vue

@@ -97,7 +97,7 @@
     </div>
 
     <div class="bottom">
-      <MedicineAccord @length="medicineLength = $event"></MedicineAccord>
+      <MedicineAccord :isPurposeType="isPurposeType" @length="medicineLength = $event"></MedicineAccord>
     </div>
     <div class="topForm flex-vertical-center-l">
       <div class="item flex-vertical-center-l">
@@ -336,17 +336,17 @@ export default {
   mounted() {
     if (this.$route.query.pid) {
       this.getAccordDetail().then(() => {
-        if (this.isPurposeType) this.getHospitalCategory().then(() => this.getHospitalDepartment());
+        if (this.isPurposeType) this.getHospitalCategory()
       });
     }
   },
   methods: {
     async getHospitalCategory() {
       this.hospitalCategory = await getHospitalCategory();
+      await this.getHospitalDepartment();
     },
     async getHospitalDepartment() {
       this.hospitalDepartment = await getHospitalDepartment({hospital: this.form.sectCategory || ''});
-
       if (!this.hospitalDepartment.find(item => item.id === this.form.sectDept)) this.form.sectDept = '';
     },
     // 保存按钮点击
@@ -461,6 +461,7 @@ export default {
             dose: Number(item1.dose),
             drugname: item1.name,
             drugid: item1.medid,
+            matid: item1.matid, // 知识库id
             origin: item1.originname,
             seqn: item1.id,
             specification: item1.spec,
@@ -497,6 +498,7 @@ export default {
           inventory: item1.instock || item1.inventory, // 库存
           key: "",
           search_i: index1,
+          matid: item1.matid, // 药品id
           medid: item1.drugid || item1.medid, // 药品id
           originname: item1.origin || item1.originname // 产地名称
         };
@@ -701,6 +703,11 @@ export default {
         symptomname: tcmdParams.syndrometypes,
         treatment: tcmdParams.treatment
       };
+      if (this.isPurposeType) {
+        params.prescriptionDetailVos = params.prescriptionDetailVos.map(item => (item.drugid = null, item));
+        params.pharmacyid = null;
+        params.drugtype = null;
+      }
       const loading = this.$loading({
         lock: true,
         text: "正在提交",

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

@@ -2536,7 +2536,7 @@ export default {
           inventory: item.kc, // 库存
           key: "",
           search_i: index,
-          medid: item.ypmc ? item.pid : drugid, // 药品id
+          medid: item.ypmc ? item.pid || item.matid : drugid, // 药品id
           originname: item.cdmc, // 产地名称
           showSearch: false
         };