diff --git a/src/api/qualityManagement/periodicTesting/testTask.js b/src/api/qualityManagement/periodicTesting/testTask.js index ddec245..32389d2 100644 --- a/src/api/qualityManagement/periodicTesting/testTask.js +++ b/src/api/qualityManagement/periodicTesting/testTask.js @@ -1,7 +1,7 @@ import request from '@/axios'; // 获取列表数据 bsCraftAbility/queryAllCa -export const getList = (current, size, params) => { +export const getList = (current, size, params,filterType) => { return request({ url: '/blade-desk/QA/CycleTestTask/list', method: 'get', @@ -9,6 +9,7 @@ export const getList = (current, size, params) => { ...params, current, size, + filterType }, }); }; diff --git a/src/components/basic-import/main.vue b/src/components/basic-import/main.vue index c70e840..db437b9 100644 --- a/src/components/basic-import/main.vue +++ b/src/components/basic-import/main.vue @@ -79,7 +79,6 @@ export default { this.$emit('closeDialog'); }, handleTemplate() { - console.log('templateUrl----------',this.templateUrl) exportBlob( `${this.templateUrl}?${this.website.tokenHeader}=${getToken()}` ).then(res => { diff --git a/src/views/periodicTesting/components/addProjectCycleDialog.vue b/src/views/periodicTesting/components/addProjectCycleDialog.vue index e9f643e..8be483f 100644 --- a/src/views/periodicTesting/components/addProjectCycleDialog.vue +++ b/src/views/periodicTesting/components/addProjectCycleDialog.vue @@ -32,10 +32,10 @@ - + @@ -200,9 +200,10 @@ > 试验件:{{ projectForm.testTypeName }} 试验项目:{{projectForm.cycleTestItemName}} - 试验标准:{{ projectForm.cycleTestItemStandard }} + 试验标准: + {{ projectForm.cycleTestStandardName }} + + 试验条件:{{ projectForm.cycleTestItemCondition }} @@ -317,6 +318,9 @@ export default { }, methods: { + downloadStandard(val){ + + }, getRowDetail(id){ getDetail(id).then(res =>{ this.projectForm = { @@ -342,6 +346,36 @@ export default { } }) }, + downloadA(fileUrl, fileName){ + const xhr = new XMLHttpRequest(); + xhr.open('GET', fileUrl, true); + xhr.responseType = 'blob'; + + xhr.onload = function () { + if (xhr.status === 200) { + const res = xhr.response; + const link = document.createElement('a'); + link.style.display = 'none'; + const url = window.URL.createObjectURL(res); + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click(); + window.URL.revokeObjectURL(link.href); + document.body.removeChild(link); + } else { + console.error('下载失败:', xhr.status); + ElMessage.error('下载失败,请稍后重试'); + } + }; + + xhr.onerror = function() { + console.error('下载请求出错'); + ElMessage.error('下载请求出错,请检查网络连接'); + }; + + xhr.send(); + }, getPlates(){ getPlateList().then(res =>{ this.plateData = res.data.data @@ -369,7 +403,7 @@ export default { tpProjectChange(val){ let selectedOption = this.projectOption.find(option => option.id === val); this.projectForm.cycleTestItemCondition = selectedOption.condition - this.projectForm.cycleTestItemStandard = selectedOption.standard + this.projectForm.cycleTestStandardName = selectedOption.cycleTestStandardName }, // 切换周期 diff --git a/src/views/periodicTesting/components/addTestProjectDialog.vue b/src/views/periodicTesting/components/addTestProjectDialog.vue index 3a46037..bfcb375 100644 --- a/src/views/periodicTesting/components/addTestProjectDialog.vue +++ b/src/views/periodicTesting/components/addTestProjectDialog.vue @@ -108,7 +108,6 @@ export default { }) }, changeStand(val){ - console.log('val----------',val) if(val == 6){ this.ruleForm.cycleTestStandardName = '' this.fileList = [] @@ -117,6 +116,7 @@ export default { getDetails(id) { getDetail(id).then(res => { this.ruleForm = res.data.data; + this.ruleForm.cycleTestStandardId = this.ruleForm.cycleTestStandardId == -1 ? '' : this.ruleForm.cycleTestStandardId this.ruleForm.standardValue = 3 }); }, diff --git a/src/views/periodicTesting/components/viewDialog.vue b/src/views/periodicTesting/components/viewDialog.vue index 0105415..d7c1a52 100644 --- a/src/views/periodicTesting/components/viewDialog.vue +++ b/src/views/periodicTesting/components/viewDialog.vue @@ -14,7 +14,9 @@ 试验件:{{detailForm.testTypeName}} - 试验标准:{{detailForm.cycleTestItemStandard}} + 试验标准: + {{detailForm.cycleTestStandardName}} + @@ -48,17 +50,20 @@
试验结果
- + - 试验结果:{{detailForm.testDate}} + 试验结果: + + {{detailForm.originalName}} - 试验时间:{{detailForm.testDate}} + 试验时间: + {{detailForm.testDate}} - + - 未试验原因:{{detailForm.meterNum}} + 未试验原因:{{detailForm.reasonForNo}}
@@ -155,7 +160,6 @@ export default { } }, mounted(){ - console.log('row---------------------',this.rowObj) this.getDetail() }, methods:{ @@ -165,6 +169,36 @@ export default { this.detailForm = res.data.data }) }, + downloadA(fileUrl, fileName){ + const xhr = new XMLHttpRequest(); + xhr.open('GET', fileUrl, true); + xhr.responseType = 'blob'; + + xhr.onload = function () { + if (xhr.status === 200) { + const res = xhr.response; + const link = document.createElement('a'); + link.style.display = 'none'; + const url = window.URL.createObjectURL(res); + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click(); + window.URL.revokeObjectURL(link.href); + document.body.removeChild(link); + } else { + console.error('下载失败:', xhr.status); + ElMessage.error('下载失败,请稍后重试'); + } + }; + + xhr.onerror = function() { + console.error('下载请求出错'); + ElMessage.error('下载请求出错,请检查网络连接'); + }; + + xhr.send(); + }, closeDialog(){ this.$emit('closeDialog'); }, diff --git a/src/views/periodicTesting/projectCycle.vue b/src/views/periodicTesting/projectCycle.vue index 4c4475f..ef7600e 100644 --- a/src/views/periodicTesting/projectCycle.vue +++ b/src/views/periodicTesting/projectCycle.vue @@ -215,7 +215,7 @@ export default { }, { label: '试验标准', - prop: 'cycleTestItemStandard', + prop: 'cycleTestStandardName', search: false, sortable: true, width: 200, diff --git a/src/views/periodicTesting/testProject.vue b/src/views/periodicTesting/testProject.vue index a80ca3c..e767ace 100644 --- a/src/views/periodicTesting/testProject.vue +++ b/src/views/periodicTesting/testProject.vue @@ -29,7 +29,8 @@ 删除 @@ -191,6 +192,37 @@ export default { }); }, + downloadA(fileUrl, fileName){ + const xhr = new XMLHttpRequest(); + xhr.open('GET', fileUrl, true); + xhr.responseType = 'blob'; + + xhr.onload = function () { + if (xhr.status === 200) { + const res = xhr.response; + const link = document.createElement('a'); + link.style.display = 'none'; + const url = window.URL.createObjectURL(res); + link.href = url; + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click(); + window.URL.revokeObjectURL(link.href); + document.body.removeChild(link); + } else { + console.error('下载失败:', xhr.status); + ElMessage.error('下载失败,请稍后重试'); + } + }; + + xhr.onerror = function() { + console.error('下载请求出错'); + ElMessage.error('下载请求出错,请检查网络连接'); + }; + + xhr.send(); + }, + // 点击上方删除按钮,多条删除 handleDeletes() { if (this.selectionList.length == 0) { diff --git a/src/views/periodicTesting/testTask.vue b/src/views/periodicTesting/testTask.vue index 547dac0..dc1aca4 100644 --- a/src/views/periodicTesting/testTask.vue +++ b/src/views/periodicTesting/testTask.vue @@ -22,8 +22,8 @@ 批量下发