编码管理检验报告同步
This commit is contained in:
parent
565ae7bd9a
commit
2b4ee6800c
|
|
@ -71,3 +71,11 @@ export function getProjectList(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设备管理--获取报告编号信息
|
||||||
|
export function getSynchReportCode(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/ma_machine/getReport',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
|
|
@ -54,6 +54,7 @@
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
<el-button icon="el-icon-upload2" size="mini" @click="handleSynch">检验报告同步</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
|
@ -333,17 +334,37 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 检验报告同步对话框 -->
|
||||||
|
<el-dialog :title="titleSynch" :visible.sync="openSynch" width="500px" append-to-body @close="cancelSynch">
|
||||||
|
<el-form ref="formSynchParams" :model="formSynchParams" :inline="true">
|
||||||
|
<el-form-item prop="reportCode">
|
||||||
|
<el-input v-model="formSynchParams.reportCode" placeholder="请输入报告编号" maxlength="20" style="width: 340px"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuerySynch">查询</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<div style="margin-top: 10px; height: 100px; text-align: center; ">
|
||||||
|
<img v-if="formSynchParams.pdf" src="../../../../assets/img/pdf.png" alt="暂无图片" @click="downloadPdf" style="max-width: 100%; max-height: 100%;" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer" style="text-align: right">
|
||||||
|
<el-button type="primary" @click="downloadCode">同步</el-button>
|
||||||
|
<el-button @click="cancelSynch">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getListDevice,getDeviceDetail,editDevice,addDevice,delDevice,getDeviceType,getZichanType } from "@/api/ma/device";
|
import { getListDevice,getDeviceDetail,editDevice,addDevice,delDevice,getDeviceType,getZichanType,getSynchReportCode } from "@/api/ma/device";
|
||||||
import { getKeeperIds} from "@/api/ma/typeConfigKeeper";
|
import { getKeeperIds} from "@/api/ma/typeConfigKeeper";
|
||||||
import { getRepairIds } from "@/api/ma/typeConfigRepair";
|
import { getRepairIds } from "@/api/ma/typeConfigRepair";
|
||||||
import {
|
import {
|
||||||
getUserTypeList,
|
getUserTypeList,
|
||||||
} from "@/api/ma/base";
|
} from "@/api/ma/base";
|
||||||
import { downloadFile } from '@/utils/download'
|
import { downloadFile, downloadFileData } from '@/utils/download'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import QRCode from 'qrcodejs2';
|
import QRCode from 'qrcodejs2';
|
||||||
import html2canvas from 'html2canvas';
|
import html2canvas from 'html2canvas';
|
||||||
|
|
@ -440,6 +461,16 @@
|
||||||
qrcodeUrl: '',
|
qrcodeUrl: '',
|
||||||
KeeperOptions: [],
|
KeeperOptions: [],
|
||||||
repairerOptions: [],
|
repairerOptions: [],
|
||||||
|
|
||||||
|
|
||||||
|
titleSynch: "", //检验报告同步标题
|
||||||
|
openSynch: false, //检验报告同步
|
||||||
|
synchLoading: false, //检验报告同步loading
|
||||||
|
formSynchParams: { //检验报告同步表单
|
||||||
|
reportCode: "", //检验报告编号
|
||||||
|
pdf: "", //检验报告pdf
|
||||||
|
pdfName: "", //检验报告pdf名称
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -705,8 +736,57 @@
|
||||||
buyTask: row.buyTask
|
buyTask: row.buyTask
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
|
||||||
|
//检验报告同步
|
||||||
|
handleSynch(){
|
||||||
|
this.titleSynch = "检验报告同步";
|
||||||
|
this.openSynch = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
handleQuerySynch(){
|
||||||
|
const params = {
|
||||||
|
reportCode: this.formSynchParams.reportCode,
|
||||||
|
}
|
||||||
|
getSynchReportCode(params).then((response) => {
|
||||||
|
let data = response.data;
|
||||||
|
if(data.pdf){
|
||||||
|
this.formSynchParams.pdf = data.pdf;
|
||||||
|
this.formSynchParams.pdfName = data.reportName;
|
||||||
|
}else{
|
||||||
|
this.formSynchParams.pdf = "";
|
||||||
|
this.formSynchParams.pdfName = "";
|
||||||
|
this.$message.error('该报告编号暂无文件');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
downloadPdf(){
|
||||||
|
if (this.formSynchParams.pdf) {
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = this.formSynchParams.pdf;
|
||||||
|
// 从 URL 中提取文件名,如果无法提取则使用默认文件名
|
||||||
|
const fileName = this.formSynchParams.pdfName;
|
||||||
|
link.download = fileName;
|
||||||
|
// 设置在新页面打开
|
||||||
|
link.target = '_blank';
|
||||||
|
// 将链接添加到文档中
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
// 移除链接
|
||||||
|
document.body.removeChild(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
cancelSynch(){
|
||||||
|
this.openSynch = false;
|
||||||
|
this.formSynchParams = { //检验报告同步表单
|
||||||
|
reportCode: "", //检验报告编号
|
||||||
|
pdf: "", //检验报告pdf
|
||||||
|
pdfName: "", //检验报告pdf名称
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// handleExport() {
|
// handleExport() {
|
||||||
// this.download('/material/ma_machine/export', {
|
// this.download('/material/ma_machine/export', {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue