Browse Source

修改华侨医院bug

csx 6 years ago
parent
commit
27875d545b

+ 9 - 0
src/api/stock.js View File

@@ -544,3 +544,12 @@ export function getStockDetail(params) {
544 544
   })
545 545
 }
546 546
 
547
+
548
+
549
+export function getPrintStockGood(params) {
550
+  return request({
551
+    url: '/api/print/stock',
552
+    method: 'get',
553
+    params: params
554
+  })
555
+}

+ 123 - 114
src/router/modules/stock.js View File

@@ -11,119 +11,128 @@ export default {
11 11
     icon: 'stock'
12 12
   },
13 13
   children: [
14
-        {
15
-          path: '/stock/in',
16
-          component: () => import('@/xt_pages/stock/stockInOrder'),
17
-          name: 'stockInOrder',
18
-          meta: { title: 'stockInOrder', noCache: true }
19
-        }, {
20
-          path: '/stock/return',
21
-          component: () => import('@/xt_pages/stock/salesReturnOrder'),
22
-          name: 'salesReturnOrder',
23
-          meta: { title: 'salesReturnOrder', noCache: true }
24
-        }, 
25
-        {
26
-          path: '/stock/out',
27
-          component: () => import('@/xt_pages/stock/stockOutOrder'),
28
-          name: 'stockOutOrder',
29
-          meta: { title: 'stockOutOrder', noCache: true }
30
-        },  {
31
-          path: '/stock/cancel',
32
-          component: () => import('@/xt_pages/stock/cancelStockOrder'),
33
-          name: 'cancelStockOrder',
34
-          meta: { title: 'cancelStockOrder', noCache: true }
35
-        },{
36
-          path: '/stock/in/other',
37
-          component: () => import('@/xt_pages/stock/otherStockInOrder'),
38
-          name: 'otherStockInOrder',
39
-          meta: { title: 'otherStockInOrder', noCache: true }
40
-        }, {
41
-          path: '/stock/return/other',
42
-          component: () => import('@/xt_pages/stock/otherSalesReturnOrder'),
43
-          name: 'otherSalesReturnOrder',
44
-          meta: { title: 'otherSalesReturnOrder', noCache: true }
45
-        },{
46
-          path: '/stock/out/other',
47
-          component: () => import('@/xt_pages/stock/otherStockOutOrder'),
48
-          name: 'otherStockOutOrder',
49
-          meta: { title: 'otherStockOutOrder', noCache: true }
50
-        }, {
51
-          path: '/stock/cancel/other',
52
-          component: () => import('@/xt_pages/stock/otherCancelStockOrder'),
53
-          name: 'otherCancelStockOrder',
54
-          meta: { title: 'otherCancelStockOrder', noCache: true }
55
-        }, {
56
-          path: '/stock/query',
57
-          component: () => import('@/xt_pages/stock/stockQuery'),
58
-          name: 'stockQuery',
59
-          meta: { title: 'stockQuery' }
60
-        }, {
61
-          path: '/stock/detail',
62
-          component: () => import('@/xt_pages/stock/stockDetailIndex'),
63
-          name: 'stockDetail',
64
-          meta: { title: 'stockDetail' }
65
-        },{
66
-          path: '/stock/in/add',
67
-          component: () => import('@/xt_pages/stock/stockInOrderAdd'),
68
-          name: 'stockInOrderAdd',
69
-          hidden: true,
70
-          is_menu: false,
71
-          meta: { title: 'stockInOrderAdd' }
72
-        }, {
73
-          path: '/stock/in/detail',
74
-          component: () => import('@/xt_pages/stock/stockInDetail'),
75
-          name: 'stockInDetail',
76
-          hidden: true,
77
-          is_menu: false,
78
-          meta: { title: 'stockInDetail' }
79
-        }, {
80
-          path: '/stock/return/detail',
81
-          component: () => import('@/xt_pages/stock/salesReturnDetail'),
82
-          name: 'salesReturnDetail',
83
-          hidden: true,
84
-          is_menu: false,
85
-          meta: { title: 'salesReturnDetail' }
86
-        }, {
87
-          path: '/stock/return/add',
88
-          component: () => import('@/xt_pages/stock/salesReturnOrderAdd'),
89
-          name: 'salesReturnOrderAdd',
90
-          hidden: true,
91
-          is_menu: false,
92
-          meta: { title: 'salesReturnOrderAdd' }
93
-        }, {
94
-          path: '/stock/out/add',
95
-          component: () => import('@/xt_pages/stock/stockOutOrderAdd'),
96
-          name: 'stockOutOrderAdd',
97
-          hidden: true,
98
-          is_menu: false,
99
-          meta: { title: 'stockOutOrderAdd', noCache: true }
100
-        }, {
101
-          path: '/stock/out/detail',
102
-          component: () => import('@/xt_pages/stock/stockOutDetail'),
103
-          name: 'stockOutDetail',
104
-          hidden: true,
105
-          is_menu: false,
106
-          meta: { title: 'stockOutDetail', noCache: true }
107
-        }, {
108
-          path: '/stock/cancel/add',
109
-          component: () => import('@/xt_pages/stock/cancelStockOrderAdd'),
110
-          name: 'cancelStockOrderAdd',
111
-          hidden: true,
112
-          is_menu: false,
113
-          meta: { title: 'cancelStockOrderAdd', noCache: true }
114
-        }, {
115
-          path: '/stock/cancel/detail',
116
-          component: () => import('@/xt_pages/stock/cancelStockDetail'),
117
-          name: 'cancelStockDetail',
118
-          hidden: true,
119
-          is_menu: false,
120
-          meta: { title: 'cancelStockDetail', noCache: true }
121
-        },
122
-        {
123
-          path: '/stock/config',
124
-          component: () => import('@/xt_pages/stock/index'),
125
-          name: 'config',
126
-          meta: { title: 'config' }
127
-        }
14
+    {
15
+      path: '/stock/in',
16
+      component: () => import('@/xt_pages/stock/stockInOrder'),
17
+      name: 'stockInOrder',
18
+      meta: { title: 'stockInOrder', noCache: true }
19
+    }, {
20
+      path: '/stock/return',
21
+      component: () => import('@/xt_pages/stock/salesReturnOrder'),
22
+      name: 'salesReturnOrder',
23
+      meta: { title: 'salesReturnOrder', noCache: true }
24
+    },
25
+    {
26
+      path: '/stock/out',
27
+      component: () => import('@/xt_pages/stock/stockOutOrder'),
28
+      name: 'stockOutOrder',
29
+      meta: { title: 'stockOutOrder', noCache: true }
30
+    }, {
31
+      path: '/stock/cancel',
32
+      component: () => import('@/xt_pages/stock/cancelStockOrder'),
33
+      name: 'cancelStockOrder',
34
+      meta: { title: 'cancelStockOrder', noCache: true }
35
+    }, {
36
+      path: '/stock/in/other',
37
+      component: () => import('@/xt_pages/stock/otherStockInOrder'),
38
+      name: 'otherStockInOrder',
39
+      meta: { title: 'otherStockInOrder', noCache: true }
40
+    }, {
41
+      path: '/stock/return/other',
42
+      component: () => import('@/xt_pages/stock/otherSalesReturnOrder'),
43
+      name: 'otherSalesReturnOrder',
44
+      meta: { title: 'otherSalesReturnOrder', noCache: true }
45
+    }, {
46
+      path: '/stock/out/other',
47
+      component: () => import('@/xt_pages/stock/otherStockOutOrder'),
48
+      name: 'otherStockOutOrder',
49
+      meta: { title: 'otherStockOutOrder', noCache: true }
50
+    }, {
51
+      path: '/stock/cancel/other',
52
+      component: () => import('@/xt_pages/stock/otherCancelStockOrder'),
53
+      name: 'otherCancelStockOrder',
54
+      meta: { title: 'otherCancelStockOrder', noCache: true }
55
+    }, {
56
+      path: '/stock/query',
57
+      component: () => import('@/xt_pages/stock/stockQuery'),
58
+      name: 'stockQuery',
59
+      meta: { title: 'stockQuery', noCache: true  }
60
+    }, {
61
+      path: '/stock/detail',
62
+      component: () => import('@/xt_pages/stock/stockDetailIndex'),
63
+      name: 'stockDetail',
64
+      meta: { title: 'stockDetail', noCache: true  }
65
+    }, {
66
+      path: '/stock/in/add',
67
+      component: () => import('@/xt_pages/stock/stockInOrderAdd'),
68
+      name: 'stockInOrderAdd',
69
+      hidden: true,
70
+      is_menu: false,
71
+      meta: { title: 'stockInOrderAdd', noCache: true }
72
+    }, {
73
+      path: '/stock/in/detail',
74
+      component: () => import('@/xt_pages/stock/stockInDetail'),
75
+      name: 'stockInDetail',
76
+      hidden: true,
77
+      is_menu: false,
78
+      meta: { title: 'stockInDetail', noCache: true  }
79
+    }, {
80
+      path: '/stock/return/detail',
81
+      component: () => import('@/xt_pages/stock/salesReturnDetail'),
82
+      name: 'salesReturnDetail',
83
+      hidden: true,
84
+      is_menu: false,
85
+      meta: { title: 'salesReturnDetail', noCache: true  }
86
+    }, {
87
+      path: '/stock/return/add',
88
+      component: () => import('@/xt_pages/stock/salesReturnOrderAdd'),
89
+      name: 'salesReturnOrderAdd',
90
+      hidden: true,
91
+      is_menu: false,
92
+      meta: { title: 'salesReturnOrderAdd', noCache: true }
93
+    }, {
94
+      path: '/stock/out/add',
95
+      component: () => import('@/xt_pages/stock/stockOutOrderAdd'),
96
+      name: 'stockOutOrderAdd',
97
+      hidden: true,
98
+      is_menu: false,
99
+      meta: { title: 'stockOutOrderAdd', noCache: true }
100
+    }, {
101
+      path: '/stock/out/detail',
102
+      component: () => import('@/xt_pages/stock/stockOutDetail'),
103
+      name: 'stockOutDetail',
104
+      hidden: true,
105
+      is_menu: false,
106
+      meta: { title: 'stockOutDetail', noCache: true }
107
+    }, {
108
+      path: '/stock/cancel/add',
109
+      component: () => import('@/xt_pages/stock/cancelStockOrderAdd'),
110
+      name: 'cancelStockOrderAdd',
111
+      hidden: true,
112
+      is_menu: false,
113
+      meta: { title: 'cancelStockOrderAdd', noCache: true }
114
+    }, {
115
+      path: '/stock/cancel/detail',
116
+      component: () => import('@/xt_pages/stock/cancelStockDetail'),
117
+      name: 'cancelStockDetail',
118
+      hidden: true,
119
+      is_menu: false,
120
+      meta: { title: 'cancelStockDetail', noCache: true }
121
+    }, {
122
+      path: '/stock/config',
123
+      component: () => import('@/xt_pages/stock/index'),
124
+      name: 'config',
125
+      meta: { title: 'config', noCache: true  }
126
+    }, {
127
+      path: '/stock/print',
128
+      component: () => import('@/xt_pages/stock/detail/print'),
129
+      hidden: true,
130
+      is_menu: false,
131
+      name: 'stock_print',
132
+      meta: {
133
+        title: '库存打印',
134
+        noCache: true
135
+      }
136
+    }
128 137
   ]
129 138
 }

+ 15 - 15
src/xt_pages/dialysis/batch_print/batch_print_order_other.vue View File

@@ -232,7 +232,7 @@
232 232
                     <table class="inside_table">
233 233
                       <tbody>
234 234
                       <!-- <thead> -->
235
-                        <tr><td colspan="10" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">二、透析中护理录:</td></tr>
235
+                        <tr><td colspan="10" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">二、透析中护理录:</td></tr>
236 236
                         <tr>
237 237
                           <td width="100">时间</td>
238 238
                           <td width="30">T<br>C°</td>
@@ -275,7 +275,7 @@
275 275
                           <td>{{monitor_record.ultrafiltration_volume?monitor_record.ultrafiltration_volume:'/'}}</td>
276 276
                           <td>{{monitor_record.sodium_concentration?monitor_record.sodium_concentration:''}}</td>
277 277
                           <td style="line-height:16px;padding:0px;"> <div style="height:48px;line-height:48px; overflow:hidden;"><span style="word-break: break-all;margin:0;line-height:16px;-webkit-line-clamp:3;overflow:visible;display:inline-block;vertical-align:middle;height:auto;">{{monitor_record.symptom}}&nbsp;{{monitor_record.dispose}}&nbsp;{{monitor_record.result}}</span></div></td>
278
-                          <td><span v-if="setAdminUserES(monitor_record, 'monitoring_nurse') == ''">{{getAdminUser(monitor_record, 'monitoring_nurse')}}</span><img class="es-img" :src="setAdminUserES(monitor_record, 'monitoring_nurse')" alt="" srcset=""  v-else style="height: 20px;"></td>
278
+                          <td><span v-if="setAdminUserES(monitor_record, 'monitoring_nurse') == ''">{{getAdminUser(monitor_record, 'monitoring_nurse')}}</span><img class="es-img" :src="setAdminUserES(monitor_record, 'monitoring_nurse')" alt="" srcset=""  v-else ></td>
279 279
                         </tr>
280 280
                       </tbody>
281 281
                     </table>
@@ -335,7 +335,7 @@
335 335
                     <table class="inside_table">
336 336
                       <tbody>
337 337
                       <!-- <thead> -->
338
-                        <tr><td colspan="10" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">二、透析中护理录:</td></tr>
338
+                        <tr><td colspan="10" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">二、透析中护理录:</td></tr>
339 339
                         <tr>
340 340
                           <td width="100">时间</td>
341 341
                           <td width="30">T<br>C°</td>
@@ -360,13 +360,13 @@
360 360
                           <td>{{monitor_record.ultrafiltration_volume?monitor_record.ultrafiltration_volume:'/'}}</td>
361 361
                           <td>{{monitor_record.sodium_concentration?monitor_record.sodium_concentration:''}}</td>
362 362
                           <td style="line-height:16px;padding:0px;"> <div style="height:48px;line-height:48px; overflow:hidden;"><span style="word-break: break-all;margin:0;line-height:16px;-webkit-line-clamp:3;overflow:visible;display:inline-block;vertical-align:middle;height:auto;"> {{monitor_record.symptom}}&nbsp;{{monitor_record.dispose}}&nbsp;{{monitor_record.result}}</span></div></td>
363
-                          <td><span v-if="setAdminUserES(monitor_record, 'monitoring_nurse') == ''">{{getAdminUser(monitor_record, 'monitoring_nurse')}}</span><img class="es-img" :src="setAdminUserES(monitor_record, 'monitoring_nurse')" alt="" srcset=""  v-else style="height: 20px;"></td>
363
+                          <td><span v-if="setAdminUserES(monitor_record, 'monitoring_nurse') == ''">{{getAdminUser(monitor_record, 'monitoring_nurse')}}</span><img class="es-img" :src="setAdminUserES(monitor_record, 'monitoring_nurse')" alt="" srcset=""  v-else ></td>
364 364
                         </tr>
365 365
                       </tbody>
366 366
                     </table>
367 367
                   </td>
368 368
                 </tr>
369
-                <tr><td colspan="2" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">三、透析后护理录</td></tr>
369
+                <tr><td colspan="2" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">三、透析后护理录</td></tr>
370 370
                 <tr>
371 371
                   <td>
372 372
                     <div class="row" style="padding: 2px 0;line-height:19px;">
@@ -474,14 +474,14 @@
474 474
                         责任护士:
475 475
                         <div class="under_line" style="width: 100px;">
476 476
                           <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
477
-                          <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else style="height: 20px;">
477
+                          <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else >
478 478
                         </div>
479 479
                       </div>
480 480
                       <div class="inline_block" >
481 481
                         &emsp;核对人:
482 482
                         <div class="under_line" style="width: 100px;">
483 483
                           <span v-if="setAdminUserES(record.check, 'modifier') == ''">{{getAdminUser(record.check, 'modifier')}}</span>
484
-                          <img class="es-img" :src="setAdminUserES(record.check, 'modifier')" alt="" srcset="" v-else style="height: 20px;">
484
+                          <img class="es-img" :src="setAdminUserES(record.check, 'modifier')" alt="" srcset="" v-else>
485 485
                         </div>
486 486
                       </div>
487 487
                       <div class="inline_block">
@@ -494,7 +494,7 @@
494 494
                         &emsp;收针者:
495 495
                         <div class="under_line" style="width: 100px;">
496 496
                           <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
497
-                          <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else style="height: 20px;">
497
+                          <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else >
498 498
                         </div>
499 499
                       </div>
500 500
                     </div>
@@ -519,7 +519,7 @@
519 519
                         血透室护士签名:
520 520
                         <div class="under_line" style="width: 100px;">
521 521
                           <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
522
-                          <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else style="height: 20px;">
522
+                          <img class="es-img" :src="setAdminUserES(record.dialysis_order, 'start_nurse')" alt="" srcset="" v-else >
523 523
                         </div>
524 524
                       </div>
525 525
                       <div class="inline_block" >
@@ -810,15 +810,15 @@
810 810
                   <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td>
811 811
                   <td height="60px">
812 812
                     <span v-if="setAdminUserES(advice, 'advice_doctor') == ''">{{getAdminUser(advice, 'advice_doctor')}}</span>
813
-                    <img class="es-img" :src="setAdminUserES(advice, 'advice_doctor')" alt="" srcset="" v-else style="height: 20px;">
813
+                    <img class="es-img" :src="setAdminUserES(advice, 'advice_doctor')" alt="" srcset="" v-else >
814 814
                   </td>
815 815
                   <td height="60px">
816 816
                       <span v-if="setAdminUserES(advice, 'checker') == ''">{{getAdminUser(advice, 'checker')}}</span>
817
-                      <img class="es-img" :src="setAdminUserES(advice, 'checker')" alt="" srcset="" v-else style="height: 20px;">
817
+                      <img class="es-img" :src="setAdminUserES(advice, 'checker')" alt="" srcset="" v-else >
818 818
                   </td>
819 819
                   <td height="60px">
