首营资质 资质新增 资质审核代码提交

prod
郑明梁 3 years ago
parent 45c43ce0ea
commit ac1bd1ab14

@ -0,0 +1,11 @@
import axios from "@/utils/request";
export function filterClassify(query) {
return axios(
{
url: "/spms/classify/code/filter",
method: "get",
params: query
}
);
}

@ -0,0 +1,59 @@
import axios from "@/utils/request";
export function filterCompanyCert(query) {
return axios(
{
url: "/sup/company/cert/filter",
method: "get",
params: query
}
)
}
export function insertCompanyCert(query) {
return axios(
{
url: "/sup/info/insertCompanyCert",
method: "post",
data: query
}
);
}
export function updateCompanyCert(query) {
return axios(
{
url: "/sup/info/updateCompanyCert",
method: "post",
data: query
}
);
}
export function auditSupCert(query) {
return axios(
{
url: "/sale/sup/cert/audit",
method: "post",
data: query
}
);
}
export function deleteCompanyCert(query) {
return axios(
{
url: "/sup/info/deleteCompanyCert",
method: "post",
data: query
}
);
}

@ -0,0 +1,90 @@
import request from '@/utils/request'
import axios from "@/utils/request";
export function listApply(query) {
return request({
url: '/purchase/apply/list',
method: 'get',
params: query
})
}
export function auditListApply(query) {
return request({
url: '/purchase/apply/auditList',
method: 'get',
params: query
})
}
export function listApplyDetail(query) {
return request({
url: '/purchase/apply/list/detail',
method: 'get',
params: query
})
}
export function getApply(id) {
return request({
url: '/purchase/apply/' + id,
method: 'get'
})
}
export function addApply(data) {
return request({
url: '/purchase/apply',
method: 'post',
data: data
})
}
export function auditOrder(data) {
return request({
url: '/purchase/apply/auditOrder',
method: 'post',
data: data
})
}
// 修改pur
export function updateApply(data) {
return request({
url: '/purchase/apply',
method: 'put',
data: data
})
}
// 删除pur
export function delApply(id) {
return request({
url: '/purchase/apply/' + id,
method: 'delete'
})
}
export function inserThrOrderWeb(query) {
return axios({
url: "/purchase/apply/postOrder",
method: "post",
data: query
});
}
// 删除pur
export function delApplyDetail(id) {
return request({
url: '/purchase/apply/detail/' + id,
method: 'delete'
})
}

@ -0,0 +1,86 @@
import axios from "@/utils/request";
export function listPlan(query) {
return axios({
url: '/purchase/plan/list',
method: 'get',
params: query
})
}
export function auditListPlan(query) {
return axios({
url: '/purchase/plan/auditList',
method: 'get',
params: query
})
}
export function listApplyDetail(query) {
return axios({
url: '/purchase/plan/list/detail',
method: 'get',
params: query
})
}
export function getApply(id) {
return axios({
url: '/purchase/plan/' + id,
method: 'get'
})
}
export function addApply(data) {
return axios({
url: '/purchase/plan',
method: 'post',
data: data
})
}
export function auditOrder(data) {
return axios({
url: '/purchase/plan/auditOrder',
method: 'post',
data: data
})
}
// 修改pur
export function updateApply(data) {
return axios({
url: '/purchase/plan',
method: 'put',
data: data
})
}
// 删除pur
export function delApply(id) {
return axios({
url: '/purchase/plan/' + id,
method: 'delete'
})
}
export function inserThrOrderWeb(query) {
return axios({
url: "/purchase/plan/postOrder",
method: "post",
data: query
});
}
// 删除pur
export function delApplyDetail(id) {
return axios({
url: '/purchase/plan/detail/' + id,
method: 'delete'
})
}

@ -0,0 +1,54 @@
import axios from "@/utils/request";
export function filterCertSet(query) {
return axios(
{
url: "/sup/cert/set/filter",
method: "get",
params: query
}
);
}
export function delSupCertCert(query) {
return axios(
{
url: "/sup/cert/set/delete",
method: "post",
data: query
}
);
}
export function addSupCertSet(query) {
return axios(
{
url: "/sup/cert/set/add",
method: "post",
data: query
}
);
}
export function modifySupCertSet(query) {
return axios(
{
url: "/sup/cert/set/update",
method: "post",
data: query
}
);
}
export function selectAllCert(query) {
return axios(
{
url: "/sup/info/selectAllCert",
method: "post",
data: query
}
);
}

@ -0,0 +1,162 @@
import axios from "@/utils/request";
export function getSupComapnys(query) {
return axios(
{
url: "/api/pur/getSupComapnys",
method: "get",
params: query
}
);
}
export function delSupComapnys(query) {
return axios(
{
url: "/api/pur/supCompany/delete",
method: "post",
data: query
}
);
}
export function modifyCompany(query) {
return axios(
{
url: "/api/pur/modifyCompany",
method: "post",
data: query
}
);
}
export function auditCompany(query) {
return axios(
{
url: "/api/pur/auditCompany",
method: "post",
data: query
}
);
}
export function addCompany(query) {
return axios(
{
url: "/api/pur/addCompany",
method: "post",
data: query
}
);
}
export function getRefid(query) {
return axios(
{
url: "/sale/info/refid",
method: "get",
params: query
}
);
}
export function checkCompany(query) {
return axios(
{
url: "/salewarehouse/register/checkCompany",
method: "get",
params: query
}
);
}
export function getRegisterConfig(query) {
return axios(
{
url: "/salewarehouse/register/getRegisterConfig",
method: "get",
params: query
}
);
}
export function getSubCompany(query) {
return axios(
{
url: "/sale/info/getSubCompany",
method: "get",
params: 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) {
return axios(
{
url: "/sup/company/selectBind",
method: "post",
data: query
}
);
}
export function filterCompanyCertIdList(query) {
return axios(
{
url: "/sup/info/filterCompanyCertIdList",
method: "post",
data: query
}
);
}
export function printSupCertManufacturer(data) {
return axios({
url: "/sup/info/printSupCertManufacturer",
method: "post",
headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
responseType: 'arraybuffer', //一定要设置响应类型否则页面会是空白pdf
data: data
});
}
export function printSupCertProduction(data) {
return axios({
url: "/sup/info/printSupCertProduction",
method: "post",
headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
responseType: 'arraybuffer', //一定要设置响应类型否则页面会是空白pdf
data: data
});
}

@ -0,0 +1,58 @@
import axios from "@/utils/request";
export function getCompanyList(query) {
return axios({
url: "/sup/manufacturer/getCompanyList",
method: "get",
params: query
});
}
export function getCompanyBySup(query) {
return axios({
url: "/sup/manufacturer/getCompanyBySup",
method: "get",
params: query
});
}
export function getCompanyInfo(query) {
return axios({
url: "/sup/manufacturer/getCompanyInfo",
method: "get",
params: query
});
}
export function addOrModifyCompany(query, formName) {
let url = formName === "add" ?
"/sup/manufacturer/addCompany" : "/sup/manufacturer/modifyCompany";
return axios(
{
url: url,
method: "post",
data: query
}
);
}
export function auditManufacturer(query) {
return axios(
{
url: "/udiwms/sup/manufacturer/audit",
method: "post",
data: query
}
);
}
export function deleteCompany(query) {
return axios({
url: "/sup/manufacturer/basic/delete",
method: "get",
params: query
});
}

@ -0,0 +1,57 @@
import axios from "@/utils/request";
export function filterCompanyCert(query) {
return axios(
{
url: "/udiwms/info/suppliers/enterprise/basic/cert/filter",
method: "get",
params: query
}
)
}
export function getCompanyCert(query) {
return axios(
{
url: "/udiwms/info/suppliers/enterprise/basic/cert/companyCert",
method: "get",
params: query
}
);
}
export function insertCompanyCert(query) {
return axios(
{
url: "/udiwms/info/suppliers/enterprise/basic/cert/insertCompanyCert",
method: "post",
data: query
}
);
}
export function updateCompanyCert(query) {
return axios(
{
url: "/udiwms/info/suppliers/enterprise/basic/cert/updateCompanyCert",
method: "post",
data: query
}
);
}
export function deleteCompanyCert(query) {
return axios(
{
url: "/udiwms/info/suppliers/enterprise/basic/cert/deleteCompanyCert",
method: "post",
data: query
}
);
}

@ -0,0 +1,55 @@
import axios from "@/utils/request";
export function getRegistrationList(query) {
return axios({
url: "/sup/product/getRegistrationList",
method: "get",
params: query
});
}
export function getRegistrationInfo(query) {
return axios({
url: "/sup/product/getRegistrationInfo",
method: "get",
params: query
});
}
export function addOrModifyRegistration(query, formName) {
let url = formName === "add" ?
"/sup/product/addRegistration" : "/sup/product/modifyRegistration";
return axios(
{
url: url,
method: "post",
data: query
}
);
}
export function deleteRegistration(query) {
return axios({
url: "/sup/product/delete",
method: "get",
params: query
});
}
export function auditSupProduct(data) {
return axios({
url: '/udiwms/pur/suppliers/product/audit',
method: 'post',
data: data
})
}
export function bindProduct(data) {
return axios({
url: '/sup/product/selectBind',
method: 'post',
data: data
})
}

@ -153,7 +153,6 @@
},
downloadExcel(row) {
axios.get("./config.json").then(res => {
debugger
let baseUrl = res.data.BASE_URL;
let href = baseUrl + "/udiwms/corps/exportLog/download" +
"?genKey=" + row.genKey;

@ -1,11 +1,11 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="query"label-width="100px" v-show="showSearch" size="mini">
<el-form :model="query" label-width="100px" v-show="showSearch" size="mini">
<el-row>
<el-col :span="6">
<el-form-item label="搜索:">
<el-input v-model="query.key" placeholder="搜索" style="90%" clearable="true"></el-input>
<el-input v-model="query.key" placeholder="搜索" style="width: 120%" clearable="true"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -19,7 +19,9 @@
</el-button-group>
</div>
<el-table v-loading="loading" :data="list" highlight-current-row @current-change="handleSelectChange" style="width: 100%">
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" @current-change="handleSelectChange" style="width: 100%" highlight-current-row border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="往来单位编码" prop="erpId" show-overflow-tooltip></el-table-column>
<el-table-column label="第三方主系统ID" prop="thirdId" show-overflow-tooltip></el-table-column>

@ -0,0 +1,397 @@
<template>
<div>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-card style="margin-top: -30px">
<el-button-group style="display: flex">
<el-button type="primary" @click.native="submitUpload()" style="margin: 0 60px 10px auto; height: 35px" :loading="loading">提交</el-button>
</el-button-group>
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>证书名称</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="name">
<el-input v-model="formData.name" auto-complete="off" :disabled="formData.auditStatus == 1"></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>证书编号</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="code">
<el-input v-model="formData.code" auto-complete="off" :disabled="formData.auditStatus == 1"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>有效期</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="vailDate">
<el-date-picker
v-model="formData.vailDate"
type="date"
:disabled="formData.auditStatus == 1"
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择有效期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>失效期</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="expireDate">
<el-date-picker
v-model="formData.expireDate"
type="date"
:disabled="formData.auditStatus == 1"
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择失效期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>状态</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="need">
<el-select v-model="formData.status" style="width: 100%">
<el-option label="失效" :value=1></el-option>
<el-option label="有效" :value=0></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="3">
<div class="ao-text">
<span>备注</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="remark">
<el-input v-model="formData.remark" auto-complete="off" type="textarea" autosize></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row :gutter="20">-->
<!-- <el-col :span="4">-->
<!-- </el-col>-->
<!-- <el-col :span="16">-->
<!-- <div style="color: red">-->
<!-- 需要上传档案为营业执照电子档案经营许可证电子档案经营备案证电子档案开户行电子档案-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="3">
<div class="ao-text">
<span>文件</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item>
<el-upload
:disabled="formData.auditStatus == 1"
class="upload-demo"
ref="upload"
:action="this.uploadUrl"
:on-preview="uploadHandlePreview"
:on-remove="uploadHandleRemove"
:limit="1"
:headers="headers"
:on-exceed="uploadHandleExceed"
accept=".jpg,.png"
:on-change="uploadOnchange"
:on-success="uploadHandleSuccess"
:on-error="uploadHandleError"
:file-list="fileList"
:data="{type:'image2'}"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary" :disabled="formData.auditStatus == 1">
{{ choiceFile }}
</el-button>
<div>只能上传 .jpg,.png 文件且不超过 2 MB</div>
</el-upload>
<!-- <el-button type="primary" size="mini" icon="search" @click="toViewCompanyCert"-->
<!-- style="text-align:right"-->
<!-- >文件预览-->
<!-- </el-button-->
<!-- >-->
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</div>
</template>
<script>
import draggable from "vuedraggable";
import store from "../../../store";
import {insertCompanyCert, updateCompanyCert} from "../../../api/purchase/companyCert";
export default {
name: "supCompanyCertAdd",
props: {
closeDialog: {
type: Function,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
editTye: {
type: Object,//1:2
required: true,
},
addType: {
type: Object,
required: true,
},
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
code: "",
formData: {
type: 0,
vailDate: null,
expireDate: null,
remark: null,
code: null,
name: null,
manufacturerIdFk: null,
auditStatus: 6
},
formRules: {
name: [
{required: true, message: "请输入证书名称", trigger: "blur"}
],
code: [
{required: true, message: "请输入证书编号", trigger: "blur"}
],
},
loading: false,
uploadUrl: "",
fileList: [],
headers: {},
choiceFile: "选取文件",
};
},
components: {
draggable,
},
methods: {
submitUpload() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
if (this.formData.auditStatus == 1) {
this.$confirm("该证书已审核通过,是否重新提交审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.onConfirmSubmit(1);
})
.catch(() => {
});
} else {
this.onConfirmSubmit();
}
}
});
},
onConfirmSubmit(val) {
this.formData.repeatUpload = val;
console.log(this.formData)
if (this.$isNotBlank(this.formData.filePath)) {
if (this.$refs.upload.uploadFiles.length > 0) {
this.$refs.upload.submit();
} else {
this.onSubmit();
}
} else {
console.log(this.$refs.upload.uploadFiles.length);
if (this.$refs.upload.uploadFiles.length > 0) {
this.$refs.upload.submit();
} else {
this.$message.warning(`请选择文件`);
}
}
},
onSubmit() {
this.loading = true;
this.formData.customerId = this.inputQuery.customerId;
if(this.formData.customerId==null){
this.formData.customerId=store.getters.customerId
}
this.formData.type = this.addType;
//1:2.3.
if (this.addType == 2) {
this.formData.manufacturerIdFk = this.inputQuery.manufacturerId;
} else if (this.addType == 3) {
this.formData.manufacturerIdFk = this.inputQuery.manufacturerIdFk;
this.formData.productIdFk = this.inputQuery.productId;
}
if (this.formData.auditStatus != 1)
this.formData.auditStatus = "6";
if (this.editTye == 1) {
insertCompanyCert(this.formData).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("添加成功");
this.closeDialog(true);
} else {
this.$message.error(response.message);
}
});
} else {
updateCompanyCert(this.formData).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("添加成功");
this.closeDialog(true);
} else {
this.$message.error(response.message);
}
});
}
},
uploadHandleRemove(file, fileList) {
console.log(file, fileList);
},
uploadHandlePreview(file) {
console.log(file);
console.log(this.fileList);
},
uploadHandleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
uploadOnchange(file, fileList) {
let fileName = file.name;
let uid = file.uid
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if (lastName.toLowerCase() !== ".jpg" && lastName.toLowerCase() !== ".png") {
this.$message.error("上传文件只能是 .jpg,.png 格式");
for (let i = 0; i < fileList.length; i++) {//list
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
}
return isLt;
},
uploadHandleSuccess(response, file, fileList) {
if (response.code === 20000) {
this.formData.filePath = response.data.name;
this.onSubmit();
} else {
this.$message.error("文件上传失败:" + response.message);
}
},
uploadHandleError() {
},
toViewCompanyCert() {
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
window.open(this.certFileUrl + this.formData.filePath);
},
},
filters: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
this.uploadUrl = this.BASE_URL + "/udiwms/upload/register/file";
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
if (this.inputQuery.formData == null ) {
this.formData = {}
}else if(this.inputQuery.formData != null && this.inputQuery.formData.addType==1){
this.formData = {}
}else{
this.formData = this.inputQuery.formData;
console.log(this.inputQuery.formData);
}
if (this.formData.filePath != null) {
this.choiceFile = "更换文件";
} else {
this.choiceFile = "选取文件";
}
},
};
</script>
<style>
.ao-text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
float: right;
text-align: right;
margin-top: 10px;
}
</style>

