Browse Source

自备药

XMLWAN 4 years ago
parent
commit
ed6c59d2f7

+ 17 - 1
src/lang/zh.js View File

@@ -75,6 +75,7 @@ export default {
75 75
     dialysisPrintOrder: '打印透析单',
76 76
     details: '透析',
77 77
     data_dictionary: '数据字典',
78
+    specialDictionary: '专项字典',
78 79
     field_config: '字段配置',
79 80
     template: '模版配置',
80 81
     druguse: '医嘱模版',
@@ -148,7 +149,22 @@ export default {
148 149
     RescueRecord: '抢救记录',
149 150
     special_permission_manage: '特殊权限管理',
150 151
     schedule_print: '排班打印',
151
-
152
+    
153
+    drugsExpiryDate:'药品有效期预警',
154
+    drugsSurplus:'药品剩余预警',
155
+    drugsQuery:'明细查询',
156
+    drugsReportLoss:'药品报损',
157
+    drugsAdjustPrice:'药品调价',
158
+    drugsStockCancel:'退库单',
159
+    drugsStockReturn:'退货单',
160
+    drugsStockOut:'出库单',
161
+    drugsStockIn:'入库单',
162
+    stockDrugs:'药品管理',
163
+    selfPreparedMedicineInfo:'自备药信息',
164
+    selfPreparedMedicineQuery:'自备药查询',
165
+    selfPreparedMedicineIndex:'自备药管理',
166
+    selfPreparedMedicine:'自备药管理',
167
+    consumablesManagement:'耗材管理',
152 168
     warehouseReceipt: '耗材出入库',
153 169
     warehouseReceiptOther: '其他出入库',
154 170
     stockInOrder: '耗材入库单',

+ 157 - 22
src/router/modules/stock.js View File

@@ -13,29 +13,15 @@ export default {
13 13
   },
14 14
   children: [
15 15
     {
16
-      path: '/stock/warehouseReceipt/',
16
+      path: '/stock/consumablesManagement',
17 17
       component: Layout,
18 18
       redirect: '/stock/in',
19
-      name: 'warehouseReceipt',
19
+      name: 'consumablesManagement',
20 20
       parentNum: 1,
21 21
       meta: {
22 22
         isChild: true,
23
-        title: 'warehouseReceipt',
23
+        title: 'consumablesManagement',
24 24
         noCache: true
25
-
26
-      }
27
-    },
28
-    {
29
-      path: '/stock/warehouseReceiptOther/',
30
-      component: Layout,
31
-      redirect: '/stock/in/other',
32
-      name: 'warehouseReceiptOther',
33
-      parentNum: 2,
34
-      meta: {
35
-        isChild: true,
36
-        title: 'warehouseReceiptOther',
37
-        noCache: true
38
-
39 25
       }
40 26
     },
41 27
     {
@@ -80,7 +66,7 @@ export default {
80 66
       name: 'otherStockInOrder',
81 67
       hidden: true,
82 68
       is_menu: false,
83
-      num: 2,
69
+      num: 1,
84 70
       meta: { title: 'otherStockInOrder', noCache: true }
85 71
     },
86 72
     {
@@ -89,7 +75,7 @@ export default {
89 75
       name: 'otherSalesReturnOrder',
90 76
       hidden: true,
91 77
       is_menu: false,
92
-      num: 2,
78
+      num: 1,
93 79
       meta: { title: 'otherSalesReturnOrder', noCache: true }
94 80
     },
95 81
     {
@@ -98,7 +84,7 @@ export default {
98 84
       name: 'otherStockOutOrder',
99 85
       hidden: true,
100 86
       is_menu: false,
101
-      num: 2,
87
+      num: 1,
102 88
       meta: { title: 'otherStockOutOrder', noCache: true }
103 89
     },
104 90
     {
@@ -107,7 +93,7 @@ export default {
107 93
       name: 'otherCancelStockOrder',
108 94
       hidden: true,
109 95
       is_menu: false,
110
-      num: 2,
96
+      num: 1,
111 97
       meta: { title: 'otherCancelStockOrder', noCache: true }
112 98
     },
113 99
     // {
@@ -164,12 +150,18 @@ export default {
164 150
       path: '/stock/query',
165 151
       component: () => import('@/xt_pages/stock/stockQuery'),
166 152
       name: 'stockQuery',
153
+      hidden: true,
154
+      is_menu: false,
155
+      num: 1,
167 156
       meta: { title: 'stockQuery', noCache: true }
168 157
     },
169 158
     {
170 159
       path: '/stock/detail',
171 160
       component: () => import('@/xt_pages/stock/stockDetailIndex'),
172 161
       name: 'stockDetail',
162
+      hidden: true,
163
+      is_menu: false,
164
+      num: 1,
173 165
       meta: { title: 'stockDetail', noCache: true }
174 166
     },
175 167
     {
@@ -240,6 +232,9 @@ export default {
240 232
       path: '/stock/config',
241 233
       component: () => import('@/xt_pages/stock/index'),
242 234
       name: 'config',
235
+      hidden: true,
236
+      is_menu: false,
237
+      num: 1,
243 238
       meta: { title: 'config', noCache: true }
244 239
     },
245 240
     {
@@ -260,6 +255,146 @@ export default {
260 255
       hidden: true,
261 256
       is_menu: false,
262 257
       meta: { title: 'user_detail', noCache: true }
263
-    }
258
+    },
259
+    {
260
+      path: '/stock/selfPreparedMedicine',
261
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/index'),
262
+      redirect: '/stock/selfPreparedMedicineIndex',
263
+      name: 'selfPreparedMedicine',
264
+      parentNum: 2,
265
+      meta: {
266
+        isChild: true,
267
+        title: 'selfPreparedMedicine',
268
+        noCache: true
269
+      }
270
+    },
271
+    {
272
+      path: '/stock/selfPreparedMedicineIndex',
273
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/index'),
274
+      name: 'selfPreparedMedicineIndex',
275
+      hidden: true,
276
+      is_menu: false,
277
+      num: 2,
278
+      meta: { title: 'selfPreparedMedicineIndex', noCache: true }
279
+    },
280
+    {
281
+      path: '/stock/selfPreparedMedicineQuery',
282
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/query'),
283
+      name: 'selfPreparedMedicineQuery',
284
+      hidden: true,
285
+      is_menu: false,
286
+      num: 2,
287
+      meta: { title: 'selfPreparedMedicineQuery', noCache: true }
288
+    },
289
+    {
290
+      path: '/stock/selfPreparedMedicineQueryPrint',
291
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/queryPrint'),
292
+      name: 'selfPreparedMedicineQueryPrint',
293
+      hidden: true,
294
+      is_menu: false,
295
+      meta: { title: 'selfPreparedMedicineQueryPrint', noCache: true }
296
+    },
297
+    {
298
+      path: '/stock/selfPreparedMedicineInfo',
299
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/info'),
300
+      name: 'selfPreparedMedicineInfo',
301
+      hidden: true,
302
+      is_menu: false,
303
+      num: 2,
304
+      meta: { title: 'selfPreparedMedicineInfo', noCache: true }
305
+    },
306
+    {
307
+      path: '/stock/drugs',
308
+      component: Layout,
309
+      redirect: '/stock/drugs/stock/in',
310
+      name: 'stockDrugs',
311
+      parentNum: 3,
312
+      meta: {
313
+        isChild: true,
314
+        title: 'stockDrugs',
315
+        noCache: true
316
+      }
317
+    },
318
+    {
319
+      path: '/stock/drugs/stock/in',
320
+      component: () => import('@/xt_pages/stock/drugs/stockIn'),
321
+      name: 'drugsStockIn',
322
+      hidden: true,
323
+      is_menu: false,
324
+      num: 3,
325
+      meta: { title: 'drugsStockIn', noCache: true }
326
+    },
327
+    {
328
+      path: '/stock/drugs/stock/out',
329
+      component: () => import('@/xt_pages/stock/drugs/stockOut'),
330
+      name: 'drugsStockOut',
331
+      hidden: true,
332
+      is_menu: false,
333
+      num: 3,
334
+      meta: { title: 'drugsStockOut', noCache: true }
335
+    },
336
+    {
337
+      path: '/stock/drugs/stock/return',
338
+      component: () => import('@/xt_pages/stock/drugs/stockReturn'),
339
+      name: 'drugsStockReturn',
340
+      hidden: true,
341
+      is_menu: false,
342
+      num: 3,
343
+      meta: { title: 'drugsStockReturn', noCache: true }
344
+    },
345
+    {
346
+      path: '/stock/drugs/stock/cancel',
347
+      component: () => import('@/xt_pages/stock/drugs/stockCancel'),
348
+      name: 'drugsStockCancel',
349
+      hidden: true,
350
+      is_menu: false,
351
+      num: 3,
352
+      meta: { title: 'drugsStockCancel', noCache: true }
353
+    },
354
+    {
355
+      path: '/stock/drugs/stock/adjustPrice',
356
+      component: () => import('@/xt_pages/stock/drugs/adjustPrice'),
357
+      name: 'drugsAdjustPrice',
358
+      hidden: true,
359
+      is_menu: false,
360
+      num: 3,
361
+      meta: { title: 'drugsAdjustPrice', noCache: true }
362
+    },
363
+    {
364
+      path: '/stock/drugs/stock/reportLoss',
365
+      component: () => import('@/xt_pages/stock/drugs/reportLoss'),
366
+      name: 'drugsReportLoss',
367
+      hidden: true,
368
+      is_menu: false,
369
+      num: 3,
370
+      meta: { title: 'drugsReportLoss', noCache: true }
371
+    },
372
+    {
373
+      path: '/stock/drugs/stock/query',
374
+      component: () => import('@/xt_pages/stock/drugs/query'),
375
+      name: 'drugsQuery',
376
+      hidden: true,
377
+      is_menu: false,
378
+      num: 3,
379
+      meta: { title: 'drugsQuery', noCache: true }
380
+    },
381
+    {
382
+      path: '/stock/drugs/stock/drugsSurplus',
383
+      component: () => import('@/xt_pages/stock/drugs/drugsSurplus'),
384
+      name: 'drugsSurplus',
385
+      hidden: true,
386
+      is_menu: false,
387
+      num: 3,
388
+      meta: { title: 'drugsSurplus', noCache: true }
389
+    },
390
+    {
391
+      path: '/stock/drugs/stock/drugsExpiryDate',
392
+      component: () => import('@/xt_pages/stock/drugs/drugsExpiryDate'),
393
+      name: 'drugsExpiryDate',
394
+      hidden: true,
395
+      is_menu: false,
396
+      num: 3,
397
+      meta: { title: 'drugsExpiryDate', noCache: true }
398
+    },
264 399
   ]
265 400
 }

+ 10 - 0
src/router/modules/systems.js View File

@@ -81,6 +81,16 @@ export default {
81 81
 
82 82
     }
83 83
   },
84
+  {
85
+    path: '/data/specialDictionary',
86
+    component: () => import('@/xt_pages/data/specialDictionary'),
87
+    name: 'specialDictionary',
88
+    meta: {
89
+      title: 'specialDictionary',
90
+      noCache: true,
91
+
92
+    }
93
+  },
84 94
   {
85 95
     path: '/data/template',
86 96
     component: () => import('@/xt_pages/data/template'),

+ 65 - 0
src/xt_pages/data/specialDictionary.vue View File

@@ -0,0 +1,65 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+            <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        </div>
6
+        <div class="app-container">
7
+            <el-tabs v-model="activeName" @tab-click="handleClick">
8
+                <el-tab-pane label="药品" name="1">
9
+                    <drugs></drugs>
10
+                </el-tab-pane>
11
+                <el-tab-pane label="耗材" name="2">
12
+                    <consumables></consumables>
13
+                </el-tab-pane>
14
+                <el-tab-pane label="项目" name="3">
15
+                    <project></project>
16
+                </el-tab-pane>
17
+                <el-tab-pane label="检验检查项目" name="4">
18
+                    <inspection></inspection>
19
+                </el-tab-pane>
20
+                <el-tab-pane label="生产厂商" name="5">
21
+                    <manufacturer></manufacturer>
22
+                </el-tab-pane>
23
+                <el-tab-pane label="供应商" name="6">
24
+                    <supplier></supplier>
25
+                </el-tab-pane>
26
+                <el-tab-pane label="配置项字典" name="7">
27
+                    <configure></configure>
28
+                </el-tab-pane>
29
+            </el-tabs>
30
+        </div>
31
+    </div>
32
+</template>
33
+
34
+
35
+<script>
36
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
37
+import drugs from './components/drugs'
38
+import consumables from './components/consumables'
39
+import project from './components/project'
40
+import inspection from './components/inspection'
41
+import manufacturer from './components/manufacturer'
42
+import supplier from './components/supplier'
43
+import configure from './components/configure'
44
+export default {
45
+    components:{
46
+        BreadCrumb,
47
+        drugs,
48
+        consumables,
49
+        project,
50
+        inspection,
51
+        manufacturer,
52
+        supplier,
53
+        configure
54
+    },
55
+    data(){
56
+        return{
57
+            crumbs: [
58
+                { path: false, name: "管理中心" },
59
+                { path: "/data/specialDictionary", name: "专项字典" }
60
+            ],
61
+            activeName: "1"
62
+        }
63
+    }
64
+}
65
+</script>

+ 675 - 0
src/xt_pages/stock/drugs/adjustPrice.vue View File

@@ -0,0 +1,675 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      <el-button
7
+        size="small"
8
+        @click="handleWarehouse"
9
+        class="filter-item"
10
+        style="float:right;"
11
+        type="primary"
12
+        icon="el-icon-circle-plus-outline"
13
+        >新增</el-button
14
+      >
15
+    </div>
16
+
17
+    <div class="app-container">
18
+      <div class="cell clearfix">
19
+        <el-input
20
+          size="small"
21
+          style="width: 400px;"
22
+          v-model.trim="searchKey"
23
+          class="filter-item"
24
+          placeholder="单据编码/制单人/厂商"
25
+        />
26
+        <el-button
27
+          size="small"
28
+          class="filter-item"
29
+          type="primary"
30
+          icon="el-icon-search"
31
+          @click="search"
32
+          >搜索</el-button
33
+        >
34
+      </div>
35
+
36
+      <div class="cell clearfix">
37
+        <label class="title"><span class="name">调价日期</span> : </label>
38
+        <el-date-picker
39
+          size="small"
40
+          v-model="start_time"
41
+          prefix-icon="el-icon-date"
42
+          :editable="false"
43
+          style="width: 196px;"
44
+          type="date"
45
+          placeholder="选择日期时间"
46
+          align="right"
47
+          format="yyyy-MM-dd"
48
+          value-format="yyyy-MM-dd"
49
+          @change="startTimeChange"
50
+        ></el-date-picker>
51
+        <span class="cellLine"> - </span>
52
+        <el-date-picker
53
+          size="small"
54
+          v-model="end_time"
55
+          prefix-icon="el-icon-date"
56
+          :editable="false"
57
+          style="width: 196px;"
58
+          type="date"
59
+          placeholder="选择日期时间"
60
+          align="right"
61
+          format="yyyy-MM-dd"
62
+          value-format="yyyy-MM-dd"
63
+          @change="endTimeChange"
64
+        ></el-date-picker>
65
+      </div>
66
+
67
+      <div class="cell clearfix">
68
+        <el-checkbox
69
+          style="width: 70px"
70
+          v-model="checked"
71
+          @change="changeAllSelected"
72
+          >全选</el-checkbox
73
+        >
74
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
75
+          >删除</el-button
76
+        >
77
+      </div>
78
+
79
+      <el-table
80
+        :data="Warehouse.warehouseDate"
81
+        :class="signAndWeighBoxPatients"
82
+        style="width: 100%"
83
+        border
84
+        highlight-current-row
85
+        v-loading="Warehouse.loading"
86
+        ref="multipleTable"
87
+        @selection-change="select"
88
+        :row-style="{ color: '#303133' }"
89
+        :header-cell-style="{
90
+          backgroundColor: 'rgb(245, 247, 250)',
91
+          color: '#606266'
92
+        }"
93
+      >
94
+        <el-table-column align="center" type="selection" width="55">
95
+        </el-table-column>
96
+
97
+        <el-table-column label="单据日期" align="center">
98
+          <template slot-scope="scope">
99
+            {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
100
+          </template>
101
+        </el-table-column>
102
+
103
+        <el-table-column label="单据编号" align="center">
104
+          <template slot-scope="scope">
105
+            {{ scope.row.warehousing_order }}
106
+          </template>
107
+        </el-table-column>
108
+
109
+        <el-table-column label="制单人" align="center">
110
+          <template slot-scope="scope">
111
+            {{ getXuserName(scope.row.creater) }}
112
+          </template>
113
+        </el-table-column>
114
+
115
+        <el-table-column label="厂家" align="center">
116
+          <template slot-scope="scope">
117
+            {{ getManufactuerName(scope.row.manufacturer) }}
118
+          </template>
119
+        </el-table-column>
120
+
121
+        <el-table-column label="经销商" align="center">
122
+          <template slot-scope="scope">
123
+            {{ getDealerName(scope.row.dealer) }}
124
+          </template>
125
+        </el-table-column>
126
+
127
+        <el-table-column label="操作" align="center">
128
+          <template slot-scope="scope">
129
+            <el-tooltip
130
+              class="item"
131
+              effect="dark"
132
+              content="编辑"
133
+              placement="top"
134
+            >
135
+              <el-button
136
+                size="small"
137
+                type="primary"
138
+                icon="el-icon-edit-outline"
139
+                @click="handleEdit(scope.$index, scope.row)"
140
+              >
141
+              </el-button>
142
+            </el-tooltip>
143
+            <el-tooltip
144
+              class="item"
145
+              effect="dark"
146
+              content="删除"
147
+              placement="top"
148
+            >
149
+              <el-button
150
+                size="small"
151
+                type="danger"
152
+                icon="el-icon-delete"
153
+                @click="handleDelete(scope.$index, scope.row)"
154
+              >
155
+              </el-button>
156
+            </el-tooltip>
157
+          </template>
158
+        </el-table-column>
159
+      </el-table>
160
+
161
+      <el-pagination
162
+        @size-change="handleSizeChange"
163
+        @current-change="handleCurrentChange"
164
+        :page-sizes="[10, 50, 100]"
165
+        :page-size="10"
166
+        background
167
+        style="margin-top:20px;float: right"
168
+        layout="total, sizes, prev, pager, next, jumper"
169
+        :total="total"
170
+      >
171
+      </el-pagination>
172
+    </div>
173
+  </div>
174
+</template>
175
+
176
+<script>
177
+import { uParseTime } from "@/utils/tools";
178
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
179
+import {
180
+  deleteWarehouseInfo,
181
+  GetAllConfig,
182
+  GetAllGoodInfo,
183
+  GetAllGoodType,
184
+  getWarehouseInfoList,
185
+  getWarehouseList
186
+} from "@/api/stock";
187
+import BreadCrumb from "../../components/bread-crumb";
188
+
189
+export default {
190
+  name: "stockIn",
191
+  components: { BreadCrumb },
192
+  created() {
193
+    // var nowDate = new Date();
194
+    //
195
+    // var year = new Date().getFullYear()
196
+    // var month = new Date().getMonth() + 1
197
+    // var day = nowDate.getDate()
198
+    // if (parseInt(month) < 10) {
199
+    //   month = '0' + month
200
+    // }
201
+    // if (parseInt(day) < 10) {
202
+    //   day = '0' + day
203
+    // }
204
+    // const endTime = year + '-' + month + '-' + day
205
+    // this.end_time = endTime
206
+    //
207
+    //
208
+    // var year = new Date().getFullYear()
209
+    // var month = new Date().getMonth()
210
+    // var day = new Date().getDate()
211
+    //
212
+    // day.setMonth(day.getMonth() - 3);
213
+    //
214
+    // if (parseInt(month) < 10) {
215
+    //   month = '0' + month
216
+    // }
217
+    // if (parseInt(day) < 10) {
218
+    //   day = '0' + day
219
+    // }
220
+    // const startTime = year + '-' + month + '-' + day
221
+    // this.start_time = startTime
222
+
223
+    var nowDate = new Date();
224
+    var nowYear = nowDate.getFullYear();
225
+    var nowMonth = nowDate.getMonth() + 1;
226
+    var nowDay = nowDate.getDate();
227
+    this.end_time =
228
+      nowYear +
229
+      "-" +
230
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
231
+      "-" +
232
+      (nowDay < 10 ? "0" + nowDay : nowDay);
233
+    nowDate.setMonth(nowDate.getMonth() - 1);
234
+    nowYear = nowDate.getFullYear();
235
+    nowMonth = nowDate.getMonth() + 1;
236
+    nowDay = nowDate.getDate();
237
+    this.start_time =
238
+      nowYear +
239
+      "-" +
240
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
241
+      "-" +
242
+      (nowDay < 10 ? "0" + nowDay : nowDay);
243
+
244
+    this.GetWarehouse();
245
+    this.GetConfigInfo();
246
+    this.fetchAllAdminUsers();
247
+  },
248
+  data() {
249
+    return {
250
+      crumbs: [
251
+        { path: false, name: "库存管理" },
252
+        { path: false, name: "入库单" }
253
+      ],
254
+      searchKey: "",
255
+      type: 1,
256
+      page: 1,
257
+      limit: 10,
258
+      checked: false,
259
+      total: 0,
260
+      pageTotal: 0,
261
+      pageSelect: 0,
262
+      adminUserOptions: [],
263
+      multipleSelection: [],
264
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
265
+      start_time: "",
266
+      end_time: "",
267
+      goodType: [],
268
+      goodInfo: [],
269
+      manufacturer: [],
270
+      selectedTableData: [],
271
+      dealer: [],
272
+      Warehouse: {
273
+        loading: false,
274
+        warehouseDate: [],
275
+        tableCurrentIndex: ""
276
+      },
277
+
278
+      WarehouseInfo: {
279
+        loading: false,
280
+        warehouseInfoDate: []
281
+      },
282
+      startTime: ""
283
+    };
284
+  },
285
+  methods: {
286
+    search: function() {
287
+      const Params = {
288
+        page: this.page,
289
+        limit: this.limit,
290
+        start_time: this.start_time,
291
+        end_time: this.end_time,
292
+        type: this.type,
293
+        keywords: this.searchKey
294
+      };
295
+      this.Warehouse.warehouseDate = [];
296
+      getWarehouseList(Params).then(response => {
297
+        if (response.data.state == 0) {
298
+          this.Warehouse.loading = false;
299
+          this.$message.error(response.data.msg);
300
+          return false;
301
+        } else {
302
+          this.Warehouse.loading = false;
303
+          this.total = response.data.data.total;
304
+          for (let i = 0; i < response.data.data.list.length; i++) {
305
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
306
+          }
307
+        }
308
+      });
309
+    },
310
+    GetWarehouse: function() {
311
+      const Params = {
312
+        page: this.page,
313
+        limit: this.limit,
314
+        start_time: this.start_time,
315
+        end_time: this.end_time,
316
+        type: this.type
317
+      };
318
+      this.Warehouse.warehouseDate = [];
319
+      getWarehouseList(Params).then(response => {
320
+        if (response.data.state == 0) {
321
+          this.Warehouse.loading = false;
322
+          this.$message.error(response.data.msg);
323
+          return false;
324
+        } else {
325
+          this.Warehouse.loading = false;
326
+          this.total = response.data.data.total;
327
+          for (let i = 0; i < response.data.data.list.length; i++) {
328
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
329
+          }
330
+        }
331
+      });
332
+    },
333
+    tableRowClassName({ row, rowIndex }) {
334
+      // 把每一行的索引放进row
335
+      row.index = rowIndex;
336
+    },
337
+    onRowClick(row, event, column) {
338
+      this.WarehouseInfo.warehouseInfoDate = [];
339
+      this.Warehouse.tableCurrentIndex = row.index;
340
+      const params = {
341
+        id: row.id
342
+      };
343
+      this.WarehouseInfo.loading = true;
344
+      getWarehouseInfoList(params).then(response => {
345
+        if (response.data.state == 0) {
346
+          this.WarehouseInfo.loading = false;
347
+          this.$message.error(response.data.msg);
348
+          return false;
349
+        } else {
350
+          this.WarehouseInfo.loading = false;
351
+          for (let i = 0; i < response.data.data.info.length; i++) {
352
+            this.WarehouseInfo.warehouseInfoDate.push(
353
+              response.data.data.info[i]
354
+            );
355
+          }
356
+        }
357
+      });
358
+    },
359
+    getXuserName(id) {
360
+      if (id <= 0) {
361
+        return "";
362
+      }
363
+      var name = "";
364
+      if (
365
+        this.adminUserOptions == null ||
366
+        typeof this.adminUserOptions.length === "undefined"
367
+      ) {
368
+        return name;
369
+      }
370
+      var leng = this.adminUserOptions.length;
371
+      if (leng == 0) {
372
+        return name;
373
+      }
374
+      for (let index = 0; index < leng; index++) {
375
+        if (this.adminUserOptions[index].id == id) {
376
+          name = this.adminUserOptions[index].name;
377
+          break;
378
+        }
379
+      }
380
+      return name;
381
+    },
382
+    fetchAllDoctorAndNurse() {
383
+      fetchAllDoctorAndNurse().then(response => {
384
+        if (response.data.state == 1) {
385
+          this.doctorOptions = response.data.data.doctors;
386
+        }
387
+      });
388
+    },
389
+    fetchAllAdminUsers() {
390
+      fetchAllAdminUsers().then(response => {
391
+        console.log(response);
392
+        if (response.data.state == 1) {
393
+          this.adminUserOptions = response.data.data.users;
394
+          var alen = this.adminUserOptions.length;
395
+          for (let index = 0; index < alen; index++) {
396
+            if (this.adminUserOptions[index].user_type == 2) {
397
+              // this.doctorOptions.push(this.adminUserOptions[index]);
398
+            }
399
+          }
400
+        }
401
+      });
402
+    },
403
+    getSpecificationName: function(id) {
404
+      let name = "";
405
+      for (let i = 0; i < this.goodInfo.length; i++) {
406
+        if (this.goodInfo[i].id == id) {
407
+          name = this.goodInfo[i].specification_name;
408
+        }
409
+      }
410
+
411
+      return name;
412
+    },
413
+    getTypeName: function(id) {
414
+      let name = "";
415
+      for (let i = 0; i < this.goodType.length; i++) {
416
+        if (this.goodType[i].id == id) {
417
+          name = this.goodType[i].type_name;
418
+        }
419
+      }
420
+      return name;
421
+    },
422
+    GetAllGoodType: function() {
423
+      GetAllGoodType().then(response => {
424
+        if (response.data.state == 0) {
425
+          this.$message.error(response.data.msg);
426
+          return false;
427
+        } else {
428
+          for (let i = 0; i < response.data.data.goodType.length; i++) {
429
+            this.goodType.push(response.data.data.goodType[i]);
430
+          }
431
+        }
432
+      });
433
+    },
434
+    GetAllGoodInfo: function() {
435
+      GetAllGoodInfo().then(response => {
436
+        if (response.data.state == 0) {
437
+          this.$message.error(response.data.msg);
438
+          return false;
439
+        } else {
440
+          for (let i = 0; i < response.data.data.goodInfo.length; i++) {
441
+            this.goodInfo.push(response.data.data.goodInfo[i]);
442
+          }
443
+        }
444
+      });
445
+    },
446
+    clicks: function() {
447
+      console.log(this.WarehouseInfo.warehouseInfoDate);
448
+    },
449
+    handleWarehouse: function() {
450
+      this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
451
+    },
452
+    handleReturnSales: function() {
453
+      // this.$router.push({path:'/patients/create'}
454
+      if (this.multipleSelection.length <= 0) {
455
+        this.$message.error("请选择退货商品");
456
+        return;
457
+      }
458
+
459
+      const ids = [];
460
+      for (let i = 0; i < this.multipleSelection.length; i++) {
461
+        ids.push(this.multipleSelection[i].id);
462
+      }
463
+      this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
464
+    },
465
+    handleReturnSalesRecord: function() {
466
+      this.$router.push({ name: "salesReutrnRecord" });
467
+    },
468
+    handleWarehouseRecord: function() {
469
+      this.$router.push({ name: "warehouseRecord" });
470
+    },
471
+    handleSelectionChange: function(val) {
472
+      this.multipleSelection = val;
473
+    },
474
+    handleSizeChange(val) {
475
+      this.limit = val;
476
+      this.GetWarehouse();
477
+    },
478
+    handleCurrentChange(val) {
479
+      this.page = val;
480
+      this.GetWarehouse();
481
+    },
482
+    startTimeChange(val) {
483
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
484
+      if (time > 0) {
485
+        this.$message.error("结束时间不能小于开始时间");
486
+        this.start_time = "";
487
+      } else {
488
+        this.startTime = this.getTimestamp(val);
489
+        this.GetWarehouse();
490
+      }
491
+    },
492
+    endTimeChange(val) {
493
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
494
+      if (time < 0) {
495
+        this.$message.error("结束时间不能小于开始时间");
496
+        this.end_time = "";
497
+      } else {
498
+        this.GetWarehouse();
499
+      }
500
+    },
501
+    getTimestamp(time) {
502
+      // 把时间日期转成时间戳
503
+      return new Date(time).getTime() / 1000;
504
+    },
505
+    calculate: function(val) {
506
+      return Math.round(parseFloat(val) * 100) / 100;
507
+    },
508
+    GetConfigInfo: function() {
509
+      GetAllConfig().then(response => {
510
+        if (response.data.state == 0) {
511
+          this.$message.error(response.data.msg);
512
+          return false;
513
+        } else {
514
+          this.manufacturer = response.data.data.manufacturer;
515
+          this.dealer = response.data.data.dealer;
516
+        }
517
+      });
518
+    },
519
+    getManufactuerName: function(manufacturer_id) {
520
+      for (let i = 0; i < this.manufacturer.length; i++) {
521
+        if (this.manufacturer[i].id == manufacturer_id) {
522
+          return this.manufacturer[i].manufacturer_name;
523
+        }
524
+      }
525
+    },
526
+    getDealerName: function(dealer_id) {
527
+      for (let i = 0; i < this.dealer.length; i++) {
528
+        if (this.dealer[i].id == dealer_id) {
529
+          return this.dealer[i].dealer_name;
530
+        }
531
+      }
532
+    },
533
+    handleEdit: function(index, row) {
534
+      this.$router.push({
535
+        name: "stockInDetail",
536
+        query: { id: row.id, type: this.type }
537
+      });
538
+    },
539
+    handleDelete: function(index, row) {
540
+      const ids = [];
541
+      ids.push(row.id);
542
+      const idStr = ids.join(",");
543
+
544
+      const params = {
545
+        ids: idStr
546
+      };
547
+
548
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
549
+        confirmButtonText: "确定",
550
+        cancelButtonText: "取消",
551
+        type: "warning"
552
+      })
553
+        .then(() => {
554
+          deleteWarehouseInfo(params).then(response => {
555
+            if (response.data.state == 0) {
556
+              this.$message.error(response.data.msg);
557
+              return false;
558
+            } else {
559
+              this.$notify({
560
+                title: "成功",
561
+                message: "删除成功",
562
+                type: "success",
563
+                duration: 2000
564
+              });
565
+              for (let i = 0; i < ids.length; i++) {
566
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
567
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
568
+                    this.Warehouse.warehouseDate.splice(y, 1);
569
+                  }
570
+                }
571
+              }
572
+            }
573
+          });
574
+        })
575
+        .catch(() => {});
576
+    },
577
+    changeAllSelected: function(val) {
578
+      if (val) {
579
+        this.$refs.multipleTable.toggleAllSelection();
580
+      } else {
581
+        this.$refs.multipleTable.clearSelection();
582
+      }
583
+    },
584
+    select(selection) {
585
+      this.selectedTableData = selection;
586
+    },
587
+    batchDelete() {
588
+      if (this.selectedTableData.length <= 0) {
589
+        this.$message.error("请选择要删除的记录");
590
+        return;
591
+      }
592
+      const ids = [];
593
+      for (let i = 0; i < this.selectedTableData.length; i++) {
594
+        ids.push(this.selectedTableData[i].id);
595
+      }
596
+      const idStr = ids.join(",");
597
+      const params = {
598
+        ids: idStr
599
+      };
600
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
601
+        confirmButtonText: "确定",
602
+        cancelButtonText: "取消",
603
+        type: "warning"
604
+      })
605
+        .then(() => {
606
+          deleteWarehouseInfo(params).then(response => {
607
+            if (response.data.state == 0) {
608
+              this.$message.error(response.data.msg);
609
+              return false;
610
+            } else {
611
+              this.$notify({
612
+                title: "成功",
613
+                message: "删除成功",
614
+                type: "success",
615
+                duration: 2000
616
+              });
617
+
618
+              for (let i = 0; i < ids.length; i++) {
619
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
620
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
621
+                    this.Warehouse.warehouseDate.splice(y, 1);
622
+                  }
623
+                }
624
+              }
625
+            }
626
+          });
627
+        })
628
+        .catch(() => {});
629
+    }
630
+  }
631
+};
632
+</script>
633
+
634
+<style rel="stylesheet/css" lang="scss" scoped>
635
+.information {
636
+  border: 1px #dcdfe6 solid;
637
+  padding: 30px 20px 30px 20px;
638
+
639
+  .border {
640
+    border-bottom: 1px #dcdfe6 solid;
641
+    margin: 0px 0 20px 0;
642
+  }
643
+}
644
+
645
+.edit_separater {
646
+  border-top: 1px solid rgb(233, 233, 233);
647
+  margin-top: 15px;
648
+  margin-bottom: 15px;
649
+}
650
+</style>
651
+
652
+<style>
653
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
654
+  font-size: 12px;
655
+}
656
+
657
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
658
+  background: #6fb5fa;
659
+}
660
+
661
+.count {
662
+  color: #bd2c00;
663
+}
664
+.el-table td,
665
+.el-table th.is-leaf,
666
+.el-table--border,
667
+.el-table--group {
668
+  border-color: #d0d3da;
669
+}
670
+.el-table--border::after,
671
+.el-table--group::after,
672
+.el-table::before {
673
+  background-color: #d0d3da;
674
+}
675
+</style>

