clientType.vue 3.5 KB

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