820 820
                     <span v-if="setAdminUserES(advice, 'execution_staff') == ''">{{getAdminUser(advice, 'execution_staff')}}</span>
821
-                    <img class="es-img" :src="setAdminUserES(advice, 'execution_staff')" alt="" srcset="" v-else style="height: 20px;">
821
+                    <img class="es-img" :src="setAdminUserES(advice, 'execution_staff')" alt="" srcset="" v-else >
822 822
                   </td>
823 823
                   <td height="60px"><span v-if="advice.execution_time"> {{getTime(advice.execution_time,'{y}-{m}-{d} {h}:{i}')}} </span> </td>
824 824
                 </tr>
@@ -905,15 +905,15 @@
905 905
                     <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td>
906 906
                     <td height="60px">
907 907
                       <span v-if="setAdminUserES(advice, 'advice_doctor') == ''">{{getAdminUser(advice, 'advice_doctor')}}</span>
908
-                      <img class="es-img" :src="setAdminUserES(advice, 'advice_doctor')" alt="" srcset="" v-else style="height: 20px;">
908
+                      <img class="es-img" :src="setAdminUserES(advice, 'advice_doctor')" alt="" srcset="" v-else >
909 909
                     </td>
910 910
                     <td height="60px">
911 911
                         <span v-if="setAdminUserES(advice, 'checker') == ''">{{getAdminUser(advice, 'checker')}}</span>
912
-                        <img class="es-img" :src="setAdminUserES(advice, 'checker')" alt="" srcset="" v-else style="height: 20px;">
912
+                        <img class="es-img" :src="setAdminUserES(advice, 'checker')" alt="" srcset="" v-else >
913 913
                     </td>
914 914
                     <td height="60px">
915 915
                       <span v-if="setAdminUserES(advice, 'execution_staff') == ''">{{getAdminUser(advice, 'execution_staff')}}</span>
916
-                      <img class="es-img" :src="setAdminUserES(advice, 'execution_staff')" alt="" srcset="" v-else style="height: 20px;">
916
+                      <img class="es-img" :src="setAdminUserES(advice, 'execution_staff')" alt="" srcset="" v-else >
917 917
                     </td>
918 918
                     <td height="60px"><span v-if="advice.execution_time"> {{getTime(advice.execution_time,'{y}-{m}-{d} {h}:{i}')}} </span> </td>
919 919
                   </tr>

+ 3 - 3
src/xt_pages/dialysis/template/dialysisPrintOrderTwo.vue View File

@@ -224,7 +224,7 @@
224 224
               <td style="padding: 0;" colspan="2">
225 225
                 <table class="inside_table">
226 226
                   <tbody>
227
-                    <tr><td colspan="10" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">二、透析中护理录:</td></tr>
227
+                    <tr><td colspan="10" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">二、透析中护理录:</td></tr>
228 228
                     <tr>
229 229
                       <td width="100">时间</td>
230 230
                       <td width="30">T<br>C°</td>
@@ -328,7 +328,7 @@
328 328
               <td style="padding: 0;" colspan="2">
329 329
                 <table class="inside_table">
330 330
                   <tbody>
331
-                    <tr><td colspan="10" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">二、透析中护理录:</td></tr>
331
+                    <tr><td colspan="10" style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">二、透析中护理录:</td></tr>
332 332
                     <tr>
333 333
                       <td width="100">时间</td>
334 334
                       <td width="30">T<br>C°</td>
@@ -362,7 +362,7 @@
362 362
                 </table>
363 363
               </td>
364 364
             </tr>
365
-            <tr><td colspan="2"  style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">三、透析后护理录</td></tr>
365
+            <tr><td colspan="2"  style="font-size:16px;padding: 6px 8px;line-height: 30px;text-align:left;">三、透析后护理录</td></tr>
366 366
             <tr>
367 367
               <td>
368 368
                 <div class="row" style="padding: 2px 0;line-height:19px;">

+ 125 - 16
src/xt_pages/stock/Dialog/salesReturnDialog.vue View File

@@ -10,17 +10,22 @@
10 10
     <el-row :gutter="20">
11 11
       <el-col :span="8">
12 12
         <el-table
13
-          :data="propForm.goodType"
14
-          ref="templatetable"
13
+          :data="propForm.goods"
14
+          ref="table"
15 15
           border
16 16
           highlight-current-row
17 17
           max-height="250"
18
+          :row-class-name="tableRows"
19
+          @row-click="onRowClicks"
18 20
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
19 21
           @current-change="goodTypeTableChange"
20 22
           style="width: 100%">
21 23
           <el-table-column
22
-            prop="type_name"
24
+            align="center"
23 25
             label="商品类型">
26
+            <template slot-scope="scope">
27
+              <span>{{getGoodTypeName(scope.row)}}</span>
28
+            </template>
24 29
           </el-table-column>
25 30
         </el-table>
26 31
       </el-col>
@@ -32,7 +37,7 @@
32 37
           max-height="250"
33 38
           @row-click="clickRow"
34 39
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
35
-
40
+          @select="selectGoodInfo"
36 41
           @selection-change="changeGoodInfoTableData"
37 42
           @select-all="changeAllGoodInfoTableData"
38 43
           row-key="row_key"
@@ -90,7 +95,9 @@
90 95
         keywords: '',
91 96
         multipleSelection: [],
92 97
         currentGoodTypeId: 0,
93
-        isClose: false
98
+        isClose: false,
99
+        table_current_index: -1
100
+
94 101
       }
95 102
     },
96 103
     props: {
@@ -103,44 +110,100 @@
103 110
       hide:function(){
104 111
         this.visibility = false
105 112
         this.goodInfoTableData = []
113
+        for (let i = 0; i < this.propForm.goods.length; i++) {
114
+          for (let key in this.propForm.goods[i]) {
115
+            if (key != 'index') {
116
+              this.propForm.goods[i][key].isSelected = false
117
+            }
118
+          }
119
+        }
106 120
 
107 121
       },
108 122
       show:function(){
109 123
         this.visibility = true
124
+        for (let i = 0; i < this.propForm.goods.length; i++) {
125
+          for (let key in this.propForm.goods[i]) {
126
+            if (key != 'index') {
127
+              this.propForm.goods[i][key].isSelected = false
128
+            }
129
+          }
130
+        }
110 131
       },
111 132
       goodTypeTableChange: function(currentRow, oldCurrentRow) {
112
-        this.currentGoodTypeId = currentRow.id
133
+        console.log(currentRow)
134
+        let keyName = ''
135
+        for (var key in currentRow) {
136
+          if (key != 'index') {
137
+            keyName = key
138
+          }
139
+        }
113 140
         this.goodInfoTableData = []
114 141
         this.goodInfo = []
115
-        console.log(this.propForm.goodInfo)
116
-
142
+        if (keyName.length > 0) {
143
+          this.currentGoodTypeId = parseInt(keyName)
144
+          this.goodInfo = currentRow[keyName]
145
+          this.goodInfoTableData = (currentRow[keyName])
146
+        }
117 147
 
118
-        for (let i = 0; i < this.propForm.goodInfo.length; i++) {
119
-          if (this.currentGoodTypeId == this.propForm.goodInfo[i].good_type_id) {
120
-              this.goodInfo.push(this.propForm.goodInfo[i])
121
-              this.goodInfoTableData.push(this.propForm.goodInfo[i])
148
+        for (let i = 0; i < this.goodInfoTableData.length; i++) {
149
+          if (this.goodInfoTableData[i].isSelected) {
150
+            this.$nextTick(function() {
151
+              this.$refs.multipleTable.toggleRowSelection(this.goodInfoTableData[i])
152
+            })
122 153
           }
123 154
         }
155
+        //
156
+        //
157
+        //
158
+        //
159
+        // for (let i = 0; i < this.propForm.goodInfo.length; i++) {
160
+        //   if (this.currentGoodTypeId == this.propForm.goodInfo[i].good_type_id) {
161
+        //       this.goodInfo.push(this.propForm.goodInfo[i])
162
+        //       this.goodInfoTableData.push(this.propForm.goodInfo[i])
163
+        //   }
164
+        // }
124 165
       },
125 166
       cancle: function() {
126 167
         this.$emit('dialog-cancle', this.getValue())
127 168
         this.$refs.multipleTable.clearSelection()
128
-        this.$refs.templatetable.setCurrentRow(null);
169
+        this.$refs.table.setCurrentRow(null);
129 170
         this.goodInfoTableData = []
130 171
 
131 172
       },
132 173
       comfirm: function() {
133 174
         this.$emit('dialog-comfirm', this.getValue())
134 175
         this.$refs.multipleTable.clearSelection()
135
-        this.$refs.templatetable.setCurrentRow(null);
176
+        this.$refs.table.setCurrentRow(null);
136 177
         this.goodInfoTableData = []
137 178
 
138 179
       },
139 180
       getValue: function() {
181
+        for (let i = 0; i < this.propForm.goods.length; i++) {
182
+          for (let key in this.propForm.goods[i]) {
183
+            if (key != 'index') {
184
+              for(let a= 0; a < this.propForm.goods[i][key].length; a++){
185
+                if (this.propForm.goods[i][key][a].isSelected) {
186
+                  this.multipleSelection.push(this.propForm.goods[i][key][a])
187
+                }
188
+              }
189
+            }
190
+          }
191
+        }
192
+
193
+        const obj3 = {}
194
+        this.multipleSelection =  this.multipleSelection.reduce((cur, next) => {
195
+          obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
196
+          return cur
197
+        }, [])
198
+
140 199
         const obj = {
141 200
           selectedGoodInfo: this.multipleSelection,
142 201
           goodTypeId: this.currentGoodTypeId
143 202
         }
203
+
204
+        console.log(obj)
205
+
206
+
144 207
         return obj
145 208
       }, goodTypeSelect: function(id) {
146 209
         this.tempGoodInfo = []
@@ -184,11 +247,57 @@
184 247
         }
185 248
       }, changeGoodInfoTableData: function(val) {
186 249
         this.multipleSelection = val
187
-      }, changeAllGoodInfoTableData: function(val) {
188
-        this.multipleSelection = val
250
+      }, changeAllGoodInfoTableData: function(selection) {
251
+        var goodInfos = this.propForm.goods[this.table_current_index][this.currentGoodTypeId]
252
+        for (let y = 0; y < goodInfos.length; y++) {
253
+          goodInfos[y].isSelected = false
254
+        }
255
+        if (selection.length > 0) {
256
+          for (let y = 0; y < goodInfos.length; y++) {
257
+            for (let i = 0; i < selection.length; i++) {
258
+              if (goodInfos[y].id == selection[i].id) {
259
+                goodInfos[y].isSelected = true
260
+              }
261
+            }
262
+          }
263
+        }
189 264
       },clickRow:function(row) {
190 265
         this.$refs.multipleTable.toggleRowSelection(row)
191 266
 
267
+      }, tableRows({ row, rowIndex }) {
268
+        // 把每一行的索引放进row
269
+        row.index = rowIndex
270
+      },
271
+      onRowClicks(row, event, column) {
272
+        this.table_current_index = row.index
273
+      }, selectGoodInfo(selection, row) {
274
+        var goodInfos = this.propForm.goods[this.table_current_index][this.currentGoodTypeId]
275
+        for (let y = 0; y < goodInfos.length; y++) {
276
+          goodInfos[y].isSelected = false
277
+        }
278
+        if (selection.length > 0) {
279
+          for (let y = 0; y < goodInfos.length; y++) {
280
+            for (let i = 0; i < selection.length; i++) {
281
+              if (goodInfos[y].id == selection[i].id) {
282
+                goodInfos[y].isSelected = true
283
+              }
284
+            }
285
+          }
286
+        }
287
+
288
+      }, getGoodTypeName: function(val) {
289
+        let keyName = ''
290
+        for (var key in val) {
291
+          if (key != 'index') {
292
+            keyName = key
293
+          }
294
+        }
295
+        let keys = parseInt(keyName)
296
+        for (let i = 0; i < this.propForm.goodType.length; i++) {
297
+          if (this.propForm.goodType[i].id == keys) {
298
+            return this.propForm.goodType[i].type_name
299
+          }
300
+        }
192 301
       }
193 302
     }
194 303
   }

+ 117 - 23
src/xt_pages/stock/Dialog/stockInDialog.vue View File

@@ -10,18 +10,22 @@
10 10
     <el-row :gutter="20">
11 11
       <el-col :span="8">
12 12
         <el-table
13
-          :data="propForm.goodType"
14
-          ref="templatetable"
13
+          :data="propForm.goods"
14
+          ref=""
15 15
           border
16 16
           highlight-current-row
17 17
           max-height="250"
18
+          :row-class-name="tableRows"
19
+          @row-click="onRowClicks"
18 20
           @current-change="goodTypeTableChange"
19 21
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
20 22
           style="width: 100%">
21 23
           <el-table-column
22 24
             align="center"
23
-            prop="type_name"
24 25
             label="商品类型">
26
+            <template slot-scope="scope">
27
+              <span>{{getGoodTypeName(scope.row)}}</span>
28
+            </template>
25 29
           </el-table-column>
26 30
         </el-table>
27 31
       </el-col>
@@ -33,6 +37,7 @@
33 37
           max-height="250"
34 38
           @row-click="clickRow"
35 39
           @selection-change="changeGoodInfoTableData"
40
+          @select="selectGoodInfo"
36 41
           @select-all="changeAllGoodInfoTableData"
37 42
           row-key="row_key"
38 43
           style="width: 100%"
@@ -95,7 +100,9 @@
95 100
         multipleSelection: [],
96 101
         currentGoodTypeId: 0,
97 102
         isClose: false,
98
-        visibility: false
103
+        visibility: false,
104
+        SelectedDatas: [],
105
+        table_current_index: -1
99 106
       }
100 107
     },
