<!--
|
* @Descripttion: 新报工页面
|
* @version:
|
* @Author: zt_lc
|
* @Date: 2022-06-08 14:23:20
|
* @LastEditors: zt_lc
|
* @LastEditTime: 2022-08-18 16:00:48
|
-->
|
<template>
|
<div style="height: 100%;">
|
<div style="padding:0px 14px;height: 100%;overflow: auto;">
|
<div class="tabDivClass">
|
<div class="product-out-header-left">
|
<div style="height:28px;line-height:28px;">
|
<el-divider class="pane-divider" direction="vertical"></el-divider
|
><span style="font-size:14px;font-weight:bold">产出</span>
|
<el-tooltip effect="dark" content="刷新列表" placement="top">
|
<el-button
|
class="step-refresh-btn"
|
icon="el-icon-refresh"
|
type="info"
|
circle
|
@click="getBatchReport(5)"
|
></el-button>
|
</el-tooltip>
|
</div>
|
<div style="margin-left: 30px">
|
<!-- <el-button-->
|
<!-- type="text"-->
|
<!-- style="margin-right: 20px;margin-top: 3px"-->
|
<!-- icon="el-icon-refresh"-->
|
<!-- @click="getBatchReport(5)"-->
|
<!-- >刷新</el-button-->
|
<!-- >-->
|
<el-radio-group v-model="groupStatus">
|
<el-radio :label="false">按组报工</el-radio>
|
<el-radio :label="true">按人员报工</el-radio>
|
</el-radio-group>
|
</div>
|
</div>
|
<div style="display:flex;flex-wrap:wrap;">
|
<el-button
|
class="export-btn"
|
type="primary"
|
@click="exportOutProduct()"
|
>导出
|
</el-button>
|
<el-button
|
class="out-btn"
|
type="primary"
|
:disabled="currProductMainDisable || currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="addShiftProductOut()"
|
>交班产出
|
</el-button>
|
<el-button
|
class="batch-out-btn"
|
type="primary"
|
:disabled="currProductMainDisable || currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="addBatchProductOut()"
|
>批量产出
|
</el-button>
|
<div class="print-button-class">
|
<el-button type="danger" class="print-btn" @click="batchPrint()"
|
>大标签打印
|
</el-button>
|
<el-checkbox
|
class="print-radio-class"
|
v-model="batchPrintRadio"
|
@change="labelTabChange1"
|
></el-checkbox>
|
</div>
|
<div class="print-button-class">
|
<el-button
|
type="danger"
|
class="print-btn"
|
@click="batchSmallPrint()"
|
>小标签打印
|
</el-button>
|
<el-checkbox
|
class="print-radio-class"
|
v-model="batchSmallPrintRadio"
|
@change="labelTabChange2"
|
></el-checkbox>
|
</div>
|
<div
|
class="print-button-class"
|
v-if="permissions.product_finished_productLabel1_unlimit"
|
>
|
<el-button
|
type="danger"
|
class="print-btn"
|
@click="warehousingPrint()"
|
>成品标签1
|
</el-button>
|
</div>
|
<div
|
class="print-button-class"
|
v-if="permissions.product_finished_productLabel1"
|
>
|
<el-button
|
type="danger"
|
class="print-btn"
|
@click="warehousingPrintSingle()"
|
>成品标签1
|
</el-button>
|
<el-checkbox
|
class="print-radio-class"
|
v-model="warehousingPrintSingleRadio"
|
@change="labelTabChange3"
|
></el-checkbox>
|
</div>
|
<div
|
class="print-button-class"
|
v-if="permissions.product_finished_productLabel2"
|
>
|
<el-button
|
type="danger"
|
class="print-btn"
|
@click="warehousingSmalllPrint()"
|
>成品标签2
|
</el-button>
|
<el-checkbox
|
class="print-radio-class"
|
v-model="warehousingSmalllPrintRadio"
|
@change="labelTabChange4"
|
></el-checkbox>
|
</div>
|
<el-button
|
class="change-shift-out-btn"
|
type="primary"
|
:disabled="currProductMainDisable || currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="editList()"
|
>编辑
|
</el-button>
|
<el-button
|
class="batch-out-del-btn"
|
type="primary"
|
:disabled="currProductMainDisable || currentDutyRecord.isConfirm"
|
v-if="editShow"
|
@click="cancelSaveList()"
|
>取消
|
</el-button>
|
<el-button
|
class="change-shift-out-btn"
|
type="primary"
|
:disabled="currProductMainDisable || currentDutyRecord.isConfirm"
|
v-if="editShow"
|
@click="saveList()"
|
>保存
|
</el-button>
|
<!-- <el-button class="tracking-out-revoke-btn" type="primary" icon="tracking-btn-out"
|
:disabled="currProductMainDisable || currentDutyRecord.isConfirm" v-if="!editShow" >交班
|
</el-button> -->
|
<el-button
|
class="submit-out-btn"
|
type="primary"
|
:disabled="currProductMainDisable || currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="submitList()"
|
:loading="submitLoading"
|
>提交
|
</el-button>
|
<el-button
|
class="batch-out-del-btn"
|
type="primary"
|
:disabled="currProductMainDisable || currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="deleteList()"
|
>删除
|
</el-button>
|
<el-button
|
v-if="permissions.product_main_revoke"
|
type="danger"
|
class="revoke-btn"
|
@click="revokeList()"
|
:loading="removeLoading"
|
>撤销</el-button
|
>
|
<el-button
|
v-if="permissions.product_state_reset"
|
type="primary"
|
class="change-shift-out-btn"
|
@click="goReset()"
|
:loading="resetLoading"
|
>状态重置</el-button
|
>
|
</div>
|
</div>
|
<el-table
|
ref="productOutTable"
|
:data="productOutputList"
|
height="calc(100% - 118px)"
|
:header-cell-style="productOutTableHeaderCellStyle"
|
:row-class-name="productOutTableRowClassName"
|
class="tracking-table"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="55"> </el-table-column>
|
|
<el-table-column label="序号" width="50px">
|
<template slot-scope="scope">
|
{{ scope.$index + 1 }}
|
</template>
|
</el-table-column>
|
|
<el-table-column label="报工单号" prop="productNo" align="center">
|
</el-table-column>
|
<el-table-column
|
label="状态"
|
prop="state"
|
align="center"
|
:formatter="formatState"
|
width="120"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">状态</div>
|
<div class="th" @click.stop>
|
<template>
|
<el-select
|
clearable
|
v-model="paramObject.state"
|
placeholder="全部状态"
|
@change="getBatchReport(5)"
|
style="width: 100%"
|
>
|
<el-option
|
v-for="item in stateTagArr"
|
:key="item.id"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</template>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="零件编号"
|
prop="partNo"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
label="零件名称"
|
prop="partName"
|
align="center"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
label="SN号"
|
prop="outBatchNo"
|
align="center"
|
width="120"
|
:show-overflow-tooltip="true"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">SN号</div>
|
<div class="th" @click.stop>
|
<template>
|
<el-input
|
clearable
|
@keyup.enter.native="getBatchReport(5)"
|
v-model="paramObject.outBatchNo"
|
placeholder="SN号"
|
@clear="getBatchReport(5)"
|
style="width: 100%"
|
>
|
</el-input>
|
</template>
|
</div>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="载具编号"
|
prop="reelNumber"
|
align="center"
|
width="120"
|
:show-overflow-tooltip="true"
|
>
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit"
|
v-model="scope.row.reelNumber"
|
placeholder="载具编号"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.reelNumber
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="起始米标"
|
prop="startMeterMark"
|
align="center"
|
width="100"
|
>
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit"
|
v-model="scope.row.startMeterMark"
|
placeholder="起始米标"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.startMeterMark
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="截止米标"
|
prop="endMeterMark"
|
align="center"
|
width="100"
|
>
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit"
|
v-model="scope.row.endMeterMark"
|
placeholder="截止米标"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.endMeterMark
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="生产数量"
|
prop="productQty"
|
align="center"
|
width="100"
|
>
|
</el-table-column>
|
<el-table-column label="分段描述" prop="segmentDesc" align="center">
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit"
|
v-model="scope.row.segmentDesc"
|
placeholder="分段描述"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.segmentDesc
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column label="报废数量" prop="scrapQty" align="center">
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit"
|
v-model="scope.row.scrapQty"
|
placeholder="报废数量"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.scrapQty
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="IFS批次号"
|
prop="ifsBatchNo"
|
align="center"
|
width="120"
|
>
|
<template slot="header" slot-scope="scope">
|
<div style="line-height: 14px;">IFS批次号</div>
|
<div class="th" @click.stop>
|
<template>
|
<el-input
|
clearable
|
@keyup.enter.native="getBatchReport(5)"
|
v-model="paramObject.ifsBatchNo"
|
placeholder="IFS批次号"
|
@clear="getBatchReport(5)"
|
style="width: 100%"
|
>
|
</el-input>
|
</template>
|
</div>
|
</template>
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isIfsBatchNoEdit"
|
v-model="scope.row.ifsBatchNo"
|
placeholder="IFS批次号"
|
></el-input>
|
<template v-if="!scope.row.isIfsBatchNoEdit">{{
|
scope.row.ifsBatchNo
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column label="备注" prop="remark" align="center">
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit"
|
v-model="scope.row.remark"
|
placeholder="备注"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{ scope.row.remark }}</template>
|
</template>
|
</el-table-column>
|
<el-table-column label="盘具重量" prop="reelWeight" align="center">
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit"
|
v-model="scope.row.reelWeight"
|
placeholder="盘具重量"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.reelWeight
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column label="毛重" prop="grossWeight" align="center">
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit"
|
v-model="scope.row.grossWeight"
|
placeholder="毛重"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.grossWeight
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column label="系统号" prop="systemNo" align="center">
|
</el-table-column>
|
<el-table-column label="工序名称" prop="operationName" align="center">
|
</el-table-column>
|
<el-table-column label="单位" prop="unit" align="center">
|
</el-table-column>
|
<el-table-column
|
label="交班状态"
|
prop="shiftState"
|
align="center"
|
:formatter="formatshiftState"
|
>
|
</el-table-column>
|
<el-table-column label="打印次数" prop="printNum" align="center">
|
</el-table-column>
|
<el-table-column
|
label="操作"
|
align="center"
|
width="190px"
|
fixed="right"
|
>
|
<template slot-scope="scope">
|
<el-tooltip effect="dark" content="投入" placement="top-start">
|
<el-button
|
type="text"
|
size="small"
|
class="blue-but"
|
@click="searchDetail(scope.$index, scope.row)"
|
>投入</el-button
|
>
|
</el-tooltip>
|
<el-tooltip effect="dark" content="交班" placement="top-start">
|
<el-button
|
type="text"
|
size="small"
|
class="blue-but"
|
@click="
|
translate(scope.$index, scope.row, 'DRAFTTOCHANGESHIFT')
|
"
|
:disabled="
|
currProductMainDisable || currentDutyRecord.isConfirm
|
"
|
v-if="
|
scope.row.state == '01draft' &&
|
scope.row.shiftState == '01draft'
|
"
|
>交班</el-button
|
>
|
</el-tooltip>
|
<el-tooltip effect="dark" content="取消交班" placement="top-start">
|
<el-button
|
type="text"
|
size="small"
|
class="blue-but"
|
@click="
|
translate(scope.$index, scope.row, 'CHANGESHIFTTODRAFT')
|
"
|
:disabled="
|
currProductMainDisable || currentDutyRecord.isConfirm
|
"
|
v-if="
|
scope.row.state == '01draft' &&
|
scope.row.shiftState == '03changeshift'
|
"
|
>取消交班</el-button
|
>
|
</el-tooltip>
|
<el-tooltip
|
effect="dark"
|
content="标签"
|
placement="top-start"
|
v-if="permissions.product_main_printlabel"
|
>
|
<el-button
|
type="text"
|
size="small"
|
class="blue-but"
|
@click="printLabel(scope.row)"
|
>标签</el-button
|
>
|
</el-tooltip>
|
<el-tooltip
|
effect="dark"
|
content="小标签"
|
placement="top-start"
|
v-if="permissions.product_main_smalllprintlabel"
|
>
|
<el-button
|
type="text"
|
size="small"
|
class="blue-but"
|
@click="smallPrintLabel(scope.row)"
|
>小标签</el-button
|
>
|
</el-tooltip>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="pagin-page">
|
<el-pagination
|
:current-page="queryReport.current"
|
:page-sizes="[10, 15, 20, 50, 100]"
|
:page-size="queryReport.size"
|
layout="total, sizes, prev, pager, next, jumper"
|
@size-change="handleSizeChangeReport"
|
@current-change="handleCurrentChangeReport"
|
:total="queryReport.total"
|
>
|
</el-pagination>
|
</div>
|
|
<batchProductOutFormDialog
|
:currshowlist.sync="showBatchProductForm"
|
:productList="productList"
|
:parentInfo="parentInfo"
|
:currentDutyRecord="currentDutyRecord"
|
:personBoardList="personBoardList"
|
@refreshProductOutputList="refreshProductOutputList"
|
:groupStatus="groupStatus"
|
/>
|
<shiftProductoutFormDialog
|
:currshowlist.sync="showShiftProductForm"
|
:productList="productList"
|
:parentInfo="parentInfo"
|
:currentDutyRecord="currentDutyRecord"
|
:personBoardList="personBoardList"
|
@refreshProductOutputList="refreshProductOutputList"
|
/>
|
<workReportFeed
|
v-if="searchFeed"
|
ref="searchFeed"
|
@refreshFeedsForDel="refreshFeedsForDel"
|
></workReportFeed>
|
|
<productOutFormDialog
|
:currshowlist.sync="showProductForm"
|
:productList="productList"
|
:parentInfo="parentInfo"
|
:currentDutyRecord="currentDutyRecord"
|
:personBoardList="personBoardList"
|
@refreshProductOutputList="refreshProductOutputList"
|
/>
|
<TaskSecretForm
|
:currshowlist.sync="showTaskSecretForm"
|
@confirmSecret="confirmSecret"
|
:tackingList="confirmList"
|
:tipeInfo="tipeInfo"
|
/>
|
<printSecretFormDialog
|
:currshowlist.sync="showPrintSecretForm"
|
:outputs="selectOutputs"
|
:statusCheck="statusCheck"
|
@goOnPrint="goOnPrint"
|
@cancelClose="cancelClose"
|
@cancelCloseCancel="cancelCloseCancel"
|
/>
|
</div>
|
<div>
|
<iframe
|
id="frame"
|
style="width:2480px;overflow:hidden;margin-top: 200px;"
|
:src="jimusrc"
|
></iframe>
|
</div>
|
</div>
|
</template>
|
<style lang="scss" scoped>
|
.cancel-btn {
|
background-image: -webkit-linear-gradient(
|
90deg,
|
rgba(254, 100, 84, 0.8) 0%,
|
rgba(252, 84, 75, 0.8) 50%,
|
rgba(250, 69, 65, 0.8) 100%
|
);
|
background-image: -moz-linear-gradient(
|
90deg,
|
rgba(254, 100, 84, 0.8) 0%,
|
rgba(252, 84, 75, 0.8) 50%,
|
rgba(250, 69, 65, 0.8) 100%
|
);
|
background-image: linear-gradient(
|
90deg,
|
rgba(254, 100, 84, 0.8) 0%,
|
rgba(252, 84, 75, 0.8) 50%,
|
rgba(250, 69, 65, 0.8) 100%
|
);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 10px;
|
padding: 6px 15px;
|
height: 32px;
|
}
|
|
.cancel-btn >>> span {
|
margin-left: 3px;
|
}
|
|
.tracking-change-state-div >>> .tracking-btn-cancel {
|
background: url('/img/workbench/icon_cancel.png') center center no-repeat;
|
background-size: cover;
|
}
|
|
.tracking-change-state-div >>> .tracking-btn-cancel:before {
|
content: '消';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
|
.submit-btn {
|
background-image: -webkit-linear-gradient(
|
90deg,
|
rgba(80, 213, 118, 0.8) 0%,
|
rgba(73, 209, 87, 0.8) 50%,
|
rgba(65, 205, 58, 0.8) 100%
|
);
|
background-image: -moz-linear-gradient(
|
90deg,
|
rgba(80, 213, 118, 0.8) 0%,
|
rgba(73, 209, 87, 0.8) 50%,
|
rgba(65, 205, 58, 0.8) 100%
|
);
|
background-image: linear-gradient(
|
90deg,
|
rgba(80, 213, 118, 0.8) 0%,
|
rgba(73, 209, 87, 0.8) 50%,
|
rgba(65, 205, 58, 0.8) 100%
|
);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 10px;
|
padding: 6px 15px;
|
height: 32px;
|
}
|
|
.submit-btn >>> span {
|
margin-left: 3px;
|
}
|
|
.tracking-change-state-div >>> .tracking-btn-submit {
|
background: url('/img/workbench/icon_tracking_submit.png') center center
|
no-repeat;
|
background-size: cover;
|
}
|
|
.tracking-change-state-div >>> .tracking-btn-submit:before {
|
content: '交';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
|
.revoke-btn {
|
background-image: -webkit-linear-gradient(
|
90deg,
|
rgba(254, 91, 53, 0.8) 0%,
|
rgba(245, 68, 50, 0.8) 100%
|
);
|
background-image: -moz-linear-gradient(
|
90deg,
|
rgba(254, 91, 53, 0.8) 0%,
|
rgba(245, 68, 50, 0.8) 100%
|
);
|
background-image: linear-gradient(
|
90deg,
|
rgba(254, 91, 53, 0.8) 0%,
|
rgba(245, 68, 50, 0.8) 100%
|
);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.revoke-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.print-btn {
|
background-image: -webkit-linear-gradient(
|
90deg,
|
rgba(83, 53, 254, 0.8) 0%,
|
rgba(52, 50, 213, 0.8) 100%
|
);
|
background-image: -moz-linear-gradient(
|
90deg,
|
rgba(83, 53, 254, 0.8) 0%,
|
rgba(52, 50, 213, 0.8) 100%
|
);
|
background-image: linear-gradient(
|
90deg,
|
rgba(83, 53, 254, 0.8) 0%,
|
rgba(52, 50, 213, 0.8) 100%
|
);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.print-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.tracking-change-state-div >>> .tracking-btn-revoke {
|
background: url('/img/workbench/icon_back.png') center center no-repeat;
|
background-size: cover;
|
}
|
|
.tracking-change-state-div >>> .tracking-btn-revoke:before {
|
content: '撤';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
|
.tracking-divider.el-divider {
|
margin: 12px 0px 18px;
|
}
|
|
.product-out-header {
|
margin-top: 10px;
|
margin-bottom: 14px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.product-out-header-left {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.product-out-header >>> .tracking-btn-out {
|
background: url('/img/workbench/icon_bgcc.png') center center no-repeat;
|
background-size: cover;
|
font-size: 14px;
|
}
|
|
.product-out-header >>> .tracking-btn-out:before {
|
content: '产';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
|
.pane-divider {
|
width: 4px;
|
background-color: #4283ee;
|
}
|
|
.export-btn {
|
background-image: -webkit-linear-gradient(139deg, #16abe6 0%, #16abe6 100%);
|
background-image: -moz-linear-gradient(139deg, #16abe6 0%, #16abe6 100%);
|
background-image: linear-gradient(139deg, #16abe6 0%, #16abe6 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.export-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.out-btn {
|
background-image: -webkit-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: -moz-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.out-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.batch-out-btn {
|
background-image: -webkit-linear-gradient(139deg, #ff8c00 0%, #ffa500 100%);
|
background-image: -moz-linear-gradient(139deg, #ff8c00 0%, #ffa500 100%);
|
background-image: linear-gradient(139deg, #ff8c00 0%, #ffa500 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.batch-out-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.submit-out-btn {
|
background-image: -webkit-linear-gradient(139deg, #54d167 0%, #49cb3b 100%);
|
background-image: -moz-linear-gradient(139deg, #54d167 0%, #49cb3b 100%);
|
background-image: linear-gradient(139deg, #54d167 0%, #49cb3b 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.submit-out-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.change-shift-out-btn {
|
background-image: -webkit-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: -moz-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.change-shift-out-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.tracking-out-revoke-btn {
|
background-image: -webkit-linear-gradient(139deg, #fc5e40 0%, #f54c3d 100%);
|
background-image: -moz-linear-gradient(139deg, #fc5e40 0%, #f54c3d 100%);
|
background-image: linear-gradient(139deg, #fc5e40 0%, #f54c3d 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.tracking-out-revoke-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.batch-out-del-btn {
|
background-image: -webkit-linear-gradient(139deg, #e86d61 0%, #e45552 100%);
|
background-image: -moz-linear-gradient(139deg, #e86d61 0%, #e45552 100%);
|
background-image: linear-gradient(139deg, #e86d61 0%, #e45552 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
font-size: 14px;
|
}
|
|
.batch-out-del-btn >>> span {
|
margin-left: 3px;
|
font-size: 12px;
|
}
|
|
.tracking-table >>> .stripe-row {
|
background: #f6f9fe;
|
}
|
|
.tracking-table >>> td {
|
padding: 3px 0px;
|
}
|
|
.tracking-table >>> .el-button {
|
padding: 5px 0px;
|
}
|
|
.tracking-table >>> .el-input .el-input__inner {
|
height: 24px;
|
line-height: 24px;
|
}
|
|
.product-in-header {
|
margin-top: 10px;
|
margin-bottom: 14px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.product-in-header-left {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.product-in-header >>> .tracking-btn-in {
|
background: url('/img/workbench/icon_bgtr.png') center center no-repeat;
|
background-size: cover;
|
font-size: 14px;
|
}
|
|
.product-in-header >>> .tracking-btn-in:before {
|
content: '投';
|
font-size: 14px;
|
visibility: hidden;
|
}
|
|
.in-btn {
|
background-image: -webkit-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: -moz-linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
background-image: linear-gradient(139deg, #5f6eef 0%, #2783ff 100%);
|
color: #fff;
|
border-color: #fbecec;
|
border-radius: 15px;
|
padding: 6px 15px;
|
}
|
|
.in-btn >>> span {
|
margin-left: 3px;
|
}
|
|
.tabDivClass {
|
margin-top: 20px;
|
margin-bottom: 14px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.red-but.is-disabled {
|
color: #fab6b6;
|
}
|
|
.red-but {
|
color: red;
|
}
|
|
.blue-but.is-disabled {
|
color: #aacfff;
|
}
|
|
.blue-but {
|
color: #006eff;
|
}
|
|
.white-but {
|
color: white;
|
font-weight: bolder;
|
}
|
|
.pagin-page {
|
margin-top: 10px;
|
margin-bottom: 14px;
|
display: flex;
|
justify-content: end;
|
align-items: center;
|
}
|
|
.step-refresh-btn.el-button--small.is-circle {
|
padding: 4px;
|
}
|
|
.tabDivClass >>> .print-button-class {
|
position: relative !important;
|
margin-left: 10px;
|
}
|
.tabDivClass >>> .print-radio-class {
|
position: absolute !important;
|
left: 3px;
|
top: 3px;
|
}
|
</style>
|
<script>
|
import {
|
getProductMainV1,
|
batchUpdateProductMain,
|
batchChange,
|
batchCancelProductMain,
|
productOutPutStateByMainId,
|
getPrintUrl,
|
exportProductOutPut,
|
getSNByTaskId,
|
validateOverProduction,
|
validateOverFeed,
|
productProcessState,
|
validateIsLastOperation,
|
validateChangeProductOut,
|
resetState,
|
updatePrintNum
|
} from '@/api/product/personboard'
|
import {
|
batchLabelPrint,
|
checkBatchLabelPrint,
|
batchLabelPrintTimes
|
} from '@/api/product/handymantype'
|
import batchProductOutFormDialog from './batchproductout-form-new.vue'
|
import { mapGetters } from 'vuex'
|
import { getShiftProductOutByOpIdAndWsId } from '../../../api/product/personboard'
|
import { value2label } from '../../../util/formatUtil'
|
import workReportFeed from './workReport-feed.vue'
|
import shiftProductoutFormDialog from './shift-productout-form.vue'
|
import productOutFormDialog from './productout-form-new.vue'
|
import TaskSecretForm from './task-secret-form.vue'
|
import { transform } from '@/util/fileTransform'
|
import getLodop from '@/util/lodop'
|
import { getYearAndMonth } from '@/util/date'
|
import { judgeLabelMark } from '@/api/warehouse/check'
|
import printSecretFormDialog from './print-secret-form.vue'
|
import { getEnableFinishProdList } from '../../../api/warehouse/packaging'
|
export default {
|
components: {
|
batchProductOutFormDialog,
|
workReportFeed,
|
shiftProductoutFormDialog,
|
productOutFormDialog,
|
TaskSecretForm,
|
printSecretFormDialog
|
},
|
props: {
|
workstationId: {
|
type: Number
|
},
|
currOperateTask: {
|
type: Object,
|
default: () => {
|
return {}
|
}
|
},
|
currentDutyRecord: {
|
type: Object,
|
default: () => {
|
return {}
|
}
|
},
|
personBoardList: {
|
type: Array,
|
default: () => {
|
return []
|
}
|
},
|
currItem: {
|
type: String,
|
default: null
|
}
|
},
|
data() {
|
return {
|
showPrintSecretForm: false,
|
printLabelType: null,
|
printData: null,
|
stateTagArr: [
|
{ value: '01draft', label: '草稿' },
|
{ value: '02submitted', label: '已提交' },
|
{ value: '04processing', label: '处理中' },
|
{ value: '03changeshift', label: '交班' }
|
],
|
tableData: [],
|
multipleSelection: [],
|
productMainColumn: [
|
{
|
prop: 'productNo',
|
label: '报工单号'
|
},
|
{ prop: 'createUser', label: '创建人' },
|
{ prop: 'createTime', label: '创建时间' },
|
{
|
prop: 'state',
|
label: '状态',
|
formatter: (colValue) => {
|
var formatVal
|
if (colValue === '01draft') {
|
formatVal = '草稿'
|
} else if (colValue === '04processing') {
|
formatVal = '处理中'
|
} else if (colValue === '02submitted') {
|
formatVal = '已提交'
|
}
|
return formatVal
|
}
|
}
|
],
|
productMainList: [],
|
productOutputList: [],
|
productInputList: [],
|
currProductMainId: null,
|
currProductMainNo: null,
|
currProductMainState: null,
|
currProductMainDisable: false,
|
showProductInDialog: false,
|
secondTableHeight: null,
|
groupStatus: false,
|
productList: [],
|
parentInfo: {
|
workstationId: null,
|
operationTaskId: null,
|
currProductMainId: null,
|
productOutId: null,
|
currProductMainNo: null,
|
partId: null,
|
partNo: null,
|
partName: null,
|
unit: null
|
},
|
showProductForm: false,
|
showBatchProductForm: false,
|
changeStateDisabled: false,
|
clickChangeStateArr: [],
|
editShow: false, // 是否编辑,
|
searchFeed: false,
|
stateShiftTagArr: [{ value: '03changeshift', label: '交班' }],
|
showShiftProductForm: false,
|
jimusrc: '',
|
queryReport: {
|
current: 1,
|
size: 10,
|
total: 0
|
},
|
paramObject: {
|
outBatchNo: null,
|
ifsBatchNo: null,
|
state: '01draft'
|
},
|
reportAllData: [], // 存放原始数据,
|
LODOP: null, // 打印插件
|
showTaskSecretForm: false,
|
confirmList: [],
|
tipeInfo: null,
|
submitLoading: false,
|
removeLoading: false,
|
resetLoading: false,
|
batchPrintRadio: false,
|
batchSmallPrintRadio: false,
|
warehousingPrintSingleRadio: false,
|
warehousingSmalllPrintRadio: false,
|
statusCheck: true,
|
selectOutputs: []
|
}
|
},
|
created() {},
|
computed: {
|
...mapGetters(['permissions', 'userInfo'])
|
},
|
methods: {
|
cancelClose() {
|
this.statusCheck = true
|
},
|
cancelCloseCancel() {
|
this.statusCheck = true
|
},
|
labelTabChange1(val) {
|
if (val) {
|
this.batchSmallPrintRadio = false
|
this.warehousingPrintSingleRadio = false
|
this.warehousingSmalllPrintRadio = false
|
}
|
},
|
labelTabChange2(val) {
|
if (val) {
|
this.batchPrintRadio = false
|
this.warehousingPrintSingleRadio = false
|
this.warehousingSmalllPrintRadio = false
|
}
|
},
|
labelTabChange3(val) {
|
if (val) {
|
this.batchPrintRadio = false
|
this.batchSmallPrintRadio = false
|
this.warehousingSmalllPrintRadio = false
|
}
|
},
|
labelTabChange4(val) {
|
if (val) {
|
this.batchPrintRadio = false
|
this.batchSmallPrintRadio = false
|
this.warehousingPrintSingleRadio = false
|
}
|
},
|
// 继续打印
|
goOnPrint(param) {
|
this.statusCheck = true
|
if (param) {
|
// 继续打印,判断是哪个标签的打印printData
|
if (this.printLabelType == '1') {
|
// 大标签打印
|
if (this.printData.data != null && this.printData.data.length > 0) {
|
// 找出所有要打印的SN的list
|
const snList = []
|
this.printData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (let i = 0; i < this.printData.data.length; i++) {
|
markFlag = markArr.includes(this.printData.data[i].outBatchNo)
|
if (markFlag) {
|
this.createLodopPrintIze(this.printData.data[i])
|
} else {
|
this.createLodopPrint(this.printData.data[i])
|
}
|
}
|
})
|
}
|
} else if (this.printLabelType == '2') {
|
// 小标签打印
|
if (this.printData.data != null && this.printData.data.length > 0) {
|
// 找出所有要打印的SN的list
|
const snList = []
|
this.printData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (let i = 0; i < this.printData.data.length; i++) {
|
markFlag = markArr.includes(this.printData.data[i].outBatchNo)
|
if (markFlag) {
|
this.createLodopSmallPrintIze(this.printData.data[i])
|
} else {
|
this.createLodopSmallPrint(this.printData.data[i])
|
}
|
}
|
})
|
}
|
} else if (this.printLabelType == '3') {
|
// 成品标签1打印
|
if (this.printData.data != null && this.printData.data.length > 0) {
|
// 找出所有要打印的SN的list
|
const snList = []
|
this.printData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (let i = 0; i < this.printData.data.length; i++) {
|
markFlag = markArr.includes(this.printData.data[i].outBatchNo)
|
if (markFlag) {
|
this.createWarehousingLodopPrintIze(this.printData.data[i])
|
} else {
|
this.createWarehousingLodopPrint(this.printData.data[i])
|
}
|
}
|
})
|
}
|
} else if (this.printLabelType == '4') {
|
// 成品标签2打印
|
if (this.printData.data != null && this.printData.data.length > 0) {
|
// 找出所有要打印的SN的list
|
const snList = []
|
this.printData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (let i = 0; i < this.printData.data.length; i++) {
|
markFlag = markArr.includes(this.printData.data[i].outBatchNo)
|
if (markFlag) {
|
this.createWarehousingSmallLodopPrintIze(
|
this.printData.data[i]
|
)
|
} else {
|
this.createWarehousingSmallLodopPrint(this.printData.data[i])
|
}
|
}
|
})
|
}
|
}
|
} else {
|
// 密码错误,停止打印
|
}
|
},
|
formatState(row, column, cellValue) {
|
return value2label(cellValue, this.stateTagArr)
|
},
|
formatshiftState(row, column, cellValue) {
|
return value2label(cellValue, this.stateShiftTagArr)
|
},
|
productOutTableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
|
let headerStyle = 'background:#599ef4;color:#fff;'
|
if (columnIndex === 0) {
|
headerStyle += 'border-radius: 6px 0px 0px 0px;'
|
} else if (columnIndex === 22) {
|
headerStyle += 'border-radius: 0px 6px 0px 0px;'
|
}
|
return headerStyle
|
},
|
productOutTableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 1) {
|
return 'stripe-row'
|
} else {
|
return ''
|
}
|
},
|
handleSelectionChange(val) {
|
this.multipleSelection = val
|
},
|
// 获取年月日字符串
|
getDayStr() {
|
var date = new Date()
|
var fullYear = date.getFullYear()
|
var month = date.getMonth()
|
var day = date.getDate()
|
month = month + 1
|
var monthStr
|
var dayStr
|
if (month <= 9) {
|
monthStr = '0' + month
|
} else {
|
monthStr = '' + month
|
}
|
if (day <= 9) {
|
dayStr = '0' + day
|
} else {
|
dayStr = '' + day
|
}
|
return fullYear + monthStr + dayStr
|
},
|
// 初始化页面变量
|
initTracking() {
|
this.productMainList = []
|
this.productOutputList = []
|
this.productInputList = []
|
this.currProductMainId = null
|
this.currProductMainNo = null
|
this.currProductMainState = null
|
this.currProductMainDisable = null
|
this.showProductInDialog = false
|
this.secondTableHeight = null
|
this.groupStatus = false
|
this.productList = []
|
this.parentInfo = {
|
workstationId: null,
|
operationTaskId: null,
|
currProductMainId: null,
|
productOutId: null,
|
currProductMainNo: null,
|
partId: null,
|
partNo: null,
|
partName: null,
|
unit: null
|
}
|
this.showProductForm = false
|
this.showBatchProductForm = false
|
this.editShow = false
|
|
this.showShiftProductForm = false
|
},
|
// 添加交班产出
|
addShiftProductOut() {
|
var productStaffs = []
|
var productStaffIds = []
|
if (this.currOperateTask.id != null) {
|
if (
|
this.currentDutyRecord != null &&
|
this.currentDutyRecord.id != null
|
) {
|
if (this.personBoardList != null && this.personBoardList.length > 0) {
|
this.parentInfo.workstationId = this.workstationId
|
this.parentInfo.operationTaskId = this.currOperateTask.id
|
this.parentInfo.currProductMainId = this.currProductMainId
|
this.parentInfo.currProductMainNo = this.currProductMainNo
|
this.parentInfo.partId = this.currOperateTask.partId
|
this.parentInfo.partNo = this.currOperateTask.partNo
|
this.parentInfo.partName = this.currOperateTask.partName
|
this.parentInfo.unit = this.currOperateTask.unit
|
this.parentInfo.productOutId = null
|
// 给弹出框产量列表productList赋值
|
this.productList = []
|
var product
|
if (this.groupStatus) {
|
// 按人员报工,多条或一条记录
|
for (var i = 0; i < this.personBoardList.length; i++) {
|
product = {}
|
// cxf 0807 不清空会导致n次方的数据
|
productStaffs = []
|
productStaffIds = []
|
productStaffIds.push(this.personBoardList[i].staffId)
|
productStaffs.push(this.personBoardList[i].staffNo)
|
product.staffName = this.personBoardList[i].staffName
|
product.staffNo = this.personBoardList[i].staffNo
|
product.productNo = this.currProductMainNo
|
product.partId = this.currOperateTask.partId
|
product.partNo = this.currOperateTask.partNo
|
product.partName = this.currOperateTask.partName
|
// product.outBatchNo = this.getDayStr()
|
product.outBatchNo = null
|
product.reelNumber = null
|
product.startMeterMark = 0
|
product.endMeterMark = 0
|
product.productQty = 0
|
product.ifsBatchNo = null
|
product.unit = this.currOperateTask.unit
|
product.productStaffs = JSON.parse(
|
JSON.stringify(productStaffs)
|
)
|
product.productStaffIds = JSON.parse(
|
JSON.stringify(productStaffIds)
|
)
|
product.status = this.groupStatus
|
product.systemNo = null
|
product.date = null
|
product.dutyRecordId = this.currentDutyRecord.id
|
|
product.scrapQty = null
|
product.segmentDesc = null
|
product.remark = null
|
|
product.sproductQty = 0
|
|
product.reelWeight = null
|
product.grossWeight = null
|
|
this.productList.push(product)
|
}
|
} else {
|
// 按班组报工,一条记录
|
var staffName = ''
|
var staffNo = ''
|
var staffId = ''
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffName += this.personBoardList[i].staffName + ','
|
}
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffNo += this.personBoardList[i].staffNo + ','
|
productStaffs.push(this.personBoardList[i].staffNo)
|
}
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffId += this.personBoardList[i].staffId + ','
|
productStaffIds.push(this.personBoardList[i].staffId)
|
}
|
staffName = staffName.substring(0, staffName.length - 1)
|
staffNo = staffNo.substring(0, staffNo.length - 1)
|
|
product = {}
|
product.staffName = staffName
|
product.staffNo = staffNo
|
product.productNo = this.currProductMainNo
|
product.partId = this.currOperateTask.partId
|
product.partNo = this.currOperateTask.partNo
|
product.partName = this.currOperateTask.partName
|
// product.outBatchNo = this.getDayStr()
|
product.outBatchNo = null
|
product.reelNumber = null
|
product.startMeterMark = 0
|
product.endMeterMark = 0
|
product.productQty = 0
|
product.ifsBatchNo = null
|
product.unit = this.currOperateTask.unit
|
product.productStaffs = productStaffs
|
product.productStaffIds = productStaffIds
|
product.status = this.groupStatus
|
product.systemNo = null
|
product.date = null
|
product.dutyRecordId = this.currentDutyRecord.id
|
|
product.scrapQty = null
|
product.segmentDesc = null
|
product.remark = null
|
|
product.sproductQty = 0
|
|
product.reelWeight = null
|
product.grossWeight = null
|
|
this.productList.push(product)
|
}
|
// 弹出产量填写的dialog
|
this.showShiftProductForm = true
|
} else {
|
this.$message.warning('当前没有人员,不可进行报工!')
|
}
|
} else {
|
this.$message.warning('当前没有上班记录,不可进行报工!')
|
}
|
} else {
|
this.$message.warning('请先选择工单')
|
}
|
},
|
// 新增产出
|
addProductOut() {
|
let productStaffs = []
|
let productStaffIds = []
|
if (this.currOperateTask.id != null) {
|
if (
|
this.currentDutyRecord != null &&
|
this.currentDutyRecord.id != null
|
) {
|
if (this.personBoardList != null && this.personBoardList.length > 0) {
|
this.parentInfo.workstationId = this.workstationId
|
this.parentInfo.operationTaskId = this.currOperateTask.id
|
this.parentInfo.currProductMainId = this.currProductMainId
|
this.parentInfo.currProductMainNo = this.currProductMainNo
|
this.parentInfo.partId = this.currOperateTask.partId
|
this.parentInfo.partNo = this.currOperateTask.partNo
|
this.parentInfo.partName = this.currOperateTask.partName
|
this.parentInfo.unit = this.currOperateTask.unit
|
this.parentInfo.productOutId = null
|
// 给弹出框产量列表productList赋值
|
this.productList = []
|
let product
|
if (this.groupStatus) {
|
// 按人员报工,多条或一条记录
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
product = {}
|
// cxf 0807 不清空会导致n次方的数据
|
productStaffs = []
|
productStaffIds = []
|
productStaffIds.push(this.personBoardList[i].staffId)
|
productStaffs.push(this.personBoardList[i].staffNo)
|
product.staffName = this.personBoardList[i].staffName
|
product.staffNo = this.personBoardList[i].staffNo
|
product.productNo = this.currProductMainNo
|
product.partId = this.currOperateTask.partId
|
product.partNo = this.currOperateTask.partNo
|
product.partName = this.currOperateTask.partName
|
// product.outBatchNo = this.getDayStr()
|
product.outBatchNo = null
|
product.disNumber = null
|
product.productQty = 0
|
product.unit = this.currOperateTask.unit
|
product.productStaffs = JSON.parse(
|
JSON.stringify(productStaffs)
|
)
|
product.productStaffIds = JSON.parse(
|
JSON.stringify(productStaffIds)
|
)
|
product.status = this.groupStatus
|
product.systemNo = null
|
product.date = null
|
product.dutyRecordId = this.currentDutyRecord.id
|
product.startMeterMark = 0
|
product.endMeterMark = 0
|
|
product.outBatchNo = null
|
product.reelNumber = null
|
product.ifsBatchNo = null
|
product.scrapQty = null
|
product.segmentDesc = null
|
product.remark = null
|
|
product.sproductQty = 0
|
|
this.productList.push(product)
|
}
|
} else {
|
// 按班组报工,一条记录
|
let staffName = ''
|
let staffNo = ''
|
let staffId = ''
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffName += this.personBoardList[i].staffName + ','
|
}
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffNo += this.personBoardList[i].staffNo + ','
|
productStaffs.push(this.personBoardList[i].staffNo)
|
}
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffId += this.personBoardList[i].staffId + ','
|
productStaffIds.push(this.personBoardList[i].staffId)
|
}
|
staffName = staffName.substring(0, staffName.length - 1)
|
staffNo = staffNo.substring(0, staffNo.length - 1)
|
|
product = {}
|
product.staffName = staffName
|
product.staffNo = staffNo
|
product.productNo = this.currProductMainNo
|
product.partId = this.currOperateTask.partId
|
product.partNo = this.currOperateTask.partNo
|
product.partName = this.currOperateTask.partName
|
// product.outBatchNo = this.getDayStr()
|
product.outBatchNo = null
|
product.disNumber = null
|
product.productQty = 0
|
product.unit = this.currOperateTask.unit
|
product.productStaffs = productStaffs
|
product.productStaffIds = productStaffIds
|
product.status = this.groupStatus
|
product.systemNo = null
|
product.date = null
|
product.dutyRecordId = this.currentDutyRecord.id
|
product.startMeterMark = 0
|
product.endMeterMark = 0
|
|
product.outBatchNo = null
|
product.reelNumber = null
|
product.ifsBatchNo = null
|
product.scrapQty = null
|
product.segmentDesc = null
|
product.remark = null
|
|
product.sproductQty = 0
|
|
this.productList.push(product)
|
}
|
// 弹出产量填写的dialog
|
this.showProductForm = true
|
} else {
|
this.$message.warning('当前没有人员,不可进行报工!')
|
}
|
} else {
|
this.$message.warning('当前没有上班记录,不可进行报工!')
|
}
|
} else {
|
this.$message.warning('请先选择工单')
|
}
|
},
|
// 添加批量产出
|
addBatchProductOut() {
|
if (!this.currOperateTask.id) {
|
this.$message.error('请选择工单!')
|
return
|
}
|
|
// 先判断,是否存在需要交接的产出
|
getShiftProductOutByOpIdAndWsId(
|
this.workstationId,
|
this.currOperateTask.id
|
).then((response) => {
|
var data = response.data
|
if (data.code === 0) {
|
if (data.data != null) {
|
this.$message.warning(
|
'工单、机台下存在交班的产出,不可进行【批量产出】'
|
)
|
/* const lastShiftProductOut = data.data
|
if (
|
this.currentDutyRecord.id !== lastShiftProductOut.dutyRecordId
|
) {
|
this.$message.warning(
|
'工单下存在交班的产出,不可进行【批量产出】'
|
)
|
} else {
|
let productStaffs = []
|
let productStaffIds = []
|
if (this.currOperateTask.id != null) {
|
if (
|
this.currentDutyRecord != null &&
|
this.currentDutyRecord.id != null
|
) {
|
if (
|
this.personBoardList != null &&
|
this.personBoardList.length > 0
|
) {
|
this.parentInfo.workstationId = this.workstationId
|
this.parentInfo.operationTaskId = this.currOperateTask.id
|
this.parentInfo.currProductMainId = this.currProductMainId
|
this.parentInfo.currProductMainNo = this.currProductMainNo
|
this.parentInfo.partId = this.currOperateTask.partId
|
this.parentInfo.partNo = this.currOperateTask.partNo
|
this.parentInfo.partName = this.currOperateTask.partName
|
this.parentInfo.unit = this.currOperateTask.unit
|
this.parentInfo.productOutId = null
|
this.productList = []
|
let product
|
if (this.groupStatus) {
|
for (
|
let i = 0;
|
i < this.personBoardList.length;
|
i++
|
) {
|
product = {}
|
productStaffs = []
|
productStaffIds = []
|
productStaffIds.push(
|
this.personBoardList[i].staffId
|
)
|
productStaffs.push(this.personBoardList[i].staffNo)
|
product.staffName = this.personBoardList[
|
i
|
].staffName
|
product.staffNo = this.personBoardList[i].staffNo
|
product.productNo = this.currProductMainNo
|
product.partId = this.currOperateTask.partId
|
product.partNo = this.currOperateTask.partNo
|
product.partName = this.currOperateTask.partName
|
product.outBatchNo = null
|
product.disNumber = null
|
product.productQty = 0
|
product.unit = this.currOperateTask.unit
|
product.productStaffs = JSON.parse(
|
JSON.stringify(productStaffs)
|
)
|
product.productStaffIds = JSON.parse(
|
JSON.stringify(productStaffIds)
|
)
|
product.status = this.groupStatus
|
product.systemNo = null
|
product.date = null
|
product.dutyRecordId = this.currentDutyRecord.id
|
product.startMeterMark = 0
|
product.endMeterMark = 0
|
|
product.outBatchNo = null
|
product.reelNumber = null
|
product.ifsBatchNo = null
|
product.scrapQty = null
|
product.segmentDesc = null
|
product.remark = null
|
|
product.sproductQty = 0
|
product.batchNoEdit = false
|
|
product.reelWeight = null
|
product.grossWeight = null
|
|
this.productList.push(product)
|
}
|
} else {
|
let staffName = ''
|
let staffNo = ''
|
let staffId = ''
|
for (
|
let i = 0;
|
i < this.personBoardList.length;
|
i++
|
) {
|
staffName += this.personBoardList[i].staffName + ','
|
}
|
for (
|
let i = 0;
|
i < this.personBoardList.length;
|
i++
|
) {
|
staffNo += this.personBoardList[i].staffNo + ','
|
productStaffs.push(this.personBoardList[i].staffNo)
|
}
|
for (
|
let i = 0;
|
i < this.personBoardList.length;
|
i++
|
) {
|
staffId += this.personBoardList[i].staffId + ','
|
productStaffIds.push(
|
this.personBoardList[i].staffId
|
)
|
}
|
staffName = staffName.substring(
|
0,
|
staffName.length - 1
|
)
|
staffNo = staffNo.substring(0, staffNo.length - 1)
|
|
product = {}
|
product.staffName = staffName
|
product.staffNo = staffNo
|
product.productNo = this.currProductMainNo
|
product.partId = this.currOperateTask.partId
|
product.partNo = this.currOperateTask.partNo
|
product.partName = this.currOperateTask.partName
|
product.outBatchNo = null
|
product.disNumber = null
|
product.productQty = 0
|
product.unit = this.currOperateTask.unit
|
product.productStaffs = productStaffs
|
product.productStaffIds = productStaffIds
|
product.status = this.groupStatus
|
product.systemNo = null
|
product.date = null
|
product.dutyRecordId = this.currentDutyRecord.id
|
product.startMeterMark = 0
|
product.endMeterMark = 0
|
|
product.outBatchNo = null
|
product.reelNumber = null
|
product.ifsBatchNo = null
|
product.scrapQty = null
|
product.segmentDesc = null
|
product.remark = null
|
|
product.sproductQty = 0
|
product.batchNoEdit = false
|
|
product.reelWeight = null
|
product.grossWeight = null
|
|
this.productList.push(product)
|
}
|
this.showBatchProductForm = true
|
} else {
|
this.$message.warning('当前没有人员,不可进行报工!')
|
}
|
} else {
|
this.$message.warning('当前没有上班记录,不可进行报工!')
|
}
|
} else {
|
this.$message.warning('请先选择工单')
|
}
|
} */
|
} else {
|
let productStaffs = []
|
let productStaffIds = []
|
if (this.currOperateTask.id != null) {
|
if (
|
this.currentDutyRecord != null &&
|
this.currentDutyRecord.id != null
|
) {
|
if (
|
this.personBoardList != null &&
|
this.personBoardList.length > 0
|
) {
|
this.parentInfo.workstationId = this.workstationId
|
this.parentInfo.operationTaskId = this.currOperateTask.id
|
this.parentInfo.currProductMainId = this.currProductMainId
|
this.parentInfo.currProductMainNo = this.currProductMainNo
|
this.parentInfo.partId = this.currOperateTask.partId
|
this.parentInfo.partNo = this.currOperateTask.partNo
|
this.parentInfo.partName = this.currOperateTask.partName
|
this.parentInfo.unit = this.currOperateTask.unit
|
this.parentInfo.productOutId = null
|
// 给弹出框产量列表productList赋值
|
this.productList = []
|
let product
|
if (this.groupStatus) {
|
// 按人员报工,多条或一条记录
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
product = {}
|
// cxf 0807 不清空会导致n次方的数据
|
productStaffs = []
|
productStaffIds = []
|
productStaffIds.push(this.personBoardList[i].staffId)
|
productStaffs.push(this.personBoardList[i].staffNo)
|
product.staffName = this.personBoardList[i].staffName
|
product.staffNo = this.personBoardList[i].staffNo
|
product.productNo = this.currProductMainNo
|
product.partId = this.currOperateTask.partId
|
product.partNo = this.currOperateTask.partNo
|
product.partName = this.currOperateTask.partName
|
// product.outBatchNo = this.getDayStr()
|
product.outBatchNo = null
|
product.disNumber = null
|
product.productQty = 0
|
product.unit = this.currOperateTask.unit
|
product.productStaffs = JSON.parse(
|
JSON.stringify(productStaffs)
|
)
|
product.productStaffIds = JSON.parse(
|
JSON.stringify(productStaffIds)
|
)
|
product.status = this.groupStatus
|
product.systemNo = null
|
product.date = null
|
product.dutyRecordId = this.currentDutyRecord.id
|
product.startMeterMark = 0
|
product.endMeterMark = 0
|
|
product.reelNumber = null
|
product.ifsBatchNo = null
|
product.scrapQty = null
|
product.segmentDesc = null
|
product.remark = null
|
|
product.sproductQty = 0
|
product.batchNoEdit = false
|
|
product.reelWeight = null
|
product.grossWeight = null
|
|
product.mainRemark = null
|
|
this.productList.push(product)
|
}
|
} else {
|
// 按班组报工,一条记录
|
let staffName = ''
|
let staffNo = ''
|
let staffId = ''
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffName += this.personBoardList[i].staffName + ','
|
}
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffNo += this.personBoardList[i].staffNo + ','
|
productStaffs.push(this.personBoardList[i].staffNo)
|
}
|
for (let i = 0; i < this.personBoardList.length; i++) {
|
staffId += this.personBoardList[i].staffId + ','
|
productStaffIds.push(this.personBoardList[i].staffId)
|
}
|
staffName = staffName.substring(0, staffName.length - 1)
|
staffNo = staffNo.substring(0, staffNo.length - 1)
|
|
product = {}
|
product.staffName = staffName
|
product.staffNo = staffNo
|
product.productNo = this.currProductMainNo
|
product.partId = this.currOperateTask.partId
|
product.partNo = this.currOperateTask.partNo
|
product.partName = this.currOperateTask.partName
|
// product.outBatchNo = this.getDayStr()
|
product.outBatchNo = null
|
product.disNumber = null
|
product.productQty = 0
|
product.unit = this.currOperateTask.unit
|
product.productStaffs = productStaffs
|
product.productStaffIds = productStaffIds
|
product.status = this.groupStatus
|
product.systemNo = null
|
product.date = null
|
product.dutyRecordId = this.currentDutyRecord.id
|
product.startMeterMark = 0
|
product.endMeterMark = 0
|
|
product.reelNumber = null
|
product.ifsBatchNo = null
|
product.scrapQty = null
|
product.segmentDesc = null
|
product.remark = null
|
|
product.sproductQty = 0
|
product.batchNoEdit = false
|
|
product.reelWeight = null
|
product.grossWeight = null
|
|
product.mainRemark = null
|
|
this.productList.push(product)
|
}
|
// 弹出产量填写的dialog
|
this.showBatchProductForm = true
|
} else {
|
this.$message.warning('当前没有人员,不可进行报工!')
|
}
|
} else {
|
this.$message.warning('当前没有上班记录,不可进行报工!')
|
}
|
} else {
|
this.$message.warning('请先选择工单')
|
}
|
}
|
}
|
})
|
},
|
warehousingPrint() {
|
this.LODOP = getLodop()
|
if (this.multipleSelection.length > 0) {
|
let flag = true
|
const ids = []
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.outputId)
|
if (item.state == '01draft') {
|
flag = false
|
}
|
})
|
|
if (flag) {
|
if (this.currOperateTask.id) {
|
validateIsLastOperation(this.currOperateTask.id)
|
.then((res) => {
|
const data = res.data
|
if (data.data) {
|
// 判断
|
const queryParam = {
|
ids: ids
|
}
|
|
batchLabelPrint(queryParam).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
// 更新打印次数
|
batchLabelPrintTimes(queryParam).then((response0) => {
|
const resData0 = response0.data
|
if (resData0.code === 0) {
|
if (resData.data != null && resData.data.length > 0) {
|
// 找出所有要打印的SN的list
|
const snList = []
|
resData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (let i = 0; i < resData.data.length; i++) {
|
markFlag = markArr.includes(
|
resData.data[i].outBatchNo
|
)
|
if (markFlag) {
|
this.createWarehousingLodopPrintIze(
|
resData.data[i]
|
)
|
} else {
|
this.createWarehousingLodopPrint(
|
resData.data[i]
|
)
|
}
|
}
|
})
|
}
|
}
|
})
|
}
|
})
|
} else {
|
this.$message.error('非最后一道工序,不可打印标签')
|
}
|
})
|
.catch(() => {})
|
} else {
|
this.$message.error('请选择工单!')
|
}
|
} else {
|
this.$message.error('草稿状态下,不可打印标签')
|
}
|
} else {
|
this.$message.warning('请先选择需要打印的报告')
|
}
|
},
|
warehousingPrintSingle() {
|
this.selectOutputs = this.multipleSelection
|
this.LODOP = getLodop()
|
if (this.multipleSelection.length > 0) {
|
let flag = true
|
const ids = []
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.outputId)
|
if (this.statusCheck) {
|
if (item.state == '01draft') {
|
flag = false
|
}
|
}
|
})
|
|
if (flag) {
|
if (this.currOperateTask.id) {
|
validateIsLastOperation(this.currOperateTask.id)
|
.then((res) => {
|
const data = res.data
|
if (data.data) {
|
// 判断
|
const queryParam = {
|
ids: ids
|
}
|
|
batchLabelPrint(queryParam)
|
.then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
// 更新打印次数并校验
|
checkBatchLabelPrint(
|
Object.assign(queryParam, {
|
isSubmit: !this.statusCheck
|
})
|
)
|
.then((response0) => {
|
const resData0 = response0.data
|
if (resData0.code === 0) {
|
if (resData0.data) {
|
if (
|
resData.data != null &&
|
resData.data.length > 0
|
) {
|
this.statusCheck = true
|
// 找出所有要打印的SN的list
|
const snList = []
|
resData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (
|
let i = 0;
|
i < resData.data.length;
|
i++
|
) {
|
markFlag = markArr.includes(
|
resData.data[i].outBatchNo
|
)
|
if (markFlag) {
|
this.createWarehousingLodopPrintIze(
|
resData.data[i]
|
)
|
} else {
|
this.createWarehousingLodopPrint(
|
resData.data[i]
|
)
|
}
|
}
|
})
|
} else {
|
this.statusCheck = true
|
}
|
} else {
|
this.statusCheck = true
|
// 弹出密码填写框
|
this.printData = resData
|
this.printLabelType = '3'
|
this.showPrintSecretForm = true
|
}
|
} else {
|
this.statusCheck = true
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.statusCheck = true
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.statusCheck = true
|
this.$message.error('非最后一道工序,不可打印标签')
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.$message.error('请选择工单!')
|
}
|
} else {
|
this.statusCheck = true
|
this.$message.error('草稿状态下,不可打印标签')
|
}
|
} else {
|
this.statusCheck = true
|
this.$message.warning('请先选择需要打印的报告')
|
}
|
},
|
createWarehousingLodopPrintIze(data) {
|
const currYearAndMonth = getYearAndMonth()
|
const qr = {
|
part_no: data.partNo,
|
lot_batch_no: data.ifsBatchNo,
|
qty_arrived: data.productQty,
|
// wdr: data.lotTrackingIfs ? data.outBatchNo : '*',
|
wdr: data.outBatchNo,
|
unit_meas: data.unit,
|
material_code: data.cusMaterialCode,
|
sn_no: data.outBatchNo
|
}
|
const qrStr = JSON.stringify(qr)
|
/*
|
const pattern2 = new RegExp('[A-Za-z]+')
|
const specification = ''
|
const partNameArr = data.partName
|
let m = 0
|
for (let i = 0; i < partNameArr.length; i++) {
|
if (pattern2.test(partNameArr[i])) {
|
m = i
|
break
|
}
|
} */
|
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, -1, 500, 300, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 1000, 600, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_TEXT(60, 27, 63, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(60, 54, 140, 20, data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(82, 10, 85, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(82, 58, 161, 22, data.partNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_BARCODE(53, 223, 148, 214, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
this.LODOP.ADD_PRINT_BARCODE(
|
10,
|
20,
|
368,
|
29,
|
data.outBatchNo == '*' ? '93Extended' : 'Code39',
|
data.outBatchNo
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(104, 13, 100, 20, '生产日期:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
104,
|
79,
|
171,
|
20,
|
data.productionTime == null ? '' : data.productionTime.substring(0, 10)
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(126, 40, 91, 20, '数量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
126,
|
79,
|
134,
|
20,
|
data.productQty + ' ' + data.unit
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(148, 13, 100, 20, '分段描述:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(148, 79, 160, 20, data.segmentDesc)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(170, 13, 100, 20, '规格型号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(170, 79, 310, 40, data.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_LINE(215, 20, 215, 163, 0, 2)
|
this.LODOP.ADD_PRINT_LINE(215, 197, 215, 360, 0, 2)
|
this.LODOP.ADD_PRINT_TEXT(208, 163, 34, 15, currYearAndMonth)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.ADD_PRINT_LINE(225, 20, 225, 360, 0, 2)
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
},
|
createWarehousingLodopPrint(data) {
|
const qr = {
|
part_no: data.partNo,
|
lot_batch_no: data.ifsBatchNo,
|
qty_arrived: data.productQty,
|
// wdr: data.lotTrackingIfs ? data.outBatchNo : '*',
|
wdr: data.outBatchNo,
|
unit_meas: data.unit,
|
material_code: data.cusMaterialCode,
|
sn_no: data.outBatchNo
|
}
|
const qrStr = JSON.stringify(qr)
|
/*
|
const pattern2 = new RegExp('[A-Za-z]+')
|
const specification = ''
|
const partNameArr = data.partName
|
let m = 0
|
for (let i = 0; i < partNameArr.length; i++) {
|
if (pattern2.test(partNameArr[i])) {
|
m = i
|
break
|
}
|
} */
|
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, -1, 500, 300, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 1000, 600, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_TEXT(60, 27, 63, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(60, 54, 140, 20, data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(82, 10, 85, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(82, 58, 161, 22, data.partNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_BARCODE(53, 223, 148, 214, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
this.LODOP.ADD_PRINT_BARCODE(
|
10,
|
20,
|
368,
|
29,
|
data.outBatchNo == '*' ? '93Extended' : 'Code39',
|
data.outBatchNo
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(104, 13, 100, 20, '生产日期:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
104,
|
79,
|
171,
|
20,
|
data.productionTime == null ? '' : data.productionTime.substring(0, 10)
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(126, 40, 91, 20, '数量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
126,
|
79,
|
134,
|
20,
|
data.productQty + ' ' + data.unit
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(148, 13, 100, 20, '分段描述:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(148, 79, 160, 20, data.segmentDesc)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(170, 13, 100, 20, '规格型号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(170, 79, 310, 40, data.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
},
|
// 入库标签
|
warehousingSmalllPrint() {
|
this.selectOutputs = this.multipleSelection
|
this.LODOP = getLodop()
|
if (this.multipleSelection.length > 0) {
|
let flag = true
|
const ids = []
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.outputId)
|
if (this.statusCheck) {
|
if (item.state == '01draft') {
|
flag = false
|
}
|
}
|
})
|
if (flag) {
|
if (this.currOperateTask.id) {
|
validateIsLastOperation(this.currOperateTask.id)
|
.then((res) => {
|
const data = res.data
|
if (data.data) {
|
const queryParam = {
|
ids: ids
|
}
|
batchLabelPrint(queryParam)
|
.then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
// 更新打印次数并校验
|
checkBatchLabelPrint(
|
Object.assign(queryParam, {
|
isSubmit: !this.statusCheck
|
})
|
)
|
.then((response0) => {
|
const resData0 = response0.data
|
if (resData0.code === 0) {
|
if (resData0.data) {
|
if (
|
resData.data != null &&
|
resData.data.length > 0
|
) {
|
this.statusCheck = true
|
// 找出所有要打印的SN的list
|
const snList = []
|
resData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (
|
let i = 0;
|
i < resData.data.length;
|
i++
|
) {
|
markFlag = markArr.includes(
|
resData.data[i].outBatchNo
|
)
|
if (markFlag) {
|
this.createWarehousingSmallLodopPrintIze(
|
resData.data[i]
|
)
|
} else {
|
this.createWarehousingSmallLodopPrint(
|
resData.data[i]
|
)
|
}
|
}
|
})
|
} else {
|
this.statusCheck = true
|
}
|
} else {
|
this.statusCheck = true
|
// 弹出密码填写框
|
this.printData = resData
|
this.printLabelType = '4'
|
this.showPrintSecretForm = true
|
}
|
} else {
|
this.statusCheck = true
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.statusCheck = true
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.statusCheck = true
|
this.$message.error('非最后一道工序,不可打印标签')
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.$message.error('请选择工单!')
|
}
|
} else {
|
this.statusCheck = true
|
this.$message.error('草稿状态下,不可打印标签')
|
}
|
} else {
|
this.statusCheck = true
|
this.$message.warning('请先选择需要打印的报告')
|
}
|
},
|
createWarehousingSmallLodopPrintIze(data) {
|
const currYearAndMonth = getYearAndMonth()
|
const qr = {
|
part_no: data.partNo,
|
lot_batch_no: data.ifsBatchNo,
|
qty_arrived: data.productQty,
|
// wdr: data.lotTrackingIfs ? data.outBatchNo : '*',
|
wdr: data.outBatchNo,
|
unit_meas: data.unit,
|
sn_no: data.outBatchNo
|
}
|
const qrStr = JSON.stringify(qr)
|
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, -1, 500, 300, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 1000, 600, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_TEXT(37, 45, 63, 20, '数量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(
|
63,
|
46,
|
134,
|
20,
|
data.productQty + ' ' + data.unit
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(37, 92, 63, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(69, 93, 134, 20, data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(23, 140, 77, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(57, 141, 182, 22, data.partNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_BARCODE(45, 215, 149, 181, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 7)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
this.LODOP.ADD_PRINT_LINE(215, 20, 215, 163, 0, 2)
|
this.LODOP.ADD_PRINT_LINE(215, 197, 215, 360, 0, 2)
|
this.LODOP.ADD_PRINT_TEXT(208, 163, 34, 15, currYearAndMonth)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.ADD_PRINT_LINE(225, 20, 225, 360, 0, 2)
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
},
|
createWarehousingSmallLodopPrint(data) {
|
const qr = {
|
part_no: data.partNo,
|
lot_batch_no: data.ifsBatchNo,
|
qty_arrived: data.productQty,
|
// wdr: data.lotTrackingIfs ? data.outBatchNo : '*',
|
wdr: data.outBatchNo,
|
unit_meas: data.unit,
|
sn_no: data.outBatchNo
|
}
|
const qrStr = JSON.stringify(qr)
|
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, -1, 500, 300, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 1000, 600, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_TEXT(37, 45, 63, 20, '数量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(
|
63,
|
46,
|
134,
|
20,
|
data.productQty + ' ' + data.unit
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(37, 92, 63, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(69, 93, 134, 20, data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(23, 140, 77, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_TEXT(57, 141, 182, 22, data.partNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Angle', 270)
|
this.LODOP.ADD_PRINT_BARCODE(45, 215, 149, 181, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 7)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
},
|
// 批量小标签
|
batchSmallPrint() {
|
this.selectOutputs = this.multipleSelection
|
this.LODOP = getLodop()
|
if (this.multipleSelection.length > 0) {
|
let flag = true
|
const ids = []
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.outputId)
|
if (this.statusCheck) {
|
if (item.state == '01draft') {
|
flag = false
|
}
|
}
|
})
|
if (flag) {
|
const queryParam = {
|
ids: ids
|
}
|
batchLabelPrint(queryParam)
|
.then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
// 更新打印次数并校验
|
checkBatchLabelPrint(
|
Object.assign(queryParam, { isSubmit: !this.statusCheck })
|
)
|
.then((response0) => {
|
const resData0 = response0.data
|
if (resData0.code === 0) {
|
if (resData0.data) {
|
if (resData.data != null && resData.data.length > 0) {
|
this.statusCheck = true
|
// 找出所有要打印的SN的list
|
const snList = []
|
resData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (let i = 0; i < resData.data.length; i++) {
|
markFlag = markArr.includes(
|
resData.data[i].outBatchNo
|
)
|
if (markFlag) {
|
this.createLodopSmallPrintIze(resData.data[i])
|
} else {
|
this.createLodopSmallPrint(resData.data[i])
|
}
|
}
|
})
|
} else {
|
this.statusCheck = true
|
}
|
} else {
|
this.statusCheck = true
|
// 弹出密码填写框
|
this.printData = resData
|
this.printLabelType = '2'
|
this.showPrintSecretForm = true
|
}
|
} else {
|
this.statusCheck = true
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.statusCheck = true
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.statusCheck = true
|
this.$message.error('草稿状态下,不可打印标签')
|
}
|
} else {
|
this.statusCheck = true
|
this.$message.warning('请先选择需要打印的报告')
|
}
|
},
|
createLodopSmallPrintIze(data) {
|
const currYearAndMonth = getYearAndMonth()
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, 0, 300, 100, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 600, 200, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_BARCODE(1, 25, 195, 18, '128Auto', data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(20, 25, 85, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(20, 45, 105, 20, data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(20, 100, 126, 20, data.productQty)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(20, 155, 126, 20, data.partPitch)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(28, 25, 85, 20, '零件名称:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(28, 58, 170, 35, data.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(45, 25, 190, 35, data.endProduct)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(61, 25, 85, 20, '备注:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(61, 65, 154, 31, data.remark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_LINE(71, 20, 71, 98, 0, 1)
|
this.LODOP.ADD_PRINT_LINE(71, 132, 71, 210, 0, 1)
|
this.LODOP.ADD_PRINT_TEXT(67, 98, 34, 10, currYearAndMonth)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.ADD_PRINT_LINE(75, 20, 75, 210, 0, 1)
|
this.LODOP.PRINT()
|
// this.LODOP.PREVIEW()
|
},
|
createLodopSmallPrint(data) {
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, 0, 300, 100, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 600, 200, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_BARCODE(4, 25, 195, 18, '128Auto', data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(24, 25, 85, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(24, 45, 105, 20, data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(24, 105, 126, 20, data.productQty)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(24, 155, 126, 20, data.partPitch)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(34, 25, 85, 20, '零件名称:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(34, 58, 170, 35, data.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(53, 25, 190, 35, data.endProduct)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(70, 25, 85, 20, '备注:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.ADD_PRINT_TEXT(70, 65, 154, 31, data.remark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 5)
|
this.LODOP.PRINT()
|
// this.LODOP.PREVIEW()
|
},
|
// 批量打印
|
batchPrint() {
|
this.selectOutputs = this.multipleSelection
|
this.LODOP = getLodop()
|
if (this.multipleSelection.length > 0) {
|
let flag = true
|
const ids = []
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.outputId)
|
if (this.statusCheck) {
|
if (item.state == '01draft') {
|
flag = false
|
}
|
}
|
})
|
if (flag) {
|
const queryParam = {
|
ids: ids
|
}
|
batchLabelPrint(queryParam)
|
.then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
// 更新打印次数并校验
|
checkBatchLabelPrint(
|
Object.assign(queryParam, { isSubmit: !this.statusCheck })
|
)
|
.then((response0) => {
|
const resData0 = response0.data
|
if (resData0.code === 0) {
|
if (resData0.data) {
|
if (resData.data != null && resData.data.length > 0) {
|
this.statusCheck = true
|
// 找出所有要打印的SN的list
|
const snList = []
|
resData.data.forEach((ele) => {
|
snList.push(ele.outBatchNo)
|
})
|
this.getBatchReport(7)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
for (let i = 0; i < resData.data.length; i++) {
|
markFlag = markArr.includes(
|
resData.data[i].outBatchNo
|
)
|
if (markFlag) {
|
this.createLodopPrintIze(resData.data[i])
|
} else {
|
this.createLodopPrint(resData.data[i])
|
}
|
}
|
})
|
} else {
|
this.statusCheck = true
|
}
|
} else {
|
this.statusCheck = true
|
// 弹出密码填写框
|
this.printData = resData
|
this.printLabelType = '1'
|
this.showPrintSecretForm = true
|
}
|
} else {
|
this.statusCheck = true
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.statusCheck = true
|
}
|
})
|
.catch(() => {
|
this.statusCheck = true
|
})
|
} else {
|
this.statusCheck = true
|
this.$message.error('草稿状态下,不可打印标签')
|
}
|
} else {
|
this.statusCheck = true
|
this.$message.warning('请先选择需要打印的报告')
|
}
|
},
|
createLodopPrintIze(data) {
|
const currYearAndMonth = getYearAndMonth()
|
console.log(data)
|
const qr = {
|
part_no: data.partNo,
|
lot_batch_no: data.ifsBatchNo,
|
qty_arrived: data.productQty,
|
// wdr: data.lotTrackingIfs ? data.outBatchNo : '*',
|
wdr: data.outBatchNo,
|
unit_meas: data.unit,
|
sn_no: data.outBatchNo
|
}
|
const qrStr = JSON.stringify(qr)
|
/*
|
'{"part_no":"' +
|
data.partNo +
|
'","part_name":"' +
|
data.partName +
|
'","lot_batch_no":"' +
|
data.outBatchNo +
|
'","qty_arrived":"' +
|
data.productQty +
|
'"}'
|
*/
|
// const container = document.getElementsByTagName('canvas')[0]
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, 0, 460, 230, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 1200, 600, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
// this.LODOP.ADD_PRINT_TEXT(48, 32, 85, 20, '客户订单号:')
|
// this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(48, 24, 111, 20, data.customerOrderNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(83, 32, 85, 20, '客户名称:')
|
// this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(73, 24, 109, 20, data.customerName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(106, 24, 109, 20, data.discToolMeasurement)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_BARCODE(9, 55, 368, 29, 'Code39', data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 8)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_BARCODE(119, 24, 100, 100, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 7)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
this.LODOP.ADD_PRINT_TEXT(46, 129, 75, 20, '工序:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(60, 129, 75, 20, '工作站:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(76, 129, 75, 20, '零件描述:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(107, 129, 75, 20, '生产数量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(123, 129, 75, 20, '毛重:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(137, 129, 75, 20, '检验结论:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(154, 129, 75, 20, '实际净重:')
|
this.LODOP.ADD_PRINT_TEXT(154, 129, 75, 20, '起始米标:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(170, 129, 75, 20, '理论净重:')
|
this.LODOP.ADD_PRINT_TEXT(170, 129, 75, 20, '截止米标:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(187, 129, 75, 20, '分段描述:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(46, 173, 95, 20, data.operationName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(60, 174, 95, 20, data.workstationName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(76, 179, 220, 30, data.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(107, 179, 95, 20, data.productQty)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(123, 179, 95, 20, data.grossWeight)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(137, 179, 95, 20, '')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(153, 179, 95, 20, data.netWeight)
|
this.LODOP.ADD_PRINT_TEXT(153, 179, 95, 20, data.startMeterMark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(170, 179, 95, 20, data.theoryWeight)
|
this.LODOP.ADD_PRINT_TEXT(170, 179, 95, 20, data.endMeterMark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(187, 179, 220, 20, data.segmentDesc)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(46, 252, 80, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(59, 252, 80, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(107, 252, 80, 20, '载具编号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(122, 252, 80, 20, '载具重量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(137, 252, 80, 20, '打印时间:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(152, 252, 80, 20, '生产人员:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(170, 252, 80, 20, '打印人员:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(198, 129, 80, 20, '备注:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(46, 292, 115, 20, data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(59, 293, 123, 20, data.partNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(107, 315, 115, 20, data.reelNumber)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(121, 316, 115, 20, data.reelWeight)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(
|
136,
|
316,
|
115,
|
20,
|
data.nowTime == null ? '' : data.nowTime.substring(0, 10)
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(152, 309, 115, 20, data.productionPerson)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(
|
170,
|
310,
|
115,
|
20,
|
this.userInfo.staffName == null ? '' : this.userInfo.staffName
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(198, 193, 211, 25, data.remark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_LINE(219, 20, 219, 228, 0, 2)
|
this.LODOP.ADD_PRINT_LINE(219, 262, 219, 450, 0, 2)
|
this.LODOP.ADD_PRINT_TEXT(212, 228, 34, 15, currYearAndMonth)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.ADD_PRINT_LINE(225, 20, 225, 450, 0, 2)
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
},
|
createLodopPrint(data) {
|
console.log(data)
|
const qr = {
|
part_no: data.partNo,
|
lot_batch_no: data.ifsBatchNo,
|
qty_arrived: data.productQty,
|
// wdr: data.lotTrackingIfs ? data.outBatchNo : '*',
|
wdr: data.outBatchNo,
|
unit_meas: data.unit,
|
sn_no: data.outBatchNo
|
}
|
const qrStr = JSON.stringify(qr)
|
/*
|
'{"part_no":"' +
|
data.partNo +
|
'","part_name":"' +
|
data.partName +
|
'","lot_batch_no":"' +
|
data.outBatchNo +
|
'","qty_arrived":"' +
|
data.productQty +
|
'"}'
|
*/
|
// const container = document.getElementsByTagName('canvas')[0]
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, 0, 460, 230, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 1200, 600, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
// this.LODOP.ADD_PRINT_TEXT(48, 32, 85, 20, '客户订单号:')
|
// this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(48, 24, 111, 20, data.customerOrderNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(83, 32, 85, 20, '客户名称:')
|
// this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(73, 24, 109, 20, data.customerName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(106, 24, 109, 20, data.discToolMeasurement)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_BARCODE(9, 55, 368, 29, 'Code39', data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 8)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_BARCODE(119, 24, 100, 100, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 7)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
this.LODOP.ADD_PRINT_TEXT(46, 129, 75, 20, '工序:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(60, 129, 75, 20, '工作站:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(76, 129, 75, 20, '零件描述:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(107, 129, 75, 20, '生产数量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(123, 129, 75, 20, '毛重:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(137, 129, 75, 20, '检验结论:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(154, 129, 75, 20, '实际净重:')
|
this.LODOP.ADD_PRINT_TEXT(154, 129, 75, 20, '起始米标:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(170, 129, 75, 20, '理论净重:')
|
this.LODOP.ADD_PRINT_TEXT(170, 129, 75, 20, '截止米标:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(187, 129, 75, 20, '分段描述:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(46, 173, 95, 20, data.operationName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(60, 174, 95, 20, data.workstationName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(76, 179, 214, 30, data.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(107, 179, 95, 20, data.productQty)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(123, 179, 95, 20, data.grossWeight)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(137, 179, 95, 20, '')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(153, 179, 95, 20, data.netWeight)
|
this.LODOP.ADD_PRINT_TEXT(153, 179, 95, 20, data.startMeterMark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.ADD_PRINT_TEXT(170, 179, 95, 20, data.theoryWeight)
|
this.LODOP.ADD_PRINT_TEXT(170, 179, 95, 20, data.endMeterMark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(187, 179, 220, 20, data.segmentDesc)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(46, 252, 80, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(59, 252, 80, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(107, 252, 80, 20, '载具编号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(122, 252, 80, 20, '载具重量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(137, 252, 80, 20, '打印时间:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(152, 252, 80, 20, '生产人员:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(170, 252, 80, 20, '打印人员:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(201, 129, 80, 20, '备注:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(46, 292, 115, 20, data.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(59, 293, 123, 20, data.partNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(107, 315, 115, 20, data.reelNumber)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(121, 316, 115, 20, data.reelWeight)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(
|
136,
|
316,
|
115,
|
20,
|
data.nowTime == null ? '' : data.nowTime.substring(0, 10)
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(152, 309, 115, 20, data.productionPerson)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(
|
170,
|
310,
|
115,
|
20,
|
this.userInfo.staffName == null ? '' : this.userInfo.staffName
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(202, 193, 211, 25, data.remark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
},
|
// 产出保存之后,刷新页面
|
refreshProductOutputList(val) {
|
this.queryReport.current = 1
|
this.getBatchReport(2)
|
},
|
editList() {
|
if (this.multipleSelection.length > 0) {
|
const list = this.multipleSelection
|
const objArr = []
|
list.forEach((item) => {
|
objArr.push({
|
id: item.outputId,
|
outBatchNo: item.outBatchNo
|
})
|
})
|
if (this.getFlag(list)) {
|
validateChangeProductOut(objArr).then((repsonse) => {
|
const resData = repsonse.data
|
if (resData.code == 0) {
|
const cannotEditIfsBatchNoList = resData.data
|
list.forEach((el) => {
|
const index = this.productOutputList.indexOf(el)
|
if (index > -1) {
|
this.productOutputList[index].isEdit = true
|
if (cannotEditIfsBatchNoList != null) {
|
const cannotEditIfsBatchNoObj = cannotEditIfsBatchNoList.find(
|
(item) => {
|
return el.outputId == item.id
|
}
|
)
|
if (cannotEditIfsBatchNoObj) {
|
this.productOutputList[index].isIfsBatchNoEdit = false
|
} else {
|
this.productOutputList[index].isIfsBatchNoEdit = true
|
}
|
} else {
|
this.productOutputList[index].isIfsBatchNoEdit = true
|
}
|
}
|
})
|
this.editShow = true
|
}
|
})
|
}
|
} else {
|
this.$message.error('请选择需要编辑的对象')
|
}
|
},
|
saveList() {
|
const list = JSON.parse(JSON.stringify(this.productOutputList))
|
const data = []
|
list.forEach((el) => {
|
if (el.isEdit) {
|
var productVo = {}
|
productVo.id = el.id
|
productVo.operationTaskId = this.currOperateTask.id
|
productVo.workstationId = el.workstationId
|
var productOuts = []
|
var productOut = {}
|
productOut.startMeterMark = el.startMeterMark
|
productOut.endMeterMark = el.endMeterMark
|
productOut.productQty = el.productQty
|
productOut.segmentDesc = el.segmentDesc
|
productOut.scrapQty = el.scrapQty
|
productOut.ifsBatchNo = el.ifsBatchNo
|
productOut.reelNumber = el.reelNumber
|
productOut.reelWeight = el.reelWeight
|
productOut.grossWeight = el.grossWeight
|
productOut.remark = el.remark
|
productOut.unit = el.unit
|
productOuts.push(productOut)
|
productVo.productOutputList = productOuts
|
data.push(productVo)
|
}
|
})
|
if (data.length > 0) {
|
// 先去校验当前工单是否已生产超量,若超量则弹出密码输入框,若不超量,继续报工
|
validateOverProduction(data).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
if (resData.data.success) {
|
validateOverFeed(data)
|
.then((resp) => {
|
const respData = resp.data
|
if (respData.code == 0) {
|
if (respData.data.success) {
|
batchUpdateProductMain(data).then((res) => {
|
this.$message.success('编辑成功')
|
this.editShow = false
|
this.getBatchReport(3)
|
})
|
} else {
|
// 投料不足,提示人工选择
|
// respData.data.message
|
let confirmInfo = ''
|
const confirmMessage = respData.data.message
|
confirmMessage.forEach((item) => {
|
confirmInfo = confirmInfo + item + ';<br>'
|
})
|
this.$confirm(
|
confirmInfo +
|
'<span style="color:red;">是否继续报工?</span>',
|
'提示',
|
{
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
customClass: 'validate-over-feed-message',
|
dangerouslyUseHTMLString: true,
|
closeOnClickModal: false
|
}
|
)
|
.then(() => {
|
batchUpdateProductMain(data).then((res) => {
|
this.$message.success('编辑成功')
|
this.editShow = false
|
this.getBatchReport(3)
|
})
|
})
|
.catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消报工'
|
})
|
})
|
}
|
} else {
|
this.$message.error('投料是否充足校验失败')
|
}
|
})
|
.catch((error) => {
|
console.log('失败' + new Date().getTime())
|
})
|
} else {
|
this.tipeInfo = resData.data.message
|
this.showTaskSecretForm = true
|
this.confirmList = data
|
}
|
} else {
|
this.$message.error('工单数量校验失败')
|
}
|
})
|
}
|
},
|
// 取消编辑
|
cancelSaveList() {
|
this.editShow = false
|
this.productOutputList.forEach((element) => {
|
if (element.isEdit) {
|
element.isEdit = false
|
element.isIfsBatchNoEdit = false
|
}
|
})
|
},
|
|
getBatchReport(refreshType) {
|
this.productOutputList = []
|
var obj = Object.assign(
|
{ current: this.queryReport.current, size: this.queryReport.size },
|
{
|
workstationId: this.workstationId,
|
operationTaskId: this.currOperateTask.id
|
},
|
this.paramObject
|
)
|
const _that = this
|
getProductMainV1(obj).then((res) => {
|
_that.productOutputList = res.data.data.records
|
// console.log(_that.productOutputList)
|
_that.productOutputList.forEach((element) => {
|
_that.$set(element, 'isEdit', false)
|
_that.$set(element, 'isIfsBatchNoEdit', false)
|
})
|
_that.queryReport.total = res.data.data.total
|
// this.getReportData()
|
// 根据不同的功能按钮,触发相关页面数据的刷新
|
_that.refreshRelationBusiness(refreshType)
|
})
|
},
|
refreshRelationBusiness(refreshType) {
|
if (refreshType === 1) {
|
// 批量产出后,刷新
|
// 刷新投料信息
|
// this.$emit('refreshFeeds')
|
// 刷新人工信息
|
this.$emit('refreshArtificial')
|
// 刷新产出记录
|
// this.$emit('refreshProductOutput')
|
// 刷新当前工单状态
|
// this.$emit('refreshCurrOpTask')
|
} else if (refreshType === 2) {
|
// 交班产出后,刷新
|
// 刷新投料信息
|
// this.$emit('refreshFeeds')
|
// 刷新人工信息
|
this.$emit('refreshArtificial')
|
// 刷新产出记录
|
// this.$emit('refreshProductOutput')
|
// 刷新当前工单状态
|
this.$emit('refreshCurrOpTask')
|
} else if (refreshType === 3) {
|
// 编辑产出后,刷新
|
// 刷新投料信息
|
// this.$emit('refreshFeeds')
|
// 刷新人工信息
|
this.$emit('refreshArtificial')
|
// 刷新产出记录
|
// this.$emit('refreshProductOutput')
|
// 刷新当前工单状态
|
this.$emit('refreshCurrOpTask')
|
} else if (refreshType === 4) {
|
// 删除产出后,刷新
|
// 刷新投料信息
|
// this.$emit('refreshFeedsForDel')
|
// 刷新人工信息
|
this.$emit('refreshArtificial')
|
// 刷新产出记录
|
// this.$emit('refreshProductOutput')
|
} else if (refreshType === 5) {
|
// 提交报告后,刷新
|
// 刷新工单列表
|
this.$emit('refreshOperateTasks')
|
// 刷新产出记录
|
// this.$emit('refreshProductOutput')
|
} else if (refreshType === 6) {
|
// 撤销报告后,刷新
|
// 刷新工单列表
|
this.$emit('refreshOperateTasks')
|
// 刷新产出记录
|
// this.$emit('refreshProductOutput')
|
}
|
},
|
// 提交报告
|
submitList() {
|
if (this.multipleSelection.length > 0) {
|
if (this.multipleSelection.length > 10) {
|
this.$message.error('最多只能选择10条记录进行提交!')
|
return false
|
}
|
const list = this.multipleSelection
|
if (this.getFlag(list)) {
|
this.submitLoading = true
|
var event = 'SUBMIT'
|
var submitSize = 0
|
let successSize = 0
|
const errorMsg = ''
|
var toProcessIds = []
|
list.forEach((ele) => {
|
toProcessIds.push(ele.id)
|
})
|
// 1、状态改成进行中
|
productProcessState(toProcessIds, event)
|
.then((response) => {
|
// 判断是否携带打印
|
if (this.batchPrintRadio) {
|
this.statusCheck = false
|
this.batchPrint()
|
} else if (this.batchSmallPrintRadio) {
|
this.statusCheck = false
|
this.batchSmallPrint()
|
} else if (this.warehousingPrintSingleRadio) {
|
this.statusCheck = false
|
this.warehousingPrintSingle()
|
} else if (this.warehousingSmalllPrintRadio) {
|
this.statusCheck = false
|
this.warehousingSmalllPrint()
|
}
|
this.submitLoading = false
|
this.$message.success('提交成功,刷新查看提交结果')
|
this.getBatchReport(5)
|
// 2、处理提交
|
list.forEach((ele) => {
|
var outIds = []
|
outIds.push(ele.id)
|
batchChange(outIds, event)
|
.then((response) => {
|
successSize++
|
submitSize++
|
if (submitSize === list.length) {
|
// this.submitLoading = false
|
// if (successSize === list.length) {
|
// this.$message.success('提交成功')
|
// } else {
|
// this.$message.error(errorMsg + '提交失败')
|
// }
|
// this.getBatchReport(5)
|
}
|
if (
|
this.batchPrintRadio ||
|
this.batchSmallPrintRadio ||
|
this.warehousingPrintSingleRadio ||
|
this.warehousingSmalllPrintRadio
|
) {
|
updatePrintNum({ ids: [ele.outputId] }).then(
|
(response) => {
|
this.getBatchReport(7)
|
}
|
)
|
}
|
})
|
.catch(() => {
|
// errorMsg = errorMsg + ele.outBatchNo + ';'
|
// submitSize++
|
// console.log('submitSize', submitSize)
|
// this.submitLoading = false
|
// console.log('successSize', successSize)
|
// console.log('超时......', error)
|
// if (submitSize === list.length) {
|
// console.log('submitSizeFinal', submitSize)
|
// this.submitLoading = false
|
// console.log('successSizeFinal', successSize)
|
// if (successSize === 0) {
|
// this.$message.error('处理失败')
|
// } else {
|
// this.$message.error(errorMsg + '处理失败')
|
// }
|
// this.getBatchReport(5)
|
// }
|
if (
|
this.batchPrintRadio ||
|
this.batchSmallPrintRadio ||
|
this.warehousingPrintSingleRadio ||
|
this.warehousingSmalllPrintRadio
|
) {
|
updatePrintNum({ ids: [ele.outputId] }).then(
|
(response) => {
|
this.getBatchReport(7)
|
}
|
)
|
}
|
})
|
})
|
})
|
.catch((error) => {})
|
|
// this.submitLoading = false;
|
// this.$message.success('提交成功');
|
// this.getBatchReport(5);
|
// var outIds = list.map((ele) => {
|
// return ele.id
|
// })
|
// batchChange(outIds, event)
|
// .then((response) => {
|
// this.submitLoading = false;
|
// this.$message.success('提交成功')
|
// this.getBatchReport(5)
|
// })
|
// .catch((error) => {})
|
}
|
} else {
|
this.$message.error('请选择需要提交的对象')
|
}
|
},
|
// 撤销报告
|
revokeList() {
|
if (this.multipleSelection.length > 0) {
|
if (this.multipleSelection.length > 1) {
|
this.$message.error('最多只能选择1条记录进行撤销!')
|
return false
|
}
|
const list = this.multipleSelection
|
if (this.getRevokeFlag(list)) {
|
this.removeLoading = true
|
var event = 'REVOKE'
|
var outIds = list.map((ele) => {
|
return ele.id
|
})
|
batchChange(outIds, event)
|
.then((response) => {
|
this.removeLoading = false
|
this.$message.success('撤销成功')
|
this.getBatchReport(6)
|
})
|
.catch(() => {
|
this.removeLoading = false
|
})
|
}
|
} else {
|
this.$message.error('请选择需要撤销的对象')
|
}
|
},
|
// 状态重置
|
goReset() {
|
if (this.multipleSelection.length > 0) {
|
if (this.multipleSelection.some((e) => e.state !== '04processing')) {
|
this.$message.error('只可重置处理中的工单')
|
return
|
}
|
this.resetLoading = true
|
resetState(this.multipleSelection.map((e) => e.id))
|
.then((response) => {
|
this.$message.success('重置成功')
|
this.getBatchReport(5)
|
})
|
.finally(() => {
|
this.resetLoading = false
|
})
|
} else {
|
this.$message.error('请选择需要重置的对象')
|
}
|
},
|
// 批量删除报工
|
deleteList() {
|
if (this.multipleSelection.length > 0) {
|
const list = this.multipleSelection
|
if (this.getFlag(list)) {
|
var outIds = list.map((ele) => {
|
return ele.id
|
})
|
batchCancelProductMain(outIds)
|
.then((response) => {
|
this.$message.success('删除成功')
|
this.queryReport.current = 1
|
this.getBatchReport(4)
|
})
|
.catch((error) => {})
|
}
|
} else {
|
this.$message.error('请选择需要编辑的对象')
|
}
|
},
|
getFlag(list) {
|
const l_index = list.findIndex(
|
(el) =>
|
el.state == '02submitted' ||
|
el.shiftState == '03changeshift' ||
|
el.state == '04processing'
|
)
|
if (l_index > -1) {
|
this.$message.error('只能提交草稿状态的报工单,请重新选择!')
|
return false
|
} else {
|
return true
|
}
|
},
|
getRevokeFlag(list) {
|
const l_index = list.findIndex(
|
(el) =>
|
el.state == null ||
|
el.state == '01draft' ||
|
el.state == '04processing'
|
)
|
if (l_index > -1) {
|
this.$message.error(
|
'您选择的对象中存在未提交或处理中的数据,请重新选择!'
|
)
|
return false
|
} else {
|
return true
|
}
|
},
|
searchDetail(index, row) {
|
this.searchFeed = true
|
this.$nextTick(() => {
|
this.$refs.searchFeed.init(
|
row.id,
|
this.workstationId,
|
row.productMainId,
|
row.productNo,
|
row.state,
|
row.shiftState
|
)
|
})
|
},
|
translate(index, row, event) {
|
productOutPutStateByMainId(row.id, event).then((res) => {
|
this.$message.success('操作成功')
|
this.getBatchReport(7)
|
})
|
},
|
refreshFeedsForDel() {
|
// 刷新投料信息
|
// this.$emit('refreshFeedsForDel')
|
},
|
smallPrintLabel(row) {
|
if (row.state == '01draft') {
|
this.$message.error('草稿状态下,不可打印标签')
|
} else {
|
const queryParam = {
|
type: 4,
|
id: row.id
|
}
|
getPrintUrl(queryParam).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
const url = resData.data
|
window.open(url)
|
} else {
|
this.$message.error('获取积木报表url失败')
|
}
|
})
|
}
|
},
|
printLabel(row) {
|
if (row.state == '01draft') {
|
this.$message.error('草稿状态下,不可打印标签')
|
} else {
|
const queryParam = {
|
type: 2,
|
id: row.id
|
}
|
getPrintUrl(queryParam).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
const url = resData.data
|
window.open(url)
|
} else {
|
this.$message.error('获取积木报表url失败')
|
}
|
})
|
}
|
|
// const queryParam = {
|
// type: 2,
|
// id: row.id
|
// }
|
// getPrintUrl(queryParam).then((response) => {
|
// const resData = response.data
|
// if (resData.code === 0) {
|
// document.getElementById('frame').contentWindow.location.reload(true)
|
// const url = resData.data
|
// const res = url.split('/report')
|
// this.jimusrc = '/report' + res[1]
|
// setTimeout(() => {
|
// var iframe = document.getElementById('frame')
|
// iframe.contentWindow.focus()
|
// iframe.contentWindow.print()
|
// }, 2000)
|
// // window.open(url)
|
// } else {
|
// this.$message.error('获取积木报表url失败')
|
// }
|
// })
|
},
|
handleSizeChangeReport(val) {
|
this.queryReport.size = val
|
this.queryReport.current = 1
|
this.getBatchReport(1)
|
},
|
handleCurrentChangeReport(val) {
|
this.queryReport.current = val
|
this.getBatchReport(1)
|
},
|
getReportData() {
|
const list = JSON.parse(JSON.stringify(this.reportAllData))
|
this.productOutputList = list.slice(
|
(this.queryReport.current - 1) * this.queryReport.size,
|
this.queryReport.current * this.queryReport.size
|
)
|
},
|
exportOutProduct() {
|
if (this.currOperateTask.id != null) {
|
const obj = {
|
operationTaskId: this.currOperateTask.id,
|
workstationId: this.workstationId
|
}
|
exportProductOutPut(obj).then((response) => {
|
transform(response)
|
})
|
} else {
|
this.$message.warning('请先选择工单')
|
}
|
},
|
// 查询报工列表数据
|
refreshAllData() {
|
this.initTracking()
|
if (!(!this.workstationId && this.currOperateTask.id == null)) {
|
this.queryReport.current = 1
|
this.getBatchReport(1)
|
}
|
},
|
confirmSecret() {
|
validateOverFeed(this.confirmList)
|
.then((resp) => {
|
const respData = resp.data
|
if (respData.code == 0) {
|
if (respData.data.success) {
|
batchUpdateProductMain(this.confirmList).then((res) => {
|
this.$message.success('编辑成功')
|
this.editShow = false
|
this.getBatchReport(3)
|
})
|
} else {
|
// 投料不足,提示人工选择
|
// respData.data.message
|
let confirmInfo = ''
|
const confirmMessage = respData.data.message
|
confirmMessage.forEach((item) => {
|
confirmInfo = confirmInfo + item + ';<br>'
|
})
|
this.$confirm(
|
confirmInfo + '<span style="color:red;">是否继续报工?</span>',
|
'提示',
|
{
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
customClass: 'validate-over-feed-message',
|
dangerouslyUseHTMLString: true,
|
closeOnClickModal: false
|
}
|
)
|
.then(() => {
|
batchUpdateProductMain(this.confirmList).then((res) => {
|
this.$message.success('编辑成功')
|
this.editShow = false
|
this.getBatchReport(3)
|
})
|
})
|
.catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消报工'
|
})
|
})
|
}
|
} else {
|
this.$message.error('投料是否充足校验失败')
|
}
|
})
|
.catch((error) => {
|
console.log('失败' + new Date().getTime())
|
})
|
}
|
},
|
watch: {
|
currOperateTask: {
|
handler(newValue, oldValue) {
|
// 置空明细、置空当前报工
|
this.productOutputList = []
|
this.productInputList = []
|
this.currProductMainId = null
|
this.currProductMainNo = null
|
this.currProductMainState = null
|
this.currProductMainDisable = false
|
this.reportAllData = []
|
this.paramObject.state = '01draft'
|
this.queryReport.current = 1
|
this.queryReport.total = 0
|
this.editShow = false
|
this.$nextTick(() => {
|
if (this.currItem != null && this.currItem === 'workReport') {
|
if (newValue.id) {
|
// 查询工单下所有报工productMainList
|
this.getBatchReport(7)
|
}
|
}
|
})
|
},
|
deep: true
|
},
|
workstationId() {
|
this.initTracking()
|
}
|
}
|
}
|
</script>
|