|
|
@ -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-->
|
|
|
|
|
|
|
|
<!-- 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"
|
|
|
|
size="small"
|
|
|
|
style="margin-left: 4px"
|
|
|
|
type="text">开始
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
条码打印
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</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)
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}) || []
|
|
|
|
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 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) {
|
|
|
|
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
|
|
|
|
})
|
|
|
|
})
|
|
|
|
getNewestProductPlanDetail({planId: val.planId}).then(val => {
|
|
|
|
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))
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}).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() {
|
|
|
|