|
|
@@ -1,73 +1,184 @@
|
|
|
<template>
|
|
|
<div id="">
|
|
|
- <search
|
|
|
- :formSet="formSet"
|
|
|
- :formData.sync="formData"
|
|
|
- @search="search"
|
|
|
- @init="init"
|
|
|
- ></search>
|
|
|
+ <header class="header_t_0">
|
|
|
+ <span
|
|
|
+ >教育类型:<i>{{ getEduName(apiData.educationTypeId) }}</i></span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ >培训项目:<i>{{ getBusName(apiData.businessId) }}</i></span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ >人数:<i>{{ apiData.userGoodsList.length || 0 }}位</i></span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ >数量:<i>{{ getTotal(apiData.userGoodsList) }}个</i></span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ >总金额:<i
|
|
|
+ >¥{{ getTotalPrice(apiData.userGoodsList) | formatPrice }}</i
|
|
|
+ ></span
|
|
|
+ >
|
|
|
+ </header>
|
|
|
<header class="header_t">
|
|
|
- <h2>学员列表x条</h2>
|
|
|
+ <div>
|
|
|
+ <el-input
|
|
|
+ v-model="searchData.searchKey"
|
|
|
+ :size="size"
|
|
|
+ placeholder="输入姓名/身份证号"
|
|
|
+ style="margin-right:10px;"
|
|
|
+ ></el-input>
|
|
|
+ <el-button :size="size" @click="searchData.searchKey = ''"
|
|
|
+ >重置</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
<div>
|
|
|
<el-button :size="size" type="primary" @click="studentPage(-1)"
|
|
|
- >新增</el-button
|
|
|
+ >新增学员</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="size" type="primary" @click="importStudentFunc"
|
|
|
+ >导入学员</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="size" type="primary" @click="goodsCheckBox(-1)"
|
|
|
+ >匹配商品</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="size" type="primary" @click="del(-1)"
|
|
|
+ >批量删除</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="size" type="primary" @click="backFunc"
|
|
|
+ >上一步</el-button
|
|
|
+ >
|
|
|
+ <el-button :size="size" type="warning" @click="submit"
|
|
|
+ >提交支付</el-button
|
|
|
>
|
|
|
- <el-button :size="size" type="primary">导入学员</el-button>
|
|
|
- <el-button :size="size" type="primary">批量删除</el-button>
|
|
|
- <el-button :size="size" type="warning">下一步</el-button>
|
|
|
</div>
|
|
|
</header>
|
|
|
<el-main>
|
|
|
- <el-table
|
|
|
- :size="size"
|
|
|
- :data="tableData"
|
|
|
- style="width: 100%"
|
|
|
- border
|
|
|
- :header-cell-style="{
|
|
|
- 'background-color': '#eee',
|
|
|
- color: '#333',
|
|
|
- fontSize: '14px'
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-table-column align="center" type="selection" width="55">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" type="index" width="50" label="序号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- v-for="(item, index) in tableSet"
|
|
|
- :key="index"
|
|
|
- align="center"
|
|
|
- :label="item.label"
|
|
|
- :prop="item.prop"
|
|
|
- :width="item.width"
|
|
|
+ <el-form :model="apiData" :rules="rules" ref="ruleForm">
|
|
|
+ <el-table
|
|
|
+ max-height="520px"
|
|
|
+ ref="table"
|
|
|
+ :size="size"
|
|
|
+ :data="
|
|
|
+ apiData.userGoodsList.filter(
|
|
|
+ data =>
|
|
|
+ !searchData.searchKey ||
|
|
|
+ data.realname
|
|
|
+ .toLowerCase()
|
|
|
+ .includes(searchData.searchKey.toLowerCase()) ||
|
|
|
+ data.idCard
|
|
|
+ .toLowerCase()
|
|
|
+ .includes(searchData.searchKey.toLowerCase())
|
|
|
+ )
|
|
|
+ "
|
|
|
+ style="width: 100%"
|
|
|
+ border
|
|
|
+ :header-cell-style="{
|
|
|
+ 'background-color': '#eee',
|
|
|
+ color: '#333',
|
|
|
+ fontSize: '14px'
|
|
|
+ }"
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row[item.prop] }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" type="index" label="操作" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- :size="size"
|
|
|
- @click="studentPage(scope.$index, scope.row)"
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
- <el-button type="text" :size="size" @click="del(scope.$index)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-table-column align="center" type="selection" width="55">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" type="index" width="50" label="序号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in tableSet"
|
|
|
+ :key="index"
|
|
|
+ align="center"
|
|
|
+ :label="item.label"
|
|
|
+ :prop="item.prop"
|
|
|
+ :width="item.width"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ v-if="item.scope == 'input'"
|
|
|
+ :prop="'userGoodsList.' + scope.$index + '.' + item.prop"
|
|
|
+ :rules="rules[item.prop]"
|
|
|
+ >
|
|
|
+ <el-input v-model="scope.row[item.prop]"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-select
|
|
|
+ style="margin-bottom:22px;"
|
|
|
+ v-else-if="item.scope == 'select'"
|
|
|
+ v-model="scope.row[item.prop]"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(items, indexs) in item.options"
|
|
|
+ :key="indexs"
|
|
|
+ :label="items.label"
|
|
|
+ :value="items.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <div v-else-if="item.scope == 'goods'">
|
|
|
+ <div
|
|
|
+ v-for="(items, indexs) in scope.row.goodsList"
|
|
|
+ :key="indexs"
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ items.year +
|
|
|
+ "/" +
|
|
|
+ items.subjectNames +
|
|
|
+ "/" +
|
|
|
+ items.goodsName +
|
|
|
+ "/"
|
|
|
+ }}
|
|
|
+ <span v-if="items.standPrice > 0"
|
|
|
+ >¥{{ items.standPrice | formatPrice }}</span
|
|
|
+ ><span v-else>免费</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.scope == 'price'" style="color:red;">
|
|
|
+ ¥{{ getPrice(scope.row.goodsList) | formatPrice }}
|
|
|
+ </div>
|
|
|
+ <span v-else>{{ scope.row[item.prop] }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="操作"
|
|
|
+ width="160"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ :size="size"
|
|
|
+ @click="goodsCheckBox(scope.$index, scope.row.goodsList)"
|
|
|
+ >匹配商品</el-button
|
|
|
+ >
|
|
|
+ <el-button type="text" :size="size" @click="del(scope.$index)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form>
|
|
|
</el-main>
|
|
|
<student-page ref="studentPage" @backStudentData="backStudentData" />
|
|
|
+ <goodsCheckBox ref="goodsCheckBox" @backGoodsData="backGoodsData" />
|
|
|
+ <import-student ref="importStudent" @backFunc="backStudentFunc" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapGetters } from "vuex";
|
|
|
import studentPage from "./studentPage.vue";
|
|
|
+import goodsCheckBox from "./goodsCheckBox.vue";
|
|
|
+import importStudent from "../../../handle-rollCall/importStudent.vue";
|
|
|
export default {
|
|
|
- components: { studentPage },
|
|
|
+ components: { studentPage, goodsCheckBox, importStudent },
|
|
|
+ props: {
|
|
|
+ apiData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
const edu_level = () => {
|
|
|
let ary = this.$store.state.dictList["edu_level"].map(i => {
|
|
|
@@ -78,76 +189,363 @@ export default {
|
|
|
});
|
|
|
return ary;
|
|
|
};
|
|
|
+ const validateTel = (rule, value, callback) => {
|
|
|
+ var reg = /^1[34578][0-9]{9}$/;
|
|
|
+ if (!reg.test(value)) {
|
|
|
+ return callback(new Error("请输入正确手机号码"));
|
|
|
+ } else if (this.checkTel == value) {
|
|
|
+ return callback(new Error("当前手机号码已被创建"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const validateIdcard = (rule, value, callback) => {
|
|
|
+ let _IDRe18 = /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
|
|
+ let _IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
|
|
|
+ if (!_IDRe18.test(value) && !_IDre15.test(value)) {
|
|
|
+ return callback(new Error("请输入正确身份证号码"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
+ rules: {
|
|
|
+ realname: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
|
|
+ idCard: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ trigger: "blur",
|
|
|
+ validator: validateIdcard
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ telphone: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ trigger: "blur",
|
|
|
+ validator: validateTel
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
size: "small",
|
|
|
- formSet: [
|
|
|
- {
|
|
|
- prop: "goodsType",
|
|
|
- placeholder: "学历",
|
|
|
- scope: "select",
|
|
|
- options: edu_level()
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "searchKey",
|
|
|
- placeholder: "输入姓名/身份证号/商品名称"
|
|
|
- }
|
|
|
- ],
|
|
|
- formData: {},
|
|
|
+ searchData: {},
|
|
|
+ checkTel: "",
|
|
|
tableSet: [
|
|
|
{
|
|
|
label: "姓名",
|
|
|
- prop: "name"
|
|
|
+ prop: "realname",
|
|
|
+ scope: "input",
|
|
|
+ width: "120px"
|
|
|
},
|
|
|
{
|
|
|
- label: "性别",
|
|
|
- prop: "sex"
|
|
|
+ label: "身份证号",
|
|
|
+ prop: "idCard",
|
|
|
+ scope: "input",
|
|
|
+ width: "200px"
|
|
|
},
|
|
|
{
|
|
|
- label: "身份证号",
|
|
|
- prop: "idCard"
|
|
|
+ label: "手机号码",
|
|
|
+ prop: "telphone",
|
|
|
+ scope: "input",
|
|
|
+ width: "150px"
|
|
|
},
|
|
|
{
|
|
|
label: "学历",
|
|
|
- prop: "edu"
|
|
|
+ prop: "eduLevel",
|
|
|
+ scope: "select",
|
|
|
+ options: edu_level(),
|
|
|
+ width: "140px"
|
|
|
},
|
|
|
{
|
|
|
label: "所属公司",
|
|
|
- prop: "company"
|
|
|
+ prop: "companyName",
|
|
|
+ scope: "input",
|
|
|
+ width: "220px"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "年份/科目/商品/价格",
|
|
|
+ scope: "goods",
|
|
|
+ width: "350px"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "金额",
|
|
|
+ scope: "price",
|
|
|
+ width: "180px"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["educationType", "businessList_t"]),
|
|
|
+ getEduName: function() {
|
|
|
+ return function(id) {
|
|
|
+ if (this.educationType && this.educationType.length > 0) {
|
|
|
+ let ary = this.educationType.find(i => i.id == id) || {};
|
|
|
+ return ary.educationName;
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getBusName: function() {
|
|
|
+ return function(id) {
|
|
|
+ if (this.businessList_t && this.businessList_t.length > 0) {
|
|
|
+ let ary = this.businessList_t.find(i => i.id == id) || {};
|
|
|
+ return ary.projectName + " - " + ary.businessName;
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getPrice: function() {
|
|
|
+ return function(list) {
|
|
|
+ if (list && list.length > 0) {
|
|
|
+ let num = 0;
|
|
|
+ list.forEach(i => (num += i.standPrice));
|
|
|
+ return num || 0;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
}
|
|
|
- ],
|
|
|
- tableData: [{
|
|
|
- name:"tang"
|
|
|
- },{
|
|
|
- name:"lian"
|
|
|
- },{
|
|
|
- name:"feng"
|
|
|
- }]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getTotal: function() {
|
|
|
+ return function(list) {
|
|
|
+ if (list && list.length > 0) {
|
|
|
+ let num = 0;
|
|
|
+ list.forEach(i => (num += (i.goodsList && i.goodsList.length) || 0));
|
|
|
+ return num || 0;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getTotalPrice: function() {
|
|
|
+ return function(list) {
|
|
|
+ if (list && list.length > 0) {
|
|
|
+ let num = 0;
|
|
|
+ list.forEach(i => {
|
|
|
+ i.goodsList &&
|
|
|
+ i.goodsList.forEach(k => {
|
|
|
+ num += k.standPrice || 0;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return num || 0;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ const apiData = {
|
|
|
+ goodsType: 1,
|
|
|
+ educationTypeId: 107,
|
|
|
+ projectId: 3665,
|
|
|
+ businessId: 34355,
|
|
|
+ inputFrom: 1,
|
|
|
+ payType: 1,
|
|
|
+ userGoodsList: [
|
|
|
+ {
|
|
|
+ realname: "唐",
|
|
|
+ sex: "男",
|
|
|
+ idCard: "445224199901043000",
|
|
|
+ telphone: "13602712680",
|
|
|
+ eduLevel: "小学",
|
|
|
+ companyName: "中正",
|
|
|
+ goodsList: [
|
|
|
+ {
|
|
|
+ goodsId: 303723,
|
|
|
+ goodsName: "2023年一级建造师-选修1",
|
|
|
+ year: 2023,
|
|
|
+ subjectNames: "市政,必修,矿业,建筑,机电,水利水电,公路",
|
|
|
+ standPrice: 3433523
|
|
|
+ },
|
|
|
+ {
|
|
|
+ goodsId: 303724,
|
|
|
+ goodsName: "2023年一级建造师-选修2",
|
|
|
+ year: 2023,
|
|
|
+ subjectNames: "市政,必修,矿业,建筑,机电,水利水电,公路",
|
|
|
+ standPrice: 34424
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ realname: "连",
|
|
|
+ sex: "男",
|
|
|
+ idCard: "445224199901013055",
|
|
|
+ telphone: "13602711111",
|
|
|
+ eduLevel: "初中",
|
|
|
+ companyName: "中正",
|
|
|
+ goodsList: [
|
|
|
+ {
|
|
|
+ goodsId: 303723,
|
|
|
+ goodsName: "2023年一级建造师-选修1",
|
|
|
+ year: 2023,
|
|
|
+ subjectNames: "市政,必修,矿业,建筑,机电,水利水电,公路",
|
|
|
+ standPrice: 3433523
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ realname: "锋",
|
|
|
+ sex: "男",
|
|
|
+ idCard: "445224199901013056",
|
|
|
+ telphone: "13602711112",
|
|
|
+ eduLevel: "初中",
|
|
|
+ companyName: "中正",
|
|
|
+ goodsList: [
|
|
|
+ {
|
|
|
+ goodsId: 303723,
|
|
|
+ goodsName: "2023年一级建造师-选修1",
|
|
|
+ year: 2023,
|
|
|
+ subjectNames: "市政,必修,矿业,建筑,机电,水利水电,公路",
|
|
|
+ standPrice: 3433523
|
|
|
+ },
|
|
|
+ {
|
|
|
+ goodsId: 303722,
|
|
|
+ goodsName: "2023年一级建造师-必修",
|
|
|
+ year: 2023,
|
|
|
+ subjectNames: "市政,必修,矿业,建筑,机电,水利水电,公路",
|
|
|
+ standPrice: 15641651
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ submit() {
|
|
|
+ if (this.apiData.userGoodsList.length == 0) {
|
|
|
+ this.$message.warning("请新增学员数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let status = this.apiData.userGoodsList.every(i => {
|
|
|
+ return i.goodsList && i.goodsList.length > 0;
|
|
|
+ });
|
|
|
+ if (!status) {
|
|
|
+ this.$message.warning("请为学员匹配商品");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.checkTel = "";
|
|
|
+ this.$refs["ruleForm"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ let ary = JSON.parse(JSON.stringify(this.apiData));
|
|
|
+ ary.userGoodsList.forEach(i => {
|
|
|
+ i.user = {
|
|
|
+ realname: i.realname,
|
|
|
+ sex: i.sex,
|
|
|
+ idCard: i.idCard,
|
|
|
+ companyName: i.companyName,
|
|
|
+ telphone: i.telphone,
|
|
|
+ eduLevel: i.eduLevel
|
|
|
+ };
|
|
|
+ delete i.realname;
|
|
|
+ delete i.sex;
|
|
|
+ delete i.idCard;
|
|
|
+ delete i.companyName;
|
|
|
+ delete i.telphone;
|
|
|
+ delete i.eduLevel;
|
|
|
+ });
|
|
|
+ this.$request
|
|
|
+ .orderhandle(ary)
|
|
|
+ .then(res => {
|
|
|
+ this.checkTel = "";
|
|
|
+ this.$emit("backData", res.data);
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ if (err.code == 439) {
|
|
|
+ this.checkTel = err.msg;
|
|
|
+ this.$refs["ruleForm"].validate();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
//学员编辑
|
|
|
studentPage(index, row) {
|
|
|
- console.log(index);
|
|
|
this.$refs.studentPage.openBoxs(index, row);
|
|
|
},
|
|
|
- backStudentData(index, row) {
|
|
|
- if (index == -1) {
|
|
|
- this.tableData.push(row);
|
|
|
- } else {
|
|
|
- this.tableData.splice(index, 1, row);
|
|
|
+ //匹配商品
|
|
|
+ goodsCheckBox(index, row) {
|
|
|
+ if (index == -1 && this.$refs.table.selection.length == 0) {
|
|
|
+ this.$message.error("请勾选需要匹配商品的学员");
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.$refs.goodsCheckBox.openBoxs(index, row, this.apiData);
|
|
|
},
|
|
|
- del(index) {
|
|
|
- this.$confirm("确定删除吗", "提示", {
|
|
|
+ backFunc() {
|
|
|
+ this.$confirm("返回上一步将导致当前页数据丢失,是否继续?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
|
- this.tableData.splice(index, 1);
|
|
|
+ this.$emit("backPage");
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
+ importStudentFunc() {
|
|
|
+ this.$refs.importStudent.openBoxs(true);
|
|
|
+ },
|
|
|
+ backStudentFunc(row) {
|
|
|
+ this.apiData.userGoodsList.push(...row);
|
|
|
+ },
|
|
|
+ backStudentData(index, row) {
|
|
|
+ if (index == -1) {
|
|
|
+ this.apiData.userGoodsList.push(row);
|
|
|
+ } else {
|
|
|
+ this.apiData.userGoodsList.splice(index, 1, row);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ del(index) {
|
|
|
+ if (index == -1) {
|
|
|
+ if (this.$refs.table.selection.length > 0) {
|
|
|
+ this.$confirm("确定批量删除吗", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$refs.table.selection.forEach(i => {
|
|
|
+ this.apiData.userGoodsList = this.apiData.userGoodsList.filter(
|
|
|
+ item => {
|
|
|
+ return item != i;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ } else {
|
|
|
+ this.$message.error("请选择需要删除的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$confirm("确定删除吗", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.apiData.userGoodsList.splice(index, 1);
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ },
|
|
|
+ backGoodsData(index, ary) {
|
|
|
+ if (index == -1) {
|
|
|
+ this.$refs.table.selection.forEach((i, k) => {
|
|
|
+ i.goodsList = ary;
|
|
|
+ });
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ } else {
|
|
|
+ this.$set(this.apiData.userGoodsList[index], "goodsList", ary);
|
|
|
+ }
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ },
|
|
|
search() {},
|
|
|
init() {}
|
|
|
}
|
|
|
@@ -155,6 +553,19 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.header_t_0 {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 14px;
|
|
|
+ span {
|
|
|
+ margin-right: 14px;
|
|
|
+ color: #999;
|
|
|
+ i {
|
|
|
+ font-style: normal;
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
.header_t {
|
|
|
display: flex;
|
|
|
align-items: center;
|