detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. <template>
  2. <div style="overflow: auto;padding-bottom: 6.6rem;box-sizing: border-box;">
  3. <div >
  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;" @click="handleShow">
  12. <div style="font-size: 0.88rem;
  13. color: #ABDFFF;">展开</div>
  14. <img 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>{{ total_num }}</span><span>件</span></div>
  22. </div>
  23. <div>
  24. <p>已扫总数</p>
  25. <div><span>{{ scan_num }}</span><span>件</span></div>
  26. </div>
  27. <div>
  28. <p>未扫总数</p>
  29. <div><span>{{ total_num - scan_num }}</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" style="margin-top: .8rem">
  44. <div class="secd_title">
  45. <span>销售单号:</span><span> {{ item.bus_no }}</span>
  46. </div>
  47. <span class="secd_title_d">{{ item.product_title }}</span>
  48. <div class="secd_g"><span>规格型号:</span><span>{{ item.product_size }}</span></div>
  49. <div class="secd_flex_w">
  50. <div class="secd_flex_s">
  51. <span>已扫到数量:</span>
  52. <span>{{ item.out_qty }}件</span>
  53. </div>
  54. <div class="secd_flex_s">
  55. <span>未发货数量:</span>
  56. <span>{{ item.this_delivery_qty - item.out_qty }}件</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. </div>
  74. <!-- <div>
  75. <div class="header">
  76. <div class="header_top">
  77. <Button type="primary" class="header_btn" ghost @click="handleShow"
  78. :icon="is_show ? 'ios-arrow-dropup' : 'ios-arrow-dropdown'">
  79. <div style="margin-right: 0.6rem">
  80. {{ is_show ? "收起" : "展开" }}
  81. </div>
  82. </Button>
  83. <div style="margin-right: 1rem; color: #66a9f0">王小伟</div>
  84. </div>
  85. <div class="header_middle">
  86. <b-dropdown size="sm" text="产品总数" class="m-2" :disabled="is_use">
  87. <b-dropdown-item-button>Action</b-dropdown-item-button>
  88. <b-dropdown-item-button>Another action</b-dropdown-item-button>
  89. <b-dropdown-item-button>Something else here</b-dropdown-item-button>
  90. </b-dropdown>
  91. <b-dropdown size="sm" text="已扫总数" class="m-2" :disabled="is_use">
  92. <b-dropdown-item-button>Action</b-dropdown-item-button>
  93. <b-dropdown-item-button>Another action</b-dropdown-item-button>
  94. <b-dropdown-item-button>Something else here</b-dropdown-item-button>
  95. </b-dropdown>
  96. <b-dropdown size="sm" text="未扫总数" class="m-2" :disabled="is_use">
  97. <b-dropdown-item-button>Action</b-dropdown-item-button>
  98. <b-dropdown-item-button>Another action</b-dropdown-item-button>
  99. <b-dropdown-item-button>Something else here</b-dropdown-item-button>
  100. </b-dropdown>
  101. </div>
  102. <div class="header_middle1 ot">
  103. <div class="ft">{{ total_num }} &nbsp;</div>
  104. <div class="ft">{{ scan_num }} &nbsp;</div>
  105. <div class="ft">{{ total_num - scan_num }} &nbsp;</div>
  106. </div>
  107. <div class="header_footer">
  108. <div style="margin-left: 1rem">已发货{{ transport_total }}</div>
  109. </div>
  110. </div>
  111. <div class="bdy">
  112. <table>
  113. <tr style="height: 2rem">
  114. <th style="width: 3rem">销售单号</th>
  115. <th style="width: 4rem">产品名称</th>
  116. <th style="width: 3rem">规格型号</th>
  117. <th style="width: 3rem">已扫到数量</th>
  118. <th style="width: 3rem">未发货数量</th>
  119. </tr>
  120. <tr v-for="(item, index) in tableData" :key="index" @click="handleChoose(item, index)">
  121. <td>
  122. {{ item.bus_no }}
  123. </td>
  124. <td>{{ item.product_title }}</td>
  125. <td>{{ item.product_size }}</td>
  126. <td>{{ item.out_qty }}</td>
  127. <td>{{ item.this_delivery_qty - item.out_qty }}</td>
  128. </tr>
  129. </table>
  130. </div>
  131. <div class="footer">
  132. <Button type="primary" class="header_btn" style="margin-right: 3rem; height: 2.6rem" @click="handleReturn">
  133. 返回</Button>
  134. <Button type="primary" class="header_btn" style="margin-left: 3rem; height: 2.6rem" @click="handelGoSure">
  135. 确认</Button>
  136. </div>
  137. </div> -->
  138. </template>
  139. <script>
  140. export default {
  141. data() {
  142. return {
  143. tableData: [],
  144. key_tableData: {},
  145. send_goods_out: {},
  146. data: {},
  147. send_goods_out_product: {},
  148. is_show: true,
  149. is_use: false,
  150. total_num: 0,
  151. scan_num: 0,
  152. saveData: 0,
  153. transport_total: 0,
  154. scan_data: [],
  155. is_box_data: []
  156. }
  157. },
  158. mounted() {
  159. // if (localStorage.getItem('fyy_target')) {
  160. // data.target = JSON.parse(localStorage.getItem('fyy_target'))
  161. // }
  162. this.handleShow()
  163. this.tableData = []
  164. const id = this.$route.query.id
  165. const data = {
  166. url: `http://121.36.142.167:7774/jbl/api/module-data/send_goods_out/send_goods_out/474061443708694528/${id}`
  167. // 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},
  168. }
  169. this.initData(data)
  170. },
  171. methods: {
  172. // 原始数据获取
  173. initData(row) {
  174. this.axios.post('/api/testdwyget', { ...row }).then(res => {
  175. this.tableData.push(...res.data.data.send_goods_out_product);
  176. res.data.data.send_goods_out_product.forEach((element, index) => {
  177. this.data = res.data
  178. this.total_num = this.total_num + element.this_delivery_qty
  179. this.transport_total = this.transport_total + element.out_qty
  180. this.key_tableData[this.deelUniqueProductKey(element)] = element;
  181. if (element.box_orders_show) {
  182. this.is_box_data.push(this.deelUniqueKey(element));
  183. }
  184. })
  185. // let ji = ['\"425A3030303235\"']
  186. // console.log(JSON.stringify(ji))
  187. let text = []
  188. if (localStorage.getItem('fyy_target')) {
  189. // console.log(JSON.parse(localStorage.getItem('fyy_target')))
  190. let target = JSON.parse(localStorage.getItem('fyy_target'))
  191. localStorage.removeItem('fyy_target')
  192. // this.$Message.warning(localStorage.getItem('fyy_target'))
  193. target.forEach(v => {
  194. v = v.replace(/\"/g, '')
  195. text.push(this.func.hexToString(v))
  196. })
  197. // // console.log(text)
  198. }
  199. const dataBox = {
  200. url: 'http://121.36.142.167:7774/jbl/api/module-data/box_orders/box_orders/diy/defective_order_no_list',
  201. post: { "defective_order_no_list":text}
  202. }
  203. // const dataBox = {
  204. // url: 'http://121.36.142.167:7774/jbl/api/module-data/box_orders/box_orders/diy/defective_order_no_list',
  205. // post: { "defective_order_no_list":['BZ00025']}
  206. // }
  207. this.initDataBox(dataBox)
  208. })
  209. },
  210. // 扫描数据获取
  211. initDataBox (row) {
  212. this.$Message.warning(row.post["defective_order_no_list"].toString())
  213. this.axios.post('/api/testdwy', { ...row }).then(res => {
  214. if (res.code == 200) {
  215. this.$Message.success('请求成功!')
  216. res.data.data.forEach((element, index) => {
  217. element.product_code = element.product_no
  218. let object = {
  219. "order_item_id": element.order_item_id,
  220. "order_no": element.order_no,
  221. "box_num": element.box_num,
  222. "product_code": element.product_code,
  223. "box_no": element.box_orders.defective_order_no,
  224. "color": element.color,
  225. "color_two": element.color_two,
  226. "process_title": element.process_title,
  227. "process_title_two": element.process_title_two,
  228. "box_id": element.box_orders.id
  229. }
  230. this.scan_data.push(object)
  231. })
  232. this.deelTableData()
  233. }
  234. })
  235. },
  236. deelUniqueKey(element) {
  237. let key = element.box_orders_show
  238. return key;
  239. },
  240. deelUniqueProductKey(element) {
  241. let key = element.product_code + (element.color?element.color:'') + (element.color_two?element.color_two:'') +(element.process_title?element.process_title:'') +(element.process_title_two?element.process_title_two:'')
  242. return key;
  243. },
  244. // 将原始数据处理拼接成提交的数据
  245. deelTableData() {
  246. let new_table_data = [];
  247. let is_scan_key = {};
  248. console.log(this.scan_data);
  249. this.scan_data.forEach((element, index) => {
  250. if (this.is_box_data.indexOf(element.box_no) === -1 && Object.keys(this.key_tableData).indexOf(this.deelUniqueProductKey(element)) !== -1 && (this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty - element.box_num) >= 0) {
  251. let table_data_detail = JSON.parse(JSON.stringify(this.key_tableData[this.deelUniqueProductKey(element)]))
  252. table_data_detail.box_orders = element.box_id;
  253. table_data_detail.box_orders_show = element.box_no;
  254. table_data_detail.out_qty += element.box_num;
  255. this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty -= element.box_num*1;
  256. is_scan_key[this.deelUniqueProductKey(element)]=1;
  257. // table_data_detail.this_delivery_qty = this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty;
  258. table_data_detail.id = null;
  259. new_table_data.push(table_data_detail)
  260. }
  261. })
  262. this.tableData.forEach((element, index) => {
  263. // if (element.this_delivery_qty > 0 && element.out_qty === 0) {
  264. // new_table_data.push(element)
  265. // }
  266. if(!is_scan_key[this.deelUniqueProductKey(element)]){
  267. new_table_data.push(element)
  268. }
  269. })
  270. this.tableData = new_table_data;
  271. },
  272. handelGoSure () {
  273. this.tableData.forEach((element, index) => {
  274. element.item_num = (index + 1)
  275. })
  276. this.data.data.send_goods_out_product = this.tableData
  277. let data = {
  278. url: 'http://121.36.142.167:7774/jbl/api/module-data/send_goods_out/send_goods_out',
  279. post: this.data
  280. }
  281. this.axios.post('/api/testdwy', data).then(res => {
  282. if (res.code === 200) {
  283. this.$Message.success(res.msg)
  284. this.$router.go(-1)
  285. }
  286. })
  287. // console.log(JSON.stringify(this.data))
  288. },
  289. handleReturn() {
  290. localStorage.removeItem('fyy_target')
  291. this.$router.push('/cms/finish')
  292. },
  293. handleChoose(item, index) {
  294. item.is_choose = !item.is_choose
  295. this.tableData.splice(index, 1, item)
  296. },
  297. handleShow() {
  298. this.is_show = !this.is_show
  299. // console.log(document.getElementsByClassName('header'))
  300. }
  301. }
  302. }
  303. </script>
  304. <style lang="scss" scoped>
  305. .return_btn {
  306. background-image: url('../../../assets/home/return.png');
  307. background-size: 100% 100%;
  308. }
  309. .confirm_btn {
  310. background-image: url('../../../assets/home/confirm.png');
  311. background-size: 100% 100%;
  312. }
  313. .return_btn,
  314. .confirm_btn {
  315. width: 10.97rem;
  316. height: 3.93rem;
  317. display: flex;
  318. align-items: center;
  319. justify-content: center;
  320. color: #fff;
  321. font-size: 1.06rem;
  322. font-weight: 500;
  323. letter-spacing: 1px;
  324. }
  325. .secd_flex_s>span:nth-child(1) {
  326. font-size: 0.94rem;
  327. color: #ABDFFF;
  328. }
  329. .secd_flex_s>span:nth-child(2) {
  330. font-size: 0.94rem;
  331. color: #03FCD3;
  332. }
  333. .secd_g {
  334. font-size: 1rem;
  335. color: #ABDFFF
  336. }
  337. .secd_title_d {
  338. font-size: 1.13rem;
  339. color: #FFFFFF;
  340. text-shadow: 0px 0px 0px rgba(255, 255, 255, 0.5);
  341. white-space: nowrap;
  342. overflow: hidden;
  343. text-overflow: ellipsis;
  344. }
  345. .secd_flex_w {
  346. display: flex;
  347. justify-content: space-between;
  348. padding-right: 1.6rem;
  349. box-sizing: border-box;
  350. }
  351. .secd_flex {
  352. display: flex;
  353. flex-direction: column;
  354. gap: .375rem;
  355. .secd_title {
  356. font-size: 0.88rem;
  357. color: #ABDFFF;
  358. opacity: 0.5;
  359. }
  360. }
  361. .check_box_c {
  362. width: 1.19rem;
  363. height: 100%;
  364. background-image: url('../../../assets/home/check.png');
  365. background-size: 100% 100%;
  366. }
  367. .check_box_c_active {
  368. width: 1.3rem;
  369. height: 100%;
  370. background-image: url('../../../assets/home/checked.png');
  371. background-size: 100% 100%;
  372. }
  373. .send_work {
  374. height: 10.69rem;
  375. background-image: url('../../../assets/home/packUpback.png');
  376. background-size: 100% 100%;
  377. margin-top: 1.38rem;
  378. padding: 0.44rem 0.4rem 1.34rem 1.22rem;
  379. box-sizing: border-box;
  380. .check_box {
  381. height: 1.19rem;
  382. display: flex;
  383. justify-content: right;
  384. }
  385. }
  386. .com_top {
  387. margin-top: 1.72rem !important;
  388. }
  389. .completion_con {
  390. height: 5.19rem;
  391. background-image: url('../../../assets/home/completion.png');
  392. background-size: 100% 100%;
  393. margin-top: 0.72rem;
  394. padding: 1rem 1.28rem;
  395. box-sizing: border-box;
  396. display: flex;
  397. align-items: center;
  398. justify-content: space-between;
  399. }
  400. .home_con_s {
  401. position: relative;
  402. .pack_up {
  403. position: absolute;
  404. top: 0;
  405. left: 50%;
  406. transform: translateX(-50%);
  407. width: 5.56rem;
  408. background-image: url('../../../assets/home/packUp.png');
  409. background-size: 100% 100%;
  410. height: 1.97rem;
  411. display: flex;
  412. align-items: center;
  413. justify-content: center;
  414. img {
  415. width: 2.59rem;
  416. height: 0.88rem;
  417. }
  418. }
  419. .pack_up_d {
  420. top: -1.1rem;
  421. }
  422. .pack_up_con {
  423. height: 14.09rem;
  424. background-image: url('../../../assets/home/packUpback.png');
  425. background-size: 100% 100%;
  426. padding: 1.78rem 2.03rem;
  427. box-sizing: border-box;
  428. .pack_up_name {
  429. height: 1.25rem;
  430. font-size: 1.25rem;
  431. color: #fff;
  432. font-weight: 600;
  433. }
  434. .pack_up_grid {
  435. display: grid;
  436. grid-template-columns: repeat(2, 1fr);
  437. row-gap: .625rem;
  438. &>div {
  439. display: flex;
  440. flex-direction: column;
  441. row-gap: .625rem;
  442. &>div {
  443. display: flex;
  444. gap: .125rem;
  445. span:nth-child(1) {
  446. font-size: 1.63rem;
  447. font-family: DIN-BoldItalic, DIN;
  448. font-weight: 600;
  449. color: #04FFD5;
  450. line-height: 1.31rem;
  451. transform: skewX(-10deg);
  452. text-shadow: 0px 0px 0px rgba(4, 255, 213, 0.23);
  453. }
  454. span:nth-child(2) {
  455. font-size: 1rem;
  456. font-family: PingFangSC-Regular, PingFang SC;
  457. font-weight: 400;
  458. color: #ABDFFF;
  459. }
  460. }
  461. &>p:nth-child(1) {
  462. font-size: 1rem;
  463. font-family: PingFangSC-Regular, PingFang SC;
  464. font-weight: 400;
  465. color: #ABDFFF;
  466. margin-bottom: 0px;
  467. }
  468. }
  469. }
  470. }
  471. }
  472. .home_con_body {
  473. width: 100%;
  474. padding: 1rem;
  475. box-sizing: border-box;
  476. }
  477. .home_header {
  478. height: 2.125rem;
  479. display: flex;
  480. align-items: center;
  481. justify-content: center;
  482. color: #fff;
  483. font-size: 1.125rem;
  484. font-weight: 600;
  485. }
  486. .home_header_line {
  487. width: 100%;
  488. height: .0625rem;
  489. background-color: #fff;
  490. opacity: 0.2;
  491. }
  492. .header {
  493. width: 94%;
  494. height: 7rem;
  495. // overflow: hidden;
  496. // transition: all 0.4s;
  497. position: relative;
  498. top: 0.5rem;
  499. left: 3%;
  500. box-shadow: 0.16rem 0.1rem 0.1rem 0.1rem #9d9b9b;
  501. border-radius: 1rem;
  502. padding: 0.4rem 0.7rem 0 1rem;
  503. background: #fff;
  504. }
  505. .header_btn {
  506. border-radius: 1rem;
  507. padding: 0.1rem;
  508. width: 5rem;
  509. display: flex;
  510. justify-content: space-around;
  511. align-items: center;
  512. }
  513. .header_top {
  514. display: flex;
  515. justify-content: space-between;
  516. align-items: center;
  517. }
  518. .ot {
  519. position: relative;
  520. top: -1.3rem;
  521. }
  522. .header_middle1 {
  523. display: flex;
  524. justify-content: space-between;
  525. align-items: center;
  526. .ft {
  527. font-size: 1.5rem;
  528. width: 5rem;
  529. text-align: center;
  530. }
  531. }
  532. .header_middle {
  533. position: relative;
  534. top: -0.3rem;
  535. display: flex;
  536. justify-content: space-between;
  537. align-items: center;
  538. }
  539. /deep/ .btn-group>.btn,
  540. .btn-group-vertical>.btn {
  541. background: #ffffff;
  542. color: #2c3e50;
  543. outline: none;
  544. border: none;
  545. margin: 0;
  546. z-index: 3;
  547. }
  548. //.header_footer {
  549. // position: relative;
  550. // top: -1.7rem;
  551. // display: flex;
  552. // justify-content: space-between;
  553. // align-items: center;
  554. //
  555. // div {
  556. // font-size: 0.5rem;
  557. // color: rgb(244, 136, 42);
  558. // }
  559. //}
  560. .bdy {
  561. width: 94%;
  562. height: calc(100% - 18.7rem);
  563. overflow: auto;
  564. position: relative;
  565. top: 1rem;
  566. left: 3%;
  567. }
  568. /deep/td {
  569. text-align: center;
  570. vertical-align: middle;
  571. }
  572. table {
  573. border-collapse: collapse;
  574. /* 合并边框 */
  575. width: 100%;
  576. /* 表格宽度 */
  577. background: #fff;
  578. table-layout: fixed;
  579. }
  580. th {
  581. font-size: 0.6rem;
  582. background: #66b1f4;
  583. color: #fff;
  584. }
  585. td {
  586. font-size: 0.6rem;
  587. word-break: break-all;
  588. }
  589. td,
  590. th {
  591. vertical-align: middle;
  592. text-align: center;
  593. border: 0.1rem solid #dddddd;
  594. /* 单元格边框样式 */
  595. padding: 0.02rem;
  596. /* 单元格内边距 */
  597. }
  598. .choose_item {
  599. background: #c8c8c8;
  600. }
  601. .footer {
  602. display: flex;
  603. width: 91%;
  604. position: absolute;
  605. bottom: 3rem;
  606. }
  607. </style>