huangyw hace 3 años
padre
commit
53e23f2953

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

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

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

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

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

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

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

+ 280 - 169
src/xt_pages/supply/components/addGoodReturn.vue Ver fichero

@@ -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: "新增退货单" },
@@ -375,8 +420,8 @@ export default {
375 420
       supplier_name: "",
376 421
       supplyList: [],
377 422
       rate_of_concession: "",
378
-      arrearage:"",
379
-      payment:"",
423
+      arrearage: "",
424
+      payment: "",
380 425
       discount_amount: "",
381 426
       tableRules: {
382 427
         name: [{ required: true, message: "商品不能为空", trigger: "blur" }],
@@ -393,7 +438,7 @@ export default {
393 438
       disabled: false,
394 439
       is_check: 0,
395 440
       dialogVisible: false,
396
-      return_remark:"",
441
+      return_remark: "",
397 442
     };
398 443
   },
399 444
   methods: {
@@ -705,6 +750,31 @@ export default {
705 750
       this.total_price = total_price;
706 751
       return total_price.toFixed(2);
707 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
+
708 778
     checkPurchaseOrder(id, index) {
709 779
       this.$confirm("是否审核?", {
710 780
         confirmButtonText: "确 定",
@@ -723,159 +793,200 @@ export default {
723 793
         })
724 794
         .catch(() => {});
725 795
     },
726
-    getGoodOrderDetail(){
727
-      
728
-        var id = this.$route.query.id
729
-      getGoodOrderDetail(id).then(response=>{
730
-        if(response.data.state == 1){
731
-          var out = response.data.data.out
732
-          this.is_check = out.is_check
733
-          this.id = out.id
734
-          this.supplier_name = out.supplier_id
735
-          this.rate_of_concession = out.rate_of_concession
736
-          this.discount_amount = out.discount_amount
737
-          this.payment = out.payment
738
-          this.arrearage = out.arrearage
739
-          this.start_time = this.getTimes(out.document_date)
740
-          var orderInfo = response.data.data.list
741
-          console.log("orderINFO233232232332",orderInfo)
742
-          var drugList = response.data.data.drugList
743
-          var goodList = response.data.data.goodList
744
-          for(let i=0;i< orderInfo.length;i++){
745
-              
746
-              orderInfo[i].supply_count =  orderInfo[i].count
747
-              orderInfo[i].supply_price =  orderInfo[i].price
748
-              orderInfo[i].supply_remake =  orderInfo[i].remark
749
-              orderInfo[i].type =  orderInfo[i].is_source
750
-              orderInfo[i].project_id =  orderInfo[i].project_id
751
-              orderInfo[i].supply_unit =  orderInfo[i].supply_unit
752
-              orderInfo[i].order_number =  orderInfo[i].order_number
753
-              orderInfo[i].good_number = orderInfo[i].good_number
754
-              orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
755
-              orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
756
-              orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
757
-            if(orderInfo[i].is_source == 1){
758
-              for(let j=0;j<drugList.length;j++){
759
-                  if( orderInfo[i].project_id == drugList[j].id){
760
-                    if(drugList[j].max_unit!=drugList[j].min_unit){
761
-                      orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
762
-                      orderInfo[i].unitList[0].name = drugList[j].max_unit
763
-                      orderInfo[i].unitList[1].name = drugList[j].min_unit
764
-                    }
765
-                    if(drugList[j].max_unit ==drugList[j].min_unit){
766
-                      orderInfo[i].unitList = [{id:1,name:""}]
767
-                      orderInfo[i].unitList[0].name = drugList[j].max_unit
768
-                    }
769
-                  
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;
770 841
                   }
771
-              }  
772
-              } 
773
-            if(orderInfo[i].is_source == 2){
774
-              for(let j=0;j<goodList.length;j++){
775
-                  if(orderInfo[i].project_id == goodList[j].id){
776
-                      orderInfo[i].unitList = [{id:1,name:""}]
777
-                      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;
778 845
                   }
779
-              }  
780
-            } 
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
+            }
781 857
           }
782
-        
783
-          this.recordInfo.tableList= []
784
-          this.recordInfo.tableList = orderInfo
785
-        
858
+
859
+          this.recordInfo.tableList = [];
860
+          this.recordInfo.tableList = orderInfo;
786 861
         }
787
-      })  
862
+      });
788 863
     },
789 864
     toPrint() {
790 865
       var id = this.$route.query.id;
791 866
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
792 867
     },
793
-    saveGoodReturn(){
868
+    saveGoodReturn() {
794 869
       var warehouse_out_id = this.$route.query.id;
795
-      this.$refs["tableForm"].validate((valid)=>{
796
-        if(valid){
797
-          this.loading = true
798
-          for(let i=0;i<this.recordInfo.tableList.length;i++){
799
-            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
800
-            this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
801
-            this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
802
-       
803
-            for(let j=0;j<this.manufactuerList.length;j++){
804
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
805
-                  this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
806
-                }
807
-                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].id){
808
-                  this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
809
-                }
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();
810 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
+              }
811 897
             }
812 898
           }
813 899
           var params = {
814
-            "stockIn":this.recordInfo.tableList,
815
-            "return_marke":this.return_remark,
816
-          }
817
-          console.log("start_time232233232",this.start_time)
818
-          
819
-          saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
820
-            if(response.data.state == 1){
821
-               this.loading = false
822
-               this.showOne = false
823
-               this.showTwo = true
824
-               this.$message.success("保存成功!")
825
-               var warehouseCancel = response.data.data.warehouseCancel
826
-               var out = response.data.data.cancelOrder
827
-               this.id = out.id
828
-               this.supplier_name = out.supplier_id
829
-               this.rate_of_concession = out.rate_of_concession
830
-               this.discount_amount = out.discount_amount
831
-               this.payment = out.payment
832
-               this.arrearage = out.arrearage
833
-               this.start_time = this.getTimes(out.document_date)
834
-               var orderInfo = response.data.data.list
835
-               for(let i=0;i< orderInfo.length;i++){
836
-                orderInfo[i].supply_count =  orderInfo[i].count
837
-                orderInfo[i].supply_price =  orderInfo[i].price
838
-                orderInfo[i].supply_remake =  orderInfo[i].remark
839
-                orderInfo[i].type =  orderInfo[i].is_source
840
-                orderInfo[i].project_id =  orderInfo[i].project_id
841
-                orderInfo[i].supply_unit =  orderInfo[i].supply_unit
842
-                orderInfo[i].order_number =  orderInfo[i].order_number
843
-                orderInfo[i].good_number = orderInfo[i].good_number
844
-                orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
845
-                orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
846
-                orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
847
-                if(orderInfo[i].is_source == 1){
848
-                  for(let j=0;j<this.drugList.length;j++){
849
-                      if( orderInfo[i].project_id == this.drugList[j].id){
850
-                        if(this.drugList[j].max_unit!=this.drugList[j].min_unit){
851
-                          orderInfo[i].unitList = [{id:1,name:""},{id:2,name:""}]
852
-                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
853
-                          orderInfo[i].unitList[1].name = this.drugList[j].min_unit
854
-                        }
855
-                        if(this.drugList[j].max_unit ==this.drugList[j].min_unit){
856
-                          orderInfo[i].unitList = [{id:1,name:""}]
857
-                          orderInfo[i].unitList[0].name = this.drugList[j].max_unit
858
-                        }
859
-                      
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;
860 962
                       }
861
-                  }  
862
-                  } 
863
-                if(orderInfo[i].is_source == 2){
864
-                  for(let j=0;j<this.goodList.length;j++){
865
-                      if(orderInfo[i].project_id == this.goodList[j].id){
866
-                          orderInfo[i].unitList = [{id:1,name:""}]
867
-                          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;
868 969
                       }
869
-                  }  
870
-                } 
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
+                }
871 982
               }
872
-              this.recordInfo.tableList= []
873
-              this.recordInfo.tableList = orderInfo
983
+              this.recordInfo.tableList = [];
984
+              this.recordInfo.tableList = orderInfo;
874 985
             }
875
-          })
986
+          });
876 987
         }
