tranManagementTransport.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <!--运输任务-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="20">
  5. <template slot="right">
  6. <ws-button
  7. class="but"
  8. type="primary"
  9. @click="handleAdd()"
  10. v-hasPermission="
  11. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  12. "
  13. >添加</ws-button
  14. >
  15. </template>
  16. <template slot="left">
  17. <ws-button
  18. class="but"
  19. type="primary"
  20. @click="handle()"
  21. v-hasPermission="
  22. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  23. "
  24. >
  25. 执行中</ws-button
  26. >
  27. <ws-button
  28. class="but"
  29. @click="handleLook()"
  30. v-hasPermission="
  31. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  32. "
  33. >已完成</ws-button
  34. >
  35. <ws-button
  36. class="but"
  37. @click="handleEdit()"
  38. v-hasPermission="
  39. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  40. "
  41. >全部任务</ws-button
  42. >
  43. </template>
  44. <template slot="left">
  45. <ws-input
  46. label="起点"
  47. placeholder="请输入起点"
  48. clearable
  49. maxlength="200"
  50. type="input"
  51. class="find"
  52. ></ws-input>
  53. <ws-input
  54. label="终点"
  55. placeholder="请输入终点"
  56. clearable
  57. maxlength="200"
  58. type="input"
  59. class="find"
  60. ></ws-input>
  61. <ws-input
  62. v-model="warehouseName"
  63. placeholder="可按合同编号或运输任务编号查找"
  64. clearable
  65. maxlength="500"
  66. type="input"
  67. class="findValue"
  68. ></ws-input>
  69. <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
  70. <div class="search">
  71. <ws-button
  72. class="find"
  73. type="primary"
  74. @click="lookUp()"
  75. v-hasPermission="
  76. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  77. "
  78. ><img
  79. width="16"
  80. height="16"
  81. style="
  82. vertical-align: text-top;
  83. position: relative;
  84. top: 0px;
  85. left: -8px;
  86. "
  87. src="../../../public/img/sousuo.png"
  88. alt=""
  89. /></ws-button>
  90. </div>
  91. </template>
  92. </BaseHeaderLayout>
  93. <div>
  94. <el-table
  95. class="wenzi"
  96. :data="gainList"
  97. style="width: 100%; margin-top: 20px"
  98. height="780"
  99. >
  100. <el-table-column prop="index" label="序号" width="80">
  101. </el-table-column>
  102. <el-table-column prop=" taskNo" label="运输任务编号" width="80">
  103. </el-table-column>
  104. <el-table-column prop=" contractNo" label="合同编号">
  105. <template slot-scope="scope">
  106. <div
  107. v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
  108. >
  109. {{ scope.row.capacity }}
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column prop=" weight" class="table_td" label="货物(吨数)" >
  114. <!-- <template slot-scope="scope">
  115. <div
  116. style="height: 24px"
  117. v-for="(item, i) in scope.row.warehouseNumViewList"
  118. >
  119. {{ item.inNetWeight }}
  120. </div>
  121. </template> -->
  122. </el-table-column>
  123. <el-table-column class="table_td" label="运输方式">
  124. <!-- <template slot-scope="scope">
  125. <div
  126. style="height: 24px"
  127. v-for="(item, i) in scope.row.warehouseNumViewList"
  128. >
  129. {{ item.outNetWeight }}
  130. </div>
  131. </template> -->
  132. </el-table-column>
  133. <el-table-column prop=" start" class="table_td" label="起点">
  134. <!-- <template slot-scope="scope">
  135. <div
  136. style="height: 24px"
  137. v-for="(item, i) in scope.row.warehouseNumViewList"
  138. >
  139. {{ item.storage }}
  140. </div>
  141. </template> -->
  142. </el-table-column>
  143. <el-table-column prop="currentTransferAddress" class="table_td" label="当前中转">
  144. <!-- <template slot-scope="scope">
  145. <div
  146. style="height: 24px"
  147. v-for="(item, i) in scope.row.warehouseNumViewList"
  148. >
  149. {{ item.storage }}
  150. </div>
  151. </template> -->
  152. </el-table-column>
  153. <el-table-column prop="end" class="table_td" label="终点">
  154. <!-- <template slot-scope="scope"> -->
  155. <!-- <div
  156. style="height: 24px"
  157. v-for="(item, i) in scope.row.warehouseNumViewList"
  158. >
  159. {{ item.storage }}
  160. </div> -->
  161. <!-- </template> -->
  162. </el-table-column>
  163. <el-table-column prop="status" label="状态">
  164. <template slot-scope="scope">
  165. <el-popover
  166. placement="left"
  167. :width="285"
  168. trigger="click"
  169. visible-arrow="false"
  170. @show="history(scope.row)"
  171. >
  172. <template>
  173. <span slot="reference">
  174. <span
  175. v-if="scope.row.status =='待执行'"
  176. class="executory"
  177. ></span>
  178. <span
  179. v-if="scope.row.status == '执行中'"
  180. class="inExecution"
  181. ></span>
  182. <span v-if="scope.row.status == '已完成'" class="done"></span
  183. >{{scope.row.status}}
  184. </span>
  185. </template>
  186. <div>
  187. <p style="margin-top: 0; padding-left: 10px">操作历史</p>
  188. <div v-for="(item, index) in historyList" class="flex">
  189. <div class="vertical-text vertical-text-left">
  190. {{ item.updateDate }}
  191. </div>
  192. <div>
  193. <div class="vertical-circle"></div>
  194. <div
  195. v-if="index != historyList.length - 1"
  196. class="vertical-line"
  197. ></div>
  198. </div>
  199. <div class="vertical-text">
  200. {{ item.operateUser }}<br />{{ item.dealMsg }}
  201. </div>
  202. </div>
  203. </div>
  204. </el-popover>
  205. <img
  206. width="17"
  207. height="18"
  208. style="vertical-align: text-top; position: relative; top: -1px"
  209. src="../../../public/img/edit.png"
  210. @click="editClick(scope.row)"
  211. alt=""
  212. />
  213. </template>
  214. </el-table-column>
  215. <el-table-column prop="seller" label="操作" width="300">
  216. <template slot-scope="scope">
  217. <ws-button
  218. class="completed"
  219. @click="nocomplete(scope.row)"
  220. v-hasPermission="
  221. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  222. "
  223. >
  224. 查看
  225. </ws-button>
  226. <ws-button
  227. class="putstorage"
  228. @click="warehousing(scope.row)"
  229. v-hasPermission="
  230. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  231. "
  232. >
  233. 编辑
  234. </ws-button>
  235. <ws-button
  236. class="deliverystorage"
  237. @click="delivery(scope.row)"
  238. v-hasPermission="
  239. `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
  240. "
  241. >
  242. 删除
  243. </ws-button>
  244. </template>
  245. </el-table-column>
  246. <!-- <el-table-column prop="address" label="操作" width="200">
  247. <template slot-scope="scope">
  248. <div class="record" @click="record(scope.row)">记录</div>
  249. <div class="adjustment" @click="loss(scope.row)">盘损</div>
  250. </template>
  251. </el-table-column> -->
  252. </el-table>
  253. </div>
  254. </div>
  255. </template>
  256. <script>
  257. import {
  258. gain,
  259. } from '@/model/transport/index'
  260. import { downloadFile } from '@/utils/batchDown'
  261. import Pagination from '@/components/Pagination'
  262. import WsUpload from '@/components/WsUpload'
  263. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  264. export default {
  265. name: 'viewSpareMoney',
  266. components: {
  267. WsUpload,
  268. Pagination,
  269. },
  270. watch: {
  271. vesselId(val) {
  272. this.getList()
  273. },
  274. isShow(val) {
  275. this.showType = val
  276. },
  277. },
  278. data() {
  279. return {
  280. //弹出框
  281. dialogViewSpareMoney: false,
  282. dialogApproveFormVisible: false,
  283. // 船舶类型
  284. monetaryKey: null,
  285. // 表格显示数据
  286. tableDate: [],
  287. // 是否显示
  288. showType: true,
  289. // 年
  290. year: '',
  291. gainList:[],
  292. currentPage: 1,
  293. pageSize: 10,
  294. searchType: 1,
  295. searchTypeText: '未完成',
  296. searchKeyWord: '',
  297. contractType: 2,
  298. // 提交类型
  299. submitType: true,
  300. size: 10,
  301. spanArr: [],
  302. warehouseName: '',
  303. compId: sessionStorage.getItem('ws-pf_compId'),
  304. deptCircularPage: {},
  305. historyList: [],
  306. pickerBeginDateBefore: {
  307. disabledDate: (time) => {
  308. return time.getTime() > Date.now()
  309. },
  310. },
  311. accessoryTFs: false,
  312. }
  313. },
  314. activated() {
  315. this.getList()
  316. this.showType = this.isShow
  317. },
  318. methods: {
  319. //添加
  320. add(){
  321. this.$router.push({ path :'tranManagementTransportAdd'})
  322. },
  323. //查找
  324. lookUp(){
  325. this.currentPage= 1
  326. this.getList()
  327. },
  328. getList() {
  329. gain({
  330. compId: sessionStorage.getItem('ws-pf_compId'),
  331. currentPage:this.currentPage,
  332. pageSize:this.pageSize,
  333. searchType:this.searchType,
  334. searchKeyWord:this.searchKeyWord,
  335. })
  336. .toPromise()
  337. .then((response)=>{
  338. this.gainList = response
  339. })
  340. },
  341. //编辑
  342. delivery(item) {
  343. this.$router.push({
  344. path: 'tranManagementTransportEdit',
  345. query: {
  346. baseId: item.warehouseId,
  347. positionId: item.binNumberId,
  348. warehouseName: item.warehouseName,
  349. binNumber: item.binNumber,
  350. capacity: item.capacity,
  351. },
  352. })
  353. },
  354. //查看
  355. warehousing(item) {
  356. var free = 0
  357. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  358. free += Number(item.warehouseNumViewList[i].storage)
  359. }
  360. this.$router.push({
  361. path: 'tranManagementLook',
  362. query: {
  363. baseId: item.warehouseId,
  364. positionId: item.binNumberId,
  365. warehouseName: item.warehouseName,
  366. binNumber: item.binNumber,
  367. capacity:item.capacity - free ,
  368. },
  369. })
  370. },
  371. getSpanArr(data) {
  372. let that = this
  373. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  374. that.spanArr = []
  375. that.pos = 0
  376. //遍历数据
  377. data.forEach((item, index) => {
  378. //判断是否是第一项
  379. // if (index === 0) {
  380. // this.spanArr.push(1)
  381. // this.pos = 0
  382. // } else {
  383. //不是第一项时,就根据标识去存储
  384. if (data[index].warehouseNumViewList.length > 1) {
  385. // 查找到符合条件的数据时每次要把之前存储的数据+1
  386. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  387. this.spanArr.push(0)
  388. } else {
  389. // 没有符合的数据时,要记住当前的index
  390. this.spanArr.push(1)
  391. this.pos = index
  392. }
  393. // }
  394. })
  395. },
  396. //查看//传参
  397. nocomplete(row) {
  398. this.$router.push({
  399. path: 'tranManagementLook',
  400. // query: {
  401. // baseId: row.warehouseId,
  402. // positionId: row.binNumberId,
  403. // warehouseName: row.warehouseName,
  404. // binNumber: row.binNumber,
  405. // },
  406. })
  407. },
  408. //记录
  409. // record(item) {
  410. // this.$router.push({
  411. // name: 'warehouseManagementRecord',
  412. // query: {
  413. // baseId: item.warehouseId,
  414. // positionId: item.binNumberId,
  415. // warehouseName: item.warehouseName,
  416. // },
  417. // params: {
  418. // remark: item.remark,
  419. // binNumber: item.binNumber,
  420. // capacity: item.capacity,
  421. // },
  422. // })
  423. // },
  424. //盘损
  425. // loss(item) {
  426. // this.$router.push({
  427. // path: 'warehouseManagementIoss',
  428. // query: {
  429. // baseId: item.warehouseId,
  430. // positionId: item.binNumberId,
  431. // warehouseName: item.warehouseName,
  432. // binNumber: item.binNumber,
  433. // },
  434. // })
  435. // },
  436. //查看
  437. handleLook() {
  438. this.$router.push({ path: 'tranManagementLook' })
  439. },
  440. //添加
  441. handleAdd() {
  442. this.$router.push({ path: 'tranManagementTransportAdd' })
  443. },
  444. //编辑
  445. handleEdit() {
  446. this.$router.push({ path: 'tranManagementTransportEdit' })
  447. },
  448. dateFormat(fmt, date) {
  449. let ret
  450. const opt = {
  451. 'Y+': date.getFullYear().toString(), // 年
  452. 'm+': (date.getMonth() + 1).toString(), // 月
  453. 'd+': date.getDate().toString(), // 日
  454. 'H+': date.getHours().toString(), // 时
  455. // "M+": date.getMinutes().toString(), // 分
  456. // "S+": date.getSeconds().toString() // 秒
  457. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  458. }
  459. for (let k in opt) {
  460. ret = new RegExp('(' + k + ')').exec(fmt)
  461. if (ret) {
  462. fmt = fmt.replace(
  463. ret[1],
  464. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  465. )
  466. }
  467. }
  468. return fmt
  469. },
  470. handleClose() {
  471. this.accessoryTFs = false
  472. },
  473. handleSizeChange(val) {
  474. console.log(`每页 ${val} 条`)
  475. this.pageSize = val
  476. this.getList()
  477. },
  478. handleCurrentChange(val) {
  479. this.currentPage = val
  480. console.log(`当前页: ${val}`)
  481. this.getList()
  482. },
  483. editClick(row) {
  484. var status = ''
  485. if (row.status == '待执行' || row.status == '已完成') {
  486. status = '执行中'
  487. } else if (row.status == '执行中') {
  488. status = '已完成'
  489. }
  490. //cancelButtonClass: "btn-custom-cancel"
  491. this.$confirm(`是否将状态改为${status}`, {
  492. confirmButtonText: '确定',
  493. cancelButtonText: '取消',
  494. type: 'warning',
  495. })
  496. .then(() => {
  497. editstatus({ id: row.id })
  498. .toPromise()
  499. .then((response) => {
  500. this.$notify.success({
  501. title: '成功',
  502. message: '状态修改成功',
  503. })
  504. this.getList()
  505. })
  506. .catch((response) => {
  507. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  508. })
  509. })
  510. .catch(() => {
  511. return false
  512. })
  513. },
  514. selecttaskType(e) {
  515. for (var i = 0; i < this.taskTypeList.length; i++) {
  516. if (this.taskTypeList[i].value == e) {
  517. this.searchType = this.taskTypeList[i].type
  518. }
  519. }
  520. },
  521. handleExamine(row) {
  522. this.$router.push({
  523. name: 'salesContractExamine',
  524. query: { id: row.id },
  525. })
  526. },
  527. // 关闭 dialog时 处理文件url 初始化upload组件
  528. handleCloe() {
  529. this.dialogViewSpareMoney = false
  530. },
  531. history(row) {
  532. billoperatehis({ id: row.id })
  533. .toPromise()
  534. .then((response) => {
  535. this.historyList = response
  536. })
  537. },
  538. find() {
  539. this.currentPage = 1
  540. this.getList()
  541. },
  542. async exportlist() {
  543. const { data } = await export1(
  544. {
  545. compId: sessionStorage.getItem('ws-pf_compId'),
  546. contractType: this.contractType,
  547. currentPage: this.currentPage,
  548. pageSize: this.pageSize,
  549. searchType: this.searchType,
  550. searchKeyWord: this.searchKeyWord,
  551. startDate: this.startDate,
  552. endDate: this.endDate,
  553. },
  554. {},
  555. { responseType: 'blob' }
  556. ).toPromise()
  557. downloadFile({
  558. res: data,
  559. fileName: `${
  560. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  561. }_采购合同`,
  562. type: 'xls',
  563. })
  564. },
  565. },
  566. }
  567. </script>
  568. <style lang="scss" scoped>
  569. .connert {
  570. width: 90%;
  571. margin: 0 auto;
  572. }
  573. .vertical-text-left {
  574. width: 62px;
  575. text-align: right;
  576. }
  577. .el-button--primary {
  578. background-color: #5878e8;
  579. border-color: #5878e8;
  580. }
  581. .el-button--default {
  582. color: #8890b1;
  583. border-color: #e8eaf1;
  584. }
  585. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  586. width: 30px;
  587. margin-left: 0;
  588. border-top-left-radius: 0px;
  589. border-bottom-left-radius: 0px;
  590. }
  591. /deep/.findValue .el-input__inner {
  592. border-top-right-radius: 0px;
  593. border-bottom-right-radius: 0px;
  594. }
  595. .completed.el-button--default {
  596. border-color: #5878e8;
  597. background-color: #f6f7fc;
  598. color: #5878e8;
  599. }
  600. .putstorage.el-button--default,
  601. .deliverystorage.el-button--default {
  602. border-color: #8890b1;
  603. background-color: #fff;
  604. color: #8890b1;
  605. }
  606. /deep/.el-table td,
  607. /deep/.el-table th.is-leaf {
  608. border-right: 1px solid #e9ecf7;
  609. text-align: center;
  610. }
  611. /deep/.el-table tr td:first-child,
  612. /deep/.el-table tr th.is-leaf:first-child {
  613. border-left: 1px solid #e9ecf7;
  614. }
  615. .record,
  616. .adjustment {
  617. display: inline-block;
  618. color: #5878e8;
  619. padding: 0 4px !important;
  620. position: relative;
  621. }
  622. .record:after {
  623. position: absolute;
  624. content: '';
  625. display: block;
  626. top: 5px;
  627. right: -2px;
  628. width: 1px;
  629. height: 12px;
  630. background: #e9ecf7;
  631. }
  632. .el-row{
  633. height: 150px;
  634. }
  635. .base_header_layout .grid-content{
  636. margin-top: 80px;
  637. }
  638. .but{
  639. margin-top: 150px;
  640. }
  641. .findValue{
  642. width: 50%;
  643. margin-left: 25%;
  644. }
  645. /deep/.el-input--small .el-input__inner{
  646. margin-left: -230px;
  647. width: 300px;
  648. }
  649. .search{
  650. margin-left: -100px;
  651. }
  652. </style>