You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
2.9 KiB
123 lines
2.9 KiB
<template> |
|
<el-dialog v-model="setCrewShow" :before-close="cancel" :title="title" width="600px"> |
|
<avue-form :option="option" ref="from"></avue-form> |
|
|
|
<template #footer> |
|
<div class="dialog-footer"> |
|
<el-button @click="cancel()">取消</el-button> |
|
<el-button type="primary" @click="submit()"> 确认 </el-button> |
|
</div> |
|
</template> |
|
</el-dialog> |
|
</template> |
|
<script> |
|
// setDispatch |
|
import { setDispatch,getRoleUserList } from '@/api/processManagement/taskDispatch'; |
|
import { taskRedeploy } from '@/api/processManagement/taskProcessing'; |
|
|
|
export default { |
|
name: 'SetPersonnel', |
|
props: { |
|
setCrewOpen: { |
|
type: Boolean, |
|
default: false, |
|
}, |
|
id: { |
|
type: String, |
|
default: null, |
|
}, |
|
type: { |
|
type: String, |
|
default: '', |
|
}, |
|
title: { |
|
type: String, |
|
default: '分派', |
|
}, |
|
updateRow: { |
|
type: Array, |
|
default: [], |
|
}, |
|
}, |
|
data() { |
|
return { |
|
url: '', |
|
setCrewShow: false, |
|
formData: {}, |
|
option: { |
|
submitBtn: false, |
|
emptyBtn: false, |
|
column: [ |
|
{ |
|
label: '工艺员', |
|
prop: 'userId', |
|
span: 23, |
|
type: 'select', |
|
filterable:true, |
|
clearable: true, |
|
dicUrl: '/blade-system/user/list-process-engineer', |
|
props: { |
|
label: 'realName', |
|
value: 'id', |
|
res: 'data.records', |
|
}, |
|
rules: [ |
|
{ |
|
required: true, |
|
message: '请选择', |
|
trigger: 'blur', |
|
}, |
|
], |
|
}, |
|
], |
|
}, |
|
}; |
|
}, |
|
mounted() { |
|
this.setCrewShow = this.setCrewOpen; |
|
}, |
|
methods: { |
|
submit() { |
|
this.$refs.from.validate((valid, done, msg) => { |
|
if (valid) { |
|
// done(); |
|
let arr = []; |
|
this.updateRow.forEach((item, index) => { |
|
arr.push(item.id); |
|
}); |
|
|
|
if (this.title == '转派') { |
|
let query = { |
|
craftMan: this.$refs.from.form.userId, |
|
id: arr[0], |
|
// remarks:'任务分派' |
|
}; |
|
taskRedeploy(query).then(res => { |
|
this.$message.success('操作成功!'); |
|
this.cancel(true); |
|
}); |
|
} else { |
|
let query = { |
|
dtIdList: arr.join(','), |
|
userId: this.$refs.from.form.userId, |
|
// remarks:'任务分派' |
|
}; |
|
setDispatch(query).then(res => { |
|
this.$message.success('操作成功!'); |
|
this.cancel(true); |
|
}); |
|
} |
|
} else { |
|
console.log('error submit!!'); |
|
return false; |
|
} |
|
}); |
|
}, |
|
|
|
cancel(refresh) { |
|
this.setCrewShow = false; |
|
this.$emit('setCrewOpeSancel', typeof refresh === 'boolean' && refresh); |
|
}, |
|
}, |
|
}; |
|
</script>
|
|
|