877
-      })
878
-    }
988
+      });
989
+    },
879 990
   },
880 991
   created() {
881 992
     const tempObj = {};

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

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

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

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

@@ -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
           >
@@ -358,10 +358,12 @@
358 358
     <el-button @click="dialogVisible = false">取 消</el-button>
359 359
   </span>
360 360
   </el-dialog> -->
361
+  <popup ref="Popup" :content="content" :content_1="content_1" :content_2="content_2" :number="number" :orderList ="orderList"></popup>
361 362
   </div>
362 363
 </template>
363 364
 
364 365
 <script>
366
+import popup from "./Popup"
365 367
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
366 368
 import { uParseTime } from "@/utils/tools";
367 369
 import {
@@ -377,9 +379,13 @@ export default {
377 379
   name: "addPurchaseOrder",
378 380
   components: {
379 381
     BreadCrumb,
382
+    popup
380 383
   },
381 384
   data() {
382 385
     return {
386
+      content_2:"购货单",
387
+      content:"购货订单",
388
+      content_1:"已有以下关联数据,不能反审核",
383 389
       Reviewed: false,
384 390
       crumbs: [
385 391
         { path: false, name: "采购订单" },
@@ -1001,13 +1007,7 @@ export default {
1001 1007
           this.orderList = list
1002 1008
           //如果长度大于0,有购货单不能反审核
1003 1009
           if (list.length > 0) {
1004
-            this.$popup({
1005
-              title: "系统提示",
1006
-              content: this.number,
1007
-              btnText: "关闭",
1008
-              orderList: this.orderList,
1009
-              click: () => {},
1010
-            });
1010
+            this.$refs.Popup.dialogVisible = true
1011 1011
           }
1012 1012
           if (list.length == 0) {
1013 1013
             this.getReturnOrder()