+ 589 - 0
src/xt_pages/stock/drugs/drugsExpiryDate.vue View File

@@ -0,0 +1,589 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      <el-button
7
+        size="small"
8
+        @click="handleWarehouse"
9
+        class="filter-item"
10
+        style="float:right;"
11
+        type="primary"
12
+        icon="el-icon-circle-plus-outline"
13
+        >新增</el-button
14
+      >
15
+    </div>
16
+
17
+    <div class="app-container">
18
+      <div style="display:flex;justify-content: space-between;">
19
+        <div class="cell clearfix">
20
+          <el-input
21
+            size="small"
22
+            style="width: 400px;"
23
+            v-model.trim="searchKey"
24
+            class="filter-item"
25
+            placeholder="单据编码/制单人/厂商"
26
+          />
27
+          <el-button
28
+            size="small"
29
+            class="filter-item"
30
+            type="primary"
31
+            icon="el-icon-search"
32
+            @click="search"
33
+            >搜索</el-button
34
+          >
35
+        </div>
36
+        <div>
37
+          <el-button size="small" type="primary">打印</el-button>
38
+          <el-button size="small" type="primary">报表下载</el-button>
39
+        </div>
40
+      </div>
41
+
42
+      <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
43
+            <el-table-column align="center" prop="dialysis_no" label="自编码">
44
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
45
+            </el-table-column>
46
+            <el-table-column align="center" prop="name" label="药品名称">
47
+                <template slot-scope="scope">{{ scope.row.name }}</template>
48
+            </el-table-column>
49
+            <el-table-column align="center" prop="dialysis_no" label="生产厂家">
50
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
51
+            </el-table-column>
52
+            <el-table-column align="center" prop="name" label="规格型号">
53
+                <template slot-scope="scope">{{ scope.row.name }}</template>
54
+            </el-table-column>
55
+            <el-table-column align="center" prop="name" label="批次号">
56
+                <template slot-scope="scope">{{ scope.row.name }}</template>
57
+            </el-table-column>
58
+            <el-table-column align="center" prop="name" label="入库时间">
59
+                <template slot-scope="scope">{{ scope.row.name }}</template>
60
+            </el-table-column>
61
+            <el-table-column align="center" prop="name" label="入库数量">
62
+                <template slot-scope="scope">{{ scope.row.name }}</template>
63
+            </el-table-column>
64
+            <el-table-column align="center" prop="name" label="基本单位">
65
+                <template slot-scope="scope">{{ scope.row.name }}</template>
66
+            </el-table-column>
67
+            <el-table-column align="center" prop="name" label="零价">
68
+                <template slot-scope="scope">{{ scope.row.name }}</template>
69
+            </el-table-column>
70
+            <el-table-column align="center" prop="name" label="有效期">
71
+                <template slot-scope="scope">{{ scope.row.name }}</template>
72
+            </el-table-column>
73
+        </el-table>
74
+
75
+      <el-pagination
76
+        @size-change="handleSizeChange"
77
+        @current-change="handleCurrentChange"
78
+        :page-sizes="[10, 50, 100]"
79
+        :page-size="10"
80
+        background
81
+        style="margin-top:20px;float: right"
82
+        layout="total, sizes, prev, pager, next, jumper"
83
+        :total="total"
84
+      >
85
+      </el-pagination>
86
+    </div>
87
+  </div>
88
+</template>
89
+
90
+<script>
91
+import { uParseTime } from "@/utils/tools";
92
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
93
+import {
94
+  deleteWarehouseInfo,
95
+  GetAllConfig,
96
+  GetAllGoodInfo,
97
+  GetAllGoodType,
98
+  getWarehouseInfoList,
99
+  getWarehouseList
100
+} from "@/api/stock";
101
+import BreadCrumb from "../../components/bread-crumb";
102
+
103
+export default {
104
+  name: "stockIn",
105
+  components: { BreadCrumb },
106
+  created() {
107
+    // var nowDate = new Date();
108
+    //
109
+    // var year = new Date().getFullYear()
110
+    // var month = new Date().getMonth() + 1
111
+    // var day = nowDate.getDate()
112
+    // if (parseInt(month) < 10) {
113
+    //   month = '0' + month
114
+    // }
115
+    // if (parseInt(day) < 10) {
116
+    //   day = '0' + day
117
+    // }
118
+    // const endTime = year + '-' + month + '-' + day
119
+    // this.end_time = endTime
120
+    //
121
+    //
122
+    // var year = new Date().getFullYear()
123
+    // var month = new Date().getMonth()
124
+    // var day = new Date().getDate()
125
+    //
126
+    // day.setMonth(day.getMonth() - 3);
127
+    //
128
+    // if (parseInt(month) < 10) {
129
+    //   month = '0' + month
130
+    // }
131
+    // if (parseInt(day) < 10) {
132
+    //   day = '0' + day
133
+    // }
134
+    // const startTime = year + '-' + month + '-' + day
135
+    // this.start_time = startTime
136
+
137
+    var nowDate = new Date();
138
+    var nowYear = nowDate.getFullYear();
139
+    var nowMonth = nowDate.getMonth() + 1;
140
+    var nowDay = nowDate.getDate();
141
+    this.end_time =
142
+      nowYear +
143
+      "-" +
144
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
145
+      "-" +
146
+      (nowDay < 10 ? "0" + nowDay : nowDay);
147
+    nowDate.setMonth(nowDate.getMonth() - 1);
148
+    nowYear = nowDate.getFullYear();
149
+    nowMonth = nowDate.getMonth() + 1;
150
+    nowDay = nowDate.getDate();
151
+    this.start_time =
152
+      nowYear +
153
+      "-" +
154
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
155
+      "-" +
156
+      (nowDay < 10 ? "0" + nowDay : nowDay);
157
+
158
+    this.GetWarehouse();
159
+    this.GetConfigInfo();
160
+    this.fetchAllAdminUsers();
161
+  },
162
+  data() {
163
+    return {
164
+      crumbs: [
165
+        { path: false, name: "库存管理" },
166
+        { path: false, name: "药品有效期预警" }
167
+      ],
168
+      searchKey: "",
169
+      type: 1,
170
+      page: 1,
171
+      limit: 10,
172
+      checked: false,
173
+      total: 0,
174
+      pageTotal: 0,
175
+      pageSelect: 0,
176
+      adminUserOptions: [],
177
+      multipleSelection: [],
178
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
179
+      start_time: "",
180
+      end_time: "",
181
+      goodType: [],
182
+      goodInfo: [],
183
+      manufacturer: [],
184
+      selectedTableData: [],
185
+      dealer: [],
186
+      Warehouse: {
187
+        loading: false,
188
+        warehouseDate: [],
189
+        tableCurrentIndex: ""
190
+      },
191
+
192
+      WarehouseInfo: {
193
+        loading: false,
194
+        warehouseInfoDate: []
195
+      },
196
+      startTime: ""
197
+    };
198
+  },
199
+  methods: {
200
+    search: function() {
201
+      const Params = {
202
+        page: this.page,
203
+        limit: this.limit,
204
+        start_time: this.start_time,
205
+        end_time: this.end_time,
206
+        type: this.type,
207
+        keywords: this.searchKey
208
+      };
209
+      this.Warehouse.warehouseDate = [];
210
+      getWarehouseList(Params).then(response => {
211
+        if (response.data.state == 0) {
212
+          this.Warehouse.loading = false;
213
+          this.$message.error(response.data.msg);
214
+          return false;
215
+        } else {
216
+          this.Warehouse.loading = false;
217
+          this.total = response.data.data.total;
218
+          for (let i = 0; i < response.data.data.list.length; i++) {
219
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
220
+          }
221
+        }
222
+      });
223
+    },
224
+    GetWarehouse: function() {
225
+      const Params = {
226
+        page: this.page,
227
+        limit: this.limit,
228
+        start_time: this.start_time,
229
+        end_time: this.end_time,
230
+        type: this.type
231
+      };
232
+      this.Warehouse.warehouseDate = [];
233
+      getWarehouseList(Params).then(response => {
234
+        if (response.data.state == 0) {
235
+          this.Warehouse.loading = false;
236
+          this.$message.error(response.data.msg);
237
+          return false;
238
+        } else {
239
+          this.Warehouse.loading = false;
240
+          this.total = response.data.data.total;
241
+          for (let i = 0; i < response.data.data.list.length; i++) {
242
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
243
+          }
244
+        }
245
+      });
246
+    },
247
+    tableRowClassName({ row, rowIndex }) {
248
+      // 把每一行的索引放进row
249
+      row.index = rowIndex;
250
+    },
251
+    onRowClick(row, event, column) {
252
+      this.WarehouseInfo.warehouseInfoDate = [];
253
+      this.Warehouse.tableCurrentIndex = row.index;
254
+      const params = {
255
+        id: row.id
256
+      };
257
+      this.WarehouseInfo.loading = true;
258
+      getWarehouseInfoList(params).then(response => {
259
+        if (response.data.state == 0) {
260
+          this.WarehouseInfo.loading = false;
261
+          this.$message.error(response.data.msg);
262
+          return false;
263
+        } else {
264
+          this.WarehouseInfo.loading = false;
265
+          for (let i = 0; i < response.data.data.info.length; i++) {
266
+            this.WarehouseInfo.warehouseInfoDate.push(
267
+              response.data.data.info[i]
268
+            );
269
+          }
270
+        }
271
+      });
272
+    },
273
+    getXuserName(id) {
274
+      if (id <= 0) {
275
+        return "";
276
+      }
277
+      var name = "";
278
+      if (
279
+        this.adminUserOptions == null ||
280
+        typeof this.adminUserOptions.length === "undefined"
281
+      ) {
282
+        return name;
283
+      }
284
+      var leng = this.adminUserOptions.length;
285
+      if (leng == 0) {
286
+        return name;
287
+      }
288
+      for (let index = 0; index < leng; index++) {
289
+        if (this.adminUserOptions[index].id == id) {
290
+          name = this.adminUserOptions[index].name;
291
+          break;
292
+        }
293
+      }
294
+      return name;
295
+    },
296
+    fetchAllDoctorAndNurse() {
297
+      fetchAllDoctorAndNurse().then(response => {
298
+        if (response.data.state == 1) {
299
+          this.doctorOptions = response.data.data.doctors;
300
+        }
301
+      });
302
+    },
303
+    fetchAllAdminUsers() {
304
+      fetchAllAdminUsers().then(response => {
305
+        console.log(response);
306
+        if (response.data.state == 1) {
307
+          this.adminUserOptions = response.data.data.users;
308
+          var alen = this.adminUserOptions.length;
309
+          for (let index = 0; index < alen; index++) {
310
+            if (this.adminUserOptions[index].user_type == 2) {
311
+              // this.doctorOptions.push(this.adminUserOptions[index]);
312
+            }
313
+          }
314
+        }
315
+      });
316
+    },
317
+    getSpecificationName: function(id) {
318
+      let name = "";
319
+      for (let i = 0; i < this.goodInfo.length; i++) {
320
+        if (this.goodInfo[i].id == id) {
321
+          name = this.goodInfo[i].specification_name;
322
+        }
323
+      }
324
+
325
+      return name;
326
+    },
327
+    getTypeName: function(id) {
328
+      let name = "";
329
+      for (let i = 0; i < this.goodType.length; i++) {
330
+        if (this.goodType[i].id == id) {
331
+          name = this.goodType[i].type_name;
332
+        }
333
+      }
334
+      return name;
335
+    },
336
+    GetAllGoodType: function() {
337
+      GetAllGoodType().then(response => {
338
+        if (response.data.state == 0) {
339
+          this.$message.error(response.data.msg);
340
+          return false;
341
+        } else {
342
+          for (let i = 0; i < response.data.data.goodType.length; i++) {
343
+            this.goodType.push(response.data.data.goodType[i]);
344
+          }
345
+        }
346
+      });
347
+    },
348
+    GetAllGoodInfo: function() {
349
+      GetAllGoodInfo().then(response => {
350
+        if (response.data.state == 0) {
351
+          this.$message.error(response.data.msg);
352
+          return false;
353
+        } else {
354
+          for (let i = 0; i < response.data.data.goodInfo.length; i++) {
355
+            this.goodInfo.push(response.data.data.goodInfo[i]);
356
+          }
357
+        }
358
+      });
359
+    },
360
+    clicks: function() {
361
+      console.log(this.WarehouseInfo.warehouseInfoDate);
362
+    },
363
+    handleWarehouse: function() {
364
+      this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
365
+    },
366
+    handleReturnSales: function() {
367
+      // this.$router.push({path:'/patients/create'}
368
+      if (this.multipleSelection.length <= 0) {
369
+        this.$message.error("请选择退货商品");
370
+        return;
371
+      }
372
+
373
+      const ids = [];
374
+      for (let i = 0; i < this.multipleSelection.length; i++) {
375
+        ids.push(this.multipleSelection[i].id);
376
+      }
377
+      this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
378
+    },
379
+    handleReturnSalesRecord: function() {
380
+      this.$router.push({ name: "salesReutrnRecord" });
381
+    },
382
+    handleWarehouseRecord: function() {
383
+      this.$router.push({ name: "warehouseRecord" });
384
+    },
385
+    handleSelectionChange: function(val) {
386
+      this.multipleSelection = val;
387
+    },
388
+    handleSizeChange(val) {
389
+      this.limit = val;
390
+      this.GetWarehouse();
391
+    },
392
+    handleCurrentChange(val) {
393
+      this.page = val;
394
+      this.GetWarehouse();
395
+    },
396
+    startTimeChange(val) {
397
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
398
+      if (time > 0) {
399
+        this.$message.error("结束时间不能小于开始时间");
400
+        this.start_time = "";
401
+      } else {
402
+        this.startTime = this.getTimestamp(val);
403
+        this.GetWarehouse();
404
+      }
405
+    },
406
+    endTimeChange(val) {
407
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
408
+      if (time < 0) {
409
+        this.$message.error("结束时间不能小于开始时间");
410
+        this.end_time = "";
411
+      } else {
412
+        this.GetWarehouse();
413
+      }
414
+    },
415
+    getTimestamp(time) {
416
+      // 把时间日期转成时间戳
417
+      return new Date(time).getTime() / 1000;
418
+    },
419
+    calculate: function(val) {
420
+      return Math.round(parseFloat(val) * 100) / 100;
421
+    },
422
+    GetConfigInfo: function() {
423
+      GetAllConfig().then(response => {
424
+        if (response.data.state == 0) {
425
+          this.$message.error(response.data.msg);
426
+          return false;
427
+        } else {
428
+          this.manufacturer = response.data.data.manufacturer;
429
+          this.dealer = response.data.data.dealer;
430
+        }
431
+      });
432
+    },
433
+    getManufactuerName: function(manufacturer_id) {
434
+      for (let i = 0; i < this.manufacturer.length; i++) {
435
+        if (this.manufacturer[i].id == manufacturer_id) {
436
+          return this.manufacturer[i].manufacturer_name;
437
+        }
438
+      }
439
+    },
440
+    getDealerName: function(dealer_id) {
441
+      for (let i = 0; i < this.dealer.length; i++) {
442
+        if (this.dealer[i].id == dealer_id) {
443
+          return this.dealer[i].dealer_name;
444
+        }
445
+      }
446
+    },
447
+    handleEdit: function(index, row) {
448
+      this.$router.push({
449
+        name: "stockInDetail",
450
+        query: { id: row.id, type: this.type }
451
+      });
452
+    },
453
+    handleDelete: function(index, row) {
454
+      const ids = [];
455
+      ids.push(row.id);
456
+      const idStr = ids.join(",");
457
+
458
+      const params = {
459
+        ids: idStr
460
+      };
461
+
462
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
463
+        confirmButtonText: "确定",
464
+        cancelButtonText: "取消",
465
+        type: "warning"
466
+      })
467
+        .then(() => {
468
+          deleteWarehouseInfo(params).then(response => {
469
+            if (response.data.state == 0) {
470
+              this.$message.error(response.data.msg);
471
+              return false;
472
+            } else {
473
+              this.$notify({
474
+                title: "成功",
475
+                message: "删除成功",
476
+                type: "success",
477
+                duration: 2000
478
+              });
479
+              for (let i = 0; i < ids.length; i++) {
480
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
481
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
482
+                    this.Warehouse.warehouseDate.splice(y, 1);
483
+                  }
484
+                }
485
+              }
486
+            }
487
+          });
488
+        })
489
+        .catch(() => {});
490
+    },
491
+    changeAllSelected: function(val) {
492
+      if (val) {
493
+        this.$refs.multipleTable.toggleAllSelection();
494
+      } else {
495
+        this.$refs.multipleTable.clearSelection();
496
+      }
497
+    },
498
+    select(selection) {
499
+      this.selectedTableData = selection;
500
+    },
501
+    batchDelete() {
502
+      if (this.selectedTableData.length <= 0) {
503
+        this.$message.error("请选择要删除的记录");
504
+        return;
505
+      }
506
+      const ids = [];
507
+      for (let i = 0; i < this.selectedTableData.length; i++) {
508
+        ids.push(this.selectedTableData[i].id);
509
+      }
510
+      const idStr = ids.join(",");
511
+      const params = {
512
+        ids: idStr
513
+      };
514
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
515
+        confirmButtonText: "确定",
516
+        cancelButtonText: "取消",
517
+        type: "warning"
518
+      })
519
+        .then(() => {
520
+          deleteWarehouseInfo(params).then(response => {
521
+            if (response.data.state == 0) {
522
+              this.$message.error(response.data.msg);
523
+              return false;
524
+            } else {
525
+              this.$notify({
526
+                title: "成功",
527
+                message: "删除成功",
528
+                type: "success",
529
+                duration: 2000
530
+              });
531
+
532
+              for (let i = 0; i < ids.length; i++) {
533
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
534
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
535
+                    this.Warehouse.warehouseDate.splice(y, 1);
536
+                  }
537
+                }
538
+              }
539
+            }
540
+          });
541
+        })
542
+        .catch(() => {});
543
+    }
544
+  }
545
+};
546
+</script>
547
+
548
+<style rel="stylesheet/css" lang="scss" scoped>
549
+.information {
550
+  border: 1px #dcdfe6 solid;
551
+  padding: 30px 20px 30px 20px;
552
+
553
+  .border {
554
+    border-bottom: 1px #dcdfe6 solid;
555
+    margin: 0px 0 20px 0;
556
+  }
557
+}
558
+
559
+.edit_separater {
560
+  border-top: 1px solid rgb(233, 233, 233);
561
+  margin-top: 15px;
562
+  margin-bottom: 15px;
563
+}
564
+</style>
565
+
566
+<style>
567
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
568
+  font-size: 12px;
569
+}
570
+
571
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
572
+  background: #6fb5fa;
573
+}
574
+
575
+.count {
576
+  color: #bd2c00;
577
+}
578
+.el-table td,
579
+.el-table th.is-leaf,
580
+.el-table--border,
581
+.el-table--group {
582
+  border-color: #d0d3da;
583
+}
584
+.el-table--border::after,
585
+.el-table--group::after,
586
+.el-table::before {
587
+  background-color: #d0d3da;
588
+}
589
+</style>

+ 583 - 0
src/xt_pages/stock/drugs/drugsSurplus.vue View File

