Browse Source

修改华侨医院bug

csx 6 years ago
parent
commit
27875d545b

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

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
     icon: 'stock'
11
     icon: 'stock'
12
   },
12
   },
13
   children: [
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
                     <table class="inside_table">
232
                     <table class="inside_table">
233
                       <tbody>
233
                       <tbody>
234
                       <!-- <thead> -->
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
                         <tr>
236
                         <tr>
237
                           <td width="100">时间</td>
237
                           <td width="100">时间</td>
238
                           <td width="30">T<br>C°</td>
238
                           <td width="30">T<br>C°</td>
275
                           <td>{{monitor_record.ultrafiltration_volume?monitor_record.ultrafiltration_volume:'/'}}</td>
275
                           <td>{{monitor_record.ultrafiltration_volume?monitor_record.ultrafiltration_volume:'/'}}</td>
276
                           <td>{{monitor_record.sodium_concentration?monitor_record.sodium_concentration:''}}</td>
276
                           <td>{{monitor_record.sodium_concentration?monitor_record.sodium_concentration:''}}</td>
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>
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
                         </tr>
279
                         </tr>
280
                       </tbody>
280
                       </tbody>
281
                     </table>
281
                     </table>
335
                     <table class="inside_table">
335
                     <table class="inside_table">
336
                       <tbody>
336
                       <tbody>
337
                       <!-- <thead> -->
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
                         <tr>
339
                         <tr>
340
                           <td width="100">时间</td>
340
                           <td width="100">时间</td>
341
                           <td width="30">T<br>C°</td>
341
                           <td width="30">T<br>C°</td>
360
                           <td>{{monitor_record.ultrafiltration_volume?monitor_record.ultrafiltration_volume:'/'}}</td>
360
                           <td>{{monitor_record.ultrafiltration_volume?monitor_record.ultrafiltration_volume:'/'}}</td>
361
                           <td>{{monitor_record.sodium_concentration?monitor_record.sodium_concentration:''}}</td>
361
                           <td>{{monitor_record.sodium_concentration?monitor_record.sodium_concentration:''}}</td>
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>
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
                         </tr>
364
                         </tr>
365
                       </tbody>
365
                       </tbody>
366
                     </table>
366
                     </table>
367
                   </td>
367
                   </td>
368
                 </tr>
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
                 <tr>
370
                 <tr>
371
                   <td>
371
                   <td>
372
                     <div class="row" style="padding: 2px 0;line-height:19px;">
372
                     <div class="row" style="padding: 2px 0;line-height:19px;">
474
                         责任护士:
474
                         责任护士:
475
                         <div class="under_line" style="width: 100px;">
475
                         <div class="under_line" style="width: 100px;">
476
                           <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
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
                         </div>
478
                         </div>
479
                       </div>
479
                       </div>
480
                       <div class="inline_block" >
480
                       <div class="inline_block" >
481
                         &emsp;核对人:
481
                         &emsp;核对人:
482
                         <div class="under_line" style="width: 100px;">
482
                         <div class="under_line" style="width: 100px;">
483
                           <span v-if="setAdminUserES(record.check, 'modifier') == ''">{{getAdminUser(record.check, 'modifier')}}</span>
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
                         </div>
485
                         </div>
486
                       </div>
486
                       </div>
487
                       <div class="inline_block">
487
                       <div class="inline_block">
494
                         &emsp;收针者:
494
                         &emsp;收针者:
495
                         <div class="under_line" style="width: 100px;">
495
                         <div class="under_line" style="width: 100px;">
496
                           <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
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
                         </div>
498
                         </div>
499
                       </div>
499
                       </div>
500
                     </div>
500
                     </div>
519
                         血透室护士签名:
519
                         血透室护士签名:
520
                         <div class="under_line" style="width: 100px;">
520
                         <div class="under_line" style="width: 100px;">
521
                           <span v-if="setAdminUserES(record.dialysis_order, 'start_nurse') == ''">{{getAdminUser(record.dialysis_order, 'start_nurse')}}</span>
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
                         </div>
523
                         </div>
524
                       </div>
524
                       </div>
525
                       <div class="inline_block" >
525
                       <div class="inline_block" >
810
                   <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td>
810
                   <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td>
811
                   <td height="60px">
811
                   <td height="60px">
812
                     <span v-if="setAdminUserES(advice, 'advice_doctor') == ''">{{getAdminUser(advice, 'advice_doctor')}}</span>
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
                   </td>
814
                   </td>
815
                   <td height="60px">
815
                   <td height="60px">
816
                       <span v-if="setAdminUserES(advice, 'checker') == ''">{{getAdminUser(advice, 'checker')}}</span>
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
                   </td>
818
                   </td>
819
                   <td height="60px">
819
                   <td height="60px">
820
                     <span v-if="setAdminUserES(advice, 'execution_staff') == ''">{{getAdminUser(advice, 'execution_staff')}}</span>
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
                   </td>
822
                   </td>
823
                   <td height="60px"><span v-if="advice.execution_time"> {{getTime(advice.execution_time,'{y}-{m}-{d} {h}:{i}')}} </span> </td>
823
                   <td height="60px"><span v-if="advice.execution_time"> {{getTime(advice.execution_time,'{y}-{m}-{d} {h}:{i}')}} </span> </td>
824
                 </tr>
824
                 </tr>
905
                     <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td>
905
                     <td width="10%" v-if="(advice.children && advice.children.length > 0 || advice.parent_id > 0) && advice.isShow == 2" ></td>
906
                     <td height="60px">
906
                     <td height="60px">
907
                       <span v-if="setAdminUserES(advice, 'advice_doctor') == ''">{{getAdminUser(advice, 'advice_doctor')}}</span>
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
                     </td>
909
                     </td>
910
                     <td height="60px">
910
                     <td height="60px">
911
                         <span v-if="setAdminUserES(advice, 'checker') == ''">{{getAdminUser(advice, 'checker')}}</span>
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
                     </td>
913
                     </td>
914
                     <td height="60px">
914
                     <td height="60px">
915
                       <span v-if="setAdminUserES(advice, 'execution_staff') == ''">{{getAdminUser(advice, 'execution_staff')}}</span>
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
                     </td>
917
                     </td>
918
                     <td height="60px"><span v-if="advice.execution_time"> {{getTime(advice.execution_time,'{y}-{m}-{d} {h}:{i}')}} </span> </td>
918
                     <td height="60px"><span v-if="advice.execution_time"> {{getTime(advice.execution_time,'{y}-{m}-{d} {h}:{i}')}} </span> </td>
919
                   </tr>
919
                   </tr>

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

224
               <td style="padding: 0;" colspan="2">
224
               <td style="padding: 0;" colspan="2">
225
                 <table class="inside_table">
225
                 <table class="inside_table">
226
                   <tbody>
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
                     <tr>
228
                     <tr>
229
                       <td width="100">时间</td>
229
                       <td width="100">时间</td>
230
                       <td width="30">T<br>C°</td>
230
                       <td width="30">T<br>C°</td>
328
               <td style="padding: 0;" colspan="2">
328
               <td style="padding: 0;" colspan="2">
329
                 <table class="inside_table">
329
                 <table class="inside_table">
330
                   <tbody>
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
                     <tr>
332
                     <tr>
333
                       <td width="100">时间</td>
333
                       <td width="100">时间</td>
334
                       <td width="30">T<br>C°</td>
334
                       <td width="30">T<br>C°</td>
362
                 </table>
362
                 </table>
363
               </td>
363
               </td>
364
             </tr>
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
             <tr>
366
             <tr>
367
               <td>
367
               <td>
368
                 <div class="row" style="padding: 2px 0;line-height:19px;">
368
                 <div class="row" style="padding: 2px 0;line-height:19px;">

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

10
     <el-row :gutter="20">
10
     <el-row :gutter="20">
11
       <el-col :span="8">
11
       <el-col :span="8">
12
         <el-table
12
         <el-table
13
-          :data="propForm.goodType"
14
-          ref="templatetable"
13
+          :data="propForm.goods"
14
+          ref="table"
15
           border
15
           border
16
           highlight-current-row
16
           highlight-current-row
17
           max-height="250"
17
           max-height="250"
18
+          :row-class-name="tableRows"
19
+          @row-click="onRowClicks"
18
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
20
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
19
           @current-change="goodTypeTableChange"
21
           @current-change="goodTypeTableChange"
20
           style="width: 100%">
22
           style="width: 100%">
21
           <el-table-column
23
           <el-table-column
22
-            prop="type_name"
24
+            align="center"
23
             label="商品类型">
25
             label="商品类型">
26
+            <template slot-scope="scope">
27
+              <span>{{getGoodTypeName(scope.row)}}</span>
28
+            </template>
24
           </el-table-column>
29
           </el-table-column>
25
         </el-table>
30
         </el-table>
26
       </el-col>
31
       </el-col>
32
           max-height="250"
37
           max-height="250"
33
           @row-click="clickRow"
38
           @row-click="clickRow"
34
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
39
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
35
-
40
+          @select="selectGoodInfo"
36
           @selection-change="changeGoodInfoTableData"
41
           @selection-change="changeGoodInfoTableData"
37
           @select-all="changeAllGoodInfoTableData"
42
           @select-all="changeAllGoodInfoTableData"
38
           row-key="row_key"
43
           row-key="row_key"
90
         keywords: '',
95
         keywords: '',
91
         multipleSelection: [],
96
         multipleSelection: [],
92
         currentGoodTypeId: 0,
97
         currentGoodTypeId: 0,
93
-        isClose: false
98
+        isClose: false,
99
+        table_current_index: -1
100
+
94
       }
