部门相关调整

This commit is contained in:
andy 2026-07-04 10:02:36 +08:00
parent d1fc734393
commit 8145cfa33b
2 changed files with 53 additions and 8 deletions

View File

@ -59,7 +59,7 @@
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
<el-table-column prop="leader" label="负责人" width="260"></el-table-column>
<el-table-column prop="phone" label="联系电话" width="260"></el-table-column>
<el-table-column prop="isOverTime" label="是否加班" width="260">
<el-table-column prop="isOverTime" label="是否加班" width="180">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isOverTime"
@ -71,6 +71,18 @@
/>
</template>
</el-table-column>
<el-table-column prop="isShowFinancial" label="是否用作财务展示" width="180">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShowFinancial"
:active-value="1"
:inactive-value="0"
active-text="是"
inactive-text="否"
@change="handleIsShowFinancialChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
@ -150,7 +162,7 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="10">
<el-form-item label="是否加班" prop="isOverTime">
<el-radio-group v-model="form.isOverTime">
<el-radio :label="1"></el-radio>
@ -158,6 +170,14 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="14">
<el-form-item label="是否作为薪资导出部门" prop="isShowFinancial" label-width="180px">
<el-radio-group v-model="form.isShowFinancial">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
@ -229,7 +249,8 @@ export default {
// isOverTime
const data = response.data.map(item => ({
...item,
isOverTime: Number(item.isOverTime)
isOverTime: Number(item.isOverTime),
isShowFinancial: Number(item.isShowFinancial)
}));
this.deptList = this.handleTree(data, "deptId");
this.loading = false;
@ -260,6 +281,7 @@ export default {
leader: undefined,
phone: undefined,
isOverTime: 0,
isShowFinancial: 0,
status: "0"
};
this.resetForm("form");
@ -300,6 +322,8 @@ export default {
this.form = response.data;
// isOverTime
this.form.isOverTime = Number(this.form.isOverTime);
this.form.isShowFinancial = Number(this.form.isShowFinancial);
this.open = true;
this.title = "修改部门";
listDeptExcludeChild(row.deptId).then(response => {
@ -340,6 +364,8 @@ export default {
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 修改是否加班状态 */
handleIsOverTimeChange(row) {
updateDept(row).then(() => {
@ -351,6 +377,19 @@ export default {
}).catch(() => {
row.isOverTime = row.isOverTime === 1 ? 0 : 1;
});
},
/** 修改是否作为财务导出展示 */
handleIsShowFinancialChange(row) {
updateDept(row).then(() => {
this.$modal.msgSuccess("修改成功");
//
if (this.form.deptId === row.deptId) {
this.form.isShowFinancial = row.isShowFinancial;
}
}).catch(() => {
row.isShowFinancial = row.isShowFinancial === 1 ? 0 : 1;
});
}
}
};

View File

@ -352,7 +352,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="打卡位置:" prop="timeClockList">
<el-select v-model="form.timeClockList" multiple placeholder="选择打卡机" style="width: 100%;">
<el-select v-model="form.timeClockList" multiple placeholder="选择打卡机,餐厅打卡机无需选择" style="width: 100%;">
<el-option
v-for="dict in dict.type.time_clock"
:key="dict.value"
@ -434,7 +434,10 @@
<el-cascader
v-model="form.deptId"
:options="deptOpt"
:props="{ checkStrictly: true }"
value="id"
filterable
clearable
>
<!--@change="handleChange"-->
</el-cascader>
@ -1088,9 +1091,9 @@ export default {
imageUrl:[
{ required: true, message: "请上传员工头像", trigger: "blur" },
],
timeClockList: [
{ required: true, message: "打卡机不能为空", trigger: "blur" }
],
// timeClockList: [
// { required: true, message: "", trigger: "blur" }
// ],
jobCode: [
{ required: true, message: "请选择员工岗位信息", trigger: "blur" }
],
@ -1238,7 +1241,10 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.deptId = this.form.deptId[this.form.deptId.length -1]
console.log(this.form.deptId)
if(Array.isArray(this.form.deptId)){
this.form.deptId = this.form.deptId[this.form.deptId.length -1]
}
if (this.form.userId != null) {
updateStaff(this.form).then(response => {
this.$modal.msgSuccess("修改成功");