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

master
yinq 4 months ago
parent a33fa0362c
commit 9412139f5b

@ -197,6 +197,34 @@ public class MesProductOrder extends BaseEntity {
@Excel(name = "单位时间") @Excel(name = "单位时间")
private Long productionTime; 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() { public Long getProductionTime() {
return productionTime; return productionTime;
} }

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

@ -27,6 +27,16 @@
/> />
</el-select> </el-select>
</el-form-item> </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-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></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-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -130,12 +140,8 @@
<script> <script>
import { import {
listProductOrder, listProductOrder,
getProductOrder,
delProductOrder,
addProductOrder,
updateProductOrder,
getOrderCode, productOrderLockInventory, productOrderPublish, productOrderRecall
} from "@/api/mes/productOrder"; } from "@/api/mes/productOrder";
import {findRouteList} from "@/api/mes/baseRoute";
export default { export default {
name: "ProductOrder", name: "ProductOrder",

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

Loading…
Cancel
Save