MES:
-生产任务和生产派工修复bug
车间MES:
一楼工序和4楼装配工序开始和完成完善
一楼成品入库完善
master
xs 3 months ago
parent c1104a21ff
commit 26788889e5

@ -29,6 +29,8 @@ public class MesConfig
*/ */
private int socketServerReadTimeOut; private int socketServerReadTimeOut;
private Long laserProcessId;
public String getSocketServerHost() { public String getSocketServerHost() {
return socketServerHost; return socketServerHost;
} }
@ -52,4 +54,12 @@ public class MesConfig
public void setSocketServerReadTimeOut(int socketServerReadTimeOut) { public void setSocketServerReadTimeOut(int socketServerReadTimeOut) {
this.socketServerReadTimeOut = socketServerReadTimeOut; this.socketServerReadTimeOut = socketServerReadTimeOut;
} }
public Long getLaserProcessId() {
return laserProcessId;
}
public void setLaserProcessId(Long laserProcessId) {
this.laserProcessId = laserProcessId;
}
} }

@ -41,12 +41,12 @@ public class MesProductPlanDetail extends BaseEntity
private String userName; private String userName;
/** 开始时间 */ /** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realBeginTime; private Date realBeginTime;
/** 完成时间 */ /** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date realEndTime; private Date realEndTime;

@ -336,10 +336,9 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
} }
/** /**
* *
*
* @param mesProductOrder * @param mesProductOrder
*/ */
@Override @Override
@ -358,7 +357,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService {
//工单状态0-待发布1-已发布2-已完成3-已开始4-暂停8-已撤回9-已删除 //工单状态0-待发布1-已发布2-已完成3-已开始4-暂停8-已撤回9-已删除
//找到派工数量大于0并且状态是已发布或者已开始的或者暂停的 //找到派工数量大于0并且状态是已发布或者已开始的或者暂停的
List<MesProductOrder> filterProductOrders = mesProductOrders.stream().filter(p -> List<MesProductOrder> filterProductOrders = mesProductOrders.stream().filter(p ->
(p.getDispatchAmount().compareTo(BigDecimal.ONE) >= 0) && (p.getDispatchAmount() != null && p.getDispatchAmount().compareTo(BigDecimal.ONE) >= 0) &&
(p.getOrderStatus().equals(MesConstants.PUBLISHED) || p.getOrderStatus().equals(MesConstants.BEGIN) || p.getOrderStatus().equals(MesConstants.PAUSE)) (p.getOrderStatus().equals(MesConstants.PUBLISHED) || p.getOrderStatus().equals(MesConstants.BEGIN) || p.getOrderStatus().equals(MesConstants.PAUSE))
).collect(Collectors.toList()); ).collect(Collectors.toList());

@ -7,6 +7,7 @@ import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.uuid.Seq; import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*; import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesProductPlanDetailVo; import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import com.hw.mes.mapper.*; import com.hw.mes.mapper.*;
@ -49,6 +50,9 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
@Autowired @Autowired
private MesProductOrderMapper mesProductOrderMapper; private MesProductOrderMapper mesProductOrderMapper;
@Autowired
private MesConfig mesConfig;
/** /**
* *
* *
@ -301,11 +305,18 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
Date currentDate = new Date(); Date currentDate = new Date();
String userName = SecurityUtils.getUsername(); String userName = SecurityUtils.getUsername();
BigDecimal planAmount = null; BigDecimal planAmount = null;
// BigDecimal dispatchAmount = null;
//获取计划数量 //获取计划数量
//如果是按图纸生产(激光切割工序),则判断完成数量不能大于图纸的数量,
//如果不是按图纸生产,则判断完成数量不能大于计划的数量
String attachId = dbProductPlan.getAttachId(); String attachId = dbProductPlan.getAttachId();
if (dbProductPlan.getProcessId().equals(mesConfig.getLaserProcessId())) {
if (StringUtils.isNotEmpty(attachId)) {//如果是按图纸生产的 if (StringUtils.isNotEmpty(attachId)) {//如果是按图纸生产的
String[] attachIdArr = attachId.split(","); String[] attachIdArr = attachId.split(",");
planAmount = new BigDecimal(attachIdArr.length); planAmount = new BigDecimal(attachIdArr.length);
} else {
planAmount = BigDecimal.ONE;
}
} else { } else {
planAmount = dbProductPlan.getPlanAmount(); planAmount = dbProductPlan.getPlanAmount();
} }

@ -382,6 +382,7 @@ export default {
}, },
BARCODE_TYPE_PARAM: { BARCODE_TYPE_PARAM: {
PRODUCT:'3',//
PRODUCT_BARCODE: '4',// PRODUCT_BARCODE: '4',//
SPLIT_BIND_BARCODE: '5', // SPLIT_BIND_BARCODE: '5', //
}, },
@ -474,7 +475,12 @@ export default {
} else { } else {
this.addInternalBtnVisible = false; this.addInternalBtnVisible = false;
this.addProductBarcodeBtnVisible = false; this.addProductBarcodeBtnVisible = false;
if(this.barcodeTypeParam === this.BARCODE_TYPE_PARAM.PRODUCT){
this.addBindBarcodeBtnVisible = false;
}else{
this.addBindBarcodeBtnVisible = true; this.addBindBarcodeBtnVisible = true;
}
if (this.total === 1 && this.barcodeTypeParam === this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE) { if (this.total === 1 && this.barcodeTypeParam === this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE) {
this.handleAddBindBarcode(this.form.bindBarcode); this.handleAddBindBarcode(this.form.bindBarcode);
} }

@ -3,7 +3,7 @@
<div class="headTitle">京源环保生产管理系统</div> <div class="headTitle">京源环保生产管理系统</div>
<div class="chartBox chartBox1"> <div class="chartBox chartBox1">
<div class="title">派工信息</div> <div class="title">生产派工</div>
<div class="chart"> <div class="chart">
<div class="whiteTable"> <div class="whiteTable">
<el-table <el-table
@ -14,6 +14,7 @@
style="width: 100%" style="width: 100%"
ref="planTable" ref="planTable"
highlight-current-row highlight-current-row
@current-change="getDetail"
> >
<el-table-column <el-table-column
label="序号" label="序号"
@ -21,6 +22,11 @@
width="50" width="50"
> >
</el-table-column> </el-table-column>
<el-table-column
label="任务编号"
prop="dispatchCode"
>
</el-table-column>
<el-table-column <el-table-column
label="派工单号" label="派工单号"
prop="planCode" prop="planCode"
@ -78,13 +84,13 @@
SOP预览 SOP预览
</el-button> </el-button>
<el-button <!--el-button
size="small" size="small"
type="text" type="text"
@click="getDetail(scope)" @click="getDetail(scope.row)"
> >
明细 明细
</el-button> </el-button-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -151,7 +157,6 @@
<div class="chart"> <div class="chart">
<div class="whiteTable"> <div class="whiteTable">
<el-table <el-table
highlight-current-row
@current-change="getMaterialInstall" @current-change="getMaterialInstall"
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="tableData1" :data="tableData1"
@ -159,7 +164,7 @@
:max-height="19.13 * vw" :max-height="19.13 * vw"
style="width: 100%" style="width: 100%"
ref="table" ref="table"
highlight-current-row
> >
<el-table-column <el-table-column
label="序号" label="序号"
@ -240,7 +245,8 @@
size="small" size="small"
type="text" type="text"
@click="print(scope.row)" @click="print(scope.row)"
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.FINISHED || scope.row.planDetailStatus === PLAN_DETAIL_STATUS.ABNORMAL_FINISHED" v-if="(scope.row.planDetailStatus === PLAN_DETAIL_STATUS.FINISHED || scope.row.planDetailStatus === PLAN_DETAIL_STATUS.ABNORMAL_FINISHED)
&& finalProcessFlag ==='1'"
> >
条码 条码
</el-button> </el-button>
@ -315,7 +321,8 @@
<!-- 申请领料信息对话框 --> <!-- 申请领料信息对话框 -->
<el-dialog title="申请领料" :visible.sync="dialogVisible" append-to-body> <el-dialog title="申请领料" :visible.sync="dialogVisible" append-to-body>
<apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData" v-if="dialogVisible"></apply-raw-outstock> <apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData"
v-if="dialogVisible"></apply-raw-outstock>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="printModel" class="dialog" title="条码打印" width="80%"> <el-dialog :visible.sync="printModel" class="dialog" title="条码打印" width="80%">
@ -382,7 +389,8 @@
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input> <el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item--> </el-form-item-->
<el-form-item label="物料条码"> <el-form-item label="物料条码">
<el-input placeholder="请扫描或输入物料条码" v-model="returnModelForm.materialBarcode" suffix-icon="el-icon-full-screen"> <el-input placeholder="请扫描或输入物料条码" v-model="returnModelForm.materialBarcode"
suffix-icon="el-icon-full-screen">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="仓库"> <el-form-item label="仓库">
@ -392,7 +400,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="planAmount"> <el-form-item label="数量" prop="planAmount">
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1" style="width: 260px"></el-input-number> <el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1"
style="width: 260px"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="退库类型" prop="taskType"> <el-form-item label="退库类型" prop="taskType">
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型" style="width: 260px"> <el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型" style="width: 260px">
@ -476,7 +485,7 @@
<script> <script>
import Chart from '@/components/board/Chart' import Chart from '@/components/board/Chart'
import PrintPage from '@/views/mes/barcode/endProductIndex' import PrintPage from '@/views/board/barcode/workshopBarcode'
import {monitorSerialData} from "@/utils/serial" import {monitorSerialData} from "@/utils/serial"
import WorkshopNotice from "@/components/workshopNotice/index.vue"; import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice" import {noticeData} from "@/utils/notice"
@ -495,6 +504,7 @@ import {
} from '@/api/board' } from '@/api/board'
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue"; import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import {getNowDateTime} from "@/utils/ruoyi";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default { export default {
@ -530,6 +540,7 @@ export default {
materialBomId: null, materialBomId: null,
planId: null, planId: null,
nowMaterial: null, nowMaterial: null,
finalProcessFlag:null,
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100, vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
searchMaterialValue: '', searchMaterialValue: '',
warehouseList: [], warehouseList: [],
@ -585,7 +596,9 @@ export default {
ABNORMAL_FINISHED: '9' ABNORMAL_FINISHED: '9'
}, },
productPlanData:{} productPlanData: {},
reloadFlag: "0",
} }
}, },
mounted() { mounted() {
@ -598,18 +611,23 @@ export default {
// duration: 0 // duration: 0
// }); // });
// }, 60 * 1000) // }, 60 * 1000)
getProductPlans({pageNum: 1, pageSize: 5}).then(e => { getProductPlans({pageNum: 1, pageSize: 5}).then(async e => {
this.tableData = e.rows this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)
this.nowMaterial = e.rows?.[0]?.materialName
this.materialBomId = e.rows?.[0]?.materialBomId
this.saleOrderId = e.rows?.[0]?.saleOrderId
this.$refs.planTable.setCurrentRow(e.rows?.[0]); this.$refs.planTable.setCurrentRow(e.rows?.[0]);
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.rows?.[0]?.planId}).then(res => {
this.tableData1 = res.rows let queryRow = {
this.totalNum3 = Math.ceil(res.total / 5) pageNum: 1,
this.$refs.table.setCurrentRow(res.rows[0]); pageSize: 5,
}) planId: e.rows?.[0]?.planId,
materialName: e.rows?.[0]?.materialName,
materialBomId: e.rows?.[0]?.materialBomId,
saleOrderId: e.rows?.[0]?.saleOrderId,
saleType: e.rows?.[0]?.saleType
}
await this.getDetail(queryRow);
}) })
}, },
methods: { methods: {
@ -715,12 +733,10 @@ export default {
startProductPlanDetail({ startProductPlanDetail({
planDetailId: e.planDetailId planDetailId: e.planDetailId
}) })
.finally(() => { .then(() => {
this.getDetail({row: {planId: e.planId}}) this.$modal.msgSuccess("开始成功");
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { e.realBeginTime = getNowDateTime();
this.tableData = e.rows e.planDetailStatus = this.PLAN_DETAIL_STATUS.STARTED;
this.totalNum1 = Math.ceil(e.total / 5)
})
}) })
}) })
.catch(() => { .catch(() => {
@ -731,7 +747,7 @@ export default {
}) })
} }
if (e.planDetailStatus === '2') { if (e.planDetailStatus === '2') {
this.$confirm('是否完成计划', '确认', { this.$confirm('是否完成生产明细', '确认', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'success' type: 'success'
@ -739,12 +755,12 @@ export default {
completeProductPlanDetail({ completeProductPlanDetail({
planDetailId: e.planDetailId planDetailId: e.planDetailId
}) })
.finally(() => { .then(() => {
this.getDetail({row: {planId: e.planId}}) this.$modal.msgSuccess("完成成功");
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { e.realEndTime = getNowDateTime();
this.tableData = e.rows e.planDetailStatus = this.PLAN_DETAIL_STATUS.FINISHED;
this.totalNum1 = Math.ceil(e.total / 5) let currentProductPlan = this.tableData.filter(item => item.planId === e.planId)
}) currentProductPlan[0].completeAmount += 1;
}) })
}) })
.catch(() => { .catch(() => {
@ -756,39 +772,30 @@ export default {
} }
}, },
// / // /
async getDetail(e) { async getDetail(row) {
this.planId = e.row.planId if (this.reloadFlag !== "1" && this.planId === row.planId) {
this.materialBomId = e.row.materialBomId return;
this.nowMaterial = e.row.materialName }
this.saleOrderId = e.row.saleOrderId this.reloadFlag = "0";
this.nowNum3 = 1 this.planId = row.planId
await getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.row.planId}).then(res => { this.materialBomId = row.materialBomId
this.nowMaterial = row.materialName
this.saleOrderId = row.saleOrderId
this.saleType = row.saleType
this.finalProcessFlag = row.finalProcessFlag
await getProductPlanDetails({pageNum: 1, pageSize: 5, planId: row.planId}).then(res => {
if (res.rows.length === 0) { if (res.rows.length === 0) {
this.$confirm('是否生成计划明细', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
insertProductPlanDetails({ insertProductPlanDetails({
"planId": e.row.planId, "planId": row.planId,
}).then(val => { }).then(val => {
getProductPlanDetails({pageNum: this.nowNum3, pageSize: 5, planId: e.row.planId}).then(res => { getProductPlanDetails({pageNum: 1, pageSize: 5, planId: row.planId}).then(res => {
this.tableData1 = res.rows this.tableData1 = res.rows
this.totalNum3 = Math.ceil(res.total / 5) this.totalNum3 = Math.ceil(res.total / 5)
this.$refs.table.setCurrentRow(res.rows[0]); this.$refs.table.setCurrentRow(res.rows[0]);
}) })
this.$message({
type: 'info',
message: `生成完成`
});
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
}) })
} else { } else {
this.tableData1 = res.rows this.tableData1 = res.rows
this.$refs.table.setCurrentRow(res.rows[0]); this.$refs.table.setCurrentRow(res.rows[0]);
@ -797,6 +804,8 @@ export default {
}) })
}, },
async getMaterialInstall(e) { async getMaterialInstall(e) {
this.info = e this.info = e
this.nowNum2 = 1 this.nowNum2 = 1
@ -842,6 +851,7 @@ export default {
print(val) { print(val) {
this.PrintData = val this.PrintData = val
this.PrintData.barcodeType = '3';//
this.printModel = true this.printModel = true
}, },
@ -1072,7 +1082,6 @@ export default {
}, },
firstConnectSerial() { firstConnectSerial() {
if (!this.checkSerialConnected()) { if (!this.checkSerialConnected()) {
this.$confirm('请连接条码枪', '提示', { this.$confirm('请连接条码枪', '提示', {
@ -1142,6 +1151,7 @@ export default {
/deep/ .el-table .cell { /deep/ .el-table .cell {
color: #fff color: #fff
} }
/deep/ .current-row .cell { /deep/ .current-row .cell {
color: #000 color: #000
} }

@ -12,6 +12,9 @@
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw" :max-height="19.13 * vw"
style="width: 100%" style="width: 100%"
ref="planTable"
highlight-current-row
@current-change="getDetail"
> >
<el-table-column <el-table-column
label="序号" label="序号"
@ -62,18 +65,18 @@
width="120" width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!--el-button
size="small" size="small"
type="text" type="text"
@click="getDetail(scope)" @click="getDetail(scope.row)"
> >
明细 明细
</el-button> </el-button-->
<el-button <el-button
size="small" size="small"
type="text" type="text"
@click="getDetail(scope)" @click="getDetail(scope.row)"
> >
SOP预览 SOP预览
</el-button> </el-button>
@ -104,12 +107,13 @@
<div class="chart"> <div class="chart">
<div class="whiteTable"> <div class="whiteTable">
<el-table <el-table
ref="table"
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="tableData1" :data="tableData1"
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw" :max-height="19.13 * vw"
style="width: 100%" style="width: 100%"
highlight-current-row
> >
<el-table-column <el-table-column
label="序号" label="序号"
@ -229,7 +233,8 @@
<!-- 申请领料信息对话框 --> <!-- 申请领料信息对话框 -->
<el-dialog title="申请领料" :visible.sync="dialogVisible" append-to-body> <el-dialog title="申请领料" :visible.sync="dialogVisible" append-to-body>
<apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData" v-if="dialogVisible"></apply-raw-outstock> <apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData"
v-if="dialogVisible"></apply-raw-outstock>
</el-dialog> </el-dialog>
@ -344,6 +349,7 @@ import {
} from "@/api/board"; } from "@/api/board";
import {monitorSerialData} from "@/utils/serial"; import {monitorSerialData} from "@/utils/serial";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue'; import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
import {getNowDateTime} from "@/utils/ruoyi";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default { export default {
@ -375,6 +381,7 @@ export default {
totalNum2: 0, totalNum2: 0,
planId: null, planId: null,
materialBomId: null, materialBomId: null,
finalProcessFlag: null,
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100, vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
searchMaterialValue: '', searchMaterialValue: '',
warehouseList: [], warehouseList: [],
@ -439,12 +446,12 @@ export default {
SINGLE_FLAG: { SINGLE_FLAG: {
NOT_SINGLE: "0",// NOT_SINGLE: "0",//
INTERNAL: '2'// INTERNAL: '2'//
} },
reloadFlag: "0",
} }
}, },
created() { created() {
}, },
mounted() { mounted() {
@ -457,16 +464,25 @@ export default {
// duration: 0 // duration: 0
// }); // });
// }, 60 * 1000) // }, 60 * 1000)
getProductPlans({pageNum: 1, pageSize: 5}).then(e => { getProductPlans({pageNum: 1, pageSize: 5}).then(async e => {
this.tableData = e.rows this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)
this.materialBomId = e.rows?.[0]?.materialBomId this.$refs.planTable.setCurrentRow(e.rows?.[0]);
this.saleOrderId = e.rows?.[0]?.saleOrderId
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.rows?.[0]?.planId}).then(res => { let queryRow = {
this.tableData1 = res.rows pageNum: 1,
this.totalNum2 = Math.ceil(res.total / 5) pageSize: 5,
}) planId: e.rows?.[0]?.planId,
materialName: e.rows?.[0]?.materialName,
materialBomId: e.rows?.[0]?.materialBomId,
saleOrderId: e.rows?.[0]?.saleOrderId,
saleType: e.rows?.[0]?.saleType
}
await this.getDetail(queryRow);
}) })
this.$refs.chart2.setData({ this.$refs.chart2.setData({
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -745,7 +761,7 @@ export default {
// / // /
planExecute(e) { planExecute(e) {
if (e.planDetailStatus === '1') { if (e.planDetailStatus === '1') {
this.$confirm('是否开始计划', '确认', { this.$confirm('是否开始生产明细', '确认', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'success' type: 'success'
@ -753,12 +769,18 @@ export default {
startProductPlanDetail({ startProductPlanDetail({
planDetailId: e.planDetailId planDetailId: e.planDetailId
}) })
.finally(() => { .then(() => {
this.getDetail({row: {planId: e.planId}}) this.$modal.msgSuccess("开始成功");
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { e.realBeginTime = getNowDateTime();
this.tableData = e.rows e.planDetailStatus = this.PLAN_DETAIL_STATUS.STARTED;
this.totalNum1 = Math.ceil(e.total / 5)
}) // this.getDetail(queryRow);
// getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
// this.tableData = e.rows
// this.totalNum1 = Math.ceil(e.total / 5)
// let currentRow = e.rows.filter(item => item.planId == e.planId)
// this.$refs.planTable.setCurrentRow(currentRow);
// })
}) })
}) })
.catch(() => { .catch(() => {
@ -769,7 +791,7 @@ export default {
}) })
} }
if (e.planDetailStatus === '2') { if (e.planDetailStatus === '2') {
this.$confirm('是否完成计划', '确认', { this.$confirm('是否完成生产明细', '确认', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'success' type: 'success'
@ -777,12 +799,12 @@ export default {
completeProductPlanDetail({ completeProductPlanDetail({
planDetailId: e.planDetailId planDetailId: e.planDetailId
}) })
.finally(() => { .then(() => {
this.getDetail({row: {planId: e.planId}}) this.$modal.msgSuccess("完成成功");
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { e.realEndTime = getNowDateTime();
this.tableData = e.rows e.planDetailStatus = this.PLAN_DETAIL_STATUS.FINISHED;
this.totalNum1 = Math.ceil(e.total / 5) let currentProductPlan = this.tableData.filter(item => item.planId === e.planId)
}) currentProductPlan[0].completeAmount += 1;
}) })
}) })
.catch(() => { .catch(() => {
@ -793,46 +815,39 @@ export default {
}) })
} }
}, },
// / // /
getDetail(e) { async getDetail(row) {
this.planId = e.row.planId if (this.reloadFlag !== "1" && this.planId === row.planId) {
this.materialBomId = e.row.materialBomId return;
this.saleOrderId = e.row.saleOrderId }
this.saleType = e.row.saleType this.reloadFlag = "0";
this.nowNum2 = 1 this.planId = row.planId
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.row.planId}).then(res => { this.materialBomId = row.materialBomId
this.nowMaterial = row.materialName
this.saleOrderId = row.saleOrderId
this.saleType = row.saleType
this.finalProcessFlag = row.finalProcessFlag
await getProductPlanDetails({pageNum: 1, pageSize: 5, planId: row.planId}).then(res => {
if (res.rows.length === 0) { if (res.rows.length === 0) {
this.$confirm('是否生成计划明细', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
insertProductPlanDetails({ insertProductPlanDetails({
"planId": e.row.planId, "planId": row.planId,
}).then(val => { }).then(val => {
getProductPlanDetails({pageNum: this.nowNum2, pageSize: 5, planId: e.row.planId}).then(res => { getProductPlanDetails({pageNum: 1, pageSize: 5, planId: row.planId}).then(res => {
this.tableData1 = res.rows this.tableData1 = res.rows
this.totalNum2 = Math.ceil(res.total / 5) this.totalNum3 = Math.ceil(res.total / 5)
this.$refs.table.setCurrentRow(res.rows[0]);
}) })
this.$message({
type: 'info',
message: `生成完成`
});
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
}) })
} else { } else {
this.tableData1 = res.rows this.tableData1 = res.rows
this.totalNum2 = Math.ceil(res.total / 5) this.$refs.table.setCurrentRow(res.rows[0]);
this.totalNum3 = Math.ceil(res.total / 5)
} }
}) })
}, },
// //
getMaterials(val) { getMaterials(val) {
@ -1130,6 +1145,10 @@ export default {
color: #fff color: #fff
} }
/deep/ .current-row .cell {
color: #000
}
/deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell { /deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #fff0; background-color: #fff0;
} }

@ -95,7 +95,7 @@
confirm-button-text='是' confirm-button-text='是'
icon="el-icon-info" icon="el-icon-info"
icon-color="red" icon-color="red"
title="确定开始计划吗?" title="确定开始吗?"
@confirm="startNextProduction(props.row,i)" @confirm="startNextProduction(props.row,i)"
> >
@ -926,7 +926,7 @@ export default {
}, },
// //
accomplishPlan() { accomplishPlan() {
this.$confirm('是否完成计划', '确认', { this.$confirm('确定完成么', '确认', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'success' type: 'success'
@ -939,6 +939,7 @@ export default {
type: 'success', type: 'success',
message: '已完成' message: '已完成'
}); });
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)

@ -125,7 +125,7 @@
icon="el-icon-info" icon="el-icon-info"
icon-color="red" icon-color="red"
style="margin-left: 8px" style="margin-left: 8px"
title="确定开始计划吗?" title="确定开始吗?"
@confirm="startPlan(scope.row)" @confirm="startPlan(scope.row)"
> >
<el-button <el-button
@ -490,7 +490,7 @@ export default {
this.form.materialId = val.materialId this.form.materialId = val.materialId
this.form.materialCode = val.materialCode this.form.materialCode = val.materialCode
this.form.materialName = val.materialName this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.planDetailStatus) this.form.planDetailStatus = setState(data?.planDetailStatus)
this.getInfo(val) this.getInfo(val)
}, },
getInfo(e) { getInfo(e) {

@ -208,6 +208,7 @@
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-timer"
@click="handleProductionScheduling(scope.row)" @click="handleProductionScheduling(scope.row)"
v-hasPermi="['mes:productOrder:edit']" v-hasPermi="['mes:productOrder:edit']"
>排产 >排产
@ -258,14 +259,15 @@
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-right" icon="el-icon-user-solid"
@click="handleDispatch(scope.row)" @click="handleDispatch(scope.row)"
v-if="scope.row.orderStatus !== MES_ORDER_STATUS.UNPUBLISH"
>生产派工 >生产派工
</el-button> </el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-right" icon="el-icon-box"
@click="handleMaterialUsage(scope.row)" @click="handleMaterialUsage(scope.row)"
>库存使用 >库存使用
</el-button> </el-button>

@ -763,9 +763,25 @@ export default {
let toUpdatedProductPlans = []; let toUpdatedProductPlans = [];
let undispathDesc; let undispathDesc;
let currentDispatchAmount = 0; let currentDispatchAmount = 0;
let planDispatchAmount = 0;
for (let i = 0; i < dataList.length; i++) { for (let i = 0; i < dataList.length; i++) {
let e = dataList[i]; let e = dataList[i];
if (e.firstFlag && e.firstFlag === "1") {//
let dispatchAmount = e.dispatchAmount;
const numericAmount = parseInt(dispatchAmount, 10);
if (!this.isPositiveInteger(numericAmount) || numericAmount <= 0) {
this.$modal.msgError("派工数量须为大于等于0的正整数");
return;
}
planDispatchAmount = numericAmount;
if (e.newFlag && e.newFlag === "1") {
currentDispatchAmount += numericAmount;
}
}
let dispatchFlag = false; let dispatchFlag = false;
undispathDesc = "派工单号为[" + e.dispatchCode + "],工序为[" + e.processName + "],请选择用户派工"; undispathDesc = "派工单号为[" + e.dispatchCode + "],工序为[" + e.processName + "],请选择用户派工";
if (e.processType !== this.PROCESS_TYPE.AUTO) { if (e.processType !== this.PROCESS_TYPE.AUTO) {
@ -792,6 +808,8 @@ export default {
toUpdatedProductPlan.planStatus = processUser.planStatus; toUpdatedProductPlan.planStatus = processUser.planStatus;
toUpdatedProductPlan.attachId = e.attachId; toUpdatedProductPlan.attachId = e.attachId;
toUpdatedProductPlan.sopId = e.sopId; toUpdatedProductPlan.sopId = e.sopId;
toUpdatedProductPlan.planAmount = planDispatchAmount;
toUpdatedProductPlan.dispatchAmount = planDispatchAmount;
toUpdatedProductPlan.children = null; toUpdatedProductPlan.children = null;
let productionTimeHour = processUser.productionTime; let productionTimeHour = processUser.productionTime;
@ -814,18 +832,7 @@ export default {
return; return;
} }
if (e.firstFlag && e.firstFlag === "1") {//
let dispatchAmount = e.dispatchAmount;
const numericAmount = parseInt(dispatchAmount, 10);
if (!this.isPositiveInteger(numericAmount) || numericAmount <= 0) {
this.$modal.msgError("派工数量须为大于等于0的正整数");
return;
}
if (e.newFlag && e.newFlag === "1") {
currentDispatchAmount += numericAmount;
}
}
} }
// //

Loading…
Cancel
Save