tranManagementShipping.vue 16 KB

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