tranManagementShipping.vue 15 KB

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