|
|
|
@ -8,7 +8,7 @@
|
|
|
|
|
<div class="form">
|
|
|
|
|
<el-form :model="form" label-position="right" label-width="80px" size="mini">
|
|
|
|
|
<el-form-item label="明细编号">
|
|
|
|
|
<el-input v-model="form.planDetailCode" ></el-input>
|
|
|
|
|
<el-input v-model="form.planDetailCode"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="工单编号">
|
|
|
|
|
<el-input v-model="form.planCode"></el-input>
|
|
|
|
@ -19,6 +19,9 @@
|
|
|
|
|
<el-form-item label="物料名称">
|
|
|
|
|
<el-input v-model="form.materialName"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="图纸名称">
|
|
|
|
|
<el-input v-model="form.attachName"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="状态">
|
|
|
|
|
<el-input v-model="form.planDetailStatus"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -30,7 +33,7 @@
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
</el-form>
|
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
<el-button type="success">图纸下发</el-button>
|
|
|
|
|
<el-button type="primary" @click="getMaterials">领料</el-button>
|
|
|
|
|
<el-button type="primary" @click="accomplishPlan">完成</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -90,24 +93,27 @@
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="计划"
|
|
|
|
|
label="计划图纸"
|
|
|
|
|
prop="planAmount"
|
|
|
|
|
width="80"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ (scope.row.attachId || '').split(',').length }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="实际"
|
|
|
|
|
label="实际图纸"
|
|
|
|
|
prop="completeAmount"
|
|
|
|
|
width="80"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="差异"
|
|
|
|
|
label="差异图纸"
|
|
|
|
|
prop="difference"
|
|
|
|
|
width="80"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ scope.row.planAmount - scope.row.completeAmount }}
|
|
|
|
|
{{ (scope.row.attachId || '').split(',').length - scope.row.completeAmount }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
@ -121,42 +127,12 @@
|
|
|
|
|
width="120"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
|
|
|
|
<el-popconfirm
|
|
|
|
|
confirm-button-text='是'
|
|
|
|
|
cancel-button-text='否'
|
|
|
|
|
icon="el-icon-info"
|
|
|
|
|
v-if="scope.row.completeAmount === 0"
|
|
|
|
|
icon-color="red"
|
|
|
|
|
@confirm="startNextProduction(scope.row)"
|
|
|
|
|
title="确定开始计划吗?"
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
slot="reference">开始</el-button>
|
|
|
|
|
</el-popconfirm>
|
|
|
|
|
|
|
|
|
|
<el-popconfirm
|
|
|
|
|
confirm-button-text='是'
|
|
|
|
|
cancel-button-text='否'
|
|
|
|
|
icon="el-icon-info"
|
|
|
|
|
v-if="scope.row.completeAmount !== 0 && scope.row.completeAmount < scope.row.planAmount"
|
|
|
|
|
icon-color="red"
|
|
|
|
|
@confirm="startNextProduction(scope.row)"
|
|
|
|
|
title="确定继续计划吗?"
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
slot="reference">继续</el-button>
|
|
|
|
|
</el-popconfirm>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
style="margin-left: 4px"
|
|
|
|
|
type="text"
|
|
|
|
|
>
|
|
|
|
|
退库
|
|
|
|
|
条码打印
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
@ -175,7 +151,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="chartBox chartBox4">
|
|
|
|
|
<div class="title">当日产量</div>
|
|
|
|
|
<div class="title">每周产量</div>
|
|
|
|
|
<div class="chart">
|
|
|
|
|
<Chart ref="chart4"></Chart>
|
|
|
|
|
</div>
|
|
|
|
@ -204,6 +180,87 @@
|
|
|
|
|
<el-button type="primary" @click="getMaterialsModel = false">确 定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="dialogVisible"
|
|
|
|
|
title="领料"
|
|
|
|
|
width="40%">
|
|
|
|
|
<el-form ref="form" :model="form1" label-width="80px">
|
|
|
|
|
<el-form-item label="工单编号">
|
|
|
|
|
<el-input v-model="form1.planCode" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="明细编号">
|
|
|
|
|
<el-input v-model="form1.planDetailCode" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="领料仓库">
|
|
|
|
|
<el-select v-model="form1.warehouseId" placeholder="请选择领料仓库" @change="warehouseChange">
|
|
|
|
|
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
|
|
|
|
|
:value="item.warehouseId"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="领料原因">
|
|
|
|
|
<el-input v-model="form1.applyReason" type="textarea"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-table
|
|
|
|
|
:cell-style="{textAlign:'center'}"
|
|
|
|
|
:data="form.wmsRawOutstockDetailList"
|
|
|
|
|
:header-cell-style="{textAlign:'center'}"
|
|
|
|
|
max-height="19.13vw"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="物料编号"
|
|
|
|
|
prop="materialCode"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="物料名称"
|
|
|
|
|
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"
|
|
|
|
|
width="120"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input-number
|
|
|
|
|
:min="0"
|
|
|
|
|
v-model="scope.row.planAmount"
|
|
|
|
|
controls-position="right"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
</el-input-number>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
width="160"
|
|
|
|
|
>
|
|
|
|
|
<template slot="header" slot-scope="scope">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="searchMaterialValue"
|
|
|
|
|
placeholder="输入物料名称搜索"
|
|
|
|
|
size="mini"
|
|
|
|
|
@change="searchMaterial"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div style="text-align: center;margin-top: 12px">
|
|
|
|
|
<el-button type="primary" @click="receiveMaterial">申请领料</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -214,8 +271,10 @@ import {
|
|
|
|
|
completeProductPlanDetail,
|
|
|
|
|
getNewestProductPlanDetail,
|
|
|
|
|
getProductPlans,
|
|
|
|
|
startNextProductPlanDetail
|
|
|
|
|
startNextProductPlanDetail,
|
|
|
|
|
getPlanDrawings
|
|
|
|
|
} from "@/api/board/fifthFloor";
|
|
|
|
|
import {applyRawOutstock, getStockTotal, getWarehouses} from "@/api/board/firstFloor";
|
|
|
|
|
|
|
|
|
|
const setState = (e)=>{
|
|
|
|
|
if(e === '1'){
|
|
|
|
@ -239,8 +298,12 @@ export default {
|
|
|
|
|
nowNum1: 1,
|
|
|
|
|
totalNum1: 0,
|
|
|
|
|
getMaterialsModel:false,
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
form: {},
|
|
|
|
|
form1: {},
|
|
|
|
|
tableData: [],
|
|
|
|
|
warehouseList: [],
|
|
|
|
|
searchMaterialValue: '',
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
@ -443,6 +506,19 @@ export default {
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}) || []
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 设置图表信息
|
|
|
|
|
getInfo(e) {
|
|
|
|
|
this.$refs.chart1_1.setData({
|
|
|
|
@ -763,12 +839,29 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 开始继续
|
|
|
|
|
async startNextProduction(e){
|
|
|
|
|
const data = await startNextProductPlanDetail({planId: e.planId})
|
|
|
|
|
this.form = data.data
|
|
|
|
|
this.form.materialId = e.materialId
|
|
|
|
|
this.form.materialName = e.materialName
|
|
|
|
|
this.form.planDetailStatus = setState(data.data.planDetailStatus)
|
|
|
|
|
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)
|
|
|
|
|
})
|
|
|
|
|
getNewestProductPlanDetail({planId: val.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(){
|
|
|
|
@ -800,7 +893,68 @@ export default {
|
|
|
|
|
message: '已取消'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 领料页面
|
|
|
|
|
getMaterials() {
|
|
|
|
|
this.searchMaterialValue = ''
|
|
|
|
|
this.dialogVisible = true
|
|
|
|
|
this.form1 = {
|
|
|
|
|
warehouseId: '',
|
|
|
|
|
planId: this.form.row.planId,
|
|
|
|
|
planCode: this.form.row.planCode,
|
|
|
|
|
planDetailCode: this.form.row.planDetailCode,
|
|
|
|
|
applyReason: '',
|
|
|
|
|
taskType: '1',
|
|
|
|
|
wmsRawOutstockDetailList: []
|
|
|
|
|
}
|
|
|
|
|
// 获取仓库信息
|
|
|
|
|
getWarehouses({"warehouseFloor":5}).then(e => {
|
|
|
|
|
this.warehouseList = e.data
|
|
|
|
|
|
|
|
|
|
this.form1.warehouseId = e.data[0]?.warehouseId
|
|
|
|
|
this.searchMaterial("");
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 物料搜索
|
|
|
|
|
searchMaterial(val) {
|
|
|
|
|
getStockTotal({
|
|
|
|
|
warehouseId:this.form1.warehouseId,
|
|
|
|
|
materialName: val
|
|
|
|
|
}).then(e => {
|
|
|
|
|
this.form1.wmsRawOutstockDetailList = e.data.map(r => {
|
|
|
|
|
return {
|
|
|
|
|
materialId: r.materialId,
|
|
|
|
|
materialCode: r.materialCode,
|
|
|
|
|
materialName: r.materialName,
|
|
|
|
|
availableAmount: r.totalAmount-r.occupyAmount-r.frozenAmount,
|
|
|
|
|
unavailableAmount: r.occupyAmount+r.frozenAmount,
|
|
|
|
|
planAmount: r.planAmount
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
warehouseChange(warehouseId){
|
|
|
|
|
this.form.wmsRawOutstockDetailList =[];
|
|
|
|
|
this.form.warehouseId = warehouseId;
|
|
|
|
|
this.getStockTotal();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
receiveMaterial() {
|
|
|
|
|
applyRawOutstock(this.form).then(e => {
|
|
|
|
|
if (e.code === 200) {
|
|
|
|
|
this.dialogVisible = false
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '领料完成',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|