第三方库存信息代码提交

prod
郑明梁 2 years ago
parent 400313e977
commit 0c0dddb349

@ -0,0 +1,40 @@
import axios from "@/utils/request";
export function getInvProducts(query) {
return axios({
url: "/udiwms/thrsys/getInvProducts",
method: "get",
params: query
});
}
export function delInvProducts(query) {
return axios({
url: "/udiwms/thrsys/delInvProducts",
method: "post",
data: query
});
}
export function delAll(query) {
return axios({
url: "/udiwms/thrsys/invProducts/delAll",
method: "get",
params: query
});
}
export function downloadAll(query) {
return axios({
url: "/udiwms/thrsys/invProducts/downloadAll",
method: "get",
params: query
});
}
export function inpisDlAll(query) {
return axios({
url: "/udiwms/thrsys/invProducts/inpisDlAll",
method: "post",
data: query
});
}

@ -0,0 +1,33 @@
import axios from "@/utils/request";
export function filterLog(query) {
return axios({
url: "/udiwms/invProducts/exportLog/filter",
method: "get",
params: query
});
}
export function deleteLog(query) {
return axios({
url: "/udiwms/invProducts/exportLog/deleteLog",
method: "post",
data: query
});
}
export function downloadLog(query) {
return axios({
url: "/udiwms/invProducts/exportLog/download",
method: "get",
params: query
});
}
export function exportExcel(query) {
return axios({
url: "/udiwms/invProducts/importLog/export",
method: "post",
data: query
});
}

@ -0,0 +1,25 @@
import axios from "@/utils/request";
export function filterLog(query) {
return axios({
url: "/udiwms/thrInvProducts/importLog/filter",
method: "get",
params: query
});
}
export function filterDetail(query) {
return axios({
url: "/udiwms/thrInvProducts/importLog/filterDetail",
method: "get",
params: query
});
}
export function deleteLog(query) {
return axios({
url: "/udiwms/thrInvProducts/importLog/deleteLog",
method: "post",
data: query
});
}

@ -0,0 +1,314 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.inventoryCode" clearable
placeholder="请输入产品编码"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.inventoryName" clearable
placeholder="请输入产品名称"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.spec" clearable
placeholder="请输入规格型号"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.registerCertNo" clearable
placeholder="请输入注册/备案凭证号"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.manufactory" clearable
placeholder="请输入生厂厂家"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.filterCount" placeholder="过滤条件">
<el-option label="全部" value="0"></el-option>
<el-option label="库存等于0" value="1"></el-option>
<el-option label="库存大于0" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.thirdSys" placeholder="请选择第三方系统">
<el-option
v-for="item in thirdSys"
:key="item.value"
:label="item.thirdName"
:value="item.thirdId">
<span style="float: left">{{ item.thirdName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.thirdId }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="getList"></el-button>
<el-button type="primary" icon="search" @click="clearAll"
v-if="!this.thirdSysDetail.enabled">清空全部
</el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row>
<el-table-column label="序号" type="index" width="70"></el-table-column>
<el-table-column label="产品编码" prop="code" show-overflow-tooltip></el-table-column>
<el-table-column label="产品名称" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" prop="batchNo" show-overflow-tooltip></el-table-column>
<el-table-column label="生产日期" prop="manufacturingDate" show-overflow-tooltip></el-table-column>
<el-table-column label="失效日期" prop="expirationDate" show-overflow-tooltip></el-table-column>
<el-table-column label="数量" prop="count" show-overflow-tooltip></el-table-column>
<el-table-column label="注册证号" prop="registerCertNo" show-overflow-tooltip></el-table-column>
<el-table-column label="生产厂家" prop="manufactory" show-overflow-tooltip></el-table-column>
<el-table-column label="仓位" prop="warehouseName" show-overflow-tooltip></el-table-column>
<el-table-column label="货位" prop="spaceName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" v-if="thirdSysDetail.fromType!=0">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.stop="deleteDialog(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="getList"
/>
</el-card>
</div>
</template>
<script>
import {delInvProducts, delAll, downloadAll} from "@/api/thrsys/thrInvProducts";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
import {selectIp} from "@/api/param/systemParamConfig";
import {getOnhands} from "@/api/inventory/onHand.js";
export default {
data() {
return {
filterQuery: {
inventoryCode: null,
inventoryName: null,
spec: null,
registerCertNo: null,
manufactory: null,
thirdSys: null,
page: 1,
limit: 100,
filterCount:null,
},
total: 0,
list: [],
thirdSys: [],
thirdSysDetail: null,
fileList: [],
uploadData: {
thirdSys: "thirdId",
},
uploadFileUrl: null,
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
inventoryCode: null,
inventoryName: null,
thirdSys: null,
spec: null,
registerCertNo: null,
manufactory: null,
page: 1,
limit: 100,
filterCount:null,
};
this.getList();
},
getList() {
if (this.filterQuery.thirdSys == null) {
this.$message.warning("请先选择第三方系统!")
return;
}
this.loading = true;
getOnhands(this.filterQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
}else {
this.$message.error(response.message);
this.loading = false;
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该产品信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: row.id,
};
delInvProducts(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
clearAll() {
this.$confirm("此操作将清空所有库存产品信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delAll()
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
} else {
this.$message.success(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
} else {
console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success("文件上传成功,请稍后刷新查看!");
}
},
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
debugger
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSys = this.thirdSys[0].thirdId;
this.uploadData.thirdSys = this.filterQuery.thirdSys;
this.getThirdSysDetail();
this.selectSysParam();
this.getList();
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSys
};
selectIp(query).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/invpi/upload";
}
});
},
thirdSysChange() {
this.uploadData.thirdSys = this.filterQuery.thirdSys;
this.getThirdSysDetail();
},
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSys,
key: "invPiUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
downloadDatas() {
let query = {
thirdSysFk: this.filterQuery.thirdSys
};
downloadAll(query).then((response) => {
if (response.code == 20000) {
this.$message.success(response.data);
} else {
this.$message.error(response.message);
}
});
},
},
components: {},
mounted() {
},
created() {
this.getBasicThirdSys();
},
};
</script>
<style scoped>
</style>

