ClientAcceptance.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <!-- 准出报告,新增客户端报告 -->
  3. <el-form ref="ClientData" :inline="true" :model="ClientData" :rules="serviceDataRules" style="margin:7% 3%;">
  4. <el-row :gutter="20">
  5. <el-col :span="13">
  6. <el-form-item class="backStyle" prop="reportName">
  7. <el-input v-model="ClientData.reportName" style="width:40vw;" placeholder="报告标题(xxx项目准出报告)" />
  8. </el-form-item>
  9. </el-col>
  10. <el-col :span="11">
  11. <el-form-item label="by" prop="ownner" style="margin: 20px 0 0 60px;margin-left:70px;background: white">
  12. <el-input v-model="ClientData.ownner" style="width:20vw; border:2px solid #ccc;border-radius: 4px;" placeholder="who" />
  13. </el-form-item>
  14. </el-col>
  15. </el-row>
  16. <el-row :gutter="20"><el-col :span="12"><el-form-item label="一、项目概述" class="backStyle" /></el-col></el-row>
  17. <el-row :gutter="20" type="flex">
  18. <el-col :span="12">
  19. <el-form-item label="测试结果" class="backStyle" prop="status">
  20. <el-radio-group v-model="ClientData.status">
  21. <el-radio style="margin: 0 90px;" label="1" @change="changeStatus(1)">通过</el-radio>
  22. <el-radio style="padding-right: 140px;" label="2" @change="changeStatus">不通过</el-radio>
  23. </el-radio-group>
  24. </el-form-item>
  25. <el-form-item label="准入结果" prop="smokeTestResult" class="backStyle" style="margin-left:77px;"><el-input v-model="ClientData.smokeTestResult" style="width:30.5vw;" placeholder="准入次数/通过次数/失败次数" /></el-form-item>
  26. </el-col>
  27. </el-row>
  28. <el-row :gutter="23">
  29. <el-col :span="23">
  30. <el-form-item label="开发人员" prop="developer" class="backStyle"><el-input v-model=" ClientData.developer" style="width:30.5vw;" /></el-form-item>
  31. <el-form-item label="开发周期" prop="devTimeEnd" class="backStyle" style="margin-left:80px;">
  32. <el-date-picker v-model="ClientData.devTimeEnd" style="width:14.5vw;" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" /> —
  33. <el-date-picker v-model="ClientData.devTimeStart" style="width:14.5vw;" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" />
  34. </el-form-item>
  35. </el-col>
  36. </el-row>
  37. <el-row :gutter="23">
  38. <el-col :span="23">
  39. <el-form-item label="测试人员" prop="tester" class="backStyle"><el-input v-model="ClientData.tester" style="width:30.5vw;" /></el-form-item>
  40. <el-form-item label="测试周期" prop="testTimeEnd" class="backStyle" style="margin-left:80px;">
  41. <el-date-picker v-model="ClientData.testTimeEnd" style="width:14.5vw;" type="date" placeholder="选择日期" /> —
  42. <el-date-picker v-model="ClientData.testTimeStart" style="width:14.5vw;" type="date" placeholder="选择日期" />
  43. </el-form-item>
  44. </el-col>
  45. </el-row>
  46. <el-row :gutter="20" type="flex">
  47. <el-col :span="12">
  48. <el-form-item label="准出延期" class="backStyle" prop="taskLateStatus">
  49. <el-radio-group v-model="ClientData.taskLateStatus">
  50. <el-radio style="margin: 0 90px;" label="2" @change="clickshow">否</el-radio>
  51. <el-radio style="padding-right: 177px;" label="1" @change="clickshow(1)">是</el-radio>
  52. </el-radio-group>
  53. </el-form-item>
  54. <el-form-item v-if="showDelay" prop="taskLateReason" label="延期原因" class="backStyle" style="margin-left:82px;"><el-input v-model="ClientData.taskLateReason" style="width:30.5vw;" /></el-form-item>
  55. </el-col>
  56. </el-row>
  57. <el-form-item label="二、项目背景" class="backStyle" />
  58. <div id="editorElem" class="toolbar" />
  59. <div id="editorElem1" class="text" style="text-align:left;cellspacing:0;cellpadding:0;min-height:100px;" />
  60. <el-form-item label="三、测试项" class="backStyle" />
  61. <p class="p">功能测试 <el-radio-group v-model="pftResult"> <el-radio :label="3">未执行</el-radio><el-radio :label="1">测试通过</el-radio><el-radio :label="2">测试未通过</el-radio></el-radio-group></p>
  62. <div id="editorElems" class="toolbar" />
  63. <div id="editorElems1" class="text" style="text-align:left;cellspacing:0;cellpadding:0;min-height:100px;" />
  64. <p class="p">兼容测试<el-radio-group v-model="sctResult"><el-radio :label="1">测试通过</el-radio><el-radio :label="2">测试未通过</el-radio></el-radio-group></p>
  65. <div id="editorFrom" class="toolbar" />
  66. <div id="editorFrom1" class="text" style="text-align:left;cellspacing:0;cellpadding:0;min-height:100px;" />
  67. <el-form-item label="四、产品验收" class="backStyle" />
  68. <el-row :gutter="20">
  69. <el-col :span="6">
  70. <p class="p">验收结果<el-radio-group v-model="acceptanceResult"><el-radio :label="3">未执行</el-radio><el-radio :label="1">测试通过</el-radio><el-radio :label="2">测试未通过</el-radio></el-radio-group></p>
  71. </el-col>
  72. </el-row>
  73. <div id="editorFro" class="toolbar" />
  74. <div id="editorFro1" class="text" style="text-align:left;cellspacing:0;cellpadding:0;min-height:100px;" />
  75. <el-form-item label="五、bug指标" class="backStyle" />
  76. <div id="editorEle" class="toolbar" />
  77. <div id="editorEle1" class="text" style="text-align:left;cellspacing:0;cellpadding:0;min-height:100px;" />
  78. <el-row :gutter="24" style="margin:70px 0 0 150px;" type="flex" justify="center">
  79. <el-col :span="8"><el-button type="info" @click="clickPreview(ClientData)"> 预 览 </el-button></el-col>
  80. <el-col v-show="showButton" :span="8"><el-button type="info" @click="getCreateData(ClientData)"> 保 存 </el-button></el-col>
  81. <el-col v-show="showButton1" :span="8"><el-button type="info" @click="getQueryData(ClientData)"> 更 新 </el-button></el-col>
  82. <el-col :span="8"><el-button type="info" @click="open(ClientData)"> 取 消 </el-button></el-col>
  83. </el-row>
  84. </el-form>
  85. </template>
  86. <script>
  87. import { projectTestReportUpdate, projectTestReportCreate } from '@/api/ResultPage'
  88. import E from 'wangeditor'
  89. export default {
  90. name: 'ClientAcceptance',
  91. data() {
  92. return {
  93. userData: '',
  94. objData: '',
  95. userInformation: localStorage.getItem('username'),
  96. userNames: localStorage.getItem('realname'),
  97. bizIdData: localStorage.getItem('key'),
  98. serviceDataRules: {
  99. reportName: [{ required: true, message: '报告标题不能为空', trigger: 'change' }],
  100. ownner: [{ required: true, message: 'by不能为空', trigger: 'change' }],
  101. status: [{ required: true, message: '测试结果不能为空', trigger: 'change' }],
  102. taskLateStatus: [{ required: true, message: '准出延期不能为空', trigger: 'change' }],
  103. taskLateReason: [{ required: true, message: '延期原因不能为空', trigger: 'change' }],
  104. smokeTestResult: [{ required: true, message: '准入结果不能为空', trigger: 'change' }],
  105. developer: [{ required: true, message: '开发人员不能为空', trigger: 'change' }],
  106. devTimeEnd: [{ required: true, message: '开发周期不能为空', trigger: 'change' }],
  107. tester: [{ required: true, message: '测试人员不能为空', trigger: 'change' }],
  108. testTimeEnd: [{ required: true, message: '测试周期不能为空', trigger: 'change' }]
  109. },
  110. showButton: true,
  111. showButton1: '',
  112. content: null,
  113. editorContent: '',
  114. showDelay: false,
  115. labelWidth: '60px',
  116. status: '',
  117. taskLateStatus: '',
  118. pftResult: '',
  119. sctResult: '',
  120. acceptanceResult: '',
  121. ClientData: {},
  122. editorElem: [],
  123. editorElems: []
  124. }
  125. },
  126. created() {
  127. this.getRouterData()
  128. },
  129. mounted() {
  130. this.editorElem = new E('#editorElem', '#editorElem1')
  131. this.editorElems = new E('#editorElems', '#editorElems1')
  132. this.editorFrom = new E('#editorFrom', '#editorFrom1')
  133. this.editorFro = new E('#editorFro', '#editorFro1')
  134. this.editorEle = new E('#editorEl', '#editorEle1')
  135. this.editorElem.customConfig.zIndex = 110
  136. this.editorElems.customConfig.zIndex = 110
  137. this.editorFrom.customConfig.zIndex = 110
  138. this.editorFro.customConfig.zIndex = 110
  139. this.editorEle.customConfig.zIndex = 110
  140. this.editorElem.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify']
  141. this.editorElems.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify']
  142. this.editorFrom.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify']
  143. this.editorFro.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify']
  144. this.editorEle.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify']
  145. this.editorElem.customConfig.onchange = (html) => { this.editorElem = html }
  146. this.editorElems.customConfig.onchange = (html) => { this.editorElems = html }
  147. this.editorFrom.customConfig.onchange = (html) => { this.editorFrom = html }
  148. this.editorFro.customConfig.onchange = (html) => { this.editorFro = html }
  149. this.editorEle.customConfig.onchange = (html) => { this.editorEle = html }
  150. this.editorElem.create()
  151. this.editorElems.create()
  152. this.editorFrom.create()
  153. this.editorFro.create()
  154. this.editorEle.create()
  155. this.editorElems.txt.html(`<p></p><table width="100%"><colgroup><col width="20%"><col width="20%"><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr><th>页面</th><th>模块</th><th>接口</th><th>测试结果</th><th>备注</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><p></p>`)
  156. this.editorFrom.txt.html(`<p>1、机型兼容</p><table width="100%"><colgroup><col width="20%"><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr><th>手机型号</th><th>操作系统</th><th>分辨率</th><th>(微信版本号)</tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><p>2、网络兼容</p><table width="100%"><colgroup><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr><th>WIFI</th><th>4G</th><th>5G</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td></tr></tbody></table><p>3、容器兼容</p><br>`)
  157. this.editorFro.txt.html(`<p></p><table width="100%"><colgroup><col width="20%"><col width="20%"><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr><th>验收项</th><th>验收点</th><th>验收人</th><th>验收结果</th><th>备注</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><p></p>`)
  158. this.editorEle.txt.html(`<p></p><table width="100%"><colgroup><col width="20%"><col width="20%"><col width="20%"><col width="20%"><col width="20%"></colgroup><thead><tr><th>bug总数</th><th>已解决bug数</th><th>遗留bug数</th><th>bug解决率</th><th>备注</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><p>遗留问题:</p><br>`)
  159. this.getRouterData1()
  160. },
  161. methods: {
  162. getRouterData() {
  163. this.showButton = true
  164. this.showButton1 = false
  165. if (this.$route.query.data) {
  166. this.showButton1 = true
  167. this.showButton = false
  168. this.ClientData = this.$route.query.data
  169. this.pftResult = this.ClientData.pftResult
  170. this.sctResult = this.ClientData.sctResult
  171. if (this.ClientData.status === 1) {
  172. this.status = '1'
  173. this.ClientData.status = '1'
  174. } else {
  175. this.status = '2'
  176. this.ClientData.status = '2'
  177. }
  178. if (this.ClientData.taskLateStatus === 1) {
  179. this.taskLateStatus = '1'
  180. this.ClientData.taskLateStatus = '1'
  181. this.showDelay = true
  182. } else {
  183. this.taskLateStatus = '2'
  184. this.ClientData.taskLateStatus = '2'
  185. this.showDelay = false
  186. }
  187. }
  188. },
  189. getRouterData1() {
  190. this.editorElem.txt.html(this.ClientData.projectBackground)
  191. this.editorElems.txt.html(this.ClientData.fctInfo)
  192. this.editorFrom.txt.html(this.ClientData.sctInfo)
  193. this.editorFro.txt.html(this.ClientData.acceptanceResultInfo)
  194. this.editorEle.txt.html(this.ClientData.bugTarget)
  195. },
  196. open(ele) {
  197. this.$confirm('是否放弃修改,离开页面?', '确认信息', {
  198. distinguishCancelAndClose: true,
  199. confirmButtonText: '继续修改',
  200. cancelButtonText: '放弃修改'
  201. })
  202. .then(() => { this.$message({ type: 'info', message: '继续修改' }) })
  203. .catch(action => { action === 'cancel' ? this.$router.go(-1) : '' })
  204. },
  205. getCreateData(ele) {
  206. this.$refs['ClientData'].validate((valid) => {
  207. if (valid) {
  208. this.ClientData = ele
  209. typeof (this.editorElem) === 'string' ? this.ClientData.projectBackground = this.editorElem : ''
  210. typeof (this.editorElems) === 'string' ? this.ClientData.fctInfo = this.editorElems : ''
  211. typeof (this.editorFrom) === 'string' ? this.ClientData.sctInfo = this.editorFrom : ''
  212. typeof (this.editorFro) === 'string' ? this.ClientData.acceptanceResultInfo = this.editorFro : ''
  213. typeof (this.editorEle) === 'string' ? this.ClientData.bugTarget = this.editorEle : ''
  214. this.ClientData.pftResult = this.pftResult
  215. this.ClientData.sctResult = this.sctResult
  216. this.ClientData.acceptanceResult = this.acceptanceResult
  217. this.ClientData.taskId = this.$route.query.id
  218. this.ClientData.bizId = this.bizIdData
  219. this.ClientData.status = this.status
  220. this.ClientData.taskLateStatus = this.taskLateStatus
  221. this.ClientData.type = 1
  222. this.userData = { id: '', ename: this.userInformation, name: this.userNames }
  223. this.objData = { projectTestReport: this.ClientData, user: this.userData }
  224. projectTestReportCreate(this.objData).then(res => {
  225. if (res.code === 200) {
  226. this.$message({ type: 'success', message: '保存成功' })
  227. this.$router.go(-1)
  228. } else {
  229. this.$message.error('保存失败')
  230. }
  231. })
  232. } else {
  233. return false
  234. }
  235. })
  236. },
  237. getQueryData(ele) {
  238. this.ClientData = ele
  239. typeof (this.editorElem) === 'string' ? this.ClientData.projectBackground = this.editorElem : ''
  240. typeof (this.editorElems) === 'string' ? this.ClientData.fctInfo = this.editorElems : ''
  241. typeof (this.editorFrom) === 'string' ? this.ClientData.sctInfo = this.editorFrom : ''
  242. typeof (this.editorFro) === 'string' ? this.ClientData.acceptanceResultInfo = this.editorFro : ''
  243. typeof (this.editorEle) === 'string' ? this.ClientData.bugTarget = this.editorEle : ''
  244. this.ClientData.pftResult = this.pftResult
  245. this.ClientData.sctResult = this.sctResult
  246. this.ClientData.acceptanceResult = this.acceptanceResult
  247. this.ClientData.status = this.status
  248. this.ClientData.taskLateStatus = this.taskLateStatus
  249. this.userData = { id: '', ename: this.userInformation, name: this.userNames }
  250. this.objData = { projectTestReport: this.ClientData, user: this.userData }
  251. projectTestReportUpdate(this.objData).then(res => {
  252. if (res.code === 200) {
  253. this.$message({ type: 'success', message: '更新成功' })
  254. } else {
  255. this.$message.error('更新失败')
  256. }
  257. })
  258. },
  259. clickPreview(ele) {
  260. this.$router.push({ path: '/Platform/presentation/ResultPageyL', query: { data: ele }})
  261. },
  262. clickshow(e) {
  263. e === 1 ? this.taskLateStatus = '1' : this.taskLateStatus = '2'
  264. e === 1 ? this.showDelay = true : this.showDelay = false
  265. },
  266. changeStatus(e) {
  267. e === 1 ? this.status = '1' : this.status = '2'
  268. }
  269. }
  270. }
  271. </script>
  272. <style scoped>
  273. .el-col {
  274. white-space:nowrap;
  275. }
  276. .backStyle {
  277. margin:20px 0;
  278. background: #ccc;
  279. border-radius: 4px;
  280. padding:2px;
  281. }
  282. .toolbar {
  283. width: 79vw;
  284. border: 2px solid #ccc;
  285. }
  286. .text {
  287. font-size: 15px;
  288. color:#606266;
  289. width: 79vw;
  290. border: 2px solid #ccc;
  291. height: aotu;
  292. }
  293. .p {
  294. font-size: 15px;
  295. color:#606266;
  296. }
  297. </style>