报工+成品计划

yangwl
zhaoxiaolin 1 year ago
parent a92d361094
commit 470a0fbec2

@ -163,3 +163,14 @@ export function getMesListBom(query) {
// method: 'get' // method: 'get'
// }); // });
// } // }
//获取批次
export function getBatchList(workorderCode) {
const data = {
workorderCode
}
return request({
url: '/mes/reportWork/getBatchList',
method: 'put',
data: data
});
}

@ -166,9 +166,10 @@
:formatter="productCodeFormate" :formatter="productCodeFormate"
/> />
<el-table-column label="产品名称" align="center" prop="productName" width="200"/> <el-table-column label="产品名称" align="center" prop="productName" width="200"/>
<el-table-column label="规格型号" align="center" prop="spec" />
<el-table-column label="排产数量(母)" align="center" prop="quantity" width="100"/> <el-table-column label="排产数量(母)" align="center" prop="quantity" width="100"/>
<el-table-column label="规格型号" align="center" prop="spec" v-if="false"/>
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="报工批次" align="center" prop="batch" width="100"/>
<el-table-column label="本次报工数量" align="center" prop="quantityFeedback" width="100"/> <el-table-column label="本次报工数量" align="center" prop="quantityFeedback" width="100"/>
<el-table-column label="用人数" align="center" prop="useMan" /> <el-table-column label="用人数" align="center" prop="useMan" />
<el-table-column label="工时" align="center" prop="workTime" /> <el-table-column label="工时" align="center" prop="workTime" />
@ -332,7 +333,6 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <!--
<el-col :span="6"> <el-col :span="6">
<el-form-item label="班组编码" prop="teamCode"> <el-form-item label="班组编码" prop="teamCode">
@ -346,6 +346,25 @@
</el-form-item> </el-form-item>
</el-col>--> </el-col>-->
</el-row> </el-row>
<el-row>
<el-col :span="6">
<el-form-item label="批次编码" prop="batch">
<el-select v-model="form.batch" class="selectItem" placeholder="请选择班组" clearable>
<el-option v-for="(item,index) in batchList"
:key="index"
:label="item.batchCode"
:value="item.batchCode">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结束报工" prop="endReport">
<el-radio v-model="form.endReport" label="0"></el-radio>
<el-radio v-model="form.endReport" label="1"></el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
@ -386,7 +405,7 @@
</template> </template>
<script> <script>
import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork,reportSap } from "@/api/mes/reportWork"; import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork,reportSap,getBatchList } from "@/api/mes/reportWork";
import ReportWorkConsume from "./reportWorkConsume.vue"; import ReportWorkConsume from "./reportWorkConsume.vue";
import ItemSelectUser from "./selectUser.vue"; import ItemSelectUser from "./selectUser.vue";
import ItemSelectWorkOrder from "./selectWorkOrder.vue"; import ItemSelectWorkOrder from "./selectWorkOrder.vue";
@ -459,13 +478,16 @@ export default {
attr4: null, attr4: null,
}, },
// //
form: {}, form: {
endReport:'0'
},
uploadStatusList:[ uploadStatusList:[
{"dictLabel":"待报工","dictValue":"0"}, {"dictLabel":"待报工","dictValue":"0"},
{"dictLabel":"报工成功","dictValue":"1"}, {"dictLabel":"报工成功","dictValue":"1"},
{"dictLabel":"报工失败","dictValue":"2"} {"dictLabel":"报工失败","dictValue":"2"}
], ],
teamList:[], teamList:[],
batchList:[],
// //
rules: { rules: {
workorderCode:[ workorderCode:[
@ -587,7 +609,8 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateTime: null, updateTime: null,
updateBy: null updateBy: null,
endReport:'0'
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -723,6 +746,9 @@ export default {
this.form.unit = obj.unit; this.form.unit = obj.unit;
this.form.shiftId = obj.shiftId; this.form.shiftId = obj.shiftId;
this.form.shiftName = obj.shiftName; this.form.shiftName = obj.shiftName;
getBatchList(obj.workorderCode).then(response => {
this.batchList = response;
});
}, },
/**线体选择弹出框**/ /**线体选择弹出框**/
handleSelectEquip() { handleSelectEquip() {

@ -150,6 +150,17 @@
>打印预览 >打印预览
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleDetail"
>工单详情
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -168,7 +179,12 @@
<el-table-column width="300" label="产品名称" align="center" prop="productName"/> <el-table-column width="300" label="产品名称" align="center" prop="productName"/>
<el-table-column label="规格型号" align="center" prop="productSpc" v-if="false"/> <el-table-column label="规格型号" align="center" prop="productSpc" v-if="false"/>
<el-table-column width="50" label="单位" align="center" prop="unit"/> <el-table-column width="50" label="单位" align="center" prop="unit"/>
<el-table-column width="120" label="已生产数量" align="center" prop="quantityProduced"/> <!--
<el-table-column label="子单批次信息" width="300" align="center" prop="batchInfo">
<template slot-scope="scope">
<div v-for="item in scope.row.batchInfo">{{ item }}</div>
</template>
</el-table-column>-->
<el-table-column width="120" label="派工数量" align="center" prop="quantitySplit"/> <el-table-column width="120" label="派工数量" align="center" prop="quantitySplit"/>
<el-table-column width="150" label="工艺编码" align="center" prop="routeCode"/> <el-table-column width="150" label="工艺编码" align="center" prop="routeCode"/>
<el-table-column width="200" label="工艺名称" align="center" prop="routeName" /> <el-table-column width="200" label="工艺名称" align="center" prop="routeName" />
@ -188,6 +204,7 @@
</el-table-column> </el-table-column>
<el-table-column label="班次" align="center" prop="shiftId" :formatter="shiftFormat"> <el-table-column label="班次" align="center" prop="shiftId" :formatter="shiftFormat">
</el-table-column> </el-table-column>
<el-table-column label="工单状态" align="center" prop="status"> <el-table-column label="工单状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.workorder_type" :value="scope.row.status"/> <dict-tag :options="dict.type.workorder_type" :value="scope.row.status"/>
@ -463,12 +480,13 @@
<el-table-column width="60" label="单位" align="center" prop="unit"/> <el-table-column width="60" label="单位" align="center" prop="unit"/>
<el-table-column width="90" label="工艺编码" align="center" prop="routeCode"/> <el-table-column width="90" label="工艺编码" align="center" prop="routeCode"/>
<el-table-column width="90" label="班次" align="center" prop="shiftDesc" :formatter="shiftFormat"/> <el-table-column width="90" label="班次" align="center" prop="shiftDesc" :formatter="shiftFormat"/>
<el-table-column align="center" prop="batchCodeList" label="批次号"></el-table-column> <el-table-column align="center" width="230" prop="batchCodeList" label="批次号"></el-table-column>
<el-table-column align="center" width="150" prop="batchNumList" label="批次数量"></el-table-column>
</el-table> </el-table>
<!-- 测试 --> <!-- 测试 -->
<!-- 操作按钮 --> <!-- 操作按钮 -->
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm" v-if="showDetail"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -486,7 +504,6 @@
v-model="materielParams.productCode" v-model="materielParams.productCode"
placeholder="请输入物料编码" placeholder="请输入物料编码"
clearable clearable
@keyup.enter.native="handleMaterielQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料名称" prop="productCode"> <el-form-item label="物料名称" prop="productCode">
@ -494,7 +511,6 @@
v-model="materielParams.productDescZh" v-model="materielParams.productDescZh"
placeholder="请输入物料名称" placeholder="请输入物料名称"
clearable clearable
@keyup.enter.native="handleMaterielQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -554,6 +570,7 @@ export default {
// //
formRef: 'form', formRef: 'form',
validateRules: [], validateRules: [],
materielList:[],
printData: { printData: {
printable: 'printFrom', printable: 'printFrom',
ignore: ['no-print'], ignore: ['no-print'],
@ -698,6 +715,7 @@ export default {
pageSize: 10, pageSize: 10,
}, },
materielBP: [], materielBP: [],
showDetail:true
}; };
}, },
@ -714,6 +732,12 @@ export default {
return cellValue.slice(7,18); // return cellValue.slice(7,18); //
}, },
// -
handleMaterielQuery() {
this.materielQueryParams.pageNum = 1;
this.getMaterielList();
},
// - // -
changeCarNum(num) { changeCarNum(num) {
@ -1279,9 +1303,150 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
//
handleDetail(row) {
//
this.reset();
this.splitData = [];
this.productData = [];
this.splitForm = {
prodLineCodeArray: [],
splitNum: null,
productDate: null,
shiftId: null,
routeCode: null,
carNum: null,
prodType:null,
materialCode:null,
materialName:null
}
this.formFields = []
this.converCarNum = null;
//
getProShifts().then(response => {
this.workShift = response.data
})
//
getProRoutes(this.selectWork.productCode).then(response => {
this.routes = response.data
getProEquipment(this.selectWork.routeCode).then(response => {
this.proline = response.data
})
//
for (let i = 0; i < this.routes.length; i++) {
if (this.routes[i].routeCode == this.selectWork.routeCode) {
this.converCarNum = this.routes[i].carNumUnit;
}
}
})
//
getProEquipment(this.selectWork.routeCode).then(response2 => {
this.eRouteOptions = response2.data
})
// list
getWorkBatchList(this.selectWork).then(response => {
this.formFields = response.data
})
//
//
this.proLoading = true // true
this.workerLoading = true // true
getOrderAndWork(this.selectWork).then(response => {
this.splitData.push(response.data.workOrder)
this.productData.push(response.data.order)
//
this.splitForm.prodType = this.splitData[0].prodType
if(this.productData[0].prodType == 'white') {
this.checkType = true
this.splitForm.materialName = this.splitData[0].materialName
this.splitForm.materialCode = this.splitData[0].materialCode
}else {
this.checkType = false
}
this.refreshProTable = false // refreshProTablefalse
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshProTable = true // refreshProTabletrue
this.proLoading = false // false
})
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkerTable = true // refreshProTabletrue
this.workerLoading = false // false
})
//
this.splitForm.splitNum = this.splitData[0].quantitySplit
//
this.splitForm.prodLineCodeArray = response.data.workOrder.prodLineCodeArray
//
this.splitForm.carNum = this.splitData[0].carNum
//
this.splitForm.shiftId = this.splitData[0].shiftDesc
//
this.splitForm.routeCode = this.splitData[0].routeCode
//
if(this.splitData[0].productDate != null){
this.splitForm.productDate = this.splitData[0].productDate;
}else{
this.splitForm.productDate = new Date();
}
//
if (this.productData[0].prodType == 'white'){
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
if (order.children !== undefined && work.children !== undefined) {
setAtrr1(order.children[0], work);
}
}
setAtrr1(this.productData[0], this.splitData[0]);
}
//
if (this.productData[0],prototype != 'white'){
if(this.splitData[0].sortNo != null){
this.splitForm.sortNo = this.splitData[0].sortNo
}
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
if (order.children !== undefined && work.children !== undefined) {
setAtrr1(order.children[0], work.children[0]);
}
}
setAtrr1(this.productData[0], this.splitData[0]);
}
})
this.open = true;
this.title = "生产工单详情";
this.showDetail = false;
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
this.showDetail = true;
this.reset(); this.reset();
}, },
// - // -

Loading…
Cancel
Save