baseInfo.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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 { getPageSingle } from '@/api/ledgerAssets';
  77. import { getDetails } from '@/api/classifyManage/itemInformation.js';
  78. export default {
  79. props: {
  80. rowId:{
  81. type:String ,
  82. default:''
  83. },
  84. },
  85. data () {
  86. return {
  87. information:{
  88. extendField:{}
  89. },
  90. activeName:'inUse',
  91. tableData:[],
  92. pagination: {
  93. pageNum: 1,
  94. size: 15
  95. },
  96. total: 0,
  97. searchForm:{
  98. categoryId:this.rowId,
  99. positionType:1
  100. },
  101. countInfo:{}
  102. }
  103. },
  104. created () {
  105. this.getDetilInfo()
  106. this.handleList()
  107. // this.getCountNum()
  108. },
  109. methods:{
  110. getDetilInfo(){
  111. getDetails(this.rowId).then(res=>{
  112. this.information = res
  113. if(res.extendField){
  114. this.$set(this.information, 'extendField', JSON.parse(res.extendField))
  115. }
  116. })
  117. },
  118. tabClick(val){
  119. switch (this.activeName) {
  120. case 'inUse': {
  121. this.searchForm.positionType = 1
  122. break;
  123. }
  124. case 'inLibrary': {
  125. this.searchForm.positionType = 2
  126. break;
  127. }
  128. case 'hasConsume': {
  129. this.searchForm.positionType = 3
  130. break;
  131. }
  132. default:
  133. break;
  134. }
  135. this.handleList()
  136. },
  137. handleCurrent (page) {
  138. this.pagination.pageNum = page
  139. this.handleList()
  140. },
  141. handleSize (size) {
  142. this.pagination.pageNum = 1
  143. this.pagination.size = size
  144. this.handleList()
  145. },
  146. handleList () {
  147. const params = {
  148. ...this.searchForm,
  149. ...this.pagination
  150. }
  151. getPageSingle(params).then(res=>{
  152. this.tableData = res.list
  153. this.total = res.count
  154. })
  155. },
  156. getCountNum(){
  157. const params = {
  158. assetType:'ZHOUMIN',
  159. informationId:this.rowInfo.id
  160. }
  161. getCount(params).then(res=>{
  162. if(res?.success){
  163. this.countInfo = res.data
  164. }
  165. })
  166. }
  167. },
  168. watch:{
  169. // 监听类别id变化
  170. // rowId() {
  171. // this.getDetilInfo()
  172. // }
  173. },
  174. }
  175. </script>
  176. <style lang="scss" scoped>
  177. .baseinfo-container {
  178. background-color: #fff;
  179. padding: 20px;
  180. .content {
  181. padding: 0 20px;
  182. }
  183. .basic-details-title{
  184. font-size: 16px;
  185. margin: 15px 0;
  186. }
  187. .basic-tab{
  188. margin-bottom: 15px;
  189. }
  190. .upload-container {
  191. display: flex;
  192. .img-box {
  193. width: 280px;
  194. height: 342px;
  195. border: 1px solid rgba(215, 215, 215, 1);
  196. display: flex;
  197. justify-content: center;
  198. align-items: center;
  199. img {
  200. max-width: 100%;
  201. }
  202. }
  203. .file-list {
  204. margin-left: 50px;
  205. flex: 1;
  206. display: flex;
  207. justify-content: space-between;
  208. flex-wrap: wrap;
  209. justify-items: baseline;
  210. align-content: flex-start;
  211. .file-box {
  212. width: 30%;
  213. margin-bottom: 20px;
  214. height: 57px;
  215. text-align: center;
  216. line-height: 55px;
  217. border: 1px solid var(--mainColor);
  218. color: var(--mainColor);
  219. cursor: pointer;
  220. &.disabled {
  221. cursor: not-allowed;
  222. border-color: rgba(215, 215, 215, 1);
  223. color: rgba(215, 215, 215, 1);
  224. }
  225. }
  226. }
  227. }
  228. }
  229. </style>