tranManagementTransporHairRespond.vue 17 KB

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