101 108
     props: {
@@ -106,47 +113,78 @@
106 113
     methods: {
107 114
       hide: function() {
108 115
         this.visibility = false
116
+        for (let i = 0; i < this.propForm.goods.length; i++) {
117
+          for (let key in this.propForm.goods[i]) {
118
+            if (key != 'index') {
119
+              this.propForm.goods[i][key].isSelected = false
120
+            }
121
+          }
122
+        }
109 123
       },
110 124
       show: function() {
111 125
         this.visibility = true
126
+        for (let i = 0; i < this.propForm.goods.length; i++) {
127
+          for (let key in this.propForm.goods[i]) {
128
+            if (key != 'index') {
129
+              this.propForm.goods[i][key].isSelected = false
130
+            }
131
+          }
132
+        }
112 133
       },
113 134
       goodTypeTableChange: function(currentRow, oldCurrentRow) {
114
-        this.currentGoodTypeId = currentRow.id
115
-        const params = {
116
-          id: currentRow.id
135
+        let keyName = ''
136
+        for (var key in currentRow) {
137
+          if (key != 'index') {
138
+            keyName = key
139
+          }
117 140
         }
118 141
         this.goodInfoTableData = []
119 142
         this.goodInfo = []
120
-        GetGoodInfoByGoodId(params).then(response => {
121
-          if (response.data.state == 0) {
122
-            this.$message.error(response.data.msg)
123
-            return false
124
-          } else {
125
-            for (let i = 0; i < response.data.data.list.length; i++) {
126
-              this.goodInfo.push(response.data.data.list[i])
127
-              this.goodInfoTableData.push(response.data.data.list[i])
128
-            }
143
+        if (keyName.length > 0) {
144
+          this.currentGoodTypeId = parseInt(keyName)
145
+          this.goodInfo = currentRow[keyName]
146
+          this.goodInfoTableData = (currentRow[keyName])
147
+        }
148
+
149
+        for (let i = 0; i < this.goodInfoTableData.length; i++) {
150
+          if (this.goodInfoTableData[i].isSelected) {
151
+            this.$nextTick(function() {
152
+              this.$refs.multipleTable.toggleRowSelection(this.goodInfoTableData[i])
153
+            })
129 154
           }
130
-        })
155
+        }
156
+
131 157
       },
132 158
       cancle: function(formName) {
133 159
         this.goodInfo = []
134 160
         this.goodInfoTableData = []
135 161
         this.$emit('dialog-cancle', this.getValue())
136 162
         this.$refs.multipleTable.clearSelection()
137
-        this.$refs.templatetable.setCurrentRow(null)
163
+        this.$refs.table.setCurrentRow(null)
164
+
138 165
       },
139 166
       comfirm: function(formName) {
140 167
         this.goodInfo = []
141 168
         this.goodInfoTableData = []
142 169
         this.$emit('dialog-comfirm', this.getValue())
143 170
         this.$refs.multipleTable.clearSelection()
144
-        this.$refs.templatetable.setCurrentRow(null)
171
+        this.$refs.table.setCurrentRow(null)
145 172
       },
146 173
       getValue: function() {
174
+        for (let i = 0; i < this.propForm.goods.length; i++) {
175
+          for (let key in this.propForm.goods[i]) {
176
+            if (key != 'index') {
177
+              for(let a= 0; a < this.propForm.goods[i][key].length; a++){
178
+                if (this.propForm.goods[i][key][a].isSelected) {
179
+                  this.multipleSelection.push(this.propForm.goods[i][key][a])
180
+                }
181
+              }
182
+            }
183
+          }
184
+        }
185
+
147 186
         const obj = {
148 187
           selectedGoodInfo: this.multipleSelection,
149
-          goodTypeId: this.currentGoodTypeId
150 188
         }
151 189
         return obj
152 190
       }, goodTypeSelect: function(id) {
@@ -191,13 +229,69 @@
191 229
           this.goodInfoTableData.push(searchArr[i])
192 230
         }
193 231
       }, changeGoodInfoTableData: function(val) {
194
-        this.multipleSelection = val
195
-      }, changeAllGoodInfoTableData: function(val) {
196
-        this.multipleSelection = val
232
+      }, changeAllGoodInfoTableData: function(selection) {
233
+
234
+        var goodInfos = this.propForm.goods[this.table_current_index][this.currentGoodTypeId]
235
+        for (let y = 0; y < goodInfos.length; y++) {
236
+          goodInfos[y].isSelected = false
237
+        }
238
+        if (selection.length > 0) {
239
+          for (let y = 0; y < goodInfos.length; y++) {
240
+            for (let i = 0; i < selection.length; i++) {
241
+              if (goodInfos[y].id == selection[i].id) {
242
+                goodInfos[y].isSelected = true
243
+              }
244
+            }
245
+          }
246
+        }
247
+
197 248
       }, clickRow: function(row) {
198 249
         this.$refs.multipleTable.toggleRowSelection(row)
250
+      }, newGroupObject: function() {
251
+        return Object.assign(
252
+          {},
253
+          {
254
+            id: 0,
255
+            info: []
256
+          }
257
+        )
258
+      }, getGoodTypeName: function(val) {
259
+        let keyName = ''
260
+        for (var key in val) {
261
+          if (key != 'index') {
262
+            keyName = key
263
+          }
264
+        }
265
+        let keys = parseInt(keyName)
266
+        for (let i = 0; i < this.propForm.goodType.length; i++) {
267
+          if (this.propForm.goodType[i].id == keys) {
268
+            return this.propForm.goodType[i].type_name
269
+          }
270
+        }
271
+      }, tableRows({ row, rowIndex }) {
272
+        // 把每一行的索引放进row
273
+        row.index = rowIndex
274
+      },
275
+      onRowClicks(row, event, column) {
276
+        this.table_current_index = row.index
277
+      }, selectGoodInfo(selection, row) {
278
+        var goodInfos = this.propForm.goods[this.table_current_index][this.currentGoodTypeId]
279
+        for (let y = 0; y < goodInfos.length; y++) {
280
+          goodInfos[y].isSelected = false
281
+        }
282
+        if (selection.length > 0) {
283
+          for (let y = 0; y < goodInfos.length; y++) {
284
+            for (let i = 0; i < selection.length; i++) {
285
+              if (goodInfos[y].id == selection[i].id) {
286
+                goodInfos[y].isSelected = true
287
+              }
288
+            }
289
+          }
290
+        }
291
+
199 292
       }
200 293
     }
294
+
201 295
   }
202 296
 
203 297
 </script>

+ 121 - 117
src/xt_pages/stock/config/goodInfo.vue View File

@@ -3,29 +3,36 @@
3 3
   <div class=" sign-and-weigh-box" style="background: white">
4 4
 
5 5
 
6
-    <good-info-dailog ref="dialog" :titles="goodInfo.goodInfoDialog.goodInfoTitle" :formValue="goodInfo.goodInfoDialog.formValue"
6
+    <good-info-dailog ref="dialog" :titles="goodInfo.goodInfoDialog.goodInfoTitle"
7
+                      :formValue="goodInfo.goodInfoDialog.formValue"
7 8
                       :visibility="goodInfo.goodInfoDialog.isVisibility"
8 9
                       :isCreated="goodInfo.goodInfoDialog.isCreated" v-on:dialog-comfirm="goodInfoDialogComfirm"
9 10
                       v-on:dialog-cancle="goodInfoDialogCancle"></good-info-dailog>
10 11
 
11 12
 
13
+    <div class="cell clearfix">
14
+      <el-input size="small" style="width: 400px;" class="filter-item" v-model="keywords"
15
+                placeholder="商品编码/规格名称"/>
16
+      <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
17
+    </div>
18
+    <div class="cell clearfix" style="float: right">
19
+      <el-button size="small" icon="el-icon-circle-plus-outline" type="primary" @click="showInfoDialog">新增</el-button>
20
+    </div>
21
+
12 22
     <el-row :gutter="15">
13 23
       <el-col>
14 24
 
15 25
 
16
-        <div>
17
-          <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showInfoDialog">新增</el-button>
18
-        </div>
19
-
20
-        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="goodInfo.goodInfoData"  style="width: 100%" border
26
+        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="goodInfo.goodInfoData"
27
+                  style="width: 100%" border
21 28
                   v-loading="goodInfo.loading"
22 29
         >
23
-          <el-table-column label="商品编码"  align="center">
30
+          <el-table-column label="商品编码" align="center">
24 31
             <template slot-scope="scope">
25 32
               {{scope.row.good_code}}
26 33
             </template>
27 34
           </el-table-column>
28
-          <el-table-column label="规格名称"  align="center">
35
+          <el-table-column label="规格名称" align="center">
29 36
             <template slot-scope="scope">
30 37
               {{scope.row.specification_name}}
31 38
 
@@ -33,29 +40,29 @@
33 40
           </el-table-column>
34 41
 
35 42
 
36
-          <el-table-column label="进价"  align="center" >
43
+          <el-table-column label="进价" align="center">
37 44
             <template slot-scope="scope" v-if="scope.row.buy_price">
38 45
 
39 46
               {{scope.row.buy_price}}
40 47
 
41 48
             </template>
42 49
           </el-table-column>
43
-          <el-table-column label="出货价"  align="center" >
50
+          <el-table-column label="出货价" align="center">
44 51
             <template slot-scope="scope" v-if="scope.row.sell_price">
45 52
               {{scope.row.sell_price}}
46 53
             </template>
47 54
           </el-table-column>
48 55
           <!--<el-table-column label="有效期预警"  align="center">-->
49
-            <!--<template slot-scope="scope" v-if="scope.row.expiry_date_warn_day_count">-->
50
-              <!--{{scope.row.expiry_date_warn_day_count}}-->
51
-            <!--</template>-->
56
+          <!--<template slot-scope="scope" v-if="scope.row.expiry_date_warn_day_count">-->
57
+          <!--{{scope.row.expiry_date_warn_day_count}}-->
58
+          <!--</template>-->
52 59
           <!--</el-table-column>-->
53 60
           <!--<el-table-column label="库存预警" align="center">-->
54
-            <!--<template slot-scope="scope" v-if="scope.row.stock_warn_count">-->
55
-              <!--{{scope.row.stock_warn_count}}-->
56
-            <!--</template>-->
61
+          <!--<template slot-scope="scope" v-if="scope.row.stock_warn_count">-->
62
+          <!--{{scope.row.stock_warn_count}}-->
63
+          <!--</template>-->
57 64
           <!--</el-table-column>-->
58
-          <el-table-column label="操作" align="center" >
65
+          <el-table-column label="操作" align="center">
59 66
             <template slot-scope="scope">
60 67
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
61 68
                 <el-button
@@ -101,24 +108,24 @@
101 108
 
102 109
 <script>
103 110
 
104
-  import GoodInfoDailog from "../Dialog/goodInfoDailog";
111
+  import GoodInfoDailog from '../Dialog/goodInfoDailog'
105 112
   import {
106
-    GetAllGoodType,
107 113
     createGoodInfo,
108
-    modifyGoodInfo,
109 114
     deleteGoodInfo,
110
-    GetGoodInfoByGoodId,
111
-    GetGoodInfo,
112 115
     GetAllDeals,
116
+    GetAllGoodType,
113 117
     GetAllManufacturer,
114
-    getGoodInfoList
115
-  } from "@/api/stock";
118
+    GetGoodInfo,
119
+    GetGoodInfoByGoodId,
120
+    getGoodInfoList,
121
+    modifyGoodInfo
122
+  } from '@/api/stock'
116 123
 
117 124
   export default {
118 125
     components: {
119
-      GoodInfoDailog,
126
+      GoodInfoDailog
120 127
     },
121
-    name: "goodInfo",
128
+    name: 'goodInfo',
122 129
     data() {
123 130
       return {
124 131
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
@@ -127,7 +134,7 @@
127 134
         pageSelect: 0,
128 135
         page: 1,
129 136
         limit: 7,
130
-
137
+        keywords: '',
131 138
         goodInfo: {
132 139
           loading: false,
133 140
           goodInfoData: [],
@@ -152,22 +159,26 @@
152 159
               dealers: [],
153 160
               manufacturers: [],
154 161
               goodType: [],
155
-              goodUnit: [],
162
+              goodUnit: []
156 163
             },
157 164
 
158
-            isVisibility: false,
159
-          },
165
+            isVisibility: false
166
+          }
160 167
 
161
-        },
168
+        }
162 169
 
163
-      };
170
+      }
164 171
     },
165 172
     methods: {
166
-     handleGoodInfoEdit: function (index, row) {
173
+      search: function() {
174
+        this.getList()
175
+
176
+      },
177
+      handleGoodInfoEdit: function(index, row) {
167 178
 
168
-       this.getAllDealer()
169
-       this.getAllManufacturer()
170
-       this.getAllGoodType()
179
+        this.getAllDealer()
180
+        this.getAllManufacturer()
181
+        this.getAllGoodType()
171 182
         this.goodInfo.editGoodId = row.id
172 183
         this.goodInfo.editGoodIndex = index
173 184
 
@@ -176,35 +187,32 @@
176 187
         }
177 188
         GetGoodInfo(params).then(response => {
178 189
           if (response.data.state == 0) {
179
-            this.$message.error(response.data.msg);
180
-            return false;
190
+            this.$message.error(response.data.msg)
191
+            return false
181 192
           } else {
182 193
             console.log(response.data.data.goodInfo)
183 194
 
184
-            if(response.data.data.goodInfo.good_unit <= 0){
185
-              this.goodInfo.goodInfoDialog.formValue.good_unit = ""
186
-            }else{
195
+            if (response.data.data.goodInfo.good_unit <= 0) {
196
+              this.goodInfo.goodInfoDialog.formValue.good_unit = ''
197
+            } else {
187 198
               this.goodInfo.goodInfoDialog.formValue.good_unit = response.data.data.goodInfo.good_unit
188 199
             }
189 200
 
201
+            if (response.data.data.goodInfo.manufacturer <= 0) {
202
+              this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
190 203
 
191
-            if(response.data.data.goodInfo.manufacturer <= 0){
192
-              this.goodInfo.goodInfoDialog.formValue.manufacturer = ""
193
-
194
-            }else{
204
+            } else {
195 205
               this.goodInfo.goodInfoDialog.formValue.manufacturer = response.data.data.goodInfo.manufacturer
196 206
 
197 207
             }
198 208
 
199
-            if(response.data.data.goodInfo.dealer <= 0){
200
-              this.goodInfo.goodInfoDialog.formValue.dealer = ""
201
-            }else{
209
+            if (response.data.data.goodInfo.dealer <= 0) {
210
+              this.goodInfo.goodInfoDialog.formValue.dealer = ''
211
+            } else {
202 212
               this.goodInfo.goodInfoDialog.formValue.dealer = response.data.data.goodInfo.dealer
203 213
 
204 214
             }
205 215
 
206
-
207
-
208 216
             this.goodInfo.goodInfoDialog.formValue.specification_name = response.data.data.goodInfo.specification_name
209 217
             this.goodInfo.goodInfoDialog.formValue.buy_price = response.data.data.goodInfo.buy_price
210 218
             this.goodInfo.goodInfoDialog.formValue.sell_price = response.data.data.goodInfo.sell_price
@@ -214,16 +222,14 @@
214 222
             this.goodInfo.goodInfoDialog.formValue.remark = response.data.data.goodInfo.remark
215 223
             this.goodInfo.goodInfoDialog.isCreated = 2
216 224
             this.goodInfo.good_code = response.data.data.goodInfo.good_code
217
-            this.goodInfo.goodInfoDialog.formValue.good_id =response.data.data.goodInfo.good_type_id
225
+            this.goodInfo.goodInfoDialog.formValue.good_id = response.data.data.goodInfo.good_type_id
218 226
             this.$refs.dialog.show()
219 227
 
220 228
           }
221
-        });
222
-
223
-
229
+        })
224 230
 
225 231
       },
226
-      handleGoodInfoDelete: function (index, row) {
232
+      handleGoodInfoDelete: function(index, row) {
227 233
 
228 234
         this.$confirm('确认删除这条商品信息?', '删除商品信息', {
229 235
           confirmButtonText: '确定',
@@ -236,25 +242,25 @@
236 242
 
237 243
           deleteGoodInfo(params).then(response => {
238 244
             if (response.data.state == 0) {
239
-              this.$message.error(response.data.msg);
240
-              return false;
245
+              this.$message.error(response.data.msg)
246
+              return false
241 247
             } else {
242
-              this.goodInfo.goodInfoData.splice(index, 1);
243
-              this.$message.success("删除成功")
248
+              this.goodInfo.goodInfoData.splice(index, 1)
249
+              this.$message.success('删除成功')
244 250
             }
245
-          });
251
+          })
246 252
         }).catch(() => {
247
-        });
253
+        })
248 254
 
249 255
       },
250
-      showGoodInfoDetails: function (index, row) {
256
+      showGoodInfoDetails: function(index, row) {
251 257
         let params = {
252 258
           id: row.id
253 259
         }
254 260
         GetGoodInfo(params).then(response => {
255 261
           if (response.data.state == 0) {
256
-            this.$message.error(response.data.msg);
257
-            return false;
262
+            this.$message.error(response.data.msg)
263
+            return false
258 264
           } else {
259 265
             this.goodInfo.goodInfoDialog.formValue.specification_name = response.data.data.goodInfo.specification_name
260 266
             this.goodInfo.goodInfoDialog.formValue.good_unit = response.data.data.goodInfo.good_unit
@@ -270,18 +276,20 @@
270 276
             this.goodInfo.goodInfoDialog.isCreated = 3
271 277
             this.goodInfo.goodInfoDialog.isVisibility = true
272 278
           }
273
-        });
279
+        })
274 280
       }, getList() {
275 281
         this.goodInfo.loading = true
276 282
         let params = {
277
-          'page': this.page,
278
-          'limit': this.limit
283
+          page: this.page,
284
+          limit: this.limit,
285
+          keyword: this.keywords
286
+
279 287
         }
280 288
         getGoodInfoList(params).then(response => {
281 289
           if (response.data.state == 0) {
282 290
             this.goodInfo.loading = false
283
-            this.$message.error(response.data.msg);
284
-            return false;
291
+            this.$message.error(response.data.msg)
292
+            return false
285 293
           } else {
286 294
             this.goodInfo.loading = false
287 295
             this.total = response.data.data.total
@@ -291,16 +299,16 @@
291 299
 
292 300
             }
293 301
           }
294
-        });
302
+        })
295 303
 
296
-      }, tableRowClassName({row, rowIndex}) {
304
+      }, tableRowClassName({ row, rowIndex }) {
297 305
         //把每一行的索引放进row
298
-        row.index = rowIndex;
306
+        row.index = rowIndex
299 307
       },
300 308
       onRowClick(row, event, column) {
301 309
 
302 310
         this.goodInfo.goodInfoData = []
303
-        this.goodType.tableCurrentIndex = row.index;
311
+        this.goodType.tableCurrentIndex = row.index
304 312
         this.goodInfo.goodInfoDialog.formValue.good_id = row.id
305 313
         let params = {
306 314
           'id': row.id
@@ -309,17 +317,17 @@
309 317
         GetGoodInfoByGoodId(params).then(response => {
310 318
           if (response.data.state == 0) {
311 319
             this.goodInfo.loading = false
312
-            this.$message.error(response.data.msg);
313
-            return false;
320
+            this.$message.error(response.data.msg)
321
+            return false
314 322
           } else {
315 323
             this.goodInfo.loading = false
316 324
             for (let i = 0; i < response.data.data.list.length; i++) {
317 325
               this.goodInfo.goodInfoData.push(response.data.data.list[i])
318 326
             }
319 327
           }
320
-        });
328
+        })
321 329
 
322
-      }, goodInfoDialogComfirm: function (val) {
330
+      }, goodInfoDialogComfirm: function(val) {
323 331
 
324 332
         if (val.isCreated == 2) { //修改
325 333
           val['id'] = this.goodInfo.editGoodId
@@ -327,8 +335,8 @@
327 335
 
328 336
           modifyGoodInfo(val).then(response => {
329 337
             if (response.data.state == 0) {
330
-              this.$message.error(response.data.msg);
331
-              return false;
338
+              this.$message.error(response.data.msg)
339
+              return false
332 340
             } else {
333 341
               this.$refs.dialog.hide()
334 342
 
@@ -339,57 +347,54 @@
339 347
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
340 348
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()
341 349
 
342
-              this.$message.success("修改成功")
343
-
350
+              this.$message.success('修改成功')
344 351
 
345 352
             }
346
-          });
353
+          })
347 354
 
348 355
         } else if (val.isCreated == 1) { //新增
349 356
           createGoodInfo(val).then(response => {
350 357
             if (response.data.state == 0) {
351
-              this.$message.error(response.data.msg);
352
-              return false;
358
+              this.$message.error(response.data.msg)
359
+              return false
353 360
             } else {
354 361
               this.$refs.dialog.hide()
355 362
 
356 363
               this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
357 364
 
358
-              this.$message.success("新增成功")
359
-
365
+              this.$message.success('新增成功')
360 366
 
361 367
             }
362
-          });
368
+          })
363 369
 
364 370
         }
365 371
 
366 372
       },
367
-      goodInfoDialogCancle: function () {
373
+      goodInfoDialogCancle: function() {
368 374
         this.$refs.dialog.hide()
369 375
 
370
-
371
-      }, showInfoDialog: function () {
376
+      }, showInfoDialog: function() {
372 377
         this.$refs.dialog.show()
373 378
         this.getAllDealer()
374 379
         this.getAllManufacturer()
375 380
         this.goodInfo.goodInfoDialog.formValue.goodType = []
376 381
         GetAllGoodType().then(response => {
377 382
           if (response.data.state == 0) {
378
-            this.$message.error(response.data.msg);
379
-            return false;
383
+            this.$message.error(response.data.msg)
384
+            return false
380 385
           } else {
381 386
             for (let i = 0; i < response.data.data.goodType.length; i++) {
382 387
               this.goodInfo.goodInfoDialog.formValue.goodType.push(response.data.data.goodType[i])
383 388
             }
384 389
             if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
385
-              this.$message.error("请先新增商品类型");
390
+              this.$message.error('请先新增商品类型')
386 391
               return
387 392
             } else {
388 393
               this.goodInfo.goodInfoDialog.isVisibility = true
389 394
               this.goodInfo.goodInfoDialog.isCreated = 1
390 395
             }
391 396
           }
392
-        });
397
+        })
393 398
         this.goodInfo.goodInfoDialog.formValue.good_id = ''