@ -0,0 +1,294 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.genKey" placeholder="请输入记录ID"></el-input>
</el-form-item>
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="getList"></el-button>
<el-button type="primary" icon="el-icon-upload2" @click="exportExcel">Excel</el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
border highlight-current-row
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="记录ID"
prop="genKey"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="更新日期"
prop="updateTime"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="状态"
prop="status"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag
:type="statusFilterType(scope.row.status)"
>{{ status[scope.row.status] }}
</el-tag
>
</template>
</el-table-column>
<el-table-column
label="下载次数"
prop="dlCount"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="downloadExcel(scope.row)"
>下载
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<el-dialog
title="导出库存产品信息"
:visible.sync="thrInvProductsSelectVisible"
width="85%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="thrInvProductsSelectVisible"
>
<thrInvProductsSelect :selectType="selectType" v-on:cancelDialog="cancelDialog"
></thrInvProductsSelect>
</el-dialog>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script>
import {filterLog, deleteLog} from "@/api/thrsys/thrInvProductsExport.js";
import thrInvProductsSelect from "./thrInvProductsSelect";
import axios from "axios";
export default {
data() {
return {
filterQuery: {
genKey: null,
status: null,
fromType: null,
page: 1,
limit: 20,
thirdSysFk: null,
},
selectType: 0,
thrInvProductsSelectVisible: false,
list: [],
detailList: [],
thirdSys: [],
thirdSysDetail: null,
total: 0,
editQuery: null,
fromStatus: {
0: "产品信息",
1: "库存信息",
2: "异常第三方上传"
},
status: {
0: "等待处理",
1: "正在处理",
2: "处理异常",
3: "处理完成"
},
uploadFileUrl: null,
uploadData: {
thirdSys: "thirdId",
},
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
fromType: null,
genKey: null,
status: null,
page: 1,
limit: 20,
thirdSysFk: null,
};
this.getList();
},
getList() {
this.loading = true;
filterLog(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
}else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
exportExcel() {
this.selectType = 0;
this.thrInvProductsSelectVisible = true;
},
uploadSmp() {
this.selectType = 1;
this.thrInvProductsSelectVisible = true;
},
downloadExcel(row) {
axios.get("./config.json").then(res => {
let baseUrl = res.data.BASE_URL;
let href = baseUrl + "/udiwms/invProducts/exportLog/download" + "?genKey=" +row.genKey;
let a = document.createElement("a");
fetch(href)
.then((res) => res.blob())
.then((blob) => {
a.href = URL.createObjectURL(blob);
console.log(a.href);
a.download =
row.filePath.split("/")[
row.filePath.split("/").length - 1
]; // //
document.body.appendChild(a);
a.click();
this.getList();
});
});
},
cancelDialog(val) {
this.thrInvProductsSelectVisible = false;
if (val) {
this.getList();
}
},
deleteDialog(rowId) {
this.$confirm("此操作将删除该导出记录, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: rowId,
};
deleteLog(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
} else {
this.$message.error(response.message);
}
this.getList();
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
} else {
console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success("文件上传成功,请稍后刷新查看!");
}
},
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "warning",
2: "danger",
3: "success",
};
return statusMap[status];
},
},
mounted() {
},
components: {thrInvProductsSelect},
created() {
// this.getBasicThirdSys();
this.getList();
},
};
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 100px;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,441 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.genKey" placeholder="请输入记录ID"></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.status" placeholder="请选择处理状态">
<el-option label="全部" value=""></el-option>
<el-option label="处理中" value="0"></el-option>
<el-option label="已处理" value="1"></el-option>
<el-option label="异常" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.thirdSysFk" placeholder="请选择第三方系统" @change="sysChange">
<el-option
v-for="item in thirdSys"
:key="item.value"
:label="item.thirdName"
:value="item.thirdId">
<span style="float: left">{{ item.thirdName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.thirdId }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="getList"></el-button>
<el-upload
v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==1"
:action="uploadFileUrl"
multiple
:limit="1"
:data="uploadData"
:show-file-list="false"
:on-success="handleChange"
:file-list="fileList"
>
<el-button size="mini" type="primary">导入库存产品信息</el-button>
</el-upload>
<!-- <el-button type="primary" icon="search" @click="jumpDl"-->
<!-- v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==1">模板下载-->
<!-- </el-button>-->
<el-button type="primary" icon="el-icon-download" @click="downloadInpi"
v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==3">
下载库存产品信息
</el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
border highlight-current-row
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="记录ID"
prop="genKey"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="来源"
prop="fromType"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="更新日期"
prop="updateTime"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="来源系统"
prop="thirdSysFk"
show-overflow-tooltip
:formatter="formatterThirdSys"
></el-table-column>
<el-table-column
label="状态"
prop="status"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag
:type="statusFilterType(scope.row.status)"
>{{ status[scope.row.status] }}
</el-tag
>
</template>
</el-table-column>
<el-table-column
label="备注"
prop="remark"
show-overflow-tooltip
></el-table-column>
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="handleDetailClick(scope.row)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<el-dialog
title="导入库存产品信息详情详情"
:visible.sync="udiImportDetailVisible"
width="85%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="udiImportDetailVisible"
>
<thrInvProductsImportDetail
:currentRow="currentRow"
></thrInvProductsImportDetail>
</el-dialog>
<el-dialog
title="导出库存产品信息"
:visible.sync="thrInvProductsSelectVisible"
width="85%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="thrInvProductsSelectVisible"
>
<thrInvProductsSelect :selectType="selectType" v-on:cancelDialog="cancelDialog"
:isDownThrSys="true"
></thrInvProductsSelect>
</el-dialog>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script>
import {filterLog, deleteLog} from "@/api/thrsys/thrInvProductsImport";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
import {downloadAll} from "@/api/thrsys/thrInvProducts";
import {selectIp} from "@/api/param/systemParamConfig";
import thrInvProductsImportDetail from "./thrInvProductsImportDetail";
import thrInvProductsSelect from "./thrInvProductsSelect";
import axios from "axios";
export default {
data() {
return {
filterQuery: {
genKey: null,
status: null,
fromType: null,
page: 1,
limit: 20,
thirdSysFk: null,
},
selectType: 0,
udiImportDetailVisible: false,
thrInvProductsSelectVisible: false,
checked: false,
list: [],
detailList: [],
fileList: [],
thirdSys: [],
thirdSysDetail: null,
total: 0,
currentRow: null,
editQuery: null,
fromStatus: {
0: "产品信息",
1: "库存信息",
2: "异常第三方上传"
},
status: {
0: "等待处理",
1: "正在处理",
2: "处理异常",
3: "处理完成"
},
uploadFileUrl: null,
uploadData: {
thirdSys: "thirdId",
},
templateDlUrl: null,
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
fromType: null,
genKey: null,
status: null,
page: 1,
limit: 20,
thirdSysFk: null,
};
this.getList();
},
getList() {
this.loading = true;
filterLog(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
sysChange() {
this.getThirdSysDetail();
// console.log( this.thirdSysDetail.thirdId+"\n"+ this.thirdSysDetail.fromType+"\n"+this.thirdSysDetail.enable);
},
genInCode() {
this.selectBasicUdiVisible = true;
},
downloadInpi() {
this.selectType = 3;
this.thrInvProductsSelectVisible = true;
},
handleDetailClick(row) {
this.currentRow = row;
console.log(this.currentRow.genKey)
this.udiImportDetailVisible = true;
},
cancelDialog(val) {
this.udiImportDetailVisible = false;
this.thrInvProductsSelectVisible = false;
if (val) {
this.getList();
}
},
deleteDialog(rowId) {
this.$confirm("此操作将删除该导入记录, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: rowId,
};
deleteLog(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
} else {
this.$message.error(response.message);
}
this.getList();
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSysFk = this.thirdSys[0].thirdId;
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.getList();
this.getThirdSysDetail();
this.selectSysParam();
})
.catch(() => {
this.loading = false;
this.list = [];
});
axios.get("./config.json").then(res => {
let response = res.data.SERVER_IP;
this.templateDlUrl = response + "/第三方库存产品信息导入模板.xlsx";
console.log(this.templateDlUrl);
});
},
jumpDl() {
window.open(this.templateDlUrl, '_blank');
},
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSysFk
};
selectIp(query).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/invpi/upload";
}
});
},
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
} else {
// console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success(response.data);
}
this.fileList = [];
this.getList();
},
formatterThirdSys(key) {
let data = null;
this.thirdSys.forEach((item, index) => {
if (key.thirdSysFk == item.thirdId) {
data = item.thirdName;
}
});
return data;
},
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "warning",
2: "danger",
3: "success",
};
return statusMap[status];
},
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk,
key: "invPiUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
},
downloadDatas() {
this.$confirm("此操作从第三方系统下载全部库存产品信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk
};
downloadAll(query).then((response) => {
if (response.code == 20000) {
this.$message.success(response.data);
this.getList();
} else {
this.$message.error(response.message);
}
});
});
},
},
mounted() {
},
components: {thrInvProductsImportDetail, thrInvProductsSelect},
created() {
this.getBasicThirdSys();
// this.getList();
},
};
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 100px;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,166 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="query" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.inventoryCode" clearable
placeholder="请输入存货编码"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.inventoryName" clearable
placeholder="请输入存货名称"
></el-input>
</el-form-item>
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="getList"></el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
border highlight-current-row
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品编码" prop="inventoryCode" show-overflow-tooltip></el-table-column>
<el-table-column label="产品名称" prop="inventoryName" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" prop="batchNo" show-overflow-tooltip></el-table-column>
<el-table-column label="仓位" prop="warehouseName" show-overflow-tooltip></el-table-column>
<el-table-column label="货位" prop="spaceName" show-overflow-tooltip></el-table-column>
<el-table-column label="注册证号" prop="registerCertNo" show-overflow-tooltip></el-table-column>
<el-table-column label="生产日期" prop="manufacturingDate" show-overflow-tooltip></el-table-column>
<el-table-column label="失效日期" prop="expirationDate" show-overflow-tooltip></el-table-column>
<el-table-column label="数量" prop="count" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script>
import {
filterDetail,
} from "@/api/thrsys/thrInvProductsImport";
export default {
name: "ThrInvProductsImportDetail",
props: {
currentRow: {
type: Object,
required: true,
},
},
data() {
return {
filterQuery: {
genKey: null,
inventoryCode: null,
inventoryName: null,
status: null,
page: 1,
limit: 10,
},
list: [],
detailList: [],
total: 0,
status: {
0: "未处理",
1: "处理失败",
2: "处理成功"
},
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
genKey: null,
inventoryCode: null,
inventoryName: null,
status: null,
page: 1,
limit: 10,
};
this.getList();
},
getList() {
this.loading = true;
console.log(" this.genKey = " + this.currentRow)
this.filterQuery.genKey = this.currentRow.genKey;
filterDetail(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
}else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "danger",
2: "success",
};
return statusMap[status];
},
},
mounted() {
},
created() {
this.getList();
},
filters: {},
};
</script>
<style>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 100px;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,381 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.inventoryCode" clearable
placeholder="请输入产品编码"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.inventoryName" clearable
placeholder="请输入产品名称"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.spec" clearable
placeholder="请输入规格型号"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.registerCertNo" clearable
placeholder="请输入注册/备案凭证号"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.manufactory" clearable
placeholder="请输入生厂厂家"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.filterCount" placeholder="请选择过滤条件">
<el-option label="全部" value="0"></el-option>
<el-option label="库存等于0" value="1"></el-option>
<el-option label="库存大于0" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.thirdSys" placeholder="请选择第三方系统">
<el-option
v-for="item in thirdSys"
:key="item.value"
:label="item.thirdName"
:value="item.thirdId">
<span style="float: left">{{ item.thirdName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.thirdId }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group style="display:flex;" >
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="getList"></el-button>
<el-button type="primary" icon="el-icon-upload2" @click="selectExport" v-if="selectType==0"
>选中导出
</el-button>
<el-button type="primary" icon="el-icon-upload2" @click="allExport" v-if="selectType==0"
>结果全部导出
</el-button>
<el-button type="primary" icon="search" @click="uploadSMP"
v-if="selectType==1"
>选中上传
</el-button>
<el-button type="primary" icon="search" @click="uploadSMP"
v-if="selectType==1"
>一键上传
</el-button>
<el-button type="primary" icon="el-icon-download" @click="downloadErp"
v-if="selectType==3"
>选中下载
</el-button>
<el-button type="primary" icon="el-icon-download" @click="downloadAllErp"
v-if="selectType==3"
>结果全部下载
</el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="序号" type="index" width="70"></el-table-column>
<el-table-column label="产品编码" prop="code" show-overflow-tooltip></el-table-column>
<el-table-column label="产品名称" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" prop="batchNo" show-overflow-tooltip></el-table-column>
<el-table-column label="仓位" prop="warehouseName" show-overflow-tooltip></el-table-column>
<el-table-column label="货位" prop="spaceName" show-overflow-tooltip></el-table-column>
<el-table-column label="注册证号" prop="registerCertNo" show-overflow-tooltip></el-table-column>
<el-table-column label="生产日期" prop="manufacturingDate" show-overflow-tooltip></el-table-column>
<el-table-column label="失效日期" prop="expirationDate" show-overflow-tooltip></el-table-column>
<el-table-column label="数量" prop="count" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="filterQuery.page"
:limit.sync="filterQuery.limit"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script>
import {
delInvProducts, delAll,inpisDlAll
} from "@/api/thrsys/thrInvProducts";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
import {selectIp} from "@/api/param/systemParamConfig";
import {getOnhands} from "@/api/inventory/onHand.js";
import {exportExcel} from "@/api/thrsys/thrInvProductsExport"
export default {
name: "thrInvProductsSelect",
props: {
selectType: {
type: Object,
required: true,
},
isDownThrSys: {
type: Object,
required: true,
},
},
data() {
return {
filterQuery: {
thrInvProductsEntities:[],
inventoryCode: null,
inventoryName: null,
thirdSys: null,
spec: null,
registerCertNo: null,
manufactory: null,
page: 1,
limit: 100,
filterCount:null,
},
total: 0,
list: [],
thirdSys: [],
thirdSysDetail: null,
fileList: [],
uploadData: {
thirdSys: "thirdId",
},
uploadFileUrl: null,
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
thrInvProductsEntities:[],
inventoryCode: null,
inventoryName: null,
thirdSys: null,
spec: null,
registerCertNo: null,
manufactory: null,
page: 1,
limit: 100,
filterCount:null,
};
this.getList();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
getList() {
this.loading = true;
this.filterQuery.isDownThrSys = this.isDownThrSys;
getOnhands(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
}else {
this.$message.error(response.message);
}
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该产品信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: row.id,
};
delInvProducts(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
clearAll() {
this.$confirm("此操作将清空所有库存产品信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delAll()
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
this.getList();
} else {
this.$message.success(response.message);
}
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
} else {
console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success("文件上传成功,请稍后刷新查看!");
}
},
getBasicThirdSys() {
let query = {
enabled: true,
};
getBasicThirdSys(query)
.then((response) => {
this.thirdSys = response.data.list || [];
this.filterQuery.thirdSys = this.thirdSys[0].thirdId;
this.uploadData.thirdSys = this.filterQuery.thirdSys;
this.getThirdSysDetail();
this.selectSysParam();
this.getList();
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSys
};
selectIp(query).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/invpi/upload";
}
});
},
thirdSysChange() {
this.uploadData.thirdSys = this.filterQuery.thirdSys;
this.getThirdSysDetail();
},
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSys,
key: "invPiUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
selectExport() {
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
this.filterQuery.thrInvProductsEntities.push(obj);
});
this.allExport();
},
allExport() {
exportExcel(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.$message({
type: "success",
message: "导出成功后台正在生成Excel文件请稍后刷新查看",
});
this.$emit("cancelDialog", true);
} else {
this.$message({
type: "error",
message: response.message,
});
}
})
.catch(() => {
this.$message({
type: "error",
message: "上传失败",
});
});
},
downloadErp(){
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
this.filterQuery.thrInvProductsEntities.push(obj);
});
this.downloadAllErp();
},
downloadAllErp(){
inpisDlAll(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.$message.success("提交成功,后台正在下载!")
this.$emit("cancelDialog", true);
} else {
this.$message.error(response.message)
}
})
.catch(() => {
this.$message.error("下载失败!");
});
},
},
components: {},
mounted() {
},
created() {
this.getBasicThirdSys();
},
};
</script>
<style scoped>
</style>
Loading…
Cancel
Save