tranManagementVehicle.vue 15 KB

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