zhouhongjun
1 year ago
3 changed files with 131 additions and 0 deletions
@ -0,0 +1,43 @@ |
|||||
|
import html from "html"; |
||||
|
import { ref } from "vue"; |
||||
|
import request from "../../request/index.js"; |
||||
|
import AppList from "../../components/list/index.js"; |
||||
|
import useConfig from "../../models/base-data/jia-ge-dan.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
const appListRef = ref(null); |
||||
|
const config = useConfig("price-list-app-service-bj"); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
if (item.path === "enable" || item.path === "disable") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request(config.edit.updateUrl, { id: rows[0].id, isCancel: item.path === "enable" ? false : true }, { method: "POST" }, true), |
||||
|
`确认${item.path === "enable" ? "启用" : "停用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
); |
||||
|
} |
||||
|
if (item.path === "enable-all") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request("settleaccount/price-list-app-service-bj/update-list", { guids: rows.map((o) => o.id), isCancel: false }, { method: "POST" }, true), |
||||
|
`确认${"启用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
|
||||
|
); |
||||
|
|
||||
|
} |
||||
|
if (item.path === "disable-all") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request("settleaccount/price-list-app-service-bj/update-list", { guids: rows.map((o) => o.id), isCancel: true }, { method: "POST" }, true), |
||||
|
`确认${"停用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
|
||||
|
); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
}; |
||||
|
return { appListRef, config, onCommand }; |
||||
|
}, |
||||
|
}; |
@ -0,0 +1,44 @@ |
|||||
|
import html from "html"; |
||||
|
import { ref } from "vue"; |
||||
|
import request from "../../request/index.js"; |
||||
|
import AppList from "../../components/list/index.js"; |
||||
|
import useConfig from "../../models/base-data/xiao-shou.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
const appListRef = ref(null); |
||||
|
const config = useConfig(); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
const url = `${config.baseUrl}/${item.path}`; |
||||
|
if (item.path === "enable" || item.path === "disable") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request("settleaccount/price-list/update", { id: rows[0].id, isCancel: item.path === "enable" ? false : true }, { method: "POST" }, true), |
||||
|
`确认${item.path === "enable" ? "启用" : "停用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
); |
||||
|
} |
||||
|
if (item.path === "enable-all") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request("settleaccount/price-list/update-list", { guids: rows.map((o) => o.id), isCancel: false }, { method: "POST" }, true), |
||||
|
`确认${"启用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
|
||||
|
); |
||||
|
|
||||
|
} |
||||
|
if (item.path === "disable-all") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request("settleaccount/price-list/update-list", { guids: rows.map((o) => o.id), isCancel: true }, { method: "POST" }, true), |
||||
|
`确认${"停用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
|
||||
|
); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
}; |
||||
|
return { appListRef, config, onCommand }; |
||||
|
}, |
||||
|
}; |
@ -0,0 +1,44 @@ |
|||||
|
import html from "html"; |
||||
|
import { ref } from "vue"; |
||||
|
import request from "../../request/index.js"; |
||||
|
import AppList from "../../components/list/index.js"; |
||||
|
import useConfig from "../../models/base-data/jia-ge-dan.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
const appListRef = ref(null); |
||||
|
const config = useConfig("price-list-app-service-yin-du"); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
if (item.path === "enable" || item.path === "disable") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request(config.edit.updateUrl, { id: rows[0].id, isCancel: item.path === "enable" ? false : true }, { method: "POST" }, true), |
||||
|
`确认${item.path === "enable" ? "启用" : "停用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
); |
||||
|
} |
||||
|
if (item.path === "enable-all") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request("settleaccount/price-list-app-service-yin-du/update-list", { guids: rows.map((o) => o.id), isCancel: false }, { method: "POST" }, true), |
||||
|
`确认${"启用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
|
||||
|
); |
||||
|
|
||||
|
} |
||||
|
if (item.path === "disable-all") { |
||||
|
await appListRef.value.onClick( |
||||
|
async () => await request("settleaccount/price-list-app-service-yin-du/update-list", { guids: rows.map((o) => o.id), isCancel: true }, { method: "POST" }, true), |
||||
|
`确认${"停用"}选中的${rows.length}行数据吗?`, |
||||
|
true |
||||
|
|
||||
|
); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
}; |
||||
|
return { appListRef, config, onCommand }; |
||||
|
}, |
||||
|
}; |
Loading…
Reference in new issue