Browse Source

fe 发票重开3、4步

master
wanggang 1 year ago
parent
commit
3dfaa1d1e5
  1. 188
      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

188
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 AppTable from "../../components/table/index.js";
import extraProperties from "../../models/_extraProperties.js";
import { getUrl } from "../../request/index.js";
import { ElMessage } from "element-plus";
export default {
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>
<el-row style="height:calc(100vh - 160px);" v-loading="loading">
<el-col>
@ -70,12 +72,30 @@ export default {
<el-row style="width:100%;height:100%;padding:10px;">
<el-col :span="12" style="height:100%;padding:0 5px 0 0;">
<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-col>
<el-col :span="12" style="height:100%;padding:0 0 0 5px;">
<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>
</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-col>
</el-row>
@ -86,7 +106,6 @@ export default {
</span>
<span class="dialog-footer">
<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>
</el-dialog>
@ -137,13 +156,11 @@ export default {
.el-dialog__body {
height: calc(100% - 120px);
}
/*
.re-open .el-scrollbar,
.re-open .el-scrollbar__view {
height: calc(100% - 120px);
} */
.cell.diff {
background: yellow;
}
</style>`,
props: ["modelValue", "data", "isBusiness"],
props: ["modelValue", "data", "isBusiness", "businessType"],
emit: ["update:modelValue"],
setup(props, context) {
const show = ref(props.modelValue);
@ -156,6 +173,7 @@ export default {
adJ_DETAIL: [],
});
//
const refreshRef = ref(true);
const columns1 = {
type: "object",
title: "发票和结算分组对应关系",
@ -281,21 +299,23 @@ export default {
},
};
const setup2columns = {
lu: {
type: "string",
title: "零件号",
},
price: {
type: "number",
title: "单价",
},
qty: {
type: "number",
title: "数量",
},
amt: {
type: "number",
title: "金额",
properties: {
lu: {
type: "string",
title: "零件号",
},
price: {
type: "number",
title: "单价",
},
qty: {
type: "number",
title: "数量",
},
amt: {
type: "number",
title: "金额",
},
},
};
delete columns5.properties["oldInvBillNum"];
@ -439,47 +459,103 @@ export default {
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 () => {
if (setupRef.value === 1) {
try {
setupRef.value += 1;
//处理高亮
nextTick(() => {
console.log(setup2table1Ref.value);
console.log(setup2table2Ref.value);
const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data");
const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data");
list1.forEach((o) => {
const key = o.querySelector(".lu").innerText;
var qty = o.querySelector(".qty");
var qtyValue = qty.innerText;
var qty2 = Array.from(list2).find((o) => o.querySelector(".lu").innerText === key);
var qtyValue2 = qty2?.innerText;
if (qtyValue !== qty2) {
qty.classList.addClass("diff");
qty2?.addClass("diff");
}
});
});
// 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;
//处理高亮
nextTick(() => {
const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data");
const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data");
list1.forEach((o) => {
addDiff(o, list2, ".qty");
addDiff(o, list2, ".amt");
});
list2.forEach((o) => {
addDiff(o, list1, ".qty");
addDiff(o, list1, ".amt");
});
});
} else if (result.data?.code === 400) {
ElMessage({
type: "error",
message: "校验失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} catch (e) {
console.log(e);
}
} else if (setupRef.value === 2) {
// 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.value += 1;
// } else if (result.data?.code === 400 && result.data.fileName) {
// window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
// }
// }
setupRef.value += 1;
let service = null;
if (props.businessType === "JisBBAC") {
service = "bbac_ba_service";
} else if (bprops.usinessType === "JisHBPO") {
service = "hbpo_ba_service";
} 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;
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "提交失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
}
} else {
setupRef.value += 1;
setupDialogVisable.value = false;
refreshRef.value = false;
nextTick(() => {
refreshRef.value = true;
});
}
};
const submitReOpen = async () => {};
//
onMounted(async () => {
loading.value = true;

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 {
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() {
const appListRef = ref(null);
const visable = ref(false);
@ -69,6 +70,6 @@ export default {
}
console.log(item.path, item, rows);
};
return { appListRef, config, onCommand, visable, data };
return { appListRef, config, onCommand, visable, data, businessType };
},
};

Loading…
Cancel
Save