tranManagementTransporHairRespond.vue 15 KB

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