warehouseManagementList.vue 14 KB

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