394 399
         this.goodInfo.goodInfoDialog.formValue.specification_name = ''
395 400
         this.goodInfo.goodInfoDialog.formValue.buy_price = ''
@@ -402,49 +407,48 @@
402 407
         this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
403 408
         this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
404 409
 
405
-
406
-      }, getAllDealer: function () {
410
+      }, getAllDealer: function() {
407 411
         this.goodInfo.goodInfoDialog.formValue.dealers = []
408 412
         GetAllDeals().then(response => {
409 413
           if (response.data.state == 0) {
410
-            this.$message.error(response.data.msg);
411
-            return false;
414
+            this.$message.error(response.data.msg)
415
+            return false
412 416
           } else {
413 417
             for (let i = 0; i < response.data.data.dealer.length; i++) {
414 418
               this.goodInfo.goodInfoDialog.formValue.dealers.push(response.data.data.dealer[i])
415 419
             }
416 420
           }
417
-        });
418
-      }, getAllManufacturer: function () {
421
+        })
422
+      }, getAllManufacturer: function() {
419 423
         this.goodInfo.goodInfoDialog.formValue.manufacturers = []
420 424
         GetAllManufacturer().then(response => {
421 425
           if (response.data.state == 0) {
422
-            this.$message.error(response.data.msg);
423
-            return false;
426
+            this.$message.error(response.data.msg)
427
+            return false
424 428
           } else {
425 429
             for (let i = 0; i < response.data.data.manufacturer.length; i++) {
426 430
               this.goodInfo.goodInfoDialog.formValue.manufacturers.push(response.data.data.manufacturer[i])
427 431
             }
428 432
           }
429
-        });
430
-      }, getAllGoodType: function () {
433
+        })
434
+      }, getAllGoodType: function() {
431 435
         this.goodInfo.goodInfoDialog.formValue.goodType = []
432 436
         GetAllGoodType().then(response => {
433 437
           if (response.data.state == 0) {
434
-            this.$message.error(response.data.msg);
435
-            return false;
438
+            this.$message.error(response.data.msg)
439
+            return false
436 440
           } else {
437 441
             for (let i = 0; i < response.data.data.goodType.length; i++) {
438 442
               this.goodInfo.goodInfoDialog.formValue.goodType.push(response.data.data.goodType[i])
439 443
             }
440 444
           }
441
-        });
445
+        })
442 446
       }, handleSizeChange(val) {
443
-        this.limit = val;
444
-        this.getList();
447
+        this.limit = val
448
+        this.getList()
445 449
       }, handleCurrentChange(val) {
446
-        this.page = val;
447
-        this.getList();
450
+        this.page = val
451
+        this.getList()
448 452
       }
449 453
     },
450 454
     created() {
@@ -455,7 +459,7 @@
455 459
       this.goodInfo.goodInfoDialog.formValue.goodUnit = this.$store.getters.good_unit
456 460
 
457 461
     }
458
-  };
462
+  }
459 463
 </script>
460 464
 
461 465
 <style rel="stylesheet/css" lang="scss" scoped>
@@ -463,10 +467,11 @@
463 467
     border: 1px #dcdfe6 solid;
464 468
     padding: 30px 20px 30px 20px;
465 469
 
466
-    .border {
467
-      border-bottom: 1px #dcdfe6 solid;
468
-      margin: 0px 0 20px 0;
469
-    }
470
+  .border {
471
+    border-bottom: 1px #dcdfe6 solid;
472
+    margin: 0px 0 20px 0;
473
+  }
474
+
470 475
   }
471 476
 
472 477
   .title {
@@ -474,7 +479,6 @@
474 479
     line-height: 44px;
475 480
     padding: 0 0 0 10px;
476 481
     margin: 0 0 10px 0;
477
-    // border-radius: 4px 4px 0 0;
478 482
   }
479 483
 
