tranManagementShipping.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. //船运调度
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="8">
  5. <template slot="left">
  6. </template>
  7. <!-- 接单开始 -->
  8. <template slot="right">
  9. <span style="width: 142px; display: inline-block;color: #8890B1;">状态:</span>
  10. <ws-select
  11. v-model="searchTypeText"
  12. placeholder=""
  13. class="typeselect"
  14. @change="selecttaskType"
  15. :value="searchType"
  16. >
  17. <ws-option
  18. v-for="item in taskTypeList"
  19. :key="item.value"
  20. :label="item.value"
  21. :value="item.value"
  22. style="color: #8890B1;"
  23. />
  24. </ws-select>
  25. <div>
  26. <span style="display: inline-block; width: 70px; color: #8890b1"
  27. >接单日期:</span
  28. >
  29. </div>
  30. <el-date-picker
  31. v-model="inOutDate"
  32. type="daterange"
  33. align="right"
  34. unlink-panels
  35. range-separator="至"
  36. start-placeholder="开始日期"
  37. end-placeholder="结束日期"
  38. >
  39. </el-date-picker>
  40. <ws-input
  41. v-model="searchKeyWord"
  42. placeholder="可按发货人、收货人、任务编号查找"
  43. clearable
  44. maxlength="500"
  45. type="input"
  46. class="findValue"
  47. ></ws-input>
  48. <ws-button class="find" type="primary" @click="find()"
  49. ><img
  50. width="16"
  51. height="16"
  52. style="
  53. vertical-align: text-top;
  54. position: relative;
  55. top: 0px;
  56. left: -8px;
  57. "
  58. src="../../../public/img/sousuo.png"
  59. alt=""
  60. /></ws-button>
  61. </template>
  62. </BaseHeaderLayout>
  63. <div>
  64. <el-table
  65. class="wenzi"
  66. :data="warehouseList.records"
  67. style="width: 100%;"
  68. height="780"
  69. >
  70. <el-table-column type="index" label="序号" width="80">
  71. </el-table-column>
  72. <el-table-column class="table_td" prop="processNo" label="运输任务编号">
  73. </el-table-column>
  74. <el-table-column class="table_td" prop="goodsName" label="货名">
  75. </el-table-column>
  76. <el-table-column class="table_td" label="重量(吨)" prop="weight">
  77. </el-table-column>
  78. <el-table-column class="table_td" label="发货" prop="send">
  79. </el-table-column>
  80. <el-table-column class="table_td" label="收货" prop="receive">
  81. </el-table-column>
  82. <el-table-column class="table_td" label="运输周期" prop="tranCycle">
  83. <template scope="scope">
  84. {{ scope.row.deliveryDateStart }} ~ {{ scope.row.deliveryDateEnd }}
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="status" label="状态">
  88. <template slot-scope="scope">
  89. <el-popover
  90. placement="left"
  91. :width="285"
  92. trigger="click"
  93. visible-arrow="false"
  94. @show="history(scope.row)"
  95. >
  96. <template>
  97. <span slot="reference">
  98. <span
  99. v-if="scope.row.processStatus == '待执行'"
  100. class="executory"
  101. ></span>
  102. <span
  103. v-if="scope.row.processStatus == '执行中'"
  104. class="inExecution"
  105. ></span>
  106. <span
  107. v-if="scope.row.processStatus == '已完成'"
  108. class="done"
  109. ></span
  110. >{{ scope.row.processStatus }}
  111. </span>
  112. </template>
  113. <div>
  114. <p style="margin-top: 0; padding-left: 10px">历史记录</p>
  115. <div
  116. v-for="(item, index) in historyList"
  117. class="flex"
  118. :key="index"
  119. >
  120. <div class="vertical-text vertical-text-left">
  121. {{ item.updateDate }}
  122. </div>
  123. <div>
  124. <div class="vertical-circle"></div>
  125. <div
  126. v-if="index != historyList.length - 1"
  127. class="vertical-line"
  128. ></div>
  129. </div>
  130. <div class="vertical-text">
  131. {{ item.operateUser }}<br />{{ item.dealMsg }}
  132. </div>
  133. </div>
  134. </div>
  135. </el-popover>
  136. <img
  137. width="17"
  138. height="18"
  139. style="vertical-align: text-top; position: relative; top: -1px"
  140. src="../../../public/img/edit.png"
  141. @click="editClick(scope.row)"
  142. alt=""
  143. />
  144. </template>
  145. </el-table-column>
  146. <el-table-column class="table_td" label="接单时间" prop="createDate">
  147. </el-table-column>
  148. <el-table-column prop="seller" label="操作" width="300">
  149. <template slot-scope="scope">
  150. <div class="record" @click="handleLook(scope.row)">查看</div>
  151. <div class="adjustment" @click="shipping(scope.row)">船次</div>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. <!-- 页数 -->
  156. <el-pagination
  157. @size-change="handleSizeChange"
  158. @current-change="handleCurrentChange"
  159. :current-page="currentPage"
  160. :page-size="deptCircularPage.pageSize"
  161. layout="total, sizes, prev, pager, next, jumper"
  162. :total="deptBudgetTotal"
  163. >
  164. </el-pagination>
  165. </div>
  166. </div>
  167. </template>
  168. <script>
  169. import {shippingList, alsostate } from '@/model/transport/index'
  170. import Pagination from '@/components/Pagination'
  171. import WsUpload from '@/components/WsUpload'
  172. import { EventBus } from 'base-core-lib'
  173. export default {
  174. name: 'viewSpareMoney',
  175. components: {
  176. WsUpload,
  177. Pagination,
  178. },
  179. watch: {
  180. vesselId(val) {
  181. this.getList()
  182. },
  183. isShow(val) {
  184. this.showType = val
  185. },
  186. },
  187. data() {
  188. return {
  189. //弹出框
  190. dialogViewSpareMoney: false,
  191. dialogApproveFormVisible: false,
  192. // 船舶类型
  193. monetaryKey: null,
  194. // 表格显示数据
  195. tableDate: [],
  196. // 是否显示
  197. showType: true,
  198. // 年
  199. year: '',
  200. pickerOptions: {},
  201. value2: '',
  202. deptBudgetTotal: 0,
  203. currentPage: 1,
  204. tranTypeKey: 3,
  205. pageSize: 10,
  206. searchType: 1,
  207. searchTypeText: '执行中',
  208. taskTypeList: [
  209. { value: '执行中', type: 1 },
  210. { value: '已完成', type: 2 },
  211. { value: '全部任务', type: '' },
  212. ],
  213. searchKeyWord: '',
  214. contractType: 2,
  215. inOutDate: [],
  216. // 提交类型
  217. submitType: true,
  218. size: 10,
  219. spanArr: [],
  220. warehouseName: '',
  221. compId: sessionStorage.getItem('ws-pf_compId'),
  222. deptCircularPage: {},
  223. warehouseList: [],
  224. deptBudgetList: {},
  225. historyList: [],
  226. pickerBeginDateBefore: {
  227. disabledDate: (time) => {
  228. return time.getTime() > Date.now()
  229. },
  230. },
  231. accessoryTFs: false,
  232. }
  233. },
  234. activated() {
  235. this.getList()
  236. this.showType = this.isShow
  237. },
  238. methods: {
  239. getList() {
  240. shippingList({
  241. compId: sessionStorage.getItem('ws-pf_compId'),
  242. currentPage: this.currentPage,
  243. pageSize: this.pageSize,
  244. contractType: this.contractType,
  245. tranTypeKey: this.tranTypeKey,
  246. searchType: this.searchType,
  247. startDate: this.startDate,
  248. endDate: this.endDate,
  249. searchKeyWord: this.searchKeyWord,
  250. })
  251. .toPromise()
  252. .then((response) => {
  253. this.warehouseList = response
  254. this.deptCircularPage.currentPage = response.current
  255. this.deptCircularPage.pageSize = response.size
  256. this.deptBudgetTotal = response.total
  257. })
  258. },
  259. delivery(item) {
  260. this.$router.push({
  261. path: 'warehouseManagementDelivery',
  262. query: {
  263. baseId: item.warehouseId,
  264. positionId: item.binNumberId,
  265. warehouseName: item.warehouseName,
  266. binNumber: item.binNumber,
  267. capacity: item.capacity,
  268. },
  269. })
  270. },
  271. getSpanArr(data) {
  272. let that = this
  273. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  274. that.spanArr = []
  275. that.pos = 0
  276. // //遍历数据
  277. data.forEach((item, index) => {
  278. //判断是否是第一项
  279. if (index === 0) {
  280. this.spanArr.push(1)
  281. this.pos = 0
  282. } else {
  283. //不是第一项时,就根据标识去存储
  284. if (data[index].warehouseNumViewList.length > 1) {
  285. 查找到符合条件的数据时每次要把之前存储的数据 + 1
  286. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  287. this.spanArr.push(0)
  288. } else {
  289. // 没有符合的数据时,要记住当前的index
  290. this.spanArr.push(1)
  291. this.pos = index
  292. }
  293. }
  294. })
  295. },
  296. //查看
  297. handleLook(row) {
  298. this.$router.push({
  299. name: 'tshippingDispatchingview',
  300. query: { id: row.id },
  301. })
  302. },
  303. // 派船
  304. shipping(row) {
  305. this.$router.push({
  306. name: 'shippingDispatchingcar',
  307. query: {
  308. id: row.id,
  309. },
  310. })
  311. },
  312. dateFormat(fmt, date) {
  313. let ret
  314. const opt = {
  315. 'Y+': date.getFullYear().toString(), // 年
  316. 'm+': (date.getMonth() + 1).toString(), // 月
  317. 'd+': date.getDate().toString(), // 日
  318. 'H+': date.getHours().toString(), // 时
  319. // "M+": date.getMinutes().toString(), // 分
  320. // "S+": date.getSeconds().toString() // 秒
  321. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  322. }
  323. for (let k in opt) {
  324. ret = new RegExp('(' + k + ')').exec(fmt)
  325. if (ret) {
  326. fmt = fmt.replace(
  327. ret[1],
  328. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  329. )
  330. }
  331. }
  332. return fmt
  333. },
  334. handleClose() {
  335. this.accessoryTFs = false
  336. },
  337. handleSizeChange(val) {
  338. console.log(`每页 ${val} 条`)
  339. this.pageSize = val
  340. this.getList()
  341. },
  342. handleCurrentChange(val) {
  343. this.currentPage = val
  344. console.log(`当前页: ${val}`)
  345. this.getList()
  346. },
  347. editClick(row) {
  348. var status = ''
  349. if (row.processStatus == '待执行' || row.processStatus == '已完成') {
  350. status = '执行中'
  351. } else if (row.processStatus == '执行中') {
  352. status = '已完成'
  353. }
  354. //cancelButtonClass: "btn-custom-cancel"
  355. this.$confirm(`是否将状态改为${status}`, {
  356. confirmButtonText: '确定',
  357. cancelButtonText: '取消',
  358. type: 'warning',
  359. })
  360. .then(() => {
  361. alsostate({ id: row.id })
  362. .toPromise()
  363. .then((response) => {
  364. this.$notify.success({
  365. title: '成功',
  366. message: '状态修改成功',
  367. })
  368. this.getList()
  369. })
  370. .catch((response) => {
  371. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  372. })
  373. })
  374. .catch(() => {
  375. return false
  376. })
  377. },
  378. selecttaskType(e) {
  379. for (var i = 0; i < this.taskTypeList.length; i++) {
  380. if (this.taskTypeList[i].value == e) {
  381. this.searchType = this.taskTypeList[i].type
  382. }
  383. }
  384. },
  385. fujian(row) {
  386. if (
  387. row.receiveAttachmentPath === null ||
  388. row.receiveAttachmentPath === ''
  389. ) {
  390. EventBus.$emit(
  391. 'warning',
  392. this.$t('system.noticeCircular.NoInformation')
  393. )
  394. } else {
  395. this.accessoryTFs = true
  396. }
  397. this.appendixIdss = row.receiveAttachmentPath
  398. },
  399. handleExamine(row) {
  400. this.$router.push({
  401. name: 'salesContractExamine',
  402. query: { id: row.id },
  403. })
  404. },
  405. // 关闭 dialog时 处理文件url 初始化upload组件
  406. handleCloe() {
  407. this.dialogViewSpareMoney = false
  408. },
  409. history(row) {
  410. billoperatehis({ id: row.id })
  411. .toPromise()
  412. .then((response) => {
  413. this.historyList = response
  414. })
  415. },
  416. find() {
  417. if (this.inOutDate.length > 0) {
  418. this.startDate = this.dateFormat('YYYY-mm-dd', this.inOutDate[0])
  419. this.endDate = this.dateFormat('YYYY-mm-dd', this.inOutDate[1])
  420. } else {
  421. this.startDate = ''
  422. this.endDate = ''
  423. }
  424. this.currentPage = 1
  425. this.getList()
  426. },
  427. },
  428. }
  429. </script>
  430. <style lang="scss" scoped>
  431. .connert {
  432. width: 90%;
  433. margin: 0 auto;
  434. }
  435. .vertical-text-left {
  436. width: 62px;
  437. text-align: right;
  438. }
  439. //分页
  440. .el-pagination {
  441. text-align: center;
  442. white-space: nowrap;
  443. padding: 2px 5px;
  444. color: #303133;
  445. font-weight: 700;
  446. margin-bottom: 20px;
  447. }
  448. /deep/.el-pager li.active {
  449. color: #5878e8;
  450. cursor: default;
  451. }
  452. /deep/.el-pager li:hover {
  453. color: #5878e8;
  454. cursor: default;
  455. }
  456. .el-button--primary {
  457. background-color: #5878e8;
  458. border-color: #5878e8;
  459. }
  460. .el-button--default {
  461. color: #8890b1;
  462. border-color: #e8eaf1;
  463. }
  464. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  465. width: 30px;
  466. margin-left: 0;
  467. border-top-left-radius: 0px;
  468. border-bottom-left-radius: 0px;
  469. }
  470. /deep/.findValue .el-input__inner {
  471. border-top-right-radius: 0px;
  472. border-bottom-right-radius: 0px;
  473. }
  474. .completed.el-button--default {
  475. border-color: #5878e8;
  476. background-color: #f6f7fc;
  477. color: #5878e8;
  478. }
  479. .putstorage.el-button--default,
  480. .deliverystorage.el-button--default {
  481. border-color: #8890b1;
  482. background-color: #fff;
  483. color: #8890b1;
  484. }
  485. /deep/.el-table td,
  486. /deep/.el-table th.is-leaf {
  487. border-right: 1px solid #e9ecf7;
  488. text-align: center;
  489. }
  490. /deep/.el-table tr td:first-child,
  491. /deep/.el-table tr th.is-leaf:first-child {
  492. border-left: 1px solid #e9ecf7;
  493. }
  494. .record,
  495. .adjustment {
  496. display: inline-block;
  497. color: #5878e8;
  498. padding: 0 4px !important;
  499. position: relative;
  500. }
  501. .record:after {
  502. position: absolute;
  503. content: '';
  504. display: block;
  505. top: 5px;
  506. right: -2px;
  507. width: 1px;
  508. height: 12px;
  509. background: #e9ecf7;
  510. }
  511. .el-row {
  512. height: 60px;
  513. }
  514. .base_header_layout .grid-content {
  515. margin-top: 80px;
  516. }
  517. .el-input--small .el-input__inner {
  518. margin-left: 20px;
  519. }
  520. .el-range-editor--small.el-input__inner {
  521. height: 32px;
  522. margin: 0 10px;
  523. }
  524. //执行样式
  525. .executory,
  526. .inExecution,
  527. .done {
  528. width: 6px;
  529. height: 6px;
  530. display: inline-block;
  531. border-radius: 50%;
  532. position: relative;
  533. top: -1px;
  534. font-size: 14px;
  535. }
  536. .executory {
  537. background: #ff9f24;
  538. }
  539. .inExecution {
  540. background: #5878e8;
  541. }
  542. .done {
  543. background: #50cad4;
  544. }
  545. .record,
  546. .adjustment {
  547. display: inline-block;
  548. color: #5878e8;
  549. padding: 0 4px !important;
  550. position: relative;
  551. font-size: 14px;
  552. }
  553. .el-select{
  554. width: 30%;
  555. margin-right: 10px;
  556. }
  557. /deep/.typeselect .el-input__inner{
  558. color: #8890B1;
  559. }
  560. </style>