warehouseManagementPutOut.vue 16 KB

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