基地校初选

This commit is contained in:
paidaxing444 2020-08-21 11:10:32 +08:00
parent ca4af92dc9
commit a149333947
5 changed files with 82 additions and 31 deletions
ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs
ruoyi-ui/src
api/jxjs
views/jxjs

@ -1,6 +1,7 @@
package com.ruoyi.web.controller.jxjs;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -22,14 +23,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
/**
* 见习教师基本信息Controller
*
*
* @author ruoyi
* @date 2020-08-20
*/
@RestController
@RequestMapping("/jxjs/jxjsjbxx")
public class TsbzJxjsjbxxController extends BaseController
{
public class TsbzJxjsjbxxController extends BaseController {
@Autowired
private ITsbzJxjsjbxxService tsbzJxjsjbxxService;
@ -38,8 +38,7 @@ public class TsbzJxjsjbxxController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('jxjs:jdx:list')")
@GetMapping("/listnotjdx")
public TableDataInfo listnotjdx(TsbzJxjsjbxx tsbzJxjsjbxx)
{
public TableDataInfo listnotjdx(TsbzJxjsjbxx tsbzJxjsjbxx) {
startPage();
List<TsbzJxjsjbxx> list = tsbzJxjsjbxxService.selectTsbzJxjsjbxxListnotjdx(tsbzJxjsjbxx);
return getDataTable(list);
@ -50,8 +49,7 @@ public class TsbzJxjsjbxxController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:list')")
@GetMapping("/list")
public TableDataInfo list(TsbzJxjsjbxx tsbzJxjsjbxx)
{
public TableDataInfo list(TsbzJxjsjbxx tsbzJxjsjbxx) {
startPage();
List<TsbzJxjsjbxx> list = tsbzJxjsjbxxService.selectTsbzJxjsjbxxList(tsbzJxjsjbxx);
return getDataTable(list);
@ -63,8 +61,7 @@ public class TsbzJxjsjbxxController extends BaseController
@PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:export')")
@Log(title = "见习教师基本信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TsbzJxjsjbxx tsbzJxjsjbxx)
{
public AjaxResult export(TsbzJxjsjbxx tsbzJxjsjbxx) {
List<TsbzJxjsjbxx> list = tsbzJxjsjbxxService.selectTsbzJxjsjbxxList(tsbzJxjsjbxx);
ExcelUtil<TsbzJxjsjbxx> util = new ExcelUtil<TsbzJxjsjbxx>(TsbzJxjsjbxx.class);
return util.exportExcel(list, "jxjsjbxx");
@ -75,8 +72,7 @@ public class TsbzJxjsjbxxController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(tsbzJxjsjbxxService.selectTsbzJxjsjbxxById(id));
}
@ -86,8 +82,7 @@ public class TsbzJxjsjbxxController extends BaseController
@PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:add')")
@Log(title = "见习教师基本信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TsbzJxjsjbxx tsbzJxjsjbxx)
{
public AjaxResult add(@RequestBody TsbzJxjsjbxx tsbzJxjsjbxx) {
return toAjax(tsbzJxjsjbxxService.insertTsbzJxjsjbxx(tsbzJxjsjbxx));
}
@ -97,19 +92,41 @@ public class TsbzJxjsjbxxController extends BaseController
@PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:edit')")
@Log(title = "见习教师基本信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TsbzJxjsjbxx tsbzJxjsjbxx)
{
public AjaxResult edit(@RequestBody TsbzJxjsjbxx tsbzJxjsjbxx) {
return toAjax(tsbzJxjsjbxxService.updateTsbzJxjsjbxx(tsbzJxjsjbxx));
}
/**
* 修改见习教师基本信息
*/
@PreAuthorize("@ss.hasPermi('jxjs:jdx:edit')")
@Log(title = "见习教师基本信息", businessType = BusinessType.UPDATE)
@PostMapping("/updatejsjdx/{ids}/{jdxid}")
public AjaxResult updateJsJdx(@PathVariable Long[] ids, @PathVariable String jdxid) {
int iCount = 0;
System.out.println("jsid=" + ids[0]);
System.out.println("jdxid=" + jdxid);
if (ids == null || ids.length == 0) {
return AjaxResult.error("请选择要分配的见习教师");
}
TsbzJxjsjbxx tsbzJxjsjbxx = null;
for (int i = 0; i < ids.length; i++) {
tsbzJxjsjbxx = new TsbzJxjsjbxx();
tsbzJxjsjbxx.setId(ids[i]);
tsbzJxjsjbxx.setJdxid(jdxid);
iCount = iCount + (tsbzJxjsjbxxService.updateTsbzJxjsjbxx(tsbzJxjsjbxx));
}
return toAjax(iCount);
}
/**
* 删除见习教师基本信息
*/
@PreAuthorize("@ss.hasPermi('jxjs:jxjsjbxx:remove')")
@Log(title = "见习教师基本信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(tsbzJxjsjbxxService.deleteTsbzJxjsjbxxByIds(ids));
}
}

@ -35,6 +35,14 @@ export function addJxjsjbxx(data) {
})
}
// 新增基地校
export function updateJxjsJdx(id, jdxid) {
return request({
url: '/jxjs/jxjsjbxx/updatejsjdx/' + id + "/" + jdxid,
method: 'post'
})
}
// 修改见习教师基本信息
export function updateJxjsjbxx(data) {
return request({
@ -59,4 +67,4 @@ export function exportJxjsjbxx(query) {
method: 'get',
params: query
})
}
}

@ -285,6 +285,9 @@ export default {
};
},
created() {
const jdxId = this.$route.params && this.$route.params.id;
//console.log(jdxId);
this.queryParams.jdxid = jdxId;
this.getList();
this.getDicts("sys_user_sex").then((response) => {
this.xbOptions = response.data;

@ -192,22 +192,20 @@
<!-- 添加或修改基地校对话框 -->
<el-dialog title="基地校分配见习教师" :visible.sync="open_fpjs" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-table :data="jxjsjbxxList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="编号" align="center" prop="id" /> -->
<el-table-column label="姓名" align="center" prop="name" />
<!-- <el-table-column label="性别" align="center" prop="xb" :formatter="xbFormat" />
<el-table :data="jxjsjbxxList" @selection-change="handleSelectionChangeFpjs">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="编号" align="center" prop="id" /> -->
<el-table-column label="姓名" align="center" prop="name" />
<!-- <el-table-column label="性别" align="center" prop="xb" :formatter="xbFormat" />
<el-table-column label="政治面貌" align="center" prop="zzmm" :formatter="zzmmFormat" />
<el-table-column label="民族" align="center" prop="mz" :formatter="mzFormat" />
<el-table-column label="学历" align="center" prop="xl" :formatter="xlFormat" />
<el-table-column label="学位" align="center" prop="xw" :formatter="xwFormat" />
<el-table-column label="是否师范生" align="center" prop="sfsfs" :formatter="sfsfsFormat" />-->
<el-table-column label="录取年份" align="center" prop="lqnf" />
</el-table>
</el-form>
<el-table-column label="是否师范生" align="center" prop="sfsfs" :formatter="sfsfsFormat" />-->
<el-table-column label="录取年份" align="center" prop="lqnf" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm_fpjs"> </el-button>
<el-button @click="cancel_fpjs"> </el-button>
</div>
</el-dialog>
@ -217,7 +215,11 @@
<script>
import { listJdx, getJdx, delJdx, addJdx, updateJdx } from "@/api/jxjs/jdx";
import { listJxjsjbxxnotjdx, getJxjsjbxx } from "@/api/jxjs/jxjsjbxx";
import {
listJxjsjbxxnotjdx,
getJxjsjbxx,
updateJxjsJdx,
} from "@/api/jxjs/jxjsjbxx";
export default {
name: "Jdx",
@ -227,6 +229,8 @@ export default {
loading: true,
//
ids: [],
jdxid: "",
jsIds: [],
//
single: true,
//
@ -360,6 +364,10 @@ export default {
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
//
handleSelectionChangeFpjs(selection) {
this.jsIds = selection.map((item) => item.id);
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
@ -400,6 +408,20 @@ export default {
}
});
},
/** 分配教师提交按钮 */
submitForm_fpjs() {
if (this.jsIds == null || this.jsIds.length == 0) {
this.msgError("请选择要分配的教师");
} else {
console.log(this.jsIds[0]);
updateJxjsJdx(this.jsIds, this.jdxid).then((response) => {
if (response.code === 200) {
this.msgSuccess("分配成功");
this.open_fpjs = false;
}
});
}
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
@ -421,6 +443,7 @@ export default {
handleFpjs(row) {
const ids = row.id || this.ids;
console.log(ids);
this.jdxid = ids;
this.open_fpjs = true;
this.getJxjsList();
},