wanggang
1 year ago
10 changed files with 231 additions and 37 deletions
@ -0,0 +1,112 @@ |
|||
import { version, state } from "../_options.js"; |
|||
|
|||
const schema = { |
|||
title: "可结算单", |
|||
type: "object", |
|||
properties: { |
|||
version, |
|||
state, |
|||
billNum: { |
|||
title: "结算单据", |
|||
type: "string", |
|||
oneToMany: "/settle/detail", |
|||
config: "/models/settle/detail.js", |
|||
}, |
|||
settleBillNum: { |
|||
title: "关联结算单号", |
|||
type: "string", |
|||
}, |
|||
invGroupNum: { |
|||
title: "发票分组号", |
|||
type: "string", |
|||
}, |
|||
}, |
|||
}; |
|||
|
|||
export default function (businessType) { |
|||
let service; |
|||
if (businessType === "JisBBAC") { |
|||
service = "bbac_can_sa_service"; |
|||
} else if (businessType === "JisHBPO") { |
|||
service = "hbpo_can_sa_service"; |
|||
} else { |
|||
service = "pub_can_sa_service"; |
|||
} |
|||
const queryUrl = `settleaccount/${service}/main-query`; |
|||
const exportUrl = `settleaccount/${service}/export`; |
|||
const addUrl = `settleaccount/${service}/generate-invoice`; |
|||
|
|||
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, |
|||
}, |
|||
}; |
|||
} |
@ -1,19 +1,37 @@ |
|||
import AppList from "../../components/list/index.js"; |
|||
import html from "html"; |
|||
import { ref } from "vue"; |
|||
import { useRoute } from "vue-router"; |
|||
import { ElMessageBox } from "element-plus"; |
|||
import useConfig from "../../models/settle/detail.js"; |
|||
import request from "../../request/index.js"; |
|||
|
|||
export default { |
|||
components: { AppList }, |
|||
template: html`<app-list :config="config" @command="onCommand" />`, |
|||
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`, |
|||
setup() { |
|||
const appListRef = ref(null); |
|||
const route = useRoute(); |
|||
const businessType = route.meta.businessType; |
|||
const config = useConfig(businessType); |
|||
const config = useConfig(businessType, "unable"); |
|||
const onCommand = async (item, rows) => { |
|||
const url = config.edit.addUrl; |
|||
if (item.path === "add") { |
|||
try { |
|||
await ElMessageBox.confirm(`确认是否对所有符合查询条件的数据生成可结算单?`, "提示", { |
|||
type: "warning", |
|||
}); |
|||
appListRef.value.tableLoading = true; |
|||
const data = appListRef.value.buildQuery(); |
|||
const result = request(url, data, { method: "POST" }); |
|||
console.log(result); |
|||
} catch (e) { |
|||
console.log(e); |
|||
} finally { |
|||
appListRef.value.tableLoading = false; |
|||
} |
|||
} |
|||
}; |
|||
return { config, onCommand }; |
|||
return { appListRef, config, onCommand }; |
|||
}, |
|||
}; |
|||
|
Loading…
Reference in new issue