@@ -0,0 +1,583 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      <el-button
7
+        size="small"
8
+        @click="handleWarehouse"
9
+        class="filter-item"
10
+        style="float:right;"
11
+        type="primary"
12
+        icon="el-icon-circle-plus-outline"
13
+        >新增</el-button
14
+      >
15
+    </div>
16
+
17
+    <div class="app-container">
18
+      <div style="display:flex;justify-content: space-between;">
19
+        <div class="cell clearfix">
20
+          <el-input
21
+            size="small"
22
+            style="width: 400px;"
23
+            v-model.trim="searchKey"
24
+            class="filter-item"
25
+            placeholder="单据编码/制单人/厂商"
26
+          />
27
+          <el-button
28
+            size="small"
29
+            class="filter-item"
30
+            type="primary"
31
+            icon="el-icon-search"
32
+            @click="search"
33
+            >搜索</el-button
34
+          >
35
+        </div>
36
+        <div>
37
+          <el-button size="small" type="primary">打印</el-button>
38
+          <el-button size="small" type="primary">报表下载</el-button>
39
+        </div>
40
+      </div>
41
+
42
+      <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
43
+            <el-table-column align="center" prop="dialysis_no" label="自编码">
44
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
45
+            </el-table-column>
46
+            <el-table-column align="center" prop="name" label="药品名称">
47
+                <template slot-scope="scope">{{ scope.row.name }}</template>
48
+            </el-table-column>
49
+            <el-table-column align="center" prop="dialysis_no" label="生产厂家">
50
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
51
+            </el-table-column>
52
+            <el-table-column align="center" prop="name" label="规格型号">
53
+                <template slot-scope="scope">{{ scope.row.name }}</template>
54
+            </el-table-column>
55
+            <el-table-column align="center" prop="name" label="数量/库存">
56
+                <template slot-scope="scope">{{ scope.row.name }}</template>
57
+            </el-table-column>
58
+            <el-table-column align="center" prop="name" label="基本单位">
59
+                <template slot-scope="scope">{{ scope.row.name }}</template>
60
+            </el-table-column>
61
+            <el-table-column align="center" prop="name" label="零价">
62
+                <template slot-scope="scope">{{ scope.row.name }}</template>
63
+            </el-table-column>
64
+            <el-table-column align="center" prop="name" label="库存警戒">
65
+                <template slot-scope="scope">{{ scope.row.name }}</template>
66
+            </el-table-column>
67
+        </el-table>
68
+
69
+      <el-pagination
70
+        @size-change="handleSizeChange"
71
+        @current-change="handleCurrentChange"
72
+        :page-sizes="[10, 50, 100]"
73
+        :page-size="10"
74
+        background
75
+        style="margin-top:20px;float: right"
76
+        layout="total, sizes, prev, pager, next, jumper"
77
+        :total="total"
78
+      >
79
+      </el-pagination>
80
+    </div>
81
+  </div>
82
+</template>
83
+
84
+<script>
85
+import { uParseTime } from "@/utils/tools";
86
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
87
+import {
88
+  deleteWarehouseInfo,
89
+  GetAllConfig,
90
+  GetAllGoodInfo,
91
+  GetAllGoodType,
92
+  getWarehouseInfoList,
93
+  getWarehouseList
94
+} from "@/api/stock";
95
+import BreadCrumb from "../../components/bread-crumb";
96
+
97
+export default {
98
+  name: "stockIn",
99
+  components: { BreadCrumb },
100
+  created() {
101
+    // var nowDate = new Date();
102
+    //
103
+    // var year = new Date().getFullYear()
104
+    // var month = new Date().getMonth() + 1
105
+    // var day = nowDate.getDate()
106
+    // if (parseInt(month) < 10) {
107
+    //   month = '0' + month
108
+    // }
109
+    // if (parseInt(day) < 10) {
110
+    //   day = '0' + day
111
+    // }
112
+    // const endTime = year + '-' + month + '-' + day
113
+    // this.end_time = endTime
114
+    //
115
+    //
116
+    // var year = new Date().getFullYear()
117
+    // var month = new Date().getMonth()
118
+    // var day = new Date().getDate()
119
+    //
120
+    // day.setMonth(day.getMonth() - 3);
121
+    //
122
+    // if (parseInt(month) < 10) {
123
+    //   month = '0' + month
124
+    // }
125
+    // if (parseInt(day) < 10) {
126
+    //   day = '0' + day
127
+    // }
128
+    // const startTime = year + '-' + month + '-' + day
129
+    // this.start_time = startTime
130
+
131
+    var nowDate = new Date();
132
+    var nowYear = nowDate.getFullYear();
133
+    var nowMonth = nowDate.getMonth() + 1;
134
+    var nowDay = nowDate.getDate();
135
+    this.end_time =
136
+      nowYear +
137
+      "-" +
138
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
139
+      "-" +
140
+      (nowDay < 10 ? "0" + nowDay : nowDay);
141
+    nowDate.setMonth(nowDate.getMonth() - 1);
142
+    nowYear = nowDate.getFullYear();
143
+    nowMonth = nowDate.getMonth() + 1;
144
+    nowDay = nowDate.getDate();
145
+    this.start_time =
146
+      nowYear +
147
+      "-" +
148
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
149
+      "-" +
150
+      (nowDay < 10 ? "0" + nowDay : nowDay);
151
+
152
+    this.GetWarehouse();
153
+    this.GetConfigInfo();
154
+    this.fetchAllAdminUsers();
155
+  },
156
+  data() {
157
+    return {
158
+      crumbs: [
159
+        { path: false, name: "库存管理" },
160
+        { path: false, name: "药品剩余预警" }
161
+      ],
162
+      searchKey: "",
163
+      type: 1,
164
+      page: 1,
165
+      limit: 10,
166
+      checked: false,
167
+      total: 0,
168
+      pageTotal: 0,
169
+      pageSelect: 0,
170
+      adminUserOptions: [],
171
+      multipleSelection: [],
172
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
173
+      start_time: "",
174
+      end_time: "",
175
+      goodType: [],
176
+      goodInfo: [],
177
+      manufacturer: [],
178
+      selectedTableData: [],
179
+      dealer: [],
180
+      Warehouse: {
181
+        loading: false,
182
+        warehouseDate: [],
183
+        tableCurrentIndex: ""
184
+      },
185
+
186
+      WarehouseInfo: {
187
+        loading: false,
188
+        warehouseInfoDate: []
189
+      },
190
+      startTime: ""
191
+    };
192
+  },
193
+  methods: {
194
+    search: function() {
195
+      const Params = {
196
+        page: this.page,
197
+        limit: this.limit,
198
+        start_time: this.start_time,
199
+        end_time: this.end_time,
200
+        type: this.type,
201
+        keywords: this.searchKey
202
+      };
203
+      this.Warehouse.warehouseDate = [];
204
+      getWarehouseList(Params).then(response => {
205
+        if (response.data.state == 0) {
206
+          this.Warehouse.loading = false;
207
+          this.$message.error(response.data.msg);
208
+          return false;
209
+        } else {
210
+          this.Warehouse.loading = false;
211
+          this.total = response.data.data.total;
212
+          for (let i = 0; i < response.data.data.list.length; i++) {
213
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
214
+          }
215
+        }
216
+      });
217
+    },
218
+    GetWarehouse: function() {
219
+      const Params = {
220
+        page: this.page,
221
+        limit: this.limit,
222
+        start_time: this.start_time,
223
+        end_time: this.end_time,
224
+        type: this.type
225
+      };
226
+      this.Warehouse.warehouseDate = [];
227
+      getWarehouseList(Params).then(response => {
228
+        if (response.data.state == 0) {
229
+          this.Warehouse.loading = false;
230
+          this.$message.error(response.data.msg);
231
+          return false;
232
+        } else {
233
+          this.Warehouse.loading = false;
234
+          this.total = response.data.data.total;
235
+          for (let i = 0; i < response.data.data.list.length; i++) {
236
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
237
+          }
238
+        }
239
+      });
240
+    },
241
+    tableRowClassName({ row, rowIndex }) {
242
+      // 把每一行的索引放进row
243
+      row.index = rowIndex;
244
+    },
245
+    onRowClick(row, event, column) {
246
+      this.WarehouseInfo.warehouseInfoDate = [];
247
+      this.Warehouse.tableCurrentIndex = row.index;
248
+      const params = {
249
+        id: row.id
250
+      };
251
+      this.WarehouseInfo.loading = true;
252
+      getWarehouseInfoList(params).then(response => {
253
+        if (response.data.state == 0) {
254
+          this.WarehouseInfo.loading = false;
255
+          this.$message.error(response.data.msg);
256
+          return false;
257
+        } else {
258
+          this.WarehouseInfo.loading = false;
259
+          for (let i = 0; i < response.data.data.info.length; i++) {
260
+            this.WarehouseInfo.warehouseInfoDate.push(
261
+              response.data.data.info[i]
262
+            );
263
+          }
264
+        }
265
+      });
266
+    },
267
+    getXuserName(id) {
268
+      if (id <= 0) {
269
+        return "";
270
+      }
271
+      var name = "";
272
+      if (
273
+        this.adminUserOptions == null ||
274
+        typeof this.adminUserOptions.length === "undefined"
275
+      ) {
276
+        return name;
277
+      }
278
+      var leng = this.adminUserOptions.length;
279
+      if (leng == 0) {
280
+        return name;
281
+      }
282
+      for (let index = 0; index < leng; index++) {
283
+        if (this.adminUserOptions[index].id == id) {
284
+          name = this.adminUserOptions[index].name;
285
+          break;
286
+        }
287
+      }
288
+      return name;
289
+    },
290
+    fetchAllDoctorAndNurse() {
291
+      fetchAllDoctorAndNurse().then(response => {
292
+        if (response.data.state == 1) {
293
+          this.doctorOptions = response.data.data.doctors;
294
+        }
295
+      });
296
+    },
297
+    fetchAllAdminUsers() {
298
+      fetchAllAdminUsers().then(response => {
299
+        console.log(response);
300
+        if (response.data.state == 1) {
301
+          this.adminUserOptions = response.data.data.users;
302
+          var alen = this.adminUserOptions.length;
303
+          for (let index = 0; index < alen; index++) {
304
+            if (this.adminUserOptions[index].user_type == 2) {
305
+              // this.doctorOptions.push(this.adminUserOptions[index]);
306
+            }
307
+          }
308
+        }
309
+      });
310
+    },
311
+    getSpecificationName: function(id) {
312
+      let name = "";
313
+      for (let i = 0; i < this.goodInfo.length; i++) {
314
+        if (this.goodInfo[i].id == id) {
315
+          name = this.goodInfo[i].specification_name;
316
+        }
317
+      }
318
+
319
+      return name;
320
+    },
321
+    getTypeName: function(id) {
322
+      let name = "";
323
+      for (let i = 0; i < this.goodType.length; i++) {
324
+        if (this.goodType[i].id == id) {
325
+          name = this.goodType[i].type_name;
326
+        }
327
+      }
328
+      return name;
329
+    },
330
+    GetAllGoodType: function() {
331
+      GetAllGoodType().then(response => {
332
+        if (response.data.state == 0) {
333
+          this.$message.error(response.data.msg);
334
+          return false;
335
+        } else {
336
+          for (let i = 0; i < response.data.data.goodType.length; i++) {
337
+            this.goodType.push(response.data.data.goodType[i]);
338
+          }
339
+        }
340
+      });
341
+    },
342
+    GetAllGoodInfo: function() {
343
+      GetAllGoodInfo().then(response => {
344
+        if (response.data.state == 0) {
345
+          this.$message.error(response.data.msg);
346
+          return false;
347
+        } else {
348
+          for (let i = 0; i < response.data.data.goodInfo.length; i++) {
349
+            this.goodInfo.push(response.data.data.goodInfo[i]);
350
+          }
351
+        }
352
+      });
353
+    },
354
+    clicks: function() {
355
+      console.log(this.WarehouseInfo.warehouseInfoDate);
356
+    },
357
+    handleWarehouse: function() {
358
+      this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
359
+    },
360
+    handleReturnSales: function() {
361
+      // this.$router.push({path:'/patients/create'}
362
+      if (this.multipleSelection.length <= 0) {
363
+        this.$message.error("请选择退货商品");
364
+        return;
365
+      }
366
+
367
+      const ids = [];
368
+      for (let i = 0; i < this.multipleSelection.length; i++) {
369
+        ids.push(this.multipleSelection[i].id);
370
+      }
371
+      this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
372
+    },
373
+    handleReturnSalesRecord: function() {
374
+      this.$router.push({ name: "salesReutrnRecord" });
375
+    },
376
+    handleWarehouseRecord: function() {
377
+      this.$router.push({ name: "warehouseRecord" });
378
+    },
379
+    handleSelectionChange: function(val) {
380
+      this.multipleSelection = val;
381
+    },
382
+    handleSizeChange(val) {
383
+      this.limit = val;
384
+      this.GetWarehouse();
385
+    },
386
+    handleCurrentChange(val) {
387
+      this.page = val;
388
+      this.GetWarehouse();
389
+    },
390
+    startTimeChange(val) {
391
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
392
+      if (time > 0) {
393
+        this.$message.error("结束时间不能小于开始时间");
394
+        this.start_time = "";
395
+      } else {
396
+        this.startTime = this.getTimestamp(val);
397
+        this.GetWarehouse();
398
+      }
399
+    },
400
+    endTimeChange(val) {
401
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
402
+      if (time < 0) {
403
+        this.$message.error("结束时间不能小于开始时间");
404
+        this.end_time = "";
405
+      } else {
406
+        this.GetWarehouse();
407
+      }
408
+    },
409
+    getTimestamp(time) {
410
+      // 把时间日期转成时间戳
411
+      return new Date(time).getTime() / 1000;
412
+    },
413
+    calculate: function(val) {
414
+      return Math.round(parseFloat(val) * 100) / 100;
415
+    },
416
+    GetConfigInfo: function() {
417
+      GetAllConfig().then(response => {
418
+        if (response.data.state == 0) {
419
+          this.$message.error(response.data.msg);
420
+          return false;
421
+        } else {
422
+          this.manufacturer = response.data.data.manufacturer;
423
+          this.dealer = response.data.data.dealer;
424
+        }
425
+      });
426
+    },
427
+    getManufactuerName: function(manufacturer_id) {
428
+      for (let i = 0; i < this.manufacturer.length; i++) {
429
+        if (this.manufacturer[i].id == manufacturer_id) {
430
+          return this.manufacturer[i].manufacturer_name;
431
+        }
432
+      }
433
+    },
434
+    getDealerName: function(dealer_id) {
435
+      for (let i = 0; i < this.dealer.length; i++) {
436
+        if (this.dealer[i].id == dealer_id) {
437
+          return this.dealer[i].dealer_name;
438
+        }
439
+      }
440
+    },
441
+    handleEdit: function(index, row) {
442
+      this.$router.push({
443
+        name: "stockInDetail",
444
+        query: { id: row.id, type: this.type }
445
+      });
446
+    },
447
+    handleDelete: function(index, row) {
448
+      const ids = [];
449
+      ids.push(row.id);
450
+      const idStr = ids.join(",");
451
+
452
+      const params = {
453
+        ids: idStr
454
+      };
455
+
456
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
457
+        confirmButtonText: "确定",
458
+        cancelButtonText: "取消",
459
+        type: "warning"
460
+      })
461
+        .then(() => {
462
+          deleteWarehouseInfo(params).then(response => {
463
+            if (response.data.state == 0) {
464
+              this.$message.error(response.data.msg);
465
+              return false;
466
+            } else {
467
+              this.$notify({
468
+                title: "成功",
469
+                message: "删除成功",
470
+                type: "success",
471
+                duration: 2000
472
+              });
473
+              for (let i = 0; i < ids.length; i++) {
474
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
475
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
476
+                    this.Warehouse.warehouseDate.splice(y, 1);
477
+                  }
478
+                }
479
+              }
480
+            }
481
+          });
482
+        })
483
+        .catch(() => {});
484
+    },
485
+    changeAllSelected: function(val) {
486
+      if (val) {
487
+        this.$refs.multipleTable.toggleAllSelection();
488
+      } else {
489
+        this.$refs.multipleTable.clearSelection();
490
+      }
491
+    },
492
+    select(selection) {
493
+      this.selectedTableData = selection;
494
+    },
495
+    batchDelete() {
496
+      if (this.selectedTableData.length <= 0) {
497
+        this.$message.error("请选择要删除的记录");
498
+        return;
499
+      }
500
+      const ids = [];
501
+      for (let i = 0; i < this.selectedTableData.length; i++) {
502
+        ids.push(this.selectedTableData[i].id);
503
+      }
504
+      const idStr = ids.join(",");
505
+      const params = {
506
+        ids: idStr
507
+      };
508
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
509
+        confirmButtonText: "确定",
510
+        cancelButtonText: "取消",
511
+        type: "warning"
512
+      })
513
+        .then(() => {
514
+          deleteWarehouseInfo(params).then(response => {
515
+            if (response.data.state == 0) {
516
+              this.$message.error(response.data.msg);
517
+              return false;
518
+            } else {
519
+              this.$notify({
520
+                title: "成功",
521
+                message: "删除成功",
522
+                type: "success",
523
+                duration: 2000
524
+              });
525
+
526
+              for (let i = 0; i < ids.length; i++) {
527
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
528
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
529
+                    this.Warehouse.warehouseDate.splice(y, 1);
530
+                  }
531
+                }
532
+              }
533
+            }
534
+          });
535
+        })
536
+        .catch(() => {});
537
+    }
538
+  }
539
+};
540
+</script>
541
+
542
+<style rel="stylesheet/css" lang="scss" scoped>
543
+.information {
544
+  border: 1px #dcdfe6 solid;
545
+  padding: 30px 20px 30px 20px;
546
+
547
+  .border {
548
+    border-bottom: 1px #dcdfe6 solid;
549
+    margin: 0px 0 20px 0;
550
+  }
551
+}
552
+
553
+.edit_separater {
554
+  border-top: 1px solid rgb(233, 233, 233);
555
+  margin-top: 15px;
556
+  margin-bottom: 15px;
557
+}
558
+</style>
559
+
560
+<style>
561
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
562
+  font-size: 12px;
563
+}
564
+
565
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
566
+  background: #6fb5fa;
567
+}
568
+
569
+.count {
570
+  color: #bd2c00;
571
+}
572
+.el-table td,
573
+.el-table th.is-leaf,
574
+.el-table--border,
575
+.el-table--group {
576
+  border-color: #d0d3da;
577
+}
578
+.el-table--border::after,
579
+.el-table--group::after,
580
+.el-table::before {
581
+  background-color: #d0d3da;
582
+}
583
+</style>

+ 193 - 0
src/xt_pages/stock/drugs/query.vue View File

@@ -0,0 +1,193 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      <el-button
7
+        size="small"
8
+        @click="handleWarehouse"
9
+        class="filter-item"
10
+        style="float:right;"
11
+        type="primary"
12
+        icon="el-icon-circle-plus-outline"
13
+        >新增</el-button
14
+      >
15
+    </div>
16
+
17
+    <div class="app-container">
18
+        <div class="cell clearfix">
19
+            <el-input
20
+            size="small"
21
+            style="width: 400px;"
22
+            v-model.trim="searchKey"
23
+            class="filter-item"
24
+            placeholder="单据编码/制单人/厂商"
25
+            />
26
+            <el-button
27
+            style="margin-right:10px;"
28
+            size="small"
29
+            class="filter-item"
30
+            type="primary"
31
+            icon="el-icon-search"
32
+            @click="search"
33
+            >搜索</el-button
34
+            >
35
+            <label class="title"><span class="name">报损日期</span> : </label>
36
+            <el-date-picker
37
+            size="small"
38
+            v-model="start_time"
39
+            prefix-icon="el-icon-date"
40
+            :editable="false"
41
+            style="width: 196px;"
42
+            type="date"
43
+            placeholder="选择日期时间"
44
+            align="right"
45
+            format="yyyy-MM-dd"
46
+            value-format="yyyy-MM-dd"
47
+            @change="startTimeChange"
48
+            ></el-date-picker>
49
+            <span class="cellLine"> - </span>
50
+            <el-date-picker
51
+            size="small"
52
+            v-model="end_time"
53
+            prefix-icon="el-icon-date"
54
+            :editable="false"
55
+            style="width: 196px;"
56
+            type="date"
57
+            placeholder="选择日期时间"
58
+            align="right"
59
+            format="yyyy-MM-dd"
60
+            value-format="yyyy-MM-dd"
61
+            @change="endTimeChange"
62
+            ></el-date-picker>
63
+        </div>
64
+
65
+        <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
66
+            <el-table-column align="center" prop="dialysis_no" label="单据编码">
67
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
68
+            </el-table-column>
69
+            <el-table-column align="center" prop="name" label="药品名称">
70
+                <template slot-scope="scope">{{ scope.row.name }}</template>
71
+            </el-table-column>
72
+            <el-table-column align="center" prop="dialysis_no" label="规格名称">
73
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
74
+            </el-table-column>
75
+            <el-table-column align="center" prop="name" label="批号">
76
+                <template slot-scope="scope">{{ scope.row.name }}</template>
77
+            </el-table-column>
78
+            <el-table-column align="center" prop="name" label="数量">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+            </el-table-column>
81
+            <el-table-column align="center" prop="name" label="原零价">
82
+                <template slot-scope="scope">{{ scope.row.name }}</template>
83
+            </el-table-column>
84
+            <el-table-column align="center" prop="name" label="现零价">
85
+                <template slot-scope="scope">{{ scope.row.name }}</template>
86
+            </el-table-column>
87
+            <el-table-column align="center" prop="name" label="操作人">
88
+                <template slot-scope="scope">{{ scope.row.name }}</template>
89
+            </el-table-column>
90
+        </el-table>
91
+
92
+
93
+      
94
+
95
+        <el-pagination
96
+            @size-change="handleSizeChange"
97
+            @current-change="handleCurrentChange"
98
+            :page-sizes="[10, 50, 100]"
99
+            :page-size="10"
100
+            background
101
+            style="margin-top:20px;float: right"
102
+            layout="total, sizes, prev, pager, next, jumper"
103
+            :total="total"
104
+        >
105
+        </el-pagination>
106
+    </div>
107
+  </div>
108
+</template>
109
+
110
+<script>
111
+import BreadCrumb from "../../components/bread-crumb";
112
+
113
+export default {
114
+  name: "stockIn",
115
+  components: { BreadCrumb },
116
+  created() {
117
+    
118
+  },
119
+  data() {
120
+    return {
121
+        crumbs: [
122
+            { path: false, name: "库存管理" },
123
+            { path: false, name: "入库单" }
124
+        ],
125
+        searchKey: "",
126
+        tableData: [{
127
+            date: '2016-05-02',
128
+            name: '王小虎',
129
+            address: '上海市普陀区金沙江路 1518 弄'
130
+            }, {
131
+            date: '2016-05-04',
132
+            name: '王小虎',
133
+            address: '上海市普陀区金沙江路 1517 弄'
134
+            }, {
135
+            date: '2016-05-01',
136
+            name: '王小虎',
137
+            address: '上海市普陀区金沙江路 1519 弄'
138
+            }, {
139
+            date: '2016-05-03',
140
+            name: '王小虎',
141
+            address: '上海市普陀区金沙江路 1516 弄'
142
+        }]
143
+      
144
+    };
145
+  },
146
+  methods: {
147
+    
148
+  }
149
+};
150
+</script>
151
+
152
+<style rel="stylesheet/css" lang="scss" scoped>
153
+.information {
154
+  border: 1px #dcdfe6 solid;
155
+  padding: 30px 20px 30px 20px;
156
+
157
+  .border {
158
+    border-bottom: 1px #dcdfe6 solid;
159
+    margin: 0px 0 20px 0;
160
+  }
161
+}
162
+
163
+.edit_separater {
164
+  border-top: 1px solid rgb(233, 233, 233);
165
+  margin-top: 15px;
166
+  margin-bottom: 15px;
167
+}
168
+</style>
169
+
170
+<style>
171
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
172
+  font-size: 12px;
173
+}
174
+
175
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
176
+  background: #6fb5fa;
177
+}
178
+
179
+.count {
180
+  color: #bd2c00;
181
+}
182
+.el-table td,
183
+.el-table th.is-leaf,
184
+.el-table--border,
185
+.el-table--group {
186
+  border-color: #d0d3da;
187
+}
188
+.el-table--border::after,
189
+.el-table--group::after,
190
+.el-table::before {
191
+  background-color: #d0d3da;
192
+}
193
+</style>

+ 675 - 0
src/xt_pages/stock/drugs/reportLoss.vue View File

