|
@@ -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 = {};
|