1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497 |
- <template>
- <div>
- <Modal v-model="fullscreenModal" fullscreen title="工位屏" @on-cancel='cancel'>
- <div slot="header">
- <span style="font-size: 0.5rem">工位屏</span>
- <div class="fullscreen-title-btn">
- <Button type="primary" size='large' style="margin-right:1rem" @click="handleCancelPrint">撤销打印</Button>
- <Button
- @click="handleWideScreenClick"
- size="large"
- id="full_screen_btn"
- type="primary"
- style="margin-right: 1rem"
- >
- {{ isWideScreen ? "完整模式" : "简单模式" }}
- </Button>
- <Button
- @click="handleFullScreenClick"
- size="large"
- id="full_screen_btn"
- type="primary"
- style="margin-right: 1rem"
- >
- {{ isFullScreen ? "收 缩" : "全 屏" }}
- </Button>
- <Button
- @click="handlePrint"
- size="large"
- type="primary"
- style="margin-right: 1rem"
- >
- 打 印
- </Button>
- <!-- <Button
- @click="handleOk"
- size="large"
- type="primary"
- style="margin-right: 1rem"
- >
- 完 工
- </Button> -->
- <Button
- style="margin-right: 1rem"
- @click="goCheckPage(1)"
- size="large"
- type="primary"
- >
- 补 打
- </Button>
- <Button
- style="margin-right: 1rem"
- @click="goCheckPage(2)"
- size="large"
- type="primary"
- >
- 设备打印
- </Button>
- </div>
- </div>
- <div class="fullscreen-content">
- <div class="fullscreen-content-select">
- <div class="fullscreen-content-select-block">
- <Button
- @click="handleSelection(ordernoObj, 1)"
- size="large"
- type="primary"
- style="margin-right: 10px"
- >
- 项目选择
- </Button>
- <div class="icon-wrapper" v-show="selectedInfo.order_no">
- <Icon
- class="icon-close"
- @click="handleCancelSelected('order_no')"
- size="24"
- type="md-close"
- />
- <div>
- <span>订单编号:</span>
- <span>{{ selectedInfo.order_no }}</span>
- </div>
- <div>
- <span>项目名称:</span>
- <span>{{ selectedInfo.residential_name }}</span>
- </div>
- </div>
- </div>
- <div class="fullscreen-content-select-block">
- <Button
- @click="handleSelection(urlObj, 2)"
- size="large"
- type="primary"
- style="margin-right: 10px"
- >
- 图号选择
- </Button>
- <div style="display: flex; align-items: center">
- <div class="icon-wrapper">
- <div v-show="selectedInfo.url_number">
- <Icon
- class="icon-close"
- @click="handleCancelSelected('product_id')"
- size="24"
- type="md-close"
- />
- <span>图号:</span>
- <span>{{ selectedInfo.url_number }}</span>
- </div>
- </div>
- </div>
- </div>
- <div class="fullscreen-content-select-block">
- <Button
- @click="handleSelectionRowno(rownoObj)"
- size="large"
- type="primary"
- style="margin-right: 10px"
- >
- 行号选择
- </Button>
- <div
- class="icon-wrapper"
- v-show="selectedInfo.rows.length != 0"
- style="display: flex; align-items: center"
- >
- <span>行号:</span>
- <div style="display: flex; justify-content: flex-start">
- <div v-for="(item, index) in selectedInfo.rows" :key="item.key">
- <div class="icon-wrapper" style="margin-right: 0.35rem">
- <Icon
- class="icon-close"
- @click="handleCancelSelected(index, 1)"
- size="24"
- type="md-close"
- />
- <span style="display: inline-block"
- >{{ item.start }}-{{ item.end }}</span
- >
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="fullscreen-content-select-block">
- <Button
- @click="handleSelectionCancel"
- size="large"
- type="primary"
- :ghost='selectedAll?true:false'
- style="margin-right: 10px"
- v-if="selectedAll"
- >
- 取消全选
- </Button>
- <Button
- @click="handleSelectionAll"
- size="large"
- type="primary"
- :ghost='selectedAll?true:false'
- style="margin-right: 10px"
- v-else
- >
- 全选
- </Button>
- </div>
- </div>
- <div class="fullscreen-content-choose">
- <div
- :class="[
- choose.isChoosed
- ? 'fullscreen-content-choose-block fullscreen-content-choose-block-choosen'
- : 'fullscreen-content-choose-block fullscreen-content-choose-block-unchoosen',
- isWideScreen ? 'fullscreen-content-choose-block-wide' : '',
- ]"
- v-for="choose in contentData"
- :key="choose.row"
- @click="handleChooseBlockClick(choose)"
- >
- <div
- :class="[isWideScreen ? 'chip-tag-choosed' : 'chip-tag']"
- v-show="choose.type == 1"
- >
- 芯片
- <Icon
- size="20px"
- :style="
- isWideScreen
- ? 'font-size: 1rem; transform: translate(0, -50%)'
- : 'font-size: 1rem; transform: translate(0, -40%)'
- "
- style="font-size: 1rem; transform: translate(0, -40%)"
- :color="choose.isChoosed ? '#2d8cf0' : 'white'"
- type="md-arrow-dropup"
- />
- </div>
- <div v-show="!isWideScreen">
- <span>行号</span>
- <span>{{ choose.row_no }}</span>
- </div>
- <div v-show="!isWideScreen">
- <span>部件</span>
- <span>{{ choose.part_title }}</span>
- </div>
- <div v-show="!isWideScreen">
- <span>材料</span>
- <span>{{ choose.sub_part_title }}</span>
- </div>
- <div v-show="!isWideScreen">
- <span>毛料尺寸</span>
- <span>{{ choose.wool_size }}</span>
- </div>
- <div v-show="!isWideScreen">
- <span>精裁尺寸</span>
- <span>{{ choose.cut_size }}</span>
- </div>
- <div v-show="isWideScreen" class="wide-screen-rowno">
- <span
- :class="[
- choose.isChoosed
- ? 'wide-screen-rowno-span-choosed'
- : 'wide-screen-rowno-span',
- ]"
- >{{ choose.row_no }}</span
- >
- </div>
- <div>
- <span>生产数量</span>
- <span>
- {{
- choose.on_complete + choose.un_complete
- }}
- </span>
- </div>
- <div>
- <span>未打印数量</span>
- <span
- >{{ choose.un_print }}</span
- >
- </div>
- </div>
- </div>
- <div class="fullscreen-content-page">
- <Page
- @on-change="changePage"
- :page-size="page_size"
- :current="page_index"
- :total="total"
- />
- </div>
- </div>
- <div slot="footer"></div>
- <Modal
- class="selection-modal"
- v-model="selectionModal"
-
- width="80%"
- >
- <div slot="header">
- <h1>{{currencySelectedObj.title}}</h1>
- </div>
- <van-number-keyboard
- :show="show"
- @blur="show = false"
- @input="onInput"
- @delete="onDelete"
- z-index="99999"
- />
- <div class="selection-modal-top">
- <Input
- :placeholder="currencySelectedObj.title"
- v-model="currentSearchValue"
- @on-focus="show = true"
- @on-change="
- handleCurrentSearch(currencySelectedObj, currentSearchValue)
- "
- style="width: 80%"
- >
- <Icon
- @click="
- handleCurrentSearch(currencySelectedObj, currentSearchValue)
- "
- type="ios-search"
- slot="suffix"
- />
- </Input>
- </div>
- <div class="selection-modal-body">
- <div
- :class="[
- block.isCurrent
- ? 'selection-modal-body-block selection-modal-body-block-choosen'
- : 'selection-modal-body-block selection-modal-body-block-unchoosen',
- ]"
- v-for="(block, index) in currencySelectedObj.list"
- :key="index"
- @click="handleSelectionClick(currencySelectedObj, block)"
- style="font-size:1.4em"
- >
- <div v-show="currencySelectedObj.type == 1">
- <span>订单编号:</span>
- <span>{{ block.order_no }}</span>
- </div>
- <div v-show="currencySelectedObj.type == 2">
- <span>{{ block.title }}</span>
- </div>
- <div v-show="currencySelectedObj.type == 1">
- <span>项目名称:</span>
- <span>{{ block.residential_name }}</span>
- </div>
- </div>
- <div
- style="font-size: 1rem"
- v-show="currencySelectedObj.list.length == 0"
- >
- 暂无数据
- </div>
- </div>
- <div class="fullscreen-content-page">
- <Page
- @on-change="changeModalPage"
- :current="
- currencySelectedObj.type == 1
- ? modal_1_page_index
- : modal_2_page_index
- "
- :page-size="
- currencySelectedObj.type == 1
- ? modal_1_page_size
- : modal_2_page_size
- "
- :total="
- currencySelectedObj.type == 1 ? modal_1_total : modal_2_total
- "
- />
- </div>
- <div slot="footer" style="text-align:center">
- <Button
- @click="selectionModal = false"
- type="primary"
- style="margin-right: 10px;width:30%;height:1rem;font-size:2em"
- >
- 返回
- </Button>
- <!-- <Button
- v-show="currencySelectedObj.type == 1"
- @click="handleSelectionComfirm(currencySelectedObj)"
- type="primary"
- >
- 确认
- </Button> -->
- </div>
- </Modal>
- <Modal
- class="selection-modal"
- v-model="selectionDetailModal"
-
- width="80%"
- >
- <div slot="header"><h1>{{currencySelectedObj.title}}</h1></div>
- <div class="selection-modal-body" v-if="currencySelectedObj.hasChild">
- <div
- :class="[
- block.isCurrent
- ? 'selection-modal-body-block-detail selection-modal-body-block-detail-choosen'
- : 'selection-modal-body-block-detail selection-modal-body-block-detail-unchoosen',
- ]"
- v-for="(block, index) in chooseDetailUrlNo.children"
- :key="index"
- @click="handleSelectionDetailClick(chooseDetailUrlNo, block)"
- style="font-size: 1.4em;"
- >
- <div>
- <span>{{ block.url_number }}</span>
- </div>
- </div>
- </div>
- <div slot="footer" style='text-align:center'>
- <Button
- @click="
- selectionDetailModal = false;
- selectionModal = true;
- "
- type="primary"
- style="margin-right: 10px;width:30%;height:1rem;font-size:2em"
- >
- 返回
- </Button>
- <!-- <Button
- @click="handleSelectionComfirm(currencySelectedObj)"
- type="primary"
- >
- 确认
- </Button> -->
- </div>
- </Modal>
- <Modal
- class="selection-rowno-modal"
- v-model="selectionRownolModal"
- width="80%"
- >
- <div slot="header"><h1>行号选择</h1></div>
- <div class="selection-rowno-modal-body">
- <van-number-keyboard
- :show="show2"
- @blur="show2 = false"
- @input="keyboardTap"
- @delete="keyboardDele"
- z-index="99999"
- />
- <div
- class="selection-rowno-modal-body-block"
- v-for="(block, index) in chooseLineNo"
- :key="index"
- >
- <span style="font-size:2em;">行号区间:</span>
- <Input
- v-model="block.start"
- @on-focus="handleRowNoInput(block, 1)"
- clearable
- style="width: 20%; margin: 0 10px"
- size="large"
- />
- -
- <Input
- v-model="block.end"
- @on-focus="handleRowNoInput(block, 2)"
- clearable
- style="width: 20%; margin: 0 10px"
- size="large"
- />
- <Button
- @click="handleAddRow(block, index)"
- type="primary"
- size="large"
- v-show="index == 0"
- style="margin-right: 10px"
- >
- 添加
- </Button>
- <Button
- @click="handleDeleRow(block, index)"
- type="primary"
- size="large"
- v-show="index != 0"
- style="margin-right: 10px"
- >
- 删除
- </Button>
- </div>
- </div>
- <div slot="footer" style="text-align:center">
- <Button
- @click="selectionRownolModal = false"
- type="primary"
- style="margin-right: 10px;width:30%;height:1rem;font-size:2em"
- >
- 返回
- </Button>
- <Button @click="handleRowNoComfirm" type="primary"
- style="margin-right: 10px;width:30%;height:1rem;font-size:2em">
- 确认
- </Button>
- </div>
- </Modal>
- <Modal
- class="selection-print-modal"
- v-model="printModal"
- width="60%"
- >
- <div slot="header" style="text-align:center;font-weight:bold"><h1>打 印</h1></div>
- <div class="selection-print-modal-body">
- <div class="selection-print-modal-body-top">
- <div>
- <span>行号:</span>
- <span>{{ selectedObj.row_no }}</span>
- </div>
- <div>
- <span>部件名称:</span>
- <span>{{ selectedObj.part_title }}</span>
- </div>
- <div>
- <span>数量:</span>
- <InputNumber
- :max="selectedObj.un_print==0?selectedObj.on_print:selectedObj.un_print"
- :min="0"
- style="height:1em;font-size:1.5em;line-height:0.9em;width:2rem"
- @on-focus="handlePrintInput"
- v-model="selectedObj.print_num"
- ></InputNumber>
- <van-number-keyboard
- :show="show4"
- @blur="show4 = false"
- @input="keyboardPrintTap"
- @delete="keyboardPrintDele"
- z-index="99999"
- />
- </div>
- </div>
- <div class="selection-print-modal-body-info">
- {{
- selectedObj.isFinished
- ? "该部件芯片数量已全部打印,是否再次打印?请选择要打印的房间号:"
- : "请确认打印数量是否正确!"
- }}
- <div>
- <Button
- v-show="selectedObj.isFinished"
- @click="handleSelectionRoom"
- type="primary"
- >
- 选择房间号
- </Button>
- </div>
- </div>
- </div>
- <div slot="footer" class="selection-print-modal-body-footer">
- <Button
- @click="printModal = false"
- type="primary"
- style="margin-right: 40px"
- >
- 返回
- </Button>
- <Button @click="handlePrintComfirm(selectedObj,null,item.printerUsbPort,item.printer_brand,item.sub_type)" type="primary" v-for="item in printTip" :key="item.id" >
- {{item.title}}
- </Button>
- <Button @click="Print(selectedObj)" type="primary" v-if="false">
- 标签打印
- </Button>
-
- </div>
- </Modal>
- <!-- <Modal
- class="selection-print-modal"
- v-model="okModal"
- title="完成"
- width="60%"
- >
- <div class="selection-print-modal-body">
- <div class="selection-print-modal-body-top">
- <div>
- <span>行号:</span>
- <span>{{ selectedObj.row_no }}</span>
- </div>
- <div>
- <span>部件名称:</span>
- <span>{{ selectedObj.part_title }}</span>
- </div>
- <div>
- <span>数量:</span>
- <InputNumber
- :max="
- selectedObj.type == 1
- ? selectedObj.on_print - selectedObj.on_complete
- : selectedObj.un_complete
- "
- :min="0"
- size="large"
- @on-focus="handleOkInput"
- v-model="selectedObj.ok_num"
- ></InputNumber>
- <van-number-keyboard
- :show="show3"
- @blur="show3 = false"
- @input="keyboardOkTap"
- @delete="keyboardOkDele"
- z-index="99999"
- />
- </div>
- </div>
- <div class="selection-print-modal-body-info">
- 请确认完成数量是否正确?
- </div>
- </div>
- <div slot="footer">
- <Button
- @click="okModal = false"
- type="primary"
- style="margin-right: 10px"
- >
- 返回
- </Button>
- <Button @click="handleOkComfirm(selectedObj)" type="primary">
- 确认
- </Button>
- </div>
- </Modal> -->
- <Modal
- class="selection-modal"
- v-model="roomModal"
- @on-cancel ='handleRoomCancel'
- :draggable='true'
- style="height:100%"
- width="80%"
- >
- <div slot="header">
- <h1>选择房间号</h1>
- </div>
- <div class="selection-modal-body">
- <div
- :class="[
- block.isCurrent
- ? 'selection-modal-body-block selection-modal-body-block-choosen'
- : 'selection-modal-body-block selection-modal-body-block-unchoosen',
- ]"
- v-for="(block, index) in modalRoomList"
- :key="index"
- @click="handleSelectedRoomClick(modalRoomList, block)"
- >
- <div style="display:flex;flex-direction: column;text-align: center;">
- <span style="font-size:25px">{{ block.house }}</span>
- <span style="font-size:18px">{{`(${block.tag})`}}</span>
- </div>
- </div>
- </div>
- <div class="fullscreen-content-page">
- <Page
- @on-change="changeRoomPage"
- :current="modal_room_page_index"
- :page-size="modal_room_page_size"
- :total="modal_room_total"
- />
- </div>
- <div slot="footer" style="display:flex;flex-wrap: wrap;">
- <Button
- @click="handleRoomCancel"
- type="primary"
- style="margin: 10px;width:20%;height:60px;font-size:29px"
- >
- 返回
- </Button>
- <Button @click="handlePrintComfirm(selectedObj, 1,item.printerUsbPort,item.printer_brand,item.sub_type)" type="primary"
- style="width:20%;height:1rem;font-size:29px;margin: 10px" v-for="item in printTip" :key="item.id">
- {{item.title}}
- </Button>
- <Button @click="Print(selectedObj, 1)" type="primary" style="width:20%;height:2rem;font-size:29px" v-if="false">
- 标签打印
- </Button>
-
- </div>
- </Modal>
- <!-- <Modal
- class=""
- v-model="finishWork"
- @on-cancel ='handleCancel'
- width="80%"
- >
- <div slot="header" style="text-align:center;font-weight:bold"><h1>完 工</h1></div>
- <div style="display:flex;height: 7.5rem;">
- <div style="width:60%;overflow:auto;border-right:2px solid #ede7e7">
- <div style="display:flex">
- <span style="width:2rem;font-size: 0.4rem;margin: 0.6em;">工序</span>
- <div style="display:flex;flex-wrap: wrap;">
- <span v-for="item in produceList" :key="item.id" @click="changeChooseProduceList(item)" :style="item.isChoosed?{border: '2px solid #2D8CF0',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#ffffff',backgroundColor:'#2D8CF0',cursor: 'pointer'}:{border: '2px solid #2D8CF0',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#2D8CF0',cursor: 'pointer'}">
- {{item.title}}
- </span>
- </div>
- </div>
- <div style="display:flex">
- <span style="width:1.5rem;font-size: 0.4rem;margin: 0.6em;">班组</span>
- <div style="display:flex;flex-wrap:wrap">
- <span v-for="_item in employeeList" :key="_item.id" @click="changeChooseEmployeeList(_item)" :style="_item.isChoosed?{border: '2px solid #2D8CF0',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#ffffff',backgroundColor:'#2D8CF0',cursor: 'pointer'}:{border: '2px solid #2D8CF0',fontSize: '0.4rem',padding: '0.1em 0.2rem',borderRadius: '5px',margin: '0.6em',color:'#2D8CF0',cursor: 'pointer'}" >
- {{_item.nickname}}
- </span>
- </div>
- </div>
- </div>
- <div style="width:40%;overflow:auto;">
- <van-number-keyboard
- :show="show5"
- @blur="show5 = false"
- @input="numChange"
- @delete="delChange"
- z-index="99999"
- />
- <div v-for="(item,index) in rownoList" :key="item.id" style="display:flex;justify-content: space-between;align-items: center;width: 100%;font-size:0.4rem;margin-bottom:0.5rem">
-
- <span style="margin-left:1rem">行号:{{item.sort}}</span><span style="width: 40%;">数量:<Input style='width:50%' size="large" v-model="item.num" @on-focus="focusChange(index)" clearable /></span>
- </div>
- </div>
- </div>
- <div slot="footer" style="text-align:center;">
- <div style="margin-bottom:0.3rem"><h1>是否确认完工?</h1></div>
- <Button
- @click="handleCancel"
- type="primary"
- style="margin-right: 0.5rem;width:15%;height:1rem;font-size:0.4rem"
- >
- 返回
- </Button>
- <Button @click="handleThen" type="primary" style="margin-right: 0.5rem;width:15%;height:1rem;font-size:0.4rem">
- 确认
- </Button>
- </div>
- </Modal> -->
- <Modal v-model="selectTrue" :closable='false'>
- <div style="text-align:center;margin:2em"><h1>是否全选所有页面的所有部件</h1></div>
- <div slot="footer" style="text-align:center;">
- <Button
- @click="selectTrue=false"
- type="primary"
- style="margin-right: 0.5rem;width:30%;height:1rem;font-size:0.4rem"
- >
- 返回
- </Button>
- <Button @click="selectOk" type="primary" style="margin-right: 0.5rem;width:30%;height:1rem;font-size:0.4rem">
- 确认
- </Button>
- </div>
- </Modal>
- </Modal>
- <div ref='printRow' class="printRow">
- <div v-for="(item,index) in tagPrintList" :key="index" class="printRow_content" style="width:400px">
- <div style="display:flex"><span style="width:140px">项目:{{item.client_name}}</span><span>区域:{{item.house ? item.house + "-" : ""}}{{item.layer ? item.layer : ""}}{{item.position ? item.position : ""}}</span></div>
- <div style="display:flex"><span style="width:140px">房号:{{item.number_detail}}</span><span>产品:{{item.product_title}}</span></div>
- <div style="display:flex"><span style="width:140px">图号:{{item.url_number}}</span><span>部件:{{item.part_title}}</span></div>
- <div><span>尺寸:{{item.measure}}</span></div>
- <div><span>木皮:{{item.color_title}}</span></div>
- </div>
- </div>
- </div>
- </template>
- <script>
- // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- // 例如:import 《组件名称》 from '《组件路径》';
- import $ from "jquery";
- import "@vant/touch-emulator";
- export default {
- name: "",
- components: {},
- props: {},
- // import引入的组件需要注入到对象中才能使用
- data() {
- // 这里存放数据
- return {
- wxsoect:null,
- printTip:[],
- rule_data:[],
- selectTrue:false,
- cancelData:[],
- tagPrintList:[],
- produceID:null,
- employeeID:null,
- rownoList:[],
- employeeList:[],
- produceList:[],
- saveData:[],
- finishWork:false,
- show: false,
- show2: false,
- show3: false,
- show4: false,
- show5:false,
- isFullScreen: false,
- fullscreenModal: true,
- selectionModal: false,
- selectionRownolModal: false,
- selectionDetailModal: false,
- printModal: false,
- okModal: false,
- roomModal: false,
- contentData: [],
- selectedObj: {
- state:0,
- },
- ordernoObj: {
- title: "订单编号/项目名称选择",
- currentSearchValue: "",
- list: [],
- hasChild: false,
- },
- urlObj: {
- title: "图号选择",
- currentSearchValue: "",
- list: [],
- hasChild: true,
- },
- rownoObj: {},
- currencySelectedObj: {
- title: "订单编号/项目名称选择",
- type: 1,
- list: [],
- },
- selectedInfo: {
- order_no: "",
- residential_name: "",
- url_number: "",
- product_id: "",
- rows: [],
- },
- page_index: 1,
- // page_size: 6,
- total: 0,
- currentSearchValue: "",
- modal_1_page_index: 1,
- modal_1_page_size: 6,
- selectedAll:false,//true全选;false取消全选
- modal_1_total: 0,
- modal_room_page_index: 1,
- modal_room_page_size: 9,
- modal_room_total: 0,
- modal_2_page_index: 1,
- modal_2_page_size: 60,
- modal_2_total: 0,
- chooseOrderNo: {},
- chooseUrlNo: {},
- chooseDetailUrlNo: {},
- chooseLineNo: [{ start: "", end: "" }],
- keyboardObj: {},
- keyboardVal: "",
- modalRoomList: [],
- modalRoomListSelected: [],
- isWideScreen: localStorage.getItem("isWideScreen") || false,
- focusIndex:'',
- max:'',
- };
- },
- // 生命周期 - 创建完成(可以访问当前this实例)
- computed:{
- page_size(){
- if(this.isWideScreen){
- return 12
- }else{
- return 6
- }
- }
- },
- created() {
-
- },
- beforeRouteEnter(to, from, next) {
- next((vm) => {
- if (from.path == "/cms/ChipPrintScreen/ChipPrintScreenCheck") {
- vm.selectedInfo = JSON.parse(localStorage.getItem("printInfo"));
- vm.getChipDetail();
- vm.handleGetType(JSON.parse(localStorage.getItem("printInfo")).order_no);
- }})
- },
- // 生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- // this.axios.post('/api/station_get_type').then(res=>{
- // if(res.code == 200){
- // this.employeeList = res.data.employee_list;
- // this.employeeList.map(item=>{
- // item.isChoosed = false;
- // })
- // this.produceList = res.data.produce_list;
- // this.produceList.map(item=>{
- // item.isChoosed = false;
- // })
- // }
- // })
- this.axios.get('/api/ext_print_format_station').then(res=>{
- this.printTip = res.data.data;
- })
- },
- methods: {
- handleCancelPrint(){
- if(this.saveData.length==0){
- return this.$Message.warning('请选择数据!')
- }
- if(!this.selectedObj.isChoosed){
- return this.$Message.warning('撤销打印只能单选!')
- }
- this.axios.post('/api/station_cancer_print',{
- order_no: this.selectedInfo.order_no,
- product_id: this.selectedInfo.product_id,
- rows: this.selectedInfo.rows,
- num: this.selectedObj.print_num,
- id: this.selectedObj.id,
- }).then(res=>{
- if(res.code==200){
- this.$Message.success(res.msg)
- }
- })
- },
- selectOk(){
- this.selectTrue = false;
- this.selectedAll = !this.selectedAll;
- this.contentData.map(v=>{
- v.isChoosed = true
- });
- this.saveData = [];
- },
- handleSelectionAll(){
- this.selectTrue = true;
- },
- handleSelectionCancel(){
- this.selectedAll = !this.selectedAll;
- if(this.selectedAll){
- this.contentData.map(v=>{
- v.isChoosed = true
- });
- this.saveData = [];
- }else{
- this.contentData.map(v=>{
- v.isChoosed = false;
- });
- this.saveData=[];
- this.cancelData = [];
- }
- },
- Print(row,type){
- if (
- type &&
- this.modalRoomListSelected.length != this.selectedObj.print_num
- ) {
- return this.$Message.warning("与打印数量不符");
- }
- let ids = this.modalRoomListSelected.map((v) => {
- return v.id;
- });
- let data = type
- ? {
- order_no: this.selectedInfo.order_no,
- product_id: this.selectedInfo.product_id,
- rows: this.selectedInfo.rows,
- num: this.selectedObj.print_num,
- id: row.id,
- ids,
- type,
- }
- : {
- order_no: this.selectedInfo.order_no,
- product_id: this.selectedInfo.product_id,
- rows: this.selectedInfo.rows,
- num: this.selectedObj.print_num,
- id: row.id,
- };
- // 获取打印数据
- this.axios({
- method: "post",
- url: "/api/station_print",
- data,
- }).then((resp) => {
- if (resp.code == 200) {
- console.log(resp)
- this.tagPrintList = resp.data;
- setTimeout(()=>{
- this.$print(this.$refs.printRow);
- })
-
- }
- });
-
- },
- cancel(){
- this.fullscreenModal = false;
- this.$router.push({path:'/cms/ChipPrintScreen/list'});
- // this.$forceUpdate();
- },
- focusChange(index){
- this.focusIndex = index;
- this.max = this.rownoList[index].num;
- this.show5=true;
- },
- delChange(){
- // item.num = item.num.toString().substring(0,item.num.length-1)
- this.rownoList[this.focusIndex].num = this.rownoList[this.focusIndex].num.toString().substring(0,this.rownoList[this.focusIndex].num.toString().length-1);
- // console.log(this.rownoList[this.focusIndex].num)
- },
- numChange(e){
- // console.log(index);
- // item.num = item.num+''+e;
- this.rownoList[this.focusIndex].num =this.rownoList[this.focusIndex].num==='0'?'':this.rownoList[this.focusIndex].num+''+e;
- console.log(this.rownoList)
- if(Number(this.rownoList[this.focusIndex].num)>this.rownoList[this.focusIndex].val){
- this.rownoList[this.focusIndex].num = this.rownoList[this.focusIndex].val.toString();
- }
- // if(this.this.rownoList[this.focusIndex].num>max){
- // this.rownoList[this.focusIndex].num=max
- // }
- // if(Number(this.rownoList[this.focusIndex].num)>Number(max==''?'0':max)){
-
- // this.rownoList[this.focusIndex].num =JSON.parse(JSON.stringify(max));
- // console.log(this.rownoList[this.focusIndex].num)
- // }
- },
- changeChooseEmployeeList(item){
- this.employeeList.map(m=>{
- if(m.id==item.id){
- m.isChoosed = !m.isChoosed
- }else{
- m.isChoosed=false;
- }
- })
- if(item.isChoosed){
- this.employeeID =item.id
- }else{
- this.employeeID =null;
- }
- this.$forceUpdate();
- },
- changeChooseProduceList(item){
- let passData={
- order_no: this.selectedInfo.order_no,
- product_id: this.selectedInfo.product_id,
- rows: this.selectedInfo.rows,
- };
- let produce = item.id;
- let id = [];
- let cancelId = [];
- if(this.selectedAll){
- this.cancelData.map(v=>{
- cancelId.push(v.id)
- })
- passData.delete_id = cancelId;
- passData.produce =produce;
- passData.type =1; //type1全选状态;
- }else{
- this.saveData.map(v=>{
- id.push(v.id);
- });
- passData.id = id;
- passData.produce =produce;
- }
- this.produceList.map(m=>{
-
- if(m.id==item.id){
- m.isChoosed = !m.isChoosed
- }else{
- m.isChoosed=false;
- }
- })
- console.log(item)
- if(item.isChoosed){
- this.axios.post('/api/station_get_order_produce',{...passData}).then(res=>{
- if(res.code==200){
- this.rownoList = res.data;
- this.produceID = item.id;
- this.rownoList.map(v=>{
- v.val = v.num;
- })
- this.rule_data.forEach(element => {
- if(element.id == item.id){
- this.employeeList = element.employee_list;
- this.employeeList.map(item=>{
- item.isChoosed = false;
- })
- console.log(1)
- }
- });
-
- console.log(this.employeeList)
- }
- })
- }else{
- this.employeeList=[];
- this.rownoList= [];
- this.produceID = null;
- }
- },
- back() {
- this.$router.go(-1);
- },
- handleSelection(obj, type) {
- this.saveData = [];
- if (type == 2 && this.selectedInfo.order_no == "") {
- return this.$Message.warning("请先选择项目");
-
- }
- this.currentSearchValue = "";
- this.currentSearchValue = obj.currentSearchValue;
- this.currencySelectedObj = obj;
- this.selectionModal = true;
- this.total = 0;
- this.currencySelectedObj.type = type;
- if (this.currencySelectedObj.list.length == 0 || type == 2) {
- this.handleCurrentSearch(
- this.currencySelectedObj,
- this.currentSearchValue
- );
- }
- },
- handleSelectionRowno(row) {
- if (this.selectedInfo.rows.length > 0) {
- this.chooseLineNo = JSON.parse(JSON.stringify(this.selectedInfo.rows));
- } else {
- this.chooseLineNo = [{ start: null, end: null }];
- }
- this.selectionRownolModal = true;
- },
- handleCancelSelected(v, type) {
- this.saveData = [];
- if (type) {
- this.selectedInfo.rows.splice(v, 1);
- } else if (v == "product_id") {
- this.selectedInfo.url_number = "";
- this.selectedInfo.product_id = "";
- } else {
- this.selectedInfo[v] = "";
- }
- if (v != "order_no") {
- this.getChipDetail();
- } else {
- this.selectedInfo.residential_name = "";
- this.selectedInfo.url_number = "";
- this.selectedInfo.product_id = "";
- this.selectedInfo.rows = [];
- this.contentData = [];
- this.total = 0;
- }
- },
- handleChooseBlockClick(row) {
-
- if (row.isChoosed) {
- row.isChoosed = false;
- this.saveData.map((v,index)=>{
- if(v.id == row.id){
- this.saveData.splice(index,1)
- }
- })
- } else {
- row.isChoosed = true;
- this.saveData.push(row)
- }
- // console.log(this.saveData)
- if (row.un_print == 0) {
- row.isFinished = true;
- }
- if(this.saveData.length == 1){
- this.selectedObj = this.saveData[0];
- }else{
- if(this.saveData.length>1){
- this.selectedObj = {};
- }else{
- this.selectedObj = {state:0};
- }
-
- }
- if(this.selectedAll){
- if(!row.isChoosed){
- this.cancelData.push(row)
- }else{
- this.cancelData.map((v,index)=>{
- if(v.id == row.id){
- this.cancelData.splice(index,1)
- }
- })
- }
- }
- console.log(this.saveData)
- console.log(this.cancelData)
- // this.selectedObj = row;
- },
- goCheckPage(val) {
- switch(val){
- case 1:
- localStorage.setItem("printInfo", JSON.stringify(this.selectedInfo));
- this.$router.push({
- path: "/cms/ChipPrintScreen/ChipPrintScreenCheck"
- });
- break;
- case 2:
- localStorage.setItem("printInfo", JSON.stringify(this.selectedInfo));
- this.$router.push({
- path: "/cms/ChipPrintScreen/ChipPrintScreenEquipment"
- });
- break;
- }
-
-
- },
- handleSelectionClick(row, obj) {
- row.list.map((v) => (v.isCurrent = false));
- obj.isCurrent = true;
- if (row.hasChild) {
- // 行号
- this.selectionModal = false;
- this.selectionDetailModal = true;
- this.chooseDetailUrlNo = obj;
- this.currentSearchValue = this.rownoObj.currentSearchValue;
- this.contentData = [];
- this.total = 0;
- } else {
- // 订单号
- this.chooseOrderNo = obj;
- this.currentSearchValue = this.ordernoObj.currentSearchValue;
- }
- if (row.type == 1) {
- this.handleSelectionComfirm(this.currencySelectedObj);
- }
- this.$forceUpdate();
- },
- handleSelectedRoomClick(list, block) {
- if (block.isCurrent) {
- this.modalRoomListSelected = this.modalRoomListSelected.filter(
- (v) => v.id != block.id
- );
- block.isCurrent = !block.isCurrent;
- } else {
- if (this.modalRoomListSelected.length < this.selectedObj.print_num) {
- block.isCurrent = !block.isCurrent;
- this.modalRoomListSelected = this.modalRoomListSelected.concat(
- this.modalRoomList.filter((v) => v.isCurrent)
- );
- } else {
- this.$Message.warning("与打印数量不符,请重新选择");
- }
- }
- this.modalRoomListSelected = Array.from(
- new Set([...this.modalRoomListSelected])
- );
- },
- handleAddRow(row, index) {
- this.chooseLineNo.push({
- start: "",
- end: "",
- });
- },
- handleDeleRow(row, index) {
- this.chooseLineNo.splice(index, 1);
- },
- handleSelectionDetailClick(row, obj) {
- row.children.map((v) => (v.isCurrent = false));
- obj.isCurrent = true;
- this.chooseUrlNo = obj;
- this.handleSelectionComfirm(this.currencySelectedObj);
- this.$forceUpdate();
- },
- handleFullScreenClick() {
- this.isFullScreen = !this.isFullScreen;
- if (this.isFullScreen) {
- this.enterFullScreen();
- } else {
- this.exitFullScreen();
- }
- },
- handleWideScreenClick() {
- this.isWideScreen = !this.isWideScreen;
- localStorage.setItem("isWideScreen", this.isWideScreen);
-
- if (this.isWideScreen) {
- this.page_index =1;
- // this.page_size = 12;
- this.enterWideScreen();
- } else {
- this.page_index =1;
- // this.page_size = 6;
- this.exitWideScreen();
- }
- this.getChipDetail();
- },
- enterWideScreen() {},
- exitWideScreen() {},
- handleSelectionRoom() {
- this.getModalRoomList();
- this.roomModal = true;
- },
- enterFullScreen() {
- let el = document.documentElement;
- let rfs =
- el.requestFullScreen ||
- el.webkitRequestFullScreen ||
- el.mozRequestFullScreen ||
- el.msRequestFullscreen;
- if (rfs) {
- rfs.call(el);
- } else if (typeof window.ActiveXObject !== "undefined") {
- // for IE,这里其实就是模拟了按下键盘的F11,使浏览器全屏
- let wscript = new ActiveXObject("WScript.Shell");
- if (wscript != null) {
- wscript.SendKeys("{F11}");
- }
- }
- },
- exitFullScreen() {
- let el = document;
- let cfs =
- el.cancelFullScreen ||
- el.mozCancelFullScreen ||
- el.msExitFullscreen ||
- el.webkitExitFullscreen ||
- el.exitFullscreen;
- if (cfs) {
- // typeof cfs != "undefined" && cfs
- cfs.call(el);
- } else if (typeof window.ActiveXObject !== "undefined") {
- // for IE,这里和fullScreen相同,模拟按下F11键退出全屏
- let wscript = new ActiveXObject("WScript.Shell");
- if (wscript != null) {
- wscript.SendKeys("{F11}");
- }
- }
- },
- handleCurrentSearch(row, val) {
- //type 1项目选择 2图号选择
- let url =
- row.type == 1
- ? "/api/station_get_order"
- : "/api/station_get_url_number";
- this.axios({
- method: "post",
- url,
- data: {
- page_index:
- row.type == 1 ? this.modal_1_page_index : this.modal_2_page_index,
- page_size:
- row.type == 1 ? this.modal_1_page_size : this.modal_2_page_size,
- order_no: row.type == 1 ? val : this.selectedInfo.order_no,
- url_number: row.type == 1 ? "" : val,
- },
- }).then((res) => {
- if (res.code == 200) {
- if (row.type == 1) {
- row.list = res.data.data;
- this.modal_1_total = res.data.total;
- } else {
- row.list = [];
- this.modal_2_total = res.data.total;
- let length = Math.ceil(res.data.data.length / 10);
- for (let index = 0; index < length; index++) {
- row.list.push({
- //最后一位不一定刚好10个
- title:
- length - index == 1
- ? `${res.data.data[10 * index].url_number}~${
- res.data.data[res.data.data.length - 1].url_number
- }`
- : `${res.data.data[10 * index].url_number}~${
- res.data.data[10 * index + 9].url_number
- }`,
- children: res.data.data.slice(10 * index, 10 * index + 10),
- });
- }
- }
- }
- });
- },
- handleGetType(row){
- this.axios.post('/api/station_get_type',{order_no:row}).then(res=>{
- if(res.code == 200){
- // this.employeeList = res.data.employee_list;
- // this.employeeList.map(item=>{
- // item.isChoosed = false;
- // })
- this.rule_data = res.data.rule_data;
- this.produceList = res.data.produce_list;
- this.produceList.map(item=>{
- item.isChoosed = false;
- })
- }
- })
- },
- //项目、图号确认
- handleSelectionComfirm(row) {
- console.log(`row`, row);
- this.page_index=1;
- // 这里需要把弹框关闭之后赋值到selectedInfo上
- // this.selectedInfo.order_no;
- // 1 项目选择 2图号选择
- if (row.type == 1) {
- let order_no ='';
- this.saveData = [];
- this.selectedInfo.order_no = this.chooseOrderNo.order_no;
- this.selectedInfo.residential_name = this.chooseOrderNo.residential_name;
- this.selectionModal = false;
- this.selectedAll = false;
- this.contentData = [];
- this.selectedInfo.url_number = '';
- row.list.map(v=>{
- if(v.isCurrent){
- order_no = v.order_no;
- }
- })
- this.handleGetType(order_no);
- } else if (row.type == 2) {
- this.selectedAll = false;
- this.selectedInfo.url_number = this.chooseUrlNo.url_number;
- this.selectedInfo.product_id = this.chooseUrlNo.product_id;
- this.selectionDetailModal = false;
- this.getChipDetail();
- }
- // order_no: "20211010",
- // residential_name: "2",
- // url_number: "3",
- // row_no: [],
- },
- // 获取具体详情
- getChipDetail() {
- this.axios({
- method: "post",
- url: "/api/station_get_order_product_pr",
- data: {
- order_no: this.selectedInfo.order_no,
- product_id: this.selectedInfo.product_id,
- rows: this.selectedInfo.rows,
- page_index: this.page_index,
- page_size: this.page_size,
- },
- }).then((res) => {
- if (res.code == 200) {
-
- res.data.data.map((v) => (v.isChoosed = false));
- this.contentData = res.data.data;
- if(this.selectedAll){
- this.contentData.map(v=>{
- v.isChoosed = true;
- })
- this.contentData.map(v=>{
- this.cancelData.map(m=>{
- if(v.id == m.id){
- v.isChoosed=false;
- }
- })
- })
- }
- this.contentData.map(v=>{
- this.saveData.map(m=>{
- if(v.id==m.id){
- v.isChoosed =true;
- }
- })
- })
- this.total = res.data.total;
- }
- });
- },
- handlePrint() {
- if(this.selectedObj.state == 0){
- return this.$Message.warning("请选择数据");
- }
- if (!this.selectedObj.isChoosed) {
- return this.$Message.warning("打印只能单选");
- }
- if (this.selectedObj.type != 1) {
- return this.$Message.warning("该部件不含芯片,无需打印");
- }
- if (this.selectedObj.un_print == 0) {
- this.selectedObj.print_num = this.selectedObj.on_print;
- } else {
- this.selectedObj.print_num = this.selectedObj.un_print;
- }
- this.printModal = true;
- },
- printDemo(data) {
- setTimeout(()=>{
- if (!data) return 0;
- const st = this.wxsoect;
- const {
- client_name,
- product_title,
- part_title,
- measure,
- process,
- url_number,
- color_title,
- chip,
- chip_bin,
- house,
- unit,
- layer,
- number_detail,
- position,
- } = data;
- st.send("OpenPort|255");
- st.send("ZM_ClearBuffer");
- st.send("ZM_SetPrintSpeed|4");
- st.send("ZM_SetDarkness|12");
- if (location.origin.indexOf("121.37.173.82") > -1) {
- st.send("ZM_SetLabelHeight|136|32");
- } else {
- st.send("ZM_SetLabelHeight|160|16");
- }
- st.send("ZM_SetLabelWidth|664");
- st.send(
- `ZM_DrawTextTrueTypeW|70|20|24|0|Arial|1|600|0|0|0|A1| 项目:${client_name ||
- ""}`
- );
- st.send(
- `ZM_DrawTextTrueTypeW|280|20|24|0|Arial|1|600|0|0|0|A1| 区域: ${layer||''}`
- );
- st.send(
- `ZM_DrawTextTrueTypeW|70|55|24|0|Arial|1|600|0|0|0|A2| 房号:${number_detail||''}`
- );
- st.send(
- `ZM_DrawTextTrueTypeW|280|55|24|0|Arial|1|600|0|0|0|A2| 产品:${product_title ||
- ""} `
- );
- st.send(
- `ZM_DrawTextTrueTypeW|70|90|24|0|Arial|1|600|0|0|0|A3| 部件:${part_title || ""} `
- );
- st.send(
- `ZM_DrawTextTrueTypeW|280|90|24|0|Arial|1|600|0|0|0|A3| 图号: ${url_number ||
- ""} `
- );
- st.send(
- `ZM_DrawTextTrueTypeW|70|125|24|0|Arial|1|600|0|0|0|A4| 尺寸: ${measure ||
- ""} `
- );
- st.send(
- `ZM_DrawTextTrueTypeW|280|125|24|0|Arial|1|600|0|0|0|A4| 木皮:${color_title || ""}`
- );
- st.send(
- `ZM_DrawTextTrueTypeW|520|90|12|0|Arial|1|600|0|0|0|A4| ${chip_bin || ""}`
- );
- st.send(`ZM_RW_RfidFormat|1|0|0|${chip.length}|1|${chip}`);
- st.send("ZM_PrintLabel_R|1|1");
- st.send("ClosePort");
- },1000)
-
- },
- handlePrintComfirm(row, type,printerUsbPort,printer_brand,sub_type) {
- if (
- type &&
- this.modalRoomListSelected.length != this.selectedObj.print_num
- ) {
- return this.$Message.warning("与打印数量不符");
- }
- let ids = this.modalRoomListSelected.map((v) => {
- return v.id;
- });
- let data = type
- ? {
- order_no: this.selectedInfo.order_no,
- product_id: this.selectedInfo.product_id,
- rows: this.selectedInfo.rows,
- num: this.selectedObj.print_num,
- id: row.id,
- ids,
- type,
- }
- : {
- order_no: this.selectedInfo.order_no,
- product_id: this.selectedInfo.product_id,
- rows: this.selectedInfo.rows,
- num: this.selectedObj.print_num,
- id: row.id,
- };
- if(printer_brand === '灵天智能'){
- const wxsoect = new WebSocket(`ws://localhost:${printerUsbPort?printerUsbPort:'1808'}`);
- this.wxsoect = wxsoect;
- console.log("this.wxsoect :>> ", this.wxsoect);
-
- wxsoect.onopen = function(evt) {
- console.log(`已成功打开`);
- };
- }
- // 获取打印数据
- this.axios({
- method: "post",
- url: "/api/station_print",
- data,
- }).then((resp) => {
- if (resp.code == 200) {
- if(printer_brand === '灵天智能'){
- resp.data.map(ele=>{
- this.printDemo(ele)
- })
- this.getChipDetail();
- }else if(printer_brand === 'POSTEK'){
- // usb打印/ip打印
- this.axios.get("/api/get_print_local_url").then((res) => {
- console.log(res);
- if (res.code == 200) {
- if (res.data.state) {
- this.handlePrintChipsUsb(resp.data, res.data.type,printerUsbPort,sub_type);
- } else {
- this.handlePrintChipsIp(resp.data, res.data.type);
- }
- }
- });}else{
- return this.$Message.error('该格式未设置打印机')
- }
- // this.selectedObj.un_print = this.selectedObj.un_print - this.selectedObj.print_num;
- // if(this.selectedObj.un_print == 0){
- // this.selectedObj.isFinished == true;
- // this.selectedObj.print_num == this.selectedObj.on_print;
- // }
- this.modalRoomList.map((v) => {
- v.isCurrent = false;
- });
- this.modalRoomListSelected = [];
- this.saveData = [];
- this.printModal = false;
- this.roomModal = false;
- }
- });
- },
- handleThen(){
- if(!this.produceID||!this.employeeID){
- return this.$Message.warning('请确认信息')
- }
- this.axios.post('/api/station_order_produce_complete',{produce_id:this.produceID,employee_id:this.employeeID,sort_list:this.rownoList}).then(res=>{
- if(res.code==200){
- this.$Message.success(res.msg);
- this.produceList.map((v) => {
- v.isChoosed = false;
- });
- this.produceID = null;
- this.rownoList=[];
- this.finishWork = false;
- }
- })
- // this.finishWork = false;
- },
- // handleOk() {
- // if (this.saveData.length==0&&!this.selectedAll) {
- // return this.$Message.warning("请选择数据");
- // }
- // if (this.selectedObj.type == 1 && this.selectedObj.un_print == 0) {
- // this.selectedObj.ok_num =
- // this.selectedObj.on_print - this.selectedObj.on_complete;
- // this.okModal = true;
- // } else if (this.selectedObj.type != 1) {
- // this.selectedObj.ok_num = this.selectedObj.un_complete;
- // this.okModal = true;
- // } else {
- // return this.$Message.warning("部件存在未打印芯片,请先打印");
- // }
- // this.finishWork = true;
- // },
- handleRoomCancel() {
- this.modalRoomList.map((v) => {
- v.isCurrent = false;
- });
- this.modalRoomListSelected = [];
- this.roomModal = false;
- },
- handleCancel() {
- this.produceList.map((v) => {
- v.isChoosed = false;
- });
- this.produceID = null;
- this.rownoList = [];
- this.finishWork = false;
- },
- // handleOkComfirm(row) {
- // this.axios({
- // method: "post",
- // url: "/api/station_complete",
- // data: {
- // order_no: this.selectedInfo.order_no,
- // product_id: this.selectedInfo.product_id,
- // rows: this.selectedInfo.rows,
- // num: this.selectedObj.ok_num,
- // id: row.id,
- // },
- // }).then((res) => {
- // if (res.code == 200) {
- // this.okModal = false;
- // this.getChipDetail();
- // }
- // });
- // },
- //行号确认
- handleRowNoComfirm() {
- let data =[];
- this.chooseLineNo.map((v)=>{
- if(v.start&&v.end){
- data.push(v)
- }
- })
- this.selectedInfo.rows = JSON.parse(JSON.stringify(data));
- this.selectionRownolModal = false;
- this.page_index = 1;
- this.getChipDetail();
- },
- onInput(value) {
- this.currentSearchValue = this.currentSearchValue + "" + value;
- this.handleCurrentSearch(
- this.currencySelectedObj,
- this.currentSearchValue
- );
- },
- onDelete() {
- this.currentSearchValue = this.currentSearchValue.substring(
- 0,
- this.currentSearchValue.length - 1
- );
- this.handleCurrentSearch(
- this.currencySelectedObj,
- this.currentSearchValue
- );
- },
- keyboardOkTap(value) {
- let max;
- if (this.selectedObj.type == 1) {
- max = this.selectedObj.on_print - this.selectedObj.on_complete;
- } else {
- max = this.selectedObj.un_complete;
- }
- this.selectedObj.ok_num =
- (this.selectedObj.ok_num ? this.selectedObj.ok_num : "") + "" + value;
- if (this.selectedObj.ok_num * 1 > max) {
- this.selectedObj.ok_num = max;
- }
- this.$forceUpdate();
- },
- keyboardOkDele() {
- this.selectedObj.ok_num = (this.selectedObj.ok_num + "").substring(
- 0,
- this.selectedObj.ok_num.length - 1
- );
- this.$forceUpdate();
- },
- keyboardPrintTap(value) {
- let max = this.selectedObj.on_print + this.selectedObj.un_print;
- this.selectedObj.print_num =
- Number((this.selectedObj.print_num ? this.selectedObj.print_num : "") +
- "" +
- value);
- if (this.selectedObj.print_num * 1 > max) {
- this.selectedObj.print_num = max;
- }
- this.$forceUpdate();
- },
- keyboardPrintDele() {
- this.selectedObj.print_num = Number((this.selectedObj.print_num + "").substring(
- 0,
- this.selectedObj.print_num.length - 1
- ));
- this.$forceUpdate();
- },
- keyboardTap(value) {
- this.keyboardObj[this.keyboardVal] =
- (this.keyboardObj[this.keyboardVal]
- ? this.keyboardObj[this.keyboardVal]
- : "") +
- "" +
- value;
- },
- keyboardDele() {
- this.keyboardObj[this.keyboardVal] = this.keyboardObj[
- this.keyboardVal
- ].substring(0, this.keyboardObj[this.keyboardVal].length - 1);
- },
- handleRowNoInput(row, type) {
- if (type == 1) {
- this.keyboardVal = "start";
- } else {
- this.keyboardVal = "end";
- }
- this.keyboardObj = row;
-
- this.show2 = true;
- },
- handleOkInput() {
- this.show3 = true;
- },
- handlePrintInput() {
- this.show4 = true;
- },
- changePage(e) {
- this.page_index = e;
- this.getChipDetail();
- },
- changeModalPage(e) {
- this.currencySelectedObj.type == 1
- ? (this.modal_1_page_index = e)
- : (this.modal_2_page_index = e);
- this.handleCurrentSearch(
- this.currencySelectedObj,
- this.currentSearchValue
- );
- },
- changeRoomPage(e) {
- this.modal_room_page_index = e;
- this.getModalRoomList();
- },
- getModalRoomList() {
- this.axios({
- method: "post",
- url: "/api/station_get_print_house",
- data: {
- order_no: this.selectedInfo.order_no,
- product_id: this.selectedInfo.product_id,
- rows: this.selectedInfo.rows,
- page_index: this.modal_room_page_index,
- page_size: this.modal_room_page_size,
- id: this.selectedObj.id,
- },
- }).then((res) => {
- if (res.code == 200) {
- res.data.data.map((v) => {
- v.isCurrent = false;
- this.modalRoomListSelected &&
- this.modalRoomListSelected.map((w) => {
- if (w.id == v.id) {
- v.isCurrent = true;
- }
- });
- });
- this.modalRoomList = res.data.data;
- this.modal_room_total = res.data.total;
- console.log(this.modalRoomList)
- }
- });
- },
- handlePrintChipsUsb(contents, type,printerUsbPort,sub_type) {
- this.axios.get("/api/get_print_url").then((res) => {
- // let data = {};
- // // let url = "http://192.168.0.145:888/postek/print"; //request_url
- let url = `http://${res.data.request_url}:888/postek/print`; //request_url
- // data.reqParam = "1"; //这个一般不用改,如需改,查api
- // let printparamsJsonArray = [];
- // // let IP = "192.168.1.58";//print_url
- // // let IP = "192.168.0.199"; //print_url
- // // printparamsJsonArray.push({printPort:"1",printName:"POSTEK TX3r"});
- // printparamsJsonArray.push({ PTK_OpenUSBPort:printerUsbPort});
- // printparamsJsonArray.push({ PTK_ClearBuffer: "" });
- // printparamsJsonArray.push({ PTK_SetDirection: "B" });
- // printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
- // printparamsJsonArray.push({ PTK_SetDarkness: "10" });
- // printparamsJsonArray.push({
- // PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
- // });
- // printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
- // // 打印类型 1江山 2贝斯特
- // if (type == 1) {
- // contents.map((content) => {
- // //江山打印格式
- // //上
- // const printContent_l1 = `单号:${content.order_no}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
- // });
- // const printContent_l1_2 = `型号:${content.product_title}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
- // });
- // const printContent_l2 = `尺寸:${content.measure}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
- // });
- // const printContent_l2_2 = `工艺:${content.process_title}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
- // });
- // const printContent_l3 = `颜色:${content.color_title}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
- // });
- // const printContent_l3_2 = `部件:${content.part_title}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
- // });
- // //下
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
- // });
- // printparamsJsonArray.push({
- // PTK_RWRFIDLabel:
- // "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
- // });
- // printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
- // });
- // } else {
- // contents.map((content) => {
- // //贝斯特打印格式
- // //上
- // const printContent_l1 = `项目:${content.client_name}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
- // });
- // const printContent_l1_2 = `区域:${
- // content.house ? content.house + "-" : ""
- // }${content.layer ? content.layer : ""}${
- // content.position ? content.position : ""
- // }`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "650,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
- // });
- // const printContent_l2 = `房号:${content.number_detail}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
- // });
- // const printContent_l2_2 = `产品:${content.product_title}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "650,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
- // });
- // const printContent_l3 = `图号:${content.url_number}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
- // });
- // const printContent_l3_2 = `部件:${content.part_title}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "650,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
- // });
- // const printContent_l4 = `木皮:${content.color_title}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
- // });
- // const printContent_l4_2 = `尺寸:${content.measure}`;
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
- // });
- // let space_str = '\u0000'
- // let printContent_l5_data=this.hexCharCodeToStr(content.chip);
- // printContent_l5_data = printContent_l5_data.replace(space_str,'')
- // const printContent_l5 = `芯片编码:${printContent_l5_data}`;
- // // console.log(printContent_l5_data)
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueTypeEx:
- // "970,330,25,0,微软雅黑,1,700,0,0,0,10,0,0,0," + printContent_l5,
- // });
- // //下
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "650,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "650,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "650,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "150,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueType:
- // "650,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
- // });
- // printparamsJsonArray.push({
- // PTK_DrawText_TrueTypeEx:
- // "970,530,25,0,微软雅黑,1,700,0,0,0,10,0,0,0," + printContent_l5,
- // });
- // // 17,35 420
- // printparamsJsonArray.push({
- // PTK_RWRFIDLabel:
- // "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
- // });
- // printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
- // });
- // }
- // printparamsJsonArray.push({ PTK_CloseUSBPort: "" });
- // data.printparams = printparamsJsonArray;
- // let sub_data = JSON.parse(JSON.stringify(data));
- // sub_data.printparams = JSON.stringify(sub_data.printparams);
- let _this = this;
- $.ajax({
- type: "post",
- url,
- data: _this.func.PrintChipsUsb(contents,type,printerUsbPort,sub_type),
- dataType: "json",
- timeout: 5000,
- success: function(result) {
- _this.getChipDetail();
- if (result.retval == "0") {
- _this.$Message.success("发送成功");
- } else {
- _this.$Message.error("发送失败,返回结果:" + result.msg);
- }
- },
- error: function() {
- _this.getChipDetail();
- },
- });
- });
- },
- // hexCharCodeToStr(hexCharCodeStr) {
- // let trimedStr = hexCharCodeStr.trim();
- // let rawStr = trimedStr.substr(0,2).toLowerCase() === "0x"?trimedStr.substr(2):trimedStr;
- // let len = rawStr.length;
- // if(len % 2 !== 0) {
- // alert("Illegal Format ASCII Code!");
- // return "";}
- // let curCharCode;
- // let resultStr = [];
- // for(var i = 0; i < len;i = i + 2) {
- // curCharCode = parseInt(rawStr.substr(i, 2), 16); // ASCII Code Value
- // resultStr.push(String.fromCharCode(curCharCode));
- // }
- // return resultStr.join("");
- // },
- handlePrintChipsIp(contents, type) {
- this.axios.get("/api/get_print_url").then((res) => {
- let data = {};
- // let url = "http://192.168.0.145:888/postek/print"; //request_url
- let url = `http://${res.data.request_url}:888/postek/print`; //request_url
- data.reqParam = "1"; //这个一般不用改,如需改,查api
- let printparamsJsonArray = [];
- // let IP = "192.168.1.58";//print_url
- // let IP = "192.168.0.199"; //print_url
- let IP = res.data.print_url;
- let port = 9100;
- let IP_Port = IP + "," + port;
- printparamsJsonArray.push({ PTK_Connect_Timer: IP_Port + ",1" });
- printparamsJsonArray.push({ PTK_ClearBuffer: "" });
- printparamsJsonArray.push({ PTK_SetDirection: "B" });
- printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
- printparamsJsonArray.push({ PTK_SetDarkness: "10" });
- printparamsJsonArray.push({
- PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
- });
- printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
- console.log(`contents`, contents);
- if (type == 1) {
- contents.map((content) => {
- //江山打印格式
- //上
- const printContent_l1 = `单号:${content.order_no}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
- });
- const printContent_l1_2 = `型号:${content.product_title}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
- });
- const printContent_l2 = `尺寸:${content.measure}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
- });
- const printContent_l2_2 = `工艺:${content.process_title}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
- });
- const printContent_l3 = `颜色:${content.color_title}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
- });
- const printContent_l3_2 = `部件:${content.part_title}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
- });
- //下
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
- });
- printparamsJsonArray.push({
- PTK_RWRFIDLabel:
- "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
- });
- printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
- });
- } else {
- contents.map((content) => {
- //贝斯特打印格式
- //上
- const printContent_l1 = `项目:${content.client_name}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
- });
- const printContent_l1_2 = `区域:${
- content.house ? content.house + "-" : ""
- }${content.layer ? content.layer : ""}${
- content.position ? content.position : ""
- }`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
- });
- const printContent_l2 = `房号:${content.number_detail}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
- });
- const printContent_l2_2 = `产品:${content.product_title}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
- });
- const printContent_l3 = `图号:${content.url_number}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
- });
- const printContent_l3_2 = `部件:${content.part_title}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
- });
- const printContent_l4 = `木皮:${content.color_title}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
- });
- const printContent_l4_2 = `尺寸:${content.measure}`;
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
- });
- //下
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
- });
- printparamsJsonArray.push({
- PTK_DrawText_TrueType:
- "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
- });
- // 17,35 420
- printparamsJsonArray.push({
- PTK_RWRFIDLabel:
- "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
- });
- printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
- });
- }
- printparamsJsonArray.push({ PTK_CloseConnect: "" });
- data.printparams = printparamsJsonArray;
- let sub_data = JSON.parse(JSON.stringify(data));
- sub_data.printparams = JSON.stringify(sub_data.printparams);
- let _this = this;
- $.ajax({
- type: "post",
- url,
- data: sub_data,
- dataType: "json",
- timeout: 5000,
- success: function(result) {
- _this.getChipDetail();
- if (result.retval == "0") {
- _this.$Message.success("发送成功");
- } else {
- _this.$Message.error("发送失败,返回结果:" + result.msg);
- }
- },
- error: function() {
- _this.getChipDetail();
- },
- });
- });
- },
- },
- // 监控data中的数据变化
- watch: {},
- beforeCreate() {}, // 生命周期 - 创建之前
- beforeMount() {}, // 生命周期 - 挂载之前
- beforeUpdate() {}, // 生命周期 - 更新之前
- updated() {}, // 生命周期 - 更新之后
- beforeDestroy() {}, // 生命周期 - 销毁之前
- destroyed() {}, // 生命周期 - 销毁完成
- activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang="scss" scoped>
- .fullscreen-title-btn {
- position: absolute;
- right: 100px;
- top: 0.175rem;
- }
- .fullscreen-content {
- font-size: 26px;
- font-family: "Microsoft YaHei", 微软雅黑;
- font-weight: bold;
- .fullscreen-content-select {
- display: flex;
- justify-content: flex-start;
- padding-bottom: 0.1rem;
- border-bottom: 1px solid #e8eaec;
- .fullscreen-content-select-block {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- .fullscreen-content-select-block:nth-child(1) {
- width: 30%;
- }
- .fullscreen-content-select-block:nth-child(2) {
- width: 30%;
- }
- .fullscreen-content-select-block:nth-child(3) {
- width: 30%;
- }
- }
- .fullscreen-content-choose {
- display: flex;
- justify-content: flex-start;
- flex-wrap: wrap;
- padding-top: 0.1rem;
- margin-bottom: 0.5rem;
- .fullscreen-content-choose-block {
- width: 33.33%;
- border-radius: 5px;
- border: 1px solid #2d8cf0;
- // margin: 0.1rem 1%;
- padding: 1%;
- position: relative;
- div {
- display: flex;
- justify-content: space-between;
- // margin-top: 5px;
- }
- .chip-tag {
- display: inline-block;
- position: absolute;
- width: 1rem;
- top: 0;
- left: 50%;
- font-size: 18px;
- background-color: #fadb14;
- color: black;
- height: 0.75rem;
- border-radius: 15%;
- text-align: center;
- padding-top: 0.15rem;
- transform: translate(-50%, -10%);
- }
- .chip-tag-choosed {
- display: inline-block;
- position: absolute;
- width: 1rem;
- top: 0;
- left: 15%;
- font-size: 18px;
- background-color: #fadb14;
- color: black;
- height: 0.75rem;
- border-radius: 15%;
- text-align: center;
- padding-top: 0.15rem;
- transform: translate(-10%, -10%) !important;
- }
- }
- .fullscreen-content-choose-block-wide {
- width: 24.5%;
- }
- .fullscreen-content-choose-block-choosen {
- color: white;
- background-color: #2d8cf0;
- }
- .fullscreen-content-choose-block-unchoosen {
- color: #2d8cf0;
- background-color: white;
- }
- }
- }
- .fullscreen-content-page {
- display: flex;
- justify-content: center;
- }
- .selection-modal {
- .selection-modal-top {
- display: flex;
- justify-content: center;
- }
- .selection-modal-body {
- display: flex;
- justify-content: center;
- flex-wrap: wrap;
- .selection-modal-body-block {
- cursor: pointer;
- width: 30%;
- margin: 1%;
- padding: 3% 1%;
- background-color: #e9ecef;
- div {
- display: flex;
- justify-content: center;
- }
- }
- .selection-modal-body-block-detail {
- cursor: pointer;
- width: 17%;
- margin: 1%;
- padding: 3% 1%;
- background-color: #e9ecef;
- div {
- display: flex;
- justify-content: center;
- }
- }
- .selection-modal-body-block-choosen,
- .selection-modal-body-block-detail-choosen {
- background-color: #fadb14;
- }
- .selection-modal-body-block-unchoosen,
- .selection-modal-body-block-detail-unchoosen {
- background-color: #e9ecef;
- }
- }
- }
- .selection-rowno-modal {
- .selection-rowno-modal-body {
- max-height: 7rem;
- overflow: auto;
- .selection-rowno-modal-body-block {
- margin: 0.5rem 0;
- text-align: center;
- }
- }
- }
- .selection-print-modal {
- .selection-print-modal-body {
- font-size: 0.5rem;
- height: 4.5rem;
- .selection-print-modal-body-top {
- display: flex;
- justify-content: space-around;
- align-items: center;
- margin: 0.5rem 0;
- /deep/.ivu-input-number-handler{
- height: 20.5px;
- }
- // /deep/.ivu-input-number-input-warp{
- // margin: auto 0;
- // /deep/.ivu-input-number-input{
- // margin: auto 0;
- // }
- // }
- }
- .selection-print-modal-body-info {
- padding-top: 16px;
- border-top: 1px solid #e8eaec;
- text-align: center;
- button{
- height: 2em;
- font-size: 1em;
- }
- }
- }
- .selection-print-modal-body-footer{
- height: auto;
- display: flex;
- // justify-content: space-around;
- flex-wrap: wrap;
- button{
- margin: 0.2em;
- height: 1.5em;
- font-size: 3em;
- }
- }
- }
- .icon-wrapper {
- position: relative;
- font-size: 0.25rem;
- }
- .icon-close {
- position: absolute;
- right: -0.35rem;
- top: -0.2rem;
- }
- /deep/.ivu-page-item {
- display: inline-block;
- font-size: 0.5rem;
- height: 1rem;
- line-height: 1rem;
- width: 1rem;
- }
- /deep/.ivu-page-prev,
- /deep/.ivu-page-next {
- display: inline-block;
- font-size: 0.5rem;
- height: 1rem;
- line-height: 1rem;
- width: 1rem;
- a {
- font-size: 0.5rem;
- }
- }
- /deep/.ivu-modal-close {
- border: 1px solid black;
- }
- /deep/.fullscreen-content-page {
- display: flex;
- justify-content: space-around;
- }
- .wide-screen-rowno {
- display: flex;
- justify-content: center !important;
- span {
- display: inline-block;
- text-align: center;
- width: 3rem;
- height: 3rem;
- line-height: 3rem;
- border-radius: 50%;
- font-size: 1.5rem;
- }
- .wide-screen-rowno-span-choosed {
- color: #2d8cf0;
- background-color: white;
- }
- .wide-screen-rowno-span {
- color: white;
- background-color: #2d8cf0;
- }
- }
- .printRow{
- display: none;
- }
- @media print {
- .printRow{
- display: block;
- width: 100%;
- margin-top: 10mm;
- .printRow_content{
- page-break-after: always;
- }
- }
- @page{
- margin:10mm 1mm
- }
- }
- </style>
|