tranManagementTransporHairRespond.vue 13 KB

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