SbPositionNum.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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="selectCountByUseTypeGroup(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(useTypeMap,item.useType)">{{ 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. selectCountByUseTypeGroup
  102. } from '@/api/sb/count'
  103. export default {
  104. data () {
  105. return {
  106. value: 1,
  107. drawerVisible: false,
  108. queryParam: {},
  109. radioStyle: {
  110. display: 'flex',
  111. // flexDirection: 'column',
  112. alignItems: 'center',
  113. height: '60px',
  114. fontSize: '25px',
  115. lineHeight: '60px'
  116. },
  117. confirmLoading: false,
  118. modalTitle: null,
  119. configMap: {},
  120. parentId: null,
  121. code: null,
  122. sbPositionData: [],
  123. useTypeMap: {},
  124. typeData: [],
  125. factoryStr: null,
  126. form: this.$form.createForm(this),
  127. visible: true,
  128. user: this.$store.getters.userInfo
  129. }
  130. },
  131. created () {
  132. // 下拉框map
  133. this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
  134. selectCountByPositionGroup().then(res => {
  135. this.sbPositionData = res.data
  136. this.selectCountByPosition(res.data[0])
  137. })
  138. },
  139. methods: {
  140. drawerClose () {
  141. this.drawerVisible = false
  142. },
  143. base (record) {
  144. this.visible = true
  145. // 如果是空标识添加
  146. if (this.BaseTool.Object.isBlank(record)) {
  147. this.modalTitle = '添加'
  148. this.data = []
  149. }
  150. },
  151. handleCancel (values) {
  152. this.visible = false
  153. this.confirmLoading = false
  154. this.form.resetFields()
  155. if (this.BaseTool.Object.isNotBlank(values)) {
  156. this.$emit('ok', values)
  157. } else {
  158. this.$emit('ok')
  159. }
  160. },
  161. selectCountByPosition (position) {
  162. this.parentId = position.id
  163. this.code = null
  164. this.typeData = []
  165. },
  166. selectCountByUseTypeGroup (position) {
  167. this.code = position.code
  168. selectCountByUseTypeGroup(position).then(res => {
  169. this.typeData = res.data
  170. })
  171. },
  172. jumpSbInfo (type) {
  173. const routeUrl = this.$router.resolve({ path: '/sb/info/company', query: { typeId: type.typeId } })
  174. window.open(routeUrl.href, '_blank')
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="less" scoped>
  180. .search{
  181. width: 100%;
  182. background: #fff;
  183. text-align: center;
  184. padding:10px;
  185. margin-bottom: 20px;
  186. }
  187. .gutter-box{
  188. height: 350px;
  189. overflow: auto;
  190. }
  191. .gutter-color{
  192. background: #fff;
  193. border: 1px solid #DDDDDD;
  194. }
  195. .gutter-btn{
  196. height: 165px;
  197. display: flex;
  198. flex-direction: column;
  199. justify-content: center;
  200. align-items: center;
  201. font-size: 50px;
  202. color:#333;
  203. &:hover{
  204. cursor: pointer;
  205. }
  206. }
  207. .act{
  208. color:#3462FD;
  209. }
  210. .main{
  211. margin-top:30px;
  212. }
  213. .title{
  214. font-size: 28px;
  215. font-family: PingFang SC;
  216. font-weight: 500;
  217. color: #3462FD;
  218. padding:10px 42px;
  219. border-bottom: 1px solid #DDDDDD;
  220. }
  221. .btn{
  222. position: fixed;
  223. bottom: 50px;
  224. width: 100%;
  225. display: flex;
  226. justify-content: center;
  227. }
  228. .center{
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. }
  233. .opt_option{
  234. background: linear-gradient(-3deg, #cce2f0 0%, #99D1F6 100%);
  235. color:#fff;
  236. }
  237. .one_title_option{
  238. background:#fff;
  239. display: flex;
  240. // width: 100%;
  241. // justify-content: space-between;
  242. align-items: center;
  243. margin-bottom:10px;
  244. font-size: 25px;
  245. font-family: PingFang SC;
  246. color: #333333;
  247. cursor: pointer;
  248. border-radius: 10px;
  249. border: 1px solid #C0BEBE;
  250. padding:17px ;
  251. }
  252. .opt_one_title_option{
  253. background: linear-gradient(-3deg, #99D1F6 0%, #9196F3 100%);
  254. color:#fff;
  255. }
  256. ::-webkit-scrollbar { width: 0; height: 0; color: transparent; }
  257. </style>