zhangdi 4 months ago
commit 4d5a807dd2
  1. 3
      src/api/qualityManagement/periodicTesting/testTask.js
  2. 1
      src/components/basic-import/main.vue
  3. 46
      src/views/periodicTesting/components/addProjectCycleDialog.vue
  4. 2
      src/views/periodicTesting/components/addTestProjectDialog.vue
  5. 48
      src/views/periodicTesting/components/viewDialog.vue
  6. 2
      src/views/periodicTesting/projectCycle.vue
  7. 34
      src/views/periodicTesting/testProject.vue
  8. 22
      src/views/periodicTesting/testTask.vue

@ -1,7 +1,7 @@
import request from '@/axios'; import request from '@/axios';
// 获取列表数据 bsCraftAbility/queryAllCa // 获取列表数据 bsCraftAbility/queryAllCa
export const getList = (current, size, params) => { export const getList = (current, size, params,filterType) => {
return request({ return request({
url: '/blade-desk/QA/CycleTestTask/list', url: '/blade-desk/QA/CycleTestTask/list',
method: 'get', method: 'get',
@ -9,6 +9,7 @@ export const getList = (current, size, params) => {
...params, ...params,
current, current,
size, size,
filterType
}, },
}); });
}; };

@ -79,7 +79,6 @@ export default {
this.$emit('closeDialog'); this.$emit('closeDialog');
}, },
handleTemplate() { handleTemplate() {
console.log('templateUrl----------',this.templateUrl)
exportBlob( exportBlob(
`${this.templateUrl}?${this.website.tokenHeader}=${getToken()}` `${this.templateUrl}?${this.website.tokenHeader}=${getToken()}`
).then(res => { ).then(res => {

@ -32,10 +32,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="试验标准:" prop="cycleTestItemStandard"> <el-form-item label="试验标准:" prop="cycleTestStandardName">
<el-input <el-input
disabled disabled
v-model="projectForm.cycleTestItemStandard" v-model="projectForm.cycleTestStandardName"
placeholder="请输入试验标准" placeholder="请输入试验标准"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -200,9 +200,10 @@
> >
<el-col :span="6">试验件{{ projectForm.testTypeName }}</el-col> <el-col :span="6">试验件{{ projectForm.testTypeName }}</el-col>
<el-col :span="6"><span>试验项目{{projectForm.cycleTestItemName}}</span></el-col> <el-col :span="6"><span>试验项目{{projectForm.cycleTestItemName}}</span></el-col>
<el-col :span="6" <el-col :span="6" >试验标准
>试验标准<span style="color: #1890ff">{{ projectForm.cycleTestItemStandard }}</span></el-col <span style="color: #1890ff;cursor:pointer;" @click="downloadA(projectForm.standard.link,projectForm.standard.originalName)">{{ projectForm.cycleTestStandardName }}</span>
> <!-- <a style="color: #1890ff;cursor:pointer;" :href="projectForm.link">{{ projectForm.cycleTestStandardName }} {{projectForm.link}}</a> -->
</el-col>
</el-row> </el-row>
<el-row :gutter="20" style="padding: 5px 0"> <el-row :gutter="20" style="padding: 5px 0">
<el-col :span="6">试验条件{{ projectForm.cycleTestItemCondition }}</el-col> <el-col :span="6">试验条件{{ projectForm.cycleTestItemCondition }}</el-col>
@ -317,6 +318,9 @@ export default {
}, },
methods: { methods: {
downloadStandard(val){
},
getRowDetail(id){ getRowDetail(id){
getDetail(id).then(res =>{ getDetail(id).then(res =>{
this.projectForm = { 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(){ getPlates(){
getPlateList().then(res =>{ getPlateList().then(res =>{
this.plateData = res.data.data this.plateData = res.data.data
@ -369,7 +403,7 @@ export default {
tpProjectChange(val){ tpProjectChange(val){
let selectedOption = this.projectOption.find(option => option.id === val); let selectedOption = this.projectOption.find(option => option.id === val);
this.projectForm.cycleTestItemCondition = selectedOption.condition this.projectForm.cycleTestItemCondition = selectedOption.condition
this.projectForm.cycleTestItemStandard = selectedOption.standard this.projectForm.cycleTestStandardName = selectedOption.cycleTestStandardName
}, },
// //

@ -108,7 +108,6 @@ export default {
}) })
}, },
changeStand(val){ changeStand(val){
console.log('val----------',val)
if(val == 6){ if(val == 6){
this.ruleForm.cycleTestStandardName = '' this.ruleForm.cycleTestStandardName = ''
this.fileList = [] this.fileList = []
@ -117,6 +116,7 @@ export default {
getDetails(id) { getDetails(id) {
getDetail(id).then(res => { getDetail(id).then(res => {
this.ruleForm = res.data.data; this.ruleForm = res.data.data;
this.ruleForm.cycleTestStandardId = this.ruleForm.cycleTestStandardId == -1 ? '' : this.ruleForm.cycleTestStandardId
this.ruleForm.standardValue = 3 this.ruleForm.standardValue = 3
}); });
}, },

@ -14,7 +14,9 @@
<span>试验件</span><span>{{detailForm.testTypeName}}</span> <span>试验件</span><span>{{detailForm.testTypeName}}</span>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<span>试验标准</span><span style="color: #1890ff;">{{detailForm.cycleTestItemStandard}}</span> <span>试验标准</span>
<span style="color: #1890ff;cursor:pointer;" @click="downloadA(detailForm.standard.link,detailForm.standard.originalName)">{{detailForm.cycleTestStandardName}}</span>
<!-- <a style="color: #1890ff;cursor:pointer;" :href="detailForm.link" :download="detailForm.cycleTestStandardName">{{ detailForm.cycleTestStandardName }}</a> -->
</el-col> </el-col>
</el-row> </el-row>
<el-row class="item_item" :gutter="20"> <el-row class="item_item" :gutter="20">
@ -48,17 +50,20 @@
</div> </div>
<div style="font-weight: 550;">试验结果</div> <div style="font-weight: 550;">试验结果</div>
<div class="info_box"> <div class="info_box">
<el-row class="item_item" :gutter="20"> <el-row class="item_item" :gutter="20" v-if="detailForm.isDone == 1">
<el-col :span="6"> <el-col :span="6">
<span>试验结果</span><span style="color: #1890FF;cursor: pointer;">{{detailForm.testDate}}</span> <span>试验结果</span>
<!-- <span style="color: #1890FF;cursor: pointer;">{{detailForm.testDate}}</span> -->
<span style="color: #1890ff;cursor: pointer;" @click="downloadA(detailForm.link,detailForm.originalName)">{{detailForm.originalName}}</span>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<span>试验时间</span><span>{{detailForm.testDate}}</span> <span>试验时间</span>
<span>{{detailForm.testDate}}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row class="item_item" :gutter="20" v-show="detailForm.isDone == 0"> <el-row class="item_item" :gutter="20" v-show="detailForm.isDone == 2" >
<el-col :span="6"> <el-col :span="6">
<span>未试验原因</span><span>{{detailForm.meterNum}}</span> <span>未试验原因</span><span>{{detailForm.reasonForNo}}</span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -155,7 +160,6 @@ export default {
} }
}, },
mounted(){ mounted(){
console.log('row---------------------',this.rowObj)
this.getDetail() this.getDetail()
}, },
methods:{ methods:{
@ -165,6 +169,36 @@ export default {
this.detailForm = res.data.data 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(){ closeDialog(){
this.$emit('closeDialog'); this.$emit('closeDialog');
}, },

@ -215,7 +215,7 @@ export default {
}, },
{ {
label: '试验标准', label: '试验标准',
prop: 'cycleTestItemStandard', prop: 'cycleTestStandardName',
search: false, search: false,
sortable: true, sortable: true,
width: 200, width: 200,

@ -29,7 +29,8 @@
<el-button type="text" @click="handleDel(scope.row)">删除</el-button> <el-button type="text" @click="handleDel(scope.row)">删除</el-button>
</template> </template>
<template #originalName="{ row }"> <template #originalName="{ row }">
<a style="color:#284c89" :href="row.link" :download="row.originalName">{{row.originalName}}</a> <span style="color:#284c89;cursor:pointer;" @click="downloadA(row.link,row.originalName)">{{row.originalName}}</span>
<!-- <a :href="row.link" :download="row.originalName">{{row.originalName}}</a> -->
</template> </template>
</avue-crud> </avue-crud>
@ -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() { handleDeletes() {
if (this.selectionList.length == 0) { if (this.selectionList.length == 0) {

@ -22,8 +22,8 @@
<el-button @click="handleIssue" type="primary"> 批量下发 </el-button> <el-button @click="handleIssue" type="primary"> 批量下发 </el-button>
</template> </template>
<template #menu-right="{ size }"> <template #menu-right="{ size }">
<el-button type="warning" plain>临期</el-button> <el-button type="warning" plain @click="handleSearch(1)">临期</el-button>
<el-button type="danger" plain>超期</el-button> <el-button type="danger" plain @click="handleSearch(2)">超期</el-button>
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button type="text" @click="handleView(scope.row, 'view')">详情</el-button> <el-button type="text" @click="handleView(scope.row, 'view')">详情</el-button>
@ -334,7 +334,7 @@ export default {
}, },
{ {
label: '试验标准', label: '试验标准',
prop: 'cycleTestItemStandard', prop: 'cycleTestStandardName',
type: 'textarea', type: 'textarea',
search: false, search: false,
sortable: true, sortable: true,
@ -523,7 +523,8 @@ export default {
}, },
selectionList: [], selectionList: [],
dialogType: '', dialogType: '',
issueType:'one' issueType:'one',
filterType:''
}; };
}, },
computed: { computed: {
@ -609,6 +610,12 @@ export default {
this.issueDialog = true; this.issueDialog = true;
} }
}, },
//
handleSearch(val){
this.page.currentPage = 1
this.filterType = val
this.onLoad(this.page)
},
// //
issueRow(row) { issueRow(row) {
this.issueType = 'one' this.issueType = 'one'
@ -633,8 +640,6 @@ export default {
}, },
writeSubmit() { writeSubmit() {
this.$refs.writeForm.validate(valid => { this.$refs.writeForm.validate(valid => {
console.log('valid=============================', valid);
console.log('fileList=============================', this.fileList);
if (valid) { if (valid) {
let params ={ let params ={
id:this.writeForm.id, id:this.writeForm.id,
@ -643,7 +648,6 @@ export default {
testAttachId:this.writeForm.isDone == 1 ? this.fileList.map(item => item.attachId).join(',') : '', testAttachId:this.writeForm.isDone == 1 ? this.fileList.map(item => item.attachId).join(',') : '',
reasonForNo:this.writeForm.isDone == 2 ? this.writeForm.reasonForNo ? this.writeForm.reasonForNo : '' : '' reasonForNo:this.writeForm.isDone == 2 ? this.writeForm.reasonForNo ? this.writeForm.reasonForNo : '' : ''
} }
console.log('params==============',params)
writeTask(params).then(res =>{ writeTask(params).then(res =>{
if(res.data.code == 200){ if(res.data.code == 200){
this.$message.success('填报成功') this.$message.success('填报成功')
@ -657,10 +661,12 @@ export default {
}, },
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.filterType = ''
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params, done) { searchChange(params, done) {
this.query = params; this.query = params;
this.filterType = ''
this.page.currentPage = 1; this.page.currentPage = 1;
this.onLoad(this.page, params); this.onLoad(this.page, params);
done(); done();
@ -711,7 +717,7 @@ export default {
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query),this.filterType).then(res => {
this.data = res.data.data.records; this.data = res.data.data.records;
this.loading = false; this.loading = false;

Loading…
Cancel
Save