Merge remote-tracking branch 'origin/dev2.0' into dev2.0

20231126-yw
郑明梁 2 years ago
commit 83d3472710

@ -0,0 +1,68 @@
import axios from "@/utils/request";
export function filterDeviceCert(query) {
return axios(
{
url: "/inv/device/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
}
);
}
export function revokeSupCert(query) {
return axios(
{
url: "/sale/sup/cert/revoke",
method: "post",
data: query
}
);
}

@ -43,7 +43,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="资产编码:">
@ -66,7 +65,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="设备状态:">
@ -107,7 +105,6 @@
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
@ -116,10 +113,9 @@
<el-button type="primary" icon="el-icon-plus" @click="addDevice"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
@row-click="listClick" @current-change="handInvChange"
border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="部门" prop="deptName" width="180"></el-table-column>
@ -176,18 +172,24 @@
></pagination>
</el-card>
<el-tabs type="border-card" style="margin: 5px">
<el-tabs type="border-card" style="margin: 15px">
<el-tab-pane label="基本信息" >
</el-tab-pane>
<el-tab-pane label="设备资质" >
<checkResultPanel
:idQuery="filterQuery"
:rowData="selectedRowData"
></checkResultPanel>
</el-tab-pane>
<el-tab-pane label="技术资料" >
</el-tab-pane>
<el-tab-pane label="相关人员">
</el-tab-pane>
</el-tabs>
<el-dialog
:title="formMap[formName]"
:visible.sync="deviceDialogVisible"
@ -224,12 +226,14 @@ import {getDeptListByUser} from "@/api/auth/authDept";
import {getDeptDeviceList, deleteDeptDevice ,printOrder, verifyTemplateFile} from "@/api/inventory/deptDevice";
import deptDeviceModifyDialog from "@/views/inventory/deptDeviceModifyDialog.vue";
import inspectSetModifyDialog from "@/views/inventory/InspectSetModifyDialog.vue";
import checkResultPanel from "@/views/inventory/invDeviceEditDialog.vue";
export default {
name: "DeptDeviceDetail",
data() {
return {
selectedRowData: {},
filterQuery: {
deptCode: this.$store.getters.locDeptCode,
invCode: this.$store.getters.locInvCode,
@ -319,6 +323,31 @@ export default {
};
},
methods: {
handInvChange(row) { //
this.invManage(row);
},
invManage(row) {
this.selectedRowData = {
deptCode: this.$store.getters.locDeptCode,
invCode: this.$store.getters.locInvCode,
deviceName: null,
code: null,
ggxh: null,
batchNo: null,
status: 1,
addType: 1,
page: 1
};
},
listClick(row) {
// this.selectedRowData = null
// // nexgtTickselectedRow
// this.$nextTick(res=>{
this.selectedRowData = row // selectedRow
//
// })
},
hideSearch() {
this.showSearch = !this.showSearch;
},
@ -505,6 +534,7 @@ export default {
};
},
components: {
checkResultPanel,
deptDeviceModifyDialog,
inspectSetModifyDialog
},

@ -0,0 +1,471 @@
<template>
<div>
<el-form :model="inputQuery" :rules="rules" ref="inputQuery" label-width="100px">
<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" 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="证书状态">
<template slot-scope="scope">
<span>{{ expire[scope.row.status] }}</span>
</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="备注" 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="mini" @click.native="showImgViewer(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>
<el-image-viewer v-if="imgViewerVisible" style="z-index:9999" :on-close="closeImgViewer"
:url-list="imgList"/>
<pagination
v-show="certTotal>0"
:total="certTotal"
:page.sync="certQuery.page"
:limit.sync="certQuery.limit"
@pagination="certHandleCurrentChange"
></pagination>
<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-form>
</div>
</template>
<script>
import {modifyCompany, addCompany, bindCorp, previewImage} from "@/api/purchase/supCompany";
import store from "@/store/index";
import {regionDataPlus, CodeToText} from "element-china-area-data";
import { deleteCompanyCert, updateCompanyCert} from "@/api/purchase/companyCert";
import {filterDeviceCert} from "@/api/inventory/deviceCert";
import corpMaintainSelect from "@/views/basic/corpMaintain/corpMaintainSelect"
import companyAddCert from "@/views/purchase/cert/supCertAddDialog";
import draggable from "vuedraggable";
import {getUUID, isBlank} from "@/utils/strUtil";
import supCertSetSelectDialog from "@/views/purchase/cert/supCertSetSelectDialog";
import {getBasicUnitMaintains, getCorpList} from "@/api/basic/basicUnitMaintain";
import ElImageViewer from "element-ui/packages/image/src/image-viewer"
export default {
name: "invDeviceEdit",
props: {
// closeDialog: {
// type: Function,
// required: true,
// },
// inputEdit: {
// type: Object,
// required: true,
// },
// editType: {
// type: Number,
// required: true,
// }
rowData: {
type: Object,
required: true,
},
idQuery: {
type: Object,
required: true,
},
},
data() {
return {
BASE_URL: process.env.VUE_APP_BASE_API,
headers: {},
classesDisplay: false,
selectedOptions: [],
imgViewerVisible: false,
imgList: [],
options: regionDataPlus,
inputQuery: {
// customerId: null,
devCodeFk:null,
companyName: null,
contacts: null,
mobile: null,
detailAddr: null,
},
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: {
devCodeFk: "",
page: 1,
limit: 20,
type: 1
},
expire: {
0: "有效",
1: "失效"
},
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
},
maintainsList: [],
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() {
console.log("第一次this.rowData:")
console.log(this.rowData)
// if (this.editType == 1) {
this.getDeviceCertList();
// }
this.getBasicUnitMaintainsList();
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
// this.inputQuery = this.inputEdit
// this.inputQuery = this.idQuery
// if (this.inputQuery.areaCode != null)
// this.selectedOptions = this.inputQuery.areaCode.split(",");
}
,
components: {
draggable, companyAddCert, corpMaintainSelect, supCertSetSelectDialog, ElImageViewer
}
,
methods: {
//
showImgViewer(row) {
this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name=";
this.imgList = [];
previewImage({imageUrl: row.filePath, certFileUrl: this.certFileUrl}).then(response => {
if (response.code === 20000) {
this.imgList = response.data;
}
});
this.imgViewerVisible = true;
const m = (e) => {
e.preventDefault()
};
document.body.style.overflow = 'hidden';
document.addEventListener("touchmove", m, false); //
},
closeImgViewer() {
this.imgViewerVisible = false;
const m = (e) => {
e.preventDefault()
};
document.body.style.overflow = 'auto';
document.removeEventListener("touchmove", m, true);
},
selectBasicCorp() {
this.selectCorpVisible = true;
},
cancelDialog() {
this.closeDialog();
},
//
closeLocalDialog() {
this.addCertVisible = false;
this.selectCertVisible = false;
// this.getCompanyCertList();
this.getDeviceCertList();
}
,
//
addCert(row) {
if (isBlank(this.inputQuery.customerId)) {
return this.$message.error("请先选择供应商");
}
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 = {};
this.inputQuery.formData.addType = 1;
this.editTye = 1;
}
this.addCertVisible = true;
}
,
//
certHandleCurrentChange(val) {
this.certQuery.page = val.page;
// this.getCompanyCertList();
this.getDeviceCertList();
},
getBasicUnitMaintainsList() {
getCorpList()
.then((response) => {
this.maintainsList = response.data || [];
})
.catch(() => {
this.maintainsList = [];
});
},
getDeviceCertList() {
this.certLoading = true;
// let certRuery = {}
// this.certQuery.customerId = this.inputEdit.customerId;
console.log("获取idQuery")
console.log(this.idQuery)
this.certQuery.devCodeFk = this.idQuery.code;
console.log( "获取this.certQuery:")
console.log( this.certQuery)
filterDeviceCert(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(() => {
});
},
},
// filters: {
// statusFilterType(status) {
// const statusMap = {
// 0: "warning",
// 1: "success",
// 2: "danger",
// 6: "warning",
// };
// return statusMap[status];
// }
// ,
// },
}
;
</script>
<style scoped>
.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>

@ -375,7 +375,6 @@
<inv-rel-users :inputQuery="currentRow"
:configParms="configParms"
></inv-rel-users>
</el-tab-pane>
<!-- <el-tab-pane>-->
<!-- <span slot="label">{{ currentRow.name }}-单据类型</span>-->

Loading…
Cancel
Save