@ -0,0 +1,649 @@
<template>
<div>
<!-- 配送企业资质 -->
<el-card>
<el-form :model="filterQuery" class="query-form" size="mini" 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="请输入配送企业名称"></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="请输入统一社会信用号"></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="120">
<template slot-scope="scope">
<el-button
type="text"
v-if="scope.row.auditStatus ==6 || scope.row.auditStatus ==3|| scope.row.auditStatus ==4"
@click.native.stop="editCompany(scope.row)"
>审核
</el-button>
<el-button
type="text"
v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3 && scope.row.auditStatus !=4"
@click.native.stop="editCompany(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="showSearch2">
<el-row>
<el-col :span="6">
<el-form-item label="生产企业名称">
<el-input v-model="filterManufacturerQuery.companyName" style="width: 90%" placeholder="请输入生产企业名称"></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="请输入统一社会信用号"></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="hideSearch2">/</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%" highlight-current-row border @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="120">
<template slot-scope="scope">
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus ==6 || scope.row.auditStatus ==3|| scope.row.auditStatus ==4"
@click.native.stop="addInfoDialog(scope.row)"
>审核
</el-button>
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3 && scope.row.auditStatus !=4"
@click.native.stop="addInfoDialog(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="120px" v-show="showSearch3">
<el-row>
<el-col :span="6">
<el-form-item label="产品名称:">
<el-input v-model="registrationQuery.recordProductName" style="width: 90%;" clearable="true" placeholder="请输入产品名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="注册备案号:">
<el-input v-model="registrationQuery.recordCode" style="width: 90%;" clearable="true" placeholder="请输入注册备案号"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="注册备案人:">
<el-input v-model="registrationQuery.recordPeopleName" style="width: 90%;" clearable="true" placeholder="请输入注册备案人"></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="hideSearch3">/</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="120">
<template slot-scope="scope">
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus ==6 || scope.row.auditStatus ==3|| scope.row.auditStatus ==4"
@click.native.stop="registrationDialog(scope.row)"
>审核
</el-button>
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus !=6 && scope.row.auditStatus !=3 && scope.row.auditStatus !=4"
@click.native.stop="registrationDialog(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} 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: "21",
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
/**-----------------生产企业资质----------------------------*/
showSearch2: true,
filterManufacturerQuery: {
customerId: null,
companyName: "",
creditCode: "",
placeArea: "",
auditStatus: "21",
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,
/**----------------------------配送产品资质--------------------------------*/
showSearch3: true,
productLoading: false,
value: "",
registrationVisible: false,
registrationQuery: {
customerId: null,
manufacturerIdFk: null,
auditStatus: "21",
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",
3: "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: "21",
page: 1,
limit: 20,
};
this.getList();
this.productList = [];
this.salesmanList = [];
},
hideSearch() {
this.showSearch = !this.showSearch;
},
getList() {
this.loading = true;
getSupComapnys(this.filterQuery)
.then((response) => {
console.log(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 || row.auditStatus == 4) {
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: "21",
limit: 10,
};
this.manufacturerList = [];
this.getManufacturerList();
},
onManufacturerSubmit() {
this.manufacturerList = [];
this.getManufacturerList();
},
hideSearch2() {
this.showSearch2 = !this.showSearch2;
},
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.total = 0;
});
},
addInfoDialog(row) {
if (row.auditStatus == 6 || row.auditStatus == 3 || row.auditStatus == 4) {
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) {
if(type==true){
this.addInfoVisible = false;
this.enterpriseId = null;
this.manufacturerList = [];
this.getManufacturerList();
}else{
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: "21",
page: 1,
limit: 10
};
this.getRegistrationList();
},
onSubmit2() {
this.getRegistrationList();
},
hideSearch3() {
this.showSearch3 = !this.showSearch3;
},
registrationDialog(row) {
if (row.auditStatus == 6 || row.auditStatus == 3 || row.auditStatus == 4) {
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
})
.catch(() => {
this.registrationLoading = false;
this.registrationList = [];
});
},
certHandleCurrentChange(val) {
this.registrationQuery.page = val.page;
this.getRegistrationList();
}
},
components: {
supCompanyEditAdudit, supManufacturerAuditDialog, suppliersRegistrationBasic
}
,
mounted() {
},
created() {
this.getList();
},
};
</script>

