第三方业务单据代码提交

prod
郑明梁 2 years ago
parent 31441f81cf
commit 2e2b4280ec

@ -0,0 +1,127 @@
import axios from '@/utils/request'
//--------------获取ERP数据-------------------
export function getErpMainOrder(query) {
return axios({
url: "/warehouse/getErpMainOrder",
method: "get",
params: query
});
}
export function getCloudErp(query) {
return axios({
url: "/spms/erpOrder/filter",
method: "get",
params: query
});
}
export function getThirdSysOrder(query) {
return axios({
url: "/udiwms/thirdOrder/filter",
method: "get",
params: query
});
}
export function getErpMainOrderStatus(query) {
return axios({
url: "/warehouse/getErpMainOrderStatus",
method: "get",
params: query
});
}
export function getErpDetailOrder(query) {
return axios({
url: "/warehouse/getErpDetailOrder",
method: "get",
params: query
});
}
export function importErpOrder(query) {
return axios({
url: "/warehouse/importErpOrder",
method: "post",
data: query
});
}
export function combineErpOrder(query) {
return axios({
url: "/warehouse/combineErpOrder",
method: "post",
data: query
});
}
export function deleteErpOrder(query) {
return axios({
url: "/warehouse/deleteErpOrder",
method: "post",
data: query
});
}
export function selectErpOrder(query) {
return axios({
url: "/warehouse/selectErpOrder",
method: "post",
data: query
});
}
export function importErpStock(query) {
return axios({
url: "/warehouse/stockPrint/importErpStock",
method: "post",
data: query
});
}
export function repeatCheck(query) {
return axios({
url: "/warehouse/repeatCheck",
method: "post",
data: query
});
}
export function repeatPrintCheck(query) {
return axios({
url: "/warehouse/repeatPrintCheck",
method: "post",
data: query
});
}
export function dlErpStock(query) {
return axios({
url: "/warehouse/dlErpStock",
method: "get",
params: query
});
}
export function addStockOrder(query) {
return axios({
url: "/udiwms/erpOrder/addStockOrder",
method: "get",
params: query
});
}
export function addReceiveOrder(query) {
return axios({
url: "/udiwms/receive/addStockOrder",
method: "get",
params: query
});
}

@ -0,0 +1,9 @@
import axios from "@/utils/request";
export function getOnhands(query) {
return axios({
url: "/udiwms/inv/getInvProducts",
method: "get",
params: query
});
}

@ -0,0 +1,58 @@
import axios from "@/utils/request";
export function getThrOrders(query) {
return axios({
url: "/udiwms/thrsys/getOrders",
method: "get",
params: query
});
}
export function getThrOrderDetails(query) {
return axios({
url: "/udiwms/thrsys/getOrderDetails",
method: "get",
params: query
});
}
export function delThrOrders(query) {
return axios({
url: "/udiwms/thrsys/delOrder",
method: "post",
data: query
});
}
export function delOrderDetail(query) {
return axios({
url: "/udiwms/thrsys/delOrderDetail",
method: "post",
data: query
});
}
export function delAll(query) {
return axios({
url: "/udiwms/thrsys/order/delAll",
method: "get",
params: query
});
}
export function downloadAll(query) {
return axios({
url: "/udiwms/thrsys/orders/downloadAll",
method: "get",
params: query
});
}
export function orderDownload(query) {
return axios({
url: "/udiwms/thrsys/orders/orderDownload",
method: "post",
data: query
});
}

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

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

@ -0,0 +1,18 @@
import axios from "@/utils/request";
export function inserThrOrderWeb(query) {
return axios({
url: "/udiwms/thrsys/order/insertWeb",
method: "post",
data: query
});
}
export function updateReceive(query) {
return axios({
url: "/udiwms/receive/order/update",
method: "post",
data: query
});
}

