problemList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <div style="width: 100%;margin-left: 10px;">
  3. <div style="margin: 2% 0;">
  4. <el-form :model="queryCode">
  5. <!-- <el-select v-model="queryCode.taskId" clearable placeholder="任务" style="width:10%;margin:0 5px;">
  6. <el-option v-for="item in taskIdStr" :key="item.id" :label="item.name" :value="item.id" />
  7. </el-select>
  8. <el-select v-model="queryCode.status" clearable placeholder="bug状态" style="width:10%;margin-right:5px;">
  9. <el-option v-for="item in bugStatusStr" :key="item.code" :label="item.name" :value="item.code" />
  10. </el-select> -->
  11. <el-input v-model="queryCode.currentHandler" clearable filterable placeholder="处理人" style="width:12%;margin-right:5px;" />
  12. <el-input v-model="queryCode.creator" clearable filterable placeholder="创建人" style="width:12%;margin-right:5px;" />
  13. <el-date-picker v-model="queryCode.gmtCreateBegin" style="width:19%;margin-right:5px;" type="datetime" placeholder="创建时间" />
  14. <!-- <el-date-picker v-model="queryCode.gmtCreateEnd" style="width:12%;margin-right:5px;" type="datetime" placeholder="截止时间" /> -->
  15. <el-input v-model="queryCode.bugName" clearable filterable placeholder="主题" style="width:12%;margin-right:5px;" />
  16. <el-select v-model="queryCode.priority" clearable placeholder="故障级别" style="width:10%;margin-right:5px;">
  17. <el-option v-for="item in bugStatusPriority" :key="item.code" :label="item.name" :value="item.code" />
  18. </el-select>
  19. <el-button type="primary" @click="dataQuery(queryCode)">查询</el-button>
  20. <el-button type="primary" style="margin: 1% 5px;" @click="createdCode()">新建线上问题</el-button>
  21. </el-form>
  22. </div>
  23. <el-table :data="tableData" fit>
  24. <el-table-column label="ID" min-width="120" align="center">
  25. <template slot-scope="scope">{{ scope.row.id }}</template>
  26. </el-table-column>
  27. <el-table-column label="主题" min-width="230" align="center">
  28. <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row.id)">{{ scope.row.bugName }}</a></template>
  29. </el-table-column>
  30. <el-table-column label="处理人" min-width="150" align="center">
  31. <template slot-scope="scope">{{ scope.row.currentHandlerList }}</template>
  32. </el-table-column>
  33. <el-table-column label="创建日期" min-width="250" align="center">
  34. <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
  35. </el-table-column>
  36. <el-table-column label="级别" width="150" align="center">
  37. <template slot-scope="scope"><span>{{ scope.row.priorityName }}</span></template>
  38. </el-table-column>
  39. <el-table-column label="状态" width="150" align="center">
  40. <template slot-scope="scope"><span>{{ scope.row.bugStatusName }}</span></template>
  41. </el-table-column>
  42. <el-table-column fixed="right" label="操作" width="225" align="center">
  43. <template slot-scope="scope">
  44. <el-button size="mini" type="primary" @click="queryPresentation(scope.row)">更新</el-button>
  45. <el-button size="mini" type="primary" @click="delePresentation(scope.row.id)">删除</el-button>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <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" />
  50. </div>
  51. </template>
  52. <script>
  53. import { bugList, bugGet, bugDelete, taskListCreate, bugGetEnum } from '@/api/defectManage'
  54. export default {
  55. name: 'DefectManagement',
  56. data() {
  57. return {
  58. bugTypeStr: [],
  59. bugStatusStr: [],
  60. bizOptions: [{ name: '万象', value: 101 }, { name: '企业级', value: 100 }, { name: '滴滴代驾', value: 261 }, { name: 'prado', value: 330 }, { name: 'carbo', value: 331 }, { name: '海马', value: 309 }],
  61. bugLevelStr: [{ name: 'p0', value: 0 }, { name: 'p1', value: 1 }, { name: 'p2', value: 2 }, { name: 'p3', value: 3 }],
  62. reasonStr: [],
  63. platformTypeStr: [],
  64. stageStr: [],
  65. discoveryMethodStr: [],
  66. businessTypeStr: [],
  67. bugStatusPriority: [],
  68. repairResultStr: [],
  69. isDeleteStr: [{ name: '保留', value: 0 }, { name: '删除', value: 1 }],
  70. serviceDataRules: {
  71. bizId: [{ required: true, message: '业务线不能为空', trigger: 'change' }],
  72. // bugName: [{ required: true, message: '主题不能为空', trigger: 'change' }],
  73. taskId: [{ required: true, message: '任务不能为空', trigger: 'change' }],
  74. // projectId: [{ required: true, message: '项目ID不能为空', trigger: 'change' }],
  75. bugType: [{ required: true, message: 'bug类型不能为空', trigger: 'change' }],
  76. discoveryMethod: [{ required: true, message: '发现方式不能为空', trigger: 'change' }],
  77. reason: [{ required: true, message: '问题原因不能为空', trigger: 'change' }],
  78. priority: [{ required: true, message: '级别不能为空', trigger: 'change' }],
  79. status: [{ required: true, message: '状态不能为空', trigger: 'change' }],
  80. platformType: [{ required: true, message: '平台类型不能为空', trigger: 'change' }],
  81. stage: [{ required: true, message: '所处阶段不能为空', trigger: 'change' }],
  82. assigner: [{ required: true, message: 'bug责任人不能为空', trigger: 'change' }],
  83. currentHandler: [{ required: true, message: 'bug处理人不能为空', trigger: 'change' }],
  84. bugDescribe: [{ required: true, message: 'bug描述不能为空', trigger: 'change' }],
  85. businessType: [{ required: true, message: '业务模块不能为空', trigger: 'change' }]
  86. },
  87. userInformation: localStorage.getItem('username'),
  88. userNames: localStorage.getItem('realname'),
  89. bizJson: localStorage.getItem('key'),
  90. pageSize: 20,
  91. curIndex: 0,
  92. total: 0,
  93. show2: '',
  94. tableData: [],
  95. queryCode: {},
  96. statusShow: false,
  97. repairShow: false,
  98. formLabelWidth: '11%',
  99. formLabelWidth1: '22%',
  100. serviceTypeEnumList: [],
  101. clientTypeEnumList: [],
  102. bizIdEnumList: [],
  103. objData: '',
  104. userData: '',
  105. taskIdStr: '',
  106. fileList: [],
  107. fileDbList: []
  108. }
  109. },
  110. created() {
  111. this.getList()
  112. this.bugListSelect()
  113. },
  114. mounted() {
  115. this.getQueryData()
  116. },
  117. methods: {
  118. getList() {
  119. this.bizJson = localStorage.getItem('key')
  120. this.indexPage = {
  121. bizId: this.bizJson,
  122. pageSize: this.pageSize,
  123. curIndex: this.curIndex
  124. }
  125. bugList(this.indexPage).then(res => {
  126. this.tableData = res.data
  127. this.total = res.total
  128. })
  129. },
  130. bugListSelect() {
  131. bugGetEnum().then(res => {
  132. this.bugStatusStr = res.data.bugEnumList
  133. this.bugStatusPriority = res.data.priorityEnumList
  134. this.stageStr = res.data.bugStageEnumList
  135. this.reasonStr = res.data.reasonEnumList
  136. this.platformTypeStr = res.data.platformTypeEnumList
  137. this.bugTypeStr = res.data.bugTypeEnumList
  138. this.bugLevelStr = res.data.priorityEnumList
  139. this.discoveryMethodStr = res.data.discoveryMethodEnumList
  140. this.repairResultStr = res.data.repairResultEnumList
  141. this.clientTypeEnumList = res.data.clientTypeEnumList
  142. this.serviceTypeEnumList = res.data.serviceTypeEnumList
  143. this.bizIdEnumList = res.data.bizIdEnumList
  144. })
  145. },
  146. clickChangeType(e) {
  147. // console.log(this.form.businessType)
  148. // this.form.businessType = ''
  149. if (e === '服务端') {
  150. this.businessTypeStr = this.serviceTypeEnumList
  151. } else {
  152. this.businessTypeStr = this.clientTypeEnumList
  153. }
  154. },
  155. dataQuery(e) {
  156. this.bizJson = localStorage.getItem('key')
  157. this.indexPage = e
  158. this.curIndex = 0
  159. this.indexPage.bizId = this.bizJson
  160. this.indexPage.pageSize = this.pageSize
  161. this.indexPage.curIndex = this.curIndex
  162. bugList(this.indexPage).then(res => {
  163. this.tableData = res.data
  164. this.total = res.total
  165. })
  166. },
  167. dataQueryInSearch(e) {
  168. this.bizJson = localStorage.getItem('key')
  169. this.indexPage = e
  170. this.indexPage.bizId = this.bizJson
  171. this.indexPage.pageSize = this.pageSize
  172. this.indexPage.curIndex = this.curIndex
  173. bugList(this.indexPage).then(res => {
  174. this.tableData = res.data
  175. this.total = res.total
  176. })
  177. },
  178. // // 删除报告
  179. delePresentation(e) {
  180. this.$confirm('是否确认删除', '确认信息', {
  181. distinguishCancelAndClose: true,
  182. confirmButtonText: '确定',
  183. cancelButtonText: '取消'
  184. })
  185. .then(() => {
  186. this.userData = { id: '', ename: this.userInformation, name: this.userNames }
  187. bugDelete(this.userData, e).then(res => {
  188. this.getList()
  189. })
  190. this.$message({ type: 'success', message: '已删除' })
  191. })
  192. .catch(action => {
  193. this.$message({ type: 'success', message: '已取消' })
  194. })
  195. },
  196. queryPresentation(ele) {
  197. this.form = ele
  198. for (var a of this.bizOptions) {
  199. if (ele.bizId === a.value) {
  200. this.bizId = a.name
  201. }
  202. }
  203. // this.bizId = ele.bizId
  204. this.form.taskId = ele.taskId
  205. this.$router.push({ name: '更新线上问题', params: { formData: this.form }, query: { id: this.form.id }})
  206. // this.dialogFormVisible = true
  207. },
  208. getQueryData() {
  209. this.$route.query.code === 4 ? this.queryCode.taskId = this.$route.query.id : ''
  210. this.bizJson = localStorage.getItem('key')
  211. taskListCreate({ bizId: this.bizJson }).then(res => {
  212. this.taskIdStr = res.data
  213. })
  214. },
  215. handleSizeChange(size) {
  216. this.pageSize = size
  217. this.dataQueryInSearch(this.queryCode)
  218. },
  219. handleCurrentChange(curIndex) {
  220. this.curIndex = curIndex
  221. this.dataQueryInSearch(this.queryCode)
  222. },
  223. createdCode() {
  224. this.form = {}
  225. // this.$route.query.code === 4 ? this.form.taskId = this.$route.query.id : ''
  226. // if (this.$refs['form'] !== undefined) {
  227. // this.$refs['form'].resetFields()
  228. // }
  229. this.$router.push({ name: '新建线上问题' })
  230. },
  231. toReportView(e) {
  232. // this.buildShow(e)
  233. bugGet(e).then(res => {
  234. this.form = res.data
  235. for (var a of this.bizIdEnumList) {
  236. res.data.bizId === a.code ? this.form.bizId = a.name : ''
  237. }
  238. this.$router.push({ name: '查看线上问题', query: { id: this.form.id }})
  239. })
  240. },
  241. handleChange(file, fileList) {
  242. this.fileDbList = []
  243. this.fileList = fileList.slice(-3)
  244. for (var a of this.fileList) {
  245. this.fileDbList.push({ name: a.name, url: 'http' + a.response.url })
  246. }
  247. var arr = []
  248. for (var el of this.fileDbList) {
  249. arr.push({ 'name': el.name, 'url': el.response.url })
  250. }
  251. },
  252. successFun() {
  253. this.$notify({ title: 'Success', message: 'Created Successfully', type: 'success', duration: 2000 })
  254. },
  255. errorFun() {
  256. this.$notify({ title: 'Failed', message: 'Created Failed', type: 'error', duration: 2000 })
  257. }
  258. }
  259. }
  260. </script>
  261. <style lang="stylus" scoped>
  262. </style>