SbPositionNum copy.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <div v-show="visible" class="main">
  3. <div>
  4. <div class="one_title">
  5. <a-row type="flex" :gutter="[20,20]">
  6. <a-col :span="6" v-for="position in sbPositionData" :key="position.id" @click="selectCountByPosition(position)" v-show="position.type === 1">
  7. <div class="one_title_option" :class="parentId==position.id?'opt_one_title_option':''">
  8. <div><my-icon type="icon-lianyouchangqu-copy" style="font-size:107px;"/></div>
  9. <div>
  10. <div> {{ position.name }}</div>
  11. <div style="color:#296BEF;font-size: 42px;">{{ position.num }}台,总{{ position.childNum }}台</div>
  12. </div>
  13. </div>
  14. </a-col>
  15. </a-row>
  16. </div>
  17. <br />
  18. <div class="two_title">
  19. <a-row type="flex" :gutter="[20,40]">
  20. <a-col :span="3" v-for="position in sbPositionData" v-show="position.type === 2 && position.parentId === parentId" :key="position.id" @click="selectCountByPositionGroupBySbType(position)">
  21. <div class="two_title_option" :class="code==position.code?'opt_two_title_option':''">
  22. <div> {{ position.name }}</div>
  23. <div style="color:#296BEF;margin-top: 22px;">{{ position.num }}台</div>
  24. </div>
  25. </a-col>
  26. </a-row>
  27. </div>
  28. <div class="three_title" v-if="typeData.length >0">
  29. <!-- <div class="title">丙二车间:28台</div> -->
  30. <a-row type="flex" justify="space-around" :gutter="[40,40]">
  31. <a-col :span="3" v-for="item in typeData" :key="item.id" >
  32. <div class="three_title_option" @click="jumpSbInfo(item)">
  33. <div>{{ item.typeName }}</div>
  34. <div style="padding:5px;background: #CDDBFA;opacity: 0.56;border-radius: 2px; color:#2C5DC7;margin-top: 10px;">{{ item.num }}台</div>
  35. </div>
  36. </a-col>
  37. </a-row>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import {
  44. selectCountByPositionGroup,
  45. selectCountByPositionGroupBySbType
  46. } from '@/api/sb/count'
  47. export default {
  48. name: 'SbPositionNum',
  49. components: {
  50. },
  51. data () {
  52. return {
  53. confirmLoading: false,
  54. modalTitle: null,
  55. configMap: {},
  56. parentId: null,
  57. code: null,
  58. sbPositionData: [],
  59. typeData: [],
  60. factoryStr: null,
  61. form: this.$form.createForm(this),
  62. visible: true,
  63. user: this.$store.getters.userInfo
  64. }
  65. },
  66. props: {
  67. },
  68. created () {
  69. // 下拉框map
  70. selectCountByPositionGroup().then(res => {
  71. this.sbPositionData = res.data
  72. this.selectCountByPosition(res.data[0])
  73. })
  74. },
  75. methods: {
  76. base (record) {
  77. this.visible = true
  78. // 如果是空标识添加
  79. if (this.BaseTool.Object.isBlank(record)) {
  80. this.modalTitle = '添加'
  81. this.data = []
  82. }
  83. },
  84. handleCancel (values) {
  85. this.visible = false
  86. this.confirmLoading = false
  87. this.form.resetFields()
  88. if (this.BaseTool.Object.isNotBlank(values)) {
  89. this.$emit('ok', values)
  90. } else {
  91. this.$emit('ok')
  92. }
  93. },
  94. selectCountByPosition (position) {
  95. this.parentId = position.id
  96. this.code = null
  97. this.typeData = []
  98. },
  99. selectCountByPositionGroupBySbType (position) {
  100. this.code = position.code
  101. selectCountByPositionGroupBySbType(position).then(res => {
  102. this.typeData = res.data
  103. })
  104. },
  105. jumpSbInfo (type) {
  106. const routeUrl = this.$router.resolve({ path: '/sb/info/company', query: { typeId: type.typeId } })
  107. window.open(routeUrl.href, '_blank')
  108. }
  109. }
  110. }
  111. </script>
  112. <style lang="less" scoped>
  113. .main{
  114. padding:20px;
  115. // background: #fff;
  116. .one_title_option{
  117. background:#fff;
  118. display: flex;
  119. justify-content: space-between;
  120. align-items: center;
  121. font-size: 26px;
  122. font-family: PingFang SC;
  123. font-weight: bold;
  124. color: #333333;
  125. cursor: pointer;
  126. border-radius: 10px;
  127. padding:17px 50px 17px 17px;
  128. }
  129. .opt_one_title_option{
  130. background: linear-gradient(-3deg, #99D1F6 0%, #9196F3 100%);
  131. color:#fff;
  132. }
  133. .two_title_option{
  134. background:#fff;
  135. text-align: center;
  136. font-size: 26px;
  137. padding:20px;
  138. cursor: pointer;
  139. box-shadow: 1px 14px 29px 0px rgba(138,97,250,0.19);
  140. border-radius: 10px;
  141. }
  142. .opt_two_title_option{
  143. background: linear-gradient(-3deg, #cce2f0 0%, #99D1F6 100%);
  144. }
  145. .three_title{
  146. margin-top: 50px;
  147. background: #FFFFFF;
  148. border: 1px solid #D2D5D9;
  149. border-radius: 4px;
  150. font-family: PingFang SC;
  151. padding: 20px;
  152. min-height:100vh;
  153. .title{
  154. width: 500px;
  155. font-size: 34px;
  156. font-weight: bold;
  157. padding: 10px 0 30px 0;
  158. color: #2C5DC7;
  159. border-bottom: 2px solid #2c5dc7;
  160. margin-bottom: 30px;
  161. }
  162. .three_title_option{
  163. cursor: pointer;
  164. font-size: 22px;
  165. font-weight: 500;
  166. text-align: center;
  167. }
  168. }
  169. }
  170. </style>