change - 生产工单新增修改时关联前置生产工单

master
yinq 4 months ago
parent a33fa0362c
commit 9412139f5b

@ -197,6 +197,34 @@ public class MesProductOrder extends BaseEntity {
@Excel(name = "单位时间")
private Long productionTime;
/**
* ID
*/
@Excel(name = "前置生产工单ID")
private Long preOrderId;
/**
*
*/
@Excel(name = "前置生产工单编号")
private String preOrderCode;
public String getPreOrderCode() {
return preOrderCode;
}
public void setPreOrderCode(String preOrderCode) {
this.preOrderCode = preOrderCode;
}
public Long getPreOrderId() {
return preOrderId;
}
public void setPreOrderId(Long preOrderId) {
this.preOrderId = preOrderId;
}
public Long getProductionTime() {
return productionTime;
}

@ -75,6 +75,7 @@
mpo.create_time,
mpo.update_by,
mpo.update_time,
mpo.pre_order_id,
mbr.production_time
from mes_product_order mpo
left join (select a.route_id,
@ -115,6 +116,7 @@
<if test="orderStatus != null and orderStatus != ''">and mpo.order_status = #{orderStatus}</if>
<if test="stockLockFlag != null and stockLockFlag != ''">and mpo.stock_lock_flag = #{stockLockFlag}</if>
<if test="saleOrderFlag != null and saleOrderFlag != ''">and mpo.sale_order_flag = #{saleOrderFlag}</if>
<if test="preOrderId != null and preOrderId != ''">and mpo.pre_order_id = #{preOrderId}</if>
<if test="createBy != null and createBy != ''">and mpo.create_by = #{createBy}</if>
<if test="createTime != null ">and mpo.create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and mpo.update_by = #{updateBy}</if>
@ -160,6 +162,7 @@
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="planDeliveryDate != null">plan_delivery_date,</if>
<if test="preOrderId != null">pre_order_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null and orderCode != ''">#{orderCode},</if>
@ -190,6 +193,7 @@
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="planDeliveryDate != null">#{planDeliveryDate},</if>
<if test="preOrderId != null">#{preOrderId},</if>
</trim>
</insert>
@ -224,6 +228,7 @@
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="planDeliveryDate != null">plan_delivery_date = #{planDeliveryDate},</if>
<if test="preOrderId != null">pre_order_id = #{preOrderId},</if>
</trim>
where product_order_id = #{productOrderId}
</update>

@ -27,6 +27,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="工艺路线" prop="dispatchId">
<el-select v-model="form.dispatchId" filterable 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>
<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>
@ -54,7 +64,7 @@
<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">
<template slot-scope="scope">
<span>{{formatDayHourMinutes(scope.row.productionTime) }}</span>
<span>{{ formatDayHourMinutes(scope.row.productionTime) }}</span>
</template>
</el-table-column>
<el-table-column label="销售数量" align="center" prop="saleAmount" v-if="columns[10].visible"/>
@ -130,12 +140,8 @@
<script>
import {
listProductOrder,
getProductOrder,
delProductOrder,
addProductOrder,
updateProductOrder,
getOrderCode, productOrderLockInventory, productOrderPublish, productOrderRecall
} from "@/api/mes/productOrder";
import {findRouteList} from "@/api/mes/baseRoute";
export default {
name: "ProductOrder",

@ -338,6 +338,11 @@
placeholder="请选择计划交货日期">
</el-date-picker>
</el-form-item>
<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>
</el-form-item>
<el-form-item label="计划开始时间" prop="planBeginTime">
<el-date-picker clearable
v-model="form.planBeginTime"
@ -416,6 +421,11 @@
placeholder="请选择计划交货日期">
</el-date-picker>
</el-form-item>
<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>
</el-form-item>
<el-form-item label="计划开始时间" prop="planBeginTime">
<el-date-picker clearable
v-model="form.planBeginTime"
@ -460,6 +470,15 @@
</div>
</el-dialog>
<!-- 添加生产工单信息对话框 -->
<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>
<el-button @click="productOrderOpen = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -476,14 +495,17 @@ import addSaleOrder from '@//views/mes/productOrder/addSaleOrder.vue';
import {getMaterialVisionList} from "@//api/mes/materialBom";
import {findRouteList} from "@//api/mes/baseRoute";
import addBom from '@//views/mes/materialBom/addBom.vue';
import add_ProductOrder from '@//views/mes/productOrder/addProductOrder.vue';
import router from "@//router";
import {parseTime} from "@/utils/ruoyi";
export default {
name: "ProductOrder",
dicts: ['active_flag', 'plan_status', 'dispatch_type', 'mes_sale_type'],
components: {
'add-SaleOrder': addSaleOrder,
'add-bom': addBom
'add-bom': addBom,
'add-product-order': add_ProductOrder,
},
data() {
return {
@ -513,6 +535,8 @@ export default {
noOrderOpen: false,
//
materialOpen: false,
//
productOrderOpen: false,
//
queryParams: {
pageNum: 1,
@ -630,9 +654,9 @@ export default {
materialBomList: [],
//线
routeList: [],
saleOrderDisabled: true,
materialDisabled: true,
productOrderDisabled: true,
//
MES_SALE_TYPE: {
MES_SALE_TYPE_EXTERNAL: '1',//
@ -783,6 +807,19 @@ export default {
this.saleOrderOpen = false;
},
/** 提交生产工单信息按钮 */
submitProductOrderForm() {
let selectedRow = this.$refs.productOrderRef.selectedRow;
this.form.preOrderId = selectedRow.saleOrderId;
this.form.preOrderCode = selectedRow.orderCode;
if (selectedRow.planBeginTime != null && this.form.planBeginTime == null){
const date = new Date(selectedRow.planBeginTime);
date.setDate(date.getDate() + 1)
this.form.planBeginTime = parseTime(date, '{y}-{m}-{d} {h}:{i}:{s}');
}
this.productOrderOpen = false;
},
changeSaleType(value) {
this.form.saleOrderId = null;
this.form.saleorderCode = null;
@ -837,6 +874,11 @@ export default {
}
},
/** 新增按钮操作 */
handleProductOrderAdd() {
this.productOrderOpen = true;
},
/** 无订单新增按钮操作 */
handleNoOrderAdd() {
this.materialDisabled = false;

Loading…
Cancel
Save