Ver código fonte

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

XMLWAN 3 anos atrás
pai
commit
214b1ee7bf

+ 3 - 2
src/api/supply.js Ver arquivo

@@ -266,9 +266,10 @@ export function savesupply(data) {
266 266
   })
267 267
 }
268 268
 
269
-export function updatesupply(data,params) {
269
+export function updatesupply(data) {
270
+  console.log(data,'oopo')
270 271
   return request({
271
-    url: '/api/supply/updatesupply?suppliercode=' + params.supplierCode + '&suppliername=' + params.supplierName,
272
+    url: '/api/supply/updatesupply',
272 273
     method: 'post',
273 274
     data: data
274 275
   })

+ 9 - 3
src/components/Popup/index.js Ver arquivo

@@ -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 - 6
src/components/Popup/index.vue Ver arquivo

@@ -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,17 +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
-      
67
-      this.$router.push({path:"/good/order/edit?id=" + id});
69
+    toClick_1(id) {
70
+      // this.toClick(id);
71
+      // return id;
72
+      console.log(this.router)
68 73
     },
69 74
   },
70 75
 };

+ 3 - 2
src/main.js Ver arquivo

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

@@ -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'),

+ 144 - 0
src/xt_pages/supply/components/Popup.vue Ver arquivo

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

+ 299 - 76
src/xt_pages/supply/components/addGoodReturn.vue Ver arquivo

@@ -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">
@@ -296,6 +334,8 @@
296 334
           >优惠率:<el-input
297 335
             style="width: 100px"
298 336
             v-model="rate_of_concession"
337
+            @input="addressChange"
338
+            placeholder="请输入优惠率"
299 339
           ></el-input
300 340
           >%</span
301 341
         >
@@ -304,6 +344,8 @@
304 344
           >优惠金额:<el-input
305 345
             style="width: 100px"
306 346
             v-model="discount_amount"
347
+            @input="count_discount"
348
+            placeholder="请输入优惠金额"
307 349
           ></el-input
308 350
         ></span>
309 351
 
@@ -311,6 +353,8 @@
311 353
           >本次付款:<el-input
312 354
             style="width: 100px"
313 355
             v-model="payment"
356
+            @input="count_payment"
357
+            placeholder="请输入本次付款"
314 358
           ></el-input
315 359
         ></span>
316 360
 
@@ -318,11 +362,12 @@
318 362
           >本次欠款:<el-input
319 363
             style="width: 100px"
320 364
             v-model="arrearage"
365
+            @input="count_arrearage"
366
+            placeholder="请输入本次欠款"
321 367
           ></el-input
322 368
         ></span>
323 369
       </div>
324 370
     </div>
325
-
326 371
   </div>
327 372
 </template>
328 373
 
@@ -332,7 +377,7 @@ import { uParseTime } from "@/utils/tools";
332 377
 import {
333 378
   getInitOrder,
334 379
   getGoodOrderDetail,
335
-  saveGoodReturnOrder
380
+  saveGoodReturnOrder,
336 381
 } from "@/api/supply";
