baseInfo.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <div class="baseinfo-container">
  3. <div class="basic-details-title border-none">
  4. <span class="border-span">基本信息</span>
  5. </div>
  6. <el-descriptions title="" :column="4" size="medium" border>
  7. <el-descriptions-item>
  8. <template slot="label"> 类别编码 </template>
  9. {{ information.code }}
  10. </el-descriptions-item>
  11. <el-descriptions-item>
  12. <template slot="label"> 舟皿名称 </template>
  13. {{ information.name }}
  14. </el-descriptions-item>
  15. <el-descriptions-item>
  16. <template slot="label"> 型号</template>
  17. {{ information.modelType }}
  18. </el-descriptions-item>
  19. <el-descriptions-item>
  20. <template slot="label"> 规格 </template>
  21. {{ information.specification }}
  22. </el-descriptions-item>
  23. <el-descriptions-item :span="2">
  24. <template slot="label"> 分类 </template>
  25. {{information.categoryLevelPath}}
  26. </el-descriptions-item>
  27. <el-descriptions-item>
  28. <template slot="label"> 长/宽/高(mm) </template>
  29. {{information.extendField.length}}/{{information.extendField.width}}/{{information.extendField.high}}
  30. </el-descriptions-item>
  31. <el-descriptions-item>
  32. <template slot="label"> 计量单位</template>
  33. {{information.measuringUnit}}
  34. </el-descriptions-item>
  35. </el-descriptions>
  36. <div class="basic-details-title border-none">
  37. <span class="border-span">舟皿明细</span>
  38. </div>
  39. <div>
  40. <el-tabs v-model="activeName" type="card" @tab-click="tabClick" class="basic-tab">
  41. <el-tab-pane :label="`在用(${countInfo.inUseSum?countInfo.inUseSum:'0'})`" name="inUse" >
  42. </el-tab-pane>
  43. <el-tab-pane :label="`在库(${countInfo.inLibrarySum?countInfo.inLibrarySum:'0'})`" name="inLibrary">
  44. </el-tab-pane>
  45. <el-tab-pane :label="`消耗(${countInfo.consumeSum?countInfo.consumeSum:'0'})`" name="hasConsume">
  46. </el-tab-pane>
  47. </el-tabs>
  48. <el-table :data="tableData" class="table-box"
  49. :header-cell-style="{ background: '#F0F3F3', border: 'none'}"
  50. >
  51. <el-table-column type="index" label="序号" width="100"> </el-table-column>
  52. <el-table-column prop="code" label="编码" > </el-table-column>
  53. <el-table-column prop="name" label="名称" > </el-table-column>
  54. <el-table-column prop="inCode" label="入库单号" v-if="activeName=='inLibrary'"> </el-table-column>
  55. <el-table-column prop="inTime" label="入库时间" v-if="activeName=='inLibrary'"> </el-table-column>
  56. <el-table-column prop="outCode" label="出库单号" v-if="activeName!='inLibrary'"> </el-table-column>
  57. <el-table-column prop="outTime" label="出库时间" v-if="activeName!='inLibrary'"> </el-table-column>
  58. </el-table>
  59. <div class="pagination">
  60. <el-pagination
  61. background
  62. layout="total, sizes, prev, pager, next, jumper"
  63. :total="total"
  64. :page-sizes="[15, 30, 50, 100, 500]"
  65. :page-size="pagination.size"
  66. :current-page.sync="pagination.pageNum"
  67. @current-change="handleCurrent"
  68. @size-change="handleSize"
  69. >
  70. </el-pagination>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import {
  77. getCategoryInfo,
  78. getPageSingle
  79. } from '@/api/ledgerAssets/boat.js';
  80. export default {
  81. props: {
  82. rowId:{
  83. type:String ,
  84. default:''
  85. },
  86. },
  87. data () {
  88. return {
  89. information:{
  90. extendField:{}
  91. },
  92. activeName:'inUse',
  93. tableData:[],
  94. pagination: {
  95. pageNum: 1,
  96. size: 15
  97. },
  98. total: 0,
  99. searchForm:{
  100. categoryId:this.rowId,
  101. positionType:1
  102. },
  103. countInfo:{}
  104. }
  105. },
  106. created () {
  107. this.getDetilInfo()
  108. this.handleList()
  109. // this.getCountNum()
  110. },
  111. methods:{
  112. getDetilInfo(){
  113. getCategoryInfo(this.rowId).then(res=>{
  114. this.information = res.data
  115. if(res.data.extendField){
  116. this.$set(this.information, 'extendField', JSON.parse(res.data.extendField))
  117. }
  118. })
  119. },
  120. tabClick(val){
  121. switch (this.activeName) {
  122. case 'inUse': {
  123. this.searchForm.positionType = 1
  124. break;
  125. }
  126. case 'inLibrary': {
  127. this.searchForm.positionType = 2
  128. break;
  129. }
  130. case 'hasConsume': {
  131. this.searchForm.positionType = 3
  132. break;
  133. }
  134. default:
  135. break;
  136. }
  137. this.handleList()
  138. },
  139. handleCurrent (page) {
  140. this.pagination.pageNum = page
  141. this.handleList()
  142. },
  143. handleSize (size) {
  144. this.pagination.pageNum = 1
  145. this.pagination.size = size
  146. this.handleList()
  147. },
  148. handleList () {
  149. const params = {
  150. ...this.searchForm,
  151. ...this.pagination
  152. }
  153. getPageSingle(params).then(res=>{
  154. this.tableData = res.list
  155. this.total = res.count
  156. })
  157. },
  158. getCountNum(){
  159. const params = {
  160. assetType:'ZHOUMIN',
  161. informationId:this.rowInfo.id
  162. }
  163. getCount(params).then(res=>{
  164. if(res?.success){
  165. this.countInfo = res.data
  166. }
  167. })
  168. }
  169. },
  170. watch:{
  171. // 监听类别id变化
  172. // rowId() {
  173. // this.getDetilInfo()
  174. // }
  175. },
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .baseinfo-container {
  180. background-color: #fff;
  181. padding: 20px;
  182. .content {
  183. padding: 0 20px;
  184. }
  185. .basic-details-title{
  186. font-size: 16px;
  187. margin: 15px 0;
  188. }
  189. .basic-tab{
  190. margin-bottom: 15px;
  191. }
  192. .upload-container {
  193. display: flex;
  194. .img-box {
  195. width: 280px;
  196. height: 342px;
  197. border: 1px solid rgba(215, 215, 215, 1);
  198. display: flex;
  199. justify-content: center;
  200. align-items: center;
  201. img {
  202. max-width: 100%;
  203. }
  204. }
  205. .file-list {
  206. margin-left: 50px;
  207. flex: 1;
  208. display: flex;
  209. justify-content: space-between;
  210. flex-wrap: wrap;
  211. justify-items: baseline;
  212. align-content: flex-start;
  213. .file-box {
  214. width: 30%;
  215. margin-bottom: 20px;
  216. height: 57px;
  217. text-align: center;
  218. line-height: 55px;
  219. border: 1px solid var(--mainColor);
  220. color: var(--mainColor);
  221. cursor: pointer;
  222. &.disabled {
  223. cursor: not-allowed;
  224. border-color: rgba(215, 215, 215, 1);
  225. color: rgba(215, 215, 215, 1);
  226. }
  227. }
  228. }
  229. }
  230. }
  231. </style>