zhaoxinyu
5 months ago
5 changed files with 383 additions and 31 deletions
@ -0,0 +1,309 @@ |
|||||
|
import balanSchema from "./vmi.js"; |
||||
|
import { dayjs } from "element-plus"; |
||||
|
|
||||
|
function balanceSchema() { |
||||
|
return { |
||||
|
title: "寄售库存", |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
lu: { |
||||
|
title: "客户零件号", |
||||
|
type: "string", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
partCode: { |
||||
|
title: "厂内零件号", |
||||
|
type: "string", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
businessType: { |
||||
|
title: "业务类型", |
||||
|
type: "string", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
BSEQty: { |
||||
|
title: "期初发货数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
BRETQty: { |
||||
|
title: "期初退货数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
SEQTY : { |
||||
|
title: "实际发货数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
RETQty: { |
||||
|
title: "实际退货数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
CANQty: { |
||||
|
title: "可结数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
NOTQty: { |
||||
|
title: "不可结数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
SE_SA_CAN_QTY: { |
||||
|
title: "有发有结有价格数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
SE_SA_NOT_QTY: { |
||||
|
title: "有发有结无价格数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
ONLY_SE_QTY: { |
||||
|
title: "有发运无结算数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
ONLY_SA_QTY: { |
||||
|
title: "有结算无发运数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
INVQty: { |
||||
|
title: "已开票数量", |
||||
|
type: "string", |
||||
|
input: "number", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
sebegin: { |
||||
|
title: "发运开始", |
||||
|
type: "datetime", |
||||
|
|
||||
|
}, |
||||
|
seend: { |
||||
|
title: "发运结束", |
||||
|
type: "datetime", |
||||
|
|
||||
|
}, |
||||
|
sabegin: { |
||||
|
title: "结算开始", |
||||
|
type: "datetime", |
||||
|
|
||||
|
}, |
||||
|
saend: { |
||||
|
title: "结算结束", |
||||
|
type: "datetime", |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
const schema = balanceSchema(); |
||||
|
|
||||
|
const baseUrl = "settleaccount/vmi"; |
||||
|
const queryUrl = `${baseUrl}/get-receive-ship-sum`; |
||||
|
const detailsUrl = `${baseUrl}/get/%s`; |
||||
|
const createUrl = `${baseUrl}/create`; |
||||
|
const updateUrl = `${baseUrl}/update/%s`; |
||||
|
const deleteUrl = `${baseUrl}/delete-list`; |
||||
|
const importUrl = `${baseUrl}/code-setting-upload-excel-import`; |
||||
|
const exportUrl = `${baseUrl}/get-receive-ship-sum-export`; |
||||
|
const queryMethod = "POST"; |
||||
|
const detailsMethod = "POST"; |
||||
|
const createMethod = "POST"; |
||||
|
const updateMethod = "POST"; |
||||
|
const deleteMethod = "POST"; |
||||
|
const importMethod = "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: "partCode", |
||||
|
action: "like", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "sebegin", |
||||
|
action: "biggerThanOrEqual", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
title: "发运开始", |
||||
|
clearable: false, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "seend", |
||||
|
action: "smallThan", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
title: "发运结束", |
||||
|
clearable: false, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "sabegin", |
||||
|
action: "biggerThanOrEqual", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
title: "结算开始", |
||||
|
clearable: false, |
||||
|
}, |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "saend", |
||||
|
action: "smallThan", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
title: "结算结束", |
||||
|
clearable: false, |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
], |
||||
|
}, |
||||
|
skipCount: { |
||||
|
hidden: true, |
||||
|
default: 0, |
||||
|
}, |
||||
|
maxResultCount: { |
||||
|
hidden: true, |
||||
|
default: 10, |
||||
|
}, |
||||
|
sorting: { |
||||
|
hidden: true, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
table: { |
||||
|
schema: schema, |
||||
|
}, |
||||
|
edit: { |
||||
|
detailsUrl, |
||||
|
createUrl, |
||||
|
updateUrl, |
||||
|
deleteUrl, |
||||
|
importUrl, |
||||
|
exportUrl, |
||||
|
detailsMethod, |
||||
|
createMethod, |
||||
|
updateMethod, |
||||
|
deleteMethod, |
||||
|
importMethod, |
||||
|
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/balance-part-count"; |
||||
|
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/balance") { |
||||
|
//showMessage(data);
|
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
onUnmounted(() => PubSub.unsubscribe(event)); |
||||
|
return { config, onCommand }; |
||||
|
}, |
||||
|
}; |
Loading…
Reference in new issue