Browse Source

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

see999 3 years ago
parent
commit
f71234a00c

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

@@ -267,6 +267,7 @@ export function savesupply(data) {
267 267
 }
268 268
 
269 269
 export function updatesupply(data) {
270
+  console.log(data,'oopo')
270 271
   return request({
271 272
     url: '/api/supply/updatesupply',
272 273
     method: 'post',
@@ -274,5 +275,13 @@ export function updatesupply(data) {
274 275
   })
275 276
 }
276 277
 
278
+// export function updatesupply(data) {
279
+//   return request({
280
+//     url: '/api/supply/updatesupply' ,
281
+//     method: 'post',
282
+//     data: data
283
+//   })
284
+// }
285
+
277 286
 
278 287
 

+ 9 - 3
src/components/Popup/index.js View File

@@ -1,22 +1,28 @@
1 1
 import Vue from 'vue'
2 2
 import Popup from './index.vue'
3 3
 
4
+
4 5
 const PopupBox = Vue.extend(Popup)
5 6
 
6
-Popup.install = function (data) {
7
+Popup.install = function (data,methods) {
7 8
   let instance = new PopupBox({
8
-    data
9
+    data,
10
+    methods
9 11
   }).$mount()
10 12
 
11 13
   document.body.appendChild(instance.$el)
12
-
14
+  instance.toClick_1()
13 15
   Vue.nextTick(() => {
14 16
     instance.show = true
17
+    // this.$router.push({path:"/good/order/edit?id=" + instance.id});
15 18
     // show 和弹窗组件里的show对应,用于控制显隐
16 19
     setTimeout(() => {
17 20
       instance.show = false
18 21
     }, 3000);
19 22
   })
23
+
24
+
25
+
20 26
 }
21 27
 
22 28
 export default Popup

+ 11 - 5
src/components/Popup/index.vue View File

@@ -29,8 +29,8 @@
29 29
           </p>
30 30
           <div v-for="(item, index) in orderList" :key="index">
31 31
             <li>
32
-              购货单 {{ item.good_number
33
-              }}<a @click="toClick(item.id)">点击查看</a>
32
+              购货单 {{ item.good_number }}
33
+              <router-link tag="span" to=""> </router-link>
34 34
             </li>
35 35
           </div>
36 36
         </div>
@@ -44,6 +44,9 @@
44 44
 </template>
45 45
 
46 46
 <script>
47
+import Vue from "vue";
48
+import router from "vue-router";
49
+Vue.use(router);
47 50
 export default {
48 51
   name: "Popup",
49 52
   data() {
@@ -54,16 +57,19 @@ export default {
54 57
       content: "",
55 58
       btnText: "关闭",
56 59
       orderList: [],
60
+      id: 0,
57 61
     };
58 62
   },
59 63
   created() {},
60 64
   methods: {
61 65
     btnClick() {
62
-      this.click();
66
+      this.click1();
63 67
       this.show = false;
64 68
     },
65
-    toClick(id) {
66
-      this.$router.push("/good/order/edit?id=" + id);
69
+    toClick_1(id) {
70
+      // this.toClick(id);
71
+      // return id;
72
+      console.log(this.router)
67 73
     },
68 74
   },
69 75
 };

+ 3 - 2
src/main.js View File

@@ -33,8 +33,9 @@ import * as voicePromptFun from './utils/voicePrompt'
33 33
 import 'default-passive-events'
34 34
 Vue.prototype.voicePrompt = voicePromptFun.voicePrompt  //语音提醒
35 35
 
36
-import Popup from "./components/Popup/index"  //全局删除弹框控件
37
-Vue.prototype.$popup = Popup.install
36
+// import Popup from "./components/Popup/index"  //全局删除弹框控件
37
+// Vue.prototype.$popup = Popup.install
38
+// Vue.component(Popup)
38 39
 
39 40
 import Computed from "../src/xt_pages/components/Computed/index"  //自动计算金额控件
40 41
 Vue.component("Computed",Computed)

+ 9 - 0
src/router/modules/supply.js View File

@@ -27,6 +27,15 @@ export default {
27 27
       meta: { title: 'addSupply', noCache: true },
28 28
       isChild: true
29 29
     },
30
+    {
31
+      path: '/supply/Popup',
32
+      component: () => import('@/xt_pages/supply/components/Popup'),
33
+      name: 'Popup',
34
+      hidden: true,
35
+      is_menu: false,
36
+      meta: { title: 'Popup', noCache: true },
37
+      isChild: true
38
+    },
30 39
     {
31 40
       path: '/supply/edit',
32 41
       component: () => import('@/xt_pages/supply/components/editSupply'),

+ 2 - 2
src/views/layout/Layout.vue View File

@@ -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>

+ 5 - 5
src/xt_pages/data/components/drugs.vue View File

@@ -630,12 +630,12 @@
630 630
 
631 631
               }
632 632
 
633
-              // if(this.formValue.is_user <= 0){
633
+              if(this.formValue.is_user <= 0){
634 634
 
635
-              //   this.formValue.is_user = ''
636
-              // } else{
637
-              //   this.formValue.is_user = this.formValue.is_user.toString()
638
-              // }
635
+                this.formValue.is_user = ''
636
+              } else{
637
+                this.formValue.is_user = this.formValue.is_user.toString()
638
+              }
639 639
 
640 640
 
641 641
               if(this.formValue.is_charge_predict <= 0){

File diff suppressed because it is too large
+ 259 - 668
src/xt_pages/hospitalStation/outpatientChargesManagement.vue


+ 1 - 0
src/xt_pages/outpatientCharges/components/chargeDialog.vue View File

@@ -183,6 +183,7 @@
183 183
     },
184 184
     methods: {
185 185
       show: function (total,order) {
186
+
186 187
         this.form.total = total
187 188
         this.form.private_price = total
188 189
         this.form.pay_price = total

+ 2 - 2
src/xt_pages/outpatientCharges/components/registerDialog.vue View File

@@ -560,7 +560,7 @@
560 560
         this.form.age = jsGetAge(births, '-')
561 561
 
562 562
 
563
-
563
+        this.InsuplcAdmdvs = []
564 564
         var that = this
565 565
         let params={
566 566
           id_card_no: this.form.id_card,
@@ -590,7 +590,7 @@
590 590
                   }).catch(() => {
591 591
                   })
592 592
                 } else {
593
-                  that.InsuplcAdmdvs = []
593
+
594 594
                   for(let i =0; i < response.data.data.info.output.insuinfo.length; i++){
595 595
                     that.InsuplcAdmdvs.push({
596 596
                       value:response.data.data.info.output.insuinfo[i].insuplc_admdvs,

+ 5 - 0
src/xt_pages/stock/stockInOrderEdit.vue View File

@@ -795,6 +795,11 @@ export default {
795 795
             }else{
796 796
                this.recordInfo.recordData[i].price = val.buy_price
797 797
             }
798
+            if(val.packing_price == 0){
799
+              this.recordInfo.recordData[i].packing_price = ""
800
+            }else{
801
+              this.recordInfo.recordData[i].packing_price = val.packing_price
802
+            }
798 803
           
799 804
             this.recordInfo.recordData[i].specification_name = val.specification_name
800 805
             this.recordInfo.recordData[i].good_id = val.id

+ 144 - 0
src/xt_pages/supply/components/Popup.vue View File

@@ -0,0 +1,144 @@
1
+<template>
2
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="27%">
3
+    <div class="pop">
4
+      <div class="content">
5
+        <div class="content_1">
6
+          <img
7
+            src="../../../assets/Popup/alert.png"
8
+            alt="正在加载.."
9
+            class="alertImg"
10
+          />
11
+        </div>
12
+        <div class="content_2">
13
+          <p>
14
+            {{content}}<span style="color: #46a3ff">{{ number }}</span
15
+            >{{content_1}}
16
+          </p>
17
+          <div v-for="(item, index) in orderList" :key="index">
18
+            <li>
19
+              {{content_2}} {{ item.good_number }}
20
+              <a style="color: blue" @click="toClick_1(item.id)">点击查看</a>
21
+            </li>
22
+          </div>
23
+        </div>
24
+      </div>
25
+      <div class="btn">
26
+        <el-button @click="btnClick">{{ btnText }}</el-button>
27
+      </div>
28
+    </div>
29
+  </el-dialog>
30
+</template>
31
+
32
+<script>
33
+export default {
34
+  props: ["content_2", "content_1","content","number", "orderList"], //props接收
35
+  name: "Popup",
36
+  data() {
37
+    return {
38
+      dialogVisible: false,
39
+      show: false,
40
+      title: "系统提示",
41
+      content: "",
42
+      btnText: "关闭",
43
+      id: 0,
44
+    };
45
+  },
46
+  created() {},
47
+  methods: {
48
+    btnClick() {
49
+      this.show = false;
50
+    },
51
+    toClick_1(id) {
52
+      this.$router.push("/good/order/edit?id=" + id);
53
+    },
54
+  },
55
+};
56
+</script>
57
+
58
+
59
+<style lang="scss" scoped>
60
+// 渐变过渡
61
+.fade-enter,
62
+.fade-leave-active {
63
+  opacity: 0;
64
+}
65
+.fade-enter-active,
66
+.fade-leave-active {
67
+  transition: opacity 0.35s;
68
+}
69
+// 全局弹窗
70
+.mask {
71
+  background: rgba(0, 0, 0, 0.5);
72
+  position: fixed;
73
+  top: 0;
74
+  z-index: 10;
75
+  width: 100%;
76
+  height: 100%;
77
+}
78
+
79
+.pop {
80
+  height: 205px;
81
+  width: 435px;
82
+  background: #fff;
83
+  border-radius: 8px;
84
+  position: relative;
85
+  left: 45%;
86
+  transform: translateX(-50%);
87
+  z-index: 20;
88
+  text-align: center;
89
+  .title {
90
+    height: 40px;
91
+    line-height: 40px;
92
+    span {
93
+      float: left;
94
+      margin-left: 15px;
95
+    }
96
+  }
97
+  .content {
98
+    height: 125px;
99
+    display: flex;
100
+    .content_1 {
101
+      width: 20%;
102
+      .alertImg {
103
+        width: 45px;
104
+        height: 45px;
105
+      }
106
+    }
107
+
108
+    .content_2 {
109
+      p {
110
+        line-height: 43px !important;
111
+        text-align: left !important;
112
+      }
113
+
114
+      li {
115
+        list-style: disc;
116
+        text-align: left;
117
+        a {
118
+          float: right;
119
+          margin-right: 60px;
120
+        }
121
+      }
122
+    }
123
+  }
124
+
125
+  .btn {
126
+    height: 40px;
127
+    line-height: 40px;
128
+    transform: translateY(30px);
129
+    button {
130
+      float: right;
131
+      margin-right: 15px;
132
+    }
133
+  }
134
+
135
+  .close {
136
+    top: 0;
137
+    right: 10px;
138
+    position: absolute;
139
+    display: block;
140
+    width: 40px;
141
+    height: 40px;
142
+  }
143
+}
144
+</style>

File diff suppressed because it is too large
+ 1074 - 770
src/xt_pages/supply/components/addGoodOrder.vue


+ 282 - 169
src/xt_pages/supply/components/addGoodReturn.vue View File

@@ -59,8 +59,20 @@
59 59
           <span>单据编码:{{ number }}</span>
60 60
         </div>
61 61
         <div>
62
-          <el-button size="small" type="primary" @click="saveGoodReturn" v-show="showOne">保存</el-button>
63
-          <el-button size="small" type="primary" @click="saveGoodReturn" v-show="showTwo">保存</el-button>
62
+          <el-button
63
+            size="small"
64
+            type="primary"
65
+            @click="saveGoodReturn"
66
+            v-show="showOne"
67
+            >保存</el-button
68
+          >
69
+          <el-button
70
+            size="small"
71
+            type="primary"
72
+            @click="saveGoodReturn"
73
+            v-show="showTwo"
74
+            >保存</el-button
75
+          >
64 76
           <el-button size="small" type="primary" @click="updatePurchaseOrder"
65 77
             >审核</el-button
66 78
           >
@@ -74,8 +86,8 @@
74 86
         <el-table
75 87
           :row-style="{ color: '#303133' }"
76 88
           :header-cell-style="{
77
-              backgroundColor: 'rgb(245, 247, 250)',
78
-              color: '#606266'
89
+            backgroundColor: 'rgb(245, 247, 250)',
90
+            color: '#606266',
79 91
           }"
80 92
           :data="recordInfo.tableList"
81 93
           :class="signAndWeighBoxPatients"
@@ -131,26 +143,35 @@
131 143
                 v-model="scope.row.supply_specification_name"
132 144
                 style="width: 150px"
133 145
                 :disabled="true"
134
-                 placeholder="规格&单位"
146
+                placeholder="规格&单位"
135 147
               ></el-input>
136 148
             </template>
137 149
           </el-table-column>
138 150
 
139
-        <el-table-column label="单位" align="center" width="120px">
151
+          <el-table-column label="单位" align="center" width="120px">
140 152
             <template slot="header" slot-scope="scope">
141
-                <span>单位<span style="color: red">*</span></span>
153
+              <span>单位<span style="color: red">*</span></span>
142 154
             </template>
143 155
             <template slot-scope="scope">
144
-              <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
145
-                <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择"  :disabled="disabled">
146
-                        <!-- <el-option
156
+              <el-form-item
157
+                :prop="'tableList.' + scope.$index + '.supply_unit'"
158
+                :rules="tableRules.supply_unit"
159
+              >
160
+                <el-select
161
+                  v-model="scope.row.supply_unit"
162
+                  style="width: 100px"
163
+                  filterable
164
+                  placeholder="请选择"
165
+                  :disabled="disabled"
166
+                >
167
+                  <!-- <el-option
147 168
                             v-for="(item,index) in scope.row.unitList"
148 169
                             :key="index"
149 170
                             :label="item.name"
150 171
                             :value="item.name">
151 172
                         </el-option> -->
152 173
                 </el-select>
153
-              </el-form-item>  
174
+              </el-form-item>
154 175
             </template>
155 176
           </el-table-column>
156 177
           <el-table-column label="可用库存" align="center" width="130px">
@@ -196,7 +217,7 @@
196 217
                 v-model="scope.row.supply_price"
197 218
                 style="width: 140px"
198 219
                 :disabled="disabled"
199
-                 placeholder="请输入采购单价"
220
+                placeholder="请输入采购单价"
200 221
               ></el-input>
201 222
             </template>
202 223
           </el-table-column>
@@ -259,26 +280,43 @@
259 280
             </template>
260 281
           </el-table-column>
261 282
 
262
-          <el-table-column label="操作" align="center" width="150px" fixed="right">
283
+          <el-table-column
284
+            label="操作"
285
+            align="center"
286
+            width="150px"
287
+            fixed="right"
288
+          >
263 289
             <template slot-scope="scope">
264
-              <el-tooltip class="item" effect="dark" content="新增" placement="top" >
265
-                  <el-button
266
-                      size="mini"
267
-                      type="primary"
268
-                      icon="el-icon-circle-plus-outline"
269
-                      @click="handleEdit(scope.$index, scope.row)">
270
-                  </el-button>
271
-            </el-tooltip>
272
-            <el-tooltip class="item" effect="dark" content="删除" placement="top">
273
-                  <el-button
274
-                      size="mini"
275
-                      type="danger"
276
-                      icon="el-icon-delete"
277
-                      @click="handleDelete(scope.$index, scope.row)">
278
-                  </el-button>
290
+              <el-tooltip
291
+                class="item"
292
+                effect="dark"
293
+                content="新增"
294
+                placement="top"
295
+              >
296
+                <el-button
297
+                  size="mini"
298
+                  type="primary"
299
+                  icon="el-icon-circle-plus-outline"
300
+                  @click="handleEdit(scope.$index, scope.row)"
301
+                >
302
+                </el-button>
303
+              </el-tooltip>
304
+              <el-tooltip
305
+                class="item"
306
+                effect="dark"
307
+                content="删除"
308
+                placement="top"
309
+              >
310
+                <el-button
311
+                  size="mini"
312
+                  type="danger"
313
+                  icon="el-icon-delete"
314
+                  @click="handleDelete(scope.$index, scope.row)"
315
+                >
316
+                </el-button>
279 317
               </el-tooltip>
280 318
             </template>
281
-         </el-table-column>
319
+          </el-table-column>
282 320
         </el-table>
283 321
       </el-form>
284 322
       <div style="margin-top: 10px">
@@ -290,11 +328,14 @@
290 328
         >
291 329
         </el-input>
292 330
       </div>
331
+      <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
293 332
       <div style="margin-top: 10px">
294 333
         <span
295 334
           >优惠率:<el-input
296 335
             style="width: 100px"
297 336
             v-model="rate_of_concession"
337
+            @input="addressChange"
338
+            placeholder="请输入优惠率"
298 339
           ></el-input
299 340
           >%</span
300 341
         >
@@ -303,6 +344,8 @@
303 344
           >优惠金额:<el-input
304 345
             style="width: 100px"
305 346
             v-model="discount_amount"
347
+            @input="count_discount"
348
+            placeholder="请输入优惠金额"
306 349
           ></el-input
307 350
         ></span>
308 351
 
@@ -310,6 +353,8 @@
310 353
           >本次付款:<el-input
311 354
             style="width: 100px"
312 355
             v-model="payment"
356
+            @input="count_payment"
357
+            placeholder="请输入本次付款"
313 358
           ></el-input
314 359
         ></span>
315 360
 
@@ -317,11 +362,12 @@
317 362
           >本次欠款:<el-input
318 363
             style="width: 100px"
319 364
             v-model="arrearage"
365
+            @input="count_arrearage"
366
+            placeholder="请输入本次欠款"
320 367
           ></el-input
321 368
         ></span>
322 369
       </div>
323 370
     </div>
324
-
325 371
   </div>
326 372
 </template>
327 373
 
@@ -331,7 +377,7 @@ import { uParseTime } from "@/utils/tools";
331 377
 import {
332 378
   getInitOrder,
333 379
   getGoodOrderDetail,
334
-  saveGoodReturnOrder
380
+  saveGoodReturnOrder,
335 381
 } from "@/api/supply";
336 382
 export default {
337 383
   name: "addPurchaseOrder",
@@ -340,7 +386,7 @@ export default {
340 386
   },
341 387
   data() {
342 388
     return {
343
-      tipsInfo:"",
389
+      tipsInfo: "",
344 390
       crumbs: [
345 391
         { path: false, name: "购货单" },
346 392
         { path: "/good/return/add", name: "新增退货单" },
@@ -374,8 +420,8 @@ export default {
374 420
       supplier_name: "",
375 421
       supplyList: [],
376 422
       rate_of_concession: "",
377
-      arrearage:"",
378
-      payment:"",
423
+      arrearage: "",
424
+      payment: "",
379 425
       discount_amount: "",
380 426
       tableRules: {
381 427
         name: [{ required: true, message: "商品不能为空", trigger: "blur" }],
@@ -392,7 +438,7 @@ export default {
392 438
       disabled: false,
393 439
       is_check: 0,
394 440
       dialogVisible: false,
395
-      return_remark:"",
441
+      return_remark: "",
396 442
     };
397 443
   },
398 444
   methods: {
@@ -701,8 +747,34 @@ export default {
701 747
           this.recordInfo.tableList[i].supply_price *
702 748
           this.recordInfo.tableList[i].supply_count;
703 749
       }
750
+      this.total_price = total_price;
704 751
       return total_price.toFixed(2);
705 752
     },
753
+
754
+    addressChange() {
755
+      var discount_amount = 0;
756
+      if (this.rate_of_concession > 0) {
757
+        discount_amount = (
758
+          (this.rate_of_concession / 100) *
759
+          this.total_price
760
+        ).toFixed(2);
761
+      }
762
+      this.discount_amount = discount_amount;
763
+    },
764
+    count_discount() {
765
+      this.rate_of_concession = (
766
+        this.discount_amount /
767
+        (this.total_price * 0.01)
768
+      ).toFixed(2);
769
+    },
770
+    count_payment() {
771
+      this.arrearage = this.total_price - this.payment;
772
+    },
773
+
774
+    count_arrearage() {
775
+      this.payment = this.total_price - this.arrearage;
776
+    },
777
+
706 778
     checkPurchaseOrder(id, index) {
707 779
       this.$confirm("是否审核?", {
708 780
         confirmButtonText: "确 定",
@@ -721,159 +793,200 @@ export default {
721 793
         })
722 794
         .catch(() => {});
723 795
     },
724
-    getGoodOrderDetail(){
725
-      
726
-        var id = this.$route.query.id
727
-      getGoodOrderDetail(id).then(response=>{
728
-        if(response.data.state == 1){
729
-          var out = response.data.data.out
730
-          this.is_check = out.is_check
731
-          this.id = out.id
732
-          this.supplier_name = out.supplier_id
733
-          this.rate_of_concession = out.rate_of_concession
734
-          this.discount_amount = out.discount_amount
735
-          this.payment = out.payment
736
-          this.arrearage = out.arrearage
737
-          this.start_time = this.getTimes(out.document_date)
738
-          var orderInfo = response.data.data.list
739
-          console.log("orderINFO233232232332",orderInfo)
740
-          var drugList = response.data.data.drugList
741
-          var goodList = response.data.data.goodList
742
-          for(let i=0;i< orderInfo.length;i++){
743
-              
744
-              orderInfo[i].supply_count =  orderInfo[i].count
745
-              orderInfo[i].supply_price =  orderInfo[i].price
746
-              orderInfo[i].supply_remake =  orderInfo[i].remark
747
-              orderInfo[i].type =  orderInfo[i].is_source
748
-              orderInfo[i].project_id =  orderInfo[i].project_id
749
-              orderInfo[i].supply_unit =  orderInfo[i].supply_unit
750
-              orderInfo[i].order_number =  orderInfo[i].order_number
751
-              orderInfo[i].good_number = orderInfo[i].good_number
752
-              orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
753
-              orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
754
-              orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
755
-            if(orderInfo[i].is_source == 1){
756
-              for(let j=0;j<drugList.length;j++){
757
-                  if( orderInfo[i].project_id == drugList[j].id){
758
-                    if(drugList[j].max_unit!=drugList[j].min_unit){
759
-                      orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
760
-                      orderInfo[i].unitList[0].name = drugList[j].max_unit
761
-                      orderInfo[i].unitList[1].name = drugList[j].min_unit
762
-                    }
763
-                    if(drugList[j].max_unit ==drugList[j].min_unit){
764
-                      orderInfo[i].unitList = [{id:1,name:""}]
765
-                      orderInfo[i].unitList[0].name = drugList[j].max_unit
766
-                    }
767
-                  
796
+    getGoodOrderDetail() {
797
+      var id = this.$route.query.id;
798
+      getGoodOrderDetail(id).then((response) => {
799
+        if (response.data.state == 1) {
800
+          var out = response.data.data.out;
801
+          this.is_check = out.is_check;
802
+          this.id = out.id;
803
+          this.supplier_name = out.supplier_id;
804
+          this.rate_of_concession = out.rate_of_concession;
805
+          this.discount_amount = out.discount_amount;
806
+          this.payment = out.payment;
807
+          this.arrearage = out.arrearage;
808
+          this.start_time = this.getTimes(out.document_date);
809
+          var orderInfo = response.data.data.list;
810
+          console.log("orderINFO233232232332", orderInfo);
811
+          var drugList = response.data.data.drugList;
812
+          var goodList = response.data.data.goodList;
813
+          for (let i = 0; i < orderInfo.length; i++) {
814
+            orderInfo[i].supply_count = orderInfo[i].count;
815
+            orderInfo[i].supply_price = orderInfo[i].price;
816
+            orderInfo[i].supply_remake = orderInfo[i].remark;
817
+            orderInfo[i].type = orderInfo[i].is_source;
818
+            orderInfo[i].project_id = orderInfo[i].project_id;
819
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit;
820
+            orderInfo[i].order_number = orderInfo[i].order_number;
821
+            orderInfo[i].good_number = orderInfo[i].good_number;
822
+            orderInfo[i].supply_total_price = (
823
+              orderInfo[i].count * orderInfo[i].price
824
+            ).toFixed(2);
825
+            orderInfo[i].supply_expiry_date = this.getTimes(
826
+              orderInfo[i].supply_expiry_date
827
+            );
828
+            orderInfo[i].supply_product_date = this.getTimes(
829
+              orderInfo[i].supply_product_date
830
+            );
831
+            if (orderInfo[i].is_source == 1) {
832
+              for (let j = 0; j < drugList.length; j++) {
833
+                if (orderInfo[i].project_id == drugList[j].id) {
834
+                  if (drugList[j].max_unit != drugList[j].min_unit) {
835
+                    orderInfo[i].unitList = [
836
+                      { id: 1, name: "" },
837
+                      { id: 2, name: "" },
838
+                    ];
839
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit;
840
+                    orderInfo[i].unitList[1].name = drugList[j].min_unit;
768 841
                   }
769
-              }  
770
-              } 
771
-            if(orderInfo[i].is_source == 2){
772
-              for(let j=0;j<goodList.length;j++){
773
-                  if(orderInfo[i].project_id == goodList[j].id){
774
-                      orderInfo[i].unitList = [{id:1,name:""}]
775
-                      orderInfo[i].unitList[0].name = goodList[j].packing_unit
842
+                  if (drugList[j].max_unit == drugList[j].min_unit) {
843
+                    orderInfo[i].unitList = [{ id: 1, name: "" }];
844
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit;
776 845
                   }
777
-              }  
778
-            } 
846
+                }
847
+              }
848
+            }
849
+            if (orderInfo[i].is_source == 2) {
850
+              for (let j = 0; j < goodList.length; j++) {
851
+                if (orderInfo[i].project_id == goodList[j].id) {
852
+                  orderInfo[i].unitList = [{ id: 1, name: "" }];
853
+                  orderInfo[i].unitList[0].name = goodList[j].packing_unit;
854
+                }
855
+              }
856
+            }
779 857
           }
780
-        
781
-          this.recordInfo.tableList= []
782
-          this.recordInfo.tableList = orderInfo
783
-        
858
+
859
+          this.recordInfo.tableList = [];
860
+          this.recordInfo.tableList = orderInfo;
784 861
         }
785
-      })  
862
+      });
786 863
     },
787 864
     toPrint() {
788 865
       var id = this.$route.query.id;
789 866
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
790 867
     },
791
-    saveGoodReturn(){
868
+    saveGoodReturn() {
792 869
       var warehouse_out_id = this.$route.query.id;
793
-      this.$refs["tableForm"].validate((valid)=>{
794
-        if(valid){
795
-          this.loading = true
796
-          for(let i=0;i<this.recordInfo.tableList.length;i++){
797
-            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
798
-            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
799
-            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
800
-       
801
-            for(let j=0;j<this.manufactuerList.length;j++){
802
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
803
-                  this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
804
-                }
805
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id){
806
-                  this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
807
-                }
870
+      this.$refs["tableForm"].validate((valid) => {
871
+        if (valid) {
872
+          this.loading = true;
873
+          for (let i = 0; i < this.recordInfo.tableList.length; i++) {
874
+            this.recordInfo.tableList[i].supply_count = parseInt(
875
+              this.recordInfo.tableList[i].supply_count
876
+            );
877
+            this.recordInfo.tableList[i].supply_price =
878
+              this.recordInfo.tableList[i].supply_price.toString();
879
+            this.recordInfo.tableList[i].supply_total =
880
+              this.recordInfo.tableList[i].supply_total.toString();
808 881
 
882
+            for (let j = 0; j < this.manufactuerList.length; j++) {
883
+              if (
884
+                this.recordInfo.tableList[i].supply_manufacturer ==
885
+                this.manufactuerList[j].manufacturer_name
886
+              ) {
887
+                this.recordInfo.tableList[i].manufacturer_id =
888
+                  this.manufactuerList[j].id;
889
+              }
890
+              if (
891
+                this.recordInfo.tableList[i].supply_manufacturer ==
892
+                this.manufactuerList[j].id
893
+              ) {
894
+                this.recordInfo.tableList[i].supply_manufacturer =
895
+                  this.manufactuerList[j].manufacturer_name;
896
+              }
809 897
             }
810 898
           }
811 899
           var params = {
812
-            "stockIn":this.recordInfo.tableList,
813
-            "return_marke":this.return_remark,
814
-          }
815
-          console.log("start_time232233232",this.start_time)
816
-          
817
-          saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
818
-            if(response.data.state == 1){
819
-               this.loading = false
820
-               this.showOne = false
821
-               this.showTwo = true
822
-               this.$message.success("保存成功!")
823
-               var warehouseCancel = response.data.data.warehouseCancel
824
-               var out = response.data.data.cancelOrder
825
-               this.id = out.id
826
-               this.supplier_name = out.supplier_id
827
-               this.rate_of_concession = out.rate_of_concession
828
-               this.discount_amount = out.discount_amount
829
-               this.payment = out.payment
830
-               this.arrearage = out.arrearage
831
-               this.start_time = this.getTimes(out.document_date)
832
-               var orderInfo = response.data.data.list
833
-               for(let i=0;i< orderInfo.length;i++){
834
-                orderInfo[i].supply_count =  orderInfo[i].count
835
-                orderInfo[i].supply_price =  orderInfo[i].price
836
-                orderInfo[i].supply_remake =  orderInfo[i].remark
837
-                orderInfo[i].type =  orderInfo[i].is_source
838
-                orderInfo[i].project_id =  orderInfo[i].project_id
839
-                orderInfo[i].supply_unit =  orderInfo[i].supply_unit
840
-                orderInfo[i].order_number =  orderInfo[i].order_number
841
-                orderInfo[i].good_number = orderInfo[i].good_number
842
-                orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
843
-                orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
844
-                orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
845
-                if(orderInfo[i].is_source == 1){
846
-                  for(let j=0;j<this.drugList.length;j++){
847
-                      if( orderInfo[i].project_id == this.drugList[j].id){
848
-                        if(this.drugList[j].max_unit!=this.drugList[j].min_unit){
849
-                          orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
850
-                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
851
-                          orderInfo[i].unitList[1].name = this.drugList[j].min_unit
852
-                        }
853
-                        if(this.drugList[j].max_unit ==this.drugList[j].min_unit){
854
-                          orderInfo[i].unitList = [{id:1,name:""}]
855
-                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
856
-                        }
857
-                      
900
+            stockIn: this.recordInfo.tableList,
901
+            return_marke: this.return_remark,
902
+          };
903
+          console.log("start_time232233232", this.start_time);
904
+
905
+          saveGoodReturnOrder(
906
+            params,
907
+            warehouse_out_id,
908
+            this.start_time,
909
+            this.rate_of_concession,
910
+            this.discount_amount,
911
+            this.arrearage,
912
+            this.payment,
913
+            this.supplier_name
914
+          ).then((response) => {
915
+            if (response.data.state == 1) {
916
+              this.loading = false;
917
+              this.showOne = false;
918
+              this.showTwo = true;
919
+              this.$message.success("保存成功!");
920
+              var warehouseCancel = response.data.data.warehouseCancel;
921
+              var out = response.data.data.cancelOrder;
922
+              this.id = out.id;
923
+              this.supplier_name = out.supplier_id;
924
+              this.rate_of_concession = out.rate_of_concession;
925
+              this.discount_amount = out.discount_amount;
926
+              this.payment = out.payment;
927
+              this.arrearage = out.arrearage;
928
+              this.start_time = this.getTimes(out.document_date);
929
+              var orderInfo = response.data.data.list;
930
+              for (let i = 0; i < orderInfo.length; i++) {
931
+                orderInfo[i].supply_count = orderInfo[i].count;
932
+                orderInfo[i].supply_price = orderInfo[i].price;
933
+                orderInfo[i].supply_remake = orderInfo[i].remark;
934
+                orderInfo[i].type = orderInfo[i].is_source;
935
+                orderInfo[i].project_id = orderInfo[i].project_id;
936
+                orderInfo[i].supply_unit = orderInfo[i].supply_unit;
937
+                orderInfo[i].order_number = orderInfo[i].order_number;
938
+                orderInfo[i].good_number = orderInfo[i].good_number;
939
+                orderInfo[i].supply_total_price = (
940
+                  orderInfo[i].count * orderInfo[i].price
941
+                ).toFixed(2);
942
+                orderInfo[i].supply_expiry_date = this.getTimes(
943
+                  orderInfo[i].supply_expiry_date
944
+                );
945
+                orderInfo[i].supply_product_date = this.getTimes(
946
+                  orderInfo[i].supply_product_date
947
+                );
948
+                if (orderInfo[i].is_source == 1) {
949
+                  for (let j = 0; j < this.drugList.length; j++) {
950
+                    if (orderInfo[i].project_id == this.drugList[j].id) {
951
+                      if (
952
+                        this.drugList[j].max_unit != this.drugList[j].min_unit
953
+                      ) {
954
+                        orderInfo[i].unitList = [
955
+                          { id: 1, name: "" },
956
+                          { id: 2, name: "" },
957
+                        ];
958
+                        orderInfo[i].unitList[0].name =
959
+                          this.drugList[j].max_unit;
960
+                        orderInfo[i].unitList[1].name =
961
+                          this.drugList[j].min_unit;
858 962
                       }
859
-                  }  
860
-                  } 
861
-                if(orderInfo[i].is_source == 2){
862
-                  for(let j=0;j<this.goodList.length;j++){
863
-                      if(orderInfo[i].project_id == this.goodList[j].id){
864
-                          orderInfo[i].unitList = [{id:1,name:""}]
865
-                          orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
963
+                      if (
964
+                        this.drugList[j].max_unit == this.drugList[j].min_unit
965
+                      ) {
966
+                        orderInfo[i].unitList = [{ id: 1, name: "" }];
967
+                        orderInfo[i].unitList[0].name =
968
+                          this.drugList[j].max_unit;
866 969
                       }
867
-                  }  
868
-                } 
970
+                    }
971
+                  }
972
+                }
973
+                if (orderInfo[i].is_source == 2) {
974
+                  for (let j = 0; j < this.goodList.length; j++) {
975
+                    if (orderInfo[i].project_id == this.goodList[j].id) {
976
+                      orderInfo[i].unitList = [{ id: 1, name: "" }];
977
+                      orderInfo[i].unitList[0].name =
978
+                        this.goodList[j].packing_unit;
979
+                    }
980
+                  }
981
+                }
869 982
               }
870
-              this.recordInfo.tableList= []
871
-              this.recordInfo.tableList = orderInfo
983
+              this.recordInfo.tableList = [];
984
+              this.recordInfo.tableList = orderInfo;
872 985
             }
873
-          })
986
+          });
874 987
         }
875
-      })
876
-    }
988
+      });
989
+    },
877 990
   },
878 991
   created() {
879 992
     const tempObj = {};

+ 4 - 3
src/xt_pages/supply/components/addSupply.vue View File

@@ -383,9 +383,11 @@ export default {
383 383
             this.$refs[formName].validate((valid) => {
384 384
               if (valid) {
385 385
                 let params = {
386
-                  ...this.supplier,
387
-                  ...this.recordInfo,
386
+                  // ...this.supplier,
387
+                  suppliername:this.supplier.supplierName,
388
+                  // ...this.recordInfo
388 389
                 };
390
+                let data = { ...this.recordInfo };
389 391
                 console.log(params, "dhas");
390 392
                 updatesupply(params).then((res) => {
391 393
                   console.log(res, "oo");
@@ -401,7 +403,6 @@ export default {
401 403
           }
402 404
         });
403 405
       }
404
-
405 406
       this.contactsinfo();
406 407
     },
407 408
 

File diff suppressed because it is too large
+ 1237 - 914
src/xt_pages/supply/components/editGoodOrder.vue


File diff suppressed because it is too large
+ 993 - 782
src/xt_pages/supply/components/editPurchaseOrder.vue