@@ -0,0 +1,675 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      <el-button
7
+        size="small"
8
+        @click="handleWarehouse"
9
+        class="filter-item"
10
+        style="float:right;"
11
+        type="primary"
12
+        icon="el-icon-circle-plus-outline"
13
+        >新增</el-button
14
+      >
15
+    </div>
16
+
17
+    <div class="app-container">
18
+      <div class="cell clearfix">
19
+        <el-input
20
+          size="small"
21
+          style="width: 400px;"
22
+          v-model.trim="searchKey"
23
+          class="filter-item"
24
+          placeholder="单据编码/制单人/厂商"
25
+        />
26
+        <el-button
27
+          size="small"
28
+          class="filter-item"
29
+          type="primary"
30
+          icon="el-icon-search"
31
+          @click="search"
32
+          >搜索</el-button
33
+        >
34
+      </div>
35
+
36
+      <div class="cell clearfix">
37
+        <label class="title"><span class="name">报损日期</span> : </label>
38
+        <el-date-picker
39
+          size="small"
40
+          v-model="start_time"
41
+          prefix-icon="el-icon-date"
42
+          :editable="false"
43
+          style="width: 196px;"
44
+          type="date"
45
+          placeholder="选择日期时间"
46
+          align="right"
47
+          format="yyyy-MM-dd"
48
+          value-format="yyyy-MM-dd"
49
+          @change="startTimeChange"
50
+        ></el-date-picker>
51
+        <span class="cellLine"> - </span>
52
+        <el-date-picker
53
+          size="small"
54
+          v-model="end_time"
55
+          prefix-icon="el-icon-date"
56
+          :editable="false"
57
+          style="width: 196px;"
58
+          type="date"
59
+          placeholder="选择日期时间"
60
+          align="right"
61
+          format="yyyy-MM-dd"
62
+          value-format="yyyy-MM-dd"
63
+          @change="endTimeChange"
64
+        ></el-date-picker>
65
+      </div>
66
+
67
+      <div class="cell clearfix">
68
+        <el-checkbox
69
+          style="width: 70px"
70
+          v-model="checked"
71
+          @change="changeAllSelected"
72
+          >全选</el-checkbox
73
+        >
74
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
75
+          >删除</el-button
76
+        >
77
+      </div>
78
+
79
+      <el-table
80
+        :data="Warehouse.warehouseDate"
81
+        :class="signAndWeighBoxPatients"
82
+        style="width: 100%"
83
+        border
84
+        highlight-current-row
85
+        v-loading="Warehouse.loading"
86
+        ref="multipleTable"
87
+        @selection-change="select"
88
+        :row-style="{ color: '#303133' }"
89
+        :header-cell-style="{
90
+          backgroundColor: 'rgb(245, 247, 250)',
91
+          color: '#606266'
92
+        }"
93
+      >
94
+        <el-table-column align="center" type="selection" width="55">
95
+        </el-table-column>
96
+
97
+        <el-table-column label="单据日期" align="center">
98
+          <template slot-scope="scope">
99
+            {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
100
+          </template>
101
+        </el-table-column>
102
+
103
+        <el-table-column label="单据编号" align="center">
104
+          <template slot-scope="scope">
105
+            {{ scope.row.warehousing_order }}
106
+          </template>
107
+        </el-table-column>
108
+
109
+        <el-table-column label="制单人" align="center">
110
+          <template slot-scope="scope">
111
+            {{ getXuserName(scope.row.creater) }}
112
+          </template>
113
+        </el-table-column>
114
+
115
+        <el-table-column label="厂家" align="center">
116
+          <template slot-scope="scope">
117
+            {{ getManufactuerName(scope.row.manufacturer) }}
118
+          </template>
119
+        </el-table-column>
120
+
121
+        <el-table-column label="经销商" align="center">
122
+          <template slot-scope="scope">
123
+            {{ getDealerName(scope.row.dealer) }}
124
+          </template>
125
+        </el-table-column>
126
+
127
+        <el-table-column label="操作" align="center">
128
+          <template slot-scope="scope">
129
+            <el-tooltip
130
+              class="item"
131
+              effect="dark"
132
+              content="编辑"
133
+              placement="top"
134
+            >
135
+              <el-button
136
+                size="small"
137
+                type="primary"
138
+                icon="el-icon-edit-outline"
139
+                @click="handleEdit(scope.$index, scope.row)"
140
+              >
141
+              </el-button>
142
+            </el-tooltip>
143
+            <el-tooltip
144
+              class="item"
145
+              effect="dark"
146
+              content="删除"
147
+              placement="top"
148
+            >
149
+              <el-button
150
+                size="small"
151
+                type="danger"
152
+                icon="el-icon-delete"
153
+                @click="handleDelete(scope.$index, scope.row)"
154
+              >
155
+              </el-button>
156
+            </el-tooltip>
157
+          </template>
158
+        </el-table-column>
159
+      </el-table>
160
+
161
+      <el-pagination
162
+        @size-change="handleSizeChange"
163
+        @current-change="handleCurrentChange"
164
+        :page-sizes="[10, 50, 100]"
165
+        :page-size="10"
166
+        background
167
+        style="margin-top:20px;float: right"
168
+        layout="total, sizes, prev, pager, next, jumper"
169
+        :total="total"
170
+      >
171
+      </el-pagination>
172
+    </div>
173
+  </div>
174
+</template>
175
+
176
+<script>
177
+import { uParseTime } from "@/utils/tools";
178
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
179
+import {
180
+  deleteWarehouseInfo,
181
+  GetAllConfig,
182
+  GetAllGoodInfo,
183
+  GetAllGoodType,
184
+  getWarehouseInfoList,
185
+  getWarehouseList
186
+} from "@/api/stock";
187
+import BreadCrumb from "../../components/bread-crumb";
188
+
189
+export default {
190
+  name: "stockIn",
191
+  components: { BreadCrumb },
192
+  created() {
193
+    // var nowDate = new Date();
194
+    //
195
+    // var year = new Date().getFullYear()
196
+    // var month = new Date().getMonth() + 1
197
+    // var day = nowDate.getDate()
198
+    // if (parseInt(month) < 10) {
199
+    //   month = '0' + month
200
+    // }
201
+    // if (parseInt(day) < 10) {
202
+    //   day = '0' + day
203
+    // }
204
+    // const endTime = year + '-' + month + '-' + day
205
+    // this.end_time = endTime
206
+    //
207
+    //
208
+    // var year = new Date().getFullYear()
209
+    // var month = new Date().getMonth()
210
+    // var day = new Date().getDate()
211
+    //
212
+    // day.setMonth(day.getMonth() - 3);
213
+    //
214
+    // if (parseInt(month) < 10) {
215
+    //   month = '0' + month
216
+    // }
217
+    // if (parseInt(day) < 10) {
218
+    //   day = '0' + day
219
+    // }
220
+    // const startTime = year + '-' + month + '-' + day
221
+    // this.start_time = startTime
222
+
223
+    var nowDate = new Date();
224
+    var nowYear = nowDate.getFullYear();
225
+    var nowMonth = nowDate.getMonth() + 1;
226
+    var nowDay = nowDate.getDate();
227
+    this.end_time =
228
+      nowYear +
229
+      "-" +
230
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
231
+      "-" +
232
+      (nowDay < 10 ? "0" + nowDay : nowDay);
233
+    nowDate.setMonth(nowDate.getMonth() - 1);
234
+    nowYear = nowDate.getFullYear();
235
+    nowMonth = nowDate.getMonth() + 1;
236
+    nowDay = nowDate.getDate();
237
+    this.start_time =
238
+      nowYear +
239
+      "-" +
240
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
241
+      "-" +
242
+      (nowDay < 10 ? "0" + nowDay : nowDay);
243
+
244
+    this.GetWarehouse();
245
+    this.GetConfigInfo();
246
+    this.fetchAllAdminUsers();
247
+  },
248
+  data() {
249
+    return {
250
+      crumbs: [
251
+        { path: false, name: "库存管理" },
252
+        { path: false, name: "入库单" }
253
+      ],
254
+      searchKey: "",
255
+      type: 1,
256
+      page: 1,
257
+      limit: 10,
258
+      checked: false,
259
+      total: 0,
260
+      pageTotal: 0,
261
+      pageSelect: 0,
262
+      adminUserOptions: [],
263
+      multipleSelection: [],
264
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
265
+      start_time: "",
266
+      end_time: "",
267
+      goodType: [],
268
+      goodInfo: [],
269
+      manufacturer: [],
270
+      selectedTableData: [],
271
+      dealer: [],
272
+      Warehouse: {
273
+        loading: false,
274
+        warehouseDate: [],
275
+        tableCurrentIndex: ""
276
+      },
277
+
278
+      WarehouseInfo: {
279
+        loading: false,
280
+        warehouseInfoDate: []
281
+      },
282
+      startTime: ""
283
+    };
284
+  },
285
+  methods: {
286
+    search: function() {
287
+      const Params = {
288
+        page: this.page,
289
+        limit: this.limit,
290
+        start_time: this.start_time,
291
+        end_time: this.end_time,
292
+        type: this.type,
293
+        keywords: this.searchKey
294
+      };
295
+      this.Warehouse.warehouseDate = [];
296
+      getWarehouseList(Params).then(response => {
297
+        if (response.data.state == 0) {
298
+          this.Warehouse.loading = false;
299
+          this.$message.error(response.data.msg);
300
+          return false;
301
+        } else {
302
+          this.Warehouse.loading = false;
303
+          this.total = response.data.data.total;
304
+          for (let i = 0; i < response.data.data.list.length; i++) {
305
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
306
+          }
307
+        }
308
+      });
309
+    },
310
+    GetWarehouse: function() {
311
+      const Params = {
312
+        page: this.page,
313
+        limit: this.limit,
314
+        start_time: this.start_time,
315
+        end_time: this.end_time,
316
+        type: this.type
317
+      };
318
+      this.Warehouse.warehouseDate = [];
319
+      getWarehouseList(Params).then(response => {
320
+        if (response.data.state == 0) {
321
+          this.Warehouse.loading = false;
322
+          this.$message.error(response.data.msg);
323
+          return false;
324
+        } else {
325
+          this.Warehouse.loading = false;
326
+          this.total = response.data.data.total;
327
+          for (let i = 0; i < response.data.data.list.length; i++) {
328
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
329
+          }
330
+        }
331
+      });
332
+    },
333
+    tableRowClassName({ row, rowIndex }) {
334
+      // 把每一行的索引放进row
335
+      row.index = rowIndex;
336
+    },
337
+    onRowClick(row, event, column) {
338
+      this.WarehouseInfo.warehouseInfoDate = [];
339
+      this.Warehouse.tableCurrentIndex = row.index;
340
+      const params = {
341
+        id: row.id
342
+      };
343
+      this.WarehouseInfo.loading = true;
344
+      getWarehouseInfoList(params).then(response => {
345
+        if (response.data.state == 0) {
346
+          this.WarehouseInfo.loading = false;
347
+          this.$message.error(response.data.msg);
348
+          return false;
349
+        } else {
350
+          this.WarehouseInfo.loading = false;
351
+          for (let i = 0; i < response.data.data.info.length; i++) {
352
+            this.WarehouseInfo.warehouseInfoDate.push(
353
+              response.data.data.info[i]
354
+            );
355
+          }
356
+        }
357
+      });
358
+    },
359
+    getXuserName(id) {
360
+      if (id <= 0) {
361
+        return "";
362
+      }
363
+      var name = "";
364
+      if (
365
+        this.adminUserOptions == null ||
366
+        typeof this.adminUserOptions.length === "undefined"
367
+      ) {
368
+        return name;
369
+      }
370
+      var leng = this.adminUserOptions.length;
371
+      if (leng == 0) {
372
+        return name;
373
+      }
374
+      for (let index = 0; index < leng; index++) {
375
+        if (this.adminUserOptions[index].id == id) {
376
+          name = this.adminUserOptions[index].name;
377
+          break;
378
+        }
379
+      }
380
+      return name;
381
+    },
382
+    fetchAllDoctorAndNurse() {
383
+      fetchAllDoctorAndNurse().then(response => {
384
+        if (response.data.state == 1) {
385
+          this.doctorOptions = response.data.data.doctors;
386
+        }
387
+      });
388
+    },
389
+    fetchAllAdminUsers() {
390
+      fetchAllAdminUsers().then(response => {
391
+        console.log(response);
392
+        if (response.data.state == 1) {
393
+          this.adminUserOptions = response.data.data.users;
394
+          var alen = this.adminUserOptions.length;
395
+          for (let index = 0; index < alen; index++) {
396
+            if (this.adminUserOptions[index].user_type == 2) {
397
+              // this.doctorOptions.push(this.adminUserOptions[index]);
398
+            }
399
+          }
400
+        }
401
+      });
402
+    },
403
+    getSpecificationName: function(id) {
404
+      let name = "";
405
+      for (let i = 0; i < this.goodInfo.length; i++) {
406
+        if (this.goodInfo[i].id == id) {
407
+          name = this.goodInfo[i].specification_name;
408
+        }
409
+      }
410
+
411
+      return name;
412
+    },
413
+    getTypeName: function(id) {
414
+      let name = "";
415
+      for (let i = 0; i < this.goodType.length; i++) {
416
+        if (this.goodType[i].id == id) {
417
+          name = this.goodType[i].type_name;
418
+        }
419
+      }
420
+      return name;
421
+    },
422
+    GetAllGoodType: function() {
423
+      GetAllGoodType().then(response => {
424
+        if (response.data.state == 0) {
425
+          this.$message.error(response.data.msg);
426
+          return false;
427
+        } else {
428
+          for (let i = 0; i < response.data.data.goodType.length; i++) {
429
+            this.goodType.push(response.data.data.goodType[i]);
430
+          }
431
+        }
432
+      });
433
+    },
434
+    GetAllGoodInfo: function() {
435
+      GetAllGoodInfo().then(response => {
436
+        if (response.data.state == 0) {
437
+          this.$message.error(response.data.msg);
438
+          return false;
439
+        } else {
440
+          for (let i = 0; i < response.data.data.goodInfo.length; i++) {
441
+            this.goodInfo.push(response.data.data.goodInfo[i]);
442
+          }
443
+        }
444
+      });
445
+    },
446
+    clicks: function() {
447
+      console.log(this.WarehouseInfo.warehouseInfoDate);
448
+    },
449
+    handleWarehouse: function() {
450
+      this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
451
+    },
452
+    handleReturnSales: function() {
453
+      // this.$router.push({path:'/patients/create'}
454
+      if (this.multipleSelection.length <= 0) {
455
+        this.$message.error("请选择退货商品");
456
+        return;
457
+      }
458
+
459
+      const ids = [];
460
+      for (let i = 0; i < this.multipleSelection.length; i++) {
461
+        ids.push(this.multipleSelection[i].id);
462
+      }
463
+      this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
464
+    },
465
+    handleReturnSalesRecord: function() {
466
+      this.$router.push({ name: "salesReutrnRecord" });
467
+    },
468
+    handleWarehouseRecord: function() {
469
+      this.$router.push({ name: "warehouseRecord" });
470
+    },
471
+    handleSelectionChange: function(val) {
472
+      this.multipleSelection = val;
473
+    },
474
+    handleSizeChange(val) {
475
+      this.limit = val;
476
+      this.GetWarehouse();
477
+    },
478
+    handleCurrentChange(val) {
479
+      this.page = val;
480
+      this.GetWarehouse();
481
+    },
482
+    startTimeChange(val) {
483
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
484
+      if (time > 0) {
485
+        this.$message.error("结束时间不能小于开始时间");
486
+        this.start_time = "";
487
+      } else {
488
+        this.startTime = this.getTimestamp(val);
489
+        this.GetWarehouse();
490
+      }
491
+    },
492
+    endTimeChange(val) {
493
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
494
+      if (time < 0) {
495
+        this.$message.error("结束时间不能小于开始时间");
496
+        this.end_time = "";
497
+      } else {
498
+        this.GetWarehouse();
499
+      }
500
+    },
501
+    getTimestamp(time) {
502
+      // 把时间日期转成时间戳
503
+      return new Date(time).getTime() / 1000;
504
+    },
505
+    calculate: function(val) {
506
+      return Math.round(parseFloat(val) * 100) / 100;
507
+    },
508
+    GetConfigInfo: function() {
509
+      GetAllConfig().then(response => {
510
+        if (response.data.state == 0) {
511
+          this.$message.error(response.data.msg);
512
+          return false;
513
+        } else {
514
+          this.manufacturer = response.data.data.manufacturer;
515
+          this.dealer = response.data.data.dealer;
516
+        }
517
+      });
518
+    },
519
+    getManufactuerName: function(manufacturer_id) {
520
+      for (let i = 0; i < this.manufacturer.length; i++) {
521
+        if (this.manufacturer[i].id == manufacturer_id) {
522
+          return this.manufacturer[i].manufacturer_name;
523
+        }
524
+      }
525
+    },
526
+    getDealerName: function(dealer_id) {
527
+      for (let i = 0; i < this.dealer.length; i++) {
528
+        if (this.dealer[i].id == dealer_id) {
529
+          return this.dealer[i].dealer_name;
530
+        }
531
+      }
532
+    },
533
+    handleEdit: function(index, row) {
534
+      this.$router.push({
535
+        name: "stockInDetail",
536
+        query: { id: row.id, type: this.type }
537
+      });
538
+    },
539
+    handleDelete: function(index, row) {
540
+      const ids = [];
541
+      ids.push(row.id);
542
+      const idStr = ids.join(",");
543
+
544
+      const params = {
545
+        ids: idStr
546
+      };
547
+
548
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
549
+        confirmButtonText: "确定",
550
+        cancelButtonText: "取消",
551
+        type: "warning"
552
+      })
553
+        .then(() => {
554
+          deleteWarehouseInfo(params).then(response => {
555
+            if (response.data.state == 0) {
556
+              this.$message.error(response.data.msg);
557
+              return false;
558
+            } else {
559
+              this.$notify({
560
+                title: "成功",
561
+                message: "删除成功",
562
+                type: "success",
563
+                duration: 2000
564
+              });
565
+              for (let i = 0; i < ids.length; i++) {
566
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
567
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
568
+                    this.Warehouse.warehouseDate.splice(y, 1);
569
+                  }
570
+                }
571
+              }
572
+            }
573
+          });
574
+        })
575
+        .catch(() => {});
576
+    },
577
+    changeAllSelected: function(val) {
578
+      if (val) {
579
+        this.$refs.multipleTable.toggleAllSelection();
580
+      } else {
581
+        this.$refs.multipleTable.clearSelection();
582
+      }
583
+    },
584
+    select(selection) {
585
+      this.selectedTableData = selection;
586
+    },
587
+    batchDelete() {
588
+      if (this.selectedTableData.length <= 0) {
589
+        this.$message.error("请选择要删除的记录");
590
+        return;
591
+      }
592
+      const ids = [];
593
+      for (let i = 0; i < this.selectedTableData.length; i++) {
594
+        ids.push(this.selectedTableData[i].id);
595
+      }
596
+      const idStr = ids.join(",");
597
+      const params = {
598
+        ids: idStr
599
+      };
600
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
601
+        confirmButtonText: "确定",
602
+        cancelButtonText: "取消",
603
+        type: "warning"
604
+      })
605
+        .then(() => {
606
+          deleteWarehouseInfo(params).then(response => {
607
+            if (response.data.state == 0) {
608
+              this.$message.error(response.data.msg);
609
+              return false;
610
+            } else {
611
+              this.$notify({
612
+                title: "成功",
613
+                message: "删除成功",
614
+                type: "success",
615
+                duration: 2000
616
+              });
617
+
618
+              for (let i = 0; i < ids.length; i++) {
619
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
620
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
621
+                    this.Warehouse.warehouseDate.splice(y, 1);
622
+                  }
623
+                }
624
+              }
625
+            }
626
+          });
627
+        })
628
+        .catch(() => {});
629
+    }
630
+  }
631
+};
632
+</script>
633
+
634
+<style rel="stylesheet/css" lang="scss" scoped>
635
+.information {
636
+  border: 1px #dcdfe6 solid;
637
+  padding: 30px 20px 30px 20px;
638
+
639
+  .border {
640
+    border-bottom: 1px #dcdfe6 solid;
641
+    margin: 0px 0 20px 0;
642
+  }
643
+}
644
+
645
+.edit_separater {
646
+  border-top: 1px solid rgb(233, 233, 233);
647
+  margin-top: 15px;
648
+  margin-bottom: 15px;
649
+}
650
+</style>
651
+
652
+<style>
653
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
654
+  font-size: 12px;
655
+}
656
+
657
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
658
+  background: #6fb5fa;
659
+}
660
+
661
+.count {
662
+  color: #bd2c00;
663
+}
664
+.el-table td,
665
+.el-table th.is-leaf,
666
+.el-table--border,
667
+.el-table--group {
668
+  border-color: #d0d3da;
669
+}
670
+.el-table--border::after,
671
+.el-table--group::after,
672
+.el-table::before {
673
+  background-color: #d0d3da;
674
+}
675
+</style>

+ 531 - 0
src/xt_pages/stock/drugs/stockCancel.vue View File

@@ -0,0 +1,531 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <el-button
6
+        size="small"
7
+        @click="AddNewOrder"
8
+        class="filter-item"
9
+        style="float:right;"
10
+        type="primary"
11
+        icon="el-icon-circle-plus-outline"
12
+        >新增
13
+      </el-button>
14
+    </div>
15
+
16
+    <div class="app-container">
17
+      <div class="cell clearfix">
18
+        <el-input
19
+          size="small"
20
+          style="width: 400px;"
21
+          class="filter-item"
22
+          v-model.trim="searchKey"
23
+          placeholder="单据编码/制单人/厂商"
24
+        />
25
+        <el-button
26
+          size="small"
27
+          class="filter-item"
28
+          type="primary"
29
+          icon="el-icon-search"
30
+          @click="search"
31
+          >搜索</el-button
32
+        >
33
+      </div>
34
+
35
+      <div class="cell clearfix">
36
+        <label class="title"><span class="name">退库时间</span> : </label>
37
+        <el-date-picker
38
+          size="small"
39
+          v-model="start_time"
40
+          prefix-icon="el-icon-date"
41
+          :editable="false"
42
+          style="width: 196px;"
43
+          type="date"
44
+          placeholder="选择日期时间"
45
+          align="right"
46
+          format="yyyy-MM-dd"
47
+          value-format="yyyy-MM-dd"
48
+          @change="startTimeChange"
49
+        ></el-date-picker>
50
+        <span class="cellLine"> - </span>
51
+        <el-date-picker
52
+          size="small"
53
+          v-model="end_time"
54
+          prefix-icon="el-icon-date"
55
+          :editable="false"
56
+          style="width: 196px;"
57
+          type="date"
58
+          placeholder="选择日期时间"
59
+          align="right"
60
+          format="yyyy-MM-dd"
61
+          value-format="yyyy-MM-dd"
62
+          @change="endTimeChange"
63
+        ></el-date-picker>
64
+      </div>
65
+
66
+      <div class="filter-container" style="margin-top: 10px">
67
+        <el-checkbox
68
+          style="width: 70px"
69
+          v-model="checked"
70
+          @change="changeAllSelected"
71
+          >全选</el-checkbox
72
+        >
73
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
74
+          >删除</el-button
75
+        >
76
+      </div>
77
+
78
+      <el-row :gutter="12" style="margin-top: 10px">
79
+        <el-table
80
+          :data="cancelStockDate"
81
+          :class="signAndWeighBoxPatients"
82
+          border
83
+          highlight-current-row
84
+          ref="multipleTable"
85
+          @selection-change="select"
86
+          :row-style="{ color: '#303133' }"
87
+          :header-cell-style="{
88
+            backgroundColor: 'rgb(245, 247, 250)',
89
+            color: '#606266'
90
+          }"
91
+        >
92
+          <el-table-column type="selection" width="55"> </el-table-column>
93
+
94
+          <el-table-column label="单据日期" align="center">
95
+            <template slot-scope="scope">
96
+              {{ scope.row.return_time | parseTime("{y}-{m}-{d}") }}
97
+            </template>
98
+          </el-table-column>
99
+
100
+          <el-table-column label="单据编号" align="center">
101
+            <template slot-scope="scope">
102
+              {{ scope.row.order_number }}
103
+            </template>
104
+          </el-table-column>
105
+
106
+          <el-table-column label="制单人" align="center">
107
+            <template slot-scope="scope">
108
+              {{ getXuserName(scope.row.creater) }}
109
+            </template>
110
+          </el-table-column>
111
+
112
+          <el-table-column label="厂家" align="center">
113
+            <template slot-scope="scope">
114
+              {{ getManufactuerName(scope.row.manufacturer) }}
115
+            </template>
116
+          </el-table-column>
117
+
118
+          <el-table-column label="经销商" align="center">
119
+            <template slot-scope="scope">
120
+              {{ getDealerName(scope.row.dealer) }}
121
+            </template>
122
+          </el-table-column>
123
+
124
+          <el-table-column label="操作" align="center">
125
+            <template slot-scope="scope">
126
+              <el-tooltip
127
+                class="item"
128
+                effect="dark"
129
+                content="编辑"
130
+                placement="top"
131
+              >
132
+                <el-button
133
+                  size="mini"
134
+                  type="primary"
135
+                  icon="el-icon-edit-outline"
136
+                  @click="handleEdit(scope.$index, scope.row)"
137
+                >
138
+                </el-button>
139
+              </el-tooltip>
140
+              <el-tooltip
141
+                class="item"
142
+                effect="dark"
143
+                content="删除"
144
+                placement="top"
145
+              >
146
+                <el-button
147
+                  size="mini"
148
+                  type="danger"
149
+                  icon="el-icon-delete"
150
+                  @click="handleDelete(scope.$index, scope.row)"
151
+                >
152
+                </el-button>
153
+              </el-tooltip>
154
+            </template>
155
+          </el-table-column>
156
+        </el-table>
157
+
158
+        <el-pagination
159
+          @size-change="handleSizeChange"
160
+          @current-change="handleCurrentChange"
161
+          :page-sizes="[10, 50, 100]"
162
+          :page-size="10"
163
+          background
164
+          style="margin-top:20px;float: right"
165
+          layout="total, sizes, prev, pager, next, jumper"
166
+          :total="total"
167
+        >
168
+        </el-pagination>
169
+      </el-row>
170
+    </div>
171
+  </div>
172
+</template>
173
+
174
+<script>
175
+import { uParseTime } from "@/utils/tools";
176
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
177
+import {
178
+  deleteCancelStock,
179
+  GetAllConfig,
180
+  getCancelStockList
181
+} from "@/api/stock";
182
+import BreadCrumb from "../../components/bread-crumb";
183
+
184
+export default {
185
+  name: "salesReturnOrder",
186
+  components: { BreadCrumb },
187
+  created() {
188
+    var nowDate = new Date();
189
+    var nowYear = nowDate.getFullYear();
190
+    var nowMonth = nowDate.getMonth() + 1;
191
+    var nowDay = nowDate.getDate();
192
+    this.end_time =
193
+      nowYear +
194
+      "-" +
195
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
196
+      "-" +
197
+      (nowDay < 10 ? "0" + nowDay : nowDay);
198
+    nowDate.setMonth(nowDate.getMonth() - 1);
199
+    nowYear = nowDate.getFullYear();
200
+    nowMonth = nowDate.getMonth() + 1;
201
+    nowDay = nowDate.getDate();
202
+    this.start_time =
203
+      nowYear +
204
+      "-" +
205
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
206
+      "-" +
207
+      (nowDay < 10 ? "0" + nowDay : nowDay);
208
+
209
+    this.GetCancelStock();
210
+    this.GetConfigInfo();
211
+    this.fetchAllAdminUsers();
212
+  },
213
+  data() {
214
+    return {
215
+      crumbs: [
216
+        { path: false, name: "库存管理" },
217
+        { path: false, name: "出库退库单" }
218
+      ],
219
+      searchKey: "",
220
+      type: 1,
221
+      page: 1,
222
+      limit: 10,
223
+      checked: false,
224
+      total: 0,
225
+      pageTotal: 0,
226
+      pageSelect: 0,
227
+      adminUserOptions: [],
228
+      multipleSelection: [],
229
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
230
+      start_time: "",
231
+      cancelStockDate: [],
232
+      end_time: "",
233
+      goodType: [],
234
+      goodInfo: [],
235
+      manufacturer: [],
236
+      selectedTableData: [],
237
+      dealer: []
238
+    };
239
+  },
240
+  methods: {
241
+    search: function() {
242
+      const Params = {
243
+        page: this.page,
244
+        limit: this.limit,
245
+        start_time: this.start_time,
246
+        end_time: this.end_time,
247
+        type: this.type,
248
+        keywords: this.searchKey
249
+      };
250
+      this.cancelStockDate = [];
251
+      getCancelStockList(Params).then(response => {
252
+        if (response.data.state == 0) {
253
+          this.$message.error(response.data.msg);
254
+          return false;
255
+        } else {
256
+          this.total = response.data.data.total;
257
+          for (let i = 0; i < response.data.data.list.length; i++) {
258
+            this.cancelStockDate.push(response.data.data.list[i]);
259
+          }
260
+        }
261
+      });
262
+    },
263
+    AddNewOrder: function() {
264
+      this.$router.push({
265
+        name: "cancelStockOrderAdd",
266
+        query: { type: this.type }
267
+      });
268
+    },
269
+    GetCancelStock: function() {
270
+      const Params = {
271
+        page: this.page,
272
+        limit: this.limit,
273
+        start_time: this.start_time,
274
+        end_time: this.end_time,
275
+        type: this.type
276
+      };
277
+      this.cancelStockDate = [];
278
+      getCancelStockList(Params).then(response => {
279
+        if (response.data.state == 0) {
280
+          this.$message.error(response.data.msg);
281
+          return false;
282
+        } else {
283
+          this.total = response.data.data.total;
284
+          for (let i = 0; i < response.data.data.list.length; i++) {
285
+            this.cancelStockDate.push(response.data.data.list[i]);
286
+          }
287
+        }
288
+      });
289
+    },
290
+    getXuserName(id) {
291
+      if (id <= 0) {
292
+        return "";
293
+      }
294
+      var name = "";
295
+      if (
296
+        this.adminUserOptions == null ||
297
+        typeof this.adminUserOptions.length === "undefined"
298
+      ) {
299
+        return name;
300
+      }
301
+      var leng = this.adminUserOptions.length;
302
+      if (leng == 0) {
303
+        return name;
304
+      }
305
+      for (let index = 0; index < leng; index++) {
306
+        if (this.adminUserOptions[index].id == id) {
307
+          name = this.adminUserOptions[index].name;
308
+          break;
309
+        }
310
+      }
311
+      return name;
312
+    },
313
+    fetchAllAdminUsers() {
314
+      fetchAllAdminUsers().then(response => {
315
+        console.log(response);
316
+        if (response.data.state == 1) {
317
+          this.adminUserOptions = response.data.data.users;
318
+          var alen = this.adminUserOptions.length;
319
+          for (let index = 0; index < alen; index++) {
320
+            if (this.adminUserOptions[index].user_type == 2) {
321
+              // this.doctorOptions.push(this.adminUserOptions[index]);
322
+            }
323
+          }
324
+        }
325
+      });
326
+    },
327
+    handleSelectionChange: function(val) {
328
+      this.multipleSelection = val;
329
+    },
330
+    handleSizeChange(val) {
331
+      this.limit = val;
332
+      this.GetCancelStock();
333
+    },
334
+    handleCurrentChange(val) {
335
+      this.page = val;
336
+      this.GetCancelStock();
337
+    },
338
+    startTimeChange(val) {
339
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
340
+      if (time > 0) {
341
+        this.$message.error("结束时间不能小于开始时间");
342
+        this.start_time = "";
343
+      } else {
344
+        this.GetCancelStock();
345
+      }
346
+      this.GetCancelStock();
347
+    },
348
+    endTimeChange(val) {
349
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
350
+      if (time < 0) {
351
+        this.$message.error("结束时间不能小于开始时间");
352
+        this.end_time = "";
353
+      } else {
354
+        this.GetCancelStock();
355
+      }
356
+    },
357
+    getTimestamp(time) {
358
+      // 把时间日期转成时间戳
359
+      return new Date(time).getTime() / 1000;
360
+    },
361
+    calculate: function(val) {
362
+      return Math.round(parseFloat(val) * 100) / 100;
363
+    },
364
+    GetConfigInfo: function() {
365
+      GetAllConfig().then(response => {
366
+        if (response.data.state == 0) {
367
+          this.$message.error(response.data.msg);
368
+          return false;
369
+        } else {
370
+          this.manufacturer = response.data.data.manufacturer;
371
+          this.dealer = response.data.data.dealer;
372
+        }
373
+      });
374
+    },
375
+    getManufactuerName: function(manufacturer_id) {
376
+      for (let i = 0; i < this.manufacturer.length; i++) {
377
+        if (this.manufacturer[i].id == manufacturer_id) {
378
+          return this.manufacturer[i].manufacturer_name;
379
+        }
380
+      }
381
+    },
382
+    getDealerName: function(dealer_id) {
383
+      for (let i = 0; i < this.dealer.length; i++) {
384
+        if (this.dealer[i].id == dealer_id) {
385
+          return this.dealer[i].dealer_name;
386
+        }
387
+      }
388
+    },
389
+    handleEdit: function(index, row) {
390
+      this.$router.push({
391
+        name: "cancelStockDetail",
392
+        query: { id: row.id, type: this.type }
393
+      });
394
+    },
395
+    handleDelete: function(index, row) {
396
+      const ids = [];
397
+      ids.push(row.id);
398
+      const idStr = ids.join(",");
399
+
400
+      const params = {
401
+        ids: idStr
402
+      };
403
+
404
+      this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
405
+        confirmButtonText: "确定",
406
+        cancelButtonText: "取消",
407
+        type: "warning"
408
+      })
409
+        .then(() => {
410
+          deleteCancelStock(params).then(response => {
411
+            if (response.data.state == 0) {
412
+              this.$message.error(response.data.msg);
413
+              return false;
414
+            } else {
415
+              this.$notify({
416
+                title: "成功",
417
+                message: "删除成功",
418
+                type: "success",
419
+                duration: 2000
420
+              });
421
+              for (let i = 0; i < ids.length; i++) {
422
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
423
+                  if (ids[i] == this.cancelStockDate[y].id) {
424
+                    this.cancelStockDate.splice(y, 1);
425
+                  }
426
+                }
427
+              }
428
+            }
429
+          });
430
+        })
431
+        .catch(() => {});
432
+    },
433
+    changeAllSelected: function(val) {
434
+      if (val) {
435
+        this.$refs.multipleTable.toggleAllSelection();
436
+      } else {
437
+        this.$refs.multipleTable.clearSelection();
438
+      }
439
+    },
440
+    select(selection) {
441
+      this.selectedTableData = selection;
442
+    },
443
+    batchDelete() {
444
+      if (this.selectedTableData.length <= 0) {
445
+        this.$message.error("请选择要删除的记录");
446
+        return;
447
+      }
448
+      const ids = [];
449
+      for (let i = 0; i < this.selectedTableData.length; i++) {
450
+        ids.push(this.selectedTableData[i].id);
451
+      }
452
+      const idStr = ids.join(",");
453
+      const params = {
454
+        ids: idStr
455
+      };
456
+      this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
457
+        confirmButtonText: "确定",
458
+        cancelButtonText: "取消",
459
+        type: "warning"
460
+      })
461
+        .then(() => {
462
+          deleteCancelStock(params).then(response => {
463
+            if (response.data.state == 0) {
464
+              this.$message.error(response.data.msg);
465
+              return false;
466
+            } else {
467
+              this.$notify({
468
+                title: "成功",
469
+                message: "删除成功",
470
+                type: "success",
471
+                duration: 2000
472
+              });
473
+
474
+              for (let i = 0; i < ids.length; i++) {
475
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
476
+                  if (ids[i] == this.cancelStockDate[y].id) {
477
+                    this.cancelStockDate.splice(y, 1);
478
+                  }
479
+                }
480
+              }
481
+            }
482
+          });
483
+        })
484
+        .catch(() => {});
485
+    }
486
+  }
487
+};
488
+</script>
489
+
490
+<style rel="stylesheet/css" lang="scss" scoped>
491
+.information {
492
+  border: 1px #dcdfe6 solid;
493
+  padding: 30px 20px 30px 20px;
494
+
495
+  .border {
496
+    border-bottom: 1px #dcdfe6 solid;
497
+    margin: 0px 0 20px 0;
498
+  }
499
+}
500
+
501
+.edit_separater {
502
+  border-top: 1px solid rgb(233, 233, 233);
503
+  margin-top: 15px;
504
+  margin-bottom: 15px;
505
+}
506
+</style>
507
+
508
+<style>
509
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
510
+  font-size: 12px;
511
+}
512
+
513
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
514
+  background: #6fb5fa;
515
+}
516
+
517
+.count {
518
+  color: #bd2c00;
519
+}
520
+.el-table td,
521
+.el-table th.is-leaf,
522
+.el-table--border,
523
+.el-table--group {
524
+  border-color: #d0d3da;
525
+}
526
+.el-table--border::after,
527
+.el-table--group::after,
528
+.el-table::before {
529
+  background-color: #d0d3da;
530
+}
531
+</style>

