tranManagementReceivingFeedback.vue 16 KB

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