Browse Source

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

XMLWAN 3 years ago
parent
commit
214b1ee7bf

+ 3 - 2
src/api/supply.js View File

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

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

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

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

29
           </p>
29
           </p>
30
           <div v-for="(item, index) in orderList" :key="index">
30
           <div v-for="(item, index) in orderList" :key="index">
31
             <li>
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
             </li>
34
             </li>
35
           </div>
35
           </div>
36
         </div>
36
         </div>
44
 </template>
44
 </template>
45
 
45
 
46
 <script>
46
 <script>
47
+import Vue from "vue";
48
+import router from "vue-router";
49
+Vue.use(router);
47
 export default {
50
 export default {
48
   name: "Popup",
51
   name: "Popup",
49
   data() {
52
   data() {
54
       content: "",
57
       content: "",
55
       btnText: "关闭",
58
       btnText: "关闭",
56
       orderList: [],
59
       orderList: [],
60
+      id: 0,
57
     };
61
     };
58
   },
62
   },
59
   created() {},
63
   created() {},
60
   methods: {
64
   methods: {
61
     btnClick() {
65
     btnClick() {
62
-      this.click();
66
+      this.click1();
63
       this.show = false;
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 View File

33
 import 'default-passive-events'
33
 import 'default-passive-events'
34
 Vue.prototype.voicePrompt = voicePromptFun.voicePrompt  //语音提醒
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
 import Computed from "../src/xt_pages/components/Computed/index"  //自动计算金额控件
40
 import Computed from "../src/xt_pages/components/Computed/index"  //自动计算金额控件
40
 Vue.component("Computed",Computed)
41
 Vue.component("Computed",Computed)

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

27
       meta: { title: 'addSupply', noCache: true },
27
       meta: { title: 'addSupply', noCache: true },
28
       isChild: true
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
       path: '/supply/edit',
40
       path: '/supply/edit',
32
       component: () => import('@/xt_pages/supply/components/editSupply'),
41
       component: () => import('@/xt_pages/supply/components/editSupply'),

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

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 View File

59
           <span>单据编码:{{ number }}</span>
59
           <span>单据编码:{{ number }}</span>
60
         </div>
60
         </div>
61
         <div>
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
           <el-button size="small" type="primary" @click="updatePurchaseOrder"
76
           <el-button size="small" type="primary" @click="updatePurchaseOrder"
65
             >审核</el-button
77
             >审核</el-button
66
           >
78
           >
74
         <el-table
86
         <el-table
75
           :row-style="{ color: '#303133' }"
87
           :row-style="{ color: '#303133' }"
76
           :header-cell-style="{
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
           :data="recordInfo.tableList"
92
           :data="recordInfo.tableList"
81
           :class="signAndWeighBoxPatients"
93
           :class="signAndWeighBoxPatients"
131
                 v-model="scope.row.supply_specification_name"
143
                 v-model="scope.row.supply_specification_name"
132
                 style="width: 150px"
144
                 style="width: 150px"
133
                 :disabled="true"
145
                 :disabled="true"
134
-                 placeholder="规格&单位"
146
+                placeholder="规格&单位"
135
               ></el-input>
147
               ></el-input>
136
             </template>
148
             </template>
137
           </el-table-column>
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
             <template slot="header" slot-scope="scope">
152
             <template slot="header" slot-scope="scope">
141
-                <span>单位<span style="color: red">*</span></span>
153
+              <span>单位<span style="color: red">*</span></span>
142
             </template>
154
             </template>
143
             <template slot-scope="scope">
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
                             v-for="(item,index) in scope.row.unitList"
168
                             v-for="(item,index) in scope.row.unitList"
148
                             :key="index"
169
                             :key="index"
149
                             :label="item.name"
170
                             :label="item.name"
150
                             :value="item.name">
171
                             :value="item.name">
151
                         </el-option> -->
172
                         </el-option> -->
152
                 </el-select>
173
                 </el-select>
153
-              </el-form-item>  
174
+              </el-form-item>
154
             </template>
175
             </template>
155
           </el-table-column>
176
           </el-table-column>
156
           <el-table-column label="可用库存" align="center" width="130px">
177
           <el-table-column label="可用库存" align="center" width="130px">
196
                 v-model="scope.row.supply_price"
217
                 v-model="scope.row.supply_price"
197
                 style="width: 140px"
218
                 style="width: 140px"
198
                 :disabled="disabled"
219
                 :disabled="disabled"
199
-                 placeholder="请输入采购单价"
220
+                placeholder="请输入采购单价"
200
               ></el-input>
221
               ></el-input>
201
             </template>
222
             </template>
202
           </el-table-column>
223
           </el-table-column>
259
             </template>
280
             </template>
260
           </el-table-column>
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
             <template slot-scope="scope">
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
               </el-tooltip>
317
               </el-tooltip>
280
             </template>
318
             </template>
281
-         </el-table-column>
319
+          </el-table-column>
282
         </el-table>
320
         </el-table>
283
       </el-form>
321
       </el-form>
284
       <div style="margin-top: 10px">
322
       <div style="margin-top: 10px">
296
           >优惠率:<el-input
334
           >优惠率:<el-input
297
             style="width: 100px"
335
             style="width: 100px"
298
             v-model="rate_of_concession"
336
             v-model="rate_of_concession"
337
+            @input="addressChange"
338
+            placeholder="请输入优惠率"
299
           ></el-input
339
           ></el-input
300
           >%</span
340
           >%</span
301
         >
341
         >
304
           >优惠金额:<el-input
344
           >优惠金额:<el-input
305
             style="width: 100px"
345
             style="width: 100px"
306
             v-model="discount_amount"
346
             v-model="discount_amount"
347
+            @input="count_discount"
348
+            placeholder="请输入优惠金额"
307
           ></el-input
349
           ></el-input
308
         ></span>
350
         ></span>
309
 
351
 
311
           >本次付款:<el-input
353
           >本次付款:<el-input
312
             style="width: 100px"
354
             style="width: 100px"
313
             v-model="payment"
355
             v-model="payment"
356
+            @input="count_payment"
357
+            placeholder="请输入本次付款"
314
           ></el-input
358
           ></el-input
315
         ></span>
359
         ></span>
316
 
360
 
318
           >本次欠款:<el-input
362
           >本次欠款:<el-input
319
             style="width: 100px"
363
             style="width: 100px"
320
             v-model="arrearage"
364
             v-model="arrearage"
365
+            @input="count_arrearage"
366
+            placeholder="请输入本次欠款"
321
           ></el-input
367
           ></el-input
322
         ></span>
368
         ></span>
323
       </div>
369
       </div>
324
     </div>
370
     </div>
325
-
326
   </div>
371
   </div>
327
 </template>
372
 </template>
328
 
373
 
332
 import {
377
 import {
333
   getInitOrder,
378
   getInitOrder,
334
   getGoodOrderDetail,
379
   getGoodOrderDetail,
335
-  saveGoodReturnOrder
380
+  saveGoodReturnOrder,
336
 } from "@/api/supply";
381
 } from "@/api/supply";
337
 export default {
382
 export default {
338
   name: "addPurchaseOrder",
383
   name: "addPurchaseOrder",
341
   },
386
   },
342
   data() {
387
   data() {
343
     return {
388
     return {
344
-      tipsInfo:"",
389
+      tipsInfo: "",
345
       crumbs: [
390
       crumbs: [
346
         { path: false, name: "购货单" },
391
         { path: false, name: "购货单" },
347
         { path: "/good/return/add", name: "新增退货单" },
392
         { path: "/good/return/add", name: "新增退货单" },
373
       supplier_name: "",
418
       supplier_name: "",
374
       supplyList: [],
419
       supplyList: [],
375
       rate_of_concession: "",
420
       rate_of_concession: "",
376
-      arrearage:"",
377
-      payment:"",
421
+      arrearage: "",
422
+      payment: "",
378
       discount_amount: "",
423
       discount_amount: "",
379
       tableRules: {
424
       tableRules: {
380
         name: [{ required: true, message: "商品不能为空", trigger: "blur" }],
425
         name: [{ required: true, message: "商品不能为空", trigger: "blur" }],
391
       disabled: false,
436
       disabled: false,
392
       is_check: 0,
437
       is_check: 0,
393
       dialogVisible: false,
438
       dialogVisible: false,
394
-      return_remark:"",
439
+      return_remark: "",
395
     };
440
     };
396
   },
441
   },
397
   methods: {
442
   methods: {
690
       this.total_price = total_price;
735
       this.total_price = total_price;
691
       return total_price.toFixed(2);
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
     checkPurchaseOrder(id, index) {
763
     checkPurchaseOrder(id, index) {
694
       this.$confirm("是否审核?", {
764
       this.$confirm("是否审核?", {
695
         confirmButtonText: "确 定",
765
         confirmButtonText: "确 定",
709
         .catch(() => {});
779
         .catch(() => {});
710
     },
780
     },
711
     getGoodOrderDetail(){
781
     getGoodOrderDetail(){
712
-      
782
+
713
         var id = this.$route.query.id
783
         var id = this.$route.query.id
714
         var ids = this.$route.query.ids
784
         var ids = this.$route.query.ids
715
       getGoodOrderDetail(id,ids).then(response=>{
785
       getGoodOrderDetail(id,ids).then(response=>{
728
           var drugList = response.data.data.drugList
798
           var drugList = response.data.data.drugList
729
           var goodList = response.data.data.goodList
799
           var goodList = response.data.data.goodList
730
           for(let i=0;i< orderInfo.length;i++){
800
           for(let i=0;i< orderInfo.length;i++){
731
-              
801
+
732
               orderInfo[i].supply_count =  orderInfo[i].count
802
               orderInfo[i].supply_count =  orderInfo[i].count
733
               orderInfo[i].supply_price =  orderInfo[i].price
803
               orderInfo[i].supply_price =  orderInfo[i].price
734
               orderInfo[i].supply_remake =  orderInfo[i].remark
804
               orderInfo[i].supply_remake =  orderInfo[i].remark
752
                       orderInfo[i].unitList = [{id:1,name:""}]
822
                       orderInfo[i].unitList = [{id:1,name:""}]
753
                       orderInfo[i].unitList[0].name = drugList[j].max_unit
823
                       orderInfo[i].unitList[0].name = drugList[j].max_unit
754
                     }
824
                     }
755
-                  
825
+
756
                   }
826
                   }
757
-              }  
758
-              } 
827
+              }
828
+              }
759
             if(orderInfo[i].is_source == 2){
829
             if(orderInfo[i].is_source == 2){
760
               for(let j=0;j<goodList.length;j++){
830
               for(let j=0;j<goodList.length;j++){
761
                   if(orderInfo[i].project_id == goodList[j].id){
831
                   if(orderInfo[i].project_id == goodList[j].id){
762
                       orderInfo[i].unitList = [{id:1,name:""}]
832
                       orderInfo[i].unitList = [{id:1,name:""}]
763
                       orderInfo[i].unitList[0].name = goodList[j].packing_unit
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
     toPrint() {
905
     toPrint() {
776
       var id = this.$route.query.id;
906
       var id = this.$route.query.id;
777
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
907
       this.$router.push({ path: "/purchase/order/print?&id=" + id });
778
     },
908
     },
779
-    saveGoodReturn(){
909
+    saveGoodReturn() {
780
       var warehouse_out_id = this.$route.query.id;
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
           var params = {
940
           var params = {
801
             return_marke:this.return_remark,
942
             return_marke:this.return_remark,
802
           }
943
           }
803
           console.log("start_time232233232",this.start_time)
944
           console.log("start_time232233232",this.start_time)
804
-          
945
+
805
           saveGoodReturnOrder(params,warehouse_out_id,this.start_time,this.rate_of_concession,this.discount_amount,this.arrearage,this.payment,this.supplier_name).then(response=>{
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
             if(response.data.state == 1){
947
             if(response.data.state == 1){
807
                this.loading = false
948
                this.loading = false
842
                           orderInfo[i].unitList = [{id:1,name:""}]
983
                           orderInfo[i].unitList = [{id:1,name:""}]
843
                           orderInfo[i].unitList[0].name = this.drugList[j].max_unit
984
                           orderInfo[i].unitList[0].name = this.drugList[j].max_unit
844
                         }
985
                         }
845
-                      
986
+
846
                       }
987
                       }
847
-                  }  
848
-                  } 
988
+                  }
989
+                  }
849
                 if(orderInfo[i].is_source == 2){
990
                 if(orderInfo[i].is_source == 2){
850
                   for(let j=0;j<this.goodList.length;j++){
991
                   for(let j=0;j<this.goodList.length;j++){
851
                       if(orderInfo[i].project_id == this.goodList[j].id){
992
                       if(orderInfo[i].project_id == this.goodList[j].id){
852
                           orderInfo[i].unitList = [{id:1,name:""}]
993
                           orderInfo[i].unitList = [{id:1,name:""}]
853
                           orderInfo[i].unitList[0].name = this.goodList[j].packing_unit
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
   created() {
1089
   created() {
867
     const tempObj = {};
1090
     const tempObj = {};
886
     console.log("即哪里地方2",this.recordInfo.tableList)
1109
     console.log("即哪里地方2",this.recordInfo.tableList)
887
     this.getInitOrder();
1110
     this.getInitOrder();
888
     if(parseInt(this.$route.query.id) > 0){
1111
     if(parseInt(this.$route.query.id) > 0){
889
-     
1112
+
890
      //获取购货单列表
1113
      //获取购货单列表
891
       this.getGoodOrderDetail();
1114
       this.getGoodOrderDetail();
892
     }
1115
     }
893
- 
1116
+
894
   },
1117
   },
895
 };
1118
 };
896
 </script>
1119
 </script>

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

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

+ 0 - 1
src/xt_pages/supply/components/editGoodOrder.vue View File

778
           this.total_price
778
           this.total_price
779
         ).toFixed(2);
779
         ).toFixed(2);
780
       }
780
       }
781
-      
782
       this.discount_amount = discount_amount;
781
       this.discount_amount = discount_amount;
783
     },
782
     },
784
     count_discount() {
783
     count_discount() {

+ 22 - 8
src/xt_pages/supply/components/editPurchaseOrder.vue View File

60
           ></el-date-picker>
60
           ></el-date-picker>
61
           <span>单据编码:{{ number }}</span>
61
           <span>单据编码:{{ number }}</span>
62
         </div>
62
         </div>
63
-        <div>
63
+        <div style="display: flex;">
64
           <el-button size="small" type="primary" @click="toAdd" v-show="showOne"
64
           <el-button size="small" type="primary" @click="toAdd" v-show="showOne"
65
             >生成采购单</el-button
65
             >生成采购单</el-button
66
           >
66
           >
344
       </div>
344
       </div>
345
     </div>
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
   </div>
362
   </div>
348
 </template>
363
 </template>
349
 
364
 
350
 <script>
365
 <script>
366
+import popup from "./Popup"
351
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
367
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
352
 import { uParseTime } from "@/utils/tools";
368
 import { uParseTime } from "@/utils/tools";
353
 import {
369
 import {
363
   name: "addPurchaseOrder",
379
   name: "addPurchaseOrder",
364
   components: {
380
   components: {
365
     BreadCrumb,
381
     BreadCrumb,
382
+    popup
366
   },
383
   },
367
   data() {
384
   data() {
368
     return {
385
     return {
386
+      content_2:"购货单",
387
+      content:"购货订单",
388
+      content_1:"已有以下关联数据,不能反审核",
369
       Reviewed: false,
389
       Reviewed: false,
370
       crumbs: [
390
       crumbs: [
371
         { path: false, name: "采购订单" },
391
         { path: false, name: "采购订单" },
963
           this.orderList = list
983
           this.orderList = list
964
           //如果长度大于0,有购货单不能反审核
984
           //如果长度大于0,有购货单不能反审核
965
           if (list.length > 0) {
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
           if (list.length == 0) {
988
           if (list.length == 0) {
975
             this.getReturnOrder()
989
             this.getReturnOrder()