tranManagementTransporHairRespond.vue 13 KB

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