480 484
   .edit_separater {

+ 236 - 225
src/xt_pages/stock/config/goodType.vue View File

@@ -1,24 +1,30 @@
1 1
 <template>
2 2
 
3 3
   <div class=" sign-and-weigh-box" style="background: white">
4
-    <good-type-dialog ref="dialog" :titles="goodType.goodTypeDialog.goodTypeTitle" :formValue="goodType.goodTypeDialog.formValue"
4
+    <good-type-dialog ref="dialog" :titles="goodType.goodTypeDialog.goodTypeTitle"
5
+                      :formValue="goodType.goodTypeDialog.formValue"
5 6
                       :visibility="goodType.goodTypeDialog.isVisibility"
6 7
                       :isCreated="goodType.goodTypeDialog.isCreated" v-on:dialog-comfirm="goodTypeDialogComfirm"
7 8
                       v-on:dialog-cancle="goodTypeDialogCancle"></good-type-dialog>
8
-
9
-
9
+    <div class="cell clearfix">
10
+      <el-input size="small" style="width: 400px;" class="filter-item" v-model="keywords"
11
+                placeholder="类型编码/类型名称"/>
12
+      <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
13
+
14
+    </div>
15
+    <div class="cell clearfix" style="float: right">
16
+      <el-button size="small" icon="el-icon-circle-plus-outline" type="primary" @click="showDialog">新增</el-button>
17
+    </div>
10 18
     <el-row :gutter="15">
11 19
       <el-col>
12 20
 
13
-        <div>
14
-          <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showDialog">新增</el-button>
15
-        </div>
16 21
 
17 22
         <!--<div class="dataTitle"></div>-->
18 23
 
19 24
         <div style="margin-bottom: 10px;">
20 25
         </div>
21
-        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="goodType.goodTypeData"  style="width: 100%" border
26
+        <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="goodType.goodTypeData"
27
+                  style="width: 100%" border
22 28
                   highlight-current-row
23 29
                   @row-click="onRowClick"
24 30
                   :row-class-name="tableRowClassName"
@@ -34,7 +40,7 @@
34 40
               {{scope.row.type_name}}
35 41
             </template>
36 42
           </el-table-column>
37
-          <el-table-column label="操作" align="center" >
43
+          <el-table-column label="操作" align="center">
38 44
             <template slot-scope="scope">
39 45
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
40 46
                 <el-button
@@ -140,256 +146,261 @@
140 146
 </template>
141 147
 
142 148
 <script>
143
-import goodTypeDialog from "../Dialog/goodTypeDialog";
144
-import {
145
-  createGoodType,
146
-  modifyGoodType,
147
-  getGoodTypeList,
148
-  deleteGoodType,
149
-  GetGoodType,
150
-  createGoodInfo,
151
-  modifyGoodInfo,
152
-  getGoodInfoList,
153
-  deleteGoodInfo,
154
-  GetGoodInfoByGoodId,
155
-  GetGoodInfo,
156
-  GetAllDeals,
157
-  GetAllManufacturer,
158
-  GetAllGoodType
159
-} from "@/api/stock";
160
-import GoodInfoDailog from "../Dialog/goodInfoDailog";
161
-
162
-export default {
163
-  components: {
164
-    goodTypeDialog
165
-  },
166
-  name: "goodType",
167
-  data() {
168
-    return {
169
-      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
170
-      total: 0,
171
-      pageTotal: 0,
172
-      pageSelect: 0,
173
-      page: 1,
174
-      limit: 7,
175
-
176
-      goodType: {
177
-        loading: false,
178
-        goodTypeData: [],
179
-        type_code: "",
180
-        editInfoId: "",
181
-        editInfoIndex: "",
182
-        tableCurrentIndex: -1,
183
-        goodTypeDialog: {
184
-          goodTypeTitle: "新增商品类型",
185
-          isCreated: 1, //1.创建 2.编辑 3.查看详情
186
-          formValue: {
187
-            type_name: "",
188
-            remark: ""
189
-          },
190
-          isVisibility: false
149
+  import goodTypeDialog from '../Dialog/goodTypeDialog'
150
+  import {
151
+    createGoodInfo,
152
+    createGoodType,
153
+    deleteGoodInfo,
154
+    deleteGoodType,
155
+    GetAllDeals,
156
+    GetAllGoodType,
157
+    GetAllManufacturer,
158
+    GetGoodInfo,
159
+    GetGoodInfoByGoodId,
160
+    getGoodInfoList,
161
+    GetGoodType,
162
+    getGoodTypeList,
163
+    modifyGoodInfo,
164
+    modifyGoodType
165
+  } from '@/api/stock'
166
+
167
+  export default {
168
+    components: {
169
+      goodTypeDialog
170
+    },
171
+    name: 'goodType',
172
+    data() {
173
+      return {
174
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
175
+        total: 0,
176
+        pageTotal: 0,
177
+        pageSelect: 0,
178
+        page: 1,
179
+        limit: 7,
180
+        keywords: '',
181
+        goodType: {
182
+          loading: false,
183
+          goodTypeData: [],
184
+          type_code: '',
185
+          editInfoId: '',
186
+          editInfoIndex: '',
187
+          tableCurrentIndex: -1,
188
+          goodTypeDialog: {
189
+            goodTypeTitle: '新增商品类型',
190
+            isCreated: 1, //1.创建 2.编辑 3.查看详情
191
+            formValue: {
192
+              type_name: '',
193
+              remark: ''
194
+            },
195
+            isVisibility: false
196
+          }
191 197
         }
192 198
       }
193
-    };
194
-  },
195
-  methods: {
196
-    handleEdit: function(index, row) {
197
-      this.goodType.editTypeId = row.id;
198
-      this.goodType.editTypeIndex = index;
199
-      let params = {
200
-        id: row.id
201
-      };
202
-      GetGoodType(params).then(response => {
203
-        if (response.data.state == 0) {
204
-          this.$message.error(response.data.msg);
205
-          return false;
206
-        } else {
207
-          this.goodType.goodTypeDialog.formValue.remark =
208
-            response.data.data.goodType.remark;
209
-          this.goodType.goodTypeDialog.formValue.type_name =
210
-            response.data.data.goodType.type_name;
211
-          this.goodType.goodTypeDialog.isCreated = 2;
212
-          this.$refs.dialog.show();
213
-          this.goodType.type_code = response.data.data.goodType.type_code;
214
-        }
215
-      });
216 199
     },
217
-    handleDelete: function(index, row) {
218
-      this.$confirm("确认删除这条商品类型?", "删除商品类型", {
219
-        confirmButtonText: "确定",
220
-        cancelButtonText: "取消",
221
-        type: "warning"
222
-      })
223
-        .then(() => {
200
+    methods: {
201
+      search: function() {
202
+        this.getList()
203
+      },
204
+      handleEdit: function(index, row) {
205
+        this.goodType.editTypeId = row.id
206
+        this.goodType.editTypeIndex = index
207
+        let params = {
208
+          id: row.id
209
+        }
210
+        GetGoodType(params).then(response => {
211
+          if (response.data.state == 0) {
212
+            this.$message.error(response.data.msg)
213
+            return false
214
+          } else {
215
+            this.goodType.goodTypeDialog.formValue.remark =
216
+              response.data.data.goodType.remark
217
+            this.goodType.goodTypeDialog.formValue.type_name =
218
+              response.data.data.goodType.type_name
219
+            this.goodType.goodTypeDialog.isCreated = 2
220
+            this.$refs.dialog.show()
221
+            this.goodType.type_code = response.data.data.goodType.type_code
222
+          }
223
+        })
224
+      },
225
+      handleDelete: function(index, row) {
226
+        this.$confirm('确认删除这条商品类型?', '删除商品类型', {
227
+          confirmButtonText: '确定',
228
+          cancelButtonText: '取消',
229
+          type: 'warning'
230
+        })
231
+          .then(() => {
232
+            let params = {
233
+              id: row.id
234
+            }
235
+
236
+            deleteGoodType(params).then(response => {
237
+              if (response.data.state == 0) {
238
+                this.$message.error(response.data.msg)
239
+                return false
240
+              } else {
241
+                this.goodType.goodTypeData.splice(index, 1)
242
+                this.goodType.tableCurrentIndex = -1
243
+
244
+                this.$message.success('删除成功')
245
+              }
246
+            })
247
+          })
248
+          .catch(() => {
249
+          })
250
+      },
251
+      showDetails: function(index, row) {
252
+        let params = {
253
+          id: row.id
254
+        }
255
+        GetGoodType(params).then(response => {
256
+          if (response.data.state == 0) {
257
+            this.$message.error(response.data.msg)
258
+            return false
259
+          } else {
260
+            this.goodType.goodTypeDialog.formValue.type_name =
261
+              response.data.data.goodType.type_name
262
+            this.goodType.goodTypeDialog.formValue.remark =
263
+              response.data.data.goodType.remark
264
+            this.goodType.goodTypeDialog.isCreated = 3
265
+            this.goodType.goodTypeDialog.isVisibility = true
266
+          }
267
+        })
268
+      },
269
+
270
+      goodTypeDialogComfirm: function(val) {
271
+
272
+        if (val.isCreated == 2) {
273
+          //修改
224 274
           let params = {
225
-            id: row.id
226
-          };
275
+            type_name: val.type_name,
276
+            remark: val.remark,
277
+            type_code: this.goodType.type_code,
278
+            id: this.goodType.editTypeId
279
+          }
227 280
 
228
-          deleteGoodType(params).then(response => {
281
+          modifyGoodType(params).then(response => {
229 282
             if (response.data.state == 0) {
230
-              this.$message.error(response.data.msg);
231
-              return false;
283
+              this.$message.error(response.data.msg)
284
+              return false
232 285
             } else {
233
-              this.goodType.goodTypeData.splice(index, 1);
234
-              this.goodType.tableCurrentIndex = -1;
286
+              this.$refs.dialog.hide()
235 287
 
236
-              this.$message.success("删除成功");
288
+              this.goodType.goodTypeData[this.goodType.editTypeIndex].type_name =
289
+                response.data.data.goodTypes.type_name
290
+              this.goodType.goodTypeData[this.goodType.editTypeIndex].remark =
291
+                response.data.data.goodTypes.remark
292
+
293
+              this.$message.success('修改成功')
237 294
             }
238
-          });
239
-        })
240
-        .catch(() => {});
241
-    },
242
-    showDetails: function(index, row) {
243
-      let params = {
244
-        id: row.id
245
-      };
246
-      GetGoodType(params).then(response => {
247
-        if (response.data.state == 0) {
248
-          this.$message.error(response.data.msg);
249
-          return false;
250
-        } else {
251
-          this.goodType.goodTypeDialog.formValue.type_name =
252
-            response.data.data.goodType.type_name;
253
-          this.goodType.goodTypeDialog.formValue.remark =
254
-            response.data.data.goodType.remark;
255
-          this.goodType.goodTypeDialog.isCreated = 3;
256
-          this.goodType.goodTypeDialog.isVisibility = true;
295
+          })
296
+        } else if (val.isCreated == 1) {
297
+          //新增
298
+          createGoodType(val).then(response => {
299
+            if (response.data.state == 0) {
300
+              this.$message.error(response.data.msg)
301
+              return false
302
+            } else {
303
+              this.$refs.dialog.hide()
304
+              this.goodType.goodTypeData.unshift(response.data.data.goodTypes)
305
+              this.$message.success('新增成功')
306
+            }
307
+          })
257 308
         }
258
-      });
259
-    },
260
-
261
-    goodTypeDialogComfirm: function(val) {
309
+      },
310
+      goodTypeDialogCancle: function() {
311
+        this.$refs.dialog.hide()
312
+      },
313
+      showDialog: function() {
314
+        this.goodType.goodTypeDialog.isCreated = 1
315
+        this.$refs.dialog.show()
316
+      },
317
+      getList() {
318
+        this.goodType.loading = true
262 319
 
263
-      if (val.isCreated == 2) {
264
-        //修改
265 320
         let params = {
266
-          type_name: val.type_name,
267
-          remark: val.remark,
268
-          type_code: this.goodType.type_code,
269
-          id: this.goodType.editTypeId
270
-        };
271
-
272
-        modifyGoodType(params).then(response => {
273
-          if (response.data.state == 0) {
274
-            this.$message.error(response.data.msg);
275
-            return false;
276
-          } else {
277
-            this.$refs.dialog.hide();
278
-
279
-            this.goodType.goodTypeData[this.goodType.editTypeIndex].type_name =
280
-              response.data.data.goodTypes.type_name;
281
-            this.goodType.goodTypeData[this.goodType.editTypeIndex].remark =
282
-              response.data.data.goodTypes.remark;
321
+          page: this.page,
322
+          limit: this.limit,
323
+          keyword: this.keywords
283 324
 
284
-            this.$message.success("修改成功");
285
-          }
286
-        });
287
-      } else if (val.isCreated == 1) {
288
-        //新增
289
-        createGoodType(val).then(response => {
325
+        }
326
+        getGoodTypeList(params).then(response => {
290 327
           if (response.data.state == 0) {
291
-            this.$message.error(response.data.msg);
292
-            return false;
328
+            this.goodType.loading = false
329
+            this.$message.error(response.data.msg)
330
+            return false
293 331
           } else {
294
-            this.$refs.dialog.hide();
295
-            this.goodType.goodTypeData.unshift(response.data.data.goodTypes);
296
-            this.$message.success("新增成功");
332
+            this.goodType.loading = false
333
+            this.total = response.data.data.total
334
+            this.goodType.goodTypeData = []
335
+            for (let i = 0; i < response.data.data.list.length; i++) {
336
+              this.goodType.goodTypeData.push(response.data.data.list[i])
337
+            }
297 338
           }
298
-        });
299
-      }
300
-    },
301
-    goodTypeDialogCancle: function() {
302
-      this.$refs.dialog.hide();
303
-    },
304
-    showDialog: function() {
305
-      this.goodType.goodTypeDialog.isCreated = 1;
306
-      this.$refs.dialog.show();
307
-    },
308
-    getList() {
309
-      this.goodType.loading = true;
310
-
311
-      let params = {
312
-        page: this.page,
313
-        limit: this.limit
314
-      };
315
-      getGoodTypeList(params).then(response => {
316
-        if (response.data.state == 0) {
317
-          this.goodType.loading = false;
318
-          this.$message.error(response.data.msg);
319
-          return false;
339
+        })
340
+      },
341
+      tableRowClassName({ row, rowIndex }) {
342
+        //把每一行的索引放进row
343
+        row.index = rowIndex
344
+      },
345
+      onRowClick(row, event, column) {
346
+        this.goodType.tableCurrentIndex = row.index
347
+      },
348
+      showInfoDialog: function() {
349
+        if (this.goodType.tableCurrentIndex == -1) {
350
+          this.$message.error('请先选择商品类型')
351
+          return
320 352
         } else {
321
-          this.goodType.loading = false;
322
-          this.total = response.data.data.total;
323
-          this.goodType.goodTypeData = [];
324
-          for (let i = 0; i < response.data.data.list.length; i++) {
325
-            this.goodType.goodTypeData.push(response.data.data.list[i]);
326
-          }
353
+          this.getAllGoodType()
327 354
         }
328
-      });
329
-    },
330
-    tableRowClassName({ row, rowIndex }) {
331
-      //把每一行的索引放进row
332
-      row.index = rowIndex;
333
-    },
334
-    onRowClick(row, event, column) {
335
-      this.goodType.tableCurrentIndex = row.index;
336
-    },
337
-    showInfoDialog: function() {
338
-      if (this.goodType.tableCurrentIndex == -1) {
339
-        this.$message.error("请先选择商品类型");
340
-        return;
341
-      } else {
342
-        this.getAllGoodType();
355
+      },
356
+      handleSizeChange(val) {
357
+        this.limit = val
358
+        this.getList()
359
+      },
360
+      handleCurrentChange(val) {
361
+        this.page = val
362
+        this.getList()
343 363
       }
344 364
     },
345
-    handleSizeChange(val) {
346
-      this.limit = val;
347
-      this.getList();
348
-    },
349
-    handleCurrentChange(val) {
350
-      this.page = val;
351
-      this.getList();
365
+    created() {
366
+      this.getList()
352 367
     }
353
-  },
354
-  created() {
355
-    this.getList();
356 368
   }
357
-};
358 369
 </script>
359 370
 
360 371
 <style rel="stylesheet/css" lang="scss" scoped>
361
-.information {
362
-  border: 1px #dcdfe6 solid;
363
-  padding: 30px 20px 30px 20px;
372
+  .information {
373
+    border: 1px #dcdfe6 solid;
374
+    padding: 30px 20px 30px 20px;
364 375
 
365 376
   .border {
366 377
     border-bottom: 1px #dcdfe6 solid;
367 378
     margin: 0px 0 20px 0;
368 379
   }
369
-}
370
-
371
-.title {
372
-  height: 44px;
373
-  line-height: 44px;
374
-  padding: 0 0 0 10px;
375
-  margin: 0 0 10px 0;
376
-  // border-radius: 4px 4px 0 0;
377
-}
378
-
379
-.edit_separater {
380
-  border-top: 1px solid rgb(233, 233, 233);
381
-  margin-top: 15px;
382
-  margin-bottom: 15px;
383
-}
380
+
381
+  }
382
+
383
+  .title {
384
+    height: 44px;
385
+    line-height: 44px;
386
+    padding: 0 0 0 10px;
387
+    margin: 0 0 10px 0;
388
+  }
389
+
390
+  .edit_separater {
391
+    border-top: 1px solid rgb(233, 233, 233);
392
+    margin-top: 15px;
393
+    margin-bottom: 15px;
394
+  }
384 395
 </style>
385 396
 
386 397
 <style>
387
-.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
388
-  font-size: 12px;
389
-}
398
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
399
+    font-size: 12px;
400
+  }
390 401
 
391
-.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
392
-  background: #6fb5fa;
393
-}
402
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
403
+    background: #6fb5fa;
404
+  }
394 405
 
395 406
 </style>

+ 13 - 0
src/xt_pages/stock/detail/cancelStockDetail.vue View File

@@ -1,5 +1,7 @@
1 1
 <template>
2 2
     <div>
3
+      <el-button style="float: right" size="small" icon="el-icon-printer" @click="PrintAction" type="primary">打印
4
+      </el-button>
3 5
       <div class="cell clearfix" >
4 6
         <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
5 7
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
@@ -178,6 +180,17 @@
178 180
       }
179 181
     },
180 182
     methods: {
183
+      PrintAction: function() {
184
+        this.$router.push({
185
+          path: '/stock/print',
186
+          query: {
187
+            type: 4,
188
+            start_time: this.start_time,
189
+            end_time: this.end_time
190
+
191
+          }
192
+        })
193
+      },
181 194
       changeType: function(val) {
182 195
         this.order_type = val
183 196
         this.GetCancelStock()

+ 415 - 0
src/xt_pages/stock/detail/print.vue View File

@@ -0,0 +1,415 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      <el-button :loading="loading" size="small" icon="el-icon-printer" @click="printThisPage" type="primary">打印
6
+      </el-button>
7
+    </div>
8
+    <div class="app-container ">
9
+      <div id="dialysis-print-box">
10
+        <div class="dialysis-print-order">
11
+          <div class="order-yy-name">{{orgname}}</div>
12
+          <div class="order-title" v-if="type == 1">入库单</div>
13
+          <div class="order-title" v-if="type == 2">退货单</div>
14
+          <div class="order-title" v-if="type == 3">出库单</div>
15
+          <div class="order-title" v-if="type == 4">退库单</div>
16
+
17
+          <div style="float: left;margin-bottom: 10px;">{{getDateOne()}}</div>
18
+          <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
19
+
20
+
21
+
22
+          <table class="print-table" border="1">
23
+            <tbody>
24
+            <tr>
25
+              <td style="line-height: 50px" width="50">序号</td>
26
+              <td style="line-height: 50px" width="250">商品类型</td>
27
+              <td style="line-height: 50px" width="250">规格名称</td>
28
+              <td style="line-height: 50px" width="80">数量</td>
29
+              <td style="line-height: 50px" width="80" v-if="type == 1 || type == 3">总价</td>
30
+              <td style="line-height: 50px" width="">备 注</td>
31
+            </tr>
32
+
33
+
34
+            <tr v-for="(stock,index) in stockDatas" :key="stock.id">
35
+              <td style="line-height: 50px">&nbsp;
36
+                {{index+1}}
37
+              </td>
38
+              <td style="line-height: 50px">
39
+                <span v-if="stock.type && stock.type.type_name.length > 0">{{stock.type.type_name}}</span>
40
+              </td>
41
+              <td style="line-height: 50px">
42
+                <span v-if="stock">{{stock.specification_name}}</span>
43
+              </td>
44
+              <td style="line-height: 50px">{{calCount(stock)}}</td>
45
+              <td style="line-height: 50px" v-if="type == 1 || type == 3">{{calTotal(stock)}}</td>
46
+              <td style="line-height: 50px"></td>
47
+            </tr>
48
+            </tbody>
49
+          </table>
50
+          <table class="print-table" border="1" v-if="type == 1 || type == 3">
51
+            <tbody>
52
+            <tr>
53
+              <td width="633" style="line-height: 50px">合计</td>
54
+              <td width="80" style="line-height: 50px">{{calTotalPrice()}}</td>
55
+              <td></td>
56
+            </tr>
57
+
58
+            </tbody>
59
+          </table>
60
+        </div>
61
+
62
+      </div>
63
+
64
+    </div>
65
+  </div>
66
+
67
+</template>
68
+
69
+<script>
70
+  import { getPrintStockGood } from '@/api/stock'
71
+  import { getDataConfig } from '@/utils/data'
72
+  import { jsGetAge, uParseTime } from '@/utils/tools'
73
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
74
+  import print from 'print-js'
75
+
76
+  export default {
77
+    name: 'dialysisPrintOrder',
78
+    components: {
79
+      BreadCrumb
80
+
81
+    },
82
+    data() {
83
+      return {
84
+        crumbs: [
85
+          { path: false, name: '出入库明细' },
86
+          { path: false, name: '打印单' }
87
+        ],
88
+        loading: false,
89
+        orgname: '',
90
+        queryParams: {
91
+          start_time: this.$route.query.start_time,
92
+          end_time: this.$route.query.end_time,
93
+          type: this.$route.query.type
94
+        },
95
+        totalPrice: 0,
96
+        stockDatas: [],
97
+        goodUnit: [],
98
+        type: this.$route.query.type,
99
+        start_time: this.$route.query.start_time,
100
+        end_time: this.$route.query.end_time,
101
+
102
+      }
103
+    },
104
+    methods: {
105
+      getDateOne(){
106
+        if (this.type == 1){
107
+          return "入库日期: "+this.start_time +"~"+this.end_time
108
+        }else if(this.type == 2){
109
+          return "退货日期: "+this.start_time +"~"+this.end_time
110
+        }else if(this.type == 3){
111
+          return "出库日期: "+this.start_time +"~"+this.end_time
112
+        }else if(this.type == 4){
113
+          return "退库日期: "+this.start_time +"~"+this.end_time
114
+        }
115
+
116
+      },
117
+      getDateTwo(){
118
+        var ptime = Math.round(new Date().getTime() / 1000)
119
+        return "印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
120
+      },
121
+      getTime(value, temp) {
122
+        if (value == 0) {
123
+          return ''
124
+        }
125
+        if (value != undefined) {
126
+          return uParseTime(value, temp)
127
+        }
128
+        return ''
129
+      },
130
+      printThisPage() {
131
+        var ptime = Math.round(new Date().getTime() / 1000)
132
+        this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
133
+        const style = '@media print {.dialysis-print-order{width:960px;margin:0 auto}.dialysis-print-order .order-yy-name{margin:auto;text-align:center;font-size:20px;letter-spacing:5px}.dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px 20px 20px 20px}.dialysis-print-order .table-box{width:100%;line-height:23px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:25px;font-size:14px}.dialysis-print-order .print-table-no{width:100%;text-align:center;border-collapse:collapse;font-size:14px}.dialysis-print-order .under-line{border-bottom:1px solid #999;width:95%;text-align:center;margin-left:2px}.dialysis-print-order .title-box{text-align:center;font-size:16px;border:1px solid #666}.dialysis-print-order .radio-lebel-box{font-weight:400;cursor:pointer}.dialysis-print-order .radio-no{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.dialysis-print-order .radio-inner{white-space:nowrap;cursor:pointer;outline:0;display:inline-block;line-height:1;position:relative;vertical-align:middle}.dialysis-print-order .radio-fang{display:inline-block;position:relative;border:1px solid #000;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.dialysis-print-order .is-checked-radio::after{content:"√";font-size:15px}}.dialysis-print-order .print-table-no tr td { padding: 8px 5px; line-height: 25px; }.es-img{height: 20px; }.advice-name{text-align: left;}.advice-children{display:flex;} .dialysis-print-order .print-table tr td{padding: 0px 0px;} .print-template-two tr {line-height: 30px;}   .title-box-pro{border: 0 #fff;line-height: 40px;height: 40px;text-align: left;padding-left: 10px !important;}  .text-align-left{text-align: left !important;padding-left:10px !important;font-size: 14px !important;line-height: 25px;}'
134
+        printJS({
135
+          printable: 'dialysis-print-box',
136
+          type: 'html',
137
+          style: style,
138
+          scanStyles: false
139
+        })
140
+      }, getDialysisRecord() {
141
+        this.loading = true
142
+        getPrintStockGood(this.queryParams).then(response => {
143
+          if (response.data.state == 1) {
144
+            for (let i = 0; i < response.data.data.list.length; i++) {
145
+              if (this.type == 1) {
146
+                if (response.data.data.list[i].query_warehousing_info.length > 0) {
147
+                  this.stockDatas.push(response.data.data.list[i])
148
+                }
149
+
150
+              } else if (this.type == 2) {
151
+                if (response.data.data.list[i].query_sales_return_info.length > 0) {
152
+                  this.stockDatas.push(response.data.data.list[i])
153
+                }
154
+
155
+              } else if (this.type == 3) {
156
+                if (response.data.data.list[i].query_warehouseout_info.length > 0) {
157
+                  this.stockDatas.push(response.data.data.list[i])
158
+                }
159
+
160
+              } else if (this.type == 4) {
161
+                if (response.data.data.list[i].query_cancel_stock_info.length > 0) {
162
+                  this.stockDatas.push(response.data.data.list[i])
163
+                }
164
+              }
165
+
166
+            }
167
+            var obj =  null
168
+            for(let i = 0; i <this.stockDatas.length;i++){
169
+              obj = this.stockDatas[i]
170
+            }
171
+
172
+            // if (this.stockDatas.length < 50) {
173
+            //   var nl = 50 - this.stockDatas.length
174
+            //   for (let index = 0; index < nl; index++) {
175
+            //     this.stockDatas.push([])
176
+            //   }
177
+            // }
178
+            this.loading = false
179
+          } else {
180
+            this.loading = false
181
+            this.$message.error('请求数据失败')
182
+            return false
183
+          }
184
+        })
185
+      }, calCount(stock) {
186
+        let total = 0
187
+        var array = []
188
+        if (this.type == 1) {
189
+          array = stock.query_warehousing_info
190
+        } else if (this.type == 2) {
191
+          array = stock.query_sales_return_info
192
+        } else if (this.type == 3) {
193
+          array = stock.query_warehouseout_info
194
+        } else if (this.type == 4) {
195
+          array = stock.query_cancel_stock_info
196
+        }
197
+
198
+        for (let i = 0; i < array.length; i++) {
199
+          if (this.type == 1) {
200
+            total = total + array[i].warehousing_count
201
+          } else if (this.type == 2) {
202
+            total = total + array[i].count
203
+          } else if (this.type == 3) {
204
+            total = total + array[i].count
205
+
206
+          } else if (this.type == 4) {
207
+            total = total + array[i].count
208
+          }
209
+        }
210
+        return total
211
+
212
+      }, calTotal(stock) {
213
+        console.log(stock)
214
+
215
+        var array = []
216
+        if (this.type == 1) {
217
+          array = stock.query_warehousing_info
218
+        } else if (this.type == 3) {
219
+          array = stock.query_warehouseout_info
220
+        }
221
+
222
+        let total_price = 0.0
223
+        for (let i = 0; i < array.length; i++) {
224
+          total_price = total_price + array[i].total_price
225
+        }
226
+        return total_price
227
+      }, calTotalPrice() {
228
+
229
+        var amountPrice = 0
230
+        for (let i = 0; i < this.stockDatas.length; i++) {
231
+          var obj = this.stockDatas[i]
232
+          var len = 0
233
+          if (this.type == 1) {
234
+            len = obj.query_warehousing_info.length
235
+          } else if (this.type == 3) {
236
+            len = obj.query_warehouseout_info.length
237
+          }
238
+          let total_price = 0.0
239
+          for (let a = 0; a < len; a++) {
240
+            if (this.type == 1) {
241
+              total_price = total_price + obj.query_warehousing_info[a].total_price
242
+            } else if (this.type == 3) {
243
+              total_price = total_price + obj.query_warehouseout_info[a].total_price
244
+            }
245
+          }
246
+          amountPrice = amountPrice + total_price
247
+        }
248
+        return amountPrice
249
+      }
250
+    },
251
+    created() {
252
+      var xtuser = this.$store.getters.xt_user
253
+      this.orgname = xtuser.org.org_name
254
+      this.goodUnit = this.$store.getters.good_unit
255
+
256
+      this.getDialysisRecord()
257
+
258
+    }
259
+
260
+  }
261
+</script>
262
+
263
+<style>
264
+  .dialysis-print-order {
265
+    width: 960px;
266
+    margin: 0 auto
267
+  }
268
+
269
+  .dialysis-print-order .order-yy-name {
270
+    margin: auto;
271
+    text-align: center;
272
+    font-size: 20px;
273
+    letter-spacing: 5px;
274
+  }
275
+
276
+  .dialysis-print-order .order-title {
277
+    margin: auto;
278
+    font-weight: 600;
279
+    text-align: center;
280
+    font-size: 22px;
281
+    padding: 10px 20px 20px 20px;
282
+  }
283
+
284
+  .dialysis-print-order .table-box {
285
+
286
+    width: 100%;
287
+    line-height: 23px;
288
+    font-size: 14px;
289
+  }
290
+
291
+  .dialysis-print-order .print-table {
292
+    width: 100%;
293
+    text-align: center;
294
+    border-collapse: collapse;
295
+    line-height: 40px;
296
+    font-size: 14px;
297
+  }
298
+
299
+  .dialysis-print-order .print-table-no {
300
+    width: 100%;
301
+    text-align: center;
302
+    border-collapse: collapse;
303
+    font-size: 14px;
304
+  }
305
+
306
+  .dialysis-print-order .under-line {
307
+    border-bottom: 1px solid #999;
308
+    width: 95%;
309
+    text-align: center;
310
+    margin-left: 2px;
311
+
312
+
313
+  }
314
+
315
+  .dialysis-print-order .title-box {
316
+    text-align: center;
317
+    font-size: 16px;
318
+  }
319
+
320
+  .dialysis-print-order .radio-lebel-box {
321
+    font-weight: 400;
322
+    cursor: pointer;
323
+  }
324
+
325
+  .dialysis-print-order .radio-no {
326
+    opacity: 0;
327
+    outline: none;
328
+    position: absolute;
329
+    margin: 0;
330
+    width: 0;
331
+    height: 0;
332
+    z-index: -1;
333
+  }
334
+
335
+  .dialysis-print-order .radio-inner {
336
+    white-space: nowrap;
337
+    cursor: pointer;
338
+    outline: none;
339
+    display: inline-block;
340
+    line-height: 1;
341
+    position: relative;
342
+    vertical-align: middle;
343
+  }
344
+
345
+  .dialysis-print-order .radio-fang {
346
+    display: inline-block;
347
+    position: relative;
348
+    border: 1px solid #000;
349
+    box-sizing: border-box;
350
+    width: 14px;
351
+    height: 14px;
352
+    background-color: #fff;
353
+    z-index: 1;
354
+    transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
355
+  }
356
+
357
+  .dialysis-print-order .is-checked-radio::after {
358
+    content: "√";
359
+    font-size: 15px;
360
+  }
361
+
362
+
363
+  .dialysis-print-order .print-table-no tr td {
364
+    padding: 8px 5px;
365
+    line-height: 25px;
366
+  }
367
+
368
+  .dialysis-print-order .print-table tr td {
369
+    padding: 1px 1px;
370
+    /*line-height: 25px;*/
371
+  }
372
+
373
+  .es-img {
374
+    height: 25px;
375
+  }
376
+
377
+  .advice-name {
378
+    text-align: left;
379
+  }
380
+
381
+  .advice-children {
382
+    display: flex;
383
+  }
384
+
385
+  .title-box-pro {
386
+    border: 0 #fff;
387
+    line-height: 25px;
388
+    height: 25px;
389
+    text-align: left;
390
+    padding-left: 10px !important;
391
+  }
392
+
393
+  .title-box-pro-tr {
394
+    border: 0 #fff;
395
+  }
396
+
397
+  .text-align-left {
398
+    text-align: left !important;
399
+    padding-left: 10px !important;
400
+    font-size: 14px !important;
401
+    line-height: 25px;
402
+  }
403
+
404
+  .print-table-tr-new td {
405
+    line-height: 20px !important;
406
+  }
407
+
408
+  .border-top-solid {
409
+    border: solid 1px #000;
410
+  }
411
+
412
+  .print-template-two tr {
413
+    line-height: 30px;
414
+  }
415
+</style>

+ 12 - 0
src/xt_pages/stock/detail/salesReturnDetail.vue View File

@@ -1,5 +1,7 @@
1 1
 <template>
2 2
     <div>
3
+      <el-button style="float: right" size="small" icon="el-icon-printer" @click="PrintAction" type="primary">打印
4
+      </el-button>
3 5
       <div class="cell clearfix" >
4 6
         <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
5 7
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
@@ -238,6 +240,16 @@
238 240
       },
239 241
       AddNewOrder: function() {
240 242
         this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type }})
243
+      },PrintAction: function() {
244
+        this.$router.push({
245
+          path: '/stock/print',
246
+          query: {
247
+            type: 2,
248
+            start_time: this.start_time,
249
+            end_time: this.end_time
250
+
251
+          }
252
+        })
241 253
       },
