修改生产界面

master
夜笙歌 1 year ago
parent 2b4b139cdf
commit 78c92e8756

@ -8,3 +8,35 @@ export function getProductPlans(query) {
params: query params: query
}) })
} }
export function insertProductPlanDetails(query) {
return request({
url: '/mes/api/insertProductPlanDetails',
method: 'post',
data: query
})
}
export function getMaterialBoms(query) {
return request({
url: '/mes/api/getMaterialBoms',
method: 'get',
params: query
})
}
export function getWarehouses(query) {
return request({
url: '/wms/api/getWarehouses',
method: 'get',
params: query
})
}
export function applyRawOutstock(query) {
return request({
url: '/wms/api/applyRawOutstock',
method: 'post',
data: query
})
}

@ -7,11 +7,11 @@
<div class="chart"> <div class="chart">
<div class="whiteTable"> <div class="whiteTable">
<el-table <el-table
:data="tableData"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="tableData"
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%"
> >
<el-table-column <el-table-column
label="序号" label="序号"
@ -20,40 +20,40 @@
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="dispatchCode"
label="工单编号" label="工单编号"
prop="dispatchCode"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="materialName"
label="物料名称" label="物料名称"
prop="materialName"
width="100" width="100"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="planAmount"
label="计划" label="计划"
prop="planAmount"
width="100" width="100"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="completeAmount"
label="实际" label="实际"
prop="completeAmount"
width="100" width="100"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="difference"
label="差异" label="差异"
prop="difference"
width="100" width="100"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.planAmount -scope.row.completeAmount }} {{ scope.row.planAmount - scope.row.completeAmount }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="planDeliveryDate"
label="交付时间" label="交付时间"
prop="planDeliveryDate"
width="150" width="150"
> >
</el-table-column> </el-table-column>
@ -63,16 +63,17 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text"
size="small" size="small"
type="text"
> >
条码打印 条码打印
</el-button> </el-button>
<el-button <el-button
type="text"
size="small" size="small"
type="text"
@click="getDetail"
> >
开始 明细
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -93,11 +94,11 @@
<div class="chart"> <div class="chart">
<div class="whiteTable"> <div class="whiteTable">
<el-table <el-table
:data="tableData1"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="tableData1"
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%"
> >
<el-table-column <el-table-column
@ -107,18 +108,18 @@
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="planNumber"
label="计划编号" label="计划编号"
prop="planNumber"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="workOrderNumber"
label="工单编号" label="工单编号"
prop="workOrderNumber"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="startTime"
label="开始时间" label="开始时间"
prop="startTime"
width="200" width="200"
> >
</el-table-column> </el-table-column>
@ -128,34 +129,34 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text"
size="small" size="small"
type="text"
> >
装配 装配
</el-button> </el-button>
<el-button <el-button
type="text"
size="small" size="small"
type="text"
@click="getMaterials(scope) " @click="getMaterials(scope) "
> >
领料 领料
</el-button> </el-button>
<el-button <el-button
type="text"
size="small" size="small"
type="text"
> >
扫描 扫描
</el-button> </el-button>
<el-button <el-button
type="text"
size="small" size="small"
type="text"
> >
退料 退料
</el-button> </el-button>
<el-button <el-button
type="text"
size="small" size="small"
style="color: #f56c6c" style="color: #f56c6c"
type="text"
> >
删除 删除
</el-button> </el-button>
@ -183,37 +184,37 @@
</div> </div>
<el-dialog <el-dialog
title="领料"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
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"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="成品" v-show="false"> <el-form-item v-show="false" label="成品">
<el-input v-model="form.productId"></el-input> <el-input v-model="form.productId"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="领料类型" v-show="false"> <el-form-item v-show="false" label="领料类型">
<el-select v-model="form.taskType" placeholder="请选择领料类型"> <el-select v-model="form.taskType" placeholder="请选择领料类型">
<el-option label="类型一" value="shanghai"></el-option> <el-option label="类型一" value="shanghai"></el-option>
<el-option label="类型二" value="beijing"></el-option> <el-option label="类型二" value="beijing"></el-option>
</el-select> </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="form.wmsRawOutstockDetailList =[]">
<el-option v-for="item in warehouseList" :label="item.warehouseName" :value="item.warehouseId"></el-option> <el-option v-for="item in warehouseList" :label="item.warehouseName" :value="item.warehouseId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="领料原因"> <el-form-item label="领料原因">
<el-input type="textarea" v-model="form.applyReason"></el-input> <el-input v-model="form.applyReason" type="textarea"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
:data="form.wmsRawOutstockDetailList"
style="width: 100%"
max-height="19.13vw"
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%"
> >
<el-table-column <el-table-column
label="物料编号" label="物料编号"
@ -221,20 +222,20 @@
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="materialName"
label="物料名称" label="物料名称"
prop="materialName"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="planAmount"
label="领取数量" label="领取数量"
prop="planAmount"
width="120" width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-input-number
style="width: 100%"
controls-position="right"
v-model="scope.row.quantityAcquired" v-model="scope.row.quantityAcquired"
controls-position="right"
style="width: 100%"
> >
</el-input-number> </el-input-number>
</template> </template>
@ -246,14 +247,14 @@
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<el-input <el-input
v-model="searchMaterialValue" v-model="searchMaterialValue"
placeholder="输入物料名称搜索"
size="mini" size="mini"
@change="searchMaterial" @change="searchMaterial"/>
placeholder="输入物料名称搜索"/>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text"
size="small" size="small"
type="text"
> >
删除 删除
</el-button> </el-button>
@ -270,7 +271,13 @@
<script> <script>
import Chart from '@/components/board/Chart' import Chart from '@/components/board/Chart'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { getProductPlans} from '@/api/board/firstFloor' import {
getMaterialBoms,
getWarehouses,
applyRawOutstock,
getProductPlans,
insertProductPlanDetails
} from '@/api/board/firstFloor'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default { export default {
@ -280,14 +287,14 @@ export default {
}, },
data() { data() {
return { return {
searchMaterialValue:'', searchMaterialValue: '',
warehouseList:[], warehouseList: [],
form: { form: {
warehouseId: '', warehouseId: '',
planCode: '', planCode: '',
applyReason: '', applyReason: '',
productId:''||2, productId: '' || 2,
planDetailCode:''||1, planDetailCode: '' || 1,
taskType: '1', taskType: '1',
wmsRawOutstockDetailList: [] wmsRawOutstockDetailList: []
}, },
@ -295,7 +302,7 @@ export default {
materialId: '', materialId: '',
materialName: '', materialName: '',
planAmount: '', planAmount: '',
quantityAcquired:0, quantityAcquired: 0,
}, },
dialogVisible: false, dialogVisible: false,
addDialogVisible: false, addDialogVisible: false,
@ -342,10 +349,18 @@ export default {
} }
}, },
mounted() { mounted() {
getProductPlans().then(e=>{ getProductPlans().then(e => {
console.log(e) console.log(e)
this.tableData = e.data this.tableData = e.data
}) })
insertProductPlanDetails({
"planId": 1,
"planAmount": 1,
"materialId": 1,
"materialBomId": 1
}).then(e => {
console.log(e)
})
this.$refs.chart2.setData({ this.$refs.chart2.setData({
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -510,32 +525,49 @@ export default {
}) })
}, },
methods: { methods: {
getDetail() {
if(true){
this.$alert('这是一段内容', '标题名称', {
confirmButtonText: '确定',
callback: action => {
this.$message({
type: 'info',
message: `action: ${ action }`
});
}
});
}else{
}
},
getMaterials(val) { getMaterials(val) {
this.searchMaterialValue = '' this.searchMaterialValue = ''
this.dialogVisible = true this.dialogVisible = true
this.form = { this.form = {
warehouseId: '', warehouseId: '',
planCode: val.row.planNumber, planCode: val.row.planNumber,
productId:''||2, productId: '' || 2,
planDetailCode:''||1, planDetailCode: '' || 1,
applyReason: '', applyReason: '',
taskType: '1', taskType: '1',
wmsRawOutstockDetailList: [] wmsRawOutstockDetailList: []
} }
getWarehouses({ getWarehouses({
warehouseFloor:1 warehouseFloor: 1
}).then(e=>{ }).then(e => {
this.warehouseList = e.data this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId this.form.warehouseId = e.data[0]?.warehouseId
}) })
getMaterialBoms({ getMaterialBoms({
ancestors:1, ancestors: 1,
}).then(e=>{ }).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r=>{ this.form.wmsRawOutstockDetailList = e.data.map(r => {
return { return {
materialId:r.materialId, materialId: r.materialId,
materialName:r.materialName, materialName: r.materialName,
planAmount:0, planAmount: 0,
} }
}) })
}) })
@ -545,9 +577,9 @@ export default {
this.form.wmsRawOutstockDetailList.push(this.form2) this.form.wmsRawOutstockDetailList.push(this.form2)
}, },
receiveMaterial() { receiveMaterial() {
applyRawOutstock(this.form).then(e=>{ applyRawOutstock(this.form).then(e => {
console.log(e) console.log(e)
if(e.code === 200){ if (e.code === 200) {
this.dialogVisible = false this.dialogVisible = false
this.$message({ this.$message({
message: '领料完成', message: '领料完成',
@ -556,17 +588,17 @@ export default {
} }
}) })
}, },
searchMaterial(val){ searchMaterial(val) {
console.log(val) console.log(val)
getMaterialBoms({ getMaterialBoms({
ancestors:1, ancestors: 1,
materialName:val materialName: val
}).then(e=>{ }).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r=>{ this.form.wmsRawOutstockDetailList = e.data.map(r => {
return { return {
materialId:r.materialId, materialId: r.materialId,
materialName:r.materialName, materialName: r.materialName,
planAmount:0, planAmount: 0,
} }
}) })
}) })

@ -126,12 +126,10 @@ export default {
// this.loginForm.stationId = this.$route?.query?.station || ''; // this.loginForm.stationId = this.$route?.query?.station || '';
if (this.$route?.query?.isStationId === 'true') { if (this.$route?.query?.isStationId === 'true') {
this.isStationId = true this.isStationId = true
}
},
mounted() {
getStations().then(e => { getStations().then(e => {
this.options = e.data this.options = e.data
}) })
}
}, },
methods: { methods: {
getCode() { getCode() {
@ -168,8 +166,9 @@ export default {
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch("Login", this.loginForm).then(() => {
let data = this.options.find(v=>v.stationId === this.loginForm.stationId) || {} let data = this.options.find(v=>v.stationId === this.loginForm.stationId) || {}
let routeData = this.floorData.find(v=>v.floor === data.floor && v.processId === data.processId) let routeData = this.floorData.find(v=>v.floor === data.floor && v.processId === data.processId) || {}
console.log(routeData) // this.$router.push({path: this.redirect || "/"}).catch(() => {
// });
this.$router.push({path: routeData.route || this.redirect || "/"}).catch(() => { this.$router.push({path: routeData.route || this.redirect || "/"}).catch(() => {
}); });
}).catch(() => { }).catch(() => {

Loading…
Cancel
Save