Sfoglia il codice sorgente

11月14日 库存扣减更新

XMLWAN 3 anni fa
parent
commit
89953e9136

+ 495 - 0
src/xt_pages/supply/components/goodOrderPrint.vue Vedi File

@@ -0,0 +1,495 @@
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
8
+            size="small"
9
+            icon="el-icon-printer"
10
+            type="primary"
11
+            @click="printAction"
12
+            >打印</el-button
13
+          >
14
+        </el-col>
15
+      </el-row>
16
+    </div>
17
+    <div class="app-container" style="background-color: white">
18
+      <div id="print_content">
19
+        <div class="print_main_content">
20
+          <div class="order_title_panl">
21
+            <div style="font-size: 22px; font-weight: bold">{{ orgName }}</div>
22
+            <span style="font-weight: 500; font-size: 18px">采购单</span>
23
+          </div>
24
+          <div style="display: flex; justify-content: space-between">
25
+            <div style="text-align: left; margin-bottom: 1px; font-size: 18px">
26
+              供应商:
27
+                {{ getSupplyName(supplier_id) }}
28
+            </div>
29
+            <div style="margin-bottom: 1px; font-size: 18px">
30
+             单据日期:{{ getTimes(document_date) }}
31
+            </div>
32
+            <div style="margin-bottom: 1px; font-size: 18px">
33
+              单据编号:
34
+              {{ good_number }}
35
+            </div>
36
+            <div style="margin-bottom: 1px; font-size: 18px">币别:RMB</div>
37
+          </div>
38
+
39
+          <div class="table_panel">
40
+            <table class="table">
41
+              <thead>
42
+                <tr>
43
+                  <td style="line-height: 18px" width="80">序号</td>
44
+                  <td style="line-height: 18px" width="80">商品</td>
45
+                  <td style="line-height: 18px" width="80">单位</td>
46
+                  <td style="line-height: 18px" width="80">数量</td>
47
+                  <td style="line-height: 18px" width="80">采购单价</td>
48
+                  <td style="line-height: 18px" width="60">采购金额</td>
49
+                </tr>
50
+              </thead>
51
+              <tbody>
52
+                <tr v-for="(item, index) in tableList" :key="index">
53
+                  <td style="line-height: 18px">
54
+                    <span>{{ index + 1 }}</span>
55
+                  </td>
56
+                  <td style="line-height: 18px">
57
+                    <span>{{ item.name }}</span>
58
+                  </td>
59
+                  <td style="line-height: 18px">
60
+                   <span>{{ item.supply_unit }}</span>
61
+                  </td>
62
+                  <td style="line-height: 18px">
63
+                    <span>{{ item.count }}</span>
64
+                  </td>
65
+                  <td style="line-height: 18px">
66
+                    <span>{{ item.price }}</span>
67
+                  </td>
68
+                  <td style="line-height: 18px">
69
+                    <span>{{(item.count * item.price).toFixed(2)}}</span>
70
+                  </td>
71
+                </tr>
72
+                <tr>
73
+                  <td colspan="3" style="line-height: 18px">合计</td>
74
+                  <td colspan="1" style="line-height: 18px">{{getAllCount()}}</td>
75
+                  <td colspan="5" style="line-height: 18px"></td>
76
+                </tr>
77
+                 <tr>
78
+                  <td colspan="9" style="line-height: 18px">合计  金额大写 {{getAllPrice()}}</td>
79
+                </tr>
80
+              </tbody>
81
+            </table>
82
+          </div>
83
+          <div
84
+            style="
85
+              width: 100%;
86
+              display: flex;
87
+              flex: 1;
88
+              justify-content: flex-start;
89
+              flex-wrap: wrap;
90
+            "
91
+          >
92
+            <div
93
+              style="
94
+                width: 25%;
95
+                text-align: left;
96
+                margin-bottom: 1px;
97
+                font-size: 18px;
98
+              "
99
+            >
100
+              优惠率:<span v-if="rate_of_concession>0">{{rate_of_concession}}%</span>
101
+            </div>
102
+            <div
103
+              style="
104
+                width: 25%;
105
+                text-align: left;
106
+                margin-bottom: 1px;
107
+                font-size: 18px;
108
+              "
109
+            >
110
+              优惠金额:<span v-if="discount_amount>0">{{discount_amount}}</span>
111
+            </div>
112
+            <div
113
+              style="
114
+                width: 25%;
115
+                text-align: left;
116
+                margin-bottom: 1px;
117
+                font-size: 18px;
118
+              "
119
+            >
120
+              本次付款:<span v-if="payment>0">{{payment}}</span>
121
+            </div>
122
+            <div
123
+              style="
124
+                width: 25%;
125
+                text-align: left;
126
+                margin-bottom: 1px;
127
+                font-size: 18px;
128
+              "
129
+            >
130
+              本次欠款:<span v-if="arrearage>0">{{arrearage}}</span>
131
+            </div>
132
+            <div
133
+              style="
134
+                width: 100%;
135
+                text-align: left;
136
+                margin-bottom: 1px;
137
+                font-size: 18px;
138
+              "
139
+            >
140
+              备注:{{return_remark}}
141
+            </div>
142
+            <div
143
+              style="
144
+                width: 25%;
145
+                text-align: left;
146
+                margin-bottom: 1px;
147
+                font-size: 18px;
148
+              "
149
+            >
150
+              制单人:{{getXuserName(creater)}}
151
+            </div>
152
+            <div
153
+              style="
154
+                width: 25%;
155
+                text-align: left;
156
+                margin-bottom: 1px;
157
+                font-size: 18px;
158
+              "
159
+            >
160
+              收货人签字:
161
+            </div>
162
+            <div
163
+              style="
164
+                width: 25%;
165
+                text-align: left;
166
+                margin-bottom: 1px;
167
+                font-size: 18px;
168
+              "
169
+            >
170
+              供应商签字:
171
+            </div>
172
+          </div>
173
+     
174
+        </div>
175
+      </div>
176
+    </div>
177
+  </div>
178
+</template>
179
+
180
+<script>
181
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
182
+
183
+import { fetchAllAdminUsers } from "@/api/doctor";
184
+import { getGoodOrderDetail } from "@/api/supply";
185
+import print from "print-js";
186
+import { getLodop } from "@/assets/LodopFuncs";
187
+const moment = require("moment");
188
+import { uParseTime } from "@/utils/tools";
189
+export default {
190
+  components: {
191
+    BreadCrumb,
192
+  },
193
+  data() {
194
+    return {
195
+      size: "medium ",
196
+      crumbs: [
197
+        { path: false, name: "库存管理" },
198
+        { path: false, name: "耗材管理" },
199
+        { path: false, name: "入库单打印" },
200
+      ],
201
+      isEdit: 0,
202
+      checked: false,
203
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
204
+      time_now: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
205
+      orgName: "",
206
+      orgId: "",
207
+      adminUserOptions: [],
208
+      tableList: [],
209
+      good_number: "",
210
+      id: "",
211
+      supplier_id: "",
212
+      rate_of_concession: "",
213
+      discount_amount: "",
214
+      supplyList: [],
215
+      document_date: "",
216
+      warehouse_out_id:"",
217
+      return_remark: "",
218
+      warehousing_id: 0,
219
+      number: "",
220
+      drugList: [],
221
+      goodList: [],
222
+      arrearage:"",
223
+      payment:"",
224
+      creater:"",
225
+
226
+    };
227
+  },
228
+  methods: {
229
+    printAction: function () {
230
+      const style =
231
+        "@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 14px; padding: 1px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 12px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }";
232
+      printJS({
233
+        printable: "print_content",
234
+        type: "html",
235
+        documentTitle: "  ",
236
+        style: style,
237
+        scanStyles: false,
238
+      });
239
+    },
240
+    // 打印功能
241
+    btnClickPrint: function () {
242
+      let LODOP = getLodop(); //调用getLodop获取LODOP对象
243
+      LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_整页缩放打印输出");
244
+
245
+      LODOP.ADD_PRINT_BARCODE(15, 15, 300, 300, "QRCode", "xxxxxxxxxxxxx");
246
+      LODOP.SET_PRINT_STYLEA(0, "Stretch", 1); //(可变形)扩展缩放模式
247
+      LODOP.PREVIEW(); //预览(预览打印无脚标)
248
+      // LODOP.PRINT();  //打印
249
+      LODOP.RINT_DESIGN();
250
+    },
251
+
252
+    getTime(val) {
253
+      if (val < 0) {
254
+        return "";
255
+      }
256
+      if (val == "") {
257
+        return "";
258
+      } else {
259
+        return uParseTime(val, "{y}-{m}-{d}");
260
+      }
261
+    },
262
+    fetchAllAdminUsers() {
263
+      fetchAllAdminUsers().then((response) => {
264
+        if (response.data.state == 1) {
265
+          this.adminUserOptions = response.data.data.users;
266
+        }
267
+      });
268
+    },
269
+    getXuserName(id) {
270
+      if (id <= 0) {
271
+        return "";
272
+      }
273
+      var name = "";
274
+      if (
275
+        this.adminUserOptions == null ||
276
+        typeof this.adminUserOptions.length === "undefined"
277
+      ) {
278
+        return name;
279
+      }
280
+      var leng = this.adminUserOptions.length;
281
+      if (leng == 0) {
282
+        return name;
283
+      }
284
+      for (let index = 0; index < leng; index++) {
285
+        if (this.adminUserOptions[index].id == id) {
286
+          name = this.adminUserOptions[index].name;
287
+          break;
288
+        }
289
+      }
290
+      return name;
291
+    },
292
+ 
293
+    getSupplyName(id) {
294
+      var name = "";
295
+      for (let i = 0; i < this.supplyList.length; i++) {
296
+        if (id == this.supplyList[i].id) {
297
+          name = this.supplyList[i].supplier_name;
298
+        }
299
+      }
300
+      return name;
301
+    },
302
+    getGoodOrderDetail() {
303
+      var id = this.$route.query.id;
304
+      getGoodOrderDetail(id).then((response) => {
305
+        if (response.data.state == 1) {
306
+          var out = response.data.data.out;
307
+          this.supplyList = response.data.data.supplyList,
308
+          this.is_check = out.is_check;
309
+          this.id = out.id;
310
+          this.supplier_id = out.supplier_id;
311
+          this.rate_of_concession = out.rate_of_concession;
312
+          this.discount_amount = out.discount_amount;
313
+          this.payment = out.payment;
314
+          this.arrearage = out.arrearage;
315
+          this.good_number = out.good_number;
316
+          this.return_remark = out.return_remake;
317
+          this.document_date = out.document_date;
318
+          this.creater = out.creater
319
+          var orderInfo = response.data.data.list;
320
+          for (let i = 0; i < orderInfo.length; i++) {
321
+            orderInfo[i].id = orderInfo[i].id
322
+            orderInfo[i].supply_count = orderInfo[i].count;
323
+            orderInfo[i].supply_price = orderInfo[i].price;
324
+            orderInfo[i].supply_remake = orderInfo[i].remark;
325
+            orderInfo[i].type = orderInfo[i].is_source;
326
+            orderInfo[i].project_id = orderInfo[i].project_id;
327
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit;
328
+            orderInfo[i].order_number = orderInfo[i].order_number;
329
+            orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2);
330
+            this.tableList = orderInfo;
331
+         }
332
+        }
333
+      });
334
+    },
335
+    getTimes(time) {
336
+      if (time === "") {
337
+        return "";
338
+      }
339
+      return uParseTime(time, "{y}-{m}-{d}");
340
+    },
341
+    getAllCount(){
342
+      var total = 0
343
+      for(let i=0;i<this.tableList.length;i++){
344
+         total +=this.tableList[i].count
345
+      }  
346
+      if(total > 0){
347
+       return total
348
+      }else{
349
+        return ""
350
+      } 
351
+    },
352
+    getAllPrice() {
353
+      var total_price = 0;
354
+      for (let i = 0; i < this.tableList.length; i++) {
355
+        total_price +=(this.tableList[i].price *this.tableList[i].count)
356
+      }
357
+      this.total_price = total_price;
358
+      if(total_price > 0){
359
+         return this.smallToBIG(total_price.toFixed(2));
360
+      }else{
361
+        return ""
362
+      }
363
+     
364
+    },
365
+     smallToBIG(price) {
366
+        let fraction = ['角', '分'];
367
+        let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
368
+        let unit = [['元.', '万,', '亿,'], ['', '拾', '佰', '仟']];
369
+        let head = price < 0 ? '欠' : '';
370
+        price = Math.abs(price);
371
+        console.log("price",price)
372
+        let upper = '';
373
+        for (let i = 0; i < fraction.length; i++) {
374
+          upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
375
+        }
376
+        upper = upper || '整';
377
+        console.log("price",upper)
378
+        price = Math.floor(price);
379
+        for (let i = 0; i < unit[0].length && price > 0; i++) {
380
+          let p = '';
381
+          for (let j = 0; j < unit[1].length && price > 0; j++) {
382
+            p = digit[price % 10] + unit[1][j] + p;
383
+            price = Math.floor(price / 10);
384
+          }
385
+          upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
386
+        }
387
+        console.log("head",head)
388
+        var zhongwen = head + upper.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
389
+        console.log("23322323",zhongwen)
390
+        var ztr = zhongwen.replaceAll(".","");
391
+        console.log("ztr",ztr)
392
+        return ztr
393
+      },
394
+  },
395
+  created() {
396
+    this.orgName = this.$store.getters.xt_user.org.org_name;
397
+    this.orgId = this.$store.getters.xt_user.org.id;
398
+    this.fetchAllAdminUsers();
399
+    //获取购货单列表
400
+    this.getGoodOrderDetail();
401
+  },
402
+};
403
+</script>
404
+
405
+
406
+<style rel="stylesheet/scss" lang="scss" scoped>
407
+.print_main_content {
408
+  background-color: white;
409
+  max-width: 1500px;
410
+  margin: 0 auto;
411
+  padding: 0 0 20px 0;
412
+
413
+  .order_title_panl {
414
+    text-align: center;
415
+
416
+    .main_title {
417
+      font-size: 18px;
418
+      line-height: 40px;
419
+      font-weight: 500;
420
+    }
421
+  }
422
+  .table_panel {
423
+    .table {
424
+      width: 100%;
425
+      border: 1px solid;
426
+      border-collapse: collapse;
427
+      padding: 2px;
428
+
429
+      thead {
430
+        tr {
431
+          td {
432
+            border: 1px solid;
433
+            text-align: center;
434
+            font-size: 18px;
435
+            padding: 1px 5px;
436
+          }
437
+        }
438
+      }
439
+      tbody {
440
+        tr {
441
+          td {
442
+            border: 1px solid;
443
+            text-align: center;
444
+            font-size: 18px;
445
+            padding: 10px 5px;
446
+            white-space: pre-line;
447
+            .proj {
448
+              padding: 5px 0;
449
+              text-align: left;
450
+
451
+              .proj_title {
452
+                font-size: 16px;
453
+                font-weight: 500;
454
+                line-height: 25px;
455
+              }
456
+
457
+              .proj_item {
458
+                font-size: 15px;
459
+                line-height: 20px;
460
+
461
+                .zone_name {
462
+                  font-weight: 500;
463
+                }
464
+              }
465
+            }
466
+          }
467
+        }
468
+      }
469
+    }
470
+  }
471
+}
472
+
473
+.description {
474
+  width: 100%;
475
+  display: flex;
476
+  flex: 1;
477
+  justify-content: flex-start;
478
+  flex-wrap: wrap;
479
+  .content {
480
+    width: 25%;
481
+    text-align: left;
482
+    margin-bottom: 1px;
483
+    font-size: 18px;
484
+  }
485
+  .content_1 {
486
+    width: 100%;
487
+    text-align: left;
488
+    margin-bottom: 1px;
489
+    font-size: 18px;
490
+  }
491
+  // .content_2{
492
+  //   width: 33%;
493
+  // }
494
+}
495
+</style>

