index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. <template>
  2. <div>
  3. <basic-container v-if="isShow">
  4. <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :search.sync="query"
  5. v-model="form" id="out-table" :header-cell-class-name="headerClassName" ref="crud" @row-del="rowDel"
  6. @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
  7. @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
  8. @resetColumn="resetColumn('crud', 'option', 'optionBack', 501)"
  9. @saveColumn="saveColumn('crud', 'option', 'optionBack', 501)" @on-load="onLoad">
  10. <template slot="menuLeft">
  11. <el-button type="primary" size="small" icon="el-icon-plus" @click="addButton">创建单据
  12. </el-button>
  13. <el-button type="success" size="small" :disabled="selectionList.length != 1"
  14. @click="copyButton">复制单据
  15. </el-button>
  16. <el-button type="warning" size="small" @click="outExport">导 出</el-button>
  17. <div style="margin-top: 10px">
  18. <el-tabs type="card" v-model="query.billStatus" @tab-click="handleClick">
  19. <!-- <el-tab-pane label="录入" name="1"></el-tab-pane>
  20. <el-tab-pane label="提交" name="2"></el-tab-pane>
  21. <el-tab-pane label="受理" name="3"></el-tab-pane> -->
  22. <el-tab-pane label="待确认" name="4"></el-tab-pane>
  23. <el-tab-pane label="已生成" name="5"></el-tab-pane>
  24. <el-tab-pane label="订舱驳回" name="7"></el-tab-pane>
  25. <el-tab-pane label="全部" name="0"></el-tab-pane>
  26. </el-tabs>
  27. </div>
  28. </template>
  29. <template slot="menu" slot-scope="{ row, index }">
  30. <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">编辑</el-button>
  31. <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
  32. :disabled="!(row.issueStatus == 0 || row.issueStatus == 6||row.billStatus==1)">删 除</el-button>
  33. </template>
  34. <!-- <template slot="status" slot-scope="{ row }">
  35. <span v-if="row.issueStatus == 0"
  36. style="color: #fff;border-radius: 30px;padding: 2px 15px;background-color: #409EFF;">{{
  37. row.status }}</span>
  38. <span v-if="row.issueStatus != 0"
  39. style="color: #fff;border-radius: 30px;padding: 2px 15px;background-color: #67C23A;">{{
  40. row.status }}</span>
  41. </template> -->
  42. <template slot="billNo" slot-scope="{ row }">
  43. <span style="color: #1e9fff;cursor: pointer;" @click="rowEdit(row)">{{ row.billNo }}</span>
  44. </template>
  45. </avue-crud>
  46. </basic-container>
  47. <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
  48. </div>
  49. </template>
  50. <script>
  51. import { getList, remove } from "@/api/iosBasicData/businessCenter/bookingCabin.js";
  52. import { getWorkDicts } from "@/api/system/dictbiz";
  53. import detailsPage from "./detailsPage";
  54. import { getToken } from "@/util/auth";
  55. import { dateFormat } from "@/util/date";
  56. import _ from "lodash";
  57. export default {
  58. data() {
  59. return {
  60. isShow: true,
  61. form: {},
  62. query: {
  63. businessType: 'KHTS',
  64. billStatus: '4'
  65. },
  66. loading: false,
  67. page: {
  68. pageSize: 10,
  69. currentPage: 1,
  70. total: 0
  71. },
  72. selectionList: [],
  73. option: {},
  74. optionBack: {
  75. height: 'auto',
  76. calcHeight: 30,
  77. menuWidth: 140,
  78. tip: false,
  79. searchShow: true,
  80. searchMenuSpan: 18,
  81. border: true,
  82. index: true,
  83. addBtn: false,
  84. viewBtn: false,
  85. editBtn: false,
  86. delBtn: false,
  87. selection: true,
  88. searchIcon: true,
  89. align: 'center',
  90. searchIndex: 3,
  91. column: [
  92. {
  93. label: '所属公司',
  94. prop: "branchName",
  95. width: "100",
  96. // search: true,
  97. // type: "select",
  98. // filterable: true,
  99. // dicUrl: "/api/blade-system/dept/lazy-list",
  100. // props: {
  101. // label: "deptName",
  102. // value: "deptName",
  103. // },
  104. overHidden: true,
  105. },
  106. {
  107. label: '所属公司',
  108. prop: "branchId",
  109. width: "100",
  110. search: true,
  111. type: "select",
  112. filterable: true,
  113. dicUrl: "/api/blade-system/dept/lazy-list",
  114. props: {
  115. label: "deptName",
  116. value: "id",
  117. },
  118. hide: true,
  119. // showColumn: false,
  120. overHidden: true,
  121. },
  122. {
  123. label: '系统号',
  124. prop: "billNo",
  125. width: "120",
  126. search: true,
  127. overHidden: true,
  128. },
  129. {
  130. label: 'B/L NO',
  131. prop: "hblno",
  132. width: "100",
  133. search: true,
  134. overHidden: true,
  135. },
  136. {
  137. label: '客户',
  138. prop: "corpCnName",
  139. width: "100",
  140. search: true,
  141. type: 'select',
  142. filterable: true,
  143. remote: true,
  144. dicUrl: "/api/blade-los/bcorps/selectList?status=0&current=1&size=20&cnName={{key}}",
  145. props: {
  146. label: 'cnName',
  147. value: 'cnName',
  148. res: 'data.records'
  149. },
  150. overHidden: true,
  151. },
  152. {
  153. label: 'ETD',
  154. prop: "etd",
  155. width: "100",
  156. overHidden: true,
  157. type: "date",
  158. format: "yyyy-MM-dd",
  159. valueFormat: "yyyy-MM-dd 00:00:00",
  160. },
  161. {
  162. label: "起运港",
  163. prop: "polEnName",
  164. width: "80",
  165. overHidden: true,
  166. search: true,
  167. type: 'select',
  168. filterable: true,
  169. remote: true,
  170. dicUrl: "/api/blade-los/bports/list?current=1&size=5&cnName={{key}}",
  171. props: {
  172. label: 'enName',
  173. value: 'enName',
  174. desc: 'code',
  175. res: 'data.records'
  176. },
  177. },
  178. {
  179. label: "卸货港",
  180. prop: "podEnName",
  181. width: "80",
  182. overHidden: true,
  183. search: true,
  184. type: 'select',
  185. filterable: true,
  186. remote: true,
  187. dicUrl: "/api/blade-los/bports/list?current=1&size=5&cnName={{key}}",
  188. props: {
  189. label: 'enName',
  190. value: 'enName',
  191. desc: 'code',
  192. res: 'data.records'
  193. },
  194. },
  195. {
  196. label: "箱型箱量",
  197. prop: "quantityCntrDescr",
  198. width: "80",
  199. overHidden: true,
  200. },
  201. {
  202. label: "TEU",
  203. prop: "teu",
  204. width: "100",
  205. overHidden: true
  206. },
  207. {
  208. label: "20GP",
  209. prop: "quantityV20",
  210. width: "100",
  211. overHidden: true
  212. },
  213. {
  214. label: "40GP",
  215. prop: "quantityV40",
  216. width: "100",
  217. overHidden: true
  218. },
  219. {
  220. label: "20HC",
  221. prop: "quantityV45",
  222. width: "100",
  223. overHidden: true
  224. },
  225. {
  226. label: "40FR",
  227. prop: "quantityV48",
  228. width: "100",
  229. overHidden: true
  230. },
  231. {
  232. label: "40HC",
  233. prop: "quantityV40hc",
  234. width: "100",
  235. overHidden: true
  236. },
  237. // {
  238. // label: "单据状态",
  239. // prop: "issueStatus",
  240. // width: "80",
  241. // overHidden: true,
  242. // // search: true,
  243. // type: 'select',
  244. // dicData: [{
  245. // label: '录入',
  246. // value: '0',
  247. // }, {
  248. // label: '已生成',
  249. // value: '1',
  250. // }, {
  251. // label: '待确认',
  252. // value: '2',
  253. // }, {
  254. // label: '订舱驳回',
  255. // value: '6',
  256. // }],
  257. // },
  258. {
  259. label: "审核状态",
  260. prop: "status",
  261. width: "80",
  262. overHidden: true,
  263. // search: true,
  264. type: 'select',
  265. dicData: [{
  266. label: '录入',
  267. value: 0,
  268. }, {
  269. label: '提交审核',
  270. value: 1,
  271. }, {
  272. label: '已审核',
  273. value: 3,
  274. }, {
  275. label: '驳回',
  276. value: 4,
  277. }],
  278. },
  279. {
  280. label: "OP",
  281. prop: "operatorName",
  282. width: "80",
  283. overHidden: true,
  284. search: true,
  285. type: 'select',
  286. filterable: true,
  287. dicUrl: "/api/blade-user/userListAll?roleAlias=操作员",
  288. props: {
  289. label: 'realName',
  290. value: 'realName',
  291. },
  292. },
  293. {
  294. label: "客服",
  295. prop: "customerServiceName",
  296. width: "80",
  297. overHidden: true,
  298. search: true,
  299. type: 'select',
  300. filterable: true,
  301. dicUrl: "/api/blade-user/userListAll?roleAlias=客服",
  302. props: {
  303. label: 'realName',
  304. value: 'realName',
  305. },
  306. },
  307. {
  308. label: '订舱日期',
  309. prop: "bookingDate",
  310. width: "100",
  311. overHidden: true,
  312. search: true,
  313. type: "date",
  314. searchProp: "bookingDateList",
  315. unlinkPanels: true,
  316. searchRange: true,
  317. format: "yyyy-MM-dd",
  318. valueFormat: "yyyy-MM-dd HH:mm:ss",
  319. searchDefaultTime: ["00:00:00", "23:59:59"],
  320. },
  321. {
  322. label: '付费方式',
  323. prop: "mpaymode",
  324. width: "100",
  325. overHidden: true,
  326. },
  327. {
  328. label: "运输条款",
  329. prop: "serviceTerms",
  330. width: "80",
  331. overHidden: true,
  332. },
  333. {
  334. label: '件数',
  335. prop: "quantity",
  336. width: "100",
  337. overHidden: true,
  338. },
  339. {
  340. label: '包装',
  341. prop: "packingUnit",
  342. width: "100",
  343. overHidden: true,
  344. },
  345. {
  346. label: '毛重(KGS)',
  347. prop: "grossWeight",
  348. width: "100",
  349. overHidden: true,
  350. },
  351. {
  352. label: '尺码(CBM)',
  353. prop: "measurement",
  354. width: "100",
  355. overHidden: true,
  356. },
  357. {
  358. label: '发货人',
  359. prop: "hshipperDetails",
  360. width: "100",
  361. overHidden: true,
  362. },
  363. {
  364. label: '收货人',
  365. prop: "hconsigneeDetails",
  366. width: "100",
  367. overHidden: true,
  368. },
  369. {
  370. label: '通知人',
  371. prop: "hnotifyDetails",
  372. width: "100",
  373. overHidden: true,
  374. },
  375. {
  376. label: '唛头',
  377. prop: "marks",
  378. width: "100",
  379. overHidden: true,
  380. },
  381. {
  382. label: '货物',
  383. prop: "commodityDescr",
  384. width: "100",
  385. overHidden: true,
  386. },
  387. {
  388. label: '船名',
  389. prop: "vesselCnName",
  390. width: "100",
  391. overHidden: true,
  392. },
  393. {
  394. label: '航次',
  395. prop: "voyageNo",
  396. width: "100",
  397. overHidden: true,
  398. },
  399. {
  400. label: "制单人",
  401. prop: "createUserName",
  402. width: "100",
  403. overHidden: true,
  404. },
  405. {
  406. label: "制单日期",
  407. prop: "createTime",
  408. width: "120",
  409. overHidden: true,
  410. },
  411. {
  412. label: "修改人",
  413. prop: "updateUserName",
  414. width: "100",
  415. overHidden: true
  416. },
  417. {
  418. label: "修改日期",
  419. prop: "updateTime",
  420. width: "120",
  421. overHidden: true,
  422. },
  423. {
  424. label: "备注",
  425. prop: "cyRemarks",
  426. width: "100",
  427. overHidden: true
  428. },
  429. ]
  430. },
  431. data: [],
  432. };
  433. },
  434. components: {
  435. detailsPage
  436. },
  437. async created() {
  438. this.option = await this.getColumnData(this.getColumnName(501), this.optionBack);
  439. },
  440. activated() {
  441. setTimeout(() => {
  442. if (this.$route.query.billId) {
  443. this.isShow = false
  444. }
  445. this.$refs.crud.doLayout();
  446. }, 100);
  447. },
  448. methods: {
  449. handleClick(tab, event) {
  450. // if (this.query.billStatus == 4) {
  451. // this.query.billStatus = null;
  452. // }
  453. this.onLoad(this.page, this.query);
  454. },
  455. addButton() {
  456. this.isShow = false
  457. this.detailData = {
  458. type: 'new'
  459. }
  460. },
  461. copyButton() {
  462. this.isShow = false
  463. this.detailData = {
  464. copyId: this.selectionList[0].id
  465. };
  466. },
  467. rowEdit(row) {
  468. this.detailData = {
  469. id: row.id
  470. };
  471. this.isShow = false
  472. },
  473. // 删除
  474. rowDel(row, index) {
  475. if (row.item == 1) {
  476. return this.$message.error("存在明细不允许删除");
  477. }
  478. this.$confirm("确定将选择数据删除?", {
  479. confirmButtonText: "确定",
  480. cancelButtonText: "取消",
  481. type: "warning"
  482. }).then(() => {
  483. remove({ ids: row.id }).then(res => {
  484. this.onLoad(this.page, this.query);
  485. this.$message.success("成功删除");
  486. })
  487. })
  488. },
  489. searchReset() {
  490. this.query = this.$options.data().query;
  491. this.onLoad(this.page);
  492. },
  493. // 搜索按钮点击
  494. searchChange(params, done) {
  495. this.page.currentPage = 1;
  496. this.onLoad(this.page, this.query);
  497. done();
  498. },
  499. selectionChange(list) {
  500. this.selectionList = list;
  501. },
  502. currentChange(currentPage) {
  503. this.page.currentPage = currentPage;
  504. },
  505. sizeChange(pageSize) {
  506. this.page.pageSize = pageSize;
  507. },
  508. refreshChange() {
  509. this.onLoad(this.page, this.query);
  510. },
  511. onLoad(page, params = {}) {
  512. let obj = {}
  513. obj = {
  514. ...Object.assign(params, this.query),
  515. }
  516. this.loading = true;
  517. getList(page.currentPage, page.pageSize, obj).then(res => {
  518. this.data = res.data.data.records;
  519. this.page.total = res.data.data.total;
  520. this.$nextTick(() => {
  521. this.$refs.crud.doLayout();
  522. this.$refs.crud.dicInit();
  523. });
  524. }).finally(() => {
  525. this.loading = false;
  526. })
  527. },
  528. // 详情的返回列表
  529. goBack() {
  530. // 初始化数据
  531. if (JSON.stringify(this.$route.query) != "{}") {
  532. this.$router.$avueRouter.closeTag();
  533. this.$router.push({
  534. path: "/iosBasicData/businessCenter/customerLetter/index"
  535. });
  536. }
  537. this.detailData = {}
  538. this.isShow = true;
  539. this.onLoad(this.page, this.query);
  540. },
  541. outExport() {
  542. let config = { params: { ...this.query } }
  543. if (config.params) {
  544. for (const propName of Object.keys(config.params)) {
  545. const value = config.params[propName];
  546. if (value !== null && typeof (value) !== "undefined") {
  547. if (value instanceof Array) {
  548. for (const key of Object.keys(value)) {
  549. let params = propName + '[' + key + ']';
  550. config.params[params] = value[key]
  551. }
  552. delete config.params[propName]
  553. }
  554. }
  555. }
  556. }
  557. const routeData = this.$router.resolve({
  558. path: '/api/blade-los/routecost/exportRouteCost', //跳转目标窗口的地址
  559. query: {
  560. ...config.params, //括号内是要传递给新窗口的参数
  561. identification: this.url
  562. }
  563. })
  564. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  565. },
  566. //自定义列保存
  567. async saveColumn(ref, option, optionBack, code) {
  568. /**
  569. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  570. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  571. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  572. */
  573. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  574. if (inSave) {
  575. this.$message.success("保存成功");
  576. //关闭窗口
  577. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  578. this.selectionList = []
  579. this.searchReset()
  580. this.$nextTick(() => {
  581. this.$refs.crud.refreshTable();
  582. this.$refs.crud.dicInit();
  583. });
  584. }
  585. },
  586. //自定义列重置
  587. async resetColumn(ref, option, optionBack, code) {
  588. this[option] = this[optionBack];
  589. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  590. if (inSave) {
  591. this.$message.success("重置成功");
  592. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  593. this.selectionList = []
  594. this.searchReset()
  595. this.$nextTick(() => {
  596. this.$refs.crud.refreshTable();
  597. this.$refs.crud.dicInit();
  598. });
  599. }
  600. },
  601. // 更改表格颜色
  602. headerClassName(tab) {
  603. //颜色间隔
  604. let back = ""
  605. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  606. if (tab.columnIndex % 2 === 0) {
  607. back = "back-one"
  608. } else if (tab.columnIndex % 2 === 1) {
  609. back = "back-two"
  610. }
  611. }
  612. return back;
  613. },
  614. }
  615. }
  616. </script>
  617. <style lang="scss" scoped>
  618. ::v-deep #out-table .back-one {
  619. background: #ecf5ff !important;
  620. text-align: center;
  621. }
  622. ::v-deep #out-table .back-two {
  623. background: #ecf5ff !important;
  624. text-align: center;
  625. }
  626. .pointerClick {
  627. cursor: pointer;
  628. color: #1e9fff;
  629. }
  630. ::v-deep .el-col-md-8 {
  631. width: 24.33333%;
  632. }
  633. </style>