|
|
|
@ -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() {
|
|
|
|
|