101
       }
95
     },
102
     },
96
     props: {
103
     props: {
103
       hide:function(){
110
       hide:function(){
104
         this.visibility = false
111
         this.visibility = false
105
         this.goodInfoTableData = []
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
       show:function(){
122
       show:function(){
109
         this.visibility = true
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
       goodTypeTableChange: function(currentRow, oldCurrentRow) {
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
         this.goodInfoTableData = []
140
         this.goodInfoTableData = []
114
         this.goodInfo = []
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
       cancle: function() {
166
       cancle: function() {
126
         this.$emit('dialog-cancle', this.getValue())
167
         this.$emit('dialog-cancle', this.getValue())
127
         this.$refs.multipleTable.clearSelection()
168
         this.$refs.multipleTable.clearSelection()
128
-        this.$refs.templatetable.setCurrentRow(null);
169
+        this.$refs.table.setCurrentRow(null);
129
         this.goodInfoTableData = []
170
         this.goodInfoTableData = []
130
 
171
 
131
       },
172
       },
132
       comfirm: function() {
173
       comfirm: function() {
133
         this.$emit('dialog-comfirm', this.getValue())
174
         this.$emit('dialog-comfirm', this.getValue())
134
         this.$refs.multipleTable.clearSelection()
175
         this.$refs.multipleTable.clearSelection()
135
-        this.$refs.templatetable.setCurrentRow(null);
176
+        this.$refs.table.setCurrentRow(null);
136
         this.goodInfoTableData = []
177
         this.goodInfoTableData = []
137
 
178
 
138
       },
179
       },
139
       getValue: function() {
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
         const obj = {
199
         const obj = {
141
           selectedGoodInfo: this.multipleSelection,
200
           selectedGoodInfo: this.multipleSelection,
142
           goodTypeId: this.currentGoodTypeId
201
           goodTypeId: this.currentGoodTypeId
143
         }
202
         }
203
+
204
+        console.log(obj)
205
+
206
+
144
         return obj
207
         return obj
145
       }, goodTypeSelect: function(id) {
208
       }, goodTypeSelect: function(id) {
146
         this.tempGoodInfo = []
209
         this.tempGoodInfo = []
184
         }
247
         }
185
       }, changeGoodInfoTableData: function(val) {
248
       }, changeGoodInfoTableData: function(val) {
186
         this.multipleSelection = val
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
       },clickRow:function(row) {
264
       },clickRow:function(row) {
190
         this.$refs.multipleTable.toggleRowSelection(row)
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
     <el-row :gutter="20">
10
     <el-row :gutter="20">
11
       <el-col :span="8">
11
       <el-col :span="8">
12
         <el-table
12
         <el-table
13
-          :data="propForm.goodType"
14
-          ref="templatetable"
13
+          :data="propForm.goods"
14
+          ref=""
15
           border
15
           border
16
           highlight-current-row
16
           highlight-current-row
17
           max-height="250"
17
           max-height="250"
18
+          :row-class-name="tableRows"
19
+          @row-click="onRowClicks"
18
           @current-change="goodTypeTableChange"
20
           @current-change="goodTypeTableChange"
19
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
21
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
20
           style="width: 100%">
22
           style="width: 100%">
21
           <el-table-column
23
           <el-table-column
22
             align="center"
24
             align="center"
23
-            prop="type_name"
24
             label="商品类型">
25
             label="商品类型">
26
+            <template slot-scope="scope">
27
+              <span>{{getGoodTypeName(scope.row)}}</span>
28
+            </template>
25
           </el-table-column>
29
           </el-table-column>
26
         </el-table>
30
         </el-table>
27
       </el-col>
31
       </el-col>
33
           max-height="250"
37
           max-height="250"
34
           @row-click="clickRow"
38
           @row-click="clickRow"
35
           @selection-change="changeGoodInfoTableData"
39
           @selection-change="changeGoodInfoTableData"
40
+          @select="selectGoodInfo"
36
           @select-all="changeAllGoodInfoTableData"
41
           @select-all="changeAllGoodInfoTableData"
37
           row-key="row_key"
42
           row-key="row_key"
38
           style="width: 100%"
43
           style="width: 100%"
95
         multipleSelection: [],
100
         multipleSelection: [],
96
         currentGoodTypeId: 0,
101
         currentGoodTypeId: 0,
97
         isClose: false,
102
         isClose: false,
98
-        visibility: false
103
+        visibility: false,
104
+        SelectedDatas: [],
105
+        table_current_index: -1
99
       }
106
       }
100
     },
107
     },
101
     props: {
108
     props: {
106
     methods: {
113
     methods: {
107
       hide: function() {
114
       hide: function() {
108
         this.visibility = false
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
       show: function() {
124
       show: function() {
111
         this.visibility = true
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
       goodTypeTableChange: function(currentRow, oldCurrentRow) {
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
         this.goodInfoTableData = []
141
         this.goodInfoTableData = []
119
         this.goodInfo = []
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
       cancle: function(formName) {
158
       cancle: function(formName) {
133
         this.goodInfo = []
159
         this.goodInfo = []
134
         this.goodInfoTableData = []
160
         this.goodInfoTableData = []
135
         this.$emit('dialog-cancle', this.getValue())
161
         this.$emit('dialog-cancle', this.getValue())
136
         this.$refs.multipleTable.clearSelection()
162
         this.$refs.multipleTable.clearSelection()
137
-        this.$refs.templatetable.setCurrentRow(null)
163
+        this.$refs.table.setCurrentRow(null)
164
+
138
       },
165
       },
139
       comfirm: function(formName) {
166
       comfirm: function(formName) {
140
         this.goodInfo = []
167
         this.goodInfo = []
141
         this.goodInfoTableData = []
168
         this.goodInfoTableData = []
142
         this.$emit('dialog-comfirm', this.getValue())
169
         this.$emit('dialog-comfirm', this.getValue())
143
         this.$refs.multipleTable.clearSelection()
170
         this.$refs.multipleTable.clearSelection()
144
-        this.$refs.templatetable.setCurrentRow(null)
171
+        this.$refs.table.setCurrentRow(null)
145
       },
172
       },
146
       getValue: function() {
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
         const obj = {
186
         const obj = {
148
           selectedGoodInfo: this.multipleSelection,
187
           selectedGoodInfo: this.multipleSelection,
149
-          goodTypeId: this.currentGoodTypeId
150
         }
188
         }
151
         return obj
189
         return obj
152
       }, goodTypeSelect: function(id) {
190
       }, goodTypeSelect: function(id) {
191
           this.goodInfoTableData.push(searchArr[i])
229
           this.goodInfoTableData.push(searchArr[i])
192
         }
230
         }
193
       }, changeGoodInfoTableData: function(val) {
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
       }, clickRow: function(row) {
248
       }, clickRow: function(row) {
198
         this.$refs.multipleTable.toggleRowSelection(row)
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
 </script>
297
 </script>

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

3
   <div class=" sign-and-weigh-box" style="background: white">
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
                       :visibility="goodInfo.goodInfoDialog.isVisibility"
8
                       :visibility="goodInfo.goodInfoDialog.isVisibility"
8
                       :isCreated="goodInfo.goodInfoDialog.isCreated" v-on:dialog-comfirm="goodInfoDialogComfirm"
9
                       :isCreated="goodInfo.goodInfoDialog.isCreated" v-on:dialog-comfirm="goodInfoDialogComfirm"
9
                       v-on:dialog-cancle="goodInfoDialogCancle"></good-info-dailog>
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
     <el-row :gutter="15">
22
     <el-row :gutter="15">
13
       <el-col>
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
                   v-loading="goodInfo.loading"
28
                   v-loading="goodInfo.loading"
22
         >
29
         >
23
-          <el-table-column label="商品编码"  align="center">
30
+          <el-table-column label="商品编码" align="center">
24
             <template slot-scope="scope">
31
             <template slot-scope="scope">
25
               {{scope.row.good_code}}
32
               {{scope.row.good_code}}
26
             </template>
33
             </template>
27
           </el-table-column>
34
           </el-table-column>
28
-          <el-table-column label="规格名称"  align="center">
35
+          <el-table-column label="规格名称" align="center">
29
             <template slot-scope="scope">
36
             <template slot-scope="scope">
30
               {{scope.row.specification_name}}
37
               {{scope.row.specification_name}}
31
 
38
 
33
           </el-table-column>
40
           </el-table-column>
34
 
41
 
35
 
42
 
36
-          <el-table-column label="进价"  align="center" >
43
+          <el-table-column label="进价" align="center">
37
             <template slot-scope="scope" v-if="scope.row.buy_price">
44
             <template slot-scope="scope" v-if="scope.row.buy_price">
38
 
45
 
39
               {{scope.row.buy_price}}
46
               {{scope.row.buy_price}}
40
 
47
 
41
             </template>
48
             </template>
42
           </el-table-column>
49
           </el-table-column>
43
-          <el-table-column label="出货价"  align="center" >
50
+          <el-table-column label="出货价" align="center">
44
             <template slot-scope="scope" v-if="scope.row.sell_price">
51
             <template slot-scope="scope" v-if="scope.row.sell_price">
45
               {{scope.row.sell_price}}
52
               {{scope.row.sell_price}}
46
             </template>
53
             </template>
47
           </el-table-column>
54
           </el-table-column>
48
           <!--<el-table-column label="有效期预警"  align="center">-->
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
           <!--</el-table-column>-->
59
           <!--</el-table-column>-->
53
           <!--<el-table-column label="库存预警" align="center">-->
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
           <!--</el-table-column>-->
64
           <!--</el-table-column>-->
58
-          <el-table-column label="操作" align="center" >
65
+          <el-table-column label="操作" align="center">
59
             <template slot-scope="scope">
66
             <template slot-scope="scope">
60
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
67
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
61
                 <el-button
68
                 <el-button
101
 
108
 
102
 <script>
109
 <script>
103
 
110
 
104
-  import GoodInfoDailog from "../Dialog/goodInfoDailog";
111
+  import GoodInfoDailog from '../Dialog/goodInfoDailog'
105
   import {
112
   import {
106
-    GetAllGoodType,
107
     createGoodInfo,
113
     createGoodInfo,
108
-    modifyGoodInfo,
109
     deleteGoodInfo,
114
     deleteGoodInfo,
110
-    GetGoodInfoByGoodId,
111
-    GetGoodInfo,
112
     GetAllDeals,
115
     GetAllDeals,
116
+    GetAllGoodType,
113
     GetAllManufacturer,
117
     GetAllManufacturer,
114
-    getGoodInfoList
115
-  } from "@/api/stock";
118
+    GetGoodInfo,
119
+    GetGoodInfoByGoodId,
120
+    getGoodInfoList,
121
+    modifyGoodInfo
122
+  } from '@/api/stock'
116
 
123
 
117
   export default {
124
   export default {
118
     components: {
125
     components: {
119
-      GoodInfoDailog,
126
+      GoodInfoDailog
120
     },
127
     },
121
-    name: "goodInfo",
128
+    name: 'goodInfo',
122
     data() {
129
     data() {
123
       return {
130
       return {
124
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
131
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
127
         pageSelect: 0,
134
         pageSelect: 0,
128
         page: 1,
135
         page: 1,
129
         limit: 7,
136
         limit: 7,
130
-
137
+        keywords: '',
131
         goodInfo: {
138
         goodInfo: {
132
           loading: false,
139
           loading: false,
133
           goodInfoData: [],
140
           goodInfoData: [],
152
               dealers: [],
159
               dealers: [],
153
               manufacturers: [],
160
               manufacturers: [],
154
               goodType: [],
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
     methods: {
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
         this.goodInfo.editGoodId = row.id
182
         this.goodInfo.editGoodId = row.id
172
         this.goodInfo.editGoodIndex = index
183
         this.goodInfo.editGoodIndex = index
173
 
184
 
176
         }
187
         }
177
         GetGoodInfo(params).then(response => {
188
         GetGoodInfo(params).then(response => {
178
           if (response.data.state == 0) {
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
           } else {
192
           } else {
182
             console.log(response.data.data.goodInfo)
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
               this.goodInfo.goodInfoDialog.formValue.good_unit = response.data.data.goodInfo.good_unit
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
               this.goodInfo.goodInfoDialog.formValue.manufacturer = response.data.data.goodInfo.manufacturer
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
               this.goodInfo.goodInfoDialog.formValue.dealer = response.data.data.goodInfo.dealer
212
               this.goodInfo.goodInfoDialog.formValue.dealer = response.data.data.goodInfo.dealer
203
 
213
 
204
             }
214
             }
205
 
215
 
206
-
207
-
208
             this.goodInfo.goodInfoDialog.formValue.specification_name = response.data.data.goodInfo.specification_name
216
             this.goodInfo.goodInfoDialog.formValue.specification_name = response.data.data.goodInfo.specification_name
209
             this.goodInfo.goodInfoDialog.formValue.buy_price = response.data.data.goodInfo.buy_price
217
             this.goodInfo.goodInfoDialog.formValue.buy_price = response.data.data.goodInfo.buy_price
210
             this.goodInfo.goodInfoDialog.formValue.sell_price = response.data.data.goodInfo.sell_price
218
             this.goodInfo.goodInfoDialog.formValue.sell_price = response.data.data.goodInfo.sell_price
214
             this.goodInfo.goodInfoDialog.formValue.remark = response.data.data.goodInfo.remark
222
             this.goodInfo.goodInfoDialog.formValue.remark = response.data.data.goodInfo.remark
215
             this.goodInfo.goodInfoDialog.isCreated = 2
223
             this.goodInfo.goodInfoDialog.isCreated = 2
216
             this.goodInfo.good_code = response.data.data.goodInfo.good_code
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
             this.$refs.dialog.show()
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
         this.$confirm('确认删除这条商品信息?', '删除商品信息', {
234
         this.$confirm('确认删除这条商品信息?', '删除商品信息', {
229
           confirmButtonText: '确定',
235
           confirmButtonText: '确定',
236
 
242
 
237
           deleteGoodInfo(params).then(response => {
243
           deleteGoodInfo(params).then(response => {
238
             if (response.data.state == 0) {
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
             } else {
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
         }).catch(() => {
252
         }).catch(() => {
247
-        });
253
+        })
248
 
254
 
249
       },
255
       },
250
-      showGoodInfoDetails: function (index, row) {
256
+      showGoodInfoDetails: function(index, row) {
251
         let params = {
257
         let params = {
252
           id: row.id
258
           id: row.id
253
         }
259
         }
254
         GetGoodInfo(params).then(response => {
260
         GetGoodInfo(params).then(response => {
255
           if (response.data.state == 0) {
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
           } else {
264
           } else {
259
             this.goodInfo.goodInfoDialog.formValue.specification_name = response.data.data.goodInfo.specification_name
265
             this.goodInfo.goodInfoDialog.formValue.specification_name = response.data.data.goodInfo.specification_name
260
             this.goodInfo.goodInfoDialog.formValue.good_unit = response.data.data.goodInfo.good_unit
266
             this.goodInfo.goodInfoDialog.formValue.good_unit = response.data.data.goodInfo.good_unit
270
             this.goodInfo.goodInfoDialog.isCreated = 3
276
             this.goodInfo.goodInfoDialog.isCreated = 3
271
             this.goodInfo.goodInfoDialog.isVisibility = true
277
             this.goodInfo.goodInfoDialog.isVisibility = true
272
           }
278
           }
273
-        });
279
+        })
274
       }, getList() {
280
       }, getList() {
275
         this.goodInfo.loading = true
281
         this.goodInfo.loading = true
276
         let params = {
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
         getGoodInfoList(params).then(response => {
288
         getGoodInfoList(params).then(response => {
281
           if (response.data.state == 0) {
289
           if (response.data.state == 0) {
282
             this.goodInfo.loading = false
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
           } else {
293
           } else {
286
             this.goodInfo.loading = false
294
             this.goodInfo.loading = false
287
             this.total = response.data.data.total
295
             this.total = response.data.data.total
291
 
299
 
292
             }
300
             }
293
           }
301
           }
294
-        });
302
+        })
295
 
303
 
296
-      }, tableRowClassName({row, rowIndex}) {
304
+      }, tableRowClassName({ row, rowIndex }) {
297
         //把每一行的索引放进row
305
         //把每一行的索引放进row
298
-        row.index = rowIndex;
306
+        row.index = rowIndex
299
       },
307
       },
300
       onRowClick(row, event, column) {
308
       onRowClick(row, event, column) {
301
 
309
 
302
         this.goodInfo.goodInfoData = []
310
         this.goodInfo.goodInfoData = []
303
-        this.goodType.tableCurrentIndex = row.index;
311
+        this.goodType.tableCurrentIndex = row.index
304
         this.goodInfo.goodInfoDialog.formValue.good_id = row.id
312
         this.goodInfo.goodInfoDialog.formValue.good_id = row.id
305
         let params = {
313
         let params = {
306
           'id': row.id
314
           'id': row.id
309
         GetGoodInfoByGoodId(params).then(response => {
317
         GetGoodInfoByGoodId(params).then(response => {
310
           if (response.data.state == 0) {
318
           if (response.data.state == 0) {
311
             this.goodInfo.loading = false
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
           } else {
322
           } else {
315
             this.goodInfo.loading = false
323
             this.goodInfo.loading = false
316
             for (let i = 0; i < response.data.data.list.length; i++) {
324
             for (let i = 0; i < response.data.data.list.length; i++) {
317
               this.goodInfo.goodInfoData.push(response.data.data.list[i])
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
         if (val.isCreated == 2) { //修改
332
         if (val.isCreated == 2) { //修改
325
           val['id'] = this.goodInfo.editGoodId
333
           val['id'] = this.goodInfo.editGoodId
327
 
335
 
328
           modifyGoodInfo(val).then(response => {
336
           modifyGoodInfo(val).then(response => {
329
             if (response.data.state == 0) {
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
             } else {
340
             } else {
333
               this.$refs.dialog.hide()
341
               this.$refs.dialog.hide()
334
 
342
 
339
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
347
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
340
               this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()
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
         } else if (val.isCreated == 1) { //新增
355
         } else if (val.isCreated == 1) { //新增
349
           createGoodInfo(val).then(response => {
356
           createGoodInfo(val).then(response => {
350
             if (response.data.state == 0) {
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
             } else {
360
             } else {
354
               this.$refs.dialog.hide()
361
               this.$refs.dialog.hide()
355
 
362
 
356
               this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
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
         this.$refs.dialog.hide()
374
         this.$refs.dialog.hide()
369
 
375
 
370
-
371
-      }, showInfoDialog: function () {
376
+      }, showInfoDialog: function() {
372
         this.$refs.dialog.show()
377
         this.$refs.dialog.show()
373
         this.getAllDealer()
378
         this.getAllDealer()
374
         this.getAllManufacturer()
379
         this.getAllManufacturer()
375
         this.goodInfo.goodInfoDialog.formValue.goodType = []
380
         this.goodInfo.goodInfoDialog.formValue.goodType = []
376
         GetAllGoodType().then(response => {
381
         GetAllGoodType().then(response => {
377
           if (response.data.state == 0) {
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
           } else {
385
           } else {
381
             for (let i = 0; i < response.data.data.goodType.length; i++) {
386
             for (let i = 0; i < response.data.data.goodType.length; i++) {
382
               this.goodInfo.goodInfoDialog.formValue.goodType.push(response.data.data.goodType[i])
387
               this.goodInfo.goodInfoDialog.formValue.goodType.push(response.data.data.goodType[i])
383
             }
388
             }
384
             if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
389
             if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
385
-              this.$message.error("请先新增商品类型");
390
+              this.$message.error('请先新增商品类型')
386
               return
391
               return
387
             } else {
392
             } else {
388
               this.goodInfo.goodInfoDialog.isVisibility = true
393
               this.goodInfo.goodInfoDialog.isVisibility = true
389
               this.goodInfo.goodInfoDialog.isCreated = 1
394
               this.goodInfo.goodInfoDialog.isCreated = 1
390
             }
395
             }
391
           }
396
           }
392
-        });
397
+        })
393
         this.goodInfo.goodInfoDialog.formValue.good_id = ''
398
         this.goodInfo.goodInfoDialog.formValue.good_id = ''
394
         this.goodInfo.goodInfoDialog.formValue.specification_name = ''
399
         this.goodInfo.goodInfoDialog.formValue.specification_name = ''
395
         this.goodInfo.goodInfoDialog.formValue.buy_price = ''
400
         this.goodInfo.goodInfoDialog.formValue.buy_price = ''
402
         this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
407
         this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
403
         this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
408
         this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
404
 
409
 
405
-
406
-      }, getAllDealer: function () {
410
+      }, getAllDealer: function() {
407
         this.goodInfo.goodInfoDialog.formValue.dealers = []
411
         this.goodInfo.goodInfoDialog.formValue.dealers = []
408
         GetAllDeals().then(response => {
412
         GetAllDeals().then(response => {
409
           if (response.data.state == 0) {
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
           } else {
416
           } else {
413
             for (let i = 0; i < response.data.data.dealer.length; i++) {
417
             for (let i = 0; i < response.data.data.dealer.length; i++) {
414
               this.goodInfo.goodInfoDialog.formValue.dealers.push(response.data.data.dealer[i])
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
         this.goodInfo.goodInfoDialog.formValue.manufacturers = []
423
         this.goodInfo.goodInfoDialog.formValue.manufacturers = []
420
         GetAllManufacturer().then(response => {
424
         GetAllManufacturer().then(response => {
421
           if (response.data.state == 0) {
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
           } else {
428
           } else {
425
             for (let i = 0; i < response.data.data.manufacturer.length; i++) {
429
             for (let i = 0; i < response.data.data.manufacturer.length; i++) {
426
               this.goodInfo.goodInfoDialog.formValue.manufacturers.push(response.data.data.manufacturer[i])
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
         this.goodInfo.goodInfoDialog.formValue.goodType = []
435
         this.goodInfo.goodInfoDialog.formValue.goodType = []
432
         GetAllGoodType().then(response => {
436
         GetAllGoodType().then(response => {
433
           if (response.data.state == 0) {
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
           } else {
440
           } else {
437
             for (let i = 0; i < response.data.data.goodType.length; i++) {
441
             for (let i = 0; i < response.data.data.goodType.length; i++) {
438
               this.goodInfo.goodInfoDialog.formValue.goodType.push(response.data.data.goodType[i])
442
               this.goodInfo.goodInfoDialog.formValue.goodType.push(response.data.data.goodType[i])
439
             }
443
             }
440
           }
444
           }
441
-        });
445
+        })
442
       }, handleSizeChange(val) {
446
       }, handleSizeChange(val) {
443
-        this.limit = val;
444
-        this.getList();
447
+        this.limit = val
448
+        this.getList()
445
       }, handleCurrentChange(val) {
449
       }, handleCurrentChange(val) {
446
-        this.page = val;
447
-        this.getList();
450
+        this.page = val
451
+        this.getList()
448
       }
452
       }
449
     },
453
     },
450
     created() {
454
     created() {
455
       this.goodInfo.goodInfoDialog.formValue.goodUnit = this.$store.getters.good_unit
459
       this.goodInfo.goodInfoDialog.formValue.goodUnit = this.$store.getters.good_unit
456
 
460
 
457
     }
461
     }
458
-  };
462
+  }
459
 </script>
463
 </script>
460
 
464
 
461
 <style rel="stylesheet/css" lang="scss" scoped>
465
 <style rel="stylesheet/css" lang="scss" scoped>
463
     border: 1px #dcdfe6 solid;
467
     border: 1px #dcdfe6 solid;
464
     padding: 30px 20px 30px 20px;
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
   .title {
477
   .title {
474
     line-height: 44px;
479
     line-height: 44px;
475
     padding: 0 0 0 10px;
480
     padding: 0 0 0 10px;
476
     margin: 0 0 10px 0;
481
     margin: 0 0 10px 0;
477
-    // border-radius: 4px 4px 0 0;
478
   }
482
   }
479
 
483
 
480
   .edit_separater {
484
   .edit_separater {

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

1
 <template>
1
 <template>
2
 
2
 
3
   <div class=" sign-and-weigh-box" style="background: white">
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
                       :visibility="goodType.goodTypeDialog.isVisibility"
6
                       :visibility="goodType.goodTypeDialog.isVisibility"
6
                       :isCreated="goodType.goodTypeDialog.isCreated" v-on:dialog-comfirm="goodTypeDialogComfirm"
7
                       :isCreated="goodType.goodTypeDialog.isCreated" v-on:dialog-comfirm="goodTypeDialogComfirm"
7
                       v-on:dialog-cancle="goodTypeDialogCancle"></good-type-dialog>
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
     <el-row :gutter="15">
18
     <el-row :gutter="15">
11
       <el-col>
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
         <!--<div class="dataTitle"></div>-->
22
         <!--<div class="dataTitle"></div>-->
18
 
23
 
19
         <div style="margin-bottom: 10px;">
24
         <div style="margin-bottom: 10px;">
20
         </div>
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
                   highlight-current-row
28
                   highlight-current-row
23
                   @row-click="onRowClick"
29
                   @row-click="onRowClick"
24
                   :row-class-name="tableRowClassName"
30
                   :row-class-name="tableRowClassName"
34
               {{scope.row.type_name}}
40
               {{scope.row.type_name}}
35
             </template>
41
             </template>
36
           </el-table-column>
42
           </el-table-column>
37
-          <el-table-column label="操作" align="center" >
43
+          <el-table-column label="操作" align="center">
38
             <template slot-scope="scope">
44
             <template slot-scope="scope">
39
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
45
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
40
                 <el-button
46
                 <el-button
140
 </template>
146
 </template>
141
 
147
 
142
 <script>
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
           let params = {
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
             if (response.data.state == 0) {
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
             } else {
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
         let params = {
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
           if (response.data.state == 0) {
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
           } else {
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
         } else {
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
 </script>
369
 </script>
359
 
370
 
360
 <style rel="stylesheet/css" lang="scss" scoped>
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
   .border {
376
   .border {
366
     border-bottom: 1px #dcdfe6 solid;
377
     border-bottom: 1px #dcdfe6 solid;
367
     margin: 0px 0 20px 0;
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
 </style>
395
 </style>
385
 
396
 
386
 <style>
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
 </style>
406
 </style>

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

1
 <template>
1
 <template>
2
     <div>
2
     <div>
3
+      <el-button style="float: right" size="small" icon="el-icon-printer" @click="PrintAction" type="primary">打印
4
+      </el-button>
3
       <div class="cell clearfix" >
5
       <div class="cell clearfix" >
4
         <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
6
         <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>
7
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
178
       }
180
       }
179
     },
181
     },
180
     methods: {
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
       changeType: function(val) {
194
       changeType: function(val) {
182
         this.order_type = val
195
         this.order_type = val
183
         this.GetCancelStock()
196
         this.GetCancelStock()

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

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

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

1
 <template>
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
     </div>
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
 </template>
129
 </template>
124
 
130
 
125
 <script>
131
 <script>
126
   import { uParseTime } from '@/utils/tools'
132
   import { uParseTime } from '@/utils/tools'
127
   import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
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
   export default {
136
   export default {
131
     name: 'stockInDetail',
137
     name: 'stockInDetail',
161
           { value: 1, label: '耗材入库单' },
167
           { value: 1, label: '耗材入库单' },
162
           { value: 2, label: '其他入库单' }
168
           { value: 2, label: '其他入库单' }
163
         ],
169
         ],
170
+        newDate: [
171
+          { name: '合计', num: '111111' }
172
+
173
+        ],
164
 
174
 
165
         searchKey: '',
175
         searchKey: '',
166
         type: 1,
176
         type: 1,
206
         }
216
         }
207
 
217
 
208
         return name
218
         return name
209
-      },   typeName: function(good_type_id) {
219
+      }, typeName: function(good_type_id) {
210
         let name = ''
220
         let name = ''
211
         for (let i = 0; i < this.goodType.length; i++) {
221
         for (let i = 0; i < this.goodType.length; i++) {
212
           if (this.goodType[i].id == good_type_id) {
222
           if (this.goodType[i].id == good_type_id) {
225
         return name
235
         return name
226
       },
236
       },
227
       search: function() {
237
       search: function() {
238
+
239
+
240
+
241
+
242
+
228
         const Params = {
243
         const Params = {
229
           page: this.page,
244
           page: this.page,
230
           limit: this.limit,
245
           limit: this.limit,
241
           } else {
256
           } else {
242
             this.total = response.data.data.total
257
             this.total = response.data.data.total
243
             for (let i = 0; i < response.data.data.list.length; i++) {
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
       AddNewOrder: function() {
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
       GetCancelStock: function() {
286
       GetCancelStock: function() {
253
         const Params = {
287
         const Params = {
268
           } else {
302
           } else {
269
             this.total = response.data.data.total
303
             this.total = response.data.data.total
270
             for (let i = 0; i < response.data.data.list.length; i++) {
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
       }, getXuserName(id) {
319
       }, getXuserName(id) {
344
           }
388
           }
345
         }
389
         }
346
       }, handleEdit: function(index, row) {
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
       }, handleDelete: function(index, row) {
392
       }, handleDelete: function(index, row) {
349
         const ids = []
393
         const ids = []
350
         ids.push(row.id)
394
         ids.push(row.id)
430
           })
474
           })
431
         }).catch(() => {
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
           m += s1.split('.')[1].length
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
           m += s2.split('.')[1].length
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
 <template>
1
 <template>
2
     <div>
2
     <div>
3
+      <el-button style="float: right" size="small" icon="el-icon-printer" @click="PrintAction" type="primary">打印
4
+      </el-button>
3
       <div class="cell clearfix" >
5
       <div class="cell clearfix" >
4
         <el-input size="small" style="width: 400px;" class="filter-item" v-model="searchKey" placeholder="单据编码/制单人/规格名称"/>
6
         <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>
7
         <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
83
 
85
 
84
           <el-table-column label="操作时间" align="center">
86
           <el-table-column label="操作时间" align="center">
85
             <template slot-scope="scope">
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
             </template>
91
             </template>
88
           </el-table-column>
92
           </el-table-column>
89
           <el-table-column label="制单人" align="center">
93
           <el-table-column label="制单人" align="center">
104
           </el-table-column>
108
           </el-table-column>
105
           <el-table-column label="总价" align="center">
109
           <el-table-column label="总价" align="center">
106
             <template slot-scope="scope">
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
             </template>
113
             </template>
110
           </el-table-column>
114
           </el-table-column>
111
 
115
 
245
           } else {
249
           } else {
246
             this.total = response.data.data.total
250
             this.total = response.data.data.total
247
             for (let i = 0; i < response.data.data.list.length; i++) {
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
           } else {
286
           } else {
273
             this.total = response.data.data.total
287
             this.total = response.data.data.total
274
             for (let i = 0; i < response.data.data.list.length; i++) {
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
       }, getXuserName(id) {
304
       }, getXuserName(id) {
450
         r1 = Number(price.toString().replace(".",""));
475
         r1 = Number(price.toString().replace(".",""));
451
         r2 = Number(total.toString().replace(".",""));
476
         r2 = Number(total.toString().replace(".",""));
452
         return r1 * r2 / Math.pow(10,m);
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
         // prop
178
         // prop
179
         isVisibility: false,
179
         isVisibility: false,
180
         propForm: {
180
         propForm: {
181
+          goods:[],
181
           goodType: [],
182
           goodType: [],
182
           goodInfo: [],
183
           goodInfo: [],
183
           goodUnit: [],
184
           goodUnit: [],
194
         salesReturn: {},
195
         salesReturn: {},
195
         manufacturer: [],
196
         manufacturer: [],
196
         dealer: [],
197
         dealer: [],
197
-        goodType: []
198
+        goodType: [],
199
+        goodInfo:[]
198
       }
200
       }
199
     },
201
     },
200
     methods: {
202
     methods: {
201
       comfirm: function(val) {
203
       comfirm: function(val) {
202
         this.$refs.dialog.hide()
204
         this.$refs.dialog.hide()
203
-
204
         if (val.selectedGoodInfo.length > 0) {
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
             if (i == 0) {
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
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
209
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
209
             } else {
210
             } else {
210
               const tempForm = {}
211
               const tempForm = {}
211
               tempForm['id'] = 0
212
               tempForm['id'] = 0
212
-              tempForm['good_type_id'] = val.goodTypeId
213
+              tempForm['good_type_id'] = val.selectedGoodInfo[i].good_type_id
213
               tempForm['good_id'] = val.selectedGoodInfo[i].id
214
               tempForm['good_id'] = val.selectedGoodInfo[i].id
214
-              tempForm['count'] = ''
215
+              tempForm['return_count'] = ''
216
+              tempForm['price'] = ''
215
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
217
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
216
             }
218
             }
217
           }
219
           }
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
             const obj = {}
268
             const obj = {}
262
             const obj2 = {}
269
             const obj2 = {}
263
             const obj3 = {}
270
             const obj3 = {}
297
         return name
304
         return name
298
       }, specificationName: function(good_info_id) {
305
       }, specificationName: function(good_info_id) {
299
         let name = ''
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
         return name
312
         return name
311
         tempObj['count'] = ''
318
         tempObj['count'] = ''
312
         this.recordInfo.recordData.push(tempObj)
319
         this.recordInfo.recordData.push(tempObj)
313
       }, handleDelete: function(index, row) {
320
       }, handleDelete: function(index, row) {
314
-        if (row.id == 0) {
321
+        console.log(row.id)
322
+        if (row.id == undefined || row.id == 0) {
315
           this.recordInfo.recordData.splice(index, 1)
323
           this.recordInfo.recordData.splice(index, 1)
316
         } else {
324
         } else {
317
           const params = {
325
           const params = {
343
       }, showDialog(index, row) {
351
       }, showDialog(index, row) {
344
         this.currentIndex = index
352
         this.currentIndex = index
345
         this.propForm.goodType = []
353
         this.propForm.goodType = []
354
+        this.propForm.goods = []
355
+
346
 
356
 
347
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
357
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
348
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
358
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
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
         // if (this.form.manufacturer == 0 && this.form.dealer == 0) {
480
         // if (this.form.manufacturer == 0 && this.form.dealer == 0) {
444
         //   for (let i = 0; i < this.warehouseInfoList.length; i++) {
481
         //   for (let i = 0; i < this.warehouseInfoList.length; i++) {
445
         //     this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
482
         //     this.propForm.goodType.push(this.warehouseInfoList[i].info.type)

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

177
         // prop
177
         // prop
178
         isVisibility: false,
178
         isVisibility: false,
179
         propForm: {
179
         propForm: {
180
+          goods:[],
180
           goodType: [],
181
           goodType: [],
181
           goodInfo: [],
182
           goodInfo: [],
182
           goodUnit: [],
183
           goodUnit: [],
197
       comfirm: function(val) {
198
       comfirm: function(val) {
198
         this.$refs.dialog.hide()
199
         this.$refs.dialog.hide()
199
         if (val.selectedGoodInfo.length > 0) {
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
         this.propForm.goodType = []
215
         this.propForm.goodType = []
321
       }, showDialog(index, row) {
322
       }, showDialog(index, row) {
322
         this.currentIndex = index
323
         this.currentIndex = index
323
         this.propForm.goodType = []
324
         this.propForm.goodType = []
325
+        this.propForm.goods = []
326
+
324
         //根据选择经销商和厂商过滤商品类型
327
         //根据选择经销商和厂商过滤商品类型
325
 
328
 
326
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
329
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
418
           return cur
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
         this.$refs.dialog.show()
455
         this.$refs.dialog.show()
422
       }, back() {
456
       }, back() {
423
         this.$router.go(-1)
457
         this.$router.go(-1)
480
       tempObj['return_count'] = ''
514
       tempObj['return_count'] = ''
481
       tempObj['price'] = ''
515
       tempObj['price'] = ''
482
       this.recordInfo.recordData.push(tempObj)
516
       this.recordInfo.recordData.push(tempObj)
517
+      console.log(this.recordInfo.recordData)
483
       this.GetConfigInfo()
518
       this.GetConfigInfo()
484
       this.propForm.goodUnit = this.$store.getters.good_unit
519
       this.propForm.goodUnit = this.$store.getters.good_unit
485
     }
520
     }

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

264
         // prop
264
         // prop
265
         isVisibility: false,
265
         isVisibility: false,
266
         propForm: {
266
         propForm: {
267
+          goods: [],
267
           goodType: [],
268
           goodType: [],
268
           goodInfo: [],
269
           goodInfo: [],
269
           goodUnit: [],
270
           goodUnit: [],
340
         this.isVisibility = true
341
         this.isVisibility = true
341
       }, comfirm: function(val) {
342
       }, comfirm: function(val) {
342
         this.propForm.goodType = []
343
         this.propForm.goodType = []
344
+        this.propForm.goods = []
345
+
343
         this.$refs.dialog.hide()
346
         this.$refs.dialog.hide()
344
         console.log(val)
347
         console.log(val)
345
         if (val.selectedGoodInfo.length > 0) {
348
         if (val.selectedGoodInfo.length > 0) {
346
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
349
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
347
             if (i == 0) {
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
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
352
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
350
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
353
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
351
 
354
 
352
             } else {
355
             } else {
353
               const tempForm = {}
356
               const tempForm = {}
354
-              tempForm['good_type_id'] = val.goodTypeId
357
+              tempForm['good_type_id'] =val.selectedGoodInfo[i].good_type_id
355
               tempForm['good_id'] = val.selectedGoodInfo[i].id
358
               tempForm['good_id'] = val.selectedGoodInfo[i].id
356
               tempForm['number'] = ''
359
               tempForm['number'] = ''
357
               tempForm['product_date'] = ''
360
               tempForm['product_date'] = ''
361
               tempForm['remark'] = ''
364
               tempForm['remark'] = ''
362
               tempForm['dealer'] = ''
365
               tempForm['dealer'] = ''
363
               tempForm['manufacturer'] = ''
366
               tempForm['manufacturer'] = ''
364
-              // this.recordInfo.recordData.add(tempForm,this.currentIndex + i)
365
-              // this.recordInfo.recordData.push(tempForm)
366
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
367
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
367
             }
368
             }
368
           }
369
           }
371
         this.currentIndex = -1
372
         this.currentIndex = -1
372
       }, cancle: function() {
373
       }, cancle: function() {
373
         this.propForm.goodType = []
374
         this.propForm.goodType = []
375
+        this.propForm.goods = []
374
         this.$refs.dialog.hide()
376
         this.$refs.dialog.hide()
375
       }, GetAllGoodType: function() {
377
       }, GetAllGoodType: function() {
376
         GetAllGoodType().then(response => {
378
         GetAllGoodType().then(response => {
517
               }, []) // 设置cur默认类型为数组,并且初始值为空的数组
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
       ,
611
       ,
589
       changeManufacturer(val) {
612
       changeManufacturer(val) {
590
 
613
 
591
-
592
       }, changeDealer(val) {
614
       }, changeDealer(val) {
593
 
615
 
594
       }
616
       }

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

265
         // prop
265
         // prop
266
         isVisibility: false,
266
         isVisibility: false,
267
         propForm: {
267
         propForm: {
268
+          goods: [],
268
           goodType: [],
269
           goodType: [],
269
           goodInfo: [],
270
           goodInfo: [],
270
           goodUnit: [],
271
           goodUnit: [],
288
       comfirm: function(val) {
289
       comfirm: function(val) {
289
         this.$refs.dialog.hide()
290
         this.$refs.dialog.hide()
290
         this.propForm.goodType = []
291
         this.propForm.goodType = []
292
+        this.propForm.goods = []
291
 
293
 
292
         if (val.selectedGoodInfo.length > 0) {
294
         if (val.selectedGoodInfo.length > 0) {
293
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
295
           for (let i = val.selectedGoodInfo.length - 1; ;i--) {
294
             if (i == 0) {
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
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
298
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
297
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
299
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
298
 
300
 
299
             } else {
301
             } else {
300
               const tempForm = {}
302
               const tempForm = {}
301
               tempForm['id'] = 0
303
               tempForm['id'] = 0
302
-              tempForm['good_type_id'] = val.goodTypeId
304
+              tempForm['good_type_id'] = val.selectedGoodInfo[i].good_type_id
303
               tempForm['good_id'] = val.selectedGoodInfo[i].id
305
               tempForm['good_id'] = val.selectedGoodInfo[i].id
304
               tempForm['number'] = ''
306
               tempForm['number'] = ''
305
               tempForm['product_date'] = ''
307
               tempForm['product_date'] = ''
317
         this.currentIndex = -1
319
         this.currentIndex = -1
318
       }, cancle: function() {
320
       }, cancle: function() {
319
         this.$refs.dialog.hide()
321
         this.$refs.dialog.hide()
322
+        this.propForm.goods = []
323
+
320
         this.propForm.goodType = []
324
         this.propForm.goodType = []
321
 
325
 
322
       }, GetConfigInfo: function() {
326
       }, GetConfigInfo: function() {
439
                 return cur
443
                 return cur
440
               }, []) // 设置cur默认类型为数组,并且初始值为空的数组
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
         // prop
207
         // prop
208
         isVisibility: false,
208
         isVisibility: false,
209
         propForm: {
209
         propForm: {
210
+          goods:[],
210
           goodType: [],
211
           goodType: [],
211
           goodInfo: [],
212
           goodInfo: [],
212
           goodUnit: [],
213
           goodUnit: [],
228
         this.$refs.dialog.hide()
229
         this.$refs.dialog.hide()
229
         this.propForm.goodType = []
230
         this.propForm.goodType = []
230
         if (val.selectedGoodInfo.length > 0) {
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
             if (i == 0) {
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
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
235
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
235
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
236
               this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
236
             } else {
237
             } else {
238
+              console.log(val.selectedGoodInfo[i].buy_price.toString())
237
               const tempForm = {}
239
               const tempForm = {}
238
-              tempForm['good_type_id'] = val.goodTypeId
240
+              tempForm['good_type_id'] =val.selectedGoodInfo[i].good_type_id
239
               tempForm['good_id'] = val.selectedGoodInfo[i].id
241
               tempForm['good_id'] = val.selectedGoodInfo[i].id
240
               tempForm['count'] = ''
242
               tempForm['count'] = ''
241
-              tempForm['price'] = val.selectedGoodInfo[i].buy_price
243
+              tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
242
               tempForm['remark'] = ''
244
               tempForm['remark'] = ''
243
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
245
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
244
             }
246
             }
357
       }, showDialog(index, row) {
359
       }, showDialog(index, row) {
358
         this.currentIndex = index
360
         this.currentIndex = index
359
         this.propForm.goodType = []
361
         this.propForm.goodType = []
362
+        this.propForm.goods = []
363
+
364
+
365
+
360
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
366
         if (this.form.manufacturer == -1 && this.form.dealer == -1) {
361
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
367
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
362
             if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == 0) {
368
             if (this.warehouseInfoList[i].info.dealers.id == 0 && this.warehouseInfoList[i].info.manufacturers.id == 0) {
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
         this.$refs.dialog.show()
487
         this.$refs.dialog.show()
495
 
488
 
496
       }, back() {
489
       }, back() {

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

207
         // prop
207
         // prop
208
         isVisibility: false,
208
         isVisibility: false,
209
         propForm: {
209
         propForm: {
210
+          goods:[],
210
           goodType: [],
211
           goodType: [],
211
           goodInfo: [],
212
           goodInfo: [],
212
           goodUnit: [],
213
           goodUnit: [],
231
         this.$refs.dialog.hide()
232
         this.$refs.dialog.hide()
232
 
233
 
233
         if (val.selectedGoodInfo.length > 0) {
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
             if (i == 0) {
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
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
238
               this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
239
+
238
             } else {
240
             } else {
239
               const tempForm = {}
241
               const tempForm = {}
240
               tempForm['id'] = 0
242
               tempForm['id'] = 0
241
-              tempForm['good_type_id'] = val.goodTypeId
243
+              tempForm['good_type_id'] = val.selectedGoodInfo[i].good_type_id
242
               tempForm['good_id'] = val.selectedGoodInfo[i].id
244
               tempForm['good_id'] = val.selectedGoodInfo[i].id
243
               tempForm['count'] = ''
245
               tempForm['count'] = ''
244
-              tempForm['price'] = ''
246
+              tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
247
+
245
               tempForm['remark'] = ''
248
               tempForm['remark'] = ''
246
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
249
               this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
247
             }
250
             }
375
       }, showDialog(index, row) {
378
       }, showDialog(index, row) {
376
         this.currentIndex = index
379
         this.currentIndex = index
377
         this.propForm.goodType = []
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
         if (this.form.manufacturer == 0 && this.form.dealer == 0) {
411
         if (this.form.manufacturer == 0 && this.form.dealer == 0) {
379
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
412
           for (let i = 0; i < this.warehouseInfoList.length; i++) {
380
             this.propForm.goodType.push(this.warehouseInfoList[i].info.type)
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
           this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
469
           this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
411
             obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
470
             obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
412
             return cur
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
         this.$refs.dialog.show()
501
         this.$refs.dialog.show()
416
 
502
 

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

1
 <template>
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
                 v-loading="WarehouseInfo.loading"
17
                 v-loading="WarehouseInfo.loading"
10
       >
18
       >
11
 
19
 
24
             <span>{{scope.row.specification_name}}</span>
32
             <span>{{scope.row.specification_name}}</span>
25
           </template>
33
           </template>
26
         </el-table-column>
34
         </el-table-column>
27
-        <el-table-column label="入库数量" align="center" >
35
+        <el-table-column label="入库数量" align="center">
28
           <template slot-scope="scope">
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
           </template>
39
           </template>
31
         </el-table-column>
40
         </el-table-column>
32
         <el-table-column label="入库退货" align="center">
41
         <el-table-column label="入库退货" align="center">
33
           <template slot-scope="scope">
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
           </template>
46
           </template>
37
         </el-table-column>
47
         </el-table-column>
48
         </el-table-column>
58
         </el-table-column>
49
         <el-table-column label="出库退库" align="center">
59
         <el-table-column label="出库退库" align="center">
50
           <template slot-scope="scope">
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
           </template>
64
           </template>
54
         </el-table-column>
65
         </el-table-column>
59
         </el-table-column>
70
         </el-table-column>
60
 
71
 
61
         <el-table-column label="剩余库存" align="center">
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
           </template>
75
           </template>
65
         </el-table-column>
76
         </el-table-column>
66
       </el-table>
77
       </el-table>
75
         layout="total, sizes, prev, pager, next, jumper"
86
         layout="total, sizes, prev, pager, next, jumper"
76
         :total="total">
87
         :total="total">
77
       </el-pagination>
88
       </el-pagination>
78
-  </div>
89
+    </div>
79
   </div>
90
   </div>
80
 
91
 
81
 </template>
92
 </template>
82
 
93
 
83
 <script>
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
   export default {
99
   export default {
93
-    name: "stockIn",
100
+    name: 'stockIn',
94
     created() {
101
     created() {
95
       this.GetAllStockQuery()
102
       this.GetAllStockQuery()
96
       this.GetAllGoodInfo()
103
       this.GetAllGoodInfo()
97
       this.GetAllGoodType()
104
       this.GetAllGoodType()
98
     },
105
     },
99
-    components:{
106
+    components: {
100
       BreadCrumb
107
       BreadCrumb
101
     },
108
     },
102
     data() {
109
     data() {
103
       return {
110
       return {
104
         crumbs: [
111
         crumbs: [
105
           { path: false, name: '库存管理' },
112
           { path: false, name: '库存管理' },
106
-          { path: '/stock/query', name: '库存查询' },
113
+          { path: '/stock/query', name: '库存查询' }
107
         ],
114
         ],
108
-
115
+        keywords:'',
109
         total: 0,
116
         total: 0,
110
         multipleSelection: [],
117
         multipleSelection: [],
111
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
118
         signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
117
         goodInfo: [],
124
         goodInfo: [],
118
         WarehouseInfo: {
125
         WarehouseInfo: {
119
           loading: false,
126
           loading: false,
120
-          warehouseInfoDate: [],
127
+          warehouseInfoDate: []
121
         }
128
         }
122
-      };
129
+      }
123
     },
130
     },
124
     methods: {
131
     methods: {
125
-      GetAllStockQuery: function () {
132
+      GetAllStockQuery: function() {
133
+        console.log(this.keywords)
126
         let Params = {
134
         let Params = {
127
           page: this.page,
135
           page: this.page,
128
           limit: this.limit,
136
           limit: this.limit,
137
+          keyword:this.keywords
129
         }
138
         }
130
         this.WarehouseInfo.loading = true
139
         this.WarehouseInfo.loading = true
131
-
132
         this.WarehouseInfo.warehouseInfoDate = []
140
         this.WarehouseInfo.warehouseInfoDate = []
133
         getAllStockQueryList(Params).then(response => {
141
         getAllStockQueryList(Params).then(response => {
134
           if (response.data.state == 0) {
142
           if (response.data.state == 0) {
135
             this.WarehouseInfo.loading = false
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
           } else {
146
           } else {
139
             this.WarehouseInfo.loading = false
147
             this.WarehouseInfo.loading = false
140
             this.total = response.data.data.total
148
             this.total = response.data.data.total
141
             for (let i = 0; i < response.data.data.list.length; i++) {
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
                 this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
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
         let name = ''
159
         let name = ''
152
         for (let i = 0; i < this.goodInfo.length; i++) {
160
         for (let i = 0; i < this.goodInfo.length; i++) {
153
           if (this.goodInfo[i].id == id) {
161
           if (this.goodInfo[i].id == id) {
155
           }
163
           }
156
         }
164
         }
157
         return name
165
         return name
158
-      }, getTypeName: function (id) {
166
+      }, getTypeName: function(id) {
159
         let name = ''
167
         let name = ''
160
         for (let i = 0; i < this.goodType.length; i++) {
168
         for (let i = 0; i < this.goodType.length; i++) {
161
           if (this.goodType[i].id == id) {
169
           if (this.goodType[i].id == id) {
163
           }
171
           }
164
         }
172
         }
165
         return name
173
         return name
166
-      }, GetAllGoodType: function () {
174
+      }, GetAllGoodType: function() {
167
         GetAllGoodType().then(response => {
175
         GetAllGoodType().then(response => {
168
           if (response.data.state == 0) {
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
           } else {
179
           } else {
172
             for (let i = 0; i < response.data.data.goodType.length; i++) {
180
             for (let i = 0; i < response.data.data.goodType.length; i++) {
173
               this.goodType.push(response.data.data.goodType[i])
181
               this.goodType.push(response.data.data.goodType[i])
174
             }
182
             }
175
           }
183
           }
176
-        });
177
-      }, GetAllGoodInfo: function () {
184
+        })
185
+      }, GetAllGoodInfo: function() {
178
         GetAllGoodInfo().then(response => {
186
         GetAllGoodInfo().then(response => {
179
           if (response.data.state == 0) {
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
           } else {
190
           } else {
183
             for (let i = 0; i < response.data.data.goodInfo.length; i++) {
191
             for (let i = 0; i < response.data.data.goodInfo.length; i++) {
184
               this.goodInfo.push(response.data.data.goodInfo[i])
192
               this.goodInfo.push(response.data.data.goodInfo[i])
185
             }
193
             }
186
           }
194
           }
187
-        });
188
-      }, handleBack: function () {
195
+        })
196
+      }, handleBack: function() {
189
         this.$router.go(-1)
197
         this.$router.go(-1)
190
       }, handleSizeChange(val) {
198
       }, handleSizeChange(val) {
191
-        this.limit = val;
192
-        this.GetAllStockQuery();
199
+        this.limit = val
200
+        this.GetAllStockQuery()
193
       }, handleCurrentChange(val) {
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
         return Math.round(parseFloat(val) * 100) / 100
205
         return Math.round(parseFloat(val) * 100) / 100
198
-      }, startTimeChange: function () {
206
+      }, startTimeChange: function() {
199
         this.GetAllStockQuery()
207
         this.GetAllStockQuery()
200
-      }, endTimeChange: function () {
208
+      }, endTimeChange: function() {
201
         this.GetAllStockQuery()
209
         this.GetAllStockQuery()
202
 
210
 
203
-      },stockInCount:function (row) {
211
+      }, stockInCount: function(row) {
204
         let total = 0
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
         return total
216
         return total
209
 
217
 
210
-      },salesReturnCount:function (row) {
218
+      }, salesReturnCount: function(row) {
211
         let total = 0
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
           total = total + row.query_sales_return_info[i].count
221
           total = total + row.query_sales_return_info[i].count
214
         }
222
         }
215
         return total
223
         return total
216
 
224
 
217
-      },stockOutCount:function (row) {
225
+      }, stockOutCount: function(row) {
218
         let total = 0
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
         return total
230
         return total
223
 
231
 
224
-      },cancelStockCount:function (row) {
232
+      }, cancelStockCount: function(row) {
225
         let total = 0
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
         return total
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
 </script>
251
 </script>
246
 
252
 
247
 <style rel="stylesheet/css" lang="scss" scoped>
253
 <style rel="stylesheet/css" lang="scss" scoped>
249
     border: 1px #dcdfe6 solid;
255
     border: 1px #dcdfe6 solid;
250
     padding: 30px 20px 30px 20px;
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
   .title {
265
   .title {
262
     padding: 0 0 0 10px;
269
     padding: 0 0 0 10px;
263
     color: #fff;
270
     color: #fff;
264
     margin: 0 0 10px 0;
271
     margin: 0 0 10px 0;
265
-    // border-radius: 4px 4px 0 0;
266
   }
272
   }
267
 
273
 
268
   .edit_separater {
274
   .edit_separater {