Bladeren bron

供应商模块与退货单模块

huangyw 3 jaren geleden
bovenliggende
commit
21ece9b165

+ 2 - 2
config/index.js Bestand weergeven

@@ -29,8 +29,8 @@ module.exports = {
29 29
 
30 30
     // host: 'xt.test.sgjyun.com',
31 31
     //  host: 'xt.kuyicloud.com',
32
-   host: 'xt.test.sgjyun.com',
33
-    //host: 'localhost',
32
+  //  host: 'xt.test.sgjyun.com',
33
+    host: 'localhost',
34 34
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
35 35
     autoOpenBrowser: true,
36 36
     errorOverlay: true,

+ 1 - 0
package.json Bestand weergeven

@@ -56,6 +56,7 @@
56 56
     "jszip": "3.1.5",
57 57
     "mockjs": "1.0.1-beta3",
58 58
     "moment": "^2.24.0",
59
+    "node-sass": "^7.0.1",
59 60
     "normalize.css": "7.0.0",
60 61
     "nprogress": "0.2.0",
61 62
     "print-js": "^1.0.50",

+ 1 - 0
src/lang/zh.js Bestand weergeven

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

+ 13 - 0
src/router/modules/supply.js Bestand weergeven

@@ -81,6 +81,19 @@ export default {
81 81
       component: () => import('@/xt_pages/supply/components/editGoodOrder'),
82 82
       name: 'editGoodOrder',
83 83
       meta: { title: 'editGoodOrder', noCache: true },
84
+    },
85
+    // 退货单模块
86
+    {
87
+      path: '/good/return/query',
88
+      component: () => import('@/xt_pages/supply/goodreturn'),
89
+      name: 'goodReturnQuery',
90
+      meta: { title: 'goodReturnQuery', noCache: true },
91
+    },
92
+    {
93
+      path: '/good/return/add',
94
+      component: () => import('@/xt_pages/supply/components/addGoodReturn'),
95
+      name: 'addGoodReturn',
96
+      meta: { title: 'addGoodReturn', noCache: true },
84 97
       hidden: true,
85 98
       is_menu: false,
86 99
       isChild: true

+ 2 - 2
src/views/layout/Layout.vue Bestand weergeven

@@ -16,10 +16,10 @@
16 16
           <i class="iconfont icon-computer_fill navIcon"></i>
17 17
           <p>透析管理</p>
18 18
         </div>
19
-        <!-- <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
19
+        <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
20 20
           <i class="iconfont icon-kccx navIcon"></i>
21 21
           <p>采购管理</p>
22
-        </div> -->
22
+        </div>
23 23
         <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
24 24
           <i class="iconfont icon-kccx navIcon"></i>
25 25
           <p>库房管理</p>

+ 896 - 0
src/xt_pages/supply/components/addGoodReturn.vue Bestand weergeven

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

+ 382 - 18
src/xt_pages/supply/components/addSupply.vue Bestand weergeven

@@ -1,32 +1,396 @@
1 1
 <template>
2
-    <el-dialog
3
-    title="提示"
4
-    :visible.sync="dialogVisible"
5
-    width="30%"
6
-    :before-close="handleClose">
7
-    <span>这是一段信息</span>
2
+  <el-dialog title="新增供应商" :visible.sync="dialogVisible" width="35%">
3
+    <!-- :before-close="handleClose" 如需要可添加进上方 -->
4
+    <div>
5
+      <el-form
6
+        :inline="true"
7
+        :model="supplier"
8
+        class="demo-form-inline"
9
+        label-width="100px"
10
+        :rules="rules"
11
+        ref="supplier"
12
+      >
13
+        <el-row>
14
+          <el-col span="6">
15
+            <el-form-item label="供应商编码" prop="id">
16
+              <el-input v-model="supplier.id"></el-input>
17
+            </el-form-item>
18
+          </el-col>
19
+          <el-col span="6">
20
+            <el-form-item label="供应商名称" prop="name">
21
+              <el-input v-model="supplier.name"></el-input>
22
+            </el-form-item>
23
+          </el-col>
24
+        </el-row>
25
+        <el-row>
26
+          <el-col span="6">
27
+            <el-form-item label="供应商类别">
28
+              <el-input v-model="supplier.type"></el-input>
29
+            </el-form-item>
30
+          </el-col>
31
+          <el-col span="6">
32
+            <el-form-item label="增值税税率">
33
+              <el-input v-model="supplier.rate"></el-input>
34
+            </el-form-item>
35
+          </el-col>
36
+        </el-row>
37
+        <el-row>
38
+          <el-col span="6">
39
+            <el-form-item label="纳税人识别号">
40
+              <el-input v-model="supplier.taxerId"></el-input>
41
+            </el-form-item>
42
+          </el-col>
43
+          <el-col span="6">
44
+            <el-form-item label="开户银行">
45
+              <el-input v-model="supplier.bankname"></el-input>
46
+            </el-form-item>
47
+          </el-col>
48
+        </el-row>
49
+        <el-row>
50
+          <el-col span="6">
51
+            <el-form-item label="银行账号">
52
+              <el-input v-model="supplier.bankId"></el-input>
53
+            </el-form-item>
54
+          </el-col>
55
+        </el-row>
56
+      </el-form>
57
+
58
+      <el-form
59
+        :rules="tableRules"
60
+        :model="recordInfo"
61
+        ref="tableForm"
62
+        class="tableclass"
63
+      >
64
+        <el-table
65
+          :row-style="{ color: '#303133' }"
66
+          :header-cell-style="{
67
+            backgroundColor: 'rgb(245, 247, 250)',
68
+            color: '#606266',
69
+          }"
70
+          :data="recordInfo.tableList"
71
+          :class="signAndWeighBoxPatients"
72
+          border
73
+          style="width: 100%"
74
+          max-height="450"
75
+        >
76
+          <!-- 联系人填写 -->
77
+          <el-table-column label="联系人" align="center" width="110px">
78
+            <template slot="header" slot-scope="scope">
79
+              <span>联系人<span style="color: red">*</span></span>
80
+            </template>
81
+            <template slot-scope="scope">
82
+              <el-form-item
83
+                :prop="'tableList.' + scope.$index + '.supply_count'"
84
+                :rules="tableRules.contacts"
85
+              >
86
+                <el-input
87
+                  v-model="scope.row.supply_count"
88
+                  style="width: 80px; margin-top: 3px"
89
+                ></el-input>
90
+              </el-form-item>
91
+            </template>
92
+          </el-table-column>
93
+          <!-- 手机填写 -->
94
+          <el-table-column label="手机" align="center" width="100px">
95
+            <template slot-scope="scope">
96
+              <el-input
97
+                v-model="scope.row.supply_price"
98
+                style="width: 80px"
99
+              ></el-input>
100
+              <div style="visibility: hidden">/</div>
101
+            </template>
102
+          </el-table-column>
103
+          <!-- 联系地址填写 -->
104
+          <el-table-column label="联系地址" align="center" width="130px">
105
+            <template slot-scope="scope">
106
+              <el-input
107
+                v-model="scope.row.supply_license_number"
108
+                style="width: 115px"
109
+              ></el-input>
110
+              <div style="visibility: hidden">/</div>
111
+            </template>
112
+          </el-table-column>
113
+          <!-- 首要联系人填写 -->
114
+          <el-table-column align="center" width="100px">
115
+            <template slot="header" slot-scope="scope">
116
+              <span>首要联系人<span style="color: red">*</span></span>
117
+            </template>
118
+            <template slot-scope="scope">
119
+              <el-form-item :prop="'tableList.' + scope.$index + '.name'">
120
+                <el-select
121
+                  v-model="scope.row.name"
122
+                  style="width: 90px"
123
+                  placeholder="请选择"
124
+                  @change="changeName"
125
+                >
126
+                  <el-option
127
+                    v-for="(item, index) in tabList"
128
+                    :key="index"
129
+                    :label="item.label"
130
+                    :value="item"
131
+                  >
132
+                  </el-option>
133
+                </el-select>
134
+              </el-form-item>
135
+            </template>
136
+          </el-table-column>
137
+
138
+          <el-table-column
139
+            label="操作"
140
+            align="center"
141
+            width="120px"
142
+            fixed="right"
143
+          >
144
+            <template slot-scope="scope">
145
+              <el-tooltip
146
+                class="item"
147
+                effect="dark"
148
+                content="新增"
149
+                placement="top"
150
+              >
151
+                <el-button
152
+                  class="tablebtn"
153
+                  size="mini"
154
+                  type="primary"
155
+                  icon="el-icon-circle-plus-outline"
156
+                  @click="handleAdd(scope.$index, scope.row)"
157
+                >
158
+                </el-button>
159
+              </el-tooltip>
160
+              <el-tooltip
161
+                class="item"
162
+                effect="dark"
163
+                content="删除"
164
+                placement="top"
165
+              >
166
+                <el-button
167
+                  class="tablebtn"
168
+                  size="mini"
169
+                  type="danger"
170
+                  icon="el-icon-delete"
171
+                  @click="handleDelete(scope.$index, scope.row)"
172
+                >
173
+                </el-button>
174
+              </el-tooltip>
175
+            </template>
176
+          </el-table-column>
177
+        </el-table>
178
+      </el-form>
179
+    </div>
180
+
8 181
     <span slot="footer" class="dialog-footer">
9
-        <el-button @click="dialogVisible = false">取 消</el-button>
10
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
182
+      <el-button @click="dialogVisible = false">取 消</el-button>
183
+      <el-button type="primary" @click="submitForm('supplier')"
184
+        >确 定</el-button
185
+      >
11 186
     </span>
12
-    </el-dialog>
187
+  </el-dialog>
13 188
 </template>
14 189
 
15 190
 <script>
191
+import Template from "../../data/template.vue";
16 192
 export default {
17
-    
18
-    data(){
19
-        return{
20
-           dialogVisible:false, 
193
+  data() {
194
+    return {
195
+      Template,
196
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
197
+      // 表单验证规则
198
+      rules: {
199
+        id: [
200
+          {
201
+            required: true,
202
+            message: "请填写供应商编号",
203
+            trigger: "blur",
204
+          },
205
+        ],
206
+        name: [
207
+          {
208
+            required: true,
209
+            message: "请填写供应商名称",
210
+            trigger: "blur",
211
+          },
212
+        ],
213
+      },
214
+      tabList: [
215
+        {
216
+          value: 0,
217
+          label: "是",
218
+        },
219
+        {
220
+          value: 1,
221
+          label: "否",
222
+        },
223
+      ],
224
+      tableRules: {
225
+        contacts: [
226
+          { required: true, message: "联系人不能为空", trigger: "blur" },
227
+        ],
228
+      },
229
+      recordInfo: {
230
+        tableList: [1],
231
+      },
232
+      tableData: [
233
+        {
234
+          contacts: "",
235
+          phone: "",
236
+          address: "",
237
+          FirstConcats: "",
238
+          operate: "",
239
+        },
240
+      ],
241
+      options: [
242
+        {
243
+          value: "1",
244
+          label: "是",
245
+        },
246
+        {
247
+          value: "2",
248
+          label: "否",
249
+        },
250
+      ],
251
+      value: "",
252
+      dialogVisible: false,
253
+      supplier: {
254
+        name: "",
255
+        id: "",
256
+        type: "",
257
+        rate: 10,
258
+        taxerId: "",
259
+        bankId: "",
260
+        bankname: "",
261
+      },
262
+    };
263
+  },
264
+  created() {
265
+    this.supplier.id = "gys001";
266
+  },
267
+  methods: {
268
+    show() {
269
+      this.dialogVisible = true;
270
+      this.orderIdAdd();
271
+      this.continueArr();
272
+    },
273
+    //  验证表单内容
274
+    submitForm(formName) {
275
+      this.$refs[formName].validate((valid) => {
276
+        if (valid) {
277
+          alert("submit!");
278
+          this.dialogVisible = false;
279
+        } else {
280
+          console.log("error submit!!");
281
+          return false;
21 282
         }
283
+      });
284
+
285
+      this.contactsinfo();
22 286
     },
23
-    methods:{
24
-      show(){
25
-        this.dialogVisible = true  
287
+
288
+    // 首要联系人选择变更动态展示
289
+    changeName() {},
290
+
291
+    // 供应商编码动态递增
292
+    orderIdAdd() {
293
+      // 模拟情景
294
+      let data = ["gsy001", "gsy002", "gsy004"];
295
+      let data1 = [];
296
+      let num = 0;
297
+
298
+      data.forEach((o) => {
299
+        o = o.split("gsy");
300
+        data1.push(o[1]);
301
+      });
302
+
303
+      console.log(data1, "现有数据");
304
+
305
+      this.continueArr();
306
+    },
307
+
308
+    //递增数判断
309
+    continueArr() {
310
+      var num = 0;
311
+      let arr = ["001", "002", "004", "005", "006"];
312
+
313
+      let len = 3; //显示的长度
314
+      num = parseInt(num, 10) + 1;
315
+      num = num.toString();
316
+      for (let i = 0; i < arr.length; i++) {
317
+        while (num.length < len) {
318
+          num = "0" + num;
319
+        }
320
+        
26 321
       }
322
+      console.log(num,'d')
323
+    },
324
+
325
+    // 添加表单行
326
+    handleAdd() {
327
+      let data = {};
328
+      this.recordInfo.tableList.push(data);
27 329
     },
28
-    created(){
330
+    // 删除表单行
331
+    handleDelete() {},
332
+
333
+    //表格判断是否填入信息
334
+    contactsinfo() {
335
+      let info = this.tableData;
336
+      return new Promise((resolve, reject) => {
337
+        // if (info) {
338
+        //   resolve(info);
339
+        // } else {
340
+        //   reject("error");
341
+        info.forEach((i) => {
342
+          if (
343
+            i.contacts != "" &&
344
+            i.phone != "" &&
345
+            i.address != "" &&
346
+            i.FirstConcats != ""
347
+          ) {
348
+            resolve(info);
349
+          } else {
350
+            reject("error");
351
+          }
352
+        });
353
+        // }
354
+      })
355
+        .then((res) => {
356
+          console.log(res, "ooo");
357
+        })
358
+        .catch((err) => {
359
+          console.log(err, "ddd");
360
+        });
361
+    },
362
+  },
363
+};
364
+</script>
365
+
366
+<style lang="scss" scoped>
367
+.demo-form-inline {
368
+  .el-col-6 {
369
+    width: 50%;
370
+  }
371
+  .el-input {
372
+    width: 75%;
373
+  }
374
+}
375
+
376
+.tablebtn {
377
+  padding: 10px 12px;
378
+}
29 379
 
380
+/deep/.el-form.tableclass {
381
+  .el-table__header-wrapper {
382
+    .el-table__header {
383
+      width: 625px !important;
30 384
     }
385
+  }
386
+  .el-table__body-wrapper.is-scrolling-none {
387
+    .el-table__body {
388
+      width: 625px !important;
389
+    }
390
+  }
391
+}
392
+
393
+/deep/ .el-form-item__error {
394
+  // display: none !important;
31 395
 }
32
-</script>
396
+</style>

+ 392 - 0
src/xt_pages/supply/goodreturn.vue Bestand weergeven

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

+ 16 - 10
src/xt_pages/supply/supplyQuery.vue Bestand weergeven

@@ -59,6 +59,7 @@
59 59
         </div>
60 60
         <div>
61 61
           <el-button size="small" type="primary" @click="toAdd">新增</el-button>
62
+          <addSupply ref="addSupply"></addSupply>
62 63
         </div>
63 64
       </div>
64 65
 
@@ -124,8 +125,6 @@
124 125
          </template>
125 126
        </el-table-column>
126 127
 
127
-
128
-
129 128
        <el-table-column label="操作" align="center" width="260px">
130 129
           <template slot-scope="scope">
131 130
               <el-button
@@ -155,8 +154,8 @@
155 154
         :total="total"
156 155
       >
157 156
       </el-pagination>
158
-
159
-       <add-supply ref="addSupply"></add-supply>
157
+      
158
+       
160 159
     </div>
161 160
   </div>
162 161
 </template>
@@ -164,13 +163,11 @@
164 163
 <script>
165 164
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
166 165
 import addSupply from "./components/addSupply.vue"
167
-
166
+import {getSupplierId} from "@/api/supply"
168 167
 export default {
169 168
   name: "stockIn",
170
-   components: {
171
-     addSupply
172
-   },
173 169
   created() {
170
+    this.initSupplierData()
174 171
     this.org_id =  this.$store.getters.xt_user.org_id
175 172
 
176 173
     var start_time =  window.sessionStorage.getItem('start_time')
@@ -186,10 +183,12 @@ export default {
186 183
     window.sessionStorage.removeItem('end_time')
187 184
   },
188 185
   components: {
189
-    BreadCrumb
186
+    BreadCrumb,
187
+    addSupply
190 188
   },
191 189
   data() {
192 190
     return {
191
+      type_name:"",
193 192
       crumbs: [
194 193
         { path: false, name: "采购管理" },
195 194
         { path: "/spply/query", name: "供应商管理" }
@@ -211,8 +210,15 @@ export default {
211 210
     };
212 211
   },
213 212
   methods:{
213
+    // 获取供应商编码接口
214
+    initSupplierData(){
215
+      getSupplierId().then(res => {
216
+        console.log(res,'sss')
217
+      })
218
+    },
219
+
214 220
      toAdd(){
215
-       // console.log("res32323232323223",this.$refs)
221
+      //  console.log("res32323232323223",this.$refs.addSupply)
216 222
        this.$refs.addSupply.show()
217 223
      },
218 224
       changeTypeName(){