tranManagementTransporTationFire.vue 18 KB

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