detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. <template>
  2. <div style="overflow-y: scroll;padding-bottom: 9rem;box-sizing: border-box;">
  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>{{ 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. // console.log(data);
  170. this.initData(data)
  171. // console.log(data);
  172. },
  173. methods: {
  174. // 原始数据获取
  175. initData(row) {
  176. this.axios.post('/api/testdwyget', { ...row }).then(res => {
  177. this.tableData.push(...res.data.data.send_goods_out_product);
  178. res.data.data.send_goods_out_product.forEach((element, index) => {
  179. this.data = res.data
  180. this.total_num = this.total_num + element.this_delivery_qty
  181. this.transport_total = this.transport_total + element.out_qty
  182. this.key_tableData[this.deelUniqueProductKey(element)] = element;
  183. if (element.box_orders_show) {
  184. this.is_box_data.push(this.deelUniqueKey(element));
  185. }
  186. })
  187. // let ji = ['\"425A3030303235\"']
  188. // console.log(JSON.stringify(ji))
  189. let text = []
  190. if (localStorage.getItem('fyy_target')) {
  191. // console.log(JSON.parse(localStorage.getItem('fyy_target')))
  192. let target = JSON.parse(localStorage.getItem('fyy_target'))
  193. localStorage.removeItem('fyy_target')
  194. // this.$Message.warning(localStorage.getItem('fyy_target'))
  195. target.forEach(v => {
  196. v = v.replace(/\"/g, '')
  197. text.push(this.func.hexToString(v))
  198. })
  199. // // console.log(text)
  200. }
  201. const dataBox = {
  202. url: 'http://121.36.142.167:7774/jbl/api/module-data/box_orders/box_orders/diy/defective_order_no_list',
  203. post: { "defective_order_no_list":text}
  204. }
  205. // const dataBox = {
  206. // url: 'http://121.36.142.167:7774/jbl/api/module-data/box_orders/box_orders/diy/defective_order_no_list',
  207. // post: { "defective_order_no_list":['BZ00025']}
  208. // }
  209. this.initDataBox(dataBox)
  210. })
  211. },
  212. // 扫描数据获取
  213. initDataBox (row) {
  214. this.$Message.warning(row.post["defective_order_no_list"].toString())
  215. this.axios.post('/api/testdwy', { ...row }).then(res => {
  216. if (res.code == 200) {
  217. this.$Message.success('请求成功!')
  218. res.data.data.forEach((element, index) => {
  219. element.product_code = element.product_no
  220. let object = {
  221. "order_item_id": element.order_item_id,
  222. "order_no": element.order_no,
  223. "box_num": element.box_num,
  224. "product_code": element.product_code,
  225. "box_no": element.box_orders.defective_order_no,
  226. "box_id": element.box_orders.id
  227. }
  228. this.scan_data.push(object)
  229. })
  230. this.deelTableData()
  231. }
  232. })
  233. },
  234. deelUniqueKey(element) {
  235. let key = element.box_orders_show
  236. return key;
  237. },
  238. deelUniqueProductKey(element) {
  239. let key = element.order_no+'_'+element.product_code
  240. return key;
  241. },
  242. // 将原始数据处理拼接成提交的数据
  243. deelTableData() {
  244. let new_table_data = [];
  245. console.log(this.scan_data);
  246. this.scan_data.forEach((element, index) => {
  247. 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) {
  248. let table_data_detail = JSON.parse(JSON.stringify(this.key_tableData[this.deelUniqueProductKey(element)]))
  249. table_data_detail.box_orders = element.box_id;
  250. table_data_detail.box_orders_show = element.box_no;
  251. table_data_detail.out_qty += element.box_num;
  252. this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty -= element.box_num*1;
  253. // table_data_detail.this_delivery_qty = this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty;
  254. table_data_detail.id = null;
  255. new_table_data.push(table_data_detail)
  256. }
  257. })
  258. this.tableData.forEach((element, index) => {
  259. if (element.this_delivery_qty > 0) {
  260. new_table_data.push(element)
  261. }
  262. })
  263. this.tableData = new_table_data;
  264. },
  265. handelGoSure () {
  266. this.tableData.forEach((element, index) => {
  267. element.item_num = (index + 1)
  268. })
  269. this.data.data.send_goods_out_product = this.tableData
  270. let data = {
  271. url: 'http://121.36.142.167:7774/jbl/api/module-data/send_goods_out/send_goods_out',
  272. post: this.data
  273. }
  274. this.axios.post('/api/testdwy', data).then(res => {
  275. if (res.code === 200) {
  276. this.$Message.success(res.msg)
  277. this.$router.go(-1)
  278. }
  279. })
  280. // console.log(JSON.stringify(this.data))
  281. },
  282. handleReturn() {
  283. localStorage.removeItem('fyy_target')
  284. this.$router.push('/cms/finish')
  285. },
  286. handleChoose(item, index) {
  287. item.is_choose = !item.is_choose
  288. this.tableData.splice(index, 1, item)
  289. },
  290. handleShow() {
  291. this.is_show = !this.is_show
  292. // console.log(document.getElementsByClassName('header'))
  293. }
  294. }
  295. }
  296. </script>
  297. <style lang="scss" scoped>
  298. .return_btn {
  299. background-image: url('../../../assets/home/return.png');
  300. background-size: 100% 100%;
  301. }
  302. .confirm_btn {
  303. background-image: url('../../../assets/home/confirm.png');
  304. background-size: 100% 100%;
  305. }
  306. .return_btn,
  307. .confirm_btn {
  308. width: 10.97rem;
  309. height: 3.93rem;
  310. display: flex;
  311. align-items: center;
  312. justify-content: center;
  313. color: #fff;
  314. font-size: 1.06rem;
  315. font-weight: 500;
  316. letter-spacing: 1px;
  317. }
  318. .secd_flex_s>span:nth-child(1) {
  319. font-size: 0.94rem;
  320. color: #ABDFFF;
  321. }
  322. .secd_flex_s>span:nth-child(2) {
  323. font-size: 0.94rem;
  324. color: #03FCD3;
  325. }
  326. .secd_g {
  327. font-size: 1rem;
  328. color: #ABDFFF
  329. }
  330. .secd_title_d {
  331. font-size: 1.13rem;
  332. color: #FFFFFF;
  333. text-shadow: 0px 0px 0px rgba(255, 255, 255, 0.5);
  334. white-space: nowrap;
  335. overflow: hidden;
  336. text-overflow: ellipsis;
  337. }
  338. .secd_flex_w {
  339. display: flex;
  340. justify-content: space-between;
  341. padding-right: 1.6rem;
  342. box-sizing: border-box;
  343. }
  344. .secd_flex {
  345. display: flex;
  346. flex-direction: column;
  347. gap: .375rem;
  348. .secd_title {
  349. font-size: 0.88rem;
  350. color: #ABDFFF;
  351. opacity: 0.5;
  352. }
  353. }
  354. .check_box_c {
  355. width: 1.19rem;
  356. height: 100%;
  357. background-image: url('../../../assets/home/check.png');
  358. background-size: 100% 100%;
  359. }
  360. .check_box_c_active {
  361. width: 1.3rem;
  362. height: 100%;
  363. background-image: url('../../../assets/home/checked.png');
  364. background-size: 100% 100%;
  365. }
  366. .send_work {
  367. height: 9.69rem;
  368. background-image: url('../../../assets/home/packUpback.png');
  369. background-size: 100% 100%;
  370. margin-top: 1.38rem;
  371. padding: 0.44rem 0.4rem 1.34rem 1.22rem;
  372. box-sizing: border-box;
  373. .check_box {
  374. height: 1.19rem;
  375. display: flex;
  376. justify-content: right;
  377. }
  378. }
  379. .com_top {
  380. margin-top: 1.72rem !important;
  381. }
  382. .completion_con {
  383. height: 5.19rem;
  384. background-image: url('../../../assets/home/completion.png');
  385. background-size: 100% 100%;
  386. margin-top: 0.72rem;
  387. padding: 1rem 1.28rem;
  388. box-sizing: border-box;
  389. display: flex;
  390. align-items: center;
  391. justify-content: space-between;
  392. }
  393. .home_con_s {
  394. position: relative;
  395. .pack_up {
  396. position: absolute;
  397. top: 0;
  398. left: 50%;
  399. transform: translateX(-50%);
  400. width: 5.56rem;
  401. background-image: url('../../../assets/home/packUp.png');
  402. background-size: 100% 100%;
  403. height: 1.97rem;
  404. display: flex;
  405. align-items: center;
  406. justify-content: center;
  407. img {
  408. width: 2.59rem;
  409. height: 0.88rem;
  410. }
  411. }
  412. .pack_up_d {
  413. top: -1.1rem;
  414. }
  415. .pack_up_con {
  416. height: 14.09rem;
  417. background-image: url('../../../assets/home/packUpback.png');
  418. background-size: 100% 100%;
  419. padding: 1.78rem 2.03rem;
  420. box-sizing: border-box;
  421. .pack_up_name {
  422. height: 1.25rem;
  423. font-size: 1.25rem;
  424. color: #fff;
  425. font-weight: 600;
  426. }
  427. .pack_up_grid {
  428. display: grid;
  429. grid-template-columns: repeat(2, 1fr);
  430. row-gap: .625rem;
  431. &>div {
  432. display: flex;
  433. flex-direction: column;
  434. row-gap: .625rem;
  435. &>div {
  436. display: flex;
  437. gap: .125rem;
  438. span:nth-child(1) {
  439. font-size: 1.63rem;
  440. font-family: DIN-BoldItalic, DIN;
  441. font-weight: 600;
  442. color: #04FFD5;
  443. line-height: 1.31rem;
  444. transform: skewX(-10deg);
  445. text-shadow: 0px 0px 0px rgba(4, 255, 213, 0.23);
  446. }
  447. span:nth-child(2) {
  448. font-size: 1rem;
  449. font-family: PingFangSC-Regular, PingFang SC;
  450. font-weight: 400;
  451. color: #ABDFFF;
  452. }
  453. }
  454. &>p:nth-child(1) {
  455. font-size: 1rem;
  456. font-family: PingFangSC-Regular, PingFang SC;
  457. font-weight: 400;
  458. color: #ABDFFF;
  459. margin-bottom: 0px;
  460. }
  461. }
  462. }
  463. }
  464. }
  465. .home_con_body {
  466. width: 100%;
  467. padding: 1rem;
  468. box-sizing: border-box;
  469. }
  470. .home_header {
  471. height: 3.125rem;
  472. display: flex;
  473. align-items: center;
  474. justify-content: center;
  475. color: #fff;
  476. font-size: 1.125rem;
  477. font-weight: 600;
  478. }
  479. .home_header_line {
  480. width: 100%;
  481. height: .0625rem;
  482. background-color: #fff;
  483. opacity: 0.2;
  484. }
  485. .header {
  486. width: 94%;
  487. height: 7rem;
  488. // overflow: hidden;
  489. // transition: all 0.4s;
  490. position: relative;
  491. top: 0.5rem;
  492. left: 3%;
  493. box-shadow: 0.16rem 0.1rem 0.1rem 0.1rem #9d9b9b;
  494. border-radius: 1rem;
  495. padding: 0.4rem 0.7rem 0 1rem;
  496. background: #fff;
  497. }
  498. .header_btn {
  499. border-radius: 1rem;
  500. padding: 0.1rem;
  501. width: 5rem;
  502. display: flex;
  503. justify-content: space-around;
  504. align-items: center;
  505. }
  506. .header_top {
  507. display: flex;
  508. justify-content: space-between;
  509. align-items: center;
  510. }
  511. .ot {
  512. position: relative;
  513. top: -1.3rem;
  514. }
  515. .header_middle1 {
  516. display: flex;
  517. justify-content: space-between;
  518. align-items: center;
  519. .ft {
  520. font-size: 1.5rem;
  521. width: 5rem;
  522. text-align: center;
  523. }
  524. }
  525. .header_middle {
  526. position: relative;
  527. top: -0.3rem;
  528. display: flex;
  529. justify-content: space-between;
  530. align-items: center;
  531. }
  532. /deep/ .btn-group>.btn,
  533. .btn-group-vertical>.btn {
  534. background: #ffffff;
  535. color: #2c3e50;
  536. outline: none;
  537. border: none;
  538. margin: 0;
  539. z-index: 3;
  540. }
  541. .header_footer {
  542. position: relative;
  543. top: -1.7rem;
  544. display: flex;
  545. justify-content: space-between;
  546. align-items: center;
  547. div {
  548. font-size: 0.5rem;
  549. color: rgb(244, 136, 42);
  550. }
  551. }
  552. .bdy {
  553. width: 94%;
  554. height: calc(100% - 18.7rem);
  555. overflow: auto;
  556. position: relative;
  557. top: 1rem;
  558. left: 3%;
  559. }
  560. /deep/td {
  561. text-align: center;
  562. vertical-align: middle;
  563. }
  564. table {
  565. border-collapse: collapse;
  566. /* 合并边框 */
  567. width: 100%;
  568. /* 表格宽度 */
  569. background: #fff;
  570. table-layout: fixed;
  571. }
  572. th {
  573. font-size: 0.6rem;
  574. background: #66b1f4;
  575. color: #fff;
  576. }
  577. td {
  578. font-size: 0.6rem;
  579. word-break: break-all;
  580. }
  581. td,
  582. th {
  583. vertical-align: middle;
  584. text-align: center;
  585. border: 0.1rem solid #dddddd;
  586. /* 单元格边框样式 */
  587. padding: 0.02rem;
  588. /* 单元格内边距 */
  589. }
  590. .choose_item {
  591. background: #c8c8c8;
  592. }
  593. .footer {
  594. display: flex;
  595. width: 100%;
  596. position: absolute;
  597. bottom: 4.8rem;
  598. }
  599. </style>