tranManagementVehicle.vue 14 KB

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