tranManagementVehicle.vue 17 KB

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