warehouseManagementLook.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <div class="container">
  3. <el-row>
  4. <el-col :span="20">
  5. <h2 class="bg-left title">查看仓库详情</h2>
  6. </el-col>
  7. <el-col :span="4" class="bg-right">
  8. <el-button
  9. class="bg-bottom"
  10. type="primary"
  11. size="small"
  12. @click="returnWarehouse()"
  13. ><img
  14. width="6"
  15. height="10"
  16. style="vertical-align: bottom; margin-right: 3px"
  17. src="../../../public/img/lujing.png"
  18. alt=""
  19. />返回</el-button
  20. >
  21. </el-col>
  22. </el-row>
  23. <div class="center">
  24. <el-radio-group v-model="warehouseType" @change="warehouseTypechange">
  25. <el-radio label="1">自有库</el-radio>
  26. <el-radio label="2">临时库</el-radio>
  27. </el-radio-group>
  28. <ws-form ref="deptBudgetList" :model="deptBudgetList">
  29. <div class="small-title">基本信息</div>
  30. <!--基本信息-->
  31. <ws-info-table>
  32. <!--仓库名称-->
  33. <ws-form-item
  34. class="warehouseName"
  35. label="仓库名称"
  36. span="1"
  37. prop="warehouseName"
  38. >
  39. <ws-select
  40. v-model="deptBudgetList.warehouseName"
  41. placeholder="请输入仓库名称"
  42. class="typeselect"
  43. @change="selectpackingMethod"
  44. >
  45. <ws-option
  46. v-for="item in packtypeList"
  47. :key="item.constKey"
  48. :label="item.warehouseName"
  49. :value="item.warehouseName"
  50. />
  51. </ws-select>
  52. </ws-form-item>
  53. <!--负责人-->
  54. <ws-form-item label="负责人" span="1" prop="personCharge">
  55. {{ deptBudgetList.personCharge }}
  56. </ws-form-item>
  57. <!--负责人电话-->
  58. <ws-form-item
  59. label="负责人电话"
  60. span="1"
  61. prop="personPhone"
  62. class="readonly"
  63. >
  64. {{ deptBudgetList.personPhone }}
  65. </ws-form-item>
  66. <!--仓库所在地-->
  67. <ws-form-item label="仓库所在地" span="1" prop="warehouseLocation">
  68. {{ deptBudgetList.warehousePrivate
  69. }}{{ deptBudgetList.warehouseCity
  70. }}{{ deptBudgetList.warehouseArea }}
  71. </ws-form-item>
  72. <!--详细地址-->
  73. <ws-form-item
  74. label="详细地址"
  75. span="1"
  76. prop="detailedAddress"
  77. class="readonly"
  78. >
  79. {{ deptBudgetList.detailedAddress }}
  80. </ws-form-item>
  81. <!--总储量(吨)-->
  82. <ws-form-item
  83. v-show="warehouseType == 1"
  84. label="总储量(吨)"
  85. span="1"
  86. prop="totalStorage"
  87. >
  88. {{ totalStorage }}
  89. </ws-form-item>
  90. </ws-info-table>
  91. <div v-for="item in deptBudgetList.warehousePositionInfoList">
  92. <ws-info-table>
  93. <!--仓位编号-->
  94. <ws-form-item
  95. label="仓位编号"
  96. span="1"
  97. prop="binNumber"
  98. class="forlist"
  99. >
  100. {{ item.binNumber }}
  101. </ws-form-item>
  102. <!--最大储量(吨)-->
  103. <ws-form-item
  104. label="最大储量(吨)"
  105. span="1"
  106. prop="maxStorage"
  107. class="forlist"
  108. >
  109. {{ item.maxStorage }}
  110. </ws-form-item>
  111. <!--现有储量-->
  112. <ws-form-item
  113. :label="'现有储量(' + item.nowStorage + '吨)'"
  114. span="1"
  115. prop="detailStorage"
  116. >
  117. {{ item.detailStorage }}
  118. </ws-form-item>
  119. <!--备注(选填)-->
  120. <ws-form-item label="备注(选填)" span="1" prop="remark">
  121. {{ item.remark }}
  122. </ws-form-item>
  123. </ws-info-table>
  124. </div>
  125. <div class="small-title">仓库照片</div>
  126. </ws-form>
  127. </div>
  128. <div style="text-align: right; padding: 10px">
  129. <el-button
  130. class="bg-bottom-up"
  131. type="primary"
  132. size="small"
  133. @click="returnWarehouse()"
  134. >关闭</el-button
  135. >
  136. </div>
  137. </div>
  138. </template>
  139. <script>
  140. import { xiala, billoperatehis, getLook } from '@/model/warehouse/index'
  141. import { downloadFile } from '@/utils/batchDown'
  142. import Pagination from '@/components/Pagination'
  143. import WsUpload from '@/components/WsUpload'
  144. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  145. export default {
  146. name: 'viewSpareMoney',
  147. components: {
  148. WsUpload,
  149. Pagination,
  150. },
  151. watch: {
  152. vesselId(val) {
  153. this.getList()
  154. },
  155. isShow(val) {
  156. this.showType = val
  157. },
  158. },
  159. data() {
  160. return {
  161. //弹出框
  162. dialogViewSpareMoney: false,
  163. dialogApproveFormVisible: false,
  164. // 船舶类型
  165. monetaryKey: null,
  166. // 表格显示数据
  167. tableDate: [],
  168. // 是否显示
  169. showType: true,
  170. // 年
  171. year: '',
  172. deptBudgetTotal: 0,
  173. currentPage: 1,
  174. pageSize: 10,
  175. searchType: 1,
  176. searchKeyWord: '',
  177. contractType: 2,
  178. startDate: null,
  179. endDate: null,
  180. unitList: [],
  181. warehouseType: '1',
  182. // 提交类型
  183. submitType: true,
  184. size: 10,
  185. compId: sessionStorage.getItem('ws-pf_compId'),
  186. deptCircularPage: {},
  187. packtypeList: [],
  188. date: {
  189. year: dayjs().format('YYYY'),
  190. month: dayjs().format('MM'),
  191. },
  192. contractList: [],
  193. deptBudgetList: {},
  194. historyList: [],
  195. pickerBeginDateBefore: {
  196. disabledDate: (time) => {
  197. return time.getTime() > Date.now()
  198. },
  199. },
  200. accessoryTFs: false,
  201. }
  202. },
  203. activated() {
  204. this.selectpackingMethod()
  205. this.showType = this.isShow
  206. this.loaddata()
  207. },
  208. computed: {
  209. totalStorage: function () {
  210. var sum = 0
  211. if (this.deptBudgetList.warehousePositionInfoList) {
  212. for (
  213. var i = 0;
  214. i < this.deptBudgetList.warehousePositionInfoList.length;
  215. i++
  216. ) {
  217. sum += Number(
  218. this.deptBudgetList.warehousePositionInfoList[i].maxStorage
  219. )
  220. }
  221. }
  222. return sum
  223. },
  224. },
  225. methods: {
  226. //返回按钮
  227. returnWarehouse() {
  228. this.$router.push({ path: 'warehouseManagementList' })
  229. this.deptBudgetList = {}
  230. },
  231. warehouseTypechange() {
  232. this.loaddata()
  233. },
  234. dateFormat(fmt, date) {
  235. let ret
  236. const opt = {
  237. 'Y+': date.getFullYear().toString(), // 年
  238. 'm+': (date.getMonth() + 1).toString(), // 月
  239. 'd+': date.getDate().toString(), // 日
  240. 'H+': date.getHours().toString(), // 时
  241. // "M+": date.getMinutes().toString(), // 分
  242. // "S+": date.getSeconds().toString() // 秒
  243. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  244. }
  245. for (let k in opt) {
  246. ret = new RegExp('(' + k + ')').exec(fmt)
  247. if (ret) {
  248. fmt = fmt.replace(
  249. ret[1],
  250. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  251. )
  252. }
  253. }
  254. return fmt
  255. },
  256. handleClose() {
  257. this.accessoryTFs = false
  258. },
  259. handleSizeChange(val) {
  260. console.log(`每页 ${val} 条`)
  261. this.pageSize = val
  262. this.getList()
  263. },
  264. handleCurrentChange(val) {
  265. this.currentPage = val
  266. console.log(`当前页: ${val}`)
  267. this.getList()
  268. },
  269. selectpackingMethod(e) {
  270. console.log(e)
  271. for (var i = 0; i < this.packtypeList.length; i++) {
  272. if (this.packtypeList[i].warehouseName == e) {
  273. this.getLook(this.packtypeList[i].id)
  274. }
  275. }
  276. },
  277. loaddata() {
  278. // 仓库名称
  279. xiala({
  280. compId: sessionStorage.getItem('ws-pf_compId'),
  281. warehouseType: this.warehouseType,
  282. })
  283. .toPromise()
  284. .then((response) => {
  285. this.packtypeList = response
  286. })
  287. },
  288. getLook(compId1) {
  289. getLook({
  290. id: compId1,
  291. })
  292. .toPromise()
  293. .then((response) => {
  294. this.deptBudgetList = response
  295. // console.log(this.deptBudgetList)
  296. })
  297. },
  298. // 关闭 dialog时 处理文件url 初始化upload组件
  299. handleCloe() {
  300. this.dialogViewSpareMoney = false
  301. },
  302. history(row) {
  303. console.log(row)
  304. billoperatehis({ id: row.id })
  305. .toPromise()
  306. .then((response) => {
  307. this.historyList = response
  308. })
  309. },
  310. //删除
  311. approve() {},
  312. listQuery() {},
  313. total() {},
  314. clearfiltQuery() {},
  315. selectCrtDuty() {},
  316. },
  317. }
  318. </script>
  319. <style lang="scss" scoped>
  320. .center {
  321. position: relative;
  322. margin-top: 100px;
  323. top: 30px;
  324. width: 90%;
  325. height: 500px;
  326. margin: 0 auto;
  327. }
  328. .container .bg-left {
  329. padding-left: 40px;
  330. }
  331. .bg-right {
  332. padding: 16px;
  333. text-align: right;
  334. }
  335. .vertical-text-left {
  336. width: 62px;
  337. text-align: right;
  338. }
  339. /deep/.el-form-item {
  340. width: 33.33%;
  341. }
  342. .forlist {
  343. width: 16.67%;
  344. }
  345. //文字基本信息
  346. .center h3 {
  347. margin-left: 42px;
  348. }
  349. //去边框
  350. /deep/.el-form-item {
  351. border-right: 0px;
  352. border-bottom: 0px;
  353. }
  354. /deep/.ws-info-table {
  355. border-left: 0px;
  356. border-top: 0px;
  357. }
  358. .ws-info-table .el-form-item .el-form-item__content {
  359. border-right: 0px;
  360. border-bottom: 0px;
  361. border-left: 0px;
  362. border-top: 0px;
  363. }
  364. /deep/.ws-info-table .el-form-item {
  365. border-right: 0px;
  366. border-bottom: 0px;
  367. border-left: 0px;
  368. border-top: 0px;
  369. }
  370. //背景
  371. /deep/.ws-info-table .el-form-item .el-form-item__content {
  372. background: #f5f7fa;
  373. border-radius: 4px;
  374. border: 1px solid #d8dce6;
  375. font-family: PingFangSC-Regular, PingFang SC;
  376. margin-bottom: 5px;
  377. font-size: 14px;
  378. font-weight: 400;
  379. color: #8890b1;
  380. line-height: 16px;
  381. }
  382. /deep/.ws-info-table .el-form-item .el-form-item__label {
  383. background-color: #fff;
  384. font-size: 14px;
  385. font-family: PingFangSC-Regular, PingFang SC;
  386. font-weight: 400;
  387. color: #8890b1;
  388. line-height: 16px;
  389. }
  390. //多选框
  391. /deep/.el-input__inner {
  392. display: inline-block;
  393. background-color: #fff;
  394. }
  395. /deep/.ws-info-table .warehouseName.el-form-item .el-form-item__content {
  396. background: #fff;
  397. border: none;
  398. }
  399. .title {
  400. position: relative;
  401. }
  402. .title::before {
  403. content: '';
  404. display: inline-block;
  405. width: 5px;
  406. height: 30px;
  407. background: #5473e8;
  408. position: absolute;
  409. left: 0;
  410. }
  411. .ws-info-table {
  412. border-left: 1px solid transparent;
  413. border-top: 1px solid transparent;
  414. }
  415. .el-button--primary {
  416. background-color: #5878e8;
  417. border-color: #5878e8;
  418. }
  419. .el-col {
  420. background: #f6f7fc;
  421. }
  422. .small-title {
  423. position: relative;
  424. padding: 10px;
  425. font-weight: 600;
  426. }
  427. .small-title::before {
  428. position: absolute;
  429. content: '';
  430. display: block;
  431. background: #5473e8;
  432. width: 4px;
  433. height: 14px;
  434. left: 0px;
  435. top: 13px;
  436. }
  437. </style>