+ 675 - 0
src/xt_pages/stock/drugs/stockIn.vue View File

@@ -0,0 +1,675 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      <el-button
7
+        size="small"
8
+        @click="handleWarehouse"
9
+        class="filter-item"
10
+        style="float:right;"
11
+        type="primary"
12
+        icon="el-icon-circle-plus-outline"
13
+        >新增</el-button
14
+      >
15
+    </div>
16
+
17
+    <div class="app-container">
18
+      <div class="cell clearfix">
19
+        <el-input
20
+          size="small"
21
+          style="width: 400px;"
22
+          v-model.trim="searchKey"
23
+          class="filter-item"
24
+          placeholder="单据编码/制单人/厂商"
25
+        />
26
+        <el-button
27
+          size="small"
28
+          class="filter-item"
29
+          type="primary"
30
+          icon="el-icon-search"
31
+          @click="search"
32
+          >搜索</el-button
33
+        >
34
+      </div>
35
+
36
+      <div class="cell clearfix">
37
+        <label class="title"><span class="name">入库时间</span> : </label>
38
+        <el-date-picker
39
+          size="small"
40
+          v-model="start_time"
41
+          prefix-icon="el-icon-date"
42
+          :editable="false"
43
+          style="width: 196px;"
44
+          type="date"
45
+          placeholder="选择日期时间"
46
+          align="right"
47
+          format="yyyy-MM-dd"
48
+          value-format="yyyy-MM-dd"
49
+          @change="startTimeChange"
50
+        ></el-date-picker>
51
+        <span class="cellLine"> - </span>
52
+        <el-date-picker
53
+          size="small"
54
+          v-model="end_time"
55
+          prefix-icon="el-icon-date"
56
+          :editable="false"
57
+          style="width: 196px;"
58
+          type="date"
59
+          placeholder="选择日期时间"
60
+          align="right"
61
+          format="yyyy-MM-dd"
62
+          value-format="yyyy-MM-dd"
63
+          @change="endTimeChange"
64
+        ></el-date-picker>
65
+      </div>
66
+
67
+      <div class="cell clearfix">
68
+        <el-checkbox
69
+          style="width: 70px"
70
+          v-model="checked"
71
+          @change="changeAllSelected"
72
+          >全选</el-checkbox
73
+        >
74
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
75
+          >删除</el-button
76
+        >
77
+      </div>
78
+
79
+      <el-table
80
+        :data="Warehouse.warehouseDate"
81
+        :class="signAndWeighBoxPatients"
82
+        style="width: 100%"
83
+        border
84
+        highlight-current-row
85
+        v-loading="Warehouse.loading"
86
+        ref="multipleTable"
87
+        @selection-change="select"
88
+        :row-style="{ color: '#303133' }"
89
+        :header-cell-style="{
90
+          backgroundColor: 'rgb(245, 247, 250)',
91
+          color: '#606266'
92
+        }"
93
+      >
94
+        <el-table-column align="center" type="selection" width="55">
95
+        </el-table-column>
96
+
97
+        <el-table-column label="单据日期" align="center">
98
+          <template slot-scope="scope">
99
+            {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
100
+          </template>
101
+        </el-table-column>
102
+
103
+        <el-table-column label="单据编号" align="center">
104
+          <template slot-scope="scope">
105
+            {{ scope.row.warehousing_order }}
106
+          </template>
107
+        </el-table-column>
108
+
109
+        <el-table-column label="制单人" align="center">
110
+          <template slot-scope="scope">
111
+            {{ getXuserName(scope.row.creater) }}
112
+          </template>
113
+        </el-table-column>
114
+
115
+        <el-table-column label="厂家" align="center">
116
+          <template slot-scope="scope">
117
+            {{ getManufactuerName(scope.row.manufacturer) }}
118
+          </template>
119
+        </el-table-column>
120
+
121
+        <el-table-column label="经销商" align="center">
122
+          <template slot-scope="scope">
123
+            {{ getDealerName(scope.row.dealer) }}
124
+          </template>
125
+        </el-table-column>
126
+
127
+        <el-table-column label="操作" align="center">
128
+          <template slot-scope="scope">
129
+            <el-tooltip
130
+              class="item"
131
+              effect="dark"
132
+              content="编辑"
133
+              placement="top"
134
+            >
135
+              <el-button
136
+                size="small"
137
+                type="primary"
138
+                icon="el-icon-edit-outline"
139
+                @click="handleEdit(scope.$index, scope.row)"
140
+              >
141
+              </el-button>
142
+            </el-tooltip>
143
+            <el-tooltip
144
+              class="item"
145
+              effect="dark"
146
+              content="删除"
147
+              placement="top"
148
+            >
149
+              <el-button
150
+                size="small"
151
+                type="danger"
152
+                icon="el-icon-delete"
153
+                @click="handleDelete(scope.$index, scope.row)"
154
+              >
155
+              </el-button>
156
+            </el-tooltip>
157
+          </template>
158
+        </el-table-column>
159
+      </el-table>
160
+
161
+      <el-pagination
162
+        @size-change="handleSizeChange"
163
+        @current-change="handleCurrentChange"
164
+        :page-sizes="[10, 50, 100]"
165
+        :page-size="10"
166
+        background
167
+        style="margin-top:20px;float: right"
168
+        layout="total, sizes, prev, pager, next, jumper"
169
+        :total="total"
170
+      >
171
+      </el-pagination>
172
+    </div>
173
+  </div>
174
+</template>
175
+
176
+<script>
177
+import { uParseTime } from "@/utils/tools";
178
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
179
+import {
180
+  deleteWarehouseInfo,
181
+  GetAllConfig,
182
+  GetAllGoodInfo,
183
+  GetAllGoodType,
184
+  getWarehouseInfoList,
185
+  getWarehouseList
186
+} from "@/api/stock";
187
+import BreadCrumb from "../../components/bread-crumb";
188
+
189
+export default {
190
+  name: "stockIn",
191
+  components: { BreadCrumb },
192
+  created() {
193
+    // var nowDate = new Date();
194
+    //
195
+    // var year = new Date().getFullYear()
196
+    // var month = new Date().getMonth() + 1
197
+    // var day = nowDate.getDate()
198
+    // if (parseInt(month) < 10) {
199
+    //   month = '0' + month
200
+    // }
201
+    // if (parseInt(day) < 10) {
202
+    //   day = '0' + day
203
+    // }
204
+    // const endTime = year + '-' + month + '-' + day
205
+    // this.end_time = endTime
206
+    //
207
+    //
208
+    // var year = new Date().getFullYear()
209
+    // var month = new Date().getMonth()
210
+    // var day = new Date().getDate()
211
+    //
212
+    // day.setMonth(day.getMonth() - 3);
213
+    //
214
+    // if (parseInt(month) < 10) {
215
+    //   month = '0' + month
216
+    // }
217
+    // if (parseInt(day) < 10) {
218
+    //   day = '0' + day
219
+    // }
220
+    // const startTime = year + '-' + month + '-' + day
221
+    // this.start_time = startTime
222
+
223
+    var nowDate = new Date();
224
+    var nowYear = nowDate.getFullYear();
225
+    var nowMonth = nowDate.getMonth() + 1;
226
+    var nowDay = nowDate.getDate();
227
+    this.end_time =
228
+      nowYear +
229
+      "-" +
230
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
231
+      "-" +
232
+      (nowDay < 10 ? "0" + nowDay : nowDay);
233
+    nowDate.setMonth(nowDate.getMonth() - 1);
234
+    nowYear = nowDate.getFullYear();
235
+    nowMonth = nowDate.getMonth() + 1;
236
+    nowDay = nowDate.getDate();
237
+    this.start_time =
238
+      nowYear +
239
+      "-" +
240
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
241
+      "-" +
242
+      (nowDay < 10 ? "0" + nowDay : nowDay);
243
+
244
+    this.GetWarehouse();
245
+    this.GetConfigInfo();
246
+    this.fetchAllAdminUsers();
247
+  },
248
+  data() {
249
+    return {
250
+      crumbs: [
251
+        { path: false, name: "库存管理" },
252
+        { path: false, name: "入库单" }
253
+      ],
254
+      searchKey: "",
255
+      type: 1,
256
+      page: 1,
257
+      limit: 10,
258
+      checked: false,
259
+      total: 0,
260
+      pageTotal: 0,
261
+      pageSelect: 0,
262
+      adminUserOptions: [],
263
+      multipleSelection: [],
264
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
265
+      start_time: "",
266
+      end_time: "",
267
+      goodType: [],
268
+      goodInfo: [],
269
+      manufacturer: [],
270
+      selectedTableData: [],
271
+      dealer: [],
272
+      Warehouse: {
273
+        loading: false,
274
+        warehouseDate: [],
275
+        tableCurrentIndex: ""
276
+      },
277
+
278
+      WarehouseInfo: {
279
+        loading: false,
280
+        warehouseInfoDate: []
281
+      },
282
+      startTime: ""
283
+    };
284
+  },
285
+  methods: {
286
+    search: function() {
287
+      const Params = {
288
+        page: this.page,
289
+        limit: this.limit,
290
+        start_time: this.start_time,
291
+        end_time: this.end_time,
292
+        type: this.type,
293
+        keywords: this.searchKey
294
+      };
295
+      this.Warehouse.warehouseDate = [];
296
+      getWarehouseList(Params).then(response => {
297
+        if (response.data.state == 0) {
298
+          this.Warehouse.loading = false;
299
+          this.$message.error(response.data.msg);
300
+          return false;
301
+        } else {
302
+          this.Warehouse.loading = false;
303
+          this.total = response.data.data.total;
304
+          for (let i = 0; i < response.data.data.list.length; i++) {
305
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
306
+          }
307
+        }
308
+      });
309
+    },
310
+    GetWarehouse: function() {
311
+      const Params = {
312
+        page: this.page,
313
+        limit: this.limit,
314
+        start_time: this.start_time,
315
+        end_time: this.end_time,
316
+        type: this.type
317
+      };
318
+      this.Warehouse.warehouseDate = [];
319
+      getWarehouseList(Params).then(response => {
320
+        if (response.data.state == 0) {
321
+          this.Warehouse.loading = false;
322
+          this.$message.error(response.data.msg);
323
+          return false;
324
+        } else {
325
+          this.Warehouse.loading = false;
326
+          this.total = response.data.data.total;
327
+          for (let i = 0; i < response.data.data.list.length; i++) {
328
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
329
+          }
330
+        }
331
+      });
332
+    },
333
+    tableRowClassName({ row, rowIndex }) {
334
+      // 把每一行的索引放进row
335
+      row.index = rowIndex;
336
+    },
337
+    onRowClick(row, event, column) {
338
+      this.WarehouseInfo.warehouseInfoDate = [];
339
+      this.Warehouse.tableCurrentIndex = row.index;
340
+      const params = {
341
+        id: row.id
342
+      };
343
+      this.WarehouseInfo.loading = true;
344
+      getWarehouseInfoList(params).then(response => {
345
+        if (response.data.state == 0) {
346
+          this.WarehouseInfo.loading = false;
347
+          this.$message.error(response.data.msg);
348
+          return false;
349
+        } else {
350
+          this.WarehouseInfo.loading = false;
351
+          for (let i = 0; i < response.data.data.info.length; i++) {
352
+            this.WarehouseInfo.warehouseInfoDate.push(
353
+              response.data.data.info[i]
354
+            );
355
+          }
356
+        }
357
+      });
358
+    },
359
+    getXuserName(id) {
360
+      if (id <= 0) {
361
+        return "";
362
+      }
363
+      var name = "";
364
+      if (
365
+        this.adminUserOptions == null ||
366
+        typeof this.adminUserOptions.length === "undefined"
367
+      ) {
368
+        return name;
369
+      }
370
+      var leng = this.adminUserOptions.length;
371
+      if (leng == 0) {
372
+        return name;
373
+      }
374
+      for (let index = 0; index < leng; index++) {
375
+        if (this.adminUserOptions[index].id == id) {
376
+          name = this.adminUserOptions[index].name;
377
+          break;
378
+        }
379
+      }
380
+      return name;
381
+    },
382
+    fetchAllDoctorAndNurse() {
383
+      fetchAllDoctorAndNurse().then(response => {
384
+        if (response.data.state == 1) {
385
+          this.doctorOptions = response.data.data.doctors;
386
+        }
387
+      });
388
+    },
389
+    fetchAllAdminUsers() {
390
+      fetchAllAdminUsers().then(response => {
391
+        console.log(response);
392
+        if (response.data.state == 1) {
393
+          this.adminUserOptions = response.data.data.users;
394
+          var alen = this.adminUserOptions.length;
395
+          for (let index = 0; index < alen; index++) {
396
+            if (this.adminUserOptions[index].user_type == 2) {
397
+              // this.doctorOptions.push(this.adminUserOptions[index]);
398
+            }
399
+          }
400
+        }
401
+      });
402
+    },
403
+    getSpecificationName: function(id) {
404
+      let name = "";
405
+      for (let i = 0; i < this.goodInfo.length; i++) {
406
+        if (this.goodInfo[i].id == id) {
407
+          name = this.goodInfo[i].specification_name;
408
+        }
409
+      }
410
+
411
+      return name;
412
+    },
413
+    getTypeName: function(id) {
414
+      let name = "";
415
+      for (let i = 0; i < this.goodType.length; i++) {
416
+        if (this.goodType[i].id == id) {
417
+          name = this.goodType[i].type_name;
418
+        }
419
+      }
420
+      return name;
421
+    },
422
+    GetAllGoodType: function() {
423
+      GetAllGoodType().then(response => {
424
+        if (response.data.state == 0) {
425
+          this.$message.error(response.data.msg);
426
+          return false;
427
+        } else {
428
+          for (let i = 0; i < response.data.data.goodType.length; i++) {
429
+            this.goodType.push(response.data.data.goodType[i]);
430
+          }
431
+        }
432
+      });
433
+    },
434
+    GetAllGoodInfo: function() {
435
+      GetAllGoodInfo().then(response => {
436
+        if (response.data.state == 0) {
437
+          this.$message.error(response.data.msg);
438
+          return false;
439
+        } else {
440
+          for (let i = 0; i < response.data.data.goodInfo.length; i++) {
441
+            this.goodInfo.push(response.data.data.goodInfo[i]);
442
+          }
443
+        }
444
+      });
445
+    },
446
+    clicks: function() {
447
+      console.log(this.WarehouseInfo.warehouseInfoDate);
448
+    },
449
+    handleWarehouse: function() {
450
+      this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
451
+    },
452
+    handleReturnSales: function() {
453
+      // this.$router.push({path:'/patients/create'}
454
+      if (this.multipleSelection.length <= 0) {
455
+        this.$message.error("请选择退货商品");
456
+        return;
457
+      }
458
+
459
+      const ids = [];
460
+      for (let i = 0; i < this.multipleSelection.length; i++) {
461
+        ids.push(this.multipleSelection[i].id);
462
+      }
463
+      this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
464
+    },
465
+    handleReturnSalesRecord: function() {
466
+      this.$router.push({ name: "salesReutrnRecord" });
467
+    },
468
+    handleWarehouseRecord: function() {
469
+      this.$router.push({ name: "warehouseRecord" });
470
+    },
471
+    handleSelectionChange: function(val) {
472
+      this.multipleSelection = val;
473
+    },
474
+    handleSizeChange(val) {
475
+      this.limit = val;
476
+      this.GetWarehouse();
477
+    },
478
+    handleCurrentChange(val) {
479
+      this.page = val;
480
+      this.GetWarehouse();
481
+    },
482
+    startTimeChange(val) {
483
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
484
+      if (time > 0) {
485
+        this.$message.error("结束时间不能小于开始时间");
486
+        this.start_time = "";
487
+      } else {
488
+        this.startTime = this.getTimestamp(val);
489
+        this.GetWarehouse();
490
+      }
491
+    },
492
+    endTimeChange(val) {
493
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
494
+      if (time < 0) {
495
+        this.$message.error("结束时间不能小于开始时间");
496
+        this.end_time = "";
497
+      } else {
498
+        this.GetWarehouse();
499
+      }
500
+    },
501
+    getTimestamp(time) {
502
+      // 把时间日期转成时间戳
503
+      return new Date(time).getTime() / 1000;
504
+    },
505
+    calculate: function(val) {
506
+      return Math.round(parseFloat(val) * 100) / 100;
507
+    },
508
+    GetConfigInfo: function() {
509
+      GetAllConfig().then(response => {
510
+        if (response.data.state == 0) {
511
+          this.$message.error(response.data.msg);
512
+          return false;
513
+        } else {
514
+          this.manufacturer = response.data.data.manufacturer;
515
+          this.dealer = response.data.data.dealer;
516
+        }
517
+      });
518
+    },
519
+    getManufactuerName: function(manufacturer_id) {
520
+      for (let i = 0; i < this.manufacturer.length; i++) {
521
+        if (this.manufacturer[i].id == manufacturer_id) {
522
+          return this.manufacturer[i].manufacturer_name;
523
+        }
524
+      }
525
+    },
526
+    getDealerName: function(dealer_id) {
527
+      for (let i = 0; i < this.dealer.length; i++) {
528
+        if (this.dealer[i].id == dealer_id) {
529
+          return this.dealer[i].dealer_name;
530
+        }
531
+      }
532
+    },
533
+    handleEdit: function(index, row) {
534
+      this.$router.push({
535
+        name: "stockInDetail",
536
+        query: { id: row.id, type: this.type }
537
+      });
538
+    },
539
+    handleDelete: function(index, row) {
540
+      const ids = [];
541
+      ids.push(row.id);
542
+      const idStr = ids.join(",");
543
+
544
+      const params = {
545
+        ids: idStr
546
+      };
547
+
548
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
549
+        confirmButtonText: "确定",
550
+        cancelButtonText: "取消",
551
+        type: "warning"
552
+      })
553
+        .then(() => {
554
+          deleteWarehouseInfo(params).then(response => {
555
+            if (response.data.state == 0) {
556
+              this.$message.error(response.data.msg);
557
+              return false;
558
+            } else {
559
+              this.$notify({
560
+                title: "成功",
561
+                message: "删除成功",
562
+                type: "success",
563
+                duration: 2000
564
+              });
565
+              for (let i = 0; i < ids.length; i++) {
566
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
567
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
568
+                    this.Warehouse.warehouseDate.splice(y, 1);
569
+                  }
570
+                }
571
+              }
572
+            }
573
+          });
574
+        })
575
+        .catch(() => {});
576
+    },
577
+    changeAllSelected: function(val) {
578
+      if (val) {
579
+        this.$refs.multipleTable.toggleAllSelection();
580
+      } else {
581
+        this.$refs.multipleTable.clearSelection();
582
+      }
583
+    },
584
+    select(selection) {
585
+      this.selectedTableData = selection;
586
+    },
587
+    batchDelete() {
588
+      if (this.selectedTableData.length <= 0) {
589
+        this.$message.error("请选择要删除的记录");
590
+        return;
591
+      }
592
+      const ids = [];
593
+      for (let i = 0; i < this.selectedTableData.length; i++) {
594
+        ids.push(this.selectedTableData[i].id);
595
+      }
596
+      const idStr = ids.join(",");
597
+      const params = {
598
+        ids: idStr
599
+      };
600
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
601
+        confirmButtonText: "确定",
602
+        cancelButtonText: "取消",
603
+        type: "warning"
604
+      })
605
+        .then(() => {
606
+          deleteWarehouseInfo(params).then(response => {
607
+            if (response.data.state == 0) {
608
+              this.$message.error(response.data.msg);
609
+              return false;
610
+            } else {
611
+              this.$notify({
612
+                title: "成功",
613
+                message: "删除成功",
614
+                type: "success",
615
+                duration: 2000
616
+              });
617
+
618
+              for (let i = 0; i < ids.length; i++) {
619
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
620
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
621
+                    this.Warehouse.warehouseDate.splice(y, 1);
622
+                  }
623
+                }
624
+              }
625
+            }
626
+          });
627
+        })
628
+        .catch(() => {});
629
+    }
630
+  }
631
+};
632
+</script>
633
+
634
+<style rel="stylesheet/css" lang="scss" scoped>
635
+.information {
636
+  border: 1px #dcdfe6 solid;
637
+  padding: 30px 20px 30px 20px;
638
+
639
+  .border {
640
+    border-bottom: 1px #dcdfe6 solid;
641
+    margin: 0px 0 20px 0;
642
+  }
643
+}
644
+
645
+.edit_separater {
646
+  border-top: 1px solid rgb(233, 233, 233);
647
+  margin-top: 15px;
648
+  margin-bottom: 15px;
649
+}
650
+</style>
651
+
652
+<style>
653
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
654
+  font-size: 12px;
655
+}
656
+
657
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
658
+  background: #6fb5fa;
659
+}
660
+
661
+.count {
662
+  color: #bd2c00;
663
+}
664
+.el-table td,
665
+.el-table th.is-leaf,
666
+.el-table--border,
667
+.el-table--group {
668
+  border-color: #d0d3da;
669
+}
670
+.el-table--border::after,
671
+.el-table--group::after,
672
+.el-table::before {
673
+  background-color: #d0d3da;
674
+}
675
+</style>

+ 550 - 0
src/xt_pages/stock/drugs/stockOut.vue View File

