warehouseManagementPutOut.vue 15 KB

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