baseInfo.vue 7.1 KB

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