工艺流程
This commit is contained in:
parent
37ae89d618
commit
2415808862
@ -316,7 +316,7 @@
|
||||
</el-col>
|
||||
<!-- <el-col :span="12"> -->
|
||||
<el-col :span="12" v-if="Typefile">
|
||||
<el-form-item label="代码上传" prop="">
|
||||
<!-- <el-form-item label="代码上传" prop="">
|
||||
<el-upload
|
||||
ref="codeName"
|
||||
class="upload-demo"
|
||||
@ -339,6 +339,21 @@
|
||||
> 预览文件</el-button
|
||||
>
|
||||
</el-upload>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="代码上传" prop="url">
|
||||
<el-select
|
||||
v-model="form.originalName"
|
||||
value-key="codeId"
|
||||
placeholder="请选择工序"
|
||||
@change="selectSource($event)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in machineryList"
|
||||
:key="item.codeId"
|
||||
:label="item.codeName"
|
||||
:value="{ url: item.codeId, originalName: item.codeName }"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -412,6 +427,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list } from "@/api/management/codeprogram";
|
||||
import { findProAgvline } from "@/api/mes/dv/route";
|
||||
import { findProAgvsite } from "@/api/mes/dv/siteConfiguration";
|
||||
import {
|
||||
@ -490,6 +506,7 @@ export default {
|
||||
lineId: "",
|
||||
pointId: "",
|
||||
},
|
||||
machineryList: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
routeId: [
|
||||
@ -594,15 +611,28 @@ export default {
|
||||
this.form.lineId = "";
|
||||
this.form.pointId = "";
|
||||
this.form.exitType = "0";
|
||||
this.form.originalName = "";
|
||||
this.form.url = "";
|
||||
} else {
|
||||
this.TypeId = false;
|
||||
this.Typefile = false;
|
||||
this.Typefile = true;
|
||||
this.warehousing = false;
|
||||
this.form.lineId = "";
|
||||
this.form.pointId = "";
|
||||
this.form.exitType = "";
|
||||
this.form.originalName = "";
|
||||
this.form.url = "";
|
||||
}
|
||||
this.form.machineryTypeName = data.machineryTypeName;
|
||||
var queryParams = { machineryTypeId: data.machineryTypeId };
|
||||
list(queryParams).then((response) => {
|
||||
this.machineryList = response.data;
|
||||
});
|
||||
},
|
||||
selectSource(e) {
|
||||
console.log(e);
|
||||
this.form.url = e.url;
|
||||
this.form.originalName = e.originalName;
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
@ -752,24 +782,28 @@ export default {
|
||||
this.TypeId = true;
|
||||
this.Typefile = false;
|
||||
this.warehousing = false;
|
||||
this.form.originalName = "";
|
||||
this.form.url = "";
|
||||
this.form.exitType = "";
|
||||
// this.form.originalName = "";
|
||||
// this.form.url = "";
|
||||
// this.form.exitType = "";
|
||||
} else if (row.machineryTypeId == 230) {
|
||||
this.TypeId = false;
|
||||
this.Typefile = false;
|
||||
this.warehousing = true;
|
||||
this.form.lineId = "";
|
||||
this.form.pointId = "";
|
||||
// this.form.lineId = "";
|
||||
// this.form.pointId = "";
|
||||
} else {
|
||||
this.TypeId = false;
|
||||
this.Typefile = true;
|
||||
this.warehousing = false;
|
||||
this.form.lineId = "";
|
||||
this.form.pointId = "";
|
||||
this.form.exitType = "";
|
||||
// this.form.lineId = "";
|
||||
// this.form.pointId = "";
|
||||
// this.form.exitType = "";
|
||||
}
|
||||
}
|
||||
var queryParams = { machineryTypeId: row.machineryTypeId };
|
||||
list(queryParams).then((response) => {
|
||||
this.machineryList = response.data;
|
||||
});
|
||||
var name = {};
|
||||
if (row.originalName != undefined && row.originalName != "") {
|
||||
this.$set(name, "name", row.originalName);
|
||||
@ -781,13 +815,13 @@ export default {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.recordId != null) {
|
||||
if (this.form.machineryTypeId == 229) {
|
||||
this.form.originalName = "";
|
||||
this.form.url = "";
|
||||
} else {
|
||||
this.form.lineId = "";
|
||||
this.form.pointId = "";
|
||||
}
|
||||
// if (this.form.machineryTypeId == 229) {
|
||||
// this.form.originalName = "";
|
||||
// this.form.url = "";
|
||||
// } else {
|
||||
// this.form.lineId = "";
|
||||
// this.form.pointId = "";
|
||||
// }
|
||||
updateRouteprocess(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
|
@ -1,6 +1,13 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="工单编码" prop="workorderCode">
|
||||
<el-input
|
||||
v-model="queryParams.workorderCode"
|
||||
@ -60,86 +67,191 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="需求日期" prop="requestDate">
|
||||
<el-date-picker clearable
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="queryParams.requestDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择需求日期">
|
||||
placeholder="请选择需求日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</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-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-form-item>
|
||||
<el-button type="primary" icon="el-icon-refresh" v-hasPermi="['mes:pro:protask:list']" circle="" @click="getList"></el-button>
|
||||
<el-button type="primary" icon="el-icon-edit" v-hasPermi="['mes:pro:protask:edit']" circle="" @click="handleOpenGantt"></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
v-hasPermi="['mes:pro:protask:list']"
|
||||
circle=""
|
||||
@click="getList"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
v-hasPermi="['mes:pro:protask:edit']"
|
||||
circle=""
|
||||
@click="handleOpenGantt"
|
||||
></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="wrapper">
|
||||
<div class="container">
|
||||
<GanttChar class="left-container" ref="ganttChar" :tasks="tasks"></GanttChar>
|
||||
<GanttChar
|
||||
class="left-container"
|
||||
ref="ganttChar"
|
||||
:tasks="tasks"
|
||||
></GanttChar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-row :gutter="10" class="mb8" style="margin-top: 10px">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain size="mini" @click="production"
|
||||
>批量执行生产</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="workorderList"
|
||||
row-key="workorderId"
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column label="工单编码" width="180" prop="workorderCode" >
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"
|
||||
:selectable="selectable"
|
||||
/>
|
||||
|
||||
<el-table-column label="工单编码" width="180" prop="workorderCode">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:pro:protask:query']"
|
||||
>{{scope.row.workorderCode}}</el-button>
|
||||
>{{ scope.row.workorderCode }}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工单名称" width="200" align="center" prop="workorderName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="工单来源" align="center" prop="orderSource" >
|
||||
<el-table-column
|
||||
label="工单名称"
|
||||
width="200"
|
||||
align="center"
|
||||
prop="workorderName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="工单来源" align="center" prop="orderSource">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_workorder_sourcetype" :value="scope.row.orderSource"/>
|
||||
<dict-tag
|
||||
:options="dict.type.mes_workorder_sourcetype"
|
||||
:value="scope.row.orderSource"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单编号" width="140" align="center" prop="sourceCode" />
|
||||
<el-table-column label="产品编号" width="120" align="center" prop="productCode" />
|
||||
<el-table-column label="产品名称" width="200" align="center" prop="productName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="productSpc" :show-overflow-tooltip="true"/>
|
||||
<el-table-column
|
||||
label="订单编号"
|
||||
width="140"
|
||||
align="center"
|
||||
prop="sourceCode"
|
||||
/>
|
||||
<el-table-column
|
||||
label="产品编号"
|
||||
width="120"
|
||||
align="center"
|
||||
prop="productCode"
|
||||
/>
|
||||
<el-table-column
|
||||
label="产品名称"
|
||||
width="200"
|
||||
align="center"
|
||||
prop="productName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
align="center"
|
||||
prop="productSpc"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||
<el-table-column label="计划数量" align="center" prop="quantity" />
|
||||
<el-table-column label="调整数量" align="center" prop="quantityChanged" />
|
||||
<el-table-column label="已生产数量" align="center" width="100px" prop="quantityProduced" />
|
||||
<el-table-column
|
||||
label="已生产数量"
|
||||
align="center"
|
||||
width="100px"
|
||||
prop="quantityProduced"
|
||||
/>
|
||||
<el-table-column label="客户编码" align="center" prop="clientCode" />
|
||||
<el-table-column label="客户名称" align="center" prop="clientName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="需求日期" align="center" prop="requestDate" width="180">
|
||||
<el-table-column
|
||||
label="客户名称"
|
||||
align="center"
|
||||
prop="clientName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="需求日期"
|
||||
align="center"
|
||||
prop="requestDate"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.requestDate, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.requestDate, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排产状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
|
||||
<dict-tag
|
||||
:options="dict.type.mes_order_status"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.status =='CONFIRMED'"
|
||||
v-if="scope.row.status == 'CONFIRMED'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:pro:protask:edit']"
|
||||
>排产</el-button>
|
||||
>排产</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
v-if="scope.row.status == 'CONFIRMED'"
|
||||
@click="handleproductione(scope.row)"
|
||||
>执行生产</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@ -169,7 +281,8 @@
|
||||
v-for="dict in dict.type.mes_workorder_sourcetype"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -194,7 +307,7 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" readonly="readonly" >
|
||||
<el-input v-model="form.productCode" readonly="readonly">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -224,11 +337,13 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="需求日期" prop="requestDate">
|
||||
<el-date-picker disabled
|
||||
<el-date-picker
|
||||
disabled
|
||||
v-model="form.requestDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择需求日期">
|
||||
placeholder="请选择需求日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -236,7 +351,7 @@
|
||||
<el-row v-if="form.orderSource == 'ORDER'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户编号" prop="clientCode">
|
||||
<el-input v-model="form.clientCode" readonly="readonly" >
|
||||
<el-input v-model="form.clientCode" readonly="readonly">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -250,23 +365,65 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" readonly="readonly" />
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
readonly="readonly"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-steps :active="activeProcess" v-if="form.workorderId !=null" align-center simple>
|
||||
<el-step v-for="(item,index) in processOptions"
|
||||
:title="item.processName" @click.native="handleStepClick(index)">
|
||||
<el-steps
|
||||
:active="activeProcess"
|
||||
v-if="form.workorderId != null"
|
||||
align-center
|
||||
simple
|
||||
>
|
||||
<el-step
|
||||
v-for="(item, index) in processOptions"
|
||||
:title="item.processName"
|
||||
@click.native="handleStepClick(index)"
|
||||
>
|
||||
</el-step>
|
||||
</el-steps>
|
||||
<el-card v-for=" (item,index) in processOptions " :key="index" v-if="activeProcess == index && form.workorderId !=null">
|
||||
<ProTask :workorderId="form.workorderId" :routeId="item.routeId" :processId="item.processId" :colorCode="item.colorCode" :optType="optType" :recordId="item.recordId"></ProTask>
|
||||
<el-card
|
||||
v-for="(item, index) in processOptions"
|
||||
:key="index"
|
||||
v-if="activeProcess == index && form.workorderId != null"
|
||||
>
|
||||
<ProTask
|
||||
:workorderId="form.workorderId"
|
||||
:routeId="item.routeId"
|
||||
:processId="item.processId"
|
||||
:colorCode="item.colorCode"
|
||||
:optType="optType"
|
||||
:recordId="item.recordId"
|
||||
></ProTask>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">确 定</el-button>
|
||||
<el-button type="success" @click="handleFinish" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">完成</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="cancel"
|
||||
v-if="optType == 'view' || form.status != 'PREPARE'"
|
||||
>返回</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitForm"
|
||||
v-if="form.status == 'PREPARE' && optType != 'view'"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button
|
||||
type="success"
|
||||
@click="handleFinish"
|
||||
v-if="
|
||||
form.status == 'PREPARE' &&
|
||||
optType != 'view' &&
|
||||
form.workorderId != null
|
||||
"
|
||||
>完成</el-button
|
||||
>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -274,8 +431,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listWorkorder, getWorkorder, delWorkorder, addWorkorder, updateWorkorder } from "@/api/mes/pro/workorder";
|
||||
import {listGanttTaskList} from "@/api/mes/pro/protask";
|
||||
import {
|
||||
listWorkorder,
|
||||
getWorkorder,
|
||||
delWorkorder,
|
||||
addWorkorder,
|
||||
updateWorkorder,
|
||||
} from "@/api/mes/pro/workorder";
|
||||
import { listGanttTaskList } from "@/api/mes/pro/protask";
|
||||
import { listProductprocess } from "@/api/mes/pro/routeprocess";
|
||||
import ProTask from "./proTask.vue";
|
||||
import GanttChar from "./ganttx.vue";
|
||||
@ -284,16 +447,16 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "Workorder",
|
||||
dicts: ['mes_order_status','mes_workorder_sourcetype'],
|
||||
dicts: ["mes_order_status", "mes_workorder_sourcetype"],
|
||||
components: {
|
||||
Treeselect,
|
||||
ProTask,
|
||||
GanttChar
|
||||
GanttChar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//自动生成编码
|
||||
autoGenFlag:true,
|
||||
autoGenFlag: true,
|
||||
optType: undefined,
|
||||
activeProcess: 0,
|
||||
// 遮罩层
|
||||
@ -322,7 +485,7 @@ export default {
|
||||
pageSize: 10,
|
||||
workorderCode: null,
|
||||
workorderName: null,
|
||||
workorderType: 'SELF', //这里的排产要排除自产之外的外协和外购
|
||||
workorderType: "SELF", //这里的排产要排除自产之外的外协和外购
|
||||
orderSource: null,
|
||||
sourceCode: null,
|
||||
productId: null,
|
||||
@ -342,9 +505,9 @@ export default {
|
||||
ancestors: null,
|
||||
status: null,
|
||||
},
|
||||
tasks:{
|
||||
tasks: {
|
||||
data: [],
|
||||
links: []
|
||||
links: [],
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@ -358,17 +521,21 @@ export default {
|
||||
/** 查询生产工单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listWorkorder(this.queryParams).then(response => {
|
||||
this.workorderList = this.handleTree(response.rows, "workorderId", "parentId");
|
||||
listWorkorder(this.queryParams).then((response) => {
|
||||
this.workorderList = this.handleTree(
|
||||
response.rows,
|
||||
"workorderId",
|
||||
"parentId"
|
||||
);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleOpenGantt(){
|
||||
this.$router.push({ path: '/mes/pro/schedule/ganttedit'})
|
||||
handleOpenGantt() {
|
||||
this.$router.push({ path: "/mes/pro/schedule/ganttedit" });
|
||||
},
|
||||
getGanttTasks(){
|
||||
listGanttTaskList(this.queryParams).then(response =>{
|
||||
getGanttTasks() {
|
||||
listGanttTaskList(this.queryParams).then((response) => {
|
||||
this.tasks.data = response.data.data;
|
||||
this.tasks.links = response.data.links;
|
||||
this.$refs.ganttChar.reload();
|
||||
@ -376,8 +543,8 @@ export default {
|
||||
},
|
||||
|
||||
//获取当前产品对应的生产工序
|
||||
getProcess(){
|
||||
listProductprocess(this.form.productId).then(response =>{
|
||||
getProcess() {
|
||||
listProductprocess(this.form.productId).then((response) => {
|
||||
this.processOptions = response.data;
|
||||
});
|
||||
},
|
||||
@ -390,15 +557,23 @@ export default {
|
||||
return {
|
||||
id: node.workorderId,
|
||||
label: node.workorderName,
|
||||
children: node.children
|
||||
children: node.children,
|
||||
};
|
||||
},
|
||||
/** 查询生产工单下拉树结构 */
|
||||
getTreeselect() {
|
||||
listWorkorder().then(response => {
|
||||
listWorkorder().then((response) => {
|
||||
this.workorderOptions = [];
|
||||
const data = { workorderId: 0, workorderName: '顶级节点', children: [] };
|
||||
data.children = this.handleTree(response.data, "workorderId", "parentId");
|
||||
const data = {
|
||||
workorderId: 0,
|
||||
workorderName: "顶级节点",
|
||||
children: [],
|
||||
};
|
||||
data.children = this.handleTree(
|
||||
response.data,
|
||||
"workorderId",
|
||||
"parentId"
|
||||
);
|
||||
this.workorderOptions.push(data);
|
||||
});
|
||||
},
|
||||
@ -434,19 +609,19 @@ export default {
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
updateTime: null,
|
||||
};
|
||||
this.activeProcess =0;
|
||||
this.activeProcess = 0;
|
||||
this.autoGenFlag = true;
|
||||
this.resetForm("form");
|
||||
},
|
||||
//甘特图按钮点击
|
||||
openGanttChart(){
|
||||
this.$refs.ganttChar.showFlag =true;
|
||||
openGanttChart() {
|
||||
this.$refs.ganttChar.showFlag = true;
|
||||
},
|
||||
//Step点击
|
||||
handleStepClick(index){
|
||||
this.activeProcess =index;
|
||||
handleStepClick(index) {
|
||||
this.activeProcess = index;
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -457,8 +632,24 @@ export default {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
var ids = [];
|
||||
ids = selection.map((item) => item.routeId);
|
||||
},
|
||||
production() {},
|
||||
handleproductione() {},
|
||||
|
||||
selectable(row, index) {
|
||||
if (row.status == "WORKING") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
//从BOM行中直接新增
|
||||
handleSubAdd(row){
|
||||
handleSubAdd(row) {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
@ -472,7 +663,7 @@ export default {
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "添加生产工单";
|
||||
this.optType="add";
|
||||
this.optType = "add";
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd(row) {
|
||||
@ -490,17 +681,17 @@ export default {
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "添加生产工单";
|
||||
this.optType="add";
|
||||
genCode('WORKORDER_CODE').then(response =>{
|
||||
this.optType = "add";
|
||||
genCode("WORKORDER_CODE").then((response) => {
|
||||
this.form.workorderCode = response;
|
||||
});
|
||||
},
|
||||
// 查询明细按钮操作
|
||||
handleView(row){
|
||||
handleView(row) {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
const workorderId = row.workorderId || this.ids;
|
||||
getWorkorder(workorderId).then(response => {
|
||||
getWorkorder(workorderId).then((response) => {
|
||||
this.form = response.data;
|
||||
this.getProcess();
|
||||
this.open = true;
|
||||
@ -515,27 +706,27 @@ export default {
|
||||
if (row != null) {
|
||||
this.form.parentId = row.workorderId;
|
||||
}
|
||||
getWorkorder(row.workorderId).then(response => {
|
||||
getWorkorder(row.workorderId).then((response) => {
|
||||
this.form = response.data;
|
||||
this.getProcess();
|
||||
this.open = true;
|
||||
this.title = "生产排产";
|
||||
this.optType="edit";
|
||||
this.optType = "edit";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.workorderId != null) {
|
||||
updateWorkorder(this.form).then(response => {
|
||||
updateWorkorder(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
//this.open = false;
|
||||
this.$refs["bomlist"].getList();
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addWorkorder(this.form).then(response => {
|
||||
addWorkorder(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
//this.open = false;
|
||||
this.form.workorderId = response.data;
|
||||
@ -547,35 +738,47 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?').then(function() {
|
||||
this.$modal
|
||||
.confirm(
|
||||
'是否确认删除生产工单编号为"' + row.workorderId + '"的数据项?'
|
||||
)
|
||||
.then(function () {
|
||||
return delWorkorder(row.workorderId);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
handleSelectProduct(){
|
||||
handleSelectProduct() {
|
||||
this.$refs.itemSelect.showFlag = true;
|
||||
},
|
||||
handleSelectClient(){
|
||||
handleSelectClient() {
|
||||
this.$refs.clientSelect.showFlag = true;
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('mes/pro/workorder/export', {
|
||||
...this.queryParams
|
||||
}, `workorder_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
"mes/pro/workorder/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
handleFinish(){
|
||||
`workorder_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
handleFinish() {
|
||||
let that = this;
|
||||
this.$modal.confirm('是否完成工单编制?【完成后将不能更改】').then(function(){
|
||||
that.form.status = 'CONFIRMED';
|
||||
this.$modal
|
||||
.confirm("是否完成工单编制?【完成后将不能更改】")
|
||||
.then(function () {
|
||||
that.form.status = "CONFIRMED";
|
||||
that.submitForm();
|
||||
});
|
||||
},
|
||||
//物料选择弹出框
|
||||
onItemSelected(obj){
|
||||
if(obj != undefined && obj != null){
|
||||
onItemSelected(obj) {
|
||||
if (obj != undefined && obj != null) {
|
||||
this.form.productId = obj.itemId;
|
||||
this.form.productCode = obj.itemCode;
|
||||
this.form.productName = obj.itemName;
|
||||
@ -584,28 +787,28 @@ export default {
|
||||
}
|
||||
},
|
||||
//客户选择弹出框
|
||||
onClientSelected(obj){
|
||||
if(obj != undefined && obj != null){
|
||||
onClientSelected(obj) {
|
||||
if (obj != undefined && obj != null) {
|
||||
this.form.clientId = obj.clientId;
|
||||
this.form.clientCode = obj.clientCode;
|
||||
this.form.clientName = obj.clientName;
|
||||
}
|
||||
},
|
||||
//自动生成编码
|
||||
handleAutoGenChange(autoGenFlag){
|
||||
if(autoGenFlag){
|
||||
genCode('WORKORDER_CODE').then(response =>{
|
||||
handleAutoGenChange(autoGenFlag) {
|
||||
if (autoGenFlag) {
|
||||
genCode("WORKORDER_CODE").then((response) => {
|
||||
this.form.workorderCode = response;
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
this.form.workorderCode = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.wrapper{
|
||||
.wrapper {
|
||||
height: 400px;
|
||||
}
|
||||
.container {
|
||||
|
Loading…
Reference in New Issue
Block a user