更新班组
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-29 14:47:33
|
||||
* @LastEditTime: 2025-10-31 15:47:16
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -31,10 +31,11 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="部门">
|
||||
<el-form-item label="部门" prop="deptId">
|
||||
<dept-select
|
||||
style="width: 100%"
|
||||
ref="deptSelect"
|
||||
v-model="dataForm.deptId"
|
||||
@DeptId="setDeptId"></dept-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -44,7 +45,7 @@
|
||||
style="width: 100%"
|
||||
v-model="dataForm.leaderId"
|
||||
@change="setLeaderName"
|
||||
filterable
|
||||
filterable
|
||||
placeholder="请选择组长">
|
||||
<el-option
|
||||
v-for="item in leaderArr"
|
||||
@@ -59,7 +60,7 @@
|
||||
<el-input
|
||||
v-model="dataForm.leaderPhone"
|
||||
clearable
|
||||
maxlength="11"
|
||||
maxlength="11"
|
||||
placeholder="请输入组长电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -137,7 +138,7 @@ export default {
|
||||
num: undefined,
|
||||
remark: undefined,
|
||||
},
|
||||
setData: true,
|
||||
setData: true,
|
||||
leaderArr: [],
|
||||
options: [
|
||||
{
|
||||
@@ -156,19 +157,23 @@ export default {
|
||||
name: [
|
||||
{ required: true, message: '班组名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
deptId: [
|
||||
{ required: true, message: '部门不能为空', trigger: 'blur' },
|
||||
],
|
||||
leaderId: [
|
||||
{ required: true, message: '组长不能为空', trigger: 'change' },
|
||||
],
|
||||
isProduction: [
|
||||
{ required: true, message: '生产班组不能为空', trigger: 'change' },
|
||||
],
|
||||
leaderPhone: [
|
||||
{
|
||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
leaderPhone: [
|
||||
{
|
||||
pattern:
|
||||
/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -184,9 +189,9 @@ export default {
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
setDataForm(){
|
||||
this.$refs.deptSelect.setID(this.dataForm.deptId)
|
||||
},
|
||||
setDataForm() {
|
||||
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
||||
},
|
||||
setLeaderName(val) {
|
||||
this.leaderArr.map((item) => {
|
||||
if (val === item.id) {
|
||||
@@ -194,33 +199,33 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
if(!this.dataForm.deptId){
|
||||
this.$message('部门不能为空');
|
||||
return
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
if (!this.dataForm.deptId) {
|
||||
this.$message('部门不能为空');
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user