班组&能源基础

This commit is contained in:
2023-10-24 15:16:20 +08:00
parent 9be57ad750
commit ac4565e587
37 changed files with 2029 additions and 74 deletions

View File

@@ -41,14 +41,18 @@
>
<group-team-add ref="groupList" @successSubmit="successSubmit" />
</base-dialog>
<!-- 组员编辑 -->
<worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit>
</div>
</template>
<script>
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
import { parseTime } from '@/utils/ruoyi'
import GroupTeamAdd from './components/groupTeamAdd.vue'
import GroupTeamAdd from './components/groupTeamAdd'
import StatusBtn from './components/statusBtn.vue'
import WorkerOperate from './components/workerOperate.vue'
import WorkerEdit from './components/workerEdit.vue';
const tableProps = [
{
prop: 'createTime',
@@ -62,7 +66,7 @@ const tableProps = [
},
{
prop: 'code',
label: '班组编码',
label: '编码',
minWidth: 220
},
{
@@ -71,17 +75,22 @@ const tableProps = [
},
{
prop: 'leaderName',
label: '班组组长'
label: '组长'
},
{
prop: 'enabled',
label: '班组状态',
subcomponent: StatusBtn
}
},
{
prop: 'workerName',
label: '组员',
subcomponent: WorkerOperate
},
]
export default {
name: "GroupTeam",
components: { GroupTeamAdd },
components: { GroupTeamAdd, WorkerEdit },
data() {
return {
formConfig: [
@@ -93,9 +102,9 @@ export default {
},
{
type: 'input',
label: '班组编码',
placeholder: '班组编码',
param: 'code'
label: '组长',
placeholder: '组长',
param: 'leaderName'
},
{
type: 'button',
@@ -144,7 +153,8 @@ export default {
pageSize: 20,
name: null,
code: null
}
},
paramVisible: false
};
},
created() {
@@ -158,8 +168,8 @@ export default {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.leaderName = val.leaderName
this.queryParams.name = val.name
this.queryParams.code = val.code
this.getList()
break
default:
@@ -191,12 +201,20 @@ export default {
}
},
// 班组状态
handleTableEvents(data) {
updateGroupTeam({ ...data }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
}
})
handleTableEvents(params) {
console.log(params)
if (params.name === 'state') {// 班组状态
updateGroupTeam({ ...params.payload }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
}
})
}else {// 编辑&查看
this.paramVisible = true
this.$nextTick(() => {
this.$refs.workerEditParam.init(params)
})
}
},
handleCancel() {
this.$refs.groupList.formClear()
@@ -219,6 +237,9 @@ export default {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
closeDrawer() {
this.getList()
}
}
};