testPresentation.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <template>
  2. <div class="eleStyle">
  3. <el-container class="header_sty">
  4. <el-header class="public_header">
  5. <el-tabs v-model="activeName" @tab-click="handleClick">
  6. <el-tab-pane label="测试日报" name="first" />
  7. <el-tab-pane label="准出报告" name="second" />
  8. <el-tab-pane label="提测报告" name="third" />
  9. </el-tabs>
  10. </el-header>
  11. <el-main class="public_main report-Layout">
  12. <div class="Layout_space_between distance">
  13. <div class="Layout_space_between">
  14. <span style="width: 100px;">{{ title }}</span>
  15. <el-input v-model="state" size="medium" filterable placeholder="报告名称搜索" style="width:100%;" @change="getList(state)" />
  16. </div>
  17. <el-button type="primary" size="medium" @click="getQueryData(1), centerDialogVisible = true">新建{{ title }}</el-button>
  18. </div>
  19. <el-table v-loading="loading" :data="tableData" size="mini" :header-cell-style="{ background: '#F2F3F6' }" border style="width: 100%" :show-overflow-tooltip="true">
  20. <el-table-column label="报告名称" min-width="280" align="center" show-overflow-tooltip>
  21. <template slot-scope="scope">
  22. <a v-if="title === '测试日报' || title === '准出报告'" href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row)">{{ scope.row.reportName }}</a>
  23. <a v-if="title === '提测报告'" href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row)">{{ scope.row.name }}</a>
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="状态" min-width="150" align="center">
  27. <template slot-scope="scope">{{ scope.row.statusString }}</template>
  28. </el-table-column>
  29. <el-table-column label="报告人" min-width="180" align="center">
  30. <template slot-scope="scope">
  31. <div v-if="title === '测试日报' || title === '准出报告'">{{ scope.row.ownner }}</div>
  32. <div v-if="title === '提测报告'">{{ scope.row.submitter }}</div>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="创建时间" min-width="280" align="center">
  36. <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
  37. </el-table-column>
  38. <el-table-column label="操作" align="center" fixed="right" min-width="230">
  39. <template slot-scope="scope">
  40. <div v-if="title === '测试日报'">
  41. <span v-if="scope.row.status === 0 ? true : false" class="didi-hover" @click="dailyButtom(5,scope.row)">发送</span>
  42. <span v-if="scope.row.status === 0 ? true : false" style="margin: 0 30px;" class="didi-hover" @click="dailyButtom(6,scope.row)">编辑</span>
  43. <span v-if="scope.row.status === 0 ? true : false" class="didi-hover" @click="report_click(4,scope.row )">删除</span>
  44. <span v-if="scope.row.status === 1 ? true : false" class="didi-hover" @click="dailyButtom(3,scope.row)">复制</span>
  45. </div>
  46. <div v-if="title === '准出报告'">
  47. <div v-if="scope.row.status === 1 ? false : true">
  48. <span v-if="scope.row.status === 2 ? true : false" class="didi-hover" @click="clientButtom(5,scope.row)">发送</span>
  49. <span v-if="scope.row.status === 2 ? true : false" style="margin: 0 30px;" class="didi-hover" @click="clientButtom(6,scope.row)">编辑</span>
  50. <span v-if="scope.row.status === 2 ? true : false" class="didi-hover" @click="report_click(4,scope.row )">删除</span>
  51. </div>
  52. </div>
  53. <div v-if="title === '提测报告'">
  54. <div v-if="scope.row.status === 1 ? false : true">
  55. <span v-if="scope.row.status === 3 ? true : false" class="didi-hover" @click="report_click(1,scope.row)">通过</span>
  56. <span v-if="scope.row.status === 3 ? true : false" style="margin-left: 30px;" class="didi-hover" @click="report_click(2,scope.row)">打回</span>
  57. <span v-if="scope.row.status === 0 ? true : false" class="didi-hover" @click="report_click(5,scope.row)">发送</span>
  58. <span v-if="scope.row.status === 0 ? true : false" style="margin: 0 30px;" class="didi-hover" @click="report_click(6,scope.row)">编辑</span>
  59. <span v-if="scope.row.status === 0 ? true : false" class="didi-hover" @click="report_click(4,scope.row )">删除</span>
  60. <span v-if="scope.row.status === 2 ? true : false" class="didi-hover" @click="report_click(3,scope.row)">重新提测</span>
  61. </div>
  62. </div>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. </el-main>
  67. <el-footer class="public_footer">
  68. <el-pagination style="margin-top:30px;" align="center" :current-page="curIndex" :page-sizes="[5, 10, 20]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
  69. </el-footer>
  70. </el-container>
  71. <!-- 日报/准出/提测选择任务 -->
  72. <el-dialog title="选择任务" :visible.sync="centerDialogVisible" width="30%" center>
  73. <div class="Layout_space_between">
  74. <div style="width:100px;">选择任务 :</div>
  75. <el-select v-model="queryData.code" filterable placeholder="请选择任务" size="mini" style="width:100%;">
  76. <el-option v-for="item in restaurants" :key="item.id" :label="item.name" :value="item.id" />
  77. </el-select>
  78. </div>
  79. <span slot="footer" class="dialog-footer">
  80. <el-button type="primary" size="mini" @click="createPresentation(queryData.code)">创建</el-button>
  81. </span>
  82. </el-dialog>
  83. <el-dialog :title="report_from.titName" :visible.sync="dialog_testData" width="30%" :close-on-click-modal="false">
  84. <div style="position: absolute; top: 23px; left: 12px;width:4px;height:17px;background:#409EFF;border-radius:1px;" />
  85. <div align="center">
  86. <div v-if="title === '提测报告'">是否{{ report_from.statusString }}以下提测?</div>
  87. <div v-if="title === '测试日报'">是否{{ report_from.statusString }}以下测试日报?</div>
  88. <div v-if="title === '准出报告'">是否{{ report_from.statusString }}以下准出报告?</div>
  89. <div style="color: #f79232;">{{ report_from.name }}</div>
  90. </div>
  91. <el-input v-show="report_from.statusString === '打回'" v-model="report_from.reason" type="textarea" placeholder="请输入打回原因..." :rows="3" />
  92. <span slot="footer" class="dialog-footer">
  93. <el-button type="primary" size="mini" @click="passOrBackSend()">确 定</el-button>
  94. <el-button type="danger" size="mini" @click="endDialog">取 消</el-button>
  95. </span>
  96. </el-dialog>
  97. <TestReport v-if="dialogVisible1" ref="TestReport" />
  98. <DailyReport v-if="dialogDaily" ref="DailyReport" />
  99. <ClientReport v-if="dialogClient" ref="ClientReport" />
  100. </div>
  101. </template>
  102. <script>
  103. import '@/styles/PublicStyle/index.scss'
  104. import { dailyReportList, dailyReportDelete } from '@/api/testPresentetion' // 日报
  105. import { projectTestReportList, projectTestReportDelete } from '@/api/ResultPage' // 准出
  106. import { launchTestList, launchTestDelete, taskListCreate } from '@/api/InterfaceReport' // 提测
  107. import TestReport from '@/views/Platform/presentation/Templates/TestReport' // 提测
  108. import DailyReport from '@/views/Platform/presentation/Templates/DailyReport' // 日报
  109. import ClientReport from '@/views/Platform/presentation/Templates/ClientReport' // 准出
  110. import { launchTestUpdate } from '@/api/InterfaceReport'
  111. export default {
  112. name: 'TestPresentation',
  113. components: {
  114. TestReport,
  115. DailyReport,
  116. ClientReport
  117. },
  118. data() {
  119. return {
  120. activeName: 'first',
  121. title: '测试日报', // 报告title
  122. userInformation: localStorage.getItem('username'),
  123. userNames: localStorage.getItem('realname'),
  124. bizJson: localStorage.getItem('bizId'),
  125. centerDialogVisible: false,
  126. dialog_testData: false, // 操作弹窗
  127. report_data: {}, // 当前点击数据
  128. userData: { id: '', ename: this.userInformation, name: this.userNames },
  129. loading: true,
  130. pageSize: 15,
  131. curIndex: 1,
  132. total: 0,
  133. state: '',
  134. restaurants: [],
  135. queryData: {
  136. state: ''
  137. },
  138. report_from: {
  139. name: '',
  140. titName: '',
  141. statusString: ''
  142. },
  143. tableData: [],
  144. z_name: '',
  145. restaurants2: [],
  146. dialogVisible1: false, // 提测弹窗
  147. dialogDaily: false,
  148. dialogClient: false,
  149. indexPage: {
  150. pageSize: 15,
  151. curIndex: 1
  152. }
  153. }
  154. },
  155. destroyed() {
  156. this.$store.state.data.status = false
  157. },
  158. created() {
  159. this.getList()
  160. this.$store.state.data.status = true
  161. },
  162. mounted() {
  163. this.getQueryData()
  164. },
  165. methods: {
  166. handleClick(tab, event) {
  167. this.curIndex = 1
  168. this.loading = true
  169. switch (Number(tab.index)) {
  170. case 0:
  171. this.title = '测试日报'
  172. this.getList()
  173. break
  174. case 1:
  175. this.title = '准出报告'
  176. this.getList()
  177. break
  178. case 2:
  179. this.title = '提测报告'
  180. this.getList()
  181. break
  182. }
  183. },
  184. async getList(e) { // 报告list
  185. this.loading = true
  186. this.z_name = e
  187. const indexPage = { reportName: e, bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
  188. if (this.title === '测试日报') {
  189. const res = await dailyReportList(indexPage)
  190. if (res.code === 200) {
  191. this.tableData = res.data
  192. this.total = res.total
  193. }
  194. }
  195. if (this.title === '准出报告') {
  196. const res = await projectTestReportList(indexPage)
  197. if (res.code === 200) {
  198. this.tableData = res.data
  199. this.total = res.total
  200. }
  201. }
  202. if (this.title === '提测报告') {
  203. const data = { name: e, bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
  204. const res = await launchTestList(data)
  205. if (res.code === 200) {
  206. this.tableData = res.data
  207. this.total = res.total
  208. }
  209. }
  210. this.loading = false
  211. },
  212. async passOrBackSend() { // 提测打回
  213. this.dialog_testData = false
  214. const launchTestInfo = { status: this.report_data.status, id: this.report_data.id, launchRepulseInfo: this.report_from.reason }
  215. const userData = { id: '', ename: this.userInformation, name: this.userNames }
  216. const objData = { launchTestInfo: launchTestInfo, user: userData }
  217. if (this.report_from.statusString === '通过' || this.report_from.statusString === '打回') {
  218. const res = await launchTestUpdate(objData)
  219. if (res.code === 200) {
  220. this.getList()
  221. this.$message({ message: res.msg, type: 'success', offset: 150 })
  222. }
  223. } else if (this.report_from.statusString === '删除') {
  224. switch (this.title) {
  225. case '测试日报':
  226. dailyReportDelete(this.userData, this.report_data.id).then(res => {
  227. if (res.code === 200) {
  228. this.$message({ type: 'success', message: '删除成功' })
  229. this.getList()
  230. }
  231. })
  232. break
  233. case '准出报告':
  234. projectTestReportDelete(this.userData, this.report_data.id).then(res => {
  235. if (res.code === 200) {
  236. this.$message({ type: 'success', message: '删除成功' })
  237. this.getList()
  238. }
  239. })
  240. break
  241. case '提测报告':
  242. launchTestDelete(this.userData, this.report_data.id).then(res => {
  243. if (res.code === 200) {
  244. this.$message({ type: 'success', message: '删除成功' })
  245. this.getList()
  246. }
  247. })
  248. break
  249. }
  250. }
  251. },
  252. dailyButtom(e, data) { // 测试报告
  253. console.log(data, 'xsaxsaxasxsxaxas')
  254. this.report_data = data
  255. switch (e) {
  256. case 3:
  257. this.dialogDaily = true
  258. this.$nextTick(() => {
  259. this.$refs.DailyReport.init(4, data)
  260. })
  261. break
  262. case 5:
  263. this.dialogDaily = true
  264. this.$nextTick(() => {
  265. this.$refs.DailyReport.init(3, data)
  266. })
  267. break
  268. case 6:
  269. this.dialogDaily = true
  270. this.$nextTick(() => {
  271. this.$refs.DailyReport.init(2, data)
  272. })
  273. break
  274. }
  275. },
  276. clientButtom(e, data) { // 准出报告
  277. this.report_data = data
  278. switch (e) {
  279. case 5:
  280. this.dialogClient = true
  281. this.$nextTick(() => {
  282. this.$refs.ClientReport.init(3, data)
  283. })
  284. break
  285. case 6:
  286. this.dialogClient = true
  287. this.$nextTick(() => {
  288. this.$refs.ClientReport.init(2, data)
  289. })
  290. break
  291. }
  292. },
  293. report_click(e, data) { // 提测报告
  294. this.report_from.name = data.name || data.reportName
  295. this.report_data = data
  296. switch (e) {
  297. case 1:
  298. this.dialog_testData = true
  299. this.report_from.titName = '提测确认'
  300. this.report_from.statusString = '通过'
  301. break
  302. case 2:
  303. this.dialog_testData = true
  304. this.report_from.titName = '提测确认'
  305. this.report_from.statusString = '打回'
  306. break
  307. case 3:
  308. data.taskIds = [Number(this.taskId)]
  309. this.dialogVisible1 = true
  310. this.$nextTick(() => {
  311. this.$refs.TestReport.init(4, data)
  312. })
  313. break
  314. case 4:
  315. this.dialog_testData = true
  316. this.report_from.titName = '删除确认'
  317. this.report_from.statusString = '删除'
  318. break
  319. case 5:
  320. this.dialogVisible1 = true
  321. this.$nextTick(() => {
  322. this.$refs.TestReport.init(3, data)
  323. })
  324. break
  325. case 6:
  326. this.dialogVisible1 = true
  327. this.$nextTick(() => {
  328. this.$refs.TestReport.init(2, data)
  329. })
  330. break
  331. }
  332. },
  333. // queryPresentation(data) { // 报告编辑
  334. // switch (this.title) {
  335. // case '测试日报':
  336. // this.dialogDaily = true
  337. // this.$nextTick(() => {
  338. // this.$refs.DailyReport.init(2, data)
  339. // })
  340. // break
  341. // case '准出报告':
  342. // this.dialogClient = true
  343. // this.$nextTick(() => {
  344. // this.$refs.ClientReport.init(2, data)
  345. // })
  346. // break
  347. // case '提测报告':
  348. // this.dialogVisible1 = true
  349. // this.$nextTick(() => {
  350. // this.$refs.TestReport.init(2, data)
  351. // })
  352. // break
  353. // }
  354. // },
  355. // 获取任务数据
  356. getQueryData() {
  357. this.$set(this.queryData, 'TestReport', '')
  358. this.$set(this.queryData, 'ClientReport', '')
  359. this.$set(this.queryData, 'code', '')
  360. this.restaurants = []
  361. taskListCreate({ bizId: localStorage.getItem('bizId') }).then(res => {
  362. this.restaurants = res.data.taskInfoList
  363. })
  364. },
  365. createPresentation(e) {
  366. if (e !== '') {
  367. switch (this.title) {
  368. case '测试日报':
  369. this.dialogDaily = true
  370. this.$nextTick(() => {
  371. this.$refs.DailyReport.init(7, [e])
  372. })
  373. break
  374. case '准出报告':
  375. this.dialogClient = true
  376. this.$nextTick(() => {
  377. this.$refs.ClientReport.init(7, [e])
  378. })
  379. break
  380. case '提测报告':
  381. this.dialogVisible1 = true
  382. this.$nextTick(() => {
  383. this.$refs.TestReport.init(7, [e])
  384. })
  385. break
  386. }
  387. this.$set(this.queryData, 'code', '')
  388. this.centerDialogVisible = false
  389. } else {
  390. this.$message({ message: '提示,请选择要添加的任务ID', type: 'warning' })
  391. }
  392. },
  393. createFilter(queryString) {
  394. return (restaurant) => {
  395. return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  396. }
  397. },
  398. // 日报/准出/提测
  399. toReportView(ele) {
  400. switch (this.title) {
  401. case '测试日报':
  402. this.dialogDaily = true
  403. this.$nextTick(() => {
  404. this.$refs.DailyReport.init(3, ele)
  405. })
  406. break
  407. case '准出报告':
  408. this.dialogClient = true
  409. this.$nextTick(() => {
  410. this.$refs.ClientReport.init(3, ele)
  411. })
  412. break
  413. case '提测报告':
  414. this.dialogVisible1 = true
  415. this.$nextTick(() => {
  416. this.$refs.TestReport.init(3, ele)
  417. })
  418. break
  419. }
  420. },
  421. endDialog() { // 结束对话框
  422. this.dialog_testData = false
  423. this.$message({ type: 'warning', message: '已取消' })
  424. },
  425. handleSizeChange(size) {
  426. this.pageSize = size
  427. this.getList(this.z_name)
  428. },
  429. handleCurrentChange(curIndex) {
  430. this.curIndex = curIndex
  431. this.getList(this.z_name)
  432. }
  433. }
  434. }
  435. </script>
  436. <style scoped>
  437. .eleStyle {
  438. width: 100%;
  439. height:100%;
  440. background:#F2F3F6;
  441. display: inline-block;
  442. }
  443. .header_sty {
  444. font-size: 14px;
  445. background:#ffffff;
  446. margin: 10px;
  447. border-radius: 4px;
  448. overflow: hidden;
  449. }
  450. .distance {
  451. margin-bottom: 20px;
  452. }
  453. .report-Layout {
  454. min-height: calc(100vh - 221px)
  455. }
  456. </style>
  457. <style lang="stylus">
  458. .el-tabs__nav-wrap::after {
  459. background-color: #FFF !important;
  460. }
  461. </style>