reportList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <div>
  3. <section class="main-section">
  4. <div class="el-main-title">
  5. <div class="title-left-icon" />
  6. <div class="title-left-name">提测报告</div>
  7. </div>
  8. <div class="detail-info">
  9. <el-table
  10. :data="testData"
  11. size="small"
  12. :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500', textAlign: 'center' }"
  13. show-overflow-tooltip="true"
  14. max-height="300"
  15. >
  16. <el-table-column label="标题名称" min-width="150">
  17. <template slot-scope="scope">
  18. <span class="btn" @click="toReportView(scope.row, 2)">{{ scope.row.name }}</span>
  19. </template>
  20. </el-table-column>
  21. <el-table-column label="状态" min-width="100" align="center">
  22. <template slot-scope="scope">
  23. <span :style="{color: stColors[scope.row.status]}"> {{ scope.row.statusString }} </span>
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="创建人" min-width="100" align="center">
  27. <template slot-scope="scope">{{ scope.row.createrObject.name }}</template>
  28. </el-table-column>
  29. <el-table-column label="创建日期" min-width="150" align="center">
  30. <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
  31. </el-table-column>
  32. <el-table-column label="操作" width="200">
  33. <template slot-scope="scope">
  34. <div v-if="scope.row.status === 1 ? false : true">
  35. <span v-if="scope.row.status === 3 ? true : false" class="btn" @click="back(1,scope.row.id, scope.row)">通过</span>
  36. <span v-if="scope.row.status === 3 ? true : false" style="margin-left: 30px;" class="btn" @click="back(2,scope.row.id, scope.row)">打回</span>
  37. <span v-if="scope.row.status === 0 ? true : false" class="btn" @click="back(5,scope.row.id, scope.row)">发送</span>
  38. <span v-if="scope.row.status === 0 ? true : false" style="margin: 0 30px;" class="btn" @click="back(6,scope.row.id, scope.row)">编辑</span>
  39. <span v-if="scope.row.status === 0 ? true : false" class="btn" @click="back(4,scope.row.id, scope.row )">删除</span>
  40. <span v-if="scope.row.status === 2 ? true : false" class="btn" @click="back(3,scope.row.id, scope.row)">重新提测</span>
  41. <el-dialog :title="titName" :visible.sync="dialog_testData" width="30%" :close-on-click-modal="false">
  42. <div style="position: absolute; top: 23px; left: 12px;width:4px;height:17px;background:#409EFF;border-radius:1px;" />
  43. <div align="center">
  44. <div>是否{{ Str }}以下提测?</div>
  45. <div style="color: #f79232;">{{ requireName }}</div>
  46. </div>
  47. <el-input v-show="Str === '打回'" v-model="CallBackTheReason" type="textarea" placeholder="请输入打回原因..." :rows="3" />
  48. <span slot="footer" class="dialog-footer">
  49. <el-button type="primary" size="mini" @click="passOrBackSend()">确 定</el-button>
  50. <el-button type="danger" size="mini" @click="endDialog">取 消</el-button>
  51. </span>
  52. </el-dialog>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <el-col :span="24">
  58. <div align="right">
  59. <el-pagination
  60. :page-sizes="[5, 10, 15, testPages.total]"
  61. :current-page="testPages.curIndex"
  62. :page-size="testPages.pageSize"
  63. background
  64. layout="total, sizes, prev, pager, next, jumper"
  65. :total="testPages.total"
  66. @size-change="testSizeChange"
  67. @current-change="testCurrentChange"
  68. />
  69. </div>
  70. </el-col>
  71. </div>
  72. </section>
  73. <section class="main-section">
  74. <div class="el-main-title">
  75. <div class="title-left-icon" />
  76. <div class="title-left-name">日报报告</div>
  77. </div>
  78. <div class="detail-info">
  79. <el-table :data="dailyData" size="small" :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500', textAlign: 'center' }" show-overflow-tooltip="true">
  80. <el-table-column label="标题名称" min-width="100" align="center">
  81. <template slot-scope="scope">
  82. <a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row, 0)">{{ scope.row.reportName }}</a>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="状态" min-width="100" align="center">
  86. <template slot-scope="scope">{{ scope.row.statusString }}</template>
  87. </el-table-column>
  88. <el-table-column label="创建人" min-width="100" align="center">
  89. <template slot-scope="scope">{{ scope.row.createrObject.name }}</template>
  90. </el-table-column>
  91. <el-table-column label="创建日期" min-width="100" align="center">
  92. <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
  93. </el-table-column>
  94. </el-table>
  95. <el-col :span="24">
  96. <div align="right">
  97. <el-pagination
  98. :page-sizes="[5, 10, 15, dailyPages.total]"
  99. :current-page="dailyPages.curIndex"
  100. :page-size="dailyPages.pageSize"
  101. background
  102. layout="total, sizes, prev, pager, next, jumper"
  103. :total="dailyPages.total"
  104. @size-change="dailySizeChange"
  105. @current-change="dailyCurrentChange"
  106. />
  107. </div>
  108. </el-col>
  109. </div>
  110. </section>
  111. <section class="main-section">
  112. <div class="el-main-title">
  113. <div class="title-left-icon" />
  114. <div class="title-left-name">准出报告</div>
  115. </div>
  116. <div class="detail-info">
  117. <el-table :data="clientData" size="small" :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500', textAlign: 'center' }" show-overflow-tooltip="true">
  118. <el-table-column label="标题名称" min-width="100" align="center">
  119. <template slot-scope="scope">
  120. <a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row, 1)">{{ scope.row.reportName }}</a>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="状态" min-width="100" align="center">
  124. <template slot-scope="scope">{{ scope.row.reportStatusString }}</template>
  125. </el-table-column>
  126. <el-table-column label="创建人" min-width="100" align="center">
  127. <template slot-scope="scope">{{ scope.row.createrObject.name }}</template>
  128. </el-table-column>
  129. <el-table-column label="创建日期" min-width="100" align="center">
  130. <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
  131. </el-table-column>
  132. </el-table>
  133. <el-col :span="24">
  134. <div align="right">
  135. <el-pagination
  136. :page-sizes="[5, 10, 15, clientPages.total]"
  137. :current-page="clientPages.curIndex"
  138. :page-size="clientPages.pageSize"
  139. background
  140. layout="total, sizes, prev, pager, next, jumper"
  141. :total="clientPages.total"
  142. @size-change="clientSizeChange"
  143. @current-change="clientCurrentChange"
  144. />
  145. </div>
  146. </el-col>
  147. </div>
  148. </section>
  149. <!-- 弹框 -->
  150. <Test-report v-if="dialogTest" ref="TestReport" />
  151. <Daily-report v-if="dialogDaily" ref="DailyReport" />
  152. <Client-report v-if="dialogClient" ref="ClientReport" />
  153. </div>
  154. </template>
  155. <script>
  156. import {
  157. dailyReport,
  158. projectTestReport,
  159. launchTest,
  160. launchTestUpdate,
  161. launchTestDelete
  162. } from '@/api/taskIndex' // ajax
  163. import TestReport from '@/views/Platform/presentation/Templates/TestReport' // 提测
  164. import DailyReport from '@/views/Platform/presentation/Templates/DailyReport' // 日报
  165. import ClientReport from '@/views/Platform/presentation/Templates/ClientReport' // 准出
  166. export default {
  167. components: {
  168. TestReport,
  169. DailyReport,
  170. ClientReport
  171. },
  172. data() {
  173. return {
  174. userInformation: localStorage.getItem('username'),
  175. userNames: localStorage.getItem('realname'),
  176. taskId: Number(this.$route.query.id), // 任务id
  177. stColors: ['#409EFF', '#07BCA4', '#F56C6C', '#07BCA4'],
  178. dialog_testData: false, // 打回弹窗
  179. CallBackTheReason: '', // 打回原因
  180. CallBackStatus: '', // 打回状态
  181. CallBackId: '', // 打回id
  182. titName: '', // 打回title
  183. Str: '', // 打回操作名称
  184. requireName: '', // 归属需求name
  185. testData: [], // 提测信息
  186. testPages: { // 提测分页
  187. curIndex: 1,
  188. pageSize: 5,
  189. total: 0
  190. },
  191. dailyData: [], // 日报信息
  192. dailyPages: { // 提测分页
  193. curIndex: 1,
  194. pageSize: 5,
  195. total: 0
  196. },
  197. clientData: [], // 准出信息
  198. clientPages: {// 准出分页
  199. curIndex: 1,
  200. pageSize: 5,
  201. total: 0
  202. },
  203. dialogTest: false, // 新建提测报告
  204. dialogDaily: false, // 新建日报报告
  205. dialogClient: false // 新建准出报告
  206. }
  207. },
  208. created() {
  209. this.getTest()
  210. this.getDaily()
  211. this.getClient()
  212. },
  213. methods: {
  214. async getTest() { // 获取提测
  215. const params = { taskId: this.taskId, curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
  216. const res = await launchTest(params)
  217. if (res.code === 200) {
  218. this.testData = res.data.list
  219. this.testPages.total = res.data.total
  220. }
  221. },
  222. async getDaily() { // 获取日报
  223. const params = { taskId: this.taskId, curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
  224. const res = await dailyReport(params)
  225. if (res.code === 200) {
  226. this.dailyData = res.data.list
  227. this.dailyPages.total = res.data.total
  228. }
  229. },
  230. async getClient() { // 获取准出
  231. const params = { taskId: this.taskId, curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
  232. const res = await projectTestReport(params)
  233. if (res.code === 200) {
  234. this.clientData = res.data.list
  235. this.clientPages.total = res.data.total
  236. }
  237. },
  238. testSizeChange(e) { // 提测分页
  239. this.testPages.pageSize = e
  240. this.getTest()
  241. },
  242. testCurrentChange(e) { // 提测分页
  243. this.testPages.curIndex = e
  244. this.getTest()
  245. },
  246. dailySizeChange(e) { // 日报分页
  247. this.dailyPages.pageSize = e
  248. this.getDaily()
  249. },
  250. dailyCurrentChange(e) { // 日报分页
  251. this.dailyPages.curIndex = e
  252. this.getDaily()
  253. },
  254. clientSizeChange(e) { // 准出分页
  255. this.clientPages.pageSize = e
  256. this.getClient()
  257. },
  258. clientCurrentChange(e) { // 准出分页
  259. this.clientPages.curIndex = e
  260. this.getClient()
  261. },
  262. async passOrBackSend() { // 提测打回
  263. this.dialog_testData = false
  264. const launchTestInfo = { status: this.CallBackStatus, id: this.CallBackId }
  265. const userData = { id: '', ename: this.userInformation, name: this.userNames }
  266. const objData = { launchTestInfo: launchTestInfo, user: userData }
  267. if (this.Str === '通过' || this.Str === '打回') {
  268. const res = await launchTestUpdate(objData)
  269. if (res.code === 200) {
  270. this.getTest()
  271. this.$message({ message: res.msg, type: 'success', offset: 150 })
  272. } else {
  273. this.$message({ message: res.msg, type: 'error', offset: 150 })
  274. }
  275. } else if (this.Str === '删除') {
  276. const res = await launchTestDelete(userData, this.CallBackId)
  277. if (res.code === 200) {
  278. this.$message({ type: 'success', message: '删除成功' })
  279. }
  280. }
  281. },
  282. endDialog() { // 结束对话框
  283. this.dialog_testData = false
  284. this.$message({ type: 'warning', message: '已取消' })
  285. },
  286. toReportView(ele, index) { // 进入报告详情页
  287. switch (index) {
  288. case 0:
  289. this.dialogDaily = true
  290. this.$nextTick(() => {
  291. this.$refs.DailyReport.init(3, ele)
  292. })
  293. break
  294. case 1:
  295. this.dialogClient = true
  296. this.$nextTick(() => {
  297. this.$refs.ClientReport.init(3, ele)
  298. })
  299. break
  300. case 2:
  301. this.dialogTest = true
  302. this.$nextTick(() => {
  303. this.$refs.TestReport.init(3, ele)
  304. })
  305. break
  306. }
  307. },
  308. back(e, ele, data) { // 打回
  309. this.requireName = data.name
  310. this.CallBackStatus = e
  311. this.CallBackId = ele
  312. switch (e) {
  313. case 1:
  314. this.dialog_testData = true
  315. this.titName = '提测确认'
  316. this.Str = '通过'
  317. break
  318. case 2:
  319. this.dialog_testData = true
  320. this.titName = '提测确认'
  321. this.Str = '打回'
  322. break
  323. case 3:
  324. data.taskIds = [Number(this.taskId)]
  325. this.dialogTest = true
  326. this.$nextTick(() => {
  327. this.$refs.TestReport.init(4, data)
  328. })
  329. break
  330. case 4:
  331. this.dialog_testData = true
  332. this.titName = '删除确认'
  333. this.Str = '删除'
  334. break
  335. case 5:
  336. this.dialogTest = true
  337. this.$nextTick(() => {
  338. this.$refs.TestReport.init(3, data)
  339. })
  340. break
  341. case 6:
  342. this.dialogTest = true
  343. this.$nextTick(() => {
  344. this.$refs.TestReport.init(2, data)
  345. })
  346. break
  347. }
  348. }
  349. }
  350. }
  351. </script>
  352. <style lang="scss" scoped>
  353. @import '@/styles/detail-pages.scss';
  354. .main-section {
  355. @include main-section;
  356. overflow: auto;
  357. .detail-info {
  358. padding: 0 34px 20px 34px;
  359. }
  360. }
  361. .btn{
  362. cursor: pointer;
  363. }
  364. </style>