You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spms-vue/src/views/thrsys/SysUdimsConfig.vue

210 lines
7.5 KiB
Vue

<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="4" class="el-col" style="margin-top: 6px">
<el-checkbox v-model="configQuery.downstreamEnable"></el-checkbox>
</el-col>
<el-col :span="20" class="el-col">
<div>
<span>数据同步轮询时间(单位:分钟):&nbsp;</span>
<el-input
style="width: 100px"
size="small"
type="number"
v-model="configQuery.syncTime"
splaceholder="请输入内容"
></el-input>
</div>
</el-col>
</el-row>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
单据类型
</template>
<el-checkbox v-model="configQuery.typeBus">业务单据类型</el-checkbox>
<el-checkbox v-model="configQuery.typeScan">扫码单据类型</el-checkbox>
<el-checkbox v-model="configQuery.typeThird">第三方单据类型</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
基础信息
</template>
<el-checkbox v-model="configQuery.basicProducts">耗材字典</el-checkbox>
<el-checkbox v-model="configQuery.basicCorp">往来单位字典</el-checkbox>
<el-checkbox v-model="configQuery.basicInv">仓库字典</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdProducts">第三方产品信息</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdCorp">第三方往来信息</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdInv">第三方仓库信息</el-checkbox>
<el-checkbox v-model="configQuery.basicThirdBusOrder">第三方业务单据</el-checkbox>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
国家库DI数据
</template>
<el-checkbox v-model="configQuery.dbDiProducts">DI产品信息</el-checkbox>
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="" :column="1" :size="100" style="margin-top: 30px" border>
<el-descriptions-item label="单据(单据类型)" label-style="width: 150px">
<el-checkbox-group v-model="checkedBusTypes" @change="handleCheckedChange" >
<el-checkbox
style="padding-top: 10px"
v-for="busType in busTypes" :label="busType" :key="busType.action"
:value="busType.action">{{ busType.name }}
</el-checkbox>
</el-checkbox-group>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
单据(单据状态)
</template>
<el-checkbox v-model="configQuery.orderUnCheck">待校验单据</el-checkbox>
<el-checkbox v-model="configQuery.orderUnReceive">未验收单据</el-checkbox>
<el-checkbox v-model="configQuery.orderScanFinish"></el-checkbox>
</el-descriptions-item>
</el-descriptions>
</el-card>
</template>
<script>
import {findConfig, updateConfig} from "@/api/thrsys/spsSyncStatus";
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,
basicCorp: null,
basicInv: null,
basicThirdProducts: null,
basicThirdCorp: null,
basicThirdInv: null,
basicThirdBusOrder: null,
orderScanFinish: null,
dbDiProducts: null,
downstreamEnable: null,
syncTime: null,
orderUnCheck: null,
orderUnReceive: null,
busTypes: [],
},
checkedBusTypes: [],
busTypes: [],
}
},
methods: {
getConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
// debugger
this.configQuery = response.data;
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]);
}
}
}
}
console.log(this.checkedBusTypes);
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
saveConfig() {
if (this.checkedBusTypes != null) {
this.configQuery.busTypes = [];
for (let i = 0; i < this.checkedBusTypes.length; i++) {
this.configQuery.busTypes.push(this.checkedBusTypes[i].action);
}
}
updateConfig(this.configQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("更新成功!");
this.getConfig();
}
})
.catch(() => {
this.loading = false;
});
},
handleCheckedChange() {
},
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.getConfig();
})
.catch(() => {
});
},
},
created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getBusType();
},
}
</script>
<style scoped>
</style>