配送企业资质打印

wang
郑明梁 3 years ago
parent 8c51dec1e4
commit 154fe42896

@ -42,7 +42,6 @@ export function auditSupCert(query) {
} }
export function deleteCompanyCert(query) { export function deleteCompanyCert(query) {
return axios( return axios(
{ {

@ -93,7 +93,23 @@ export function getSubCompany(query) {
} }
); );
} }
export function verifyTemplateFile(data) {
return axios({
url: "/sup/info/verifyTemplateFile",
method: "post",
data: data
});
}
export function printSupCert(data) {
return axios({
url: "/sup/info/printOrder",
method: "post",
headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
responseType: 'arraybuffer', //一定要设置响应类型否则页面会是空白pdf
data: data
});
}
export function bindCorp(query) { export function bindCorp(query) {
return axios( return axios(
{ {
@ -103,6 +119,15 @@ export function bindCorp(query) {
} }
); );
} }
export function filterCompanyCertIdList(query) {
return axios(
{
url: "/sup/info/filterCompanyCertIdList",
method: "post",
data: query
}
);
}

@ -1421,7 +1421,6 @@ export default {
this.editDialogVisible = true; this.editDialogVisible = true;
this.editQuery = row; this.editQuery = row;
this.pId=row.id; this.pId=row.id;
this.pId=row.id;
this.relevanceEdit = { this.relevanceEdit = {
id: row.id, id: row.id,
// thirdId: row.thirdId, // thirdId: row.thirdId,

@ -82,6 +82,14 @@
>详情 >详情
</el-button> </el-button>
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3"
@click.native="printSupCertPdf(scope.row)"
>打印
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -321,7 +329,7 @@
</template> </template>
<script> <script>
import {getSupComapnys, delSupComapnys} from "@/api/purchase/supCompany"; import {getSupComapnys, delSupComapnys, printSupCert, verifyTemplateFile,filterCompanyCertIdList} from "@/api/purchase/supCompany";
import supCompanyEditAdudit from "./supCompanyAduditDialog"; import supCompanyEditAdudit from "./supCompanyAduditDialog";
import supManufacturerAuditDialog from "@/views/purchase/supManufacturerAuditDialog"; import supManufacturerAuditDialog from "@/views/purchase/supManufacturerAuditDialog";
import {deleteCompany, getCompanyList} from "@/api/purchase/supManufacturer"; import {deleteCompany, getCompanyList} from "@/api/purchase/supManufacturer";
@ -651,9 +659,49 @@ export default {
certHandleCurrentChange(val) { certHandleCurrentChange(val) {
this.registrationQuery.page = val; this.registrationQuery.page = val;
this.getRegistrationList(); this.getRegistrationList();
} },
printSupCertPdf(row) {
let query = {moduleId: 8};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
//id
var supCertQuery={
customerId:row.customerId,
type:1
};
filterCompanyCertIdList(supCertQuery).then((req) => {
debugger
if(req.code===20000){
let printParams = {
templateId: res.data,
ids: req.data,
customerId: row.customerId
};
printSupCert(printParams).then((response) => {
//pdfurl
const binaryData = [];
binaryData.push(response);
//blob
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
window.open(url);//pdf
})
}
})
} else {
this.loading = false;
this.$message.error(res.message);
}
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
})
},
}, },
components: { components: {
supCompanyEditAdudit, supManufacturerAuditDialog, suppliersRegistrationBasic supCompanyEditAdudit, supManufacturerAuditDialog, suppliersRegistrationBasic
} }

@ -8,8 +8,9 @@
> >
<el-card class="el-card" style="margin-top: -25px"> <el-card class="el-card" style="margin-top: -25px">
<div style="display: flex;" v-if="editType==2"> <div style="display: flex;" >
<el-button <el-button
v-if="editType==2"
type="primary" type="primary"
size="mini" size="mini"
icon="search" icon="search"
@ -18,6 +19,7 @@
</el-button </el-button
> >
<el-button <el-button
v-if="editType==2"
type="primary" type="primary"
size="mini" size="mini"
icon="search" icon="search"
@ -25,6 +27,13 @@
>审核拒绝 >审核拒绝
</el-button </el-button
> >
<el-button
type="primary"
size="mini"
icon="search"
@click="printSupCertAll"
>打印
</el-button>
</div> </div>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 20px"> <el-row :gutter="20" class="el-row" type="flex" style="margin-top: 20px">
<el-col :span="10" class="el-col"> <el-col :span="10" class="el-col">
@ -135,7 +144,10 @@
<el-table v-loading="certLoading" <el-table v-loading="certLoading"
:data="certList" :data="certList"
ref="certTable"
style="width: 100%"> style="width: 100%">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column type="index" label="序号" width="50"></el-table-column> <el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="证书名称" prop="name"></el-table-column> <el-table-column label="证书名称" prop="name"></el-table-column>
<el-table-column label="证书编号" prop="code"></el-table-column> <el-table-column label="证书编号" prop="code"></el-table-column>
@ -164,6 +176,13 @@
>预览 >预览
</el-button </el-button
> >
<el-button
type="text"
size="small"
@click.native="printSupCert(scope.row)"
>打印
</el-button
>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@ -211,7 +230,7 @@
</template> </template>
<script> <script>
import {modifyCompany, auditCompany} from "../../api/purchase/supCompany"; import {modifyCompany, auditCompany,printSupCert, verifyTemplateFile} from "../../api/purchase/supCompany";
import { import {
provinceAndCityData, provinceAndCityData,
regionData, regionData,
@ -519,7 +538,72 @@ export default {
}); });
} }
, ,
printSupCert(row) {
var selectIds=[row.id];
let query = {moduleId: 8};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
let printParams = {
templateId: res.data,
ids: selectIds,
customerId: row.customerId
};
printSupCert(printParams).then((response) => {
//pdfurl
const binaryData = [];
binaryData.push(response);
//blob
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
window.open(url);//pdf
})
} else {
this.loading = false;
this.$message.error(res.message);
}
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
})
},
printSupCertAll() {
var certLists=this.$refs.certTable.selection;
var selectIds=[];
certLists.forEach(item => {
selectIds.push(item.id);
})
let query = {moduleId: 8};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
let printParams = {
templateId: res.data,
ids: selectIds,
customerId: this.inputQuery.customerId
};
printSupCert(printParams).then((response) => {
//pdfurl
const binaryData = [];
binaryData.push(response);
//blob
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
window.open(url);//pdf
})
} else {
this.loading = false;
this.$message.error(res.message);
}
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
})
},
deleteCompanyCert(row) { deleteCompanyCert(row) {
this.$confirm("是否删除?", "提示", { this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",

Loading…
Cancel
Save