337 382
 export default {
338 383
   name: "addPurchaseOrder",
@@ -341,7 +386,7 @@ export default {
341 386
   },
342 387
   data() {
343 388
     return {
344
-      tipsInfo:"",
389
+      tipsInfo: "",
345 390
       crumbs: [
346 391
         { path: false, name: "购货单" },
347 392
         { path: "/good/return/add", name: "新增退货单" },
@@ -373,8 +418,8 @@ export default {
373 418
       supplier_name: "",
374 419
       supplyList: [],
375 420
       rate_of_concession: "",
376
-      arrearage:"",
377
-      payment:"",
421
+      arrearage: "",
422
+      payment: "",
378 423
       discount_amount: "",
379 424
       tableRules: {
380 425
         name: [{ required: true, message: "商品不能为空", trigger: "blur" }],
@@ -391,7 +436,7 @@ export default {
391 436
       disabled: false,
392 437
       is_check: 0,
393 438
       dialogVisible: false,
394
-      return_remark:"",
439
+      return_remark: "",
395 440
     };
396 441
   },
397 442
   methods: {
@@ -690,6 +735,31 @@ export default {
690 735
       this.total_price = total_price;
691 736
       return total_price.toFixed(2);
692 737
     },
738
+
739
+    addressChange() {
740
+      var discount_amount = 0;
741
+      if (this.rate_of_concession > 0) {
742
+        discount_amount = (
743
+          (this.rate_of_concession / 100) *
744
+          this.total_price
745
+        ).toFixed(2);
746
+      }
747
+      this.discount_amount = discount_amount;
748
+    },
749
+    count_discount() {
750
+      this.rate_of_concession = (
751
+        this.discount_amount /
752
+        (this.total_price * 0.01)
753
+      ).toFixed(2);
754
+    },
755
+    count_payment() {
756
+      this.arrearage = this.total_price - this.payment;
757
+    },
758
+
759
+    count_arrearage() {
760
+      this.payment = this.total_price - this.arrearage;
761
+    },
762
+
693 763
     checkPurchaseOrder(id, index) {
694 764
       this.$confirm("是否审核?", {
695 765
         confirmButtonText: "确 定",
@@ -709,7 +779,7 @@ export default {
709 779
         .catch(() => {});
710 780
     },
711 781
     getGoodOrderDetail(){
712
-      
782
+
713 783
         var id = this.$route.query.id
714 784
         var ids = this.$route.query.ids
715 785
       getGoodOrderDetail(id,ids).then(response=>{
@@ -728,7 +798,7 @@ export default {
728 798
           var drugList = response.data.data.drugList
729 799
           var goodList = response.data.data.goodList
730 800
           for(let i=0;i< orderInfo.length;i++){
731
-              
801
+
732 802
               orderInfo[i].supply_count =  orderInfo[i].count
733 803
               orderInfo[i].supply_price =  orderInfo[i].price
734 804
               orderInfo[i].supply_remake =  orderInfo[i].remark
@@ -752,48 +822,119 @@ export default {
752 822
                       orderInfo[i].unitList = [{id:1,name:""}]
753 823
                       orderInfo[i].unitList[0].name = drugList[j].max_unit
754 824
                     }
755
-                  
825
+
756 826
                   }
757
-              }  
758
-              } 
827
+              }
828
+              }
759 829
             if(orderInfo[i].is_source == 2){
760 830
               for(let j=0;j<goodList.length;j++){
761 831
                   if(orderInfo[i].project_id == goodList[j].id){
762 832
                       orderInfo[i].unitList = [{id:1,name:""}]
763 833
                       orderInfo[i].unitList[0].name = goodList[j].packing_unit
764 834
                   }
765
-              }  
766
-            } 
835
+              }
836
+            }
837
+    getGoodOrderDetail() {
838
+      var id = this.$route.query.id;
839
+      getGoodOrderDetail(id).then((response) => {
840
+        if (response.data.state == 1) {
841
+          var out = response.data.data.out;
842
+          this.is_check = out.is_check;
843
+          this.id = out.id;
844
+          this.supplier_name = out.supplier_id;
845
+          this.rate_of_concession = out.rate_of_concession;
846
+          this.discount_amount = out.discount_amount;
847
+          this.payment = out.payment;
848
+          this.arrearage = out.arrearage;
849
+          this.start_time = this.getTimes(out.document_date);
850
+          var orderInfo = response.data.data.list;
851
+          console.log("orderINFO233232232332", orderInfo);
852
+          var drugList = response.data.data.drugList;
853
+          var goodList = response.data.data.goodList;
854
+          for (let i = 0; i < orderInfo.length; i++) {
855
+            orderInfo[i].supply_count = orderInfo[i].count;
856
+            orderInfo[i].supply_price = orderInfo[i].price;
857
+            orderInfo[i].supply_remake = orderInfo[i].remark;
858
+            orderInfo[i].type = orderInfo[i].is_source;
859
+            orderInfo[i].project_id = orderInfo[i].project_id;
860
+            orderInfo[i].supply_unit = orderInfo[i].supply_unit;
861
+            orderInfo[i].order_number = orderInfo[i].order_number;
862
+            orderInfo[i].good_number = orderInfo[i].good_number;
863
+            orderInfo[i].supply_total_price = (
864
+              orderInfo[i].count * orderInfo[i].price
865
+            ).toFixed(2);
866
+            orderInfo[i].supply_expiry_date = this.getTimes(
867
+              orderInfo[i].supply_expiry_date
868
+            );
869
+            orderInfo[i].supply_product_date = this.getTimes(
870
+              orderInfo[i].supply_product_date
871
+            );
872
+            if (orderInfo[i].is_source == 1) {
873
+              for (let j = 0; j < drugList.length; j++) {
874
+                if (orderInfo[i].project_id == drugList[j].id) {
875
+                  if (drugList[j].max_unit != drugList[j].min_unit) {
876
+                    orderInfo[i].unitList = [
877
+                      { id: 1, name: "" },
878
+                      { id: 2, name: "" },
879
+                    ];
880
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit;
881
+                    orderInfo[i].unitList[1].name = drugList[j].min_unit;
882
+                  }
883
+                  if (drugList[j].max_unit == drugList[j].min_unit) {
884
+                    orderInfo[i].unitList = [{ id: 1, name: "" }];
885
+                    orderInfo[i].unitList[0].name = drugList[j].max_unit;
886
+                  }
887
+                }
888
+              }
889
+            }
890
+            if (orderInfo[i].is_source == 2) {
891
+              for (let j = 0; j < goodList.length; j++) {
892
+                if (orderInfo[i].project_id == goodList[j].id) {
893
+                  orderInfo[i].unitList = [{ id: 1, name: "" }];
894
+                  orderInfo[i].unitList[0].name = goodList[j].packing_unit;
895
+                }
896
+              }
897
+            }
767 898
           }
768
-        
769
-          this.recordInfo.tableList= []
770
-          this.recordInfo.tableList = orderInfo
771
-        
899
+
900
+          this.recordInfo.tableList = [];
901
+          this.recordInfo.tableList = orderInfo;
772 902
         }
773
-      })  
903
+      });
774 904
     },
775 905
     toPrint() {
776 906
       var id = this.$route.query.id;
777 907
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
778 908
     },
779
-    saveGoodReturn(){
909
+    saveGoodReturn() {
780 910
       var warehouse_out_id = this.$route.query.id;
781
-      this.$refs["tableForm"].validate((valid)=>{
782
-        if(valid){
783
-          this.loading = true
784
-          for(let i=0;i<this.recordInfo.tableList.length;i++){
785
-            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
786
-            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
787
-            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
788
-       
789
-            for(let j=0;j<this.manufactuerList.length;j++){
790
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
791
-                  this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
792
-                }
793
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id){
794
-                  this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
795
-                }
911
+      this.$refs["tableForm"].validate((valid) => {
912
+        if (valid) {
913
+          this.loading = true;
914
+          for (let i = 0; i < this.recordInfo.tableList.length; i++) {
915
+            this.recordInfo.tableList[i].supply_count = parseInt(
916
+              this.recordInfo.tableList[i].supply_count
917
+            );
918
+            this.recordInfo.tableList[i].supply_price =
919
+              this.recordInfo.tableList[i].supply_price.toString();
920
+            this.recordInfo.tableList[i].supply_total =
921
+              this.recordInfo.tableList[i].supply_total.toString();
796 922
 
923
+            for (let j = 0; j < this.manufactuerList.length; j++) {
924
+              if (
925
+                this.recordInfo.tableList[i].supply_manufacturer ==
926
+                this.manufactuerList[j].manufacturer_name
927
+              ) {
928
+                this.recordInfo.tableList[i].manufacturer_id =
929
+                  this.manufactuerList[j].id;
930
+              }
931
+              if (
932
+                this.recordInfo.tableList[i].supply_manufacturer ==
933
+                this.manufactuerList[j].id
934
+              ) {
935
+                this.recordInfo.tableList[i].supply_manufacturer =
936
+                  this.manufactuerList[j].manufacturer_name;
937
+              }
797 938
             }
798 939
           }
799 940
           var params = {
@@ -801,7 +942,7 @@ export default {
801 942
             return_marke:this.return_remark,
802 943
           }
803 944
           console.log("start_time232233232",this.start_time)
804
-          
945
+
805 946
           saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
806 947
             if(response.data.state == 1){
807 948
                this.loading = false
@@ -842,26 +983,108 @@ export default {
842 983
                           orderInfo[i].unitList = [{id:1,name:""}]
843 984
                           orderInfo[i].unitList[0].name = this.drugList[j].max_unit
844 985
                         }
845
-                      
986
+
846 987
                       }
847
-                  }  
848
-                  } 
988
+                  }
989
+                  }
849 990
                 if(orderInfo[i].is_source == 2){
850 991
                   for(let j=0;j<this.goodList.length;j++){
851 992
                       if(orderInfo[i].project_id == this.goodList[j].id){
852 993
                           orderInfo[i].unitList = [{id:1,name:""}]
853 994
                           orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
854 995
                       }
855
-                  }  
856
-                } 
996
+                  }
997
+                }
998
+            stockIn: this.recordInfo.tableList,
999
+            return_marke: this.return_remark,
1000
+          };
1001
+          console.log("start_time232233232", this.start_time);
1002
+
1003
+          saveGoodReturnOrder(
1004
+            params,
1005
+            warehouse_out_id,
1006
+            this.start_time,
1007
+            this.rate_of_concession,
1008
+            this.discount_amount,
1009
+            this.arrearage,
1010
+            this.payment,
1011
+            this.supplier_name
1012
+          ).then((response) => {
1013
+            if (response.data.state == 1) {
1014
+              this.loading = false;
1015
+              this.showOne = false;
1016
+              this.showTwo = true;
1017
+              this.$message.success("保存成功!");
1018
+              var warehouseCancel = response.data.data.warehouseCancel;
1019
+              var out = response.data.data.cancelOrder;
1020
+              this.id = out.id;
1021
+              this.supplier_name = out.supplier_id;
1022
+              this.rate_of_concession = out.rate_of_concession;
1023
+              this.discount_amount = out.discount_amount;
1024
+              this.payment = out.payment;
1025
+              this.arrearage = out.arrearage;
1026
+              this.start_time = this.getTimes(out.document_date);
1027
+              var orderInfo = response.data.data.list;
1028
+              for (let i = 0; i < orderInfo.length; i++) {
1029
+                orderInfo[i].supply_count = orderInfo[i].count;
1030
+                orderInfo[i].supply_price = orderInfo[i].price;
1031
+                orderInfo[i].supply_remake = orderInfo[i].remark;
1032
+                orderInfo[i].type = orderInfo[i].is_source;
1033
+                orderInfo[i].project_id = orderInfo[i].project_id;
1034
+                orderInfo[i].supply_unit = orderInfo[i].supply_unit;
1035
+                orderInfo[i].order_number = orderInfo[i].order_number;
1036
+                orderInfo[i].good_number = orderInfo[i].good_number;
1037
+                orderInfo[i].supply_total_price = (
1038
+                  orderInfo[i].count * orderInfo[i].price
1039
+                ).toFixed(2);
1040
+                orderInfo[i].supply_expiry_date = this.getTimes(
1041
+                  orderInfo[i].supply_expiry_date
1042
+                );
1043
+                orderInfo[i].supply_product_date = this.getTimes(
1044
+                  orderInfo[i].supply_product_date
1045
+                );
1046
+                if (orderInfo[i].is_source == 1) {
1047
+                  for (let j = 0; j < this.drugList.length; j++) {
1048
+                    if (orderInfo[i].project_id == this.drugList[j].id) {
1049
+                      if (
1050
+                        this.drugList[j].max_unit != this.drugList[j].min_unit
1051
+                      ) {
1052
+                        orderInfo[i].unitList = [
1053
+                          { id: 1, name: "" },
1054
+                          { id: 2, name: "" },
1055
+                        ];
1056
+                        orderInfo[i].unitList[0].name =
1057
+                          this.drugList[j].max_unit;
1058
+                        orderInfo[i].unitList[1].name =
1059
+                          this.drugList[j].min_unit;
1060
+                      }
1061
+                      if (
1062
+                        this.drugList[j].max_unit == this.drugList[j].min_unit
1063
+                      ) {
1064
+                        orderInfo[i].unitList = [{ id: 1, name: "" }];
1065
+                        orderInfo[i].unitList[0].name =
1066
+                          this.drugList[j].max_unit;
1067
+                      }
1068
+                    }
1069
+                  }
1070
+                }
1071
+                if (orderInfo[i].is_source == 2) {
1072
+                  for (let j = 0; j < this.goodList.length; j++) {
1073
+                    if (orderInfo[i].project_id == this.goodList[j].id) {
1074
+                      orderInfo[i].unitList = [{ id: 1, name: "" }];
1075
+                      orderInfo[i].unitList[0].name =
1076
+                        this.goodList[j].packing_unit;
1077
+                    }
1078
+                  }
1079
+                }
857 1080
               }
858
-              this.recordInfo.tableList= []
859
-              this.recordInfo.tableList = orderInfo
1081
+              this.recordInfo.tableList = [];
1082
+              this.recordInfo.tableList = orderInfo;
860 1083
             }
861
-          })
1084
+          });
862 1085
         }
863
-      })
864
-    }
1086
+      });
1087
+    },
865 1088
   },
866 1089
   created() {
867 1090
     const tempObj = {};
@@ -886,11 +1109,11 @@ export default {
886 1109
     console.log("即哪里地方2",this.recordInfo.tableList)
887 1110
     this.getInitOrder();
888 1111
     if(parseInt(this.$route.query.id) > 0){
889
-     
1112
+
890 1113
      //获取购货单列表
891 1114
       this.getGoodOrderDetail();
892 1115
     }
893
- 
1116
+
894 1117
   },
895 1118
 };
896 1119
 </script>

+ 3 - 2
src/xt_pages/supply/components/addSupply.vue Ver arquivo

@@ -383,12 +383,13 @@ export default {
383 383
             this.$refs[formName].validate((valid) => {
384 384
               if (valid) {
385 385
                 let params = {
386
-                  ...this.supplier,
386
+                  // ...this.supplier,
387
+                  suppliername:this.supplier.supplierName,
387 388
                   // ...this.recordInfo
388 389
                 };
389 390
                 let data = { ...this.recordInfo };
390 391
                 console.log(params, "dhas");
391
-                updatesupply(data,params).then((res) => {
392
+                updatesupply(params).then((res) => {
392 393
                   console.log(res, "oo");
393 394
                 });
394 395
               } else {

+ 0 - 1
src/xt_pages/supply/components/editGoodOrder.vue Ver arquivo

@@ -778,7 +778,6 @@ export default {
778 778
           this.total_price
779 779
         ).toFixed(2);
780 780
       }
781
-      
782 781
       this.discount_amount = discount_amount;
783 782
     },
784 783
     count_discount() {

+ 22 - 8
src/xt_pages/supply/components/editPurchaseOrder.vue Ver arquivo

@@ -60,7 +60,7 @@
60 60
           ></el-date-picker>
61 61
           <span>单据编码:{{ number }}</span>
62 62
         </div>
63
-        <div>
63
+        <div style="display: flex;">
64 64
           <el-button size="small" type="primary" @click="toAdd" v-show="showOne"
65 65
             >生成采购单</el-button
66 66
           >
@@ -344,10 +344,26 @@
344 344
       </div>
345 345
     </div>
346 346
 
347
+    <!-- <el-dialog
348
+  title="系统提示"
349
+  :visible.sync="dialogVisible"
350
+  width="30%">
351
+  <span>
352
+    采购订单{{number}}已有以下关联数据,不能反审核
353
+    <div v-for="(item,index) in orderList" :key="index">
354
+        <li>采购单{{item.good_number}}</li> <a @click="toClick(item.id)">点击查看</a>
355
+    </div>
356
+  </span>
357
+  <span slot="footer" class="dialog-footer">
358
+    <el-button @click="dialogVisible = false">取 消</el-button>
359
+  </span>
360
+  </el-dialog> -->
361
+  <popup ref="Popup" :content="content" :content_1="content_1" :content_2="content_2" :number="number" :orderList ="orderList"></popup>
347 362
   </div>
348 363
 </template>
349 364
 
350 365
 <script>
366
+import popup from "./Popup"
351 367
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
352 368
 import { uParseTime } from "@/utils/tools";
353 369
 import {
@@ -363,9 +379,13 @@ export default {
363 379
   name: "addPurchaseOrder",
364 380
   components: {
365 381
     BreadCrumb,
382
+    popup
366 383
   },
367 384
   data() {
368 385
     return {
386
+      content_2:"购货单",
387
+      content:"购货订单",
388
+      content_1:"已有以下关联数据,不能反审核",
369 389
       Reviewed: false,
370 390
       crumbs: [
371 391
         { path: false, name: "采购订单" },
@@ -963,13 +983,7 @@ export default {
963 983
           this.orderList = list
964 984
           //如果长度大于0,有购货单不能反审核
965 985
           if (list.length > 0) {
966
-            this.$popup({
967
-              title: "系统提示",
968
-              content: this.number,
969
-              btnText: "关闭",
970
-              orderList: this.orderList,
971
-              click: () => {},
972
-            });
986
+            this.$refs.Popup.dialogVisible = true
973 987
           }
974 988
           if (list.length == 0) {
975 989
             this.getReturnOrder()