|
@@ -62,6 +62,12 @@
|
62
|
62
|
<el-button size="small" type="primary" @click="updateGoodReturn">保存</el-button>
|
63
|
63
|
<el-button size="small" type="primary" @click="checkReturnOrder" v-if="is_check == 2">审核</el-button>
|
64
|
64
|
<el-button size="small" type="primary" @click="modefyReturnOrder" v-if="is_check == 1">反审核</el-button>
|
|
65
|
+ <el-button size="small" type="primary" @click="updateGoodReturn"
|
|
66
|
+ >保存</el-button
|
|
67
|
+ >
|
|
68
|
+ <el-button size="small" type="primary" @click="checkReturnOrder"
|
|
69
|
+ >审核</el-button
|
|
70
|
+ >
|
65
|
71
|
</div>
|
66
|
72
|
</div>
|
67
|
73
|
|
|
@@ -69,8 +75,8 @@
|
69
|
75
|
<el-table
|
70
|
76
|
:row-style="{ color: '#303133' }"
|
71
|
77
|
:header-cell-style="{
|
72
|
|
- backgroundColor: 'rgb(245, 247, 250)',
|
73
|
|
- color: '#606266'
|
|
78
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
79
|
+ color: '#606266',
|
74
|
80
|
}"
|
75
|
81
|
:data="recordInfo.tableList"
|
76
|
82
|
:class="signAndWeighBoxPatients"
|
|
@@ -131,21 +137,30 @@
|
131
|
137
|
</template>
|
132
|
138
|
</el-table-column>
|
133
|
139
|
|
134
|
|
- <el-table-column label="单位" align="center" width="120px">
|
|
140
|
+ <el-table-column label="单位" align="center" width="120px">
|
135
|
141
|
<template slot="header" slot-scope="scope">
|
136
|
|
- <span>单位<span style="color: red">*</span></span>
|
|
142
|
+ <span>单位<span style="color: red">*</span></span>
|
137
|
143
|
</template>
|
138
|
144
|
<template slot-scope="scope">
|
139
|
|
- <el-form-item :prop="'tableList.' + scope.$index + '.supply_unit'" :rules='tableRules.supply_unit'>
|
140
|
|
- <el-select v-model="scope.row.supply_unit" style="width:100px;" filterable placeholder="请选择" :disabled="disabled">
|
141
|
|
- <!-- <el-option
|
|
145
|
+ <el-form-item
|
|
146
|
+ :prop="'tableList.' + scope.$index + '.supply_unit'"
|
|
147
|
+ :rules="tableRules.supply_unit"
|
|
148
|
+ >
|
|
149
|
+ <el-select
|
|
150
|
+ v-model="scope.row.supply_unit"
|
|
151
|
+ style="width: 100px"
|
|
152
|
+ filterable
|
|
153
|
+ placeholder="请选择"
|
|
154
|
+ :disabled="disabled"
|
|
155
|
+ >
|
|
156
|
+ <!-- <el-option
|
142
|
157
|
v-for="(item,index) in scope.row.unitList"
|
143
|
158
|
:key="index"
|
144
|
159
|
:label="item.name"
|
145
|
160
|
:value="item.name">
|
146
|
161
|
</el-option> -->
|
147
|
162
|
</el-select>
|
148
|
|
- </el-form-item>
|
|
163
|
+ </el-form-item>
|
149
|
164
|
</template>
|
150
|
165
|
</el-table-column>
|
151
|
166
|
<el-table-column label="可用库存" align="center" width="130px">
|
|
@@ -254,26 +269,43 @@
|
254
|
269
|
</template>
|
255
|
270
|
</el-table-column>
|
256
|
271
|
|
257
|
|
- <el-table-column label="操作" align="center" width="150px" fixed="right">
|
|
272
|
+ <el-table-column
|
|
273
|
+ label="操作"
|
|
274
|
+ align="center"
|
|
275
|
+ width="150px"
|
|
276
|
+ fixed="right"
|
|
277
|
+ >
|
258
|
278
|
<template slot-scope="scope">
|
259
|
|
- <el-tooltip class="item" effect="dark" content="新增" placement="top" >
|
260
|
|
- <el-button
|
261
|
|
- size="mini"
|
262
|
|
- type="primary"
|
263
|
|
- icon="el-icon-circle-plus-outline"
|
264
|
|
- @click="handleEdit(scope.$index, scope.row)">
|
265
|
|
- </el-button>
|
266
|
|
- </el-tooltip>
|
267
|
|
- <el-tooltip class="item" effect="dark" content="删除" placement="top">
|
268
|
|
- <el-button
|
269
|
|
- size="mini"
|
270
|
|
- type="danger"
|
271
|
|
- icon="el-icon-delete"
|
272
|
|
- @click="handleDelete(scope.$index, scope.row)">
|
273
|
|
- </el-button>
|
|
279
|
+ <el-tooltip
|
|
280
|
+ class="item"
|
|
281
|
+ effect="dark"
|
|
282
|
+ content="新增"
|
|
283
|
+ placement="top"
|
|
284
|
+ >
|
|
285
|
+ <el-button
|
|
286
|
+ size="mini"
|
|
287
|
+ type="primary"
|
|
288
|
+ icon="el-icon-circle-plus-outline"
|
|
289
|
+ @click="handleEdit(scope.$index, scope.row)"
|
|
290
|
+ >
|
|
291
|
+ </el-button>
|
|
292
|
+ </el-tooltip>
|
|
293
|
+ <el-tooltip
|
|
294
|
+ class="item"
|
|
295
|
+ effect="dark"
|
|
296
|
+ content="删除"
|
|
297
|
+ placement="top"
|
|
298
|
+ >
|
|
299
|
+ <el-button
|
|
300
|
+ size="mini"
|
|
301
|
+ type="danger"
|
|
302
|
+ icon="el-icon-delete"
|
|
303
|
+ @click="handleDelete(scope.$index, scope.row)"
|
|
304
|
+ >
|
|
305
|
+ </el-button>
|
274
|
306
|
</el-tooltip>
|
275
|
307
|
</template>
|
276
|
|
- </el-table-column>
|
|
308
|
+ </el-table-column>
|
277
|
309
|
</el-table>
|
278
|
310
|
</el-form>
|
279
|
311
|
<div style="margin-top: 10px">
|
|
@@ -285,11 +317,14 @@
|
285
|
317
|
>
|
286
|
318
|
</el-input>
|
287
|
319
|
</div>
|
|
320
|
+ <div style="margin-top: 10px">合计:{{ getAllPrice() }} 元</div>
|
288
|
321
|
<div style="margin-top: 10px">
|
289
|
322
|
<span
|
290
|
323
|
>优惠率:<el-input
|
291
|
324
|
style="width: 100px"
|
292
|
325
|
v-model="rate_of_concession"
|
|
326
|
+ @input="addressChange"
|
|
327
|
+ placeholder="请输入优惠率"
|
293
|
328
|
></el-input
|
294
|
329
|
>%</span
|
295
|
330
|
>
|
|
@@ -298,6 +333,8 @@
|
298
|
333
|
>优惠金额:<el-input
|
299
|
334
|
style="width: 100px"
|
300
|
335
|
v-model="discount_amount"
|
|
336
|
+ @input="count_discount"
|
|
337
|
+ placeholder="请输入优惠金额"
|
301
|
338
|
></el-input
|
302
|
339
|
></span>
|
303
|
340
|
|
|
@@ -305,6 +342,8 @@
|
305
|
342
|
>本次付款:<el-input
|
306
|
343
|
style="width: 100px"
|
307
|
344
|
v-model="payment"
|
|
345
|
+ @input="count_payment"
|
|
346
|
+ placeholder="请输入本次付款"
|
308
|
347
|
></el-input
|
309
|
348
|
></span>
|
310
|
349
|
|
|
@@ -312,6 +351,8 @@
|
312
|
351
|
>本次欠款:<el-input
|
313
|
352
|
style="width: 100px"
|
314
|
353
|
v-model="arrearage"
|
|
354
|
+ @input="count_arrearage"
|
|
355
|
+ placeholder="请输入本次欠款"
|
315
|
356
|
></el-input
|
316
|
357
|
></span>
|
317
|
358
|
</div>
|
|
@@ -349,7 +390,7 @@ export default {
|
349
|
390
|
},
|
350
|
391
|
data() {
|
351
|
392
|
return {
|
352
|
|
- tipsInfo:"",
|
|
393
|
+ tipsInfo: "",
|
353
|
394
|
crumbs: [
|
354
|
395
|
{ path: false, name: "退货单" },
|
355
|
396
|
{ path: "/good/return/add", name: "新增退货单" },
|
|
@@ -383,8 +424,8 @@ export default {
|
383
|
424
|
supplier_name: "",
|
384
|
425
|
supplyList: [],
|
385
|
426
|
rate_of_concession: "",
|
386
|
|
- arrearage:"",
|
387
|
|
- payment:"",
|
|
427
|
+ arrearage: "",
|
|
428
|
+ payment: "",
|
388
|
429
|
discount_amount: "",
|
389
|
430
|
tableRules: {
|
390
|
431
|
name: [{ required: true, message: "商品不能为空", trigger: "blur" }],
|
|
@@ -401,8 +442,8 @@ export default {
|
401
|
442
|
disabled: false,
|
402
|
443
|
is_check: 0,
|
403
|
444
|
dialogVisible: false,
|
404
|
|
- return_remark:"",
|
405
|
|
- warehouse_out_id:0,
|
|
445
|
+ return_remark: "",
|
|
446
|
+ warehouse_out_id: 0,
|
406
|
447
|
};
|
407
|
448
|
},
|
408
|
449
|
methods: {
|
|
@@ -587,6 +628,7 @@ export default {
|
587
|
628
|
tempObj["warehousing_id"] =0
|
588
|
629
|
tempObj["warehouse_info_id"] =0
|
589
|
630
|
tempObj["count"] = ""
|
|
631
|
+
|
590
|
632
|
this.recordInfo.tableList.push(tempObj);
|
591
|
633
|
},
|
592
|
634
|
handleDelete: function (index, row) {
|
|
@@ -618,9 +660,9 @@ export default {
|
618
|
660
|
}
|
619
|
661
|
})
|
620
|
662
|
}).catch(() => {
|
621
|
|
- })
|
|
663
|
+ })
|
622
|
664
|
}
|
623
|
|
-
|
|
665
|
+
|
624
|
666
|
},
|
625
|
667
|
getWarehoseInfo(arr, max_unit, min_unit, min_number) {
|
626
|
668
|
var total = 0;
|
|
@@ -736,10 +778,113 @@ export default {
|
736
|
778
|
this.recordInfo.tableList[i].supply_price *
|
737
|
779
|
this.recordInfo.tableList[i].supply_count;
|
738
|
780
|
}
|
|
781
|
+ this.total_price = total_price;
|
739
|
782
|
return total_price.toFixed(2);
|
740
|
783
|
},
|
|
784
|
+
|
|
785
|
+ addressChange() {
|
|
786
|
+ var discount_amount = 0;
|
|
787
|
+ if (this.rate_of_concession > 0) {
|
|
788
|
+ discount_amount = (
|
|
789
|
+ (this.rate_of_concession / 100) *
|
|
790
|
+ this.total_price
|
|
791
|
+ ).toFixed(2);
|
|
792
|
+ }
|
|
793
|
+ this.discount_amount = discount_amount;
|
|
794
|
+ },
|
|
795
|
+ count_discount() {
|
|
796
|
+ this.rate_of_concession = (
|
|
797
|
+ this.discount_amount /
|
|
798
|
+ (this.total_price * 0.01)
|
|
799
|
+ ).toFixed(2);
|
|
800
|
+ },
|
|
801
|
+ count_payment() {
|
|
802
|
+ this.arrearage = this.total_price - this.payment;
|
|
803
|
+ },
|
|
804
|
+
|
|
805
|
+ count_arrearage() {
|
|
806
|
+ this.payment = this.total_price - this.arrearage;
|
|
807
|
+ },
|
|
808
|
+
|
|
809
|
+ checkPurchaseOrder(id, index) {
|
|
810
|
+ this.$confirm("是否审核?", {
|
|
811
|
+ confirmButtonText: "确 定",
|
|
812
|
+ cancelButtonText: "取 消",
|
|
813
|
+ type: "warning",
|
|
814
|
+ })
|
|
815
|
+ .then(() => {
|
|
816
|
+ checkPurchaseOrder(this.id).then((response) => {
|
|
817
|
+ if (response.data.state == 1) {
|
|
818
|
+ var info = response.data.data.info;
|
|
819
|
+ this.disabled = true;
|
|
820
|
+ this.$message.success("审核成功!");
|
|
821
|
+ this.getPurchaseOrderDetail();
|
|
822
|
+ }
|
|
823
|
+ });
|
|
824
|
+ })
|
|
825
|
+ .catch(() => {});
|
|
826
|
+ },
|
|
827
|
+ getGoodReturnDetail() {
|
|
828
|
+ var id = this.$route.query.id;
|
|
829
|
+ getGoodReturnDetail(id).then((response) => {
|
|
830
|
+ if (response.data.state == 1) {
|
|
831
|
+ var out = response.data.data.cancelDetail;
|
|
832
|
+ console.log("out23322323232323", out);
|
|
833
|
+ this.warehouse_out_id = out.warehouse_out_id;
|
|
834
|
+ this.is_check = out.is_check;
|
|
835
|
+ this.id = out.id;
|
|
836
|
+ this.supplier_name = out.supplier_id;
|
|
837
|
+ this.rate_of_concession = out.rate_of_concession;
|
|
838
|
+ this.discount_amount = out.discount_amount;
|
|
839
|
+ this.payment = out.payment;
|
|
840
|
+ this.arrearage = out.arrearage;
|
|
841
|
+ this.start_time = this.getTimes(out.document_date);
|
|
842
|
+ var orderInfo = response.data.data.orderCancelDetail;
|
|
843
|
+ console.log("orderINFO233232232332", orderInfo);
|
|
844
|
+ var drugList = response.data.data.drugList;
|
|
845
|
+ var goodList = response.data.data.goodList;
|
|
846
|
+ for (let i = 0; i < orderInfo.length; i++) {
|
|
847
|
+ orderInfo[i].supply_count = orderInfo[i].count;
|
|
848
|
+ orderInfo[i].supply_price = orderInfo[i].price;
|
|
849
|
+ orderInfo[i].supply_remake = orderInfo[i].remark;
|
|
850
|
+ orderInfo[i].type = orderInfo[i].is_source;
|
|
851
|
+ orderInfo[i].project_id = orderInfo[i].project_id;
|
|
852
|
+ orderInfo[i].supply_unit = orderInfo[i].supply_unit;
|
|
853
|
+ orderInfo[i].order_number = orderInfo[i].order_number;
|
|
854
|
+ orderInfo[i].good_number = orderInfo[i].good_number;
|
|
855
|
+ orderInfo[i].supply_total_price = (
|
|
856
|
+ orderInfo[i].count * orderInfo[i].price
|
|
857
|
+ ).toFixed(2);
|
|
858
|
+ orderInfo[i].supply_expiry_date = orderInfo[i].supply_expiry_date;
|
|
859
|
+ orderInfo[i].supply_product_date = orderInfo[i].supply_product_date;
|
|
860
|
+ if (orderInfo[i].is_source == 1) {
|
|
861
|
+ for (let j = 0; j < drugList.length; j++) {
|
|
862
|
+ if (orderInfo[i].project_id == drugList[j].id) {
|
|
863
|
+ if (drugList[j].max_unit != drugList[j].min_unit) {
|
|
864
|
+ orderInfo[i].unitList = [
|
|
865
|
+ { id: 1, name: "" },
|
|
866
|
+ { id: 2, name: "" },
|
|
867
|
+ ];
|
|
868
|
+ orderInfo[i].unitList[0].name = drugList[j].max_unit;
|
|
869
|
+ orderInfo[i].unitList[1].name = drugList[j].min_unit;
|
|
870
|
+ }
|
|
871
|
+ if (drugList[j].max_unit == drugList[j].min_unit) {
|
|
872
|
+ orderInfo[i].unitList = [{ id: 1, name: "" }];
|
|
873
|
+ orderInfo[i].unitList[0].name = drugList[j].max_unit;
|
|
874
|
+ }
|
|
875
|
+ }
|
|
876
|
+ }
|
|
877
|
+ }
|
|
878
|
+ if (orderInfo[i].is_source == 2) {
|
|
879
|
+ for (let j = 0; j < goodList.length; j++) {
|
|
880
|
+ if (orderInfo[i].project_id == goodList[j].id) {
|
|
881
|
+ orderInfo[i].unitList = [{ id: 1, name: "" }];
|
|
882
|
+ orderInfo[i].unitList[0].name = goodList[j].packing_unit;
|
|
883
|
+ }
|
|
884
|
+ }
|
|
885
|
+ }
|
741
|
886
|
getGoodReturnDetail(){
|
742
|
|
-
|
|
887
|
+
|
743
|
888
|
var id = this.$route.query.id
|
744
|
889
|
getGoodReturnDetail(id).then(response=>{
|
745
|
890
|
if(response.data.state == 1){
|
|
@@ -788,31 +933,30 @@ export default {
|
788
|
933
|
orderInfo[i].unitList = [{id:1,name:""}]
|
789
|
934
|
orderInfo[i].unitList[0].name = drugList[j].max_unit
|
790
|
935
|
}
|
791
|
|
-
|
|
936
|
+
|
792
|
937
|
}
|
793
|
|
- }
|
794
|
|
- }
|
|
938
|
+ }
|
|
939
|
+ }
|
795
|
940
|
if(orderInfo[i].is_source == 2){
|
796
|
941
|
for(let j=0;j<goodList.length;j++){
|
797
|
942
|
if(orderInfo[i].project_id == goodList[j].id){
|
798
|
943
|
orderInfo[i].unitList = [{id:1,name:""}]
|
799
|
944
|
orderInfo[i].unitList[0].name = goodList[j].packing_unit
|
800
|
945
|
}
|
801
|
|
- }
|
802
|
|
- }
|
|
946
|
+ }
|
|
947
|
+ }
|
803
|
948
|
}
|
804
|
|
-
|
805
|
|
- this.recordInfo.tableList= []
|
806
|
|
- this.recordInfo.tableList = orderInfo
|
807
|
|
-
|
|
949
|
+
|
|
950
|
+ this.recordInfo.tableList = [];
|
|
951
|
+ this.recordInfo.tableList = orderInfo;
|
808
|
952
|
}
|
809
|
|
- })
|
|
953
|
+ });
|
810
|
954
|
},
|
811
|
955
|
toPrint() {
|
812
|
956
|
var id = this.$route.query.id;
|
813
|
957
|
this.$router.push({ path: "/purchase/order/print?&id=" + id });
|
814
|
958
|
},
|
815
|
|
- updateGoodReturn(){
|
|
959
|
+ updateGoodReturn() {
|
816
|
960
|
var warehouse_out_id = this.$route.query.id;
|
817
|
961
|
this.$refs["tableForm"].validate((valid)=>{
|
818
|
962
|
if(valid){
|
|
@@ -821,7 +965,7 @@ export default {
|
821
|
965
|
this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count)
|
822
|
966
|
this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString()
|
823
|
967
|
this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString()
|
824
|
|
-
|
|
968
|
+
|
825
|
969
|
for(let j=0;j<this.manufactuerList.length;j++){
|
826
|
970
|
if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
|
827
|
971
|
this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id
|
|
@@ -830,6 +974,33 @@ export default {
|
830
|
974
|
this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name
|
831
|
975
|
}
|
832
|
976
|
|
|
977
|
+ this.$refs["tableForm"].validate((valid) => {
|
|
978
|
+ if (valid) {
|
|
979
|
+ this.loading = true;
|
|
980
|
+ for (let i = 0; i < this.recordInfo.tableList.length; i++) {
|
|
981
|
+ this.recordInfo.tableList[i].supply_count = parseInt(
|
|
982
|
+ this.recordInfo.tableList[i].supply_count
|
|
983
|
+ );
|
|
984
|
+ this.recordInfo.tableList[i].supply_price =
|
|
985
|
+ this.recordInfo.tableList[i].supply_price.toString();
|
|
986
|
+ this.recordInfo.tableList[i].supply_total =
|
|
987
|
+ this.recordInfo.tableList[i].supply_total.toString();
|
|
988
|
+
|
|
989
|
+ for (let j = 0; j < this.manufactuerList.length; j++) {
|
|
990
|
+ if (
|
|
991
|
+ this.recordInfo.tableList[i].supply_manufacturer ==
|
|
992
|
+ this.manufactuerList[j].manufacturer_name
|
|
993
|
+ ) {
|
|
994
|
+ this.recordInfo.tableList[i].manufacturer_id =
|
|
995
|
+ this.manufactuerList[j].id;
|
|
996
|
+ }
|
|
997
|
+ if (
|
|
998
|
+ this.recordInfo.tableList[i].supply_manufacturer ==
|
|
999
|
+ this.manufactuerList[j].id
|
|
1000
|
+ ) {
|
|
1001
|
+ this.recordInfo.tableList[i].supply_manufacturer =
|
|
1002
|
+ this.manufactuerList[j].manufacturer_name;
|
|
1003
|
+ }
|
833
|
1004
|
}
|
834
|
1005
|
}
|
835
|
1006
|
var params = {
|
|
@@ -843,10 +1014,30 @@ export default {
|
843
|
1014
|
var msg = response.data.msg
|
844
|
1015
|
this.loading = false
|
845
|
1016
|
this.$message.success("保存成功!")
|
|
1017
|
+ stockIn: this.recordInfo.tableList,
|
|
1018
|
+ return_marke: this.return_remark,
|
|
1019
|
+ };
|
|
1020
|
+ console.log("start_time232233232", this.start_time);
|
|
1021
|
+ console.log("arrage2323322323", this.arrearage);
|
|
1022
|
+ updateGoodReturn(
|
|
1023
|
+ params,
|
|
1024
|
+ warehouse_out_id,
|
|
1025
|
+ this.start_time,
|
|
1026
|
+ this.rate_of_concession,
|
|
1027
|
+ this.discount_amount,
|
|
1028
|
+ this.arrearage,
|
|
1029
|
+ this.payment,
|
|
1030
|
+ this.supplier_name,
|
|
1031
|
+ this.number
|
|
1032
|
+ ).then((response) => {
|
|
1033
|
+ if (response.data.state == 1) {
|
|
1034
|
+ var msg = response.data.msg;
|
|
1035
|
+ this.loading = false;
|
|
1036
|
+ this.$message.success("保存成功!");
|
846
|
1037
|
}
|
847
|
|
- })
|
|
1038
|
+ });
|
848
|
1039
|
}
|
849
|
|
- })
|
|
1040
|
+ });
|
850
|
1041
|
},
|
851
|
1042
|
checkReturnOrder(){
|
852
|
1043
|
this.loading = true
|
|
@@ -870,10 +1061,17 @@ export default {
|
870
|
1061
|
}
|
871
|
1062
|
modefyReturnOrder(params).then(response=>{
|
872
|
1063
|
if(response.data.state == 1){
|
873
|
|
-
|
|
1064
|
+
|
874
|
1065
|
}
|
875
|
1066
|
})
|
876
|
1067
|
}
|
|
1068
|
+ checkReturnOrder() {
|
|
1069
|
+ var params = {
|
|
1070
|
+ warehouse_out_id: this.warehouse_out_id,
|
|
1071
|
+ id: this.id,
|
|
1072
|
+ };
|
|
1073
|
+ checkReturnOrder(params).then((response) => {});
|
|
1074
|
+ },
|
877
|
1075
|
},
|
878
|
1076
|
created() {
|
879
|
1077
|
const tempObj = {};
|