SbStatusCount.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <div>
  3. <div>
  4. <!-- <div class="search">
  5. <a-input-search
  6. v-info.trim="queryParam.sampleName"
  7. allowClear
  8. enter-button
  9. size="large"
  10. style="width:500px"
  11. placeholder="请输入设备名称"
  12. >
  13. <my-icon slot="addonBefore" :style="{ padding:'5px' }" type="icon-shaixuan" @click="drawerVisible = true"/>
  14. </a-input-search>
  15. <a-drawer
  16. title="筛选"
  17. placement="top"
  18. :closable="false"
  19. :visible="drawerVisible"
  20. @close="drawerClose"
  21. >
  22. <a-form layout="inline">
  23. <a-row :gutter="20">
  24. <a-col :xxl="8" :md="12" :sm="24">
  25. <a-form-item label="样品名称">
  26. <a-input v-model.trim="queryParam.sampleName" placeholder="请输入样品名称"/>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :xxl="8" :md="12" :sm="24">
  30. <a-form-item label="批次号">
  31. <a-input v-model.trim="queryParam.batchNo" placeholder="请输入批次号"/>
  32. </a-form-item>
  33. </a-col>
  34. </a-row>
  35. </a-form>
  36. <div
  37. :style="{
  38. position: 'absolute',
  39. right: 0,
  40. bottom: 0,
  41. width: '100%',
  42. padding: '10px 16px',
  43. textAlign: 'center',
  44. zIndex: 1,
  45. }">
  46. <a-button type="primary" size="large" @click="getInfo">查询</a-button>
  47. <a-button style="margin-left: 88px" size="large" @click="queryParam={}">重置</a-button>
  48. </div>
  49. </a-drawer>
  50. </div> -->
  51. <a-row :gutter="40">
  52. <a-col :span="6">
  53. <div class="">
  54. <div style=" overflow: auto;height: 350px;">
  55. <div
  56. class="one_title_option"
  57. v-for="position in sbPositionData"
  58. :key="position.id"
  59. @click="selectCountByPosition(position)"
  60. v-show="position.type === 1"
  61. :class="parentId==position.id?'opt_one_title_option':''">
  62. <div><my-icon :type="item==1?'icon-lianyouchangqu-white':'icon-lianyouchangqu-copy'" style="font-size:80px; color:#fff;margin-right: 30px;"/></div>
  63. <div>
  64. <div>{{ position.name }}</div>
  65. <div>{{ position.num }}台,总{{ position.childNum }}台</div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </a-col>
  71. <a-col :span="18" class="gutter-box">
  72. <a-row :gutter="[20,20]">
  73. <a-col :span="6" v-for="position in sbPositionData" v-show="position.type === 2 && position.parentId === parentId" :key="position.id" @click="selectCountBySbStatusGroup(position)">
  74. <div class="gutter-btn gutter-color " :class="code==position.code?'opt_option':''">
  75. <div style="font-size:32px">{{ position.name }}</div>
  76. <div style="font-size:16px">3楼</div>
  77. <div style="font-size:28px ;color:#3462FD">{{ position.num }}台</div>
  78. </div>
  79. </a-col>
  80. </a-row>
  81. </a-col>
  82. </a-row>
  83. <div>
  84. <div class="main gutter-color">
  85. <!-- <div class="title">报修数据</div> -->
  86. <div>
  87. <a-descriptions :column="6" bordered>
  88. <a-descriptions-item v-for="item in typeData" :key="item.id" :label="BaseTool.Object.getField(statusMap,item.status)">{{ item.num }}台</a-descriptions-item>
  89. </a-descriptions>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="btn">
  94. </div>
  95. </div>
  96. </div>
  97. </template>
  98. <script>
  99. import {
  100. selectCountByPositionGroup,
  101. selectCountBySbStatusGroup
  102. } from '@/api/sb/count'
  103. export default {
  104. name: 'SbPositionNum',
  105. components: {
  106. },
  107. data () {
  108. return {
  109. confirmLoading: false,
  110. drawerVisible: false,
  111. modalTitle: null,
  112. queryParam: {},
  113. configMap: {},
  114. parentId: null,
  115. code: null,
  116. sbPositionData: [],
  117. statusMap: {},
  118. typeData: [],
  119. factoryStr: null,
  120. form: this.$form.createForm(this),
  121. visible: true,
  122. user: this.$store.getters.userInfo
  123. }
  124. },
  125. props: {
  126. },
  127. created () {
  128. // 下拉框map
  129. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
  130. selectCountByPositionGroup().then(res => {
  131. this.sbPositionData = res.data
  132. this.selectCountByPosition(res.data[0])
  133. })
  134. },
  135. methods: {
  136. drawerClose () {
  137. this.drawerVisible = false
  138. },
  139. base (record) {
  140. this.visible = true
  141. // 如果是空标识添加
  142. if (this.BaseTool.Object.isBlank(record)) {
  143. this.modalTitle = '添加'
  144. this.data = []
  145. }
  146. },
  147. handleCancel (values) {
  148. this.visible = false
  149. this.confirmLoading = false
  150. this.form.resetFields()
  151. if (this.BaseTool.Object.isNotBlank(values)) {
  152. this.$emit('ok', values)
  153. } else {
  154. this.$emit('ok')
  155. }
  156. },
  157. selectCountByPosition (position) {
  158. this.parentId = position.id
  159. this.code = null
  160. this.typeData = []
  161. },
  162. selectCountBySbStatusGroup (position) {
  163. this.code = position.code
  164. selectCountBySbStatusGroup(position).then(res => {
  165. this.typeData = res.data
  166. })
  167. },
  168. jumpSbInfo (type) {
  169. const routeUrl = this.$router.resolve({ path: '/sb/info/company', query: { typeId: type.typeId } })
  170. window.open(routeUrl.href, '_blank')
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="less" scoped>
  176. .search{
  177. width: 100%;
  178. background: #fff;
  179. text-align: center;
  180. padding:10px;
  181. margin-bottom: 20px;
  182. }
  183. .gutter-box{
  184. height: 350px;
  185. overflow: auto;
  186. }
  187. .gutter-color{
  188. background: #fff;
  189. border: 1px solid #DDDDDD;
  190. }
  191. .gutter-btn{
  192. height: 165px;
  193. display: flex;
  194. flex-direction: column;
  195. justify-content: center;
  196. align-items: center;
  197. font-size: 50px;
  198. color:#333;
  199. &:hover{
  200. cursor: pointer;
  201. }
  202. }
  203. .act{
  204. color:#3462FD;
  205. }
  206. .main{
  207. margin-top:30px;
  208. }
  209. .title{
  210. font-size: 28px;
  211. font-family: PingFang SC;
  212. font-weight: 500;
  213. color: #3462FD;
  214. padding:10px 42px;
  215. border-bottom: 1px solid #DDDDDD;
  216. }
  217. .btn{
  218. position: fixed;
  219. bottom: 50px;
  220. width: 100%;
  221. display: flex;
  222. justify-content: center;
  223. }
  224. .center{
  225. display: flex;
  226. justify-content: center;
  227. align-items: center;
  228. }
  229. .opt_option{
  230. background: linear-gradient(-3deg, #cce2f0 0%, #99D1F6 100%);
  231. color:#fff;
  232. }
  233. .one_title_option{
  234. background:#fff;
  235. display: flex;
  236. // width: 100%;
  237. // justify-content: space-between;
  238. align-items: center;
  239. margin-bottom:10px;
  240. font-size: 25px;
  241. font-family: PingFang SC;
  242. color: #333333;
  243. cursor: pointer;
  244. border-radius: 10px;
  245. border: 1px solid #C0BEBE;
  246. padding:17px ;
  247. }
  248. .opt_one_title_option{
  249. background: linear-gradient(-3deg, #99D1F6 0%, #9196F3 100%);
  250. color:#fff;
  251. }
  252. ::-webkit-scrollbar { width: 0; height: 0; color: transparent; }
  253. </style>