containerNumber.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <template>
  2. <div>
  3. <el-dialog title="放箱号信息" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
  4. <avue-crud
  5. v-if="dialogVisible"
  6. :option="option"
  7. :table-loading="loading"
  8. :data="data"
  9. ref="crud"
  10. :search.sync="query"
  11. :page.sync="page"
  12. @current-row-change="handleCurrentRowChange"
  13. :header-cell-class-name="headerClassName"
  14. @search-change="searchChange"
  15. @search-reset="searchReset"
  16. @current-change="currentChange"
  17. @size-change="sizeChange"
  18. @on-load="onLoad"
  19. >
  20. </avue-crud>
  21. <span slot="footer" class="dialog-footer">
  22. <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
  23. <el-button type="primary" @click="submit" size="mini">导 入</el-button>
  24. </span>
  25. </el-dialog>
  26. </div>
  27. </template>
  28. <script>
  29. import { getList } from "@/api/boxManagement/containerNumber/index.js";
  30. import { head } from "lodash";
  31. export default {
  32. props: {},
  33. data() {
  34. return {
  35. quotationObj: null,
  36. data: [],
  37. dialogVisible: false,
  38. loading: false,
  39. option: {
  40. height: 500,
  41. calcHeight: 30,
  42. border: true,
  43. index: true,
  44. addBtn: false,
  45. viewBtn: false,
  46. delBtn: false,
  47. editBtn: false,
  48. menu: false,
  49. header: false,
  50. highlightCurrentRow: true,
  51. searchShow: true,
  52. searchIndex: 3,
  53. searchMenuSpan: 6,
  54. headr: false,
  55. column: [
  56. {
  57. label: "箱东",
  58. prop: "boxEastName",
  59. width: 150,
  60. overHidden: true
  61. },
  62. {
  63. label: "系统号",
  64. prop: "sysNo",
  65. width: 100,
  66. overHidden: true
  67. },
  68. {
  69. label: "放箱号",
  70. prop: "containerNumber",
  71. width: 100,
  72. search: true,
  73. overHidden: true
  74. },
  75. {
  76. label: "箱号",
  77. prop: "code",
  78. width: 100,
  79. overHidden: true
  80. },
  81. {
  82. label: "内部放箱号",
  83. prop: "internalContainerNumber",
  84. width: 100,
  85. overHidden: true
  86. },
  87. {
  88. label: "放箱号类型",
  89. prop: "boxClass",
  90. width: 100,
  91. overHidden: true
  92. },
  93. {
  94. label: "来源类型",
  95. prop: "srcType",
  96. width: 100,
  97. overHidden: true
  98. },
  99. {
  100. label: "来源系统号",
  101. prop: "srcNo",
  102. width: 100,
  103. overHidden: true
  104. },
  105. {
  106. label: "来源放箱号",
  107. prop: "srcContainerNumber",
  108. width: 100,
  109. overHidden: true
  110. },
  111. {
  112. label: "箱属",
  113. prop: "boxBelongsTo",
  114. width: 80,
  115. overHidden: true
  116. },
  117. {
  118. label: "代理名称",
  119. prop: "agentName",
  120. width: 90,
  121. overHidden: true
  122. },
  123. {
  124. label: "起运港提/送箱场站",
  125. prop: "polStationCname",
  126. width: 140,
  127. overHidden: true
  128. },
  129. {
  130. label: "目的港提/还箱场站",
  131. prop: "podStationCname",
  132. width: 140,
  133. overHidden: true
  134. },
  135. {
  136. label: "起运港",
  137. prop: "polCname",
  138. width: 90,
  139. search: true,
  140. type: "select",
  141. filterable: true,
  142. remote: true,
  143. dicUrl: "/api/blade-los/bports/list?status=0&size=5&current=1&cnName={{key}}",
  144. props: {
  145. label: "cnName",
  146. value: "cnName",
  147. desc: "code",
  148. res: "data.records"
  149. },
  150. overHidden: true
  151. },
  152. {
  153. label: "目的港",
  154. prop: "podCname",
  155. width: 90,
  156. search: true,
  157. type: "select",
  158. filterable: true,
  159. remote: true,
  160. dicUrl: "/api/blade-los/bports/list?status=0&size=5&current=1&code={{key}}",
  161. props: {
  162. label: "code",
  163. value: "code",
  164. desc: "code",
  165. res: "data.records"
  166. },
  167. overHidden: true
  168. },
  169. {
  170. label: "箱型",
  171. prop: "boxType",
  172. width: 80,
  173. overHidden: true
  174. },
  175. {
  176. label: "可用箱量",
  177. prop: "remainingNum",
  178. width: 100,
  179. overHidden: true
  180. },
  181. {
  182. label: "操作占用",
  183. prop: "occupyNum",
  184. width: 100,
  185. overHidden: true
  186. },
  187. {
  188. label: "场地盘存",
  189. prop: "storageNum",
  190. width: 100,
  191. overHidden: true
  192. },
  193. {
  194. label: "内部放箱号类型",
  195. prop: "internalBoxClass",
  196. width: 120,
  197. overHidden: true
  198. },
  199. {
  200. label: "箱况",
  201. prop: "boxCondition",
  202. width: 80,
  203. overHidden: true
  204. },
  205. {
  206. label: "有效日期起",
  207. prop: "effectiveStartDate",
  208. type: "date",
  209. format: "yyyy-MM-dd",
  210. valueFormat: "yyyy-MM-dd HH:mm:ss",
  211. width: 100,
  212. overHidden: true
  213. },
  214. {
  215. label: "有效日期止",
  216. prop: "effectiveEndDate",
  217. type: "date",
  218. format: "yyyy-MM-dd",
  219. valueFormat: "yyyy-MM-dd HH:mm:ss",
  220. width: 100,
  221. overHidden: true
  222. },
  223. {
  224. label: "舱位类型",
  225. prop: "cabinType",
  226. width: 100,
  227. overHidden: true
  228. },
  229. {
  230. label: "舱位数",
  231. prop: "shippingSpaceNumber",
  232. width: 90,
  233. overHidden: true
  234. },
  235. {
  236. label: "航线",
  237. prop: "airlineCname",
  238. width: 100,
  239. overHidden: true
  240. },
  241. {
  242. label: "是否合营舱位",
  243. prop: "whetherJointVentureCabin",
  244. width: 100,
  245. overHidden: true
  246. },
  247. {
  248. label: "LOLO-POL",
  249. prop: "loloPol",
  250. width: 90,
  251. overHidden: true
  252. },
  253. {
  254. label: "LOLO-POD",
  255. prop: "loloPod",
  256. width: 90,
  257. overHidden: true
  258. },
  259. {
  260. label: "目的港场站地址",
  261. prop: "podCyAddress",
  262. width: 120,
  263. overHidden: true
  264. },
  265. {
  266. label: "目的港场站联系人",
  267. prop: "podCyContact",
  268. width: 120,
  269. overHidden: true
  270. },
  271. {
  272. label: "目的港场站邮箱",
  273. prop: "podCyEmail",
  274. width: 120,
  275. overHidden: true
  276. },
  277. {
  278. label: "目的港场站电话",
  279. prop: "podCyTel",
  280. width: 120,
  281. overHidden: true
  282. }
  283. ]
  284. },
  285. query: {},
  286. page: {
  287. pageSize: 10,
  288. currentPage: 1,
  289. total: 0
  290. }
  291. };
  292. },
  293. async created() {
  294. // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
  295. },
  296. methods: {
  297. currentChange(currentPage) {
  298. this.page.currentPage = currentPage;
  299. },
  300. sizeChange(pageSize) {
  301. this.page.pageSize = pageSize;
  302. },
  303. searchReset() {
  304. this.query = this.$options.data().query;
  305. this.onLoad(this.page);
  306. },
  307. // 搜索按钮点击
  308. searchChange(params, done) {
  309. this.page.currentPage = 1;
  310. this.onLoad(this.page, this.query);
  311. done();
  312. },
  313. onLoad(page, params = {}) {
  314. let obj = {};
  315. obj = {
  316. ...Object.assign(params, this.query),
  317. whetherDeactivate:0
  318. };
  319. if (obj.effectiveDateList && obj.effectiveDateList.length > 0) {
  320. obj.effectiveStartDate = obj.effectiveDateList[0];
  321. obj.effectiveEndDate = obj.effectiveDateList[1];
  322. }
  323. this.loading = true;
  324. getList(page.currentPage, page.pageSize, obj)
  325. .then(res => {
  326. this.data = res.data.data.records;
  327. this.page.total = res.data.data.total;
  328. this.$nextTick(() => {
  329. this.$refs.crud.doLayout();
  330. this.$refs.crud.dicInit();
  331. });
  332. })
  333. .finally(() => {
  334. this.loading = false;
  335. });
  336. },
  337. openDialog(val, form) {
  338. this.dialogVisible = true;
  339. this.quotationObj = null;
  340. this.query = {};
  341. // this.query.containerNumber = val;
  342. },
  343. handleCurrentRowChange(val) {
  344. this.quotationObj = val;
  345. },
  346. submit() {
  347. if (!this.quotationObj) {
  348. return this.$message.error("请选择数据");
  349. }
  350. let obj = {
  351. polId: this.quotationObj.polId,
  352. polCode: this.quotationObj.polCode,
  353. polEname: this.quotationObj.polEname,
  354. polCname: this.quotationObj.polCname,
  355. polStationId: this.quotationObj.polStationId,
  356. polStationCode: this.quotationObj.polStationCode,
  357. polStationCname: this.quotationObj.polStationCname,
  358. polStationEname: this.quotationObj.polCnpolStationEnameame,
  359. boxTypeQuantityOne: this.quotationObj.boxType,
  360. boxNumber: this.quotationObj.remainingNum,
  361. containerNumber: this.quotationObj.containerNumber
  362. };
  363. this.$emit("importData", obj);
  364. this.dialogVisible = false;
  365. },
  366. //自定义列保存
  367. async saveColumn(ref, option, optionBack, code) {
  368. /**
  369. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  370. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  371. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  372. */
  373. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  374. if (inSave) {
  375. this.$message.success("保存成功");
  376. //关闭窗口
  377. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  378. this.searchReset();
  379. }
  380. },
  381. //自定义列重置
  382. async resetColumn(ref, option, optionBack, code) {
  383. this[option] = this[optionBack];
  384. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  385. if (inSave) {
  386. this.$message.success("重置成功");
  387. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  388. }
  389. },
  390. // 更改表格颜色
  391. headerClassName(tab) {
  392. //颜色间隔
  393. let back = "";
  394. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  395. if (tab.columnIndex % 2 === 0) {
  396. back = "back-one";
  397. } else if (tab.columnIndex % 2 === 1) {
  398. back = "back-two";
  399. }
  400. }
  401. return back;
  402. }
  403. }
  404. };
  405. </script>
  406. <style scoped>
  407. ::v-deep#out-table .back-one {
  408. background: #ecf5ff !important;
  409. text-align: center;
  410. padding: 4px 0;
  411. }
  412. ::v-deep#out-table .back-two {
  413. background: #ecf5ff !important;
  414. text-align: center;
  415. padding: 4px 0;
  416. }
  417. </style>