修改生产界面

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

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

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

Loading…
Cancel
Save