同步问题

ywj_dev
anthonywj 2 years ago
parent ed3d229a1b
commit c42d1b5b55

@ -9,13 +9,13 @@ ENV = 'production'
# VUE_APP_BASE_API = 'http://101.43.77.55:9150/UDI_SPMS_SERVER/' # VUE_APP_BASE_API = 'http://101.43.77.55:9150/UDI_SPMS_SERVER/'
# VUE_APP_BASE_API = 'http://r.jiyuudims.cloud:5004/UDI_SPMS_SERVER/' # VUE_APP_BASE_API = 'http://r.jiyuudims.cloud:5004/UDI_SPMS_SERVER/'
# 吴总测试服务器 # 吴总测试服务器
# VUE_APP_BASE_API = 'http://116.204.106.103:9150/UDI_SPMS_SERVER/' VUE_APP_BASE_API = 'http://116.204.106.103:9150/UDI_SPMS_SERVER/'
# 平潭 # 平潭
# VUE_APP_BASE_API = 'http://121.204.169.96:9150/UDI_SPMS_SERVER/' # VUE_APP_BASE_API = 'http://121.204.169.96:9150/UDI_SPMS_SERVER/'
# 文明点 # 文明点
VUE_APP_BASE_API = 'http://192.168.0.62:9150/UDI_SPMS_SERVER/' # VUE_APP_BASE_API = 'http://192.168.0.62:9150/UDI_SPMS_SERVER/'
# 应用访问路径 例如使用前缀 /admin/ # 应用访问路径 例如使用前缀 /admin/
VUE_APP_CONTEXT_PATH = '/UDI_SPMS_CLIENT/' VUE_APP_CONTEXT_PATH = '/UDI_SPMS_CLIENT/'

