|
@@ -556,33 +556,10 @@ export default {
|
556
|
556
|
drugList[i].drug_type = this.drugTypeList[y].name;
|
557
|
557
|
}
|
558
|
558
|
}
|
559
|
|
- drugList[i].supply_name =
|
560
|
|
- drugList[i].drug_name +
|
561
|
|
- " " +
|
562
|
|
- drugList[i].dose +
|
563
|
|
- drugList[i].dose_unit +
|
564
|
|
- "*" +
|
565
|
|
- drugList[i].min_number +
|
566
|
|
- drugList[i].min_unit +
|
567
|
|
- "/" +
|
568
|
|
- drugList[i].max_unit +
|
569
|
|
- " " +
|
570
|
|
- drugList[i].manufacturer;
|
|
559
|
+ drugList[i].supply_name =drugList[i].drug_name +" " +drugList[i].dose +drugList[i].dose_unit +"*" +drugList[i].min_number +drugList[i].min_unit +"/" +drugList[i].max_unit +" " +drugList[i].manufacturer;
|
571
|
560
|
drugList[i].supply_type = drugList[i].drug_type;
|
572
|
|
- drugList[i].supply_specification_name =
|
573
|
|
- drugList[i].dose +
|
574
|
|
- drugList[i].dose_unit +
|
575
|
|
- "*" +
|
576
|
|
- drugList[i].min_number +
|
577
|
|
- drugList[i].min_unit +
|
578
|
|
- "/" +
|
579
|
|
- drugList[i].max_unit;
|
580
|
|
- drugList[i].supply_total = this.getWarehoseInfo(
|
581
|
|
- drugList[i].drug_warehouse_info,
|
582
|
|
- drugList[i].max_unit,
|
583
|
|
- drugList[i].min_unit,
|
584
|
|
- drugList[i].min_number
|
585
|
|
- );
|
|
561
|
+ drugList[i].supply_specification_name =drugList[i].dose + drugList[i].dose_unit +"*" +drugList[i].min_number +drugList[i].min_unit +"/" +drugList[i].max_unit;
|
|
562
|
+ drugList[i].supply_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number);
|
586
|
563
|
drugList[i].supply_count = "";
|
587
|
564
|
drugList[i].supply_total_price = "";
|
588
|
565
|
drugList[i].supply_manufacturer = drugList[i].manufacturer;
|
|
@@ -629,19 +606,11 @@ export default {
|
629
|
606
|
goodList[i].good_type_id = this.goodTypeList[y].type_name;
|
630
|
607
|
}
|
631
|
608
|
}
|
632
|
|
- goodList[i].supply_name =
|
633
|
|
- goodList[i].good_name +
|
634
|
|
- " " +
|
635
|
|
- goodList[i].specification_name +
|
636
|
|
- " " +
|
637
|
|
- goodList[i].manufacturer;
|
|
609
|
+ goodList[i].supply_name =goodList[i].good_name +" " +goodList[i].specification_name +" " +goodList[i].manufacturer;
|
638
|
610
|
goodList[i].supply_type = goodList[i].good_type_id;
|
639
|
|
- goodList[i].supply_specification_name =
|
640
|
|
- goodList[i].specification_name;
|
|
611
|
+ goodList[i].supply_specification_name =goodList[i].specification_name;
|
641
|
612
|
goodList[i].supply_price = goodList[i].buy_price;
|
642
|
|
- goodList[i].supply_total = this.getTotalStockCount(
|
643
|
|
- goodList[i].good_warehouse_info
|
644
|
|
- );
|
|
613
|
+ goodList[i].supply_total = this.getTotalStockCount(goodList[i].good_warehouse_info);
|
645
|
614
|
goodList[i].supply_count = "";
|
646
|
615
|
goodList[i].supply_total_price = "";
|
647
|
616
|
goodList[i].supply_manufacturer = goodList[i].manufacturer;
|
|
@@ -1111,17 +1080,91 @@ export default {
|
1111
|
1080
|
if (response.data.state == 1) {
|
1112
|
1081
|
var cancelList = response.data.data.cancelList;
|
1113
|
1082
|
console.log("cancelList23232232323323223", cancelList);
|
1114
|
|
- if (cancelList.length > 0) {
|
1115
|
|
- }
|
1116
|
|
- var outList = response.data.data.outList;
|
1117
|
|
- console.log("outList2332232332", outList);
|
|
1083
|
+ var drugList = response.data.data.drugList;
|
|
1084
|
+ console.log("drugList233223232323232", drugList);
|
1118
|
1085
|
var cancelOrderList = response.data.data.cancelOrderList;
|
1119
|
1086
|
console.log("cancelOrderList2323322322332", cancelOrderList);
|
1120
|
|
- var drugList = response.data.data.drugList;
|
1121
|
|
- console.log("drugList233223232323232", drugList);
|
|
1087
|
+ if(cancelList.length == 0){
|
|
1088
|
+ this.$router.push({ path: "/good/return/add?id=" + this.id });
|
|
1089
|
+ }
|
|
1090
|
+ if (cancelList.length > 0) {
|
|
1091
|
+ var outList = response.data.data.outList;
|
|
1092
|
+ for(let i=0;i<outList.length;i++){
|
|
1093
|
+ if(outList[i].is_source == 1){
|
|
1094
|
+ for(let j=0;j<drugList.length;j++){
|
|
1095
|
+ if(outList[i].project_id == drugList[j].id){
|
|
1096
|
+ if(outList[i].supply_unit == drugList[j].max_unit){
|
|
1097
|
+ outList[i].count = outList[i].count * drugList[j].min_number
|
|
1098
|
+ }
|
|
1099
|
+
|
|
1100
|
+ }
|
|
1101
|
+ }
|
|
1102
|
+ }
|
|
1103
|
+ }
|
|
1104
|
+
|
|
1105
|
+ for(let i=0;i<cancelOrderList.length;i++){
|
|
1106
|
+ if(cancelOrderList[i].is_source == 1){
|
|
1107
|
+ for(let j=0;j<drugList.length;j++){
|
|
1108
|
+ if(cancelOrderList[i].supply_unit == drugList[j].max_unit){
|
|
1109
|
+ cancelOrderList[i].count = cancelOrderList[i].count * drugList[j].min_number
|
|
1110
|
+ }
|
|
1111
|
+ }
|
|
1112
|
+ }
|
|
1113
|
+ }
|
|
1114
|
+
|
|
1115
|
+ let objInfo = {};
|
|
1116
|
+ if(cancelOrderList.length >0){
|
|
1117
|
+ cancelOrderList.forEach((item, index) => {
|
|
1118
|
+ let { project_id } = item;
|
|
1119
|
+ if (!objInfo[project_id]) {
|
|
1120
|
+ objInfo[project_id] = {
|
|
1121
|
+ project_id,
|
|
1122
|
+ child: [],
|
|
1123
|
+ count: 0,
|
|
1124
|
+ };
|
|
1125
|
+ }
|
|
1126
|
+ });
|
|
1127
|
+ let newArr = Object.values(objInfo)
|
|
1128
|
+
|
|
1129
|
+ console.log("outList2332232332", outList)
|
|
1130
|
+ for (let i = 0; i < cancelOrderList.length; i++) {
|
|
1131
|
+ for (let j = 0; j < newArr.length; j++) {
|
|
1132
|
+ if (cancelOrderList[i].project_id == newArr[j].project_id) {
|
|
1133
|
+ newArr[j].child.push(cancelOrderList[i])
|
|
1134
|
+ }
|
|
1135
|
+ }
|
|
1136
|
+ console.log("newAr2332232323", newArr)
|
|
1137
|
+
|
|
1138
|
+ //如果采购单有数据,则需要比较数量
|
|
1139
|
+ if (newArr.length > 0) {
|
|
1140
|
+ for (let i = 0; i < purcaseOrder.length; i++) {
|
|
1141
|
+ for (let j = 0; j < newArr.length; j++) {
|
|
1142
|
+ if (purcaseOrder[i].project_id == newArr[j].project_id) {
|
|
1143
|
+ //根据商品ID比较数量大小,把数量不足的商品ID储存,表示采购单的数量未满足采购订单的数据,可以继续生成采购单
|
|
1144
|
+ if (purcaseOrder[i].count > newArr[j].count) {
|
|
1145
|
+ arr.push(purcaseOrder[i].project_id);
|
|
1146
|
+ }
|
|
1147
|
+ }
|
|
1148
|
+ }
|
|
1149
|
+ }
|
|
1150
|
+ //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
|
|
1151
|
+
|
|
1152
|
+ if (arr.length == 0) {
|
|
1153
|
+ this.$message.error("该订单已全部生成采购单,请知悉!");
|
|
1154
|
+ return;
|
|
1155
|
+ }
|
|
1156
|
+
|
|
1157
|
+ if (total != goodOrder.length) {
|
|
1158
|
+ str = arr.join(",");
|
|
1159
|
+ this.$router.push({ path: "/good/order/add?id=" + id + "&ids=" + str});
|
|
1160
|
+ }
|
|
1161
|
+ }
|
|
1162
|
+ }
|
|
1163
|
+ }
|
|
1164
|
+ }
|
1122
|
1165
|
}
|
1123
|
1166
|
});
|
1124
|
|
- this.$router.push({ path: "/good/return/add?id=" + this.id });
|
|
1167
|
+
|
1125
|
1168
|
},
|
1126
|
1169
|
//反审核
|
1127
|
1170
|
MofyGoodOrder() {
|