@@ -0,0 +1,550 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <el-button
6
+        size="small"
7
+        @click="AddNewOrder"
8
+        class="filter-item"
9
+        style="float:right;"
10
+        type="primary"
11
+        icon="el-icon-circle-plus-outline"
12
+        >新增</el-button
13
+      >
14
+    </div>
15
+    <div class="app-container">
16
+      <div class="cell clearfix">
17
+        <el-input
18
+          size="small"
19
+          style="width: 400px;"
20
+          class="filter-item"
21
+          v-model.trim="searchKey"
22
+          placeholder="单据编码/制单人/厂商"
23
+        />
24
+        <el-button
25
+          size="small"
26
+          class="filter-item"
27
+          type="primary"
28
+          icon="el-icon-search"
29
+          @click="search"
30
+          >搜索</el-button
31
+        >
32
+      </div>
33
+
34
+      <div class="cell clearfix">
35
+        <label class="title"><span class="name">出库时间</span> : </label>
36
+        <el-date-picker
37
+          size="small"
38
+          v-model="start_time"
39
+          prefix-icon="el-icon-date"
40
+          :editable="false"
41
+          style="width: 196px;"
42
+          type="date"
43
+          placeholder="选择日期时间"
44
+          align="right"
45
+          format="yyyy-MM-dd"
46
+          value-format="yyyy-MM-dd"
47
+          @change="startTimeChange"
48
+        ></el-date-picker>
49
+        <span class="cellLine"> - </span>
50
+        <el-date-picker
51
+          size="small"
52
+          v-model="end_time"
53
+          prefix-icon="el-icon-date"
54
+          :editable="false"
55
+          style="width: 196px;"
56
+          type="date"
57
+          placeholder="选择日期时间"
58
+          align="right"
59
+          format="yyyy-MM-dd"
60
+          value-format="yyyy-MM-dd"
61
+          @change="endTimeChange"
62
+        ></el-date-picker>
63
+      </div>
64
+
65
+      <div class="cell clearfix">
66
+        <el-checkbox
67
+          style="width: 70px"
68
+          v-model="checked"
69
+          @change="changeAllSelected"
70
+          >全选</el-checkbox
71
+        >
72
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
73
+          >删除</el-button
74
+        >
75
+      </div>
76
+
77
+      <el-table
78
+        :data="warehouseOutDate"
79
+        :class="signAndWeighBoxPatients"
80
+        style="width: 100%"
81
+        border
82
+        highlight-current-row
83
+        ref="multipleTable"
84
+        @selection-change="select"
85
+        :row-style="{ color: '#303133' }"
86
+        :header-cell-style="{
87
+          backgroundColor: 'rgb(245, 247, 250)',
88
+          color: '#606266'
89
+        }"
90
+      >
91
+        <el-table-column type="selection" width="55"> </el-table-column>
92
+
93
+        <el-table-column label="单据日期" align="center">
94
+          <template slot-scope="scope">
95
+            {{ scope.row.warehouse_out_time | parseTime("{y}-{m}-{d}") }}
96
+          </template>
97
+        </el-table-column>
98
+
99
+        <el-table-column label="单据编号" align="center">
100
+          <template slot-scope="scope">
101
+            {{ scope.row.warehouse_out_order_number }}
102
+          </template>
103
+        </el-table-column>
104
+
105
+        <el-table-column label="制单人" align="center">
106
+          <template slot-scope="scope">
107
+            {{ getXuserName(scope.row.creater) }}
108
+          </template>
109
+        </el-table-column>
110
+        <el-table-column label="厂家" align="center">
111
+          <template slot-scope="scope">
112
+            {{ getManufactuerName(scope.row.manufacturer) }}
113
+          </template>
114
+        </el-table-column>
115
+
116
+        <el-table-column label="经销商" align="center">
117
+          <template slot-scope="scope">
118
+            {{ getDealerName(scope.row.dealer) }}
119
+          </template>
120
+        </el-table-column>
121
+
122
+        <el-table-column label="操作" align="center">
123
+          <template slot-scope="scope">
124
+            <el-tooltip
125
+              class="item"
126
+              effect="dark"
127
+              content="编辑"
128
+              placement="top"
129
+            >
130
+              <el-button
131
+                size="mini"
132
+                type="primary"
133
+                icon="el-icon-edit-outline"
134
+                @click="handleEdit(scope.$index, scope.row)"
135
+              >
136
+              </el-button>
137
+            </el-tooltip>
138
+            <el-tooltip
139
+              class="item"
140
+              effect="dark"
141
+              content="删除"
142
+              placement="top"
143
+            >
144
+              <el-button
145
+                size="mini"
146
+                type="danger"
147
+                icon="el-icon-delete"
148
+                @click="handleDelete(scope.$index, scope.row)"
149
+              >
150
+              </el-button>
151
+            </el-tooltip>
152
+          </template>
153
+        </el-table-column>
154
+      </el-table>
155
+      <el-pagination
156
+        @size-change="handleSizeChange"
157
+        @current-change="handleCurrentChange"
158
+        :page-sizes="[10, 50, 100]"
159
+        :page-size="10"
160
+        background
161
+        style="margin-top:20px;float: right"
162
+        layout="total, sizes, prev, pager, next, jumper"
163
+        :total="total"
164
+      >
165
+      </el-pagination>
166
+    </div>
167
+  </div>
168
+</template>
169
+
170
+<script>
171
+import { uParseTime } from "@/utils/tools";
172
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
173
+
174
+import {
175
+  deleteWarehouseOut,
176
+  GetAllConfig,
177
+  getWarehouseOutList
178
+} from "@/api/stock";
179
+import BreadCrumb from "../../components/bread-crumb";
180
+
181
+export default {
182
+  name: "salesReturnOrder",
183
+  components: { BreadCrumb },
184
+  created() {
185
+    var nowDate = new Date();
186
+    var nowYear = nowDate.getFullYear();
187
+    var nowMonth = nowDate.getMonth() + 1;
188
+    var nowDay = nowDate.getDate();
189
+    this.end_time =
190
+      nowYear +
191
+      "-" +
192
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
193
+      "-" +
194
+      (nowDay < 10 ? "0" + nowDay : nowDay);
195
+    nowDate.setMonth(nowDate.getMonth() - 1);
196
+    nowYear = nowDate.getFullYear();
197
+    nowMonth = nowDate.getMonth() + 1;
198
+    nowDay = nowDate.getDate();
199
+    this.start_time =
200
+      nowYear +
201
+      "-" +
202
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
203
+      "-" +
204
+      (nowDay < 10 ? "0" + nowDay : nowDay);
205
+    this.GetWarehouseOut();
206
+    this.GetConfigInfo();
207
+    this.fetchAllAdminUsers();
208
+  },
209
+  data() {
210
+    return {
211
+      searchKey: "",
212
+      crumbs: [
213
+        { path: false, name: "库存管理" },
214
+        { path: false, name: "出库单" }
215
+      ],
216
+      page: 1,
217
+      limit: 10,
218
+      checked: false,
219
+      total: 0,
220
+      pageTotal: 0,
221
+      pageSelect: 0,
222
+      adminUserOptions: [],
223
+      multipleSelection: [],
224
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
225
+      start_time: "",
226
+      warehouseOutDate: [],
227
+      end_time: "",
228
+      goodType: [],
229
+      goodInfo: [],
230
+      manufacturer: [],
231
+      selectedTableData: [],
232
+      dealer: [],
233
+      type: 1
234
+    };
235
+  },
236
+  methods: {
237
+    search: function() {
238
+      const Params = {
239
+        page: this.page,
240
+        limit: this.limit,
241
+        start_time: this.start_time,
242
+        end_time: this.end_time,
243
+        type: this.type,
244
+        keywords: this.searchKey
245
+      };
246
+      this.warehouseOutDate = [];
247
+      getWarehouseOutList(Params).then(response => {
248
+        if (response.data.state == 0) {
249
+          this.$message.error(response.data.msg);
250
+          return false;
251
+        } else {
252
+          this.total = response.data.data.total;
253
+          for (let i = 0; i < response.data.data.list.length; i++) {
254
+            this.warehouseOutDate.push(response.data.data.list[i]);
255
+          }
256
+        }
257
+      });
258
+    },
259
+    AddNewOrder: function() {
260
+      this.$router.push({
261
+        name: "stockOutOrderAdd",
262
+        query: { type: this.type }
263
+      });
264
+    },
265
+    GetWarehouseOut: function() {
266
+      const Params = {
267
+        page: this.page,
268
+        limit: this.limit,
269
+        start_time: this.start_time,
270
+        end_time: this.end_time,
271
+        type: this.type
272
+      };
273
+      this.warehouseOutDate = [];
274
+      getWarehouseOutList(Params).then(response => {
275
+        if (response.data.state == 0) {
276
+          this.$message.error(response.data.msg);
277
+          return false;
278
+        } else {
279
+          this.total = response.data.data.total;
280
+          for (let i = 0; i < response.data.data.list.length; i++) {
281
+            this.warehouseOutDate.push(response.data.data.list[i]);
282
+          }
283
+        }
284
+      });
285
+    },
286
+    getXuserName(id) {
287
+      if (id <= 0) {
288
+        return "";
289
+      }
290
+      var name = "";
291
+      if (
292
+        this.adminUserOptions == null ||
293
+        typeof this.adminUserOptions.length === "undefined"
294
+      ) {
295
+        return name;
296
+      }
297
+      var leng = this.adminUserOptions.length;
298
+      if (leng == 0) {
299
+        return name;
300
+      }
301
+      for (let index = 0; index < leng; index++) {
302
+        if (this.adminUserOptions[index].id == id) {
303
+          name = this.adminUserOptions[index].name;
304
+          break;
305
+        }
306
+      }
307
+      return name;
308
+    },
309
+    fetchAllAdminUsers() {
310
+      fetchAllAdminUsers().then(response => {
311
+        console.log(response);
312
+        if (response.data.state == 1) {
313
+          this.adminUserOptions = response.data.data.users;
314
+          var alen = this.adminUserOptions.length;
315
+          for (let index = 0; index < alen; index++) {
316
+            if (this.adminUserOptions[index].user_type == 2) {
317
+              // this.doctorOptions.push(this.adminUserOptions[index]);
318
+            }
319
+          }
320
+        }
321
+      });
322
+    },
323
+    handleSelectionChange: function(val) {
324
+      this.multipleSelection = val;
325
+    },
326
+    handleSizeChange(val) {
327
+      this.limit = val;
328
+      this.GetWarehouseOut();
329
+    },
330
+    handleCurrentChange(val) {
331
+      this.page = val;
332
+      this.GetWarehouseOut();
333
+    },
334
+    startTimeChange(val) {
335
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
336
+      if (time > 0) {
337
+        this.$message.error("结束时间不能小于开始时间");
338
+        this.start_time = "";
339
+      } else {
340
+        this.GetWarehouseOut();
341
+      }
342
+      this.GetWarehouseOut();
343
+    },
344
+    endTimeChange(val) {
345
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
346
+      if (time < 0) {
347
+        this.$message.error("结束时间不能小于开始时间");
348
+        this.end_time = "";
349
+      } else {
350
+        this.GetWarehouseOut();
351
+      }
352
+    },
353
+    getTimestamp(time) {
354
+      // 把时间日期转成时间戳
355
+      return new Date(time).getTime() / 1000;
356
+    },
357
+    calculate: function(val) {
358
+      return Math.round(parseFloat(val) * 100) / 100;
359
+    },
360
+    GetConfigInfo: function() {
361
+      GetAllConfig().then(response => {
362
+        if (response.data.state == 0) {
363
+          this.$message.error(response.data.msg);
364
+          return false;
365
+        } else {
366
+          this.manufacturer = response.data.data.manufacturer;
367
+          this.dealer = response.data.data.dealer;
368
+        }
369
+      });
370
+    },
371
+    getManufactuerName: function(manufacturer_id) {
372
+      for (let i = 0; i < this.manufacturer.length; i++) {
373
+        if (this.manufacturer[i].id == manufacturer_id) {
374
+          return this.manufacturer[i].manufacturer_name;
375
+        }
376
+      }
377
+    },
378
+    getDealerName: function(dealer_id) {
379
+      for (let i = 0; i < this.dealer.length; i++) {
380
+        if (this.dealer[i].id == dealer_id) {
381
+          return this.dealer[i].dealer_name;
382
+        }
383
+      }
384
+    },
385
+    handleEdit: function(index, row) {
386
+      this.$router.push({
387
+        name: "stockOutDetail",
388
+        query: { id: row.id, type: this.type }
389
+      });
390
+    },
391
+    handleDelete: function(index, row) {
392
+      const ids = [];
393
+      ids.push(row.id);
394
+      const idStr = ids.join(",");
395
+
396
+      const params = {
397
+        ids: idStr
398
+      };
399
+
400
+      this.$confirm("确认删除出库单记录?", "删除出库单记录", {
401
+        confirmButtonText: "确定",
402
+        cancelButtonText: "取消",
403
+        type: "warning"
404
+      })
405
+        .then(() => {
406
+          deleteWarehouseOut(params).then(response => {
407
+            if (response.data.state == 0) {
408
+              this.$message.error(response.data.msg);
409
+              return false;
410
+            } else {
411
+              this.$notify({
412
+                title: "成功",
413
+                message: "删除成功",
414
+                type: "success",
415
+                duration: 2000
416
+              });
417
+              for (let i = 0; i < ids.length; i++) {
418
+                for (let y = 0; y < this.warehouseOutDate.length; y++) {
419
+                  if (ids[i] == this.warehouseOutDate[y].id) {
420
+                    this.warehouseOutDate.splice(y, 1);
421
+                  }
422
+                }
423
+              }
424
+            }
425
+          });
426
+        })
427
+        .catch(() => {});
428
+    },
429
+    changeAllSelected: function(val) {
430
+      if (val) {
431
+        this.$refs.multipleTable.toggleAllSelection();
432
+      } else {
433
+        this.$refs.multipleTable.clearSelection();
434
+      }
435
+    },
436
+    select(selection) {
437
+      this.selectedTableData = selection;
438
+    },
439
+    batchDelete() {
440
+      if (this.selectedTableData.length <= 0) {
441
+        this.$message.error("请选择要删除的记录");
442
+        return;
443
+      }
444
+      const ids = [];
445
+      for (let i = 0; i < this.selectedTableData.length; i++) {
446
+        ids.push(this.selectedTableData[i].id);
447
+      }
448
+      const idStr = ids.join(",");
449
+      const params = {
450
+        ids: idStr
451
+      };
452
+      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
453
+        confirmButtonText: "确定",
454
+        cancelButtonText: "取消",
455
+        type: "warning"
456
+      })
457
+        .then(() => {
458
+          deleteWarehouseOut(params).then(response => {
459
+            if (response.data.state == 0) {
460
+              this.$message.error(response.data.msg);
461
+              return false;
462
+            } else {
463
+              this.$notify({
464
+                title: "成功",
465
+                message: "删除成功",
466
+                type: "success",
467
+                duration: 2000
468
+              });
469
+
470
+              for (let i = 0; i < ids.length; i++) {
471
+                for (let y = 0; y < this.warehouseOutDate.length; y++) {
472
+                  if (ids[i] == this.warehouseOutDate[y].id) {
473
+                    this.warehouseOutDate.splice(y, 1);
474
+                  }
475
+                }
476
+              }
477
+            }
478
+          });
479
+        })
480
+        .catch(() => {});
481
+    }
482
+  }
483
+};
484
+</script>
485
+
486
+<style rel="stylesheet/scss" lang="scss">
487
+.app-container {
488
+  // margin: 20px;
489
+  font-size: 15px;
490
+  .filter-container {
491
+    padding-bottom: 5px;
492
+  }
493
+  .search-component {
494
+    width: 500px;
495
+    .searchBox {
496
+      width: 300px;
497
+      height: 36px;
498
+      line-height: 36px;
499
+      padding-left: 15px;
500
+      border: 1px #dcdfe6 solid;
501
+      border-right: none;
502
+      outline: none;
503
+      float: left;
504
+      border-radius: 6px 0 0 6px;
505
+      font-size: 14px;
506
+      color: #333;
507
+      background: #fff;
508
+      box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
509
+    }
510
+    .searchBtn {
511
+      background-color: #409eff;
512
+      color: #fff;
513
+      font-size: 15px;
514
+      text-align: center;
515
+      height: 36px;
516
+      line-height: 36px;
517
+      float: left;
518
+      outline: none;
519
+      width: 70px;
520
+      border: none;
521
+      border-radius: 0 6px 6px 0;
522
+      font-family: "Microsoft Yahei";
523
+      cursor: pointer;
524
+    }
525
+  }
526
+
527
+  .amount {
528
+    font-weight: normal;
529
+    padding: 10px 0 0 0;
530
+    color: #606266;
531
+    font-size: 14px;
532
+    span {
533
+      color: #ef2525;
534
+      font-family: "Arial";
535
+      padding: 0 2px;
536
+    }
537
+  }
538
+}
539
+.el-table td,
540
+.el-table th.is-leaf,
541
+.el-table--border,
542
+.el-table--group {
543
+  border-color: #d0d3da;
544
+}
545
+.el-table--border::after,
546
+.el-table--group::after,
547
+.el-table::before {
548
+  background-color: #d0d3da;
549
+}
550
+</style>

+ 534 - 0
src/xt_pages/stock/drugs/stockReturn.vue View File

@@ -0,0 +1,534 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <el-button
6
+        size="small"
7
+        @click="AddNewOrder"
8
+        class="filter-item"
9
+        style="float:right;"
10
+        type="primary"
11
+        icon="el-icon-circle-plus-outline"
12
+        >新增
13
+      </el-button>
14
+    </div>
15
+
16
+    <div class="app-container">
17
+      <div class="cell clearfix">
18
+        <el-input
19
+          style="width: 400px;"
20
+          class="filter-item"
21
+          v-model.trim="searchKey"
22
+          placeholder="单据编码/制单人/厂商"
23
+        />
24
+        <el-button
25
+          class="filter-item"
26
+          type="primary"
27
+          icon="el-icon-search"
28
+          @click="search"
29
+          >搜索</el-button
30
+        >
31
+      </div>
32
+
33
+      <div class="cell clearfix">
34
+        <label class="title"><span class="name">退货时间</span> : </label>
35
+        <el-date-picker
36
+          size="small"
37
+          v-model="start_time"
38
+          prefix-icon="el-icon-date"
39
+          :editable="false"
40
+          style="width: 196px;"
41
+          type="date"
42
+          placeholder="选择日期时间"
43
+          align="right"
44
+          format="yyyy-MM-dd"
45
+          value-format="yyyy-MM-dd"
46
+          @change="startTimeChange"
47
+        ></el-date-picker>
48
+        <span class="cellLine"> - </span>
49
+        <el-date-picker
50
+          size="small"
51
+          v-model="end_time"
52
+          prefix-icon="el-icon-date"
53
+          :editable="false"
54
+          style="width: 196px;"
55
+          type="date"
56
+          placeholder="选择日期时间"
57
+          align="right"
58
+          format="yyyy-MM-dd"
59
+          value-format="yyyy-MM-dd"
60
+          @change="endTimeChange"
61
+        ></el-date-picker>
62
+      </div>
63
+
64
+      <div class="cell clearfix" style="margin-top: 10px">
65
+        <el-checkbox
66
+          style="width: 70px"
67
+          v-model="checked"
68
+          @change="changeAllSelected"
69
+          >全选</el-checkbox
70
+        >
71
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
72
+          >删除</el-button
73
+        >
74
+      </div>
75
+
76
+      <el-table
77
+        :data="saleReturnDate"
78
+        :class="signAndWeighBoxPatients"
79
+        style="width: 100%"
80
+        border
81
+        highlight-current-row
82
+        ref="multipleTable"
83
+        @selection-change="select"
84
+        :row-style="{ color: '#303133' }"
85
+        :header-cell-style="{
86
+          backgroundColor: 'rgb(245, 247, 250)',
87
+          color: '#606266'
88
+        }"
89
+      >
90
+        <el-table-column type="selection" width="55"> </el-table-column>
91
+
92
+        <el-table-column label="单据日期" align="center">
93
+          <template slot-scope="scope">
94
+            {{ scope.row.opera_time | parseTime("{y}-{m}-{d}") }}
95
+          </template>
96
+        </el-table-column>
97
+
98
+        <el-table-column label="单据编号" align="center">
99
+          <template slot-scope="scope">
100
+            {{ scope.row.order_number }}
101
+          </template>
102
+        </el-table-column>
103
+
104
+        <el-table-column label="制单人" align="center">
105
+          <template slot-scope="scope">
106
+            {{ getXuserName(scope.row.creater) }}
107
+          </template>
108
+        </el-table-column>
109
+
110
+        <el-table-column label="厂家" align="center">
111
+          <template slot-scope="scope">
112
+            {{ getManufactuerName(scope.row.manufacturer) }}
113
+          </template>
114
+        </el-table-column>
115
+
116
+        <el-table-column label="经销商" align="center">
117
+          <template slot-scope="scope">
118
+            {{ getDealerName(scope.row.dealer) }}
119
+          </template>
120
+        </el-table-column>
121
+
122
+        <el-table-column label="操作" align="center">
123
+          <template slot-scope="scope">
124
+            <el-tooltip
125
+              class="item"
126
+              effect="dark"
127
+              content="编辑"
128
+              placement="top"
129
+            >
130
+              <el-button
131
+                size="mini"
132
+                type="primary"
133
+                icon="el-icon-edit-outline"
134
+                @click="handleEdit(scope.$index, scope.row)"
135
+              >
136
+              </el-button>
137
+            </el-tooltip>
138
+            <el-tooltip
139
+              class="item"
140
+              effect="dark"
141
+              content="删除"
142
+              placement="top"
143
+            >
144
+              <el-button
145
+                size="mini"
146
+                type="danger"
147
+                icon="el-icon-delete"
148
+                @click="handleDelete(scope.$index, scope.row)"
149
+              >
150
+              </el-button>
151
+            </el-tooltip>
152
+          </template>
153
+        </el-table-column>
154
+      </el-table>
155
+
156
+      <el-pagination
157
+        @size-change="handleSizeChange"
158
+        @current-change="handleCurrentChange"
159
+        :page-sizes="[10, 50, 100]"
160
+        :page-size="10"
161
+        background
162
+        style="margin-top:20px;float: right"
163
+        layout="total, sizes, prev, pager, next, jumper"
164
+        :total="total"
165
+      >
166
+      </el-pagination>
167
+    </div>
168
+  </div>
169
+</template>
170
+
171
+<script>
172
+import { uParseTime } from "@/utils/tools";
173
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
174
+import {
175
+  deleteSalesReturn,
176
+  GetAllConfig,
177
+  getSalesReturnList,
178
+  getWarehouseInfoList,
179
+  getWarehouseList
180
+} from "@/api/stock";
181
+import BreadCrumb from "../../components/bread-crumb";
182
+
183
+export default {
184
+  name: "salesReturnOrder",
185
+  components: { BreadCrumb },
186
+  created() {
187
+    var nowDate = new Date();
188
+    var nowYear = nowDate.getFullYear();
189
+    var nowMonth = nowDate.getMonth() + 1;
190
+    var nowDay = nowDate.getDate();
191
+    this.end_time =
192
+      nowYear +
193
+      "-" +
194
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
195
+      "-" +
196
+      (nowDay < 10 ? "0" + nowDay : nowDay);
197
+    nowDate.setMonth(nowDate.getMonth() - 1);
198
+    nowYear = nowDate.getFullYear();
199
+    nowMonth = nowDate.getMonth() + 1;
200
+    nowDay = nowDate.getDate();
201
+    this.start_time =
202
+      nowYear +
203
+      "-" +
204
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
205
+      "-" +
206
+      (nowDay < 10 ? "0" + nowDay : nowDay);
207
+
208
+    this.GetSalesReturn();
209
+    this.GetConfigInfo();
210
+    this.fetchAllAdminUsers();
211
+  },
212
+  data() {
213
+    return {
214
+      searchKey: "",
215
+      crumbs: [
216
+        { path: false, name: "库存管理" },
217
+        { path: false, name: "退货单" }
218
+      ],
219
+      type: 1,
220
+      page: 1,
221
+      limit: 10,
222
+      checked: false,
223
+      total: 0,
224
+      pageTotal: 0,
225
+      pageSelect: 0,
226
+      adminUserOptions: [],
227
+      multipleSelection: [],
228
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
229
+      start_time: "",
230
+      saleReturnDate: [],
231
+      end_time: "",
232
+      goodType: [],
233
+      goodInfo: [],
234
+      manufacturer: [],
235
+      selectedTableData: [],
236
+      dealer: []
237
+    };
238
+  },
239
+  methods: {
240
+    search: function() {
241
+      const Params = {
242
+        page: this.page,
243
+        limit: this.limit,
244
+        start_time: this.start_time,
245
+        end_time: this.end_time,
246
+        type: this.type,
247
+        keywords: this.searchKey
248
+      };
249
+      this.saleReturnDate = [];
250
+      getSalesReturnList(Params).then(response => {
251
+        if (response.data.state == 0) {
252
+          this.$message.error(response.data.msg);
253
+          return false;
254
+        } else {
255
+          this.total = response.data.data.total;
256
+          for (let i = 0; i < response.data.data.list.length; i++) {
257
+            this.saleReturnDate.push(response.data.data.list[i]);
258
+          }
259
+        }
260
+      });
261
+    },
262
+    AddNewOrder: function() {
263
+      this.$router.push({
264
+        name: "salesReturnOrderAdd",
265
+        query: { type: this.type }
266
+      });
267
+    },
268
+    GetSalesReturn: function() {
269
+      const Params = {
270
+        page: this.page,
271
+        limit: this.limit,
272
+        start_time: this.start_time,
273
+        end_time: this.end_time,
274
+        type: this.type
275
+      };
276
+      this.saleReturnDate = [];
277
+      getSalesReturnList(Params).then(response => {
278
+        if (response.data.state == 0) {
279
+          this.$message.error(response.data.msg);
280
+          return false;
281
+        } else {
282
+          this.total = response.data.data.total;
283
+          for (let i = 0; i < response.data.data.list.length; i++) {
284
+            this.saleReturnDate.push(response.data.data.list[i]);
285
+          }
286
+        }
287
+      });
288
+    },
289
+    getXuserName(id) {
290
+      if (id <= 0) {
291
+        return "";
292
+      }
293
+      var name = "";
294
+      if (
295
+        this.adminUserOptions == null ||
296
+        typeof this.adminUserOptions.length === "undefined"
297
+      ) {
298
+        return name;
299
+      }
300
+      var leng = this.adminUserOptions.length;
301
+      if (leng == 0) {
302
+        return name;
303
+      }
304
+      for (let index = 0; index < leng; index++) {
305
+        if (this.adminUserOptions[index].id == id) {
306
+          name = this.adminUserOptions[index].name;
307
+          break;
308
+        }
309
+      }
310
+      return name;
311
+    },
312
+    fetchAllAdminUsers() {
313
+      fetchAllAdminUsers().then(response => {
314
+        console.log(response);
315
+        if (response.data.state == 1) {
316
+          this.adminUserOptions = response.data.data.users;
317
+          var alen = this.adminUserOptions.length;
318
+          for (let index = 0; index < alen; index++) {
319
+            if (this.adminUserOptions[index].user_type == 2) {
320
+              // this.doctorOptions.push(this.adminUserOptions[index]);
321
+            }
322
+          }
323
+        }
324
+      });
325
+    },
326
+    handleSelectionChange: function(val) {
327
+      this.multipleSelection = val;
328
+    },
329
+    handleSizeChange(val) {
330
+      this.limit = val;
331
+      this.GetSalesReturn();
332
+    },
333
+    handleCurrentChange(val) {
334
+      this.page = val;
335
+      this.GetSalesReturn();
336
+    },
337
+    startTimeChange(val) {
338
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
339
+      if (time > 0) {
340
+        this.$message.error("结束时间不能小于开始时间");
341
+        this.start_time = "";
342
+      } else {
343
+        this.GetSalesReturn();
344
+      }
345
+      this.GetSalesReturn();
346
+    },
347
+    endTimeChange(val) {
348
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
349
+      if (time < 0) {
350
+        this.$message.error("结束时间不能小于开始时间");
351
+        this.end_time = "";
352
+      } else {
353
+        this.GetWarehouse();
354
+      }
355
+      this.GetSalesReturn();
356
+    },
357
+    getTimestamp(time) {
358
+      // 把时间日期转成时间戳
359
+      return new Date(time).getTime() / 1000;
360
+    },
361
+    calculate: function(val) {
362
+      return Math.round(parseFloat(val) * 100) / 100;
363
+    },
364
+    GetConfigInfo: function() {
365
+      GetAllConfig().then(response => {
366
+        if (response.data.state == 0) {
367
+          this.$message.error(response.data.msg);
368
+          return false;
369
+        } else {
370
+          this.manufacturer = response.data.data.manufacturer;
371
+          this.dealer = response.data.data.dealer;
372
+        }
373
+      });
374
+    },
375
+    getManufactuerName: function(manufacturer_id) {
376
+      for (let i = 0; i < this.manufacturer.length; i++) {
377
+        if (this.manufacturer[i].id == manufacturer_id) {
378
+          return this.manufacturer[i].manufacturer_name;
379
+        }
380
+      }
381
+    },
382
+    getDealerName: function(dealer_id) {
383
+      for (let i = 0; i < this.dealer.length; i++) {
384
+        if (this.dealer[i].id == dealer_id) {
385
+          return this.dealer[i].dealer_name;
386
+        }
387
+      }
388
+    },
389
+    handleEdit: function(index, row) {
390
+      this.$router.push({
391
+        name: "salesReturnDetail",
392
+        query: { id: row.id, type: this.type }
393
+      });
394
+    },
395
+    handleDelete: function(index, row) {
396
+      const ids = [];
397
+      ids.push(row.id);
398
+      const idStr = ids.join(",");
399
+
400
+      const params = {
401
+        ids: idStr
402
+      };
403
+
404
+      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
405
+        confirmButtonText: "确定",
406
+        cancelButtonText: "取消",
407
+        type: "warning"
408
+      })
409
+        .then(() => {
410
+          deleteSalesReturn(params).then(response => {
411
+            if (response.data.state == 0) {
412
+              this.$message.error(response.data.msg);
413
+              return false;
414
+            } else {
415
+              this.$notify({
416
+                title: "成功",
417
+                message: "删除成功",
418
+                type: "success",
419
+                duration: 2000
420
+              });
421
+              for (let i = 0; i < ids.length; i++) {
422
+                for (let y = 0; y < this.saleReturnDate.length; y++) {
423
+                  if (ids[i] == this.saleReturnDate[y].id) {
424
+                    this.saleReturnDate.splice(y, 1);
425
+                  }
426
+                }
427
+              }
428
+            }
429
+          });
430
+        })
431
+        .catch(() => {});
432
+    },
433
+    changeAllSelected: function(val) {
434
+      if (val) {
435
+        this.$refs.multipleTable.toggleAllSelection();
436
+      } else {
437
+        this.$refs.multipleTable.clearSelection();
438
+      }
439
+    },
440
+    select(selection) {
441
+      this.selectedTableData = selection;
442
+    },
443
+    batchDelete() {
444
+      if (this.selectedTableData.length <= 0) {
445
+        this.$message.error("请选择要删除的记录");
446
+        return;
447
+      }
448
+      const ids = [];
449
+      for (let i = 0; i < this.selectedTableData.length; i++) {
450
+        ids.push(this.selectedTableData[i].id);
451
+      }
452
+      const idStr = ids.join(",");
453
+      const params = {
454
+        ids: idStr
455
+      };
456
+      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
457
+        confirmButtonText: "确定",
458
+        cancelButtonText: "取消",
459
+        type: "warning"
460
+      })
461
+        .then(() => {
462
+          deleteSalesReturn(params).then(response => {
463
+            if (response.data.state == 0) {
464
+              this.$message.error(response.data.msg);
465
+              return false;
466
+            } else {
467
+              this.$notify({
468
+                title: "成功",
469
+                message: "删除成功",
470
+                type: "success",
471
+                duration: 2000
472
+              });
473
+
474
+              for (let i = 0; i < ids.length; i++) {
475
+                for (let y = 0; y < this.saleReturnDate.length; y++) {
476
+                  if (ids[i] == this.saleReturnDate[y].id) {
477
+                    this.saleReturnDate.splice(y, 1);
478
+                  }
479
+                }
480
+              }
481
+            }
482
+          });
483
+        })
484
+        .catch(() => {});
485
+    }
486
+  }
487
+};
488
+</script>
489
+
490
+<style rel="stylesheet/css" lang="scss" scoped>
491
+.information {
492
+  border: 1px #dcdfe6 solid;
493
+  padding: 30px 20px 30px 20px;
494
+
495
+  .border {
496
+    border-bottom: 1px #dcdfe6 solid;
497
+    margin: 0px 0 20px 0;
498
+  }
499
+}
500
+
501
+.edit_separater {
502
+  border-top: 1px solid rgb(233, 233, 233);
503
+  margin-top: 15px;
504
+  margin-bottom: 15px;
505
+}
506
+.cell {
507
+  text-align: center;
508
+}
509
+</style>
510
+
511
+<style>
512
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
513
+  font-size: 12px;
514
+}
515
+
516
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
517
+  background: #6fb5fa;
518
+}
519
+
520
+.count {
521
+  color: #bd2c00;
522
+}
523
+.el-table td,
524
+.el-table th.is-leaf,
525
+.el-table--border,
526
+.el-table--group {
527
+  border-color: #d0d3da;
528
+}
529
+.el-table--border::after,
530
+.el-table--group::after,
531
+.el-table::before {
532
+  background-color: #d0d3da;
533
+}
534
+</style>

