tranManagementTransporTationFire.vue 15 KB

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