You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-spms-vue/src/views/purchase/cert/supCertSearch.vue

724 lines
29 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div>
<!-- 配送企业资质 -->
<el-card>
<el-form :model="filterQuery" class="query-form" label-width="120px" v-show="showSearch">
<el-row>
<el-col span="6">
<el-form-item label="配送企业名称:">
<el-input v-model="filterQuery.companyName" style="width: 90%" placeholder="请输入配送企业名称" clearable></el-input>
</el-form-item>
</el-col>
<el-col span="6">
<el-form-item label="统一社会信用号:">
<el-input v-model="filterQuery.creditNum" style="width: 90%" placeholder="请输入统一社会信用号" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group style="display:flex;">
<el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row @row-click="supCompanyClick">
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="配送企业名称" prop="companyName" show-overflow-tooltip></el-table-column>
<el-table-column label="统一社会信用号" prop="creditNum"></el-table-column>
<el-table-column label="所属地区" prop="area"></el-table-column>
<el-table-column label="详细地址" prop="detailAddr" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="审核状态" prop="auditStatus" width="120">
<template slot-scope="scope">
<el-tag :type="(scope.row.auditStatus) | statusFilterType">
{{ checkFlag[scope.row.auditStatus] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button type="text" size="small" v-if="scope.row.auditStatus ==6 || scope.row.auditStatus ==3" @click.native.stop="editCompany(scope.row)">审核</el-button>
<el-button type="text" size="small" v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3" @click.native.stop="editCompany(scope.row)">详情</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>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="handleCurrentChange"
></pagination>
</el-card>
<el-dialog
:title="formMap[formName]"
:visible.sync="supCompanyVisible"
width="80%"
v-if="supCompanyVisible"
@close='closeDialog'
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<supCompanyEditAdudit
:closeDialog="closeDialog"
:inputQuery="inputQuery"
:editType="editType"
></supCompanyEditAdudit>
</el-dialog>
<!-- 生产企业资质 -->
<el-card class="el-card">
<el-form :model="filterManufacturerQuery" class="query-form" label-width="120px" v-show="showSearch1">
<el-row>
<el-col :span="6">
<el-form-item label="生产企业名称">
<el-input v-model="filterManufacturerQuery.companyName" style="width: 90%" placeholder="请输入生产企业名称" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="统一社会信用号">
<el-input v-model="filterManufacturerQuery.creditCode" style="width: 90%" placeholder="请输入统一社会信用号" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group style="display:flex;">
<el-button icon="el-icon-view" type="primary" @click="hideSearch1">显示/隐藏搜索栏</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onManufacturerReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="onManufacturerSubmit">查询</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loadManufacturerLoading" :data="manufacturerList" style="width: 100%" border highlight-current-row @row-click="supManufacturerClick">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="生产企业名称" prop="companyName" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="社会信用号" prop="creditCode"></el-table-column>
<el-table-column label="企业类型" prop="bussinessStatus" width="120">
<template slot-scope="scope">
<span>{{ companyTypeMap[scope.row.companyType] }}</span>
</template>
</el-table-column>
<el-table-column label="所在地区" prop="placeArea"></el-table-column>
<el-table-column label="所在地址" prop="placeAddress" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="所属供应商" prop="supName" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="审核状态" prop="auditStatus" width="120">
<template slot-scope="scope">
<el-tag :type="(scope.row.auditStatus) | statusFilterType">
{{ checkFlag[scope.row.auditStatus] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button type="text" size="small" v-if="scope.row.auditStatus ==6 || scope.row.auditStatus ==3" @click.native.stop="addInfoDialog(scope.row)">审核</el-button>
<el-button type="text" size="small" v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3" @click.native.stop="addInfoDialog(scope.row)">详情</el-button>
<el-button type="text" size="small" v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3" @click.native="printSupCertManufacturerPdf(scope.row)">打印</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="manufacturerTotal>0"
:total="manufacturerTotal"
:page.sync="filterManufacturerQuery.page"
:limit.sync="filterManufacturerQuery.limit"
@pagination="handleManuChange"
></pagination>
</el-card>
<el-dialog
:title="formManufacturerMap[formManufacturerName]"
:visible.sync="addInfoVisible"
width="80%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="addInfoVisible"
@close='closeDialog'
>
<supManufacturerAuditDialog
:addCloseDialog="closeManufacturerDialog"
:enterpriseId="enterpriseId"
:inputQuery="inputManufacturerQuery"
:editType="editManufacturerType"
></supManufacturerAuditDialog>
</el-dialog>
<!-- 配送产品资质 -->
<el-card class="el-card">
<el-form :model="registrationQuery" class="query-form" label-width="100px" v-show="showSearch2">
<el-row style="width: 100%">
<el-form-item label="物资名称:">
<el-input v-model="registrationQuery.recordProductName" style="width: 90%" clearable="true" placeholder="请输入物资名称"></el-input>
</el-form-item>
<el-form-item label="注册备案号:">
<el-input v-model="registrationQuery.recordCode" style="width: 90%" clearable="true" placeholder="请输入注册备案号"></el-input>
</el-form-item>
<el-form-item label="注册备案人:">
<el-input v-model="registrationQuery.recordPeopleName" style="width: 90%" clearable="true" placeholder="请输入注册备案人"></el-input>
</el-form-item>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group style="display:flex;">
<el-button icon="el-icon-view" type="primary" @click="hideSearch2">显示/隐藏搜索栏</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset2">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit2">查询</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="registrationLoading" :data="registrationList" border highlight-current-row style="width: 100%">
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="物资名称" prop="recordProductName" show-overflow-tooltip></el-table-column>
<el-table-column label="注册/备案号" prop="recordCode" show-overflow-tooltip></el-table-column>
<el-table-column label="注册/备案人名称" prop="recordPeopleName" show-overflow-tooltip></el-table-column>
<el-table-column label="生产企业" prop="manufacturerName" show-overflow-tooltip></el-table-column>
<el-table-column label="所属供应商" prop="supName" show-overflow-tooltip></el-table-column>
<el-table-column label="审核状态" prop="auditStatus" width="120">
<template slot-scope="scope">
<el-tag :type="(scope.row.auditStatus) | statusFilterType">
{{ checkFlag[scope.row.auditStatus] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button type="text" size="small" v-if="scope.row.auditStatus ==6 || scope.row.auditStatus ==3" @click.native.stop="registrationDialog(scope.row)">审核</el-button>
<el-button type="text" size="small" v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3" @click.native.stop="registrationDialog(scope.row)">详情</el-button>
<el-button type="text" size="small" v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3" @click.native="printSupCertProductionPdf(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="certTotal>0"
:total="certTotal"
:page.sync="registrationQuery.page"
:limit.sync="registrationQuery.limit"
@pagination="certHandleCurrentChange"
></pagination>
</el-card>
<el-dialog
:title="formProductMap[formProductName]"
:visible.sync="registrationVisible"
width="80%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="registrationVisible"
@close='closeProductDialog'
>
<suppliersRegistrationBasic
:closeRegistrationDialog="closeProductDialog"
:inputQuery="inputProudtQuery"
:editType="editProductType"
></suppliersRegistrationBasic>
</el-dialog>
</div>
</template>
<script>
import {getSupComapnys, delSupComapnys, printSupCert, verifyTemplateFile,filterCompanyCertIdList,printSupCertManufacturer,printSupCertProduction} from "@/api/purchase/supCompany";
import supCompanyEditAdudit from "@/views/purchase/company/supCompanyAduditDialog";
import supManufacturerAuditDialog from "@/views/purchase/manufacturer/supManufacturerAuditDialog";
import {deleteCompany, getCompanyList} from "@/api/purchase/supManufacturer";
import suppliersRegistrationBasic from "@/views/purchase/product/supProductAuditDialog";
import {deleteRegistration, getRegistrationList} from "@/api/purchase/suppliersRegistrationBasic";
export default {
data() {
return {
/**-----------------配送企业资质----------------------------*/
showSearch:true,
filterQuery: {
companyName: "",
checkType: "",
creditNum: "",
auditStatus: "22",
page: 1,
limit: 20,
},
loading: false,
list: [],
total: 0,
formName: 1,
formMap: {
1: "配送企业资质详情",
2: "配送企业资质审核",
},
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
supCompanyVisible: false,
inputQuery: {},
editType: 0, //0:新增1编辑
/**-----------------生产企业资质----------------------------*/
showSearch1:true,
filterManufacturerQuery: {
customerId: null,
companyName: "",
creditCode: "",
placeArea: "",
auditStatus: "22",
page: 1,
limit: 10,
},
manufacturerTotal: 0,
companyTypeMap: {
1: "境内企业",
2: "境外企业"
},
productManageTypeMap: {
1: "Ⅰ类",
2: "Ⅱ类",
3: "Ⅲ类",
},
formManufacturerName: 1,
formManufacturerMap: {
1: "生产企业资质详情",
2: "生产企业资质审核",
},
manufacturerLoading: false,
manufacturerList: [],
fromOptions: [],
addInfoVisible: false,
enterpriseId: "",
inputManufacturerQuery: {},
editManufacturerType: 1,
loadManufacturerLoading: false,
/**----------------------------配送产品资质--------------------------------*/
showSearch2:true,
productLoading: false,
value: "",
registrationVisible: false,
registrationQuery: {
customerId: null,
manufacturerIdFk: null,
auditStatus: "22",
recordProductName: "",
recordCode: "",
recordPeopleName: "",
page: 1,
limit: 20
},
registrationList: [],
registrationLoading: false,
pmQuery: {
customerId: null,
companyName: null,
page: 1,
limit: 10,
},
formProductName: 1,
formProductMap: {
1: "配送产品资质详情",
2: "配送产品资质审核",
},
inputProudtQuery: {},
editProductType: 0,
certTotal: 0,
};
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
6: "warning",
};
return statusMap[status];
},
statusFilterName(status) {
const statusMap = {
0: "禁用",
1: "正常",
2: "未验证",
};
return statusMap[status];
},
},
methods: {
/**-------------------------配送企业资质--------------------------*/
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
companyName: "",
creditNum: "",
auditStatus: "22",
page: 1,
limit: 20,
};
this.getList();
this.productList = [];
this.salesmanList = [];
},
hideSearch() {
this.showSearch = !this.showSearch;
},
getList() {
this.loading = true;
getSupComapnys(this.filterQuery)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
onSubmit() {
this.getList();
},
editCompany(row) {
if (row.auditStatus == 6 || row.auditStatus == 3) {
this.formName = 2;
this.editType = 2;
} else {
this.editType = 1;
this.formName = 1;
}
this.supCompanyVisible = true;
this.inputQuery = row;
},
handleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getList();
},
deleteDialog(row) {
this.$confirm("删除后将清空该供应商以及所有关联信息?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let tQuery = {
id: row.customerId,
};
delSupComapnys(tQuery).then(() => {
this.getList();
});
})
.catch(() => {
});
},
closeDialog() {
this.supCompanyVisible = false;
},
supCompanyClick(row) {
this.filterManufacturerQuery.customerId = row.customerId;
this.onManufacturerReset();
},
/**-------------------------生产企业资质--------------------------*/
onManufacturerReset() {
let customerId = this.filterManufacturerQuery.customerId;
this.filterManufacturerQuery = {
customerId: customerId,
companyName: "",
creditCode: "",
placeArea: "",
page: 1,
auditStatus: "22",
limit: 10,
};
this.manufacturerList = [];
this.getManufacturerList();
},
hideSearch1() {
this.showSearch1 = !this.showSearch1;
},
onManufacturerSubmit() {
this.manufacturerList = [];
this.getManufacturerList();
},
getManufacturerList() {
this.manufacturerLoading = true;
getCompanyList(this.filterManufacturerQuery)
.then((response) => {
this.manufacturerLoading = false;
this.manufacturerList = response.data.list || [];
this.manufacturerTotal = response.data.total || 0;
})
.catch(() => {
this.manufacturerLoading = false;
this.manufacturerList = [];
this.manufacturerTotal = 0;
});
},
addInfoDialog(row) {
if (row.auditStatus == 6 || row.auditStatus == 3) {
this.editManufacturerType = 2;
this.formManufacturerName = 2;
} else {
this.editManufacturerType = 1;
this.formManufacturerName = 1;
}
this.enterpriseId = row.id;
this.inputManufacturerQuery = row;
this.addInfoVisible = true;
},
closeManufacturerDialog(type) {
this.addInfoVisible = false;
this.enterpriseId = null;
this.manufacturerList = [];
this.getManufacturerList();
},
handleManuChange(val) {
this.filterManufacturerQuery.page = val.page;
this.getManufacturerList();
},
supManufacturerClick(row) {
this.registrationQuery.customerId = row.customerId;
this.registrationQuery.manufacturerIdFk = row.manufacturerId;
this.onReset2();
},
/**-------------------------配送产品资质--------------------------*/
onReset2() {
let customerId = this.registrationQuery.customerId;
let manufacturerIdFk = this.registrationQuery.manufacturerIdFk;
this.registrationQuery = {
customerId: customerId,
manufacturerIdFk: manufacturerIdFk,
recordProductName: "",
recordCode: "",
recordPeopleName: "",
auditStatus: "22",
page: 1,
limit: 10
};
this.getRegistrationList();
},
onSubmit2() {
this.getRegistrationList();
},
hideSearch2() {
this.showSearch2 = !this.showSearch2;
},
registrationDialog(row) {
if (row.auditStatus == 6 || row.auditStatus == 3) {
this.formProductName = 2;
this.editProductType = 2;
} else {
this.editProductType = 1;
this.formProductName = 1;
}
this.registrationId = row.id;
this.inputProudtQuery = row;
this.registrationVisible = true;
},
closeProductDialog() {
this.registrationVisible = false;
this.enterpriseId = null;
this.registrationId = null;
this.registrationList = [];
this.getRegistrationList();
},
getRegistrationList() {
this.registrationLoading = true;
getRegistrationList(this.registrationQuery)
.then((response) => {
this.registrationLoading = false;
this.registrationList = response.data.list || [];
this.certTotal = response.data.total || 0;
})
.catch(() => {
this.registrationLoading = false;
this.registrationList = [];
this.certTotal = 0;
});
},
certHandleCurrentChange(val) {
this.registrationQuery.page = val.page;
this.getRegistrationList();
},
printSupCertPdf(row) {
let query = {id: 1};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
//查询全部详情id
var supCertQuery={
customerId:row.customerId,
type:1
};
filterCompanyCertIdList(supCertQuery).then((req) => {
if(req.code===20000){
let printParams = {
templateId: res.data,
ids: req.data,
customerId: row.customerId
};
printSupCert(printParams).then((response) => {
//将pdf文件转换为url。
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);
})
},
//生产企业打印
printSupCertManufacturerPdf(row) {
let query = {id: 2};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
//查询全部详情id
var supCertQuery={
customerId:row.customerId,
manufacturerIdFk:row.manufacturerId,
type:2
};
filterCompanyCertIdList(supCertQuery).then((req) => {
if(req.code===20000){
let printParams = {
templateId: res.data,
ids: req.data,
id: row.id
};
printSupCertManufacturer(printParams).then((response) => {
//将pdf文件转换为url。
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);
})
},
//生产产品打印
printSupCertProductionPdf(row) {
let query = {id: 3};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
//查询全部详情id
var supCertQuery={
customerId:row.customerId,
manufacturerIdFk:row.manufacturerIdFk,
productIdFk:row.productId,
type:3
};
filterCompanyCertIdList(supCertQuery).then((req) => {
if(req.code===20000){
let printParams = {
templateId: res.data,
ids: req.data,
id: row.id
};
printSupCertProduction(printParams).then((response) => {
//将pdf文件转换为url。
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: {
supCompanyEditAdudit, supManufacturerAuditDialog, suppliersRegistrationBasic
}
,
mounted() {
},
created() {
this.getList();
},
};
</script>