yangwl
zhaoxiaolin 1 year ago
parent a32735be01
commit 17e30ed8a9

@ -105,4 +105,53 @@ export function getProShifts() {
url: '/mes/reportWork/getProShifts/', url: '/mes/reportWork/getProShifts/',
method: 'get' method: 'get'
}) })
}
// 查询人员列表
export function getMesListUser(query) {
return request({
url: '/mes/reportWork/getMesListUser',
method: 'get',
params: query
});
}
//查询工单列表
export function getMesListWorkOrder(query) {
return request({
url: '/mes/reportWork/getMesListWorkOrder',
method: 'get',
params: query
});
}
//查询线体列表
export function getMesListEquip(query) {
return request({
url: '/mes/reportWork/getMesListEquip',
method: 'get',
params: query
});
}
//报工按钮
export function reportSap(reportCode) {
const data = {
reportCode
}
return request({
url: '/mes/reportWork/reportSap',
method: 'put',
data: data
});
}
// 查询物料管理列表
export function getMesListBom(query) {
return request({
url: '/mes/reportWorkConsume/getMesListBom',
method: 'get',
params: query
});
} }

@ -9,10 +9,10 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="报工类型" prop="reportType"> <el-form-item label="生产订单编码" prop="orderCode">
<el-input <el-input
v-model="queryParams.reportType" v-model="queryParams.orderCode"
placeholder="请输入报工类型" placeholder="请输入生产订单编码"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -34,14 +34,45 @@
/> />
</el-form-item> </el-form-item>
</el-form-item> </el-form-item>
<el-form-item label="产品名称" prop="productName"> <el-form-item label="产品名称" prop="productName">
<el-input <el-input
v-model="queryParams.productName" v-model="queryParams.productName"
placeholder="请输入产品名称" placeholder="请输入产品名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="报工时间" prop="feedbackTimeArray">
<el-date-picker
v-model="queryParams.feedbackTimeArray"
format="yyyy-MM-dd"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="SAP报工结果" prop="uploadStatus">
<el-select v-model="queryParams.uploadStatus" placeholder="请选择结果" clearable>
<el-option
v-for="item in uploadStatusList"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTimeArray">
<el-date-picker
v-model="queryParams.createTimeArray"
format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
@ -80,6 +111,28 @@
v-hasPermi="['mes:reportWork:remove']" v-hasPermi="['mes:reportWork:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-s-claim"
size="mini"
:disabled="single"
@click="handleReport"
v-hasPermi="['mes:reportWork:edit']"
>报工SAP</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-s-release"
size="mini"
:disabled="single"
@click="handleReportConsume"
v-hasPermi="['mes:reportWork:edit']"
>物料损耗</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@ -97,67 +150,44 @@
<el-table-column type="selection" align="center" /> <el-table-column type="selection" align="center" />
<el-table-column label="报工单编号" align="center" prop="reportCode" width="120"> <el-table-column label="报工单编号" align="center" prop="reportCode" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@click="handleView(scope.row)" @click="handleView(scope.row)"
>{{scope.row.reportCode}}</el-button> >{{scope.row.reportCode}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="报工类型" align="center" prop="reportType" width="150"/> <el-table-column label="报工类型" align="center" prop="reportType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.report_type" :value="scope.row.reportType"/>
</template>
</el-table-column>
<el-table-column label="生产工单编码" align="center" prop="workorderCode" width="200"/> <el-table-column label="生产工单编码" align="center" prop="workorderCode" width="200"/>
<el-table-column label="产品编码" align="center" prop="productCode" width="200"/> <el-table-column label="产品编码" align="center" prop="productCode" width="200"/>
<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="spec" />
<el-table-column label="排产数量(母)" align="center" prop="quantity" width="100"/>
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="排产数量" align="center" prop="quantity" />
<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="quantityQualified" :show-overflow-tooltip="true"> <el-table-column label="报工时间" align="center" prop="feedbackTime" width="150"/><!--加时分秒生成报工单的逻辑要变切记-->
<template slot-scope="scope"> <!--
<div :style="{ color: scope.row.quantityQualified ? 'green' : 'green' }">
{{ scope.row.quantityQualified }}
</div>
</template>
</el-table-column>
<el-table-column label="不合格数量" align="center" prop="quantityUnqualified" width="100"> <el-table-column label="不合格数量" align="center" prop="quantityUnqualified" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<div :style="{ color: scope.row.quantityUnqualified ? 'red' : 'red' }"> <div :style="{ color: scope.row.quantityUnqualified ? 'red' : 'red' }">
{{ scope.row.quantityUnqualified }} {{ scope.row.quantityUnqualified }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column label="报工人员" align="center" prop="userName" /> <el-table-column label="报工人" align="center" prop="nickName" />
<el-table-column label="人员名称" align="center" prop="nickName" /> <el-table-column label="工号" align="center" prop="userName" />
<el-table-column label="报工途径" align="center" prop="feedbackChannel" /> <el-table-column label="报工状态" align="center" prop="uploadStatus" width="100"/>
<el-table-column label="报工时间" align="center" prop="feedbackTime" width="180"> <el-table-column label="SAP报工时间" align="center" prop="uploadTime" width="150"/>
<template slot-scope="scope"> <el-table-column label="报工信息" align="center" prop="uploadMsg" width="100"/>
<span>{{ parseTime(scope.row.feedbackTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="录入人员" align="center" prop="recordUser" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="工时" align="center" prop="workTime" /> <el-table-column label="工时" align="center" prop="workTime" />
<el-table-column label="线体编码" align="center" prop="machineCode" /> <el-table-column label="线体编码" align="center" prop="machineCode" />
<el-table-column label="线体名称" align="center" prop="machineName" /> <el-table-column label="线体名称" align="center" prop="machineName" />
<el-table-column label="班组编码" align="center" prop="teamCode" /> <el-table-column label="班组编码" align="center" prop="teamCode" />
<el-table-column label="班次编码" align="center" prop="shiftCode" /> <el-table-column label="班次编码" align="center" prop="shiftId" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="创建时间" align="center" prop="createTime" width="150"/>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:reportWork:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:reportWork:remove']"
>删除</el-button>
</template>
</el-table-column> -->
</el-table> </el-table>
<pagination <pagination
@ -171,155 +201,117 @@
<!-- 添加或修改报工报表对话框 --> <!-- 添加或修改报工报表对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> <el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报工单编号" prop="reportCode"> <el-form-item label="报工单编号" prop="reportCode">
<el-input v-model="form.reportCode" placeholder="请输入报工单编号" /> <el-input v-model="form.reportCode" placeholder="请输入报工单编号" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="报工类型" prop="reportType">
<el-select v-model="form.reportType" placeholder="请选择报工类型" style="width:180px">
<el-option
v-for="dict in dict.type.report_work_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="报工人员" prop="userName">
<el-input v-model="form.userName" placeholder="请输入报工人员" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> </el-col>
<el-form-item label="报工途径" prop="feedbackChannel"> <el-col :span="6">
<el-select v-model="form.feedbackChannel" placeholder="请选择报工途径" style="width:180px"> <el-form-item label="报工人员姓名" prop="nickName">
<el-option <el-input v-model="form.nickName" placeholder="请输入报工人员" >
v-for="dict in dict.type.report_work_channel" <el-button slot="append" @click="handleSelectUser" icon="el-icon-search"></el-button>
:key="dict.value" </el-input>
:label="dict.label" </el-form-item>
:value="dict.value" </el-col>
></el-option> <el-col :span="6">
</el-select> <el-form-item label="报工人员工号" prop="userName">
</el-form-item> <el-input v-model="form.userName" placeholder="请输入报工人员" disabled/>
</el-col> </el-form-item>
</el-row> </el-col>
<el-col v-if="false">
<el-form-item label="默认">
<el-input v-model="form.reportType" disabled/>
<el-input v-model="form.feedbackChannel" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="生产工单编码" prop="workorderCode">
<el-input v-model="form.workorderCode" placeholder="请选择生产工单" >
<el-button slot="append" @click="handleSelectWorkOrder" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="6">
<el-form-item label="生产工单编码" prop="workorderCode">
<el-input v-model="form.workorderCode" placeholder="请输入生产工单编码" />
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="产品编码" prop="productCode"> <el-form-item label="产品编码" prop="productCode">
<el-input v-model="form.productCode" placeholder="请输入产品编码" /> <el-input v-model="form.productCode" placeholder="请输入产品编码" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="产品名称" prop="productName"> <el-form-item label="产品名称" prop="productName">
<el-input v-model="form.productName" placeholder="请输入产品名称" /> <el-input v-model="form.productName" placeholder="请输入产品名称" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="规格型号" prop="spec"> <el-form-item label="规格型号" prop="spec">
<el-input v-model="form.spec" placeholder="请输入内容" /> <el-input v-model="form.spec" placeholder="请输入内容" disabled/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="班次编码" prop="shiftId" v-if="false">
<el-input v-model="form.shiftId" placeholder="请输入班次编码" />
</el-form-item>
<el-form-item label="班次名称" prop="shiftName">
<el-input v-model="form.shiftName" placeholder="请输入班次名称" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="单位" prop="unit"> <el-form-item label="排产数量" prop="quantity">
<el-input v-model="form.unit" placeholder="请输入单位" /> <el-input v-model="form.quantity" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="线体编码" prop="machineCode"> <el-form-item label="单位" prop="unit">
<el-input v-model="form.machineCode" placeholder="请输入线体编码" /> <el-input v-model="form.unit" placeholder="请输入单位" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="线体名称" prop="machineName"> <el-form-item label="线体名称" prop="machineName">
<el-input v-model="form.machineName" placeholder="请输入线体名称" /> <el-input v-model="form.machineName" placeholder="请选择线体名称">
<el-button slot="append" @click="handleSelectEquip" icon="el-icon-search"></el-button>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="线体编码" prop="machineCode">
<el-input v-model="form.machineCode" placeholder="请输入线体编码" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="报工时间" prop="feedbackTime"> <el-form-item label="报工时间" prop="feedbackTime">
<el-date-picker clearable <el-date-picker clearable
v-model="form.feedbackTime" v-model="form.feedbackTime"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 180px" style="width: 180px"
placeholder="请选择报工时间"> placeholder="请选择报工时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="排产数量" prop="quantity">
<el-input-number
:min="0"
:step="1"
v-model="form.quantity"
style="width: 180px"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="本次报工数量" prop="quantityFeedback">
<el-input-number
:min="0"
:step="1"
v-model="form.quantityFeedback"
style="width: 180px"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合格数量" prop="quantityQualified">
<el-input-number
:min="0"
:step="1"
v-model="form.quantityQualified"
style="width: 180px"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="不合格数量" prop="quantityUnqualified">
<el-input-number
:min="0"
:step="1"
v-model="form.quantityUnqualified"
style="width: 180px"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="人员名称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入人员名称" />
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="录入人员" prop="recordUser"> <el-form-item label="本次报工数量" prop="quantityFeedback">
<el-input v-model="form.recordUser" placeholder="请输入录入人员" /> <el-input-number
</el-form-item> :min="0"
:step="1"
v-model="form.quantityFeedback"
style="width: 180px"
/>
</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">
<el-input v-model="form.teamCode" placeholder="请输入班组编码" /> <el-input v-model="form.teamCode" placeholder="请输入班组编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="班次编码" prop="shiftCode">
<el-input v-model="form.shiftCode" placeholder="请输入班次编码" />
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
@ -329,53 +321,48 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-divider content-position="center" v-if="form.reportCode !=null"></el-divider> <div v-if="optType =='reportConsume' || optType =='view'">
<ReportWorkConsume v-if="form.reportCode !=null" :optType="optType" :reportCode="form.reportCode"></ReportWorkConsume> <el-divider content-position="center" v-if="form.reportCode !=null"></el-divider>
<ReportWorkConsume :reportCode="form.reportCode"
:productCode="form.productCode"
:workorderCode="form.workorderCode"
></ReportWorkConsume>
</div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view'"></el-button> <el-button type="primary" @click="cancel" v-if="optType =='view'"></el-button>
<el-button type="primary" @click="submitForm" v-else></el-button> <el-button type="primary" @click="submitForm" v-else></el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--人员选择弹窗-->
<!-- 添加或修改生产报工物料消耗对话框 --> <ItemSelectUser
<el-dialog :title="title" :visible.sync="reportWorkConsunmOpen" width="1200px" append-to-body> ref="itemSelectUser"
<el-table v-loading="loading" :data="reportWorkConsumeList"> @onSelected="onSelectUser"
<el-table-column type="selection" width="100" align="center" /> ></ItemSelectUser>
<el-table-column label="报工编码" align="center" prop="reportCode" /> <!--工单选择弹窗-->
<el-table-column label="工单编码" align="center" prop="workorderCode" /> <ItemSelectWorkOrder
<el-table-column label="物料编号" align="center" prop="materialCode" /> ref="itemSelectWorkOrder"
<el-table-column label="物料名称" align="center" prop="materialName" /> @onSelected="onSelectWorkOrder"
<el-table-column label="物料规格型号" align="center" prop="materialSpc" /> ></ItemSelectWorkOrder>
<el-table-column label="数量" align="center" prop="quantity" /> <!--线体选择弹窗-->
<el-table-column label="单位" align="center" prop="unit" /> <ItemSelectEquip
<el-table-column label="备注" align="center" prop="remark" /> ref="itemSelectEquip"
<el-table-column label="预留字段1" align="center" prop="attr1" /> @onSelected="onSelectEquip"
<el-table-column label="预留字段2" align="center" prop="attr2" /> ></ItemSelectEquip>
<el-table-column label="预留字段3" align="center" prop="attr3" />
<el-table-column label="预留字段4" align="center" prop="attr4" />
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
</el-table>
<pagination
v-show="consumeTotal>0"
:total="consumeTotal"
:page.sync="consumeQueryParams.consumePageNum"
:limit.sync="consumeQueryParams.consumePageSize"
@pagination="getList"
/>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork } from "@/api/mes/reportWork"; import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork,reportSap } from "@/api/mes/reportWork";
import ReportWorkConsume from "./reportWorkConsume.vue"; import ReportWorkConsume from "./reportWorkConsume.vue";
import ItemSelectUser from "./selectUser.vue";
import ItemSelectWorkOrder from "./selectWorkOrder.vue";
import ItemSelectEquip from "./selectEquip.vue";
import moment from 'moment';
export default { export default {
name: "ReportWork", name: "ReportWork",
dicts: ['report_work_type','report_work_channel'], dicts: ['report_type'],
components: {ReportWorkConsume}, components: {ReportWorkConsume,ItemSelectUser,ItemSelectWorkOrder,ItemSelectEquip},
data() { data() {
return { return {
optType: undefined, optType: undefined,
@ -383,6 +370,7 @@ export default {
loading: true, loading: true,
// //
ids: [], ids: [],
selectRow:{},
// //
single: true, single: true,
// //
@ -399,14 +387,15 @@ export default {
title: "", title: "",
// //
open: false, open: false,
reportWorkConsunmOpen:false, consumeQueryParams:{
consumeQueryParams:{ consumePageNum:1,
consumePageNum:1, consumePageSize:10,
consumePageSize:10, reportCode:null,
reportCode:null, },
},
// //
queryParams: { queryParams: {
createTimeArray: [],
feedbackTimeArray: [],
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
reportType: null, reportType: null,
@ -430,7 +419,7 @@ export default {
machineCode: null, machineCode: null,
machineName: null, machineName: null,
teamCode: null, teamCode: null,
shiftCode: null, shiftId: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
@ -438,29 +427,62 @@ export default {
}, },
// //
form: {}, form: {},
uploadStatusList:[
{"dictLabel":"待报工","dictValue":"0"},
{"dictLabel":"报工成功","dictValue":"1"},
{"dictLabel":"报工失败","dictValue":"2"}
],
// //
rules: { rules: {
reportType: [ workorderCode:[
{ required: true, message: "报工类型报工类型SELF自行报工、UNI统一报工不能为空", trigger: "change" } { required: true, message: "本次报工工单不能为空", trigger: "blur" }
], ],
quantityFeedback: [ quantityFeedback: [
{ required: true, message: "本次报工数量不能为空", trigger: "blur" } { required: true, message: "本次报工数量不能为空", trigger: "blur" }
], ],
quantityQualified: [ feedbackTime: [
{ required: true, message: "合格数量不能为空", trigger: "blur" } { required: true, message: "本次报工时间不能为空", trigger: "blur" }
], ],
quantityUnqualified: [ machineName: [
{ required: true, message: "不合格数量不能为空", trigger: "blur" } { required: true, message: "本次报工线体不能为空", trigger: "blur" }
],
teamCode: [
{ required: true, message: "本次报工班组不能为空", trigger: "blur" }
], ],
} }
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDate();
}, },
methods: { methods: {
/**获取默认查询时间段**/
getDate() {
let start = this.Fungetdate (0)
let end = this.Fungetdate (1)
this.queryParams.createTimeArray.push(start,end)
//this.queryParams.feedbackTimeArray.push(start,end)
},
Fungetdate (num) {
var dd = new Date();
dd.setDate(dd.getDate() + num);
var y = dd.getFullYear();
var m = dd.getMonth() + 1;//
var d = dd.getDate();
return y + "-" + m + "-" + d+" 00:00:00";
},
/** 查询报工报表列表 */ /** 查询报工报表列表 */
getList() { getList() {
if(this.queryParams.createTimeArray !=null && this.queryParams.createTimeArray.length>0){
this.queryParams.createTimeStart = moment(this.queryParams.createTimeArray[0]).format('YYYY-MM-DD HH:mm:ss');
this.queryParams.createTimeEnd = moment(this.queryParams.createTimeArray[1]).format('YYYY-MM-DD HH:mm:ss');
}
if(this.queryParams.feedbackTimeArray !=null && this.queryParams.feedbackTimeArray.length>0){
this.queryParams.feedbackTimeStart = moment(this.queryParams.feedbackTimeArray[0]).format('YYYY-MM-DD 00:00:00');
this.queryParams.feedbackTimeEnd = moment(this.queryParams.feedbackTimeArray[1]).format('YYYY-MM-DD 00:00:00');
}
this.loading = true; this.loading = true;
listReportWork(this.queryParams).then(response => { listReportWork(this.queryParams).then(response => {
this.reportWorkList = response.rows; this.reportWorkList = response.rows;
@ -488,7 +510,7 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
reportType: null, reportType: 'UNI',
reportCode: null, reportCode: null,
workorderCode: null, workorderCode: null,
productCode: null, productCode: null,
@ -501,7 +523,7 @@ export default {
quantityUnqualified: null, quantityUnqualified: null,
userName: null, userName: null,
nickName: null, nickName: null,
feedbackChannel: null, feedbackChannel: 'PC',
feedbackTime: null, feedbackTime: null,
recordUser: null, recordUser: null,
status: null, status: null,
@ -510,7 +532,7 @@ export default {
machineCode: null, machineCode: null,
machineName: null, machineName: null,
teamCode: null, teamCode: null,
shiftCode: null, shiftId: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
@ -535,6 +557,7 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.selectRow = selection
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
@ -548,6 +571,13 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.optType = "edit";
let sr = this.selectRow[0];
if(sr.uploadStatus =='sap报工成功'){
this.$modal.msgError(`上传sap成功,不允许修改`);
return
}
const id = row.id || this.ids const id = row.id || this.ids
getReportWork(id).then(response => { getReportWork(id).then(response => {
this.form = response.data; this.form = response.data;
@ -577,6 +607,13 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
let sr = this.selectRow[0];
if(sr.uploadStatus =='sap报工成功'){
this.$modal.msgError(`上传sap成功,不允许删除`);
return
}
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报工报表编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除报工报表编号为"' + ids + '"的数据项?').then(function() {
return delReportWork(ids); return delReportWork(ids);
@ -585,12 +622,70 @@ export default {
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
}, },
/** 报工按钮操作 */
handleReport(row) {
let sr = this.selectRow[0];
const code = sr.reportCode;
this.$modal.confirm('是否确认报工报表编号为"' + code + '"的数据项向sap报工').then(function() {
return reportSap(code);
}).then(() => {
this.getList();
this.$modal.msgSuccess("报工成功");
}).catch(() => {});
},
/** 物料损耗按钮操作 */
handleReportConsume(row) {
this.reset();
this.optType = "reportConsume";
let sr = this.selectRow[0];
const id = row.id || this.ids
getReportWork(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "工单物料损耗";
});
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('mes/reportWork/export', { this.download('mes/reportWork/export', {
...this.queryParams ...this.queryParams
}, `reportWork_${new Date().getTime()}.xlsx`) }, `reportWork_${new Date().getTime()}.xlsx`)
} },
/**人员选择弹出框**/
handleSelectUser() {
this.$refs.itemSelectUser.showFlag = true;
},
//
onSelectUser(obj) {
debugger
this.form.userName = obj.code;
this.form.nickName = obj.name;
},
/**工单选择弹出框**/
handleSelectWorkOrder() {
this.$refs.itemSelectWorkOrder.showFlag = true;
},
//
onSelectWorkOrder(obj) {
this.form.workorderCode = obj.workorderCode;
this.form.productName = obj.productName;
this.form.productCode = obj.productCode;
this.form.productSpc = obj.productSpc;
this.form.quantity = obj.quantitySplit;
this.form.unit = obj.unit;
this.form.shiftId = obj.shiftId;
this.form.shiftName = obj.shiftName;
},
/**线体选择弹出框**/
handleSelectEquip() {
this.$refs.itemSelectEquip.showFlag = true;
},
//线
onSelectEquip(obj) {
this.form.machineCode = obj.equipmentCode;
this.form.machineName = obj.equipmentName;
},
} }
}; };
</script> </script>

@ -8,7 +8,6 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mes:reportWorkConsume:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -19,7 +18,6 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['mes:reportWorkConsume:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -30,9 +28,9 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['mes:reportWorkConsume:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<!--
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@ -40,9 +38,8 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['mes:reportWorkConsume:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -51,11 +48,9 @@
<el-table-column label="工单编码" align="center" prop="workorderCode" width="200"/> <el-table-column label="工单编码" align="center" prop="workorderCode" width="200"/>
<el-table-column label="物料编号" align="center" prop="materialCode" width="200"/> <el-table-column label="物料编号" align="center" prop="materialCode" width="200"/>
<el-table-column label="物料名称" align="center" prop="materialName" width="200"/> <el-table-column label="物料名称" align="center" prop="materialName" width="200"/>
<el-table-column label="物料规格型号" align="center" prop="materialSpc" width="200"/> <el-table-column label="物料规格型号" align="center" prop="materialSpc" width="200" v-if="false"/>
<el-table-column label="数量" align="center" prop="quantity" /> <el-table-column label="数量" align="center" prop="quantity" />
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
<el-table-column label="操作" v-if="optType !='view'" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" v-if="optType !='view'" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -63,14 +58,12 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:reportWorkConsume:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['mes:reportWorkConsume:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -87,44 +80,58 @@
<!-- 添加或修改生产报工物料消耗对话框 --> <!-- 添加或修改生产报工物料消耗对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="工单编码" prop="workorderCode"> <el-form-item label="工单号" prop="workorderCode">
<el-input v-model="form.workorderCode" placeholder="请输入工单编码" /> <el-input v-model="form.workorderCode" placeholder="请输入物料编号" disabled/>
</el-form-item>
<el-form-item label="物料编号" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料编号" />
</el-form-item> </el-form-item>
<el-form-item label="物料名称" prop="materialName"> <el-form-item label="报工单号" prop="reportCode">
<el-input v-model="form.materialName" placeholder="请输入物料名称" /> <el-input v-model="form.reportCode" placeholder="请输入物料编号" disabled/>
</el-form-item> </el-form-item>
<el-form-item label="物料规格型号" prop="materialSpc"> <el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialSpc" placeholder="请输入物料规格型号" /> <el-input v-model="form.materialName" placeholder="请选择物料名称">
<el-button slot="append" @click="handleSelectMaterial" icon="el-icon-search"></el-button>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="quantity"> <el-form-item label="物料编号" prop="materialCode">
<el-input v-model="form.quantity" placeholder="请输入数量" /> <el-input v-model="form.materialCode" placeholder="请输入物料编号" disabled/>
</el-form-item> </el-form-item>
<!--
<el-form-item label="规格型号" prop="materialSpc">
<el-input v-model="form.materialSpc" placeholder="请输入物料规格型号" disabled/>
</el-form-item>-->
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" /> <el-select v-model="form.unit" placeholder="请选择单位" width="100%">
</el-form-item> <el-option
<el-form-item label="备注" prop="remark"> v-for="dict in dict.type.unit"
<el-input v-model="form.remark" placeholder="请输入备注" /> :key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="工厂编码" prop="factoryCode"> <el-form-item label="数量" prop="quantity">
<el-input v-model="form.factoryCode" placeholder="请输入工厂编码" /> <el-input type="number" v-model="form.quantity" placeholder="请输入数量" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<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"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
<!--物料选择弹窗-->
<ItemSelectMaterail
ref="itemSelectMaterial"
@onSelected="onSelectMaterial"
></ItemSelectMaterail>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listReportWorkConsume, getReportWorkConsume, delReportWorkConsume, addReportWorkConsume, updateReportWorkConsume } from "@/api/mes/reportWorkConsume"; import { listReportWorkConsume, getReportWorkConsume, delReportWorkConsume, addReportWorkConsume, updateReportWorkConsume } from "@/api/mes/reportWorkConsume";
import ItemSelectMaterail from "./selectMaterial.vue";
export default { export default {
name: "ReportWorkConsume", name: "ReportWorkConsume",
dicts: ["unit"],
components: {ItemSelectMaterail},
data() { data() {
return { return {
// //
@ -160,7 +167,8 @@ export default {
attr3: null, attr3: null,
attr4: null, attr4: null,
factoryCode: null, factoryCode: null,
reportCode :this.reportCode reportCode :this.reportCode,
productCode: this.productCode
}, },
// //
form: {}, form: {},
@ -182,8 +190,10 @@ export default {
}; };
}, },
props: { props: {
reportCode: null, workorderCode:null,
optType: undefined, productCode:null,
reportCode: null,
optType: undefined,
}, },
created() { created() {
this.getList(); this.getList();
@ -225,7 +235,9 @@ export default {
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
factoryCode: null, factoryCode: null,
reportCode: this.reportCode reportCode: this.reportCode,
productCode: this.productCode,
workorderCode: this.workorderCode
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -296,7 +308,18 @@ export default {
this.download('mes/reportWorkConsume/export', { this.download('mes/reportWorkConsume/export', {
...this.queryParams ...this.queryParams
}, `reportWorkConsume_${new Date().getTime()}.xlsx`) }, `reportWorkConsume_${new Date().getTime()}.xlsx`)
} },
/**物料选择弹出框**/
handleSelectMaterial() {
this.$refs.itemSelectMaterial.showFlag = true;
this.$refs.itemSelectMaterial.init(this.productCode);
},
//
onSelectMaterial(obj) {
this.form.materialCode = obj.component;
this.form.materialName = obj.componentName;
this.form.unit = obj.unit;
},
} }
}; };
</script> </script>

@ -0,0 +1,140 @@
<template>
<el-dialog title="线体选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center">
<el-form-item label="线体编码">
<el-input
v-model="queryParams.userCode"
placeholder="线体"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="线体名称">
<el-input
v-model="queryParams.userName"
placeholder="线体名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
<el-table-column width="50" align="center" type="selection"/>
<el-table-column label="线体编码" align="left" prop="equipmentCode" :show-overflow-tooltip="true" />
<el-table-column label="线体名称" align="left" prop="equipmentName" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getMesListEquip } from "@/api/mes/reportWork";
export default {
name: "itemSelectUser",
data() {
return {
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// BOM
itemList: null,
//
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
userCode: '',
userName : ''
}
};
},
created() {
this.getList();
},
methods: {
/** 查询表格列表*/
getList() {
this.loading = true;
getMesListEquip(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleBomSelectionChange(selection) {
if(selection.length>1){
this.$modal.msgSuccess("只能选一个");
}
this.selectionRow = selection[0]
},
submitBomForm() {
this.$emit('onSelected', this.selectionRow);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
}
}
};
</script>

@ -0,0 +1,158 @@
<template>
<el-dialog title="物料选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px" align="left">
<el-form-item label="物料编码">
<el-input
v-model="queryParams.component"
placeholder="物料编码"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称">
<el-input
v-model="queryParams.componentName"
placeholder="物料名称"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料组名称">
<el-input
v-model="queryParams.productGroupName"
placeholder="物料组名称"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column label="物料编码" align="left" prop="component" :show-overflow-tooltip="true" />
<el-table-column label="物料名称" align="left" prop="componentName" :show-overflow-tooltip="true" />
<el-table-column label="物料单位" align="left" prop="unit" :show-overflow-tooltip="true" />
<el-table-column label="物料组" align="left" prop="productGroup" :show-overflow-tooltip="true" />
<el-table-column label="物料组名称" align="left" prop="productGroupName" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getMesListBom } from "@/api/mes/reportWork";
export default {
name: "itemSelectMaterial",
data() {
return {
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// BOM
itemList: null,
//
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
productCode: '',
component : '',
componentName : '',
productGroupName:''
},
selectionRow:{}
};
},
created() {
//this.getList();
},
methods: {
init(productCode){
this.queryParams.productCode = productCode;
this.getList();
},
/** 查询表格列表*/
getList() {
this.loading = true;
getMesListBom(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleBomSelectionChange(selection) {
if(selection.length>1){
this.$modal.msgSuccess("只能选一个");
}
this.selectionRow = selection[0]
},
submitBomForm() {
this.$emit('onSelected', this.selectionRow);
this.showFlag = false;
},
}
};
</script>

@ -0,0 +1,147 @@
<template>
<el-dialog title="人员选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center">
<el-form-item label="员工工号">
<el-input
v-model="queryParams.userCode"
placeholder="员工工号"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="员工姓名">
<el-input
v-model="queryParams.userName"
placeholder="员工姓名"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column label="员工ID" align="left" key="userId" prop="userId" :show-overflow-tooltip="true" />
<el-table-column label="员工工号" align="left" key="userCode" prop="userCode" :show-overflow-tooltip="true" />
<el-table-column label="员工姓名" align="left" key="userName" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="手机号" align="left" key="phonenumber" prop="phonenumber" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getMesListUser } from "@/api/mes/reportWork";
export default {
name: "itemSelectUser",
data() {
return {
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// BOM
itemList: null,
//
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
userCode: '',
userName : ''
}
};
},
created() {
this.getList();
},
methods: {
/** 查询表格列表*/
getList() {
this.loading = true;
getMesListUser(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleBomSelectionChange(selection) {
if(selection.length>1){
this.$modal.msgSuccess("只能选一个");
}
this.ids = selection[0].userCode;
this.idsName = selection[0].userName;
},
submitBomForm() {
this.selectedRows.code = this.ids;
this.selectedRows.name = this.idsName;
this.$emit('onSelected', this.selectedRows);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
}
}
};
</script>

@ -0,0 +1,141 @@
<template>
<el-dialog title="工单选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="left">
<el-form-item label="工单编号">
<el-input
v-model="queryParams.workorderCode"
placeholder="工单编号"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
<el-table-column width="50" align="center" type="selection"/>
<el-table-column label="生产日期" align="left" prop="productDate" width="100"/>
<el-table-column label="工单编号" align="left" prop="workorderCode" width="150"/>
<el-table-column label="订单编号" align="left" prop="orderCode" width="120"/>
<el-table-column label="产品编码" align="left" prop="productCode" width="180" />
<el-table-column label="产品名称" align="left" prop="productName" width="180"/>
<el-table-column label="规格型号" align="left" prop="productSpc" :show-overflow-tooltip="true" />
<el-table-column label="计划生产数量" align="left" prop="quantitySplit" width="100" />
<el-table-column label="单位" align="left" prop="unit" :show-overflow-tooltip="true" />
<el-table-column label="班次ID" align="left" prop="shiftId" :show-overflow-tooltip="true" v-if="false"/>
<el-table-column label="班次名称" align="left" prop="shiftName" :show-overflow-tooltip="true" />
<el-table-column label="生产线体" align="left" prop="prodLineCode" :show-overflow-tooltip="true" width="100"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getMesListWorkOrder } from "@/api/mes/reportWork";
export default {
name: "itemSelectWorkOrder",
data() {
return {
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// BOM
itemList: null,
//
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
workorderCode: ''
},
selectionRow:{}
};
},
created() {
this.getList();
},
methods: {
/** 查询表格列表*/
getList() {
this.loading = true;
getMesListWorkOrder(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleBomSelectionChange(selection) {
if(selection.length>1){
this.$modal.msgSuccess("只能选一个");
}
this.selectionRow = selection[0]
},
submitBomForm() {
this.$emit('onSelected', this.selectionRow);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
}
}
};
</script>

@ -1053,7 +1053,7 @@ export default {
changeRoute(routeCode) { changeRoute(routeCode) {
// //
getProEquipment(routeCode).then(response => { getProEquipment(routeCode).then(response => {
debugger
// //
this.converCarNum = null; this.converCarNum = null;

@ -759,7 +759,6 @@ export default {
}).then(() => { }).then(() => {
this.loading = false; this.loading = false;
this.getList(); this.getList();
this.$modal.msgSuccess("下发成功");
}).catch( }).catch(
function (e) { function (e) {
if (e == 'cancel') { if (e == 'cancel') {

@ -9,7 +9,7 @@
<!--BOM数据--> <!--BOM数据-->
<el-col :span="24" :xs="24"> <el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center">
<el-form-item label="BOM物料编码" prop="itemCode"> <el-form-item label="物料编码" prop="itemCode">
<el-input <el-input
v-model="queryParams.component" v-model="queryParams.component"
placeholder="请输入物料编码" placeholder="请输入物料编码"
@ -18,7 +18,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="产品名称" prop="itemName"> <el-form-item label="物料名称" prop="itemName">
<el-input <el-input
v-model="queryParams.componentName" v-model="queryParams.componentName"
placeholder="请输入物料名称" placeholder="请输入物料名称"

@ -152,12 +152,6 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!--
<el-col :span="12">
<el-form-item label="材料URL" prop="docUrl">
<el-input v-model="form.docUrl" placeholder="请输入材料URL" />
</el-form-item>
</el-col>-->
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">

Loading…
Cancel
Save