中航光电热表web
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.

122 lines
2.8 KiB

7 months ago
<template>
4 months ago
<el-dialog v-model="setCrewShow" :before-close="cancel" :title="title" width="600px">
<avue-form :option="option" ref="from"></avue-form>
7 months ago
<template #footer>
<div class="dialog-footer">
<el-button @click="cancel()">取消</el-button>
4 months ago
<el-button type="primary" @click="submit()"> 确认 </el-button>
7 months ago
</div>
</template>
</el-dialog>
</template>
<script>
// setDispatch
4 months ago
import { setDispatch } from '@/api/processManagement/taskDispatch';
import { taskRedeploy } from '@/api/processManagement/taskProcessing';
7 months ago
export default {
name: 'SetPersonnel',
props: {
setCrewOpen: {
type: Boolean,
4 months ago
default: false,
7 months ago
},
id: {
type: String,
4 months ago
default: null,
7 months ago
},
type: {
type: String,
4 months ago
default: '',
7 months ago
},
title: {
type: String,
4 months ago
default: '分派',
},
updateRow: {
type: Array,
default: [],
},
7 months ago
},
data() {
return {
url: '',
setCrewShow: false,
formData: {},
option: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: '工艺员',
prop: 'userId',
span: 23,
type: 'select',
dicUrl: '/blade-system/user/page?current=1&&size=99999',
props: {
4 months ago
label: 'name',
value: 'id',
res: 'data.records',
},
7 months ago
rules: [
{
required: true,
message: '请选择',
4 months ago
trigger: 'blur',
},
],
7 months ago
},
4 months ago
],
},
7 months ago
};
},
mounted() {
4 months ago
this.setCrewShow = this.setCrewOpen;
7 months ago
},
methods: {
submit() {
this.$refs.from.validate((valid, done, msg) => {
4 months ago
if (valid) {
// done();
let arr = [];
this.updateRow.forEach((item, index) => {
arr.push(item.id);
});
4 months ago
4 months ago
if (this.title == '转派') {
4 months ago
let query = {
craftMan: this.$refs.from.form.userId,
id: arr[0],
// remarks:'任务分派'
};
4 months ago
taskRedeploy(query).then(res => {
this.$message.success('操作成功!');
this.cancel(true);
});
} else {
4 months ago
let query = {
dtIdList: arr.join(','),
userId: this.$refs.from.form.userId,
// remarks:'任务分派'
};
4 months ago
setDispatch(query).then(res => {
this.$message.success('操作成功!');
this.cancel(true);
});
}
} else {
console.log('error submit!!');
return false;
}
4 months ago
});
7 months ago
},
4 months ago
7 months ago
cancel(refresh) {
4 months ago
this.setCrewShow = false;
7 months ago
this.$emit('setCrewOpeSancel', typeof refresh === 'boolean' && refresh);
4 months ago
},
},
7 months ago
};
</script>