tranManagementReceivingFeedback.vue 18 KB

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