|
@@ -47,6 +47,7 @@
|
|
|
}}</span
|
|
|
>{{ scope.row[item.prop3] }}
|
|
|
<el-button
|
|
|
+ v-if="toData.templateStatus == 1"
|
|
|
type="text"
|
|
|
:style="
|
|
|
scope.row[item.prop4] === -1 ? 'color:red!important;' : ''
|
|
@@ -119,8 +120,8 @@
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
:loading="disabledBtn"
|
|
|
- @click="orderSubmitStatus ? submitForm() : submitForm(1)"
|
|
|
- >{{ orderSubmitStatus ? "提交下单内容" : "继续下一步" }}</el-button
|
|
|
+ @click="orderSubmitStatus ? submitForm() : submitResult(1)"
|
|
|
+ >{{ orderSubmitStatus ? "提交下单内容" : "查看录单结果" }}</el-button
|
|
|
>
|
|
|
</div>
|
|
|
<select-class ref="selectClass" />
|
|
@@ -147,7 +148,7 @@ export default {
|
|
|
{
|
|
|
label: "学员身份证",
|
|
|
prop: "idCard",
|
|
|
- width: "160px",
|
|
|
+ width: "166px",
|
|
|
},
|
|
|
{
|
|
|
label: "手机号码",
|
|
@@ -347,8 +348,11 @@ export default {
|
|
|
});
|
|
|
this.$refs.setGoodsList.openBox(this.toData, data);
|
|
|
},
|
|
|
- uploadDatas(list) {
|
|
|
- if (!list.length) return;
|
|
|
+ uploadDatas(lists) {
|
|
|
+ if (!lists.length) return;
|
|
|
+ let list = lists.sort((a, b) => {
|
|
|
+ return a.goodsType - b.goodsType;
|
|
|
+ });
|
|
|
const index = this.tableData.findIndex((item) => {
|
|
|
return item.realname === list[0].realname;
|
|
|
});
|
|
@@ -561,7 +565,7 @@ export default {
|
|
|
}
|
|
|
items.goodsRealPrice = items.standPrice;
|
|
|
items.goodsReceived = items.standPrice;
|
|
|
- if (!items.gradeId) {
|
|
|
+ if (this.toData.templateStatus == 1 && !items.gradeId) {
|
|
|
items.gradeId = 0;
|
|
|
}
|
|
|
return items;
|
|
@@ -638,10 +642,40 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ submitResult(int) {
|
|
|
+ if (this.checkedSuccess()) {
|
|
|
+ this.jumpThire();
|
|
|
+ } else {
|
|
|
+ this.$confirm(
|
|
|
+ "当前页面还有学员的商品未完成录单操作。【确定下一步】后,只能通过补录方式,继续为学员批量录单。请慎重操作。",
|
|
|
+ "操作提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定,下一步",
|
|
|
+ cancelButtonText: "再想一想",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ this.jumpThire();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ },
|
|
|
async submitForm(int, row) {
|
|
|
+ let checkStatus = this.tableData.every((item) => {
|
|
|
+ return item.checked === false;
|
|
|
+ });
|
|
|
+ if (checkStatus) {
|
|
|
+ this.$message.error("请选择需要购买的商品");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (this.orderSubmitStatus) {
|
|
|
let py = this.tableData.some((item) => {
|
|
|
- return item.checked && item.gradeId == -1;
|
|
|
+ return (
|
|
|
+ item.checked &&
|
|
|
+ item.gradeId == -1 &&
|
|
|
+ this.toData.templateStatus == 1
|
|
|
+ );
|
|
|
});
|
|
|
if (py) {
|
|
|
this.$message.warning("请选择班级");
|
|
@@ -651,7 +685,10 @@ export default {
|
|
|
if (int === 2 && row) {
|
|
|
let ary = this.tableData.some((item) => {
|
|
|
return (
|
|
|
- item.userId === row.userId && item.checked && item.gradeId == -1
|
|
|
+ item.userId === row.userId &&
|
|
|
+ item.checked &&
|
|
|
+ item.gradeId == -1 &&
|
|
|
+ this.toData.templateStatus == 1
|
|
|
);
|
|
|
});
|
|
|
if (ary) {
|
|
@@ -662,18 +699,18 @@ export default {
|
|
|
}
|
|
|
this.disabledBtn = true;
|
|
|
this.loading = true;
|
|
|
- if (int === 1 && !this.orderSubmitStatus) {
|
|
|
- var successList = this.tableData.filter((item) => {
|
|
|
- return item.checked && item.success;
|
|
|
- });
|
|
|
- var errorList = this.tableData.filter((item) => {
|
|
|
- return item.checked && item.errmsg;
|
|
|
- });
|
|
|
- this.$parent.changePage2("third", successList, errorList);
|
|
|
- this.disabledBtn = false;
|
|
|
- this.loading = false;
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (int === 1 && !this.orderSubmitStatus) {
|
|
|
+ // var successList = this.tableData.filter((item) => {
|
|
|
+ // return item.checked && item.success;
|
|
|
+ // });
|
|
|
+ // var errorList = this.tableData.filter((item) => {
|
|
|
+ // return item.checked && item.errmsg;
|
|
|
+ // });
|
|
|
+ // this.$parent.changePage2("third", successList, errorList);
|
|
|
+ // this.disabledBtn = false;
|
|
|
+ // this.loading = false;
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
let submitTable = this.tableData.filter((item) => {
|
|
|
if (row && int === 2) {
|
|
|
return item.checked && item.userId === row.userId;
|
|
@@ -705,7 +742,7 @@ export default {
|
|
|
goodsReceived: item.goodsReceived,
|
|
|
goodsPrice: item.standPrice,
|
|
|
goodsInputData: {
|
|
|
- gradeId: item.gradeId,
|
|
|
+ gradeId: this.toData.templateStatus == 1 ? item.gradeId : "",
|
|
|
},
|
|
|
},
|
|
|
],
|
|
@@ -721,7 +758,7 @@ export default {
|
|
|
goodsReceived: item.goodsReceived,
|
|
|
goodsPrice: item.standPrice,
|
|
|
goodsInputData: {
|
|
|
- gradeId: item.gradeId,
|
|
|
+ gradeId: this.toData.templateStatus == 1 ? item.gradeId : "",
|
|
|
},
|
|
|
});
|
|
|
} else {
|
|
@@ -736,7 +773,8 @@ export default {
|
|
|
goodsReceived: item.goodsReceived,
|
|
|
goodsPrice: item.standPrice,
|
|
|
goodsInputData: {
|
|
|
- gradeId: item.gradeId,
|
|
|
+ gradeId:
|
|
|
+ this.toData.templateStatus == 1 ? item.gradeId : "",
|
|
|
},
|
|
|
},
|
|
|
],
|
|
@@ -750,10 +788,35 @@ export default {
|
|
|
if (arr.length) {
|
|
|
this.$message("已提交下单内容");
|
|
|
}
|
|
|
+ if (this.orderSubmitStatus && this.checkedSuccess()) {
|
|
|
+ this.jumpThire();
|
|
|
+ }
|
|
|
this.disabledBtn = false;
|
|
|
this.loading = false;
|
|
|
this.orderSubmitStatus = false;
|
|
|
},
|
|
|
+ checkedSuccess() {
|
|
|
+ let newData = this.tableData.filter((item) => {
|
|
|
+ return item.checked;
|
|
|
+ });
|
|
|
+ let status = newData.every((item) => {
|
|
|
+ return item.success === true;
|
|
|
+ });
|
|
|
+ console.log(this.tableData, status);
|
|
|
+ return status;
|
|
|
+ },
|
|
|
+ jumpThire() {
|
|
|
+ var successList = this.tableData.filter((item) => {
|
|
|
+ return item.checked && item.success;
|
|
|
+ });
|
|
|
+ var errorList = this.tableData.filter((item) => {
|
|
|
+ return item.checked && item.errmsg;
|
|
|
+ });
|
|
|
+ this.$parent.changePage2("third", successList, errorList);
|
|
|
+ this.disabledBtn = false;
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ },
|
|
|
submitFunApi(item) {
|
|
|
var self = this;
|
|
|
return new Promise((resolve, reject) => {
|