+ 83 - 0
src/xt_pages/stock/selfPreparedMedicine/components/addMedicine.vue View File

@@ -0,0 +1,83 @@
1
+<template>
2
+    <el-dialog
3
+        :title="formTitle"
4
+        width="900px"
5
+        :visible.sync="visible"
6
+        :before-close="_close"
7
+    >
8
+        <div style="display:flex;width:100%;">
9
+            <div style="width:200px;">
10
+                <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
11
+                    <el-table-column align="center" prop="name" label="药品名称">
12
+                        <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
13
+                    </el-table-column>
14
+                </el-table>
15
+            </div>
16
+            <div style="flex:1;padding-left:10px;">
17
+                <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
18
+                    <el-table-column type="selection" align="center" width="55"></el-table-column>
19
+                    <el-table-column align="center" prop="name" label="规格名称">
20
+                        <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
21
+                    </el-table-column>
22
+                </el-table>
23
+            </div>
24
+        </div>
25
+        <div slot="footer" class="dialog-footer">
26
+            <el-button @click="hide">取 消</el-button>
27
+            <el-button type="primary" :loading="submitLoading" @click="submitAction()">保 存</el-button>
28
+        </div>
29
+    </el-dialog>         
30
+</template>
31
+
32
+<script>
33
+export default {
34
+    data(){
35
+        return{
36
+            visible:false,
37
+            formTitle:'',
38
+            tableData: [{
39
+            date: '2016-05-02',
40
+            name: '王小虎',
41
+            address: '上海市普陀区金沙江路 1518 弄',
42
+            }, {
43
+            date: '2016-05-04',
44
+            name: '王小虎',
45
+            address: '上海市普陀区金沙江路 1518 弄'
46
+            }, {
47
+            date: '2016-05-01',
48
+            name: '王小虎',
49
+            address: '上海市普陀区金沙江路 1518 弄',
50
+            }, {
51
+            date: '2016-05-03',
52
+            name: '王小虎',
53
+            address: '上海市普陀区金沙江路 1518 弄'
54
+            }]
55
+        }
56
+    },
57
+    methods:{
58
+        _close: function(done) {
59
+            // this.clear()
60
+            done()
61
+        },
62
+        clear: function() {
63
+            this.form.id = 0;
64
+            this.form.name = "";
65
+            this.form.intro = "";
66
+        },
67
+        show(id) {
68
+            // this.clear()
69
+            this.visible = true
70
+            if(id == 0){
71
+                this.formTitle = '新增'
72
+            }else{
73
+                this.formTitle = '编辑'
74
+            }
75
+        },
76
+        hide() {
77
+            // this.clear()
78
+            this.visible = false
79
+        },
80
+    }
81
+}
82
+</script>
83
+

+ 131 - 0
src/xt_pages/stock/selfPreparedMedicine/components/medicineDetail.vue View File

@@ -0,0 +1,131 @@
1
+<template>
2
+    <el-dialog
3
+        :title="formTitle"
4
+        width="900px"
5
+        :visible.sync="visible"
6
+        :before-close="_close"
7
+    >
8
+        <div style="margin-bottom:10px;">
9
+            <el-select v-model="value" placeholder="请选择">
10
+                <el-option
11
+                v-for="item in options"
12
+                :key="item.value"
13
+                :label="item.label"
14
+                :value="item.value">
15
+                </el-option>
16
+            </el-select>
17
+            <el-date-picker
18
+                v-model="start_time"
19
+                prefix-icon="el-icon-date"
20
+                :editable="false"
21
+                style="width: 196px;margin-right:10px;"
22
+                type="date"
23
+                placeholder="选择日期时间"
24
+                align="right"
25
+                format="yyyy-MM-dd"
26
+                value-format="yyyy-MM-dd">
27
+            </el-date-picker>
28
+                <el-date-picker
29
+                v-model="start_time"
30
+                prefix-icon="el-icon-date"
31
+                :editable="false"
32
+                style="width: 196px;margin-right:10px;"
33
+                type="date"
34
+                placeholder="选择日期时间"
35
+                align="right"
36
+                format="yyyy-MM-dd"
37
+                value-format="yyyy-MM-dd">
38
+            </el-date-picker>
39
+        </div>
40
+        <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
41
+            <el-table-column align="center" prop="name" label="日期">
42
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
43
+            </el-table-column>
44
+            <el-table-column align="center" prop="name" label="操作类型">
45
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
46
+            </el-table-column>
47
+            <el-table-column align="center" prop="name" label="数量">
48
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
49
+            </el-table-column>
50
+            <el-table-column align="center" prop="name" label="操作人">
51
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
52
+            </el-table-column>
53
+            <el-table-column align="center" prop="name" label="出库方式">
54
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
55
+            </el-table-column>
56
+            <el-table-column align="center" prop="name" label="备注">
57
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
58
+            </el-table-column>
59
+        </el-table>
60
+    </el-dialog>         
61
+</template>
62
+
63
+<script>
64
+export default {
65
+    data(){
66
+        return{
67
+            visible:false,
68
+            formTitle:'',
69
+            tableData: [{
70
+            date: '2016-05-02',
71
+            name: '王小虎',
72
+            address: '上海市普陀区金沙江路 1518 弄',
73
+            }, {
74
+            date: '2016-05-04',
75
+            name: '王小虎',
76
+            address: '上海市普陀区金沙江路 1518 弄'
77
+            }, {
78
+            date: '2016-05-01',
79
+            name: '王小虎',
80
+            address: '上海市普陀区金沙江路 1518 弄',
81
+            }, {
82
+            date: '2016-05-03',
83
+            name: '王小虎',
84
+            address: '上海市普陀区金沙江路 1518 弄'
85
+            }],
86
+            options: [{
87
+            value: '选项1',
88
+            label: '黄金糕'
89
+            }, {
90
+            value: '选项2',
91
+            label: '双皮奶'
92
+            }, {
93
+            value: '选项3',
94
+            label: '蚵仔煎'
95
+            }, {
96
+            value: '选项4',
97
+            label: '龙须面'
98
+            }, {
99
+            value: '选项5',
100
+            label: '北京烤鸭'
101
+            }],
102
+            value: ''
103
+        }
104
+    },
105
+    methods:{
106
+        _close: function(done) {
107
+            // this.clear()
108
+            done()
109
+        },
110
+        clear: function() {
111
+            this.form.id = 0;
112
+            this.form.name = "";
113
+            this.form.intro = "";
114
+        },
115
+        show(id) {
116
+            // this.clear()
117
+            this.visible = true
118
+            if(id == 0){
119
+                this.formTitle = '新增'
120
+            }else{
121
+                this.formTitle = '编辑'
122
+            }
123
+        },
124
+        hide() {
125
+            // this.clear()
126
+            this.visible = false
127
+        },
128
+    }
129
+}
130
+</script>
131
+

+ 118 - 0
src/xt_pages/stock/selfPreparedMedicine/components/warehouseOut.vue View File

@@ -0,0 +1,118 @@
1
+<template>
2
+    <el-dialog
3
+        :title="formTitle"
4
+        width="900px"
5
+        :visible.sync="visible"
6
+        :before-close="_close"
7
+    >
8
+        <div style="margin-bottom:10px;">
9
+            <el-date-picker
10
+                v-model="start_time"
11
+                prefix-icon="el-icon-date"
12
+                :editable="false"
13
+                style="width: 196px;margin-right:10px;"
14
+                type="date"
15
+                placeholder="选择日期时间"
16
+                align="right"
17
+                format="yyyy-MM-dd"
18
+                value-format="yyyy-MM-dd"
19
+            ></el-date-picker>
20
+            <el-select v-model="value" placeholder="请选择">
21
+                <el-option
22
+                v-for="item in options"
23
+                :key="item.value"
24
+                :label="item.label"
25
+                :value="item.value">
26
+                </el-option>
27
+            </el-select>
28
+        </div>
29
+        <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
30
+            <el-table-column align="center" prop="name" label="药品名称">
31
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
32
+            </el-table-column>
33
+            <el-table-column align="center" prop="name" label="规格名称">
34
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
35
+            </el-table-column>
36
+            <el-table-column align="center" prop="name" label="入库数量">
37
+                <template slot-scope="scope">
38
+                    <el-input v-model="input" placeholder="请输入内容"></el-input>
39
+                </template>
40
+            </el-table-column>
41
+            <el-table-column align="center" prop="name" label="备注">
42
+                <template slot-scope="scope">
43
+                    <el-input v-model="input" placeholder="请输入内容"></el-input>
44
+                </template>
45
+            </el-table-column>
46
+        </el-table>
47
+    </el-dialog>         
48
+</template>
49
+
50
+<script>
51
+export default {
52
+    data(){
53
+        return{
54
+            visible:false,
55
+            formTitle:'',
56
+            tableData: [{
57
+            date: '2016-05-02',
58
+            name: '王小虎',
59
+            address: '上海市普陀区金沙江路 1518 弄',
60
+            }, {
61
+            date: '2016-05-04',
62
+            name: '王小虎',
63
+            address: '上海市普陀区金沙江路 1518 弄'
64
+            }, {
65
+            date: '2016-05-01',
66
+            name: '王小虎',
67
+            address: '上海市普陀区金沙江路 1518 弄',
68
+            }, {
69
+            date: '2016-05-03',
70
+            name: '王小虎',
71
+            address: '上海市普陀区金沙江路 1518 弄'
72
+            }],
73
+            options: [{
74
+            value: '选项1',
75
+            label: '黄金糕'
76
+            }, {
77
+            value: '选项2',
78
+            label: '双皮奶'
79
+            }, {
80
+            value: '选项3',
81
+            label: '蚵仔煎'
82
+            }, {
83
+            value: '选项4',
84
+            label: '龙须面'
85
+            }, {
86
+            value: '选项5',
87
+            label: '北京烤鸭'
88
+            }],
89
+            value: ''
90
+        }
91
+    },
92
+    methods:{
93
+        _close: function(done) {
94
+            // this.clear()
95
+            done()
96
+        },
97
+        clear: function() {
98
+            this.form.id = 0;
99
+            this.form.name = "";
100
+            this.form.intro = "";
101
+        },
102
+        show(id) {
103
+            // this.clear()
104
+            this.visible = true
105
+            if(id == 0){
106
+                this.formTitle = '新增'
107
+            }else{
108
+                this.formTitle = '编辑'
109
+            }
110
+        },
111
+        hide() {
112
+            // this.clear()
113
+            this.visible = false
114
+        },
115
+    }
116
+}
117
+</script>
118
+

+ 118 - 0
src/xt_pages/stock/selfPreparedMedicine/components/warehousing.vue View File

@@ -0,0 +1,118 @@
1
+<template>
2
+    <el-dialog
3
+        :title="formTitle"
4
+        width="900px"
5
+        :visible.sync="visible"
6
+        :before-close="_close"
7
+    >
8
+        <div style="margin-bottom:10px;">
9
+            <el-date-picker
10
+                v-model="start_time"
11
+                prefix-icon="el-icon-date"
12
+                :editable="false"
13
+                style="width: 196px;margin-right:10px;"
14
+                type="date"
15
+                placeholder="选择日期时间"
16
+                align="right"
17
+                format="yyyy-MM-dd"
18
+                value-format="yyyy-MM-dd"
19
+            ></el-date-picker>
20
+            <el-select v-model="value" placeholder="请选择">
21
+                <el-option
22
+                v-for="item in options"
23
+                :key="item.value"
24
+                :label="item.label"
25
+                :value="item.value">
26
+                </el-option>
27
+            </el-select>
28
+        </div>
29
+        <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
30
+            <el-table-column align="center" prop="name" label="药品名称">
31
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
32
+            </el-table-column>
33
+            <el-table-column align="center" prop="name" label="规格名称">
34
+                <!-- <template slot-scope="scope">{{scope.row.dialysis_no}}</template> -->
35
+            </el-table-column>
36
+            <el-table-column align="center" prop="name" label="入库数量">
37
+                <template slot-scope="scope">
38
+                    <el-input v-model="input" placeholder="请输入内容"></el-input>
39
+                </template>
40
+            </el-table-column>
41
+            <el-table-column align="center" prop="name" label="备注">
42
+                <template slot-scope="scope">
43
+                    <el-input v-model="input" placeholder="请输入内容"></el-input>
44
+                </template>
45
+            </el-table-column>
46
+        </el-table>
47
+    </el-dialog>         
48
+</template>
49
+
50
+<script>
51
+export default {
52
+    data(){
53
+        return{
54
+            visible:false,
55
+            formTitle:'',
56
+            tableData: [{
57
+            date: '2016-05-02',
58
+            name: '王小虎',
59
+            address: '上海市普陀区金沙江路 1518 弄',
60
+            }, {
61
+            date: '2016-05-04',
62
+            name: '王小虎',
63
+            address: '上海市普陀区金沙江路 1518 弄'
64
+            }, {
65
+            date: '2016-05-01',
66
+            name: '王小虎',
67
+            address: '上海市普陀区金沙江路 1518 弄',
68
+            }, {
69
+            date: '2016-05-03',
70
+            name: '王小虎',
71
+            address: '上海市普陀区金沙江路 1518 弄'
72
+            }],
73
+            options: [{
74
+            value: '选项1',
75
+            label: '黄金糕'
76
+            }, {
77
+            value: '选项2',
78
+            label: '双皮奶'
79
+            }, {
80
+            value: '选项3',
81
+            label: '蚵仔煎'
82
+            }, {
83
+            value: '选项4',
84
+            label: '龙须面'
85
+            }, {
86
+            value: '选项5',
87
+            label: '北京烤鸭'
88
+            }],
89
+            value: ''
90
+        }
91
+    },
92
+    methods:{
93
+        _close: function(done) {
94
+            // this.clear()
95
+            done()
96
+        },
97
+        clear: function() {
98
+            this.form.id = 0;
99
+            this.form.name = "";
100
+            this.form.intro = "";
101
+        },
102
+        show(id) {
103
+            // this.clear()
104
+            this.visible = true
105
+            if(id == 0){
106
+                this.formTitle = '新增'
107
+            }else{
108
+                this.formTitle = '编辑'
109
+            }
110
+        },
111
+        hide() {
112
+            // this.clear()
113
+            this.visible = false
114
+        },
115
+    }
116
+}
117
+</script>
118
+

+ 203 - 0
src/xt_pages/stock/selfPreparedMedicine/index.vue View File

@@ -0,0 +1,203 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+            <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+            <el-button
6
+                size="small"
7
+                @click="setting"
8
+                class="filter-item"
9
+                style="float:right;"
10
+                type="primary"
11
+                >设置
12
+            </el-button>
13
+        </div>
14
+
15
+        <div class="app-container">
16
+            <div class="cell clearfix" style="margin-bottom:0px;">
17
+                <el-date-picker
18
+                v-model="start_time"
19
+                prefix-icon="el-icon-date"
20
+                :editable="false"
21
+                style="width: 196px;margin-right:10px;"
22
+                type="date"
23
+                placeholder="选择日期时间"
24
+                align="right"
25
+                format="yyyy-MM-dd"
26
+                value-format="yyyy-MM-dd"
27
+                ></el-date-picker>
28
+                <el-select v-model="value" placeholder="请选择">
29
+                    <el-option
30
+                    v-for="item in options"
31
+                    :key="item.value"
32
+                    :label="item.label"
33
+                    :value="item.value">
34
+                    </el-option>
35
+                </el-select>
36
+                <el-input style="width: 180px;margin:0 10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
37
+                <el-button class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button>
38
+            </div>
39
+            <el-container>
40
+                <div style="width:160px;">
41
+                    <div class="tablesTitle">患者列表</div>
42
+                    <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
43
+                        <el-table-column align="center" prop="dialysis_no" label="透析号" width="70">
44
+                            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
45
+                        </el-table-column>
46
+                        <el-table-column align="center" prop="name" label="姓名" width="90">
47
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
48
+                        </el-table-column>
49
+                    </el-table>
50
+                </div>
51
+                <div style="flex:1;margin-left:20px;">
52
+                    <div style="display:flex;justify-content: space-between;align-items: center;">
53
+                        <div class="tablesTitle">自备药列表</div>
54
+                        <div>
55
+                            <el-button type="primary" @click="openForm(1)">添加</el-button>
56
+                            <el-button type="primary" @click="openForm(2)">入库</el-button>
57
+                            <el-button type="primary" @click="openForm(3)">出库</el-button>
58
+                        </div>
59
+                    </div>
60
+                    <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
61
+                        <el-table-column align="center" prop="dialysis_no" label="药品名称" width="120">
62
+                            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
63
+                        </el-table-column>
64
+                        <el-table-column align="center" prop="name" label="规格名称">
65
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
66
+                        </el-table-column>
67
+                        <el-table-column align="center" prop="dialysis_no" label="单位" width="60">
68
+                            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
69
+                        </el-table-column>
70
+                        <el-table-column align="center" prop="name" label="自备数量" width="90">
71
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
72
+                        </el-table-column>
73
+                        <el-table-column align="center" prop="name" label="已使用" width="90">
74
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
75
+                        </el-table-column>
76
+                        <el-table-column align="center" prop="name" label="剩余" width="90">
77
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
78
+                        </el-table-column>
79
+                        <el-table-column align="center" prop="name" label="停用" width="90">
80
+                            <template slot-scope="scope">
81
+                                <el-switch v-model="value1">
82
+                                </el-switch>
83
+                            </template>
84
+                        </el-table-column>
85
+                        <el-table-column align="center" prop="name" label="备注">
86
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
87
+                        </el-table-column>
88
+                        <el-table-column align="center" prop="name" label="操作" width="180">
89
+                            <template slot-scope="scope">
90
+                                <el-button size="mini" type="primary" @click="toDetail">明细</el-button>
91
+                                <el-button size="mini" type="danger">删除</el-button>
92
+                            </template>
93
+                        </el-table-column>
94
+                    </el-table>
95
+                </div>
96
+            </el-container>
97
+        </div>
98
+
99
+        <el-dialog
100
+        title="设置"
101
+        :visible.sync="dialogVisible"
102
+        width="600px"
103
+        :before-close="handleClose">
104
+            <p style="margin-bottom:20px;">启用“自备药”后,在开透析医嘱时,医生可以选择自备药中的药品,且将自动出库</p>
105
+            <el-radio v-model="radio" label="1">开启</el-radio>
106
+            <el-radio v-model="radio" label="2">不开启</el-radio>
107
+            <span slot="footer" class="dialog-footer">
108
+                <el-button @click="dialogVisible = false">取 消</el-button>
109
+                <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
110
+            </span>
111
+        </el-dialog>
112
+        <add-medicine ref="addMedicine"></add-medicine>
113
+        <medicine-detail ref="medicineDetail"></medicine-detail>
114
+        <warehousing ref="warehousing"></warehousing>
115
+        <warehouse-out ref="warehouseOut"></warehouse-out>
116
+    </div>
117
+</template>
118
+
119
+
120
+<script>
121
+import BreadCrumb from "../../components/bread-crumb";
122
+import addMedicine from "./components/addMedicine"
123
+import medicineDetail from "./components/medicineDetail"
124
+import warehousing from "./components/warehousing"
125
+import warehouseOut from "./components/warehouseOut"
126
+export default {
127
+    components:{
128
+        BreadCrumb,
129
+        addMedicine,
130
+        medicineDetail,
131
+        warehousing,
132
+        warehouseOut
133
+    },
134
+    data(){
135
+        return{
136
+            crumbs: [
137
+                { path: false, name: "库存管理" },
138
+                { path: false, name: "自备药管理" },
139
+                { path: false, name: "自备药管理" },
140
+            ],
141
+            options: [{
142
+            value: '选项1',
143
+            label: '黄金糕'
144
+            }, {
145
+            value: '选项2',
146
+            label: '双皮奶'
147
+            }, {
148
+            value: '选项3',
149
+            label: '蚵仔煎'
150
+            }, {
151
+            value: '选项4',
152
+            label: '龙须面'
153
+            }, {
154
+            value: '选项5',
155
+            label: '北京烤鸭'
156
+            }],
157
+            value: '',
158
+            tableData:[
159
+                {dialysis_no:123,name:'张三'},
160
+                {dialysis_no:123,name:'张三'},
161
+                {dialysis_no:123,name:'张三'},
162
+                {dialysis_no:123,name:'张三'},
163
+                {dialysis_no:123,name:'张三'},
164
+                {dialysis_no:123,name:'张三'},
165
+                {dialysis_no:123,name:'张三'},
166
+                {dialysis_no:123,name:'张三'},
167
+                {dialysis_no:123,name:'张三'},
168
+            ],
169
+            dialogVisible:false,
170
+            radio:'1'
171
+        }
172
+    },
173
+    methods:{
174
+        setting(){
175
+            this.dialogVisible = true
176
+        },
177
+        openForm(index){
178
+            if(index == 1){
179
+                this.$refs.addMedicine.show();
180
+            }else if(index == 2){
181
+                this.$refs.warehousing.show();
182
+            }else if(index == 3){
183
+                this.$refs.warehouseOut.show();
184
+            }
185
+            
186
+        },
187
+        toDetail(){
188
+            this.$refs.medicineDetail.show();
189
+        }
190
+    }
191
+}
192
+</script>
193
+
194
+
195
+<style lang="scss" scoped>
196
+.tablesTitle{
197
+    font-size: 16px;
198
+    color: #000;
199
+    font-weight: bold;
200
+    height: 40px;
201
+    line-height: 40px;
202
+}
203
+</style>

+ 180 - 0
src/xt_pages/stock/selfPreparedMedicine/info.vue View File

@@ -0,0 +1,180 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+            <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+            <el-button
6
+                size="small"
7
+                @click="setting"
8
+                class="filter-item"
9
+                style="float:right;"
10
+                type="primary"
11
+                >设置
12
+            </el-button>
13
+        </div>
14
+
15
+        <div class="app-container">
16
+            <el-container>
17
+                <div style="width:250px;">
18
+                    <div style="display:flex;justify-content: space-between;align-items: center;">
19
+                        <div class="tablesTitle">药品名称</div>
20
+                        <el-button type="primary">新增</el-button>
21
+                    </div>
22
+                    <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
23
+                        <el-table-column align="center" prop="dialysis_no" label="透析号" width="70">
24
+                            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
25
+                        </el-table-column>
26
+                        <el-table-column align="center" prop="name" label="姓名" width="90">
27
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
28
+                        </el-table-column>
29
+                        <el-table-column align="center" prop="name" label="操作" width="80">
30
+                            <template slot-scope="scope">
31
+                                <el-button size="mini" type="danger">删除</el-button>
32
+                            </template>
33
+                        </el-table-column>
34
+                    </el-table>
35
+                </div>
36
+                <div style="flex:1;margin-left:20px;">
37
+                    <div style="display:flex;justify-content: space-between;align-items: center;">
38
+                        <div class="tablesTitle">药品规格</div>
39
+                        <div>
40
+                            <el-button type="primary">新增</el-button>
41
+                        </div>
42
+                    </div>
43
+                    <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
44
+                        <el-table-column align="center" prop="dialysis_no" label="序号" width="60">
45
+                            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
46
+                        </el-table-column>
47
+                        <el-table-column align="center" prop="name" label="规格名称">
48
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
49
+                        </el-table-column>
50
+                        <el-table-column align="center" prop="dialysis_no" label="单位" width="80">
51
+                            <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
52
+                        </el-table-column>
53
+                        <el-table-column align="center" prop="name" label="价格" width="80">
54
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
55
+                        </el-table-column>
56
+                        <el-table-column align="center" prop="name" label="库存警戒" width="90">
57
+                            <template slot-scope="scope">{{ scope.row.name }}</template>
58
+                        </el-table-column>
59
+                        <el-table-column align="center" prop="name" label="停用" width="90">
60
+                            <template slot-scope="scope">
61
+                                <el-switch v-model="value1">
62
+                                </el-switch>
63
+                            </template>
64
+                        </el-table-column>
65
+                        <el-table-column align="center" prop="name" label="操作" width="180">
66
+                            <template slot-scope="scope">
67
+                                <el-button size="mini" type="primary" @click="toDetail">编辑</el-button>
68
+                                <el-button size="mini" type="danger">删除</el-button>
69
+                            </template>
70
+                        </el-table-column>
71
+                    </el-table>
72
+                </div>
73
+            </el-container>
74
+        </div>
75
+
76
+        <el-dialog
77
+        title="设置"
78
+        :visible.sync="dialogVisible"
79
+        width="600px"
80
+        :before-close="handleClose">
81
+            <p style="margin-bottom:20px;">启用“自备药”后,在开透析医嘱时,医生可以选择自备药中的药品,且将自动出库</p>
82
+            <el-radio v-model="radio" label="1">开启</el-radio>
83
+            <el-radio v-model="radio" label="2">不开启</el-radio>
84
+            <span slot="footer" class="dialog-footer">
85
+                <el-button @click="dialogVisible = false">取 消</el-button>
86
+                <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
87
+            </span>
88
+        </el-dialog>
89
+        <add-medicine ref="addMedicine"></add-medicine>
90
+        <medicine-detail ref="medicineDetail"></medicine-detail>
91
+        <warehousing ref="warehousing"></warehousing>
92
+        <warehouse-out ref="warehouseOut"></warehouse-out>
93
+    </div>
94
+</template>
95
+
96
+
97
+<script>
98
+import BreadCrumb from "../../components/bread-crumb";
99
+import addMedicine from "./components/addMedicine"
100
+import medicineDetail from "./components/medicineDetail"
101
+import warehousing from "./components/warehousing"
102
+import warehouseOut from "./components/warehouseOut"
103
+export default {
104
+    components:{
105
+        BreadCrumb,
106
+        addMedicine,
107
+        medicineDetail,
108
+        warehousing,
109
+        warehouseOut
110
+    },
111
+    data(){
112
+        return{
113
+            crumbs: [
114
+                { path: false, name: "库存管理" },
115
+                { path: false, name: "自备药管理" },
116
+                { path: false, name: "自备药管理" },
117
+            ],
118
+            options: [{
119
+            value: '选项1',
120
+            label: '黄金糕'
121
+            }, {
122
+            value: '选项2',
123
+            label: '双皮奶'
124
+            }, {
125
+            value: '选项3',
126
+            label: '蚵仔煎'
127
+            }, {
128
+            value: '选项4',
129
+            label: '龙须面'
130
+            }, {
131
+            value: '选项5',
132
+            label: '北京烤鸭'
133
+            }],
134
+            value: '',
135
+            tableData:[
136
+                {dialysis_no:123,name:'张三'},
137
+                {dialysis_no:123,name:'张三'},
138
+                {dialysis_no:123,name:'张三'},
139
+                {dialysis_no:123,name:'张三'},
140
+                {dialysis_no:123,name:'张三'},
141
+                {dialysis_no:123,name:'张三'},
142
+                {dialysis_no:123,name:'张三'},
143
+                {dialysis_no:123,name:'张三'},
144
+                {dialysis_no:123,name:'张三'},
145
+            ],
146
+            dialogVisible:false,
147
+            radio:'1'
148
+        }
149
+    },
150
+    methods:{
151
+        setting(){
152
+            this.dialogVisible = true
153
+        },
154
+        openForm(index){
155
+            if(index == 1){
156
+                this.$refs.addMedicine.show();
157
+            }else if(index == 2){
158
+                this.$refs.warehousing.show();
159
+            }else if(index == 3){
160
+                this.$refs.warehouseOut.show();
161
+            }
162
+            
163
+        },
164
+        toDetail(){
165
+            this.$refs.medicineDetail.show();
166
+        }
167
+    }
168
+}
169
+</script>
170
+
171
+
172
+<style lang="scss" scoped>
173
+.tablesTitle{
174
+    font-size: 16px;
175
+    color: #000;
176
+    font-weight: bold;
177
+    height: 40px;
178
+    line-height: 40px;
179
+}
180
+</style>