@ -0,0 +1,180 @@
<template>
<div>
<el-card style="margin-top: -20px">
<div style="float: right;margin-bottom: 10px;margin-right: 25px">
<el-button type="primary" size="small" @click="selectSet()"></el-button>
</div>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row @selection-change="handleCheckedChange">
<el-table-column type="selection" width="55"></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="require" v-if="certType == 1">
<template slot-scope="scope">
<span>{{ enableMap[scope.row.need] }}</span>
</template>
</el-table-column>
<el-table-column label="产地" prop="foreign" v-if="certType == 2">
<template slot-scope="scope">
<span>{{ foreignMap[scope.row.foreign] }}</span>
</template>
</el-table-column>
<el-table-column label="产地" prop="imports" v-if="certType == 3">
<template slot-scope="scope">
<span>{{ foreignMap[scope.row.imports] }}</span>
</template>
</el-table-column>
<el-table-column label="器械类别" prop="cplx" v-if="certType == 3">
</el-table-column>
<el-table-column label="产品类别" prop="hchzsb" v-if="certType == 3">
</el-table-column>
<el-table-column label="分类编码" prop="flbm" v-if="certType == 3">
</el-table-column>
<el-table-column label="说明" prop="remark"></el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="handleCurrentChange"
></pagination>
</el-card>
</div>
</template>
<script>
import {filterCertSet, selectAllCert} from "@/api/purchase/supCertSet";
export default {
name: "supCertSetDialog",
props: {
closeDialog: {
type: Function,
required: true,
},
certType: { //1.2.3)
type: Object,
required: true,
},
manufacturerId: {
type: Object,
required: true,
},
productId: {
type: Object,
required: true,
},
customerId:{
type: Object,
required: true,
},
},
data() {
return {
query: {
manufacturerIdFk: null,
type: 1,
page: 1,
limit: 20
},
multipleSelection: [],
enableMap: {
true: "是",
false: "否",
},
list: [],
total: 0,
loading: false,
foreignMap: {
"1": "全部",
"2": "国外",
"3": "国内",
},
};
},
methods: {
handleCheckedChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.query.page = val.page;
this.getList();
},
getList() {
this.loading = true;
this.query.type = this.certType;
filterCertSet(this.query)
.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;
});
},
selectSet() {
let postQuery = {
certType: this.certType,
manufacturerIdFk: this.manufacturerId,
productIdFk: this.productId,
supCertSetEntities: this.multipleSelection,
customerId: this.customerId,
};
selectAllCert(postQuery)
.then(response => {
if (response.code === 20000) {
this.closeDialog();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.$message.error(response.message);
});
},
},
filters: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
created() {
this.getList();
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,548 @@
<template>
<div>
<!---生产企业资质----->
<el-card>
<el-form :model="filterQuery" class="query-form" label-width="100px" v-show="showSearch">
<el-row>
<el-col span="6">
<el-form-item label="企业名称:">
<el-input v-model="filterQuery.companyName" style="width: 90%" placeholder="请输入企业名称"></el-input>
</el-form-item>
</el-col>
<el-col span="6">
<el-form-item label="社会信用号:">
<el-input v-model="filterQuery.creditCode" style="width: 90%" placeholder="请输入社会信用号"></el-input>
</el-form-item>
</el-col>
<el-col span="6">
<el-form-item label="处理状态:">
<el-select v-model="filterQuery.auditStatus" style="width: 90%" placeholder="请输入处理状态">
<el-option label="全部" value=""></el-option>
<el-option label="草稿" value="0"></el-option>
<el-option label="未审核" value="6"></el-option>
<el-option label="变更未审核" value="3"></el-option>
<el-option label="已审核" value="1"></el-option>
<el-option label="已拒绝" value="2"></el-option>
</el-select>
</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 type="primary" icon="el-icon-plus" @click="addInfoDialog()"></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 @current-change="supManufacturerClick">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="企业名称" prop="companyName" width="250"></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></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="120">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.stop="addInfoDialog(scope.row)">编辑</el-button>
<el-button type="text" size="small" :disabled="scope.row.auditStatus === 1" @click.native.stop="deleteDialog(scope.row)">删除</el-button>
<el-button type="text" size="small" v-if="scope.row.auditStatus === 2" @click.native.stop="rejectInfo(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-dialog
:title="formMap[formName]"
:visible.sync="addInfoVisible"
width="80%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="addInfoVisible"
@close='closeDialog'
>
<suppliersEnterpriseBasicAdd
:addCloseDialog="closeDialog"
:inputQuery="inputQuery"
:editType="editType"
:fromType="fromType"
></suppliersEnterpriseBasicAdd>
</el-dialog>
</el-card>
<!---配送企业资质----->
<el-card class="el-card">
<el-form :model="registrationQuery" class="query-form" style="margin-top: 5px" v-show="showSearch2" label-width="100px">
<el-row>
<el-col span="6">
<el-form-item label="产品名称:">
<el-input v-model="registrationQuery.recordProductName" style="width: 90%" clearable placeholder="产品名称"></el-input>
</el-form-item>
</el-col>
<el-col span="6">
<el-form-item label="注册备案号:">
<el-input v-model="registrationQuery.recordCode" style="width: 90%" clearable placeholder="注册备案号"></el-input>
</el-form-item>
</el-col>
<el-col span="6">
<el-form-item label="注册备案人:">
<el-input v-model="registrationQuery.recordPeopleName" style="width: 90%" clearable placeholder="注册备案人"></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="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 type="primary" icon="el-icon-plus" @click="registrationDialog()"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="registrationLoading" :data="registrationList" style="width: 100%" border highlight-current-row>
<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="120">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.stop="registrationDialog(scope.row)">编辑</el-button>
<el-button type="text" size="small" :disabled="scope.row.auditStatus === 1" @click.native="deleteRegistration(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-dialog
:title="formProductMap[formName]"
:visible.sync="registrationVisible"
width="80%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="registrationVisible"
@close='closeProductDialog'
>
<suppliersRegistrationBasic
:closeRegistrationDialog="closeProductDialog"
:inputQuery="curProductQuery"
:editType="editProductType"
:currentManufacturer="currentManufacturer"
></suppliersRegistrationBasic>
</el-dialog>
</el-card>
</div>
</template>
<script>
import {deleteCompany, getCompanyList, getCompanyBySup} from "../../../api/purchase/supManufacturer"
import suppliersEnterpriseBasicAdd from "@/views/purchase/manufacturer/supManufacturerEditDialog";
import {getRegistrationList, deleteRegistration} from "../../../api/purchase/suppliersRegistrationBasic";
import suppliersRegistrationBasic from "@/views/purchase/product/supProductEditDialog";
export default {
name: "supCertificationAdd",
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
showSearch:true,
showSearch2:true,
/**------------------生产企业资质--------------------*/
filterQuery: {
customerId: null,
companyName: "",
auditStatus: null,
creditCode: "",
placeArea: "",
page: 1,
limit: 20,
},
total: 0,
companyTypeMap: {
1: "境内企业",
2: "境外企业"
},
productManageTypeMap: {
1: "Ⅰ类",
2: "Ⅱ类",
3: "Ⅲ类",
},
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
loading: false,
list: [],
addInfoVisible: false,
fileUrl: "",
inputQuery: {
auditStatus: 6
},
editType: 1,
fromType: 2,//1:2:
formMap: {
add: "新增生产企业资质信息",
update: "编辑生产企业资质信息",
},
currentManufacturer: null,
/**------------------配送企业资质--------------------*/
registrationVisible: false,
enterpriseId: "",
registrationQuery: {
auditStatus: null,
customerId: null,
manufacturerIdFk: null,
recordProductName: "",
recordCode: "",
recordPeopleName: "",
page: 1,
limit: 20
},
registrationList: [],
certTotal: 0,
registrationLoading: false,
registrationId: "",
pmQuery: {
customerId: null,
companyName: null,
page: 1,
limit: 10,
},
curProductQuery: {
auditStatus: 6
},
editProductType: 0,
formName: "add",
formProductMap: {
add: "新增配送产品资质信息",
update: "编辑配送产品资质信息",
},
};
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
3: "warning",
6: "warning",
};
return statusMap[status];
},
statusFilterName(status) {
const statusMap = {
0: "禁用",
1: "正常",
2: "未验证",
};
return statusMap[status];
},
},
methods: {
/**-------------------------生产企业资质---------------------*/
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
customerId: null,
companyName: "",
creditCode: "",
placeArea: "",
auditStatus: "",
page: 1,
limit: 20,
};
this.getList();
this.registrationList = [];
},
onSubmit() {
this.filterQuery.page=1
this.getList();
this.registrationList = [];
},
toViewRegistrationCert(row, num) {
let path = num === 1 ? row.filePath : row.instructions;
window.open(this.fileUrl + path);
},
getList() {
this.loading = true;
getCompanyBySup(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;
});
},
hideSearch() {
this.showSearch = !this.showSearch;
},
hideSearch2() {
this.showSearch2 = !this.showSearch2;
},
addInfoDialog(row) {
if (this.$isNotBlank(row)) {
this.enterpriseId = row.id;
this.editType = 1;
this.inputQuery = row;
} else {
this.enterpriseId = null;
this.editType = 0;
this.inputQuery = {
auditStatus: 0
};
}
this.addInfoVisible = true;
},
closeDialog(type) {
this.addInfoVisible = false;
this.registrationVisible = false;
this.enterpriseId = null;
this.registrationId = null;
this.getList();
this.registrationList = [];
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getList();
},
handleCheckedChange(val) {
console.log(val);
console.log(this.check);
},
rejectInfo(row) {
this.$confirm(row.auditComment, "驳回说明", {
confirmButtonText: "确定",
type: "warning",
showCancelButton: false,
})
.then(() => {
});
},
deleteDialog(row) {
this.$confirm("删除后将清空该生产企业以及所有关联信息?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let tQuery = {
id: row.id,
};
deleteCompany(tQuery).then(() => {
this.getList();
});
})
.catch(() => {
});
},
supManufacturerClick(row) {
this.registrationQuery.customerId = row.customerId;
this.registrationQuery.manufacturerIdFk = row.manufacturerId;
this.getRegistrationList();
this.currentManufacturer = row;
},
/**---------------------------配送产品资质----------------------*/
onReset2() {
//
if(this.currentManufacturer!=null){
this.registrationQuery = {
customerId: this.registrationQuery.customerId,
manufacturerIdFk: this.registrationQuery.manufacturerIdFk,
recordProductName: "",
recordCode: "",
recordPeopleName: "",
auditStatus: null,
page: 1,
limit: 20
};
this.getRegistrationList();
}
},
onSubmit2() {
if(this.currentManufacturer==null){
this.$message.error("请先选中生产企业!");
return
}
this.registrationQuery.page=1;
this.getRegistrationList();
},
registrationDialog(row) {
if(this.currentManufacturer==null){
this.$message.error("请先选中生产企业!");
return
}
if (this.$isNotBlank(row)) {
this.registrationId = row.id;
this.curProductQuery = row;
this.curProductQuery.cuStatus=this.currentManufacturer.auditStatus;
this.formName = "update";
this.editProductType = 1;
} else {
this.editProductType = 0;
this.formName = "add";
this.curProductQuery = {
auditStatus: 0,
cuStatus:this.currentManufacturer.auditStatus
};
}
this.registrationVisible = true;
},
deleteRegistration(row) {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.certLoading = true;
let tQuery = {
id: row.id,
filePath: row.filePath,
filePath2: row.instructions,
};
deleteRegistration(tQuery)
.then((response) => {
this.certLoading = false;
if (response.code === 20000) {
this.getRegistrationList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.certLoading = false;
});
}).catch(() => {
});
},
closeProductDialog() {
this.registrationVisible = false;
this.enterpriseId = null;
this.registrationId = null;
this.getList();
this.registrationList = [];
},
getRegistrationList() {
this.registrationLoading = true;
getRegistrationList(this.registrationQuery)
.then((response) => {
this.registrationLoading = false;
this.registrationList = response.data.list || [];
this.certTotal = response.data.total;
})
.catch(() => {
this.registrationLoading = false;
this.registrationList = [];
});
},
supChange(val) {
this.pmQuery.customerId = val;
this.findPMMethod();
},
certHandleCurrentChange(val) {
this.registrationQuery.page = val.page;
this.getRegistrationList();
}
},
components: {
suppliersEnterpriseBasicAdd, suppliersRegistrationBasic
},
mounted() {
},
created() {
this.fileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image4&name=";
this.getList();
// this.getRegistrationList();
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,622 @@
<template>
<div>
<el-card>
<el-form :model="filterQuery" label-width="120px" v-show="showSearch">
<el-row>
<el-col :span="6">
<el-form-item label="产品编码:">
<el-input v-model="filterQuery.unionCode" style="width:90%" placeholder="请输入DI/医保编码/商品条码" clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="产品通用名:">
<el-input v-model="filterQuery.cpmctymc" style="width:90%" placeholder="请输入产品通用名" clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="规格型号:">
<el-input v-model="filterQuery.ggxh" style="width: 90%" placeholder="请输入规格型号" clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="生产企业:">
<el-input v-model="filterQuery.ylqxzcrbarmc" style="width: 90%" placeholder="请输入生产企业/注册备案人" clearable="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="配送企业:">
<el-input v-model="filterQuery.supName" style="width: 90%" placeholder="请输入配送企业" clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="第三方产品编码:">
<el-input v-model="filterQuery.thrPiId" style="width: 90%" placeholder="请输入第三方产品编码" clearable="true"></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="submitSearch"></el-button>
<el-button type="primary" icon="el-icon-upload2" @click="selectExport"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" @selection-change="handleSelectionChange" border highlight-current-row>
<el-table-column type="selection" width="55" :selectable="checkSelectable"></el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="最小销售产品标识" prop="nameCode" width="140"></el-table-column>
<el-table-column label="产品编码" prop="thirdId" show-overflow-tooltip></el-table-column>
<el-table-column label="生产企业" prop="ylqxzcrbarmc" show-overflow-tooltip></el-table-column>
<el-table-column label="产品通用名" prop="cpmctymc" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="ggxh" show-overflow-tooltip></el-table-column>
<el-table-column label="注册/备案凭证" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
<el-table-column label="器械类别" prop="qxlb" show-overflow-tooltip></el-table-column>
<el-table-column width="60" label="操作" >
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="handleModifyClick(scope.row)"
>详情
</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
title="产品信息详情"
:visible.sync="editDialogVisible"
width="70%"
:close-on-click-modal="false"
:close-on-press-escape="false"
append-to-body
v-if="editDialogVisible"
>
<el-table :data="sysList" style="width: 100%" border highlight-current-row>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="第三方系统名称" prop="sysName" show-overflow-tooltip></el-table-column>
<el-table-column label="第三方产品名称" prop="thirdName" show-overflow-tooltip></el-table-column>
<el-table-column label="第三方产品ID" prop="thirdId" show-overflow-tooltip></el-table-column>
</el-table>
<el-table v-loading="loading" :data="detailList" style="width: 100%; margin-top: 20px" border @current-change="handleDetail" border highlight-current-row>
<el-table-column label="产品标识" prop="nameCode" show-overflow-tooltip></el-table-column>
<el-table-column label="产品通用名" prop="cpmctymc" show-overflow-tooltip></el-table-column>
<el-table-column label="包装级别" prop="packLevel" show-overflow-tooltip></el-table-column>
<el-table-column label="包装层级" prop="bzcj" show-overflow-tooltip></el-table-column>
</el-table>
<el-form :model="editQuery" :rules="rules" ref="editQuery" label-width="190px" style="margin-top: 20px">
<el-row>
<el-col :span="12">
<el-form-item label="产品名称" prop="cpmctymc">
<el-input style="width: 90%" size="small" splaceholder="请输入产品名称" :disabled="true" v-model="editQuery.cpmctymc"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="产品标识" prop="nameCode">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入产品标识" v-model="editQuery.nameCode"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="规格型号" prop="ggxh">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入内容" v-model="editQuery.ggxh"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="器械类别" prop="qxlb">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入器械类别" v-model="editQuery.qxlb"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="产品类别" prop="cplb">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入产品类别" v-model="editQuery.cplb"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="分类编码" prop="flbm">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入分类编码" v-model="editQuery.flbm"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="商品条码" prop="sptm">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入商品条码" v-model="editQuery.sptm"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="医保编码" prop="ybbm">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入医保编码" v-model="editQuery.ybbm"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="医疗器械注册人" prop="ylqxzcrbarmc">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入医疗器械注册人" v-model="editQuery.ylqxzcrbarmc"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="注册人英文名称" prop="ylqxzcrbarywmc">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入注册人英文名称" v-model="editQuery.ylqxzcrbarywmc"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="统一社会信用号" prop="tyshxydm">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入统一社会信用号" v-model="editQuery.tyshxydm"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="注册证/备案号" prop="zczbhhzbapzbh">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入注册证/备案号" v-model="editQuery.zczbhhzbapzbh"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="上级产品编码" prop="sjcpbm">
<el-input style="width: 90%" :disabled="true" size="small" splaceholder="请输入上级产品编码" v-model="editQuery.sjcpbm"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="包装级别" prop="packLevel">
<el-input style="width: 90%" size="small" splaceholder="请输入包装级别" :disabled="true" v-model="editQuery.packLevel"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="包装单位/包装级别" prop="bzcj">
<el-input style="width: 90%" size="small" splaceholder="请输入包装单位/包装级别" v-model="editQuery.bzcj" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="包含下级包装数量" prop="bhxjsl">
<el-input style="width: 90%" size="small" splaceholder="请输入包含下级包装数量" :disabled="true" v-model="editQuery.bhxjsl"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="包含下级产品编码" prop="bhxjcpbm">
<el-input style="width: 90%" size="small" :disabled="true" splaceholder="请输入包含下级产品编码" v-model="editQuery.bhxjcpbm"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="包含最小销售包装数量" prop="bhzxxsbzsl">
<el-input style="width: 90%" size="small" :disabled="true" splaceholder="请输入包含最小销售包装数量" v-model="editQuery.bhzxxsbzsl"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="是否包含批号" prop="scbssfbhph">
<el-input style="width: 90%" :disabled="true" size="small" v-model="editQuery.scbssfbhph"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="是否包含序列号" prop="scbssfbhxlh">
<el-input style="width: 90%" :disabled="true" size="small" v-model="editQuery.scbssfbhxlh" splaceholder="请输入内容"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="是否包含生产日期" prop="scbssfbhscrq">
<el-input style="width: 90%" :disabled="true" size="small" v-model="editQuery.scbssfbhscrq"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="是否包含失效日期" prop="scbssfbhsxrq">
<el-input style="width: 90%" :disabled="true" v-model="editQuery.scbssfbhsxrq" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="el-col">
<el-form-item label="产品描述" prop="cpms">
<el-input style="width: 90%" :disabled="false" size="small" v-model="editQuery.cpms"></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="计量单位" prop="measname">
<el-input style="width: 90%" size="small" splaceholder="请输入内容" v-model="editQuery.measname"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row >
<el-col :span="12" class="el-col">
<el-form-item label="最小包装单元内包含使用单元数量" prop="zxxsbzbhsydysl">
<el-input style="width: 90%" :disabled="!checked" size="small" splaceholder="请输入内容" v-model="editQuery.zxxsbzbhsydysl"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
<pagination
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="handleCurrentChange"
></pagination>
</el-card>
</div>
</template>
<script>
import {
getUdiInfos,
updateErpProduct,
thirdSysDetail,
getSmUdiInfos
} from "@/api/basic/udiRelevance";
import {udiUpload} from "@/api/thrsys/smp"
import {filterByUuid} from "@/api/basic/udiInfo";
import {
insertCompanyProductRelevance,
updateCompanyProductRelevance, insertFilter
} from "@/api/basic/udiRlSuptRelevance";
import store from "@/store";
export default {
name: "UdIInfoSelect",
props: {
unitFk: {
type: Object,
required: true,
},
selectType: {
type: Object,
required: true,
},
closeSelDialog: {
type: Function,
required: true,
},
},
data() {
return {
showSearch: true,
filterQuery: {
customerId: null,
uuids: [],
rlIds: [],
ylqxzcrbarmc: "",
supName: null,
cpmctymc: "",
nameCode: "",
page: 1,
limit: 20,
addType: 1,
isDisable: false,
},
editQuery: null,
relevanceEdit: {
id: null,
thirdId: "",
isUseDy: false,
},
isImport: false,
isImportUdi: false,
isUploadSmp: false,
isImportFile: false,
uploadFileUrl: null,
checked: false,
list: [],
detailList: [],
sysList: [],
total: 0,
thirdNo: "",
uuid: "111",
thirdId: null,
relId: "",
thisData: {
nameCode: null,
cpmctymc: null,
ggxh: null
},
multipleSelection: [],
editDialogVisible: false,
selectUdiDialogVisible: false,
selectErpDialogVisible: false,
selectLocalVisible: false,
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
customerId: null,
uuids: [],
rlIds: [],
ylqxzcrbarmc: "",
supName: null,
cpmctymc: "",
nameCode: "",
page: 1,
limit: 20,
unitFk: null,
addType: 1,
};
this.getList();
},
hideSearch() {
this.showSearch = !this.showSearch;
},
submitSearch() {
this.filterQuery.page = 1;
this.getList();
},
getList() {
this.loading = true;
this.filterQuery.customerId = store.getters.customerId;
getSmUdiInfos(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;
});
},
getDetailList(detailQuery) {
this.loading = true;
filterByUuid(detailQuery)
.then((response) => {
this.loading = false;
this.detailList = response.data || [];
})
.catch(() => {
this.loading = false;
this.detailList = [];
});
},
handleDetail(row) {
this.editQuery = row;
},
combine() {
this.combineQuery.productUuid = this.currentRow.uuid;
this.combineQuery.customerId = store.getters.customerId;
insertCompanyProductRelevance(this.combineQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("添加成功");
this.closeDialog(true);
} else {
this.$message.error(response.message);
}
});
},
selectExport() {
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
this.filterQuery.rlIds.push(obj.id);
});
this.filterQuery.unitFk = this.unitFk;
this.allExport();
},
allExport() {
this.filterQuery.customerId = store.getters.customerId;
insertFilter(this.filterQuery).then(response => {
this.loading = false;
if (response.code == 20000) {
this.$message.success(response.data);
this.$emit("closeSelDialog", true);
this.closeSelDialog();
} else {
this.$message.error(response.message);
}
});
},
intentDetail() {
this.isImportUdi = false;
this.selectUdiDialogVisible = true;
},
intentImportErp(val) {
this.uuid = val.uuid;
this.relId = val.id;
this.isImport = true;
this.thisData = val;
this.selectErpDialogVisible = true;
},
uploadSMP() {
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
this.filterQuery.uuids.push(obj.uuid);
});
this.allUploadSMP();
},
allUploadSMP() {
udiUpload(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.$message({
type: "success",
message: "上传成功!",
});
} else {
this.$message({
type: "error",
message: response.message,
});
}
this.$emit("cancelDialog", true);
})
.catch(() => {
this.$message({
type: "error",
message: "上传失败",
});
this.$emit("cancelDialog", true);
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.filterQuery.page = val.page;
this.getList();
},
handleModifyClick(row) {
this.editDialogVisible = true;
this.editQuery = row;
this.relevanceEdit = {
id: row.id,
thirdId: row.thirdId,
isUseDy: row.isUseDy,
};
this.checked = row.isUseDy == 1;
let ttquery = {
id: row.id,
page: 1,
limit: 10,
};
this.getDetailList(ttquery);
this.getThirdSysDetail();
},
closeUdi(val) {
this.selectUdiDialogVisible = false;
this.selectErpDialogVisible = false;
this.selectLocalVisible = false;
if (val) {
this.getList();
}
},
getThirdSysDetail() {
let query = {
id: this.relevanceEdit.id,
};
thirdSysDetail(query)
.then((response) => {
this.loading = false;
this.sysList = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.sysList = [];
});
},
checkSelectable(row) {
return !row.isSelect;
},
uploadErpProduct() {
updateErpProduct()
.then((response) => {
if (response.code == 20000) {
this.$message({
type: "success",
message: response.data,
});
this.$emit("closeDialog", true);
} else {
this.$message.error(response.message);
}
})
.catch(() => {
});
},
closeDialog() {
this.selectErpDialogVisible = false;
this.selectLocalVisible = false;
},
selectSysParam() {
let query = {
paramKey: "smp_isUploadProuct",
};
selectSysParamByKey(query).then((response) => {
if (response.code == 20000) {
if (response.data.paramValue == "1") {
this.isUploadSmp = true;
}
}
});
let query1 = {
paramKey: "upload_pi_file_enabled",
};
selectSysParamByKey(query1).then((response) => {
if (response.code == 20000) {
if (response.data.paramValue == "1") {
this.isImportFile = true;
}
}
});
let query2 = {
paramKey: "upload_pi_file_url",
};
selectSysParamByKey(query2).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.paramValue;
}
});
},
},
mounted() {
},
components: {},
created() {
this.getList();
this.selectSysParam();
},
};
</script>
<style scoped>
.el-form-item--mini.el-form-item {
margin-bottom: 9px;
}
</style>

