index.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <view class="ti_page">
  3. <view class="form">
  4. <view class="form-item adfacjb">
  5. <view class="form-item-title">团队名称</view>
  6. <view class="form-item-inp">
  7. <u-input v-model="teamInfo.teamName" placeholder="请输入团队名称" border="none" inputAlign="right" fontSize="28rpx" color="#002846"/>
  8. </view>
  9. </view>
  10. <view class="form-item adfacjb">
  11. <view class="form-item-title">所在公司</view>
  12. <view class="form-item-inp">
  13. <u-input v-model="teamInfo.enterpriseName" placeholder="请输入公司名称" border="none" inputAlign="right" fontSize="28rpx" color="#002846"/>
  14. </view>
  15. </view>
  16. <view class="form-item adfacjb">
  17. <view class="form-item-title">所属地区</view>
  18. <view class="form-item-inp adfac" @click="pickerShow('areaShow')">
  19. <text :class="{'active':areaText!=='请选择'}">{{areaText}}</text>
  20. <u-icon name="arrow-right" size="24rpx" color="#B9C0C8"></u-icon>
  21. </view>
  22. </view>
  23. <view class="form-item adfacjb">
  24. <view class="form-item-title red">所属行业</view>
  25. <view class="form-item-inp adfac" @click="turnPage('industry')">
  26. <text :class="{'active':industryText!=='请选择'}">{{industryText}}</text>
  27. <u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
  28. </view>
  29. </view>
  30. <view class="form-item adfacjb">
  31. <view class="form-item-title red">团队职能类型</view>
  32. <view class="form-item-inp adfac" @click="turnPage('function')">
  33. <text :class="{'active':functionTypeText!=='请选择'}">{{functionTypeText}}</text>
  34. <u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
  35. </view>
  36. </view>
  37. <view class="form-item adfacjb">
  38. <view class="form-item-title red">团队架构类型</view>
  39. <view class="form-item-inp adfac" @click="turnPage('architecture')">
  40. <text :class="{'active':architectureTypeText!=='请选择'}">{{architectureTypeText}}</text>
  41. <u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
  42. </view>
  43. </view>
  44. <view class="form-item adfacjb">
  45. <view class="form-item-title">团队规模</view>
  46. <view class="form-item-inp adfac" @click="selectShow('teamScaleShow')">
  47. <text :class="{'active':teamScaleText!=='请选择'}">{{teamScaleText}}</text>
  48. <u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
  49. </view>
  50. </view>
  51. <view class="form-item adfacjb">
  52. <view class="form-item-title">团队层级</view>
  53. <view class="form-item-inp adfac" @click="selectShow('teamLevelShow')">
  54. <text :class="{'active':teamLevelText!=='请选择'}">{{teamLevelText}}</text>
  55. <u-icon name="arrow-right" size="20rpx" color="#B9C0C8"></u-icon>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="box">
  60. <view class="box-title">团队简介</view>
  61. <view class="box-textarea">
  62. <u-textarea border="none" height="320rpx" maxlength="-1" fontSize="28rpx" color="#002846" v-model="teamInfo.brief" placeholder="示例:这是一个为公司ERP系统升级而组建的36人团队,成员由公司副总经理、各部门总监以及各部门核心骨干组成。团队成员工作地点分布在香港、上海、苏州、深圳和东莞等地。团队成员年龄在35-50岁之间,男女比例比较均衡,大部份成员在该公司同事超过十年。"></u-textarea>
  63. </view>
  64. </view>
  65. <view class="zt_btn" @click="handleConfirm">{{confirmText}}</view>
  66. <view class="dialog" v-if="areaShow">
  67. <view class="dialog-box">
  68. <cus-province-city-area @cancel="areaShow=false" @confirm="areaConfirm"></cus-province-city-area>
  69. </view>
  70. </view>
  71. <cus-select :show="teamScaleShow" title="选择团队规模" :list="teamScaleData" @close="teamScaleShow=false" @confirmTeam="e=>selectConfirm(e,'scale','teamScaleText','teamScaleShow')"></cus-select>
  72. <cus-select :show="teamLevelShow" title="选择团队层级" :list="teamLevelData" @close="teamLevelShow=false" @confirmTeam="e=>selectConfirm(e,'hierarchy','teamLevelText','teamLevelShow')"></cus-select>
  73. </view>
  74. </template>
  75. <script>
  76. import CusSelect from '@/components/CusSelect/index.vue'
  77. import CusProvinceCityArea from '@/components/CusProvinceCityArea/index.vue'
  78. export default {
  79. components:{ CusSelect, CusProvinceCityArea },
  80. props:{
  81. confirmText:{
  82. typeof:String,
  83. default:'下一步'
  84. }
  85. },
  86. data(){
  87. return {
  88. teamInfo:{
  89. teamName:'',
  90. enterpriseName:'',
  91. provinceId:'',
  92. cityId:'',
  93. districtId:'',
  94. industryId:'',
  95. functionIds:[],
  96. orgIds:[],
  97. scale:'',
  98. hierarchy:'',
  99. brief:'',
  100. },
  101. areaShow:false,
  102. areaText:'请选择',
  103. industryText:'请选择',
  104. functionTypeText:'请选择',
  105. architectureTypeText:'请选择',
  106. teamScaleShow:false,
  107. teamScaleData:[],
  108. teamScaleText:'请选择',
  109. teamLevelShow:false,
  110. teamLevelData:[],
  111. teamLevelText:'请选择',
  112. }
  113. },
  114. methods:{
  115. getTeamScaleData(){
  116. this.$api.get('/getListByType/team_scale').then(({data:res})=>{
  117. if(res.code!==0) return this.$showToast(res.msg)
  118. this.teamScaleData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
  119. })
  120. },
  121. getTeamHierarchyData(){
  122. this.$api.get('/getListByType/team_hierarchy').then(({data:res})=>{
  123. if(res.code!==0) return this.$showToast(res.msg)
  124. this.teamLevelData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
  125. })
  126. },
  127. setTeamInfo(info){
  128. this.teamInfo = info;
  129. },
  130. confirm(e) {
  131. const { value } = e;
  132. this.areaText = value.map(item => item.label).join('-');
  133. this.areaShow = false;
  134. },
  135. cancel() {
  136. this.areaShow = false;
  137. },
  138. close() {
  139. this.areaShow = false;
  140. },
  141. pickerShow(key){
  142. this[key] = true;
  143. },
  144. turnPage(type){
  145. if(type==='industry'){
  146. uni.navigateTo({
  147. url:'/pagesPublish/industry',
  148. events:{
  149. selectConfirm:data=>{
  150. this.teamInfo.industryId = data.industryId;
  151. this.industryText = data.industryName;
  152. }
  153. }
  154. })
  155. }else{
  156. uni.navigateTo({
  157. url:'/pagesPublish/teamTypeMultiple?type='+type,
  158. events:{
  159. selectConfirm:data=>{
  160. if(data.type==='function'){
  161. this.teamInfo.functionIds = data.ids;
  162. this.functionTypeText = data.names.join(',');
  163. }else if(data.type==='architecture'){
  164. this.teamInfo.orgIds = data.ids;
  165. this.architectureTypeText = data.names.join(',');
  166. }
  167. }
  168. }
  169. })
  170. }
  171. },
  172. selectShow(key){
  173. this[key] = true;
  174. this.$nextTick(()=>{
  175. if(key==='teamScaleShow') this.getTeamScaleData();
  176. if(key==='teamLevelShow') this.getTeamHierarchyData();
  177. })
  178. },
  179. pickerConfirm(e,key1,key2,key3){
  180. this.teamInfo[key1] = e.value[0].id;
  181. this[key2] = e.value[0].name;
  182. this[key3] = false;
  183. },
  184. selectConfirm(e,key1,key2,key3){
  185. this.teamInfo[key1] = e.id;
  186. this[key2] = e.name;
  187. this[key3] = false;
  188. },
  189. handleConfirm(){
  190. if(!this.teamInfo.industryId) return this.$showToast('请选择所属行业')
  191. if(this.teamInfo.functionIds.length===0) return this.$showToast('请选择团队职能类型')
  192. if(this.teamInfo.orgIds.length===0) return this.$showToast('请选择团队架构类型')
  193. this.$emit('handleConfirm',this.teamInfo)
  194. },
  195. areaConfirm(e){
  196. const { provinceId, cityId,districtId,provinceName,cityName,districtName } = e
  197. this.teamInfo.provinceId = provinceId;
  198. this.teamInfo.cityId = cityId;
  199. this.teamInfo.districtId = districtId;
  200. this.areaText = provinceName+' '+cityName+' '+districtName;
  201. this.areaShow = false;
  202. }
  203. }
  204. }
  205. </script>
  206. <style scoped lang="scss">
  207. .ti_page{
  208. width: 100%;
  209. padding: 0 24rpx 162rpx;
  210. box-sizing: border-box;
  211. .form{
  212. margin-top: 20rpx;
  213. background: #FFFFFF;
  214. border-radius: 24rpx;
  215. &-item{
  216. padding: 28rpx 24rpx;
  217. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  218. &-title{
  219. width: 180rpx;
  220. font-family: PingFangSC, PingFang SC;
  221. font-weight: 400;
  222. font-size: 30rpx;
  223. color: #002846;
  224. line-height: 42rpx;
  225. position: relative;
  226. box-sizing: border-box;
  227. &.red{
  228. &::after{
  229. content: "*";
  230. font-family: PingFangSC, PingFang SC;
  231. font-weight: 400;
  232. font-size: 30rpx;
  233. color: #FD4F66;
  234. line-height: 42rpx;
  235. position: absolute;
  236. left: -16rpx;
  237. }
  238. }
  239. }
  240. &-inp{
  241. width: calc(100% - 180rpx);
  242. padding-left: 20rpx;
  243. box-sizing: border-box;
  244. display: flex;
  245. align-items: center;
  246. justify-content: flex-end;
  247. text{
  248. font-family: PingFangSC, PingFang SC;
  249. font-weight: 400;
  250. font-size: 28rpx;
  251. color: #B3BFC8;
  252. line-height: 40rpx;
  253. margin-right: 10rpx;
  254. &.active{
  255. color: #002846;
  256. line-height: 30rpx;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. .box{
  263. background: #FFFFFF;
  264. box-shadow: inset 0rpx -1rpx 0rpx 0rpx rgba(229,231,235,0.5);
  265. border-radius: 24rpx;
  266. margin-top: 20rpx;
  267. padding: 28rpx 24rpx;
  268. }
  269. .zt_btn{
  270. width: calc(100% - 100rpx);
  271. position: fixed;
  272. left: 50rpx;
  273. bottom: 54rpx;
  274. z-index: 1000;
  275. }
  276. }
  277. </style>