+ 136 - 0
src/xt_pages/stock/selfPreparedMedicine/query.vue View File

@@ -0,0 +1,136 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+            <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+            <div>
6
+                <el-button
7
+                    size="small"
8
+                    @click="setting"
9
+                    class="filter-item"
10
+                    type="primary"
11
+                    >导出
12
+                </el-button>
13
+                <el-button
14
+                    size="small"
15
+                    @click="toPrint"
16
+                    class="filter-item"
17
+                    type="primary"
18
+                    >打印
19
+                </el-button>
20
+            </div>
21
+        </div>
22
+        <div class="app-container">
23
+            <div class="cell clearfix">
24
+                <el-date-picker
25
+                v-model="start_time"
26
+                prefix-icon="el-icon-date"
27
+                :editable="false"
28
+                style="width: 196px;margin-right:10px;"
29
+                type="date"
30
+                placeholder="选择日期时间"
31
+                align="right"
32
+                format="yyyy-MM-dd"
33
+                value-format="yyyy-MM-dd"
34
+                ></el-date-picker>
35
+                <el-date-picker
36
+                v-model="start_time"
37
+                prefix-icon="el-icon-date"
38
+                :editable="false"
39
+                style="width: 196px;margin-right:10px;"
40
+                type="date"
41
+                placeholder="选择日期时间"
42
+                align="right"
43
+                format="yyyy-MM-dd"
44
+                value-format="yyyy-MM-dd"
45
+                ></el-date-picker>
46
+                <el-select v-model="value" placeholder="请选择" style="margin-right:10px;">
47
+                    <el-option
48
+                    v-for="item in options"
49
+                    :key="item.value"
50
+                    :label="item.label"
51
+                    :value="item.value">
52
+                    </el-option>
53
+                </el-select>
54
+                <el-select v-model="value" placeholder="请选择">
55
+                    <el-option
56
+                    v-for="item in options"
57
+                    :key="item.value"
58
+                    :label="item.label"
59
+                    :value="item.value">
60
+                    </el-option>
61
+                </el-select>
62
+                <el-input style="width: 180px;margin:0 10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
63
+                <el-button class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button>
64
+            </div>
65
+            <el-table :data="tableData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
66
+                <el-table-column align="center" label="序号" width="60">
67
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
68
+                </el-table-column>
69
+                <el-table-column align="center" prop="name" label="透析号" width="80">
70
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
71
+                </el-table-column>
72
+                <el-table-column align="center" prop="name" label="姓名" width="80">
73
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
74
+                </el-table-column>
75
+                <el-table-column align="center" prop="name" label="药品名称">
76
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
77
+                </el-table-column>
78
+                <el-table-column align="center" prop="name" label="规格名称">
79
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
80
+                </el-table-column>
81
+                <el-table-column align="center" prop="name" label="单位" width="80">
82
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
83
+                </el-table-column>
84
+                <el-table-column align="center" prop="name" label="自卑量" width="80">
85
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
86
+                </el-table-column>
87
+                <el-table-column align="center" prop="name" label="已使用" width="80">
88
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
89
+                </el-table-column>
90
+                <el-table-column align="center" prop="name" label="剩余" width="80">
91
+                    <template slot-scope="scope">{{ scope.row.name }}</template>
92
+                </el-table-column>
93
+            </el-table>
94
+        </div>
95
+    </div>
96
+</template>
97
+
98
+<script>
99
+import BreadCrumb from "../../components/bread-crumb";
100
+export default {
101
+    components:{
102
+        BreadCrumb
103
+    },
104
+    data(){
105
+        return{
106
+            crumbs: [
107
+                { path: false, name: "库存管理" },
108
+                { path: false, name: "自备药管理" },
109
+                { path: false, name: "自备药查询" },
110
+            ],
111
+            tableData: [{
112
+                date: '2016-05-02',
113
+                name: '王小虎',
114
+                address: '上海市普陀区金沙江路 1518 弄'
115
+                }, {
116
+                date: '2016-05-04',
117
+                name: '王小虎',
118
+                address: '上海市普陀区金沙江路 1517 弄'
119
+                }, {
120
+                date: '2016-05-01',
121
+                name: '王小虎',
122
+                address: '上海市普陀区金沙江路 1519 弄'
123
+                }, {
124
+                date: '2016-05-03',
125
+                name: '王小虎',
126
+                address: '上海市普陀区金沙江路 1516 弄'
127
+            }]
128
+        }
129
+    },
130
+    methods:{
131
+        toPrint(){
132
+            this.$router.push({path: '/stock/selfPreparedMedicineQueryPrint'})
133
+        }
134
+    }
135
+}
136
+</script>

+ 635 - 0
src/xt_pages/stock/selfPreparedMedicine/queryPrint.vue View File

@@ -0,0 +1,635 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="print_main_content">
14
+                    <div class="order_title_panl">
15
+                        <span class="main_title">{{ $store.getters.xt_user.org.org_name }}医护排班表</span>
16
+                    </div>
17
+                    <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
18
+                      打印时间:
19
+                    </div>
20
+                    <div class="table_panel">
21
+                        <table class="table">
22
+                            <thead>
23
+                                <tr>
24
+                                    <td width="60">序号</td>
25
+                                    <td width="80">透析号</td>
26
+                                    <td width="80">姓名</td>
27
+                                    <td>药品名称</td>
28
+                                    <td>规格名称</td>
29
+                                    <td width="70">单位</td>
30
+                                    <td width="70">自备量</td>
31
+                                    <td width="70">已使用</td>
32
+                                    <td width="70">剩余</td>
33
+                                </tr>
34
+                            </thead>
35
+                            <tbody>
36
+                                <tr v-for='(item,index) in 8' :key="index">
37
+                                    <td>张三</td>
38
+                                    <td>张三</td>
39
+                                    <td>张三</td>
40
+                                    <td>张三</td>
41
+                                    <td>张三</td>
42
+                                    <td>张三</td>
43
+                                    <td>张三</td>
44
+                                    <td>张三</td>
45
+                                    <td>张三</td>
46
+                                </tr>
47
+                            </tbody>
48
+                        </table>
49
+                    </div>
50
+                </div>
51
+            </div>
52
+        </div>
53
+    </div>
54
+</template>
55
+
56
+<script>
57
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
58
+import print from 'print-js'
59
+import { getDoctorList,getScheduleByDoctorId } from '@/api/doctorSchedule'
60
+export default {
61
+    components:{
62
+        BreadCrumb
63
+    },
64
+    data(){
65
+        return{
66
+          crumbs: [
67
+            { path: false, name: '库存管理' },
68
+            { path: false, name: '自备药查询' },
69
+            { path: false, name: '自备药打印' },
70
+          ],
71
+          start_time:"",
72
+          end_time:"",
73
+
74
+          doctorlist:[],
75
+          tableData:[],
76
+          arrZero:[],
77
+          arrOne:[],
78
+          arrTwo:[],
79
+          arrThree:[],
80
+          arrFour:[],
81
+          arrFive:[],
82
+          arrSix:[],
83
+          arrSeven:[],
84
+          typevalue:0,
85
+          
86
+          doctorTableData:[],
87
+          nurseTableData:[]
88
+        }
89
+    },
90
+    methods:{
91
+      printAction: function() {
92
+          const style = '@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
93
+
94
+          printJS({
95
+          printable: 'print_content',
96
+          type: 'html',
97
+          documentTitle: '  ',
98
+          style: style,
99
+          scanStyles: false
100
+          })
101
+      },
102
+      getDoctorList(){
103
+        getDoctorList().then(response=>{
104
+          var list =  response.data.data.list
105
+          this.doctorlist = list
106
+          this.getScheduleByDoctorId()
107
+
108
+          //
109
+          var doctorlist =  response.data.data.doctorlist
110
+          let arr = []
111
+          for(let i=0;i<doctorlist.length;i++){
112
+              if(doctorlist[i].sort == 0){
113
+                doctorlist[i].sort = ""
114
+              }
115
+          }
116
+          console.log('doctorlist',doctorlist)
117
+          this.doctorTableData = doctorlist
118
+          var nurselist = response.data.data.nurselist
119
+          for(let i=0;i<nurselist.length;i++){
120
+              if(nurselist[i].sort == 0){
121
+                  nurselist[i].sort = ""
122
+              }
123
+          }
124
+          this.nurseTableData = nurselist
125
+        })
126
+      },
127
+      //获取本周的所有排班列表
128
+      getScheduleByDoctorId(){
129
+        const params = {
130
+          start_time:this.start_time,
131
+          end_time:this.end_time,
132
+          doctor_id:this.typevalue,
133
+        }
134
+        console.log("parasm",params)
135
+        getScheduleByDoctorId(params).then(response=>{
136
+          if(response.data.state == 1){
137
+              var staffList = response.data.data.staffList
138
+              console.log("stafflist",staffList)
139
+
140
+              var sevenStr = ""
141
+              var oneStr = ""
142
+              var twoStr = ""
143
+              var threeStr = ""
144
+              var fourStr = ""
145
+              var fiveStr = ""
146
+              var sixStr = ""
147
+              for(let i=0;i<staffList.length;i++){
148
+              if(staffList[i].schedule_week == 0){
149
+                  staffList[i].class_index = 0
150
+                    var arr = []
151
+                  this.arrZero.push(staffList[i].class_name)
152
+                  for(let i=0;i<this.arrZero.length;i++){
153
+                      if(this.arrZero[i]!=''){
154
+                        arr.push(this.arrZero[i])
155
+                      }
156
+                  }
157
+                  var countedNames = arr.reduce(function (allNames, name) { 
158
+                      if (name in allNames) {
159
+                          allNames[name]++;
160
+                      }
161
+                      else {
162
+                          allNames[name] = 1;
163
+                      }
164
+                      return allNames;
165
+                  }, {});
166
+                  let objKey = Object.keys(countedNames)
167
+                  let objVal = Object.values(countedNames)
168
+                  var zeroStr = ''
169
+                  objKey.map((item,index) => {
170
+                  let objVal = Object.values(countedNames)
171
+                      zeroStr += item + objVal[index] + '\n'
172
+                  })
173
+                  sevenStr = zeroStr
174
+              }
175
+              if(staffList[i].schedule_week == 1){
176
+                  staffList[i].class_index = 1
177
+                  var arr = []
178
+                  this.arrOne.push(staffList[i].class_name)
179
+                  for(let i=0;i<this.arrOne.length;i++){
180
+                      if(this.arrOne[i]!=''){
181
+                        arr.push(this.arrOne[i])
182
+                      }
183
+                  }
184
+                  var countedNames = arr.reduce(function (allNames, name) { 
185
+                      if (name in allNames) {
186
+                          allNames[name]++;
187
+                      }
188
+                      else {
189
+                          allNames[name] = 1;
190
+                      }
191
+                      return allNames;
192
+                  }, {});
193
+                  let objKey = Object.keys(countedNames)
194
+                  let objVal = Object.values(countedNames)
195
+                  let strOne = ''
196
+                  objKey.map((item,index) => {
197
+                  let objVal = Object.values(countedNames)
198
+                      strOne += item + objVal[index] + '\n'
199
+                  })
200
+                  oneStr  = strOne
201
+              }
202
+              if(staffList[i].schedule_week == 2){
203
+                  staffList[i].class_index = 2
204
+                    var arr = []
205
+                  this.arrTwo.push(staffList[i].class_name)
206
+                  for(let i=0;i<this.arrTwo.length;i++){
207
+                      if(this.arrTwo[i]!=''){
208
+                        arr.push(this.arrTwo[i])
209
+                      }
210
+                  }
211
+                  var countedNames = arr.reduce(function (allNames, name) { 
212
+                      if (name in allNames) {
213
+                          allNames[name]++;
214
+                      }
215
+                      else {
216
+                          allNames[name] = 1;
217
+                      }
218
+                      return allNames;
219
+                  }, {});
220
+                  let objKey = Object.keys(countedNames)
221
+                  let objVal = Object.values(countedNames)
222
+                  let strTwo = ''
223
+                  objKey.map((item,index) => {
224
+                  let objVal = Object.values(countedNames)
225
+                      strTwo += item + objVal[index] + '\n'
226
+                  })
227
+                    twoStr = strTwo
228
+              }
229
+              if(staffList[i].schedule_week == 3){
230
+                  staffList[i].class_index = 3
231
+                    var arr = []
232
+                  this.arrThree.push(staffList[i].class_name)
233
+                  for(let i=0;i<this.arrThree.length;i++){
234
+                      if(this.arrThree[i]!=''){
235
+                        arr.push(this.arrThree[i])
236
+                      }
237
+                  }
238
+                  var countedNames = arr.reduce(function (allNames, name) { 
239
+                      if (name in allNames) {
240
+                          allNames[name]++;
241
+                      }
242
+                      else {
243
+                          allNames[name] = 1;
244
+                      }
245
+                      return allNames;
246
+                  }, {});
247
+                  let objKey = Object.keys(countedNames)
248
+                  let objVal = Object.values(countedNames)
249
+                  let strThree = ''
250
+                  objKey.map((item,index) => {
251
+                  let objVal = Object.values(countedNames)
252
+                      strThree += item + objVal[index] + '\n'
253
+                  })
254
+                  threeStr = strThree
255
+              }
256
+              if(staffList[i].schedule_week == 4){
257
+                  staffList[i].class_index = 4
258
+                  var arr = []
259
+                  this.arrFour.push(staffList[i].class_name)
260
+                  for(let i=0;i<this.arrFour.length;i++){
261
+                      if(this.arrFour[i]!=''){
262
+                        arr.push(this.arrFour[i])
263
+                      }
264
+                  }
265
+                  var countedNames = arr.reduce(function (allNames, name) { 
266
+                      if (name in allNames) {
267
+                          allNames[name]++;
268
+                      }
269
+                      else {
270
+                          allNames[name] = 1;
271
+                      }
272
+                      return allNames;
273
+                  }, {});
274
+                  let objKey = Object.keys(countedNames)
275
+                  let objVal = Object.values(countedNames)
276
+                  let strFour = ''
277
+                  objKey.map((item,index) => {
278
+                  let objVal = Object.values(countedNames)
279
+                      strFour += item + objVal[index] + '\n'
280
+                  })
281
+                  fourStr = strFour
282
+              }
283
+              if(staffList[i].schedule_week == 5){
284
+                  staffList[i].class_index = 5
285
+
286
+                    var arr = []
287
+                  this.arrFive.push(staffList[i].class_name)
288
+                  for(let i=0;i<this.arrFive.length;i++){
289
+                      if(this.arrFive[i]!=''){
290
+                        arr.push(this.arrFive[i])
291
+                      }
292
+                  }
293
+                  var countedNames = arr.reduce(function (allNames, name) { 
294
+                      if (name in allNames) {
295
+                          allNames[name]++;
296
+                      }
297
+                      else {
298
+                          allNames[name] = 1;
299
+                      }
300
+                      return allNames;
301
+                  }, {});
302
+                  let objKey = Object.keys(countedNames)
303
+                  let objVal = Object.values(countedNames)
304
+                  let strFive = ''
305
+                  objKey.map((item,index) => {
306
+                  let objVal = Object.values(countedNames)
307
+                      strFive += item + objVal[index] + '\n'
308
+                  })
309
+                    fiveStr = strFive
310
+              }
311
+              if(staffList[i].schedule_week == 6){
312
+                  staffList[i].class_index = 6
313
+                    var arr = []
314
+                  this.arrSix.push(staffList[i].class_name)
315
+                  for(let i=0;i<this.arrSix.length;i++){
316
+                      if(this.arrSix[i]!=''){
317
+                        arr.push(this.arrSix[i])
318
+                      }
319
+                  }
320
+                  var countedNames = arr.reduce(function (allNames, name) { 
321
+                      if (name in allNames) {
322
+                          allNames[name]++;
323
+                      }
324
+                      else {
325
+                          allNames[name] = 1;
326
+                      }
327
+                      return allNames;
328
+                  }, {});
329
+                  let objKey = Object.keys(countedNames)
330
+                  let objVal = Object.values(countedNames)
331
+                  let strSix = ''
332
+                  objKey.map((item,index) => {
333
+                  let objVal = Object.values(countedNames)
334
+                      strSix += item + objVal[index] + '\n'
335
+                  })
336
+                  sixStr = strSix
337
+                }
338
+              }
339
+              let tempArr = [], newArr = []
340
+              for (let i = 0; i < staffList.length; i++) {
341
+                if (tempArr.indexOf(staffList[i].user_name) === -1) {
342
+                  newArr.push({
343
+                    user_name: staffList[i].user_name,
344
+                    admin_user_id:staffList[i].admin_user_id,
345
+                    user_type:staffList[i].doctor_type,
346
+                    is_sort:staffList[i].is_sort,
347
+                    sort:staffList[i].sort,
348
+                    list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
349
+                  })
350
+                  tempArr.push(staffList[i].user_name);
351
+                } else {
352
+                  for (let j = 0; j < newArr.length; j++) {
353
+                    if (newArr[j].user_name == staffList[i].user_name) {
354
+                      newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
355
+                    }
356
+                  }
357
+                }
358
+              }
359
+
360
+              let arr = [...newArr]
361
+              let newNurse = []
362
+              let newDoctor = []
363
+              arr.map(item => {
364
+                if(item.user_type == 2){
365
+                  newDoctor.push(item)
366
+                }
367
+                if(item.user_type == 3){
368
+                  newNurse.push(item)
369
+                }
370
+              })
371
+
372
+              if(this.typevalue == 0){
373
+                //护士
374
+                newNurse.sort(this.compare('admin_user_id'))
375
+                let newNurseTableData = []
376
+                this.nurseTableData.map(item => {
377
+                    if(item.is_sort == 1){
378
+                        newNurseTableData.push(item)
379
+                    }
380
+                })
381
+                newNurseTableData.sort(this.compare('admin_user_id'))
382
+                newNurseTableData.map((item,index) => {
383
+                    if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
384
+                
385
+                    }else{
386
+                        newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
387
+                    }
388
+                })
389
+                newNurse.sort(this.compare('sort'))
390
+
391
+                //医生
392
+                newDoctor.sort(this.compare('admin_user_id'))
393
+                let newDoctorTableData = []
394
+                this.doctorTableData.map(item => {
395
+                    if(item.is_sort == 1){
396
+                        newDoctorTableData.push(item)
397
+                    }
398
+                })
399
+                newDoctorTableData.sort(this.compare('admin_user_id'))
400
+                newDoctorTableData.map((item,index) => {
401
+                    if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
402
+                
403
+                    }else{
404
+                        newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
405
+                    }
406
+                })
407
+                newDoctor.sort(this.compare('sort'))
408
+                
409
+                
410
+
411
+                let arr2 = []
412
+                arr2.push({class_name:oneStr,schedule_week:1})
413
+                arr2.push({class_name:twoStr,schedule_week:2})
414
+                arr2.push({class_name:threeStr,schedule_week:3})
415
+                arr2.push({class_name:fourStr,schedule_week:4})
416
+                arr2.push({class_name:fiveStr,schedule_week:5})
417
+                arr2.push({class_name:sixStr,schedule_week:6})
418
+                arr2.push({class_name:zeroStr,schedule_week:0})
419
+                var obj = {}
420
+                obj.admin_user_id = "1000000"
421
+                obj.user_name = "合计"
422
+                obj.user_type = 10
423
+                obj.list = arr2
424
+                arr.push(obj)
425
+
426
+                let data = []
427
+                data.push(...newNurse)
428
+                data.push(...newDoctor)
429
+                data.push(obj)
430
+                this.tableData = data
431
+              }
432
+              if(this.typevalue == 2){
433
+                newDoctor.sort(this.compare('admin_user_id'))
434
+                let newDoctorTableData = []
435
+                this.doctorTableData.map(item => {
436
+                    if(item.is_sort == 1){
437
+                        newDoctorTableData.push(item)
438
+                    }
439
+                })
440
+                newDoctorTableData.sort(this.compare('admin_user_id'))
441
+                newDoctorTableData.map((item,index) => {
442
+                    if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
443
+                
444
+                    }else{
445
+                        newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
446
+                    }
447
+                })
448
+                newDoctor.sort(this.compare('sort'))
449
+                
450
+                let arr2 = []
451
+                arr2.push({class_name:oneStr,schedule_week:1})
452
+                arr2.push({class_name:twoStr,schedule_week:2})
453
+                arr2.push({class_name:threeStr,schedule_week:3})
454
+                arr2.push({class_name:fourStr,schedule_week:4})
455
+                arr2.push({class_name:fiveStr,schedule_week:5})
456
+                arr2.push({class_name:sixStr,schedule_week:6})
457
+                arr2.push({class_name:zeroStr,schedule_week:0})
458
+                var obj = {}
459
+                obj.admin_user_id = "1000000"
460
+                obj.user_name = "合计"
461
+                obj.user_type = 10
462
+                obj.list = arr2
463
+                newDoctor.push(obj)
464
+                this.tableData = newDoctor
465
+              }
466
+              if(this.typevalue == 3){
467
+                newNurse.sort(this.compare('admin_user_id'))
468
+                let newNurseTableData = []
469
+                this.nurseTableData.map(item => {
470
+                    if(item.is_sort == 1){
471
+                        newNurseTableData.push(item)
472
+                    }
473
+                })
474
+                newNurseTableData.sort(this.compare('admin_user_id'))
475
+                newNurseTableData.map((item,index) => {
476
+                    if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
477
+                
478
+                    }else{
479
+                        newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
480
+                    }
481
+                })
482
+                newNurse.sort(this.compare('sort'))
483
+                let arr2 = []
484
+                arr2.push({class_name:oneStr,schedule_week:1})
485
+                arr2.push({class_name:twoStr,schedule_week:2})
486
+                arr2.push({class_name:threeStr,schedule_week:3})
487
+                arr2.push({class_name:fourStr,schedule_week:4})
488
+                arr2.push({class_name:fiveStr,schedule_week:5})
489
+                arr2.push({class_name:sixStr,schedule_week:6})
490
+                arr2.push({class_name:zeroStr,schedule_week:0})
491
+                var obj = {}
492
+                obj.admin_user_id = "1000000"
493
+                obj.user_name = "合计"
494
+                obj.user_type = 10
495
+                obj.list = arr2
496
+                newNurse.push(obj)
497
+                this.tableData = newNurse
498
+              }
499
+            }
500
+        })
501
+      },
502
+      getClass(name,index){
503
+        if(name != undefined){
504
+          let newClass = '';
505
+          this.tableData.map(item => {
506
+            if(item.user_name == name){
507
+              if(item.list){
508
+                item.list.map(it => {
509
+                  if(it.schedule_week == index){
510
+                    newClass = it.class_name
511
+                  }
512
+                })
513
+              } 
514
+            }
515
+          })
516
+          if(newClass && newClass.indexOf("(") > -1){
517
+            let num = newClass.indexOf("(")
518
+            let a = newClass.slice(0, num) + '\n' + newClass.slice(num)
519
+            return a
520
+          }else if(newClass && newClass.indexOf("(") > -1) {
521
+            let num = newClass.indexOf("(")
522
+            let a = newClass.slice(0, num) + '\n' + newClass.slice(num)
523
+            return a
524
+          }else{
525
+            return newClass
526
+          }
527
+          
528
+        }
529
+      },
530
+      getNowFormatDate() {
531
+        var date = new Date();
532
+        var seperator1 = "-";
533
+        var year = date.getFullYear();
534
+        var month = date.getMonth() + 1;
535
+        var strDate = date.getDate();
536
+        if (month >= 1 && month <= 9) {
537
+            month = "0" + month;
538
+        }
539
+        if (strDate >= 0 && strDate <= 9) {
540
+            strDate = "0" + strDate;
541
+        }
542
+        var currentdate = year + seperator1 + month + seperator1 + strDate;
543
+        return currentdate;
544
+      },
545
+      compare(property){
546
+        return function(a,b){
547
+            var value1 = a[property];
548
+            var value2 = b[property];
549
+            return value2 - value1;
550
+        }
551
+      },
552
+    },
553
+    created(){
554
+      var starttime =  this.$route.query.starttime
555
+      this.start_time = starttime
556
+      var endtime =  this.$route.query.endtime
557
+      this.end_time = endtime
558
+      this.weekArr = this.$route.query.weekArr.split(',')
559
+      this.typevalue = parseInt(this.$route.query.typeValue)
560
+      
561
+      //获取该机构所有医护人员
562
+      this.getDoctorList()
563
+    }
564
+}
565
+</script>
566
+
567
+
568
+<style rel="stylesheet/scss" lang="scss" scoped>
569
+.print_main_content {
570
+  background-color: white;
571
+  max-width: 1500px;
572
+  margin: 0 auto;
573
+  padding: 0 0 20px 0;
574
+
575
+  .order_title_panl {
576
+    text-align: center;
577
+
578
+    .main_title {
579
+      font-size: 18px;
580
+      line-height: 40px;
581
+      font-weight: 500;
582
+    }
583
+  }
584
+  .table_panel {
585
+    .table {
586
+      width: 100%;
587
+      border: 1px solid;
588
+      border-collapse: collapse;
589
+      padding: 2px;
590
+      
591
+
592
+      thead {
593
+        tr {
594
+          td {
595
+            border: 1px solid;
596
+            text-align: center;
597
+            font-size: 18px;
598
+            padding: 15px 5px;
599
+          }
600
+        }
601
+      }
602
+      tbody {
603
+        tr {
604
+          td {
605
+            border: 1px solid;
606
+            text-align: center;
607
+            font-size: 18px;
608
+            padding: 10px 5px;
609
+            white-space: pre-line;
610
+            .proj {
611
+              padding: 5px 0;
612
+              text-align: left;
613
+
614
+              .proj_title {
615
+                font-size: 16px;
616
+                font-weight: 500;
617
+                line-height: 25px;
618
+              }
619
+
620
+              .proj_item {
621
+                font-size: 15px;
622
+                line-height: 20px;
623
+
624
+                .zone_name {
625
+                  font-weight: 500;
626
+                }
627
+              }
628
+            }
629
+          }
630
+        }
631
+      }
632
+    }
633
+  }
634
+}
635
+</style>