Преглед на файлове

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

csx преди 3 години
родител
ревизия
8f0364ac84

+ 16 - 0
src/api/supply.js Целия файл

@@ -39,3 +39,19 @@ export function updatePurchaseOrder(data, supplier_name, start_time, end_time, r
39 39
     data: data
40 40
   })
41 41
 }
42
+
43
+export function checkPurchaseOrder(id, params) {
44
+  return request({
45
+    url: '/api/supply/checkpurchaseorder?id=' + id,
46
+    method: 'Get',
47
+    params: params
48
+  })
49
+}
50
+
51
+export function getPurchaseOrderDetail(id, params) {
52
+  return request({
53
+    url: '/api/supply/getpurchaseorderdetail?id=' + id,
54
+    method: 'get',
55
+    params: params
56
+  })
57
+}

+ 1 - 0
src/lang/zh.js Целия файл

@@ -138,6 +138,7 @@ export default {
138 138
     stockQuery: '库存查询',
139 139
     supplyQuery: '供应商管理',
140 140
     purchaseOrderQuery: '购货订单',
141
+    goodOrderQuery: '购货单',
141 142
     addPurchaseOrder: '新增购货订单',
142 143
     workforce_template: '排班模板设置',
143 144
     statistics: '统计分析',

+ 35 - 0
src/router/modules/supply.js Целия файл

@@ -41,6 +41,41 @@ export default {
41 41
       hidden: true,
42 42
       is_menu: false,
43 43
       isChild: true
44
+    },
45
+    {
46
+      path: '/purchase/order/edit',
47
+      component: () => import('@/xt_pages/supply/components/editPurchaseOrder'),
48
+      name: 'editPurchaseOrder',
49
+      meta: { title: 'editPurchaseOrder', noCache: true },
50
+      hidden: true,
51
+      is_menu: false,
52
+      isChild: true
53
+    },
54
+    {
55
+      path: '/purchase/order/print',
56
+      component: () => import('@/xt_pages/supply/components/purchaseOrderPrint'),
57
+      name: 'purchaseOrderPrint',
58
+      meta: { title: 'purchaseOrderPrint', noCache: true },
59
+      hidden: true,
60
+      is_menu: false,
61
+      isChild: true
62
+    },
63
+
64
+    {
65
+      path: 'good/order/query',
66
+      component: () => import('@/xt_pages/supply/goodOrderQuery'),
67
+      name: 'goodOrderQuery',
68
+      meta: { title: 'goodOrderQuery', noCache: true }
69
+    },
70
+    {
71
+      path: '/good/order/add',
72
+      component: () => import('@/xt_pages/supply/components/addGoodOrder'),
73
+      name: 'addGoodOrder',
74
+      meta: { title: 'addGoodOrder', noCache: true },
75
+      hidden: true,
76
+      is_menu: false,
77
+      isChild: true
44 78
     }
79
+
45 80
   ]
46 81
 }

+ 3 - 3
src/xt_pages/dialysis/template/DialysisPrintOrderTen.vue Целия файл

@@ -640,7 +640,7 @@
640 640
                 </td> -->
641 641
                         <!-- <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td> -->
642 642
                         <td height="32px">
643
-                          <img v-if="advice.id > 0" style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="" />
643
+                          <!-- <img v-if="advice.id > 0" style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="" /> -->
644 644
                           <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{ getAdminUser(advice.advice_doctor) }}</span>
645 645
                           <img style="height:20px;" :src="setAdminUserES(advice.advice_doctor)" alt="" srcset="" v-else />
646 646
                         </td>
@@ -1014,8 +1014,8 @@
1014 1014
                     <div class="inline_block" style="flex:1;">
1015 1015
                       治疗医生:
1016 1016
                       <div class="under_line" style="width: 80px">
1017
-                        <img style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="" />
1018
-                        <!--<img style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="">-->
1017
+                        <!-- <img style="height:20px;" src="https://images.shengws.com/FgnRnBcx1BgULJ1dn7VKzeBPEvtm" alt="" srcset="" /> -->
1018
+                       
1019 1019
                         <span v-if="setAdminUserES(prescription.prescription_doctor) == ''">{{ getAdminUser(prescription.prescription_doctor) }}</span>
1020 1020
                         <img style="height:20px;" :src="setAdminUserES(prescription.prescription_doctor)" alt="" srcset="" v-else />
1021 1021
                       </div>

+ 1 - 1
src/xt_pages/outpatientCharges/statementPrint.vue Целия файл

@@ -301,7 +301,7 @@ export default {
301 301
           id: obj.order_id,
302 302
 
303 303
         }
