tranManagementReceivingFeedback.vue 17 KB

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