ソースを参照

药品种类,详情,数量开关

seimin 2 週間 前
コミット
0335db7829

+ 4 - 4
pages/newDrug/checkPage/checkPage.vue

@@ -11,14 +11,14 @@
11 11
     <view class="Scanning_cont">
12 12
       <view class="column head">
13 13
         <view class="value1">单号<text class="red">({{drugsBagList.length}})</text></view>
14
-        <view class="value2">种类数</view>
15
-        <view class="value3">总数</view>
14
+        <view class="value2" v-if="config.showDrugsBagTypeCount == 1">种类数</view>
15
+        <view class="value3" v-if="config.showDrugsBagTypeCount == 1">总数</view>
16 16
       </view>
17 17
       <scroll-view scroll-y class="scrollContent">
18 18
         <view class="column" v-for="item in drugsBagList" :key="item.id" @click="toDetail(item.id)">
19 19
           <view class="value1">{{item.packid}}</view>
20
-          <view class="value2">{{item.drugsTypeCount}}</view>
21
-          <view class="value3">{{item.drugsCount}}</view>
20
+          <view class="value2" v-if="config.showDrugsBagTypeCount == 1">{{item.drugsTypeCount}}</view>
21
+          <view class="value3" v-if="config.showDrugsBagTypeCount == 1">{{item.drugsCount}}</view>
22 22
         </view>
23 23
       </scroll-view>
24 24
     </view>

+ 41 - 10
pages/newDrug/continueScanning/continueScanning.vue

@@ -20,11 +20,11 @@
20 20
           <view class="name">发药科室:</view>
21 21
           <view class="value">{{drugsBag.launch ? drugsBag.launch.dept : ''}}</view>
22 22
         </view>
23
-        <view class="column">
23
+        <view class="column" v-if="config.showDrugsBagTypeCount == 1">
24 24
           <view class="name">种类数:</view>
25 25
           <view class="value">{{drugsBag.drugsTypeCount}}</view>
26 26
         </view>
27
-        <view class="column">
27
+        <view class="column" v-if="config.showDrugsBagTypeCount == 1">
28 28
           <view class="name">药品数:</view>
29 29
           <view class="value">{{drugsBag.drugsCount}}</view>
30 30
         </view>
