detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <template>
  2. <div>
  3. <div style="background-image: url('../../../assets/images/bc.png');background-size: 100% 100%;">
  4. <div class="home_header">扫描</div>
  5. <div class="home_header_line"></div>
  6. <div class="home_con_body">
  7. <div class="home_con_s">
  8. <div v-if="is_show" class="pack_up">
  9. <img @click="handleShow" src="../../../assets/home/collect.png" alt="">
  10. </div>
  11. <div v-if="!is_show" :class="!is_show ? 'pack_up_d' : ''" class="pack_up" style="display: flex;gap: .3125rem;">
  12. <div style="font-size: 0.88rem;
  13. color: #ABDFFF;">展开</div>
  14. <img @click="handleShow" style="width: 0.41rem;height: 0.69rem;" src="../../../assets/home/zk.png" alt="">
  15. </div>
  16. <div v-if="is_show" class="pack_up_con">
  17. <p class="pack_up_name">王晓伟</p>
  18. <div class="pack_up_grid">
  19. <div>
  20. <p>人员工时</p>
  21. <div><span>1245</span><span>小时</span></div>
  22. </div>
  23. <div>
  24. <p>人员工数</p>
  25. <div><span>1245</span><span>件</span></div>
  26. </div>
  27. <div>
  28. <p>工作效率</p>
  29. <div><span>1245</span><span>件/小时</span></div>
  30. </div>
  31. <div>
  32. <p>包装件数</p>
  33. <div><span>1245</span><span>件</span></div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="send_work" v-if="tableData.length > 0" v-for="(item, index) in tableData" :key="index">
  39. <div class="check_box">
  40. <div @click="handleChoose(item, index)" :class="item.is_choose ? 'check_box_c_active' : 'check_box_c'">
  41. </div>
  42. </div>
  43. <div class="secd_flex">
  44. <div class="secd_title">
  45. <span>派工单号:</span><span> {{ item.dispatch_no }}</span>
  46. </div>
  47. <span class="secd_title_d">{{ item.product_title }}</span>
  48. <div class="secd_g"><span>规格型号:</span><span>{{ item.size }}</span></div>
  49. <div class="secd_flex_w">
  50. <div class="secd_flex_s">
  51. <span>已完工数:</span>
  52. <span>{{ item.finished_num }}件</span>
  53. </div>
  54. <div class="secd_flex_s">
  55. <span>未完工数:</span>
  56. <span>{{ item.not_finished_num }}件</span>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div v-if="tableData.length == 0"
  62. style="display: flex;width: 100%;height: 10rem;justify-content: center;align-items: center;">
  63. <Spin size="small" />
  64. <Spin />
  65. <Spin size="small" />
  66. </div>
  67. <div class="footer">
  68. <div class="return_btn" @click="handleReturn">返回</div>
  69. <div class="confirm_btn" @click="handelGoSure">确认</div>
  70. </div>
  71. </div>
  72. </div>
  73. <!-- -------------------------- -->
  74. <!-- <div class="bdy">
  75. <table>
  76. <tr style="height: 2rem">
  77. <th style="width: 3rem">派工单号</th>
  78. <th style="width: 4rem">产品名称</th>
  79. <th style="width: 3rem">规格型号</th>
  80. <th style="width: 3rem">已完工数量</th>
  81. <th style="width: 3rem">未完工数量</th>
  82. </tr>
  83. <tr v-for="(item, index) in tableData" :key="index" @click="handleChoose(item, index)"
  84. :class="item.is_choose ? 'choose_item' : ''">
  85. <td>
  86. {{ item.dispatch_no }}
  87. </td>
  88. <td>{{ item.product_title }}</td>
  89. <td>{{ item.size }}</td>
  90. <td>{{ item.finished_num }}</td>
  91. <td>{{ item.not_finished_num }}</td>
  92. </tr>
  93. </table>
  94. </div> -->
  95. </div>
  96. </template>
  97. <script>
  98. export default {
  99. data() {
  100. return {
  101. tableData: [],
  102. is_show: true,
  103. is_use: false,
  104. spinShow: false
  105. }
  106. },
  107. created () {
  108. },
  109. mounted () {
  110. let text = []
  111. if (localStorage.getItem('fyy_target')) {
  112. let target = JSON.parse(localStorage.getItem('fyy_target'))
  113. localStorage.removeItem('fyy_target')
  114. target.forEach(v => {
  115. v = v.replace(/\"/g, '')
  116. text.push(this.func.hexToString(v))
  117. })
  118. }
  119. this.tableData = []
  120. // const fyyTarget = ('PG2023081000025,PG2023081000024').split(',')
  121. text.forEach(v => {
  122. const data = {
  123. url: 'http://121.36.142.167:7774/jbl/api/module-data/dispatch_orders/page',
  124. post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [{ "field": "dispatch_orders.dispatch_no", "option": "LIKE_ANYWHERE", "values": [v] }, { "field": "product_no", "option": "LIKE_ANYWHERE", "values": ["BC030101000001"] }], "size": 15, "specialConditions": [], "workflowSearchBean": {}, "dynamicFormCode": "dispatch_orders", "dynamicFormTable": null, "ignoreField": true, "developmentSystemId": null, "debugFlag": true }
  125. }
  126. this.initData(data)
  127. })
  128. },
  129. methods: {
  130. initData(row) {
  131. this.axios.post('/api/testdwy', { ...row }).then(res => {
  132. res.data.content.forEach(v => {
  133. v.is_choose = false
  134. v.dispatch_no = v.dispatch_orders.dispatch_no
  135. v.not_finished_num = v.dispatch_num - v.finished_num
  136. })
  137. this.tableData.push(...res.data.content)
  138. })
  139. },
  140. handelGoSure() {
  141. if (this.tableData.filter(v => v.is_choose).length === 0) {
  142. return this.$Message.warning('请先选择数据!')
  143. }
  144. localStorage.removeItem('fyy_target')
  145. const dataId = Math.floor(Math.random() * 100)
  146. const text = JSON.stringify(this.tableData.filter(v => v.is_choose))
  147. localStorage.setItem(dataId + '', text)
  148. this.$router.push({ path: '/cms/finish/detailed', query: { id: dataId } })
  149. },
  150. handleReturn() {
  151. localStorage.removeItem('fyy_target')
  152. this.$router.push('/cms/home')
  153. },
  154. handleChoose(item, index) {
  155. item.is_choose = !item.is_choose
  156. // this.tableData.splice(index, 1, item)
  157. },
  158. handleShow() {
  159. this.is_show = !this.is_show
  160. console.log(document.getElementsByClassName('header'))
  161. if (this.is_show) {
  162. document.getElementsByClassName('header')[0].style = 'height:7rem;overflow:hidden;transition:all .4s;'
  163. setTimeout(() => {
  164. document.getElementsByClassName('header')[0].style = 'overflow:none;'
  165. this.is_use = false
  166. }, 400)
  167. } else {
  168. this.is_use = true
  169. document.getElementsByClassName('header')[0].style = 'height:2.7rem;overflow:hidden;transition:all .4s;'
  170. }
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .return_btn {
  177. background-image: url('../../../assets/home/return.png');
  178. background-size: 100% 100%;
  179. }
  180. .confirm_btn {
  181. background-image: url('../../../assets/home/confirm.png');
  182. background-size: 100% 100%;
  183. }
  184. .return_btn,
  185. .confirm_btn {
  186. width: 10.97rem;
  187. height: 3.93rem;
  188. display: flex;
  189. align-items: center;
  190. justify-content: center;
  191. color: #fff;
  192. font-size: 1.06rem;
  193. font-weight: 500;
  194. letter-spacing: 1px;
  195. }
  196. .secd_flex_s>span:nth-child(1) {
  197. font-size: 0.94rem;
  198. color: #ABDFFF;
  199. }
  200. .secd_flex_s>span:nth-child(2) {
  201. font-size: 0.94rem;
  202. color: #03FCD3;
  203. }
  204. .secd_g {
  205. font-size: 1rem;
  206. color: #ABDFFF
  207. }
  208. .secd_title_d {
  209. font-size: 1.13rem;
  210. color: #FFFFFF;
  211. text-shadow: 0px 0px 0px rgba(255, 255, 255, 0.5);
  212. white-space: nowrap;
  213. overflow: hidden;
  214. text-overflow: ellipsis;
  215. }
  216. .secd_flex_w {
  217. display: flex;
  218. justify-content: space-between;
  219. padding-right: 1.6rem;
  220. box-sizing: border-box;
  221. }
  222. .secd_flex {
  223. display: flex;
  224. flex-direction: column;
  225. gap: .375rem;
  226. .secd_title {
  227. font-size: 0.88rem;
  228. color: #ABDFFF;
  229. opacity: 0.5;
  230. }
  231. }
  232. .check_box_c {
  233. width: 1.19rem;
  234. height: 100%;
  235. background-image: url('../../../assets/home/check.png');
  236. background-size: 100% 100%;
  237. }
  238. .check_box_c_active {
  239. width: 1.3rem;
  240. height: 100%;
  241. background-image: url('../../../assets/home/checked.png');
  242. background-size: 100% 100%;
  243. }
  244. .send_work {
  245. height: 9.69rem;
  246. background-image: url('../../../assets/home/packUpback.png');
  247. background-size: 100% 100%;
  248. margin-top: 1.38rem;
  249. padding: 0.44rem 0.4rem 1.34rem 1.22rem;
  250. box-sizing: border-box;
  251. .check_box {
  252. height: 1.19rem;
  253. display: flex;
  254. justify-content: right;
  255. }
  256. }
  257. .com_top {
  258. margin-top: 1.72rem !important;
  259. }
  260. .completion_con {
  261. height: 5.19rem;
  262. background-image: url('../../../assets/home/completion.png');
  263. background-size: 100% 100%;
  264. margin-top: 0.72rem;
  265. padding: 1rem 1.28rem;
  266. box-sizing: border-box;
  267. display: flex;
  268. align-items: center;
  269. justify-content: space-between;
  270. }
  271. .home_con_s {
  272. position: relative;
  273. .pack_up {
  274. position: absolute;
  275. top: 0;
  276. left: 50%;
  277. transform: translateX(-50%);
  278. width: 5.56rem;
  279. background-image: url('../../../assets/home/packUp.png');
  280. background-size: 100% 100%;
  281. height: 1.97rem;
  282. display: flex;
  283. align-items: center;
  284. justify-content: center;
  285. img {
  286. width: 2.59rem;
  287. height: 0.88rem;
  288. }
  289. }
  290. .pack_up_d {
  291. top: -1.1rem;
  292. }
  293. .pack_up_con {
  294. height: 14.09rem;
  295. background-image: url('../../../assets/home/packUpback.png');
  296. background-size: 100% 100%;
  297. padding: 1.78rem 2.03rem;
  298. box-sizing: border-box;
  299. .pack_up_name {
  300. height: 1.25rem;
  301. font-size: 1.25rem;
  302. color: #fff;
  303. font-weight: 600;
  304. }
  305. .pack_up_grid {
  306. display: grid;
  307. grid-template-columns: repeat(2, 1fr);
  308. row-gap: .625rem;
  309. &>div {
  310. display: flex;
  311. flex-direction: column;
  312. row-gap: .625rem;
  313. &>div {
  314. display: flex;
  315. gap: .125rem;
  316. span:nth-child(1) {
  317. font-size: 1.63rem;
  318. font-family: DIN-BoldItalic, DIN;
  319. font-weight: 600;
  320. color: #04FFD5;
  321. line-height: 1.31rem;
  322. transform: skewX(-10deg);
  323. text-shadow: 0px 0px 0px rgba(4, 255, 213, 0.23);
  324. }
  325. span:nth-child(2) {
  326. font-size: 1rem;
  327. font-family: PingFangSC-Regular, PingFang SC;
  328. font-weight: 400;
  329. color: #ABDFFF;
  330. }
  331. }
  332. &>p:nth-child(1) {
  333. font-size: 1rem;
  334. font-family: PingFangSC-Regular, PingFang SC;
  335. font-weight: 400;
  336. color: #ABDFFF;
  337. margin-bottom: 0px;
  338. }
  339. }
  340. }
  341. }
  342. }
  343. .home_con_body {
  344. width: 100%;
  345. padding: 1rem;
  346. box-sizing: border-box;
  347. }
  348. .home_header {
  349. height: 3.125rem;
  350. display: flex;
  351. align-items: center;
  352. justify-content: center;
  353. color: #fff;
  354. font-size: 1.125rem;
  355. font-weight: 600;
  356. }
  357. .home_header_line {
  358. width: 100%;
  359. height: .0625rem;
  360. background-color: #fff;
  361. opacity: 0.2;
  362. }
  363. .header {
  364. width: 94%;
  365. height: 7rem;
  366. // overflow: hidden;
  367. // transition: all 0.4s;
  368. position: relative;
  369. top: 0.5rem;
  370. left: 3%;
  371. box-shadow: 0.16rem 0.1rem 0.1rem 0.1rem #9d9b9b;
  372. border-radius: 1rem;
  373. padding: 0.4rem 0.7rem 0 1rem;
  374. background: #fff;
  375. }
  376. .header_btn {
  377. border-radius: 1rem;
  378. padding: 0.1rem;
  379. width: 5rem;
  380. display: flex;
  381. justify-content: space-around;
  382. align-items: center;
  383. }
  384. .header_top {
  385. display: flex;
  386. justify-content: space-between;
  387. align-items: center;
  388. }
  389. .ot {
  390. position: relative;
  391. top: -1.3rem;
  392. }
  393. .header_middle1 {
  394. display: flex;
  395. justify-content: space-between;
  396. align-items: center;
  397. .ft {
  398. font-size: 1.5rem;
  399. width: 5rem;
  400. text-align: center;
  401. }
  402. }
  403. .header_middle {
  404. position: relative;
  405. top: -0.3rem;
  406. display: flex;
  407. justify-content: space-between;
  408. align-items: center;
  409. }
  410. /deep/ .btn-group>.btn,
  411. .btn-group-vertical>.btn {
  412. background: #ffffff;
  413. color: #2c3e50;
  414. outline: none;
  415. border: none;
  416. margin: 0;
  417. z-index: 3;
  418. }
  419. .header_footer {
  420. position: absolute;
  421. top: -1.7rem;
  422. display: flex;
  423. justify-content: space-between;
  424. align-items: center;
  425. div {
  426. font-size: 0.5rem;
  427. color: rgb(244, 136, 42);
  428. }
  429. }
  430. .bdy {
  431. width: 94%;
  432. height: calc(100% - 18.7rem);
  433. overflow: auto;
  434. position: relative;
  435. top: 1rem;
  436. left: 3%;
  437. }
  438. /deep/td {
  439. text-align: center;
  440. vertical-align: middle;
  441. }
  442. table {
  443. border-collapse: collapse;
  444. /* 合并边框 */
  445. width: 100%;
  446. /* 表格宽度 */
  447. background: #fff;
  448. table-layout: fixed;
  449. }
  450. th {
  451. font-size: 0.6rem;
  452. background: #66b1f4;
  453. color: #fff;
  454. }
  455. td {
  456. font-size: 0.6rem;
  457. word-break: break-all;
  458. }
  459. td,
  460. th {
  461. vertical-align: middle;
  462. text-align: center;
  463. border: 0.1rem solid #dddddd;
  464. /* 单元格边框样式 */
  465. padding: 0.02rem;
  466. /* 单元格内边距 */
  467. }
  468. .choose_item {
  469. background: #c8c8c8;
  470. }
  471. .footer {
  472. display: flex;
  473. justify-content: space-around;
  474. position: absolute;
  475. width: 100%;
  476. padding: 0 .55rem;
  477. box-sizing: border-box;
  478. left: 0;
  479. bottom: 4.8rem;
  480. }
  481. </style>