修改生产界面

master
夜笙歌 9 months ago
parent 160b0f05c4
commit 6ec2a2f2c6

@ -215,7 +215,8 @@
</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" :key="item.warehouseId" :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="领料原因">

@ -14,21 +14,21 @@
<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="物料编号"> <el-form-item label="物料编号">
<el-input v-model="form.region"></el-input> <el-input v-model="form.materialId"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物料名称"> <el-form-item label="物料名称">
<el-input v-model="form.materialName"></el-input> <el-input v-model="form.materialName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="扫码时间"> <el-form-item label="扫码时间">
<el-input v-model="form.materialId"></el-input> <el-input v-model="form.materialId1"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="产品型号"> <el-form-item label="产品型号">
<el-input v-model="form.materialId"></el-input> <el-input v-model="form.materialId1"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="success">图纸下发</el-button> <el-button type="success">图纸下发</el-button>
<el-button type="primary">继续</el-button> <el-button type="primary">完成</el-button>
</div> </div>
</div> </div>
@ -121,7 +121,7 @@
<el-button <el-button
size="small" size="small"
type="text" type="text"
v-if="scope.row.completeAmoun === 0" v-if="scope.row.completeAmount === 0"
@click="startProduction(scope.row)" @click="startProduction(scope.row)"
> >
开始 开始
@ -130,7 +130,7 @@
size="small" size="small"
type="text" type="text"
@click="nextProduction(scope.row)" @click="nextProduction(scope.row)"
v-if="scope.row.completeAmount < scope.row.planAmount" v-if="scope.row.completeAmount !== 0 && scope.row.completeAmount < scope.row.planAmount"
> >
继续 继续
</el-button> </el-button>
@ -157,12 +157,29 @@
<div class="bottom"> <div class="bottom">
<el-row> <el-row>
<el-button type="primary">首页</el-button> <el-button type="primary">首页</el-button>
<el-button type="success">板材领料</el-button> <el-button type="success" @click="getMaterialsModel = true">板材领料</el-button>
<el-button type="info">SOP预览</el-button> <el-button type="info">SOP预览</el-button>
<el-button type="danger">退出</el-button> <el-button type="danger">退出</el-button>
</el-row> </el-row>
</div> </div>
<el-dialog title="板材领料" :visible.sync="getMaterialsModel">
<el-form :model="form">
<el-form-item label="活动名称" label-width="120px">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="活动区域" label-width="120px">
<el-select v-model="form.region" placeholder="请选择活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="getMaterialsModel = false"> </el-button>
<el-button type="primary" @click="getMaterialsModel = false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -179,6 +196,7 @@ export default {
}, },
data() { data() {
return { return {
getMaterialsModel:false,
form: {}, form: {},
tableData: [ tableData: [
{ {
@ -212,6 +230,8 @@ export default {
this.getInfo(e.data[0]) this.getInfo(e.data[0])
getNewestProductPlanDetail(e.data[0].planId).then(val=>{ getNewestProductPlanDetail(e.data[0].planId).then(val=>{
this.form = val.data this.form = val.data
this.form.materialId = e.data[0].materialId
this.form.materialName = e.data[0].materialName
}) })
}) })
this.$refs.chart2.setData({ this.$refs.chart2.setData({
@ -382,6 +402,8 @@ export default {
this.getInfo(e) this.getInfo(e)
getNewestProductPlanDetail(e.planId).then(val=>{ getNewestProductPlanDetail(e.planId).then(val=>{
this.form = val.data this.form = val.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
}) })
}, },
getInfo(e) { getInfo(e) {
@ -407,7 +429,7 @@ export default {
center: ["50%", "50%"], center: ["50%", "50%"],
data: [ data: [
{ {
value: e.planAmount, value: e.planAmount === 0 ? 0.0001 : e.planAmount ,
label: { label: {
normal: { normal: {
rich: { rich: {
@ -426,7 +448,7 @@ export default {
formatter: function (params) { formatter: function (params) {
return ( return (
"{a|" + "{a|" +
params.data.value + (params.data.value === 0.0001 ? 0 : params.data.value) +
"}" + "}" +
"\n{b|计划}" "\n{b|计划}"
); );
@ -486,7 +508,7 @@ export default {
center: ["50%", "50%"], center: ["50%", "50%"],
data: [ data: [
{ {
value: e.completeAmount, value: e.completeAmount === 0 ? 0.0001 : e.completeAmount ,
label: { label: {
normal: { normal: {
rich: { rich: {
@ -505,7 +527,7 @@ export default {
formatter: function (params) { formatter: function (params) {
return ( return (
"{a|" + "{a|" +
params.data.value + (params.data.value === 0.0001 ? 0 : params.data.value) +
"}" + "}" +
"\n{b|实际}" "\n{b|实际}"
); );
@ -565,7 +587,7 @@ export default {
center: ["50%", "50%"], center: ["50%", "50%"],
data: [ data: [
{ {
value: e.planAmount - e.completeAmount, value: (e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount) ,
label: { label: {
normal: { normal: {
rich: { rich: {
@ -584,7 +606,7 @@ export default {
formatter: function (params) { formatter: function (params) {
return ( return (
"{a|" + "{a|" +
params.data.value + (params.data.value === 0.0001 ? 0 : params.data.value) +
"}" + "}" +
"\n{b|差异}" "\n{b|差异}"
); );
@ -663,7 +685,7 @@ export default {
formatter: function (params) { formatter: function (params) {
return ( return (
"{a|" + "{a|" +
params.data.value + (params.data.value === 0.0001 ? 0 : params.data.value) +
"%}" + "%}" +
"\n{b|完成率}" "\n{b|完成率}"
); );
@ -709,6 +731,8 @@ export default {
this.getInfo(e) this.getInfo(e)
const data = await startNextProductPlanDetail({planId:e.planId}) const data = await startNextProductPlanDetail({planId:e.planId})
this.form = data.data this.form = data.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
}, },
} }

@ -1,114 +1,168 @@
<template> <template>
<el-card> <div>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-card>
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">工单信息</span></el-divider> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row :gutter="10"> <el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">工单信息</span></el-divider>
<el-col :span="12"> <el-row :gutter="10">
<el-form-item label="工单号:">{{ form.orderCode }}</el-form-item> <el-col :span="12">
<el-form-item label="成品编码:">{{ form.materialCode }}</el-form-item> <el-form-item label="工单号:">{{ form.orderCode }}</el-form-item>
<el-form-item label="计划开始时间:">{{ parseTime(form.planBeginTime) }}</el-form-item> <el-form-item label="成品编码:">{{ form.materialCode }}</el-form-item>
<el-form-item label="计划数量/已派工数量/完成数量:" label-width="220px"> <el-form-item label="计划开始时间:">{{ parseTime(form.planBeginTime) }}</el-form-item>
{{ form.planAmount }}/{{ form.dispatchAmount }}/{{ form.completeAmount }} <el-form-item label="计划数量/已派工数量/完成数量:" label-width="220px">
</el-form-item> {{ form.planAmount }}/{{ form.dispatchAmount }}/{{ form.completeAmount }}
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="工艺路线:">{{ form.dispatchName }}</el-form-item> <el-col :span="12">
<el-form-item label="成品名称:">{{ form.materialName }}</el-form-item> <el-form-item label="工艺路线:">{{ form.dispatchName }}</el-form-item>
<el-form-item label="计划结束时间:">{{ parseTime(form.planEndTime) }}</el-form-item> <el-form-item label="成品名称:">{{ form.materialName }}</el-form-item>
</el-col> <el-form-item label="计划结束时间:">{{ parseTime(form.planEndTime) }}</el-form-item>
</el-row> </el-col>
</el-row>
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">派工信息</span></el-divider> <el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">派工信息</span></el-divider>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMesProductPlan"> <el-button icon="el-icon-plus" size="mini" type="primary" @click="handleAddMesProductPlan">
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesProductPlan">-->
<!-- </el-button>-->
<!-- </el-col>-->
</el-row>
<el-table :data="mesProductPlanList" :row-class-name="rowMesProductPlanIndex"
@selection-change="handleMesProductPlanSelectionChange" ref="mesProductPlan">
<el-table-column type="selection" width="50" align="center"/>
<el-table-column label="序号" align="center" prop="index" width="50" v-if="false"/>
<el-table-column label="派工单号" align="center" prop="dispatchCode" width="190">
<template slot-scope="scope">
<el-input v-model="scope.row.dispatchCode" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="工序" align="center" prop="processName" width="140">
<template slot-scope="scope">
<el-input v-model="scope.row.processName" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="步骤" align="center" prop="processOrder" >
<template slot-scope="scope">
<el-input v-model="scope.row.processOrder" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="工位" align="center" prop="stationName" width="140" >
<template slot-scope="scope">
<el-input v-model="scope.row.stationName" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="派工数量" align="center" prop="planAmount" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.planAmount" :disabled="scope.row.oldRowFlag"/>
</template>
</el-table-column>
<el-table-column label="派工标准工时" align="center" prop="productionTime" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.productionTime" :disabled="scope.row.oldRowFlag"/>
</template>
</el-table-column>
<el-table-column label="计划开始时间" align="center" prop="planBeginTime" width="230">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.planBeginTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划开始时间" :disabled="scope.row.oldRowFlag"/>
</template>
</el-table-column>
<el-table-column label="计划完成时间" align="center" prop="planEndTime" width="230">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.planEndTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划完成时间" :disabled="scope.row.oldRowFlag"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="planStatus" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.planStatus" placeholder="请选择状态" :disabled="true">
<el-option
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="50">
<template slot-scope="scope">
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleDrawing(scope.row)"
>图纸
</el-button> </el-button>
</template> </el-col>
</el-table-column> <!-- <el-col :span="1.5">-->
</el-table> <!-- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesProductPlan">-->
</el-form> <!-- </el-button>-->
<el-form label-width="100px"> <!-- </el-col>-->
<el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;"> </el-row>
<el-button type="primary" @click="submitForm()"></el-button> <el-table ref="mesProductPlan" :data="mesProductPlanList"
<el-button @click="close()"></el-button> :row-class-name="rowMesProductPlanIndex" @selection-change="handleMesProductPlanSelectionChange">
</el-form-item> <el-table-column align="center" type="selection" width="50"/>
</el-form> <el-table-column v-if="false" align="center" label="序号" prop="index" width="50"/>
</el-card> <el-table-column align="center" label="派工单号" prop="dispatchCode" width="190">
<template slot-scope="scope">
<el-input v-model="scope.row.dispatchCode" :disabled="true"/>
</template>
</el-table-column>
<el-table-column align="center" label="工序" prop="processName" width="140">
<template slot-scope="scope">
<el-input v-model="scope.row.processName" :disabled="true"/>
</template>
</el-table-column>
<el-table-column align="center" label="步骤" prop="processOrder">
<template slot-scope="scope">
<el-input v-model="scope.row.processOrder" :disabled="true"/>
</template>
</el-table-column>
<el-table-column align="center" label="工位" prop="stationName" width="140">
<template slot-scope="scope">
<el-input v-model="scope.row.stationName" :disabled="true"/>
</template>
</el-table-column>
<el-table-column align="center" label="派工数量" prop="planAmount" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.planAmount" :disabled="scope.row.oldRowFlag"/>
</template>
</el-table-column>
<el-table-column align="center" label="派工标准工时" prop="productionTime" width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.productionTime" :disabled="scope.row.oldRowFlag"/>
</template>
</el-table-column>
<el-table-column align="center" label="计划开始时间" prop="planBeginTime" width="230">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.planBeginTime" :disabled="scope.row.oldRowFlag" clearable
placeholder="请选择计划开始时间"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"/>
</template>
</el-table-column>
<el-table-column align="center" label="计划完成时间" prop="planEndTime" width="230">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.planEndTime" :disabled="scope.row.oldRowFlag" clearable
placeholder="请选择计划完成时间"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"/>
</template>
</el-table-column>
<el-table-column align="center" label="状态" prop="planStatus" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.planStatus" :disabled="true" placeholder="请选择状态">
<el-option
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="50">
<template slot-scope="scope">
<el-button
icon="el-icon-search"
size="mini"
type="primary"
@click="handleDrawing(scope.row)"
>图纸
</el-button>
</template>
</el-table-column>
</el-table>
</el-form>
<el-form label-width="100px">
<el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;">
<el-button type="primary" @click="submitForm()"></el-button>
<el-button @click="close()"></el-button>
</el-form-item>
</el-form>
</el-card>
<el-dialog
:visible.sync="blueprintModel"
title="上传图纸"
width="30%"
@before-close="blueprintModel = false">
<el-upload
ref="upload"
:auto-upload="false"
action="#"
multiple
list-type="picture-card">
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img
v-if="isAssetTypeAnImage(file.name)"
:alt="file.name"
:src="file.url" class="el-upload-list__item-thumbnail"
>
<span v-else>{{ file.name }}</span>
<span class="el-upload-list__item-actions">
<span
v-if="isAssetTypeAnImage(file.name)"
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
<span
class="el-upload-list__item-delete"
@click="$refs.upload.handleRemove(file)"
>
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="blueprintModel = false"> </el-button>
<el-button type="primary" @click="blueprintModel = false"> </el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="pictureDetailModel">
<img :src="dialogImageUrl" alt="" width="100%">
</el-dialog>
</div>
</template> </template>
<script> <script>
@ -121,6 +175,9 @@ export default {
dicts: ['active_flag', 'product_status'], dicts: ['active_flag', 'product_status'],
data() { data() {
return { return {
blueprintModel: false,
pictureDetailModel: false,
dialogImageUrl: '',
// name // name
activeName: "columnInfo", activeName: "columnInfo",
// //
@ -183,10 +240,16 @@ export default {
} }
}, },
methods: { methods: {
isAssetTypeAnImage(ext) {
let suffix = ext.lastIndexOf(".");
let name = ext.substr(suffix + 1);
return [
'png', 'jpg', 'jpeg'].includes(name.toLowerCase())
},
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
let dataList = this.mesProductPlanList.filter(plan => !plan.oldRowFlag); let dataList = this.mesProductPlanList.filter(plan => !plan.oldRowFlag);
if (dataList.length === 0){ if (dataList.length === 0) {
this.close(); this.close();
return; return;
} }
@ -223,24 +286,29 @@ export default {
this.$modal.msgSuccess(res.msg); this.$modal.msgSuccess(res.msg);
this.close(); this.close();
}); });
}, }
,
/** 生产计划明细序号 */ /** 生产计划明细序号 */
rowMesProductPlanIndex({row, rowIndex}) { rowMesProductPlanIndex({row, rowIndex}) {
row.index = rowIndex + 1; row.index = rowIndex + 1;
}, }
,
/** 复选框选中数据 */ /** 复选框选中数据 */
handleMesProductPlanSelectionChange(selection) { handleMesProductPlanSelectionChange(selection) {
this.checkedMesProductPlan = selection.map(item => item.index) this.checkedMesProductPlan = selection.map(item => item.index)
}, }
,
/** 关闭按钮 */ /** 关闭按钮 */
close() { close() {
const obj = {path: "/mes/plan/productOrder", query: {t: Date.now(), pageNum: this.$route.query.pageNum}}; const obj = {path: "/mes/plan/productOrder", query: {t: Date.now(), pageNum: this.$route.query.pageNum}};
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
}, }
,
/** 查看图纸 */ /** 查看图纸 */
handleDrawing(row) { handleDrawing(row) {
console.log(row); this.blueprintModel = true
}, }
,
/** 生产计划添加按钮操作 */ /** 生产计划添加按钮操作 */
handleAddMesProductPlan() { handleAddMesProductPlan() {
let dispatchCode = ""; let dispatchCode = "";
@ -285,11 +353,13 @@ export default {
}) })
}) })
}) })
}, }
,
isPositiveInteger(value) { isPositiveInteger(value) {
// 使 // 使
return /^[1-9]\d*$/.test(value); return /^[1-9]\d*$/.test(value);
}, }
,
/** 生产计划明细删除按钮操作 */ /** 生产计划明细删除按钮操作 */
handleDeleteMesProductPlan() { handleDeleteMesProductPlan() {
if (this.checkedMesProductPlan.length == 0) { if (this.checkedMesProductPlan.length == 0) {
@ -302,6 +372,14 @@ export default {
}); });
} }
}, },
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.pictureDetailModel = true;
}
,
handleDownload(file) {
console.log(file);
}
}, },
mounted() { mounted() {
@ -317,5 +395,6 @@ export default {
// } // }
// }); // });
} }
}; }
;
</script> </script>

Loading…
Cancel
Save