tranManagementShipping.vue 15 KB

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