MES:
-在选择物料页面搜索选项增加历史记录选择
-生产工单权限完善
-采购订单查询完善
-销售订单查询完善
master
xs 3 months ago
parent d7de1e9dc8
commit ca5aca117f

@ -36,7 +36,9 @@ public class MimeTypeUtils
// 视频格式
"mp4", "avi", "rmvb",
// pdf
"pdf" };
"pdf",
//图纸
"dxf","dwg"};
public static String getExtension(String prefix)
{

@ -143,4 +143,19 @@ public enum BusinessType
*
*/
CONTINUE,
/**
*
*/
MANAGEMENT,
/**
*
*/
PUBLISH,
/**
*
*/
RECALL,
}

@ -114,6 +114,8 @@ public class MesProductOrderController extends BaseController {
* @param productOrderList
* @return
*/
@RequiresPermissions("mes:productOrder:management")
@Log(title = "生产工单", businessType = BusinessType.MANAGEMENT)
@PostMapping("/batchEditingProductOrder")
public AjaxResult batchEditingProductOrder(@RequestBody List<MesProductOrder> productOrderList) {
int result = mesProductOrderService.batchEditingProductOrder(productOrderList);
@ -131,7 +133,7 @@ public class MesProductOrderController extends BaseController {
}
/**
*
*
*/
@Log(title = "生产工单", businessType = BusinessType.UPDATE)
@PostMapping("/productOrderLockInventory")
@ -142,7 +144,8 @@ public class MesProductOrderController extends BaseController {
/**
*
*/
@Log(title = "生产工单", businessType = BusinessType.UPDATE)
@Log(title = "生产工单", businessType = BusinessType.PUBLISH)
@RequiresPermissions("mes:productOrder:publish")
@PostMapping("/productOrderPublish")
public AjaxResult productOrderPublish(@RequestBody MesProductOrder mesProductOrder) {
return toAjax(mesProductOrderService.productOrderPublish(mesProductOrder));
@ -186,6 +189,7 @@ public class MesProductOrderController extends BaseController {
* 使
*/
// @RequiresPermissions("mes:productplan:add")
@RequiresPermissions("mes:productOrder:materialUsage")
@GetMapping("/getMaterialUsages")
public AjaxResult getMaterialUsages(MesProductOrder mesProductOrder) {
return success(mesProductOrderService.getMaterialUsages(mesProductOrder));

@ -112,7 +112,7 @@ public class MesProductPlanController extends BaseController {
/**
*
*/
@RequiresPermissions("mes:productplan:edit")
@RequiresPermissions("mes:productplan:add")
@Log(title = "生产派工", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesProductPlan mesProductPlan) {
@ -216,7 +216,8 @@ public class MesProductPlanController extends BaseController {
/**
*
*/
@Log(title = "生产工单", businessType = BusinessType.UPDATE)
@Log(title = "生产工单", businessType = BusinessType.RECALL)
@RequiresPermissions("mes:productOrder:recall")
@PostMapping("/productOrderRecall")
public AjaxResult productOrderRecall(@RequestBody MesProductOrder mesProductOrder) {
return toAjax(mesProductPlanService.productOrderRecall(mesProductOrder));

@ -232,14 +232,14 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
p.getPlanId() == null
).collect(Collectors.toList());
StringBuffer returnMsgBuffer = new StringBuffer();
int i=1;
int i = 1;
for (MesProductPlan toInsertedProductPlan : toInsertedProductPlanList) {
List<MesProductPlan> conflictProductPlans = mesProductPlanMapper.selectOnlyConflictMesProductPlans(toInsertedProductPlan);
if (conflictProductPlans != null && !conflictProductPlans.isEmpty()) {
conflictProductPlans.forEach(cp -> {
returnMsgBuffer.append(i).append(".").append(cp.getNickName()).append(":").append("计划时间")
.append(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,cp.getPlanBeginTime()))
.append("-").append(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,cp.getPlanEndTime())).append(";");
.append(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, cp.getPlanBeginTime()))
.append("-").append(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, cp.getPlanEndTime())).append(";");
});
}
}
@ -290,6 +290,8 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
throw new ServiceException("总派工数量不能大于计划数量,请重新派工");
}
Long orderPlanBeginTimeL = mesProductOrder.getPlanBeginTime() == null ? 0L : mesProductOrder.getPlanBeginTime().getTime();
Long orderPlanEndTimeL = mesProductOrder.getPlanEndTime() == null ? 0L : mesProductOrder.getPlanEndTime().getTime();
/**productplanproductplan
* productorder,
@ -300,6 +302,22 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
List<MesProductPlan> mesProductPlanList = mesProductPlanEditVo.getMesProductPlanList();
for (MesProductPlan mesProductPlan : mesProductPlanList) {
Date planPlanBeginTime = mesProductPlan.getPlanBeginTime();
Date planPlanEndTime = mesProductPlan.getPlanEndTime();
if (planPlanBeginTime != null) {
long planPlanBeginTimeL = planPlanBeginTime.getTime();
if (planPlanBeginTimeL < orderPlanBeginTimeL || planPlanBeginTimeL > orderPlanEndTimeL) {
throw new ServiceException("生产派工的计划开始时间不在生产工单计划时间范围内");
}
}
if (planPlanEndTime != null) {
long planPlanEndTimeL = planPlanEndTime.getTime();
if (planPlanEndTimeL < orderPlanBeginTimeL || planPlanEndTimeL > orderPlanEndTimeL) {
throw new ServiceException("生产派工的计划结束时间不在生产工单计划时间范围内");
}
}
Long planId = mesProductPlan.getPlanId();
if (planId != null) {
MesProductPlan dbProductPlan = orderProductPlans.stream().filter(orderProductPlan -> orderProductPlan.getPlanId().equals(planId)).findFirst().get();

@ -415,6 +415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="srcBillNo != null and srcBillNo != ''"> and mpo.src_bill_no like concat('%', #{srcBillNo}, '%')</if>
<if test="tondBase != null and tondBase != ''"> and mpo.tond_base like concat('%', #{tondBase}, '%')</if>
</where>
order by mpo.erp_modify_date desc
</select>
</mapper>

@ -253,7 +253,9 @@
</if>
<if test="materialSpec != null and materialSpec != '' ">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="isRelease != null and isRelease != ''">and mso.is_release = #{isRelease}</if>
</where>
order by mso.erp_modify_date desc
</select>
</mapper>

@ -33,6 +33,11 @@ public class WmsRawInstock extends BaseEntity
@Excel(name = "库位编码")
private String locationCode;
/**
* ID
*/
private Long purchaseOrderId;
/** 采购订单号,入库扫描条码时获取唯一条码 */
@Excel(name = "采购订单号,入库扫描条码时获取唯一条码")
private String poNo;
@ -189,6 +194,15 @@ public class WmsRawInstock extends BaseEntity
{
return locationCode;
}
public Long getPurchaseOrderId() {
return purchaseOrderId;
}
public void setPurchaseOrderId(Long purchaseOrderId) {
this.purchaseOrderId = purchaseOrderId;
}
public void setPoNo(String poNo)
{
this.poNo = poNo;

@ -181,19 +181,20 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
}
}
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
WmsRawInstock wmsRawInstock = new WmsRawInstock();
wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType, Seq.rawInstockSeqCode));
wmsRawInstock.setWarehouseId(baseLocation.getWarehouseId());
wmsRawInstock.setLocationCode(locationCode);
wmsRawInstock.setPurchaseOrderId(baseBarcodeInfo.getPurchaseOrderId());
wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo());
wmsRawInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL);
wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_PURCHASE);
wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsRawInstock.setApplyBy(userName);
wmsRawInstock.setApplyDate(currentDate);
if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) {
wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode());
}
@ -336,6 +337,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
WmsRawInstock wmsRawInstock = new WmsRawInstock();
wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType, Seq.rawInstockSeqCode));
wmsRawInstock.setWarehouseId(wmsRawBackVo.getWarehouseId());
wmsRawInstock.setPurchaseOrderId(baseBarcodeInfo.getPurchaseOrderId());
wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo());
wmsRawInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO);
wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_RETURN);

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="taskCode" column="task_code" />
<result property="warehouseId" column="warehouse_id" />
<result property="locationCode" column="location_code" />
<result property="purchaseOrderId" column="purchase_order_id" />
<result property="poNo" column="po_no" />
<result property="operationType" column="operation_type" />
<result property="instockType" column="instock_type" />
@ -75,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskCode != null">task_code,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="locationCode != null">location_code,</if>
<if test="purchaseOrderId != null">purchase_order_id,</if>
<if test="poNo != null">po_no,</if>
<if test="operationType != null and operationType != ''">operation_type,</if>
<if test="instockType != null and instockType != ''">instock_type,</if>
@ -101,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskCode != null">#{taskCode},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="locationCode != null">#{locationCode},</if>
<if test="purchaseOrderId != null">#{purchaseOrderId},</if>
<if test="poNo != null">#{poNo},</if>
<if test="operationType != null and operationType != ''">#{operationType},</if>
<if test="instockType != null and instockType != ''">#{instockType},</if>

