index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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" maxlength="500" 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-row">
  67. <view class="box-title" :class="{'red':isqtype}">团队简介</view>
  68. <view class="box-title-tip" @click="briefTipShow=true">
  69. <u-icon name="question-circle" size="32rpx" color="#B3BFC8"></u-icon>
  70. </view>
  71. </view>
  72. <view class="box-textarea">
  73. <u-textarea border="none" height="320rpx" maxlength="-1" style="color: #667E90;padding: 0;" :placeholderStyle="{'color':'#B3BFC8','font-size':'30rpx','line-height':'40rpx'}"
  74. v-model="teamInfo.brief" placeholder="示例:这是一个为推动公司ERP系统升级后的落地应用而组建的团队,36名成员由公司副总经理、各部门总监以及核心骨干组成,大部分成员在该公司同事超过10年,团队成员的工作地点分布在香港、深圳、上海、苏州和东莞等地。公司升级ERP系统是配合”中国区业务战略统一”的大方向,促进建立一致性的运作流程体系。但在新ERP系统落地应用的过程中,不同区域、不同业务单元的认知理解不一,推动新系统应用的力度也参差不去,还造成了不同业务单元之间、不同职能部门之间的协作混乱。公司董事会期待这个团队能够精诚合作,打破部门壁垒,积极推动新ERP系统的落地应用,促进公司战略目标达成。"></u-textarea>
  75. </view>
  76. </view>
  77. <view class="zt_btn" @click="handleConfirm">{{confirmText}}</view>
  78. <view class="dialog" v-if="areaShow">
  79. <view class="dialog-box">
  80. <cus-province-city-area @cancel="areaShow=false" @confirm="areaConfirm"></cus-province-city-area>
  81. </view>
  82. </view>
  83. <cus-select :show="teamScaleShow" title="选择团队规模" :list="teamScaleData" @close="teamScaleShow=false" @confirmTeam="e=>selectConfirm(e,'scale','teamScaleText','teamScaleShow')"></cus-select>
  84. <!-- <cus-select :show="teamLevelShow" title="选择团队层级" :list="teamLevelData" @close="teamLevelShow=false" @confirmTeam="e=>selectConfirm(e,'hierarchy','teamLevelText','teamLevelShow')"></cus-select> -->
  85. <!-- 团队简介提示弹层 -->
  86. <u-popup :show="briefTipShow" mode="center" :round="20" :closeable="true" @close="briefTipShow=false">
  87. <view class="brief-tip-content">
  88. <view class="brief-tip-title">示例</view>
  89. <view class="brief-tip-text">这是一个为推动公司ERP系统升级后的落地应用而组建的团队,36名成员由公司副总经理、各部门总监以及核心骨干组成,大部分成员在该公司同事超过10年,团队成员的工作地点分布在香港、深圳、上海、苏州和东莞等地。</view>
  90. <view class="brief-tip-text">公司升级ERP系统是配合"中国区业务战略统一"的大方向,促进建立一致性的运作流程体系。但在新ERP系统落地应用的过程中,不同区域、不同业务单元的认知理解不一,推动新系统应用的力度也参差不齐,还造成了不同业务单元之间、不同职能部门之间的协作混乱。</view>
  91. <view class="brief-tip-text">公司董事会期待这个团队能够精诚合作,打破部门壁垒,积极推动新ERP系统的落地应用,促进公司战略目标达成。</view>
  92. </view>
  93. </u-popup>
  94. </view>
  95. </template>
  96. <script>
  97. import CusSelect from '@/components/CusSelect/index.vue'
  98. import CusProvinceCityArea from '@/components/CusProvinceCityArea/index.vue'
  99. import CusTeamBackgroundFiles from '@/components/CusTeamBackgroundFiles/index.vue'
  100. import teamBackgroundRules from '@/utils/teamBackgroundFile.js'
  101. const { createTeamSubmitPayload, validateEnterpriseWebsite } = teamBackgroundRules
  102. export default {
  103. components:{ CusSelect, CusProvinceCityArea, CusTeamBackgroundFiles },
  104. props:{
  105. confirmText:{
  106. typeof:String,
  107. default:'下一步'
  108. },
  109. qtype:{
  110. typeof:Boolean,
  111. default:false
  112. },
  113. teamId: { type: [String, Number], default: '' },
  114. submitting: { type: Boolean, default: false }
  115. },
  116. options: { styleIsolation: 'shared' },
  117. data(){
  118. return {
  119. teamInfo:{
  120. teamName:'',
  121. enterpriseName:'',
  122. enterpriseWebsite:'',
  123. provinceId:'',
  124. cityId:'',
  125. districtId:'',
  126. industryId:'',
  127. functionIds:[],
  128. orgIds:[],
  129. scale:'',
  130. hierarchy:'',
  131. brief:'',
  132. backgroundFileCount:0
  133. },
  134. areaShow:false,
  135. areaText:'请选择',
  136. industryText:'请选择',
  137. functionTypeText:'请选择',
  138. architectureTypeText:'请选择',
  139. teamScaleShow:false,
  140. teamScaleData:[],
  141. teamScaleText:'请选择',
  142. teamLevelShow:false,
  143. teamLevelData:[],
  144. teamLevelText:'请选择',
  145. isqtype:false,
  146. briefTipShow:false
  147. }
  148. },
  149. mounted() {
  150. this.isqtype = this.$props.qtype||false;
  151. },
  152. methods:{
  153. backgroundCountChange(count){
  154. this.teamInfo.backgroundFileCount = count;
  155. },
  156. flushBackgroundFiles(teamId) {
  157. return this.$refs.backgroundRef.flushPendingFiles(teamId)
  158. },
  159. hasDeferredPcUpload() {
  160. return this.$refs.backgroundRef.hasDeferredPcUpload()
  161. },
  162. waitForDeferredPcUpload(teamId) {
  163. return this.$refs.backgroundRef.waitForDeferredPcUpload(teamId)
  164. },
  165. hasUnresolvedBackgroundFiles() {
  166. return this.$refs.backgroundRef.hasUnresolvedFiles()
  167. },
  168. isBackgroundUploadActive() {
  169. return this.$refs.backgroundRef.isUploadActive()
  170. },
  171. getTeamScaleData(){
  172. this.$api.get('/getListByType/team_scale').then(({data:res})=>{
  173. if(res.code!==0) return this.$showToast(res.msg)
  174. this.teamScaleData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
  175. })
  176. },
  177. getTeamHierarchyData(){
  178. this.$api.get('/getListByType/team_hierarchy').then(({data:res})=>{
  179. if(res.code!==0) return this.$showToast(res.msg)
  180. this.teamLevelData = res.data.map(d=>({name:d.dictLabel,id:d.dictValue}))
  181. })
  182. },
  183. setTeamInfo(info){
  184. this.teamInfo = Object.assign({
  185. teamName:'', enterpriseName:'', enterpriseWebsite:'', provinceId:'', cityId:'',
  186. districtId:'', industryId:'', functionIds:[], orgIds:[], scale:'',
  187. hierarchy:'', brief:'', backgroundFileCount:0
  188. }, info || {});
  189. },
  190. confirm(e) {
  191. const { value } = e;
  192. this.areaText = value.map(item => item.label).join('-');
  193. this.areaShow = false;
  194. },
  195. cancel() {
  196. this.areaShow = false;
  197. },
  198. close() {
  199. this.areaShow = false;
  200. },
  201. pickerShow(key){
  202. this[key] = true;
  203. },
  204. turnPage(type){
  205. if(type==='industry'){
  206. uni.navigateTo({
  207. url:'/pagesPublish/industry',
  208. events:{
  209. selectConfirm:data=>{
  210. this.teamInfo.industryId = data.industryId;
  211. this.industryText = data.industryName;
  212. }
  213. }
  214. })
  215. }else{
  216. uni.navigateTo({
  217. url:'/pagesPublish/teamTypeMultiple?type='+type,
  218. events:{
  219. selectConfirm:data=>{
  220. if(data.type==='function'){
  221. this.teamInfo.functionIds = data.ids;
  222. this.functionTypeText = data.names.join(',');
  223. }else if(data.type==='architecture'){
  224. this.teamInfo.orgIds = data.ids;
  225. this.architectureTypeText = data.names.join(',');
  226. }
  227. }
  228. }
  229. })
  230. }
  231. },
  232. selectShow(key){
  233. this[key] = true;
  234. this.$nextTick(()=>{
  235. if(key==='teamScaleShow') this.getTeamScaleData();
  236. if(key==='teamLevelShow') this.getTeamHierarchyData();
  237. })
  238. },
  239. pickerConfirm(e,key1,key2,key3){
  240. this.teamInfo[key1] = e.value[0].id;
  241. this[key2] = e.value[0].name;
  242. this[key3] = false;
  243. },
  244. selectConfirm(e,key1,key2,key3){
  245. this.teamInfo[key1] = e.id;
  246. this[key2] = e.name;
  247. this[key3] = false;
  248. },
  249. async handleConfirm(){
  250. if(this.confirming || this.submitting) return
  251. if(!this.teamInfo.teamName) return this.$showToast('请输入团队名称')
  252. if(!this.teamInfo.enterpriseName) return this.$showToast('请输入公司名称')
  253. const enterpriseWebsite = String(this.teamInfo.enterpriseWebsite || '').trim()
  254. const websiteError = validateEnterpriseWebsite(enterpriseWebsite)
  255. if(websiteError) return this.$showToast(websiteError)
  256. this.teamInfo.enterpriseWebsite = enterpriseWebsite
  257. if(!this.teamInfo.districtId) return this.$showToast('请选择所属地区')
  258. if(!this.teamInfo.industryId) return this.$showToast('请选择所属行业')
  259. if(this.isqtype){
  260. if(this.teamInfo.functionIds.length===0) return this.$showToast('请选择团队职能类型')
  261. if(this.teamInfo.orgIds.length===0) return this.$showToast('请选择团队模式类型')
  262. if(!this.teamInfo.scale) return this.$showToast('请选择团队规模')
  263. // if(!this.teamInfo.hierarchy) return this.$showToast('请选择团队层级')
  264. if(!this.teamInfo.brief) return this.$showToast('请输入团队简介')
  265. }
  266. this.confirming = true
  267. try {
  268. if(this.teamId){
  269. const uploadResult = await this.flushBackgroundFiles(this.teamId)
  270. if(uploadResult.failed > 0 || this.hasUnresolvedBackgroundFiles()){
  271. this.$showToast('仍有背景资料未上传成功,请重试后再保存')
  272. return
  273. }
  274. }
  275. this.$emit('handleConfirm',createTeamSubmitPayload(this.teamInfo))
  276. } catch(error) {
  277. this.$showToast(error && (error.message || error.msg) || '背景资料处理失败,请重试')
  278. } finally {
  279. this.confirming = false
  280. }
  281. },
  282. areaConfirm(e){
  283. const { provinceId, cityId,districtId,provinceName,cityName,districtName } = e
  284. this.teamInfo.provinceId = provinceId;
  285. this.teamInfo.cityId = cityId;
  286. this.teamInfo.districtId = districtId;
  287. this.areaText = provinceName+' '+cityName+' '+districtName;
  288. this.areaShow = false;
  289. }
  290. }
  291. }
  292. </script>
  293. <style scoped lang="scss">
  294. ::v-deep .u-textarea{
  295. padding: 36rpx 0 !important;
  296. }
  297. ::v-deep .u-textarea textarea{
  298. font-family: PingFangSC, PingFang SC;
  299. font-weight: 400;
  300. font-size: 30rpx;
  301. color: #667E90;
  302. line-height: 40rpx;
  303. }
  304. .ti_page{
  305. width: 100%;
  306. padding: 0 24rpx 162rpx;
  307. box-sizing: border-box;
  308. .form{
  309. background: #FFFFFF;
  310. border-radius: 24rpx;
  311. &-item{
  312. padding: 28rpx 24rpx;
  313. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  314. &-title{
  315. width: 180rpx;
  316. font-family: PingFangSC, PingFang SC;
  317. font-weight: 400;
  318. font-size: 30rpx;
  319. color: #002846;
  320. line-height: 42rpx;
  321. position: relative;
  322. box-sizing: border-box;
  323. &.red{
  324. &::after{
  325. content: "*";
  326. font-family: PingFangSC, PingFang SC;
  327. font-weight: 400;
  328. font-size: 30rpx;
  329. color: #FD4F66;
  330. line-height: 42rpx;
  331. position: absolute;
  332. left: -16rpx;
  333. }
  334. }
  335. }
  336. &-inp{
  337. width: calc(100% - 180rpx);
  338. padding-left: 20rpx;
  339. box-sizing: border-box;
  340. display: flex;
  341. align-items: center;
  342. justify-content: flex-end;
  343. text{
  344. font-family: PingFangSC, PingFang SC;
  345. font-weight: 400;
  346. font-size: 30rpx;
  347. color: #B3BFC8;
  348. line-height: 40rpx;
  349. margin-right: 10rpx;
  350. &.active{
  351. color: #667E90;
  352. line-height: 30rpx;
  353. }
  354. }
  355. }
  356. }
  357. }
  358. .box{
  359. background: #FFFFFF;
  360. box-shadow: inset 0rpx -1rpx 0rpx 0rpx rgba(229,231,235,0.5);
  361. border-radius: 24rpx;
  362. margin-top: 20rpx;
  363. padding: 28rpx 24rpx;
  364. &-title{
  365. font-family: PingFangSC, PingFang SC;
  366. font-weight: 400;
  367. font-size: 30rpx;
  368. color: #002846;
  369. line-height: 42rpx;
  370. position: relative;
  371. &.red{
  372. &::after{
  373. content: "*";
  374. font-family: PingFangSC, PingFang SC;
  375. font-weight: 400;
  376. font-size: 30rpx;
  377. color: #FD4F66;
  378. line-height: 42rpx;
  379. position: absolute;
  380. left: -16rpx;
  381. }
  382. }
  383. }
  384. &-title-row{
  385. display: flex;
  386. align-items: center;
  387. }
  388. &-title-tip{
  389. margin-left: 12rpx;
  390. display: flex;
  391. align-items: center;
  392. }
  393. }
  394. .brief-tip-content{
  395. width: 600rpx;
  396. max-height: 70vh;
  397. padding: 40rpx 32rpx;
  398. box-sizing: border-box;
  399. overflow-y: auto;
  400. }
  401. .brief-tip-title{
  402. font-family: PingFangSC, PingFang SC;
  403. font-weight: 500;
  404. font-size: 32rpx;
  405. color: #002846;
  406. line-height: 44rpx;
  407. margin-bottom: 24rpx;
  408. text-align: center;
  409. }
  410. .brief-tip-text{
  411. font-family: PingFangSC, PingFang SC;
  412. font-weight: 400;
  413. font-size: 28rpx;
  414. color: #667E90;
  415. line-height: 44rpx;
  416. margin-bottom: 20rpx;
  417. text-indent: 2em;
  418. }
  419. .zt_btn{
  420. width: calc(100% - 100rpx);
  421. position: fixed;
  422. left: 50rpx;
  423. bottom: 54rpx;
  424. z-index: 1000;
  425. &.disabled{
  426. opacity: .55;
  427. }
  428. }
  429. }
  430. </style>