change - 员工关联多班组

main
yinq 5 months ago
parent 312fdff7ff
commit 2d60281f13

@ -191,7 +191,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班组名称" prop="teamCode"> <el-form-item label="班组名称" prop="teamCode">
<el-select v-model="form.teamCode" placeholder="请选择班组名称"> <el-select v-model="form.teamCode" placeholder="请选择班组名称" multiple>
<el-option <el-option
v-for="item in teamMembersList" v-for="item in teamMembersList"
:key="item.teamCode" :key="item.teamCode"
@ -300,9 +300,6 @@ export default {
], ],
staffName: [ staffName: [
{ required: true, message: '员工名称不能为空', trigger: 'blur' } { required: true, message: '员工名称不能为空', trigger: 'blur' }
],
teamCode: [
{ required: true, message: '班组编号不能为空', trigger: 'blur' }
] ]
}, },
columns: [ columns: [
@ -404,6 +401,9 @@ export default {
this.reset() this.reset()
const objId = row.objId || this.ids const objId = row.objId || this.ids
getBaseStaffInfo(objId).then(response => { getBaseStaffInfo(objId).then(response => {
if (response.data.teamCode && typeof response.data.teamCode === 'string') {
response.data.teamCode = response.data.teamCode.split(',');
}
this.form = response.data this.form = response.data
this.open = true this.open = true
this.title = '修改员工信息' this.title = '修改员工信息'
@ -413,6 +413,7 @@ export default {
submitForm() { submitForm() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.form.teamCode = this.form.teamCode.toString();
if (this.form.objId != null) { if (this.form.objId != null) {
updateBaseStaffInfo(this.form).then(response => { updateBaseStaffInfo(this.form).then(response => {
this.$modal.msgSuccess('修改成功') this.$modal.msgSuccess('修改成功')
@ -431,8 +432,9 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const objIds = row.objId || this.codes const objNames = row.objId || this.codes
this.$modal.confirm('是否确认删除员工编号为"' + objIds + '"的数据项?').then(function() { const objIds = row.objId || this.ids
this.$modal.confirm('是否确认删除员工编号为"' + objNames + '"的数据项?').then(function() {
return delBaseStaffInfo(objIds) return delBaseStaffInfo(objIds)
}).then(() => { }).then(() => {
this.getList() this.getList()

Loading…
Cancel
Save