index.vue 13 KB

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