questionnaireEdit.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. <cus-select :show="teamShow" :list="teamList" :addShow="true" @close="teamShow=false" @confirmTeam="confirmTeam"></cus-select>
  72. <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>
  73. <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>
  74. </view>
  75. </template>
  76. <script>
  77. import CusNumberBox from '@/components/CusNumberBox/index.vue'
  78. import CusSelect from '@/components/CusSelect/index.vue'
  79. export default {
  80. components:{ CusNumberBox, CusSelect },
  81. data(){
  82. return {
  83. limit:true,
  84. teamShow:false,
  85. startShow:false,
  86. endShow:false,
  87. dto:{
  88. submitNum:1,
  89. userList:[1,1,1,1],
  90. startTime:'',
  91. endTime:''
  92. },
  93. teamList:[
  94. {id:1,name:'甜梦巧克力有限公司',select:false},
  95. {id:2,name:'美银证券',select:false},
  96. {id:3,name:'中国银行',select:false}
  97. ],
  98. minStartTime:new Date().getTime(),
  99. minEndTime:''
  100. }
  101. },
  102. onReady() {
  103. this.$refs.datetimePicker1.setFormatter(this.formatter)
  104. this.$refs.datetimePicker2.setFormatter(this.formatter)
  105. },
  106. methods:{
  107. formatter(type, value) {
  108. if (type === 'year') {
  109. return `${value}年`
  110. }
  111. if (type === 'month') {
  112. return `${value}月`
  113. }
  114. if (type === 'day') {
  115. return `${value}日`
  116. }
  117. return value
  118. },
  119. valChange(e){
  120. this.dto.submitNum = e;
  121. },
  122. handlePreview(){
  123. uni.navigateTo({
  124. url:'/pagesPublish/questionnairePreview'
  125. })
  126. },
  127. addTeam(){
  128. uni.navigateTo({
  129. url:'/pagesPublish/fillTeamInfo?type=add',
  130. events:{
  131. saveTeamInfo: data =>{
  132. console.log(data);
  133. }
  134. }
  135. })
  136. },
  137. confirmTeam(){
  138. this.teamShow = false;
  139. },
  140. startConfirm(e){
  141. this.dto.startTime = e.value;
  142. this.minEndTime = e.value;
  143. this.startShow = false;
  144. },
  145. endConfirm(e){
  146. this.dto.endTime = e.value;
  147. this.endShow = false;
  148. },
  149. confirmPublish(){
  150. uni.navigateTo({
  151. url:'/pagesPublish/publishResult'
  152. })
  153. }
  154. }
  155. }
  156. </script>
  157. <style scoped lang="scss">
  158. .default_page{
  159. padding: 0 24rpx 182rpx;
  160. box-sizing: border-box;
  161. .box{
  162. background: #FFFFFF;
  163. box-shadow: inset 0rpx -1rpx 0rpx 0rpx rgba(229,231,235,0.5);
  164. border-radius: 24rpx;
  165. margin-top: 20rpx;
  166. &-title,&-title>text{
  167. font-family: PingFang-SC, PingFang-SC;
  168. font-weight: bold;
  169. font-size: 32rpx;
  170. color: #002846;
  171. line-height: 32rpx;
  172. }
  173. &-tip{
  174. font-family: PingFangSC, PingFang SC;
  175. font-weight: 400;
  176. font-size: 30rpx;
  177. color: #667E90;
  178. line-height: 32rpx;
  179. overflow: hidden;
  180. text-overflow: ellipsis;
  181. white-space: nowrap;
  182. }
  183. &-left{
  184. width: calc(100% - 150rpx);
  185. }
  186. &-right{
  187. &>text{
  188. font-family: PingFangSC, PingFang SC;
  189. font-weight: 400;
  190. font-size: 26rpx;
  191. color: #33A7A7;
  192. line-height: 32rpx;
  193. }
  194. &>image{
  195. width: 32rpx;
  196. height: 32rpx;
  197. margin-left: 10rpx;
  198. }
  199. }
  200. &-team{
  201. margin-top: 31rpx;
  202. &>image{
  203. width: 36rpx;
  204. height: 36rpx;
  205. }
  206. }
  207. &-time{
  208. padding: 33rpx 0;
  209. box-shadow: inset 0rpx -1rpx 0rpx 0rpx rgba(229,231,235,0.5);
  210. &-left{
  211. font-family: PingFangSC, PingFang SC;
  212. font-weight: 400;
  213. font-size: 30rpx;
  214. color: #002846;
  215. line-height: 32rpx;
  216. }
  217. &-right{
  218. &>text{
  219. font-family: PingFangSC, PingFang SC;
  220. font-weight: 400;
  221. font-size: 30rpx;
  222. color: #667E90;
  223. line-height: 32rpx;
  224. }
  225. &>image{
  226. width: 36rpx;
  227. height: 36rpx;
  228. margin-left: 10rpx;
  229. }
  230. }
  231. }
  232. &-num{
  233. margin-top: 65rpx;
  234. &-left{
  235. font-family: PingFangSC, PingFang SC;
  236. font-weight: 400;
  237. font-size: 30rpx;
  238. color: #002846;
  239. line-height: 32rpx;
  240. }
  241. }
  242. &-add{
  243. width: 120rpx;
  244. height: 54rpx;
  245. border-radius: 27rpx;
  246. border: 1rpx solid #33A7A7;
  247. font-family: PingFang-SC, PingFang-SC;
  248. font-weight: bold;
  249. font-size: 24rpx;
  250. color: #33A7A7;
  251. line-height: 54rpx;
  252. text-align: center;
  253. }
  254. &-user{
  255. margin-top: 21rpx;
  256. &-item{
  257. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EFEFEF;
  258. border-radius: 24rpx;
  259. padding: 30rpx 0 36rpx;
  260. &-left{
  261. &-name{
  262. text{
  263. font-family: PingFangSC, PingFang SC;
  264. font-weight: 400;
  265. font-size: 30rpx;
  266. color: #002846;
  267. line-height: 32rpx;
  268. }
  269. .type{
  270. background: #F8F4F8;
  271. border-radius: 21rpx;
  272. margin-left: 20rpx;
  273. padding: 5rpx 16rpx;
  274. font-family: PingFangSC, PingFang SC;
  275. font-weight: 400;
  276. font-size: 22rpx;
  277. color: #9F6196;
  278. line-height: 30rpx;
  279. text-align: center;
  280. }
  281. }
  282. &-email{
  283. font-family: PingFangSC, PingFang SC;
  284. font-weight: 400;
  285. font-size: 28rpx;
  286. color: #667E90;
  287. line-height: 28rpx;
  288. margin-top: 20rpx;
  289. }
  290. }
  291. &-right{
  292. width: 36rpx;
  293. height: 36rpx;
  294. }
  295. }
  296. }
  297. }
  298. .bottom{
  299. width: 100%;
  300. height: 162rpx;
  301. background: #FFFFFF;
  302. padding: 20rpx 50rpx;
  303. box-sizing: border-box;
  304. position: fixed;
  305. left: 0;
  306. bottom: 0;
  307. z-index: 888;
  308. }
  309. }
  310. </style>