wanggang
1 year ago
12 changed files with 243 additions and 21 deletions
@ -0,0 +1,132 @@ |
|||||
|
import useVmi from "./vmi.js"; |
||||
|
|
||||
|
const schema = Object.assign({}, useVmi()); |
||||
|
|
||||
|
Object.keys(schema.properties).forEach((o) => { |
||||
|
if (o !== "erpToLoc" && o !== "realPartCode" && o !== "qty") { |
||||
|
schema.properties[o].hideForList = true; |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
const baseUrl = "settleaccount/vmi"; |
||||
|
const queryUrl = `${baseUrl}/balance-sum`; |
||||
|
const exportUrl = `${baseUrl}/balance-sum-export`; |
||||
|
const queryMethod = "POST"; |
||||
|
const exportMethod = "POST"; |
||||
|
|
||||
|
export default function () { |
||||
|
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: "billTime", |
||||
|
action: "biggerThanOrEqual", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
title: "发运开始", |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "billTime", |
||||
|
action: "smallThan", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
title: "发运结束", |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "erpToLoc", |
||||
|
action: "like", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "realPartCode", |
||||
|
action: "like", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "custPartCode", |
||||
|
action: "like", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "vinCode", |
||||
|
action: "like", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "codeType", |
||||
|
action: "equal", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "deliverBillType", |
||||
|
action: "equal", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
skipCount: { |
||||
|
hidden: true, |
||||
|
default: 0, |
||||
|
}, |
||||
|
maxResultCount: { |
||||
|
hidden: true, |
||||
|
default: 10, |
||||
|
}, |
||||
|
sorting: { |
||||
|
hidden: true, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
table: { |
||||
|
schema: schema, |
||||
|
}, |
||||
|
edit: { |
||||
|
exportUrl, |
||||
|
exportMethod, |
||||
|
schema: schema, |
||||
|
}, |
||||
|
}; |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
import AppList from "../../components/list/index.js"; |
||||
|
import html from "html"; |
||||
|
import { ref, onMounted, onUnmounted } from "vue"; |
||||
|
import { useRoute } from "vue-router"; |
||||
|
import { ElNotification } from "element-plus"; |
||||
|
import request from "../../request/index.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list v-if="config" :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
const config = ref(null); |
||||
|
const route = useRoute(); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
console.log(item.path, item, rows); |
||||
|
}; |
||||
|
const showMessage = async (data) => { |
||||
|
await ElNotification.closeAll(); |
||||
|
ElNotification({ |
||||
|
position: "bottom-right", |
||||
|
title: "提示", |
||||
|
message: `待同步库存数量: ${data}`, |
||||
|
duration: 0, |
||||
|
}); |
||||
|
}; |
||||
|
const event = "VmiBalance"; |
||||
|
onMounted(async () => { |
||||
|
const model = "vmi/sum"; |
||||
|
const useConfig = (await import(`../../models/${model}.js`)).default; |
||||
|
config.value = useConfig(route.meta?.businessType, route.meta); |
||||
|
const result = await request("settleaccount/vmi-async-message/get-message-count", null, { method: "POST" }); |
||||
|
if (!result.errors) { |
||||
|
showMessage(result.data); |
||||
|
} |
||||
|
PubSub.subscribe(event, async (_, data) => { |
||||
|
if (route.path === "/vmi/sum") { |
||||
|
showMessage(data); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
onUnmounted(() => PubSub.unsubscribe(event)); |
||||
|
return { config, onCommand }; |
||||
|
}, |
||||
|
}; |
Loading…
Reference in new issue