|
@@ -49,7 +49,7 @@
|
|
|
<el-button type="primary" native-type="reset">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</save-form>
|
|
|
- <el-button @click="addMusicVisible = true" type="primary" v-permission="'studentInstrument/add'"
|
|
|
+ <el-button @click="operationStudent('create')" type="primary" v-permission="'studentInstrument/add'"
|
|
|
>新增乐器</el-button
|
|
|
>
|
|
|
<div class="tableWrap">
|
|
@@ -77,13 +77,30 @@
|
|
|
{{ scope.row.status?'是':'否' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="乐保有效期" align="center" prop="studentNum">
|
|
|
+ <el-table-column label="乐保有效期" align="center" width="350px" prop="studentNum">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{ scope.row.startTime|formatTimer}}~{{scope.row.endTime | formatTimer}}
|
|
|
+ {{ scope.row.startTime}}~{{scope.row.endTime}}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <auth :auths="['studentInstrument/update']">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="operationStudent('update', scope.row)"
|
|
|
+ >修改</el-button>
|
|
|
+ </auth>
|
|
|
+ <auth :auths="['studentInstrument/del']">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="removeMusic(scope.row)"
|
|
|
+ >删除</el-button>
|
|
|
+ </auth>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
save-key="studentDetail-studentLebao"
|
|
@@ -96,12 +113,12 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
- title="新增乐器"
|
|
|
+ :title="operationStatus == 'create' ? '新增乐器' : '修改乐器'"
|
|
|
width="600px"
|
|
|
:visible.sync="addMusicVisible"
|
|
|
v-if="addMusicVisible"
|
|
|
>
|
|
|
- <addMusic :categoryList='categoryList' ref='addMusic' @getList='getList' @close='addMusicVisible = false'/>
|
|
|
+ <addMusic :categoryList='categoryList' :operationData="operationData" :operationStatus="operationStatus" ref='addMusic' @getList='getList' @close='addMusicVisible = false'/>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="addMusicVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="addMusicSubmit">确 定</el-button>
|
|
@@ -112,7 +129,7 @@
|
|
|
<script>
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import addMusic from "../modals/addMusic";
|
|
|
-import { getInstrument } from "@/api/buildTeam";
|
|
|
+import { getInstrument, studentInstrumentDel } from "@/api/buildTeam";
|
|
|
import { categoryListTree } from "@/api/businessManager";
|
|
|
export default {
|
|
|
components: { pagination, addMusic },
|
|
@@ -123,7 +140,7 @@ export default {
|
|
|
searchForm: {
|
|
|
specification:'',
|
|
|
goodsCategoryId: "",
|
|
|
- studentId:this.$route.query.userId
|
|
|
+ studentId: this.$route.query.userId
|
|
|
},
|
|
|
pageInfo: {
|
|
|
// 分页规则
|
|
@@ -132,6 +149,8 @@ export default {
|
|
|
total: 0, // 总条数
|
|
|
page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
},
|
|
|
+ operationStatus: 'create',
|
|
|
+ operationData: null,
|
|
|
addMusicVisible: false,
|
|
|
categoryList: [],
|
|
|
};
|
|
@@ -162,6 +181,29 @@ export default {
|
|
|
addMusicSubmit() {
|
|
|
this.$refs.addMusic.addMusicSubmit()
|
|
|
},
|
|
|
+ operationStudent(type, row) {
|
|
|
+ if(type == 'update') {
|
|
|
+ this.operationData = row
|
|
|
+ } else if(type == 'create') {
|
|
|
+ this.operationData = null
|
|
|
+ }
|
|
|
+ this.operationStatus = type
|
|
|
+ this.addMusicVisible = true
|
|
|
+ },
|
|
|
+ removeMusic(row) {
|
|
|
+ // 删除乐器
|
|
|
+ this.$confirm(`您确定删除吗?`, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(async() => {
|
|
|
+ try {
|
|
|
+ let res = await studentInstrumentDel({ id: row.id, studentId: this.searchForm.studentId})
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.getList()
|
|
|
+ } catch { }
|
|
|
+ });
|
|
|
+ },
|
|
|
getCategory() {
|
|
|
let params = {
|
|
|
delFlag: 0,
|