clientType.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="task-set">
  3. <EnSelect title="用户分类" v-model="type" :local-data="popupData" ref="system" item-key="value" item-text="text"
  4. @setAffirm="submit"></EnSelect>
  5. </view>
  6. </template>
  7. <script>
  8. import {
  9. getClientType,
  10. setClientType
  11. } from "@/api/client";
  12. import EnSelect from "@/components/en-utils/en-select/en-select.vue";
  13. import tools from "@/service/tools";
  14. export default {
  15. name: "clientType",
  16. components: {
  17. EnSelect
  18. },
  19. props: {
  20. 'clientId': {
  21. default: ''
  22. }
  23. },
  24. data() {
  25. return {
  26. showExecute: false,
  27. popupData: [],
  28. type: '',
  29. typeName: '',
  30. }
  31. },
  32. watch: {},
  33. mounted() {
  34. // this.getClientType()
  35. },
  36. methods: {
  37. getClientType() {
  38. getClientType().then((res) => {
  39. if (res.code === 1) {
  40. this.popupData = res.data
  41. }
  42. console.log(this.popupData)
  43. })
  44. },
  45. setNewExecute(e) {
  46. //设置新执行人
  47. console.log(e)
  48. let newData = e.detail.value[0]
  49. this.type = newData.value
  50. this.typeName = newData.text
  51. },
  52. submit() {
  53. setClientType({
  54. 'clientId': this.clientId,
  55. 'type': this.type
  56. }).then((res) => {
  57. if (res.code === 1) {
  58. tools.success(res.msg)
  59. this.$emit('endTaskSet')
  60. } else {
  61. tools.error(res.msg)
  62. }
  63. })
  64. }
  65. }
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .task-set {
  70. width: 100%;
  71. min-height: 50vh;
  72. max-height: 70vh;
  73. background: #F6F7FB;
  74. overflow: auto;
  75. border-radius: 20rpx 20rpx 0rpx 0rpx;
  76. .nav {
  77. font-size: 18px;
  78. font-weight: bold;
  79. text-align: center;
  80. padding: 30rpx 0 15rpx;
  81. background: #fff;
  82. }
  83. .task-tab {
  84. display: flex;
  85. justify-content: space-between;
  86. height: 88rpx;
  87. .tab-item {
  88. width: 50%;
  89. height: 100%;
  90. font-size: 14px;
  91. color: #333333;
  92. line-height: 88rpx;
  93. text-align: center;
  94. background: #fff;
  95. border: 2rpx solid #3169FA;
  96. box-sizing: border-box;
  97. }
  98. .tab-select {
  99. background: #3169FA;
  100. color: #FFFFFF;
  101. border: none;
  102. }
  103. }
  104. .content {
  105. width: 100%;
  106. height: auto;
  107. padding: 22rpx 0 106rpx 0;
  108. .choose-box {
  109. width: 100%;
  110. height: auto;
  111. padding: 34rpx 35rpx;
  112. box-sizing: border-box;
  113. background: #fff;
  114. border-top: 1px solid #F0F0F0;
  115. display: flex;
  116. align-items: center;
  117. justify-content: space-between;
  118. .choose-box-left {
  119. font-size: 16px;
  120. color: #666666;
  121. }
  122. .choose-box-right {
  123. display: flex;
  124. align-items: center;
  125. .choose-box-right-content {
  126. font-size: 16px;
  127. font-weight: 400;
  128. color: #232A35;
  129. margin: 0 18rpx 0 0;
  130. }
  131. .choose-box-right-img {
  132. width: 12rpx;
  133. height: 20rpx;
  134. }
  135. }
  136. }
  137. .choose-box-stage {
  138. background: #fff;
  139. padding: 0 22rpx;
  140. margin-bottom: 22rpx;
  141. }
  142. .choose-box-two {
  143. margin: 0 0 22rpx 0;
  144. }
  145. }
  146. .submit-box {
  147. width: 100%;
  148. height: auto;
  149. border-top: 1px solid #F0F0F0;
  150. background: #fff;
  151. position: fixed;
  152. left: 0;
  153. bottom: 0;
  154. padding: 12rpx 32rpx;
  155. box-sizing: border-box;
  156. .submit {
  157. width: 100%;
  158. height: auto;
  159. background: #3169FA;
  160. border-radius: 4px;
  161. font-size: 16px;
  162. color: #FFFFFF;
  163. padding: 20rpx 0;
  164. text-align: center;
  165. }
  166. }
  167. .operate-box {
  168. .content-box {
  169. margin-top: 20rpx;
  170. height: auto;
  171. padding: 0 20rpx;
  172. background: #fff;
  173. }
  174. }
  175. }
  176. </style>