wanggang
1 year ago
13 changed files with 90 additions and 143 deletions
@ -1,15 +0,0 @@ |
|||||
import AppList from "../../components/list/index.js"; |
|
||||
import html from "html"; |
|
||||
import useConfig from "../../models/base-data/job-log.js"; |
|
||||
|
|
||||
export default { |
|
||||
components: { AppList }, |
|
||||
template: html`<app-list :config="config" @command="onCommand" />`, |
|
||||
setup() { |
|
||||
const config = useConfig(); |
|
||||
const onCommand = async (item, rows) => { |
|
||||
console.log(item.path, item, rows); |
|
||||
}; |
|
||||
return { config, onCommand }; |
|
||||
}, |
|
||||
}; |
|
@ -1,44 +0,0 @@ |
|||||
import AppList from "../../components/list/index.js"; |
|
||||
import html from "html"; |
|
||||
import { useRoute } from "vue-router"; |
|
||||
import { ref } from "vue"; |
|
||||
import useConfig from "../../models/settle/commerce.js"; |
|
||||
import AppCheck from "./_check.js"; |
|
||||
import request, { getUrl } from "../../request/index.js"; |
|
||||
|
|
||||
export default { |
|
||||
components: { AppList, AppCheck }, |
|
||||
template: html`<app-list :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" />`, |
|
||||
setup() { |
|
||||
const visable = ref(false); |
|
||||
const data = ref(null); |
|
||||
const route = useRoute(); |
|
||||
const businessType = route.meta.businessType; |
|
||||
const config = useConfig(businessType, "cai-wu"); |
|
||||
const onCommand = async (item, rows) => { |
|
||||
if (item.path === "export-group") { |
|
||||
const url = config.edit.exportUrl; |
|
||||
const method = config.edit.exportMethod; |
|
||||
const postData = { |
|
||||
filters: [ |
|
||||
{ |
|
||||
logic: "and", |
|
||||
column: "invGroupNum", |
|
||||
action: "equal", |
|
||||
value: rows[0]["invGroupNum"], |
|
||||
}, |
|
||||
], |
|
||||
}; |
|
||||
const response = await request(url, postData, { method }); |
|
||||
if (!response.errors) { |
|
||||
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); |
|
||||
} |
|
||||
} else if (item.path === "invbillNum" || item.path === "invGroupNum") { |
|
||||
data.value = { [item.path]: rows[0][item.path] }; |
|
||||
visable.value = true; |
|
||||
} |
|
||||
console.log(item.path, item, rows); |
|
||||
}; |
|
||||
return { config, onCommand, visable, data }; |
|
||||
}, |
|
||||
}; |
|
@ -0,0 +1,48 @@ |
|||||
|
import AppList from "../../components/list/index.js"; |
||||
|
import html from "html"; |
||||
|
import { useRoute } from "vue-router"; |
||||
|
import { ref } from "vue"; |
||||
|
import useConfig from "../../models/settle/commerce.js"; |
||||
|
import AppCheck from "./_check.js"; |
||||
|
import request, { getUrl } from "../../request/index.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList, AppCheck }, |
||||
|
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" />`, |
||||
|
setup() { |
||||
|
const appListRef = ref(null); |
||||
|
const visable = ref(false); |
||||
|
const data = ref(null); |
||||
|
const route = useRoute(); |
||||
|
const businessType = route.meta.businessType; |
||||
|
const config = useConfig(businessType, "cai-wu"); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
// if (item.path === "export-group") {
|
||||
|
// const url = config.edit.exportUrl;
|
||||
|
// const method = config.edit.exportMethod;
|
||||
|
// const postData = {
|
||||
|
// filters: [
|
||||
|
// {
|
||||
|
// logic: "and",
|
||||
|
// column: "invGroupNum",
|
||||
|
// action: "equal",
|
||||
|
// value: rows[0]["invGroupNum"],
|
||||
|
// },
|
||||
|
// ],
|
||||
|
// };
|
||||
|
// const getUrl = getUrl;
|
||||
|
// await appListRef.value.onClick(async () => {
|
||||
|
// const response = await request(url, postData, { method });
|
||||
|
// if (!response.errors) {
|
||||
|
// window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`));
|
||||
|
// }
|
||||
|
// });
|
||||
|
// } else if (item.path === "invbillNum" || item.path === "invGroupNum") {
|
||||
|
// data.value = { [item.path]: rows[0][item.path] };
|
||||
|
// visable.value = true;
|
||||
|
// }
|
||||
|
// console.log(item.path, item, rows);
|
||||
|
}; |
||||
|
return { appListRef, config, onCommand, visable, data }; |
||||
|
}, |
||||
|
}; |
Loading…
Reference in new issue