tranManagementTransporHairRespond.vue 17 KB

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