tranManagementTransporHairRespond.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  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. ],
  256. // 提交类型
  257. submitType: true,
  258. size: 10,
  259. primary: '1',
  260. spanArr: [],
  261. inOutDate: [],
  262. warehouseName: '',
  263. compId: sessionStorage.getItem('ws-pf_compId'),
  264. deptCircularPage: {},
  265. tranManagementList: [],
  266. deptBudgetList: {},
  267. historyList: [],
  268. pickerBeginDateBefore: {
  269. disabledDate: (time) => {
  270. return time.getTime() > Date.now()
  271. },
  272. },
  273. accessoryTFs: false,
  274. }
  275. },
  276. activated() {
  277. this.getList()
  278. this.showType = this.isShow
  279. },
  280. methods: {
  281. getSpanArr(data) {
  282. let that = this
  283. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  284. that.spanArr = []
  285. that.pos = 0
  286. //遍历数据
  287. data.forEach((item, index) => {
  288. //判断是否是第一项
  289. // if (index === 0) {
  290. // this.spanArr.push(1)
  291. // this.pos = 0
  292. // } else {
  293. //不是第一项时,就根据标识去存储
  294. if (data[index].warehouseNumViewList.length > 1) {
  295. // 查找到符合条件的数据时每次要把之前存储的数据+1
  296. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  297. this.spanArr.push(0)
  298. } else {
  299. // 没有符合的数据时,要记住当前的index
  300. this.spanArr.push(1)
  301. this.pos = index
  302. }
  303. // }
  304. })
  305. },
  306. //查看
  307. trainSee(row) {
  308. if (row.tranType == '汽运') {
  309. this.$router.push({
  310. path: 'tranManagementTransporFeedbackLook',
  311. query: {
  312. id: row.id,
  313. },
  314. })
  315. } else if (row.tranType == '火运') {
  316. this.$router.push({
  317. path: 'tranManagementFireFeedbackLook',
  318. query: {
  319. id: row.id,
  320. },
  321. })
  322. } else if (row.tranType == '船运') {
  323. this.$router.push({
  324. path: 'tranManagementShippingFeedbackLook',
  325. query: {
  326. id: row.id,
  327. },
  328. })
  329. }
  330. },
  331. //反馈
  332. feedback(row) {
  333. if (row.tranType == '汽运') {
  334. this.$router.push({
  335. path: 'tranManagementTransporFeedback',
  336. query: {
  337. id: row.id,
  338. },
  339. })
  340. } else if (row.tranType == '火运') {
  341. this.$router.push({
  342. path: 'tranManagementFireFeedback',
  343. query: {
  344. id: row.id,
  345. },
  346. })
  347. } else if (row.tranType == '船运') {
  348. this.$router.push({
  349. path: 'tranManagementShippingFeedback',
  350. query: {
  351. id: row.id,
  352. },
  353. })
  354. }
  355. },
  356. // statusquery(status) {
  357. // if (status == 1) {
  358. // this.primary = 1
  359. // } else if (status == 2) {
  360. // this.primary = 2
  361. // } else {
  362. // this.primary = 3
  363. // }
  364. // this.feedbackFlag = status
  365. // this.getList()
  366. // },
  367. dateFormat(fmt, date) {
  368. let ret
  369. const opt = {
  370. 'Y+': date.getFullYear().toString(), // 年
  371. 'm+': (date.getMonth() + 1).toString(), // 月
  372. 'd+': date.getDate().toString(), // 日
  373. 'H+': date.getHours().toString(), // 时
  374. // "M+": date.getMinutes().toString(), // 分
  375. // "S+": date.getSeconds().toString() // 秒
  376. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  377. }
  378. for (let k in opt) {
  379. ret = new RegExp('(' + k + ')').exec(fmt)
  380. if (ret) {
  381. fmt = fmt.replace(
  382. ret[1],
  383. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  384. )
  385. }
  386. }
  387. return fmt
  388. },
  389. handleClose() {
  390. this.accessoryTFs = false
  391. },
  392. handleSizeChange(val) {
  393. console.log(`每页 ${val} 条`)
  394. this.pageSize = val
  395. this.getList()
  396. },
  397. handleCurrentChange(val) {
  398. this.currentPage = val
  399. console.log(`当前页: ${val}`)
  400. this.getList()
  401. },
  402. getList() {
  403. automobileList({
  404. compId: sessionStorage.getItem('ws-pf_compId'),
  405. feedbackFlag: this.feedbackFlag,
  406. tranTypeKey:this.tranTypeKey,
  407. currentPage: this.currentPage,
  408. pageSize: this.pageSize,
  409. startDate: this.startDate,
  410. endDate: this.endDate,
  411. searchKeyWord: this.searchKeyWord,
  412. })
  413. .toPromise()
  414. .then((response) => {
  415. this.deptCircularPage.currentPage = response.current
  416. this.deptCircularPage.pageSize = response.size
  417. this.deptBudgetTotal = response.total
  418. this.tranManagementList = response
  419. })
  420. },
  421. editClick(row) {
  422. var feedbackStatus = ''
  423. if (row.feedbackStatus == '待执行' || row.feedbackStatus == '已完货') {
  424. feedbackStatus = '执行中'
  425. } else if (row.feedbackStatus == '执行中') {
  426. feedbackStatus = '已完货'
  427. }
  428. //cancelButtonClass: "btn-custom-cancel"
  429. this.$confirm(`是否将状态改为${feedbackStatus}`, {
  430. confirmButtonText: '确定',
  431. cancelButtonText: '取消',
  432. type: 'warning',
  433. })
  434. .then(() => {
  435. state({
  436. id: row.id,
  437. })
  438. .toPromise()
  439. .then((response) => {
  440. this.$notify.success({
  441. title: '成功',
  442. message: '状态修改成功',
  443. })
  444. this.getList()
  445. })
  446. .catch((response) => {
  447. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  448. })
  449. })
  450. .catch(() => {
  451. return false
  452. })
  453. },
  454. selecttaskType(e) {
  455. for (var i = 0; i < this.taskTypeList.length; i++) {
  456. if (this.taskTypeList[i].value == e) {
  457. this.feedbackFlag = this.taskTypeList[i].type
  458. }
  459. }
  460. this.getList()
  461. },
  462. selecttranType(e) {
  463. for (var i = 0; i < this.tranTypeList.length; i++) {
  464. if (this.tranTypeList[i].value == e) {
  465. this.tranTypeKey = this.tranTypeList[i].type
  466. }
  467. }
  468. this.getList()
  469. },
  470. find() {
  471. if (this.inOutDate != null) {
  472. if (this.inOutDate.length > 0) {
  473. this.startDate = this.dateFormat('YYYY-mm-dd', this.inOutDate[0])
  474. this.endDate = this.dateFormat('YYYY-mm-dd', this.inOutDate[1])
  475. } else {
  476. this.startDate = ''
  477. this.endDate = ''
  478. }
  479. } else {
  480. this.startDate = ''
  481. this.endDate = ''
  482. }
  483. this.currentPage = 1
  484. this.getList()
  485. },
  486. },
  487. }
  488. </script>
  489. <style lang="scss" scoped>
  490. .container {
  491. width: 100%;
  492. margin: 0 auto;
  493. }
  494. .vertical-text-left {
  495. width: 62px;
  496. text-align: right;
  497. }
  498. .el-button--primary {
  499. background-color: #5878e8;
  500. border-color: #5878e8;
  501. }
  502. .el-button--default {
  503. color: #8890b1;
  504. border-color: #e8eaf1;
  505. }
  506. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  507. width: 30px;
  508. margin-left: 0;
  509. border-top-left-radius: 0px;
  510. border-bottom-left-radius: 0px;
  511. }
  512. /deep/.findValue .el-input__inner {
  513. border-top-right-radius: 0px;
  514. border-bottom-right-radius: 0px;
  515. }
  516. //操作按钮
  517. .record,
  518. .record1,
  519. .adjustment {
  520. display: inline-block;
  521. color: #5878e8;
  522. padding: 0 4px !important;
  523. position: relative;
  524. font-size: 14px;
  525. }
  526. .record:after {
  527. position: absolute;
  528. content: '';
  529. display: block;
  530. top: 5px;
  531. right: -2px;
  532. width: 1px;
  533. height: 12px;
  534. background: #e9ecf7;
  535. }
  536. //状态样式
  537. .executory,
  538. .inExecution,
  539. .done {
  540. width: 6px;
  541. height: 6px;
  542. display: inline-block;
  543. border-radius: 50%;
  544. position: relative;
  545. top: -1px;
  546. font-size: 14px;
  547. }
  548. .executory {
  549. background: #ff9f24;
  550. }
  551. .inExecution {
  552. background: #5878e8;
  553. }
  554. .done {
  555. background: #50cad4;
  556. }
  557. .putstorage.el-button--default,
  558. .deliverystorage.el-button--default {
  559. border-color: #8890b1;
  560. background-color: #fff;
  561. color: #8890b1;
  562. }
  563. /deep/.el-table td,
  564. /deep/.el-table th.is-leaf {
  565. border-right: 1px solid #e9ecf7;
  566. text-align: center;
  567. }
  568. /deep/.el-table tr td:first-child,
  569. /deep/.el-table tr th.is-leaf:first-child {
  570. border-left: 1px solid #e9ecf7;
  571. }
  572. .base_header_layout .grid-content {
  573. margin-top: 80px;
  574. }
  575. .el-input--small .el-input__inner {
  576. margin-left: 20px;
  577. }
  578. .el-range-editor--small.el-input__inner {
  579. height: 32px;
  580. margin: 0 10px;
  581. }
  582. /deep/.el-pagination {
  583. text-align: center;
  584. white-space: nowrap;
  585. padding: 2px 5px;
  586. color: #303133;
  587. font-weight: 700;
  588. margin-bottom: 20px;
  589. }
  590. .el-select {
  591. width: 30%;
  592. margin-right: 10px;
  593. }
  594. /deep/.typeselect .el-input__inner {
  595. color: #8890b1;
  596. }
  597. </style>