@ -1,172 +1,169 @@
<template> <template>
<div> <div>
<el-card> <el-card>
<el-form :inline="true" :model="query" class="query-form" size="mini"> <el-form :inline="true" :model="query" class="query-form" size="mini">
<el-row> <el-row>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.id" placeholder="记录ID"></el-input> <el-input v-model="filterQuery.id" placeholder="记录ID"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="filterQuery.status" placeholder="处理状态"> <el-select v-model="filterQuery.status" placeholder="处理状态">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option label="等待处理" value="0"></el-option> <el-option label="等待处理" value="0"></el-option>
<el-option label="已处理" value="1"></el-option> <el-option label="已处理" value="1"></el-option>
<el-option label="异常" value="2"></el-option> <el-option label="异常" value="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-date-picker <el-date-picker
v-model="syncTime" v-model="syncTime"
type="datetime" type="datetime"
format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择同步时间"> 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="getList"></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)"
:disabled="!configParms.orderScanFinish&& !configParms.orderUnReceive&& !configParms.orderUnCheck" :disabled="!configParms.orderScanFinish&& !configParms.orderUnReceive&& !configParms.orderUnCheck"
>同步单据 >同步单据
</el-button> </el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(2)" <el-button type="primary" icon="search" @click="createScheduleDialog(2)"
:disabled="!configParms.typeBus&& !configParms.typeScan&& !configParms.typeThird"> :disabled="!configParms.typeBus&& !configParms.typeScan&& !configParms.typeThird">
同步单据类型 同步单据类型
</el-button> </el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(3)" <el-button type="primary" icon="search" @click="createScheduleDialog(3)"
:disabled="!configParms.basicProducts&& !configParms.basicCorp&& :disabled="!configParms.basicProducts&& !configParms.basicCorp&&
!configParms.basicInv&&!configParms.basicThirdProducts&& !configParms.basicThirdCorp&& !configParms.basicThirdInv !configParms.basicInv&&!configParms.basicThirdProducts&& !configParms.basicThirdCorp&& !configParms.basicThirdInv
&& !configParms.basicThirdBusOrder&& !configParms.sysUser" && !configParms.basicThirdBusOrder&& !configParms.sysUser"
>同步基础信息 >同步基础信息
</el-button> </el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(4)" <el-button type="primary" icon="search" @click="createScheduleDialog(4)"
:disabled="!configParms.dbDiProducts">同步国家库DI数据 :disabled="!configParms.dbDiProducts">同步国家库DI数据
</el-button> </el-button>
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="list" :data="list"
style="width: 100%" style="width: 100%"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="任务ID"
prop="id"
width="140"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="任务类型"
prop="type"
width="140"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="中继服务状态"
prop="status"
width="140"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag
:type="statusFilterType(scope.row.status)"
>{{ status[scope.row.status] }}
</el-tag
> >
<el-table-column label="序号" type="index"></el-table-column> </template>
<el-table-column </el-table-column>
label="任务ID" <el-table-column
prop="id" label="管理系统状态"
width="140" prop="receiveStatus"
show-overflow-tooltip width="140"
></el-table-column> show-overflow-tooltip
<el-table-column
label="任务类型"
prop="idDatas"
width="140"
show-overflow-tooltip
>
<template slot-scope="scope">
<span>{{ type[scope.row.idDatas] }}</span>
</template>
</el-table-column>
<el-table-column
label="中继服务状态"
prop="status"
width="140"
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="receiveStatus"
width="140"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-tag
:type="wmsFilterType(scope.row.receiveStatus)"
>{{ wmsstatus[scope.row.receiveStatus] }}
</el-tag
>
</template>
</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="同步信息"
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="detailDialog(scope.row.id)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="filterQuery.page"
></el-pagination>
</el-card>
<el-dialog
title="同步信息"
width="25%"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="syncVisible"
> >
<span v-text="syncInfo" style="white-space:pre-line;" class="syncInfo"></span>
</el-dialog>
</div> <template slot-scope="scope">
<el-tag
:type="wmsFilterType(scope.row.receiveStatus)"
>{{ wmsstatus[scope.row.receiveStatus] }}
</el-tag
>
</template>
</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="同步信息"
prop="cacheFilePath"
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="detailDialog(scope.row.id)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="filterQuery.page"
></el-pagination>
</el-card>
<el-dialog
title="同步信息"
width="25%"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="syncVisible"
>
<span v-text="syncInfo" style="white-space:pre-line;" class="syncInfo"></span>
</el-dialog>
</div>
</template> </template>
<script> <script>
@ -174,315 +171,315 @@ import {filterLog, deleteLog, createSchedule, findConfig, updateConfig} from "..
import store from "@/store"; import store from "@/store";
export default { export default {
data() { data() {
return { return {
filterQuery: { filterQuery: {
id: null, id: null,
status: "0", status: "0",
page: 1, page: 1,
limit: 10, limit: 10,
syncTime: null, syncTime: null,
}, },
list: [], list: [],
headers: {}, headers: {},
detailList: [], detailList: [],
thirdSys: [], thirdSys: [],
thirdSysDetail: null, thirdSysDetail: null,
total: 0, total: 0,
currentRow: null, currentRow: null,
editQuery: null, editQuery: null,
type: { type: {
"AutoDownloadOrder": "扫码单据", "AutoDownloadOrder": "扫码单据",
"AutoDownloadBusType": "单据类型", "AutoDownloadBusType": "单据类型",
"AutoDownloadAllData": "基础信息", "AutoDownloadAllData": "基础信息",
"AutoDownloadDiProducts": "国家库DI数据" "AutoDownloadDiProducts": "国家库DI数据"
}, },
status: { status: {
0: "等待处理", 0: "等待处理",
1: "处理完成", 1: "处理完成",
2: "处理异常", 2: "处理异常",
}, },
wmsstatus: { wmsstatus: {
"处理成功": "处理成功", "处理成功": "处理成功",
"": "未处理", "": "未处理",
null: "未处理", null: "未处理",
}, },
configQuery: { configQuery: {
id: null, id: null,
typeBus: null, typeBus: null,
typeScan: null, typeScan: null,
typeThird: null, typeThird: null,
basicProducts: null, basicProducts: null,
basicCorp: null, basicCorp: null,
basicInv: null, basicInv: null,
basicThirdProducts: null, basicThirdProducts: null,
basicThirdCorp: null, basicThirdCorp: null,
basicThirdInv: null, basicThirdInv: null,
basicThirdBusOrder: null, basicThirdBusOrder: null,
orderScanFinish: null, orderScanFinish: null,
dbDiProducts: null, dbDiProducts: null,
downstreamEnable: null, downstreamEnable: null,
}, },
uploadFileUrl: null, uploadFileUrl: null,
uploadData: { uploadData: {
thirdSys: "thirdId", thirdSys: "thirdId",
}, },
templateDlUrl: null, templateDlUrl: null,
checked: false, checked: false,
syncTime: null, syncTime: null,
configParms: {}, configParms: {},
syncInfo: null, syncInfo: null,
syncVisible: false syncVisible: false
}; };
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
id: null,
status: null,
page: 1,
limit: 20,
};
this.syncTime = null;
this.getList();
},
getList() {
this.loading = true;
this.filterQuery.syncTime = this.syncTime;
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;
});
},
saveConfig() {
updateConfig(this.configQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("更新成功!");
this.getConfig();
}
})
.catch(() => {
this.loading = false;
});
},
cancelDialog(val) {
this.udiImportDetailVisible = false;
this.thrCorpSelectVisible = false;
if (val) {
this.getList();
}
}
,
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
}
,
createScheduleDialog(type) {
if (this.$isNotBlank(this.syncTime)) {
this.$confirm("此操作将从" + this.syncTime + "开始同步最新数据,是否继续", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.createSchedule(type);
})
.catch(() => {
});
} else {
this.createSchedule(type);
}
},
createSchedule(type) {
let query = {
createType: type,
syncTime: this.syncTime,
}
createSchedule(query)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("创建成功!");
} else if (response.code == 501) {
this.$alert(response.message, '提示', {
confirmButtonText: '确定',
type: "warning",
callback: action => {
}
}); });
this.filterQuery = {
id: null, } else {
status: null, this.$message.error(response.message);
page: 1, }
limit: 20, this.getList();
})
}; .catch(() => {
this.syncTime = null; this.loading = false;
this.getList(); });
}, },
getList() { deleteDialog(rowId) {
this.loading = true; this.$confirm("此操作将删除该任务信息, 是否继续?", "提示", {
this.filterQuery.syncTime = this.syncTime; confirmButtonText: "确定",
filterLog(this.filterQuery) cancelButtonText: "取消",
.then((response) => { type: "warning",
this.loading = false; })
if (response.code == 20000) { .then(() => {
this.list = response.data.list || []; let dQuery = {
this.total = response.data.total || 0; id: rowId,
} else { };
this.$message.error(response.message); deleteLog(dQuery)
} .then((response) => {
}) this.loading = false;
.catch(() => { if (response.code == 20000) {
this.loading = false; this.$message.success("删除成功");
this.list = []; } else {
this.total = 0;
});
},
getConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configQuery = response.data;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
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(() => {
this.loading = false;
});
},
cancelDialog(val) {
this.udiImportDetailVisible = false;
this.thrCorpSelectVisible = false;
if (val) {
this.getList();
}
}
,
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
}
,
createScheduleDialog(type) {
if (this.$isNotBlank(this.syncTime)) {
this.$confirm("此操作将从" + this.syncTime + "开始同步最新数据,是否继续", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.createSchedule(type);
})
.catch(() => {
});
} else {
this.createSchedule(type);
}
},
createSchedule(type) {
let query = {
createType: type,
syncTime: this.syncTime,
}
createSchedule(query)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("创建成功!");
} else if (response.code == 501) {
this.$alert(response.message, '提示', {
confirmButtonText: '确定',
type: "warning",
callback: action => {
}
});
} else {
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(() => {
this.loading = false;
});
})
.catch(() => {
});
}
,
handleChange(response, files, fileList) {
if (response.code != 20000) {
this.$message.error(response.message); this.$message.error(response.message);
this.getList(); }
} else { this.getList();
this.$message.success(response.data);
this.getList();
}
}
,
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
};
return statusMap[status];
},
wmsFilterType(status) {
const statusMap = {
"未处理": "warning",
"处理成功": "success",
};
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;
}
}) })
} .catch(() => {
this.loading = false;
});
})
.catch(() => {
});
}
,
handleChange(response, files, fileList) {
if (response.code != 20000) {
this.$message.error(response.message);
this.getList();
} else {
this.$message.success(response.data);
this.getList();
}
}
,
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
};
return statusMap[status];
}, },
wmsFilterType(status) {
mounted() { const statusMap = {
"未处理": "warning",
"处理成功": "success",
};
return statusMap[status];
}, },
components: {},
created() {
this.headers = { getSyncConfig() {
ADMIN_ID: store.getters.adminId, findConfig()
ADMIN_TOKEN: store.getters.token, .then((response) => {
}; if (response.code == 20000) {
this.getSyncConfig(); this.configParms = response.data;
this.getList(); }
this.getConfig(); })
.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>

@ -41,13 +41,10 @@
<el-table-column <el-table-column
label="任务类型" label="任务类型"
prop="idDatas" prop="type"
width="140" width="140"
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope">
<span>{{ type[scope.row.idDatas] }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="状态" label="状态"

Loading…
Cancel
Save