tranManagementShipping.vue 15 KB

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