学 赵 1 year ago
parent
commit
a1dd6a4f1c
  1. 144
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  2. 5
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/commerce.js

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

@ -5,10 +5,12 @@ import request from "../../request/index.js";
import AppForm from "../../components/form/index.js"; import AppForm from "../../components/form/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import extraProperties from "../../models/_extraProperties.js"; import extraProperties from "../../models/_extraProperties.js";
import { getUrl } from "../../request/index.js";
import { ElMessage } from "element-plus";
export default { export default {
components: { AppForm, AppTable }, components: { AppForm, AppTable },
template: html`<el-drawer v-model="show" destroy-on-close size="50%" class="page-drawer" :close-on-click-modal="false"> template: html`<el-drawer v-if="refreshRef" v-model="show" destroy-on-close size="50%" class="page-drawer" :close-on-click-modal="false">
<template #header> <span class="el-dialog__title"> 结算明细 </span> </template> <template #header> <span class="el-dialog__title"> 结算明细 </span> </template>
<el-row style="height:calc(100vh - 160px);" v-loading="loading"> <el-row style="height:calc(100vh - 160px);" v-loading="loading">
<el-col> <el-col>
@ -70,12 +72,31 @@ export default {
<el-row style="width:100%;height:100%;padding:10px;"> <el-row style="width:100%;height:100%;padding:10px;">
<el-col :span="12" style="height:100%;padding:0 5px 0 0;"> <el-col :span="12" style="height:100%;padding:0 5px 0 0;">
<el-scrollbar> <el-scrollbar>
<app-table ref="setup2table1Ref" :data="model.invoicE_WAIT_DETAIL" :columns="columns2" /> <app-table ref="setup2table1Ref" :data="model.invoicE_WAIT_DETAIL" :columns="setup2columns" />
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
<el-col :span="12" style="height:100%;padding:0 0 0 5px;"> <el-col :span="12" style="height:100%;padding:0 0 0 5px;">
<el-scrollbar> <el-scrollbar>
<app-table ref="setup2table2Ref" :data="adjList" :columns="columns5" /> <app-table ref="setup2table2Ref" :data="adjList" :columns="setup2columns" />
</el-scrollbar>
</el-col>
</el-row>
</div>
<div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);background:#ebeef5;">
<el-row style="width:100%;height:100%;padding:10px;">
<el-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<h2>发票预览</h2>
<div>{{setup3Model}}</div>
</el-scrollbar>
</el-col>
</el-row>
</div>
<div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);background:#ebeef5;">
<el-row style="width:100%;height:100%;padding:10px;">
<el-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<h2>完成</h2>
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
</el-row> </el-row>
@ -86,7 +107,6 @@ export default {
</span> </span>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="next" 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> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -137,13 +157,11 @@ export default {
.el-dialog__body { .el-dialog__body {
height: calc(100% - 120px); height: calc(100% - 120px);
} }
/* .cell.diff {
.re-open .el-scrollbar, background: yellow;
.re-open .el-scrollbar__view { }
height: calc(100% - 120px);
} */
</style>`, </style>`,
props: ["modelValue", "data", "isBusiness"], props: ["modelValue", "data", "isBusiness", "businessType"],
emit: ["update:modelValue"], emit: ["update:modelValue"],
setup(props, context) { setup(props, context) {
const show = ref(props.modelValue); const show = ref(props.modelValue);
@ -156,6 +174,7 @@ export default {
adJ_DETAIL: [], adJ_DETAIL: [],
}); });
// //
const refreshRef = ref(true);
const columns1 = { const columns1 = {
type: "object", type: "object",
title: "发票和结算分组对应关系", title: "发票和结算分组对应关系",
@ -281,6 +300,7 @@ export default {
}, },
}; };
const setup2columns = { const setup2columns = {
properties: {
lu: { lu: {
type: "string", type: "string",
title: "零件号", title: "零件号",
@ -297,6 +317,7 @@ export default {
type: "number", type: "number",
title: "金额", title: "金额",
}, },
},
}; };
delete columns5.properties["oldInvBillNum"]; delete columns5.properties["oldInvBillNum"];
delete columns5.properties["invGroupNum"]; delete columns5.properties["invGroupNum"];
@ -310,6 +331,7 @@ export default {
const importDialogVisible = ref(false); const importDialogVisible = ref(false);
const setup2table1Ref = ref(null); const setup2table1Ref = ref(null);
const setup2table2Ref = ref(null); const setup2table2Ref = ref(null);
const setup3Model = ref(null);
const showSetupDialog = () => { const showSetupDialog = () => {
//重开发票号 //重开发票号
//invBillNum= //invBillNum=
@ -439,47 +461,103 @@ export default {
loading.value = false; loading.value = false;
} }
}; };
const addDiff = (o, list2, nodeClass, diffClass = "diff") => {
const key = o.querySelector(".lu")?.innerText;
var node = o.querySelector(nodeClass);
var nodeValue = node?.innerText;
var node2 = Array.from(list2)
.find((o) => o.querySelector(".lu").innerText === key)
?.querySelector(nodeClass);
var nodeValue2 = node2?.innerText;
if (nodeValue !== nodeValue2) {
node?.classList.add(diffClass);
node2?.classList.add(diffClass);
} else {
node?.classList.remove(diffClass);
node2?.classList.remove(diffClass);
}
};
const next = async () => { const next = async () => {
if (setupRef.value === 1) { if (setupRef.value === 1) {
try { try {
// setupRef.value += 1;
// return; //临时
//发到服务的校验
const result = await request(`settleaccount/adj_service/check-import`, adjList.value, { method: "POST" });
if (!result.errors) {
if (result.data?.code === 200) {
adjList.value = result.data.data;
setupRef.value += 1; setupRef.value += 1;
//处理高亮 //处理高亮
nextTick(() => { nextTick(() => {
console.log(setup2table1Ref.value);
console.log(setup2table2Ref.value);
const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data"); const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data");
const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data"); const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data");
list1.forEach((o) => { list1.forEach((o) => {
const key = o.querySelector(".lu").innerText; addDiff(o, list2, ".qty");
var qty = o.querySelector(".qty"); addDiff(o, list2, ".amt");
var qtyValue = qty.innerText; });
var qty2 = Array.from(list2).find((o) => o.querySelector(".lu").innerText === key); list2.forEach((o) => {
var qtyValue2 = qty2?.innerText; addDiff(o, list1, ".qty");
if (qtyValue !== qty2) { addDiff(o, list1, ".amt");
qty.classList.addClass("diff"); });
qty2?.addClass("diff");
}
}); });
} else if (result.data?.code === 400) {
ElMessage({
type: "error",
message: "校验失败",
}); });
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
} else if (setupRef.value === 2) { } else if (setupRef.value === 2) {
// const url = "settleaccount/adj_service/check-import"; let service = null;
// const result = await request(url, adjList.value, { method: "POST" }); if (props.businessType === "JisBBAC") {
// if (!result.errors) { service = "bbac_ba_service";
// if (result.data?.code === 200) { } else if (bprops.usinessType === "JisHBPO") {
// setupRef.value += 1; service = "hbpo_ba_service";
// } else if (result.data?.code === 400 && result.data.fileName) {
// window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
// }
// }
setupRef.value += 1;
} else { } else {
service = "pub_ba_service";
}
const url = `settleaccount/${service}}/reissue-invoice-list`;
const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) {
if (result.data?.code === 200) {
//setup3的数据来源
setup3Model.value = result.data.data;
setupRef.value += 1;
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "提交失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} else if (setupRef.value === 3) {
const url = `settleaccount/${service}}/reissue-invoice-extend`;
const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) {
if (result.data?.code === 200) {
setupRef.value += 1; setupRef.value += 1;
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "提交失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} else {
setupDialogVisable.value = false;
refreshRef.value = false;
nextTick(() => {
refreshRef.value = true;
});
} }
}; };
const submitReOpen = async () => {};
// //
onMounted(async () => { onMounted(async () => {
loading.value = true; loading.value = true;
@ -528,6 +606,8 @@ export default {
next, next,
setup2table1Ref, setup2table1Ref,
setup2table2Ref, setup2table2Ref,
refreshRef,
setup3Model,
}; };
}, },
}; };

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

@ -9,7 +9,8 @@ import AppCheck from "./_check.js";
export default { export default {
components: { AppList, AppCheck }, components: { AppList, AppCheck },
template: html`<app-list ref="appListRef" :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" :businessType="businessType" :data="data" :isBusiness="true" />`,
setup() { setup() {
const appListRef = ref(null); const appListRef = ref(null);
const visable = ref(false); const visable = ref(false);
@ -69,6 +70,6 @@ export default {
} }
console.log(item.path, item, rows); console.log(item.path, item, rows);
}; };
return { appListRef, config, onCommand, visable, data }; return { appListRef, config, onCommand, visable, data, businessType };
}, },
}; };

Loading…
Cancel
Save