index.vue 11 KB

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