wanggang
1 year ago
22 changed files with 330 additions and 512 deletions
@ -1,127 +0,0 @@ |
|||
import version from "../version.js"; |
|||
import compareSchema from "./compare.js"; |
|||
|
|||
const stateName = { |
|||
title: "状态", |
|||
type: "string", |
|||
input: "select", |
|||
clearable: true, |
|||
options: [ |
|||
{ label: "执行完成(任务成功)", value: "Succeeded" }, |
|||
{ label: "执行完成(任务失败)", value: "Failed" }, |
|||
{ label: "执行中", value: "Processing" }, |
|||
{ label: "等待执行", value: "Enqueued" }, |
|||
], |
|||
}; |
|||
|
|||
const schema = { |
|||
title: "数据对比", |
|||
type: "object", |
|||
properties: { |
|||
type: { |
|||
title: "版本号", |
|||
type: "string", |
|||
}, |
|||
taskId: { |
|||
title: "单据流水号", |
|||
type: "string", |
|||
}, |
|||
email: { |
|||
title: "创建人", |
|||
type: "string", |
|||
}, |
|||
createdAt: { |
|||
title: "创建时间", |
|||
type: "DateTime", |
|||
}, |
|||
remark: { |
|||
title: "说明", |
|||
type: "string", |
|||
}, |
|||
stateName, |
|||
}, |
|||
}; |
|||
|
|||
export default function (compareService) { |
|||
const queryUrl = "settleaccount/Job/list"; |
|||
const deleteUrl = "settleaccount/Job/delete"; |
|||
const exportUrl = "settleaccount/pub_sa_detail_service/export"; |
|||
const compareUrl = `settleaccount/${compareService}`; |
|||
const queryMethod = "POST"; |
|||
const deleteMethod = "POST"; |
|||
const exportMethod = "POST"; |
|||
const compareMethod = "POST"; |
|||
|
|||
return { |
|||
query: { |
|||
url: queryUrl, |
|||
method: queryMethod, |
|||
autoSubmit: true, |
|||
disableQueryOnLoad: false, |
|||
schema: { |
|||
title: "数据对比", |
|||
type: "object", |
|||
properties: { |
|||
type: Object.assign({ defaultSelected: false }, version), |
|||
name: { |
|||
type: "string", |
|||
hidden: true, |
|||
}, |
|||
stateName, |
|||
businessType: { |
|||
type: "string", |
|||
hidden: true, |
|||
}, |
|||
filters: { |
|||
type: "array", |
|||
hidden: true, |
|||
items: { |
|||
type: "object", |
|||
properties: { |
|||
logic: { |
|||
type: "int", |
|||
}, |
|||
column: { |
|||
type: "string", |
|||
}, |
|||
action: { |
|||
type: "int", |
|||
}, |
|||
value: { |
|||
type: "string", |
|||
}, |
|||
}, |
|||
}, |
|||
default: [], |
|||
}, |
|||
skipCount: { |
|||
hidden: true, |
|||
default: 0, |
|||
}, |
|||
maxResultCount: { |
|||
hidden: true, |
|||
default: 10, |
|||
}, |
|||
sorting: { |
|||
hidden: true, |
|||
}, |
|||
}, |
|||
}, |
|||
}, |
|||
table: { |
|||
schema: schema, |
|||
}, |
|||
edit: { |
|||
deleteUrl, |
|||
exportUrl, |
|||
compareUrl, |
|||
deleteMethod, |
|||
exportMethod, |
|||
compareMethod, |
|||
schema: schema, |
|||
}, |
|||
compare: { |
|||
schema: compareSchema, |
|||
}, |
|||
}; |
|||
} |
@ -1,105 +0,0 @@ |
|||
import version from "../version.js"; |
|||
import state from "../state.js"; |
|||
|
|||
const schema = { |
|||
title: "不可结算明细", |
|||
type: "object", |
|||
properties: { |
|||
version, |
|||
state, |
|||
billNum: { |
|||
title: "结算单据", |
|||
type: "string", |
|||
}, |
|||
settleBillNum: { |
|||
title: "关联结算单号", |
|||
type: "string", |
|||
}, |
|||
invGroupNum: { |
|||
title: "发票分组号", |
|||
type: "string", |
|||
oneToMany: "/settle/detail", |
|||
config: "/models/settle/detail.js", |
|||
}, |
|||
}, |
|||
}; |
|||
|
|||
export default function (service) { |
|||
const queryUrl = `settleaccount/${service}/detail-query`; |
|||
const exportUrl = `settleaccount/${service}/export`; |
|||
const addUrl = `settleaccount/${service}/generate-settlement-order`; |
|||
|
|||
const queryMethod = "POST"; |
|||
const exportMethod = "POST"; |
|||
const addMethod = "POST"; |
|||
|
|||
return { |
|||
query: { |
|||
url: queryUrl, |
|||
method: queryMethod, |
|||
hasFilter: true, |
|||
schema: { |
|||
title: "发票分组号", |
|||
type: "object", |
|||
properties: { |
|||
filters: { |
|||
title: "项目", |
|||
type: "array", |
|||
hidden: true, |
|||
items: { |
|||
type: "object", |
|||
properties: { |
|||
logic: { |
|||
type: "int", |
|||
}, |
|||
column: { |
|||
type: "string", |
|||
}, |
|||
action: { |
|||
type: "int", |
|||
}, |
|||
value: { |
|||
type: "string", |
|||
}, |
|||
}, |
|||
}, |
|||
default: [ |
|||
{ |
|||
logic: "and", |
|||
column: "version", |
|||
action: "equal", |
|||
value: null, |
|||
readOnly: true, |
|||
}, |
|||
], |
|||
}, |
|||
skipCount: { |
|||
hidden: true, |
|||
default: 0, |
|||
}, |
|||
maxResultCount: { |
|||
hidden: true, |
|||
default: 10, |
|||
}, |
|||
sorting: { |
|||
hidden: true, |
|||
}, |
|||
businessType: { |
|||
hidden: true, |
|||
default: 0, |
|||
}, |
|||
}, |
|||
}, |
|||
}, |
|||
table: { |
|||
schema: schema, |
|||
}, |
|||
edit: { |
|||
exportUrl, |
|||
addUrl, |
|||
exportMethod, |
|||
addMethod, |
|||
schema: schema, |
|||
}, |
|||
}; |
|||
} |
@ -0,0 +1,83 @@ |
|||
import AppList from "../../components/list/index.js"; |
|||
import AppForm from "../../components/form/index.js"; |
|||
import html from "html"; |
|||
import { useRoute } from "vue-router"; |
|||
import useConfig from "../../models/compare/compare.js"; |
|||
import { ref, onMounted, onUnmounted } from "vue"; |
|||
import { schemaToModel } from "../../utils/index.js"; |
|||
import request from "../../request/index.js"; |
|||
|
|||
export default function (type) { |
|||
return { |
|||
components: { AppList, AppForm }, |
|||
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
|
|||
<el-dialog v-model="dialogVisable" align-center destroy-on-close style="width:40%;height:50%;"> |
|||
<template #header> <span class="el-dialog__title"> EDI与发运对比 </span> </template> |
|||
<el-scrollbar> |
|||
<app-form ref="formRef" :mode="create" label-position="left" :schema="schema" v-model="model" :hideButton="true" @submit="submit" /> |
|||
</el-scrollbar> |
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button type="primary" @click="submit"> {{$t('confirm')}} </el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog>`, |
|||
styles: html`<style>
|
|||
.el-dialog__body { |
|||
height: calc(100% - 120px); |
|||
} |
|||
</style>`, |
|||
setup() { |
|||
const route = useRoute(); |
|||
const businessType = route.meta.businessType; |
|||
const dialogVisable = ref(false); |
|||
const loading = ref(false); |
|||
const config = useConfig(businessType, type); |
|||
const schema = config.compare.schema; |
|||
const defaultModel = schemaToModel(schema); |
|||
const model = ref(null); |
|||
const formRef = ref(null); |
|||
const onCommand = async (item, rows) => { |
|||
console.log(item.path, item, rows); |
|||
if (item.path === "compare") { |
|||
model.value = Object.assign({}, defaultModel); |
|||
dialogVisable.value = true; |
|||
} |
|||
}; |
|||
const submit = async () => { |
|||
try { |
|||
const valid = await formRef.value.validate(); |
|||
if (valid) { |
|||
loading.value = true; |
|||
} |
|||
const url = config.edit.compareUrl; |
|||
const data = Object.assign({ businessType, name: config.name }, model.value); |
|||
if (data.seDateTime?.length === 2) { |
|||
data.seStartDateTime = data.seDateTime[0]; |
|||
data.seEndDateTime = data.seDateTime[1]; |
|||
} |
|||
if (data.downLineDateTime?.length === 2) { |
|||
data.downLineStartDateTime = data.downLineDateTime[0]; |
|||
data.downLineEndDateTime = data.downLineDateTime[1]; |
|||
} |
|||
if (businessType) delete data["seDateTime"]; |
|||
delete data["downLineDateTime"]; |
|||
const result = await request(url, data, { method: "POST" }, true); |
|||
if (!result.errors) { |
|||
dialogVisable.value = false; |
|||
} |
|||
} catch (error) { |
|||
console.log(error); |
|||
} finally { |
|||
loading.value = false; |
|||
} |
|||
}; |
|||
//
|
|||
const appListRef = ref(null); |
|||
const event = "SaSeCompare"; |
|||
onMounted(() => PubSub.subscribe(event, async () => await appListRef.value.load())); |
|||
onUnmounted(() => PubSub.unsubscribe(event)); |
|||
return { config, onCommand, appListRef, dialogVisable, loading, schema, model, formRef, submit }; |
|||
}, |
|||
}; |
|||
} |
@ -1,98 +1,3 @@ |
|||
import AppList from "../../components/list/index.js"; |
|||
import AppForm from "../../components/form/index.js"; |
|||
import html from "html"; |
|||
import { useRoute } from "vue-router"; |
|||
import useConfig from "../../models/compare/fa-yun.js"; |
|||
import { ref, onMounted, onUnmounted } from "vue"; |
|||
import { schemaToModel } from "../../utils/index.js"; |
|||
import request from "../../request/index.js"; |
|||
import useCompare from "./_compare.js" |
|||
|
|||
export default { |
|||
components: { AppList, AppForm }, |
|||
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
|
|||
<el-dialog v-model="dialogVisable" align-center destroy-on-close style="width:40%;height:50%;"> |
|||
<template #header> <span class="el-dialog__title"> EDI与发运对比 </span> </template> |
|||
<el-scrollbar> |
|||
<app-form |
|||
ref="formRef" |
|||
:mode="create" |
|||
label-position="left" |
|||
:schema="schema" |
|||
v-model="model" |
|||
:hideButton="true" |
|||
@submit="submit" |
|||
/> |
|||
</el-scrollbar> |
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button type="primary" @click="submit"> {{$t('confirm')}} </el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog>`, |
|||
styles: html`<style>
|
|||
.el-dialog__body { |
|||
height: calc(100% - 120px); |
|||
} |
|||
</style>`, |
|||
setup() { |
|||
const route = useRoute(); |
|||
const businessType = route.meta.businessType; |
|||
const dialogVisable = ref(false); |
|||
const loading = ref(false); |
|||
let config = null; |
|||
let name = null; |
|||
if (businessType === "JisBBAC") { |
|||
config = useConfig("edi-se-compare/bbacedi-se-compare"); |
|||
name = "JisBBACEDI与发运数据对比"; |
|||
} else if (businessType === "JisHBPO") { |
|||
config = useConfig("edi-se-compare/hbpoedi-se-compare"); |
|||
name = "JisHBPOEDI与发运数据对比"; |
|||
} |
|||
config.query.schema.properties.name.default = name; |
|||
const schema = config.compare.schema; |
|||
const defaultModel = schemaToModel(schema); |
|||
const model = ref(null); |
|||
const formRef = ref(null); |
|||
const onCommand = async (item, rows) => { |
|||
console.log(item.path, item, rows); |
|||
if (item.path === "compare") { |
|||
model.value = Object.assign({}, defaultModel); |
|||
dialogVisable.value = true; |
|||
} |
|||
}; |
|||
const submit = async () => { |
|||
try { |
|||
const valid = await formRef.value.validate(); |
|||
if (valid) { |
|||
loading.value = true; |
|||
} |
|||
const url = config.edit.compareUrl; |
|||
const data = Object.assign({ businessType, name }, model.value); |
|||
if (data.seDateTime?.length === 2) { |
|||
data.seStartDateTime = data.seDateTime[0]; |
|||
data.seEndDateTime = data.seDateTime[1]; |
|||
} |
|||
if (data.downLineDateTime?.length === 2) { |
|||
data.downLineStartDateTime = data.downLineDateTime[0]; |
|||
data.downLineEndDateTime = data.downLineDateTime[1]; |
|||
} |
|||
if (businessType) delete data["seDateTime"]; |
|||
delete data["downLineDateTime"]; |
|||
const result = await request(url, data, { method: "POST" }, true); |
|||
if (!result.errors) { |
|||
dialogVisable.value = false; |
|||
} |
|||
} catch (error) { |
|||
console.log(error); |
|||
} finally { |
|||
loading.value = false; |
|||
} |
|||
}; |
|||
//
|
|||
const appListRef = ref(null); |
|||
const event = "SaSeCompare"; |
|||
onMounted(() => PubSub.subscribe(event, async () => await appListRef.value.load())); |
|||
onUnmounted(() => PubSub.unsubscribe(event)); |
|||
return { config, onCommand, appListRef, dialogVisable, loading, schema, model, formRef, submit }; |
|||
}, |
|||
}; |
|||
export default useCompare("fa-yun"); |
|||
|
@ -1,106 +1,3 @@ |
|||
import AppList from "../../components/list/index.js"; |
|||
import AppForm from "../../components/form/index.js"; |
|||
import html from "html"; |
|||
import { useRoute } from "vue-router"; |
|||
import useConfig from "../../models/compare/fa-yun.js"; |
|||
import { ref, onMounted, onUnmounted } from "vue"; |
|||
import { schemaToModel } from "../../utils/index.js"; |
|||
import request from "../../request/index.js"; |
|||
import useCompare from "./_compare.js"; |
|||
|
|||
export default { |
|||
components: { AppList, AppForm }, |
|||
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
|
|||
<el-dialog v-model="dialogVisable" align-center destroy-on-close style="width:40%;height:50%;"> |
|||
<template #header> <span class="el-dialog__title"> EDI、发运与发运对比 </span> </template> |
|||
<el-scrollbar> |
|||
<app-form |
|||
ref="formRef" |
|||
:mode="create" |
|||
label-position="left" |
|||
:schema="schema" |
|||
v-model="model" |
|||
:hideButton="true" |
|||
@submit="submit" |
|||
/> |
|||
</el-scrollbar> |
|||
<template #footer> |
|||
<span class="dialog-footer"> |
|||
<el-button type="primary" @click="submit"> {{$t('confirm')}} </el-button> |
|||
</span> |
|||
</template> |
|||
</el-dialog>`, |
|||
styles: html`<style>
|
|||
.el-dialog__body { |
|||
height: calc(100% - 120px); |
|||
} |
|||
</style>`, |
|||
setup() { |
|||
const route = useRoute(); |
|||
const businessType = route.meta.businessType; |
|||
const dialogVisable = ref(false); |
|||
const loading = ref(false); |
|||
const nameList = { |
|||
JisBBAC: "JisBBAC结算与发运数据对比", |
|||
JisHBPO: "JisHBPO结算与发运数据对比", |
|||
ZhiGongJianBBAC: "直供件BBAC结算与发运数据对比", |
|||
ZhiGongJianHBPO: "直供件HBPO结算与发运数据对比", |
|||
MaiDanJianBBAC: "买单件BBAC结算与发运数据对比", |
|||
MaiDanJianHBPO: "买单件HBPO结算与发运数据对比", |
|||
BeiJian: "备件结算与发运数据对比", |
|||
YinDuJian: "印度件结算与发运数据对比", |
|||
}; |
|||
let config = null; |
|||
let name = null; |
|||
if (businessType === "JisBBAC") { |
|||
config = useConfig("edi-se-compare/bbacedi-se-compare"); |
|||
} else if (businessType === "JisHBPO") { |
|||
config = useConfig("edi-se-compare/hbpoedi-se-compare"); |
|||
} else { |
|||
config = useConfig("pub_sa_detail_service/pub-sa-se-compare"); |
|||
name = nameList[businessType]; |
|||
} |
|||
config.query.schema.properties.businessType.default = businessType; |
|||
config.query.schema.properties.name.default = name; |
|||
const schema = config.compare.schema; |
|||
const defaultModel = schemaToModel(schema); |
|||
const model = ref(null); |
|||
const formRef = ref(null); |
|||
const onCommand = async (item, rows) => { |
|||
console.log(item.path, item, rows); |
|||
if (item.path === "compare") { |
|||
model.value = Object.assign({}, defaultModel); |
|||
dialogVisable.value = true; |
|||
} |
|||
}; |
|||
const submit = async () => { |
|||
try { |
|||
const valid = await formRef.value.validate(); |
|||
if (valid) { |
|||
loading.value = true; |
|||
} |
|||
const url = config.edit.compareUrl; |
|||
const data = Object.assign({}, model.value); |
|||
data.seStartDateTime = data.seDateTime[0]; |
|||
data.seEndDateTime = data.seDateTime[1]; |
|||
data.downLineStartDateTime = data.downLineDateTime[0]; |
|||
data.downLineEndDateTime = data.downLineDateTime[1]; |
|||
delete data["seDateTime"]; |
|||
delete data["downLineDateTime"]; |
|||
const result = await request(url, data, { method: "POST" }, true); |
|||
if (!result.errors) { |
|||
dialogVisable.value = false; |
|||
} |
|||
} catch (error) { |
|||
console.log(error); |
|||
} finally { |
|||
loading.value = false; |
|||
} |
|||
}; |
|||
//
|
|||
const appListRef = ref(null); |
|||
const event = "SaSeCompare"; |
|||
onMounted(() => PubSub.subscribe(event, async () => await appListRef.value.load())); |
|||
onUnmounted(() => PubSub.unsubscribe(event)); |
|||
return { config, onCommand, appListRef, dialogVisable, loading, schema, model, formRef, submit }; |
|||
}, |
|||
}; |
|||
export default useCompare("jie-suan"); |
|||
|
@ -1,15 +0,0 @@ |
|||
import AppList from "../../components/list/index.js"; |
|||
import html from "html"; |
|||
import useConfig from "../../models/settle/detail.js"; |
|||
|
|||
export default { |
|||
components: { AppList }, |
|||
template: html`<app-list :config="config" @command="onCommand" />`, |
|||
setup() { |
|||
config = useConfig("pub_can_sa_service"); |
|||
const onCommand = async (item, rows) => { |
|||
console.log(item.path, item, rows); |
|||
}; |
|||
return { config, onCommand }; |
|||
}, |
|||
}; |
Loading…
Reference in new issue