| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268 |
- <template>
- <ele-modal :visible.sync="visible" type="工单打印" width="1200px" :close-on-click-modal="false">
- <div class="print-container" ref="pagesRef">
- <el-row class="main-data">
- <el-col :span="6">
- <div class="bg"> 生产工单号 </div>
- <div class="code">条码区</div>
- <div class="value">{{ infoData.code }}</div>
- </el-col>
- <el-col :span="5">
- <div class="bg">生产版本</div>
- <div class="value">{{ infoData.produceVersionName }}</div>
- <div class="bg">物料编码</div>
- <div class="value">{{ infoData.productCode }}</div>
- </el-col>
- <el-col :span="5">
- <div class="bg">计划编号</div>
- <div class="value">{{ infoData.productionPlanCode }}</div>
- <div class="bg">产品名称</div>
- <div class="value">{{ infoData.productName }}</div>
- </el-col>
- <el-col :span="4">
- <div class="bg">计划类型</div>
- <div class="value">{{ typeList[infoData.planType] }}</div>
- <div class="bg">要求生产数量</div>
- <div class="value">{{ infoData.formingNum }}PCS</div>
- </el-col>
- <el-col :span="4">
- <div class="bg">工单状态</div>
- <div class="value">{{ statusList[infoData.status] }}</div>
- <div class="bg">要求生产重量</div>
- <div class="value">{{ infoData.formingWeight }}KG</div>
- </el-col>
- </el-row>
- <template v-for="(item, index) in processList">
- <el-row
- class="processes-data"
- :key="index"
- v-if="item.taskTypeName === '挤压生产'"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 挤压生产</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in extrusion"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row
- class="processes-data"
- :key="index"
- v-else-if="item.taskTypeName === '自然干燥'"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 自然干燥</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in drying"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row
- class="processes-data"
- :key="index"
- v-else-if="item.taskTypeName === '升温干燥'"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 升温干燥</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in temperature"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row
- class="processes-data"
- :key="index"
- v-else-if="item.taskTypeName.includes('定长')"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 半加定长</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in halflong"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row
- class="processes-data"
- :key="index"
- v-else-if="item.taskTypeName === '备炉'"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 备炉</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in furnace"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row
- class="processes-data"
- :key="index"
- v-else-if="item.taskTypeName === '烧结'"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 烧结</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in sinter"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row
- class="processes-data"
- :key="index"
- v-else-if="item.taskTypeName === '质检'"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 质检</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in quality"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row
- class="processes-data"
- :key="index"
- v-else-if="item.taskTypeName === '包装'"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 包装</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in packageOpt"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- <el-col
- v-for="material in itm.workReportCategoryList.filter(
- (i) => i.rootCategoryLevelId == 10
- )"
- :span="24"
- style="padding-left: 0"
- :key="material.code"
- >
- <el-col :span="8" class="border-dashed-right border-dashed-bottom"
- >物料名称:{{ material.name }}
- </el-col>
- <el-col :span="4" class="border-dashed-right border-dashed-bottom"
- >物料编码:{{ material.code }}
- </el-col>
- <el-col :span="4" class="border-dashed-right border-dashed-bottom"
- >物料数量:{{ material.number }}
- </el-col>
- <el-col :span="8" class="border-dashed-right border-dashed-bottom"
- >批次号:{{ material.batchNo }}
- </el-col>
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row
- :key="index"
- class="processes-data"
- v-else-if="item.taskTypeName.includes('库')"
- >
- <el-col :span="24" class="bg top">
- <div class="title">{{ index + 1 }}0 入库</div>
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in preStorage"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- <el-row class="processes-data" :key="index" v-else>
- <el-col :span="24" class="bg top">
- <div class="title"
- >{{ index + 1 }}0
- {{
- item.taskTypeName === '深加工'
- ? '深加工(精磨)'
- : item.taskTypeName
- }}</div
- >
- </el-col>
- <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
- <template v-for="(itm, idx) in item.list || []">
- <el-col
- :span="t.span"
- class="border-dashed-right border-dashed-bottom"
- v-for="(t, i) in deepProcesse"
- :key="i + '-' + idx"
- >
- {{ t.label }}:{{
- (t.formatter && t.formatter(itm)) || itm[t.key]
- }}
- </el-col>
- </template>
- <el-col :span="24" v-if="!(item.list && item.list.length)">
- <div class="no-data">暂无数据</div>
- </el-col>
- </el-row>
- </template>
- </div>
- <div slot="footer">
- <el-button type="primary" @click="handlePrint">打印</el-button>
- <el-button @click="cancel">取消</el-button>
- </div>
- </ele-modal>
- </template>
- <script>
- import {
- downloadPDF,
- canvasSplit,
- a4Height,
- a4Width,
- margin
- } from '@/utils/pdf.js';
- import { printWorkOrderInfo } from '@/api/produceOrder/index.js';
- export default {
- props: {
- infoData: {
- type: Object,
- default: () => ({})
- },
- processList: {
- type: Array,
- default: () => []
- },
- workOrderId: {
- type: String,
- default: ''
- }
- },
- data() {
- return {
- visible: false,
- typeList: {
- 1: '内销订单',
- 2: '外销订单',
- 3: '预制订单'
- },
- statusList: {
- 4: '待生产',
- 5: '生产中',
- 6: '已完成',
- 7: '已延期'
- },
- // 挤压生产
- extrusion: [
- {
- label: '原料牌号',
- key: 'brandNo',
- span: 8,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.workReportCategoryList[0]?.brandNum;
- }
- },
- {
- label: '原料批次号',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.workReportCategoryList[0]?.batchNo;
- }
- },
- {
- label: '投料重量(KG)',
- key: 'feedingWeight',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return (
- itm.workReportCategoryList[0]?.number ||
- itm.workReportCategoryList[0]?.totalWeight
- );
- }
- },
- {
- label: '合格数',
- key: 'standardNum',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.standardNum + '';
- }
- },
- {
- label: '不合格数',
- key: 'noStandardNum',
- span: 4,
- class: 'border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.noStandardNum || '0';
- }
- },
- {
- label: '设备号',
- key: 'deviceCode',
- span: 8,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 4
- );
- return obj?.code;
- }
- },
- {
- label: '模具编号/型号',
- key: 'xxx',
- span: 8,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 5
- );
- return obj && obj.code + '/' + obj.model;
- }
- },
- {
- label: '舟皿名称',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 8
- );
- return obj?.name;
- }
- },
- {
- label: '舟皿数量',
- key: 'boatNum',
- span: 4,
- class: 'border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 8
- );
- return obj?.extraField?.boatNum || '0';
- }
- },
- {
- label: '冲压次数',
- key: 'stampingTimes',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 5
- );
- return obj?.extraField?.stampingTimes;
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom'
- },
- {
- label: '备注',
- key: 'remark',
- span: 12,
- class: 'border-dashed-right border-dashed-bottom'
- }
- // {
- // label: '清缸时长',
- // key: 'xxx',
- // span: 8
- // }
- ],
- // 自然干燥
- drying: [
- {
- label: '干燥时长(分钟)',
- key: 'dryingDuration',
- span: 8,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.workReportArea?.extraField?.dryTime;
- }
- },
- {
- label: '合格数',
- key: 'standardNum',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.standardNum + '';
- }
- },
- {
- label: '不合格数',
- key: 'noStandardNum',
- span: 4,
- class: 'border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.noStandardNum || '0';
- }
- },
- {
- label: '区域编号',
- key: 'areaCode',
- span: 8,
- class: 'border-dashed-bottom',
- formatter(itm) {
- return itm.workReportArea?.code;
- }
- },
- {
- label: '舟皿编码',
- key: 'xxx',
- span: 8,
- class: 'border-dashed-right ',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 8
- );
- return obj?.code;
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '备注',
- key: 'remark',
- span: 4,
- class: 'border-dashed-right'
- }
- ],
- // 升温燥
- temperature: [
- {
- label: '升温曲线',
- key: 'temperatureRamp',
- span: 8,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 4
- );
- return obj?.extraField?.temperatureRamp;
- }
- },
- // {
- // label: '干燥时长(分钟)',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- {
- label: '合格数',
- key: 'standardNum',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.standardNum + '';
- }
- },
- {
- label: '不合格数',
- key: 'noStandardNum',
- span: 4,
- class: 'border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.noStandardNum || '0';
- }
- },
- {
- label: '设备号',
- key: 'deviceCode',
- span: 8,
- class: ' border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 4
- );
- return obj?.code;
- }
- },
- {
- label: '舟皿编码',
- key: 'xxx',
- span: 8,
- class: 'border-dashed-right',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 8
- );
- return obj?.code;
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '备注',
- key: 'remark',
- span: 8,
- class: 'border-dashed-right'
- }
- ],
- // 半加定长
- halflong: [
- // {
- // label: '长度(mm)',
- // key: 'xxx',
- // span: 8,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- {
- label: '合格数',
- key: 'standardNum',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.standardNum + '';
- }
- },
- {
- label: '不合格数',
- key: 'noStandardNum',
- span: 4,
- class: 'border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.noStandardNum || '0';
- }
- },
- {
- label: '设备号',
- key: 'deviceCode',
- span: 8,
- class: ' border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 4
- );
- return obj?.code;
- }
- },
- {
- label: '舟皿名称',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 8
- );
- return obj?.name;
- }
- },
- {
- label: '舟皿数量',
- key: 'boatNum',
- span: 4,
- class: 'border-dashed-right',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 8
- );
- return obj?.extraField?.boatNum || '0';
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '备注',
- key: 'remark',
- span: 4,
- class: 'border-dashed-right'
- }
- ],
- // 备炉
- furnace: [
- {
- label: '产品数量',
- key: 'xxx',
- span: 8,
- class: 'border-dashed-right',
- formatter(itm) {
- const obj = itm.workReportCategoryList.find(
- (i) => i.rootCategoryLevelId == 9
- );
- return obj?.number;
- }
- },
- {
- label: '设备号',
- key: 'deviceCode',
- span: 4,
- class: 'border-dashed-right',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 4
- );
- return obj?.code;
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 8,
- class: 'border-dashed-right'
- }
- // {
- // label: '备注',
- // key: 'remark',
- // span: 4,
- // class: 'border-dashed-right'
- // }
- ],
- // 烧结
- sinter: [
- // {
- // label: '烧结曲线',
- // key: 'sinteringCurve',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- {
- label: '合格数',
- key: 'standardNum',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.standardNum + '';
- }
- },
- {
- label: '不合格数',
- key: 'noStandardNum',
- span: 4,
- class: 'border-dashed-bottom border-dashed-right',
- formatter(itm) {
- return itm.productInfo?.noStandardNum || '0';
- }
- },
- {
- label: '设备号',
- key: 'deviceCode',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 4
- );
- return obj?.code;
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '备注',
- key: 'remark',
- span: 4,
- class: 'border-dashed-right'
- }
- ],
- // 质检
- // quality: [
- // {
- // label: '半检结果',
- // key: 'xxx',
- // span: 12,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '员工号',
- // key: 'executorJobNum',
- // span: 4,
- // class: 'border-dashed-right'
- // },
- // {
- // label: '日期',
- // key: 'executeTime',
- // span: 4,
- // class: 'border-dashed-right'
- // },
- // {
- // label: '成检结果',
- // key: 'xxx',
- // span: 12,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '员工号',
- // key: 'executorJobNum',
- // span: 4,
- // class: 'border-dashed-right'
- // },
- // {
- // label: '日期',
- // key: 'executeTime',
- // span: 4,
- // class: 'border-dashed-right'
- // },
- // {
- // label: '外径',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '长度',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '垂直度',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '圆度',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '跳动',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-bottom'
- // },
- // {
- // label: '抗拆/损伤',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '直线度',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '粗糙度',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '其它',
- // key: 'xxx',
- // span: 4,
- // class: ' border-dashed-bottom border-dashed-right '
- // },
- // {
- // label: '合格数',
- // key: 'standardNum',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '合格数',
- // key: 'noStandardNum',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '待处理',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '让步',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-right border-dashed-bottom'
- // },
- // {
- // label: '可修',
- // key: 'xxx',
- // span: 4,
- // class: 'border-dashed-bottom'
- // },
- // {
- // label: '员工号',
- // key: 'executorJobNum',
- // span: 4,
- // class: 'border-dashed-right'
- // },
- // {
- // label: '日期',
- // key: 'executeTime',
- // span: 4,
- // class: 'border-dashed-right'
- // },
- // {
- // label: '备注',
- // key: 'remark',
- // span: 4,
- // class: 'border-dashed-right'
- // }
- // ],
- // 深加工
- deepProcesse: [
- {
- label: '合格数',
- key: 'standardNum',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.standardNum + '';
- }
- },
- {
- label: '不合格数',
- key: 'noStandardNum',
- span: 4,
- class: 'border-dashed-bottom',
- formatter(itm) {
- return itm.productInfo?.noStandardNum || '0';
- }
- },
- {
- label: '设备号',
- key: 'deviceCode',
- span: 4,
- class: 'border-dashed-right',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 4
- );
- return obj?.code;
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '备注',
- key: 'remark',
- span: 4,
- class: 'border-dashed-right'
- }
- ],
- // 包装
- packageOpt: [
- {
- label: '包装要求',
- key: 'xxx',
- span: 8,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm?.packInfo?.packDemand;
- }
- },
- {
- label: '包装单位',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm?.packInfo?.packUnit;
- }
- },
- {
- label: '包装数量',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm?.packInfo?.packNum;
- }
- },
- {
- label: '最小包装单元',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return `${itm.packInfo.minPackNum}PCS/${itm.packInfo.packUnit}`;
- }
- },
- {
- label: '净重',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm?.packInfo?.netWeight;
- }
- },
- {
- label: '毛重',
- key: 'xxx',
- span: 4,
- class: ' border-dashed-bottom',
- formatter(itm) {
- return itm?.packInfo?.roughWeight;
- }
- },
- {
- label: '尾料',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- return itm?.packInfo?.surplusNum;
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 4,
- class: 'border-dashed-right'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 12,
- class: 'border-dashed-right'
- }
- // {
- // label: '备注',
- // key: 'remark',
- // span: 12,
- // class: 'border-dashed-right'
- // }
- ],
- // 预缴库
- preStorage: [
- {
- label: '产品数量',
- key: 'xxx',
- span: 4,
- class: 'border-dashed-right border-dashed-bottom',
- formatter(itm) {
- const obj = (itm.workReportDeviceList || []).find(
- (i) => i.rootCategoryLevelId == 9
- );
- return obj?.number;
- }
- },
- {
- label: '员工号',
- key: 'executorJobNum',
- span: 8,
- class: 'border-dashed-right'
- },
- {
- label: '日期',
- key: 'executeTime',
- span: 12,
- class: 'border-dashed-right'
- }
- ]
- };
- },
- methods: {
- open() {
- this.visible = true;
- this.init();
- },
- init() {
- for (const p of this.processList) {
- this.$set(p, 'list', []);
- }
- printWorkOrderInfo(this.workOrderId).then((res) => {
- for (const t of res.taskInfo) {
- for (const p of this.processList) {
- if (t.taskName === p.taskTypeName && t.taskCode === p.taskCode) {
- p.list.push(t);
- }
- }
- }
- });
- },
- cancel() {
- this.visible = false;
- },
- //打印
- handlePrint() {
- this.PrintLoading = true;
- const page = this.$refs.pagesRef;
- const pHeight = page.offsetHeight;
- const pWidth = page.offsetWidth;
- const lineHeight = 36;
- const onePageHeight = (a4Height / a4Width) * pWidth;
- const maxPageHeight = Math.min(
- Math.floor(onePageHeight / lineHeight) * lineHeight,
- pHeight
- );
- let leftH = pHeight;
- const splitPos = [];
- do {
- splitPos.push(
- (splitPos[splitPos.length - 1] || 0) +
- (leftH > maxPageHeight ? maxPageHeight : leftH)
- );
- leftH -= maxPageHeight;
- } while (leftH > 0);
- downloadPDF(page, splitPos, '生产工单').then(
- () => (this.PrintLoading = false)
- );
- }
- }
- };
- </script>
- <style scoped lang="scss">
- $heihgt: 36px;
- $border: 1px solid #ddd;
- * {
- box-sizing: border-box !important;
- }
- .bg {
- background-color: #f1f1f1;
- line-height: $heihgt - 2px;
- height: $heihgt;
- }
- .border-dashed-right {
- border-right: $border;
- }
- .border-dashed-bottom {
- border-bottom: $border;
- }
- .main-data {
- .bg {
- text-align: center;
- border-right: $border;
- border-bottom: $border;
- }
- .value {
- line-height: $heihgt - 2px;
- height: $heihgt;
- border-right: $border;
- border-bottom: $border;
- padding-left: 10px;
- }
- .code {
- line-height: 2 * $heihgt;
- height: 2 * $heihgt;
- border-right: $border;
- border-bottom: $border;
- text-align: center;
- color: rgba(0, 0, 0, 0.3);
- font-size: 18px;
- }
- }
- .print-container {
- border-top: $border;
- border-left: $border;
- border-right: $border;
- font-size: 14px;
- }
- .processes-data {
- .title {
- color: #000;
- font-weight: bold;
- }
- :deep(.el-col) {
- line-height: $heihgt - 2px;
- height: $heihgt;
- padding-left: 10px;
- }
- .top {
- border-top: $border;
- border-bottom: $border;
- }
- }
- </style>
|