<!--
|
* @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>
|
<div>
|
<el-button
|
class="batch-out-btn"
|
type="primary"
|
:disabled="currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="addSplitTask()"
|
>新增
|
</el-button>
|
|
<el-button
|
class="change-shift-out-btn"
|
type="primary"
|
:disabled="currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="editList()"
|
>编辑
|
</el-button>
|
<el-button
|
class="batch-out-del-btn"
|
type="primary"
|
:disabled="currentDutyRecord.isConfirm"
|
v-if="editShow"
|
@click="cancelSaveList()"
|
>取消
|
</el-button>
|
<el-button
|
class="change-shift-out-btn"
|
type="primary"
|
:disabled="currentDutyRecord.isConfirm"
|
v-if="editShow"
|
@click="saveList()"
|
>保存
|
</el-button>
|
<el-button
|
class="submit-out-btn"
|
type="primary"
|
:disabled="currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="submitList()"
|
:loading="submitLoading"
|
>提交
|
</el-button>
|
<el-button
|
class="batch-out-del-btn"
|
type="primary"
|
:disabled="currentDutyRecord.isConfirm"
|
v-if="!editShow"
|
@click="deleteList()"
|
>删除
|
</el-button>
|
<el-button type="danger" class="print-btn" @click="batchSmallPrint()"
|
>小标签打印
|
</el-button>
|
<el-button
|
v-if="permissions.product_splittask_productLabel1"
|
type="danger"
|
class="print-btn"
|
@click="warehousingPrint()"
|
>成品标签1
|
</el-button>
|
<el-button
|
v-if="permissions.product_splittask_productLabel2"
|
type="danger"
|
class="print-btn"
|
@click="warehousingSmalllPrint()"
|
>成品标签2
|
</el-button>
|
</div>
|
</div>
|
<el-table
|
ref="splitTaskTable"
|
:data="splitTaskList"
|
height="calc(100% - 118px)"
|
:header-cell-style="splitTaskTableHeaderCellStyle"
|
:row-class-name="splitTaskTableRowClassName"
|
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="taskNo" align="center">
|
</el-table-column>
|
<el-table-column
|
label="状态"
|
prop="status"
|
align="center"
|
:formatter="formatStatus"
|
width="60"
|
>
|
</el-table-column>
|
<el-table-column
|
label="任务类型"
|
prop="taskType"
|
align="center"
|
:formatter="formatTaskType"
|
width="80"
|
>
|
</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="partBatchNo"
|
align="center"
|
width="120"
|
:show-overflow-tooltip="true"
|
>
|
</el-table-column>
|
<el-table-column
|
label="IFS批次号"
|
prop="ifsBatchNo"
|
align="center"
|
width="120"
|
:show-overflow-tooltip="true"
|
>
|
</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 || scope.row.isSubmitEdit"
|
v-model="scope.row.reelNumber"
|
placeholder="载具编号"
|
></el-input>
|
<template v-if="!scope.row.isEdit && !scope.row.isSubmitEdit">{{
|
scope.row.reelNumber
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="生产数量"
|
prop="productQty"
|
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.productQty"
|
placeholder="生产数量"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.productQty
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="分段描述"
|
prop="segmentDesc"
|
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.segmentDesc"
|
placeholder="分段描述"
|
></el-input>
|
<template v-if="!scope.row.isEdit">{{
|
scope.row.segmentDesc
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column label="备注" prop="remark" align="center" width="100">
|
<template slot-scope="scope">
|
<el-input
|
:id="'idReport_' + +scope.$index"
|
:ref="'reference_' + scope.$index"
|
v-if="scope.row.isEdit || scope.row.isSubmitEdit"
|
v-model="scope.row.remark"
|
placeholder="备注"
|
></el-input>
|
<template v-if="!scope.row.isEdit && !scope.row.isSubmitEdit">{{
|
scope.row.remark
|
}}</template>
|
</template>
|
</el-table-column>
|
<el-table-column label="单位" prop="unit" align="center">
|
</el-table-column>
|
<el-table-column label="生产人员" prop="productionUser" align="center">
|
</el-table-column>
|
<el-table-column
|
label="创建时间"
|
prop="createTime"
|
align="center"
|
width="120"
|
>
|
</el-table-column>
|
<el-table-column label="操作" align="center" width="80px" 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>
|
</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>
|
<splitTaskFeed v-if="searchFeed" ref="searchFeed"></splitTaskFeed>
|
<splitTaskFormDialog
|
:currshowlist.sync="showSplitTaskForm"
|
:workstationId="workstationId"
|
:currentDutyRecord="currentDutyRecord"
|
:personBoardList="personBoardList"
|
@refreshDataList="refreshSplitTaskList"
|
/>
|
<splitTaskEditBack
|
v-if="editBackFeed"
|
ref="editBackFeed"
|
:splitTaskBackEditList="splitTaskBackEditList"
|
@selectEditBackStock="goOnSave"
|
></splitTaskEditBack>
|
</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;
|
}
|
</style>
|
<script>
|
import {
|
fetchListSegmentationTaskRecord,
|
delSegmentationTask,
|
submitTaskRecord,
|
updateSegmentationTaskRecord,
|
batchLabelPrint,
|
addSegmentationTaskRecordCheckEdit
|
} from '@/api/product/segmentationtaskrecord'
|
import { mapGetters } from 'vuex'
|
import { value2label } from '../../../util/formatUtil'
|
import splitTaskFeed from './splitTask-feed.vue'
|
import { transform } from '@/util/fileTransform'
|
import splitTaskFormDialog from './splitTaskForm.vue'
|
import getLodop from '@/util/lodop'
|
import splitTaskEditBack from './splitTaskEdit-back.vue'
|
import { getYearAndMonth } from '@/util/date'
|
import { judgeLabelMark } from '@/api/warehouse/check'
|
export default {
|
components: {
|
splitTaskFeed,
|
splitTaskFormDialog,
|
splitTaskEditBack
|
},
|
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 {
|
statusTagArr: [
|
{ value: '01draft', label: '草稿' },
|
{ value: '02submitted', label: '已提交' }
|
],
|
multipleSelection: [],
|
splitTaskList: [],
|
editShow: false, // 是否编辑,
|
searchFeed: false,
|
taskTypeTagArr: [
|
{ value: 'CENT_LINE', label: '分盘' },
|
{ value: 'MERGE_DISH', label: '拼盘' },
|
{ value: 'CHECK_CENT_LINE', label: '检号分盘' }
|
],
|
queryReport: {
|
current: 1,
|
size: 10,
|
total: 0
|
},
|
LODOP: null, // 打印插件
|
submitLoading: false,
|
showSplitTaskForm: false,
|
editBackFeed: false,
|
splitTaskBackEditList: [],
|
segmentationTaskRecords: []
|
}
|
},
|
created() {},
|
computed: {
|
...mapGetters(['permissions', 'userInfo'])
|
},
|
methods: {
|
formatStatus(row, column, cellValue) {
|
return value2label(cellValue, this.statusTagArr)
|
},
|
formatTaskType(row, column, cellValue) {
|
return value2label(cellValue, this.taskTypeTagArr)
|
},
|
splitTaskTableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
|
let headerStyle = 'background:#599ef4;color:#fff;'
|
if (columnIndex === 0) {
|
headerStyle += 'border-radius: 6px 0px 0px 0px;'
|
} else if (columnIndex === 21) {
|
headerStyle += 'border-radius: 0px 6px 0px 0px;'
|
}
|
return headerStyle
|
},
|
splitTaskTableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 === 1) {
|
return 'stripe-row'
|
} else {
|
return ''
|
}
|
},
|
handleSelectionChange(val) {
|
this.multipleSelection = val
|
},
|
// 初始化页面变量
|
initTracking() {
|
this.splitTaskList = []
|
this.editShow = false
|
this.searchFeed = false
|
this.showSplitTaskForm = false
|
},
|
addSplitTask() {
|
if (!this.workstationId) {
|
this.$message.error('请选择工作站!')
|
} else {
|
this.showSplitTaskForm = true
|
}
|
},
|
// 批量小标签
|
batchSmallPrint() {
|
this.LODOP = getLodop()
|
if (this.multipleSelection.length > 0) {
|
let flag = true
|
const ids = []
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.id)
|
if (item.status == '01draft') {
|
flag = false
|
}
|
})
|
if (flag) {
|
const queryParam = {
|
ids: ids
|
}
|
batchLabelPrint(queryParam).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
if (resData.data != null && resData.data.length > 0) {
|
// 找出所有要打印的SN的list
|
const snList = []
|
resData.data.forEach((ele) => {
|
snList.push(ele.partBatchNo)
|
})
|
// 查询是否正在盘点
|
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].partBatchNo)
|
if (markFlag) {
|
this.createLodopSmallPrintIze(resData.data[i])
|
} else {
|
this.createLodopSmallPrint(resData.data[i])
|
}
|
}
|
})
|
}
|
}
|
})
|
} else {
|
this.$message.error('草稿状态下,不可打印标签')
|
}
|
} else {
|
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(4, 25, 195, 18, '128Auto', data.partBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(25, 25, 85, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(25, 65, 105, 20, data.partBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(26, 155, 126, 20, data.productQty)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(37, 25, 85, 20, '零件名称:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(37, 75, 146, 35, data.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(58, 25, 85, 20, '备注:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(58, 65, 154, 31, data.remark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
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.partBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(25, 25, 85, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(25, 65, 105, 20, data.partBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(26, 155, 126, 20, data.productQty)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(37, 25, 85, 20, '零件名称:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(37, 75, 146, 35, data.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(58, 25, 85, 20, '备注:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(58, 65, 154, 31, data.remark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.PRINT()
|
// this.LODOP.PREVIEW()
|
},
|
warehousingPrint() {
|
this.LODOP = getLodop()
|
if (this.multipleSelection.length > 0) {
|
let flag = true
|
const ids = []
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.id)
|
if (item.status == '01draft') {
|
flag = false
|
}
|
})
|
|
if (flag) {
|
// 判断
|
const queryParam = {
|
ids: ids
|
}
|
|
batchLabelPrint(queryParam).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
if (resData.data != null && resData.data.length > 0) {
|
// 找出所有要打印的SN的list
|
const snList = []
|
resData.data.forEach((ele) => {
|
snList.push(ele.partBatchNo)
|
})
|
// 查询是否正在盘点
|
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].partBatchNo)
|
if (markFlag) {
|
this.createWarehousingLodopPrintIze(resData.data[i])
|
} else {
|
this.createWarehousingLodopPrint(resData.data[i])
|
}
|
}
|
})
|
}
|
}
|
})
|
} else {
|
this.$message.error('草稿状态下,不可打印标签')
|
}
|
} else {
|
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.partBatchNo,
|
unit_meas: data.unit,
|
material_code: data.cusMaterialCode,
|
sn_no: data.partBatchNo
|
}
|
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.partBatchNo)
|
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.partBatchNo == '*' ? '93Extended' : 'Code39',
|
data.partBatchNo
|
)
|
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.createTime == null ? '' : data.createTime.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.partBatchNo : '*',
|
wdr: data.partBatchNo,
|
unit_meas: data.unit,
|
material_code: data.cusMaterialCode == null ? '' : data.cusMaterialCode,
|
sn_no: data.partBatchNo
|
}
|
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(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.partBatchNo)
|
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.partBatchNo == '*' ? '93Extended' : 'Code39',
|
data.partBatchNo
|
)
|
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.createTime == null ? '' : data.createTime.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.LODOP = getLodop()
|
if (this.multipleSelection.length > 0) {
|
let flag = true
|
const ids = []
|
this.multipleSelection.forEach((item) => {
|
ids.push(item.id)
|
if (item.status == '01draft') {
|
flag = false
|
}
|
})
|
if (flag) {
|
const queryParam = {
|
ids: ids
|
}
|
batchLabelPrint(queryParam).then((response) => {
|
const resData = response.data
|
if (resData.code === 0) {
|
if (resData.data != null && resData.data.length > 0) {
|
// 找出所有要打印的SN的list
|
const snList = []
|
resData.data.forEach((ele) => {
|
snList.push(ele.partBatchNo)
|
})
|
// 查询是否正在盘点
|
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].partBatchNo)
|
if (markFlag) {
|
this.createWarehousingSmallLodopPrintIze(resData.data[i])
|
} else {
|
this.createWarehousingSmallLodopPrint(resData.data[i])
|
}
|
}
|
})
|
}
|
}
|
})
|
} else {
|
this.$message.error('草稿状态下,不可打印标签')
|
}
|
} else {
|
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.partBatchNo,
|
unit_meas: data.unit,
|
sn_no: data.partBatchNo
|
}
|
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.partBatchNo)
|
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.partBatchNo : '*',
|
wdr: data.partBatchNo,
|
unit_meas: data.unit,
|
sn_no: data.partBatchNo
|
}
|
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.partBatchNo)
|
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()
|
},
|
// 产出保存之后,刷新页面
|
refreshSplitTaskList(val) {
|
this.queryReport.current = 1
|
this.getBatchReport(2)
|
},
|
editList() {
|
if (this.multipleSelection.length > 0) {
|
const list = this.multipleSelection
|
let mergeNum = 0
|
let mergeId
|
if (list.length > 1) {
|
list.forEach((item) => {
|
if (item.taskType == 'MERGE_DISH') {
|
if (!mergeId) {
|
mergeId = item.taskId
|
mergeNum++
|
} else {
|
if (mergeId != item.taskId) {
|
mergeNum++
|
}
|
}
|
}
|
})
|
}
|
if (mergeNum > 1) {
|
this.$message.error('单次只能编辑单个【拼盘】任务')
|
} else {
|
list.forEach((el) => {
|
const index = this.splitTaskList.indexOf(el)
|
if (index > -1) {
|
if (el.status == '01draft') {
|
this.splitTaskList[index].isEdit = true
|
this.splitTaskList[index].isSubmitEdit = false
|
} else {
|
this.splitTaskList[index].false = true
|
this.splitTaskList[index].isSubmitEdit = true
|
}
|
}
|
})
|
this.editShow = true
|
}
|
} else {
|
this.$message.error('请选择需要编辑的对象')
|
}
|
},
|
saveList() {
|
if (this.multipleSelection.length > 0) {
|
const flag = this.checkProductQuality()
|
if (flag) {
|
const segmentationTaskRecords = []
|
this.multipleSelection.forEach((item) => {
|
segmentationTaskRecords.push({
|
id: item.id,
|
reelNumber: item.reelNumber,
|
productQty: item.productQty,
|
segmentDesc: item.segmentDesc,
|
remark: item.remark,
|
taskId: item.taskId,
|
returnInputStockId: null
|
})
|
})
|
addSegmentationTaskRecordCheckEdit(segmentationTaskRecords).then(
|
(resp) => {
|
const resData = resp.data
|
if (resData.data.length > 0) {
|
this.splitTaskBackEditList = resData.data
|
this.segmentationTaskRecords = segmentationTaskRecords
|
this.editBackFeed = true
|
this.$nextTick(() => {
|
this.$refs.editBackFeed.init()
|
})
|
} else {
|
this.doSave(segmentationTaskRecords)
|
}
|
}
|
)
|
}
|
} else {
|
this.$message.error('请选择需要保存的对象')
|
}
|
},
|
doSave(segmentationTaskRecords) {
|
updateSegmentationTaskRecord(segmentationTaskRecords)
|
.then((response) => {
|
this.$message.success('保存成功')
|
this.editShow = false
|
this.splitTaskList.forEach((element) => {
|
if (element.isEdit) {
|
element.isEdit = false
|
}
|
if (element.isSubmitEdit) {
|
element.isSubmitEdit = false
|
}
|
})
|
this.queryReport.current = 1
|
this.getBatchReport(4)
|
})
|
.catch((error) => {})
|
},
|
goOnSave(param) {
|
if (param) {
|
this.segmentationTaskRecords.forEach((item) => {
|
if (item.taskId == param.taskId) {
|
item.returnInputStockId = param.stockId
|
}
|
})
|
this.doSave(this.segmentationTaskRecords)
|
}
|
},
|
// 取消编辑
|
cancelSaveList() {
|
this.editShow = false
|
this.splitTaskList.forEach((element) => {
|
if (element.isEdit) {
|
element.isEdit = false
|
}
|
if (element.isSubmitEdit) {
|
element.isSubmitEdit = false
|
}
|
})
|
},
|
|
getBatchReport(refreshType) {
|
this.splitTaskList = []
|
const obj = Object.assign(
|
{ current: this.queryReport.current, size: this.queryReport.size },
|
{
|
dutyRecordId: this.currentDutyRecord.id
|
}
|
)
|
const _that = this
|
fetchListSegmentationTaskRecord(obj).then((res) => {
|
_that.splitTaskList = res.data.data.records
|
_that.splitTaskList.forEach((element) => {
|
_that.$set(element, 'isEdit', false)
|
_that.$set(element, 'isSubmitEdit', false)
|
})
|
_that.queryReport.total = res.data.data.total
|
})
|
},
|
// 提交任务
|
submitList() {
|
if (this.multipleSelection.length > 0) {
|
const list = this.multipleSelection
|
if (this.getFlag(list)) {
|
this.submitLoading = true
|
const ids = list.map((ele) => {
|
return ele.id
|
})
|
submitTaskRecord(ids)
|
.then((response) => {
|
this.submitLoading = false
|
this.$message.success('提交成功')
|
this.queryReport.current = 1
|
this.getBatchReport(4)
|
})
|
.catch((error) => {
|
this.submitLoading = false
|
})
|
}
|
} else {
|
this.$message.error('请选择需要提交的对象')
|
}
|
},
|
// 批量删除分割任务
|
deleteList() {
|
if (this.multipleSelection.length > 0) {
|
const list = this.multipleSelection
|
if (this.getFlag(list)) {
|
const ids = list.map((ele) => {
|
return ele.id
|
})
|
delSegmentationTask(ids)
|
.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')
|
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)
|
})
|
},
|
refreshAllData() {
|
this.initTracking()
|
if (this.workstationId) {
|
this.queryReport.current = 1
|
this.getBatchReport(1)
|
}
|
},
|
handleSizeChangeReport(val) {
|
this.queryReport.size = val
|
this.queryReport.current = 1
|
this.getBatchReport(1)
|
},
|
handleCurrentChangeReport(val) {
|
this.queryReport.current = val
|
this.getBatchReport(1)
|
},
|
checkProductQuality() {
|
let flag = true
|
let flagMsg = ''
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
if (this.multipleSelection[i].status == '01draft') {
|
if (
|
this.multipleSelection[i].productQty == null ||
|
this.multipleSelection[i].productQty == ''
|
) {
|
flag = false
|
flagMsg = flagMsg + '生产数量不能为空;'
|
} else {
|
if (!this.checkZero(this.multipleSelection[i].productQty)) {
|
flag = false
|
flagMsg = flagMsg + '生产数量不能为0;'
|
} else {
|
if (!this.checkPositive(this.multipleSelection[i].productQty)) {
|
flag = false
|
flagMsg = flagMsg + '生产数量需为正数;'
|
} else {
|
if (!this.checkDecimal(this.multipleSelection[i].productQty)) {
|
flag = false
|
flagMsg = flagMsg + '生产数量最多六位小数;'
|
}
|
}
|
}
|
}
|
}
|
}
|
if (!flag) {
|
this.$message.error(flagMsg)
|
}
|
return flag
|
},
|
checkZero(value) {
|
if (value == 0) {
|
return false
|
} else {
|
return true
|
}
|
},
|
checkPositive(value) {
|
if (!/^[0-9]+.?[0-9]*$/.test(value)) {
|
return false
|
} else {
|
return true
|
}
|
},
|
checkDecimal(value) {
|
if (
|
!/(^[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^(0){1}$)|(^[0-9]\.[0-9]{1,6}$)/.test(
|
value
|
)
|
) {
|
return false
|
} else {
|
return true
|
}
|
}
|
},
|
watch: {
|
currOperateTask: {
|
handler(newValue, oldValue) {
|
// 置空明细、置空当前报工
|
this.splitTaskList = []
|
this.reportAllData = []
|
this.queryReport.current = 1
|
this.queryReport.total = 0
|
this.editShow = false
|
this.$nextTick(() => {
|
if (this.currItem != null && this.currItem === 'splitTask') {
|
if (newValue.id) {
|
// 查询机台线边仓下所有的分割任务
|
// TODO
|
}
|
}
|
})
|
},
|
deep: true
|
},
|
workstationId() {
|
this.initTracking()
|
}
|
}
|
}
|
</script>
|