+ 511 - 0
src/xt_pages/supply/components/goodReturnPrint.vue Vedi File

@@ -0,0 +1,511 @@
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
8
+            size="small"
9
+            icon="el-icon-printer"
10
+            type="primary"
11
+            @click="printAction"
12
+            >打印</el-button
13
+          >
14
+        </el-col>
15
+      </el-row>
16
+    </div>
17
+    <div class="app-container" style="background-color: white">
18
+      <div id="print_content">
19
+        <div class="print_main_content">
20
+          <div class="order_title_panl">
21
+            <div style="font-size: 22px; font-weight: bold">{{ orgName }}</div>
22
+            <span style="font-weight: 500; font-size: 18px">采购退货单</span>
23
+          </div>
24
+          <div style="display: flex; justify-content: space-between">
25
+            <div style="text-align: left; margin-bottom: 1px; font-size: 18px">
26
+              供应商:
27
+                {{ getSupplyName(supplier_id) }}
28
+            </div>
29
+            <div style="margin-bottom: 1px; font-size: 18px">
30
+              单据日期:
31
+             单据日期:{{ getTimes(document_date) }}
32
+            </div>
33
+            <div style="margin-bottom: 1px; font-size: 18px">
34
+              单据编号:
35
+              {{ number }}
36
+            </div>
37
+            <div style="margin-bottom: 1px; font-size: 18px">币别:RMB</div>
38
+          </div>
39
+
40
+          <div class="table_panel">
41
+            <table class="table">
42
+              <thead>
43
+                <tr>
44
+                  <td style="line-height: 18px" width="80">序号</td>
45
+                  <td style="line-height: 18px" width="80">商品</td>
46
+                  <td style="line-height: 18px" width="80">单位</td>
47
+                  <td style="line-height: 18px" width="80">数量</td>
48
+                  <td style="line-height: 18px" width="80">采购单价</td>
49
+                  <td style="line-height: 18px" width="80">折扣率</td>
50
+                  <td style="line-height: 18px" width="80">折扣额</td>
51
+                  <td style="line-height: 18px" width="60">采购金额</td>
52
+                 
53
+                </tr>
54
+              </thead>
55
+              <tbody>
56
+                <tr v-for="(item, index) in tableList" :key="index">
57
+                  <td style="line-height: 18px">
58
+                    <span>{{ index + 1 }}</span>
59
+                  </td>
60
+                  <td style="line-height: 18px">
61
+                    <span>{{ item.name }}</span>
62
+                  </td>
63
+                  <td style="line-height: 18px">
64
+                   <span>{{ item.supply_unit }}</span>
65
+                  </td>
66
+                  <td style="line-height: 18px">
67
+                    <span>{{ item.supply_count }}</span>
68
+                  </td>
69
+                  <td style="line-height: 18px">
70
+                    <span>{{ item.price }}</span>
71
+                  </td>
72
+                  <td style="line-height: 18px">
73
+                    <span v-if="item.deposit_rate >0">{{item.deposit_rate}}</span>
74
+                  </td>
75
+                  <td style="line-height: 18px">
76
+                    <span v-if="(item.supply_count * item.price *item.deposit_rate/100) >0">{{(item.supply_count * item.price *item.deposit_rate/100).toFixed(2)}}</span>
77
+                  </td>
78
+                  <td style="line-height: 18px">
79
+                    <span v-if="discount_amount > 0">{{ discount_amount }}</span>
80
+                  </td>
81
+                
82
+                </tr>
83
+                <tr>
84
+                  <td colspan="3" style="line-height: 18px">合计</td>
85
+                  <td colspan="1" style="line-height: 18px">{{getAllCount()}}</td>
86
+                  <td colspan="5" style="line-height: 18px"></td>
87
+                </tr>
88
+                 <tr>
89
+                  <td colspan="9" style="line-height: 18px">合计  金额大写 {{getAllPrice()}}</td>
90
+                </tr>
91
+              </tbody>
92
+            </table>
93
+          </div>
94
+          <div
95
+            style="
96
+              width: 100%;
97
+              display: flex;
98
+              flex: 1;
99
+              justify-content: flex-start;
100
+              flex-wrap: wrap;
101
+            "
102
+          >
103
+            <div
104
+              style="
105
+                width: 25%;
106
+                text-align: left;
107
+                margin-bottom: 1px;
108
+                font-size: 18px;
109
+              "
110
+            >
111
+              供应商: {{ getSupplyName(supplier_id) }}
112
+            </div>
113
+            <div
114
+              style="
115
+                width: 25%;
116
+                text-align: left;
117
+                margin-bottom: 1px;
118
+                font-size: 18px;
119
+              "
120
+            >
121
+              优惠金额:<span v-if="discount_amount>0">{{discount_amount}}</span>
122
+            </div>
123
+            <div
124
+              style="
125
+                width: 25%;
126
+                text-align: left;
127
+                margin-bottom: 1px;
128
+                font-size: 18px;
129
+              "
130
+            >
131
+              本次退款:<span v-if="payment>0" >{{payment}}</span>
132
+            </div>
133
+            <div
134
+              style="
135
+                width: 25%;
136
+                text-align: left;
137
+                margin-bottom: 1px;
138
+                font-size: 18px;
139
+              "
140
+            >
141
+              本次欠款:<span v-if="arrearage >0">{{arrearage}}</span>
142
+            </div>
143
+            <div
144
+              style="
145
+                width: 100%;
146
+                text-align: left;
147
+                margin-bottom: 1px;
148
+                font-size: 18px;
149
+              "
150
+            >
151
+              备注:{{return_remark}}
152
+            </div>
153
+            <div
154
+              style="
155
+                width: 25%;
156
+                text-align: left;
157
+                margin-bottom: 1px;
158
+                font-size: 18px;
159
+              "
160
+            >
161
+              制单人:{{getXuserName(creater)}}
162
+            </div>
163
+            <div
164
+              style="
165
+                width: 25%;
166
+                text-align: left;
167
+                margin-bottom: 1px;
168
+                font-size: 18px;
169
+              "
170
+            >
171
+              收货人签字:
172
+            </div>
173
+            <div
174
+              style="
175
+                width: 25%;
176
+                text-align: left;
177
+                margin-bottom: 1px;
178
+                font-size: 18px;
179
+              "
180
+            >
181
+              供应商签字:
182
+            </div>
183
+          </div>
184
+     
185
+        </div>
186
+      </div>
187
+    </div>
188
+  </div>
189
+</template>
190
+
191
+<script>
192
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
193
+
194
+import { fetchAllAdminUsers } from "@/api/doctor";
195
+import { getGoodReturnDetail } from "@/api/supply";
196
+import print from "print-js";
197
+import { getLodop } from "@/assets/LodopFuncs";
198
+const moment = require("moment");
199
+import { uParseTime } from "@/utils/tools";
200
+export default {
201
+  components: {
202
+    BreadCrumb,
203
+  },
204
+  data() {
205
+    return {
206
+      size: "medium ",
207
+      crumbs: [
208
+        { path: false, name: "库存管理" },
209
+        { path: false, name: "耗材管理" },
210
+        { path: false, name: "入库单打印" },
211
+      ],
212
+      isEdit: 0,
213
+      checked: false,
214
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
215
+      time_now: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
216
+      orgName: "",
217
+      orgId: "",
218
+      adminUserOptions: [],
219
+      tableList: [],
220
+      number: "",
221
+      id: "",
222
+      supplier_id: "",
223
+      rate_of_concession: "",
224
+      discount_amount: "",
225
+      supplyList: [],
226
+      document_date: "",
227
+      warehouse_out_id:"",
228
+      return_remark: "",
229
+      warehousing_id: 0,
230
+      number: "",
231
+      drugList: [],
232
+      goodList: [],
233
+      arrearage:"",
234
+      payment:"",
235
+      creater:"",
236
+    };
237
+  },
238
+  methods: {
239
+    printAction: function () {
240
+      const style =
241
+        "@media print { .print_main_content { background-color: white; width:960px;  margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 14px; padding: 1px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 12px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }";
242
+      printJS({
243
+        printable: "print_content",
244
+        type: "html",
245
+        documentTitle: "  ",
246
+        style: style,
247
+        scanStyles: false,
248
+      });
249
+    },
250
+    // 打印功能
251
+    btnClickPrint: function () {
252
+      let LODOP = getLodop(); //调用getLodop获取LODOP对象
253
+      LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_整页缩放打印输出");
254
+
255
+      LODOP.ADD_PRINT_BARCODE(15, 15, 300, 300, "QRCode", "xxxxxxxxxxxxx");
256
+      LODOP.SET_PRINT_STYLEA(0, "Stretch", 1); //(可变形)扩展缩放模式
257
+      LODOP.PREVIEW(); //预览(预览打印无脚标)
258
+      // LODOP.PRINT();  //打印
259
+      LODOP.RINT_DESIGN();
260
+    },
261
+
262
+    getTime(val) {
263
+      if (val < 0) {
264
+        return "";
265
+      }
266
+      if (val == "") {
267
+        return "";
268
+      } else {
269
+        return uParseTime(val, "{y}-{m}-{d}");
270
+      }
271
+    },
272
+    fetchAllAdminUsers() {
273
+      fetchAllAdminUsers().then((response) => {
274
+        if (response.data.state == 1) {
275
+          this.adminUserOptions = response.data.data.users;
276
+        }
277
+      });
278
+    },
279
+    getXuserName(id) {
280
+      if (id <= 0) {
281
+        return "";
282
+      }
283
+      var name = "";
284
+      if (
285
+        this.adminUserOptions == null ||
286
+        typeof this.adminUserOptions.length === "undefined"
287
+      ) {
288
+        return name;
289
+      }
290
+      var leng = this.adminUserOptions.length;
291
+      if (leng == 0) {
292
+        return name;
293
+      }
294
+      for (let index = 0; index < leng; index++) {
295
+        if (this.adminUserOptions[index].id == id) {
296
+          name = this.adminUserOptions[index].name;
297
+          break;
298
+        }
299
+      }
300
+      return name;
301
+    },
302
+ 
303
+    getSupplyName(id) {
304
+      var name = "";
305
+      for (let i = 0; i < this.supplyList.length; i++) {
306
+        if (id == this.supplyList[i].id) {
307
+          name = this.supplyList[i].supplier_name;
308
+        }
309
+      }
310
+      return name;
311
+    },
312
+    getGoodReturnDetail() {
313
+      var id = this.$route.query.id;
314
+      getGoodReturnDetail(id).then((response) => {
315
+        if (response.data.state == 1) {
316
+          var out = response.data.data.cancelDetail;
317
+          this.supplyList = response.data.data.supplyList
318
+          this.warehouse_out_id = out.warehouse_out_id;
319
+          this.number = out.number;
320
+          this.is_check = out.is_check;
321
+          this.id = out.id;
322
+          this.supplier_id = out.supplier_id;
323
+          this.rate_of_concession = out.rate_of_concession;
324
+          this.discount_amount = out.discount_amount;
325
+          this.payment = out.payment;
326
+          this.arrearage = out.arrearage;
327
+          this.creater= out.creater,
328
+          this.return_remark = out.return_remark
329
+          this.document_date = out.document_date;
330
+          var orderInfo = response.data.data.orderCancelDetail;
331
+          for (let i = 0; i < orderInfo.length; i++) {
332
+            orderInfo[i].id = orderInfo[i].id;
333
+            orderInfo[i].supply_count = orderInfo[i].supply_count;
334
+            orderInfo[i].supply_price = orderInfo[i].price;
335
+            orderInfo[i].supply_remake = orderInfo[i].remark;
336
+            orderInfo[i].type = orderInfo[i].is_source;
337
+            orderInfo[i].project_id = orderInfo[i].project_id;
338
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit;
339
+            orderInfo[i].order_number = orderInfo[i].order_number;
340
+            orderInfo[i].good_number = orderInfo[i].good_number;
341
+            orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2);
342
+            orderInfo[i].supply_expiry_date = orderInfo[i].supply_expiry_date;
343
+            orderInfo[i].supply_product_date = orderInfo[i].supply_product_date;
344
+          }
345
+
346
+          this.tableList = [];
347
+          this.tableList = orderInfo;
348
+        }
349
+      });
350
+    },
351
+    getTimes(time) {
352
+      if (time === "") {
353
+        return "";
354
+      }
355
+      return uParseTime(time, "{y}-{m}-{d}");
356
+    },
357
+    getAllCount(){
358
+      var total = 0
359
+      for(let i=0;i<this.tableList.length;i++){
360
+         total +=this.tableList[i].supply_count
361
+      }  
362
+      if(total > 0){
363
+       return total
364
+      }else{
365
+        return ""
366
+      } 
367
+    },
368
+    getAllPrice() {
369
+      var total_price = 0;
370
+      for (let i = 0; i < this.tableList.length; i++) {
371
+        total_price +=(this.tableList[i].supply_price *this.tableList[i].supply_count - (this.tableList[i].supply_price * this.tableList[i].supply_count*this.tableList[i].deposit_rate/100))
372
+      }
373
+      this.total_price = total_price;
374
+      if(total_price > 0){
375
+         return this.smallToBIG(total_price.toFixed(2));
376
+      }else{
377
+        return ""
378
+      }
379
+     
380
+    },
381
+     smallToBIG(price) {
382
+        let fraction = ['角', '分'];
383
+        let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
384
+        let unit = [['元.', '万,', '亿,'], ['', '拾', '佰', '仟']];
385
+        let head = price < 0 ? '欠' : '';
386
+        price = Math.abs(price);
387
+        console.log("price",price)
388
+        let upper = '';
389
+        for (let i = 0; i < fraction.length; i++) {
390
+          upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
391
+        }
392
+        upper = upper || '整';
393
+        console.log("price",upper)
394
+        price = Math.floor(price);
395
+        for (let i = 0; i < unit[0].length && price > 0; i++) {
396
+          let p = '';
397
+          for (let j = 0; j < unit[1].length && price > 0; j++) {
398
+            p = digit[price % 10] + unit[1][j] + p;
399
+            price = Math.floor(price / 10);
400
+          }
401
+          upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
402
+        }
403
+        console.log("head",head)
404
+        var zhongwen = head + upper.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
405
+        console.log("23322323",zhongwen)
406
+        var ztr = zhongwen.replaceAll(".","");
407
+        console.log("ztr",ztr)
408
+        return ztr
409
+      },
410
+  },
411
+  created() {
412
+    this.orgName = this.$store.getters.xt_user.org.org_name;
413
+    this.orgId = this.$store.getters.xt_user.org.id;
414
+    this.fetchAllAdminUsers();
415
+    //获取购货单列表
416
+    this.getGoodReturnDetail();
417
+  },
418
+};
419
+</script>
420
+
421
+
422
+<style rel="stylesheet/scss" lang="scss" scoped>
423
+.print_main_content {
424
+  background-color: white;
425
+  max-width: 1500px;
426
+  margin: 0 auto;
427
+  padding: 0 0 20px 0;
428
+
429
+  .order_title_panl {
430
+    text-align: center;
431
+
432
+    .main_title {
433
+      font-size: 18px;
434
+      line-height: 40px;
435
+      font-weight: 500;
436
+    }
437
+  }
438
+  .table_panel {
439
+    .table {
440
+      width: 100%;
441
+      border: 1px solid;
442
+      border-collapse: collapse;
443
+      padding: 2px;
444
+
445
+      thead {
446
+        tr {
447
+          td {
448
+            border: 1px solid;
449
+            text-align: center;
450
+            font-size: 18px;
451
+            padding: 1px 5px;
452
+          }
453
+        }
454
+      }
455
+      tbody {
456
+        tr {
457
+          td {
458
+            border: 1px solid;
459
+            text-align: center;
460
+            font-size: 18px;
461
+            padding: 10px 5px;
462
+            white-space: pre-line;
463
+            .proj {
464
+              padding: 5px 0;
465
+              text-align: left;
466
+
467
+              .proj_title {
468
+                font-size: 16px;
469
+                font-weight: 500;
470
+                line-height: 25px;
471
+              }
472
+
473
+              .proj_item {
474
+                font-size: 15px;
475
+                line-height: 20px;
476
+
477
+                .zone_name {
478
+                  font-weight: 500;
479
+                }
480
+              }
481
+            }
482
+          }
483
+        }
484
+      }
485
+    }
486
+  }
487
+}
488
+
489
+.description {
490
+  width: 100%;
491
+  display: flex;
492
+  flex: 1;
493
+  justify-content: flex-start;
494
+  flex-wrap: wrap;
495
+  .content {
496
+    width: 25%;
497
+    text-align: left;
498
+    margin-bottom: 1px;
499
+    font-size: 18px;
500
+  }
501
+  .content_1 {
502
+    width: 100%;
503
+    text-align: left;
504
+    margin-bottom: 1px;
505
+    font-size: 18px;
506
+  }
507
+  // .content_2{
508
+  //   width: 33%;
509
+  // }
510
+}
511
+</style>