更新班组
This commit is contained in:
125
src/views/group/Schedule/add-group.vue
Normal file
125
src/views/group/Schedule/add-group.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:27:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-15 16:47:28
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:selectWidth="55"
|
||||
@selection-change="selectChange"
|
||||
:table-props="tableProps"
|
||||
:page="1"
|
||||
:limit="999"
|
||||
:table-data="tableData"></base-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listByDeptId } from '@/api/group/Schedule';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
label: '班组编号',
|
||||
width: 140,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班组名称',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'deptId',
|
||||
label: '所属部门',
|
||||
},
|
||||
{
|
||||
prop: 'leaderName',
|
||||
label: '组长',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: listByDeptId,
|
||||
},
|
||||
tableProps,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '班组编号',
|
||||
placeholder: '班组编号',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '班组名称',
|
||||
placeholder: '班组名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
formInline: {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
code: '',
|
||||
name: '',
|
||||
},
|
||||
selectedList: [],
|
||||
deptId: undefined
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
init(id){
|
||||
this.deptId = id
|
||||
this.getDataList()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.urlOptions
|
||||
.getDataListURL(this.deptId)
|
||||
.then((response) => {
|
||||
this.tableData = response.data;
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.formInline.name = val.name;
|
||||
this.formInline.code = val.code;
|
||||
this.getDataList();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
selectChange(val) {
|
||||
this.selectedList = val;
|
||||
},
|
||||
dataFormSubmit() {
|
||||
if (this.selectedList && this.selectedList.length > 0) {
|
||||
this.$emit('refreshTableData', this.selectedList);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user