schedule.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <div class="page">
  3. <div class="top adfac">
  4. <img src="@/assets/images/agent/arrow_left.png" @click="handleBack">
  5. <span>{{ questionnaireInfo.questionnaireName }}</span>
  6. </div>
  7. <div class="content">
  8. <div class="c_top adfacjb">
  9. <div class="ct_l">
  10. <div class="cl_title">作答进度</div>
  11. </div>
  12. <div class="ct_r adfac">
  13. <div class="eb_default" style="margin-left: 20px;" @click="handleReminds">批量提醒</div>
  14. <el-button type="primary" style="margin-left: 20px;" @click="handleMoreSingleReport">批量个人报告</el-button>
  15. <el-button type="primary" style="margin-left: 20px;" @click="handleTeamReport">生成团队报告</el-button>
  16. </div>
  17. </div>
  18. <div class="c_texts adfac">
  19. <div class="cl_pre">公司名称:<span>{{ questionnaireInfo.enterpriseName }}</span></div>
  20. <div class="cl_pre">团队类型:<span>{{ questionnaireInfo.teamName }}</span></div>
  21. <div class="cl_pre">发布时间:<span>{{ questionnaireInfo.startTime }}</span></div>
  22. <div class="cl_pre">截止时间:<span>{{ questionnaireInfo.endTime }}</span></div>
  23. </div>
  24. <div class="c_nums adfac">
  25. <div class="cn_pre">团队人数:<span>{{ questionnaireInfo.userNum }}</span></div>
  26. <div class="cn_pre">已作答:<span>{{ questionnaireInfo.finishNum }}</span> 人</div>
  27. <div class="cn_pre">未作答:<span style="color: #E22D48;">{{ questionnaireInfo.userNum-questionnaireInfo.finishNum }}</span> 人</div>
  28. </div>
  29. <el-table ref="multipleTable" :data="userList" border cell-class-name="vertical-top-cell" v-loading="loading" empty-text="暂无人员" max-height="672px" style="margin-top: 16px;" @selection-change="handleSelectionChange">
  30. <el-table-column type="selection" width="55"></el-table-column>
  31. <el-table-column label="姓名" prop="realName"></el-table-column>
  32. <el-table-column label="性别" prop="gender">
  33. <template #default="{ row }">{{ genderCfg[row.gender]||'' }}</template>
  34. </el-table-column>
  35. <el-table-column label="类型" prop="category">
  36. <template #default="{ row }">{{ UserCategory.find(u=>u.value===row.category)?.label ||'未知' }}</template>
  37. </el-table-column>
  38. <el-table-column label="手机号码" prop="mobile"></el-table-column>
  39. <el-table-column label="所属部门" prop="dept"></el-table-column>
  40. <el-table-column label="职位" prop="post"></el-table-column>
  41. <el-table-column label="级别" prop="level"></el-table-column>
  42. <!-- <el-table-column label="用户标签" prop="aaa"></el-table-column> -->
  43. <!-- <el-table-column label="发送人" prop="aaa"></el-table-column> -->
  44. <!-- <el-table-column label="所属上级" prop="aaa"></el-table-column> -->
  45. <el-table-column label="状态" prop="status">
  46. <template #default="{ row }">
  47. <div class="q_status adfac" :class="{'wzd':row.status==='0','yzd':row.status==='1'}">
  48. <div class="qs_l"></div>
  49. <div class="qs_r">{{ row.status==='0'?'未作答':row.status==='1'?'已作答':'' }}</div>
  50. </div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="提交时间" prop="submitTime"></el-table-column>
  54. <el-table-column label="操作" width="150">
  55. <template #default="scope">
  56. <el-button link type="text" size="mini" @click="handleReport(scope.row)" v-if="scope.row.status==='1'">生成报告</el-button>
  57. <el-button link type="text" size="mini" @click="handleRemind(scope.row)" v-if="scope.row.status==='0'" v-hasPermi="['core:questionnaire:remind']">提醒作答</el-button>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. </div>
  62. <div class="cus_dialog adffcacjc" v-if="reportShow" @click.prevent="closeReportAlert">
  63. <div class="cus_dialog_content adffcac">
  64. <div class="cdc_title">生成报告</div>
  65. <i class="el-icon-close cdc_close" style="font-size: 20px;color: #393939;" @click.stop="closeReportAlert"></i>
  66. <img src="@/assets/images/agent/report.gif">
  67. <p>{{ questionnaireInfo.enterpriseName }} - {{ questionnaireInfo.teamName }}</p>
  68. <p>报告正在生成中,预计需要时间<span>7-10分钟</span></p>
  69. <p>可去报告管理中查看结果~</p>
  70. <div class="zt_btn" @click.stop="closeReportAlert">我知道了</div>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script setup name="">
  76. import { ref, getCurrentInstance, onMounted, nextTick } from 'vue'
  77. const { proxy } = getCurrentInstance();
  78. import { getQuestionnaireSchedule,genTeamReportById,genPersonReport } from '@/api/agent/index.js'
  79. const { UserCategory} = proxy.useDict("UserCategory");
  80. const genderCfg = { 0: '男', 1: '女', 2: '保密' }
  81. const questionnaireInfo = ref({})
  82. const multipleSelection = ref([])
  83. const userList = ref([{status:1},{status:0}])
  84. const loading = ref(false)
  85. const reportShow = ref(false)
  86. const handleBack = () => {
  87. proxy.$router.go(-1)
  88. }
  89. const handleSelectionChange = (val) => {
  90. multipleSelection.value = val;
  91. }
  92. const handleCancel = () => {
  93. multipleSelection.value = [];
  94. proxy.$refs.multipleTable.clearSelection();
  95. }
  96. const handleReminds = () => {
  97. if(!multipleSelection.value.length) return proxy.$message({ type: 'warning', message: '请勾选需要提醒的人员' })
  98. proxy.$confirm('是否确认发送通知提醒??', '警告', {
  99. confirmButtonText: '确定',
  100. confirmButtonColor:'#761E6A',
  101. cancelButtonText: '取消',
  102. type: 'warning'
  103. }).then(() => {
  104. })
  105. }
  106. const handleMoreSingleReport = () => {
  107. if(!multipleSelection.value.length) return proxy.$message({ type: 'warning', message: '请勾选需要生成报告的人员' })
  108. genPersonFn([multipleSelection.value])
  109. }
  110. const handleTeamReport = () => {
  111. genTeamReportById(questionnaireInfo.value.id).then(res => {
  112. if(res.code!==0) return proxy.$message.error(res.msg)
  113. reportShow.value = true
  114. })
  115. }
  116. const handleReport = (row) => {
  117. genPersonFn([row.id])
  118. }
  119. const genPersonFn = (ids) => {
  120. genPersonReport(ids).then(res => {
  121. if(res.code!==0) return proxy.$message.error(res.msg)
  122. reportShow.value = true
  123. })
  124. }
  125. const handleRemind = (row) => {
  126. proxy.$confirm('是否确认发送通知提醒??', '警告', {
  127. confirmButtonText: '确定',
  128. confirmButtonColor:'#761E6A',
  129. cancelButtonText: '取消',
  130. type: 'warning'
  131. }).then(() => {
  132. })
  133. }
  134. const getList = () => {
  135. loading.value = true;
  136. getQuestionnaireSchedule(questionnaireInfo.value.id).then(res => {
  137. if(res.code!==0) return proxy.$message({ type: 'error', message: res.msg })
  138. userList.value = res.data;
  139. }).finally(()=>{
  140. loading.value = false
  141. })
  142. }
  143. const closeReportAlert = () => {
  144. reportShow.value = false;
  145. }
  146. onMounted(()=>{
  147. questionnaireInfo.value = proxy.$route.query;
  148. nextTick(()=>{
  149. getList()
  150. })
  151. })
  152. </script>
  153. <style scoped lang="scss">
  154. :v-deep .el-dialog__wrapper{
  155. background: rgba(0,0,0,.3) !important;
  156. }
  157. ::v-deep .el-dialog__title{
  158. font-weight: bold !important;
  159. }
  160. ::v-deep .el-dialog{
  161. margin-top: 15vh !important;
  162. }
  163. .page{
  164. background: #FAFAFA;
  165. .top{
  166. width: 100%;
  167. height: 64px;
  168. background: #FFFFFF;
  169. border-bottom: 1px solid #F3F4F6;
  170. img{
  171. width: 36px;
  172. height: 36px;
  173. margin-left: 16px;
  174. cursor: pointer;
  175. }
  176. span{
  177. font-family: PingFangSC, PingFang SC;
  178. font-weight: 400;
  179. font-size: 14px;
  180. color: #252525;
  181. line-height: 14px;
  182. margin-left: 27px;
  183. }
  184. }
  185. .content{
  186. width: calc(100% - 24px);
  187. height: calc(100vh - 88px);
  188. margin: 12px;
  189. background: #FFFFFF;
  190. border-radius: 6px 6px 0px 0px;
  191. border: 1px solid #F3F4F6;
  192. padding: 32px 24px;
  193. box-sizing: border-box;
  194. overflow-y: auto;
  195. .c_top{
  196. .ct_l{
  197. .cl_title{
  198. font-family: PingFang-SC, PingFang-SC;
  199. font-weight: bold;
  200. font-size: 16px;
  201. color: #252525;
  202. line-height: 16px;
  203. }
  204. }
  205. .ct_r{
  206. p{
  207. font-family: PingFang-SC, PingFang-SC;
  208. font-weight: bold;
  209. font-size: 16px;
  210. color: #808080;
  211. line-height: 16px;
  212. span{
  213. color: #252525;
  214. }
  215. }
  216. }
  217. }
  218. .c_texts{
  219. margin-top: 20px;
  220. .cl_pre{
  221. width: 25%;
  222. font-family: PingFang-SC, PingFang-SC;
  223. font-weight: 400;
  224. font-size: 14px;
  225. color: #808080;
  226. line-height: 16px;
  227. span{
  228. color: #252525;
  229. margin-left: 10px;
  230. }
  231. }
  232. }
  233. .c_nums{
  234. width: 100%;
  235. height: 68px;
  236. background: rgba(118,30,106,0.06);
  237. border-radius: 6px;
  238. margin-top: 37px;
  239. padding: 0 25px;
  240. box-sizing: border-box;
  241. .cn_pre{
  242. font-family: PingFang-SC, PingFang-SC;
  243. font-weight: bold;
  244. font-size: 14px;
  245. color: #808080;
  246. margin-right: 153px;
  247. span{
  248. font-family: DINAlternate, DINAlternate;
  249. font-size: 22px;
  250. color: #1D2129;
  251. line-height: 28px;
  252. }
  253. }
  254. }
  255. }
  256. .q_status{
  257. .qs_l{
  258. width: 10px;
  259. height: 10px;
  260. border-radius: 50%;
  261. }
  262. .qs_r{
  263. font-family: PingFangSC, PingFang SC;
  264. font-weight: 400;
  265. font-size: 14px;
  266. line-height: 16px;
  267. margin-left: 12px;
  268. }
  269. &.wzd{
  270. .qs_l{
  271. background: #E22D48;
  272. }
  273. .qs_r{
  274. color: #E22D48;
  275. }
  276. }
  277. &.yzd{
  278. .qs_l{
  279. background: #009191;
  280. }
  281. .qs_r{
  282. color: #009191;
  283. }
  284. }
  285. }
  286. }
  287. .cus_dialog_content{
  288. width: 400px;
  289. background: linear-gradient( 180deg, #FDF2FB 0%, #FFFFFF 100%);
  290. border-radius: 6px;
  291. padding: 36px 68px;
  292. box-sizing: border-box;
  293. position: relative;
  294. .cdc_title{
  295. font-family: PingFang-SC, PingFang-SC;
  296. font-weight: bold;
  297. font-size: 16px;
  298. color: #252525;
  299. line-height: 16px;
  300. text-align: center;
  301. }
  302. .cdc_close{
  303. position: absolute;
  304. right: 30px;
  305. top: 36px;
  306. cursor: pointer;
  307. }
  308. img{
  309. width: 100%;
  310. }
  311. p{
  312. font-family: PingFangSC, PingFang SC;
  313. font-weight: 400;
  314. font-size: 14px;
  315. color: #393939;
  316. line-height: 24px;
  317. text-align: center;
  318. span{
  319. color: #F31616;
  320. }
  321. }
  322. .zt_btn{
  323. margin-top: 40px;
  324. }
  325. }
  326. </style>