@@ -56,6 +56,8 @@
56 56
   export default {
57 57
     data() {
58 58
       return {
59
+        hosId: uni.getStorageSync('userData').user.currentHospital.id,
60
+        config: {}, //配置
59 61
         workOrder: {}, //工单信息
60 62
         drugsBag: {}, //药包信息
61 63
         queryObj: {}, //路由传递过来的数据
@@ -188,21 +190,50 @@
188 190
           title: "加载中",
189 191
           mask: true,
190 192
         });
191
-
192
-        post(`/transflow/scanInfo`, {type: this.queryObj.drugsBagType, id: +this.queryObj.drugsBagId, orderStateValue: this.queryObj.orderStateValue, orderId: +this.queryObj.orderId}).then(res => {
193
+        
194
+        let info$ = post(`/transflow/scanInfo`, {type: this.queryObj.drugsBagType, id: +this.queryObj.drugsBagId, orderStateValue: this.queryObj.orderStateValue, orderId: +this.queryObj.orderId});
195
+        let config$ = post(`/simple/data/fetchDataList/taskTypeConfig`, {
196
+            "idx": 0,
197
+            "sum": 1,
198
+            "taskTypeConfig": {
199
+                "taskTypeDTO": {
200
+                    "hosId": {
201
+                        "id": this.hosId
202
+                    },
203
+                    "ordinaryField": {
204
+                        "key": "ordinary_field",
205
+                        "value": this.queryObj.drugsBagType
206
+                    }
207
+                }
208
+            }
209
+        });
210
+        
211
+        Promise.all([info$, config$]).then(result => {
193 212
           uni.hideLoading();
194
-          if(res.state == 200){
195
-            if(res.data){
196
-              this.scanCount = res.data.scanCount;
197
-              this.drugsBag = res.data.dto || {};
198
-              let workOrder = res.data.workOrder || {};
213
+          let [info, config] = result || [];
214
+        
215
+          if(info.state == 200){
216
+            if(info.data){
217
+              this.scanCount = info.data.scanCount;
218
+              this.drugsBag = info.data.dto || {};
219
+              let workOrder = info.data.workOrder || {};
199 220
               workOrder.endDeptNames = workOrder.endDepts.map(v=>v.dept).toString();
200 221
               this.workOrder = workOrder;
201 222
             }
202 223
           }else{
203 224
             uni.showToast({
204 225
               icon: "none",
205
-              title: res.msg || "接口获取数据失败!",
226
+              title: info.msg || "接口获取数据失败!",
227
+            });
228
+          }
229
+        
230
+          if(config.status == 200){
231
+            let list  = config.list || [];
232
+            this.config = list.length ? list[0] : {};
233
+          }else{
234
+            uni.showToast({
235
+              icon: "none",
236
+              title: config.msg || "接口获取数据失败!",
206 237
             });
207 238
           }
208 239
         })

+ 2 - 2
pages/newDrug/createOrder/createOrder.vue

@@ -20,11 +20,11 @@
20 20
           <view class="name">发药科室:</view>
21 21
           <view class="value">{{drugsBag.launch ? drugsBag.launch.dept : ''}}</view>
22 22
         </view>
23
-        <view class="column">
23
+        <view class="column" v-if="config.showDrugsBagTypeCount == 1">
24 24
           <view class="name">种类数:</view>
25 25
           <view class="value">{{drugsBag.drugsTypeCount}}</view>
26 26
         </view>
27
-        <view class="column">
27
+        <view class="column" v-if="config.showDrugsBagTypeCount == 1">
28 28
           <view class="name">药品数:</view>
29 29
           <view class="value">{{drugsBag.drugsCount}}</view>
30 30
         </view>

+ 63 - 34
pages/newDrug/detail.vue

@@ -9,16 +9,18 @@
9 9
     </view>
10 10
 
11 11
     <view class="Scanning_cont">
12
-      <view class="column head">
13
-        <view class="value1">药品名称+规格<text class="red">({{drugsList.length}})</text></view>
14
-        <view class="value2">数量</view>
15
-      </view>
16
-      <scroll-view scroll-y class="scrollContent">
17
-        <view class="column" v-for="item in drugsList" :key="item.id">
18
-          <view class="value1">{{item.drugsInfo}} {{item.model}}</view>
19
-          <view class="value2">{{item.drugsNum}}</view>
12
+      <template v-if="config.showDrugsBagDetails == 1">
13
+        <view class="column head">
14
+          <view class="value1">药品名称+规格<text class="red">({{drugsList.length}})</text></view>
15
+          <view class="value2">数量</view>
20 16
         </view>
21
-      </scroll-view>
17
+        <scroll-view scroll-y class="scrollContent">
18
+          <view class="column" v-for="item in drugsList" :key="item.id">
19
+            <view class="value1">{{item.drugsInfo}} {{item.model}}</view>
20
+            <view class="value2">{{item.drugsNum}}</view>
21
+          </view>
22
+        </scroll-view>
23
+      </template>
22 24
     </view>
23 25
 
24 26
     <view class="foot_btn_spe">
@@ -73,38 +75,65 @@
73 75
           title: "加载中",
74 76
           mask: true,
75 77
         });
76
-
77
-        if(this.queryObj.drugsBagId){
78
-          // 根据药包id查询药品
79
-          this.getDrugsByDrugsBugId(this.queryObj.drugsBagId);
80
-        }else if(this.queryObj.orderId){
81
-          // 根据工单id查询药包,此时必是一单一码,即只有一个药包码
82
-          post(`/transflow/extra`, {type: this.queryObj.drugsBagType, extraType: 'orderInfo', orderId: +this.queryObj.orderId}).then(res => {
83
-            if(res.state == 200){
84
-              if(res.data){
85
-                let drugsBagList = res.data.drugsBagList || [];
86
-                let drugsBag = drugsBagList[0] || {};
87
-                if(drugsBag.id){
88
-                  this.getDrugsByDrugsBugId(drugsBag.id);
78
+        
79
+        post(`/simple/data/fetchDataList/taskTypeConfig`, {
80
+            "idx": 0,
81
+            "sum": 1,
82
+            "taskTypeConfig": {
83
+                "taskTypeDTO": {
84
+                    "hosId": {
85
+                        "id": this.hosId
86
+                    },
87
+                    "ordinaryField": {
88
+                        "key": "ordinary_field",
89
+                        "value": this.queryObj.drugsBagType
90
+                    }
91
+                }
92
+            }
93
+        }).then(res=> {
94
+          if(res.status == 200){
95
+            let list  = res.list || [];
96
+            this.config = list.length ? list[0] : {};
97
+            
98
+            if(this.queryObj.drugsBagId){
99
+              // 根据药包id查询药品
100
+              this.getDrugsByDrugsBugId(this.queryObj.drugsBagId);
101
+            }else if(this.queryObj.orderId){
102
+              // 根据工单id查询药包,此时必是一单一码,即只有一个药包码
103
+              post(`/transflow/extra`, {type: this.queryObj.drugsBagType, extraType: 'orderInfo', orderId: +this.queryObj.orderId}).then(res => {
104
+                if(res.state == 200){
105
+                  if(res.data){
106
+                    let drugsBagList = res.data.drugsBagList || [];
107
+                    let drugsBag = drugsBagList[0] || {};
108
+                    if(drugsBag.id){
109
+                      this.getDrugsByDrugsBugId(drugsBag.id);
110
+                    }else{
111
+                      uni.hideLoading();
112
+                      uni.showToast({
113
+                        icon: "none",
114
+                        title: "未查询到药品!",
115
+                      });
116
+                    }
117
+                  }else{
118
+                    uni.hideLoading();
119
+                  }
89 120
                 }else{
90 121
                   uni.hideLoading();
91 122
                   uni.showToast({
92 123
                     icon: "none",
93
-                    title: "未查询到药品!",
124
+                    title: res.msg || "接口获取数据失败!",
94 125
                   });
95 126
                 }
96
-              }else{
97
-                uni.hideLoading();
98
-              }
99
-            }else{
100
-              uni.hideLoading();
101
-              uni.showToast({
102
-                icon: "none",
103
-                title: res.msg || "接口获取数据失败!",
104
-              });
127
+              })
105 128
             }
106
-          })
107
-        }
129
+          }else{
130
+            uni.hideLoading();
131
+            uni.showToast({
132
+              icon: "none",
133
+              title: res.msg || "接口获取数据失败!",
134
+            });
135
+          }
136
+        })
108 137
       },
109 138
     },
110 139
     onLoad(options) {

+ 40 - 8
pages/newDrug/list.vue

@@ -8,7 +8,7 @@
8 8
             <view class="value">{{item.drugsState ? item.drugsState.name : ''}}</view>
9 9
           </view>
10 10
           <view class="body">
11
-            <view class="bodyColumn">
11
+            <view class="bodyColumn" v-if="config.showDrugsBagTypeCount == 1">
12 12
               <view class="name">种类数:{{item.drugsTypeCount}}</view>
13 13
               <view class="value">总数:{{item.drugsCount}}</view>
14 14
             </view>
@@ -50,6 +50,9 @@
50 50
     methods: {
51 51
       // 详情
52 52
       toDetail(drugsBagId){
53
+        if(this.config.showDrugsBagDetails != 1){
54
+          return;
55
+        }
53 56
         uni.navigateTo({
54 57
           url: `/pages/newDrug/detail?drugsBagType=${this.queryObj.drugsBagType}&drugsBagId=${drugsBagId}`,
55 58
         });
@@ -60,18 +63,47 @@
60 63
           title: "加载中",
61 64
           mask: true,
62 65
         });
63
-
64
-        post(`/transflow/extra`, {type: this.queryObj.drugsBagType, extraType: 'orderInfo', orderId: +this.queryObj.orderId}).then(res => {
66
+        
67
+        let info$ = post(`/transflow/extra`, {type: this.queryObj.drugsBagType, extraType: 'orderInfo', orderId: +this.queryObj.orderId});
68
+        let config$ = post(`/simple/data/fetchDataList/taskTypeConfig`, {
69
+            "idx": 0,
70
+            "sum": 1,
71
+            "taskTypeConfig": {
72
+                "taskTypeDTO": {
73
+                    "hosId": {
74
+                        "id": this.hosId
75
+                    },
76
+                    "ordinaryField": {
77
+                        "key": "ordinary_field",
78
+                        "value": this.queryObj.drugsBagType
79
+                    }
80
+                }
81
+            }
82
+        });
83
+        
84
+        Promise.all([info$, config$]).then(result => {
65 85
           uni.hideLoading();
66
-          if(res.state == 200){
67
-            if(res.data){
68
-              this.drugsBagList = res.data.drugsBagList || [];
69
-              this.workOrder = res.data.workOrder || {};
86
+          let [info, config] = result || [];
87
+        
88
+          if(info.state == 200){
89
+            if(info.data){
90
+              this.drugsBagList = info.data.drugsBagList || [];
91
+              this.workOrder = info.data.workOrder || {};
70 92
             }
71 93
           }else{
72 94
             uni.showToast({
73 95
               icon: "none",
74
-              title: res.msg || "接口获取数据失败!",
96
+              title: info.msg || "接口获取数据失败!",
97
+            });
98
+          }
99
+        
100
+          if(config.status == 200){
101
+            let list  = config.list || [];
102
+            this.config = list.length ? list[0] : {};
103
+          }else{
104
+            uni.showToast({
105
+              icon: "none",
106
+              title: config.msg || "接口获取数据失败!",
75 107
             });
76 108
           }
77 109
         })

+ 1 - 1
pages/newDrug/photoRetention/photoRetention.vue

@@ -31,7 +31,7 @@
31 31
             <view class="value">{{queryObj.accountName}}</view>
32 32
           </view>
33 33
           <template v-if="config.drugsModel === 1">
34
-            <view class="column">
34
+            <view class="column" v-if="config.showDrugsBagTypeCount == 1">
35 35
               <view class="name">药品数:</view>
36 36
               <view class="value">{{drugsBagList.length ? drugsBagList[0].drugsCount : ''}}</view>
37 37
             </view>