Commit 849e9253 authored by 沈翠玲's avatar 沈翠玲

生产排产

parent 458d24b2
......@@ -92,6 +92,15 @@ export function gettaskWorkunitList(query) {
});
}
// 查询任务工作单元列表
export function getProcessInfo(query) {
return request({
url: "md/workunit/getProcessInfo",
method: "post",
data: query,
});
}
// 默认工作中心查询
export function getdefaultWorkCenterList() {
// workshopId workCenterId = workstationId workstationName workunitId workunitName
......
......@@ -522,10 +522,22 @@
>
<el-form :model="splitform" ref="splitform" size="small" :inline="true">
<el-row>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="工序名称" prop="processName">
<el-input v-model="splitform.processName" placeholder="请选择工序" disabled>
<el-button
slot="append"
icon="el-icon-search"
@click="$refs.brSelectpro.showFlag = true"
></el-button>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工作单元" prop="workunitCode">
<el-input v-model="splitform.workunitName" placeholder="工作单元" >
<el-button slot="append" icon="el-icon-search" @click="$refs.jobAssign.showFlag = true"></el-button>
<el-input v-model="splitform.workunitName" placeholder="请选择工作单元" disabled>
<el-button slot="append" icon="el-icon-search" @click="showWorkunit"></el-button>
</el-input>
</el-form-item>
</el-col>
......@@ -540,7 +552,9 @@
</div>
</el-dialog>
<!-- 工作单元选择 -->
<jobAssign ref="jobAssign" :taskId="splitVisible ? null : taskId" @onSelected="val => onWorkstationSelect(val)"></jobAssign>
<jobAssign ref="jobAssign" :taskId="taskId" @onSelected="val => onWorkstationSelect(val)"></jobAssign>
<!-- 工作单元选择 -->
<splitProcess ref="splitProcess" :processId="splitform.processId" @onSelected="val => onWorkstationSelect(val)"></splitProcess>
<!-- 排程 -->
<el-dialog
title="详情"
......@@ -564,7 +578,10 @@
<el-button @click="isVisibleTASK = false">取 消</el-button>
</div>
</el-dialog>
<ProcessSelect
ref="brSelectpro"
@onSelected="onBrandProcess"
></ProcessSelect>
<WorkuintSelect
ref="WorkunitSelect"
:workstationId="currentData.workstationId"
......@@ -589,12 +606,15 @@ import BrandSelect from "@/components/TmTool/index.vue";
import shiftSelectMixin from '@/utils/shiftSelectMixin'
import OrderList from './orderList.vue'
import jobAssign from './jobAssign.vue'
import splitProcess from './splitProcess.vue'
import arrangCodeList from './arrangCodeList.vue'
import taskList from './taskList.vue'
import WorkuintSelect from "./workunitSelectSche.vue";
import dayjs from 'dayjs'
import ProcessSelect from "@/components/process/taskSelectSingle.vue";
export default {
components: {BrandSelect, OrderList, arrangCodeList, WorkuintSelect, jobAssign, taskList},
components: {BrandSelect,ProcessSelect, OrderList, arrangCodeList, WorkuintSelect, jobAssign, taskList, splitProcess},
dicts: ['TASK_STATUS', 'mes_workorder_type'],
name: "scheduleList",
mixins: [shiftSelectMixin],
......@@ -671,6 +691,18 @@ export default {
this.hanldeGetdefaultWorkCenterList()
},
methods: {
showWorkunit () {
if(!this.splitform.processName) return this.$modal.msgError("需要选择工序")
this.$refs.splitProcess.showFlag = true
},
onBrandProcess(row){
if (Object.values(row).length > 0) {
this.splitform.processId = row.processId;
this.splitform.processName = row.processName;
this.splitform.workunitId = null
this.splitform.workunitName = null
}
},
handleOpenTask(){
this.isVisibleTASK = true
},
......@@ -761,6 +793,7 @@ export default {
handleSplitWorkstation() {
this.splitform = {
workunitName: null,
processId: null,
workunitId: null
};
this.workstationId = this.selectedRows[0].workstationId
......
<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="workstationName">
<el-input v-model="queryParams.workstationName" 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="selectedprocessId" :label="scope.row.workunitId"
@change="handleRowChange(scope.row)">{{ "" }}</el-radio>
</template>
</el-table-column>
<el-table-column label="工作中心名称" align="center" prop="workstationName" />
<el-table-column label="工作单元编码" align="center" prop="workunitCode" />
<el-table-column label="工作单元名称" align="center" prop="workunitName" />
</el-table>
<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 { getProcessInfo} from '@/api/mes/pro/scheduleList'
export default {
name: "WorkstationSelect",
dicts: ["sys_yes_no"],
data() {
return {
showFlag: false,
// 遮罩层
loading: true,
// 选中数组
selectedprocessId: undefined,
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 工作中心表格数据
workstationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
workstationCode: null,
workstationName: null,
workstationAddress: null,
workshopId: null,
workshopCode: null,
workshopName: null,
processId: null,
processCode: null,
processName: null,
enableFlag: null,
stdWorkingTime: null,
workstationId: null
},
// 表单参数
form: {},
};
},
props: {
processId: {
type: Number | undefined,
default: undefined,
}, //外部传入的工序过滤条件
workstationId: {
type: Number | undefined,
default: undefined,
}
},
created() {
this.getList();
},
watch: {
processId: {
handler(val) {
this.queryParams.processId = val;
this.getList();
},
immediate: true,
},
workstationId: {
handler(val) {
this.queryParams.workstationId = val;
this.getList();
},
immediate: true,
},
},
methods: {
/** 查询工作中心列表 */
getList() {
this.loading = true;
if (!this.queryParams.processId) return
getProcessInfo(this.queryParams).then((response) => {
this.workstationList = response.data;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.showFlag=false;
this.resetQuery();
},
// 表单重置
reset() {
this.form = {
processId: null,
workstationCode: null,
workstationName: null,
workstationAddress: null,
workshopId: null,
workshopCode: null,
workshopName: null,
processCode: null,
processName: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
stdWorkingTime: null,
workstationId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
processId: this.processId,
workstationId: this.workstationId
};
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.selectedprocessId == null ||
this.selectedprocessId == 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