|
@@ -70,7 +70,7 @@
|
|
|
class="selection"
|
|
class="selection"
|
|
|
v-if="
|
|
v-if="
|
|
|
scope.row.templateType == 'class' &&
|
|
scope.row.templateType == 'class' &&
|
|
|
- scope.row.goodsType == 1
|
|
|
|
|
|
|
+ scope.row.goodsType == 1
|
|
|
"
|
|
"
|
|
|
>
|
|
>
|
|
|
<el-select
|
|
<el-select
|
|
@@ -89,12 +89,27 @@
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="selection dis_flex"
|
|
|
|
|
+ v-if="scope.row.sevenYear && scope.row.goodsType == 1"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span>七大员继教可选年份:</span>
|
|
|
|
|
+ <el-checkbox-group v-model="scope.row.checkList">
|
|
|
|
|
+ <el-checkbox
|
|
|
|
|
+ v-for="(item, index) in computedSevenYear(
|
|
|
|
|
+ scope.row.sevenYear
|
|
|
|
|
+ )"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="item"
|
|
|
|
|
+ ></el-checkbox>
|
|
|
|
|
+ </el-checkbox-group>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
|
class="selection"
|
|
class="selection"
|
|
|
v-if="
|
|
v-if="
|
|
|
scope.row.templateType == 'apply' &&
|
|
scope.row.templateType == 'apply' &&
|
|
|
- scope.row.goodsType == 1
|
|
|
|
|
|
|
+ scope.row.goodsType == 1
|
|
|
"
|
|
"
|
|
|
>
|
|
>
|
|
|
<el-select
|
|
<el-select
|
|
@@ -122,7 +137,15 @@
|
|
|
placeholder="请选择报考地区"
|
|
placeholder="请选择报考地区"
|
|
|
></el-cascader>
|
|
></el-cascader>
|
|
|
</div>
|
|
</div>
|
|
|
- <Class-time-tip v-if="scope.row.gradeId" :classInfo="GradeListFindItem(scope.row.gradeList,scope.row.gradeId)"></Class-time-tip>
|
|
|
|
|
|
|
+ <Class-time-tip
|
|
|
|
|
+ v-if="scope.row.gradeId"
|
|
|
|
|
+ :classInfo="
|
|
|
|
|
+ GradeListFindItem(
|
|
|
|
|
+ scope.row.gradeList,
|
|
|
|
|
+ scope.row.gradeId
|
|
|
|
|
+ )
|
|
|
|
|
+ "
|
|
|
|
|
+ ></Class-time-tip>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -194,7 +217,7 @@ export default {
|
|
|
Footer,
|
|
Footer,
|
|
|
Header,
|
|
Header,
|
|
|
ToolBar,
|
|
ToolBar,
|
|
|
- ClassTimeTip,
|
|
|
|
|
|
|
+ ClassTimeTip
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -205,14 +228,22 @@ export default {
|
|
|
provinceList: [],
|
|
provinceList: [],
|
|
|
props: {
|
|
props: {
|
|
|
lazy: true,
|
|
lazy: true,
|
|
|
- lazyLoad: this.lazyLoad,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ lazyLoad: this.lazyLoad
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.getProvinceList();
|
|
this.getProvinceList();
|
|
|
this.cartList();
|
|
this.cartList();
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ computedSevenYear: function() {
|
|
|
|
|
+ return function(item) {
|
|
|
|
|
+ var ary = (item && item.split(",")) || [];
|
|
|
|
|
+ return ary;
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
...mapMutations(["getCartCount"]),
|
|
...mapMutations(["getCartCount"]),
|
|
|
areaChange(row, index) {
|
|
areaChange(row, index) {
|
|
@@ -223,7 +254,7 @@ export default {
|
|
|
areaName: node.parent.label,
|
|
areaName: node.parent.label,
|
|
|
areaId: node.parent.value,
|
|
areaId: node.parent.value,
|
|
|
cityId: node.value,
|
|
cityId: node.value,
|
|
|
- cityName: node.label,
|
|
|
|
|
|
|
+ cityName: node.label
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
lazyLoad(node, resolve) {
|
|
lazyLoad(node, resolve) {
|
|
@@ -239,18 +270,18 @@ export default {
|
|
|
// resolve(nodes);
|
|
// resolve(nodes);
|
|
|
// });
|
|
// });
|
|
|
} else if (level == 1) {
|
|
} else if (level == 1) {
|
|
|
- this.$request.getCityList({ parentId: node.value }).then((res) => {
|
|
|
|
|
- const nodes = res.rows.map((item) => ({
|
|
|
|
|
|
|
+ this.$request.getCityList({ parentId: node.value }).then(res => {
|
|
|
|
|
+ const nodes = res.rows.map(item => ({
|
|
|
value: item.areaId,
|
|
value: item.areaId,
|
|
|
label: `${item.areaName}`,
|
|
label: `${item.areaName}`,
|
|
|
- leaf: level >= 1,
|
|
|
|
|
|
|
+ leaf: level >= 1
|
|
|
}));
|
|
}));
|
|
|
resolve(nodes);
|
|
resolve(nodes);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
GradeListFindItem(gradeList, gradeId) {
|
|
GradeListFindItem(gradeList, gradeId) {
|
|
|
- return gradeList.find((e) => e.gradeId == gradeId);
|
|
|
|
|
|
|
+ return gradeList.find(e => e.gradeId == gradeId);
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 点击select获取对应列表
|
|
* 点击select获取对应列表
|
|
@@ -260,12 +291,12 @@ export default {
|
|
|
//选择班级
|
|
//选择班级
|
|
|
console.log(row);
|
|
console.log(row);
|
|
|
if (!row.gradeList.length) {
|
|
if (!row.gradeList.length) {
|
|
|
- this.$request.goodsGradeList({ goodsId: row.goodsId }).then((res) => {
|
|
|
|
|
|
|
+ this.$request.goodsGradeList({ goodsId: row.goodsId }).then(res => {
|
|
|
row.gradeList = res.rows;
|
|
row.gradeList = res.rows;
|
|
|
if (row.gradeList.length == 0) {
|
|
if (row.gradeList.length == 0) {
|
|
|
let item = {
|
|
let item = {
|
|
|
className: "系统分班",
|
|
className: "系统分班",
|
|
|
- gradeId: 0,
|
|
|
|
|
|
|
+ gradeId: 0
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
row.gradeList.push(item);
|
|
row.gradeList.push(item);
|
|
@@ -276,22 +307,20 @@ export default {
|
|
|
//选择考试地点
|
|
//选择考试地点
|
|
|
} else if (type == "exam") {
|
|
} else if (type == "exam") {
|
|
|
//选择考期
|
|
//选择考期
|
|
|
- this.$request
|
|
|
|
|
- .getExamineList({ projectId: row.projectId })
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- row.examineList = res.rows;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.$request.getExamineList({ projectId: row.projectId }).then(res => {
|
|
|
|
|
+ row.examineList = res.rows;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 获取所有省份
|
|
* 获取所有省份
|
|
|
*/
|
|
*/
|
|
|
getProvinceList() {
|
|
getProvinceList() {
|
|
|
- this.$request.getProvinceList().then((res) => {
|
|
|
|
|
- this.provinceList = res.rows.map((item) => ({
|
|
|
|
|
|
|
+ this.$request.getProvinceList().then(res => {
|
|
|
|
|
+ this.provinceList = res.rows.map(item => ({
|
|
|
value: item.areaId,
|
|
value: item.areaId,
|
|
|
label: `${item.areaName}`,
|
|
label: `${item.areaName}`,
|
|
|
- leaf: false,
|
|
|
|
|
|
|
+ leaf: false
|
|
|
}));
|
|
}));
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -313,20 +342,21 @@ export default {
|
|
|
* 获取购物车列表
|
|
* 获取购物车列表
|
|
|
*/
|
|
*/
|
|
|
cartList() {
|
|
cartList() {
|
|
|
- this.$request.cartList().then((res) => {
|
|
|
|
|
- res.rows.forEach((item) => {
|
|
|
|
|
|
|
+ this.$request.cartList().then(res => {
|
|
|
|
|
+ res.rows.forEach(item => {
|
|
|
item.area = [];
|
|
item.area = [];
|
|
|
item.gradeId = "";
|
|
item.gradeId = "";
|
|
|
item.gradeList = [];
|
|
item.gradeList = [];
|
|
|
item.examDate = "";
|
|
item.examDate = "";
|
|
|
item.examineList = [];
|
|
item.examineList = [];
|
|
|
|
|
+ item.checkList = [];
|
|
|
});
|
|
});
|
|
|
this.goodsList = res.rows;
|
|
this.goodsList = res.rows;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
toggleSelection(rows) {
|
|
toggleSelection(rows) {
|
|
|
if (rows) {
|
|
if (rows) {
|
|
|
- rows.forEach((row) => {
|
|
|
|
|
|
|
+ rows.forEach(row => {
|
|
|
this.$refs.multipleTable.toggleRowSelection(row);
|
|
this.$refs.multipleTable.toggleRowSelection(row);
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
@@ -339,7 +369,7 @@ export default {
|
|
|
if (
|
|
if (
|
|
|
this.multipleSelection.length > 0 &&
|
|
this.multipleSelection.length > 0 &&
|
|
|
this.multipleSelection.length ==
|
|
this.multipleSelection.length ==
|
|
|
- this.goodsList.filter((item) => item.goodsStatus != 0).length
|
|
|
|
|
|
|
+ this.goodsList.filter(item => item.goodsStatus != 0).length
|
|
|
) {
|
|
) {
|
|
|
this.checked = true;
|
|
this.checked = true;
|
|
|
} else {
|
|
} else {
|
|
@@ -356,7 +386,7 @@ export default {
|
|
|
caculate() {
|
|
caculate() {
|
|
|
this.total = 0;
|
|
this.total = 0;
|
|
|
|
|
|
|
|
- this.multipleSelection.forEach((item) => {
|
|
|
|
|
|
|
+ this.multipleSelection.forEach(item => {
|
|
|
this.total += item.standPrice;
|
|
this.total += item.standPrice;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -364,7 +394,7 @@ export default {
|
|
|
if (this.$refs.multipleTable.selection.length == 0) {
|
|
if (this.$refs.multipleTable.selection.length == 0) {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: "请选择商品",
|
|
message: "请选择商品",
|
|
|
- type: "warning",
|
|
|
|
|
|
|
+ type: "warning"
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
return;
|
|
@@ -377,7 +407,16 @@ export default {
|
|
|
if (!item.gradeId && item.gradeId !== 0) {
|
|
if (!item.gradeId && item.gradeId !== 0) {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: "请选择班级",
|
|
message: "请选择班级",
|
|
|
- type: "warning",
|
|
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.sevenYear && item.goodsType == 1) {
|
|
|
|
|
+ if (item.checkList.length == 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "请选择七大员继教年份",
|
|
|
|
|
+ type: "warning"
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -395,7 +434,7 @@ export default {
|
|
|
if (!item.educationId) {
|
|
if (!item.educationId) {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: "请选择考期",
|
|
message: "请选择考期",
|
|
|
- type: "warning",
|
|
|
|
|
|
|
+ type: "warning"
|
|
|
});
|
|
});
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -405,15 +444,16 @@ export default {
|
|
|
let selectGoodsList = JSON.parse(
|
|
let selectGoodsList = JSON.parse(
|
|
|
JSON.stringify(this.$refs.multipleTable.selection)
|
|
JSON.stringify(this.$refs.multipleTable.selection)
|
|
|
);
|
|
);
|
|
|
- selectGoodsList.forEach((item) => {
|
|
|
|
|
|
|
+ let arrayBox = [];
|
|
|
|
|
+ selectGoodsList.forEach(item => {
|
|
|
if (item.goodsType == 1) {
|
|
if (item.goodsType == 1) {
|
|
|
if (item.templateType == "class") {
|
|
if (item.templateType == "class") {
|
|
|
let goodsInputData = {
|
|
let goodsInputData = {
|
|
|
type: "class",
|
|
type: "class",
|
|
|
gradeId: item.gradeId,
|
|
gradeId: item.gradeId,
|
|
|
gradeJson: JSON.stringify(
|
|
gradeJson: JSON.stringify(
|
|
|
- item.gradeList.find((grade) => grade.gradeId == item.gradeId)
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ item.gradeList.find(grade => grade.gradeId == item.gradeId)
|
|
|
|
|
+ )
|
|
|
};
|
|
};
|
|
|
item.goodsInputData = goodsInputData;
|
|
item.goodsInputData = goodsInputData;
|
|
|
}
|
|
}
|
|
@@ -423,39 +463,58 @@ export default {
|
|
|
applyAreasJson: JSON.stringify(item.applyAreas),
|
|
applyAreasJson: JSON.stringify(item.applyAreas),
|
|
|
examDateJson: JSON.stringify(
|
|
examDateJson: JSON.stringify(
|
|
|
item.examineList.find(
|
|
item.examineList.find(
|
|
|
- (exam) => exam.educationId == item.educationId
|
|
|
|
|
|
|
+ exam => exam.educationId == item.educationId
|
|
|
)
|
|
)
|
|
|
- ),
|
|
|
|
|
|
|
+ )
|
|
|
};
|
|
};
|
|
|
item.goodsInputData = goodsInputData;
|
|
item.goodsInputData = goodsInputData;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (
|
|
|
|
|
+ item.goodsType == 1 &&
|
|
|
|
|
+ item.sevenYear &&
|
|
|
|
|
+ item.checkList.length > 0
|
|
|
|
|
+ ) {
|
|
|
|
|
+ let A = item.checkList.map(i => {
|
|
|
|
|
+ return { ...item, sevenYear: i };
|
|
|
|
|
+ });
|
|
|
|
|
+ arrayBox.push(...A);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ arrayBox.push(item);
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
|
|
|
|
|
|
|
+ localStorage.setItem("checkGoodsList", JSON.stringify(arrayBox));
|
|
|
|
|
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
name: "支付",
|
|
name: "支付",
|
|
|
- path: "/payment",
|
|
|
|
|
|
|
+ path: "/payment"
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
del(row) {
|
|
del(row) {
|
|
|
this.$confirm("确认删除商品?")
|
|
this.$confirm("确认删除商品?")
|
|
|
- .then((_) => {
|
|
|
|
|
- this.$request.cartDelete(row.id).then((res) => {
|
|
|
|
|
|
|
+ .then(_ => {
|
|
|
|
|
+ this.$request.cartDelete(row.id).then(res => {
|
|
|
this.$message.con;
|
|
this.$message.con;
|
|
|
this.cartList();
|
|
this.cartList();
|
|
|
this.getCartCount();
|
|
this.getCartCount();
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
- .catch((_) => {});
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ .catch(_ => {});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
|
|
+.dis_flex {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ span {
|
|
|
|
|
+ height: 30px;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
.cart {
|
|
.cart {
|
|
|
.section {
|
|
.section {
|
|
|
&__header {
|
|
&__header {
|