同步扫码单据状态默认未已审核

ywj_dev
anthonywj 2 years ago
parent 06b298d6ed
commit e6c68ecb49

@ -1,243 +1,245 @@
<template>
<el-card>
<el-descriptions class="margin-top" title="数据同步设置" :column="1" :size="100" border>
<template slot="extra">
<el-button type="primary" size="small" @click="saveConfig()"></el-button>
</template>
<el-descriptions-item>
<template slot="label">
同步服务
</template>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="6" class="el-col">
<el-switch
v-model="configQuery.downstreamEnable"
active-text="是否启用数据同步">
</el-switch>
</el-col>
<el-col :span="14" class="el-col">
<div>
<span style="color: red;">说明:&nbsp;修改同步参数时,请关闭数据同步服务 </span>
</div>
</el-col>
</el-row>
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="同步至UDI管理系统基础数据" :column="1" :size="100" style="margin-top: 40px"
border>
<el-descriptions-item>
<template slot="label">
轮询时间设置
</template>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="8" class="el-col">
<div>
<span>数据同步轮询时间(单位:分钟):&nbsp;</span>
<el-input
style="width: 100px"
size="small"
type="number"
v-model="configQuery.syncTime" :disabled="configQuery.downstreamEnable"
splaceholder="请输入内容"
></el-input>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div>
<span>延迟执行(单位:分钟):&nbsp;</span>
<el-input
:disabled="configQuery.downstreamEnable"
style="width: 40%;"
v-model="configQuery.delaySyncTime"
>
</el-input>
</div>
</el-col>
</el-row>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
运行参数
</template>
<el-checkbox v-model="configQuery.entrustAction" :disabled="configQuery.downstreamEnable">
</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
单据类型
</template>
<el-checkbox v-model="configQuery.typeBus" :disabled="configQuery.downstreamEnable"></el-checkbox>
<el-checkbox v-model="configQuery.typeScan" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.typeThird" :disabled="configQuery.downstreamEnable">
</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
基础信息
</template>
<el-checkbox v-model="configQuery.sysUser" :disabled="configQuery.downstreamEnable"></el-checkbox>
<el-checkbox v-model="configQuery.basicProducts" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicCorp" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicInv" :disabled="configQuery.downstreamEnable"></el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
第三方基础信息
</template>
<el-checkbox v-model="configQuery.basicThirdProducts" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdCorp" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdInv" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdBusOrder" :disabled="configQuery.downstreamEnable">
</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
国家库DI数据
</template>
<el-checkbox v-model="configQuery.dbDiProducts" :disabled="configQuery.downstreamEnable">DI
</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
首营资质证书
</template>
<el-checkbox v-model="configQuery.companyCert" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.manufacturerCert" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.productCert" :disabled="configQuery.downstreamEnable">
</el-checkbox>
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="同步至UDI管理系统单据" :column="1" :size="100" style="margin-top: 30px"
border>
<el-descriptions-item>
<template slot="label">
轮询时间设置
</template>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="8" class="el-col">
<div>
<span>数据同步轮询时间(单位:分钟):&nbsp;</span>
<el-input
style="width: 100px"
size="small"
type="number"
v-model="configQuery.orderSyncTime" :disabled="configQuery.downstreamEnable"
splaceholder="请输入内容"
></el-input>
</div>
</el-col>
<!-- <el-col :span="8" class="el-col">-->
<!-- <div>-->
<!-- <span>开始时间:&nbsp;</span>-->
<!-- <el-time-picker-->
<!-- :disabled="configQuery.downstreamEnable"-->
<!-- v-model="configQuery.orderSyncStart"-->
<!-- placeholder="开始时间">-->
<!-- </el-time-picker>-->
<!-- </div>-->
<!-- </el-col>-->
</el-row>
</el-descriptions-item>
<el-descriptions-item label="单据(单据类型)" label-style="width: 150px">
<div style="float: right;margin-bottom: 10px;margin-right: 25px">
<el-button type="primary" size="small" @click="addBusTypeDialog()"
:disabled="configQuery.downstreamEnable">添加扫码单据类型
</el-button>
</div>
<el-table :data="checkedBusTypes" border style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="单据类型" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="单据类型代码" prop="action" show-overflow-tooltip></el-table-column>
<el-table-column width="250" label="单据状态">
<template slot-scope="scope">
<el-select v-model="scope.row.orderStatus" placeholder="请选择单据状态">
<el-option label="待校验" :value=3 >待校验</el-option>
<el-option label="待核对" :value=5>待核对</el-option>
<el-option label="待审核" :value=10>待审核</el-option>
<el-option label="已审核" :value=7>已审核</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" :disabled="configQuery.downstreamEnable" @click.native="remveBus(scope.$index, scope.row)">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-descriptions-item>
</el-descriptions>
<el-dialog
title="添加扫码单据类型"
:visible.sync="addBusDialogVisible"
width="55%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="addBusDialogVisible"
>
<div style="float: right;margin-bottom: 10px;margin-right: 25px">
<el-button type="primary" size="small" @click="addBusType()"></el-button>
<el-card>
<el-descriptions class="margin-top" title="数据同步设置" :column="1" :size="100" border>
<template slot="extra">
<el-button type="primary" size="small" @click="saveConfig()"></el-button>
</template>
<el-descriptions-item>
<template slot="label">
同步服务
</template>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="6" class="el-col">
<el-switch
v-model="configQuery.downstreamEnable"
active-text="是否启用数据同步">
</el-switch>
</el-col>
<el-col :span="14" class="el-col">
<div>
<span style="color: red;">说明:&nbsp;修改同步参数时,请关闭数据同步服务 </span>
</div>
</el-col>
</el-row>
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="同步至UDI管理系统基础数据" :column="1" :size="100" style="margin-top: 40px"
border>
<el-descriptions-item>
<template slot="label">
轮询时间设置
</template>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="8" class="el-col">
<div>
<span>数据同步轮询时间(单位:分钟):&nbsp;</span>
<el-input
style="width: 100px"
size="small"
type="number"
v-model="configQuery.syncTime" :disabled="configQuery.downstreamEnable"
splaceholder="请输入内容"
></el-input>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div>
<span>延迟执行(单位:分钟):&nbsp;</span>
<el-input
:disabled="configQuery.downstreamEnable"
style="width: 40%;"
v-model="configQuery.delaySyncTime"
>
</el-input>
</div>
</el-col>
</el-row>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
运行参数
</template>
<el-checkbox v-model="configQuery.entrustAction" :disabled="configQuery.downstreamEnable">
</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
单据类型
</template>
<el-checkbox v-model="configQuery.typeBus" :disabled="configQuery.downstreamEnable"></el-checkbox>
<el-checkbox v-model="configQuery.typeScan" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.typeThird" :disabled="configQuery.downstreamEnable">
</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
基础信息
</template>
<el-checkbox v-model="configQuery.sysUser" :disabled="configQuery.downstreamEnable"></el-checkbox>
<el-checkbox v-model="configQuery.basicProducts" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicCorp" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicInv" :disabled="configQuery.downstreamEnable"></el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
第三方基础信息
</template>
<el-checkbox v-model="configQuery.basicThirdProducts" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdCorp" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdInv" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdBusOrder" :disabled="configQuery.downstreamEnable">
</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
国家库DI数据
</template>
<el-checkbox v-model="configQuery.dbDiProducts" :disabled="configQuery.downstreamEnable">DI
</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
首营资质证书
</template>
<el-checkbox v-model="configQuery.companyCert" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.manufacturerCert" :disabled="configQuery.downstreamEnable">
</el-checkbox>
<el-checkbox v-model="configQuery.productCert" :disabled="configQuery.downstreamEnable">
</el-checkbox>
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="同步至UDI管理系统单据" :column="1" :size="100" style="margin-top: 30px"
border>
<el-descriptions-item>
<template slot="label">
轮询时间设置
</template>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="8" class="el-col">
<div>
<span>数据同步轮询时间(单位:分钟):&nbsp;</span>
<el-input
style="width: 100px"
size="small"
type="number"
v-model="configQuery.orderSyncTime" :disabled="configQuery.downstreamEnable"
splaceholder="请输入内容"
></el-input>
</div>
<el-table
:data="busTypes"
border
style="width: 100%"
@selection-change="handleCheckedChange"
>
<el-table-column type="selection" width="55" :selectable="checkSelectable"></el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="单据类型"
prop="name"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="单据类型代码"
prop="action"
show-overflow-tooltip
></el-table-column>
</el-table>
<el-pagination
:page-size="busQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="busQuery.page"
></el-pagination>
</el-dialog>
</el-card>
</el-col>
<!-- <el-col :span="8" class="el-col">-->
<!-- <div>-->
<!-- <span>开始时间:&nbsp;</span>-->
<!-- <el-time-picker-->
<!-- :disabled="configQuery.downstreamEnable"-->
<!-- v-model="configQuery.orderSyncStart"-->
<!-- placeholder="开始时间">-->
<!-- </el-time-picker>-->
<!-- </div>-->
<!-- </el-col>-->
</el-row>
</el-descriptions-item>
<el-descriptions-item label="单据(单据类型)" label-style="width: 150px">
<div style="float: right;margin-bottom: 10px;margin-right: 25px">
<el-button type="primary" size="small" @click="addBusTypeDialog()"
:disabled="configQuery.downstreamEnable">添加扫码单据类型
</el-button>
</div>
<el-table :data="checkedBusTypes" border style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="单据类型" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="单据类型代码" prop="action" show-overflow-tooltip></el-table-column>
<el-table-column width="250" label="单据状态">
<template slot-scope="scope">
<el-select v-model="scope.row.orderStatus" placeholder="请选择单据状态">
<el-option label="待校验" :value=3>待校验</el-option>
<el-option label="待核对" :value=5>待核对</el-option>
<el-option label="待审核" :value=10>待审核</el-option>
<el-option label="已审核" :value=7>已审核</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" :disabled="configQuery.downstreamEnable"
@click.native="remveBus(scope.$index, scope.row)">移除
</el-button>
</template>
</el-table-column>
</el-table>
</el-descriptions-item>
</el-descriptions>
<el-dialog
title="添加扫码单据类型"
:visible.sync="addBusDialogVisible"
width="55%"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="addBusDialogVisible"
>
<div style="float: right;margin-bottom: 10px;margin-right: 25px">
<el-button type="primary" size="small" @click="addBusType()"></el-button>
</div>
<el-table
:data="busTypes"
border
style="width: 100%"
@selection-change="handleCheckedChange"
>
<el-table-column type="selection" width="55" :selectable="checkSelectable"></el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="单据类型"
prop="name"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="单据类型代码"
prop="action"
show-overflow-tooltip
></el-table-column>
</el-table>
<el-pagination
:page-size="busQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="busQuery.page"
></el-pagination>
</el-dialog>
</el-card>
</template>
<script>
@ -246,167 +248,168 @@ import store from "@/store";
import {getBussinessType} from "@/api/basic/bussinessType";
export default {
name: "SysUdimsConfig",
data() {
return {
configQuery: {
id: null,
typeBus: null,
typeScan: null,
typeThird: null,
basicProducts: null,
sysUser: null,
basicCorp: null,
basicInv: null,
basicThirdProducts: null,
basicThirdCorp: null,
basicThirdInv: null,
basicThirdBusOrder: null,
orderScanFinish: null,
dbDiProducts: null,
downstreamEnable: null,
syncTime: null,
delaySyncTime: null,
orderUnCheck: null,
orderUnReceive: null,
busTypes: [],
basicSyncStart: null,
orderSyncTime: null,
orderSyncStart: null,
entrustAction: null,
unCheckCert: null,
checkedCert: null,
companyCert: null,
manufacturerCert: null,
productCert: null,
},
checkedBusTypes: [],
busQuery: {
page: 1,
limit: 10,
},
busTypes: [],
multipleSelection: [],
addBusDialogVisible: false,
total: 0,
name: "SysUdimsConfig",
data() {
return {
configQuery: {
id: null,
typeBus: null,
typeScan: null,
typeThird: null,
basicProducts: null,
sysUser: null,
basicCorp: null,
basicInv: null,
basicThirdProducts: null,
basicThirdCorp: null,
basicThirdInv: null,
basicThirdBusOrder: null,
orderScanFinish: null,
dbDiProducts: null,
downstreamEnable: null,
syncTime: null,
delaySyncTime: null,
orderUnCheck: null,
orderUnReceive: null,
busTypes: [],
basicSyncStart: null,
orderSyncTime: null,
orderSyncStart: null,
entrustAction: null,
unCheckCert: null,
checkedCert: null,
companyCert: null,
manufacturerCert: null,
productCert: null,
},
checkedBusTypes: [],
busQuery: {
page: 1,
limit: 10,
},
busTypes: [],
multipleSelection: [],
addBusDialogVisible: false,
total: 0,
}
},
methods: {
getConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configQuery = response.data;
this.checkedBusTypes = this.configQuery.busTypes;
if (this.configQuery.busTypes != null) {
// for (let i = 0; i < this.configQuery.busTypes.length; i++) {
//
// for (let k = 0; k < this.busTypes.length; k++) {
// if (this.busTypes[k].action == this.configQuery.busTypes[i]) {
// this.checkedBusTypes.push(this.busTypes[k]);
// this.busTypes[k].isSelect = true;
// }
// }
// }
}
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
saveConfig() {
this.$confirm('是否确认修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true,
}).then(() => {
if (this.checkedBusTypes != null) {
this.configQuery.busTypes = this.checkedBusTypes;
// for (let i = 0; i < this.checkedBusTypes.length; i++) {
// this.configQuery.busTypes.push(this.checkedBusTypes);
// }
}
updateConfig(this.configQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("修改成功!");
this.getConfig();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
}).catch(() => {
});
},
handleCheckedChange(val) {
this.multipleSelection = val;
},
getBusType() {
getBussinessType(this.busQuery)
.then((response) => {
this.busTypes = response.data.list || [];
this.total = response.data.total || 0;
// this.getConfig();
})
.catch(() => {
});
},
addBusTypeDialog() {
this.addBusDialogVisible = true;
this.multipleSelection = [];
},
addBusType() {
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
obj.outChange = false;
obj.orderStatus = 7;
let isPut = true;
for (let i = 0; i < this.checkedBusTypes.length; i++) {
if (this.checkedBusTypes[i].action == obj.action) {
isPut = false;
}
}
if (isPut)
this.checkedBusTypes.push(obj);
});
this.addBusDialogVisible = false;
},
remveBus(index, row) {
this.checkedBusTypes.splice(index, 1);
},
methods: {
getConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configQuery = response.data;
this.checkedBusTypes = this.configQuery.busTypes;
if (this.configQuery.busTypes != null) {
// for (let i = 0; i < this.configQuery.busTypes.length; i++) {
//
// for (let k = 0; k < this.busTypes.length; k++) {
// if (this.busTypes[k].action == this.configQuery.busTypes[i]) {
// this.checkedBusTypes.push(this.busTypes[k]);
// this.busTypes[k].isSelect = true;
// }
// }
// }
}
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
saveConfig() {
this.$confirm('是否确认修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true,
}).then(() => {
if (this.checkedBusTypes != null) {
this.configQuery.busTypes = this.checkedBusTypes;
// for (let i = 0; i < this.checkedBusTypes.length; i++) {
// this.configQuery.busTypes.push(this.checkedBusTypes);
// }
}
updateConfig(this.configQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("修改成功!");
this.getConfig();
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
}).catch(() => {
});
},
handleCheckedChange(val) {
this.multipleSelection = val;
},
getBusType() {
getBussinessType(this.busQuery)
.then((response) => {
this.busTypes = response.data.list || [];
this.total = response.data.total || 0;
// this.getConfig();
})
.catch(() => {
});
},
addBusTypeDialog() {
this.addBusDialogVisible = true;
this.multipleSelection = [];
},
addBusType() {
var selectData = this.multipleSelection;
selectData.forEach((obj) => {
obj.outChange = false;
let isPut = true;
for (let i = 0; i < this.checkedBusTypes.length; i++) {
if (this.checkedBusTypes[i].action == obj.action) {
isPut = false;
}
}
if (isPut)
this.checkedBusTypes.push(obj);
});
this.addBusDialogVisible = false;
},
remveBus(index, row) {
this.checkedBusTypes.splice(index, 1);
},
checkSelectable(row) {
return !row.isSelect;
},
handleCurrentChange(val) {
this.busQuery.page = val;
this.getBusType();
},
checkSelectable(row) {
return !row.isSelect;
},
created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getConfig();
this.getBusType();
handleCurrentChange(val) {
this.busQuery.page = val;
this.getBusType();
},
},
created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getConfig();
this.getBusType();
},
}
</script>

Loading…
Cancel
Save