tranManagementTransporHairRespond.vue 15 KB

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