代码备份

prod
anthonywj 2 years ago
parent cda0a64f3c
commit 5f561a8842

@ -50,3 +50,13 @@ export function updateConfig(query) {
}); });
} }
export function infoByStatus(query) {
return axios({
url: "/spssync/basic/udiinfo/infoByStatus",
method: "post",
data: query,
responseType: 'blob'
});
}

@ -180,6 +180,8 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
}, },
isEntrust: false,
} }
}, },
@ -267,6 +269,7 @@ export default {
this.detailList = response.data.orderDetailEntities || []; this.detailList = response.data.orderDetailEntities || [];
this.formData = response.data.orderEntity; this.formData = response.data.orderEntity;
this.orderQuery = this.formData; this.orderQuery = this.formData;
this.isEntrust = response.data.entrust;
} else { } else {
this.$message.error(response.message); this.$message.error(response.message);
} }
@ -371,6 +374,7 @@ export default {
postAccept() { postAccept() {
let query = { let query = {
orderId: this.orderQuery.billNo, orderId: this.orderQuery.billNo,
entrust: this.isEntrust,
}; };
if (this.reviewType != null && this.reviewType == 2) { if (this.reviewType != null && this.reviewType == 2) {
thirdUpdateStatus(query) thirdUpdateStatus(query)

@ -1022,6 +1022,7 @@ export default {
// //
closeAcceptDialog() { closeAcceptDialog() {
this.acceptOrderVisible = false; this.acceptOrderVisible = false;
this.newAcceptOrderVisible = false;
}, },
// //

@ -18,24 +18,24 @@
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-date-picker v-model="filterQuery.syncTime" type="datetime" format="yyyy-MM-dd HH:mm:ss" <el-date-picker v-model="filterQuery.syncTime" type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择同步时间"> value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择同步时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button-group style="display:flex;"> <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-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="search"></el-button> <el-button type="primary" icon="search" @click="getList"></el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(1)" <!-- <el-button type="primary" icon="search" @click="createScheduleDialog(1)"-->
v-if="configParms.orderScanFinish==1 || configParms.orderUnReceive==1 || configParms.orderUnCheck==1"> <!-- v-if="configParms.orderScanFinish==1 || configParms.orderUnReceive==1 || configParms.orderUnCheck==1">-->
同步单据 <!-- 同步单据-->
</el-button> <!-- </el-button>-->
<!-- <el-button type="primary" icon="search" @click="createScheduleDialog(2)" <!-- <el-button type="primary" icon="search" @click="createScheduleDialog(2)"
v-if="configParms.typeBus==1||configParms.typeScan==1||configParms.typeThird==1"> v-if="configParms.typeBus==1||configParms.typeScan==1||configParms.typeThird==1">
同步单据类型 同步单据类型
</el-button> </el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(3)" v-if="configParms.basicProducts==1||configParms.basicCorp==1||configParms.basicInv==1||configParms.basicThirdProducts==1|| <el-button type="primary" icon="search" @click="createScheduleDialog(3)" v-if="configParms.basicProducts==1||configParms.basicCorp==1||configParms.basicInv==1||configParms.basicThirdProducts==1||
configParms.basicThirdCorp==1||configParms.basicThirdInv==1||configParms.basicThirdBusOrder==1||configParms.sysUser==1">同步基础信息 configParms.basicThirdCorp==1||configParms.basicThirdInv==1||configParms.basicThirdBusOrder==1||configParms.sysUser==1">同步基础信息
</el-button> --> </el-button> -->
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
</el-row> </el-row>
@ -58,24 +58,31 @@
</el-table-column> </el-table-column>
<el-table-column label="开始时间" width="180" prop="startTime" show-overflow-tooltip></el-table-column> <el-table-column label="开始时间" width="180" prop="startTime" show-overflow-tooltip></el-table-column>
<el-table-column label="结束时间" width="180" prop="endTime" show-overflow-tooltip></el-table-column> <el-table-column label="结束时间" width="180" prop="endTime" show-overflow-tooltip></el-table-column>
<el-table-column label="同步文件" prop="cacheFilePath" width="180" show-overflow-tooltip></el-table-column>
<el-table-column label="同步信息" prop="remark" show-overflow-tooltip></el-table-column> <el-table-column label="同步信息" prop="remark" width="180" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" fixed="right" width="160"> <el-table-column label="操作" fixed="right" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click.native.stop="detailDialog(scope.row.id)">详情
</el-button> <el-popconfirm @confirm="downFile(scope.row)" confirm-button-text='' cancel-button-text='' class="mr10"
icon="el-icon-info" icon-color="blck" title="是否确认要下载文件?" v-if="scope.row.cacheFilePath">
<el-button type="text" size="small" slot="reference">下载
</el-button>
</el-popconfirm>
<!-- <el-button type="text" size="small" @click.native.stop="detailDialog(scope.row.id)">详情-->
<!-- </el-button>-->
<el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row.id)">删除 <el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row.id)">删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination :page-size="filterQuery.limit" @current-change="handleCurrentChange" layout="prev, pager, next" <el-pagination :page-size="filterQuery.limit" @current-change="handleCurrentChange" layout="prev, pager, next"
:total="total" :current-page="filterQuery.page"></el-pagination> :total="total" :current-page="filterQuery.page"></el-pagination>
</el-card> </el-card>
<el-dialog title="同步信息" width="25%" :close-on-click-modal="false" :close-on-press-escape="false" <el-dialog title="同步信息" width="25%" :close-on-click-modal="false" :close-on-press-escape="false"
:visible.sync="syncVisible"> :visible.sync="syncVisible">
<span v-text="syncInfo" style="white-space:pre-line;" class="syncInfo"></span> <span v-text="syncInfo" style="white-space:pre-line;" class="syncInfo"></span>
</el-dialog> </el-dialog>
@ -83,291 +90,308 @@
</template> </template>
<script> <script>
import { import {
filterLog, filterLog,
deleteLog, deleteLog,
createSchedule, createSchedule,
findConfig, findConfig,
updateConfig updateConfig
} from "@/api/sync/spsSyncStatus"; } from "@/api/sync/spsSyncStatus";
import store from "@/store"; import store from "@/store";
export default {
data() {
return {
filterQuery: {
id: null,
status: null,
page: 1,
limit: 10,
syncTime: null,
},
list: [],
headers: {},
detailList: [],
thirdSys: [],
thirdSysDetail: null,
total: 0,
currentRow: null,
editQuery: null,
status: {
1: "处理异常",
2: "处理完成",
},
export default { configQuery: {
data() { id: null,
return { typeBus: null,
filterQuery: { typeScan: null,
id: null, typeThird: null,
status: "1", basicProducts: null,
page: 1, basicCorp: null,
limit: 10, basicInv: null,
syncTime: null, basicThirdProducts: null,
}, basicThirdCorp: null,
list: [], basicThirdInv: null,
headers: {}, basicThirdBusOrder: null,
detailList: [], orderScanFinish: null,
thirdSys: [], dbDiProducts: null,
thirdSysDetail: null, downstreamEnable: null,
total: 0, syncTime: null,
currentRow: null, },
editQuery: null, uploadFileUrl: null,
status: { uploadData: {
1: "处理异常", thirdSys: "thirdId",
2: "处理完成", },
}, templateDlUrl: null,
checked: false,
configParms: {},
syncInfo: null,
syncVisible: false
};
},
configQuery: { methods: {
id: null, onReset() {
typeBus: null, this.$router.push({
typeScan: null, path: "",
typeThird: null, });
basicProducts: null, this.filterQuery = {
basicCorp: null, syncTime: null,
basicInv: null, id: null,
basicThirdProducts: null, status: null,
basicThirdCorp: null, page: 1,
basicThirdInv: null, limit: 20,
basicThirdBusOrder: null,
orderScanFinish: null,
dbDiProducts: null,
downstreamEnable: null,
syncTime: null,
},
uploadFileUrl: null,
uploadData: {
thirdSys: "thirdId",
},
templateDlUrl: null,
checked: false,
configParms: {},
syncInfo: null,
syncVisible: false
}; };
this.syncTime = null;
this.getList();
},
getList() {
this.loading = true;
filterLog(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);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
}, },
methods: { getConfig() {
onReset() { findConfig()
this.$router.push({ .then((response) => {
path: "", if (response.code == 20000) {
this.configQuery = response.data;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
}); });
this.filterQuery = { },
syncTime: null, saveConfig() {
id: null, updateConfig(this.configQuery)
status: null, .then((response) => {
page: 1, this.loading = false;
limit: 20, if (response.code == 20000) {
}; this.$message.success("更新成功!");
this.syncTime = null; this.getConfig();
this.getList(); }
}, })
.catch(() => {
this.loading = false;
});
},
search(){ cancelDialog(val) {
this.filterQuery.page=1; this.udiImportDetailVisible = false;
this.thrCorpSelectVisible = false;
if (val) {
this.getList(); this.getList();
}, }
getList() { },
this.loading = true; handleCurrentChange(val) {
filterLog(this.filterQuery) this.filterQuery.page = val;
.then((response) => { this.getList();
this.loading = false; },
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
getConfig() {
findConfig() createScheduleDialog(type) {
.then((response) => { if (this.$isNotBlank(this.filterQuery.syncTime)) {
if (response.code == 20000) { this.$confirm("此操作将从" + this.filterQuery.syncTime + "开始同步最新数据,是否继续", "提示", {
this.configQuery = response.data; confirmButtonText: "确定",
} else { cancelButtonText: "取消",
this.$message.error(response.message); type: "warning",
} })
}) .then(() => {
.catch(() => { this.createSchedule(type);
this.loading = false;
this.list = [];
this.total = 0;
});
},
saveConfig() {
updateConfig(this.configQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("更新成功!");
this.getConfig();
}
}) })
.catch(() => { .catch(() => {
this.loading = false;
}); });
}, } else {
this.createSchedule(type);
}
cancelDialog(val) { },
this.udiImportDetailVisible = false;
this.thrCorpSelectVisible = false;
if (val) {
this.getList();
}
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
createSchedule(type) {
let query = {
createType: type,
syncTime: this.filterQuery.syncTime,
}
createScheduleDialog(type) { createSchedule(query)
if (this.$isNotBlank(this.filterQuery.syncTime)) { .then((response) => {
this.$confirm("此操作将从" + this.filterQuery.syncTime + "开始同步最新数据,是否继续", "提示", { this.loading = false;
confirmButtonText: "确定", if (response.code == 20000) {
cancelButtonText: "取消", this.$message.success("创建成功!");
type: "warning", } else if (response.code == 501) {
}) this.$message.warning(response.message);
.then(() => { } else {
this.createSchedule(type); this.$message.error(response.message);
}
this.getList();
})
.catch(() => {
this.loading = 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(() => {}); .catch(() => {
} else { this.loading = false;
this.createSchedule(type); });
} })
.catch(() => {
}, });
},
createSchedule(type) { downFile(rows) {
let query = { infoByStatus({
createType: type, 'id': rows.id
syncTime: this.filterQuery.syncTime, }).then(res => {
} let blob = new Blob([res])
let fileName = rows.cacheFilePath.substring(rows.cacheFilePath.lastIndexOf('/'))
let link = document.createElement("a")
link.href = window.URL.createObjectURL(blob)
link.download = fileName
link.style.display = 'none'
document.body.appendChild(link)
link.click()
window.URL.revokeObjectURL(link.href)
document.body.removeChild(link)
})
},
createSchedule(query) handleChange(response, files, fileList) {
.then((response) => { console.log(response);
this.loading = false; if (response.code != 20000) {
if (response.code == 20000) { this.$message.error(response.message);
this.$message.success("创建成功!"); this.getList();
} else if (response.code == 501) { } else {
this.$message.warning(response.message); // console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
} else { this.$message.success(response.data);
this.$message.error(response.message); this.getList();
}
this.getList();
})
.catch(() => {
this.loading = 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);
this.getList();
} else {
// console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success(response.data);
this.getList();
}
},
statusFilterType(status) {
const statusMap = {
2: "success",
1: "danger",
};
return statusMap[status];
},
getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {});
},
detailDialog(id) {
this.syncVisible = true;
this.list.forEach(item => {
if (id === item.id) {
this.syncInfo = item.remark;
}
})
} }
}, },
statusFilterType(status) {
mounted() {}, const statusMap = {
components: {}, 2: "success",
created() { 1: "danger",
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
}; };
this.getSyncConfig(); return statusMap[status];
this.getList();
this.getConfig();
}, },
}; getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
},
detailDialog(id) {
this.syncVisible = true;
this.list.forEach(item => {
if (id === item.id) {
this.syncInfo = item.remark;
}
})
}
},
mounted() {
},
components: {},
created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getSyncConfig();
this.getList();
this.getConfig();
},
};
</script> </script>
<style> <style>
.itemTag { .itemTag {
float: left; float: left;
text-align: left; text-align: left;
margin-top: 10px; margin-top: 10px;
width: 100px; width: 100px;
} }
.text { .text {
font-size: 13px; font-size: 13px;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
} }
.el-row { .el-row {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.el-col { .el-col {
border-radius: 4px; border-radius: 4px;
flex-wrap: wrap; flex-wrap: wrap;
} }
.syncInfo { .syncInfo {
font-size: medium; font-size: medium;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
line-height: 25px; line-height: 25px;
} }
</style> </style>

Loading…
Cancel
Save