242 254
       GetCancelStock: function() {
243 255
         const Params = {

+ 191 - 136
src/xt_pages/stock/detail/stockInDetail.vue View File

@@ -1,131 +1,137 @@
1 1
 <template>
2
-    <div>
3
-      <div class="cell clearfix">
4
-        <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
5
-        <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
6
-      </div>
7
-
8
-      <div class="cell clearfix">
9
-        <label class="title"><span class="name">日期查询</span> : </label>
10
-        <el-date-picker size="small" v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
11
-                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
12
-                        value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
13
-        <span class="cellLine"> - </span>
14
-        <el-date-picker size="small" v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
15
-                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
16
-                        value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
17
-      </div>
18
-
19
-      <div class="cell clearfix">
20
-        <label class="title"><span class="name">单据类型</span> : </label>
21
-        <el-select size="small" v-model="order_type" clearable placeholder="单据类型" @change="changeType">
22
-          <el-option
23
-            v-for="item in orderTypeArr"
24
-            :key="item.value"
25
-            :label="item.label"
26
-            :value="item.value">
27
-          </el-option>
28
-        </el-select>
29
-      </div>
30
-
31
-      <div class="cell clearfix">
32
-        <label class="title"><span class="name">其它</span> : </label>
33
-        <el-select size="small" v-model="manufacturer_id" clearable placeholder="厂商" @change="changeManufacturer">
34
-          <el-option
35
-            v-for="item in manufacturer"
36
-            :key="item.id"
37
-            :label="item.manufacturer_name"
38
-            :value="item.id">
39
-          </el-option>
40
-        </el-select>
41
-      </div>
42
-
43
-      <el-row :gutter="12" style="margin-top: 10px">
44
-        <el-table
45
-          :data="cancelStockDate"
46
-          :class="signAndWeighBoxPatients"
47
-          border
48
-          highlight-current-row
49
-          ref="multipleTable"
50
-          @selection-change="select"
51
-          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
52
-
53
-        >
54
-
55
-          <el-table-column label="单据编号" align="center"  width="200">
56
-            <template slot-scope="scope">
57
-              {{scope.row.warehousing_order}}
58
-            </template>
59
-          </el-table-column>
60
-
61
-          <el-table-column label="商品类型" align="center">
62
-            <template slot-scope="scope">
63
-              {{typeName(scope.row.good_type_id)}}
64
-            </template>
65
-          </el-table-column>
66
-
67
-          <el-table-column label="规格名称" align="center">
68
-            <template slot-scope="scope">
69
-              {{specificationName(scope.row.good_id)}}
70
-            </template>
71
-          </el-table-column>
72
-
73
-
74
-          <el-table-column label="单据类型" align="center">
75
-            <template slot-scope="scope">
76
-              {{getTypeName(scope.row)}}
77
-            </template>
78
-          </el-table-column>
79
-
80
-          <el-table-column label="操作时间" align="center">
81
-            <template slot-scope="scope">
82
-              {{ scope.row.Warehousing.warehousing_time | parseTime('{y}-{m}-{d}')}}
83
-            </template>
84
-          </el-table-column>
85
-          <el-table-column label="制单人" align="center">
86
-            <template slot-scope="scope">
87
-              {{getXuserName(scope.row.Warehousing.creater)}}
88
-
89
-            </template>
90
-          </el-table-column>
91
-          <el-table-column label="单价" align="center">
92
-            <template slot-scope="scope">
93
-              {{scope.row.price}}
94
-            </template>
95
-          </el-table-column>
96
-          <el-table-column label="数量" align="center">
97
-            <template slot-scope="scope">
98
-              {{scope.row.warehousing_count}}
99
-            </template>
100
-          </el-table-column>
101
-          <el-table-column label="总价" align="center">
102
-            <template slot-scope="scope">
103
-              {{getTotal(scope.row.price,scope.row.warehousing_count)}}
104
-
105
-            </template>
106
-          </el-table-column>
107
-
108
-        </el-table>
109
-
110
-        <el-pagination
111
-          @size-change="handleSizeChange"
112
-          @current-change="handleCurrentChange"
113
-          :page-sizes="[7]"
114
-          :page-size="7"
115
-          background
116
-          style="margin-top:20px;float: right"
117
-          layout="total, sizes, prev, pager, next, jumper"
118
-          :total="total">
119
-        </el-pagination>
120
-
121
-      </el-row>
2
+  <div>
3
+    <el-button style="float: right" size="small" icon="el-icon-printer" @click="PrintAction" type="primary">打印
4
+    </el-button>
5
+
6
+    <div class="cell clearfix">
7
+      <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
8
+      <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
9
+    </div>
10
+
11
+    <div class="cell clearfix">
12
+      <label class="title"><span class="name">日期查询</span> : </label>
13
+      <el-date-picker size="small" v-model="start_time" prefix-icon="el-icon-date" :editable="false"
14
+                      style="width: 196px;"
15
+                      type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
16
+                      value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
17
+      <span class="cellLine"> - </span>
18
+      <el-date-picker size="small" v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
19
+                      type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
20
+                      value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
21
+    </div>
22
+
23
+    <div class="cell clearfix">
24
+      <label class="title"><span class="name">单据类型</span> : </label>
25
+      <el-select size="small" v-model="order_type" clearable placeholder="单据类型" @change="changeType">
26
+        <el-option
27
+          v-for="item in orderTypeArr"
28
+          :key="item.value"
29
+          :label="item.label"
30
+          :value="item.value">
31
+        </el-option>
32
+      </el-select>
33
+    </div>
34
+
35
+    <div class="cell clearfix">
36
+      <label class="title"><span class="name">其它</span> : </label>
37
+      <el-select size="small" v-model="manufacturer_id" clearable placeholder="厂商" @change="changeManufacturer">
38
+        <el-option
39
+          v-for="item in manufacturer"
40
+          :key="item.id"
41
+          :label="item.manufacturer_name"
42
+          :value="item.id">
43
+        </el-option>
44
+      </el-select>
122 45
     </div>
46
+
47
+    <el-row :gutter="12" style="margin-top: 10px">
48
+      <el-table
49
+        :data="cancelStockDate"
50
+        :class="signAndWeighBoxPatients"
51
+        border
52
+        highlight-current-row
53
+        ref="multipleTable"
54
+        @selection-change="select"
55
+        :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
56
+
57
+      >
58
+
59
+        <el-table-column label="单据编号" align="center" width="200">
60
+          <template slot-scope="scope">
61
+            {{scope.row.warehousing_order}}
62
+          </template>
63
+        </el-table-column>
64
+
65
+        <el-table-column label="商品类型" align="center">
66
+          <template slot-scope="scope">
67
+            {{typeName(scope.row.good_type_id)}}
68
+          </template>
69
+        </el-table-column>
70
+
71
+        <el-table-column label="规格名称" align="center">
72
+          <template slot-scope="scope">
73
+            {{specificationName(scope.row.good_id)}}
74
+          </template>
75
+        </el-table-column>
76
+
77
+
78
+        <el-table-column label="单据类型" align="center">
79
+          <template slot-scope="scope">
80
+            {{getTypeName(scope.row)}}
81
+          </template>
82
+        </el-table-column>
83
+
84
+        <el-table-column label="操作时间" align="center">
85
+          <template slot-scope="scope">
86
+            {{getTime(scope.row.Warehousing.warehousing_time)}}
87
+          </template>
88
+        </el-table-column>
89
+        <el-table-column label="制单人" align="center">
90
+          <template slot-scope="scope">
91
+            {{getXuserName(scope.row.Warehousing.creater)}}
92
+
93
+          </template>
94
+        </el-table-column>
95
+        <el-table-column label="单价" align="center">
96
+          <template slot-scope="scope">
97
+            {{scope.row.price}}
98
+          </template>
99
+        </el-table-column>
100
+        <el-table-column label="数量" align="center">
101
+          <template slot-scope="scope">
102
+            {{scope.row.warehousing_count}}
103
+          </template>
104
+        </el-table-column>
105
+        <el-table-column label="总价" align="center">
106
+          <template slot-scope="scope">
107
+            <span v-if="scope.row.is_total == 0">{{getTotal(scope.row.price,scope.row.warehousing_count)}}</span>
108
+            <span v-else>{{scope.row.total}}</span>
109
+
110
+          </template>
111
+        </el-table-column>
112
+
113
+      </el-table>
114
+
115
+
116
+      <el-pagination
117
+        @size-change="handleSizeChange"
118
+        @current-change="handleCurrentChange"
119
+        :page-sizes="[7]"
120
+        :page-size="7"
121
+        background
122
+        style="margin-top:20px;float: right"
123
+        layout="total, sizes, prev, pager, next, jumper"
124
+        :total="total">
125
+      </el-pagination>
126
+
127
+    </el-row>
128
+  </div>
123 129
 </template>
124 130
 
125 131
 <script>
126 132
   import { uParseTime } from '@/utils/tools'
127 133
   import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
128
-  import { deleteCancelStock, GetAllConfig, getStockDetail } from '@/api/stock'
134
+  import { deleteCancelStock, GetAllConfig, getStockDetail,getPrintStockGood } from '@/api/stock'
129 135
 
130 136
   export default {
131 137
     name: 'stockInDetail',
@@ -161,6 +167,10 @@
161 167
           { value: 1, label: '耗材入库单' },
162 168
           { value: 2, label: '其他入库单' }
163 169
         ],
170
+        newDate: [
171
+          { name: '合计', num: '111111' }
172
+
173
+        ],
164 174
 
165 175
         searchKey: '',
166 176
         type: 1,
@@ -206,7 +216,7 @@
206 216
         }
207 217
 
208 218
         return name
209
-      },   typeName: function(good_type_id) {
219
+      }, typeName: function(good_type_id) {
210 220
         let name = ''
211 221
         for (let i = 0; i < this.goodType.length; i++) {
212 222
           if (this.goodType[i].id == good_type_id) {
@@ -225,6 +235,11 @@
225 235
         return name
226 236
       },
227 237
       search: function() {
238
+
239
+
240
+
241
+
242
+
228 243
         const Params = {
229 244
           page: this.page,
230 245
           limit: this.limit,
@@ -241,13 +256,32 @@
241 256
           } else {
242 257
             this.total = response.data.data.total
243 258
             for (let i = 0; i < response.data.data.list.length; i++) {
244
-              this.cancelStockDate.push(response.data.data.list[i])
259
+              var obj = response.data.data.list[i]
260
+              obj['is_total'] = 0
261
+              this.cancelStockDate.push(obj)
245 262
             }
263
+
264
+            this.cancelStockDate.push({
265
+              warehousing_order: '合计',
266
+              is_total: 1,
267
+              total: response.data.data.total_price,
268
+              Warehousing: {
269
+                warehousing_time: 0
270
+              }
271
+            })
272
+
246 273
           }
247 274
         })
248 275
       },
276
+      getTime: function(val) {
277
+        if (val == 0) {
278
+          return ''
279
+        } else {
280
+          return uParseTime(val, '{y}-{m}-{d}')
281
+        }
282
+      },
249 283
       AddNewOrder: function() {
250
-        this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type }})
284
+        this.$router.push({ name: 'cancelStockOrderAdd', query: { type: this.type } })
251 285
       },
252 286
       GetCancelStock: function() {
253 287
         const Params = {
@@ -268,8 +302,18 @@
268 302
           } else {
269 303
             this.total = response.data.data.total
270 304
             for (let i = 0; i < response.data.data.list.length; i++) {
271
-              this.cancelStockDate.push(response.data.data.list[i])
305
+              var obj = response.data.data.list[i]
306
+              obj['is_total'] = 0
307
+              this.cancelStockDate.push(obj)
272 308
             }
309
+            this.cancelStockDate.push({
310
+              warehousing_order: '合计',
311
+              is_total: 1,
312
+              total: response.data.data.total_price,
313
+              Warehousing: {
314
+                warehousing_time: 0
315
+              }
316
+            })
273 317
           }
274 318
         })
275 319
       }, getXuserName(id) {
@@ -344,7 +388,7 @@
344 388
           }
345 389
         }
346 390
       }, handleEdit: function(index, row) {
347
-        this.$router.push({ name: 'cancelStockDetail', query: { id: row.id, type: this.type }})
391
+        this.$router.push({ name: 'cancelStockDetail', query: { id: row.id, type: this.type } })
348 392
       }, handleDelete: function(index, row) {
349 393
         const ids = []
350 394
         ids.push(row.id)
@@ -430,21 +474,32 @@
430 474
           })
431 475
         }).catch(() => {
432 476
         })
433
-      },getTotal:function(price, total) {
434
-        var m = 0,r1,r2;
435
-        var s1 = price.toString();
436
-        var s2 = total.toString();
437
-        try{
477
+      }, getTotal: function(price, total) {
478
+        var m = 0, r1, r2
479
+        var s1 = price.toString()
480
+        var s2 = total.toString()
481
+        try {
438 482
           m += s1.split('.')[1].length
439
-        }catch(e){
483
+        } catch (e) {
440 484
 
441 485
         }
442
-        try{}catch(e){
486
+        try {
487
+        } catch (e) {
443 488
           m += s2.split('.')[1].length
444 489
         }
445
-        r1 = Number(price.toString().replace(".",""));
446
-        r2 = Number(total.toString().replace(".",""));
447
-        return r1 * r2 / Math.pow(10,m);
490
+        r1 = Number(price.toString().replace('.', ''))
491
+        r2 = Number(total.toString().replace('.', ''))
492
+        return r1 * r2 / Math.pow(10, m)
493
+      }, PrintAction: function() {
494
+        this.$router.push({
495
+          path:'/stock/print',
496
+          query:{
497
+            type: 1,
498
+            start_time: this.start_time,
499
+            end_time: this.end_time
500
+
501
+          }
502
+        })
448 503
       }
449 504
     }
450 505
   }

+ 46 - 5
src/xt_pages/stock/detail/stockOutDetail.vue View File

@@ -1,5 +1,7 @@
1 1
 <template>
2 2
     <div>
3
+      <el-button style="float: right" size="small" icon="el-icon-printer" @click="PrintAction" type="primary">打印
4
+      </el-button>
3 5
       <div class="cell clearfix" >
4 6
         <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
5 7
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
@@ -83,7 +85,9 @@
83 85
 
84 86
           <el-table-column label="操作时间" align="center">
85 87
             <template slot-scope="scope">
86
-              {{ scope.row.WarehouseOut.warehouse_out_time | parseTime('{y}-{m}-{d}')}}
88
+
89
+              {{getTime(scope.row.WarehouseOut.warehouse_out_time)}}
90
+
87 91
             </template>
88 92
           </el-table-column>
89 93
           <el-table-column label="制单人" align="center">
@@ -104,8 +108,8 @@
104 108
           </el-table-column>
105 109
           <el-table-column label="总价" align="center">
106 110
             <template slot-scope="scope">
107
-              {{getTotal(scope.row.price,scope.row.count)}}
108
-
111
+              <span v-if="scope.row.is_total == 0">{{getTotal(scope.row.price,scope.row.count)}}</span>
112
+              <span v-else>{{scope.row.total}}</span>
109 113
             </template>
110 114
           </el-table-column>
111 115
 
@@ -245,8 +249,18 @@
245 249
           } else {
246 250
             this.total = response.data.data.total
247 251
             for (let i = 0; i < response.data.data.list.length; i++) {
248
-              this.cancelStockDate.push(response.data.data.list[i])
252
+              var obj = response.data.data.list[i]
253
+              obj['is_total'] = 0
254
+              this.cancelStockDate.push(obj)
249 255
             }
256
+            this.cancelStockDate.push({
257
+              warehouse_out_order_number: '合计',
258
+              is_total:1,
259
+              total:response.data.data.total_price,
260
+              WarehouseOut: {
261
+                warehouse_out_time: 0
262
+              }
263
+            })
250 264
           }
251 265
         })
252 266
       },
@@ -272,8 +286,19 @@
272 286
           } else {
273 287
             this.total = response.data.data.total
274 288
             for (let i = 0; i < response.data.data.list.length; i++) {
275
-              this.cancelStockDate.push(response.data.data.list[i])
289
+              var obj = response.data.data.list[i]
290
+              obj['is_total'] = 0
291
+              this.cancelStockDate.push(obj)
276 292
             }
293
+            this.cancelStockDate.push({
294
+              warehouse_out_order_number: '合计',
295
+              is_total:1,
296
+              total:response.data.data.total_price,
297
+              WarehouseOut: {
298
+                warehouse_out_time: 0
299
+              }
300
+            })
301
+
277 302
           }
