Deliverylist.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. <template>
  2. <div>
  3. <FullPage
  4. title="发货单"
  5. :list="set_list"
  6. @init="init"
  7. :loading="loading"
  8. @searchData="init"
  9. @changePage="changePage"
  10. @changeSize="changeSize"
  11. :tableColums="computedTable"
  12. :tableData="tableData"
  13. :pageIndex="pageIndex"
  14. :total="total"
  15. >
  16. <div slot="navButton">
  17. <!-- <Button
  18. v-if="persimissionData['表头设置'] || persimissionData.all"
  19. @click="setupTableHeader"
  20. type="primary"
  21. ghost
  22. icon="ios-cog"
  23. >表头设置</Button
  24. > -->
  25. </div>
  26. <template slot="basicTypeSet" slot-scope="{ row }">
  27. <div>
  28. <span
  29. v-for="item in warningList"
  30. :key="item.id"
  31. :style="{ color: item.color }"
  32. v-show="item.id == row.warning_state"
  33. >{{ item.title }}</span
  34. >
  35. </div>
  36. </template>
  37. <template slot="set" slot-scope="{ row }">
  38. <a class="map-margin" @click="goPage(row,1)">详情</a>
  39. <a class="map-margin" @click="goPage(row,2)">查看异常</a>
  40. <a
  41. @click="confirmOutStock(row, 1)"
  42. v-if="row.state == 0"
  43. class="map-margin"
  44. >确认出库</a
  45. >
  46. <!-- &&(persimissionData['确认出库'] || persimissionData.all) -->
  47. <a
  48. @click="confirmOutStock(row, 2)"
  49. v-if="row.state == 1"
  50. class="map-margin"
  51. >确认运输</a
  52. >
  53. <!-- &&(persimissionData['确认运输'] || persimissionData.all) -->
  54. <a
  55. class="map-margin"
  56. @click="
  57. goBigScreen(row);
  58. showModal = true;
  59. "
  60. >大屏</a
  61. >
  62. </template>
  63. </FullPage>
  64. <Modal v-model="showModal" fullscreen footer-hide class="modal-bs">
  65. <template slot="header">
  66. <div class="modal-title">
  67. <span class="modal-titlt-side">{{ selectedName }}</span>
  68. <span class="modal-title-name font-gradient-style"
  69. >倍思特发货清单</span
  70. >
  71. <span class="modal-titlt-side">{{ currentDate }}</span>
  72. </div>
  73. </template>
  74. <div class="modal-body">
  75. <div class="modal-body-top">
  76. <div class="modal-body-top-left">
  77. <div class="modal-body-top-left-card">
  78. <div class="font-gradient-style">
  79. 芯片总数
  80. </div>
  81. <div class="card-number-style" ref="tag_num_total">
  82. <div>0</div>
  83. <div>0</div>
  84. <div>0</div>
  85. <div>0</div>
  86. </div>
  87. </div>
  88. <div class="modal-body-top-left-card">
  89. <div class="font-gradient-style">
  90. 今日发货
  91. </div>
  92. <div class="card-number-style" ref="today_total_total">
  93. <div>0</div>
  94. <div>0</div>
  95. <div>0</div>
  96. <div>0</div>
  97. </div>
  98. </div>
  99. <div class="modal-body-top-left-card">
  100. <div class="font-gradient-style">
  101. 已发货
  102. </div>
  103. <div class="card-number-style" ref="send_total_total">
  104. <div>0</div>
  105. <div>0</div>
  106. <div>0</div>
  107. <div>0</div>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="modal-body-top-right">
  112. <div class="modal-body-top-right-card">
  113. <div>
  114. 异常芯片
  115. </div>
  116. <div class="card-number-style" ref="unusual_tag_num_total">
  117. <div>0</div>
  118. <div>0</div>
  119. <div>0</div>
  120. <div>0</div>
  121. </div>
  122. </div>
  123. <span></span>
  124. <span></span>
  125. </div>
  126. </div>
  127. <div class="modal-body-content">
  128. <div class="modal-body-content-left">
  129. <Table
  130. max-height="400"
  131. :columns="modalHouseColums"
  132. :data="modalHouseList"
  133. ></Table>
  134. <div style="padding-top:10px;color:white">
  135. 共{{ today_total - send_total }}条未发货
  136. </div>
  137. </div>
  138. <div class="modal-body-content-right">
  139. <Table
  140. style="background-color: transparent;"
  141. stripe
  142. max-height="470"
  143. :columns="modalHouseColums"
  144. :data="modalUnusualTagList"
  145. ></Table>
  146. </div>
  147. </div>
  148. </div>
  149. </Modal>
  150. </div>
  151. </template>
  152. <script>
  153. import { mapState } from "vuex";
  154. export default {
  155. data() {
  156. return {
  157. tableColums: [
  158. {
  159. title: "订单编号",
  160. align: "center",
  161. key: "order_no",
  162. fixed: "left",
  163. width: "200",
  164. },
  165. {
  166. title: "运输单号",
  167. align: "center",
  168. key: "transport_no",
  169. minWidth: 200,
  170. },
  171. {
  172. title: "订单类型",
  173. align: "center",
  174. key: "type",
  175. minWidth: 100,
  176. render: (h, params) =>
  177. h("span", {}, params.row.type == 1 ? "工装" : "家装"),
  178. },
  179. {
  180. title: "紧急程度",
  181. align: "center",
  182. key: "warning_state",
  183. minWidth: 100,
  184. slot: "basicTypeSet",
  185. },
  186. {
  187. title: "小区名称",
  188. align: "center",
  189. key: "residential_name",
  190. minWidth: 200,
  191. },
  192. {
  193. title: "出库时间",
  194. align: "center",
  195. key: "start_time",
  196. minWidth: 200,
  197. render: (h, params) =>
  198. h("span", {}, this.func.replaceDate(params.row.start_time, 1)),
  199. },
  200. {
  201. title: "确认出库百分比",
  202. align: "center",
  203. key: "in_out_value",
  204. minWidth: 150,
  205. },
  206. { title: "客户", align: "center", key: "client_name", minWidth: 150 },
  207. {
  208. title: "运输百分比",
  209. align: "center",
  210. key: "transportation_value",
  211. minWidth: 150,
  212. },
  213. { title: "手机号", align: "center", key: "mobile", minWidth: 150 },
  214. {
  215. title: "订单状态",
  216. align: "center",
  217. key: "state",
  218. minWidth: 100,
  219. render: (h, params) =>
  220. h(
  221. "span",
  222. {},
  223. params.row.state == 99
  224. ? "全部"
  225. : params.row.state == 0
  226. ? "可以派工"
  227. : params.row.state == 1
  228. ? "已派工"
  229. : "已完成"
  230. ),
  231. },
  232. {
  233. title: "操作",
  234. align: "center",
  235. key: "set",
  236. slot: "set",
  237. fixed: "right",
  238. width: "150",
  239. },
  240. ],
  241. tableData: [],
  242. pageIndex: 1,
  243. pageSize: 10,
  244. total: 0,
  245. proxyObj: {},
  246. loading: false,
  247. tableheaders: [],
  248. showModal: false,
  249. modalHouseList: [],
  250. modalUnusualTagList: [],
  251. //芯片总数
  252. tag_num: "",
  253. //今日发货
  254. today_total: "",
  255. //已发货
  256. send_total: "",
  257. warningList: [],
  258. //异常芯片
  259. unusual_tag_num: "",
  260. modalHouseColums: [
  261. {
  262. title: "房间",
  263. key: "houseName",
  264. maxWidth: 120,
  265. },
  266. {
  267. title: "产品",
  268. key: "title",
  269. },
  270. {
  271. title: "部件",
  272. key: "part_title",
  273. },
  274. ],
  275. selectedName: "",
  276. currentDate: "",
  277. timer: "",
  278. };
  279. },
  280. computed: {
  281. ...mapState(["persimissionData"]),
  282. computedTable() {
  283. if (this.tableheaders.length < 1) {
  284. return this.tableColums;
  285. }
  286. return this.func.computedHeader(this.tableheaders, this.tableColums);
  287. },
  288. set_list() {
  289. return [
  290. {
  291. title: "订单编号",
  292. name: "Input",
  293. serverName: "order_no",
  294. placeholder: "请输入订单编号",
  295. value: "",
  296. },
  297. {
  298. title: "订单类型",
  299. name: "Select",
  300. placeholder: "请选择",
  301. serverName: "type",
  302. value: "",
  303. option: [
  304. { label: "工装", value: 1 },
  305. { label: "家装", value: 0 },
  306. ],
  307. },
  308. {
  309. title: "订单状态",
  310. name: "Select",
  311. placeholder: "请选择",
  312. serverName: "sub_state",
  313. value: "",
  314. option: [
  315. { label: "可以派工", value: 0 },
  316. { label: "已派工", value: 1 },
  317. { label: "已完成", value: 2 },
  318. ],
  319. },
  320. {
  321. title: "紧急程度",
  322. name: "Select",
  323. serverName: "warning_state",
  324. placeholder: "请选择",
  325. value: "",
  326. optionName: "title",
  327. optionValue: "id",
  328. option: this.warningList,
  329. },
  330. {
  331. title: "小区名称",
  332. name: "Input",
  333. serverName: "residential_name",
  334. placeholder: "小区名称",
  335. value: "",
  336. },
  337. {
  338. title: "客户",
  339. name: "Input",
  340. serverName: "client_name",
  341. placeholder: "客户",
  342. value: "",
  343. },
  344. {
  345. title: "手机号",
  346. name: "Input",
  347. serverName: "mobile",
  348. placeholder: "手机号",
  349. value: "",
  350. },
  351. {
  352. title: "出库日期范围",
  353. start_server: "start_time",
  354. end_server: "end_time",
  355. name: "Input",
  356. start_value: "",
  357. end_value: "",
  358. isDate: true,
  359. start_placeholder: "开始日期",
  360. end_placeholder: "结束日期",
  361. },
  362. ];
  363. },
  364. },
  365. methods: {
  366. init(row) {
  367. this.pageIndex = 1;
  368. row.page_index = this.pageIndex;
  369. row.page_size = this.pageSize;
  370. this.proxyObj = row;
  371. this.getData(row);
  372. },
  373. getData(row) {
  374. this.loading = true;
  375. this.axios("/api/orders_out_list", { params: row }).then((res) => {
  376. this.loading = false;
  377. if (res.code == 200) {
  378. this.tableData = res.data.data;
  379. this.total = res.data.total;
  380. this.tableheaders = res.data.tableSet || [];
  381. }
  382. });
  383. },
  384. changePage(e) {
  385. this.pageIndex = e;
  386. this.proxyObj.page_index = this.pageIndex;
  387. this.getData(this.proxyObj);
  388. },
  389. changeSize(e) {
  390. this.pageSize = e;
  391. this.proxyObj.page_size = this.pageSize;
  392. this.getData(this.proxyObj);
  393. },
  394. confirmOutStock(row, type) {
  395. //type 1出库 2运输
  396. let params = {};
  397. let post_url =
  398. type == 1 ? "/api/orders_transport" : "/api/orders_transport_confirm";
  399. params.transport_no = row.transport_no || row.order_no;
  400. this.confirmDelete({
  401. title: type == 1 ? "确认出库" : "确认运输",
  402. content: type == 1 ? "确认出库么?" : "确认运输么?",
  403. type: "primary",
  404. then: (e) => {
  405. this.axios.post(post_url, params).then((res) => {
  406. if (res.code == 200) {
  407. this.$Message.success(res.msg);
  408. this.getData(this.proxyObj);
  409. }
  410. });
  411. },
  412. cancel: (e) => {},
  413. });
  414. },
  415. goPage(row,type) {
  416. switch(row,type){
  417. case 1:
  418. this.$router.push({
  419. path: "/cms/productionorderlist/inboundform/details",
  420. query: {
  421. order_no: row.order_no,
  422. type: 2,
  423. transport_no: row.transport_no,
  424. },
  425. });
  426. break
  427. case 2:
  428. this.$router.push('/cms/productionorderlist/deliverylist/checkUnusual')
  429. }
  430. },
  431. goBigScreen(row) {
  432. this.axios({
  433. method: "post",
  434. url: "/api/transport_list",
  435. data: {
  436. transport_no: row.transport_no,
  437. // transport_no:16185413363403
  438. },
  439. })
  440. .then((res) => {
  441. const temphouse = res.data.house;
  442. temphouse.forEach((el) => {
  443. el.houseName = `${el.house}-${el.layer}-${el.unit}-${el.number}`;
  444. });
  445. this.modalHouseList = temphouse;
  446. const tempunusual_tag = res.data.unusual_tag;
  447. tempunusual_tag.forEach((el) => {
  448. el.houseName = `${el.house}-${el.layer}-${el.unit}-${el.number}`;
  449. });
  450. this.modalUnusualTagList = tempunusual_tag;
  451. this.tag_num = res.data.tag_num;
  452. this.today_total = res.data.total;
  453. this.send_total = res.data.send_total;
  454. this.unusual_tag_num = res.data.unusual_tag_num;
  455. this.handleDispaly(
  456. res.data.tag_num,
  457. this.$refs.tag_num_total.children
  458. );
  459. this.handleDispaly(
  460. res.data.send_total,
  461. this.$refs.send_total_total.children
  462. );
  463. this.handleDispaly(
  464. res.data.total,
  465. this.$refs.today_total_total.children
  466. );
  467. this.handleDispaly(
  468. res.data.unusual_tag_num,
  469. this.$refs.unusual_tag_num_total.children
  470. );
  471. this.selectedName = row.residential_name;
  472. })
  473. .catch((err) => {});
  474. },
  475. setupTableHeader() {
  476. this.tableheaders.length < 1
  477. ? (this.tableheaders = this.tableColums.reduce(
  478. (pre, cur) => pre.concat(cur.key),
  479. []
  480. ))
  481. : "";
  482. this.$setTableheader({
  483. list: this.tableColums,
  484. selects: this.tableheaders,
  485. then: (result) => {
  486. this.tableheaders = result;
  487. this.axios
  488. .post("/api/update/table", { id: this.$route.query.id, result })
  489. .then((res) => {
  490. if (res.code == 200) {
  491. this.$Message.success(res.msg);
  492. }
  493. });
  494. },
  495. });
  496. },
  497. //芯片展示更改
  498. handleDispaly(from, to) {
  499. //[1,2,3,4]
  500. to.forEach((el) => {
  501. el.innerText = 0;
  502. });
  503. const arr = from
  504. .toString()
  505. .split("")
  506. .reverse();
  507. let i = 3;
  508. arr.forEach((el) => {
  509. to[i].innerText = el;
  510. i--;
  511. });
  512. },
  513. },
  514. created() {
  515. let _this = this; //声明一个变量指向Vue实例this,保证作用域一致
  516. this.timer = setInterval(function() {
  517. _this.currentDate = //修改数据date
  518. new Date().getFullYear() +
  519. "-" +
  520. (new Date().getMonth() + 1) +
  521. "-" +
  522. new Date().getDate() +
  523. " " +
  524. new Date().getHours() +
  525. ":" +
  526. new Date().getMinutes();
  527. }, 1000);
  528. // 获取紧急程度
  529. this.axios.get("/api/warning_list").then((res) => {
  530. this.warningList = res.data.data;
  531. });
  532. },
  533. beforeDestroy() {
  534. if (this.timer) {
  535. clearInterval(this.timer); // 在Vue实例销毁前,清除我们的定时器
  536. }
  537. },
  538. };
  539. </script>
  540. <style lang="scss" scoped>
  541. .modal-bs {
  542. /deep/.ivu-modal-header,
  543. /deep/.ivu-modal-body,
  544. /deep/.ivu-modal-footer {
  545. padding: 0;
  546. border: none;
  547. }
  548. /deep/.ivu-modal-content {
  549. background-image: url("./../../../assets/imgs/bgBSContent.png");
  550. background-repeat: no-repeat;
  551. background-size: 100% 100%;
  552. -moz-background-size: 100% 100%;
  553. }
  554. }
  555. .modal-title {
  556. display: flex;
  557. justify-content: space-between;
  558. align-items: flex-end;
  559. color: white;
  560. height: 80px;
  561. padding: 20px;
  562. background-image: url("./../../../assets/imgs/bgBSHeader.png");
  563. background-repeat: no-repeat;
  564. background-size: 100% 100%;
  565. -moz-background-size: 100% 100%;
  566. .modal-title-name {
  567. font-size: 40px;
  568. }
  569. .modal-titlt-side {
  570. width: 15%;
  571. font-size: 20px;
  572. }
  573. }
  574. .modal-body {
  575. margin-top: 50px;
  576. padding-top: 10px;
  577. background-image: url("./../../../assets/imgs/bgBSBody.png");
  578. background-repeat: no-repeat;
  579. background-size: 100% 100%;
  580. -moz-background-size: 100% 100%;
  581. .modal-body-top,
  582. .modal-body-content {
  583. display: flex;
  584. justify-content: space-between;
  585. width: 100%;
  586. }
  587. .modal-body-top {
  588. padding: 50px 0;
  589. background-image: url("./../../../assets/imgs/bgBSBodyTop.png");
  590. background-repeat: no-repeat;
  591. background-size: 100% 100%;
  592. -moz-background-size: 100% 100%;
  593. .modal-body-top-left {
  594. display: flex;
  595. width: 55%;
  596. justify-content: space-between;
  597. margin-top: 30px;
  598. .modal-body-top-left-card {
  599. width: 30%;
  600. margin: 10px;
  601. text-align: center;
  602. border-radius: 10px;
  603. padding: 10px;
  604. background-color: #282928;
  605. border: #2a6ffe 1px solid;
  606. div {
  607. padding: 10px 0;
  608. font-size: 30px;
  609. }
  610. }
  611. }
  612. .modal-body-top-right {
  613. display: flex;
  614. width: 40%;
  615. justify-content: space-between;
  616. margin-top: 30px;
  617. .modal-body-top-right-card {
  618. width: 40%;
  619. margin: 10px;
  620. text-align: center;
  621. border-radius: 10px;
  622. padding: 10px;
  623. background-color: #282928;
  624. border: #ff4242 1px solid;
  625. color: #ff4242;
  626. div {
  627. color: #ff4242;
  628. padding: 10px 0;
  629. font-size: 30px;
  630. }
  631. }
  632. }
  633. /deep/.ivu-card-head {
  634. border: none;
  635. }
  636. }
  637. .modal-body-content {
  638. padding-top: 10px;
  639. .modal-body-content-left {
  640. width: 55%;
  641. margin: 10px;
  642. padding: 50px 20px;
  643. background-image: url("./../../../assets/imgs/bgBSBodyContent.png");
  644. background-repeat: no-repeat;
  645. background-size: 100% 100%;
  646. -moz-background-size: 100% 100%;
  647. /deep/.ivu-table {
  648. color: #d4d4dc;
  649. background-color: transparent;
  650. .ivu-table-header thead tr th {
  651. // background-color:transparent;
  652. background-color: rgba(255, 255, 255, 0.1);
  653. border-bottom: #111419 1px solid;
  654. }
  655. .ivu-table-body tbody tr td {
  656. // background-color:transparent;
  657. background-color: rgba(255, 255, 255, 0.1);
  658. border-bottom: #111419 1px solid;
  659. }
  660. .ivu-table-tip tbody tr td {
  661. // background-color:transparent;
  662. background-color: rgba(255, 255, 255, 0.1);
  663. border-bottom: #111419 1px solid;
  664. }
  665. }
  666. /deep/.ivu-table:before {
  667. height: 0;
  668. }
  669. }
  670. .modal-body-content-right {
  671. width: 40%;
  672. margin: 10px;
  673. padding: 50px 20px;
  674. background-image: url("./../../../assets/imgs/bgBSBodyContent.png");
  675. background-repeat: no-repeat;
  676. background-size: 100% 100%;
  677. -moz-background-size: 100% 100%;
  678. /deep/.ivu-table {
  679. color: #d4d4dc;
  680. background-color: transparent;
  681. .ivu-table-header thead tr th {
  682. // background-color:transparent;
  683. background-color: rgba(255, 255, 255, 0.1);
  684. border-bottom: #111419 1px solid;
  685. }
  686. .ivu-table-body tbody tr td {
  687. // background-color:transparent;
  688. background-color: rgba(255, 255, 255, 0.1);
  689. border-bottom: #111419 1px solid;
  690. }
  691. .ivu-table-tip tbody tr td {
  692. // background-color:transparent;
  693. background-color: rgba(255, 255, 255, 0.1);
  694. border-bottom: #111419 1px solid;
  695. }
  696. }
  697. /deep/.ivu-table:before {
  698. height: 0;
  699. }
  700. }
  701. }
  702. }
  703. //文字渐变效果
  704. .font-gradient-style {
  705. background-image: -webkit-gradient(
  706. linear,
  707. 0% top,
  708. 0% bottom,
  709. from(#dbddf1),
  710. to(#a5a8d1)
  711. );
  712. color: transparent;
  713. -webkit-background-clip: text;
  714. -moz-background-clip: text;
  715. }
  716. //芯片数字展示效果
  717. .card-number-style {
  718. display: flex;
  719. justify-content: space-around;
  720. align-items: center;
  721. padding: 30px 0;
  722. div {
  723. width: 15%;
  724. color: white;
  725. padding: 2px 5px;
  726. background-image: linear-gradient(#121312, #313131);
  727. }
  728. }
  729. </style>