tranManagementReceivingFeedback.vue 18 KB

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