@ -314,7 +314,7 @@ export const dynamicRoutes = [
path: '/mes/product-plan',
component: Layout,
hidden: true,
permissions: ['mes:productplan:edit'],
permissions: ['mes:productplan:add'],
children: [
{
path: 'index/:productOrderId(\\d+)',
@ -328,7 +328,7 @@ export const dynamicRoutes = [
path: '/mes/production-scheduling',
component: Layout,
hidden: true,
permissions: ['mes:productplan:edit'],
permissions: ['mes:productOrder:management'],
children: [
{
path: 'index/:productOrderId(\\d+)',

@ -207,7 +207,6 @@ export default {
wmsRawOutstockDetailList: []
}
alert(JSON.stringify(this.form))
}
if (this.defineData.maxPlanAmount) {
this.maxPlanAmount = this.defineData.maxPlanAmount

@ -498,7 +498,7 @@
<!-- <el-table-column align="center" class-name="small-padding fixed-width" label="操作">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- v-hasPermi="['mes:productplan:edit']"-->
<!-- v-hasPermi="['mes:productplan:add']"-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- type="text"-->
@ -723,14 +723,14 @@ export default {
// });
// }, 60 * 1000)
getLoginStationInfo().then(e => {
// if(!e.data){
// this.$modal.msgError("");
// return;
// }
// this.loginStationInfo = e.data;
if(!e.data){
this.$modal.msgError("登录工位有误");
return;
}
this.loginStationInfo = e.data;
//TODO
this.loginStationInfo = {stationId:"1",stationCode:"ZP_02"}
// this.loginStationInfo = {stationId:"1",stationCode:"ZP_02"}
this.getProductPlans();
this.getChartData();
});

@ -510,6 +510,11 @@ const vw = (document.documentElement.clientWidth || document.body.clientWidth) /
export default {
name: 'Board1',
dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', "mes_safe_flag"],
provide(){
return{
closeDialog : this.closeDialog
}
},
components: {
'apply-raw-outstock': applyRawOutstock,
Chart,
@ -1106,7 +1111,11 @@ export default {
this.materialConfirmForm.materialBarcode = this.serialData;
}
// console.log(this.serialData)
}
},
closeDialog(){
this.dialogVisible = false;
},
}
}

@ -355,6 +355,11 @@ const vw = (document.documentElement.clientWidth || document.body.clientWidth) /
export default {
name: 'Board1',
dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', 'mes_safe_flag'],
provide(){
return{
closeDialog : this.closeDialog
}
},
mixins: [monitorSerialData],
components: {
'apply-raw-outstock': applyRawOutstock,
@ -1099,7 +1104,11 @@ export default {
this.returnModelForm.materialBarcode = this.serialData;
}
// console.log(this.serialData)
}
},
closeDialog(){
this.dialogVisible = false;
},
}

@ -1,3 +1,4 @@
<!--此文件不用-->
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">

@ -1,10 +1,10 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="物料ID" prop="materialId">
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="queryParams.materialId"
placeholder="请输入物料ID"
v-model="queryParams.materialCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
@ -17,6 +17,14 @@
@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="topFlag">
<el-select v-model="queryParams.topFlag" placeholder="请选择顶级标识" clearable>
<el-option
@ -37,14 +45,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="项目ID" prop="projectId">
<el-input
v-model="queryParams.projectId"
placeholder="请输入项目ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="激活标识" prop="activeFlag">-->
<!-- <el-select v-model="queryParams.activeFlag" placeholder="请选择激活标识" clearable>-->
<!-- <el-option-->
@ -75,7 +76,7 @@
</el-col>
<el-col :span="1.5">
<el-button
type="info"
type="primary"
plain
icon="el-icon-sort"
size="mini"
@ -85,7 +86,7 @@
</el-col>
<el-col :span="1.5">
<el-button
type="info"
type="primary"
plain
icon="el-icon-upload2"
size="mini"
@ -93,7 +94,7 @@
>BOM导入
</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
@ -107,7 +108,9 @@
<el-table-column label="父级标识" prop="parentId" v-if="columns[1].visible"/>
<el-table-column label="祖级列表" align="center" prop="ancestors" v-if="columns[2].visible"/>
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[3].visible"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="left" prop="materialName" v-if="columns[4].visible"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="BOM说明" align="center" prop="materialBomDesc" v-if="columns[15].visible"/>
<el-table-column label="标准数量" align="center" prop="standardAmount" v-if="columns[5].visible"/>
<el-table-column label="安装时长" align="center" prop="assembleTime" v-if="columns[16].visible">
@ -166,7 +169,8 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="父级BOM" prop="parentId" v-if="topBomVisible">
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer" v-if="topBomVisible" disabled/>
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer"
v-if="topBomVisible" disabled/>
</el-form-item>
<!-- <el-form-item label="物料ID" prop="materialId">-->
<!-- <el-input v-model="form.materialId" placeholder="请输入物料ID" />-->
@ -191,7 +195,8 @@
分钟
</el-form-item>
<el-form-item label="标准数量" prop="standardAmount">
<el-input-number v-model="form.standardAmount" :min="1" placeholder="请输入标准数量" :disabled="amountDisabled"/>
<el-input-number v-model="form.standardAmount" :min="1" placeholder="请输入标准数量"
:disabled="amountDisabled"/>
</el-form-item>
<!-- <el-form-item label="顶级标识" prop="topFlag">-->
<!-- <el-radio-group v-model="form.topFlag">-->
@ -202,7 +207,7 @@
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="校验类型" prop="checkType" v-if="form.topFlag === 0">
<el-form-item label="校验类型" prop="checkType" v-if="form.topFlag !== TOP_FLAG.YES">
<el-radio-group v-model="form.checkType">
<el-radio
v-for="dict in dict.type.check_type"
@ -234,7 +239,7 @@
<!-- 添加物料信息对话框 -->
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
<add-bom @selection="handleSelection" ref="materialRef"></add-bom>
<select-material @selection="handleSelection" ref="materialRef" v-if="materialOpen"></select-material>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitMaterialForm"> </el-button>
<el-button @click="materialOpen = false"> </el-button>
@ -283,7 +288,7 @@ import {
} from "@/api/mes/materialBom";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import addBom from '@//views/mes/materialBom/addBom.vue';
import selectMaterial from '@//views/mes/materialinfo/selectMaterial.vue';
import {verifyBOMIsProduction} from "@//api/mes/productOrder";
import {getToken} from "@/utils/auth";
@ -292,7 +297,7 @@ export default {
dicts: ['active_flag', 'check_type'],
components: {
Treeselect,
'add-bom': addBom
'select-material': selectMaterial
},
data() {
return {
@ -342,6 +347,9 @@ export default {
materialId: [
{required: true, message: "物料ID不能为空", trigger: "blur"}
],
materialName: [
{required: true, message: "请选择BOM信息", trigger: "blur"}
],
materialBomDesc: [
{required: true, message: "BOM说明不能为空", trigger: "blur"}
],
@ -362,7 +370,7 @@ export default {
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
headers: {Authorization: "Bearer " + getToken()},
//
url: process.env.VUE_APP_BASE_API + "/mes/import/BOMImportData"
},
@ -385,10 +393,16 @@ export default {
{key: 15, label: `BOM说明`, visible: true},
{key: 16, label: `安装时长`, visible: true},
],
//
TOP_FLAG: {
YES: 1,
NO: 0
}
};
},
watch: {
'form.parentId': function(newValue, oldValue) {
'form.parentId': function (newValue, oldValue) {
if (newValue === 0) {
this.topBomVisible = false;
this.amountDisabled = true;
@ -487,6 +501,7 @@ export default {
this.reset();
// this.getTreeselect();
if (row != null && row.materialBomId) {
this.form.topFlag = this.TOP_FLAG.NO;
this.form.parentId = row.materialBomId;
verifyBOMIsProduction(row.materialBomId).then(res => {
if (res.data) {
@ -495,9 +510,8 @@ export default {
getMaterialBom(row.materialBomId).then(e => {
//BOMbom
this.rules.materialBomDesc[0].required = this.form.parentId === 0;
if (row.parentId === 0){
this.assembleTimeVisible = false;
}
this.assembleTimeVisible = true;
this.form.checkType = e.data.checkType;
this.getBomTreeselect(e.data);
this.open = true;
@ -508,6 +522,7 @@ export default {
});
} else {
this.form.parentId = 0;
this.form.topFlag = this.TOP_FLAG.YES;
this.assembleTimeVisible = false;
this.open = true;
this.title = "添加物料BOM信息";
@ -539,7 +554,7 @@ export default {
getMaterialBom(row.materialBomId).then(response => {
this.form = response.data;
this.convertToTime();
if (this.form.parentId === 0){
if (this.form.parentId === 0) {
this.assembleTimeVisible = false;
}
//BOMbom
@ -604,8 +619,8 @@ export default {
/** 提交物料信息按钮 */
submitMaterialForm() {
let selectedRow = this.$refs.materialRef.selectedRow;
this.form.materialId = selectedRow.materialId;
this.form.materialName = selectedRow.materialName;
this.$set(this.form, "materialId", selectedRow.materialId);
this.$set(this.form, "materialName", selectedRow.materialName);
this.materialOpen = false;
},
/** 导入按钮操作 */
@ -622,7 +637,7 @@ export default {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
this.getList();
},
//

@ -54,6 +54,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="activeFlag">
<el-select v-model="queryParams.activeFlag" placeholder="请选择状态" clearable>
<el-option
v-for="dict in dict.type.mes_material_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</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>
@ -132,6 +142,11 @@
</el-table-column>
<el-table-column label="批次数量" align="center" prop="batchAmount"/>
<el-table-column label="安全库存数量" align="center" prop="safeStockAmount"/>
<el-table-column label="状态" align="center" prop="activeFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_material_status" :value="scope.row.activeFlag"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -222,9 +237,25 @@
<el-form-item label="安全库存数量" prop="safeStockAmount">
<el-input-number v-model="form.safeStockAmount" placeholder="请输入安全库存数量" :min="1" :max="10000000000"
style="width:300px"/>
style="width:260px"/>
</el-form-item>
<el-form-item label="状态" prop="activeFlag">
<el-radio-group v-model="form.activeFlag">
<el-radio
v-for="dict in dict.type.mes_material_status"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -248,7 +279,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Materialinfo",
dicts: ['active_flag', 'material_categories', 'mes_material_bind_flag','mes_material_batch_flag'],
dicts: ['active_flag', 'material_categories', 'mes_material_bind_flag','mes_material_batch_flag','mes_material_status'],
components: {
Treeselect
},

@ -7,6 +7,8 @@
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
auto-complete="on"
id="historyMaterialCode"
/>
</el-form-item>
@ -16,15 +18,19 @@
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
auto-complete="on"
id="historyMaterialName"
/>
</el-form-item>
<el-form-item label="物料规格" prop="materialName">
<el-form-item label="物料规格" prop="materialSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入物料规格"
clearable
@keyup.enter.native="handleQuery"
auto-complete="on"
id="historyMaterialSpec"
/>
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
@ -130,7 +136,7 @@ export default {
createOrgId: null,
useOrgId: null,
prodlineId: null,
activeFlag: null,
activeFlag: '1',
deletedFlag: null,
approveDate: null,
erpModifyDate: null

@ -210,7 +210,7 @@
type="text"
icon="el-icon-timer"
@click="handleProductionScheduling(scope.row)"
v-hasPermi="['mes:productOrder:edit']"
v-hasPermi="['mes:productOrder:management']"
>排产
</el-button>
<el-button
@ -246,6 +246,7 @@
icon="el-icon-success"
@click="handlePublish(scope.row)"
v-if="scope.row.orderStatus === '0'"
v-hasPermi="['mes:productOrder:publish']"
>发布
</el-button>
<el-button
@ -254,6 +255,7 @@
icon="el-icon-d-arrow-left"
@click="handleRecall(scope.row)"
v-if="scope.row.orderStatus === '1'"
v-hasPermi="['mes:productOrder:recall']"
>撤回
</el-button>
<el-button
@ -262,6 +264,7 @@
icon="el-icon-user-solid"
@click="handleDispatch(scope.row)"
v-if="scope.row.orderStatus !== MES_ORDER_STATUS.UNPUBLISH"
v-hasPermi="['mes:productplan:add']"
>生产派工
</el-button>
<el-button
@ -269,6 +272,7 @@
type="text"
icon="el-icon-box"
@click="handleMaterialUsage(scope.row)"
v-hasPermi="['mes:productOrder:materialUsage']"
>库存使用
</el-button>
</template>
@ -318,7 +322,7 @@
<el-form-item label="成品名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请点击右侧检索物料" :disabled="materialDisabled" readonly>
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
<el-button slot="append" icon="el-icon-search" v-if="!materialDisabled" @click="handleMaterialAdd"></el-button>
</el-input>
</el-form-item>
@ -498,7 +502,7 @@
<!-- 添加物料信息对话框 -->
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
<add-bom @selection="handleSelection" ref="materialRef" :select-type="selectType" v-if="materialOpen"></add-bom>
<select-material @selection="handleSelection" ref="materialRef" :select-type="selectType" v-if="materialOpen"></select-material>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitMaterialForm"> </el-button>
<el-button @click="materialOpen = false"> </el-button>
@ -547,17 +551,17 @@ import {
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";
import selectMaterial from "@/views/mes/materialinfo/selectMaterial.vue";
export default {
name: "ProductOrder",
dicts: ['active_flag', 'plan_status', 'dispatch_type', 'mes_sale_type'],
components: {
'add-SaleOrder': addSaleOrder,
'add-bom': addBom,
'select-material': selectMaterial,
'add-product-order': add_ProductOrder,
},
data() {
@ -742,6 +746,12 @@ export default {
}
};
},
activated() {
if (this.$route.query.queryParams != null) {
this.queryParams = {...this.$route.query.queryParams}
}
this.getList();
},
created() {
if (this.$route.query.queryParams != null) {
this.queryParams = {...this.$route.query.queryParams}
@ -978,7 +988,7 @@ export default {
getMaterialVisionList(response.data.materialId).then(response => {
this.materialBomList = response.data
})
if (response.data.saleOrderId === null) {
if (response.data.saleOrderFlag === "0") {
this.noOrderOpen = true;
} else {
this.open = true;

@ -97,7 +97,7 @@
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope">
<el-button
v-hasPermi="['mes:productplan:edit']"
v-hasPermi="['mes:productplan:add']"
icon="el-icon-edit"
size="mini"
type="text"

@ -8,7 +8,7 @@
<el-col :span="12">
<el-form-item label="任务编号:">{{ form.orderCode }}</el-form-item>
<el-form-item label="成品编码:">{{ form.materialCode }}</el-form-item>
<el-form-item label="计划开始时间:">{{ parseTime(form.planBeginTime) }}</el-form-item>
<el-form-item label="计划开始时间:">{{ form.planBeginTime }}</el-form-item>
<el-form-item label="计划数量/已派工数量/完成数量:" label-width="220px">
{{
form.planAmount
@ -20,7 +20,7 @@
<el-col :span="12">
<el-form-item label="工艺路线:">{{ form.dispatchName }}</el-form-item>
<el-form-item label="成品名称:">{{ form.materialName }}</el-form-item>
<el-form-item label="计划结束时间:">{{ parseTime(form.planEndTime) }}</el-form-item>
<el-form-item label="计划结束时间:">{{ form.planEndTime }}</el-form-item>
<el-form-item label="任务状态:">
<template slot-scope="scope">
<dict-tag :options="dict.type.plan_status" :value="form.orderStatus"/>
@ -149,7 +149,7 @@
|| scope.row.planStatus=== PLAN_STATUS.FINISHED || form.orderStatus===ORDER_STATUS.FINISHED || form.orderStatus===ORDER_STATUS.RECALLED || form.orderStatus===ORDER_STATUS.DELETED"
clearable
placeholder="请选择计划开始时间"
type="datetime" value-format="yyyy-MM-dd"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
/>
</template>
</el-table-column>
@ -160,7 +160,7 @@
|| scope.row.planStatus=== PLAN_STATUS.FINISHED || form.orderStatus===ORDER_STATUS.FINISHED || form.orderStatus===ORDER_STATUS.RECALLED || form.orderStatus===ORDER_STATUS.DELETED"
clearable
placeholder="请选择计划完成时间"
type="datetime" value-format="yyyy-MM-dd"/>
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"/>
</template>
</el-table-column>
@ -289,8 +289,8 @@
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="isShowTip">
请上传
<template v-if="fileSize"> <b style="color: #f67c7c">{{ fileSize }}MB</b></template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
<template v-if="drawingFileSize"> <b style="color: #f67c7c">{{ drawingFileSize }}MB</b></template>
<template v-if="drawingFileType"> <b style="color: #f56c6c">{{ drawingFileType.join("/") }}</b></template>
的文件
</div>
<el-button type="primary" @click="drawingFileUploadSubmit"> </el-button>
@ -351,8 +351,8 @@
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="isShowTip">
请上传
<template v-if="fileSize"> <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
<template v-if="sopFileSize"> <b style="color: #f56c6c">{{ sopFileSize }}MB</b></template>
<template v-if="sopFileType"> <b style="color: #f56c6c">{{ sopFileType.join("/") }}</b></template>
的文件
</div>
<el-button type="primary" @click="sopFileUploadSubmit"> </el-button>
@ -393,6 +393,7 @@ import {
getProcessUsers,
uploadFile
} from "@//api/mes/productplan";
import {getConfigKey} from "@//api/system/config"
import {deepClone} from "@//utils/index";
import {getToken} from "@//utils/auth";
import applyRawOutstock from '@//views/wms/common/applyRawOutstock.vue';
@ -429,25 +430,17 @@ export default {
// sop
sopLimit: {
type: Number,
default: 10,
default: 20,
},
//
drawingLimit: {
type: Number,
default: 10,
default: 20,
},
// (K)
fileSize: {
type: Number,
default: 500,
},
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
isShowTip: {
type: Boolean,
@ -533,6 +526,17 @@ export default {
previewSopFlag: {},//SOP
previewDrawingFlag: {},//
// SOP(MB)
sopFileSize: 50,
// SOP,
sopFileType: ["png", "jpg", "jpeg"],
// (MB)
drawingFileSize: 50,
// , ['png', 'jpg', 'jpeg']
drawingFileType: ["dxf", "dwg"],
//-
addProductPlanObject: {},
headers: {
@ -583,9 +587,37 @@ export default {
});
}
this.getConfigValues();
},
methods: {
getConfigValues(){
//
getConfigKey("mes.drawing.allowedExtension").then(res => {
if(res.msg){
this.drawingFileType = res.msg.split(",");
}
});
getConfigKey("mes.drawing.maxSize").then(res => {
if(res.msg){
this.drawingFileSize = res.msg;
}
});
getConfigKey("mes.sop.allowedExtension").then(res => {
if(res.msg){
this.sopFileType = res.msg.split(",");
}
});
getConfigKey("mes.sop.maxSize").then(res => {
if(res.msg){
this.sopFileSize = res.msg;
}
});
},
getProcessUsers(productOrderId) {
getProcessUsers(this.form.dispatchId).then(res => {
res.data.forEach(processUser => {
@ -800,6 +832,17 @@ export default {
if (processUser.userId && processUser.userId !== '') {
toUpdatedProductPlan.userId = processUser.userId;
if (processUser.planBeginTime && processUser.planBeginTime !== '' &&
(processUser.planBeginTime < this.form.planBeginTime || processUser.planBeginTime > this.form.planEndTime)){
this.$modal.msgError("序号" + (parseInt(e.index) + 1) + ":计划开始时间不在生产工单时间范围内");
return;
}
if (processUser.planEndTime && processUser.planEndTime !== '' &&
(processUser.planEndTime < this.form.planBeginTime || processUser.planEndTime > this.form.planEndTime)) {
this.$modal.msgError("序号" + (parseInt(e.index) + 1) + ":计划结束时间不在生产工单时间范围内");
return;
}
if (processUser.planBeginTime && processUser.planBeginTime !== '' &&
processUser.planEndTime && processUser.planEndTime !== '' &&
processUser.planBeginTime >= processUser.planEndTime) {
@ -1154,6 +1197,7 @@ export default {
let groupAttachFileList = this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupAttachFileList ? this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.groupAttachFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupAttachFile);
this.$modal.closeLoading();
}, (err) => {
this.$refs.drawingUpload.clearFiles(); //
this.$modal.closeLoading();
@ -1275,6 +1319,7 @@ export default {
let groupSopFileList = this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] = groupSopFileList ? this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId] : [];
this.groupSopFileList[this.addProductPlanObject.dispatchCode + "-" + this.addProductPlanObject.processId].push(groupSopFile);
this.$modal.closeLoading();
}, (err) => {
this.$refs.drawingUpload.clearFiles(); //
this.$modal.closeLoading();
@ -1303,34 +1348,43 @@ export default {
// loading
handleBeforeUpload(file) {
// let isImg = false;
// if (this.fileType.length) {
// let fileExtension = "";
// if (file.name.lastIndexOf(".") > -1) {
// fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
// }
// isImg = this.fileType.some(type => {
// if (file.type.indexOf(type) > -1) return true;
// if (fileExtension && fileExtension.indexOf(type) > -1) return true;
// return false;
// });
// } else {
// isImg = file.type.indexOf("image") > -1;
// }
//
// if (!isImg) {
// this.$modal.msgError(`, ${this.fileType.join("/")}!`);
// return false;
// }
// if (this.fileSize) {
// const isLt = file.size / 1024 / 1024 < this.fileSize;
// if (!isLt) {
// this.$modal.msgError(` ${this.fileSize} MB!`);
// return false;
// }
// }
// this.$modal.loading("...");
// this.number++;
let fileType,fileSize;
if(this.sopViewModel){
fileType = this.sopFileType;
fileSize = this.sopFileSize;
}else if(this.blueprintModel){
fileType = this.drawingFileType;
fileSize = this.drawingFileSize;
}
let isImg = false;
if (fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = fileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${fileType.join("/")}格式文件!`);
return false;
}
if (fileSize) {
const isLt = file.size / 1024 / 1024 < fileSize;
if (!isLt) {
this.$modal.msgError(`上传文件大小不能超过 ${fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传文件,请稍候...");
this.number++;
},
//
handleExceed() {

@ -76,7 +76,7 @@
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['mes:productplan:edit']"-->
<!-- v-hasPermi="['mes:productplan:add']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
@ -170,7 +170,7 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:productplan:edit']"
v-hasPermi="['mes:productplan:add']"
>修改</el-button>
<el-button
size="mini"

@ -98,34 +98,45 @@
<dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.alwaysFlag"/>
</template>
</el-table-column>
<el-table-column label="订单数量" align="center" prop="orderAmount"/>
<el-table-column label="完成数量" align="center" prop="completeAmount"/>
<el-table-column label="订单状态" align="center" prop="orderStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_purchase_order_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column label="订单数量" align="center" prop="orderAmount"/>
<el-table-column label="完成数量" align="center" prop="completeAmount"/>
<el-table-column label="审核日期" align="center" prop="approveDate">
<el-table-column label="开始日期" align="center" prop="beginDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span>{{ parseTime(scope.row.beginDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate">
<el-table-column label="结束日期" align="center" prop="endDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.erpModifyDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planDeliveryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="完成日期" align="center" prop="completeDate">
<el-table-column label="审核日期" align="center" prop="approveDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.completeDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span>{{ parseTime(scope.row.erpModifyDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button

@ -36,6 +36,18 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单状态" prop="isRelease">
<el-select v-model="queryParams.isRelease" placeholder="请选择订单状态" clearable>
<el-option
v-for="dict in dict.type.mes_sale_order_is_release"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="完成日期" prop="completeDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.completeDate"-->
@ -115,48 +127,45 @@
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="物料组" align="center" prop="matkl" v-if="columns[11].visible"/>
<el-table-column label="订单数量" align="center" prop="orderAmount" v-if="columns[12].visible"/>
<el-table-column label="完成数量" align="center" prop="completeAmount"/>
<el-table-column label="已发布数量" align="center" prop="releaseQty"/>
<el-table-column label="是否已下达计划" align="center" prop="isRelease" v-if="columns[15].visible" >
<el-table-column label="完成数量" align="center" prop="completeAmount"/>
<el-table-column label="订单状态" align="center" prop="isRelease">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_release" :value="scope.row.isRelease"/>
<dict-tag :options="dict.type.mes_sale_order_is_release" :value="scope.row.isRelease"/>
</template>
</el-table-column>
<el-table-column label="审核日期" align="center" prop="approveDate" width="180" v-if="columns[16].visible">
<el-table-column label="开始日期" align="center" prop="beginDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span>{{ parseTime(scope.row.beginDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate" width="180" v-if="columns[17].visible">
<el-table-column label="结束日期" align="center" prop="endDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.erpModifyDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate" width="180" v-if="columns[18].visible">
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate" v-if="columns[18].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planDeliveryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划开始日期" align="center" prop="beginDate" width="180" v-if="columns[19].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.beginDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划结束日期" align="center" prop="endDate" width="180" v-if="columns[20].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="完成日期" align="center" prop="completeDate" width="180" v-if="columns[21].visible">
<el-table-column label="审核日期" align="center" prop="approveDate" v-if="columns[16].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.completeDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="是否标识1-是0-否" align="center" prop="isFlag" v-if="columns[22].visible" >
<el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate" v-if="columns[17].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.isFlag"/>
<span>{{ parseTime(scope.row.erpModifyDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[23].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -322,7 +331,7 @@ import { listSaleOrder, getSaleOrder, delSaleOrder, addSaleOrder, updateSaleOrde
export default {
name: "SaleOrder",
dicts: ['document_status', 'is_release'],
dicts: ['document_status', 'is_release','mes_sale_order_is_release'],
data() {
return {
//

Loading…
Cancel
Save