ChipPrintScreenCheck.vue 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827
  1. <template>
  2. <div>
  3. <Modal v-model="fullscreenModals" fullscreen title="工位屏-补打" @on-cancel='cancel'>
  4. <div slot="header">
  5. <span style="font-size: 0.5rem">工位屏-补打</span>
  6. <div class="fullscreen-title-btn">
  7. <Button
  8. @click="handleWideScreenClick"
  9. size="large"
  10. id="full_screen_btn"
  11. type="primary"
  12. style="margin-right: 1rem"
  13. >
  14. {{ isWideScreen ? "完整模式" : "简单模式" }}
  15. </Button>
  16. <Button
  17. @click="handlePrint"
  18. size="large"
  19. type="primary"
  20. style="margin-right: 1rem"
  21. >
  22. 打 印
  23. </Button>
  24. <Button @click="back" size="large" type="primary">
  25. 返 回
  26. </Button>
  27. </div>
  28. </div>
  29. <div class="fullscreen-content">
  30. <div class="fullscreen-content-select">
  31. <div class="fullscreen-content-select-block">
  32. <Button
  33. @click="handleSelection(ordernoObj, 1)"
  34. size="large"
  35. type="primary"
  36. style="margin-right: 10px"
  37. >
  38. 项目选择
  39. </Button>
  40. <div class="icon-wrapper" v-show="selectedInfo.order_no">
  41. <Icon
  42. class="icon-close"
  43. @click="handleCancelSelected('order_no')"
  44. size="24"
  45. type="md-close"
  46. />
  47. <div>
  48. <span>订单编号:</span>
  49. <span>{{ selectedInfo.order_no }}</span>
  50. </div>
  51. <div>
  52. <span>项目名称:</span>
  53. <span>{{ selectedInfo.residential_name }}</span>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="fullscreen-content-select-block">
  58. <Button
  59. @click="handleSelection(urlObj, 2)"
  60. size="large"
  61. type="primary"
  62. style="margin-right: 10px"
  63. >
  64. 图号选择
  65. </Button>
  66. <div style="display: flex; align-items: center">
  67. <div class="icon-wrapper">
  68. <div v-show="selectedInfo.url_number">
  69. <Icon
  70. class="icon-close"
  71. @click="handleCancelSelected('product_id')"
  72. size="24"
  73. type="md-close"
  74. />
  75. <span>图号:</span>
  76. <span>{{ selectedInfo.url_number }}</span>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="fullscreen-content-select-block">
  82. <Button
  83. @click="handleSelectionRowno(rownoObj)"
  84. size="large"
  85. type="primary"
  86. style="margin-right: 10px"
  87. >
  88. 行号选择
  89. </Button>
  90. <div
  91. class="icon-wrapper"
  92. v-show="selectedInfo.rows.length != 0"
  93. style="display: flex; align-items: center"
  94. >
  95. <span>行号:</span>
  96. <div style="display: flex; justify-content: flex-start">
  97. <div v-for="(item, index) in selectedInfo.rows" :key="item.key">
  98. <div class="icon-wrapper" style="margin-right: 0.35rem">
  99. <Icon
  100. class="icon-close"
  101. @click="handleCancelSelected(index, 1)"
  102. size="24"
  103. type="md-close"
  104. />
  105. <span style="display: inline-block"
  106. >{{ item.start }}-{{ item.end }}</span
  107. >
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="fullscreen-content-choose">
  115. <div
  116. :class="[
  117. choose.isChoosed
  118. ? 'fullscreen-content-choose-block fullscreen-content-choose-block-choosen'
  119. : 'fullscreen-content-choose-block fullscreen-content-choose-block-unchoosen',
  120. isWideScreen ? 'fullscreen-content-choose-block-wide' : '',
  121. ]"
  122. v-for="choose in contentData"
  123. :key="choose.row"
  124. @click="handleChooseBlockClick(choose)"
  125. >
  126. <div :class="[isWideScreen ? 'chip-tag-choosed' : 'chip-tag']">
  127. 芯片
  128. <Icon
  129. size="20px"
  130. :style="
  131. isWideScreen
  132. ? 'font-size: 1rem; transform: translate(0, -50%)'
  133. : 'font-size: 1rem; transform: translate(0, -40%)'
  134. "
  135. style="font-size: 1rem; transform: translate(0, -40%)"
  136. :color="choose.isChoosed ? '#2d8cf0' : 'white'"
  137. type="md-arrow-dropup"
  138. />
  139. </div>
  140. <div v-show="!isWideScreen">
  141. <span>行号</span>
  142. <span>{{ choose.row_no }}</span>
  143. </div>
  144. <div v-show="!isWideScreen">
  145. <span>部件</span>
  146. <span>{{ choose.part_title }}</span>
  147. </div>
  148. <div v-show="!isWideScreen">
  149. <span>材料</span>
  150. <span>{{ choose.sub_part_title }}</span>
  151. </div>
  152. <div v-show="!isWideScreen">
  153. <span>毛料尺寸</span>
  154. <span>{{ choose.wool_size }}</span>
  155. </div>
  156. <div v-show="!isWideScreen">
  157. <span>精裁尺寸</span>
  158. <span>{{ choose.cut_size }}</span>
  159. </div>
  160. <div v-show="isWideScreen" class="wide-screen-rowno">
  161. <span
  162. :class="[
  163. choose.isChoosed
  164. ? 'wide-screen-rowno-span-choosed'
  165. : 'wide-screen-rowno-span',
  166. ]"
  167. >{{ choose.row_no }}</span
  168. >
  169. </div>
  170. <div>
  171. <span>未完成数量</span>
  172. <span>
  173. {{ choose.un_complete }}(总数:{{
  174. choose.on_complete + choose.un_complete
  175. }})
  176. </span>
  177. </div>
  178. <div>
  179. <span>未打印数量</span>
  180. <span
  181. >{{ choose.un_print }}(总数:{{
  182. choose.on_print + choose.un_print
  183. }})</span
  184. >
  185. </div>
  186. </div>
  187. </div>
  188. <div class="fullscreen-content-page">
  189. <Page
  190. @on-change="changePage"
  191. :page-size="page_size"
  192. :current="page_index"
  193. :total="total"
  194. />
  195. </div>
  196. </div>
  197. <div slot="footer"></div>
  198. <Modal
  199. class="selection-modal"
  200. v-model="selectionModal"
  201. :title="currencySelectedObj.title"
  202. width="80%"
  203. >
  204. <van-number-keyboard
  205. :show="show"
  206. @blur="show = false"
  207. @input="onInput"
  208. @delete="onDelete"
  209. z-index="99999"
  210. />
  211. <div class="selection-modal-top">
  212. <Input
  213. :placeholder="currencySelectedObj.title"
  214. v-model="currentSearchValue"
  215. @on-focus="show = true"
  216. @on-change="
  217. handleCurrentSearch(currencySelectedObj, currentSearchValue)
  218. "
  219. style="width: 80%"
  220. >
  221. <Icon
  222. @click="
  223. handleCurrentSearch(currencySelectedObj, currentSearchValue)
  224. "
  225. type="ios-search"
  226. slot="suffix"
  227. />
  228. </Input>
  229. </div>
  230. <div class="selection-modal-body">
  231. <div
  232. :class="[
  233. block.isCurrent
  234. ? 'selection-modal-body-block selection-modal-body-block-choosen'
  235. : 'selection-modal-body-block selection-modal-body-block-unchoosen',
  236. ]"
  237. v-for="(block, index) in currencySelectedObj.list"
  238. :key="index"
  239. @click="handleSelectionClick(currencySelectedObj, block)"
  240. >
  241. <div v-show="currencySelectedObj.type == 1">
  242. <span>订单编号:</span>
  243. <span>{{ block.order_no }}</span>
  244. </div>
  245. <div v-show="currencySelectedObj.type == 2">
  246. <span>{{ block.title }}</span>
  247. </div>
  248. <div v-show="currencySelectedObj.type == 1">
  249. <span>项目名称:</span>
  250. <span>{{ block.residential_name }}</span>
  251. </div>
  252. </div>
  253. <div
  254. style="font-size: 1rem"
  255. v-show="currencySelectedObj.list.length == 0"
  256. >
  257. 暂无数据
  258. </div>
  259. </div>
  260. <div class="fullscreen-content-page">
  261. <Page
  262. @on-change="changeModalPage"
  263. :current="
  264. currencySelectedObj.type == 1
  265. ? modal_1_page_index
  266. : modal_2_page_index
  267. "
  268. :page-size="
  269. currencySelectedObj.type == 1
  270. ? modal_1_page_size
  271. : modal_2_page_size
  272. "
  273. :total="currencySelectedObj.type == 1 ? modal_1_total : modal_2_total"
  274. />
  275. </div>
  276. <div slot="footer">
  277. <Button
  278. @click="selectionModal = false"
  279. type="primary"
  280. style="margin-right: 10px"
  281. >
  282. 返回
  283. </Button>
  284. <!-- <Button
  285. v-show="currencySelectedObj.type == 1"
  286. @click="handleSelectionComfirm(currencySelectedObj)"
  287. type="primary"
  288. >
  289. 确认
  290. </Button> -->
  291. </div>
  292. </Modal>
  293. <Modal
  294. class="selection-modal"
  295. v-model="selectionDetailModal"
  296. :title="currencySelectedObj.title"
  297. width="80%"
  298. >
  299. <div class="selection-modal-body" v-if="currencySelectedObj.hasChild">
  300. <div
  301. :class="[
  302. block.isCurrent
  303. ? 'selection-modal-body-block-detail selection-modal-body-block-detail-choosen'
  304. : 'selection-modal-body-block-detail selection-modal-body-block-detail-unchoosen',
  305. ]"
  306. v-for="(block, index) in chooseDetailUrlNo.children"
  307. :key="index"
  308. @click="handleSelectionDetailClick(chooseDetailUrlNo, block)"
  309. >
  310. <div>
  311. <span>{{ block.url_number }}</span>
  312. </div>
  313. </div>
  314. </div>
  315. <div slot="footer">
  316. <Button
  317. @click="
  318. selectionDetailModal = false;
  319. selectionModal = true;
  320. "
  321. type="primary"
  322. style="margin-right: 10px"
  323. >
  324. 返回
  325. </Button>
  326. <!-- <Button
  327. @click="handleSelectionComfirm(currencySelectedObj)"
  328. type="primary"
  329. >
  330. 确认
  331. </Button> -->
  332. </div>
  333. </Modal>
  334. <Modal
  335. class="selection-rowno-modal"
  336. v-model="selectionRownolModal"
  337. width="80%"
  338. >
  339. <div slot="header"><h1>行号选择</h1></div>
  340. <div class="selection-rowno-modal-body">
  341. <van-number-keyboard
  342. :show="show2"
  343. @blur="show2 = false"
  344. @input="keyboardTap"
  345. @delete="keyboardDele"
  346. z-index="99999"
  347. />
  348. <div
  349. class="selection-rowno-modal-body-block"
  350. v-for="(block, index) in chooseLineNo"
  351. :key="index"
  352. >
  353. <span style="font-size:2em;">行号区间:</span>
  354. <Input
  355. v-model="block.start"
  356. @on-focus="handleRowNoInput(block, 1)"
  357. clearable
  358. style="width: 20%; margin: 0 10px"
  359. size="large"
  360. />
  361. -
  362. <Input
  363. v-model="block.end"
  364. @on-focus="handleRowNoInput(block, 2)"
  365. clearable
  366. style="width: 20%; margin: 0 10px"
  367. size="large"
  368. />
  369. <Button
  370. @click="handleAddRow(block, index)"
  371. type="primary"
  372. size="large"
  373. v-show="index == 0"
  374. style="margin-right: 10px"
  375. >
  376. 添加
  377. </Button>
  378. <Button
  379. @click="handleDeleRow(block, index)"
  380. type="primary"
  381. size="large"
  382. v-show="index != 0"
  383. style="margin-right: 10px"
  384. >
  385. 删除
  386. </Button>
  387. </div>
  388. </div>
  389. <div slot="footer">
  390. <Button
  391. @click="selectionRownolModal = false"
  392. type="primary"
  393. style="margin-right: 10px"
  394. >
  395. 返回
  396. </Button>
  397. <Button @click="handleRowNoComfirm(chooseLineNo)" type="primary">
  398. 确认
  399. </Button>
  400. </div>
  401. </Modal>
  402. <Modal
  403. class="selection-print-modal"
  404. v-model="printModal"
  405. width="60%"
  406. >
  407. <div slot="header" style="text-align:center;font-weight:bold"><h1>打 印</h1></div>
  408. <div class="selection-print-modal-body">
  409. <div class="selection-print-modal-body-top">
  410. <div>
  411. <span>行号:</span>
  412. <span>{{ selectedObj.row_no }}</span>
  413. </div>
  414. <div>
  415. <span>部件名称:</span>
  416. <span>{{ selectedObj.part_title }}</span>
  417. </div>
  418. <div>
  419. <span>数量:</span>
  420. <InputNumber
  421. :max="selectedObj.on_print"
  422. :min="1"
  423. size="large"
  424. @on-focus="handlePrintInput"
  425. v-model="selectedObj.print_num"
  426. ></InputNumber>
  427. <van-number-keyboard
  428. :show="show3"
  429. @blur="show3 = false"
  430. @input="keyboardPrintTap"
  431. @delete="keyboardPrintDele"
  432. z-index="99999"
  433. />
  434. </div>
  435. </div>
  436. <div class="selection-print-modal-body-info">
  437. <!-- {{
  438. selectedObj.isFinished
  439. ? "该部件已打印,是否再次打印?"
  440. : "请确认打印数量是否正确!"
  441. }} -->
  442. {{
  443. "该部件已打印,是否再次打印?"
  444. }}
  445. <div>
  446. <!-- v-show="selectedObj.isFinished" -->
  447. <Button
  448. @click="handleSelectionRoom"
  449. type="primary"
  450. >
  451. 选择房间号
  452. </Button>
  453. </div>
  454. </div>
  455. </div>
  456. <div slot="footer" class="selection-print-modal-body-footer">
  457. <Button
  458. @click="printModal = false"
  459. type="primary"
  460. style="margin-right: 10px"
  461. >
  462. 返回
  463. </Button>
  464. <Button @click="handlePrintComfirm(selectedObj)" type="primary">
  465. 芯片打印
  466. </Button>
  467. <Button @click="Print(selectedObj)" type="primary">
  468. 标签打印
  469. </Button>
  470. </div>
  471. </Modal>
  472. <Modal
  473. class="selection-modal"
  474. v-model="roomModal"
  475. @on-cancel='handleRoomCancel'
  476. title="选择房间号"
  477. width="80%"
  478. >
  479. <div class="selection-modal-body">
  480. <div
  481. :class="[
  482. block.isCurrent
  483. ? 'selection-modal-body-block selection-modal-body-block-choosen'
  484. : 'selection-modal-body-block selection-modal-body-block-unchoosen',
  485. ]"
  486. v-for="(block, index) in modalRoomList"
  487. :key="index"
  488. @click="handleSelectedRoomClick(modalRoomList, block)"
  489. >
  490. <div>
  491. <span>{{ block.house }}</span>
  492. </div>
  493. </div>
  494. </div>
  495. <div class="fullscreen-content-page">
  496. <Page
  497. @on-change="changeRoomPage"
  498. :current="modal_room_page_index"
  499. :page-size="modal_room_page_size"
  500. :total="modal_room_total"
  501. />
  502. </div>
  503. <div slot="footer" style="display:flex;justify-content: space-around;">
  504. <Button
  505. @click="handleRoomCancel"
  506. type="primary"
  507. style="margin-right: 10px;width:20%;height:60px;font-size:29px"
  508. >
  509. 返回
  510. </Button>
  511. <Button @click="handlePrintComfirm(selectedObj, 1)" type="primary"
  512. style="width:20%;height:60px;font-size:29px">
  513. 芯片打印
  514. </Button>
  515. <Button @click="Print(selectedObj, 1)" type="primary" style="width:20%;height:60px;font-size:29px">
  516. 标签打印
  517. </Button>
  518. </div>
  519. </Modal>
  520. </Modal>
  521. <div ref='printRow' class="printRow">
  522. <div v-for="(item,index) in tagPrintList" :key="index" class="printRow_content" style="width:380px">
  523. <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>
  524. <div style="display:flex"><span style="width:140px">房号:{{item.number_detail}}</span><span>产品:{{item.product_title}}</span></div>
  525. <div style="display:flex"><span style="width:140px">图号:{{item.url_number}}</span><span>部件:{{item.part_title}}</span></div>
  526. <div><span>尺寸:{{item.measure}}</span></div>
  527. <div><span>木皮:{{item.color_title}}</span></div>
  528. </div>
  529. </div>
  530. </div>
  531. </template>
  532. <script>
  533. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  534. // 例如:import 《组件名称》 from '《组件路径》';
  535. import "@vant/touch-emulator";
  536. import $ from "jquery";
  537. export default {
  538. name: "",
  539. components: {},
  540. props: {},
  541. // import引入的组件需要注入到对象中才能使用
  542. data() {
  543. // 这里存放数据
  544. return {
  545. tagPrintList:[],
  546. show: false,
  547. show2: false,
  548. show3: false,
  549. isFullScreen: false,
  550. fullscreenModals: true,
  551. selectionModal: false,
  552. selectionRownolModal: false,
  553. selectionDetailModal: false,
  554. printModal: false,
  555. roomModal: false,
  556. contentData: [],
  557. selectedObj: {},
  558. ordernoObj: {
  559. title: "订单编号/项目名称选择",
  560. currentSearchValue: "",
  561. list: [],
  562. hasChild: false,
  563. },
  564. urlObj: {
  565. title: "图号选择",
  566. list: [],
  567. hasChild: true,
  568. },
  569. rownoObj: {},
  570. currencySelectedObj: {
  571. title: "订单编号/项目名称选择",
  572. currentSearchValue: "",
  573. type: 1,
  574. list: [],
  575. },
  576. selectedInfo: {
  577. order_no: "",
  578. residential_name: "",
  579. url_number: "",
  580. product_id: "",
  581. rows: [],
  582. },
  583. page_index: 1,
  584. // page_size: 6,
  585. total: 0,
  586. currentSearchValue: "",
  587. modal_1_page_index: 1,
  588. modal_1_page_size: 6,
  589. modal_1_total: 0,
  590. modal_room_page_index: 1,
  591. modal_room_page_size: 9,
  592. modal_room_total: 0,
  593. modal_2_page_index: 1,
  594. modal_2_page_size: 60,
  595. modal_2_total: 0,
  596. chooseOrderNo: {},
  597. chooseUrlNo: {},
  598. chooseDetailUrlNo: {},
  599. chooseLineNo: [{ start: "", end: "" }],
  600. keyboardObj: {},
  601. keyboardVal: "",
  602. modalRoomList: [],
  603. modalRoomListSelected: [],
  604. isWideScreen: localStorage.getItem("isWideScreen") || false,
  605. };
  606. },
  607. // 生命周期 - 创建完成(可以访问当前this实例)
  608. created() {},
  609. // 生命周期 - 挂载完成(可以访问DOM元素)
  610. mounted() {
  611. this.selectedInfo = JSON.parse(localStorage.getItem("printInfo"));
  612. this.getChipDetail();
  613. },
  614. methods: {
  615. Print(row,type){
  616. if (
  617. type &&
  618. this.modalRoomListSelected.length != this.selectedObj.print_num
  619. ) {
  620. return this.$Message.warning("与打印数量不符");
  621. }
  622. let ids = this.modalRoomListSelected.map((v) => {
  623. return v.id;
  624. });
  625. let data = type
  626. ? {
  627. order_no: this.selectedInfo.order_no,
  628. product_id: this.selectedInfo.product_id,
  629. rows: this.selectedInfo.rows,
  630. num: this.selectedObj.print_num,
  631. id: row.id,
  632. ids,
  633. type,
  634. }
  635. : {
  636. order_no: this.selectedInfo.order_no,
  637. product_id: this.selectedInfo.product_id,
  638. rows: this.selectedInfo.rows,
  639. num: this.selectedObj.print_num,
  640. id: row.id,
  641. };
  642. // 获取打印数据
  643. this.axios({
  644. method: "post",
  645. url: "/api/station_print",
  646. data,
  647. }).then((resp) => {
  648. if (resp.code == 200) {
  649. console.log(resp)
  650. this.tagPrintList = resp.data;
  651. setTimeout(()=>{
  652. this.$print(this.$refs.printRow);
  653. })
  654. }
  655. });
  656. },
  657. cancel(){
  658. this.fullscreenModals = false;
  659. this.$forceUpdate();
  660. },
  661. back() {
  662. this.$router.go(-1);
  663. },
  664. handleSelection(obj, type) {
  665. if (type == 2 && this.selectedInfo.order_no == "") {
  666. return this.$Message.warning("请先选择项目");
  667. }
  668. this.currentSearchValue = "";
  669. this.currentSearchValue = obj.currentSearchValue;
  670. this.currencySelectedObj = obj;
  671. this.selectionModal = true;
  672. this.total = 0;
  673. this.currencySelectedObj.type = type;
  674. if (this.currencySelectedObj.list.length == 0 || type == 2) {
  675. this.handleCurrentSearch(
  676. this.currencySelectedObj,
  677. this.currentSearchValue
  678. );
  679. }
  680. },
  681. handleSelectionRowno(row) {
  682. if (this.selectedInfo.rows.length > 0) {
  683. this.chooseLineNo = JSON.parse(JSON.stringify(this.selectedInfo.rows));
  684. } else {
  685. this.chooseLineNo = [{ start: null, end: null }];
  686. }
  687. this.selectionRownolModal = true;
  688. },
  689. handleCancelSelected(v, type) {
  690. if (type) {
  691. this.selectedInfo.rows.splice(v, 1);
  692. } else if (v == "product_id") {
  693. this.selectedInfo.url_number = "";
  694. this.selectedInfo.product_id = "";
  695. } else {
  696. this.selectedInfo[v] = "";
  697. }
  698. if (v != "order_no") {
  699. this.getChipDetail();
  700. } else {
  701. this.selectedInfo.residential_name = "";
  702. this.selectedInfo.url_number = "";
  703. this.selectedInfo.product_id = "";
  704. this.selectedInfo.rows = [];
  705. this.contentData = [];
  706. this.total = 0;
  707. }
  708. },
  709. handleChooseBlockClick(row) {
  710. console.log(`row`, row);
  711. if (row.isChoosed) {
  712. row.isChoosed = false;
  713. } else {
  714. this.contentData.map((v) => {
  715. v.isChoosed = false;
  716. });
  717. row.isChoosed = true;
  718. }
  719. if (row.un_print == 0) {
  720. row.isFinished = true;
  721. }
  722. this.selectedObj = row;
  723. },
  724. handleSelectionClick(row, obj) {
  725. row.list.map((v) => (v.isCurrent = false));
  726. obj.isCurrent = true;
  727. if (row.hasChild) {
  728. // 行号
  729. this.selectionModal = false;
  730. this.selectionDetailModal = true;
  731. this.chooseDetailUrlNo = obj;
  732. this.currentSearchValue = this.rownoObj.currentSearchValue;
  733. this.contentData = [];
  734. this.total = 0;
  735. } else {
  736. // 订单号
  737. this.chooseOrderNo = obj;
  738. this.currentSearchValue = this.ordernoObj.currentSearchValue;
  739. }
  740. if (row.type == 1) {
  741. this.handleSelectionComfirm(this.currencySelectedObj);
  742. }
  743. this.$forceUpdate();
  744. },
  745. handleAddRow(row, index) {
  746. this.chooseLineNo.push({
  747. start: "",
  748. end: "",
  749. });
  750. },
  751. handleDeleRow(row, index) {
  752. this.chooseLineNo.splice(index, 1);
  753. },
  754. handleSelectionDetailClick(row, obj) {
  755. row.children.map((v) => (v.isCurrent = false));
  756. obj.isCurrent = true;
  757. this.chooseUrlNo = obj;
  758. this.handleSelectionComfirm(this.currencySelectedObj);
  759. this.$forceUpdate();
  760. },
  761. handleFullScreenClick() {
  762. this.isFullScreen = !this.isFullScreen;
  763. if (this.isFullScreen) {
  764. this.enterFullScreen();
  765. } else {
  766. this.exitFullScreen();
  767. }
  768. },
  769. handleWideScreenClick() {
  770. this.isWideScreen = !this.isWideScreen;
  771. localStorage.setItem("isWideScreen", this.isWideScreen);
  772. if (this.isWideScreen) {
  773. this.page_size = 12;
  774. } else {
  775. this.page_size = 6;
  776. }
  777. this.getChipDetail();
  778. },
  779. enterFullScreen() {
  780. let el = document.documentElement;
  781. let rfs =
  782. el.requestFullScreen ||
  783. el.webkitRequestFullScreen ||
  784. el.mozRequestFullScreen ||
  785. el.msRequestFullscreen;
  786. if (rfs) {
  787. rfs.call(el);
  788. } else if (typeof window.ActiveXObject !== "undefined") {
  789. // for IE,这里其实就是模拟了按下键盘的F11,使浏览器全屏
  790. let wscript = new ActiveXObject("WScript.Shell");
  791. if (wscript != null) {
  792. wscript.SendKeys("{F11}");
  793. }
  794. }
  795. },
  796. exitFullScreen() {
  797. let el = document;
  798. let cfs =
  799. el.cancelFullScreen ||
  800. el.mozCancelFullScreen ||
  801. el.msExitFullscreen ||
  802. el.webkitExitFullscreen ||
  803. el.exitFullscreen;
  804. if (cfs) {
  805. // typeof cfs != "undefined" && cfs
  806. cfs.call(el);
  807. } else if (typeof window.ActiveXObject !== "undefined") {
  808. // for IE,这里和fullScreen相同,模拟按下F11键退出全屏
  809. let wscript = new ActiveXObject("WScript.Shell");
  810. if (wscript != null) {
  811. wscript.SendKeys("{F11}");
  812. }
  813. }
  814. },
  815. handleCurrentSearch(row, val) {
  816. //type 1项目选择 2图号选择
  817. let url =
  818. row.type == 1
  819. ? "/api/station_get_order"
  820. : "/api/station_get_url_number";
  821. this.axios({
  822. method: "post",
  823. url,
  824. data: {
  825. page_index:
  826. row.type == 1 ? this.modal_1_page_index : this.modal_2_page_index,
  827. page_size:
  828. row.type == 1 ? this.modal_1_page_size : this.modal_2_page_size,
  829. order_no: row.type == 1 ? val : this.selectedInfo.order_no,
  830. url_number: row.type == 1 ? "" : val,
  831. },
  832. }).then((res) => {
  833. if (res.code == 200) {
  834. if (row.type == 1) {
  835. row.list = res.data.data;
  836. this.modal_1_total = res.data.total;
  837. } else {
  838. row.list = [];
  839. this.modal_2_total = res.data.total;
  840. let length = Math.ceil(res.data.data.length / 10);
  841. for (let index = 0; index < length; index++) {
  842. row.list.push({
  843. //最后一位不一定刚好10个
  844. title:
  845. length - index == 1
  846. ? `${res.data.data[10 * index].url_number}~${
  847. res.data.data[res.data.data.length - 1].url_number
  848. }`
  849. : `${res.data.data[10 * index].url_number}~${
  850. res.data.data[10 * index + 10].url_number
  851. }`,
  852. children: res.data.data.slice(10 * index, 10 * index + 10),
  853. });
  854. }
  855. }
  856. }
  857. });
  858. },
  859. changeRoomPage(e) {
  860. this.modal_room_page_index = e;
  861. this.getModalRoomList();
  862. },
  863. handleSelectionRoom() {
  864. this.getModalRoomList();
  865. this.roomModal = true;
  866. },
  867. getModalRoomList() {
  868. this.axios({
  869. method: "post",
  870. url: "/api/station_get_print_house",
  871. data: {
  872. order_no: this.selectedInfo.order_no,
  873. product_id: this.selectedInfo.product_id,
  874. rows: this.selectedInfo.rows,
  875. page_index: this.modal_room_page_index,
  876. page_size: this.modal_room_page_size,
  877. id: this.selectedObj.id,
  878. },
  879. }).then((res) => {
  880. if (res.code == 200) {
  881. res.data.data.map((v) => {
  882. v.isCurrent = false;
  883. this.modalRoomListSelected &&
  884. this.modalRoomListSelected.map((w) => {
  885. if (w.id == v.id) {
  886. v.isCurrent = true;
  887. }
  888. });
  889. });
  890. this.modalRoomList = res.data.data;
  891. this.modal_room_total = res.data.total;
  892. }
  893. });
  894. },
  895. handleSelectedRoomClick(list, block) {
  896. if (block.isCurrent) {
  897. this.modalRoomListSelected = this.modalRoomListSelected.filter(
  898. (v) => v.id != block.id
  899. );
  900. block.isCurrent = !block.isCurrent;
  901. } else {
  902. if (this.modalRoomListSelected.length < this.selectedObj.print_num) {
  903. block.isCurrent = !block.isCurrent;
  904. this.modalRoomListSelected = this.modalRoomListSelected.concat(
  905. this.modalRoomList.filter((v) => v.isCurrent)
  906. );
  907. } else {
  908. this.$Message.warning("与打印数量不符,请重新选择");
  909. }
  910. }
  911. this.modalRoomListSelected = Array.from(
  912. new Set([...this.modalRoomListSelected])
  913. );
  914. },
  915. //项目、图号确认
  916. handleSelectionComfirm(row) {
  917. console.log(`row`, row);
  918. // 这里需要把弹框关闭之后赋值到selectedInfo上
  919. // this.selectedInfo.order_no;
  920. // 1 项目选择 2图号选择
  921. if (row.type == 1) {
  922. this.selectedInfo.order_no = this.chooseOrderNo.order_no;
  923. this.selectedInfo.residential_name = this.chooseOrderNo.residential_name;
  924. this.selectionModal = false;
  925. } else if (row.type == 2) {
  926. this.selectedInfo.url_number = this.chooseUrlNo.url_number;
  927. this.selectedInfo.product_id = this.chooseUrlNo.product_id;
  928. this.selectionDetailModal = false;
  929. this.getChipDetail();
  930. }
  931. // order_no: "20211010",
  932. // residential_name: "2",
  933. // url_number: "3",
  934. // row_no: [],
  935. },
  936. // 获取具体详情
  937. getChipDetail() {
  938. if(!this.selectedInfo.order_no&&!this.selectedInfo.product_id){
  939. return
  940. }else{
  941. this.axios({
  942. method: "post",
  943. url: "/api/station_get_order_on_product_pr",
  944. data: {
  945. order_no: this.selectedInfo.order_no,
  946. product_id: this.selectedInfo.product_id,
  947. rows: this.selectedInfo.rows,
  948. page_index: this.page_index,
  949. page_size: this.page_size,
  950. },
  951. }).then((res) => {
  952. if (res.code == 200) {
  953. console.log(`res`, res);
  954. res.data.data.map((v) => (v.isChoosed = false));
  955. this.contentData = res.data.data;
  956. this.total = res.data.total;
  957. }
  958. });
  959. }
  960. },
  961. handlePrint() {
  962. if (!this.selectedObj.isChoosed) {
  963. return this.$Message.warning("请选择数据");
  964. }
  965. if (this.selectedObj.un_print == 0) {
  966. this.selectedObj.print_num = this.selectedObj.on_print;
  967. } else {
  968. this.selectedObj.print_num = this.selectedObj.on_print;
  969. }
  970. this.printModal = true;
  971. },
  972. handlePrintComfirm(row, type) {
  973. if (
  974. type &&
  975. this.modalRoomListSelected.length != this.selectedObj.print_num
  976. ) {
  977. return this.$Message.warning("与打印数量不符");
  978. }
  979. let ids = this.modalRoomListSelected.map((v) => {
  980. return v.id;
  981. });
  982. let data = type
  983. ? {
  984. order_no: this.selectedInfo.order_no,
  985. product_id: this.selectedInfo.product_id,
  986. rows: this.selectedInfo.rows,
  987. num: this.selectedObj.print_num,
  988. id: row.id,
  989. ids,
  990. type,
  991. }
  992. : {
  993. order_no: this.selectedInfo.order_no,
  994. product_id: this.selectedInfo.product_id,
  995. rows: this.selectedInfo.rows,
  996. num: this.selectedObj.print_num,
  997. id: row.id,
  998. };
  999. this.axios({
  1000. method: "post",
  1001. url: "/api/station_print",
  1002. data,
  1003. }).then((resp) => {
  1004. if (resp.code == 200) {
  1005. this.axios.get("/api/get_print_local_url").then((res) => {
  1006. console.log(res);
  1007. if (res.code == 200) {
  1008. if (res.data.state) {
  1009. this.handlePrintChipsUsb(resp.data, res.data.type);
  1010. } else {
  1011. this.handlePrintChipsIp(resp.data, res.data.type);
  1012. }
  1013. }
  1014. });
  1015. this.modalRoomList.map((v) => {
  1016. v.isCurrent = false;
  1017. });
  1018. this.modalRoomListSelected = [];
  1019. this.printModal = false;
  1020. this.roomModal = false;
  1021. }
  1022. });
  1023. },
  1024. handlePrintChipsUsb(contents, type) {
  1025. this.axios.get("/api/get_print_url").then((res) => {
  1026. let data = {};
  1027. // let url = "http://192.168.0.145:888/postek/print"; //request_url
  1028. let url = `http://${res.data.request_url}:888/postek/print`; //request_url
  1029. data.reqParam = "1"; //这个一般不用改,如需改,查api
  1030. let printparamsJsonArray = [];
  1031. // let IP = "192.168.1.58";//print_url
  1032. // let IP = "192.168.0.199"; //print_url
  1033. printparamsJsonArray.push({ PTK_OpenUSBPort: 255 });
  1034. printparamsJsonArray.push({ PTK_ClearBuffer: "" });
  1035. printparamsJsonArray.push({ PTK_SetDirection: "B" });
  1036. printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
  1037. printparamsJsonArray.push({ PTK_SetDarkness: "10" });
  1038. printparamsJsonArray.push({
  1039. PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
  1040. });
  1041. printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
  1042. // 打印类型 1江山 2贝斯特
  1043. if (type == 1) {
  1044. contents.map((content) => {
  1045. //江山打印格式
  1046. //上
  1047. const printContent_l1 = `单号:${content.order_no}`;
  1048. printparamsJsonArray.push({
  1049. PTK_DrawText_TrueType:
  1050. "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
  1051. });
  1052. const printContent_l1_2 = `型号:${content.product_title}`;
  1053. printparamsJsonArray.push({
  1054. PTK_DrawText_TrueType:
  1055. "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
  1056. });
  1057. const printContent_l2 = `尺寸:${content.measure}`;
  1058. printparamsJsonArray.push({
  1059. PTK_DrawText_TrueType:
  1060. "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
  1061. });
  1062. const printContent_l2_2 = `工艺:${content.process_title}`;
  1063. printparamsJsonArray.push({
  1064. PTK_DrawText_TrueType:
  1065. "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
  1066. });
  1067. const printContent_l3 = `颜色:${content.color_title}`;
  1068. printparamsJsonArray.push({
  1069. PTK_DrawText_TrueType:
  1070. "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
  1071. });
  1072. const printContent_l3_2 = `部件:${content.part_title}`;
  1073. printparamsJsonArray.push({
  1074. PTK_DrawText_TrueType:
  1075. "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
  1076. });
  1077. //下
  1078. printparamsJsonArray.push({
  1079. PTK_DrawText_TrueType:
  1080. "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
  1081. });
  1082. printparamsJsonArray.push({
  1083. PTK_DrawText_TrueType:
  1084. "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
  1085. });
  1086. printparamsJsonArray.push({
  1087. PTK_DrawText_TrueType:
  1088. "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
  1089. });
  1090. printparamsJsonArray.push({
  1091. PTK_DrawText_TrueType:
  1092. "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
  1093. });
  1094. printparamsJsonArray.push({
  1095. PTK_DrawText_TrueType:
  1096. "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
  1097. });
  1098. printparamsJsonArray.push({
  1099. PTK_DrawText_TrueType:
  1100. "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
  1101. });
  1102. printparamsJsonArray.push({
  1103. PTK_RWRFIDLabel:
  1104. "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
  1105. });
  1106. printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
  1107. });
  1108. } else {
  1109. contents.map((content) => {
  1110. //贝斯特打印格式
  1111. //上
  1112. const printContent_l1 = `项目:${content.client_name}`;
  1113. printparamsJsonArray.push({
  1114. PTK_DrawText_TrueType:
  1115. "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
  1116. });
  1117. const printContent_l1_2 = `区域:${
  1118. content.house ? content.house + "-" : ""
  1119. }${content.layer ? content.layer : ""}${
  1120. content.position ? content.position : ""
  1121. }`;
  1122. printparamsJsonArray.push({
  1123. PTK_DrawText_TrueType:
  1124. "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
  1125. });
  1126. const printContent_l2 = `房号:${content.number_detail}`;
  1127. printparamsJsonArray.push({
  1128. PTK_DrawText_TrueType:
  1129. "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
  1130. });
  1131. const printContent_l2_2 = `产品:${content.product_title}`;
  1132. printparamsJsonArray.push({
  1133. PTK_DrawText_TrueType:
  1134. "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
  1135. });
  1136. const printContent_l3 = `图号:${content.url_number}`;
  1137. printparamsJsonArray.push({
  1138. PTK_DrawText_TrueType:
  1139. "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
  1140. });
  1141. const printContent_l3_2 = `部件:${content.part_title}`;
  1142. printparamsJsonArray.push({
  1143. PTK_DrawText_TrueType:
  1144. "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
  1145. });
  1146. const printContent_l4 = `木皮:${content.color_title}`;
  1147. printparamsJsonArray.push({
  1148. PTK_DrawText_TrueType:
  1149. "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
  1150. });
  1151. const printContent_l4_2 = `尺寸:${content.measure}`;
  1152. printparamsJsonArray.push({
  1153. PTK_DrawText_TrueType:
  1154. "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
  1155. });
  1156. //下
  1157. printparamsJsonArray.push({
  1158. PTK_DrawText_TrueType:
  1159. "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
  1160. });
  1161. printparamsJsonArray.push({
  1162. PTK_DrawText_TrueType:
  1163. "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
  1164. });
  1165. printparamsJsonArray.push({
  1166. PTK_DrawText_TrueType:
  1167. "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
  1168. });
  1169. printparamsJsonArray.push({
  1170. PTK_DrawText_TrueType:
  1171. "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
  1172. });
  1173. printparamsJsonArray.push({
  1174. PTK_DrawText_TrueType:
  1175. "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
  1176. });
  1177. printparamsJsonArray.push({
  1178. PTK_DrawText_TrueType:
  1179. "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
  1180. });
  1181. printparamsJsonArray.push({
  1182. PTK_DrawText_TrueType:
  1183. "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
  1184. });
  1185. printparamsJsonArray.push({
  1186. PTK_DrawText_TrueType:
  1187. "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
  1188. });
  1189. // 17,35 420
  1190. printparamsJsonArray.push({
  1191. PTK_RWRFIDLabel:
  1192. "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
  1193. });
  1194. printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
  1195. });
  1196. }
  1197. printparamsJsonArray.push({ PTK_CloseUSBPort: "" });
  1198. data.printparams = printparamsJsonArray;
  1199. let sub_data = JSON.parse(JSON.stringify(data));
  1200. sub_data.printparams = JSON.stringify(sub_data.printparams);
  1201. let _this = this;
  1202. $.ajax({
  1203. type: "post",
  1204. url,
  1205. data: sub_data,
  1206. dataType: "json",
  1207. timeout: 5000,
  1208. success: function(result) {
  1209. _this.getChipDetail();
  1210. if (result.retval == "0") {
  1211. _this.$Message.success("发送成功");
  1212. } else {
  1213. _this.$Message.error("发送失败,返回结果:" + result.msg);
  1214. }
  1215. },
  1216. error: function() {
  1217. _this.getChipDetail();
  1218. },
  1219. });
  1220. });
  1221. },
  1222. handleOk() {
  1223. if (!this.selectedObj.isChoosed) {
  1224. return this.$Message.warning("请选择数据");
  1225. }
  1226. if (this.selectedObj.type == 1 && this.selectedObj.un_print == 0) {
  1227. return this.$Message.warning("部件存在未打印芯片,请先打印");
  1228. }
  1229. this.selectedObj.ok_num =
  1230. this.selectedObj.on_print - this.selectedObj.on_complete;
  1231. this.okModal = true;
  1232. },
  1233. handleRoomCancel() {
  1234. this.modalRoomList.map((v) => {
  1235. v.isCurrent = false;
  1236. });
  1237. this.modalRoomListSelected = [];
  1238. this.roomModal = false;
  1239. },
  1240. handleOkComfirm(row) {
  1241. if (this.modalRoomListSelected.length != this.selectedObj.print_num) {
  1242. return this.$Message.warning("与打印数量不符,请重新选择");
  1243. }
  1244. this.axios({
  1245. method: "post",
  1246. url: "/api/station_complete",
  1247. data: {
  1248. order_no: this.selectedInfo.order_no,
  1249. product_id: this.selectedInfo.product_id,
  1250. rows: this.selectedInfo.rows,
  1251. num: this.selectedObj.ok_num,
  1252. id: row.id,
  1253. },
  1254. }).then((res) => {
  1255. if (res.code == 200) {
  1256. this.okModal = false;
  1257. this.getChipDetail();
  1258. }
  1259. });
  1260. },
  1261. //行号确认
  1262. handleRowNoComfirm() {
  1263. let data =[];
  1264. this.chooseLineNo.map((v)=>{
  1265. if(v.start&&v.end){
  1266. data.push(v)
  1267. }
  1268. })
  1269. this.selectedInfo.rows = JSON.parse(JSON.stringify(data));
  1270. this.selectionRownolModal = false;
  1271. this.page_index = 1;
  1272. this.getChipDetail();
  1273. },
  1274. onInput(value) {
  1275. this.currentSearchValue = this.currentSearchValue + "" + value;
  1276. this.handleCurrentSearch(
  1277. this.currencySelectedObj,
  1278. this.currentSearchValue
  1279. );
  1280. },
  1281. onDelete() {
  1282. this.currentSearchValue = this.currentSearchValue.substring(
  1283. 0,
  1284. this.currentSearchValue.length - 1
  1285. );
  1286. this.handleCurrentSearch(
  1287. this.currencySelectedObj,
  1288. this.currentSearchValue
  1289. );
  1290. },
  1291. handlePrintInput() {
  1292. this.show3 = true;
  1293. },
  1294. keyboardPrintTap(value) {
  1295. let max = this.selectedObj.on_print + this.selectedObj.un_print;
  1296. this.selectedObj.print_num =
  1297. Number((this.selectedObj.print_num ? this.selectedObj.print_num : "") +
  1298. "" +
  1299. value);
  1300. if (this.selectedObj.print_num * 1 > max) {
  1301. this.selectedObj.print_num = max;
  1302. }
  1303. this.$forceUpdate();
  1304. },
  1305. keyboardPrintDele() {
  1306. this.selectedObj.print_num = Number((this.selectedObj.print_num + "").substring(
  1307. 0,
  1308. this.selectedObj.print_num.length - 1
  1309. ));
  1310. this.$forceUpdate();
  1311. },
  1312. keyboardTap(value) {
  1313. this.keyboardObj[this.keyboardVal] =
  1314. (this.keyboardObj[this.keyboardVal]
  1315. ? this.keyboardObj[this.keyboardVal]
  1316. : "") +
  1317. "" +
  1318. value;
  1319. },
  1320. keyboardDele() {
  1321. this.keyboardObj[this.keyboardVal] = this.keyboardObj[
  1322. this.keyboardVal
  1323. ].substring(0, this.keyboardObj[this.keyboardVal].length - 1);
  1324. },
  1325. handleRowNoInput(row, type) {
  1326. if (type == 1) {
  1327. this.keyboardVal = "start";
  1328. } else {
  1329. this.keyboardVal = "end";
  1330. }
  1331. this.keyboardObj = row;
  1332. this.show2 = true;
  1333. },
  1334. changePage(e) {
  1335. this.page_index = e;
  1336. this.getChipDetail();
  1337. },
  1338. changeModalPage(e) {
  1339. this.currencySelectedObj.type == 1
  1340. ? (this.modal_1_page_index = e)
  1341. : (this.modal_2_page_index = e);
  1342. this.handleCurrentSearch(
  1343. this.currencySelectedObj,
  1344. this.currentSearchValue
  1345. );
  1346. },
  1347. handlePrintChipsIp(contents, type) {
  1348. this.axios.get("/api/get_print_url").then((res) => {
  1349. let data = {};
  1350. // let url = "http://192.168.0.145:888/postek/print"; //request_url
  1351. let url = `http://${res.data.request_url}:888/postek/print`; //request_url
  1352. data.reqParam = "1"; //这个一般不用改,如需改,查api
  1353. let printparamsJsonArray = [];
  1354. // let IP = "192.168.1.58";//print_url
  1355. // let IP = "192.168.0.199"; //print_url
  1356. let IP = res.data.print_url;
  1357. let port = 9100;
  1358. let IP_Port = IP + "," + port;
  1359. printparamsJsonArray.push({ PTK_Connect_Timer: IP_Port + ",1" });
  1360. printparamsJsonArray.push({ PTK_ClearBuffer: "" });
  1361. printparamsJsonArray.push({ PTK_SetDirection: "B" });
  1362. printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
  1363. printparamsJsonArray.push({ PTK_SetDarkness: "10" });
  1364. printparamsJsonArray.push({
  1365. PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
  1366. });
  1367. printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
  1368. console.log(`contents`, contents);
  1369. if (type == 1) {
  1370. contents.map((content) => {
  1371. //江山打印格式
  1372. //上
  1373. const printContent_l1 = `单号:${content.order_no}`;
  1374. printparamsJsonArray.push({
  1375. PTK_DrawText_TrueType:
  1376. "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
  1377. });
  1378. const printContent_l1_2 = `型号:${content.product_title}`;
  1379. printparamsJsonArray.push({
  1380. PTK_DrawText_TrueType:
  1381. "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
  1382. });
  1383. const printContent_l2 = `尺寸:${content.measure}`;
  1384. printparamsJsonArray.push({
  1385. PTK_DrawText_TrueType:
  1386. "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
  1387. });
  1388. const printContent_l2_2 = `工艺:${content.process_title}`;
  1389. printparamsJsonArray.push({
  1390. PTK_DrawText_TrueType:
  1391. "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
  1392. });
  1393. const printContent_l3 = `颜色:${content.color_title}`;
  1394. printparamsJsonArray.push({
  1395. PTK_DrawText_TrueType:
  1396. "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
  1397. });
  1398. const printContent_l3_2 = `部件:${content.part_title}`;
  1399. printparamsJsonArray.push({
  1400. PTK_DrawText_TrueType:
  1401. "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
  1402. });
  1403. //下
  1404. printparamsJsonArray.push({
  1405. PTK_DrawText_TrueType:
  1406. "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
  1407. });
  1408. printparamsJsonArray.push({
  1409. PTK_DrawText_TrueType:
  1410. "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
  1411. });
  1412. printparamsJsonArray.push({
  1413. PTK_DrawText_TrueType:
  1414. "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
  1415. });
  1416. printparamsJsonArray.push({
  1417. PTK_DrawText_TrueType:
  1418. "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
  1419. });
  1420. printparamsJsonArray.push({
  1421. PTK_DrawText_TrueType:
  1422. "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
  1423. });
  1424. printparamsJsonArray.push({
  1425. PTK_DrawText_TrueType:
  1426. "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
  1427. });
  1428. printparamsJsonArray.push({
  1429. PTK_RWRFIDLabel:
  1430. "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
  1431. });
  1432. printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
  1433. });
  1434. } else {
  1435. contents.map((content) => {
  1436. //贝斯特打印格式
  1437. //上
  1438. const printContent_l1 = `项目:${content.client_name}`;
  1439. printparamsJsonArray.push({
  1440. PTK_DrawText_TrueType:
  1441. "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
  1442. });
  1443. const printContent_l1_2 = `区域:${
  1444. content.house ? content.house + "-" : ""
  1445. }${content.layer ? content.layer : ""}${
  1446. content.position ? content.position : ""
  1447. }`;
  1448. printparamsJsonArray.push({
  1449. PTK_DrawText_TrueType:
  1450. "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
  1451. });
  1452. const printContent_l2 = `房号:${content.number_detail}`;
  1453. printparamsJsonArray.push({
  1454. PTK_DrawText_TrueType:
  1455. "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
  1456. });
  1457. const printContent_l2_2 = `产品:${content.product_title}`;
  1458. printparamsJsonArray.push({
  1459. PTK_DrawText_TrueType:
  1460. "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
  1461. });
  1462. const printContent_l3 = `图号:${content.url_number}`;
  1463. printparamsJsonArray.push({
  1464. PTK_DrawText_TrueType:
  1465. "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
  1466. });
  1467. const printContent_l3_2 = `部件:${content.part_title}`;
  1468. printparamsJsonArray.push({
  1469. PTK_DrawText_TrueType:
  1470. "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
  1471. });
  1472. const printContent_l4 = `木皮:${content.color_title}`;
  1473. printparamsJsonArray.push({
  1474. PTK_DrawText_TrueType:
  1475. "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
  1476. });
  1477. const printContent_l4_2 = `尺寸:${content.measure}`;
  1478. printparamsJsonArray.push({
  1479. PTK_DrawText_TrueType:
  1480. "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
  1481. });
  1482. //下
  1483. printparamsJsonArray.push({
  1484. PTK_DrawText_TrueType:
  1485. "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
  1486. });
  1487. printparamsJsonArray.push({
  1488. PTK_DrawText_TrueType:
  1489. "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
  1490. });
  1491. printparamsJsonArray.push({
  1492. PTK_DrawText_TrueType:
  1493. "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
  1494. });
  1495. printparamsJsonArray.push({
  1496. PTK_DrawText_TrueType:
  1497. "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
  1498. });
  1499. printparamsJsonArray.push({
  1500. PTK_DrawText_TrueType:
  1501. "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
  1502. });
  1503. printparamsJsonArray.push({
  1504. PTK_DrawText_TrueType:
  1505. "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
  1506. });
  1507. printparamsJsonArray.push({
  1508. PTK_DrawText_TrueType:
  1509. "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
  1510. });
  1511. printparamsJsonArray.push({
  1512. PTK_DrawText_TrueType:
  1513. "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
  1514. });
  1515. // 17,35 420
  1516. printparamsJsonArray.push({
  1517. PTK_RWRFIDLabel:
  1518. "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
  1519. });
  1520. printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
  1521. });
  1522. }
  1523. printparamsJsonArray.push({ PTK_CloseConnect: "" });
  1524. data.printparams = printparamsJsonArray;
  1525. let sub_data = JSON.parse(JSON.stringify(data));
  1526. sub_data.printparams = JSON.stringify(sub_data.printparams);
  1527. let _this = this;
  1528. $.ajax({
  1529. type: "post",
  1530. url,
  1531. data: sub_data,
  1532. dataType: "json",
  1533. timeout: 5000,
  1534. success: function(result) {
  1535. _this.getChipDetail();
  1536. if (result.retval == "0") {
  1537. _this.$Message.success("发送成功");
  1538. } else {
  1539. _this.$Message.error("发送失败,返回结果:" + result.msg);
  1540. }
  1541. },
  1542. error: function() {
  1543. _this.getChipDetail();
  1544. },
  1545. });
  1546. });
  1547. },
  1548. },
  1549. // 监听属性 类似于data概念
  1550. computed: {
  1551. page_size(){
  1552. if(this.isWideScreen){
  1553. return 12
  1554. }else{
  1555. return 6
  1556. }
  1557. }
  1558. },
  1559. // 监控data中的数据变化
  1560. watch: {},
  1561. beforeCreate() {}, // 生命周期 - 创建之前
  1562. beforeMount() {}, // 生命周期 - 挂载之前
  1563. beforeUpdate() {}, // 生命周期 - 更新之前
  1564. updated() {}, // 生命周期 - 更新之后
  1565. beforeDestroy() {}, // 生命周期 - 销毁之前
  1566. destroyed() {}, // 生命周期 - 销毁完成
  1567. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  1568. };
  1569. </script>
  1570. <style lang="scss" scoped>
  1571. .fullscreen-title-btn {
  1572. position: absolute;
  1573. right: 100px;
  1574. top: 0.175rem;
  1575. }
  1576. .fullscreen-content {
  1577. font-size: 26px;
  1578. font-family: "Microsoft YaHei", 微软雅黑;
  1579. font-weight: bold;
  1580. .fullscreen-content-select {
  1581. display: flex;
  1582. justify-content: space-around;
  1583. padding-bottom: 0.1rem;
  1584. border-bottom: 1px solid #e8eaec;
  1585. .fullscreen-content-select-block {
  1586. display: flex;
  1587. justify-content: flex-start;
  1588. align-items: center;
  1589. }
  1590. .fullscreen-content-select-block:nth-child(1) {
  1591. width: 30%;
  1592. }
  1593. .fullscreen-content-select-block:nth-child(2) {
  1594. width: 30%;
  1595. }
  1596. .fullscreen-content-select-block:nth-child(3) {
  1597. width:30%
  1598. }
  1599. }
  1600. .fullscreen-content-choose {
  1601. display: flex;
  1602. justify-content: flex-start;
  1603. flex-wrap: wrap;
  1604. padding-top: 0.1rem;
  1605. margin-bottom: 0.5rem;
  1606. .fullscreen-content-choose-block {
  1607. width: 33.33%;
  1608. border-radius: 5px;
  1609. border: 1px solid #2d8cf0;
  1610. // margin: 0.1rem 1%;
  1611. padding: 1%;
  1612. position: relative;
  1613. div {
  1614. display: flex;
  1615. justify-content: space-between;
  1616. // margin-top: 5px;
  1617. }
  1618. .chip-tag {
  1619. display: inline-block;
  1620. position: absolute;
  1621. width: 1rem;
  1622. top: 0;
  1623. left: 50%;
  1624. font-size: 18px;
  1625. background-color: #fadb14;
  1626. color: black;
  1627. height: 0.75rem;
  1628. border-radius: 15%;
  1629. text-align: center;
  1630. padding-top: 0.15rem;
  1631. transform: translate(-50%, -10%);
  1632. }
  1633. .chip-tag-choosed {
  1634. display: inline-block;
  1635. position: absolute;
  1636. width: 1rem;
  1637. top: 0;
  1638. left: 15%;
  1639. font-size: 18px;
  1640. background-color: #fadb14;
  1641. color: black;
  1642. height: 0.75rem;
  1643. border-radius: 15%;
  1644. text-align: center;
  1645. padding-top: 0.15rem;
  1646. transform: translate(-10%, -10%) !important;
  1647. }
  1648. }
  1649. .fullscreen-content-choose-block-wide {
  1650. width: 24.5%;
  1651. }
  1652. .fullscreen-content-choose-block-choosen {
  1653. color: white;
  1654. background-color: #2d8cf0;
  1655. }
  1656. .fullscreen-content-choose-block-unchoosen {
  1657. color: #2d8cf0;
  1658. background-color: white;
  1659. }
  1660. }
  1661. }
  1662. .fullscreen-content-page {
  1663. display: flex;
  1664. justify-content: center;
  1665. }
  1666. .selection-modal {
  1667. .selection-modal-top {
  1668. display: flex;
  1669. justify-content: center;
  1670. }
  1671. .selection-modal-body {
  1672. display: flex;
  1673. justify-content: center;
  1674. flex-wrap: wrap;
  1675. .selection-modal-body-block {
  1676. cursor: pointer;
  1677. width: 30%;
  1678. margin: 1%;
  1679. padding: 3% 1%;
  1680. background-color: #e9ecef;
  1681. div {
  1682. display: flex;
  1683. justify-content: center;
  1684. }
  1685. }
  1686. .selection-modal-body-block-detail {
  1687. cursor: pointer;
  1688. width: 17%;
  1689. margin: 1%;
  1690. padding: 3% 1%;
  1691. background-color: #e9ecef;
  1692. div {
  1693. display: flex;
  1694. justify-content: center;
  1695. }
  1696. }
  1697. .selection-modal-body-block-choosen,
  1698. .selection-modal-body-block-detail-choosen {
  1699. background-color: #fadb14;
  1700. }
  1701. .selection-modal-body-block-unchoosen,
  1702. .selection-modal-body-block-detail-unchoosen {
  1703. background-color: #e9ecef;
  1704. }
  1705. }
  1706. }
  1707. .selection-rowno-modal {
  1708. .selection-rowno-modal-body {
  1709. max-height: 7rem;
  1710. overflow: auto;
  1711. .selection-rowno-modal-body-block {
  1712. margin: 0.5rem 0;
  1713. text-align: center;
  1714. }
  1715. }
  1716. }
  1717. .selection-print-modal {
  1718. .selection-print-modal-body {
  1719. .selection-print-modal-body-top {
  1720. display: flex;
  1721. justify-content: space-around;
  1722. align-items: center;
  1723. margin: 0.5rem 0;
  1724. }
  1725. .selection-print-modal-body-info {
  1726. padding-top: 16px;
  1727. border-top: 1px solid #e8eaec;
  1728. text-align: center;
  1729. button{
  1730. height: 2em;
  1731. font-size: 1em;
  1732. }
  1733. }
  1734. .selection-print-modal-body-footer{
  1735. height: 1rem;
  1736. display: flex;
  1737. justify-content: space-around;
  1738. button{
  1739. height: 1.5em;
  1740. font-size: 3em;
  1741. }
  1742. }
  1743. }}
  1744. .icon-wrapper {
  1745. position: relative;
  1746. font-size: 0.25rem;
  1747. }
  1748. .icon-close {
  1749. position: absolute;
  1750. right: -0.35rem;
  1751. top: -0.2rem;
  1752. }
  1753. /deep/.ivu-page-item {
  1754. display: inline-block;
  1755. font-size: 0.5rem;
  1756. height: 1rem;
  1757. line-height: 1rem;
  1758. width: 1rem;
  1759. }
  1760. /deep/.ivu-modal-close {
  1761. border: 1px solid black;
  1762. }
  1763. /deep/.ivu-page-prev,
  1764. /deep/.ivu-page-next {
  1765. display: inline-block;
  1766. font-size: 0.5rem;
  1767. height: 1rem;
  1768. line-height: 1rem;
  1769. width: 1rem;
  1770. a {
  1771. font-size: 0.5rem;
  1772. }
  1773. }
  1774. /deep/.fullscreen-content-page {
  1775. display: flex;
  1776. justify-content: space-around;
  1777. }
  1778. .wide-screen-rowno {
  1779. display: flex;
  1780. justify-content: center !important;
  1781. span {
  1782. display: inline-block;
  1783. text-align: center;
  1784. width: 3rem;
  1785. height: 3rem;
  1786. line-height: 3rem;
  1787. border-radius: 50%;
  1788. font-size: 1.5rem;
  1789. }
  1790. .wide-screen-rowno-span-choosed {
  1791. color: #2d8cf0;
  1792. background-color: white;
  1793. }
  1794. .wide-screen-rowno-span {
  1795. color: white;
  1796. background-color: #2d8cf0;
  1797. }
  1798. }
  1799. .printRow{
  1800. display: none;
  1801. }
  1802. @media print {
  1803. .printRow{
  1804. display: block;
  1805. width: 100%;
  1806. margin-top: 10mm;
  1807. .printRow_content{
  1808. page-break-after: always;
  1809. }
  1810. }
  1811. @page{
  1812. margin:10mm 1mm
  1813. }
  1814. }
  1815. </style>