278 303
         })
279 304
       }, getXuserName(id) {
@@ -450,6 +475,22 @@
450 475
         r1 = Number(price.toString().replace(".",""));
451 476
         r2 = Number(total.toString().replace(".",""));
452 477
         return r1 * r2 / Math.pow(10,m);
478
+      }, getTime:function(val){
479
+        if(val == 0){
480
+          return ""
481
+        }else{
482
+          return uParseTime(val, '{y}-{m}-{d}');
483
+        }
484
+      }, PrintAction: function() {
485
+        this.$router.push({
486
+          path:'/stock/print',
487
+          query:{
488
+            type: 3,
489
+            start_time: this.start_time,
490
+            end_time: this.end_time
491
+
492
+          }
493
+        })
453 494
       }
454 495
     }
455 496
   }

+ 47 - 10
src/xt_pages/stock/salesReturnEdit.vue View File

@@ -178,6 +178,7 @@
178 178
         // prop
179 179
         isVisibility: false,
180 180
         propForm: {
181
+          goods:[],
181 182
           goodType: [],
182 183
           goodInfo: [],
183 184
           goodUnit: [],
@@ -194,24 +195,25 @@
194 195
         salesReturn: {},
195 196
         manufacturer: [],
196 197
         dealer: [],
197
-        goodType: []
198
+        goodType: [],
199
+        goodInfo:[]
198 200
       }
199 201
     },
200 202
     methods: {
201 203
       comfirm: function(val) {
202 204
         this.$refs.dialog.hide()
203
-
204 205
         if (val.selectedGoodInfo.length > 0) {
205
-          for (let i = val.selectedGoodInfo.length - 1; ; i--) {
206
+          for (let i = val.selectedGoodInfo.length -1; i >= 0 ; i--) {
206 207
             if (i == 0) {
207
-              this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
208
+              this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
208 209
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
209 210
             } else {
210 211
               const tempForm = {}
211 212
               tempForm['id'] = 0
212
-              tempForm['good_type_id'] = val.goodTypeId
213
+              tempForm['good_type_id'] = val.selectedGoodInfo[i].good_type_id
213 214
               tempForm['good_id'] = val.selectedGoodInfo[i].id
214
-              tempForm['count'] = ''
215
+              tempForm['return_count'] = ''
216
+              tempForm['price'] = ''
215 217
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
216 218
             }
217 219
           }
@@ -258,6 +260,11 @@
258 260
             }
259 261
 
260 262
 
263
+            for (let i = 0; i < this.warehouseInfoList.length; i++) {
264
+              this.goodInfo.push(this.warehouseInfoList[i].info)
265
+            }
266
+
267
+
261 268
             const obj = {}
262 269
             const obj2 = {}
263 270
             const obj3 = {}
@@ -297,9 +304,9 @@
297 304
         return name
298 305
       }, specificationName: function(good_info_id) {
299 306
         let name = ''
300
-        for (let i = 0; i < this.propForm.goodInfo.length; i++) {
301
-          if (this.propForm.goodInfo[i].id == good_info_id) {
302
-            name = this.propForm.goodInfo[i].specification_name
307
+        for (let i = 0; i < this.goodInfo.length; i++) {
308
+          if (this.goodInfo[i].id == good_info_id) {
309
+            name = this.goodInfo[i].specification_name
303 310
           }
304 311
         }
305 312
         return name
@@ -311,7 +318,8 @@
311 318
         tempObj['count'] = ''
312 319
         this.recordInfo.recordData.push(tempObj)
313 320
       }, handleDelete: function(index, row) {
314
-        if (row.id == 0) {
321
+        console.log(row.id)
322
+        if (row.id == undefined || row.id == 0) {
315 323
           this.recordInfo.recordData.splice(index, 1)
316 324
         } else {
317 325
           const params = {
@@ -343,6 +351,8 @@
343 351
       }, showDialog(index, row) {
344 352
         this.currentIndex = index
345 353
         this.propForm.goodType = []
354
+        this.propForm.goods = []
355
+
346 356
 
347 357
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
348 358
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
@@ -440,6 +450,33 @@
440 450
         }, [])
441 451
 
442 452
 
453
+
454
+
455
+
456
+        for (let i = 0; i < this.propForm.goodType.length; i++) {
457
+          let goodInfo = []
458
+          let goodObj = {}
459
+
460
+          for (let a = 0; a < this.propForm.goodInfo.length; a++) {
461
+            var respObj = this.propForm.goodInfo[a]
462
+            respObj['isSelected'] = false
463
+            if (respObj.type.id == this.propForm.goodType[i].id) {
464
+              goodInfo.push(respObj)
465
+            }
466
+          }
467
+          const obj = {}
468
+          goodInfo = goodInfo.reduce((cur, next) => {
469
+            obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
470
+            return cur
471
+          }, []) // 设置cur默认类型为数组,并且初始值为空的数组
472
+
473
+          this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
474
+          this.propForm.goods.push(goodObj)
475
+
476
+        }
477
+
478
+
479
+
443 480
         // if (this.form.manufacturer == 0 && this.form.dealer == 0) {
444 481
         //   for (let i = 0; i < this.warehouseInfoList.length; i++) {
445 482
         //     this.propForm.goodType.push(this.warehouseInfoList[i].info.type)

+ 47 - 12
src/xt_pages/stock/salesReturnOrderAdd.vue View File

@@ -177,6 +177,7 @@
177 177
         // prop
178 178
         isVisibility: false,
179 179
         propForm: {
180
+          goods:[],
180 181
           goodType: [],
181 182
           goodInfo: [],
182 183
           goodUnit: [],
@@ -197,18 +198,18 @@
197 198
       comfirm: function(val) {
198 199
         this.$refs.dialog.hide()
199 200
         if (val.selectedGoodInfo.length > 0) {
200
-          for (let i = val.selectedGoodInfo.length - 1; ; i--) {
201
-            if (i == 0) {
202
-              this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
203
-              this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
204
-            } else {
205
-              const tempForm = {}
206
-              tempForm['good_type_id'] = val.goodTypeId
207
-              tempForm['good_id'] = val.selectedGoodInfo[i].id
208
-              tempForm['return_count'] = ''
209
-              tempForm['price'] = ''
210
-              this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
211
-            }
201
+          for (let i = val.selectedGoodInfo.length -1; i >= 0 ; i--) {
202
+              if (i == 0) {
203
+                this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
204
+                this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
205
+              } else {
206
+                const tempForm = {}
207
+                tempForm['good_type_id'] = val.selectedGoodInfo[i].good_type_id
208
+                tempForm['good_id'] = val.selectedGoodInfo[i].id
209
+                tempForm['return_count'] = ''
210
+                tempForm['price'] = ''
211
+                this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
212
+              }
212 213
           }
213 214
         }
214 215
         this.propForm.goodType = []
@@ -321,6 +322,8 @@
321 322
       }, showDialog(index, row) {
322 323
         this.currentIndex = index
323 324
         this.propForm.goodType = []
325
+        this.propForm.goods = []
326
+
324 327
         //根据选择经销商和厂商过滤商品类型
325 328
 
326 329
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
@@ -418,6 +421,37 @@
418 421
           return cur
419 422
         }, [])
420 423
 
424
+
425
+
426
+
427
+        for (let i = 0; i < this.propForm.goodType.length; i++) {
428
+          let goodInfo = []
429
+          let goodObj = {}
430
+
431
+          for (let a = 0; a < this.propForm.goodInfo.length; a++) {
432
+            var respObj = this.propForm.goodInfo[a]
433
+            respObj['isSelected'] = false
434
+            if (respObj.type.id == this.propForm.goodType[i].id) {
435
+              goodInfo.push(respObj)
436
+            }
437
+          }
438
+          const obj = {}
439
+          goodInfo = goodInfo.reduce((cur, next) => {
440
+            obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
441
+            return cur
442
+          }, []) // 设置cur默认类型为数组,并且初始值为空的数组
443
+
444
+          this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
445
+          this.propForm.goods.push(goodObj)
446
+
447
+        }
448
+
449
+
450
+
451
+
452
+
453
+
454
+
421 455
         this.$refs.dialog.show()
422 456
       }, back() {
423 457
         this.$router.go(-1)
@@ -480,6 +514,7 @@
480 514
       tempObj['return_count'] = ''
481 515
       tempObj['price'] = ''
482 516
       this.recordInfo.recordData.push(tempObj)
517
+      console.log(this.recordInfo.recordData)
483 518
       this.GetConfigInfo()
484 519
       this.propForm.goodUnit = this.$store.getters.good_unit
485 520
     }

+ 27 - 5
src/xt_pages/stock/stockInOrderAdd.vue View File

@@ -264,6 +264,7 @@
264 264
         // prop
265 265
         isVisibility: false,
266 266
         propForm: {
267
+          goods: [],
267 268
           goodType: [],
268 269
           goodInfo: [],
269 270
           goodUnit: [],
@@ -340,18 +341,20 @@
340 341
         this.isVisibility = true
341 342
       }, comfirm: function(val) {
342 343
         this.propForm.goodType = []
344
+        this.propForm.goods = []
345
+
343 346
         this.$refs.dialog.hide()
344 347
         console.log(val)
345 348
         if (val.selectedGoodInfo.length > 0) {
346 349
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
347 350
             if (i == 0) {
348
-              this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
351
+              this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
349 352
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
350 353
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
351 354
 
352 355
             } else {
353 356
               const tempForm = {}
354
-              tempForm['good_type_id'] = val.goodTypeId
357
+              tempForm['good_type_id'] =val.selectedGoodInfo[i].good_type_id
355 358
               tempForm['good_id'] = val.selectedGoodInfo[i].id
356 359
               tempForm['number'] = ''
357 360
               tempForm['product_date'] = ''
@@ -361,8 +364,6 @@
361 364
               tempForm['remark'] = ''
362 365
               tempForm['dealer'] = ''
363 366
               tempForm['manufacturer'] = ''
364
-              // this.recordInfo.recordData.add(tempForm,this.currentIndex + i)
365
-              // this.recordInfo.recordData.push(tempForm)
366 367
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
367 368
             }
368 369
           }
@@ -371,6 +372,7 @@
371 372
         this.currentIndex = -1
372 373
       }, cancle: function() {
373 374
         this.propForm.goodType = []
375
+        this.propForm.goods = []
374 376
         this.$refs.dialog.hide()
375 377
       }, GetAllGoodType: function() {
376 378
         GetAllGoodType().then(response => {
@@ -517,7 +519,28 @@
517 519
               }, []) // 设置cur默认类型为数组,并且初始值为空的数组
518 520
             }
519 521
 
522
+            for (let i = 0; i < this.propForm.goodType.length; i++) {
523
+              let goodInfo = []
524
+              let goodObj = {}
525
+
526
+              for (let a = 0; a < response.data.data.goodInfo.length; a++) {
527
+                var respObj = response.data.data.goodInfo[a]
528
+                respObj['isSelected'] = false
529
+                if (respObj.GoodsType.id == this.propForm.goodType[i].id) {
530
+                  goodInfo.push(respObj)
531
+                }
532
+              }
533
+              const obj = {}
534
+              goodInfo = goodInfo.reduce((cur, next) => {
535
+                obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
536
+                return cur
537
+              }, []) // 设置cur默认类型为数组,并且初始值为空的数组
538
+
539
+              this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
540
+              this.propForm.goods.push(goodObj)
520 541
 
542
+            }
543
+            console.log( this.propForm.goods)
521 544
           }
522 545
         )
523 546
       },
@@ -588,7 +611,6 @@
588 611
       ,
589 612
       changeManufacturer(val) {
590 613
 
591
-
592 614
       }, changeDealer(val) {
593 615
 
594 616
       }

+ 29 - 3
src/xt_pages/stock/stockInOrderEdit.vue View File

@@ -265,6 +265,7 @@ export default {
265 265
         // prop
266 266
         isVisibility: false,
267 267
         propForm: {
268
+          goods: [],
268 269
           goodType: [],
269 270
           goodInfo: [],
270 271
           goodUnit: [],
@@ -288,18 +289,19 @@ export default {
288 289
       comfirm: function(val) {
289 290
         this.$refs.dialog.hide()
290 291
         this.propForm.goodType = []
292
+        this.propForm.goods = []
291 293
 
292 294
         if (val.selectedGoodInfo.length > 0) {
293 295
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
294 296
             if (i == 0) {
295
-              this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
297
+              this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
296 298
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
297 299
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
298 300
 
299 301
             } else {
300 302
               const tempForm = {}
301 303
               tempForm['id'] = 0
302
-              tempForm['good_type_id'] = val.goodTypeId
304
+              tempForm['good_type_id'] = val.selectedGoodInfo[i].good_type_id
303 305
               tempForm['good_id'] = val.selectedGoodInfo[i].id
304 306
               tempForm['number'] = ''
305 307
               tempForm['product_date'] = ''
@@ -317,6 +319,8 @@ export default {
317 319
         this.currentIndex = -1
318 320
       }, cancle: function() {
319 321
         this.$refs.dialog.hide()
322
+        this.propForm.goods = []
323
+
320 324
         this.propForm.goodType = []
321 325
 
322 326
       }, GetConfigInfo: function() {
@@ -439,7 +443,29 @@ export default {
439 443
                 return cur
440 444
               }, []) // 设置cur默认类型为数组,并且初始值为空的数组
441 445
             }
442
-            loading.close()
446
+
447
+          for (let i = 0; i < this.propForm.goodType.length; i++) {
448
+            let goodInfo = []
449
+            let goodObj = {}
450
+
451
+            for (let a = 0; a < response.data.data.goodInfo.length; a++) {
452
+              var respObj = response.data.data.goodInfo[a]
453
+              respObj['isSelected'] = false
454
+              if (respObj.GoodsType.id == this.propForm.goodType[i].id) {
455
+                goodInfo.push(respObj)
456
+              }
457
+            }
458
+            const obj = {}
459
+            goodInfo = goodInfo.reduce((cur, next) => {
460
+              obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
461
+              return cur
462
+            }, []) // 设置cur默认类型为数组,并且初始值为空的数组
463
+
464
+            this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
465
+            this.propForm.goods.push(goodObj)
466
+
467
+          }
468
+          loading.close()
443 469
 
444 470
           }
445 471
         )

+ 34 - 41
src/xt_pages/stock/stockOutOrderAdd.vue View File

@@ -207,6 +207,7 @@
207 207
         // prop
208 208
         isVisibility: false,
209 209
         propForm: {
210
+          goods:[],
210 211
           goodType: [],
211 212
           goodInfo: [],
212 213
           goodUnit: [],
@@ -228,17 +229,18 @@
228 229
         this.$refs.dialog.hide()
229 230
         this.propForm.goodType = []
230 231
         if (val.selectedGoodInfo.length > 0) {
231
-          for (let i = val.selectedGoodInfo.length - 1; ; i--) {
232
+          for (let i = val.selectedGoodInfo.length - 1;i >= 0 ; i--) {
232 233
             if (i == 0) {
233
-              this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
234
+              this.recordInfo.recordData[this.currentIndex].good_type_id =  val.selectedGoodInfo[i].good_type_id
234 235
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
235 236
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
236 237
             } else {
238
+              console.log(val.selectedGoodInfo[i].buy_price.toString())
237 239
               const tempForm = {}
238
-              tempForm['good_type_id'] = val.goodTypeId
240
+              tempForm['good_type_id'] =val.selectedGoodInfo[i].good_type_id
239 241
               tempForm['good_id'] = val.selectedGoodInfo[i].id
240 242
               tempForm['count'] = ''
241
-              tempForm['price'] = val.selectedGoodInfo[i].buy_price
243
+              tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
242 244
               tempForm['remark'] = ''
243 245
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
244 246
             }
@@ -357,6 +359,10 @@
357 359
       }, showDialog(index, row) {
358 360
         this.currentIndex = index
359 361
         this.propForm.goodType = []
362
+        this.propForm.goods = []
363
+
364
+
365
+
360 366
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
361 367
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
362 368
             if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == 0) {
@@ -454,43 +460,30 @@
454 460
 
455 461
 
456 462
 
457
-        // if (this.form.manufacturer == 0 && this.form.dealer == 0) {
458
-        //   for (let i = 0; i < this.warehouseInfoList.length; i++) {
459
-        //     this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
460
-        //   }
461
-        //   const obj3 = {}
462
-        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
463
-        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
464
-        //     return cur
465
-        //   }, [])
466
-        // } else {
467
-        //   if (this.form.manufacturer == 0 && this.form.dealer != 0) {
468
-        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
469
-        //       if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
470
-        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
471
-        //       }
472
-        //     }
473
-        //   }
474
-        //   if (this.form.manufacturer != 0 && this.form.dealer == 0) {
475
-        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
476
-        //       if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
477
-        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
478
-        //       }
479
-        //     }
480
-        //   }
481
-        //   if (this.form.manufacturer != 0 && this.form.dealer != 0) {
482
-        //     for (let i = 0; i < this.warehouseInfoList.length; i++) {
483
-        //       if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
484
-        //         this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
485
-        //       }
486
-        //     }
487
-        //   }
488
-        //   const obj3 = {}
489
-        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
490
-        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
491
-        //     return cur
492
-        //   }, [])
493
-        // }
463
+
464
+        for (let i = 0; i < this.propForm.goodType.length; i++) {
465
+          let goodInfo = []
466
+          let goodObj = {}
467
+
468
+          for (let a = 0; a < this.propForm.goodInfo.length; a++) {
469
+            var respObj = this.propForm.goodInfo[a]
470
+            respObj['isSelected'] = false
471
+            if (respObj.type.id == this.propForm.goodType[i].id) {
472
+              goodInfo.push(respObj)
473
+            }
474
+          }
475
+          const obj = {}
476
+          goodInfo = goodInfo.reduce((cur, next) => {
477
+            obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
478
+            return cur
479
+          }, []) // 设置cur默认类型为数组,并且初始值为空的数组
480
+
481
+          this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
482
+          this.propForm.goods.push(goodObj)
483
+
484
+        }
485
+
486
+
494 487
         this.$refs.dialog.show()
495 488
 
496 489
       }, back() {

+ 112 - 26
src/xt_pages/stock/stockOutOrderEdit.vue View File

@@ -207,6 +207,7 @@
207 207
         // prop
208 208
         isVisibility: false,
209 209
         propForm: {
210
+          goods:[],
210 211
           goodType: [],
211 212
           goodInfo: [],
212 213
           goodUnit: [],
@@ -231,17 +232,19 @@
231 232
         this.$refs.dialog.hide()
232 233
 
233 234
         if (val.selectedGoodInfo.length > 0) {
234
-          for (let i = val.selectedGoodInfo.length - 1; ; i--) {
235
+          for (let i = val.selectedGoodInfo.length - 1;i >= 0 ; i--) {
235 236
             if (i == 0) {
236
-              this.recordInfo.recordData[this.currentIndex].good_type_id = val.goodTypeId
237
+              this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
237 238
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
239
+
238 240
             } else {
239 241
               const tempForm = {}
240 242
               tempForm['id'] = 0
241
-              tempForm['good_type_id'] = val.goodTypeId
243
+              tempForm['good_type_id'] = val.selectedGoodInfo[i].good_type_id
242 244
               tempForm['good_id'] = val.selectedGoodInfo[i].id
243 245
               tempForm['count'] = ''
244
-              tempForm['price'] = ''
246
+              tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
247
+
245 248
               tempForm['remark'] = ''
246 249
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
247 250
             }
@@ -375,42 +378,125 @@
375 378
       }, showDialog(index, row) {
376 379
         this.currentIndex = index
377 380
         this.propForm.goodType = []
381
+        this.propForm.goods = []
382
+
383
+        if (this.form.manufacturer == -1 && this.form.dealer == -1) {
384
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
385
+            if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == 0) {
386
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
387
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
388
+            }
389
+          }
390
+        }
391
+
392
+        if (this.form.manufacturer == -1 && this.form.dealer == 0) {
393
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
394
+            if (this.warehouseInfoList[i].info.manufacturers.id == 0) {
395
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
396
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
397
+            }
398
+          }
399
+        }
400
+
401
+        if (this.form.manufacturer == -1 && this.form.dealer != 0) {
402
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
403
+            if (this.warehouseInfoList[i].info.manufacturers.id == 0 && this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
404
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
405
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
406
+
407
+            }
408
+          }
409
+        }
410
+
378 411
         if (this.form.manufacturer == 0 && this.form.dealer == 0) {
379 412
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
380 413
             this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
414
+            this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
415
+
381 416
           }
382
-          const obj3 = {}
383
-          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
384
-            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
385
-            return cur
386
-          }, [])
387
-        } else {
388
-          if (this.form.manufacturer == 0 && this.form.dealer != 0) {
389
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
390
-              if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
391
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
392
-              }
417
+        }
418
+
419
+        if (this.form.manufacturer == 0 && this.form.dealer == -1) {
420
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
421
+            if (this.warehouseInfoList[i].info.dealers.id == 0) {
422
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
423
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
424
+
393 425
             }
394 426
           }
395
-          if (this.form.manufacturer != 0 && this.form.dealer == 0) {
396
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
397
-              if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
398
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
399
-              }
427
+        }
428
+
429
+        if (this.form.manufacturer != 0 && this.form.dealer == -1) {
430
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
431
+            if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
432
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
433
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
434
+
400 435
             }
401 436
           }
402
-          if (this.form.manufacturer != 0 && this.form.dealer != 0) {
403
-            for (let i = 0; i < this.warehouseInfoList.length; i++) {
404
-              if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer && this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
405
-                this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
406
-              }
437
+        }
438
+
439
+        if (this.form.manufacturer != 0 && this.form.dealer != 0) {
440
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
441
+            if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer && this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
442
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
443
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
444
+
407 445
             }
408 446
           }
409
-          const obj3 = {}
447
+        }
448
+
449
+        if (this.form.manufacturer == 0 && this.form.dealer != 0) {
450
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
451
+            if (this.warehouseInfoList[i].info.dealers.id == this.form.dealer) {
452
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
453
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
454
+
455
+            }
456
+          }
457
+        }
458
+        if (this.form.manufacturer != 0 && this.form.dealer == 0) {
459
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
460
+            if (this.warehouseInfoList[i].info.manufacturers.id == this.form.manufacturer) {
461
+              this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
462
+              this.propForm.goodInfo.push(this.warehouseInfoList[i].info)
463
+            }
464
+          }
465
+        }
466
+
467
+
468
+        const obj3 = {}
410 469
           this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
411 470
             obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
412 471
             return cur
413 472
           }, [])
