tranManagementVehicle.vue 15 KB

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