|
|
|
@ -17,26 +17,41 @@
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="物料ID" prop="materialId">-->
|
|
|
|
|
<!-- <el-input-->
|
|
|
|
|
<!-- v-model="queryParams.materialId"-->
|
|
|
|
|
<!-- placeholder="请输入物料ID"-->
|
|
|
|
|
<!-- clearable-->
|
|
|
|
|
<!-- @keyup.enter.native="handleQuery"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="派工类型" prop="dispatchType">-->
|
|
|
|
|
<!-- <el-select v-model="queryParams.dispatchType" placeholder="请选择派工类型" clearable>-->
|
|
|
|
|
<!-- <el-option-->
|
|
|
|
|
<!-- v-for="dict in dict.type.dispatch_type"-->
|
|
|
|
|
<!-- :key="dict.value"-->
|
|
|
|
|
<!-- :label="dict.label"-->
|
|
|
|
|
<!-- :value="dict.value"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="工单状态" prop="orderStatus">
|
|
|
|
|
<el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable>
|
|
|
|
|
<el-form-item label="成品编号" prop="materialCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.materialCode"
|
|
|
|
|
placeholder="请输入成品编号"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="成品名称" prop="materialName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.materialName"
|
|
|
|
|
placeholder="请输入成品名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="成品规格" prop="materialSpec">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.materialSpec"
|
|
|
|
|
placeholder="请输入成品规格"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="工艺路线" prop="dispatchId">
|
|
|
|
|
<el-select v-model="queryParams.dispatchId" placeholder="请选择工艺路线" clearable>
|
|
|
|
|
<el-option v-for="item in routeList" :key="item.routeId" :label="item.routeName"
|
|
|
|
|
:value="item.routeId"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="任务状态" prop="orderStatus">
|
|
|
|
|
<el-select v-model="queryParams.orderStatus" placeholder="请选择任务状态" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.plan_status"
|
|
|
|
|
:key="dict.value"
|
|
|
|
@ -119,7 +134,7 @@
|
|
|
|
|
<!-- >导出-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
|
|
<!--right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar-->
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="productOrderList" @selection-change="handleSelectionChange">
|
|
|
|
@ -134,7 +149,9 @@
|
|
|
|
|
<el-table-column label="销售订单ID" align="center" prop="saleOrderId" v-if="columns[2].visible" width="100"/>
|
|
|
|
|
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[3].visible" width="100"/>
|
|
|
|
|
<el-table-column label="项目编号" align="center" prop="projectNo" v-if="columns[5].visible"/>
|
|
|
|
|
<el-table-column label="成品编号" align="center" prop="materialCode" v-if="columns[27].visible" width="100"/>
|
|
|
|
|
<el-table-column label="成品名称" align="center" prop="materialName" v-if="columns[6].visible" width="100"/>
|
|
|
|
|
<el-table-column label="成品规格" align="center" prop="materialSpec" v-if="columns[29].visible" width="100"/>
|
|
|
|
|
<el-table-column label="成品BOM" align="center" prop="materialBomDesc" v-if="columns[7].visible" width="120"/>
|
|
|
|
|
<el-table-column label="派工类型" align="center" prop="dispatchType" v-if="columns[8].visible">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -142,16 +159,18 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="工艺路线" align="center" prop="dispatchName" v-if="columns[9].visible" width="120"/>
|
|
|
|
|
<el-table-column label="单位时间" align="center" prop="productionTime" v-if="columns[27].visible">
|
|
|
|
|
<!--el-table-column label="单位时间" align="center" prop="productionTime" v-if="columns[27].visible">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ formatDayHourMinutes(scope.row.productionTime) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table-column-->
|
|
|
|
|
<el-table-column label="销售数量" align="center" prop="saleAmount" v-if="columns[10].visible"/>
|
|
|
|
|
<el-table-column label="计划数量" align="center" prop="planAmount" v-if="columns[11].visible"/>
|
|
|
|
|
<el-table-column label="已派工数量" align="center" prop="dispatchAmount" v-if="columns[12].visible" width="100"/>
|
|
|
|
|
<el-table-column label="完成数量" align="center" prop="completeAmount" v-if="columns[13].visible"/>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="前置任务" align="center" prop="preOrderCode"/>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="计划开始时间" align="center" prop="planBeginTime" width="180" v-if="columns[15].visible">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.planBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
@ -163,7 +182,9 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="工单状态" align="center" prop="orderStatus" v-if="columns[19].visible">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="任务状态" align="center" prop="orderStatus" v-if="columns[19].visible">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.plan_status" :value="scope.row.orderStatus"/>
|
|
|
|
|
</template>
|
|
|
|
@ -220,7 +241,7 @@
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-if="scope.row.orderStatus === MES_ORDER_STATUS.UNPUBLISH"
|
|
|
|
|
v-hasPermi="['mes:productOrder:edit']"
|
|
|
|
|
>修改工单
|
|
|
|
|
>修改
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
@ -287,7 +308,7 @@
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改生产工单对话框 -->
|
|
|
|
|
<!-- 添加或修改生产任务对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
|
|
|
<el-form-item label="任务编号" prop="orderCode">
|
|
|
|
@ -369,8 +390,8 @@
|
|
|
|
|
placeholder="请选择计划交货日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="前置生产工单" prop="preOrderCode">
|
|
|
|
|
<el-input v-model="form.preOrderCode" placeholder="请点击右侧检索生产工单" :disabled="productOrderDisabled"
|
|
|
|
|
<el-form-item label="前置生产任务" prop="preOrderCode">
|
|
|
|
|
<el-input v-model="form.preOrderCode" placeholder="请点击右侧检索生产任务" :disabled="productOrderDisabled"
|
|
|
|
|
readonly>
|
|
|
|
|
<el-button slot="append" icon="el-icon-search" @click="handleProductOrderAdd"></el-button>
|
|
|
|
|
</el-input>
|
|
|
|
@ -401,7 +422,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 无销售订单添加生产工单对话框 -->
|
|
|
|
|
<!-- 无销售订单添加生产任务对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="noOrderOpen" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
|
|
|
<el-form-item label="任务编号" prop="orderCode">
|
|
|
|
@ -459,8 +480,8 @@
|
|
|
|
|
placeholder="请选择计划交货日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="前置生产工单" prop="preOrderCode">
|
|
|
|
|
<el-input v-model="form.preOrderCode" placeholder="请点击右侧检索生产工单" :disabled="productOrderDisabled"
|
|
|
|
|
<el-form-item label="前置生产任务" prop="preOrderCode">
|
|
|
|
|
<el-input v-model="form.preOrderCode" placeholder="请点击右侧检索生产任务" :disabled="productOrderDisabled"
|
|
|
|
|
readonly>
|
|
|
|
|
<el-button slot="append" icon="el-icon-search" @click="handleProductOrderAdd"></el-button>
|
|
|
|
|
</el-input>
|
|
|
|
@ -509,8 +530,8 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 添加生产工单信息对话框 -->
|
|
|
|
|
<el-dialog title="选择生产工单信息" :visible.sync="productOrderOpen" width="1000px" append-to-body>
|
|
|
|
|
<!-- 添加生产任务信息对话框 -->
|
|
|
|
|
<el-dialog title="选择生产任务信息" :visible.sync="productOrderOpen" width="1000px" append-to-body>
|
|
|
|
|
<add-product-order @selection="handleSelection" ref="productOrderRef"></add-product-order>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitProductOrderForm">确 定</el-button>
|
|
|
|
@ -580,7 +601,7 @@ export default {
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 生产工单表格数据
|
|
|
|
|
// 生产任务表格数据
|
|
|
|
|
productOrderList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
@ -610,6 +631,9 @@ export default {
|
|
|
|
|
saleorderLinenumber: null,
|
|
|
|
|
projectNo: null,
|
|
|
|
|
materialId: null,
|
|
|
|
|
materialCode: null,
|
|
|
|
|
materialName: null,
|
|
|
|
|
materialSpec: null,
|
|
|
|
|
materialBomId: null,
|
|
|
|
|
dispatchType: null,
|
|
|
|
|
dispatchId: null,
|
|
|
|
@ -714,9 +738,9 @@ export default {
|
|
|
|
|
{key: 24, label: `更新人`, visible: false},
|
|
|
|
|
{key: 25, label: `更新时间`, visible: false},
|
|
|
|
|
{key: 26, label: `计划交货日期`, visible: true},
|
|
|
|
|
{key: 27, label: `单位时间`, visible: true},
|
|
|
|
|
{key: 27, label: `成品编号`, visible: true},
|
|
|
|
|
{key: 28, label: `销售类型`, visible: true},
|
|
|
|
|
],
|
|
|
|
|
{key: 29, label: `成品规格`, visible: true}, ],
|
|
|
|
|
//物料BOM选项
|
|
|
|
|
materialBomList: [],
|
|
|
|
|
//工艺路线选项
|
|
|
|
@ -819,6 +843,35 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.queryParams = {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
orderCode: null,
|
|
|
|
|
saleOrderId: null,
|
|
|
|
|
saleorderCode: null,
|
|
|
|
|
saleorderLinenumber: null,
|
|
|
|
|
projectNo: null,
|
|
|
|
|
materialId: null,
|
|
|
|
|
materialBomId: null,
|
|
|
|
|
dispatchType: null,
|
|
|
|
|
dispatchId: null,
|
|
|
|
|
saleAmount: null,
|
|
|
|
|
planAmount: null,
|
|
|
|
|
dispatchAmount: null,
|
|
|
|
|
completeAmount: null,
|
|
|
|
|
releaseTime: null,
|
|
|
|
|
planDeliveryDate: null,
|
|
|
|
|
planBeginTime: null,
|
|
|
|
|
planEndTime: null,
|
|
|
|
|
realBeginTime: null,
|
|
|
|
|
realEndTime: null,
|
|
|
|
|
orderStatus: null,
|
|
|
|
|
stockLockFlag: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null
|
|
|
|
|
},
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
@ -893,10 +946,10 @@ export default {
|
|
|
|
|
this.saleOrderOpen = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 提交生产工单信息按钮 */
|
|
|
|
|
/** 提交生产任务信息按钮 */
|
|
|
|
|
submitProductOrderForm() {
|
|
|
|
|
let selectedRow = this.$refs.productOrderRef.selectedRow;
|
|
|
|
|
this.form.preOrderId = selectedRow.saleOrderId;
|
|
|
|
|
this.form.preOrderId = selectedRow.productOrderId;
|
|
|
|
|
this.form.preOrderCode = selectedRow.orderCode;
|
|
|
|
|
if (selectedRow.planBeginTime != null && this.form.planBeginTime == null) {
|
|
|
|
|
const date = new Date(selectedRow.planBeginTime);
|
|
|
|
@ -943,7 +996,7 @@ export default {
|
|
|
|
|
this.form.orderCode = response.msg;
|
|
|
|
|
})
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加生产工单";
|
|
|
|
|
this.title = "添加生产任务";
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
@ -974,7 +1027,7 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
this.noOrderOpen = true;
|
|
|
|
|
this.form.saleOrderFlag = '0';
|
|
|
|
|
this.title = "添加生产工单";
|
|
|
|
|
this.title = "添加生产任务";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
@ -993,7 +1046,7 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
this.open = true;
|
|
|
|
|
}
|
|
|
|
|
this.title = "修改生产工单";
|
|
|
|
|
this.title = "修改生产任务";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -1020,8 +1073,8 @@ export default {
|
|
|
|
|
const productOrderId = row.productOrderId || this.ids[0];
|
|
|
|
|
const orderCode = row.orderCode;
|
|
|
|
|
const params = {queryParams: this.queryParams};
|
|
|
|
|
this.$tab.closeOpenPage(router.currentRoute);
|
|
|
|
|
this.$tab.openPage("工单[" + orderCode + "]生产派工", '/mes/product-plan/index/' + productOrderId, params);
|
|
|
|
|
// this.$tab.closeOpenPage(router.currentRoute);
|
|
|
|
|
this.$tab.openPage("任务[" + orderCode + "]生产派工", '/mes/product-plan/index/' + productOrderId, params);
|
|
|
|
|
});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
@ -1047,15 +1100,15 @@ export default {
|
|
|
|
|
const orderCode = row.orderCode;
|
|
|
|
|
const params = {queryParams: this.queryParams};
|
|
|
|
|
// this.$tab.closeOpenPage(router.currentRoute);
|
|
|
|
|
this.$tab.openPage("工单[" + orderCode + "]生产派工", '/mes/product-plan/index/' + productOrderId, params);
|
|
|
|
|
this.$tab.openPage("任务[" + orderCode + "]生产派工", '/mes/product-plan/index/' + productOrderId, params);
|
|
|
|
|
},
|
|
|
|
|
/** 排产 */
|
|
|
|
|
handleProductionScheduling(row) {
|
|
|
|
|
const productOrderId = row.productOrderId;
|
|
|
|
|
const orderCode = row.orderCode;
|
|
|
|
|
const params = {queryParams: this.queryParams};
|
|
|
|
|
this.$tab.closeOpenPage(router.currentRoute);
|
|
|
|
|
this.$tab.openPage("工单[" + orderCode + "]排产", '/mes/production-scheduling/index/' + productOrderId, params);
|
|
|
|
|
// this.$tab.closeOpenPage(router.currentRoute);
|
|
|
|
|
this.$tab.openPage("任务[" + orderCode + "]排产", '/mes/production-scheduling/index/' + productOrderId, params);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleMaterialUsage(row) {
|
|
|
|
@ -1089,7 +1142,7 @@ export default {
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
//销售订单新增的校验工单数量不能大于销售数量
|
|
|
|
|
//销售订单新增的校验任务数量不能大于销售数量
|
|
|
|
|
if (this.form.saleOrderFlag === '1' && this.form.saleAmount < this.form.planAmount) {
|
|
|
|
|
return this.$modal.msgError("计划数量不能大于销售数量!");
|
|
|
|
|
}
|
|
|
|
|