Browse Source

update

master
wanggang 1 year ago
parent
commit
d7ef499471
  1. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  2. 12
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
  3. 33
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js
  4. 112
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js
  5. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js
  6. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  7. 30
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  8. 43
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js
  9. 24
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js
  10. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -885,6 +885,7 @@ export default {
load,
config,
queryModel,
buildQuery,
pageModel,
treeProps,
tableKey,

12
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js

@ -6,7 +6,6 @@ const schema = {
title: "商务审批",
type: "object",
properties: {
version,
realnvBillNum: {
title: "金税发票号",
type: "string",
@ -54,10 +53,10 @@ const schema = {
export default function (businessType, type) {
let service = null;
if (type === "shangwu") {
if (type === "shang-wu") {
if (businessType === "JisBBAC") {
service = "bbac_ba_service";
} else if (businessType === "JisBBAC") {
} else if (businessType === "JisHBPO") {
service = "hbpo_ba_service";
} else {
service = "pub_ba_service";
@ -108,13 +107,6 @@ export default function (businessType, type) {
},
},
default: [
{
logic: "and",
column: "version",
action: "equal",
value: null,
readOnly: true,
},
{
logic: "and",
column: "state",

33
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js

@ -1,5 +1,3 @@
import { version } from "../_options.js";
const schema = {
title: "通用代码",
type: "object",
@ -68,14 +66,24 @@ const schema = {
},
};
export default function (businessType) {
export default function (businessType, type) {
let service;
if (businessType === "JisBBAC") {
service = "bbac_not_sa_service";
} else if (businessType === "JisHBPO") {
service = "hbpo_not_sa_service";
if (type === "unable") {
if (businessType === "JisBBAC") {
service = "bbac_not_sa_service";
} else if (businessType === "JisHBPO") {
service = "hbpo_not_sa_service";
} else {
service = "pub_not_sa_service";
}
} else {
service = "pub_not_sa_service";
if (businessType === "JisBBAC") {
service = "bbac_can_sa_service";
} else if (businessType === "JisHBPO") {
service = "hbpo_can_sa_service";
} else {
service = "pub_can_sa_service";
}
}
if (businessType === "JisBBAC" || businessType === "JisHBPO" || businessType === "MaiDanJianBBAC" || businessType === "MaiDanJianHBPO") {
schema.properties.pn.title = "生产码";
@ -93,7 +101,11 @@ export default function (businessType) {
delete schema.properties["site"];
}
const queryUrl = `settleaccount/${service}/detail-query`;
const addUrl = `settleaccount/${service}/generate-settlement-order`;
const exportUrl = `settleaccount/${service}/export`;
const queryMethod = "POST";
const addMethod = "POST";
const exportMethod = "POST";
return {
query: {
@ -167,6 +179,11 @@ export default function (businessType) {
schema: schema,
},
edit: {
addUrl,
exportUrl,
addMethod,
exportUrl,
exportMethod,
schema: schema,
},
};

112
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/unable.js

@ -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,
},
};
}

5
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/request/index.js

@ -65,10 +65,7 @@ const getResult = async (response) => {
} catch (error) {
console.log(error);
}
ElMessageBox.alert(
`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`,
`${result.errors?.error?.code ?? result.status}`
);
ElMessageBox.alert(`${result.errors?.error?.message ?? messages.get(response.status) ?? result.status}`, `${result.errors?.error?.code ?? "错误"}`);
}
return result;
};

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js

@ -85,10 +85,10 @@ function createCommerceCheckList(path, business, client, title = "商务审批")
component: "/settle/commerce",
children: [
createButton("query", "title=查询&isTop=true"),
createButton("compare", "title=商务审核通过&isTop=true"),
createButton("reject", "title=退回&isTop=true"),
createButton("approval", "title=商务审核通过&isTop=true"),
createButton("reject", "title=退回"),
createButton("export", "title=导出&isTop=true&pattern=paged"),
createButton("????", "title=客户已收票&isTop=true"),
createButton("receive", "title=客户已收票&isTop=true"),
],
};
}

30
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js

@ -38,7 +38,7 @@ export default {
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="show=false"> 返回 </el-button>
<el-button type="primary" @click="showSetupDialog" v-if="isBusiness&&data.invbillNum&&model.adJ_DETAIL.length===0"> 重开发票 </el-button>
<el-button type="primary" @click="showSetupDialog" v-if="isBusiness&&model.adJ_DETAIL.length===0"> 重开发票 </el-button>
</span>
</template>
</el-drawer>
@ -70,7 +70,7 @@ export default {
<el-button type="primary" @click="setupRef-=1" v-if="setupRef>1">上一步</el-button>
</span>
<span class="dialog-footer">
<el-button type="primary" @click="setupRef+=1" v-if="setupRef<3">下一步</el-button>
<el-button type="primary" @click="next" v-if="setupRef<3">下一步</el-button>
<el-button type="primary" @click="submitReOpen" v-if="setupRef===3">确定</el-button>
</span>
</template>
@ -253,6 +253,8 @@ export default {
const addDialogVisible = ref(false);
const importDialogVisible = ref(false);
const showSetupDialog = () => {
//重开发票号
//invBillNum=
adjList.value = [];
setupRef.value = 1;
setupDialogVisable.value = true;
@ -276,6 +278,7 @@ export default {
type: "string",
title: "发票号",
rules: [{ required: true }],
default: props.data.invbillNum,
},
settleDate: {
type: "string",
@ -307,7 +310,7 @@ export default {
},
};
const defaultAdjModel = schemaToModel(adjSchema);
const adjModel = ref(Object.assign({}, defaultAdjModel));
const adjModel = ref(Object.assign({ invBillNum: "" }, defaultAdjModel));
const addAdjFormRef = ref(null);
const showAddAdjDialog = () => {
adjModel.value = Object.assign({}, defaultAdjModel);
@ -372,6 +375,26 @@ export default {
loading.value = false;
}
};
const next = async () => {
if (setupRef.value === 1) {
try {
const url = "settleaccount/adj_service/check-import";
const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) {
if (result.data?.code === 200) {
//明细对比逻辑处理
setupRef += 1;
} else if (result.data?.code === 400 && result.data.fileName) {
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} catch (e) {
console.log(e);
}
} else {
setupRef += 1;
}
};
const submitReOpen = async () => {};
//
onMounted(async () => {
@ -409,6 +432,7 @@ export default {
importAdjSchema,
importAdj,
scrollRef,
next,
};
},
};

43
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js

@ -2,23 +2,56 @@ import AppList from "../../components/list/index.js";
import html from "html";
import { useRoute } from "vue-router";
import { ref } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import request 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 :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
template: html`<app-list ref="appListRef" :config="config" @command="onCommand" /> <app-check v-if="visable" v-model="visable" :data="data" :isBusiness="true" />`,
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, "shang-wu");
const onCommand = async (item, rows) => {
data.value = { [item.path]: rows[0][item.path] };
visable.value = true;
console.log(item.path, item, rows);
if (item.path === "approval" || item.path === "reject" || item.path === "receive") {
if (rows.length === 0) {
ElMessage({
type: "warning",
message: "没有选中的数据",
});
} else {
const message =
item.path === "approval"
? `确认审核通过选中的${rows.length}行数据吗?`
: item.path === "reject"
? `确认退回选中的${rows.length}行数据吗?`
: `确认选中的${rows.length}行数据客户已收票吗?`;
const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum);
const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
try {
await ElMessageBox.confirm(message, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;
const result = request(url, data, { method: "POST" });
console.log(result);
} catch (e) {
console.log(e);
} finally {
appListRef.value.tableLoading = false;
}
}
} else if (item.path === "invbillNum" || item.path === "invGroupNum") {
data.value = { invbillNum: rows[0]["invbillNum"], invGroupNum: rows[0]["invGroupNum"] };
visable.value = true;
console.log(item.path, item, rows);
}
};
return { config, onCommand, visable, data };
return { appListRef, config, onCommand, visable, data };
},
};

24
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/unable.js

@ -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 };
},
};

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/usable.js

@ -19,7 +19,7 @@ export default {
if (item.path === "add") {
const invbillNum = rows[0].billNum;
try {
await ElMessageBox.confirm(`"确认为${invbillNum}创建发票?`, "提示", {
await ElMessageBox.confirm(`确认为${invbillNum}创建发票?`, "提示", {
type: "warning",
});
appListRef.value.tableLoading = true;

Loading…
Cancel
Save