|
|
|
@ -7,72 +7,65 @@
|
|
|
|
|
<div class="chart">
|
|
|
|
|
<div class="whiteTable">
|
|
|
|
|
<el-table
|
|
|
|
|
:cell-style="{textAlign:'center'}"
|
|
|
|
|
:data="tableData"
|
|
|
|
|
:header-cell-style="{textAlign:'center'}"
|
|
|
|
|
:max-height="19.13 * vw"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:cell-style="{textAlign:'center'}"
|
|
|
|
|
:data="tableData"
|
|
|
|
|
:header-cell-style="{textAlign:'center'}"
|
|
|
|
|
:max-height="19.13 * vw"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="序号"
|
|
|
|
|
type="index"
|
|
|
|
|
width="50"
|
|
|
|
|
label="序号"
|
|
|
|
|
type="index"
|
|
|
|
|
width="50"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="工单编号"
|
|
|
|
|
prop="planCode"
|
|
|
|
|
label="工单编号"
|
|
|
|
|
prop="planCode"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="物料名称"
|
|
|
|
|
prop="materialName"
|
|
|
|
|
width="100"
|
|
|
|
|
label="物料名称"
|
|
|
|
|
prop="materialName"
|
|
|
|
|
width="100"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="计划"
|
|
|
|
|
prop="planAmount"
|
|
|
|
|
width="100"
|
|
|
|
|
label="计划"
|
|
|
|
|
prop="planAmount"
|
|
|
|
|
width="100"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="实际"
|
|
|
|
|
prop="completeAmount"
|
|
|
|
|
width="100"
|
|
|
|
|
label="实际"
|
|
|
|
|
prop="completeAmount"
|
|
|
|
|
width="100"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="差异"
|
|
|
|
|
prop="difference"
|
|
|
|
|
width="100"
|
|
|
|
|
label="差异"
|
|
|
|
|
prop="difference"
|
|
|
|
|
width="100"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ scope.row.planAmount - scope.row.completeAmount }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="交付时间"
|
|
|
|
|
prop="planDeliveryDate"
|
|
|
|
|
width="150"
|
|
|
|
|
label="交付时间"
|
|
|
|
|
prop="planDeliveryDate"
|
|
|
|
|
width="150"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
width="120"
|
|
|
|
|
label="操作"
|
|
|
|
|
width="120"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="print(scope.row)"
|
|
|
|
|
>
|
|
|
|
|
条码打印
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="getDetail(scope)"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="getDetail(scope)"
|
|
|
|
|
>
|
|
|
|
|
明细
|
|
|
|
|
</el-button>
|
|
|
|
@ -103,86 +96,97 @@
|
|
|
|
|
<div class="chart">
|
|
|
|
|
<div class="whiteTable">
|
|
|
|
|
<el-table
|
|
|
|
|
:cell-style="{textAlign:'center'}"
|
|
|
|
|
:data="tableData1"
|
|
|
|
|
:header-cell-style="{textAlign:'center'}"
|
|
|
|
|
:max-height="19.13 * vw"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:cell-style="{textAlign:'center'}"
|
|
|
|
|
:data="tableData1"
|
|
|
|
|
:header-cell-style="{textAlign:'center'}"
|
|
|
|
|
:max-height="19.13 * vw"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="序号"
|
|
|
|
|
type="index"
|
|
|
|
|
width="50"
|
|
|
|
|
label="序号"
|
|
|
|
|
type="index"
|
|
|
|
|
width="50"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="工单编号"
|
|
|
|
|
prop="planCode"
|
|
|
|
|
width="80"
|
|
|
|
|
label="工单编号"
|
|
|
|
|
prop="planCode"
|
|
|
|
|
width="80"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="明细编号"
|
|
|
|
|
prop="planDetailCode"
|
|
|
|
|
label="明细编号"
|
|
|
|
|
prop="planDetailCode"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="开始时间"
|
|
|
|
|
prop="realBeginTime"
|
|
|
|
|
width="120"
|
|
|
|
|
label="开始时间"
|
|
|
|
|
prop="realBeginTime"
|
|
|
|
|
width="120"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="结束时间"
|
|
|
|
|
prop="realEndTime"
|
|
|
|
|
width="120"
|
|
|
|
|
label="结束时间"
|
|
|
|
|
prop="realEndTime"
|
|
|
|
|
width="120"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="状态"
|
|
|
|
|
prop="createTime"
|
|
|
|
|
width="80"
|
|
|
|
|
label="状态"
|
|
|
|
|
prop="createTime"
|
|
|
|
|
width="80"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.mes_plan_detail_status" :value="scope.row.planDetailStatus"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
width="160"
|
|
|
|
|
label="操作"
|
|
|
|
|
width="160"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="scope.row.planDetailStatus !== '3' && scope.row.planDetailStatus !== '9'"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="planExecute(scope.row)"
|
|
|
|
|
v-if="scope.row.planDetailStatus !== '3' && scope.row.planDetailStatus !== '9'"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="planExecute(scope.row)"
|
|
|
|
|
>
|
|
|
|
|
{{ scope.row.planDetailStatus === '1' ? '开始' : '完成' }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="scope.row.planDetailStatus !== '3' && scope.row.planDetailStatus !== '9'"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="getMaterials(scope) "
|
|
|
|
|
v-if="scope.row.planDetailStatus !== '3' && scope.row.planDetailStatus !== '9'"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="getMaterials(scope) "
|
|
|
|
|
>
|
|
|
|
|
领料
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
@click="handleMaterialConfirmForm(scope)"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="handleMaterialConfirmForm(scope)"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
|
|
|
|
|
>
|
|
|
|
|
扫描
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="returnMaterial(scope)"
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="returnMaterial(scope)"
|
|
|
|
|
v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START"
|
|
|
|
|
>
|
|
|
|
|
退料
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="small"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="print(scope.row)"
|
|
|
|
|
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.FINISHED || scope.row.planDetailStatus === PLAN_DETAIL_STATUS.ABNORMAL_FINISHED"
|
|
|
|
|
>
|
|
|
|
|
条码
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -209,16 +213,16 @@
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-button type="primary">首页</el-button>
|
|
|
|
|
<el-button type="success" @click="handleProductInstock">成品入库</el-button>
|
|
|
|
|
<el-button type="warning" @click="connectSerial">连接条码枪</el-button>
|
|
|
|
|
<!--el-button type="warning" @click="connectSerialPort" ref="connectSerialBtn">连接条码枪</el-button-->
|
|
|
|
|
<!--el-button type="info">最小化</el-button-->
|
|
|
|
|
<el-button type="danger" @click="logout">退出</el-button>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="dialogVisible"
|
|
|
|
|
title="领料"
|
|
|
|
|
width="40%">
|
|
|
|
|
:visible.sync="dialogVisible"
|
|
|
|
|
title="领料"
|
|
|
|
|
width="40%">
|
|
|
|
|
<el-form ref="form" :model="form" label-width="80px">
|
|
|
|
|
<el-form-item label="工单编号">
|
|
|
|
|
<el-input v-model="form.planCode" disabled></el-input>
|
|
|
|
@ -237,65 +241,65 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-table
|
|
|
|
|
:cell-style="{textAlign:'center'}"
|
|
|
|
|
:data="form.wmsRawOutstockDetailList"
|
|
|
|
|
:header-cell-style="{textAlign:'center'}"
|
|
|
|
|
max-height="19.13vw"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:cell-style="{textAlign:'center'}"
|
|
|
|
|
:data="form.wmsRawOutstockDetailList"
|
|
|
|
|
:header-cell-style="{textAlign:'center'}"
|
|
|
|
|
max-height="19.13vw"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="物料编号"
|
|
|
|
|
prop="materialCode"
|
|
|
|
|
label="物料编号"
|
|
|
|
|
prop="materialCode"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="物料名称"
|
|
|
|
|
prop="materialName"
|
|
|
|
|
label="物料名称"
|
|
|
|
|
prop="materialName"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="安全库存"
|
|
|
|
|
prop="safeFlag"
|
|
|
|
|
label="安全库存"
|
|
|
|
|
prop="safeFlag"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.mes_safe_flag" :value="scope.row.safeFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="可用库存数量"
|
|
|
|
|
prop="availableAmount"
|
|
|
|
|
label="可用库存数量"
|
|
|
|
|
prop="availableAmount"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="占用库存数量"
|
|
|
|
|
prop="unavailableAmount"
|
|
|
|
|
label="占用库存数量"
|
|
|
|
|
prop="unavailableAmount"
|
|
|
|
|
>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="领取数量"
|
|
|
|
|
prop="planAmount"
|
|
|
|
|
width="120"
|
|
|
|
|
label="领取数量"
|
|
|
|
|
prop="planAmount"
|
|
|
|
|
width="120"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input-number
|
|
|
|
|
v-model="scope.row.planAmount"
|
|
|
|
|
:min="0"
|
|
|
|
|
controls-position="right"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
v-model="scope.row.planAmount"
|
|
|
|
|
:min="0"
|
|
|
|
|
controls-position="right"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
</el-input-number>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
width="160"
|
|
|
|
|
label="操作"
|
|
|
|
|
width="160"
|
|
|
|
|
>
|
|
|
|
|
<template slot="header" slot-scope="scope">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="searchMaterialValue"
|
|
|
|
|
placeholder="输入物料名称搜索"
|
|
|
|
|
size="mini"
|
|
|
|
|
@change="searchMaterial"/>
|
|
|
|
|
v-model="searchMaterialValue"
|
|
|
|
|
placeholder="输入物料名称搜索"
|
|
|
|
|
size="mini"
|
|
|
|
|
@change="searchMaterial"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -306,8 +310,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :visible.sync="printModel" title="条码打印" width="80%" class="dialog">
|
|
|
|
|
<div >
|
|
|
|
|
<PrintPage :defineData="PrintData" />
|
|
|
|
|
<div>
|
|
|
|
|
<PrintPage :defineData="PrintData"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="printModel = false">关闭</el-button>
|
|
|
|
@ -316,9 +320,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="productInstockVisible"
|
|
|
|
|
title="成品入库"
|
|
|
|
|
width="40%">
|
|
|
|
|
:visible.sync="productInstockVisible"
|
|
|
|
|
title="成品入库"
|
|
|
|
|
width="40%">
|
|
|
|
|
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="80px">
|
|
|
|
|
<el-form-item label="成品条码" prop="materialBarcode">
|
|
|
|
|
<el-input v-model="productInstockForm.materialBarcode"></el-input>
|
|
|
|
@ -332,21 +336,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="materialConfirmVisible"
|
|
|
|
|
title="确认物料使用"
|
|
|
|
|
width="40%">
|
|
|
|
|
:visible.sync="materialConfirmVisible"
|
|
|
|
|
title="确认物料使用"
|
|
|
|
|
width="40%">
|
|
|
|
|
<el-form ref="materialConfirmForm" :model="materialConfirmForm" :rules="materialConfirmRules" label-width="80px">
|
|
|
|
|
<el-form-item label="计划ID" prop="planId" v-if="false">
|
|
|
|
|
<el-input v-model="materialConfirmForm.planId"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="明细ID" prop="planDetailId" v-if="false">
|
|
|
|
|
<el-input v-model="materialConfirmForm.planDetailId"></el-input>
|
|
|
|
|
<el-form-item label="明细编号" prop="planDetailCode">
|
|
|
|
|
<el-input v-model="materialConfirmForm.planDetailCode" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料条码" prop="materialBarcode">
|
|
|
|
|
<el-input v-model="materialConfirmForm.materialBarcode"></el-input>
|
|
|
|
|
<el-input v-model="materialConfirmForm.materialBarcode" suffix-icon="el-icon-scan"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="数量" prop="checkAmount">
|
|
|
|
|
<el-input v-model="materialConfirmForm.checkAmount"></el-input>
|
|
|
|
|
<el-input v-model="materialConfirmForm.checkAmount" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
@ -356,34 +360,37 @@
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog :visible.sync="returnModelVisible" title="退料" width="25%">
|
|
|
|
|
<el-form ref="returnModelForm" :model="returnModelForm" label-width="80px" :rules="returnModelFormRules">
|
|
|
|
|
<el-form-item label="计划编号" >
|
|
|
|
|
<el-form-item label="计划编号">
|
|
|
|
|
<el-input v-model="returnModelForm.planCode" autocomplete="off" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="明细编号" >
|
|
|
|
|
<el-form-item label="明细编号">
|
|
|
|
|
<el-input v-model="returnModelForm.planDetailCode" autocomplete="off" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="成品" >
|
|
|
|
|
<el-form-item label="成品">
|
|
|
|
|
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料条码" >
|
|
|
|
|
<el-input placeholder="请输入内容" v-model="returnModelForm.materialBarcode" class="input-with-select" @blur="setReturnModelForm">
|
|
|
|
|
<el-form-item label="物料条码">
|
|
|
|
|
<el-input placeholder="请输入内容" v-model="returnModelForm.materialBarcode" class="input-with-select"
|
|
|
|
|
@blur="setReturnModelForm">
|
|
|
|
|
<el-button slot="append" icon="el-icon-search"></el-button>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="仓库" >
|
|
|
|
|
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode">
|
|
|
|
|
<el-form-item label="仓库">
|
|
|
|
|
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库"
|
|
|
|
|
:disabled="!returnModelForm.materialBarcode">
|
|
|
|
|
<el-option :label="i.label" :key="i.value" :value="i.value" v-for="i in WarehousesList"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="数量" >
|
|
|
|
|
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1" ></el-input-number>
|
|
|
|
|
<el-form-item label="数量">
|
|
|
|
|
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1"></el-input-number>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="退库类型" prop="taskType">
|
|
|
|
|
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型">
|
|
|
|
|
<el-option :label="i.label" :key="i.value" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option>
|
|
|
|
|
<el-option :label="i.label" :key="i.value" :value="i.value"
|
|
|
|
|
v-for="i in dict.type.wms_raw_return_task_type"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="申请原因" >
|
|
|
|
|
<el-form-item label="申请原因">
|
|
|
|
|
<el-input type="textarea" v-model="returnModelForm.applyReason" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
@ -410,29 +417,29 @@ import {
|
|
|
|
|
fourthFloorProduceInstock,
|
|
|
|
|
scanMaterial2Confirm, applyRawReturn
|
|
|
|
|
} from "@/api/board";
|
|
|
|
|
import {monitorSerialData} from "@/utils/serial"
|
|
|
|
|
|
|
|
|
|
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
|
|
|
|
|
export default {
|
|
|
|
|
name: 'Board1',
|
|
|
|
|
dicts: ['mes_plan_detail_status','wms_raw_return_task_type','mes_safe_flag'],
|
|
|
|
|
dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', 'mes_safe_flag'],
|
|
|
|
|
mixins: [monitorSerialData],
|
|
|
|
|
components: {
|
|
|
|
|
Chart,
|
|
|
|
|
PrintPage
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
serialPort: null,
|
|
|
|
|
reader: null,
|
|
|
|
|
lastScannedBarcode: '',
|
|
|
|
|
decoder: new TextDecoder(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// serialPort: null,
|
|
|
|
|
// reader: null,
|
|
|
|
|
// decoder: new TextDecoder(),
|
|
|
|
|
// barcode: '',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
returnModelVisible: false,
|
|
|
|
|
returnModelForm:{},
|
|
|
|
|
WarehousesList:[],
|
|
|
|
|
PrintData:{},
|
|
|
|
|
returnModelForm: {},
|
|
|
|
|
WarehousesList: [],
|
|
|
|
|
PrintData: {},
|
|
|
|
|
printModel: false,
|
|
|
|
|
nowNum1: 1,
|
|
|
|
|
totalNum1: 0,
|
|
|
|
@ -454,7 +461,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
productInstockRules: {
|
|
|
|
|
materialBarcode: [
|
|
|
|
|
{ required: true, message: "成品条码不能为空", trigger: "blur" }
|
|
|
|
|
{required: true, message: "成品条码不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -462,26 +469,39 @@ export default {
|
|
|
|
|
materialConfirmForm: {
|
|
|
|
|
materialBarcode: null,
|
|
|
|
|
planId: null,
|
|
|
|
|
planDetailId:null,
|
|
|
|
|
checkAmount:null
|
|
|
|
|
planDetailId: null,
|
|
|
|
|
planDetailCode: null,
|
|
|
|
|
checkAmount: 1
|
|
|
|
|
},
|
|
|
|
|
materialConfirmRules: {
|
|
|
|
|
materialBarcode: [
|
|
|
|
|
{ required: true, message: "物料条码不能为空", trigger: "blur" }
|
|
|
|
|
{required: true, message: "物料条码不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
checkAmount: [
|
|
|
|
|
{ required: true, message: "数量不能为空", trigger: "blur" }
|
|
|
|
|
{required: true, message: "数量不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
returnModelFormRules: {
|
|
|
|
|
taskType: [
|
|
|
|
|
{ required: true, message: '请选择退库类型', trigger: 'change' }
|
|
|
|
|
{required: true, message: '请选择退库类型', trigger: 'change'}
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
PLAN_DETAIL_STATUS:{
|
|
|
|
|
TO_START : '1',
|
|
|
|
|
STARTED : '2',
|
|
|
|
|
FINISHED : '3',
|
|
|
|
|
ABNORMAL_FINISHED : '9'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
this.firstConnectSerial();
|
|
|
|
|
// setInterval(() => {
|
|
|
|
|
// this.$notify.info({
|
|
|
|
|
// title: '通知',
|
|
|
|
@ -676,56 +696,63 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
checkPortConnection(){
|
|
|
|
|
checkPortConnection(portName).then((isConnected) => {
|
|
|
|
|
if (isConnected) {
|
|
|
|
|
console.log('串口已连接并可用.');
|
|
|
|
|
} else {
|
|
|
|
|
console.log('串口未连接或不可用.');
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.error('检查串口连接时发生错误:', error);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async connectSerial() {
|
|
|
|
|
try {
|
|
|
|
|
// 请求串口访问权限
|
|
|
|
|
this.serialPort = await navigator.serial.requestPort();
|
|
|
|
|
await this.serialPort.open({ baudRate: 9600 }); // 假设条码枪的波特率为9600
|
|
|
|
|
|
|
|
|
|
// 设置数据流解码
|
|
|
|
|
this.decoder = new TextDecoderStream();
|
|
|
|
|
const readableStreamClosed = this.serialPort.readable.pipeTo(this.decoder.writable);
|
|
|
|
|
this.reader = this.decoder.readable.getReader();
|
|
|
|
|
|
|
|
|
|
// 监听串口数据
|
|
|
|
|
while (true) {
|
|
|
|
|
const { value, done } = await this.reader.read();
|
|
|
|
|
if (done) {
|
|
|
|
|
this.reader.releaseLock();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// console.log("---"+value);
|
|
|
|
|
// const data = this.decoder.decode(value);
|
|
|
|
|
this.processReceivedData(value);
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('连接或读取串口时发生错误:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
processReceivedData(data) {
|
|
|
|
|
// 假设条码数据以回车符或换行符结束
|
|
|
|
|
const barcodeEnd = /\r|\n/;
|
|
|
|
|
if (barcodeEnd.test(data)) {
|
|
|
|
|
const barcode = data.split(barcodeEnd)[0].trim(); // 获取并清理条码数据
|
|
|
|
|
this.lastScannedBarcode = barcode; // 更新最后一次扫描的条码
|
|
|
|
|
console.log('扫描到的条码:', barcode);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// triggerButtonClick() {
|
|
|
|
|
// // 确保DOM已更新
|
|
|
|
|
// this.$nextTick(() => {
|
|
|
|
|
// if (this.$refs.connectSerialBtn) {
|
|
|
|
|
// // 直接调用DOM元素的click方法
|
|
|
|
|
// this.$refs.connectSerialBtn.handleClick();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
// async connectSerial() {
|
|
|
|
|
// this.checkPortConnection();
|
|
|
|
|
// try {
|
|
|
|
|
// // 请求串口访问权限
|
|
|
|
|
// this.serialPort = await navigator.serial.requestPort();
|
|
|
|
|
// await this.serialPort.open({baudRate: 9600}); // 假设条码枪的波特率为9600
|
|
|
|
|
//
|
|
|
|
|
// // 设置数据流解码
|
|
|
|
|
// this.decoder = new TextDecoderStream();
|
|
|
|
|
// const readableStreamClosed = this.serialPort.readable.pipeTo(this.decoder.writable);
|
|
|
|
|
// this.reader = this.decoder.readable.getReader();
|
|
|
|
|
//
|
|
|
|
|
// // 监听串口数据
|
|
|
|
|
// while (true) {
|
|
|
|
|
// const {value, done} = await this.reader.read();
|
|
|
|
|
// if (done) {
|
|
|
|
|
// this.reader.releaseLock();
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // console.log("---v" + value);
|
|
|
|
|
// // console.log("---d:" + done);
|
|
|
|
|
// // const data = this.decoder.decode(value);
|
|
|
|
|
// this.processReceivedData(value);
|
|
|
|
|
// }
|
|
|
|
|
// } catch (error) {
|
|
|
|
|
// console.error('连接或读取串口时发生错误:', error);
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// processReceivedData(data) {
|
|
|
|
|
// // 假设条码数据以回车符或换行符结束
|
|
|
|
|
// const barcodeEnd = /\r|\n/;
|
|
|
|
|
// // console.log("---:" + data)
|
|
|
|
|
// if (barcodeEnd.test(data)) {
|
|
|
|
|
// const barcode = data.split(barcodeEnd)[0].trim(); // 获取并清理条码数据
|
|
|
|
|
// // console.log('扫描到的条码:', this.barcode + barcode);
|
|
|
|
|
// if (this.materialConfirmVisible) {
|
|
|
|
|
// this.materialConfirmForm.materialBarcode = this.barcode + barcode;
|
|
|
|
|
// } else if (this.productInstockVisible) {
|
|
|
|
|
// this.productInstockForm.materialBarcode = this.barcode + barcode;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// this.barcode = '';
|
|
|
|
|
// } else {
|
|
|
|
|
// this.barcode += data;
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -739,7 +766,8 @@ export default {
|
|
|
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
|
|
|
location.href = '/login?isStationId=true';
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
next1() {
|
|
|
|
|
this.nowNum1 += 1
|
|
|
|
@ -780,20 +808,20 @@ export default {
|
|
|
|
|
startProductPlanDetail({
|
|
|
|
|
planDetailId: e.planDetailId
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.getDetail({row: {planId: e.planId}})
|
|
|
|
|
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.getDetail({row: {planId: e.planId}})
|
|
|
|
|
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (e.planDetailStatus === '2') {
|
|
|
|
|
this.$confirm('是否完成计划', '确认', {
|
|
|
|
@ -804,20 +832,20 @@ export default {
|
|
|
|
|
completeProductPlanDetail({
|
|
|
|
|
planDetailId: e.planDetailId
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.getDetail({row: {planId: e.planId}})
|
|
|
|
|
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.getDetail({row: {planId: e.planId}})
|
|
|
|
|
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 生成/获取明细
|
|
|
|
@ -846,12 +874,12 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.tableData1 = res.rows
|
|
|
|
|
this.totalNum2 = Math.ceil(res.total / 5)
|
|
|
|
@ -869,7 +897,7 @@ export default {
|
|
|
|
|
planId: val.row.planId,
|
|
|
|
|
planCode: val.row.planCode,
|
|
|
|
|
planDetailCode: val.row.planDetailCode,
|
|
|
|
|
saleOrderId : this.saleOrderId,
|
|
|
|
|
saleOrderId: this.saleOrderId,
|
|
|
|
|
applyReason: '',
|
|
|
|
|
taskType: '1',
|
|
|
|
|
wmsRawOutstockDetailList: []
|
|
|
|
@ -941,10 +969,30 @@ export default {
|
|
|
|
|
handleProductInstock() {
|
|
|
|
|
this.resetProductInstock();
|
|
|
|
|
this.productInstockVisible = true;
|
|
|
|
|
if (!this.checkSerialConnected()) {
|
|
|
|
|
this.$confirm('请连接条码枪', '提示', {
|
|
|
|
|
confirmButtonText: '连接',
|
|
|
|
|
showClose: true,
|
|
|
|
|
// beforeClose:async(action,instance,done)=>{
|
|
|
|
|
// if(action==='confirm'){
|
|
|
|
|
// }else{
|
|
|
|
|
// this.connectSerialPort();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// },
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
console.log("dddd")
|
|
|
|
|
this.connectSerial(this.setSerialData);
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submitProductInstock(){
|
|
|
|
|
submitProductInstock() {
|
|
|
|
|
this.$refs["productInstockForm"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
fourthFloorProduceInstock(this.productInstockForm).then(response => {
|
|
|
|
@ -955,38 +1003,53 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
cancelProductInstock(){
|
|
|
|
|
cancelProductInstock() {
|
|
|
|
|
this.productInstockVisible = false;
|
|
|
|
|
this.resetProductInstock();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 表单重置
|
|
|
|
|
resetMaterialConfirm() {
|
|
|
|
|
this.materialConfirmForm = {
|
|
|
|
|
materialBarcode: null,
|
|
|
|
|
planId: null,
|
|
|
|
|
planDetailId:null,
|
|
|
|
|
checkAmount:null
|
|
|
|
|
planDetailId: null,
|
|
|
|
|
planDetailCode: null,
|
|
|
|
|
checkAmount: 1
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("materialConfirmForm");
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 成品入库按钮操作 */
|
|
|
|
|
/** 物料扫描按钮操作 */
|
|
|
|
|
handleMaterialConfirmForm(scope) {
|
|
|
|
|
this.materialConfirmForm = {
|
|
|
|
|
materialBarcode: null,
|
|
|
|
|
planId: scope.row.planId,
|
|
|
|
|
planDetailId:scope.row.planDetailId,
|
|
|
|
|
checkAmount:null
|
|
|
|
|
planDetailId: scope.row.planDetailId,
|
|
|
|
|
planDetailCode: scope.row.planDetailCode,
|
|
|
|
|
checkAmount: 1
|
|
|
|
|
};
|
|
|
|
|
this.materialConfirmVisible = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.checkSerialConnected()) {
|
|
|
|
|
this.$confirm('请连接条码枪', '提示', {
|
|
|
|
|
confirmButtonText: '连接',
|
|
|
|
|
showClose: true,
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
console.log("dddd")
|
|
|
|
|
this.connectSerial(this.setSerialData);
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submitMaterialConfirm(){
|
|
|
|
|
submitMaterialConfirm() {
|
|
|
|
|
this.$refs["materialConfirmForm"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
scanMaterial2Confirm(this.materialConfirmForm).then(response => {
|
|
|
|
@ -997,7 +1060,7 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
cancelMaterialConfirm(){
|
|
|
|
|
cancelMaterialConfirm() {
|
|
|
|
|
this.materialConfirmVisible = false;
|
|
|
|
|
this.resetMaterialConfirm();
|
|
|
|
|
},
|
|
|
|
@ -1006,29 +1069,29 @@ export default {
|
|
|
|
|
this.returnModelVisible = true
|
|
|
|
|
this.returnModelForm = e.row
|
|
|
|
|
},
|
|
|
|
|
setReturnModelForm(){
|
|
|
|
|
setReturnModelForm() {
|
|
|
|
|
getWarehouses({
|
|
|
|
|
warehouseFloor:4,
|
|
|
|
|
materialBarcode:this.returnModelForm.materialBarcode
|
|
|
|
|
}).then(e=>{
|
|
|
|
|
this.WarehousesList = e.data.map(v=>{
|
|
|
|
|
warehouseFloor: 4,
|
|
|
|
|
materialBarcode: this.returnModelForm.materialBarcode
|
|
|
|
|
}).then(e => {
|
|
|
|
|
this.WarehousesList = e.data.map(v => {
|
|
|
|
|
return {
|
|
|
|
|
label:v.warehouseName,
|
|
|
|
|
value:v.warehouseId,
|
|
|
|
|
label: v.warehouseName,
|
|
|
|
|
value: v.warehouseId,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
returnModelConfirm(){
|
|
|
|
|
returnModelConfirm() {
|
|
|
|
|
this.$refs.returnModelForm.validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
let data = {}
|
|
|
|
|
let keys = ['warehouseId','planCode','planDetailCode','productId','materialBarcode','planAmount','taskType','applyReason']
|
|
|
|
|
keys.forEach(v=>{
|
|
|
|
|
let keys = ['warehouseId', 'planCode', 'planDetailCode', 'productId', 'materialBarcode', 'planAmount', 'taskType', 'applyReason']
|
|
|
|
|
keys.forEach(v => {
|
|
|
|
|
data[v] = this.returnModelForm[v]
|
|
|
|
|
})
|
|
|
|
|
applyRawReturn(data).then(v=>{
|
|
|
|
|
if(v.code === 200){
|
|
|
|
|
applyRawReturn(data).then(v => {
|
|
|
|
|
if (v.code === 200) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '退库成功',
|
|
|
|
|
type: 'success'
|
|
|
|
@ -1040,7 +1103,43 @@ export default {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
firstConnectSerial() {
|
|
|
|
|
if (!this.checkSerialConnected()) {
|
|
|
|
|
this.$confirm('请连接条码枪', '提示', {
|
|
|
|
|
confirmButtonText: '连接',
|
|
|
|
|
showClose: true,
|
|
|
|
|
// beforeClose:async(action,instance,done)=>{
|
|
|
|
|
// if(action==='confirm'){
|
|
|
|
|
// }else{
|
|
|
|
|
// this.connectSerialPort();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// },
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.connectSerial(this.setSerialData);
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setSerialData() {
|
|
|
|
|
// if (!this.checkSerialConnected()) {//判断是否已连接,如果没有连接则需要连接
|
|
|
|
|
// }
|
|
|
|
|
if (this.materialConfirmVisible) {
|
|
|
|
|
this.materialConfirmForm.materialBarcode = this.serialData;
|
|
|
|
|
} else if (this.productInstockVisible) {
|
|
|
|
|
this.productInstockForm.materialBarcode = this.serialData;
|
|
|
|
|
}
|
|
|
|
|
// console.log(this.serialData)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|