warehouseManagementList.vue 15 KB

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