473
+        const obj4 = {}
474
+        this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
475
+          obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
476
+          return cur
477
+        }, [])
478
+
479
+
480
+          for (let i = 0; i < this.propForm.goodType.length; i++) {
481
+            let goodInfo = []
482
+            let goodObj = {}
483
+
484
+            for (let a = 0; a < this.propForm.goodInfo.length; a++) {
485
+              var respObj = this.propForm.goodInfo[a]
486
+              respObj['isSelected'] = false
487
+              if (respObj.type.id == this.propForm.goodType[i].id) {
488
+                goodInfo.push(respObj)
489
+              }
490
+            }
491
+            const obj = {}
492
+            goodInfo = goodInfo.reduce((cur, next) => {
493
+              obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
494
+              return cur
495
+            }, []) // 设置cur默认类型为数组,并且初始值为空的数组
496
+
497
+            this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
498
+            this.propForm.goods.push(goodObj)
499
+
414 500
         }
415 501
         this.$refs.dialog.show()
416 502
 

+ 83 - 77
src/xt_pages/stock/stockQuery.vue View File

@@ -1,11 +1,19 @@
1 1
 <template>
2
-<div class="main-contain">
3
-  <div class="position">
4
-    <bread-crumb :crumbs='crumbs'></bread-crumb>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5 5
 
6
-  </div>
7
-  <div class="app-container ">
8
-      <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}"  :data="WarehouseInfo.warehouseInfoDate" :class="signAndWeighBoxPatients" border
6
+    </div>
7
+    <div class="app-container ">
8
+      <div class="cell clearfix">
9
+        <el-input size="small" style="width: 400px;" class="filter-item" v-model="keywords"
10
+                  placeholder="商品编码/商品名称/规格名称"/>
11
+        <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
12
+      </div>
13
+
14
+
15
+      <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="WarehouseInfo.warehouseInfoDate"
16
+                :class="signAndWeighBoxPatients" border
9 17
                 v-loading="WarehouseInfo.loading"
10 18
       >
11 19
 
@@ -24,14 +32,16 @@
24 32
             <span>{{scope.row.specification_name}}</span>
25 33
           </template>
26 34
         </el-table-column>
27
-        <el-table-column label="入库数量" align="center" >
35
+        <el-table-column label="入库数量" align="center">
28 36
           <template slot-scope="scope">
29
-            <span @click="showStockInDetailDialog(scope.row.good_id)" style="color: #579ef8">{{stockInCount(scope.row)}}</span>
37
+            <span @click="showStockInDetailDialog(scope.row.good_id)"
38
+                  style="color: #579ef8">{{stockInCount(scope.row)}}</span>
30 39
           </template>
31 40
         </el-table-column>
32 41
         <el-table-column label="入库退货" align="center">
33 42
           <template slot-scope="scope">
34
-            <span @click="showSaleReturnDetailDialog(scope.row)" style="color: #F56C6C">{{salesReturnCount(scope.row)}}</span>
43
+            <span @click="showSaleReturnDetailDialog(scope.row)"
44
+                  style="color: #F56C6C">{{salesReturnCount(scope.row)}}</span>
35 45
 
36 46
           </template>
37 47
         </el-table-column>
@@ -48,7 +58,8 @@
48 58
         </el-table-column>
49 59
         <el-table-column label="出库退库" align="center">
50 60
           <template slot-scope="scope">
51
-            <span @click="showCancelStockDetailDialog(scope.row)"  style="color: #F56C6C">{{cancelStockCount(scope.row)}}</span>
61
+            <span @click="showCancelStockDetailDialog(scope.row)"
62
+                  style="color: #F56C6C">{{cancelStockCount(scope.row)}}</span>
52 63
 
53 64
           </template>
54 65
         </el-table-column>
@@ -59,8 +70,8 @@
59 70
         </el-table-column>
60 71
 
61 72
         <el-table-column label="剩余库存" align="center">
62
-          <template slot-scope="scope" >
63
-            <span  style="color: red">{{(stockInCount(scope.row) - salesReturnCount(scope.row) - stockOutCount(scope.row)) + cancelStockCount(scope.row)}}</span>
73
+          <template slot-scope="scope">
74
+            <span style="color: red">{{(stockInCount(scope.row) - salesReturnCount(scope.row) - stockOutCount(scope.row)) + cancelStockCount(scope.row)}}</span>
64 75
           </template>
65 76
         </el-table-column>
66 77
       </el-table>
@@ -75,37 +86,33 @@
75 86
         layout="total, sizes, prev, pager, next, jumper"
76 87
         :total="total">
77 88
       </el-pagination>
78
-  </div>
89
+    </div>
79 90
   </div>
80 91
 
81 92
 </template>
82 93
 
83 94
 <script>
84
-  import {uParseTime} from "@/utils/tools";
85
-  import BreadCrumb from "@/xt_pages/components/bread-crumb";
86
-  import {
87
-    getAllStockQueryList,
88
-    GetAllGoodInfo,
89
-    GetAllGoodType,
90
-  } from "@/api/stock";
95
+  import { uParseTime } from '@/utils/tools'
96
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
97
+  import { GetAllGoodInfo, GetAllGoodType, getAllStockQueryList } from '@/api/stock'
91 98
 
92 99
   export default {
93
-    name: "stockIn",
100
+    name: 'stockIn',
94 101
     created() {
95 102
       this.GetAllStockQuery()
96 103
       this.GetAllGoodInfo()
97 104
       this.GetAllGoodType()
98 105
     },
99
-    components:{
106
+    components: {
100 107
       BreadCrumb
101 108
     },
102 109
     data() {
103 110
       return {
104 111
         crumbs: [
105 112
           { path: false, name: '库存管理' },
106
-          { path: '/stock/query', name: '库存查询' },
113
+          { path: '/stock/query', name: '库存查询' }
107 114
         ],
108
-
115
+        keywords:'',
109 116
         total: 0,
110 117
         multipleSelection: [],
111 118
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
@@ -117,37 +124,38 @@
117 124
         goodInfo: [],
118 125
         WarehouseInfo: {
119 126
           loading: false,
120
-          warehouseInfoDate: [],
127
+          warehouseInfoDate: []
121 128
         }
122
-      };
129
+      }
123 130
     },
124 131
     methods: {
125
-      GetAllStockQuery: function () {
132
+      GetAllStockQuery: function() {
133
+        console.log(this.keywords)
126 134
         let Params = {
127 135
           page: this.page,
128 136
           limit: this.limit,
137
+          keyword:this.keywords
129 138
         }
130 139
         this.WarehouseInfo.loading = true
131
-
132 140
         this.WarehouseInfo.warehouseInfoDate = []
133 141
         getAllStockQueryList(Params).then(response => {
134 142
           if (response.data.state == 0) {
135 143
             this.WarehouseInfo.loading = false
136
-            this.$message.error(response.data.msg);
137
-            return false;
144
+            this.$message.error(response.data.msg)
145
+            return false
138 146
           } else {
139 147
             this.WarehouseInfo.loading = false
140 148
             this.total = response.data.data.total
141 149
             for (let i = 0; i < response.data.data.list.length; i++) {
142
-              if(response.data.data.list[i].query_warehousing_info.length > 0){
150
+              if (response.data.data.list[i].query_warehousing_info.length > 0) {
143 151
                 this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
144
-              }else{
145
-                this.total = this.total -1
152
+              } else {
153
+                this.total = this.total - 1
146 154
               }
147 155
             }
148 156
           }
149
-        });
150
-      }, getSpecificationName: function (id) {
157
+        })
158
+      }, getSpecificationName: function(id) {
151 159
         let name = ''
152 160
         for (let i = 0; i < this.goodInfo.length; i++) {
153 161
           if (this.goodInfo[i].id == id) {
@@ -155,7 +163,7 @@
155 163
           }
156 164
         }
157 165
         return name
158
-      }, getTypeName: function (id) {
166
+      }, getTypeName: function(id) {
159 167
         let name = ''
160 168
         for (let i = 0; i < this.goodType.length; i++) {
161 169
           if (this.goodType[i].id == id) {
@@ -163,85 +171,83 @@
163 171
           }
164 172
         }
165 173
         return name
166
-      }, GetAllGoodType: function () {
174
+      }, GetAllGoodType: function() {
167 175
         GetAllGoodType().then(response => {
168 176
           if (response.data.state == 0) {
169
-            this.$message.error(response.data.msg);
170
-            return false;
177
+            this.$message.error(response.data.msg)
178
+            return false
171 179
           } else {
172 180
             for (let i = 0; i < response.data.data.goodType.length; i++) {
173 181
               this.goodType.push(response.data.data.goodType[i])
174 182
             }
175 183
           }
176
-        });
177
-      }, GetAllGoodInfo: function () {
184
+        })
185
+      }, GetAllGoodInfo: function() {
178 186
         GetAllGoodInfo().then(response => {
179 187
           if (response.data.state == 0) {
180
-            this.$message.error(response.data.msg);
181
-            return false;
188
+            this.$message.error(response.data.msg)
189
+            return false
182 190
           } else {
183 191
             for (let i = 0; i < response.data.data.goodInfo.length; i++) {
184 192
               this.goodInfo.push(response.data.data.goodInfo[i])
185 193
             }
186 194
           }
187
-        });
188
-      }, handleBack: function () {
195
+        })
196
+      }, handleBack: function() {
189 197
         this.$router.go(-1)
190 198
       }, handleSizeChange(val) {
191
-        this.limit = val;
192
-        this.GetAllStockQuery();
199
+        this.limit = val
200
+        this.GetAllStockQuery()
193 201
       }, handleCurrentChange(val) {
194
-        this.page = val;
195
-        this.GetAllStockQuery();
196
-      }, calculate: function (val) {
202
+        this.page = val
203
+        this.GetAllStockQuery()
204
+      }, calculate: function(val) {
197 205
         return Math.round(parseFloat(val) * 100) / 100
198
-      }, startTimeChange: function () {
206
+      }, startTimeChange: function() {
199 207
         this.GetAllStockQuery()
200
-      }, endTimeChange: function () {
208
+      }, endTimeChange: function() {
201 209
         this.GetAllStockQuery()
202 210
 
203
-      },stockInCount:function (row) {
211
+      }, stockInCount: function(row) {
204 212
         let total = 0
205
-        for(let i = 0; i < row.query_warehousing_info.length; i++ ){
206
-          total =   total+  row.query_warehousing_info[i].warehousing_count
213
+        for (let i = 0; i < row.query_warehousing_info.length; i++) {
214
+          total = total + row.query_warehousing_info[i].warehousing_count
207 215
         }
208 216
         return total
209 217
 
210
-      },salesReturnCount:function (row) {
218
+      }, salesReturnCount: function(row) {
211 219
         let total = 0
212
-        for(let i = 0; i < row.query_sales_return_info.length; i++ ){
220
+        for (let i = 0; i < row.query_sales_return_info.length; i++) {
213 221
           total = total + row.query_sales_return_info[i].count
214 222
         }
215 223
         return total
216 224
 
217
-      },stockOutCount:function (row) {
225
+      }, stockOutCount: function(row) {
218 226
         let total = 0
219
-        for(let i = 0; i < row.query_warehouseout_info.length; i++ ){
220
-          total =   total+  row.query_warehouseout_info[i].count
227
+        for (let i = 0; i < row.query_warehouseout_info.length; i++) {
228
+          total = total + row.query_warehouseout_info[i].count
221 229
         }
222 230
         return total
223 231
 
224
-      },cancelStockCount:function (row) {
232
+      }, cancelStockCount: function(row) {
225 233
         let total = 0
226
-        for(let i = 0; i < row.query_cancel_stock_info.length; i++ ){
227
-          total =   total+  row.query_cancel_stock_info[i].count
234
+        for (let i = 0; i < row.query_cancel_stock_info.length; i++) {
235
+          total = total + row.query_cancel_stock_info[i].count
228 236
         }
229 237
         return total
230
-      },showStockInDetailDialog:function (val) {
238
+      }, showStockInDetailDialog: function(val) {
231 239
 
240
+      }, showSaleReturnDetailDialog: function() {
232 241
 
233
-      },showSaleReturnDetailDialog:function () {
234
-
235
-
236
-      },showStockOutDetailDialog:function () {
237
-
238
-
239
-      },showCancelStockDetailDialog:function () {
242
+      }, showStockOutDetailDialog: function() {
240 243
 
244
+      }, showCancelStockDetailDialog: function() {
241 245
 
246
+      },search:function() {
247
+        this.GetAllStockQuery()
242 248
       }
243 249
     }
244
-  };
250
+  }
245 251
 </script>
246 252
 
247 253
 <style rel="stylesheet/css" lang="scss" scoped>
@@ -249,10 +255,11 @@
249 255
     border: 1px #dcdfe6 solid;
250 256
     padding: 30px 20px 30px 20px;
251 257
 
252
-    .border {
253
-      border-bottom: 1px #dcdfe6 solid;
254
-      margin: 0px 0 20px 0;
255
-    }
258
+  .border {
259
+    border-bottom: 1px #dcdfe6 solid;
260
+    margin: 0px 0 20px 0;
261
+  }
262
+
256 263
   }
257 264
 
258 265
   .title {
@@ -262,7 +269,6 @@
262 269
     padding: 0 0 0 10px;
263 270
     color: #fff;
264 271
     margin: 0 0 10px 0;
265
-    // border-radius: 4px 4px 0 0;
266 272
   }
267 273
 
268 274
   .edit_separater {