修改生产界面

master
夜笙歌 7 months ago
parent 6e3be17158
commit fc971fd3a0

@ -65,15 +65,13 @@
<div class="chart">
<div class="whiteTable">
<el-table
ref="table1"
:cell-style="{textAlign:'center'}"
:data="tableData"
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
highlight-current-row
max-height="19.13vw"
style="width: 100%"
@current-change="getOrderInfo"
@current-change="tableClick"
>
<el-table-column
label="序号"
@ -93,33 +91,30 @@
>
</el-table-column>
<el-table-column
label="计划图纸"
label="计划"
prop="planAmount"
width="80"
width="100"
>
<template slot-scope="scope">
{{ (scope.row.attachId || '').split(',').length }}
</template>
</el-table-column>
<el-table-column
label="实际图纸"
label="实际"
prop="completeAmount"
width="80"
width="100"
>
</el-table-column>
<el-table-column
label="差异图纸"
label="差异"
prop="difference"
width="80"
width="100"
>
<template slot-scope="scope">
{{ (scope.row.attachId || '').split(',').length - scope.row.completeAmount }}
{{ scope.row.planAmount - scope.row.completeAmount }}
</template>
</el-table-column>
<el-table-column
label="交付时间"
prop="planDeliveryDate"
width="200"
width="150"
>
</el-table-column>
<el-table-column
@ -127,20 +122,32 @@
width="120"
>
<template slot-scope="scope">
<el-button
size="small"
style="margin-left: 4px"
type="text"
<!-- <el-button-->
<!-- size="small"-->
<!-- type="text"-->
<!-- >-->
<!-- SOP预览-->
<!-- </el-button>-->
<el-popconfirm
cancel-button-text='否'
confirm-button-text='是'
icon="el-icon-info"
icon-color="red"
title="确定开始计划吗?"
@confirm="startPlan(scope.row)"
>
条码打印
</el-button>
<el-button
slot="reference"
size="small"
type="text">开始
</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div>
<div class="roundBorder" style="top: 72%;left: 1.2%;">
<el-button :disabled="nowNum1 <= 1" circle icon="el-icon-back" size="mini" @click="pre1"></el-button>
@ -272,7 +279,6 @@ import {
getNewestProductPlanDetail,
getProductPlans,
startNextProductPlanDetail,
getPlanDrawings,
applyRawOutstock,
getStockTotal,
getWarehouses
@ -306,20 +312,14 @@ export default {
tableData: [],
warehouseList: [],
searchMaterialValue: '',
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
}
},
async mounted() {
const data = await getProductPlans({pageNum: 1, pageSize: 5}).then(e => {
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
this.$refs.table1.setCurrentRow(e.rows[0]);
this.getInfo(e.rows[0])
getNewestProductPlanDetail({planId: e.rows[0].planId}).then(val => {
this.form = val.data
this.form.materialId = e.rows[0].materialId
this.form.materialName = e.rows[0].materialName
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
this.tableClick(e.rows[0])
})
this.$refs.chart2.setData({
tooltip: {
@ -499,29 +499,28 @@ export default {
this.totalNum1 = Math.ceil(e.total / 5)
})
},
getOrderInfo(e) {
this.getInfo(e)
getNewestProductPlanDetail({planId: e.planId}).then(val => {
this.form = val.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
async startPlan(val) {
const data = await startNextProductPlanDetail({planId: val.planId})
if (data.code === 200) {
this.$message({
message: '已开始',
type: 'success'
});
}
this.form = data.data || {}
this.form.materialId = val.materialId
this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.data.planDetailStatus)
this.getInfo(val)
},
async expandChange(e, rows) {
this.drawingList = [e.planId]
const data = await getPlanDrawings({planId: e.planId, attachId: e.attachId})
this.$set(this.tableData, this.tableData.indexOf(e), {
...e, drawing: data?.data.map((v, i) => {
return {
...v,
planId: e.planId + '-' + i
}
}) || []
})
async tableClick(val) {
const {data} = await getNewestProductPlanDetail({planId: val.planId})
this.form = data || {}
this.form.materialId = val.materialId
this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.planDetailStatus)
this.getInfo(val)
},
//
getInfo(e) {
this.$refs.chart1_1.setData({
series: [
@ -703,7 +702,7 @@ export default {
center: ["50%", "50%"],
data: [
{
value: (e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount),
value: Math.abs((e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount)),
label: {
normal: {
rich: {
@ -840,30 +839,42 @@ export default {
],
})
},
//
async startNextProduction(val, e) {
const dataIndex = this.tableData.indexOf(val)
const lineIndex = this.tableData[dataIndex].drawing.indexOf(e)
this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag', false)
await startNextProductPlanDetail({planId: val.planId, attachId: e.attachId})
.catch(() => {
this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag', true)
async finish() {
this.$confirm('确认计划完成?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const data = await completeProductPlanDetail({
planDetailId: this.form.planDetailId
})
if (data.code === 200) {
this.$message({
message: '已完成',
type: 'success'
});
}
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
this.tableClick(e.rows.find(v => v.planCode === this.form.planCode))
})
getNewestProductPlanDetail({planId: val.planId}).then(val => {
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
getOrderInfo(e) {
this.getInfo(e)
getNewestProductPlanDetail({planId: e.planId}).then(val => {
this.form = val.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
const data = await getPlanDrawings({planId: val.planId, attachId: val.attachId})
this.$set(this.tableData, this.tableData.indexOf(val), {
...val, drawing: data?.data.map((v, i) => {
return {
...v,
planId: val.planId + '-' + i
}
}) || []
})
},
//
accomplishPlan() {

@ -217,20 +217,14 @@
title="领料"
width="40%">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="生产计划">
<el-input v-model="form.planCode"></el-input>
<el-form-item label="工单编号">
<el-input v-model="form.planCode" disabled></el-input>
</el-form-item>
<el-form-item v-show="false" label="成品">
<el-input v-model="form.productId"></el-input>
</el-form-item>
<el-form-item v-show="false" label="领料类型">
<el-select v-model="form.taskType" placeholder="请选择领料类型">
<el-option label="类型一" value="shanghai"></el-option>
<el-option label="类型二" value="beijing"></el-option>
</el-select>
<el-form-item label="明细编号">
<el-input v-model="form.planDetailCode" disabled></el-input>
</el-form-item>
<el-form-item label="领料仓库">
<el-select v-model="form.warehouseId" placeholder="请选择领料仓库" @change="form.wmsRawOutstockDetailList =[]">
<el-select v-model="form.warehouseId" placeholder="请选择领料仓库" @change="warehouseChange">
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
:value="item.warehouseId"></el-option>
</el-select>
@ -243,12 +237,12 @@
:cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
max-height="19.13vw"
style="width: 100%"
>
<el-table-column
label="物料编号"
prop="materialId"
prop="materialCode"
>
</el-table-column>
<el-table-column
@ -256,6 +250,16 @@
prop="materialName"
>
</el-table-column>
<el-table-column
label="可用库存数量"
prop="availableAmount"
>
</el-table-column>
<el-table-column
label="占用库存数量"
prop="unavailableAmount"
>
</el-table-column>
<el-table-column
label="领取数量"
prop="planAmount"
@ -263,7 +267,8 @@
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.quantityAcquired"
:min="0"
v-model="scope.row.planAmount"
controls-position="right"
style="width: 100%"
>
@ -281,14 +286,6 @@
size="mini"
@change="searchMaterial"/>
</template>
<template slot-scope="scope">
<el-button
size="small"
type="text"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 12px">
@ -641,7 +638,6 @@ export default {
//
getWarehouses({"warehouseFloor":1}).then(e => {
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
this.searchMaterial("");
})

Loading…
Cancel
Save