| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div style="margin-bottom: 10px"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="openDialog('add',{})" |
| | | >新增</el-button> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="openDialog('add',{})" |
| | | >新增</el-button> |
| | | </el-form-item> |
| | | <el-form-item label="课程名称:" > |
| | | <el-input v-model="data.queryParams.name" placeholder="请输入课程名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button |
| | | type="primary" |
| | | @click="getList" |
| | | >查询</el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | @click="reset" |
| | | >重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | |
| | | <template #default="scope"> |
| | | <div v-if="data.isAdmin"> |
| | | <div v-if="scope.row.state !== 3"> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="primary" v-if="scope.row.state == 1" @click="openApprove(scope.row)">审核</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="primary" @click="toChapters(scope.row)">章节</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button> |
| | | </div> |
| | |
| | | <div v-else-if="!data.isAdmin"> |
| | | <div v-if="scope.row.state !== 2"> |
| | | <el-button link type="primary" v-if="scope.row.state == 0 || scope.row.state == 3" @click="submitApprove(scope.row)">提交审核</el-button> |
| | | <el-button link type="primary" v-if="scope.row.state == 1" @click="submitApprove(scope.row)">取消审批</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="primary" @click="toChapters(scope.row)">章节</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button> |
| | | <el-button link type="primary" v-if="scope.row.state == 1" @click="submitApprove(scope.row)">取消审核</el-button> |
| | | <el-button link type="primary" v-if="scope.row.state !== 1" @click="openDialog('edit',scope.row)" >编辑</el-button> |
| | | <el-button link type="primary" v-if="scope.row.state !== 1" @click="toChapters(scope.row)">章节</el-button> |
| | | <el-button link type="danger" v-if="scope.row.state !== 1" @click="handleDelete(scope.row)">删除</el-button> |
| | | </div> |
| | | <div v-else>--</div> |
| | | |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | name: '' |
| | | }, |
| | | total: 0, |
| | | dataList: [], |
| | |
| | | |
| | | /** 重置新增的表单以及其他数据 */ |
| | | function reset() { |
| | | proxy.resetForm("roleRef"); |
| | | data.queryParams = { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | name: '' |
| | | } |
| | | getList() |
| | | } |
| | | const handleDelete = (val) => { |
| | | ElMessageBox.confirm( |
| | |
| | | } |
| | | const submitApprove = async (val) => { |
| | | let param = { |
| | | companyId: val.companyId, |
| | | id: val.id, |
| | | state: null |
| | | } |