@ -0,0 +1,248 @@
<template>
<div>
<el-card>
<el-form :model="filterQuery" class="query-form" label-width="100px" v-show="showSearch">
<el-row>
<el-col span="6">
<el-form-item label="企业名称">
<el-input v-model="filterQuery.companyName" style="width: 90%" placeholder="请输入企业名称"></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="请输入社会信用号"></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 type="primary" icon="el-icon-plus" @click="addCompany"></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>
<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="contacts"></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="120">
<template slot-scope="scope">
<el-button type="text" @click.native.stop="editCompany(scope.row)">编辑</el-button>
<el-button type="text" @click.native.stop="deleteDialog(scope.row)">删除</el-button>
<el-button type="text" v-if="scope.row.auditStatus === 2" @click.native.stop="rejectInfo(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"
>
<supCompanyEdit
:closeDialog="closeDialog"
:inputQuery="inputQuery"
:editType="editType"
></supCompanyEdit>
</el-dialog>
</div>
</template>
<script>
import {getSupComapnys, delSupComapnys} from "@/api/purchase/supCompany";
import supCompanyEdit from "./supCompanyEditDialog";
export default {
data() {
return {
showSearch:true,
filterQuery: {
companyName: "",
checkType: "",
creditNum: "",
auditStatus: "20",
page: 1,
limit: 20,
},
loading: false,
list: [],
total: 0,
formName: "add",
formMap: {
add: "新增配送企业资质信息",
update: "编辑配送企业资质信息",
},
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
supCompanyVisible: false,
inputQuery: {},
editType: 0, //0:1
};
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
6: "success",
};
return statusMap[status];
},
statusFilterName(status) {
const statusMap = {
0: "禁用",
1: "正常",
2: "未验证",
};
return statusMap[status];
},
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
companyName: "",
creditNum: "",
auditStatus: "20",
page: 1,
limit: 20,
};
this.getList();
this.productList = [];
this.salesmanList = [];
},
hideSearch() {
this.showSearch = !this.showSearch;
},
getList() {
this.loading = true;
getSupComapnys(this.filterQuery)
.then((response) => {
console.log(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();
},
addCompany() {
this.supCompanyVisible = true;
this.formName = "add";
this.editType = 0;
this.inputQuery = {};
},
editCompany(row) {
this.supCompanyVisible = true;
this.formName = "update";
this.editType = 1;
this.inputQuery = row;
},
rejectInfo(row) {
this.$confirm(row.auditComment, "驳回说明", {
confirmButtonText: "确定",
type: "warning",
showCancelButton: false,
})
.then(() => {
});
},
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;
},
},
components: {
supCompanyEdit,
}
,
mounted() {
},
created() {
this.getList();
},
};
</script>

