Commit 95760324 authored by 沈翠玲's avatar 沈翠玲

作业分派

parent 33323042
...@@ -135,6 +135,15 @@ ...@@ -135,6 +135,15 @@
@click="handleSchedule" @click="handleSchedule"
>排程</el-button> >排程</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled='single'
@click="handleJobAssignment"
>作业分派</el-button>
</el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
...@@ -423,7 +432,44 @@ ...@@ -423,7 +432,44 @@
<el-button @click="scheduleVisible = false">取 消</el-button> <el-button @click="scheduleVisible = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 作业分派 -->
<el-dialog
title="作业分派"
:visible.sync="jobAssignmentVisible"
width="600px"
append-to-body
>
<el-form :model="Assignform" ref="Assignform" size="small" :inline="true">
<el-row>
<el-col :span="24">
<el-form-item label="排产数量" prop="quantity">
<el-input-number
:step="1"
:min="0"
v-model="Assignform.quantity"
placeholder="请输入排产数量"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="工作单元" prop="workunitCode">
<el-input v-model="Assignform.workunitName" placeholder="工作单元" >
<el-button slot="append" icon="el-icon-search" @click="$refs.jobAssign.showFlag = true"></el-button>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="handleSubmitJobAssignment"
>确 定</el-button>
<el-button @click="jobAssignmentVisible = false">取 消</el-button>
</div>
</el-dialog>
<!-- 工作单元选择 -->
<jobAssign ref="jobAssign" :taskId="taskId" @onSelected="val => onWorkstationSelect(val)"></jobAssign>
<!-- 排程 --> <!-- 排程 -->
<el-dialog <el-dialog
title="详情" title="详情"
...@@ -456,12 +502,14 @@ import { ...@@ -456,12 +502,14 @@ import {
getworkstationList, getworkstationList,
gettaskWorkunitList, gettaskWorkunitList,
getdefaultWorkCenterList} from '@/api/mes/pro/scheduleList' getdefaultWorkCenterList} from '@/api/mes/pro/scheduleList'
import {putProtaskSplit} from '@/api/mes/pro/protask'
import BrandSelect from "@/components/TmTool/index.vue"; import BrandSelect from "@/components/TmTool/index.vue";
import OrderList from './orderList.vue' import OrderList from './orderList.vue'
import jobAssign from './jobAssign.vue'
import arrangCodeList from './arrangCodeList.vue' import arrangCodeList from './arrangCodeList.vue'
import WorkuintSelect from "@/components/workunitSelect/single.vue"; import WorkuintSelect from "@/components/workunitSelect/single.vue";
export default { export default {
components: {BrandSelect, OrderList, arrangCodeList, WorkuintSelect}, components: {BrandSelect, OrderList, arrangCodeList, WorkuintSelect, jobAssign},
dicts: ['TASK_STATUS'], dicts: ['TASK_STATUS'],
name: "scheduleList", name: "scheduleList",
data() { data() {
...@@ -475,6 +523,11 @@ export default { ...@@ -475,6 +523,11 @@ export default {
workshopId: null, workshopId: null,
workstationId: null workstationId: null
}, },
taskId: null,
Assignform: {
quantity: 1,
workunitName: ''
},
taskWorkunitId: null, taskWorkunitId: null,
arrangCodeVisible: false, arrangCodeVisible: false,
scheduleVisible: false, scheduleVisible: false,
...@@ -512,6 +565,7 @@ export default { ...@@ -512,6 +565,7 @@ export default {
scheduleStartDate: null, scheduleStartDate: null,
scheduleEndDate: null, scheduleEndDate: null,
}, },
jobAssignmentVisible: false,
arrangeCode: null, arrangeCode: null,
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -530,6 +584,18 @@ export default { ...@@ -530,6 +584,18 @@ export default {
this.isOrder = true this.isOrder = true
this.arrangCodeVisible = true this.arrangCodeVisible = true
}, },
handleSubmitJobAssignment() {
let datas = Object.assign({}, this.selections[0]);
datas.taskWorkunit = this.Assignform;
delete datas.proWorkorderList;
putProtaskSplit(datas).then((res) => {
// console.log(res, 'res333')
if (res.code === 200) {
this.jobAssignmentVisible = false;
this.getList();
}
});
},
hanldeGetdefaultWorkCenterList() { hanldeGetdefaultWorkCenterList() {
getdefaultWorkCenterList().then(async (res) => { getdefaultWorkCenterList().then(async (res) => {
console.log(res, 5566) console.log(res, 5566)
...@@ -562,6 +628,14 @@ export default { ...@@ -562,6 +628,14 @@ export default {
const response = await getworkstationList({workshopId: null}) const response = await getworkstationList({workshopId: null})
this.workstationList = response.rows this.workstationList = response.rows
}, },
handleJobAssignment() {
this.Assignform = {
quantity: 1,
workunitName: null
};
this.taskId = this.selections[0].taskId
this.jobAssignmentVisible = true;
},
handleChangeWorkStationId(item) { handleChangeWorkStationId(item) {
this.hanldeGettaskWorkunitList() this.hanldeGettaskWorkunitList()
const finditem = this.workstationList.find(v => v.workstationId === item) const finditem = this.workstationList.find(v => v.workstationId === item)
...@@ -587,6 +661,12 @@ export default { ...@@ -587,6 +661,12 @@ export default {
const response = await gettaskWorkunitList({workstationId: this.queryWorkunitParams.workstationId}) const response = await gettaskWorkunitList({workstationId: this.queryWorkunitParams.workstationId})
this.taskWorkunitList = response.rows this.taskWorkunitList = response.rows
}, },
onWorkstationSelect(row) {
if (row != undefined && row != null) {
this.Assignform.workunitId = row.workunitId
this.Assignform.workunitName = row.workunitName
}
},
handleClick(row,index) { handleClick(row,index) {
this.currentTask = index this.currentTask = index
this.queryParams.workunitId = row.workunitId this.queryParams.workunitId = row.workunitId
......
<template>
<el-dialog title="工作单元选择" v-if="showFlag" :visible.sync="showFlag" :modal="false" width="80%" center>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-row>
<el-form-item label="工作中心编码" label-width="120" prop="workstationCode">
<el-input v-model="queryParams.workstationCode" placeholder="请输入工作中心编号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="工作中心名称" label-width="120" prop="workunitName">
<el-input v-model="queryParams.workunitName" placeholder="请输入工作单元名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-row>
<el-row>
<el-col :span="24"> </el-col>
</el-row>
</el-form>
<el-table v-loading="loading" :data="workstationList" @current-change="handleCurrent"
@row-dblclick="handleRowDbClick">
<el-table-column width="55" align="center">
<template v-slot="scope">
<el-radio v-model="selectedtaskId" :label="scope.row.workunitId"
@change="handleRowChange(scope.row)">{{ "" }}</el-radio>
</template>
</el-table-column>
<el-table-column label="工作中心名称" align="center" prop="workunitName" />
<el-table-column label="工作单元编码" align="center" prop="workunitCode" />
<el-table-column label="工作单元名称" align="center" prop="workunitName" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import { listWorkunit} from "@/api/mes/md/workunit";
export default {
name: "WorkstationSelect",
dicts: ["sys_yes_no"],
data() {
return {
// taskId: this.taskId,
showFlag: false,
// 遮罩层
loading: true,
// 选中数组
selectedtaskId: undefined,
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 工作中心表格数据
workstationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workstationCode: null,
workstationName: null,
workstationAddress: null,
workshopId: null,
workshopCode: null,
workshopName: null,
taskId: null,
processCode: null,
processName: null,
enableFlag: null,
stdWorkingTime: null,
},
// 表单参数
form: {},
};
},
props: {
taskId: {
type: Number | undefined,
default: undefined,
}, //外部传入的工序过滤条件
},
created() {
this.getList();
},
watch: {
taskId: {
handler(val) {
this.queryParams.taskId = val;
this.getList();
},
immediate: true,
},
},
methods: {
/** 查询工作中心列表 */
getList() {
this.loading = true;
listWorkunit(this.queryParams).then((response) => {
console.log(this.queryParams);
this.workstationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.showFlag=false;
this.resetQuery();
},
// 表单重置
reset() {
this.form = {
taskId: null,
workstationCode: null,
workstationName: null,
workstationAddress: null,
workshopId: null,
workshopCode: null,
workshopName: null,
taskId: null,
processCode: null,
processName: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
stdWorkingTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
taskId: this.taskId
};
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row) {
if (row) {
this.selectedRows = row;
}
},
// 单选选中数据
handleRowChange(row) {
if (row) {
this.selectedRows = row;
}
},
//双击选中
handleRowDbClick(row) {
if (row) {
this.selectedRows = row;
this.$emit("onSelected", this.selectedRows);
this.showFlag = false;
}
},
//确定选中
confirmSelect() {
if (
this.selectedtaskId == null ||
this.selectedtaskId == 0
) {
this.$notify({
title: "提示",
type: "warning",
message: "请至少选择一条数据!",
});
return;
}
this.$emit("onSelected", this.selectedRows);
this.showFlag = false;
},
},
};
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment