questionnaire.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div class="page">
  3. <div class="top adfacjb">
  4. <div class="t_l">
  5. <p>问卷调研</p>
  6. <p class="tip">创建和管理PERILL评估问卷</p>
  7. </div>
  8. <div class="t_r">
  9. <!-- <el-button type="primary" icon="el-icon-plus">发送问卷</el-button> -->
  10. </div>
  11. </div>
  12. <div class="query adfacjb">
  13. <el-select v-model="queryParams.questionnaireId" placeholder="问卷" style="width: calc(100% - 324px);" @change="getList" clearable>
  14. <el-option v-for="item in useAgentStore().questionnaireList" :key="item.id" :label="item.title" :value="item.id"/>
  15. </el-select>
  16. <el-select v-model="queryParams.status" placeholder="全部状态" style="width: 300px;" @change="getList" clearable>
  17. <el-option label="进行中" :value="0"></el-option>
  18. <el-option label="已完成" :value="1"></el-option>
  19. </el-select>
  20. </div>
  21. <div class="list">
  22. <div class="l_item" v-for="(item, index) in dataList" :key="index">
  23. <div class="li_top adfacjb">
  24. <div class="lt_l">项目名称:{{ item.programName }}</div>
  25. <div class="lt_r adfac">
  26. <div class="lr_pre adfac" v-hasPermi="['core:questionnaire:info']" @click="handleSchedule(item)">
  27. <img src="@/assets/images/agent/send_mini.png">
  28. <span>查看进度</span>
  29. </div>
  30. <div class="lr_pre adfac" v-hasPermi="['core:questionnaire:info']" @click="handleSchedule(item)">
  31. <img src="@/assets/images/agent/report_mini.png">
  32. <span>生成报告</span>
  33. </div>
  34. <div class="lr_status" :class="{'jxz':item.status===0,'ywc':item.status===1}">{{ item.status===0?'进行中':(item.status===1?'已完成':'未知') }}</div>
  35. </div>
  36. </div>
  37. <div class="li_team">公司名称:{{ item.enterpriseName }}</div>
  38. <div class="li_team">团队名称:{{ item.teamName }}</div>
  39. <div class="li_wj">问卷名称:{{ item.title }}</div>
  40. <div class="li_time_person adf">
  41. <div class="ltp">发布时间:{{ item.startTime }}</div>
  42. <div class="ltp">截止时间:{{ item.endTime }}</div>
  43. <div class="ltp">团队成员:<span>{{ item.finishNum||0 }}/{{item.userNum||0}}</span>完成</div>
  44. <div class="ltp">发送人:{{ item.creatorName }}</div>
  45. </div>
  46. <div class="li_jd">
  47. <div class="lj" :style="{'width':(item.finishNum/item.userNum*100)+'%'}"></div>
  48. </div>
  49. <div class="li_text adfacjb">
  50. <span>完成情况</span>
  51. <span>{{ ((item.finishNum/item.userNum)*100).toFixed(0) }}%</span>
  52. </div>
  53. </div>
  54. <el-row style="display: flex;justify-content: center;">
  55. <el-pagination
  56. @size-change="handleSizeChange"
  57. @current-change="handleCurrentChange"
  58. :current-page="queryParams.page"
  59. :page-sizes="[2, 5, 10]"
  60. :page-size="2"
  61. layout="total, sizes, prev, pager, next, jumper"
  62. :total="total"
  63. v-show="total > 0">
  64. </el-pagination>
  65. </el-row>
  66. </div>
  67. </div>
  68. </template>
  69. <script setup name="">
  70. import { ref, getCurrentInstance, onMounted } from 'vue'
  71. import {useAgentStore} from "@/store_v3/modules/agent";
  72. import { getTeamQuestionnaireList } from "@/api/agent/index.js";
  73. const { proxy } = getCurrentInstance();
  74. useAgentStore().getQuestionnaireData();
  75. const queryParams = ref({
  76. page:1,
  77. limit:2,
  78. questionnaireId: '',
  79. status: '',
  80. })
  81. const total = ref(0)
  82. const dataList = ref([])
  83. const handleSchedule = (item) => {
  84. proxy.$router.push({
  85. path: '/agentQuestionnaireSchedule',
  86. query:{
  87. id: item.id,
  88. questionnaireName: item.title,
  89. enterpriseName: item.enterpriseName,
  90. programName: item.programName,
  91. teamName: item.teamName,
  92. startTime: item.startTime,
  93. endTime: item.endTime,
  94. userNum: item.userNum,
  95. finishNum: item.finishNum
  96. }
  97. })
  98. }
  99. const getList = () => {
  100. let query = {...queryParams.value};
  101. getTeamQuestionnaireList(query).then(res=>{
  102. if(res.code!==0) return proxy.$message.error(res.msg)
  103. dataList.value = res.data.list;
  104. total.value = res.data.total;
  105. })
  106. }
  107. const handleSizeChange = (e)=>{
  108. queryParams.value.limit = e;
  109. getList();
  110. }
  111. const handleCurrentChange = (e)=>{
  112. queryParams.value.page = e;
  113. getList();
  114. }
  115. onMounted(()=>{
  116. getList()
  117. })
  118. </script>
  119. <style scoped lang="scss">
  120. .page{
  121. padding: 28px 20px;
  122. background: #FAFAFA;
  123. .top{
  124. .t_l{
  125. p{
  126. font-family: PingFang-SC, PingFang-SC;
  127. font-weight: bold;
  128. font-size: 16px;
  129. color: #252525;
  130. line-height: 16px;
  131. &.tip{
  132. font-family: PingFangSC, PingFang SC;
  133. font-weight: 400;
  134. font-size: 14px;
  135. color: #6B7280;
  136. line-height: 14px;
  137. margin-top: 16px;
  138. }
  139. }
  140. }
  141. }
  142. .query{
  143. width: 100%;
  144. padding: 16px 20px;
  145. box-sizing: border-box;
  146. background: #FFFFFF;
  147. border-radius: 6px;
  148. border: 1px solid #F3F4F6;
  149. margin-top: 16px;
  150. }
  151. .list{
  152. width: 100%;
  153. height: calc(100vh - 196px);
  154. overflow-y: auto;
  155. margin-top: 4px;
  156. .l_item{
  157. width: 100%;
  158. padding: 20px 24px;
  159. box-sizing: border-box;
  160. margin-top: 16px;
  161. background: #FFFFFF;
  162. border-radius: 6px;
  163. border: 1px solid #F3F4F6;
  164. .li_top{
  165. .lt_l{
  166. font-family: PingFang-SC, PingFang-SC;
  167. font-weight: bold;
  168. font-size: 14px;
  169. color: #252525;
  170. line-height: 14px;
  171. overflow: hidden;
  172. text-overflow: ellipsis;
  173. white-space: nowrap;
  174. }
  175. .lt_r{
  176. .lr_pre{
  177. cursor: pointer;
  178. margin-right: 36px;
  179. img{
  180. width: 20px;
  181. height: 20px;
  182. }
  183. span{
  184. font-family: PingFangSC, PingFang SC;
  185. font-weight: 400;
  186. font-size: 14px;
  187. color: #6B7280;
  188. line-height: 20px;
  189. margin-left: 8px;
  190. }
  191. }
  192. .lr_status{
  193. width: 76px;
  194. height: 24px;
  195. border-radius: 12px;
  196. font-family: PingFangSC, PingFang SC;
  197. font-weight: 400;
  198. font-size: 14px;
  199. line-height: 24px;
  200. text-align: center;
  201. &.jxz{
  202. background: #FCECB6;
  203. color: #864F10;
  204. }
  205. &.ywc{
  206. background: rgba(0,145,145,0.1);
  207. color: #009191;
  208. }
  209. }
  210. }
  211. }
  212. .li_team{
  213. font-family: PingFangSC, PingFang SC;
  214. font-weight: 400;
  215. font-size: 14px;
  216. color: #6B7280;
  217. line-height: 14px;
  218. margin-top: 16px;
  219. }
  220. .li_wj{
  221. font-family: PingFang-SC, PingFang-SC;
  222. font-weight: bold;
  223. font-size: 14px;
  224. color: #252525;
  225. line-height: 16px;
  226. margin-top: 24px;
  227. }
  228. .li_time_person{
  229. margin-top: 16px;
  230. .ltp{
  231. font-family: PingFangSC, PingFang SC;
  232. font-weight: 400;
  233. font-size: 14px;
  234. color: #6B7280;
  235. line-height: 14px;
  236. margin-right: 142px;
  237. span{
  238. font-weight: bold;
  239. font-size: 16px;
  240. color: #761E6A;
  241. }
  242. }
  243. }
  244. .li_jd{
  245. width: 100%;
  246. height: 8px;
  247. background: #F3F4F6;
  248. border-radius: 4px;
  249. position: relative;
  250. margin-top: 20px;
  251. .lj{
  252. height: 100%;
  253. background: linear-gradient( 270deg, #9D5F94 0%, #761E6A 100%);
  254. border-radius: 4px;
  255. position: absolute;
  256. left: 0;
  257. top: 0;
  258. }
  259. }
  260. .li_text{
  261. margin-top: 10px;
  262. span{
  263. font-family: PingFangSC, PingFang SC;
  264. font-weight: 400;
  265. font-size: 14px;
  266. color: #646464;
  267. line-height: 14px;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. </style>