@ -0,0 +1,685 @@
<template>
<div>
<el-form
:model="inputQuery"
:rules="rules"
ref="inputQuery"
label-width="100px"
>
<el-card class="el-card" style="margin-top: -25px">
<div style="display: flex;" >
<el-button
v-if="editType==2"
type="primary"
size="mini"
icon="search"
@click="onPassSubmit"
>审核通过
</el-button
>
<el-button
v-if="editType==2"
type="primary"
size="mini"
icon="search"
@click="onRejectSubmit"
>审核拒绝
</el-button
>
<el-button
v-if="editType==1"
type="primary"
size="mini"
icon="search"
@click="printSupCertAll"
>打印
</el-button>
</div>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 20px">
<el-col :span="10" class="el-col">
<el-form-item label="企业名称:" label-width="150px" prop="companyName">
<el-input
size="small"
splaceholder="请输入内容"
disabled
v-model="inputQuery.companyName"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="统一社会信用代码:" label-width="150px" prop="creditNum">
<el-input
size="small"
splaceholder="请输入内容" disabled
v-model="inputQuery.creditNum"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item label="企业类别:" label-width="150px" prop="classes">
<el-select
size="small"
v-model="inputQuery.classes" disabled
placeholder="企业类别"
style="width: 100%;"
>
<el-option v-if="classesDisplay" label="医院" value="1"></el-option>
<el-option label="经营企业" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="所属地区:" label-width="150px" prop="area">
<el-cascader
size="small"
:options="options"
v-model="selectedOptions" disabled
placeholder="请选择所属地区"
style="width: 100%"
@change="handleChange"
>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item label="联系人:" label-width="150px" prop="contacts">
<el-input
size="small"
placeholder="请输入内容" disabled
v-model="inputQuery.contacts"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="详细地址:" label-width="150px" prop="detailAddr">
<el-input
size="small"
placeholder="请输入内容" disabled
v-model="inputQuery.detailAddr"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item label="联系电话:" label-width="150px" prop="mobile">
<el-input
size="small"
placeholder="请输入内容" disabled
v-model="inputQuery.mobile"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="邮箱:" label-width="150px" prop="email">
<el-input
size="small"
placeholder="请输入内容" disabled
v-model="inputQuery.email"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<div style=" float: right;
text-align: right;
margin-bottom: 8px;"
>
<!-- <el-button type="primary" size="mini" icon="search" @click="addCert"-->
<!-- style="text-align:right"-->
<!-- >添加电子档-->
<!-- </el-button-->
<!-- >-->
</div>
<el-table v-loading="certLoading" :data="certList" ref="certTable" style="width: 100%" border highlight-current-row>
<el-table-column type="selection" width="55">
</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="code"></el-table-column>
<el-table-column label="有效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="证书状态" prop="status">
<template slot-scope="scope">
{{ supStatus[scope.row.status] }}
</template>
</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="操作" >
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="toViewCompanyCert(scope.row)"
>预览
</el-button
>
<el-button
v-if="editType==1"
type="text"
size="small"
@click.native="printSupCert(scope.row)"
>打印
</el-button
>
<el-button
type="text"
size="small"
v-if="editType==2"
@click.native="auditCert(scope.row)"
>审核
</el-button
>
<el-button
type="text"
size="small"
@click.native="rejectInfo(scope.row)"
>说明
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="certQuery.limit"
@current-change="certHandleCurrentChange"
layout="prev, pager, next"
:total="certTotal"
>
</el-pagination>
</el-card>
</el-form>
<el-dialog width="30%" :visible.sync="certAuditVisible" append-to-body>
<el-form :model="currentAudit">
<label></label>
<el-form-item label="审核备注:" :label-width="120">
<el-input type="textarea" v-model="currentAudit.auditComment" autocomplete="off"
autosize></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="rejectAuditCert"></el-button>
<el-button type="primary" @click="passAuditCert"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {modifyCompany, auditCompany,printSupCert, verifyTemplateFile} from "../../../api/purchase/supCompany";
import {
provinceAndCityData,
regionData,
provinceAndCityDataPlus,
regionDataPlus,
CodeToText,
TextToCode,
} from "element-china-area-data";
import {filterCompanyCert, deleteCompanyCert, auditSupCert} from "../../../api/purchase/companyCert";
import draggable from "vuedraggable";
export default {
name: "supCompanyEdit",
props: {
closeDialog: {
type: Function,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
editType: {//12:
type: Object,
required: true,
}
},
data() {
return {
headers: {},
classesDisplay: false,
selectedOptions: [],
options: regionDataPlus,
rules: {
companyName: [
{
required: true,
message: "请输入企业名称",
trigger: "blur"
}
],
creditNum: [
{
required: true,
message: "请输入统一社会信用代码",
trigger: "blur"
}
],
classes: [
{
required: true,
message: "请选择企业类别",
trigger: "change"
}
],
area: [
{
required: true,
message: "请选择所属地区",
trigger: "change"
}
],
detailAddr: [
{
required: true,
message: "请输入详细地址",
trigger: "change"
}
],
contacts: [
{
required: true,
message: "请输入联系人",
trigger: "change"
}
],
mobile: [
{
required: true,
message: "请输入联系电话",
trigger: "change"
}
],
email: [
{
required: true,
message: "请输入邮箱",
trigger: "change"
}
],
updateCause: [
{
required: true,
message: "请输入变更原因",
trigger: "change"
}
],
},
uploadUrl: "",
fileUrl: "",
certFileUrl: "",
url: 'http://127.0.0.1:9996/udiwms/image/register/file/getImage?type=image1&name=t11111.jpg',
certQuery: {
page: 1,
limit: 20
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
salesmanQuery: {
name: "",
page: 1,
limit: 20
},
salesmanList: [],
salesmanTotal: 0,
salesmanLoading: false,
addSalesmanVisible: false,
certTypeMap: {
1: '身份证'
},
selectLocalVisible: false,
productQuery: {
ylqxzcrbarmc: "",
cpmctymc: "",
ggxh: "",
page: 1,
limit: 20
},
productList: [],
productTotal: 0,
productLoading: false,
uuid: null,
companyApplyUpdateVisible: false,
companyEditDisabled: true,
companyEditButtonStr: "编辑",
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
supStatus: {
0: "有效",
1: "失效",
},
certAuditVisible: false,
currentAudit: {},
};
},
created() {
this.getCompanyCertList();
this.selectedOptions = this.inputQuery.areaCode.split(",");
},
components: {
draggable
},
methods: {
onPassSubmit(val) {
this.inputQuery.auditStatus = 1;
this.$confirm("是否审核通过?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.loading = true;
auditCompany(this.inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog();
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
});
},
onRejectSubmit() {
this.$prompt('请输入驳回意见', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({value}) => {
this.inputQuery.auditComment = value;
this.inputQuery.auditStatus = 2;
auditCompany(this.inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog();
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
});
}
,
cancelDialog() {
this.closeDialog();
}
,
closeLocalDialog() {
this.addCertVisible = false;
this.getCompanyCertList();
}
,
handleChange(value) {
this.inputQuery.area =
CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
this.inputQuery.areaCode = value.toString();
}
,
addCert(index, row) {
this.inputQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.inputQuery.id = row.id;
this.inputQuery.formData = row;
}
this.addCertVisible = true;
}
,
toViewCompanyCert(row) {
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
window.open(this.certFileUrl + row.filePath);
},
auditCert(row) {
this.certAuditVisible = true;
this.currentAudit = row;
},
passAuditCert() {
this.currentAudit.auditStatus = 1;
this.auditSupCert(this.currentAudit);
},
rejectAuditCert() {
this.currentAudit.auditStatus = 2;
this.auditSupCert(this.currentAudit);
},
auditSupCert(inputQuery) {
auditSupCert(inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.certAuditVisible = false;
} else {
this.$message.error(response.message);
}
});
},
rejectInfo(row) {
this.$confirm(row.auditComment, "审核备注", {
confirmButtonText: "确定",
type: "warning",
showCancelButton: false,
})
.then(() => {
});
},
certHandleCurrentChange(val) {
this.certQuery.page = val;
this.getCompanyCertList();
}
,
getCompanyCertList() {
this.certLoading = true;
this.certQuery.customerId = this.inputQuery.customerId;
this.certQuery.type = 1;
this.certQuery.auditStatus=25;
filterCompanyCert(this.certQuery)
.then((response) => {
this.certLoading = false;
this.certList = response.data.list || [];
this.certTotal=response.data.total
})
.catch(() => {
this.certLoading = false;
this.certList = [];
});
}
,
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);
})
if(selectIds.length==0){
this.$message.error("请先选择打印的证书!");
return
}
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) {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.certLoading = true;
let tquery = {
id: row.id,
filePath: row.filePath,
};
deleteCompanyCert(tquery)
.then((response) => {
this.certLoading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.certLoading = false;
});
}).catch(() => {
});
}
,
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
6: "warning",
};
return statusMap[status];
},
},
}
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,683 @@
<template>
<div>
<el-form :model="inputQuery" :rules="rules" ref="inputQuery" label-width="100px">
<el-card class="el-card" style="margin-top: -15px">
<div style="float: right; ">
<el-button type="primary" size="mini" icon="search" @click="selectBasicCorp()"></el-button>
<el-button type="primary" size="mini" icon="search" @click="onModifySubmit(0)">稿</el-button>
<el-button type="primary" size="mini" icon="search" @click="onModifySubmit(6)"></el-button>
</div>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 35px">
<el-col :span="10" class="el-col">
<el-form-item label="企业名称:" label-width="150px" prop="companyName">
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.companyName"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="统一社会信用代码:" label-width="150px" prop="creditNum">
<el-input
size="small"
splaceholder="请输入内容"
v-model="inputQuery.creditNum"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item label="企业类别:" label-width="150px" prop="classes">
<el-select
size="small"
v-model="inputQuery.classes"
placeholder="企业类别"
style="width: 100%;"
>
<el-option v-if="classesDisplay" label="医院" value="1"></el-option>
<el-option label="经营企业" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="所属地区:" label-width="150px" prop="area">
<el-cascader
size="small"
:options="options"
v-model="selectedOptions"
placeholder="请选择所属地区"
style="width: 100%"
@change="handleChange"
>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item label="联系人:" label-width="150px" prop="contacts">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.contacts"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="详细地址:" label-width="150px" prop="detailAddr">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.detailAddr"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 0px">
<el-col :span="10" class="el-col">
<el-form-item label="联系电话:" label-width="150px" prop="mobile">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.mobile"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="邮箱:" label-width="150px" prop="email">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.email"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<div style=" float: right;
text-align: right;
margin-bottom: 8px;"
>
<el-button type="primary" size="mini" icon="search" @click="selectCert"
style="text-align:right"
>选入资质证书
</el-button
>
<el-button type="primary" size="mini" icon="search" @click="addCert"
style="text-align:right"
>添加资质证书
</el-button
>
</div>
<el-table v-loading="certLoading" :data="certList" style=" width: 100%;margin-top: 20px" border highlight-current-row>
<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="code"></el-table-column>
<el-table-column label="有效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></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="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="addCert(scope.row)"
v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2|| scope.row.auditStatus == 6"
>编辑
</el-button
>
<el-button
type="text"
size="small"
@click.native="toViewCompanyCert(scope.row)"
>预览
</el-button
>
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2|| scope.row.auditStatus == 6"
@click.native="deleteCompanyCert(scope.row)"
>删除
</el-button
>
<el-button
type="text"
size="small"
v-if=" scope.row.auditStatus == 1 && scope.row.status==0"
@click.native="disableCert(scope.row,1)"
>禁用
</el-button
>
<el-button
type="text"
size="small"
v-if=" scope.row.auditStatus == 1 && scope.row.status==1"
@click.native="disableCert(scope.row,0)"
>启用
</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="certTotal>0"
:total="certTotal"
:page.sync="certQuery.page"
:limit.sync="certQuery.limit"
@pagination="certHandleCurrentChange"
></pagination>
</el-card>
<el-dialog
title="添加资质证书"
:visible.sync="addCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="addCertVisible"
append-to-body
@close='closeLocalDialog'
>
<companyAddCert
:closeDialog="closeLocalDialog"
:inputQuery="inputQuery"
:addType="addType"
:editTye="editTye"
></companyAddCert>
</el-dialog>
<el-dialog
title="选入往来单位"
:visible.sync="selectCorpVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="selectCorpVisible"
append-to-body
@close='closeLocalDialog'
>
<corpMaintainSelect
:closeDialog="closeSelectCorpDialog"
></corpMaintainSelect>
</el-dialog>
<el-dialog
title="选入资质证书"
:visible.sync="selectCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="selectCertVisible"
append-to-body
@close='closeLocalDialog'
>
<supCertSetSelectDialog
:certType="certType"
:closeDialog="closeLocalDialog"
:customerId="customerId"
></supCertSetSelectDialog>
</el-dialog>
</el-form>
</div>
</template>
<script>
import {modifyCompany, addCompany, bindCorp} from "@/api/purchase/supCompany";
import store from "@/store/index";
import {regionDataPlus, CodeToText} from "element-china-area-data";
import {filterCompanyCert, deleteCompanyCert, updateCompanyCert} from "@/api/purchase/companyCert";
import corpMaintainSelect from "@/views/basic/corpMaintain/corpMaintainSelect"
import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import draggable from "vuedraggable";
import {getUUID} from "@/utils/strUtil";
import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog";
export default {
name: "supCompanyEdit",
props: {
closeDialog: {
type: Function,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
editType: {
type: Number,
required: true,
}
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
headers: {},
classesDisplay: false,
selectedOptions: [],
options: regionDataPlus,
rules: {
companyName: [
{
required: true,
message: "请输入企业名称",
trigger: "blur"
}
],
creditNum: [
{
required: true,
message: "请输入统一社会信用代码",
trigger: "blur"
}
],
classes: [
{
required: true,
message: "请选择企业类别",
trigger: "change"
}
],
area: [
{
required: true,
message: "请选择所属地区",
trigger: "change"
}
],
detailAddr: [
{
required: true,
message: "请输入详细地址",
trigger: "change"
}
],
contacts: [
{
required: true,
message: "请输入联系人",
trigger: "change"
}
],
mobile: [
{
required: true,
message: "请输入联系电话",
trigger: "change"
}
],
email: [
{
required: true,
message: "请输入邮箱",
trigger: "change"
}
],
updateCause: [
{
required: true,
message: "请输入变更原因",
trigger: "change"
}
],
},
uploadUrl: "",
fileUrl: "",
certFileUrl: "",
url: 'http://127.0.0.1:9996/udiwms/image/register/file/getImage?type=image1&name=t11111.jpg',
certQuery: {
page: 1,
limit: 20
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
salesmanQuery: {
name: "",
page: 1,
limit: 20
},
salesmanList: [],
salesmanTotal: 0,
salesmanLoading: false,
addSalesmanVisible: false,
certTypeMap: {
1: '身份证'
},
selectLocalVisible: false,
productQuery: {
ylqxzcrbarmc: "",
cpmctymc: "",
ggxh: "",
page: 1,
limit: 20
},
productList: [],
productTotal: 0,
productLoading: false,
uuid: null,
companyApplyUpdateVisible: false,
companyEditDisabled: true,
companyEditButtonStr: "编辑",
addType: "1", //1:2.3.
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
editTye: 1,
selectCorpVisible: false,
selectCertVisible: false,
certType: 1,
customerId: null,
};
}
,
created() {
if (this.editType == 0) {
this.inputQuery.customerId = getUUID("");
}else{
this.customerId=this.inputQuery.customerId
this.getCompanyCertList();
}
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.customerId = this.inputQuery.customerId;
if (this.inputQuery.areaCode != null)
this.selectedOptions = this.inputQuery.areaCode.split(",");
}
,
components: {
draggable, companyAddCert, corpMaintainSelect, supCertSetSelectDialog
}
,
methods: {
onModifySubmit(val) {
this.inputQuery.auditStatus = val;
if (this.editType == 0) { //
this.$refs["inputQuery"].validate(valid => {
if (valid) {
this.$confirm("是否确定提交保存?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.loading = true;
addCompany(this.inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog();
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
});
} else {
return false;
}
});
} else { //
this.$refs["inputQuery"].validate(valid => {
if (valid) {
this.$confirm("是否提交变更?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.loading = true;
modifyCompany(this.inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog();
} else {
this.$message.error(response.message);
this.inputQuery.auditStatus=0
}
});
}).catch(() => {
});
} else {
return false;
}
});
}
}
,
onAuditSubmit() {
}
,
selectBasicCorp() {
this.selectCorpVisible = true;
}
,
cancelDialog() {
this.closeDialog();
}
,
closeLocalDialog() {
this.addCertVisible = false;
this.selectCertVisible = false;
this.getCompanyCertList();
}
,
closeSelectCorpDialog(val) {
if (val != null) {
let query = {
customerId: val.erpId
};
bindCorp(query).then(response => {
this.loading = false;
if (response.code === 20000) {
this.inputQuery = response.data;
this.customerId=val.erpId
this.selectCorpVisible = false;
} else {
this.$message.error(response.message);
}
});
}
},
handleChange(value) {
this.inputQuery.area =
CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
this.inputQuery.areaCode = value.toString();
}
,
addCert(row) {
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.formName = 2
this.inputQuery.formData = row;
this.editTye = 2;
} else {
this.formName = 1;
this.inputQuery.formData.addType=1;
this.editTye = 1;
}
this.addCertVisible = true;
}
,
selectCert() {
this.selectCertVisible = true;
},
toViewCompanyCert(row) {
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
window.open(this.certFileUrl + row.filePath);
}
,
certHandleCurrentChange(val) {
this.certQuery.page = val.page;
this.getCompanyCertList();
}
,
getCompanyCertList() {
this.certLoading = true;
this.certQuery.customerId = this.customerId;
filterCompanyCert(this.certQuery)
.then((response) => {
this.certLoading = false;
this.certList = response.data.list || [];
this.certTotal=response.data.total;
})
.catch(() => {
this.certLoading = false;
this.certList = [];
});
}
,
deleteCompanyCert(row) {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.certLoading = true;
let tquery = {
id: row.id,
filePath: row.filePath,
};
deleteCompanyCert(tquery)
.then((response) => {
this.certLoading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.certLoading = false;
});
}).catch(() => {
});
}
,
disableCert(row, status) {
row.status = status;
updateCompanyCert(row).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("更新成功!");
this.getCompanyCertList();
} else {
this.$message.error(response.message);
}
});
},
}
,
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
6: "warning",
};
return statusMap[status];
}
,
}
,
}
;
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,808 @@
<template>
<div>
<el-form
:model="inputQuery"
:rules="rules"
ref="inputQuery"
label-width="100px"
style="margin-top: -30px"
>
<el-card class="el-card">
<div style="display: flex;">
<el-button
v-if="editType==2"
type="primary"
size="mini"
icon="search"
@click="onPassSubmit"
>审核通过
</el-button
>
<el-button
v-if="editType==2"
type="primary"
size="mini"
icon="search"
@click="onRejectSubmit"
>审核拒绝
</el-button
>
<el-button
v-if="editType==1"
type="primary"
size="mini"
icon="search"
@click="printSupCertAll"
>打印
</el-button>
</div>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 20px">
<el-col :span="10" class="el-col">
<el-form-item label="所属供应商:" label-width="150px" prop="customerId">
<el-select
v-model="inputQuery.customerId"
filterable
remote
clearable="true"
disabled
reserve-keyword
placeholder="请输入供应商名称"
:remote-method="findMethod"
:loading="loading"
style="width: 100%;"
@change="unitChange"
>
<el-option
v-for="item in fromOptions"
:key="item.customerId"
:label="item.companyName"
:value="item.customerId"
>
<span style="float: left">{{ item.companyName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="企业名称:" label-width="150px" prop="companyName">
<el-input
size="small"
placeholder="请输入内容" disabled
v-model="inputQuery.companyName"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="统一社会信用代码:" label-width="150px" prop="creditCode">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.creditCode"
@input="change()" disabled
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="企业类型:" label-width="150px" prop="companyType">
<el-select
size="small"
v-model="inputQuery.companyType"
placeholder="企业类型" disabled
style="width: 100%;"
>
<el-option label="境内企业" value="1"></el-option>
<el-option label="境外企业" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="登记状态:" label-width="150px" prop="registerStatus">
<el-select
size="small"
v-model="inputQuery.registerStatus" disabled
placeholder="登记状态"
style="width: 100%;"
>
<el-option label="续存(在营,开业,在册)" value="1"></el-option>
<el-option label="吊销" value="2"></el-option>
<el-option label="注销" value="3"></el-option>
<el-option label="迁出" value="4"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="所在地区:" label-width="150px" prop="placeArea">
<el-cascader
size="small" disabled
:options="options"
v-model="selectedOptions"
placeholder="请选择所在地区"
style="width: 100%"
@change="handleChange"
>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="生产地区:" label-width="150px" prop="productionArea">
<el-cascader
size="small"
:options="options" disabled
v-model="selectedOptions2"
placeholder="请选择生产地区"
style="width: 100%"
@change="handleChange2"
>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="所在地址:" label-width="150px" prop="placeAddress">
<el-input
size="small" disabled
placeholder="请输入内容"
v-model="inputQuery.placeAddress"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="生产地址:" label-width="150px" prop="productionAddress">
<el-input
size="small" disabled
placeholder="请输入内容"
v-model="inputQuery.productionAddress"
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col">
<el-form-item label="备注:" label-width="150px" prop="remark">
<el-input
type="textarea"
size="small" disabled
placeholder="请输入内容"
v-model="inputQuery.remark"
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card class="el-card">
<div style="display: flex">
<!-- <el-button-->
<!-- type="primary"-->
<!-- size="small"-->
<!-- icon="search"-->
<!-- style="margin: 0 100px 20px auto; width: 100px"-->
<!-- @click="addCert()"-->
<!-- >添加电子档-->
<!-- </el-button-->
<!-- >-->
</div>
<el-table v-loading="certLoading" :data="certList" ref="certTable" style="width: 100%" border highlight-current-row>
<el-table-column type="selection" width="55"></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="code"></el-table-column>
<el-table-column label="有效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="证书状态" prop="status">
<template slot-scope="scope">
{{ supStatus[scope.row.status] }}
</template>
</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="250">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="toViewCompanyCert(scope.row)"
>预览
</el-button
>
<el-button
type="text"
size="small"
v-if="editType==2"
@click.native="auditCert(scope.row)"
>审核
</el-button
>
<el-button
v-if="editType==1"
type="text"
size="small"
@click.native="printSupCert(scope.row)"
>打印
</el-button
>
<el-button
type="text"
size="small"
@click.native="rejectInfo(scope.row)"
>说明
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="certQuery.limit"
@current-change="certHandleCurrentChange"
layout="prev, pager, next"
:total="certTotal"
>
</el-pagination>
</el-card>
<el-dialog width="30%" :visible.sync="certAuditVisible" append-to-body>
<el-form :model="currentAudit">
<label></label>
<el-form-item label="审核备注:" :label-width="120">
<el-input type="textarea" v-model="currentAudit.auditComment" autocomplete="off"
autosize></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="rejectAuditCert"></el-button>
<el-button type="primary" @click="passAuditCert"></el-button>
</div>
</el-dialog>
</el-form>
</div>
</template>
<script>
import {auditManufacturer, addOrModifyCompany} from "../../../api/purchase/supManufacturer";
import {regionDataPlus, CodeToText} from "element-china-area-data";
import {filterCompanyCert, deleteCompanyCert, auditSupCert} from "../../../api/purchase/companyCert";
import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import draggable from "vuedraggable";
import {
getSupComapnys,
printSupCertManufacturer,
verifyTemplateFile
} from "@/api/purchase/supCompany";
import {getUUID} from "@/utils/strUtil";
export default {
name: "supManufacturerAuditDialog",
props: {
addCloseDialog: {
type: Function,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
enterpriseId: "",
editType: {
type: Object,
required: true,
}
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
loading: false,
classesDisplay: false,
selectedOptions: [],
selectedOptions2: [],
options: regionDataPlus,
rules: {
customerId: [
{
required: true,
message: "请选择所属供应商",
trigger: "blur"
}
],
companyName: [
{
required: true,
message: "请输入企业名称",
trigger: "blur"
}
],
creditCode: [
{
required: true,
message: "请输入统一社会信用代码",
trigger: "blur"
}
],
companyType: [
{
required: true,
message: "请选择企业类型",
trigger: "change"
}
],
registerStatus: [
{
required: true,
message: "请选择登记状态",
trigger: "change"
}
],
placeArea: [
{
required: true,
message: "请选择所在地区",
trigger: "change"
}
],
placeAddress: [
{
required: true,
message: "请输入所在地址",
trigger: "change"
}
],
legalPersonName: [
{
required: true,
message: "请输入法人姓名",
trigger: "change"
}
],
legalPersonPapersType: [
{
required: true,
message: "请选择法人证件类型",
trigger: "change"
}
],
legalPersonPapersCode: [
{
required: true,
message: "请输入法人证件号码",
trigger: "change"
}
],
},
uploadUrl: "",
fileList: [],
fileUrl: "",
certFileUrl: "",
url: 'http://127.0.0.1:9996/udiwms/image/register/file/getImage?type=image1&name=t11111.jpg',
certQuery: {
customerId: null,
manufacturerIdFk: null,
page: 1,
limit: 20
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
fromOptions: [],
idQuery: {
id: "",
},
addType: "2", //1:2.3.
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
supStatus: {
0: "有效",
1: "失效",
},
certAuditVisible: false,
currentAudit: {},
};
},
created() {
if (this.editType == 0) {
this.enterpriseId = getUUID("");
this.inputQuery.manufacturerId = this.enterpriseId;
} else
this.certQuery.customerId = this.inputQuery.customerId;
this.certQuery.manufacturerIdFk = this.inputQuery.manufacturerId;
this.selectedOptions = this.inputQuery.placeAreaCode.split(",");
if (this.inputQuery.productionAreaCode != null) {
this.selectedOptions2 = this.inputQuery.productionAreaCode.split(",");
}
this.getCompanyCertList();
this.findMethod();
this.uploadUrl = this.BASE_URL + "/udiwms/upload/register/file";
this.fileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
},
components: {
draggable,
companyAddCert,
},
methods: {
onPassSubmit(val) {
this.inputQuery.auditStatus = 1;
this.$confirm("是否审核通过?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.loading = true;
this.inputQuery.auditStatus = 1;
auditManufacturer(this.inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.addCloseDialog(true);
this.$message.success("保存成功");
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
this.addCloseDialog(false);
});
},
onRejectSubmit() {
this.$prompt('请输入驳回意见', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({value}) => {
this.inputQuery.auditComment = value;
this.inputQuery.auditStatus = 2;
auditManufacturer(this.inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.addCloseDialog(true);
this.$message.success("保存成功");
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
});
}
,
openFile() {
window.open(this.fileUrl + this.inputQuery.filePath);
},
certHandleCurrentChange(val) {
this.certQuery.page = val;
this.getCompanyCertList();
},
getCompanyCertList() {
if (this.editType != 2 && this.editType != 0) {
this.certQuery.auditStatus = 20;
}
this.certLoading = true;
this.certQuery.type = 2;
filterCompanyCert(this.certQuery)
.then((response) => {
this.certLoading = false;
this.certList = response.data.list || [];
this.certTotal = response.data.total;
})
.catch(() => {
this.certLoading = false;
this.certList = [];
});
},
addCert(index, row) {
this.idQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
}
this.addCertVisible = true;
},
toViewCompanyCert(row) {
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
window.open(this.certFileUrl + row.filePath);
},
auditCert(row) {
this.certAuditVisible = true;
this.currentAudit = row;
},
passAuditCert() {
this.currentAudit.auditStatus = 1;
this.auditSupCert(this.currentAudit);
},
rejectAuditCert() {
this.currentAudit.auditStatus = 2;
this.auditSupCert(this.currentAudit);
},
auditSupCert(inputQuery) {
auditSupCert(inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.certAuditVisible = false;
} else {
this.$message.error(response.message);
}
});
},
rejectInfo(row) {
this.$confirm(row.auditComment, "审核备注", {
confirmButtonText: "确定",
type: "warning",
showCancelButton: false,
})
.then(() => {
});
},
deleteCompanyCert(row) {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.certLoading = true;
let tquery = {
id: row.id,
filePath: row.filePath,
};
deleteCompanyCert(tquery)
.then((response) => {
this.certLoading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.certLoading = false;
});
}).catch(() => {
});
},
closeLocalDialog() {
this.addCertVisible = false;
this.getCompanyCertList();
},
findMethod(query) {
this.fromOptions = [];
let cQuery = {
companyName: query,
};
getSupComapnys(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
});
}
,
unitChange(val) {
this.certQuery.customerId = val;
},
handleChange(value) {
this.inputQuery.placeArea =
CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
console.log(this.inputQuery.placeArea)
this.inputQuery.placeAreaCode = value.toString();
},
handleChange2(value) {
this.inputQuery.productionArea =
CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
this.inputQuery.productionAreaCode = value.toString();
},
uploadHandleRemove(file, fileList) {
console.log(file, fileList);
},
uploadHandlePreview(file) {
console.log(file);
console.log(this.fileList);
},
uploadHandleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
uploadOnchange(file, fileList) {
let fileName = file.name;
let uid = file.uid
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if (lastName.toLowerCase() !== ".jpg" && lastName.toLowerCase() !== ".png") {
this.$message.error("上传文件只能是 .jpg,.png 格式");
for (let i = 0; i < fileList.length; i++) {//list
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
}
return isLt;
},
uploadHandleSuccess(response, file, fileList) {
console.log(response)
if (response.code === 20000) {
this.inputQuery.newFilePath = response.data.name;
this.onModifySubmit('inputQuery');
} else {
this.$message.error("文件上传失败:" + response.message);
}
},
uploadHandleError() {
},
printSupCert(row) {
var selectIds=[row.id];
let query = {moduleId: 9};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
let printParams = {
templateId: res.data,
ids: selectIds,
customerId: row.customerId
};
printSupCertManufacturer(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);
})
if(selectIds.length==0){
this.$message.error("请先选择打印的证书!");
return
}
let query = {moduleId: 9};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
let printParams = {
templateId: res.data,
ids: selectIds,
customerId: this.inputQuery.customerId
};
printSupCertManufacturer(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);
})
},
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
6: "warning",
};
return statusMap[status];
},
},
};
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,729 @@
<template>
<div>
<el-form
:model="inputQuery"
:rules="rules"
ref="inputQuery"
label-width="100px"
style="margin-top: -30px"
>
<el-card class="el-card">
<div style="float:right ">
<el-button
type="primary"
size="mini"
icon="search"
v-if="inputQuery.auditStatus == 0"
@click="addOrModifyCompany(0)"
>草稿保存
</el-button
>
<el-button
type="primary"
size="mini"
icon="search"
v-if="inputQuery.auditStatus == 0|| inputQuery.auditStatus == 6"
@click="onModifySubmit(6)"
>提交审核
</el-button
>
<el-button
type="primary"
size="mini"
icon="search"
v-if="inputQuery.auditStatus == 3|| inputQuery.auditStatus == 1|| inputQuery.auditStatus == 2"
@click="onModifySubmit(3)"
>提交审核
</el-button
>
</div>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 40px">
<el-col :span="10" class="el-col" v-if="fromType==2">
<el-form-item label="所属供应商:" label-width="150px" prop="customerId">
<el-select
v-model="inputQuery.customerId"
filterable
remote
clearable="true"
:disabled="editType!=0"
reserve-keyword
placeholder="请输入供应商名称"
:remote-method="findMethod"
:loading="loading"
style="width: 100%;"
@change="unitChange"
>
<el-option
v-for="item in fromOptions"
:key="item.customerId"
:label="item.companyName"
:value="item.customerId"
>
<span style="float: left">{{ item.companyName }}</span>
</el-option>
</el-select>
</el-form-item
>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="企业名称:" label-width="150px" prop="companyName">
<el-input
size="small"
placeholder="请输入企业名称"
v-model="inputQuery.companyName"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="统一社会信用代码:" label-width="150px" prop="creditCode">
<el-input
size="small"
placeholder="请输入统一社会信用代码"
v-model="inputQuery.creditCode"
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="企业类型:" label-width="150px" prop="companyType">
<el-select
size="small"
v-model="inputQuery.companyType"
placeholder="请选择企业类型"
style="width: 100%;"
>
<el-option label="境内企业" value="1"></el-option>
<el-option label="境外企业" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="登记状态:" label-width="150px" prop="registerStatus">
<el-select
size="small"
v-model="inputQuery.registerStatus"
placeholder="请选择登记状态"
style="width: 100%;"
>
<el-option label="续存(在营,开业,在册)" value="1"></el-option>
<el-option label="吊销" value="2"></el-option>
<el-option label="注销" value="3"></el-option>
<el-option label="迁出" value="4"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="所在地区:" label-width="150px" prop="placeArea">
<el-cascader
size="small"
:options="options"
v-model="selectedOptions"
placeholder="请选择所在地区"
style="width: 100%"
@change="handleChange"
>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="生产地区:" label-width="150px" prop="productionArea">
<el-cascader
size="small"
:options="options"
v-model="selectedOptions2"
placeholder="请选择生产地区"
style="width: 100%"
@change="handleChange2"
>
</el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="所在地址:" label-width="150px" prop="placeAddress">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.placeAddress"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="生产地址:" label-width="150px" prop="productionAddress">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.productionAddress"
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col">
<el-form-item label="备注:" label-width="150px" prop="remark">
<el-input
type="textarea"
size="small"
placeholder="请输入内容"
v-model="inputQuery.remark"
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card class="el-card">
<div style="float:right ">
<el-button type="primary" size="mini" icon="search" @click="selectCert"
>选入资质证书
</el-button
>
<el-button
type="primary"
size="mini"
icon="search"
@click="addCert()"
>添加资质证书
</el-button
>
</div>
<el-table v-loading="certLoading" :data="certList" style="width: 100%;margin-top: 40px" border highlight-current-row>
<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="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></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="状态" prop="status" width="120">
<template slot-scope="scope">
<el-tag :type="(scope.row.status) | statusType">
{{ statusFlag[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="250">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="addCert(scope.row)"
>编辑
</el-button
>
<el-button
type="text"
size="small"
@click.native="toViewCompanyCert(scope.row)"
>预览
</el-button
>
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus == 0 || scope.row.auditStatus == 2|| scope.row.auditStatus == 6"
@click.native="deleteCompanyCert(scope.row)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="certTotal>0"
:total="certTotal"
:page.sync="certQuery.page"
:limit.sync="certQuery.limit"
@pagination="certHandleCurrentChange"
></pagination>
</el-card>
<el-dialog
title="添加资质证书"
:visible.sync="addCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="addCertVisible"
append-to-body
@close='closeLocalDialog'
>
<companyAddCert
:closeDialog="closeLocalDialog"
:inputQuery="inputQuery"
:addType="addType"
:editTye="editTye"
></companyAddCert>
</el-dialog>
<el-dialog
title="选入资质证书"
:visible.sync="selectCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="selectCertVisible"
append-to-body
@close='closeLocalDialog'
>
<supCertSetSelectDialog
:certType="certType"
:manufacturerId="manufacturerId"
:customerId="customerId"
:closeDialog="closeLocalDialog"
></supCertSetSelectDialog>
</el-dialog>
</el-form>
</div>
</template>
<script>
import {getCompanyInfo, addOrModifyCompany} from "../../../api/purchase/supManufacturer";
import {provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode,} from "element-china-area-data";
import {filterCompanyCert, deleteCompanyCert, updateCompanyCert} from "../../../api/purchase/companyCert";
import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import draggable from "vuedraggable";
import {getSupComapnys} from "@/api/purchase/supCompany";
import {getUUID} from "@/utils/strUtil";
import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog";
export default {
name: "supManufacturerEdit",
props: {
addCloseDialog: {
type: Function,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
editType: {
type: Object,
required: true,
},
fromType: {
type: Object,
required: true,
}
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
loading: false,
classesDisplay: false,
selectedOptions: [],
selectedOptions2: [],
options: regionData,
rules: {
customerId: [
{
required: true,
message: "请选择所属供应商",
trigger: "blur"
}
],
companyName: [
{
required: true,
message: "请输入企业名称",
trigger: "blur"
}
],
creditCode: [
{
required: true,
message: "请输入统一社会信用代码",
trigger: "blur"
}
],
companyType: [
{
required: true,
message: "请选择企业类型",
trigger: "change"
}
],
registerStatus: [
{
required: true,
message: "请选择登记状态",
trigger: "change"
}
],
placeArea: [
{
required: true,
message: "请选择所在地区",
trigger: "change"
}
],
placeAddress: [
{
required: true,
message: "请输入所在地址",
trigger: "change"
}
],
legalPersonName: [
{
required: true,
message: "请输入法人姓名",
trigger: "change"
}
],
legalPersonPapersType: [
{
required: true,
message: "请选择法人证件类型",
trigger: "change"
}
],
legalPersonPapersCode: [
{
required: true,
message: "请输入法人证件号码",
trigger: "change"
}
],
},
uploadUrl: "",
fileList: [],
fileUrl: "",
certFileUrl: "",
url: 'http://127.0.0.1:9996/udiwms/image/register/file/getImage?type=image1&name=t11111.jpg',
certQuery: {
customerId: null,
manufacturerIdFk: null,
page: 1,
limit: 20,
type: 2,
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
fromOptions: [],
idQuery: {
id: "",
},
addType: "2", //1:2.3.
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
statusFlag: {
0: "有效",
1: "失效",
},
editTye: 1,
formName: 1,
formMap: {
1: "新增生产企业资质证书",
2: "编辑生产企业资质证书",
},
manufacturerId: null,
customerId: null,
selectCertVisible: false,
certType: 2,
};
},
created() {
if (this.editType == 0) {
this.inputQuery.manufacturerId = getUUID("")
} else {
this.certQuery.customerId = this.inputQuery.customerId;
this.selectedOptions = this.inputQuery.placeAreaCode.split(",");
if(this.inputQuery.productionAreaCode!="" && this.inputQuery.productionAreaCode!=null && this.inputQuery.productionAreaCode!=undefined){
this.selectedOptions2 = this.inputQuery.productionAreaCode.split(",");
}
}
this.certQuery.manufacturerIdFk = this.inputQuery.manufacturerId;
this.manufacturerId = this.inputQuery.manufacturerId
this.customerId = this.inputQuery.customerId;
// this.getData();
this.getCompanyCertList();
this.findMethod();
this.uploadUrl = this.BASE_URL + "/udiwms/upload/register/file";
this.fileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
},
components: {
draggable,
companyAddCert, supCertSetSelectDialog
},
methods: {
onModifySubmit(type) {
this.addOrModifyCompany(type);
},
addOrModifyCompany (type){
this.$refs["inputQuery"].validate(valid => {
if (valid) {
let formData = JSON.parse(JSON.stringify(this.inputQuery));
formData.auditStatus = type;
this.loading = true;
let urlName = this.editType == 0 ? 'add' : 'update';
addOrModifyCompany(formData, urlName).then(response => {
this.loading = false;
if (response.code === 20000) {
this.addCloseDialog(true);
this.$message.success("保存成功");
} else {
this.$message.error(response.message);
}
});
} else {
console.log("error submit!!");
return false;
}
});
},
certHandleCurrentChange(val) {
this.certQuery.page = val.page;
this.getCompanyCertList();
},
getCompanyCertList() {
this.certLoading = true;
filterCompanyCert(this.certQuery)
.then((response) => {
this.certLoading = false;
this.certList = response.data.list || [];
this.certTotal=response.data.total
})
.catch(() => {
this.certLoading = false;
this.certList = [];
});
},
addCert(row) {
if (this.$isNotBlank(row)) {
this.formName = 2
this.inputQuery.formData = row;
this.editTye = 2;
} else {
this.formName = 1;
this.inputQuery.formData = {};
this.editTye = 1;
}
this.addCertVisible = true;
},
selectCert() {
this.customerId = this.inputQuery.customerId;
this.selectCertVisible = true;
},
toViewCompanyCert(row) {
window.open(this.certFileUrl + row.filePath);
},
deleteCompanyCert(row) {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.certLoading = true;
let tquery = {
id: row.id,
filePath: row.filePath,
};
deleteCompanyCert(tquery)
.then((response) => {
this.certLoading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.certLoading = false;
});
}).catch(() => {
});
},
disableCert(row, status) {
row.status = status;
updateCompanyCert(row).then(response => {
this.loading = false;
if (response.code === 20000) {
this.$message.success("更新成功!");
this.getCompanyCertList();
} else {
this.$message.error(response.message);
}
});
},
closeLocalDialog() {
this.addCertVisible = false;
this.selectCertVisible = false;
this.getCompanyCertList();
},
findMethod(query) {
this.fromOptions = [];
let cQuery = {
companyName: query,
};
getSupComapnys(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
});
}
,
unitChange(val) {
this.certQuery.customerId = val;
},
handleChange(value) {
this.inputQuery.placeArea =
CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
console.log(this.inputQuery.placeArea)
this.inputQuery.placeAreaCode = value.toString();
},
handleChange2(value) {
this.inputQuery.productionArea =
CodeToText[value[0]] + CodeToText[value[1]] + CodeToText[value[2]];
this.inputQuery.productionAreaCode = value.toString();
},
uploadHandleRemove(file, fileList) {
console.log(file, fileList);
},
uploadHandlePreview(file) {
console.log(file);
console.log(this.fileList);
},
uploadHandleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
uploadOnchange(file, fileList) {
let fileName = file.name;
let uid = file.uid
let pos = fileName.lastIndexOf(".");
let lastName = fileName.substring(pos, fileName.length);
if (lastName.toLowerCase() !== ".jpg" && lastName.toLowerCase() !== ".png") {
this.$message.error("上传文件只能是 .jpg,.png 格式");
for (let i = 0; i < fileList.length; i++) {//list
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
}
}
}
return isLt;
},
uploadHandleSuccess(response, file, fileList) {
console.log(response)
if (response.code === 20000) {
this.inputQuery.newFilePath = response.data.name;
this.onModifySubmit('inputQuery');
} else {
this.$message.error("文件上传失败:" + response.message);
}
},
uploadHandleError() {
},
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
6: "warning",
};
return statusMap[status];
},
},
};
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,776 @@
<template>
<div>
<el-form
:model="inputQuery"
:rules="rules"
ref="inputQuery"
label-width="100px"
style="margin-top: -20px"
>
<el-card class="el-card">
<div style="display: flex;">
<el-button
v-if="editType==2"
type="primary"
size="mini"
icon="search"
@click="onPassSubmit"
>审核通过
</el-button
>
<el-button
v-if="editType==2"
type="primary"
size="mini"
icon="search"
@click="onRejectSubmit"
>审核拒绝
</el-button
>
<el-button
v-if="editType==1"
type="primary"
size="mini"
icon="search"
@click="printSupCertAll"
>打印
</el-button>
</div>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top: 20px">
<el-col :span="10" class="el-col">
<el-form-item label="所属供应商:" label-width="150px" prop="customerId">
<el-select
v-model="inputQuery.customerId"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请选择供应商"
:remote-method="findMethod" disabled
:loading="loading"
style="width: 100%;"
@change="supChange"
>
<el-option
v-for="item in fromOptions"
:key="item.customerId"
:label="item.companyName"
:value="item.customerId"
>
<span style="float: left">{{ item.companyName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="所属生产企业:" label-width="150px" prop="manufacturerIdFk">
<el-select
v-model="inputQuery.manufacturerIdFk"
filterable
remote
clearable="true"
disabled
reserve-keyword
placeholder="请选择生产企业"
:remote-method="findPMMethod"
:loading="loading"
style="width: 100%;"
>
<el-option
v-for="item in fromPMOptions"
:key="item.manufacturerId"
:label="item.companyName"
:value="item.manufacturerId"
>
<span style="float: left">{{ item.companyName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="注册/备案号:" label-width="150px" prop="recordCode">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.recordCode" disabled
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="注册/备案产品名称:" label-width="150px" prop="recordProductName">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.recordProductName" disabled
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="注册/备案人名称:" label-width="150px" prop="recordPeopleName">
<el-input
size="small"
placeholder="请输入内容" disabled
v-model="inputQuery.recordPeopleName"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="代理人名称:" label-width="150px" prop="agentName">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.agentName" disabled
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="医疗器械管理类别:" label-width="150px" prop="productManageType">
<el-select
size="small"
v-model="inputQuery.productManageType" disabled
placeholder="医疗器械管理类别"
style="width: 100%;"
>
<el-option label="Ⅰ类" value="1"></el-option>
<el-option label="Ⅱ类" value="2"></el-option>
<el-option label="Ⅲ类" value="3"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="器械类别:" label-width="150px" prop="productType">
<el-select
size="small"
v-model="inputQuery.productType" disabled
placeholder="医疗器械管理类别"
style="width: 100%;"
>
<el-option label="器械" value="1"></el-option>
<el-option label="诊断试剂" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="器械目录分类编码:" label-width="150px" prop="productDirectoryCode">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.productDirectoryCode" disabled
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col">
<el-form-item label="规格型号:" label-width="150px" prop="specification">
<el-input
type="textarea"
size="small"
placeholder="请输入内容"
v-model="inputQuery.specification" disabled
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col">
<el-form-item label="备注:" label-width="150px" prop="remark">
<el-input
type="textarea"
size="small"
placeholder="请输入内容"
v-model="inputQuery.remark" disabled
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
<el-card class="el-card">
<el-table v-loading="certLoading" :data="certList" ref="certTable" style="width: 100%" border highlight-current-row>
<el-table-column type="selection" width="55"></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="code"></el-table-column>
<el-table-column label="有效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="证书状态" prop="status">
<template slot-scope="scope">
{{ supStatus[scope.row.status] }}
</template>
</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="250">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="toViewCompanyCert(scope.row)"
>预览
</el-button
>
<el-button
v-if="editType==1"
type="text"
size="small"
@click.native="printSupCert(scope.row)"
>打印
</el-button
>
<el-button
type="text"
size="small"
v-if="editType==2"
@click.native="auditCert(scope.row)"
>审核
</el-button
>
<el-button
type="text"
size="small"
@click.native="rejectInfo(scope.row)"
>说明
</el-button
>
<!-- <el-button-->
<!-- type="text"-->
<!-- size="small"-->
<!-- @click.native="deleteCompanyCert(scope.row)"-->
<!-- >删除-->
<!-- </el-button-->
<!-- >-->
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="certQuery.limit"
@current-change="certHandleCurrentChange"
layout="prev, pager, next"
:total="certTotal"
>
</el-pagination>
</el-card>
<el-dialog width="30%" :visible.sync="certAuditVisible" append-to-body>
<el-form :model="currentAudit">
<label></label>
<el-form-item label="审核备注:" :label-width="120">
<el-input type="textarea" v-model="currentAudit.auditComment" autocomplete="off"
autosize></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="rejectAuditCert"></el-button>
<el-button type="primary" @click="passAuditCert"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {auditSupProduct} from "../../../api/purchase/suppliersRegistrationBasic";
import {
provinceAndCityData,
regionData,
provinceAndCityDataPlus,
regionDataPlus,
CodeToText,
TextToCode,
} from "element-china-area-data";
import draggable from "vuedraggable";
import {
getSupComapnys,
printSupCertProduction,
verifyTemplateFile
} from "@/api/purchase/supCompany";
import {addOrModifyCompany, getCompanyList} from "@/api/purchase/supManufacturer";
import {auditSupCert, deleteCompanyCert, filterCompanyCert} from "@/api/purchase/companyCert";
import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import {getUUID} from "@/utils/strUtil";
export default {
name: "supProductEditDialog",
props: {
closeRegistrationDialog: {
type: Function,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
editType: {
type: Object,
required: true,
}
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
fromOptions: [],
fromPMOptions: [],
pmQuery: {
customerId: null,
companyName: null,
page: 1,
limit: 10,
},
loading: false,
classesDisplay: false,
selectedOptions: [],
selectedOptions2: [],
options: regionDataPlus,
rules: {
customerId: [
{
required: true,
message: "请选择供应商",
trigger: "change"
}
],
manufacturerIdFk: [
{
required: true,
message: "请选择生产企业",
trigger: "change"
}
],
recordCode: [
{
required: true,
message: "请输入注册/备案号",
trigger: "blur"
}
],
recordProductName: [
{
required: true,
message: "请输入注册/备案产品名称",
trigger: "blur"
}
],
productManageType: [
{
required: true,
message: "请选择医疗器械管理类别",
trigger: "change"
}
],
productType: [
{
required: true,
message: "请选择器械类别",
trigger: "change"
}
],
recordPeopleName: [
{
required: true,
message: "请输入注册/备案人名称",
trigger: "change"
}
],
productDirectoryCode: [
{
required: true,
message: "请输入器械目录分类编码",
trigger: "change"
}
],
specification: [
{
required: true,
message: "请输入规格型号",
trigger: "change"
}
],
},
fileList: [],
fileList2: [],
idQuery: {
id: "",
},
certQuery: {
customerId: null,
manufacturerIdFk: null,
page: 1,
limit: 20
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
certFileUrl: "",
addType: "3", //1:2.3.
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
supStatus: {
0: "有效",
1: "失效",
},
certAuditVisible: false,
currentAudit: {},
};
},
created() {
if (this.editType == 0) {
this.inputQuery.productId = getUUID("");
} else {
if(this.editType!=2 && this.editType!=0){
this.certQuery.auditStatus = 20;
}
this.getCompanyCertList();
this.pmQuery.customerId = this.inputQuery.customerId;
this.findPMMethod();
}
this.findMethod();
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
},
components: {
draggable, companyAddCert
},
methods: {
onPassSubmit() {
this.$confirm("是否审核通过?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.loading = true;
this.inputQuery.auditStatus = 1;
auditSupProduct(this.inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.closeRegistrationDialog(true);
this.$message.success("保存成功");
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
});
},
onRejectSubmit() {
this.$prompt('请输入驳回意见', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({value}) => {
this.inputQuery.auditComment = value;
this.inputQuery.auditStatus = 2;
auditSupProduct(this.inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.closeRegistrationDialog(true);
this.$message.success("保存成功");
} else {
this.$message.error(response.message);
}
});
}).catch(() => {
});
}
,
findMethod(query) {
this.fromOptions = [];
let cQuery = {
companyName: query,
};
getSupComapnys(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
});
},
supChange(val) {
this.pmQuery.customerId = val;
this.findPMMethod();
},
findPMMethod(key) {
this.fromPMOptions = [];
this.pmQuery.companyName = key;
getCompanyList(this.pmQuery)
.then((response) => {
this.loading = false;
this.fromPMOptions = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.fromPMOptions = [];
this.total = 0;
});
},
closeLocalDialog() {
this.addCertVisible = false;
this.getCompanyCertList();
},
addCert(index, row) {
this.idQuery.id = '';
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
this.idQuery.id = row.id;
this.idQuery.formData = row;
}
this.addCertVisible = true;
},
deleteCompanyCert(row) {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.certLoading = true;
let tquery = {
id: row.id,
filePath: row.filePath,
};
deleteCompanyCert(tquery)
.then((response) => {
this.certLoading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.certLoading = false;
});
}).catch(() => {
});
},
getCompanyCertList() {
this.certLoading = true;
this.certQuery.customerId = this.inputQuery.customerId;
this.certQuery.manufacturerIdFk = this.inputQuery.manufacturerIdFk;
this.certQuery.productIdFk = this.inputQuery.productId;
this.certQuery.type = 3;
filterCompanyCert(this.certQuery)
.then((response) => {
this.certLoading = false;
this.certList = response.data.list || [];
this.certTotal=response.data.total;
})
.catch(() => {
this.certLoading = false;
this.certList = [];
});
},
toViewCompanyCert(row) {
window.open(this.certFileUrl + row.filePath);
},
auditCert(row) {
this.certAuditVisible = true;
this.currentAudit = row;
},
passAuditCert() {
this.currentAudit.auditStatus = 1;
this.auditSupCert(this.currentAudit);
},
rejectAuditCert() {
this.currentAudit.auditStatus = 2;
this.auditSupCert(this.currentAudit);
},
rejectInfo(row) {
this.$confirm(row.auditComment, "审核备注", {
confirmButtonText: "确定",
type: "warning",
showCancelButton: false,
})
.then(() => {
});
},
auditSupCert(inputQuery) {
auditSupCert(inputQuery).then(response => {
this.loading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.certAuditVisible = false;
} else {
this.$message.error(response.message);
}
});
},
printSupCert(row) {
var selectIds=[row.id];
let query = {moduleId: 10};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
let printParams = {
templateId: res.data,
ids: selectIds,
id: this.inputQuery.id
};
printSupCertProduction(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);
})
if(selectIds.length==0){
this.$message.error("请先选择打印的证书!");
return
}
let query = {moduleId: 10};
this.loading = true;
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
let printParams = {
templateId: res.data,
ids: selectIds,
id: this.inputQuery.id
};
printSupCertProduction(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);
})
},
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
6: "warning",
};
return statusMap[status];
},
},
};
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,776 @@
<template>
<div>
<el-form
:model="inputQuery"
:rules="rules"
ref="inputQuery"
label-width="100px"
style="margin-top: -30px"
>
<el-card class="el-card">
<div style="float: right">
<el-button
type="primary"
size="mini"
icon="search"
v-if="inputQuery.auditStatus == 0"
@click="selectProduct()"
>选入产品
</el-button
>
<el-button
type="primary"
size="mini"
icon="search"
v-if="inputQuery.auditStatus == 0"
@click="onModifySubmit(0)"
>草稿保存
</el-button
>
<el-button
type="primary"
size="mini"
icon="search"
v-if="inputQuery.auditStatus == 0|| inputQuery.auditStatus == 6"
@click="onModifySubmit(6)"
>提交审核
</el-button
>
<el-button
type="primary"
size="mini"
icon="search"
v-if="inputQuery.auditStatus == 4|| inputQuery.auditStatus == 1|| inputQuery.auditStatus == 2"
@click="onModifySubmit(3)"
>提交审核
</el-button
>
</div>
<el-row :gutter="20" class="el-row" type="flex" style="margin-top:50px">
<el-col :span="10" class="el-col">
<el-form-item label="所属供应商:" label-width="150px" prop="customerId">
<el-select
v-model="inputQuery.customerId"
filterable
remote
clearable="true"
reserve-keyword
disabled
placeholder="请选择供应商"
:remote-method="findMethod"
:loading="loading"
style="width: 100%;"
@change="supChange"
>
<el-option
v-for="item in fromOptions"
:key="item.customerId"
:label="item.companyName"
:value="item.customerId"
>
<span style="float: left">{{ item.companyName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="所属生产企业:" label-width="150px" prop="manufacturerIdFk">
<el-select
v-model="inputQuery.manufacturerIdFk"
filterable
remote
clearable="true"
reserve-keyword
disabled
placeholder="请选择生产企业"
:remote-method="findPMMethod"
:loading="loading"
style="width: 100%;"
>
<el-option
v-for="item in fromPMOptions"
:key="item.manufacturerId"
:label="item.companyName"
:value="item.manufacturerId"
>
<span style="float: left">{{ item.companyName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="产品通用名称:" label-width="150px" prop="recordProductName">
<el-input
size="small"
disabled
placeholder="请输入内容"
v-model="inputQuery.recordProductName"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="注册/备案人名称:" label-width="150px" prop="recordPeopleName">
<el-input
size="small"
disabled
placeholder="请输入内容"
v-model="inputQuery.recordPeopleName"
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="产品类别:" label-width="150px" prop="hchzsb">
<el-select
size="small"
disabled
v-model="inputQuery.hchzsb"
placeholder="产品类别"
style="width: 100%;"
>
<el-option label="耗材" value="耗材"></el-option>
<el-option label="设备" value="设备"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="器械类别:" label-width="150px" prop="productType">
<el-select
size="small"
v-model="inputQuery.productType"
placeholder="器械类别"
disabled
style="width: 100%;"
>
<el-option label="器械" value="器械"></el-option>
<el-option label="诊断试剂" value="诊断试剂"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="注册/备案号:" label-width="150px" prop="recordCode">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.recordCode"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="器械目录分类编码:" label-width="150px" prop="productDirectoryCode">
<el-input
size="small"
placeholder="请输入内容"
disabled
v-model="inputQuery.productDirectoryCode"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="10" class="el-col">-->
<!-- <el-form-item label="代理人名称:" label-width="150px" prop="agentName">-->
<!-- <el-input-->
<!-- size="small"-->
<!-- placeholder="请输入内容"-->
<!-- v-model="inputQuery.agentName"-->
<!-- @input="change()"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="产品描述:" label-width="150px" prop="cpms">
<el-input
size="small"
placeholder="请输入内容"
v-model="inputQuery.cpms"
@input="change()"
></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col">
<el-form-item label="规格型号:" label-width="150px" prop="specification" >
<el-input
size="small"
type="textarea"
autosize
placeholder="请输入内容"
v-model="inputQuery.specification"
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="20" class="el-col">
<el-form-item label="备注:" label-width="150px" prop="remark">
<el-input
type="textarea"
size="small"
placeholder="请输入内容"
v-model="inputQuery.remark"
@input="change()"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
<el-card class="el-card">
<div style="float:right ">
<el-button type="primary" size="mini" icon="search" @click="selectCert"
>选入资质证书
</el-button
>
<el-button
type="primary"
size="mini"
icon="search"
@click="addCert()"
>添加资质证书
</el-button
>
</div>
<el-table v-loading="certLoading" :data="certList" style="width: 100%;margin-top: 40px" border highlight-current-row>
<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="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></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="状态" prop="status" width="120">
<template slot-scope="scope">
<el-tag :type="(scope.row.status) | statusType">
{{ statusFlag[scope.row.status] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="addCert(scope.row)"
>编辑
</el-button
>
<el-button
type="text"
size="small"
@click.native="toViewCompanyCert(scope.row)"
>预览
</el-button
>
<el-button
type="text"
size="small"
:disabled="scope.row.auditStatus === 1"
@click.native="deleteCompanyCert(scope.row)"
>删除
</el-button
>
<el-button
type="text"
size="small"
v-if="scope.row.auditStatus === 2"
@click.native.stop="rejectInfo(scope.row)"
>说明
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="certTotal>0"
:total="certTotal"
:page.sync="certQuery.page"
:limit.sync="certQuery.limit"
@pagination="certHandleCurrentChange"
></pagination>
</el-card>
<el-dialog
title="添加资质证书"
:visible.sync="addCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="addCertVisible"
append-to-body
@close='closeLocalDialog'
>
<companyAddCert
:closeDialog="closeLocalDialog"
:inputQuery="inputQuery"
:addType="addType"
:editTye="editTye"
></companyAddCert>
</el-dialog>
<el-dialog
title="选入资质证书"
:visible.sync="selectCertVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="selectCertVisible"
append-to-body
@close='closeLocalDialog'
>
<supCertSetSelectDialog
:certType="certType"
:manufacturerId="manufacturerId"
:productId="productId"
:customerId="customerId"
:closeDialog="closeLocalDialog"
></supCertSetSelectDialog>
</el-dialog>
<el-dialog
title="选入产品"
:visible.sync="selectSingleProductVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
v-if="selectSingleProductVisible"
append-to-body
@close='closeLocalDialog'
>
<basicSelectSingleProducts
:selectType="selectType"
:closeSelDialog="closeSelDialog"
></basicSelectSingleProducts>
</el-dialog>
</div>
</template>
<script>
import {getRegistrationInfo, addOrModifyRegistration, bindProduct} from "../../../api/purchase/suppliersRegistrationBasic";
import {regionDataPlus} from "element-china-area-data";
import draggable from "vuedraggable";
import {getSupComapnys} from "@/api/purchase/supCompany";
import {getCompanyList} from "@/api/purchase/supManufacturer";
import {deleteCompanyCert, filterCompanyCert} from "@/api/purchase/companyCert";
import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog";
import basicSelectSingleProducts from "@/views/purchase/company/companyProducts";
import {getUUID} from "@/utils/strUtil";
export default {
name: "supProductEditDialog",
props: {
closeRegistrationDialog: {
type: Function,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
editType: {
type: Object,
required: true,
},
currentManufacturer: {
type: Object,
required: true,
}
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
fromOptions: [],
fromPMOptions: [],
pmQuery: {
customerId: null,
companyName: null,
page: 1,
limit: 10,
},
loading: false,
classesDisplay: false,
cuStatus:0,
selectedOptions: [],
selectedOptions2: [],
options: regionDataPlus,
rules: {
customerId: [
{
required: true,
message: "请选择供应商",
trigger: "change"
}
],
manufacturerIdFk: [
{
required: true,
message: "请选择生产企业",
trigger: "change"
}
],
recordCode: [
{
required: true,
message: "请输入注册/备案号",
trigger: "blur"
}
],
recordProductName: [
{
required: true,
message: "请输入注册/备案产品名称",
trigger: "blur"
}
],
productManageType: [
{
required: true,
message: "请选择医疗器械管理类别",
trigger: "change"
}
],
productType: [
{
required: true,
message: "请选择器械类别",
trigger: "change"
}
],
recordPeopleName: [
{
required: true,
message: "请输入注册/备案人名称",
trigger: "change"
}
],
productDirectoryCode: [
{
required: true,
message: "请输入器械目录分类编码",
trigger: "change"
}
],
specification: [
{
required: true,
message: "请输入规格型号",
trigger: "change"
}
],
},
fileList: [],
fileList2: [],
certQuery: {
customerId: null,
manufacturerIdFk: null,
page: 1,
limit: 20
},
certList: [],
certTotal: 0,
certLoading: false,
addCertVisible: false,
certFileUrl: "",
addType: "3", //1:2.3.
checkFlag: {
0: "草稿",
1: "已通过",
2: "已拒绝",
3: "变更未审核",
6: "未审核",
},
editTye: 1,
statusFlag: {
0: "有效",
1: "失效",
},
manufacturerId: null,
productId: null,
customerId: null,
selectCertVisible: false,
selectSingleProductVisible: false,
selectType: 1,
certType: 3,
};
},
created() {
if (this.editType == 0) {
this.inputQuery.productId = getUUID("");
this.inputQuery.customerId = this.currentManufacturer.customerId;
this.inputQuery.manufacturerIdFk = this.currentManufacturer.manufacturerId;
} else {
this.getCompanyCertList();
this.pmQuery.customerId = this.inputQuery.customerId;
}
this.cuStatus=this.inputQuery.cuStatus;
this.manufacturerId = this.inputQuery.manufacturerIdFk
this.productId = this.inputQuery.productId
this.findMethod();
this.findPMMethod();
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
},
components: {
draggable, companyAddCert, supCertSetSelectDialog,basicSelectSingleProducts
},
methods: {
onModifySubmit(val) {
if(val!=0){
if(this.cuStatus!=1){
this.$message.error("生产企业未通过审核不能提交!");
return;
}
}
this.$refs['inputQuery'].validate(valid => {
if (valid) {
// this.inputQuery.auditStatus = val;
let formData = JSON.parse(JSON.stringify(this.inputQuery));
formData.auditStatus = val;
this.loading = true;
let urlName = this.editType == 0 ? 'add' : 'update';
addOrModifyRegistration(formData, urlName).then(response => {
this.loading = false;
if (response.code === 20000) {
this.closeRegistrationDialog(true);
this.$message.success("保存成功");
} else {
this.$message.error(response.message);
}
});
} else {
return false;
}
});
},
toViewCompanyCert(row) {
window.open(this.certFileUrl + row.filePath);
},
rejectInfo(row) {
this.$confirm(row.auditComment, "拒绝说明", {
confirmButtonText: "确定",
type: "warning",
showCancelButton: false,
})
.then(() => {
});
},
findMethod(query) {
this.fromOptions = [];
let cQuery = {
companyName: query,
};
getSupComapnys(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
});
},
supChange(val) {
this.pmQuery.customerId = val;
this.findPMMethod();
},
findPMMethod(key) {
this.fromPMOptions = [];
this.pmQuery.companyName = key;
getCompanyList(this.pmQuery)
.then((response) => {
this.loading = false;
this.fromPMOptions = response.data.list || [];
this.total = response.data.total || 0;
})
.catch(() => {
this.loading = false;
this.fromPMOptions = [];
this.total = 0;
});
},
closeLocalDialog() {
this.addCertVisible = false;
this.selectCertVisible = false;
this.getCompanyCertList();
},
closeSelDialog(val) {
if (val != null) {
let query = {
productId: this.inputQuery.productId,
relIdFk: val,
manufacturerId: this.inputQuery.manufacturerIdFk,
customerId: this.inputQuery.customerId,
auditStatus: this.inputQuery.auditStatus
};
bindProduct(query).then(response => {
this.loading = false;
if (response.code === 20000) {
this.inputQuery = response.data;
this.selectSingleProductVisible = false;
} else {
this.$message.error(response.message);
}
});
}
},
addCert(row) {
if (this.$isNotBlank(row)) {
this.formName = 2
this.inputQuery.formData = row;
this.editTye = 2;
} else {
this.formName = 1;
this.editTye = 1;
this.inputQuery.formData = {};
}
this.addCertVisible = true;
},
selectCert() {
this.customerId = this.inputQuery.customerId;
this.selectCertVisible = true;
},
deleteCompanyCert(row) {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.certLoading = true;
let tquery = {
id: row.id,
filePath: row.filePath,
};
deleteCompanyCert(tquery)
.then((response) => {
this.certLoading = false;
if (response.code === 20000) {
this.getCompanyCertList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.certLoading = false;
});
}).catch(() => {
});
},
certHandleCurrentChange(val) {
this.certQuery.page = val.page;
this.getCompanyCertList();
},
getCompanyCertList() {
this.certLoading = true;
this.certQuery.customerId = this.inputQuery.customerId;
this.certQuery.manufacturerIdFk = this.inputQuery.manufacturerIdFk;
this.certQuery.productIdFk = this.inputQuery.productId;
filterCompanyCert(this.certQuery)
.then((response) => {
this.certLoading = false;
this.certList = response.data.list || [];
this.certTotal=response.data.total
})
.catch(() => {
this.certLoading = false;
this.certList = [];
});
},
selectProduct() {
this.selectSingleProductVisible = true;
},
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
6: "warning",
};
return statusMap[status];
},
},
};
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 120px;
}
.text {
width: 100%;
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-card {
margin-right: 20px;
margin-top: 15px;
/*transition: all .5s;*/
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>
Loading…
Cancel
Save