@ -0,0 +1,423 @@
<template>
<div>
<el-card class="el-card">
<el-form :inline="true" :model="filterQuery"
class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.billNo"
placeholder="请输入单据号"
clearable
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.corpName"
placeholder="请输入往来单位"
clearable
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.billAction" placeholder="请选择第三方系统单据类型" clearable="true">
<el-option
v-for="item in originTypes"
:key="item.name"
:label="item.name"
:value="item.action">
<span style="float: left;font-size: 13px">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px;margin-left: 10px">{{
item.thirdSysName
}}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<span style="color: #000; margin-left: 10px; margin-right: 6px">单据日期:</span>
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</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
@current-change="handleDetail">
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="第三方单据类型" prop="billType"></el-table-column>
<el-table-column label="单据号" prop="billNo"></el-table-column>
<el-table-column label="往来单位ID" prop="corpId"></el-table-column>
<el-table-column label="往来单位" prop="corpName"
show-overflow-tooltip="true"></el-table-column>
<el-table-column label="单据状态" prop="billFlag"></el-table-column>
<el-table-column label="单据日期" prop="billdate"></el-table-column>
<el-table-column label="操作" width="100px">
<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>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%" border highlight-current-row>
<el-table-column label="序号" type="index" width="120"></el-table-column>
<el-table-column label="产品编码" prop="productId"></el-table-column>
<el-table-column label="产品通用名" prop="productName" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="生产日期" prop="productDate"></el-table-column>
<el-table-column label="失效日期" prop="expireDate"></el-table-column>
<!-- <el-table-column label="单据数量" prop="reCount"></el-table-column>-->
<el-table-column label="单据数量" prop="count"></el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import {delThrOrders, delAll, downloadAll} from "@/api/thrsys/thrOrder";
import {getLocalJoinBusType} from "@/api/basic/busLocalType";
import {getOriginBusType} from "@/api/basic/busOriginType";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
import {selectIp} from "@/api/param/systemParamConfig";
import {getCloudErp,getThirdSysOrder} from "@/api/inout/erpOrder";
export default {
data() {
return {
filterQuery: {
billAction: null,
billNo: "",
originType:null,
thirdSysFk: "",
page: 1,
limit: 10,
corpName: null,
},
total: 0,
thirdSys: [],
thirdSysDetail: null,
busTypes: [],
originTypes:[],
list: [],
detailList: [],
uploadFileUrl: null,
fileList: [],
uploadData: {
thirdSys: "thirdId",
},
loading: false,
actDateRange: [],
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
billNo: "",
thirdSysFk: "",
billFlag: null,
billAction: null,
startDate: null,
endDate: null,
page: 1,
limit: 10,
corpName: null,
};
this.actDateRange = [];
this.getList();
},
getList() {
if (this.filterQuery.thirdSysFk == null) {
this.$message.warning("请先选择第三方系统!")
return;
}
if (this.actDateRange != null) {
this.filterQuery.startDate = this.actDateRange[0];
this.filterQuery.endDate = this.actDateRange[1];
} else {
this.filterQuery.startDate = null;
this.filterQuery.endDate = null;
}
this.loading = true;
getThirdSysOrder(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;
});
},
handleDetail(row) {
this.detailList = row.subErpOrders;
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: row.id,
};
delThrOrders(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(() => {
});
},
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.selectSysParam();
this.getThirdSysDetail();
this.getBusType();
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
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("文件上传成功,请稍后刷新查看!");
}
},
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSysFk
};
selectIp(query).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/pi/upload";
}
});
},
thirdSysChange() {
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.getThirdSysDetail();
},
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk,
key: "orderQueryUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
downloadDatas() {
let query = {
billAction: this.filterQuery.billAction
};
downloadAll(query).then((response) => {
if (response.code == 20000) {
this.$message.success(response.data);
} else {
this.$message.error(response.message);
}
});
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
},
getlocalName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].localName;
}
}
},
getBusType() {
let query = {
enabled: true,
};
getLocalJoinBusType(query)
.then((response) => {
this.busTypes = response.data.list || [];
// this.getList();
})
.catch(() => {
});
getOriginBusType(query)
.then((response) => {
this.originTypes = response.data.list || [];
// this.filterQuery.originType = this.originTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
},
components: {},
mounted() {
},
created() {
this.getBasicThirdSys();
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
},
};
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 25%;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>

@ -0,0 +1,291 @@
<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="操作" fixed="right" 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="thrOrderSelectVisible"
width="85%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="thrOrderSelectVisible"
>
<thrOrderSelect :selectType="selectType" v-on:cancelDialog="cancelDialog"
></thrOrderSelect>
</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/thrOrderExport";
import thrOrderSelect from "./thrOrderSelect";
import axios from "axios";
import {formatDate} from "@/utils/date";
export default {
data() {
return {
filterQuery: {
type: 1,
genKey: null,
status: null,
fromType: null,
page: 1,
limit: 20,
thirdSysFk: null,
},
selectType: 0,
thrOrderSelectVisible: 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,
type: 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.thrOrderSelectVisible = true;
},
uploadSmp() {
this.selectType = 1;
this.thrOrderSelectVisible = true;
},
downloadExcel(row) {
axios.get("./config.json").then(res => {
let baseUrl = res.data.BASE_URL;
let href = baseUrl + "/udiwms/thrOrder/exportLog/download" + "?genKey=" + row.genKey;
let a = document.createElement("a");
var timestamp = formatDate(new Date(), "yyyyMMddhhmmss")
fetch(href)
.then((res) => res.blob())
.then((blob) => {
a.href = URL.createObjectURL(blob);
console.log(a.href);
a.download = "ThirdOrder_" + timestamp + ".UpperIn";
document.body.appendChild(a);
a.click();
this.getList();
});
});
},
cancelDialog(val) {
if (val) {
this.getList();
}
this.thrOrderSelectVisible = false;
},
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: {thrOrderSelect},
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,300 @@
<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="search" @click="exportExcel">Excel</el-button>-->
<el-button type="primary" icon="search" @click="uploadSmp"></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="操作" fixed="right" width="160">
<template slot-scope="scope">
<!--<el-button-->
<!--type="text"-->
<!--size="small"-->
<!--@click.native.stop="downloadExcel(scope.row)"-->
<!--&gt;下载-->
<!--</el-button-->
<!--&gt;-->
<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="thrOrderSelectVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="85%"
v-if="thrOrderSelectVisible"
>
<thrOrderSelect :selectType="selectType" v-on:cancelDialog="cancelDialog"
></thrOrderSelect>
</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/thrOrderExport";
import thrOrderSelect from "./thrOrderSelect";
export default {
data() {
return {
filterQuery: {
genKey: null,
status: null,
fromType: null,
page: 1,
limit: 20,
type: 2,
thirdSysFk: null,
},
loading: false,
selectType: 0,
thrOrderSelectVisible: 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,
type: 2,
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.thrOrderSelectVisible = true;
},
uploadSmp() {
this.selectType = 1;
this.thrOrderSelectVisible = true;
},
downloadExcel(row) {
let href =
"http://127.0.0.1:9991" +
"/udiwms/thrOrder/exportLog/download" +
"?genKey=" + row.genKey;
let a = document.createElement("a");
fetch(href)
.then((res) => res.blob())
.then((blob) => {
// blob
a.href = URL.createObjectURL(blob);
console.log(a.href);
// a.download = ""; //
a.download =
row.filePath.split("/")[
row.filePath.split("/").length - 1
]; // //
document.body.appendChild(a);
a.click();
this.getList();
});
// a.setAttribute("download", "");
// a.setAttribute("href", href);
// a.click();
// window.open(mOrder.exportFilePath);
},
cancelDialog(val) {
if (val) {
this.getList();
}
this.thrOrderSelectVisible = false;
},
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: {thrOrderSelect},
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,466 @@
<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
:action="uploadFileUrl"
multiple
:limit="1"
:data="uploadData"
:show-file-list="false"
:on-success="handleChange"
v-if="this.thirdSysDetail.enabled && this.thirdSysDetail.fromType==1"
: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="downloadOrderss"
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"
:formatter="formatterThirdSys"
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="remark"
show-overflow-tooltip
></el-table-column>
<el-table-column label="操作" fixed="right" 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"
>
<thrOrderImportDetail
:currentRow="currentRow"
></thrOrderImportDetail>
</el-dialog>
<el-dialog
title="下载业务单据"
:visible.sync="thrOrderSelectVisible"
width="85%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="thrOrderSelectVisible"
>
<thrOrderSelect :selectType="selectType" v-on:cancelDialog="cancelDialog" :isDownThrSys="true"
></thrOrderSelect>
</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 axios from "axios";
import {filterLog, deleteLog} from "@/api/thrsys/thrOrderImport";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
import {downloadAll} from "@/api/thrsys/thrOrder";
import {getBussinessType} from "@/api/basic/bussinessType";
import thrOrderImportDetail from "./thrOrderImportDetail";
import thrOrderSelect from "./thrOrderSelect";
import {selectIp} from "@/api/param/systemParamConfig";
export default {
data() {
return {
filterQuery: {
genKey: null,
status: null,
fromType: null,
page: 1,
limit: 20,
thirdSysFk: null,
},
udiImportDetailVisible: false,
checked: false,
list: [],
fileList: [],
detailList: [],
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,
busTypes: [],
thrOrderSelectVisible: false,
};
},
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;
});
},
handleDetailClick(row) {
this.currentRow = row;
console.log(this.currentRow.genKey)
this.udiImportDetailVisible = true;
},
sysChange() {
this.getThirdSysDetail();
// console.log( this.thirdSysDetail.thirdId+"\n"+ this.thirdSysDetail.fromType+"\n"+this.thirdSysDetail.enable);
},
cancelDialog(val) {
this.udiImportDetailVisible = false;
this.thrOrderSelectVisible = false;
if (val) {
this.getList();
}
},
jumpDl() {
window.open(this.templateDlUrl, '_blank');
},
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.BASE_URL;
// this.uploadFileUrl = response + "/udiwms/thrOrder/importLog/upload";
let response2 = res.data.SERVER_IP;
this.templateDlUrl = response2 + "/第三方业务单据导入模板.xlsx";
console.log(res.data.BASE_URL + "\n");
});
},
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSysFk
};
selectIp(query).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/order/upload";
}
});
},
formatterThirdSys(key) {
let data = null;
this.thirdSys.forEach((item, index) => {
if (key.thirdSysFk == item.thirdId) {
data = item.thirdName;
}
});
return data;
},
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("文件上传成功,请稍后刷新查看!");
this.getList();
}
this.fileList = [];
},
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "warning",
2: "danger",
3: "success",
};
return statusMap[status];
},
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk,
key: "orderQueryUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
},
downloadOrderss() {
this.selectType = 3;
this.thrOrderSelectVisible = true;
},
downloadDatas() {
this.$confirm("此操作从第三方系统下载全部业务单据信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
let query = {
billAction: this.filterQuery.billAction,
thirdSysFk: this.filterQuery.thirdSysFk
};
downloadAll(query).then((response) => {
if (response.code == 20000) {
this.$message.success(response.data);
} else {
this.$message.error(response.message);
}
});
});
},
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
})
.catch(() => {
});
},
formatter(row, index) {
if (row.isE == true) {
row.Registrationstate = "已注册"
}
if (row.Registrationstate == false) {
row.Registrationstate = "未注册"
}
return row.Registrationstate
}
},
mounted() {
},
components: {thrOrderImportDetail, thrOrderSelect},
created() {
this.getBasicThirdSys();
this.getBusType();
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,164 @@
<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.billNo" placeholder="请输入UDI编码"></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="billNo"></el-table-column>
<el-table-column label="往来单位ID" prop="corpId"
show-overflow-tooltip="true"></el-table-column>
<el-table-column label="往来单位" prop="corpName"
show-overflow-tooltip="true"></el-table-column>
<el-table-column label="扫码单据类型" prop="billType">
</el-table-column>
<el-table-column label="单据状态" prop="billFlag" width="80" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="单据日期" prop="billdate" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="产品编码" prop="productId" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="产品名称" prop="productName" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="批次号" prop="batchNo" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="生产日期" prop="productDate" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="单据数量" prop="reCount" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="实际数量" prop="count" show-overflow-tooltip="true"></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/thrOrderImport";
export default {
name: "ThrOrderImportDetail",
props: {
currentRow: {
type: Object,
required: true,
},
},
data() {
return {
filterQuery: {
genKey: null,
billNo: 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,
billNo: 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,552 @@
<template>
<div>
<el-card class="el-card">
<el-form :inline="true" :model="filterQuery"
class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.billNo"
placeholder="请输入单据号"
clearable
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input
v-model="filterQuery.corpName"
placeholder="请输入往来单位"
clearable
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.billAction" placeholder="请选择业务类型">
<el-option
v-for="item in originTypes"
:key="item.name"
:label="item.name"
:value="item.action">
<span style="float: left">{{ item.name }}</span>
<!--<span style="float: right; color: #8492a6; font-size: 13px">{{ item.action }}</span>-->
</el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<span style="color: #000; margin-left: 10px; margin-right: 6px">单据日期:</span>
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</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="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="allUploadSMP"
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-row>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row
@selection-change="handleSelectionChange"
@current-change="handleDetail">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="序号" type="index" width="60"></el-table-column>
<el-table-column label="单据号" prop="billNo"></el-table-column>
<el-table-column label="往来单位ID" prop="corpId" width="100"></el-table-column>
<el-table-column label="往来单位" prop="corpName" width="300"
show-overflow-tooltip="true"></el-table-column>
<el-table-column label="第三方单据类型" prop="originType"></el-table-column>
<el-table-column label="扫码单据类型" prop="billType">
<template slot-scope="scope">
<span>{{ geActionName(scope.row.billType) }}</span>
</template>
</el-table-column>
<el-table-column label="单据状态" prop="billFlag" width="80"></el-table-column>
<el-table-column label="单据日期" prop="billdate"></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>
<el-card class="el-card">
<el-table v-loading="loading" :data="detailList" style="width: 100%" border highlight-current-row>
<el-table-column label="序号" type="index" width="120"></el-table-column>
<el-table-column label="产品编码" prop="productId"></el-table-column>
<el-table-column label="产品名称" prop="productName" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip="true"></el-table-column>
<el-table-column label="批次号" prop="batchNo"></el-table-column>
<el-table-column label="生产日期" prop="productDate"></el-table-column>
<el-table-column label="失效日期" prop="expireDate"></el-table-column>
<el-table-column label="单据数量" prop="reCount"></el-table-column>
<el-table-column label="实际数量" prop="count"></el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import {
delThrOrders, delAll, downloadAll, orderDownload
} from "@/api/thrsys/thrOrder";
import {getBussinessType} from "@/api/basic/bussinessType";
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
import {selectIp} from "@/api/param/systemParamConfig";
import {getThirdSysOrder} from "@/api/inout/erpOrder";
import {exportExcel} from "@/api/thrsys/thrOrderExport"
import {orderUpload} from "@/api/thrsys/smp"
import {getOriginBusType} from "@/api/basic/busOriginType";
export default {
name: "ThrOrderSelect",
props: {
selectType: {
type: Object,
required: true,
},
isDownThrSys: {
type: Object,
required: true,
},
},
data() {
return {
filterQuery: {
erpOrderResponses: [],
billNo: "",
thirdSysFk: "",
billFlag: null,
billAction: null,
startDate: null,
endDate: null,
page: 1,
limit: 10,
isDownThrSys: null,
},
total: 0,
thirdSys: [],
thirdSysDetail: null,
busTypes: [],
originTypes: [],
list: [],
detailList: [],
uploadFileUrl: null,
fileList: [],
uploadData: {
thirdSys: "thirdId",
},
loading: false,
multipleSelection: [],
actDateRange: [],
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
erpOrderResponses: [],
billNo: "",
thirdSysFk: "",
billFlag: null,
billAction: null,
startDate: null,
endDate: null,
page: 1,
limit: 10,
isDownThrSys: null,
};
this.actDateRange = [];
this.getList();
},
getList() {
if (this.filterQuery.thirdSysFk == null) {
this.$message.warning("请先选择第三方系统!")
return;
}
if (this.actDateRange != null) {
this.filterQuery.startDate = this.actDateRange[0];
this.filterQuery.endDate = this.actDateRange[1];
} else {
this.filterQuery.startDate = null;
this.filterQuery.endDate = null;
}
this.loading = true;
this.filterQuery.isDownThrSys = this.isDownThrSys;
getThirdSysOrder(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;
});
},
handleDetail(row) {
this.detailList = row.subErpOrders;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
selectExport() {
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
this.filterQuery.erpOrderResponses.push(obj);
});
this.allExport();
},
allExport() {
exportExcel(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.$message({
type: "success",
message: "导出成功后台正在生成Excel文件请稍后刷新查看",
});
} else {
this.$message({
type: "error",
message: response.message,
});
}
this.$emit("cancelDialog", true);
})
.catch(() => {
this.$message({
type: "error",
message: "上传失败",
});
});
},
uploadSMP() {
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
this.filterQuery.erpOrderResponses.push(obj);
});
this.allUploadSMP();
},
allUploadSMP() {
orderUpload(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.$message.success("提交成功,后台正在上传!")
} else {
this.$message.error(response.message)
}
this.$emit("cancelDialog", true);
})
.catch(() => {
this.$message.error("上传失败!");
});
},
downloadErp() {
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
this.filterQuery.erpOrderResponses.push(obj);
});
this.downloadAllErp();
},
downloadAllErp() {
orderDownload(this.filterQuery)
.then((response) => {
if (response.code == 20000) {
this.$message.success("提交成功,后台正在下载!")
} else {
this.$message.error(response.message)
}
this.$emit("cancelDialog", true);
})
.catch(() => {
this.$message.error("下载失败!");
});
},
deleteDialog(row) {
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let dQuery = {
id: row.id,
};
delThrOrders(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(() => {
});
},
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.selectSysParam();
this.getThirdSysDetail();
this.getBusType();
})
.catch(() => {
this.loading = false;
this.list = [];
});
getOriginBusType()
.then((response) => {
this.originTypes = response.data.list || [];
})
.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("文件上传成功,请稍后刷新查看!");
}
},
selectSysParam() {
let query = {
key: "thirdIpUrl",
thirdSysFk: this.filterQuery.thirdSysFk
};
selectIp(query).then((response) => {
if (response.code == 20000) {
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/pi/upload";
}
});
},
thirdSysChange() {
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
this.getThirdSysDetail();
},
getThirdSysDetail() {
let query = {
thirdSysFk: this.filterQuery.thirdSysFk,
key: "orderQueryUrl",
};
filterDetailByKey(query)
.then((response) => {
this.thirdSysDetail = response.data;
})
.catch(() => {
this.loading = false;
this.list = [];
});
},
downloadDatas() {
let query = {
billAction: this.filterQuery.billAction
};
downloadAll(query).then((response) => {
if (response.code == 20000) {
this.$message.success(response.data);
} else {
this.$message.error(response.message);
}
});
},
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
// this.filterQuery.billAction = this.busTypes[0].action;
this.getList();
})
.catch(() => {
});
},
geActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
return action;
},
},
components: {},
mounted() {
},
created() {
let end = new Date();
let start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.actDateRange = [start, end];
this.getBasicThirdSys();
},
};
</script>
<style scoped>
.itemTag {
float: left;
text-align: left;
margin-top: 10px;
width: 25%;
}
.text {
font-size: 13px;
font-family: "Microsoft YaHei";
}
.query-form {
margin-top: 10px;
display: flex;
}
.query-form-item {
display: block !important;
margin-right: 10px;
margin-bottom: 5px;
}
.el-row {
display: flex;
flex-wrap: wrap;
}
.el-col {
border-radius: 4px;
flex-wrap: wrap;
}
</style>
Loading…
Cancel
Save