Merge branch 'master' of http://gitea.xxhhcty.xyz:8080/zcdsj/factory_web
This commit is contained in:
commit
399d64800e
|
|
@ -89,7 +89,7 @@ const props = defineProps({
|
||||||
options: { type: Array, default: null },
|
options: { type: Array, default: null },
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["update:modelValue", "update:obj", "update:label", "change"]);
|
const emit = defineEmits(["update:modelValue", "update:obj", "change"]);
|
||||||
const selectable = (row) => row.count_canhandover?row.count_canhandover>0:true;
|
const selectable = (row) => row.count_canhandover?row.count_canhandover>0:true;
|
||||||
// 控制 popover 显示与隐藏的状态
|
// 控制 popover 显示与隐藏的状态
|
||||||
const showPopover = ref(false);
|
const showPopover = ref(false);
|
||||||
|
|
@ -189,8 +189,8 @@ const rowClick = (row) => {
|
||||||
selectLabel.value = row[props.labelField];
|
selectLabel.value = row[props.labelField];
|
||||||
selectValue.value = row[props.valueField];
|
selectValue.value = row[props.valueField];
|
||||||
showPopover.value = false;
|
showPopover.value = false;
|
||||||
|
emit("change", row);
|
||||||
}
|
}
|
||||||
emit("change");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClear = () => {
|
const handleClear = () => {
|
||||||
|
|
@ -202,8 +202,7 @@ const handleClear = () => {
|
||||||
selectLabel.value = "";
|
selectLabel.value = "";
|
||||||
selectValue.value = null;
|
selectValue.value = null;
|
||||||
}
|
}
|
||||||
emit("update:label", "");
|
emit("change", props.multiple ? [] : null);
|
||||||
emit("change");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const tdChange = (res, tableData) => {
|
const tdChange = (res, tableData) => {
|
||||||
|
|
@ -219,8 +218,7 @@ const selectionChange = (val) => {
|
||||||
selectLabel.value = val
|
selectLabel.value = val
|
||||||
.map((item) => item[props.labelField])
|
.map((item) => item[props.labelField])
|
||||||
.join(props.splitField);
|
.join(props.splitField);
|
||||||
}
|
emit("change", val);
|
||||||
emit("update:label", val);
|
}
|
||||||
emit("change");
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,17 @@
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<el-form label-width="80px" :model="formData" style="padding: 20px;">
|
<el-form label-width="80px" :model="formData" style="padding: 20px;">
|
||||||
<el-form-item label="员工信息" required>
|
<el-form-item label="员工信息" required>
|
||||||
{{ formData.employee_name }}({{ formData.belong_dept_name }} - {{ formData.post_name }})
|
<xtSelect
|
||||||
|
v-model="formData.employee"
|
||||||
|
style="width: 100%;"
|
||||||
|
:apiObj = "$API.hrm.employee.list"
|
||||||
|
v-model:label="formData.employee_name"
|
||||||
|
:edit="localMode === 'add'"
|
||||||
|
@change="handleChange">
|
||||||
|
<el-table-column prop="name" label="姓名"></el-table-column>
|
||||||
|
<el-table-column prop="belong_dept_name" label="部门"></el-table-column>
|
||||||
|
<el-table-column prop="post_name" label="岗位"></el-table-column>
|
||||||
|
</xtSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="离职日期" required>
|
<el-form-item label="离职日期" required>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
|
@ -87,22 +97,10 @@ export default {
|
||||||
if (this.t_id) {
|
if (this.t_id) {
|
||||||
this.getTid();
|
this.getTid();
|
||||||
} else {
|
} else {
|
||||||
this.initFormData();
|
this.localMode = "add";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async initFormData() {
|
|
||||||
try {
|
|
||||||
let res = await this.$API.hrm.employee.read.req();
|
|
||||||
this.formData.employee_name = res.name;
|
|
||||||
this.formData.belong_dept_name = res.belong_dept_name;
|
|
||||||
this.formData.post_name = res.post_name;
|
|
||||||
this.formData.employee = res.id;
|
|
||||||
this.localMode = "add";
|
|
||||||
} catch (error) {
|
|
||||||
console.error('初始化表单数据失败:', error);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async getTid() {
|
async getTid() {
|
||||||
try {
|
try {
|
||||||
let res = await this.$API.hrm.resignation.item.req(this.t_id);
|
let res = await this.$API.hrm.resignation.item.req(this.t_id);
|
||||||
|
|
@ -114,6 +112,11 @@ export default {
|
||||||
console.error('获取离职数据失败:', error);
|
console.error('获取离职数据失败:', error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleChange(obj) {
|
||||||
|
this.formData.employee_name = obj.name;
|
||||||
|
this.formData.belong_dept_name = obj.belong_dept_name;
|
||||||
|
this.formData.post_name = obj.post_name;
|
||||||
|
},
|
||||||
handleDel() {
|
handleDel() {
|
||||||
this.$confirm(`确定删除吗?`, "提示", {
|
this.$confirm(`确定删除吗?`, "提示", {
|
||||||
type: "warning",
|
type: "warning",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue