warehouseManagementList.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  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 class="table_td" 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 class="table_td" 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 class="table_td" 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 class="table_td" 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. // 提交类型
  220. submitType: true,
  221. size: 10,
  222. spanArr: [],
  223. warehouseName: '',
  224. compId: sessionStorage.getItem('ws-pf_compId'),
  225. deptCircularPage: {},
  226. warehouseList: [],
  227. deptBudgetList: {},
  228. historyList: [],
  229. pickerBeginDateBefore: {
  230. disabledDate: (time) => {
  231. return time.getTime() > Date.now()
  232. },
  233. },
  234. accessoryTFs: false,
  235. }
  236. },
  237. activated() {
  238. //cg.viewBudget
  239. //cg.viewSpareMoney
  240. // this.getVesselData();
  241. this.getList()
  242. this.showType = this.isShow
  243. },
  244. methods: {
  245. //出库
  246. delivery(item) {
  247. this.$router.push({
  248. path: 'warehouseManagementDelivery',
  249. query: {
  250. baseId: item.warehouseId,
  251. positionId: item.binNumberId,
  252. warehouseName: item.warehouseName,
  253. binNumber: item.binNumber,
  254. capacity: item.capacity,
  255. },
  256. })
  257. },
  258. //入库
  259. warehousing(item) {
  260. var free = 0
  261. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  262. free += Number(item.warehouseNumViewList[i].storage)
  263. }
  264. this.$router.push({
  265. path: 'warehouseManagementPut',
  266. query: {
  267. baseId: item.warehouseId,
  268. positionId: item.binNumberId,
  269. warehouseName: item.warehouseName,
  270. binNumber: item.binNumber,
  271. capacity: item.capacity - free,
  272. id: item.id,
  273. },
  274. })
  275. },
  276. getSpanArr(data) {
  277. let that = this
  278. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  279. that.spanArr = []
  280. that.pos = 0
  281. //遍历数据
  282. data.forEach((item, index) => {
  283. //判断是否是第一项
  284. // if (index === 0) {
  285. // this.spanArr.push(1)
  286. // this.pos = 0
  287. // } else {
  288. //不是第一项时,就根据标识去存储
  289. if (data[index].warehouseNumViewList.length > 1) {
  290. // 查找到符合条件的数据时每次要把之前存储的数据+1
  291. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  292. this.spanArr.push(0)
  293. } else {
  294. // 没有符合的数据时,要记住当前的index
  295. this.spanArr.push(1)
  296. this.pos = index
  297. }
  298. // }
  299. })
  300. },
  301. //待完成//传参
  302. nocomplete(row) {
  303. if (row.number > 0) {
  304. this.$router.push({
  305. path: 'warehouseManagementNoComplete',
  306. query: {
  307. baseId: row.warehouseId,
  308. positionId: row.binNumberId,
  309. warehouseName: row.warehouseName,
  310. binNumber: row.binNumber,
  311. },
  312. })
  313. }
  314. },
  315. //记录
  316. record(item) {
  317. this.$router.push({
  318. name: 'warehouseManagementRecord',
  319. query: {
  320. baseId: item.warehouseId,
  321. positionId: item.binNumberId,
  322. warehouseName: item.warehouseName,
  323. },
  324. params: {
  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. })
  398. .toPromise()
  399. .then((response) => {
  400. this.warehouseList = response
  401. })
  402. },
  403. editClick(row) {
  404. var status = ''
  405. if (row.status == '待执行' || row.status == '已完成') {
  406. status = '执行中'
  407. } else if (row.status == '执行中') {
  408. status = '已完成'
  409. }
  410. //cancelButtonClass: "btn-custom-cancel"
  411. this.$confirm(`是否将状态改为${status}`, {
  412. confirmButtonText: '确定',
  413. cancelButtonText: '取消',
  414. type: 'warning',
  415. })
  416. .then(() => {
  417. editstatus({ id: row.id })
  418. .toPromise()
  419. .then((response) => {
  420. this.$notify.success({
  421. title: '成功',
  422. message: '状态修改成功',
  423. })
  424. this.getList()
  425. })
  426. .catch((response) => {
  427. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  428. })
  429. })
  430. .catch(() => {
  431. return false
  432. })
  433. },
  434. selecttaskType(e) {
  435. for (var i = 0; i < this.taskTypeList.length; i++) {
  436. if (this.taskTypeList[i].value == e) {
  437. this.searchType = this.taskTypeList[i].type
  438. }
  439. }
  440. },
  441. fujian(row) {
  442. if (
  443. row.receiveAttachmentPath === null ||
  444. row.receiveAttachmentPath === ''
  445. ) {
  446. EventBus.$emit(
  447. 'warning',
  448. this.$t('system.noticeCircular.NoInformation')
  449. )
  450. } else {
  451. this.accessoryTFs = true
  452. }
  453. this.appendixIdss = row.receiveAttachmentPath
  454. },
  455. handleExamine(row) {
  456. this.$router.push({
  457. name: 'salesContractExamine',
  458. query: { id: row.id },
  459. })
  460. },
  461. // 关闭 dialog时 处理文件url 初始化upload组件
  462. handleCloe() {
  463. this.dialogViewSpareMoney = false
  464. },
  465. history(row) {
  466. billoperatehis({ id: row.id })
  467. .toPromise()
  468. .then((response) => {
  469. this.historyList = response
  470. })
  471. },
  472. find() {
  473. this.currentPage = 1
  474. this.getList()
  475. },
  476. async exportlist() {
  477. const { data } = await export1(
  478. {
  479. compId: sessionStorage.getItem('ws-pf_compId'),
  480. contractType: this.contractType,
  481. currentPage: this.currentPage,
  482. pageSize: this.pageSize,
  483. searchType: this.searchType,
  484. searchKeyWord: this.searchKeyWord,
  485. startDate: this.startDate,
  486. endDate: this.endDate,
  487. },
  488. {},
  489. { responseType: 'blob' }
  490. ).toPromise()
  491. downloadFile({
  492. res: data,
  493. fileName: `${
  494. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  495. }_采购合同`,
  496. type: 'xls',
  497. })
  498. },
  499. },
  500. }
  501. </script>
  502. <style lang="scss" scoped>
  503. .connert {
  504. width: 90%;
  505. margin: 0 auto;
  506. }
  507. .vertical-text-left {
  508. width: 62px;
  509. text-align: right;
  510. }
  511. .el-button--primary {
  512. background-color: #5878e8;
  513. border-color: #5878e8;
  514. }
  515. .el-button--default {
  516. color: #8890b1;
  517. border-color: #e8eaf1;
  518. }
  519. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  520. width: 30px;
  521. margin-left: 0;
  522. border-top-left-radius: 0px;
  523. border-bottom-left-radius: 0px;
  524. }
  525. /deep/.findValue .el-input__inner {
  526. border-top-right-radius: 0px;
  527. border-bottom-right-radius: 0px;
  528. }
  529. .completed.el-button--default {
  530. border-color: #5878e8;
  531. background-color: #f6f7fc;
  532. color: #5878e8;
  533. }
  534. .putstorage.el-button--default,
  535. .deliverystorage.el-button--default {
  536. border-color: #8890b1;
  537. background-color: #fff;
  538. color: #8890b1;
  539. }
  540. /deep/.el-table td,
  541. /deep/.el-table th.is-leaf {
  542. border-right: 1px solid #e9ecf7;
  543. text-align: center;
  544. }
  545. /deep/.el-table tr td:first-child,
  546. /deep/.el-table tr th.is-leaf:first-child {
  547. border-left: 1px solid #e9ecf7;
  548. }
  549. /deep/.el-table .el-table__header .cell,
  550. /deep/.el-table .el-table__body .cell {
  551. -webkit-line-clamp: 10;
  552. max-height: 400px;
  553. }
  554. .record,
  555. .adjustment {
  556. display: inline-block;
  557. color: #5878e8;
  558. padding: 0 4px !important;
  559. position: relative;
  560. }
  561. .record:after {
  562. position: absolute;
  563. content: '';
  564. display: block;
  565. top: 5px;
  566. right: -2px;
  567. width: 1px;
  568. height: 12px;
  569. background: #e9ecf7;
  570. }
  571. </style>