tranManagementShipping.vue 15 KB

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