304
-        if(this.org_id == 10138 || this.org_id == 0 || this.$store.getters.xt_user.org_id == 4){
304
+        if(this.org_id == 10138 || this.org_id == 0 || this.$store.getters.xt_user.org_id == 4 || this.org_id == 10278){
305 305
           getPrivateExpenses(params).then(response => {
306 306
             if (response.data.state == 0) {
307 307
               // this.$message.error(response.data.msg)

+ 234 - 36
src/xt_pages/sign/lineUp.vue Целия файл

@@ -77,38 +77,46 @@
77 77
                     <div class="callingBox">
78 78
                         <div :class="(queueConfig.jzjhyc == 1 && queueConfig.sjjhyc == 0) ? 'callingBoxLeft1' : 'callingBoxLeft'" v-if="queueConfig.jzjhyc == 1">
79 79
                             <div class="callingTitle"><span style="margin: 0 auto;">接<br />诊<br />叫<br />号</span></div>
80
-                            <div style="flex: 1;">
80
+                            <div style="flex: 1;justify-content: space-between;display: flex;flex-direction: column;">
81 81
                                 <div class="callingTop" style="margin-bottom:10px;">
82 82
                                     <div class="callingTopTip"><span style="margin: 0 auto;">正在<br />接诊</span></div>
83 83
                                     <div class="callingContent">
84
-                                        <p style="margin:50px 0 14px;"><span v-for="(item,index) in (receivingPatient || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
85
-                                        <p><span v-for="(item,index) in (receivingPatient || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
84
+                                        <div>
85
+                                            <p><span v-for="(item,index) in (receivingPatient || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
86
+                                            <p><span v-for="(item,index) in (receivingPatient || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
87
+                                        </div>
86 88
                                     </div>
87 89
                                 </div>
88 90
                                 <div class="callingTop" style="border-radius: 0 0 15px 0;">
89 91
                                     <div class="callingTopTip"><span style="margin: 0 auto;">等待<br />接诊</span></div>
90 92
                                     <div class="callingContent">
91
-                                        <p style="margin:50px 0 14px;"><span v-for="(item,index) in (waitDoctorList || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
92
-                                        <p><span v-for="(item,index) in (waitDoctorList || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
93
+                                        <div>
94
+                                            <p><span v-for="(item,index) in (waitDoctorList || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
95
+                                            <p><span v-for="(item,index) in (waitDoctorList || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
96
+                                        </div>
93 97
                                     </div>
94 98
                                 </div>
95 99
                             </div>
96 100
                         </div>
97 101
                         <div :class="(queueConfig.jzjhyc == 0 && queueConfig.sjjhyc == 1) ? 'callingBoxLeft1' : 'callingBoxLeft'" v-if="queueConfig.sjjhyc == 1">
98 102
                             <div class="callingTitle newCallingTitle"><span style="margin: 0 auto;">上<br />机<br />叫<br />号</span></div>
99
-                            <div style="flex: 1;">
103
+                            <div style="flex: 1;justify-content: space-between;display: flex;flex-direction: column;">
100 104
                                 <div class="callingTop" style="margin-bottom:10px;">
101 105
                                     <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">正在<br />叫号</span></div>
102 106
                                     <div class="callingContent newCallingContent">
103
-                                        <p style="margin:50px 0 14px;"><span v-for="(item,index) in (upPatientList || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
104
-                                        <p><span v-for="(item,index) in (upPatientList || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
107
+                                        <div>
108
+                                            <p><span v-for="(item,index) in (upPatientList || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
109
+                                            <p><span v-for="(item,index) in (upPatientList || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
110
+                                        </div>
105 111
                                     </div>
106 112
                                 </div>
107 113
                                 <div class="callingTop" style="border-radius: 0 0 15px 0;">
108 114
                                     <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">等待<br />叫号</span></div>
109 115
                                     <div class="callingContent newCallingContent">
110
-                                        <p style="margin:50px 0 14px;"><span v-for="(item,index) in (receivingPatient || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
111
-                                        <p><span v-for="(item,index) in (receivingPatient || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
116
+                                        <div>
117
+                                            <p><span v-for="(item,index) in (receivingPatient || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
118
+                                            <p><span v-for="(item,index) in (receivingPatient || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
119
+                                        </div>
112 120
                                     </div>
113 121
                                 </div>
114 122
                             </div>
@@ -117,6 +125,91 @@
117 125
                 </div>
118 126
                 
119 127
             </div>
128
+        
129
+            <!-- <div class="page_lineUp">
130
+                <div class="lineUpTitle">
131
+                    <div>{{ this.$store.getters.xt_user.org.org_name }}<span>&nbsp;&nbsp;温馨提示:请注意排队叫号,依次叫号就诊上机,谢谢配合</span></div>
132
+                    <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
133
+                </div>
134
+                <div class="lineUpMain">
135
+                    <div class="lineUpMainLeft">
136
+                        <div class="lineUpMainLeftTitle">
137
+                            <p style="width:12%">排队号</p>
138
+                            <p style="width:14%">姓名</p>
139
+                            <p style="width:14%">病例号</p>
140
+                            <p style="width:14%">床位号</p>
141
+                            <p style="width:14%">治疗状态</p>
142
+                            <p style="width:14%">上机时间</p>
143
+                            <p style="width:16%">预计下机时间</p>
144
+                        </div>
145
+                        <div class="lineUpList">
146
+                            <div class="lineUpListOne" v-for="(item,index) in 6" :key="index">
147
+                                <p style="width:12%">
148
+                                    <span>上午</span>
149
+                                    {{ 89 }}号
150
+                                </p>
151
+                                <p style="width:14%">{{ '张三' }}</p>
152
+                                <p style="width:14%">{{ 3023 }}</p>
153
+                                <p style="width:14%">{{ 'A区' + '098' }}</p>
154
+                                <p style="width:14%">
155
+                                    <span>待接诊</span>
156
+                                </p>
157
+                                <p style="width:14%">07:38:00</p>
158
+                                <p style="width:16%">07:38:00</p>
159
+                            </div>
160
+                        </div>
161
+                    </div> 
162
+                    <div class="callingBox">
163
+                        <div class="callingBoxLeft">
164
+                            <div class="callingTitle"><span style="margin: 0 auto;">接<br />诊<br />叫<br />号</span></div>
165
+                            <div style="flex: 1;justify-content: space-between;display: flex;flex-direction: column;">
166
+                                <div class="callingTop">
167
+                                    <div class="callingTopTip"><span style="margin: 0 auto;">正在<br />接诊</span></div>
168
+                                    <div class="callingContent">
169
+                                        <div>
170
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
171
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
172
+                                        </div>
173
+                                    </div>
174
+                                </div>
175
+                                <div class="callingTop" style="border-radius: 0 0 15px 0;">
176
+                                    <div class="callingTopTip"><span style="margin: 0 auto;">等待<br />接诊</span></div>
177
+                                    <div class="callingContent">
178
+                                        <div>
179
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
180
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
181
+                                        </div>
182
+                                    </div>
183
+                                </div>
184
+                            </div>
185
+                        </div>
186
+                        <div class="callingBoxLeft">
187
+                            <div class="callingTitle newCallingTitle"><span style="margin: 0 auto;">上<br />机<br />叫<br />号</span></div>
188
+                            <div style="flex: 1;justify-content: space-between;display: flex;flex-direction: column;">
189
+                                <div class="callingTop">
190
+                                    <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">正在<br />叫号</span></div>
191
+                                    <div class="callingContent newCallingContent">
192
+                                        <div>
193
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
194
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
195
+                                        </div>
196
+                                    </div>
197
+                                </div>
198
+                                <div class="callingTop" style="border-radius: 0 0 15px 0;">
199
+                                    <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">等待<br />叫号</span></div>
200
+                                    <div class="callingContent newCallingContent">
201
+                                        <div>
202
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
203
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
204
+                                        </div>
205
+                                    </div>
206
+                                </div>
207
+                            </div>
208
+                        </div>
209
+                    </div>
210
+                </div>
211
+                
212
+            </div> -->
120 213
         </div>
121 214
         <div class="app-container">
122 215
             <div class="page_lineUp">
@@ -161,38 +254,46 @@
161 254
                     <div class="callingBox">
162 255
                         <div :class="(queueConfig.jzjhyc == 1 && queueConfig.sjjhyc == 0) ? 'callingBoxLeft1' : 'callingBoxLeft'" v-if="queueConfig.jzjhyc == 1">
163 256
                             <div class="callingTitle"><span style="margin: 0 auto;">接<br />诊<br />叫<br />号</span></div>
164
-                            <div style="flex: 1;">
257
+                            <div style="flex: 1;justify-content: space-between;display: flex;flex-direction: column;">
165 258
                                 <div class="callingTop" style="margin-bottom:10px;">
166 259
                                     <div class="callingTopTip"><span style="margin: 0 auto;">正在<br />接诊</span></div>
167 260
                                     <div class="callingContent">
168
-                                        <p style="margin:50px 0 14px;"><span v-for="(item,index) in (receivingPatient || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
169
-                                        <p><span v-for="(item,index) in (receivingPatient || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
261
+                                        <div>
262
+                                            <p><span v-for="(item,index) in (receivingPatient || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
263
+                                            <p><span v-for="(item,index) in (receivingPatient || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
264
+                                        </div>
170 265
                                     </div>
171 266
                                 </div>
172 267
                                 <div class="callingTop" style="border-radius: 0 0 15px 0;">
173 268
                                     <div class="callingTopTip"><span style="margin: 0 auto;">等待<br />接诊</span></div>
174 269
                                     <div class="callingContent">
175
-                                        <p style="margin:50px 0 14px;"><span v-for="(item,index) in (waitDoctorList || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
176
-                                        <p><span v-for="(item,index) in (waitDoctorList || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
270
+                                        <div>
271
+                                            <p><span v-for="(item,index) in (waitDoctorList || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
272
+                                            <p><span v-for="(item,index) in (waitDoctorList || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
273
+                                        </div>
177 274
                                     </div>
178 275
                                 </div>
179 276
                             </div>
180 277
                         </div>
181 278
                         <div :class="(queueConfig.jzjhyc == 0 && queueConfig.sjjhyc == 1) ? 'callingBoxLeft1' : 'callingBoxLeft'" v-if="queueConfig.sjjhyc == 1">
182 279
                             <div class="callingTitle newCallingTitle"><span style="margin: 0 auto;">上<br />机<br />叫<br />号</span></div>
183
-                            <div style="flex: 1;">
280
+                            <div style="flex: 1;justify-content: space-between;display: flex;flex-direction: column;">
184 281
                                 <div class="callingTop" style="margin-bottom:10px;">
185 282
                                     <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">正在<br />叫号</span></div>
186 283
                                     <div class="callingContent newCallingContent">
187
-                                        <p style="margin:50px 0 14px;"><span v-for="(item,index) in (upPatientList || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
188
-                                        <p><span v-for="(item,index) in (upPatientList || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
284
+                                        <div>
285
+                                            <p><span v-for="(item,index) in (upPatientList || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
286
+                                            <p><span v-for="(item,index) in (upPatientList || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
287
+                                        </div>
189 288
                                     </div>
190 289
                                 </div>
191 290
                                 <div class="callingTop" style="border-radius: 0 0 15px 0;">
192 291
                                     <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">等待<br />叫号</span></div>
193 292
                                     <div class="callingContent newCallingContent">
194
-                                        <p style="margin:50px 0 14px;"><span v-for="(item,index) in (receivingPatient || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
195
-                                        <p><span v-for="(item,index) in (receivingPatient || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
293
+                                        <div>
294
+                                            <p><span v-for="(item,index) in (receivingPatient || '').slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
295
+                                            <p><span v-for="(item,index) in (receivingPatient || '').slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
296
+                                        </div>
196 297
                                     </div>
197 298
                                 </div>
198 299
                             </div>
@@ -201,6 +302,91 @@
201 302
                 </div>
202 303
                 
203 304
             </div>
305
+        
306
+            <!-- <div class="page_lineUp">
307
+                <div class="lineUpTitle">
308
+                    <div>{{ this.$store.getters.xt_user.org.org_name }}<span>&nbsp;&nbsp;温馨提示:请注意排队叫号,依次叫号就诊上机,谢谢配合</span></div>
309
+                    <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
310
+                </div>
311
+                <div class="lineUpMain">
312
+                    <div class="lineUpMainLeft">
313
+                        <div class="lineUpMainLeftTitle">
314
+                            <p style="width:12%">排队号</p>
315
+                            <p style="width:14%">姓名</p>
316
+                            <p style="width:14%">病例号</p>
317
+                            <p style="width:14%">床位号</p>
318
+                            <p style="width:14%">治疗状态</p>
319
+                            <p style="width:14%">上机时间</p>
320
+                            <p style="width:16%">预计下机时间</p>
321
+                        </div>
322
+                        <div class="lineUpList">
323
+                            <div class="lineUpListOne" v-for="(item,index) in 6" :key="index">
324
+                                <p style="width:12%">
325
+                                    <span>上午</span>
326
+                                    {{ 89 }}号
327
+                                </p>
328
+                                <p style="width:14%">{{ '张三' }}</p>
329
+                                <p style="width:14%">{{ 3023 }}</p>
330
+                                <p style="width:14%">{{ 'A区' + '098' }}</p>
331
+                                <p style="width:14%">
332
+                                    <span>待接诊</span>
333
+                                </p>
334
+                                <p style="width:14%">07:38:00</p>
335
+                                <p style="width:16%">07:38:00</p>
336
+                            </div>
337
+                        </div>
338
+                    </div> 
339
+                    <div class="callingBox">
340
+                        <div class="callingBoxLeft">
341
+                            <div class="callingTitle"><span style="margin: 0 auto;">接<br />诊<br />叫<br />号</span></div>
342
+                            <div style="flex: 1;justify-content: space-between;display: flex;flex-direction: column;">
343
+                                <div class="callingTop">
344
+                                    <div class="callingTopTip"><span style="margin: 0 auto;">正在<br />接诊</span></div>
345
+                                    <div class="callingContent">
346
+                                        <div>
347
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
348
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
349
+                                        </div>
350
+                                    </div>
351
+                                </div>
352
+                                <div class="callingTop" style="border-radius: 0 0 15px 0;">
353
+                                    <div class="callingTopTip"><span style="margin: 0 auto;">等待<br />接诊</span></div>
354
+                                    <div class="callingContent">
355
+                                        <div>
356
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
357
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
358
+                                        </div>
359
+                                    </div>
360
+                                </div>
361
+                            </div>
362
+                        </div>
363
+                        <div class="callingBoxLeft">
364
+                            <div class="callingTitle newCallingTitle"><span style="margin: 0 auto;">上<br />机<br />叫<br />号</span></div>
365
+                            <div style="flex: 1;justify-content: space-between;display: flex;flex-direction: column;">
366
+                                <div class="callingTop">
367
+                                    <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">正在<br />叫号</span></div>
368
+                                    <div class="callingContent newCallingContent">
369
+                                        <div>
370
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
371
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
372
+                                        </div>
373
+                                    </div>
374
+                                </div>
375
+                                <div class="callingTop" style="border-radius: 0 0 15px 0;">
376
+                                    <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">等待<br />叫号</span></div>
377
+                                    <div class="callingContent newCallingContent">
378
+                                        <div>
379
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
380
+                                            <p><span v-for="(item,index) in 3" :key="index">张三三、</span></p>
381
+                                        </div>
382
+                                    </div>
383
+                                </div>
384
+                            </div>
385
+                        </div>
386
+                    </div>
387
+                </div>
388
+                
389
+            </div> -->
204 390
         </div>
205 391
     </div>
206 392
 </template>
@@ -505,26 +691,32 @@ export default {
505 691
 </script>
506 692
 
507 693
 <style lang="scss" scoped>
694
+.main-contain{
695
+    height: 100%;
696
+}
508 697
 .page_lineUp{
698
+    height: 100%;
509 699
     .lineUpTitle{
510
-        height: 50px;
700
+        height: 4vh;
511 701
         background: #1A82BF;
512 702
         display: flex;
513 703
         justify-content: space-between;
514 704
         align-items: center;
515 705
         padding: 0 20px;
516 706
         color:#fff;
517
-        font-size: 20px;
707
+        font-size: 2vh;
518 708
         font-weight: 600;
519 709
     }
520 710
     .lineUpMain{
521 711
         background: linear-gradient(0deg, #76ECEC, #479CD2);
522
-        height: 1080px;
712
+        height: 95%;
523 713
         padding:10px;
524 714
     }
525 715
     .lineUpMainLeft{
526
-        height: 620px;
716
+        height: 60%;
527 717
         border-radius: 15px;
718
+        display: flex;
719
+        flex-direction: column;
528 720
         
529 721
     }
530 722
     .lineUpMainLeftTitle{
@@ -532,9 +724,9 @@ export default {
532 724
         justify-content: space-between;
533 725
         align-items: center;
534 726
         color:#fff;
535
-        font-size: 38px;
727
+        font-size: 4vh;
536 728
         font-weight: 600;
537
-        height:80px;
729
+        height:7vh;
538 730
         background: #1A82BF;
539 731
         border-radius: 15px 15px 0 0;
540 732
         >p{
@@ -542,8 +734,9 @@ export default {
542 734
         }
543 735
     }
544 736
     .lineUpList{
545
-        font-size: 35px;
737
+        font-size: 3vh;
546 738
         font-weight: 600;
739
+        flex: 1;
547 740
         >div:nth-child(odd){
548 741
             background: #F9FDFF;
549 742
         }
@@ -554,7 +747,7 @@ export default {
554 747
             border-radius: 0 0 15px 15px;
555 748
         }
556 749
         .lineUpListOne{
557
-            height:90px;
750
+            height:16%;
558 751
             display: flex;
559 752
             justify-content: space-between;
560 753
             align-items: center;
@@ -566,7 +759,7 @@ export default {
566 759
         }
567 760
     }
568 761
     .callingBox{
569
-        height: 430px;
762
+        height: 39%;
570 763
         margin-top: 10px;
571 764
         display: flex;
572 765
         justify-content: space-between;
@@ -577,16 +770,16 @@ export default {
577 770
             justify-content: space-between;
578 771
         }
579 772
         .callingBoxLeft1{
580
-            width: 99.5%;
773
+            width: 100%;
581 774
             height: 100%;
582 775
             display: flex;
583 776
             justify-content: space-between;
584 777
         }
585 778
         .callingTitle{
586
-            width: 130px;
779
+            width: 10vh;
587 780
             height: 100%;
588 781
             border-radius: 15px 0 0 15px;
589
-            font-size: 66px;
782
+            font-size: 5vh;
590 783
             font-weight:600;
591 784
             text-align: center;
592 785
             color: #fff;
@@ -599,16 +792,16 @@ export default {
599 792
             background: #1aa680;
600 793
         }
601 794
         .callingTop{
602
-            height: 210px;
795
+            height: 49.5%;
603 796
             border-radius: 0 15px 0 0;
604 797
             background: #F9FDFF;
605 798
             display: flex;
606 799
             justify-content: space-between;
607 800
             .callingTopTip{
608
-                width: 130px;
801
+                width: 10vh;
609 802
                 height: 100%;
610 803
                 color: #fff;
611
-                font-size: 40px;
804
+                font-size: 3vh;
612 805
                 font-weight: 600;
613 806
                 background: #1A82BF;
614 807
                 display: flex;
@@ -621,15 +814,19 @@ export default {
621 814
                 flex: 1;
622 815
                 display: flex;
623 816
                 flex-direction: column;
624
-                font-size: 50px;
817
+                font-size: 4vh;
625 818
                 color:#1C6895;
626 819
                 font-weight: 600;
627 820
                 padding-left: 20px;
821
+                justify-content: space-around;
628 822
                 >p{
629 823
                     width:100%;
630 824
                     text-align: left;
631 825
                     line-height: 50px;
632 826
                 }
827
+                div>:first-child{
828
+                    margin-bottom: 10px;
829
+                }
633 830
             }
634 831
             .newCallingContent{
635 832
                 color:#1aa680;
@@ -648,6 +845,7 @@ export default {
648 845
   background: #fff;
649 846
   padding: 20px;
650 847
   z-index:5000;
848
+  height: 100%;
651 849
 }
652 850
 #fullscreenbroad #fullscreenbroad-setting {
653 851
   float: right;

+ 124 - 27
src/xt_pages/sign/signIn.vue Целия файл

@@ -41,7 +41,7 @@
41 41
                     <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
42 42
                 </div>
43 43
                 <div class="signInMain">
44
-                    <div style="display: flex;justify-content: space-between;padding:10px;">
44
+                    <div style="display: flex;justify-content: space-between;padding:10px;height:100%;">
45 45
                         <div :class="Object.keys(queueInfo).length>0 ? 'signInMainLeft' : 'signInMainLeft100'">
46 46
                             <div class="signInMainLeftTitle">
47 47
                                 <p>排队号</p>
@@ -82,6 +82,50 @@
82 82
                     </div>
83 83
                 </div>
84 84
             </div>
85
+        
86
+            <!-- <div class="page_signIn">
87
+                <div class="signInTitle">
88
+                    <div>{{ this.$store.getters.xt_user.org.org_name }}</div>
89
+                    <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
90
+                </div>
91
+                <div class="signInMain">
92
+                    <div style="display: flex;justify-content: space-between;padding:10px;height:100%;">
93
+                        <div class="signInMainLeft">
94
+                            <div class="signInMainLeftTitle">
95
+                                <p>排队号</p>
96
+                                <p>姓名</p>
97
+                                <p>病历号</p>
98
+                                <p>签到时间</p>
99
+                            </div>
100
+                            <div class="signInList">
101
+                                <div class="signInListOne" v-for="(item,index) in 10" :key="index">
102
+                                    <p>
103
+                                        上午2号
104
+                                    </p>
105
+                                    <p>张三</p>
106
+                                    <p>400001</p>
107
+                                    <p>07:00</p>
108
+                                </div>
109
+                            </div>
110
+                        </div>
111
+                        <div class="signInMainRight">
112
+                            <div class="signInMainRightTitle"><span style="margin:0 auto;">张三</span></div>
113
+                            <div class="signInMainRightContent">
114
+                                <p style="margin: 0 auto;display:flex;align-items: center;"><span>排队号</span></p>
115
+                                <p style="margin: 0 auto;display:flex;align-items: center;">
116
+                                    <span>上午</span>
117
+                                    <span style="font-size:7vw">69号</span>
118
+                                </p>
119
+                            </div>
120
+                            <div class="signInMianRightBottom"><span style="margin:0 auto;">签到成功</span></div>
121
+                        </div>
122
+                    </div>
123
+                    <div class="signInTip">
124
+                        温馨提示:请注意排队叫号,依次叫号就诊上机,谢谢配合
125
+                    </div>
126
+                </div>
127
+            </div> -->
128
+        
85 129
         </div>
86 130
         <div class="app-container">
87 131
             <div class="page_signIn">
@@ -90,7 +134,7 @@
90 134
                     <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
91 135
                 </div>
92 136
                 <div class="signInMain">
93
-                    <div style="display: flex;justify-content: space-between;padding:10px;">
137
+                    <div style="display: flex;justify-content: space-between;padding:10px;height:100%;">
94 138
                         <div :class="Object.keys(queueInfo).length>0 ? 'signInMainLeft' : 'signInMainLeft100'">
95 139
                             <div class="signInMainLeftTitle">
96 140
                                 <p>排队号</p>
@@ -120,7 +164,7 @@
120 164
                                     <span v-if="queueInfo.schedule_type == 1">上午</span>
121 165
                                     <span v-if="queueInfo.schedule_type == 2">下午</span>
122 166
                                     <span v-if="queueInfo.schedule_type == 3">晚上</span>
123
-                                    <span style="font-size:180px;">{{ queueInfo.queue_no }}号</span>
167
+                                    <span style="font-size:7vw;">{{ queueInfo.queue_no }}号</span>
124 168
                                 </p>
125 169
                             </div>
126 170
                             <div class="signInMianRightBottom"><span style="margin:0 auto;" v-if='Object.keys(queueInfo).length>0'>签到成功</span></div>
@@ -131,6 +175,49 @@
131 175
                     </div>
132 176
                 </div>
133 177
             </div>
178
+        
179
+            <!-- <div class="page_signIn">
180
+                <div class="signInTitle">
181
+                    <div>{{ this.$store.getters.xt_user.org.org_name }}</div>
182
+                    <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
183
+                </div>
184
+                <div class="signInMain">
185
+                    <div style="display: flex;justify-content: space-between;padding:10px;height:100%;">
186
+                        <div class="signInMainLeft">
187
+                            <div class="signInMainLeftTitle">
188
+                                <p>排队号</p>
189
+                                <p>姓名</p>
190
+                                <p>病历号</p>
191
+                                <p>签到时间</p>
192
+                            </div>
193
+                            <div class="signInList">
194
+                                <div class="signInListOne" v-for="(item,index) in 10" :key="index">
195
+                                    <p>
196
+                                        上午2号
197
+                                    </p>
198
+                                    <p>张三</p>
199
+                                    <p>400001</p>
200
+                                    <p>07:00</p>
201
+                                </div>
202
+                            </div>
203
+                        </div>
204
+                        <div class="signInMainRight">
205
+                            <div class="signInMainRightTitle"><span style="margin:0 auto;">张三</span></div>
206
+                            <div class="signInMainRightContent">
207
+                                <p style="margin: 0 auto;display:flex;align-items: center;"><span>排队号</span></p>
208
+                                <p style="margin: 0 auto;display:flex;align-items: center;">
209
+                                    <span>上午</span>
210
+                                    <span style="font-size:7vw">69号</span>
211
+                                </p>
212
+                            </div>
213
+                            <div class="signInMianRightBottom"><span style="margin:0 auto;">签到成功</span></div>
214
+                        </div>
215
+                    </div>
216
+                    <div class="signInTip">
217
+                        温馨提示:请注意排队叫号,依次叫号就诊上机,谢谢配合
218
+                    </div>
219
+                </div>
220
+            </div> -->
134 221
         </div>
135 222
     </div>
136 223
 </template>
@@ -341,42 +428,50 @@ export default {
341 428
 
342 429
 
343 430
 <style lang="scss" scoped>
431
+.main-contain{
432
+    height: 100%;
433
+}
344 434
 .page_signIn{
435
+    height: 98%;
345 436
     .signInTitle{
346
-        height: 50px;
437
+        height: 4vh;
347 438
         background: #1A82BF;
348 439
         display: flex;
349 440
         justify-content: space-between;
350 441
         align-items: center;
351 442
         padding: 0 20px;
352 443
         color:#fff;
353
-        font-size: 20px;
444
+        font-size: 2vh;
354 445
         font-weight: 600;
355 446
     }
356 447
     .signInMain{
357 448
         background: linear-gradient(0deg, #76ECEC, #479CD2);
358
-        height: 1040px;
449
+        height: 86%;
359 450
         
360 451
         
361 452
     }
362 453
     .signInMainLeft{
363
-        width:69%;
364
-        height: 980px;
454
+        width:70%;
455
+        // height: 100%;
365 456
         border-radius: 15px;
457
+        display: flex;
458
+        flex-direction: column;
366 459
     }
367 460
     .signInMainLeft100{
368 461
         width:100%;
369
-        height: 980px;
462
+        height: 100%;
370 463
         border-radius: 15px;
464
+        display: flex;
465
+        flex-direction: column;
371 466
     }
372 467
     .signInMainLeftTitle{
373 468
         display: flex;
374 469
         justify-content: space-between;
375 470
         align-items: center;
376 471
         color:#fff;
377
-        font-size: 38px;
472
+        font-size: 4vh;
378 473
         font-weight: 600;
379
-        height:80px;
474
+        height:7vh;
380 475
         background: #1A82BF;
381 476
         border-radius: 15px 15px 0 0;
382 477
         >p{
@@ -385,16 +480,17 @@ export default {
385 480
         }
386 481
     }
387 482
     .signInList{
388
-        font-size: 36px;
483
+        font-size: 3vh;
389 484
         font-weight: 600;
485
+        flex: 1;
390 486
         >div:nth-child(1){
391
-            font-size: 50px;
487
+            font-size: 4.5vh;
392 488
         }
393 489
         >div:nth-child(2){
394
-            font-size: 50px;
490
+            font-size: 4.5vh;
395 491
         }
396 492
         >div:nth-child(3){
397
-            font-size: 50px;
493
+            font-size: 4.5vh;
398 494
         }
399 495
         >div:nth-child(odd){
400 496
             background: #F9FDFF;
@@ -406,7 +502,7 @@ export default {
406 502
             border-radius: 0 0 15px 15px;
407 503
         }
408 504
         .signInListOne{
409
-            height:90px;
505
+            height:10%;
410 506
             display: flex;
411 507
             justify-content: space-between;
412 508
             align-items: center;
@@ -419,16 +515,17 @@ export default {
419 515
     }
420 516
     .signInMainRight{
421 517
         width: 30%;
422
-        height: 980px;
518
+        // height: 100%;
519
+        margin-left: 10px;
423 520
     }
424 521
     .noneSignInMainRight{
425 522
         display: none;
426 523
     }
427 524
     .signInMainRightTitle{
428
-        height: 260px;
525
+        height: 27.5%;
429 526
         border-radius: 15px 15px 0 0;
430 527
         background: #1A82BF;
431
-        font-size: 120px;
528
+        font-size: 14vh;
432 529
         font-weight: 600;
433 530
         color:#fff;
434 531
         display: flex;
@@ -437,22 +534,22 @@ export default {
437 534
     }
438 535
     .signInMainRightContent{
439 536
         background: #F9FDFF;
440
-        height: 450px;
537
+        height: 54.5%;
441 538
         text-align: center;
442 539
         font-weight: 600;
443 540
         color:#1C6895;
444 541
         box-sizing: border-box;
445
-        font-size:90px;
542
+        font-size:8vh;
446 543
         display:flex;
447 544
         align-items:center;
448 545
         flex-direction: column;
449 546
         justify-content: space-around;
450 547
     }
451 548
     .signInMianRightBottom{
452
-        height: 270px;
549
+        height: 18%;
453 550
         background: #1A82BF;
454 551
         border-radius: 0 0 15px 15px;
455
-        font-size: 90px;
552
+        font-size: 8vh;
456 553
         font-weight: 600;
457 554
         color:#fff;
458 555
         display: flex;
@@ -461,14 +558,13 @@ export default {
461 558
     }
462 559
     .signInTip{
463 560
         color:#fff;
464
-        font-size: 18px;
561
+        font-size: 1.5vw;
465 562
         font-weight: 600;
466 563
         display: flex;
467 564
         align-items: center;
468
-        height: 50px;
565
+        height: 3vw;
469 566
         background: linear-gradient(0deg, #42A9E7, #3686B9, #42A9E7);
470
-        margin-top: 1px;
471
-        padding-left:20px;
567
+        padding-left:2vw;
472 568
     }
473 569
 }
474 570
 #fullscreenbroad {
@@ -482,6 +578,7 @@ export default {
482 578
   background: #fff;
483 579
   padding: 20px;
484 580
   z-index:5000;
581
+  height: 100%;
485 582
 }
486 583
 #fullscreenbroad #fullscreenbroad-setting {
487 584
   float: right;

+ 34 - 49
src/xt_pages/stock/drugs/components/drugOutDetail.vue Целия файл

@@ -71,46 +71,7 @@
71 71
       </div>
72 72
     </div>
73 73
 
74
-    
75
-
76
-    <!-- <div class="cell clearfix">
77
-      <label class="title"><span class="name">单据类型</span> : </label>
78
-      <el-select
79
-        size="small"
80
-        v-model="order_type"
81
-        clearable
82
-        placeholder="单据类型"
83
-        @change="changeType"
84
-      >
85
-        <el-option
86
-          v-for="item in orderTypeArr"
87
-          :key="item.value"
88
-          :label="item.label"
89
-          :value="item.value"
90
-        >
91
-        </el-option>
92
-      </el-select>
93
-    </div> -->
94
-
95
-    <!-- <div class="cell clearfix">
96
-      <label class="title"><span class="name">其它</span> : </label>
97
-      <el-select
98
-        size="small"
99
-        v-model="manufacturer_id"
100
-        clearable
101
-        placeholder="厂商"
102
-        @change="changeManufacturer"
103
-      >
104
-        <el-option
105
-          v-for="item in manufacturer"
106
-          :key="item.id"
107
-          :label="item.manufacturer_name"
108
-          :value="item.id"
109
-        >
110
-        </el-option>
111
-      </el-select>
112
-    </div> -->
113
-
74
+  
114 75
     <el-row :gutter="12" style="margin-top: 10px">
115 76
       <el-table
116 77
         :data="tableData"
@@ -166,8 +127,11 @@
166 127
         </el-table-column>
167 128
         <el-table-column label="出货价" align="center">
168 129
           <template slot-scope="scope">
169
-           <span v-if="org_id == 9919 || org_id == 9671">{{scope.row.last_price}} </span> 
170
-           <span v-else>{{scope.row.price}}</span>
130
+           <span v-if="org_id == 9919">{{scope.row.last_price}} </span> 
131
+           <span v-else>
132
+             <span v-if="scope.row.price >0"> {{scope.row.price}}</span>
133
+            <span v-if="scope.row.price  == 0"> {{getPrice(scope.row.drug_id)}}</span>
134
+           </span>
171 135
           </template>
172 136
         </el-table-column>
173 137
         <el-table-column label="数量" align="center">
@@ -177,8 +141,12 @@
177 141
         </el-table-column>
178 142
         <el-table-column label="总价" align="center">
179 143
           <template slot-scope="scope">
180
-            
181
-            {{scope.row.total_price}}
144
+           <span v-if="org_id == 9919">{{(scope.row.last_price * scope.row.count).toFixed(2)}} </span> 
145
+           <span v-else>
146
+             <span v-if="scope.row.price >0">{{(scope.row.last_price * scope.row.count).toFixed(2)}}</span>
147
+             <span v-if="scope.row.price  == 0">{{(getPrice(scope.row.drug_id)* scope.row.count).toFixed(2)}}</span>
148
+           </span>
149
+            <!-- {{scope.row.total_price}} -->
182 150
           </template>
183 151
         </el-table-column>
184 152
       </el-table>
@@ -424,12 +392,20 @@ export default {
424 392
           for(let i=0;i<order.length;i++){
425 393
              order[i].specification_name  = order[i].dose + order[i].dose_unit + "*" + order[i].min_number +  order[i].min_unit + "/" + order[i].max_unit
426 394
              order[i].is_total = 0
427
-             if(this.org_id == 9919 || this.org_id == 9671){
395
+             if(this.org_id == 9919){
428 396
                order[i].total_price = order[i].count * order[i].last_price
429 397
                total_price += order[i].count * order[i].last_price
430 398
              }else{
431
-                order[i].total_price = order[i].count * order[i].price
432
-                total_price += order[i].count * order[i].price
399
+               if(order[i].price > 0){
400
+                 order[i].total_price = order[i].count * order[i].price
401
+                 total_price += order[i].count * order[i].price
402
+               }
403
+               if(order[i].price ==0 ){
404
+                  order[i].total_price = order[i].count * this.getPrice(order[i].drug_id)
405
+                  total_price += order[i].count * this.getPrice(order[i].drug_id)
406
+                  order[i].price = this.getPrice(order[i].drug_id)
407
+               } 
408
+               
433 409
              }
434 410
             
435 411
           }
@@ -451,7 +427,7 @@ export default {
451 427
            let objInfo = {}
452 428
           order.forEach((item,index)=>{
453 429
              let { drug_id } = item
454
-             if(this.org_id == 9671 || this.org_id == 9919){
430
+             if( this.org_id == 9919){
455 431
               if(!objInfo[drug_id]){
456 432
                 objInfo[drug_id] = {
457 433
                   drug_id,
@@ -540,7 +516,7 @@ export default {
540 516
           this.tablePrint[i].index = i+1
541 517
         }
542 518
         for(let i=0;i<this.tablePrint.length;i++){
543
-           if(this.org_id == 9671 || this.org_id == 9919 ){
519
+           if(this.org_id == 9919 ){
544 520
            
545 521
              this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
546 522
              this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
@@ -795,6 +771,15 @@ export default {
795 771
           }
796 772
         }
797 773
         return name
774
+      },
775
+      getPrice(drug_id){
776
+        var price = ""
777
+        for(let i=0;i<this.drugList.length;i++){
778
+          if(drug_id == this.drugList[i].id){
779
+             price = this.drugList[i].min_price
780
+          }
781
+        }
782
+        return price
798 783
       } 
799 784
   }
800 785
 };

+ 10 - 1
src/xt_pages/stock/drugs/drugStockFlow.vue Целия файл

@@ -109,7 +109,8 @@
109 109
        
110 110
         <el-table-column prop="drug_name" label="单价" align="center">
111 111
            <template slot-scope="scope">
112
-              <span>{{scope.row.price}}</span>
112
+              <span v-if="scope.row.price >0">{{scope.row.price}}</span>
113
+              <span v-if="scope.row.price == 0">{{getPrice(scope.row.drug_id)}}</span>
113 114
            </template>
114 115
         </el-table-column>
115 116
          <el-table-column prop="drug_name" label="有效期" align="center">
@@ -268,6 +269,7 @@
268 269
             this.total = total
269 270
             var manufacturerList = response.data.data.manufacturerList
270 271
             this.manufacturerList = manufacturerList
272
+            this.drug =  response.data.data.drug
271 273
          
272 274
            }
273 275
          })  
@@ -518,6 +520,13 @@
518 520
            name = this.drug.drug_name
519 521
         }
520 522
         return name
523
+     },
524
+     getPrice(id){
525
+       var min_price = 0 
526
+       if(id == this.drug.id){
527
+         min_price = this.drug.min_price
528
+       }
529
+       return min_price
521 530
      }
522 531
     }
523 532
   }

+ 52 - 50
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Целия файл

@@ -593,55 +593,55 @@ export default {
593 593
         return "";
594 594
       }
595 595
     },
596
-    showDialog(index, row) {
597
-      this.currentIndex = index;
598
-      const loading = this.$loading({
599
-        lock: true,
600
-        text: "Loading",
601
-        spinner: "el-icon-loading",
602
-        background: "rgba(0, 0, 0, 0.7)"
603
-      });
604
-
605
-      const params = {
606
-        manufacturer_id: this.form.manufacturer,
607
-        dealer_id: this.form.dealer
608
-      };
609
-      GetAllDrugInfoByID(params).then(response => {
610
-        if (response.data.state == 0) {
611
-          this.$message.error(response.data.msg);
612
-          return false;
613
-        } else {
614
-          if (response.data.data.drugs.length <= 0) {
615
-            this.$message.error("该厂商或经销商没有药品信息");
616
-            loading.close();
617
-
618
-            return;
619
-          }
620
-          this.$refs.dialog.show();
621
-          for (let i = 0; i < response.data.data.drugs.length; i++) {
622
-            this.propForm.goods.push(
623
-              response.data.data.drugs[i]
624
-            );
625
-          }
626
-          const obj = {};
627
-          this.propForm.goods = this.propForm.goods.reduce(
628
-            (cur, next) => {
629
-              obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
630
-              return cur;
631
-            },
632
-            []
633
-          ); // 设置cur默认类型为数组,并且初始值为空的数组
634
-        }
635
-
636
-        for (let i = 0; i < this.propForm.goods.length; i++) {
637
-          for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
638
-            var respObj = this.propForm.goods[i].drug_specs[a];
639
-            respObj["isSelected"] = false;
640
-          }
641
-        }
642
-        loading.close();
643
-      });
644
-    },
596
+    // showDialog(index, row) {
597
+    //   this.currentIndex = index;
598
+    //   const loading = this.$loading({
599
+    //     lock: true,
600
+    //     text: "Loading",
601
+    //     spinner: "el-icon-loading",
602
+    //     background: "rgba(0, 0, 0, 0.7)"
603
+    //   });
604
+
605
+    //   const params = {
606
+    //     manufacturer_id: this.form.manufacturer,
607
+    //     dealer_id: this.form.dealer
608
+    //   };
609
+    //   GetAllDrugInfoByID(params).then(response => {
610
+    //     if (response.data.state == 0) {
611
+    //       this.$message.error(response.data.msg);
612
+    //       return false;
613
+    //     } else {
614
+    //       if (response.data.data.drugs.length <= 0) {
615
+    //         this.$message.error("该厂商或经销商没有药品信息");
616
+    //         loading.close();
617
+
618
+    //         return;
619
+    //       }
620
+    //       this.$refs.dialog.show();
621
+    //       for (let i = 0; i < response.data.data.drugs.length; i++) {
622
+    //         this.propForm.goods.push(
623
+    //           response.data.data.drugs[i]
624
+    //         );
625
+    //       }
626
+    //       const obj = {};
627
+    //       this.propForm.goods = this.propForm.goods.reduce(
628
+    //         (cur, next) => {
629
+    //           obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
630
+    //           return cur;
631
+    //         },
632
+    //         []
633
+    //       ); // 设置cur默认类型为数组,并且初始值为空的数组
634
+    //     }
635
+
636
+    //     for (let i = 0; i < this.propForm.goods.length; i++) {
637
+    //       for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
638
+    //         var respObj = this.propForm.goods[i].drug_specs[a];
639
+    //         respObj["isSelected"] = false;
640
+    //       }
641
+    //     }
642
+    //     loading.close();
643
+    //   });
644
+    // },
645 645
     back() {
646 646
       this.$router.go(-1);
647 647
     },
@@ -712,6 +712,7 @@ export default {
712 712
       });
713 713
     },
714 714
     GetOrderDetail: function(order_id) {
715
+      this.listLoading = true
715 716
       const params = {
716 717
         id: order_id
717 718
       };
@@ -789,6 +790,7 @@ export default {
789 790
             this.warehouse.warehousing_time,
790 791
             "{y}-{m}-{d}"
791 792
           );
793
+          this.listLoading = false
792 794
         }
793 795
       });
794 796
     },
@@ -877,7 +879,7 @@ export default {
877 879
   created() {
878 880
    
879 881
     this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
880
-    this.GetConfigInfo();
882
+    //this.GetConfigInfo();
881 883
     this.propForm.goodUnit = this.$store.getters.good_unit;
882 884
     const order_id = this.$route.query.id;
883 885
     this.GetOrderDetail(order_id);

+ 5 - 3
src/xt_pages/stock/drugs/drugStockOutOrder.vue Целия файл

@@ -224,7 +224,8 @@
224 224
           </el-table-column>
225 225
           <el-table-column label="出货单价" align="center">
226 226
             <template slot-scope="scope">
227
-              {{scope.row.price}}
227
+              <span v-if="scope.row.price > 0"> {{scope.row.price}}</span>
228
+              <span v-if="scope.row.price == 0"> {{scope.row.retail_price}}</span>
228 229
             </template>
229 230
           </el-table-column>
230 231
           <!-- <el-table-column label="拆零零售价" align="center">
@@ -234,7 +235,8 @@
234 235
           </el-table-column> -->
235 236
           <el-table-column label="总价" align="center">
236 237
             <template slot-scope="scope">
237
-              <span>{{getAllPriceOne(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
238
+              <span v-if="scope.row.price > 0">{{getAllPriceOne(scope.row.drug_id,scope.row.price,scope.row.min_price).toFixed(2)}}</span>
239
+              <span v-if="scope.row.price == 0">{{getAllPriceOne(scope.row.drug_id,scope.row.retail_price,scope.row.min_price).toFixed(2)}}</span>
238 240
             </template>
239 241
           </el-table-column>
240 242
           <el-table-column label="生产厂家" align="center">
@@ -916,7 +918,7 @@ export default {
916 918
           this.tableShow = true
917 919
           this.tableList = []
918 920
           var list =  response.data.data.list
919
-     
921
+         
920 922
          this.manufacturerList = response.data.data.manufacturerList
921 923
          this.dealerList = response.data.data.dealerList
922 924
          var drugFlowList = response.data.data.drugFlowList

+ 688 - 0
src/xt_pages/supply/components/addGoodOrder.vue Целия файл

@@ -0,0 +1,688 @@
1
+<template>
2
+<div class="main-contain">
3
+<div class="position">
4
+    <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+</div>
6
+<div class="app-container"  v-loading="loading">
7
+    <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
+    <div>
9
+        <span style="color:red">*</span><span>供应商:</span>
10
+        <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
11
+        @change="changeTypeName">
12
+        <el-option
13
+            v-for="item in supplyList"
14
+            :key="item.id"
15
+            :label="item.supplier_name"
16
+            :value="item.id">
17
+        </el-option>
18
+        </el-select>
19
+        <span>单据日期:</span>
20
+        <el-date-picker
21
+        size="small"
22
+        v-model="start_time"
23
+        prefix-icon="el-icon-date"
24
+        :editable="false"
25
+        style="width: 196px;"
26
+        type="date"
27
+        placeholder="选择日期时间"
28
+        align="right"
29
+        format="yyyy-MM-dd"
30
+        value-format="yyyy-MM-dd"
31
+        @change="startTimeChange"
32
+        ></el-date-picker>
33
+        <span>交货日期:</span>
34
+        <el-date-picker
35
+            size="small"
36
+            v-model="end_time"
37
+            prefix-icon="el-icon-date"
38
+            :editable="false"
39
+            style="width: 196px;"
40
+            type="date"
41
+            placeholder="选择日期时间"
42
+            align="right"
43
+            format="yyyy-MM-dd"
44
+            value-format="yyyy-MM-dd"
45
+            @change="endTimeChange"
46
+        ></el-date-picker>
47
+        <span>单据编码:{{number}}</span>
48
+
49
+    </div>
50
+    <div>
51
+        <el-button size="small" type="primary" @click="toAdd">生成购货单</el-button>
52
+        <el-button size="small" type="primary" @click="updatePurchaseOrder">修改</el-button>
53
+        <el-button size="small" type="primary" @click="toPrint">打印</el-button>
54
+        <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder">审核</el-button>
55
+        <el-button size="small" type="primary" v-if="is_check == 1" @click="checkPurchaseOrder">反审核</el-button>
56
+       
57
+    </div>
58
+    </div>
59
+
60
+   <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
61
+    <el-table
62
+    :row-style="{ color: '#303133' }"
63
+    :header-cell-style="{
64
+        backgroundColor: 'rgb(245, 247, 250)',
65
+        color: '#606266'
66
+    }"
67
+    :data="recordInfo.tableList"
68
+    :class="signAndWeighBoxPatients"
69
+    border
70
+    style="width: 100%"
71
+    max-height="450"
72
+    >
73
+    <el-table-column align="center" width="200px">
74
+        <template slot="header" slot-scope="scope">
75
+            <span>商品<span style="color: red">*</span></span>
76
+        </template>
77
+        <template slot-scope="scope">
78
+           <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
79
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
80
+                <el-option
81
+                    v-for="(item,index) in tabList"
82
+                    :key="index"
83
+                    :label="item.supply_name"
84
+                    :value="item">
85
+                </el-option>
86
+             </el-select>
87
+           </el-form-item>
88
+        </template>
89
+    </el-table-column>
90
+    <el-table-column  align="center" width="150px">
91
+        <template slot="header" slot-scope="scope">
92
+            <span>商品类别</span>
93
+        </template>
94
+        <template slot-scope="scope">
95
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
96
+        </template>
97
+    </el-table-column>
98
+    <el-table-column label="规格&单位" align="center" width="200px">
99
+        <template slot-scope="scope">
100
+            <el-input v-model="scope.row.supply_specification_name" style="width:150px" :disabled="true"></el-input>
101
+        </template>
102
+    </el-table-column>
103
+     <el-table-column label="单位" align="center" width="120px">
104
+        <template slot="header" slot-scope="scope">
105
+            <span>单位<span style="color: red">*</span></span>
106
+        </template>
107
+        <template slot-scope="scope">
108
+          <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
109
+            <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
110
+                    <el-option
111
+                        v-for="(item,index) in scope.row.unitList"
112
+                        :key="index"
113
+                        :label="item.name"
114
+                        :value="item.name">
115
+                    </el-option>
116
+             </el-select>
117
+          </el-form-item>  
118
+        </template>
119
+    </el-table-column>
120
+    <el-table-column label="可用库存" align="center" width="130px">
121
+        <template slot-scope="scope">
122
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
123
+        </template>
124
+    </el-table-column>
125
+    <el-table-column label="数量" align="center" width="120px">
126
+        <template slot="header" slot-scope="scope">
127
+            <span>数量<span style="color: red">*</span></span>
128
+        </template>
129
+        <template slot-scope="scope">
130
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
131
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
132
+          </el-form-item>
133
+        </template>
134
+    </el-table-column>
135
+
136
+    <el-table-column label="购货单价" align="center" width="120px">
137
+        <template slot-scope="scope">
138
+        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
139
+        </template>
140
+    </el-table-column>
141
+
142
+    <el-table-column label="购货金额" align="center" width="120px">
143
+        <template slot-scope="scope">
144
+          {{calculate(scope.row.supply_count * scope.row.supply_price)}}
145
+        </template>
146
+    </el-table-column>
147
+
148
+    <el-table-column label="生产厂商" align="center" width="200px">
149
+        <template slot-scope="scope">
150
+        <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
151
+        </template>
152
+    </el-table-column>
153
+
154
+
155
+    <el-table-column label="批准文号" align="center" width="200px">
156
+        <template slot-scope="scope">
157
+        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="disabled"></el-input>
158
+        </template>
159
+    </el-table-column>
160
+
161
+    <el-table-column label="备注" align="center" width="200px">
162
+        <template slot-scope="scope">
163
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
164
+        </template>
165
+    </el-table-column>
166
+
167
+    <el-table-column label="操作" align="center" width="150px" fixed="right" >
168
+        <template slot-scope="scope">
169
+        <el-tooltip class="item" effect="dark" content="新增" placement="top" >
170
+            <el-button
171
+                size="mini"
172
+                type="primary"
173
+                icon="el-icon-circle-plus-outline"
174
+                @click="handleEdit(scope.$index, scope.row)">
175
+            </el-button>
176
+       </el-tooltip>
177
+       <el-tooltip class="item" effect="dark" content="删除" placement="top">
178
+            <el-button
179
+                size="mini"
180
+                type="danger"
181
+                icon="el-icon-delete"
182
+                @click="handleDelete(scope.$index, scope.row)">
183
+            </el-button>
184
+        </el-tooltip>
185
+
186
+        </template>
187
+    </el-table-column>
188
+  </el-table>
189
+</el-form>
190
+   <div style="margin-top:10px">
191
+      合计:{{getAllPrice()}} 元
192
+   </div>
193
+   <div style="margin-top:10px">
194
+        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
195
+
196
+        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
197
+
198
+    </div>
199
+</div>
200
+
201
+  <!-- <el-dialog
202
+  title="提示"
203
+  :visible.sync="dialogVisible"
204
+  width="30%"
205
+  :before-close="handleClose">
206
+  <span>这是一段信息</span>
207
+  <span slot="footer" class="dialog-footer">
208
+    <el-button @click="dialogVisible = false">取 消</el-button>
209
+    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
210
+  </span>
211
+  </el-dialog> -->
212
+</div>
213
+</template>
214
+
215
+<script>
216
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
217
+import {uParseTime } from '@/utils/tools'
218
+import {getInitOrder,updatePurchaseOrder,checkPurchaseOrder,getPurchaseOrderDetail} from "@/api/supply"
219
+export default {
220
+name: "addPurchaseOrder",
221
+components: {
222
+BreadCrumb
223
+},
224
+data() {
225
+return {
226
+    crumbs: [
227
+       { path: false, name: "购货单" },
228
+       { path: "/spply/query", name: "新增购货单" }
229
+    ],
230
+    showTwo:true,
231
+    showOne:false,
232
+    recordInfo: {
233
+      tableList:[],
234
+    },
235
+    keywords: "",
236
+    total: 0,
237
+    multipleSelection: [],
238
+    signAndWeighBoxPatients: "sign-and-weigh-box-patients",
239
+    start_time: "",
240
+    end_time: "",
241
+    page: 1,
242
+    limit: 10,
243
+    goodType: [],
244
+    goodInfo: [],
245
+    org_id:0,
246
+    types:[],
247
+    tyep_name:"",
248
+    form:{
249
+    manufacturer_id:"",
250
+    },
251
+    tabList:[],
252
+    manufactuerList:[],
253
+    currentIndex: 0,
254
+    goodTypeList:[],
255
+    drugTypeList:[],
256
+    supplier_name:"",
257
+    supplyList:[],
258
+    rate_of_concession:"",
259
+    discount_amount:"",
260
+    start_time:new Date(),
261
+    end_time:new Date(),
262
+    tableRules: {
263
+     name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
264
+     supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
265
+   },
266
+   warehousing_id:0,
267
+   number:"",
268
+   loading:false,
269
+   drugList:[],
270
+   goodList:[],
271
+   id:0,
272
+   disabled:false,
273
+   is_check:0,
274
+   dialogVisible:false,
275
+  };
276
+},
277
+methods:{
278
+
279
+getInitOrder(){
280
+    getInitOrder().then(response=>{
281
+    if(response.data.state == 1){
282
+        var drugList = response.data.data.drugList
283
+        this.manufactuerList = response.data.data.manufactuerList
284
+        this.goodTypeList = response.data.data.goodTypeList
285
+        this.drugTypeList = response.data.data.drugTypeList
286
+        this.supplyList = response.data.data.supplyList
287
+       for(let i=0;i<drugList.length;i++){
288
+          for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
289
+            drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
290
+          }
291
+        for(let j=0;j<this.manufactuerList.length;j++){
292
+            if(drugList[i].manufacturer == this.manufactuerList[j].id){
293
+                drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
294
+            }
295
+        }
296
+        for(let y=0;y<this.drugTypeList.length;y++){
297
+            if(drugList[i].drug_type == this.drugTypeList[y].value){
298
+            drugList[i].drug_type = this.drugTypeList[y].name
299
+            }
300
+        }
301
+        drugList[i].supply_name =  drugList[i].drug_name + " " + drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit + " " + drugList[i].manufacturer
302
+        drugList[i].supply_type = drugList[i].drug_type
303
+        drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
304
+        drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
305
+        drugList[i].supply_count = ""
306
+        drugList[i].supply_total_price = ""
307
+        drugList[i].supply_manufacturer=  drugList[i].manufacturer
308
+        drugList[i].supply_license_number= drugList[i].number
309
+        drugList[i].supply_remake = ""
310
+        drugList[i].type = 1
311
+        drugList[i].supply_price = drugList[i].last_price
312
+        drugList[i].name = drugList[i].drug_name
313
+        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
314
+        drugList[i].supply_unit = drugList[i].max_unit 
315
+        for(let j=0;j<drugList[i].unitList.length;j++){
316
+           drugList[i].unitList[0].name = drugList[i].max_unit
317
+           drugList[i].unitList[1].name = drugList[i].min_unit
318
+        }
319
+        this.tabList.push(drugList[i])
320
+        }
321
+        this.drugList = drugList
322
+        var goodList =  response.data.data.goodList
323
+        for(let i=0;i<goodList.length;i++){
324
+        for(let j=0;j<this.manufactuerList.length;j++){
325
+            if(goodList[i].manufacturer == this.manufactuerList[j].id){
326
+                goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
327
+            }
328
+        }
329
+        for(let y=0;y<this.goodTypeList.length;y++){
330
+            if(goodList[i].good_type_id == this.goodTypeList[y].id){
331
+                goodList[i].good_type_id = this.goodTypeList[y].type_name
332
+            }
333
+        }
334
+        goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
335
+        goodList[i].supply_type = goodList[i].good_type_id
336
+        goodList[i].supply_specification_name =goodList[i].specification_name
337
+        goodList[i].supply_price = goodList[i].buy_price
338
+        goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
339
+        goodList[i].supply_count = ""
340
+        goodList[i].supply_total_price = ""
341
+        goodList[i].supply_manufacturer = goodList[i].manufacturer
342
+        goodList[i].supply_license_number = ""
343
+        goodList[i].supply_remake = ""
344
+        goodList[i].type = 2
345
+        goodList[i].name = goodList[i].good_name
346
+        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
347
+        goodList[i].supply_unit = goodList[i].packing_unit
348
+        for(let j=0;j<goodList[i].unitList.length;j++){
349
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
350
+        }
351
+        this.tabList.push(goodList[i])
352
+        }
353
+        this.goodList = goodList
354
+    } 
355
+    })
356
+},
357
+changeGoodName(val){
358
+  this.currentIndex = val
359
+},
360
+changeName(val){
361
+    //var obj = {"id":0,"name":"合计","supply_name":"","supply_type":"","supply_specification_name":"","supply_total":"","supply_count":"","supply_price":"","supply_total_price":"","supply_manufacturer":"","supply_license_number":"","supply_remake":"","is_total":2}
362
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
363
+    if(this.currentIndex == i){
364
+        this.recordInfo.tableList[i].project_id = val.id
365
+        this.recordInfo.tableList[i].type = val.type
366
+        this.recordInfo.tableList[i].name = val.name
367
+        this.recordInfo.tableList[i].supply_name = val.supply_name
368
+        this.recordInfo.tableList[i].supply_type = val.supply_type
369
+        this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
370
+        this.recordInfo.tableList[i].supply_total = val.supply_total
371
+        if(val.supply_count == NaN){
372
+           this.recordInfo.tableList[i].supply_count = ""
373
+        }else{
374
+          this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
375
+        }
376
+
377
+        this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
378
+        this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
379
+        this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
380
+        this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
381
+        this.recordInfo.tableList[i].supply_remake = val.supply_remake
382
+        this.recordInfo.tableList[i].is_total = val.is_total
383
+        this.recordInfo.tableList[i].supply_unit = val.supply_unit
384
+        this.recordInfo.tableList[i].unitList = val.unitList
385
+     }
386
+    }
387
+   
388
+
389
+},
390
+handleEdit(){
391
+    const tempObj = {}
392
+    tempObj["id"] = 0
393
+    tempObj["name"] = ""
394
+    tempObj['supply_name'] = ""
395
+    tempObj['supply_type'] = ""
396
+    tempObj['supply_specification_name'] = ''
397
+    tempObj['supply_total'] = ""
398
+    tempObj['supply_count'] = ""
399
+    tempObj['supply_price'] = ""
400
+    tempObj['supply_total_price'] = ""
401
+    tempObj['supply_manufacturer'] = ''
402
+    tempObj['supply_license_number'] = ''
403
+    tempObj['supply_remake'] = ''
404
+    tempObj['type'] = 0
405
+    tempObj['is_total'] = 1
406
+    tempObj["project_id"] = 0
407
+    tempObj["supply_unit"] = ""
408
+    this.recordInfo.tableList.push(tempObj)
409
+},
410
+handleDelete: function(index, row) {
411
+  if (this.recordInfo.tableList.length <= 1) {
412
+        this.$message.error('只有一条记录的时候无法删除')
413
+        return
414
+   } else {
415
+        this.recordInfo.tableList.splice(index, 1)
416
+   }
417
+},
418
+
419
+changeTypeName(){
420
+
421
+},
422
+startTimeChange(){
423
+
424
+},
425
+endTimeChange(){
426
+
427
+},
428
+search(){
429
+
430
+},
431
+
432
+getWarehoseInfo(arr,max_unit,min_unit,min_number){
433
+    var total = 0
434
+    var max_str=  ""
435
+    var min_str = ""
436
+    if (arr.length > 0) {
437
+      for(let i=0;i<arr.length;i++){
438
+        total += parseInt(arr[i].stock_max_number)
439
+      }
440
+    }
441
+    if (total < min_number){
442
+        min_str = total + min_unit
443
+    }
444
+    if (total == 0) {
445
+        min_str = ""
446
+        max_str = ""
447
+    }
448
+   if (total >=min_number) {
449
+    if(parseInt(total/min_number)!=0){
450
+        max_str = parseInt(total/min_number) + max_unit
451
+    }
452
+    if(total%min_number!=0){
453
+       min_str = total%min_number + min_unit
454
+    }
455
+  }
456
+ return max_str + min_str
457
+ },
458
+getTotalStockCount(arr){
459
+  var total_count = 0
460
+  for(let i=0;i<arr.length;i++){
461
+    total_count += arr[i].stock_count
462
+  }
463
+  return total_count
464
+},
465
+calculate: function(val) {
466
+    if (isNaN(val)) {
467
+        return "";
468
+    }
469
+    if (val == 0) {
470
+        return "";
471
+    }
472
+    return Math.round(parseFloat(val) * 100) / 100;
473
+  },
474
+getTimes(time) {
475
+    if (time === '') {
476
+    return ''
477
+    }
478
+    return uParseTime(time, '{y}-{m}-{d}')
479
+},
480
+ updatePurchaseOrder(){
481
+   this.loading = true 
482
+    if(this.supplier_name == 0 || this.supplier_name == ""){
483
+        this.$message.error("供应商不能为空!")
484
+        this.loading = false
485
+        return false
486
+    }
487
+   this.$refs["tableForm"].validate((valid)=>{
488
+      if(valid){
489
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
490
+           this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
491
+           this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
492
+           this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
493
+           this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
494
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
495
+           for(let j=0;j<this.manufactuerList.length;j++){
496
+              if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
497
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
498
+              }
499
+           }
500
+        }
501
+        var start = this.getTimes(this.start_time)
502
+        var end = this.getTimes(this.end_time)
503
+        const params = {
504
+        'stockIn': this.recordInfo.tableList
505
+        }
506
+        console.log("param23232332",params)  
507
+       
508
+        updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
509
+           if(response.data.state == 1){
510
+            this.loading = false
511
+             var warehousingInfo =  response.data.data.warehousingInfo
512
+             this.$message.success("修改成功!")
513
+           }
514
+        })
515
+      } 
516
+   })
517
+ },
518
+ getAllPrice(){
519
+   var total_price = 0
520
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
521
+      total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
522
+   }  
523
+   return total_price.toFixed(2)
524
+ },
525
+ checkPurchaseOrder(id,index){
526
+   this.$confirm('是否审核?', {
527
+    confirmButtonText: '确 定',
528
+    cancelButtonText: '取 消',
529
+    type: 'warning'
530
+    }).then(() => { 
531
+    checkPurchaseOrder(this.id).then(response => {
532
+        if (response.data.state == 1) {
533
+          var info = response.data.data.info
534
+          this.disabled = true
535
+          this.$message.success("审核成功!")
536
+          this.getPurchaseOrderDetail()
537
+        } 
538
+     })
539
+    })
540
+    .catch(() => {
541
+    }) 
542
+  },
543
+  getPurchaseOrderDetail(){
544
+      console.log("处方233223232323322323232323")
545
+      var id = this.$route.query.id
546
+    getPurchaseOrderDetail(id).then(response=>{
547
+      if(response.data.state == 1){
548
+        var info = response.data.data.info
549
+        this.is_check = info.is_check
550
+        this.number = info.number
551
+        this.id = info.id
552
+        this.supplier_name = info.supplier_id
553
+        this.rate_of_concession = info.rate_of_concession
554
+        this.discount_amount = info.discount_amount
555
+        var orderInfo = response.data.data.orderInfo
556
+        if(info.is_check == 2){
557
+           this.disabled = false
558
+        }
559
+        if(info.is_check == 1){
560
+           this.disabled = true
561
+        }
562
+        console.log("drugli323322332",this.drugList)
563
+        var drugList = response.data.data.baseList
564
+        var goodList = response.data.data.goodList
565
+        for(let i=0;i<orderInfo.length;i++){
566
+            orderInfo[i].supply_count = orderInfo[i].count
567
+            orderInfo[i].supply_price = orderInfo[i].price
568
+            orderInfo[i].supply_remake = orderInfo[i].remark
569
+            orderInfo[i].type = orderInfo[i].is_source
570
+            orderInfo[i].project_id = orderInfo[i].project_id
571
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit
572
+           if(orderInfo[i].is_source == 1){
573
+            for(let j=0;j<drugList.length;j++){
574
+                if(orderInfo[i].project_id == drugList[j].id){
575
+                  orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
576
+                  orderInfo[i].unitList[0].name = drugList[j].max_unit
577
+                  orderInfo[i].unitList[1].name = drugList[j].min_unit
578
+                }
579
+             }  
580
+            } 
581
+          if(orderInfo[i].is_source == 2){
582
+            for(let j=0;j<goodList.length;j++){
583
+                if(orderInfo[i].project_id == goodList[j].id){
584
+                    orderInfo[i].unitList = [{id:1,name:""}]
585
+                    orderInfo[i].unitList[0].name = goodList[j].packing_unit
586
+                }
587
+            }  
588
+          } 
589
+        }
590
+        console.log("orderINFO23323232",orderInfo)
591
+        this.recordInfo.tableList = orderInfo
592
+      }
593
+    })  
594
+  },
595
+  toPrint(){
596
+     var id = this.$route.query.id
597
+     this.$router.push({path:"/purchase/order/print?&id="+id})  
598
+  },
599
+  toAdd(){
600
+    var id = this.$route.query.id
601
+    if(this.is_check == 2){
602
+      this.$message.error("该采购订单未审核,不能生成采购数据!")
603
+      return false
604
+    }
605
+    this.$router.push({path:"/purchase/order/add?id="+id})
606
+  }
607
+},
608
+created(){
609
+    const tempObj = {}
610
+    tempObj["id"] = 0
611
+    tempObj["name"] = ""
612
+    tempObj['supply_name'] = ""
613
+    tempObj['supply_type'] = ""
614
+    tempObj['supply_specification_name'] = ''
615
+    tempObj['supply_total'] = ""
616
+    tempObj['supply_count'] = ""
617
+    tempObj['supply_price'] = ""
618
+    tempObj['supply_total_price'] = ""
619
+    tempObj['supply_manufacturer'] = ''
620
+    tempObj['supply_license_number'] = ''
621
+    tempObj['supply_remake'] = ''
622
+    tempObj['type'] = 0
623
+    tempObj['is_total'] = 1
624
+    tempObj["project_id"] = 0
625
+    tempObj["supply_unit"] = ""
626
+    this.recordInfo.tableList.push(tempObj)
627
+    this.getInitOrder()
628
+    this.getPurchaseOrderDetail()
629
+}
630
+};
631
+</script>
632
+
633
+<style rel="stylesheet/css" lang="scss" scoped>
634
+.information {
635
+border: 1px #dcdfe6 solid;
636
+padding: 30px 20px 30px 20px;
637
+
638
+.border {
639
+border-bottom: 1px #dcdfe6 solid;
640
+margin: 0px 0 20px 0;
641
+}
642
+}
643
+
644
+.title {
645
+background: #409eff;
646
+height: 44px;
647
+line-height: 44px;
648
+padding: 0 0 0 10px;
649
+color: #fff;
650
+margin: 0 0 10px 0;
651
+}
652
+
653
+.edit_separater {
654
+border-top: 1px solid rgb(233, 233, 233);
655
+margin-top: 15px;
656
+margin-bottom: 15px;
657
+}
658
+</style>
659
+
660
+<style>
661
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
662
+font-size: 12px;
663
+}
664
+
665
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
666
+background: #6fb5fa;
667
+}
668
+
669
+.count {
670
+color: #bd2c00;
671
+}
672
+.el-table td,
673
+.el-table th.is-leaf,
674
+.el-table--border,
675
+.el-table--group {
676
+border-color: #d0d3da;
677
+}
678
+.el-table--border::after,
679
+.el-table--group::after,
680
+.el-table::before {
681
+background-color: #d0d3da;
682
+}
683
+.el-table__fixed-right{
684
+  width:150px;
685
+  bottom: 20px;
686
+  height: 100%;
687
+}
688
+</style>

+ 131 - 24
src/xt_pages/supply/components/addPurchaseOrder.vue Целия файл

@@ -49,8 +49,8 @@
49 49
     </div>
50 50
     <div>
51 51
         <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
52
-        <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">打印</el-button>
53
-        <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">审核</el-button>
52
+        <el-button size="small" type="primary" @click="toPrint()" v-show="showOne">打印</el-button>
53
+        <el-button size="small" type="primary" @click="checkPurchaseOrder" v-show="showOne">审核</el-button>
54 54
         <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">修改</el-button>
55 55
     </div>
56 56
     </div>
@@ -74,7 +74,7 @@
74 74
         </template>
75 75
         <template slot-scope="scope">
76 76
            <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
77
-            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
77
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
78 78
                 <el-option
79 79
                     v-for="(item,index) in tabList"
80 80
                     :key="index"
@@ -97,7 +97,24 @@
97 97
         <template slot-scope="scope">
98 98
             <el-input v-model="scope.row.supply_specification_name" style="width:150px" :disabled="true"></el-input>
99 99
         </template>
100
-        </el-table-column>
100
+    </el-table-column>
101
+     <el-table-column label="单位" align="center" width="120px">
102
+        <template slot="header" slot-scope="scope">
103
+            <span>单位<span style="color: red">*</span></span>
104
+        </template>
105
+        <template slot-scope="scope">
106
+          <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
107
+            <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
108
+                    <el-option
109
+                        v-for="(item,index) in scope.row.unitList"
110
+                        :key="index"
111
+                        :label="item.name"
112
+                        :value="item.name">
113
+                    </el-option>
114
+             </el-select>
115
+          </el-form-item>  
116
+        </template>
117
+    </el-table-column>
101 118
     <el-table-column label="可用库存" align="center" width="130px">
102 119
         <template slot-scope="scope">
103 120
             <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
@@ -109,14 +126,16 @@
109 126
         </template>
110 127
         <template slot-scope="scope">
111 128
           <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
112
-             <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
129
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
113 130
           </el-form-item>
114 131
         </template>
115 132
     </el-table-column>
116 133
 
134
+   
135
+
117 136
     <el-table-column label="购货单价" align="center" width="120px">
118 137
         <template slot-scope="scope">
119
-        <el-input v-model="scope.row.supply_price" style="width:80px"></el-input>
138
+        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
120 139
         </template>
121 140
     </el-table-column>
122 141
 
@@ -135,13 +154,13 @@
135 154
 
136 155
     <el-table-column label="批准文号" align="center" width="200px">
137 156
         <template slot-scope="scope">
138
-        <el-input v-model="scope.row.supply_license_number" style="width:160px"></el-input>
157
+        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="disabled"></el-input>
139 158
         </template>
140 159
     </el-table-column>
141 160
 
142 161
     <el-table-column label="备注" align="center" width="200px">
143 162
         <template slot-scope="scope">
144
-        <el-input v-model="scope.row.supply_remake" style="width:160px"></el-input>
163
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
145 164
         </template>
146 165
     </el-table-column>
147 166
 
@@ -184,7 +203,8 @@
184 203
 <script>
185 204
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
186 205
 import {uParseTime } from '@/utils/tools'
187
-import {getInitOrder,savePurchaseOrder,updatePurchaseOrder} from "@/api/supply"
206
+import {getInitOrder,savePurchaseOrder,updatePurchaseOrder,checkPurchaseOrder} from "@/api/supply"
207
+import {getDataConfig } from '@/utils/data'
188 208
 export default {
189 209
 name: "addPurchaseOrder",
190 210
 created() {
@@ -246,6 +266,7 @@ return {
246 266
     tableRules: {
247 267
      name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
248 268
      supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
269
+     supply_unit:[{required:true,message: '单位不能为空', trigger: 'blur'}]
249 270
    },
250 271
    warehousing_id:0,
251 272
    number:"",
@@ -253,6 +274,14 @@ return {
253 274
    drugList:[],
254 275
    goodList:[],
255 276
    id:0,
277
+   disabled:false,
278
+   unitList:[
279
+     {id:1,name:""},
280
+     {id:2,name:""}
281
+   ],
282
+   goodList:[
283
+     {id:1,name:""},
284
+   ],
256 285
   };
257 286
 },
258 287
 methods:{
@@ -261,11 +290,13 @@ getInitOrder(){
261 290
     getInitOrder().then(response=>{
262 291
     if(response.data.state == 1){
263 292
         var drugList = response.data.data.drugList
293
+        
264 294
         this.manufactuerList = response.data.data.manufactuerList
265 295
         this.goodTypeList = response.data.data.goodTypeList
266 296
         this.drugTypeList = response.data.data.drugTypeList
267 297
         this.supplyList = response.data.data.supplyList
268 298
        for(let i=0;i<drugList.length;i++){
299
+          
269 300
           for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
270 301
             drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
271 302
           }
@@ -289,14 +320,21 @@ getInitOrder(){
289 320
         drugList[i].supply_license_number= drugList[i].number
290 321
         drugList[i].supply_remake = ""
291 322
         drugList[i].type = 1
292
-        drugList[i].supply_price = ""
323
+        drugList[i].supply_price = drugList[i].last_price
293 324
         drugList[i].name = drugList[i].drug_name
294
-
325
+        drugList[i].supply_unit = drugList[i].max_unit
326
+        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
327
+        for(let j=0;j<drugList[i].unitList.length;j++){
328
+           drugList[i].unitList[0].name = drugList[i].max_unit
329
+           drugList[i].unitList[1].name = drugList[i].min_unit
330
+        }
295 331
         this.tabList.push(drugList[i])
296 332
         }
297 333
         this.drugList = drugList
298 334
         var goodList =  response.data.data.goodList
335
+       
299 336
         for(let i=0;i<goodList.length;i++){
337
+       
300 338
         for(let j=0;j<this.manufactuerList.length;j++){
301 339
             if(goodList[i].manufacturer == this.manufactuerList[j].id){
302 340
                 goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
@@ -310,7 +348,7 @@ getInitOrder(){
310 348
         goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
311 349
         goodList[i].supply_type = goodList[i].good_type_id
312 350
         goodList[i].supply_specification_name =goodList[i].specification_name
313
-        goodList[i].supply_price = ""
351
+        goodList[i].supply_price = goodList[i].buy_price
314 352
         goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
315 353
         goodList[i].supply_count = ""
316 354
         goodList[i].supply_total_price = ""
@@ -319,7 +357,11 @@ getInitOrder(){
319 357
         goodList[i].supply_remake = ""
320 358
         goodList[i].type = 2
321 359
         goodList[i].name = goodList[i].good_name
322
-
360
+        goodList[i].supply_unit = goodList[i].packing_unit
361
+        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
362
+        for(let j=0;j<goodList[i].unitList.length;j++){
363
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
364
+        }
323 365
         this.tabList.push(goodList[i])
324 366
         }
325 367
         this.goodList = goodList
@@ -330,16 +372,17 @@ changeGoodName(val){
330 372
   this.currentIndex = val
331 373
 },
332 374
 changeName(val){
333
-    //var obj = {"id":0,"name":"合计","supply_name":"","supply_type":"","supply_specification_name":"","supply_total":"","supply_count":"","supply_price":"","supply_total_price":"","supply_manufacturer":"","supply_license_number":"","supply_remake":"","is_total":2}
375
+   console.log("val3233232322332",val)
334 376
    for(let i=0;i<this.recordInfo.tableList.length;i++){
335 377
     if(this.currentIndex == i){
336
-        this.recordInfo.tableList[i].id = val.id
378
+        this.recordInfo.tableList[i].project_id = val.id
337 379
         this.recordInfo.tableList[i].type = val.type
338 380
         this.recordInfo.tableList[i].name = val.name
339 381
         this.recordInfo.tableList[i].supply_name = val.supply_name
340 382
         this.recordInfo.tableList[i].supply_type = val.supply_type
341 383
         this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
342 384
         this.recordInfo.tableList[i].supply_total = val.supply_total
385
+        
343 386
         if(val.supply_count == NaN){
344 387
            this.recordInfo.tableList[i].supply_count = ""
345 388
         }else{
@@ -352,6 +395,8 @@ changeName(val){
352 395
         this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
353 396
         this.recordInfo.tableList[i].supply_remake = val.supply_remake
354 397
         this.recordInfo.tableList[i].is_total = val.is_total
398
+        this.recordInfo.tableList[i].supply_unit = val.supply_unit
399
+        this.recordInfo.tableList[i].unitList = val.unitList
355 400
      }
356 401
     }
357 402
    
@@ -359,7 +404,7 @@ changeName(val){
359 404
 },
360 405
 handleEdit(){
361 406
     const tempObj = {}
362
-    tempObj["id"] = ""
407
+    tempObj["id"] = 0
363 408
     tempObj["name"] = ""
364 409
     tempObj['supply_name'] = ""
365 410
     tempObj['supply_type'] = ""
@@ -373,6 +418,8 @@ handleEdit(){
373 418
     tempObj['supply_remake'] = ''
374 419
     tempObj['type'] = 0
375 420
     tempObj['is_total'] = 1
421
+    tempObj["project_id"] = 0
422
+    tempObj["supply_unit"] = ""
376 423
     this.recordInfo.tableList.push(tempObj)
377 424
 },
378 425
 handleDelete: function(index, row) {
@@ -389,6 +436,7 @@ savePurchaseOrder(){
389 436
     this.loading = true
390 437
     if(this.supplier_name == 0 || this.supplier_name == ""){
391 438
        this.$message.error("供应商不能为空!")
439
+       this.loading = false
392 440
        return false
393 441
     }
394 442
     this.$refs["tableForm"].validate((valid)=>{
@@ -397,6 +445,8 @@ savePurchaseOrder(){
397 445
             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
398 446
             this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
399 447
             this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
448
+            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
449
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
400 450
             for(let j=0;j<this.manufactuerList.length;j++){
401 451
                 if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
402 452
                 this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
@@ -421,9 +471,29 @@ savePurchaseOrder(){
421 471
                 this.recordInfo.tableList = []
422 472
                 var orderInfo = response.data.data.orderInfo
423 473
                 for(let i=0;i<orderInfo.length;i++){
474
+                   if(orderInfo[i].is_source == 1){
475
+                    for(let j=0;j<this.drugList.length;j++){
476
+                       if(orderInfo[i].project_id == this.drugList[j].id){
477
+                          orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
478
+                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
479
+                          orderInfo[i].unitList[1].name = this.drugList[j].min_unit
480
+                       }
481
+                    }  
482
+                   } 
483
+                  if(orderInfo[i].is_source == 2){
484
+                    for(let j=0;j<this.goodList.length;j++){
485
+                       if(orderInfo[i].project_id == this.goodList[j].id){
486
+                          orderInfo[i].unitList = [{id:1,name:""}]
487
+                          orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
488
+                       }
489
+                    }  
490
+                   } 
424 491
                   orderInfo[i].supply_count = orderInfo[i].count
425 492
                   orderInfo[i].supply_price = orderInfo[i].price
426 493
                   orderInfo[i].supply_remake = orderInfo[i].remark
494
+                  orderInfo[i].type = orderInfo[i].is_source
495
+                  orderInfo[i].project_id = orderInfo[i].project_id
496
+                  orderInfo[i].supply_unit = orderInfo[i].supply_unit
427 497
                 }
428 498
                 console.log("orderINFO23323232",orderInfo)
429 499
                 this.recordInfo.tableList = orderInfo
@@ -519,12 +589,20 @@ getTimes(time) {
519 589
     return uParseTime(time, '{y}-{m}-{d}')
520 590
 },
521 591
  updatePurchaseOrder(){
522
-   this.$refs.validate((valid)=>{
592
+   this.loading = true 
593
+    if(this.supplier_name == 0 || this.supplier_name == ""){
594
+        this.$message.error("供应商不能为空!")
595
+        this.loading = false
596
+        return false
597
+    }
598
+   this.$refs["tableForm"].validate((valid)=>{
523 599
       if(valid){
524 600
         for(let i=0;i<this.recordInfo.tableList.length;i++){
525 601
            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
526 602
            this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
527 603
            this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
604
+           this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
605
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
528 606
            for(let j=0;j<this.manufactuerList.length;j++){
529 607
               if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
530 608
                 this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
@@ -533,11 +611,14 @@ getTimes(time) {
533 611
         }
534 612
         var start = this.getTimes(this.start_time)
535 613
         var end = this.getTimes(this.end_time)
536
-         const params = {
537
-            'stockIn': this.recordInfo.tableList
538
-         }
614
+        const params = {
615
+        'stockIn': this.recordInfo.tableList
616
+        }
617
+        console.log("params23232233223",params)
618
+        
539 619
         updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
540 620
            if(response.data.state == 1){
621
+            this.loading = false
541 622
              var warehousingInfo =  response.data.data.warehousingInfo
542 623
              this.$message.success("修改成功!")
543 624
            }
@@ -546,17 +627,41 @@ getTimes(time) {
546 627
    })
547 628
  },
548 629
  getAllPrice(){
549
-   console.log("表哥2332323223323223",this.recordInfo.tableList)  
550 630
    var total_price = 0
551 631
    for(let i=0;i<this.recordInfo.tableList.length;i++){
552 632
       total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
553 633
    }  
554 634
    return total_price.toFixed(2)
555
- }
635
+ },
636
+ checkPurchaseOrder(id,index){
637
+   this.$confirm('是否审核?', {
638
+    confirmButtonText: '确 定',
639
+    cancelButtonText: '取 消',
640
+    type: 'warning'
641
+    }).then(() => {
642
+    console.log("id232233232323223",this.id)    
643
+    checkPurchaseOrder(this.id).then(response => {
644
+        if (response.data.state == 1) {
645
+          var info = response.data.data.info
646
+          this.disabled = true
647
+          this.$message.success("审核成功!")
648
+        } 
649
+     })
650
+    })
651
+    .catch(() => {
652
+    }) 
653
+  },
654
+  toPrint(){
655
+     var id = this.id
656
+     this.$router.push({path:"/purchase/order/print?&id="+id})  
657
+  },
658
+  getDataConfig(module, filed_name){
659
+    return getDataConfig(module, filed_name)
660
+  },
556 661
 },
557 662
 created(){
558 663
     const tempObj = {}
559
-    tempObj["id"] = ""
664
+    tempObj["id"] = 0
560 665
     tempObj["name"] = ""
561 666
     tempObj['supply_name'] = ""
562 667
     tempObj['supply_type'] = ""
@@ -570,6 +675,8 @@ created(){
570 675
     tempObj['supply_remake'] = ''
571 676
     tempObj['type'] = 0
572 677
     tempObj['is_total'] = 1
678
+    tempObj["project_id"] = 0
679
+    tempObj["supply_unit"] = ""
573 680
     this.recordInfo.tableList.push(tempObj)
574 681
     this.getInitOrder()
575 682
 }
@@ -629,6 +736,6 @@ background-color: #d0d3da;
629 736
 .el-table__fixed-right{
630 737
   width:150px;
631 738
   bottom: 20px;
632
-  height: 200px;
739
+  height: 100%;
633 740
 }
634 741
 </style>

+ 710 - 0
src/xt_pages/supply/components/editPurchaseOrder.vue Целия файл

@@ -0,0 +1,710 @@
1
+<template>
2
+<div class="main-contain">
3
+<div class="position">
4
+    <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+</div>
6
+<div class="app-container"  v-loading="loading">
7
+    <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
+    <div>
9
+        <span style="color:red">*</span><span>供应商:</span>
10
+        <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
11
+        @change="changeTypeName">
12
+        <el-option
13
+            v-for="item in supplyList"
14
+            :key="item.id"
15
+            :label="item.supplier_name"
16
+            :value="item.id">
17
+        </el-option>
18
+        </el-select>
19
+        <span>单据日期:</span>
20
+        <el-date-picker
21
+        size="small"
22
+        v-model="start_time"
23
+        prefix-icon="el-icon-date"
24
+        :editable="false"
25
+        style="width: 196px;"
26
+        type="date"
27
+        placeholder="选择日期时间"
28
+        align="right"
29
+        format="yyyy-MM-dd"
30
+        value-format="yyyy-MM-dd"
31
+        @change="startTimeChange"
32
+        ></el-date-picker>
33
+        <span>交货日期:</span>
34
+        <el-date-picker
35
+            size="small"
36
+            v-model="end_time"
37
+            prefix-icon="el-icon-date"
38
+            :editable="false"
39
+            style="width: 196px;"
40
+            type="date"
41
+            placeholder="选择日期时间"
42
+            align="right"
43
+            format="yyyy-MM-dd"
44
+            value-format="yyyy-MM-dd"
45
+            @change="endTimeChange"
46
+        ></el-date-picker>
47
+        <span>单据编码:{{number}}</span>
48
+
49
+    </div>
50
+    <div>
51
+        <el-button size="small" type="primary" @click="toAdd">生成购货单</el-button>
52
+        <el-button size="small" type="primary" @click="updatePurchaseOrder">修改</el-button>
53
+        <el-button size="small" type="primary" @click="toPrint">打印</el-button>
54
+        <el-button size="small" type="primary" v-if="is_check == 2" @click="checkPurchaseOrder">审核</el-button>
55
+        <el-button size="small" type="primary" v-if="is_check == 1" @click="checkPurchaseOrder">反审核</el-button>
56
+       
57
+    </div>
58
+    </div>
59
+
60
+   <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
61
+    <el-table
62
+    :row-style="{ color: '#303133' }"
63
+    :header-cell-style="{
64
+        backgroundColor: 'rgb(245, 247, 250)',
65
+        color: '#606266'
66
+    }"
67
+    :data="recordInfo.tableList"
68
+    :class="signAndWeighBoxPatients"
69
+    border
70
+    style="width: 100%"
71
+    max-height="450"
72
+    >
73
+    <el-table-column align="center" width="200px">
74
+        <template slot="header" slot-scope="scope">
75
+            <span>商品<span style="color: red">*</span></span>
76
+        </template>
77
+        <template slot-scope="scope">
78
+           <el-form-item :prop="'tableList.' + scope.$index + '.name'" :rules='tableRules.name'>
79
+            <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)" :disabled="disabled">
80
+                <el-option
81
+                    v-for="(item,index) in tabList"
82
+                    :key="index"
83
+                    :label="item.supply_name"
84
+                    :value="item">
85
+                </el-option>
86
+             </el-select>
87
+           </el-form-item>
88
+        </template>
89
+    </el-table-column>
90
+    <el-table-column  align="center" width="150px">
91
+        <template slot="header" slot-scope="scope">
92
+            <span>商品类别</span>
93
+        </template>
94
+        <template slot-scope="scope">
95
+            <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
96
+        </template>
97
+    </el-table-column>
98
+    <el-table-column label="规格&单位" align="center" width="200px">
99
+        <template slot-scope="scope">
100
+            <el-input v-model="scope.row.supply_specification_name" style="width:150px" :disabled="true"></el-input>
101
+        </template>
102
+    </el-table-column>
103
+     <el-table-column label="单位" align="center" width="120px">
104
+        <template slot="header" slot-scope="scope">
105
+            <span>单位<span style="color: red">*</span></span>
106
+        </template>
107
+        <template slot-scope="scope">
108
+          <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
109
+            <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
110
+                    <el-option
111
+                        v-for="(item,index) in scope.row.unitList"
112
+                        :key="index"
113
+                        :label="item.name"
114
+                        :value="item.name">
115
+                    </el-option>
116
+             </el-select>
117
+          </el-form-item>  
118
+        </template>
119
+    </el-table-column>
120
+    <el-table-column label="批号" align="center" width="130px">
121
+        <template slot-scope="scope">
122
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
123
+        </template>
124
+    </el-table-column>
125
+    <el-table-column label="有效日期" align="center" width="130px">
126
+        <template slot-scope="scope">
127
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
128
+        </template>
129
+    </el-table-column>
130
+    <el-table-column label="可用库存" align="center" width="130px">
131
+        <template slot-scope="scope">
132
+            <el-input v-model="scope.row.supply_total" style="width:100px" :disabled="true"></el-input>
133
+        </template>
134
+    </el-table-column>
135
+    <el-table-column label="数量" align="center" width="120px">
136
+        <template slot="header" slot-scope="scope">
137
+            <span>数量<span style="color: red">*</span></span>
138
+        </template>
139
+        <template slot-scope="scope">
140
+          <el-form-item  :prop="'tableList.' + scope.$index + '.supply_count'" :rules='tableRules.supply_count'>
141
+             <el-input v-model="scope.row.supply_count" style="width:80px" :disabled="disabled"></el-input>
142
+          </el-form-item>
143
+        </template>
144
+    </el-table-column>
145
+
146
+    <el-table-column label="购货单价" align="center" width="120px">
147
+        <template slot-scope="scope">
148
+        <el-input v-model="scope.row.supply_price" style="width:80px" :disabled="disabled"></el-input>
149
+        </template>
150
+    </el-table-column>
151
+
152
+    <el-table-column label="购货金额" align="center" width="120px">
153
+        <template slot-scope="scope">
154
+          {{calculate(scope.row.supply_count * scope.row.supply_price)}}
155
+        </template>
156
+    </el-table-column>
157
+
158
+    <el-table-column label="生产日期" align="center" width="200px">
159
+        <template slot-scope="scope">
160
+        <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
161
+        </template>
162
+    </el-table-column>
163
+    <el-table-column label="生产厂家" align="center" width="200px">
164
+        <template slot-scope="scope">
165
+        <el-input v-model="scope.row.supply_manufacturer" style="width:160px" :disabled="true"></el-input>
166
+        </template>
167
+    </el-table-column>
168
+
169
+
170
+    <el-table-column label="批准文号" align="center" width="200px">
171
+        <template slot-scope="scope">
172
+        <el-input v-model="scope.row.supply_license_number" style="width:160px" :disabled="disabled"></el-input>
173
+        </template>
174
+    </el-table-column>
175
+    <el-table-column label="关联采购订单号" align="center" width="200px">
176
+        <template slot-scope="scope">
177
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
178
+        </template>
179
+    </el-table-column>
180
+    <el-table-column label="备注" align="center" width="200px">
181
+        <template slot-scope="scope">
182
+        <el-input v-model="scope.row.supply_remake" style="width:160px" :disabled="disabled"></el-input>
183
+        </template>
184
+    </el-table-column>
185
+
186
+    <el-table-column label="操作" align="center" width="150px" fixed="right" >
187
+        <template slot-scope="scope">
188
+        <el-tooltip class="item" effect="dark" content="新增" placement="top" >
189
+            <el-button
190
+                size="mini"
191
+                type="primary"
192
+                icon="el-icon-circle-plus-outline"
193
+                @click="handleEdit(scope.$index, scope.row)">
194
+            </el-button>
195
+       </el-tooltip>
196
+       <el-tooltip class="item" effect="dark" content="删除" placement="top">
197
+            <el-button
198
+                size="mini"
199
+                type="danger"
200
+                icon="el-icon-delete"
201
+                @click="handleDelete(scope.$index, scope.row)">
202
+            </el-button>
203
+        </el-tooltip>
204
+
205
+        </template>
206
+    </el-table-column>
207
+  </el-table>
208
+</el-form>
209
+   <div style="margin-top:10px">
210
+      合计:{{getAllPrice()}} 元
211
+   </div>
212
+   <div style="margin-top:10px">
213
+        <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
214
+
215
+        <span>优惠金额:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
216
+
217
+        <span>本次付款:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
218
+
219
+        <span>本次欠款:<el-input style="width:100px" v-model="discount_amount"></el-input></span>
220
+
221
+    </div>
222
+</div>
223
+
224
+  <!-- <el-dialog
225
+  title="提示"
226
+  :visible.sync="dialogVisible"
227
+  width="30%"
228
+  :before-close="handleClose">
229
+  <span>这是一段信息</span>
230
+  <span slot="footer" class="dialog-footer">
231
+    <el-button @click="dialogVisible = false">取 消</el-button>
232
+    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
233
+  </span>
234
+  </el-dialog> -->
235
+</div>
236
+</template>
237
+
238
+<script>
239
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
240
+import {uParseTime } from '@/utils/tools'
241
+import {getInitOrder,updatePurchaseOrder,checkPurchaseOrder,getPurchaseOrderDetail} from "@/api/supply"
242
+export default {
243
+name: "addPurchaseOrder",
244
+components: {
245
+BreadCrumb
246
+},
247
+data() {
248
+return {
249
+    crumbs: [
250
+       { path: false, name: "购货订单" },
251
+       { path: "/spply/query", name: "编辑购货订单" }
252
+    ],
253
+    showTwo:true,
254
+    showOne:false,
255
+    recordInfo: {
256
+      tableList:[],
257
+    },
258
+    keywords: "",
259
+    total: 0,
260
+    multipleSelection: [],
261
+    signAndWeighBoxPatients: "sign-and-weigh-box-patients",
262
+    start_time: "",
263
+    end_time: "",
264
+    page: 1,
265
+    limit: 10,
266
+    goodType: [],
267
+    goodInfo: [],
268
+    org_id:0,
269
+    types:[],
270
+    tyep_name:"",
271
+    form:{
272
+    manufacturer_id:"",
273
+    },
274
+    tabList:[],
275
+    manufactuerList:[],
276
+    currentIndex: 0,
277
+    goodTypeList:[],
278
+    drugTypeList:[],
279
+    supplier_name:"",
280
+    supplyList:[],
281
+    rate_of_concession:"",
282
+    discount_amount:"",
283
+    start_time:new Date(),
284
+    end_time:new Date(),
285
+    tableRules: {
286
+     name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
287
+     supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
288
+   },
289
+   warehousing_id:0,
290
+   number:"",
291
+   loading:false,
292
+   drugList:[],
293
+   goodList:[],
294
+   id:0,
295
+   disabled:false,
296
+   is_check:0,
297
+   dialogVisible:false,
298
+  };
299
+},
300
+methods:{
301
+
302
+getInitOrder(){
303
+    getInitOrder().then(response=>{
304
+    if(response.data.state == 1){
305
+        var drugList = response.data.data.drugList
306
+        this.manufactuerList = response.data.data.manufactuerList
307
+        this.goodTypeList = response.data.data.goodTypeList
308
+        this.drugTypeList = response.data.data.drugTypeList
309
+        this.supplyList = response.data.data.supplyList
310
+       for(let i=0;i<drugList.length;i++){
311
+          for(let z=0;z<drugList[i].drug_warehouse_info.length;z++){
312
+            drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number * drugList[i].min_number
313
+          }
314
+        for(let j=0;j<this.manufactuerList.length;j++){
315
+            if(drugList[i].manufacturer == this.manufactuerList[j].id){
316
+                drugList[i].manufacturer = this.manufactuerList[j].manufacturer_name
317
+            }
318
+        }
319
+        for(let y=0;y<this.drugTypeList.length;y++){
320
+            if(drugList[i].drug_type == this.drugTypeList[y].value){
321
+            drugList[i].drug_type = this.drugTypeList[y].name
322
+            }
323
+        }
324
+        drugList[i].supply_name =  drugList[i].drug_name + " " + drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit + " " + drugList[i].manufacturer
325
+        drugList[i].supply_type = drugList[i].drug_type
326
+        drugList[i].supply_specification_name = drugList[i].dose +drugList[i].dose_unit+"*"+drugList[i].min_number+ drugList[i].min_unit+"/"+drugList[i].max_unit
327
+        drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number)
328
+        drugList[i].supply_count = ""
329
+        drugList[i].supply_total_price = ""
330
+        drugList[i].supply_manufacturer=  drugList[i].manufacturer
331
+        drugList[i].supply_license_number= drugList[i].number
332
+        drugList[i].supply_remake = ""
333
+        drugList[i].type = 1
334
+        drugList[i].supply_price = drugList[i].last_price
335
+        drugList[i].name = drugList[i].drug_name
336
+        drugList[i].unitList = [{id:1,name:""},{id:2,name:""}]
337
+        drugList[i].supply_unit = drugList[i].max_unit 
338
+        for(let j=0;j<drugList[i].unitList.length;j++){
339
+           drugList[i].unitList[0].name = drugList[i].max_unit
340
+           drugList[i].unitList[1].name = drugList[i].min_unit
341
+        }
342
+        this.tabList.push(drugList[i])
343
+        }
344
+        this.drugList = drugList
345
+        var goodList =  response.data.data.goodList
346
+        for(let i=0;i<goodList.length;i++){
347
+        for(let j=0;j<this.manufactuerList.length;j++){
348
+            if(goodList[i].manufacturer == this.manufactuerList[j].id){
349
+                goodList[i].manufacturer = this.manufactuerList[j].manufacturer_name
350
+            }
351
+        }
352
+        for(let y=0;y<this.goodTypeList.length;y++){
353
+            if(goodList[i].good_type_id == this.goodTypeList[y].id){
354
+                goodList[i].good_type_id = this.goodTypeList[y].type_name
355
+            }
356
+        }
357
+        goodList[i].supply_name = goodList[i].good_name + " " + goodList[i].specification_name + " " +goodList[i].manufacturer
358
+        goodList[i].supply_type = goodList[i].good_type_id
359
+        goodList[i].supply_specification_name =goodList[i].specification_name
360
+        goodList[i].supply_price = goodList[i].buy_price
361
+        goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info)
362
+        goodList[i].supply_count = ""
363
+        goodList[i].supply_total_price = ""
364
+        goodList[i].supply_manufacturer = goodList[i].manufacturer
365
+        goodList[i].supply_license_number = ""
366
+        goodList[i].supply_remake = ""
367
+        goodList[i].type = 2
368
+        goodList[i].name = goodList[i].good_name
369
+        goodList[i].unitList =  [{id:1,name:""},{id:2,name:""}]
370
+        goodList[i].supply_unit = goodList[i].packing_unit
371
+        for(let j=0;j<goodList[i].unitList.length;j++){
372
+           goodList[i].unitList[0].name = goodList[i].packing_unit 
373
+        }
374
+        this.tabList.push(goodList[i])
375
+        }
376
+        this.goodList = goodList
377
+    } 
378
+    })
379
+},
380
+changeGoodName(val){
381
+  this.currentIndex = val
382
+},
383
+changeName(val){
384
+    //var obj = {"id":0,"name":"合计","supply_name":"","supply_type":"","supply_specification_name":"","supply_total":"","supply_count":"","supply_price":"","supply_total_price":"","supply_manufacturer":"","supply_license_number":"","supply_remake":"","is_total":2}
385
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
386
+    if(this.currentIndex == i){
387
+        this.recordInfo.tableList[i].project_id = val.id
388
+        this.recordInfo.tableList[i].type = val.type
389
+        this.recordInfo.tableList[i].name = val.name
390
+        this.recordInfo.tableList[i].supply_name = val.supply_name
391
+        this.recordInfo.tableList[i].supply_type = val.supply_type
392
+        this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
393
+        this.recordInfo.tableList[i].supply_total = val.supply_total
394
+        if(val.supply_count == NaN){
395
+           this.recordInfo.tableList[i].supply_count = ""
396
+        }else{
397
+          this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
398
+        }
399
+
400
+        this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
401
+        this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
402
+        this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
403
+        this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
404
+        this.recordInfo.tableList[i].supply_remake = val.supply_remake
405
+        this.recordInfo.tableList[i].is_total = val.is_total
406
+        this.recordInfo.tableList[i].supply_unit = val.supply_unit
407
+        this.recordInfo.tableList[i].unitList = val.unitList
408
+     }
409
+    }
410
+   
411
+
412
+},
413
+handleEdit(){
414
+    const tempObj = {}
415
+    tempObj["id"] = 0
416
+    tempObj["name"] = ""
417
+    tempObj['supply_name'] = ""
418
+    tempObj['supply_type'] = ""
419
+    tempObj['supply_specification_name'] = ''
420
+    tempObj['supply_total'] = ""
421
+    tempObj['supply_count'] = ""
422
+    tempObj['supply_price'] = ""
423
+    tempObj['supply_total_price'] = ""
424
+    tempObj['supply_manufacturer'] = ''
425
+    tempObj['supply_license_number'] = ''
426
+    tempObj['supply_remake'] = ''
427
+    tempObj['type'] = 0
428
+    tempObj['is_total'] = 1
429
+    tempObj["project_id"] = 0
430
+    tempObj["supply_unit"] = ""
431
+    this.recordInfo.tableList.push(tempObj)
432
+},
433
+handleDelete: function(index, row) {
434
+  if (this.recordInfo.tableList.length <= 1) {
435
+        this.$message.error('只有一条记录的时候无法删除')
436
+        return
437
+   } else {
438
+        this.recordInfo.tableList.splice(index, 1)
439
+   }
440
+},
441
+
442
+changeTypeName(){
443
+
444
+},
445
+startTimeChange(){
446
+
447
+},
448
+endTimeChange(){
449
+
450
+},
451
+search(){
452
+
453
+},
454
+
455
+getWarehoseInfo(arr,max_unit,min_unit,min_number){
456
+    var total = 0
457
+    var max_str=  ""
458
+    var min_str = ""
459
+    if (arr.length > 0) {
460
+      for(let i=0;i<arr.length;i++){
461
+        total += parseInt(arr[i].stock_max_number)
462
+      }
463
+    }
464
+    if (total < min_number){
465
+        min_str = total + min_unit
466
+    }
467
+    if (total == 0) {
468
+        min_str = ""
469
+        max_str = ""
470
+    }
471
+   if (total >=min_number) {
472
+    if(parseInt(total/min_number)!=0){
473
+        max_str = parseInt(total/min_number) + max_unit
474
+    }
475
+    if(total%min_number!=0){
476
+       min_str = total%min_number + min_unit
477
+    }
478
+  }
479
+ return max_str + min_str
480
+ },
481
+getTotalStockCount(arr){
482
+  var total_count = 0
483
+  for(let i=0;i<arr.length;i++){
484
+    total_count += arr[i].stock_count
485
+  }
486
+  return total_count
487
+},
488
+calculate: function(val) {
489
+    if (isNaN(val)) {
490
+        return "";
491
+    }
492
+    if (val == 0) {
493
+        return "";
494
+    }
495
+    return Math.round(parseFloat(val) * 100) / 100;
496
+  },
497
+getTimes(time) {
498
+    if (time === '') {
499
+    return ''
500
+    }
501
+    return uParseTime(time, '{y}-{m}-{d}')
502
+},
503
+ updatePurchaseOrder(){
504
+   this.loading = true 
505
+    if(this.supplier_name == 0 || this.supplier_name == ""){
506
+        this.$message.error("供应商不能为空!")
507
+        this.loading = false
508
+        return false
509
+    }
510
+   this.$refs["tableForm"].validate((valid)=>{
511
+      if(valid){
512
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
513
+           this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
514
+           this.recordInfo.tableList[i].supply_license_number = this.recordInfo.tableList[i].supply_license_number.toString()
515
+           this.recordInfo.tableList[i].supply_total_price = (this.recordInfo.tableList[i].supply_count * this.recordInfo.tableList[i].supply_price).toString()
516
+           this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
517
+            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
518
+           for(let j=0;j<this.manufactuerList.length;j++){
519
+              if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
520
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
521
+              }
522
+           }
523
+        }
524
+        var start = this.getTimes(this.start_time)
525
+        var end = this.getTimes(this.end_time)
526
+        const params = {
527
+        'stockIn': this.recordInfo.tableList
528
+        }
529
+        console.log("param23232332",params)  
530
+       
531
+        updatePurchaseOrder(params,this.supplier_name,start,end,this.rate_of_concession,this.discount_amount,this.id,this.number).then(response=>{
532
+           if(response.data.state == 1){
533
+            this.loading = false
534
+             var warehousingInfo =  response.data.data.warehousingInfo
535
+             this.$message.success("修改成功!")
536
+           }
537
+        })
538
+      } 
539
+   })
540
+ },
541
+ getAllPrice(){
542
+   var total_price = 0
543
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
544
+      total_price += (this.recordInfo.tableList[i].supply_price * this.recordInfo.tableList[i].supply_count)
545
+   }  
546
+   return total_price.toFixed(2)
547
+ },
548
+ checkPurchaseOrder(id,index){
549
+   this.$confirm('是否审核?', {
550
+    confirmButtonText: '确 定',
551
+    cancelButtonText: '取 消',
552
+    type: 'warning'
553
+    }).then(() => { 
554
+    checkPurchaseOrder(this.id).then(response => {
555
+        if (response.data.state == 1) {
556
+          var info = response.data.data.info
557
+          this.disabled = true
558
+          this.$message.success("审核成功!")
559
+          this.getPurchaseOrderDetail()
560
+        } 
561
+     })
562
+    })
563
+    .catch(() => {
564
+    }) 
565
+  },
566
+  getPurchaseOrderDetail(){
567
+      var id = this.$route.query.id
568
+    getPurchaseOrderDetail(id).then(response=>{
569
+      if(response.data.state == 1){
570
+        var info = response.data.data.info
571
+        this.is_check = info.is_check
572
+        this.number = info.number
573
+        this.id = info.id
574
+        this.supplier_name = info.supplier_id
575
+        this.rate_of_concession = info.rate_of_concession
576
+        this.discount_amount = info.discount_amount
577
+        var orderInfo = response.data.data.orderInfo
578
+        if(info.is_check == 2){
579
+           this.disabled = false
580
+        }
581
+        if(info.is_check == 1){
582
+           this.disabled = true
583
+        }
584
+        console.log("drugli323322332",this.drugList)
585
+        var drugList = response.data.data.baseList
586
+        var goodList = response.data.data.goodList
587
+        for(let i=0;i<orderInfo.length;i++){
588
+            orderInfo[i].supply_count = orderInfo[i].count
589
+            orderInfo[i].supply_price = orderInfo[i].price
590
+            orderInfo[i].supply_remake = orderInfo[i].remark
591
+            orderInfo[i].type = orderInfo[i].is_source
592
+            orderInfo[i].project_id = orderInfo[i].project_id
593
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit
594
+           if(orderInfo[i].is_source == 1){
595
+            for(let j=0;j<drugList.length;j++){
596
+                if(orderInfo[i].project_id == drugList[j].id){
597
+                  orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
598
+                  orderInfo[i].unitList[0].name = drugList[j].max_unit
599
+                  orderInfo[i].unitList[1].name = drugList[j].min_unit
600
+                }
601
+             }  
602
+            } 
603
+          if(orderInfo[i].is_source == 2){
604
+            for(let j=0;j<goodList.length;j++){
605
+                if(orderInfo[i].project_id == goodList[j].id){
606
+                    orderInfo[i].unitList = [{id:1,name:""}]
607
+                    orderInfo[i].unitList[0].name = goodList[j].packing_unit
608
+                }
609
+            }  
610
+          } 
611
+        }
612
+        console.log("orderINFO23323232",orderInfo)
613
+        this.recordInfo.tableList = orderInfo
614
+      }
615
+    })  
616
+  },
617
+  toPrint(){
618
+     var id = this.$route.query.id
619
+     this.$router.push({path:"/purchase/order/print?&id="+id})  
620
+  },
621
+  toAdd(){
622
+    var id = this.$route.query.id
623
+    if(this.is_check == 2){
624
+      this.$message.error("该采购订单未审核,不能生成采购数据!")
625
+      return false
626
+    }
627
+    this.$router.push({path:"/good/order/add?id="+id})
628
+  }
629
+},
630
+created(){
631
+    const tempObj = {}
632
+    tempObj["id"] = 0
633
+    tempObj["name"] = ""
634
+    tempObj['supply_name'] = ""
635
+    tempObj['supply_type'] = ""
636
+    tempObj['supply_specification_name'] = ''
637
+    tempObj['supply_total'] = ""
638
+    tempObj['supply_count'] = ""
639
+    tempObj['supply_price'] = ""
640
+    tempObj['supply_total_price'] = ""
641
+    tempObj['supply_manufacturer'] = ''
642
+    tempObj['supply_license_number'] = ''
643
+    tempObj['supply_remake'] = ''
644
+    tempObj['type'] = 0
645
+    tempObj['is_total'] = 1
646
+    tempObj["project_id"] = 0
647
+    tempObj["supply_unit"] = ""
648
+    this.recordInfo.tableList.push(tempObj)
649
+    this.getInitOrder()
650
+    this.getPurchaseOrderDetail()
651
+}
652
+};
653
+</script>
654
+
655
+<style rel="stylesheet/css" lang="scss" scoped>
656
+.information {
657
+border: 1px #dcdfe6 solid;
658
+padding: 30px 20px 30px 20px;
659
+
660
+.border {
661
+border-bottom: 1px #dcdfe6 solid;
662
+margin: 0px 0 20px 0;
663
+}
664
+}
665
+
666
+.title {
667
+background: #409eff;
668
+height: 44px;
669
+line-height: 44px;
670
+padding: 0 0 0 10px;
671
+color: #fff;
672
+margin: 0 0 10px 0;
673
+}
674
+
675
+.edit_separater {
676
+border-top: 1px solid rgb(233, 233, 233);
677
+margin-top: 15px;
678
+margin-bottom: 15px;
679
+}
680
+</style>
681
+
682
+<style>
683
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
684
+font-size: 12px;
685
+}
686
+
687
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
688
+background: #6fb5fa;
689
+}
690
+
691
+.count {
692
+color: #bd2c00;
693
+}
694
+.el-table td,
695
+.el-table th.is-leaf,
696
+.el-table--border,
697
+.el-table--group {
698
+border-color: #d0d3da;
699
+}
700
+.el-table--border::after,
701
+.el-table--group::after,
702
+.el-table::before {
703
+background-color: #d0d3da;
704
+}
705
+.el-table__fixed-right{
706
+  width:150px;
707
+  bottom: 20px;
708
+  height: 100%;
709
+}
710
+</style>

+ 292 - 0
src/xt_pages/supply/components/purchaseOrderPrint.vue Целия файл

@@ -0,0 +1,292 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="print_main_content">
14
+                    <div class="order_title_panl">
15
+                        <div style="font-size:22px;font-weight:bold;">{{ orgName }}</div>
16
+                        <span style="font-weight:500;font-size:18px;">购货单</span>
17
+                    </div>
18
+                    <div style="display:flex;justify-content: space-between;">
19
+                      <div style="text-align:left;margin-bottom:1px;font-size: 18px;">
20
+                        供应商:{{getSupplyName(supplier_id)}}
21
+                      </div>
22
+                      <div style="margin-bottom:1px;font-size: 18px;">
23
+                        单据日期:{{rate_of_concession}}
24
+                      </div>
25
+                      <div style="margin-bottom:1px;font-size: 18px;">
26
+                        单据编号:{{number}}
27
+                      </div>
28
+                      <div style="margin-bottom:1px;font-size: 18px;">
29
+                        币别:RMB
30
+                      </div>
31
+                    </div>
32
+                    
33
+                    <div class="table_panel">
34
+                        <table class="table">
35
+                            <thead>
36
+                                <tr>
37
+                                    <td style="line-height:18px;" width="80">序号</td>
38
+                                    <td style="line-height:18px;" width="80">商品</td>
39
+                                    <td style="line-height:18px;" width="80">单位</td>
40
+                                    <td style="line-height:18px;" width="80">数量</td>
41
+                                    <td style="line-height:18px;" width="80">购货单价</td>
42
+                                    <td style="line-height:18px;" width="80">折扣率</td>
43
+                                    <td style="line-height:18px;" width="80">折扣额</td> 
44
+                                    <td style="line-height:18px;" width="60">购物金额</td>
45
+                                    <td style="line-height:18px;" width="80">仓库</td>
46
+                                </tr>
47
+                            </thead>
48
+                            <tbody>
49
+                                <tr v-for='(item,index) in tableList' :key="index">
50
+                                    <td style="line-height:18px;"><span>{{index+ 1}}</span></td>
51
+                                    <td style="line-height:18px;"><span>{{item.name}}</span></td>
52
+                                    <td style="line-height:18px;"><span>{{item.supply_unit}}</span></td>
53
+                                    <td style="line-height:18px;"><span>{{item.count}}</span></td>
54
+                                    <td style="line-height:18px;"><span>{{item.price}}</span></td>
55
+                                    <td style="line-height:18px;"><span>{{rate_of_concession}}</span></td>
56
+                                    <td style="line-height:18px;"><span>{{discount_amount}}</span></td>
57
+                                    <td style="line-height:18px;"><span>{{(item.count * item.price).toFixed(2)}}</span></td>
58
+                                    <td style="line-height:18px;"><span></span></td>
59
+                                </tr>
60
+                                <tr>
61
+                                  <td>合计</td>
62
+                                  <td colspan="12" style="text-align:right;"></td>
63
+                               </tr>
64
+                            </tbody>
65
+                        </table>
66
+
67
+                        <div style="margin-top:1px;">
68
+                            <div style="width:100px;">折扣额:</div><div style="width:100px;"></div>
69
+                            <div style="width:100px;">折扣金额:</div><div style="width:100px;"><span></span></div>
70
+                            <div style="width:100px;">本次付款:</div><div style="width:100px;"><span></span></div>
71
+                            <div style="width:100px;">本次欠款:</div><div style="width:100px;"></div>
72
+                       </div>
73
+                        <div style="margin-top:1px;">
74
+                            <div style="width:100px;">备注</div><div style="width:100px;"></div>
75
+                       </div>
76
+                       <div style="margin-top:1px;">
77
+                            <div style="width:100px;">制单人:</div><div style="width:100px;"></div>
78
+                            <div style="width:100px;">收货人签字:</div><div style="width:100px;"><span></span></div>
79
+                            <div style="width:100px;">供应商签字:</div><div style="width:100px;"><span></span></div>
80
+                       </div>
81
+                    </div>
82
+                </div>
83
+            </div>
84
+        </div>
85
+    </div>
86
+</template>
87
+
88
+<script>
89
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
90
+
91
+import { fetchAllAdminUsers } from "@/api/doctor";
92
+import {getPurchaseOrderDetail} from "@/api/supply"
93
+import print from 'print-js'
94
+const moment = require('moment')
95
+import { uParseTime } from '@/utils/tools'
96
+export default {
97
+    components:{
98
+        BreadCrumb
99
+    },
100
+    data(){
101
+        return{
102
+          crumbs: [
103
+            { path: false, name: '库存管理' },
104
+            { path: false, name: '耗材管理' },
105
+            { path: false, name: '入库单打印' },
106
+          ],
107
+            isEdit: 0,
108
+            checked: false,
109
+            signAndWeighBoxPatients: "sign-and-weigh-box-patients", 
110
+            time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
111
+            orgName:'',
112
+            orgId:'',
113
+            adminUserOptions:[],
114
+            tableList:[],
115
+            number:"",
116
+            id:"",
117
+            supplier_id:"",
118
+            rate_of_concession:"",
119
+            discount_amount:"",
120
+            supplyList:[],
121
+            document_date:"",
122
+        }
123
+    },
124
+    methods:{
125
+      printAction: function() {
126
+          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 14px; padding: 1px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 12px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
127
+          printJS({
128
+          printable: 'print_content',
129
+          type: 'html',
130
+          documentTitle: '  ',
131
+          style: style,
132
+          scanStyles: false
133
+          })
134
+      },
135
+
136
+      getTime(val) {
137
+         if(val < 0){
138
+           return ""
139
+         }
140
+         if(val == ""){
141
+          return ""
142
+         }else {
143
+          return uParseTime(val, '{y}-{m}-{d}')
144
+         }
145
+      },
146
+      fetchAllAdminUsers() {
147
+        fetchAllAdminUsers().then(response => {
148
+          if (response.data.state == 1) {
149
+            this.adminUserOptions = response.data.data.users
150
+
151
+          }
152
+        })
153
+      },
154
+      getXuserName(id) {
155
+        if (id <= 0) {
156
+          return "";
157
+        }
158
+        var name = "";
159
+        if (
160
+          this.adminUserOptions == null ||
161
+          typeof this.adminUserOptions.length === "undefined"
162
+        ) {
163
+          return name;
164
+        }
165
+        var leng = this.adminUserOptions.length;
166
+        if (leng == 0) {
167
+          return name;
168
+        }
169
+        for (let index = 0; index < leng; index++) {
170
+          if (this.adminUserOptions[index].id == id) {
171
+            name = this.adminUserOptions[index].name;
172
+            break;
173
+          }
174
+        }
175
+        return name;
176
+      },
177
+      getPurchaseOrderDetail(){
178
+        var id = this.$route.query.id
179
+        getPurchaseOrderDetail(id).then(response=>{
180
+        if(response.data.state == 1){
181
+            var info = response.data.data.info
182
+            this.is_check = info.is_check
183
+            this.number = info.number
184
+            this.id = info.id
185
+            this.supplier_id = info.supplier_id
186
+            this.rate_of_concession = info.rate_of_concession
187
+            this.discount_amount = info.discount_amount
188
+            this.document_date = info.document_date
189
+            var orderInfo = response.data.data.orderInfo
190
+            var supplyList = response.data.data.supplyList
191
+            this.supplyList = supplyList
192
+            for(let i=0;i<orderInfo.length;i++){
193
+                orderInfo[i].supply_count = orderInfo[i].count
194
+                orderInfo[i].supply_price = orderInfo[i].price
195
+                orderInfo[i].supply_remake = orderInfo[i].remark
196
+                orderInfo[i].type = orderInfo[i].is_source
197
+                orderInfo[i].project_id = orderInfo[i].project_id
198
+            }
199
+            console.log("orderINFO23323232",orderInfo)
200
+            this.tableList = orderInfo
201
+        }
202
+      })  
203
+    },
204
+    getSupplyName(id){
205
+      var name = ""
206
+      for(let i=0;i<this.supplyList.length;i++){
207
+        if(id == this.supplyList[i].id){
208
+          name = this.supplyList[i].supplier_name
209
+        }
210
+      }
211
+      return name
212
+    },
213
+    },
214
+    created(){
215
+      this.orgName = this.$store.getters.xt_user.org.org_name;
216
+      this.orgId = this.$store.getters.xt_user.org.id;
217
+      this.fetchAllAdminUsers()
218
+      this.getPurchaseOrderDetail()
219
+    
220
+    }
221
+}
222
+</script>
223
+
224
+
225
+<style rel="stylesheet/scss" lang="scss" scoped>
226
+.print_main_content {
227
+  background-color: white;
228
+  max-width: 1500px;
229
+  margin: 0 auto;
230
+  padding: 0 0 20px 0;
231
+
232
+  .order_title_panl {
233
+    text-align: center;
234
+
235
+    .main_title {
236
+      font-size: 18px;
237
+      line-height: 40px;
238
+      font-weight: 500;
239
+    }
240
+  }
241
+  .table_panel {
242
+    .table {
243
+      width: 100%;
244
+      border: 1px solid;
245
+      border-collapse: collapse;
246
+      padding: 2px;
247
+      
248
+
249
+      thead {
250
+        tr {
251
+          td {
252
+            border: 1px solid;
253
+            text-align: center;
254
+            font-size: 18px;
255
+            padding: 1px 5px;
256
+          }
257
+        }
258
+      }
259
+      tbody {
260
+        tr {
261
+          td {
262
+            border: 1px solid;
263
+            text-align: center;
264
+            font-size: 18px;
265
+            padding: 10px 5px;
266
+            white-space: pre-line;
267
+            .proj {
268
+              padding: 5px 0;
269
+              text-align: left;
270
+
271
+              .proj_title {
272
+                font-size: 16px;
273
+                font-weight: 500;
274
+                line-height: 25px;
275
+              }
276
+
277
+              .proj_item {
278
+                font-size: 15px;
279
+                line-height: 20px;
280
+
281
+                .zone_name {
282
+                  font-weight: 500;
283
+                }
284
+              }
285
+            }
286
+          }
287
+        }
288
+      }
289
+    }
290
+  }
291
+}
292
+</style>

+ 387 - 0
src/xt_pages/supply/goodOrderQuery.vue Целия файл

@@ -0,0 +1,387 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+    </div>
6
+    <div class="app-container ">
7
+      <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
+        <div>
9
+        
10
+          <el-date-picker
11
+            size="small"
12
+            v-model="start_time"
13
+            prefix-icon="el-icon-date"
14
+            :editable="false"
15
+            style="width: 196px;"
16
+            type="date"
17
+            placeholder="选择日期时间"
18
+            align="right"
19
+            format="yyyy-MM-dd"
20
+            value-format="yyyy-MM-dd"
21
+            @change="startTimeChange"
22
+           ></el-date-picker>-
23
+            <el-date-picker
24
+              size="small"
25
+              v-model="end_time"
26
+              prefix-icon="el-icon-date"
27
+              :editable="false"
28
+              style="width: 196px;"
29
+              type="date"
30
+              placeholder="选择日期时间"
31
+              align="right"
32
+              format="yyyy-MM-dd"
33
+              value-format="yyyy-MM-dd"
34
+              @change="endTimeChange"
35
+          ></el-date-picker>
36
+          <span>审核状态:</span>
37
+           <el-select v-model="check_id" style="width:140px;margin-right:10px;" placeholder="请选择"
38
+            @change="changeTypeName">
39
+            <el-option
40
+                v-for="item in checkList"
41
+                :key="item.id"
42
+                :label="item.name"
43
+                :value="item.id">
44
+            </el-option>
45
+          </el-select>
46
+          <el-input
47
+            size="small"
48
+            style="width: 200px;margin-left:10px;"
49
+            class="filter-item"
50
+            v-model.trim="keywords"
51
+            placeholder="订单编号或供应商名称"
52
+          />
53
+          <el-button
54
+            size="small"
55
+            class="filter-item"
56
+            type="primary"
57
+            icon="el-icon-search"
58
+            @click="search"
59
+            >搜索</el-button
60
+          >
61
+        </div>
62
+        <div>
63
+          <el-button size="small" type="primary" @click="toAdd">新增</el-button>
64
+        </div>
65
+      </div>
66
+
67
+
68
+       <el-table
69
+        :row-style="{ color: '#303133' }"
70
+        :header-cell-style="{
71
+          backgroundColor: 'rgb(245, 247, 250)',
72
+          color: '#606266'
73
+        }"
74
+        :data="tableList"
75
+        :class="signAndWeighBoxPatients"
76
+        border
77
+      >
78
+        <el-table-column label="单据日期" align="center">
79
+          <template slot-scope="scope">
80
+            <span>{{getTimes(scope.row.document_date)}}</span>
81
+         </template>
82
+        </el-table-column>
83
+        <el-table-column label="单据编号" align="center">
84
+          <template slot-scope="scope">
85
+            <span>{{scope.row.number}}</span>
86
+          </template>
87
+        </el-table-column>
88
+        <el-table-column label="供应商" align="center">
89
+            <template slot-scope="scope">
90
+              <span>{{getName(scope.row.supplier_id)}}</span>
91
+            </template>
92
+         </el-table-column>
93
+        <el-table-column label="关联购货订单号" align="center" width="200">
94
+          <template slot-scope="scope">
95
+            
96
+          </template>
97
+        </el-table-column>
98
+        <el-table-column label="购货金额" align="center">
99
+          <template slot-scope="scope">
100
+             <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span> 
101
+          </template>
102
+        </el-table-column>
103
+        <el-table-column label="优惠后金额" align="center">
104
+         <template slot-scope="scope">
105
+           {{getAllCount(scope.row.orderInfo)}}
106
+         </template>
107
+       </el-table-column>
108
+        <el-table-column label="已付款" align="center">
109
+         <template slot-scope="scope">
110
+           {{getAllCount(scope.row.orderInfo)}}
111
+         </template>
112
+       </el-table-column>
113
+       <el-table-column label="数量" align="center">
114
+         <template slot-scope="scope">
115
+           {{getAllCount(scope.row.orderInfo)}}
116
+         </template>
117
+       </el-table-column>
118
+
119
+       <el-table-column label="订单状态" align="center">
120
+         <template slot-scope="scope">
121
+           <span v-if="scope.row.is_check == 2">未审核</span>
122
+           <span v-if="scope.row.is_check == 1">已审核</span>
123
+         </template>
124
+       </el-table-column>
125
+      
126
+          
127
+      <el-table-column label="制单人" align="center">
128
+         <template slot-scope="scope">
129
+          {{getDocName(scope.row.creater)}}
130
+         </template>
131
+       </el-table-column>
132
+
133
+      <el-table-column label="审核人" align="center">
134
+         <template slot-scope="scope">
135
+          {{getDocName(scope.row.checker)}}
136
+         </template>
137
+       </el-table-column>
138
+
139
+       <el-table-column label="操作" align="center" width="260px">
140
+          <template slot-scope="scope">
141
+              <el-button
142
+                icon="el-icon-edit-outline"
143
+                size="small"
144
+                type="primary"
145
+                @click="toClick(scope.row.id)"
146
+              >编辑
147
+              </el-button>
148
+              <el-button
149
+                icon="el-icon-delete"
150
+                size="small"
151
+                type="danger"
152
+                @click="toClickOne(scope.row)"
153
+              >删除
154
+              </el-button>
155
+          </template>
156
+        </el-table-column>
157
+      </el-table>
158
+      <el-pagination
159
+        @size-change="handleSizeChange"
160
+        @current-change="handleCurrentChange"
161
+        :page-sizes="[10, 50, 100,200,500,1000]"
162
+        :page-size="10"
163
+        background
164
+        align="right"
165
+        style="margin-top:20px;"
166
+        layout="total, sizes, prev, pager, next, jumper"
167
+        :total="total"
168
+      >
169
+      </el-pagination>
170
+
171
+    </div>
172
+  </div>
173
+</template>
174
+
175
+<script>
176
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
177
+
178
+import {getAllSupply,getAllPurchaseOrderList} from "@/api/supply"
179
+import {uParseTime } from '@/utils/tools'
180
+export default {
181
+  name: "stockIn",
182
+   components: {
183
+     
184
+   },
185
+  components: {
186
+    BreadCrumb
187
+  },
188
+  data() {
189
+    return {
190
+      crumbs: [
191
+        { path: false, name: "采购管理" },
192
+        { path: "/spply/query", name: "购货单" }
193
+      ],
194
+      keywords: "",
195
+      total: 0,
196
+      multipleSelection: [],
197
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
198
+      start_time: "",
199
+      end_time:new Date(),
200
+      page: 1,
201
+      limit: 10,
202
+      goodType: [],
203
+      goodInfo: [],
204
+      org_id:0,
205
+      types:[],
206
+      tableList:[],
207
+      type_name:"",
208
+      checkList:[
209
+        {id:0,name:"请选择"},
210
+        {id:1,name:"已审核"},
211
+        {id:2,name:"未审核"},
212
+      ],
213
+      supplyList:[],
214
+      check_id:0,
215
+      doctorList:[],
216
+    };
217
+  },
218
+  methods:{
219
+     toAdd(){
220
+       this.$router.push({path:"/purchase/order/add"})
221
+     },
222
+     changeTypeName(){
223
+
224
+     },
225
+     startTimeChange(){
226
+
227
+     },
228
+     endTimeChange(){
229
+
230
+     },
231
+     search(){
232
+
233
+     },
234
+     handleSizeChange(val){
235
+       this.limit = val
236
+       this.getlist()
237
+     },
238
+     handleCurrentChange(val){
239
+       this.page = val
240
+       this.getlist()
241
+     },
242
+     getAllSupply(){
243
+       getAllSupply().then(response=>{
244
+         if(response.data.state == 1){
245
+            var supplyList = response.data.data.supplyList
246
+            this.doctorList = response.data.data.doctorList
247
+            for(let i=0;i<supplyList.length;i++){
248
+              this.supplyList.push(supplyList[i])
249
+            }
250
+         }
251
+       })
252
+     },
253
+     changeTypeName(){
254
+
255
+     },
256
+     getTimes(time) {
257
+      if (time === '') {
258
+      return ''
259
+      }
260
+      return uParseTime(time, '{y}-{m}-{d}')
261
+     },
262
+     getlist(){
263
+        var params = {
264
+          check_id:this.check_id,
265
+          start_time:this.getTimes(this.start_time),
266
+          end_time:this.getTimes(this.end_time),
267
+          keyword:this.keywords,
268
+          page:this.page,
269
+          limit:this.limit,
270
+        }
271
+       getAllPurchaseOrderList(params).then(response=>{
272
+          if(response.data.state == 1){
273
+            var list = response.data.data.list 
274
+            console.log("list2332232323232",list)
275
+            this.tableList = list
276
+            var total = response.data.data.total
277
+            this.total = total
278
+          }
279
+       })
280
+     },
281
+     getName(id){
282
+       var name = ""
283
+       for(let i=0;i<this.supplyList.length;i++){
284
+         if(id == this.supplyList[i].id){
285
+           name = this.supplyList[i].supplier_name
286
+         }
287
+       }
288
+       return name
289
+     },
290
+     getDocName(id){
291
+      var user_name = ""
292
+      for(let i=0;i<this.doctorList.length;i++){
293
+        if(id == this.doctorList[i].admin_user_id){
294
+          user_name = this.doctorList[i].user_name
295
+        }
296
+      }
297
+      return user_name
298
+     },
299
+     getAllBuyPrice(arr){
300
+       var buy_price = 0
301
+       if(arr!=undefined && arr.length > 0){
302
+          for(let i=0;i<arr.length;i++){
303
+            buy_price += (arr[i].count * arr[i].price)
304
+          }
305
+       }
306
+       return buy_price.toFixed(2)
307
+     },
308
+     getAllCount(arr){
309
+       var count = ""
310
+        if(arr!=undefined && arr.length > 0){
311
+          for(let i=0;i<arr.length;i++){
312
+            count += arr[i].count
313
+          }
314
+       }
315
+       return count
316
+     },
317
+     toClick(id){
318
+       this.$router.push({path:"/purchase/order/edit?id="+id})
319
+     }
320
+  },
321
+  created() {
322
+    var now = new Date(); //当前日期 
323
+    var nowMonth = now.getMonth(); //当前月 
324
+    var nowYear = now.getFullYear(); //当前年 
325
+    //本月的开始时间
326
+    var monthStartDate = new Date(nowYear, nowMonth, 1); 
327
+    this.start_time = monthStartDate
328
+    this.org_id =  this.$store.getters.xt_user.org_id
329
+    this.getAllSupply()
330
+    this.getlist()
331
+  },
332
+ 
333
+};
334
+</script>
335
+
336
+<style rel="stylesheet/css" lang="scss" scoped>
337
+.information {
338
+  border: 1px #dcdfe6 solid;
339
+  padding: 30px 20px 30px 20px;
340
+
341
+  .border {
342
+    border-bottom: 1px #dcdfe6 solid;
343
+    margin: 0px 0 20px 0;
344
+  }
345
+}
346
+
347
+.title {
348
+  background: #409eff;
349
+  height: 44px;
350
+  line-height: 44px;
351
+  padding: 0 0 0 10px;
352
+  color: #fff;
353
+  margin: 0 0 10px 0;
354
+}
355
+
356
+.edit_separater {
357
+  border-top: 1px solid rgb(233, 233, 233);
358
+  margin-top: 15px;
359
+  margin-bottom: 15px;
360
+}
361
+</style>
362
+
363
+<style>
364
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
365
+  font-size: 12px;
366
+}
367
+
368
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
369
+  background: #6fb5fa;
370
+}
371
+
372
+.count {
373
+  color: #bd2c00;
374
+}
375
+.el-table td,
376
+.el-table th.is-leaf,
377
+.el-table--border,
378
+.el-table--group {
379
+  border-color: #d0d3da;
380
+}
381
+.el-table--border::after,
382
+.el-table--group::after,
383
+.el-table::before {
384
+  background-color: #d0d3da;
385
+}
386
+
387
+</style>

+ 12 - 6
src/xt_pages/supply/purchaseOrderQuery.vue Целия файл

@@ -136,16 +136,18 @@
136 136
        <el-table-column label="操作" align="center" width="260px">
137 137
           <template slot-scope="scope">
138 138
               <el-button
139
+                icon="el-icon-edit-outline"
139 140
                 size="small"
140 141
                 type="primary"
141
-                @click="toClick(scope.row)"
142
-              >库存流水
142
+                @click="toClick(scope.row.id)"
143
+              >编辑
143 144
               </el-button>
144 145
               <el-button
146
+                icon="el-icon-delete"
145 147
                 size="small"
146
-                type="primary"
148
+                type="danger"
147 149
                 @click="toClickOne(scope.row)"
148
-              >批次
150
+              >删除
149 151
               </el-button>
150 152
           </template>
151 153
         </el-table-column>
@@ -184,7 +186,7 @@ export default {
184 186
     return {
185 187
       crumbs: [
186 188
         { path: false, name: "采购管理" },
187
-        { path: "/spply/query", name: "供应商管理" }
189
+        { path: "/spply/query", name: "购货订单" }
188 190
       ],
189 191
       keywords: "",
190 192
       total: 0,
@@ -308,7 +310,10 @@ export default {
308 310
           }
309 311
        }
310 312
        return count
311
-     } 
313
+     },
314
+     toClick(id){
315
+       this.$router.push({path:"/purchase/order/edit?id="+id})
316
+     }
312 317
   },
313 318
   created() {
314 319
     var now = new Date(); //当前日期 
@@ -375,4 +380,5 @@ export default {
375 380
 .el-table::before {
376 381
   background-color: #d0d3da;
377 382
 }
383
+
378 384
 </style>