wanggang
1 year ago
11 changed files with 245 additions and 161 deletions
@ -1,145 +0,0 @@ |
|||
//财务审核
|
|||
import version from "../version.js"; |
|||
import { state2 } from "../state.js"; |
|||
import { businessType, invoiceState } from "../_options.js"; |
|||
|
|||
const state = Object.assign({}, state2); |
|||
state.input = "tabs"; |
|||
const schema = { |
|||
title: "商务审批", |
|||
type: "object", |
|||
properties: { |
|||
version, |
|||
realnvBillNum: { |
|||
title: "金税发票号", |
|||
type: "string", |
|||
}, |
|||
invbillNum: { |
|||
title: "系统发票号", |
|||
type: "string", |
|||
link: true, |
|||
}, |
|||
amt: { |
|||
title: "未税金额", |
|||
type: "number", |
|||
}, |
|||
taxAmt: { |
|||
title: "税后金额", |
|||
type: "number", |
|||
}, |
|||
invGroupNum: { |
|||
title: "发票分组号", |
|||
type: "number", |
|||
link: true, |
|||
}, |
|||
businessType, |
|||
state, |
|||
invoiceState, |
|||
taxDiff: { |
|||
title: "发票税后尾差", |
|||
type: "number", |
|||
}, |
|||
clientCode: { |
|||
title: "客户代码", |
|||
type: "string", |
|||
}, |
|||
}, |
|||
}; |
|||
|
|||
export default function () { |
|||
const service = "invoice_service"; |
|||
const queryUrl = `settleaccount/${service}/main-query`; |
|||
const exportUrl = `settleaccount/${service}/export`; |
|||
const invoiceUrl = `settleaccount/${service}/generate-invoice`; |
|||
const receivedUrl = `settleaccount/${service}/received`; |
|||
const rejectUrl = `settleaccount/${service}/reject`; |
|||
const reissueUrl = `settleaccount/${service}/reissue-invoice`; |
|||
const queryMethod = "POST"; |
|||
const exportMethod = "POST"; |
|||
const invoiceMethod = "POST"; |
|||
const receivedMethod = "POST"; |
|||
const rejectMethod = "POST"; |
|||
const reissueMethod = "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, |
|||
}, |
|||
{ |
|||
logic: "and", |
|||
column: "state", |
|||
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, |
|||
invoiceUrl, |
|||
receivedUrl, |
|||
rejectUrl, |
|||
reissueUrl, |
|||
exportMethod, |
|||
invoiceMethod, |
|||
receivedMethod, |
|||
rejectMethod, |
|||
reissueMethod, |
|||
schema: schema, |
|||
}, |
|||
}; |
|||
} |
@ -0,0 +1,123 @@ |
|||
//库存扣减
|
|||
import { taskState } from "../_options.js"; |
|||
|
|||
export default function () { |
|||
const schema = { |
|||
title: "Qad发票同步状态查询", |
|||
type: "object", |
|||
properties: { |
|||
taskState, |
|||
taskId: { |
|||
title: "任务Id", |
|||
type: "string", |
|||
}, |
|||
tableName: { |
|||
title: "表名", |
|||
type: "string", |
|||
}, |
|||
failedInfo: { |
|||
title: "失败信息", |
|||
type: "string", |
|||
}, |
|||
site: { |
|||
title: "地点", |
|||
type: "string", |
|||
}, |
|||
domain: { |
|||
title: "域", |
|||
type: "string", |
|||
}, |
|||
invoiceNumber: { |
|||
title: "金税发票号", |
|||
type: "string", |
|||
}, |
|||
sasInvoiceNumber: { |
|||
title: "结算发票号", |
|||
type: "string", |
|||
}, |
|||
customer: { |
|||
title: "客户", |
|||
type: "string", |
|||
}, |
|||
voucher: { |
|||
title: "凭证号", |
|||
type: "string", |
|||
}, |
|||
}, |
|||
}; |
|||
|
|||
const queryUrl = "settleaccount/bbac_pd_service/detail-query"; |
|||
|
|||
return { |
|||
query: { |
|||
url: queryUrl, |
|||
method: "POST", |
|||
hasFilter: true, |
|||
schema: { |
|||
title: "Qad发票同步状态查询", |
|||
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: "invoiceNumber", |
|||
action: "equal", |
|||
value: null, |
|||
readOnly: true, |
|||
}, |
|||
{ |
|||
logic: "and", |
|||
column: "sasInvoiceNumber", |
|||
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, |
|||
}, |
|||
edit: { |
|||
schema, |
|||
}, |
|||
}; |
|||
} |
@ -1,14 +1,14 @@ |
|||
import html from "html"; |
|||
import { schemaToModel } from "html"; |
|||
import { ref, nextTick, onMounted, watch } from "vue"; |
|||
import request from "../../request/index.js"; |
|||
import AppForm from "../../components/form/index.js"; |
|||
import AppTable from "../../components/table/index.js"; |
|||
import extraProperties from "../../models/_extraProperties.js"; |
|||
import { getUrl } from "../../request/index.js"; |
|||
import businessTypes from "../../models/_options.js"; |
|||
import { required, trim } from "../../utils/validation.js"; |
|||
import { delay } from "../../utils/index.js"; |
|||
import request from "../request/index.js"; |
|||
import AppForm from "../components/form/index.js"; |
|||
import AppTable from "../components/table/index.js"; |
|||
import extraProperties from "../models/_extraProperties.js"; |
|||
import { getUrl } from "../request/index.js"; |
|||
import businessTypes from "../models/_options.js"; |
|||
import { required, trim } from "../utils/validation.js"; |
|||
import { delay } from "../utils/index.js"; |
|||
import { ElMessage, ElMessageBox } from "element-plus"; |
|||
|
|||
export default { |
@ -0,0 +1,71 @@ |
|||
import AppList from "../../components/list/index.js"; |
|||
import html from "html"; |
|||
import { useRoute } from "vue-router"; |
|||
import { ref } from "vue"; |
|||
import request, { getUrl } from "../../request/index.js"; |
|||
import useConfig from "../../models/settle/commerce.js"; |
|||
import AppCheck from "../_check.js"; |
|||
|
|||
export default { |
|||
components: { AppList, AppCheck }, |
|||
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" />
|
|||
<app-check v-if="visable" v-model="visable" :businessType="businessType" :row="row" :data="data" />`,
|
|||
setup() { |
|||
const appListRef = ref(null); |
|||
const visable = ref(false); |
|||
const row = ref(null); |
|||
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 === "approval" || item.path === "reject" || item.path === "receive" || item.path === "sync") { |
|||
if (rows.length > 0) { |
|||
let message = null; |
|||
let url = null; |
|||
let data = rows.map((o) => o.invbillNum); |
|||
if (item.path === "approval") { |
|||
message = `确认审核通过选中的${rows.length}行数据吗?`; |
|||
url = config.edit.approvalUrl; |
|||
} else if (item.path === "reject") { |
|||
message = `确认退回选中的${rows.length}行数据吗?`; |
|||
data = rows[0]["invGroupNum"]; |
|||
url = config.edit.rejectUrl; |
|||
} else if (item.path === "receive") { |
|||
message = `确认选中的${rows.length}行数据客户已收票吗?`; |
|||
url = config.edit.receivedUrl; |
|||
} else if (item.path === "sync") { |
|||
message = `确认选中的${rows.length}行数据同步到QAD吗?`; |
|||
url = "settleaccount/invoice_service/submit-to-qad"; |
|||
} |
|||
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true); |
|||
} |
|||
} else if (item.path === "export-group") { |
|||
const url = config.edit.exportGroupUrl; |
|||
const method = config.edit.exportMethod; |
|||
const postData = { |
|||
filters: [ |
|||
{ |
|||
logic: "and", |
|||
column: "invGroupNum", |
|||
action: "equal", |
|||
value: rows[0]["invGroupNum"], |
|||
}, |
|||
], |
|||
}; |
|||
await appListRef.value.onClick(async () => { |
|||
const response = await request(url, postData, { method }, true); |
|||
if (!response.errors) { |
|||
window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); |
|||
} |
|||
}); |
|||
} else if (item.path === "invbillNum" || item.path === "invGroupNum") { |
|||
row.value = rows[0]; |
|||
data.value = { [item.path]: rows[0][item.path] }; |
|||
visable.value = true; |
|||
} |
|||
console.log(item.path, item, rows); |
|||
}; |
|||
return { appListRef, config, onCommand, visable, row, data, businessType }; |
|||
}, |
|||
}; |
@ -0,0 +1,18 @@ |
|||
import AppList from "../../components/list/index.js"; |
|||
import html from "html"; |
|||
import useConfig from "../../models/settle/sync.js"; |
|||
|
|||
export default { |
|||
components: { AppList }, |
|||
template: html`<app-list v-if="config" :config="config" @command="onCommand" />`, |
|||
setup() { |
|||
const config = useConfig(); |
|||
const onCommand = async (item, rows) => { |
|||
console.log(item.path, item, rows); |
|||
}; |
|||
return { |
|||
config, |
|||
onCommand, |
|||
}; |
|||
}, |
|||
}; |
Loading…
Reference in new issue