questionnaireEdit.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='编辑问卷'></cus-header>
  4. <view class="box adfacjb" style="padding: 32rpx 24rpx 40rpx;">
  5. <view class="box-left">
  6. <view class="box-title">问卷名称</view>
  7. <view class="box-tip" style="margin-top: 32rpx;">{{'GW+MC PREILL36测评题库版本'}}</view>
  8. </view>
  9. <view class="box-right adfac" @click="handlePreview">
  10. <text>预览</text>
  11. <image :src="imgBase+'my_arrow_right.png'"></image>
  12. </view>
  13. </view>
  14. <view class="box" style="padding: 32rpx 24rpx;">
  15. <view class="box-title">选择团队</view>
  16. <view class="box-team adfacjb" @click="teamShow=true">
  17. <view class="box-tip">{{'甜梦2025一期团队'}}</view>
  18. <image :src="imgBase+'my_arrow_right.png'"></image>
  19. </view>
  20. </view>
  21. <view class="box" style="padding: 32rpx 24rpx 0;">
  22. <view class="box-title">问卷作答时间设置</view>
  23. <view class="box-time adfacjb" style="margin-top: 32rpx;" @click="startShow=true">
  24. <view class="box-time-left">开始时间</view>
  25. <view class="box-time-right adfac">
  26. <text>{{'2025-10-13 00:00'}}</text>
  27. <image :src="imgBase+'my_arrow_right.png'"></image>
  28. </view>
  29. </view>
  30. <view class="box-time adfacjb">
  31. <view class="box-time-left">截止时间</view>
  32. <view class="box-time-right adfac" @click="endShow=true">
  33. <text>{{'2025-10-20 00:00'}}</text>
  34. <image :src="imgBase+'my_arrow_right.png'"></image>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="box" style="padding: 32rpx 24rpx 18rpx;">
  39. <view class="box-title adfacjb">
  40. <text>限制每位用户提交次数</text>
  41. <u-switch v-model="limit" activeColor="#199C9C" size="38"></u-switch>
  42. </view>
  43. <view class="box-num adfacjb">
  44. <view class="box-num-title">可提交次数</view>
  45. <view class="box-num-right">
  46. <cus-number-box :min="1" :number="dto.submitNum" @valChange="valChange"></cus-number-box>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="box" style="padding: 30rpx 24rpx 0;">
  51. <view class="box-title adfacjb">
  52. <text>团队人员</text>
  53. <view class="box-add">+ 添加</view>
  54. </view>
  55. <view class="box-user">
  56. <view class="box-user-item adfacjb" v-for="(item,index) in dto.userList" :key="index">
  57. <view class="box-user-item-left">
  58. <view class="box-user-item-left-name adfac">
  59. <text>{{'吴亦可'}}</text>
  60. <view class="type">{{'赞助人Sponsor'}}</view>
  61. </view>
  62. <view class="box-user-item-left-email">{{'123456789@qq.com'}}</view>
  63. </view>
  64. <image class="box-user-item-right" :src="imgBase+'icon_delete.png'"></image>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="bottom">
  69. <view class="zt_btn" @click="confirmPublish">确认发布</view>
  70. </view>
  71. <view class="dialog adffc" v-if="teamShow">
  72. <view class="dbox adffc">
  73. <view class="db-top">选择团队</view>
  74. <image class="db-close" :src="imgBase+'remind_close.png'" @click="teamShow=false"></image>
  75. <view class="db-bottom" @click="addTeam">+ 新增团队</view>
  76. <view class="db-list">
  77. <view class="db-list-item adfacjb" v-for="(item,index) in teamList" :key="item.id" @click="selectTeam(item,index)">
  78. <view class="db-list-item-left" :class="{'active':item.select}">{{item.name}}</view>
  79. <view class="db-list-item-right">
  80. <u-icon name="checkbox-mark" color="#199C9C" size="42rpx" v-if="item.select"></u-icon>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="zt_btn" style="margin-top: 40rpx;" @click="confirmTeam">确定</view>
  85. </view>
  86. </view>
  87. <u-datetime-picker ref="datetimePicker1" title="开始时间" :minDate="minStartTime" itemHeight="88" :show="startShow" v-model="dto.startTime" mode="datetime" :formatter="formatter" @cancel="startShow=false" @confirm="startConfirm"></u-datetime-picker>
  88. <u-datetime-picker ref="datetimePicker2" title="结束时间" :minDate="minEndTime" itemHeight="88" :show="endShow" v-model="dto.endTime" mode="datetime" :formatter="formatter" @cancel="endShow=false" @confirm="endConfirm"></u-datetime-picker>
  89. </view>
  90. </template>
  91. <script>
  92. import CusNumberBox from '@/components/CusNumberBox/index.vue'
  93. export default {
  94. components:{ CusNumberBox },
  95. data(){
  96. return {
  97. limit:true,
  98. teamShow:false,
  99. startShow:false,
  100. endShow:false,
  101. dto:{
  102. submitNum:1,
  103. userList:[1,1,1,1],
  104. startTime:'',
  105. endTime:''
  106. },
  107. teamList:[
  108. {id:1,name:'甜梦巧克力有限公司',select:false},
  109. {id:2,name:'美银证券',select:false},
  110. {id:3,name:'中国银行',select:false}
  111. ],
  112. minStartTime:new Date().getTime(),
  113. minEndTime:''
  114. }
  115. },
  116. onReady() {
  117. this.$refs.datetimePicker1.setFormatter(this.formatter)
  118. this.$refs.datetimePicker2.setFormatter(this.formatter)
  119. },
  120. methods:{
  121. formatter(type, value) {
  122. if (type === 'year') {
  123. return `${value}年`
  124. }
  125. if (type === 'month') {
  126. return `${value}月`
  127. }
  128. if (type === 'day') {
  129. return `${value}日`
  130. }
  131. return value
  132. },
  133. valChange(e){
  134. this.dto.submitNum = e;
  135. },
  136. handlePreview(){
  137. uni.navigateTo({
  138. url:'/pagesPublish/questionnairePreview'
  139. })
  140. },
  141. selectTeam(item,index){
  142. this.teamList.forEach((t,i)=>{
  143. this.$set(this.teamList[i],'select',i===index)
  144. })
  145. },
  146. addTeam(){
  147. uni.navigateTo({
  148. url:'/pagesPublish/fillTeamInfo?type=add',
  149. events:{
  150. saveTeamInfo: data =>{
  151. console.log(data);
  152. }
  153. }
  154. })
  155. },
  156. confirmTeam(){
  157. this.teamShow = false;
  158. },
  159. startConfirm(e){
  160. this.dto.startTime = e.value;
  161. this.minEndTime = e.value;
  162. this.startShow = false;
  163. },
  164. endConfirm(e){
  165. this.dto.endTime = e.value;
  166. this.endShow = false;
  167. },
  168. confirmPublish(){
  169. uni.navigateTo({
  170. url:'/pagesPublish/publishResult'
  171. })
  172. }
  173. }
  174. }
  175. </script>
  176. <style scoped lang="scss">
  177. .default_page{
  178. padding: 0 24rpx 182rpx;
  179. box-sizing: border-box;
  180. .box{
  181. background: #FFFFFF;
  182. box-shadow: inset 0rpx -1rpx 0rpx 0rpx rgba(229,231,235,0.5);
  183. border-radius: 24rpx;
  184. margin-top: 20rpx;
  185. &-title,&-title>text{
  186. font-family: PingFang-SC, PingFang-SC;
  187. font-weight: bold;
  188. font-size: 32rpx;
  189. color: #002846;
  190. line-height: 32rpx;
  191. }
  192. &-tip{
  193. font-family: PingFangSC, PingFang SC;
  194. font-weight: 400;
  195. font-size: 30rpx;
  196. color: #667E90;
  197. line-height: 32rpx;
  198. overflow: hidden;
  199. text-overflow: ellipsis;
  200. white-space: nowrap;
  201. }
  202. &-left{
  203. width: calc(100% - 150rpx);
  204. }
  205. &-right{
  206. &>text{
  207. font-family: PingFangSC, PingFang SC;
  208. font-weight: 400;
  209. font-size: 26rpx;
  210. color: #33A7A7;
  211. line-height: 32rpx;
  212. }
  213. &>image{
  214. width: 32rpx;
  215. height: 32rpx;
  216. margin-left: 10rpx;
  217. }
  218. }
  219. &-team{
  220. margin-top: 31rpx;
  221. &>image{
  222. width: 36rpx;
  223. height: 36rpx;
  224. }
  225. }
  226. &-time{
  227. padding: 33rpx 0;
  228. box-shadow: inset 0rpx -1rpx 0rpx 0rpx rgba(229,231,235,0.5);
  229. &-left{
  230. font-family: PingFangSC, PingFang SC;
  231. font-weight: 400;
  232. font-size: 30rpx;
  233. color: #002846;
  234. line-height: 32rpx;
  235. }
  236. &-right{
  237. &>text{
  238. font-family: PingFangSC, PingFang SC;
  239. font-weight: 400;
  240. font-size: 30rpx;
  241. color: #667E90;
  242. line-height: 32rpx;
  243. }
  244. &>image{
  245. width: 36rpx;
  246. height: 36rpx;
  247. margin-left: 10rpx;
  248. }
  249. }
  250. }
  251. &-num{
  252. margin-top: 65rpx;
  253. &-left{
  254. font-family: PingFangSC, PingFang SC;
  255. font-weight: 400;
  256. font-size: 30rpx;
  257. color: #002846;
  258. line-height: 32rpx;
  259. }
  260. }
  261. &-add{
  262. width: 120rpx;
  263. height: 54rpx;
  264. border-radius: 27rpx;
  265. border: 1rpx solid #33A7A7;
  266. font-family: PingFang-SC, PingFang-SC;
  267. font-weight: bold;
  268. font-size: 24rpx;
  269. color: #33A7A7;
  270. line-height: 54rpx;
  271. text-align: center;
  272. }
  273. &-user{
  274. margin-top: 21rpx;
  275. &-item{
  276. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  277. border-radius: 24rpx;
  278. padding: 30rpx 0 36rpx;
  279. &-left{
  280. &-name{
  281. text{
  282. font-family: PingFangSC, PingFang SC;
  283. font-weight: 400;
  284. font-size: 30rpx;
  285. color: #002846;
  286. line-height: 32rpx;
  287. }
  288. .type{
  289. background: #F8F4F8;
  290. border-radius: 21rpx;
  291. margin-left: 20rpx;
  292. padding: 5rpx 16rpx;
  293. font-family: PingFangSC, PingFang SC;
  294. font-weight: 400;
  295. font-size: 22rpx;
  296. color: #9F6196;
  297. line-height: 30rpx;
  298. text-align: center;
  299. }
  300. }
  301. &-email{
  302. font-family: PingFangSC, PingFang SC;
  303. font-weight: 400;
  304. font-size: 28rpx;
  305. color: #667E90;
  306. line-height: 28rpx;
  307. margin-top: 20rpx;
  308. }
  309. }
  310. &-right{
  311. width: 36rpx;
  312. height: 36rpx;
  313. }
  314. }
  315. }
  316. }
  317. .bottom{
  318. width: 100%;
  319. height: 162rpx;
  320. background: #FFFFFF;
  321. padding: 20rpx 50rpx;
  322. box-sizing: border-box;
  323. position: fixed;
  324. left: 0;
  325. bottom: 0;
  326. z-index: 888;
  327. }
  328. .dialog{
  329. position: fixed;
  330. left: 0;
  331. right: 0;
  332. top: 0;
  333. bottom: 0;
  334. z-index: 1000;
  335. background: rgba(0, 0, 0, .4);
  336. justify-content: flex-end;
  337. .dbox{
  338. width: 100%;
  339. height: 1200rpx;
  340. background: #FFFFFF;
  341. box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(0,0,0,0.07);
  342. border-radius: 24rpx 24rpx 0rpx 0rpx;
  343. padding: 41rpx 30rpx 64rpx;
  344. box-sizing: border-box;
  345. position: relative;
  346. .db-top{
  347. font-family: PingFang-SC, PingFang-SC;
  348. font-weight: bold;
  349. font-size: 36rpx;
  350. color: #002846;
  351. line-height: 36rpx;
  352. text-align: center;
  353. }
  354. .db-close{
  355. width: 48rpx;
  356. height: 48rpx;
  357. position: absolute;
  358. top: 35rpx;
  359. right: 30rpx;
  360. }
  361. .db-list{
  362. flex: 1;
  363. overflow-y: auto;
  364. margin-top: 58rpx;
  365. &-item{
  366. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  367. padding: 39rpx 0;
  368. &-left{
  369. font-family: PingFangSC, PingFang SC;
  370. font-weight: 400;
  371. font-size: 32rpx;
  372. color: #002846;
  373. line-height: 32rpx;
  374. &.active{
  375. font-weight: bold;
  376. color: #009191;
  377. }
  378. }
  379. }
  380. }
  381. .db-bottom{
  382. width: 100%;
  383. height: 88rpx;
  384. background: rgba(25,156,156,0.1);
  385. border-radius: 44rpx;
  386. font-family: PingFang-SC, PingFang-SC;
  387. font-weight: bold;
  388. font-size: 32rpx;
  389. color: #009191;
  390. line-height: 88rpx;
  391. text-align: center;
  392. margin-top: 40rpx;
  393. }
  394. }
  395. }
  396. }
  397. </style>