|
@@ -9,13 +9,12 @@
|
|
|
prop="paySeniorNum"
|
|
|
style="width: 100%"
|
|
|
:rules="[
|
|
|
- {
|
|
|
- pattern:
|
|
|
- /^[1-9]d*$/,
|
|
|
- message: '请输入正确的资格数',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ]"
|
|
|
+ {
|
|
|
+ pattern: /^[1-9]d*$/,
|
|
|
+ message: '请输入正确的资格数',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ ]"
|
|
|
>
|
|
|
<el-input
|
|
|
v-model="topForm.paySeniorNum"
|
|
@@ -24,14 +23,17 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="赠课资格:" v-if="hasGive" :rules="[
|
|
|
- {
|
|
|
- pattern:
|
|
|
- /^[1-9]d*$/,
|
|
|
- message: '请输入正确的资格数',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ]">
|
|
|
+ <el-form-item
|
|
|
+ label="赠课资格:"
|
|
|
+ v-if="hasGive"
|
|
|
+ :rules="[
|
|
|
+ {
|
|
|
+ pattern: /^[1-9]d*$/,
|
|
|
+ message: '请输入正确的资格数',
|
|
|
+ trigger: 'blur',
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="topForm.giveSeniorNum"
|
|
|
style="width: 380px"
|
|
@@ -39,7 +41,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <p style="color:red;margin-bottom:20px;"> 资格调整不影响该活动学员购买次数</p>
|
|
|
+ <p style="color: red; margin-bottom: 20px">
|
|
|
+ 资格调整不影响该活动学员购买次数
|
|
|
+ </p>
|
|
|
</el-form>
|
|
|
<el-alert title="添加学员" :closable="false" class="alert" type="info" />
|
|
|
<el-form
|
|
@@ -163,40 +167,40 @@
|
|
|
ref="tableList"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
@select="onTableSelect"
|
|
|
- row-key="id"
|
|
|
+ row-key="userId"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55"> </el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="studentId"
|
|
|
+ prop="organName"
|
|
|
label="分部"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="studentId"
|
|
|
+ prop="userId"
|
|
|
label="学员编号"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="studentId"
|
|
|
+ prop="username"
|
|
|
label="学员姓名"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="studentId"
|
|
|
+ prop="phone"
|
|
|
label="手机号"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="studentId"
|
|
|
+ prop="subjectNames"
|
|
|
label="声部"
|
|
|
></el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
- :total="rules.total"
|
|
|
- :page="rules.page"
|
|
|
- :limit="rules.limit"
|
|
|
- :page-sizes="rules.page_size"
|
|
|
+ :total.sync="rules.total"
|
|
|
+ :page.sync="rules.page"
|
|
|
+ :limit.sync="rules.limit"
|
|
|
+ :page-sizes.sync="rules.page_size"
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
</div>
|
|
@@ -204,9 +208,11 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
+import { getStudentList } from "@/api/vipSeting";
|
|
|
+
|
|
|
export default {
|
|
|
components: { pagination },
|
|
|
- props: ["organList","hasGive"],
|
|
|
+ props: ["organList", "hasGive"],
|
|
|
data() {
|
|
|
return {
|
|
|
topForm: {
|
|
@@ -232,26 +238,46 @@ export default {
|
|
|
},
|
|
|
async mounted() {
|
|
|
await this.$store.dispatch("setSubjects");
|
|
|
+ this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
- search() {},
|
|
|
- onReSet() {},
|
|
|
- getList() {
|
|
|
- /**
|
|
|
- * this.tableList = res.data.rows;
|
|
|
- this.rules.total = res.data.total;
|
|
|
- let idList = this.deleteList.map((course) => {
|
|
|
- return course.id;
|
|
|
- });
|
|
|
- this.isDetele = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.tableList.forEach((course) => {
|
|
|
- if (idList.indexOf(course.id) != -1) {
|
|
|
- this.$refs.tableList.toggleRowSelection(course, true);
|
|
|
- }
|
|
|
- });
|
|
|
- this.isDetele = false;
|
|
|
+ search() {
|
|
|
+ this.rules.page =1;
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ onReSet() {
|
|
|
+ this.$refs.searchForm.resetFields();
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ async getList() {
|
|
|
+ try {
|
|
|
+ const res = await getStudentList({
|
|
|
+ ...this.searchForm,
|
|
|
+ page: this.rules.page,
|
|
|
+ rows: this.rules.limit,
|
|
|
+ });
|
|
|
+ this.tableList = res.data.rows;
|
|
|
+ this.rules.total = res.data.total;
|
|
|
+ let idList = this.deleteList.map((course) => {
|
|
|
+ return course.userId;
|
|
|
+ });
|
|
|
+ this.isDetele = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.tableList.forEach((course) => {
|
|
|
+
|
|
|
+ if (idList.indexOf(course.userId) != -1) {
|
|
|
+ console.log(course)
|
|
|
+ this.$refs.tableList.toggleRowSelection(course, true);
|
|
|
+ }
|
|
|
});
|
|
|
+ this.isDetele = false;
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
*/
|
|
|
},
|
|
|
handleSelectionChange(arr) {
|
|
@@ -260,7 +286,7 @@ export default {
|
|
|
// 有可能加 有可能减
|
|
|
this.deleteList = this.deleteList.concat(arr);
|
|
|
// 去重
|
|
|
- this.deleteList = this.$helpers.lodash.uniqBy(this.deleteList, "id");
|
|
|
+ this.deleteList = this.$helpers.lodash.uniqBy(this.deleteList, "userId");
|
|
|
}
|
|
|
// else if(){}
|
|
|
else {
|
|
@@ -268,13 +294,13 @@ export default {
|
|
|
// 有2种 1是新页
|
|
|
// 2是点击反选
|
|
|
let idList = this.deleteList.map((course) => {
|
|
|
- return course.id;
|
|
|
+ return course.userId;
|
|
|
});
|
|
|
this.$nextTick(() => {
|
|
|
let tableIdList = [];
|
|
|
this.tableList.forEach((course) => {
|
|
|
- tableIdList.push(course.id);
|
|
|
- if (idList.indexOf(course.id) != -1) {
|
|
|
+ tableIdList.push(course.userId);
|
|
|
+ if (idList.indexOf(course.userId) != -1) {
|
|
|
this.$refs.tableList.toggleRowSelection(course, false);
|
|
|
// 删除这个元素
|
|
|
}
|
|
@@ -282,7 +308,7 @@ export default {
|
|
|
this.deleteList = this.$helpers.lodash.remove(
|
|
|
this.deleteList,
|
|
|
function (item) {
|
|
|
- return tableIdList.indexOf(item.id) == -1;
|
|
|
+ return tableIdList.indexOf(item.userId) == -1;
|
|
|
}
|
|
|
);
|
|
|
if (this.deleteList.length <= 0) {
|
|
@@ -293,10 +319,10 @@ export default {
|
|
|
},
|
|
|
onTableSelect(rows, row) {
|
|
|
let idList = this.deleteList.map((course) => {
|
|
|
- return course.id;
|
|
|
+ return course.userId;
|
|
|
});
|
|
|
- if (idList.indexOf(row.id) != -1) {
|
|
|
- this.deleteList.splice(idList.indexOf(row.id), 1);
|
|
|
+ if (idList.indexOf(row.userId) != -1) {
|
|
|
+ this.deleteList.splice(idList.indexOf(row.userId), 1);
|
|
|
if (this.deleteList.length <= 0) {
|
|
|
this.clearCom();
|
|
|
}
|