tranManagementTransporHairRespond.vue 15 KB

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