|
|
@ -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,31 @@ 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> |
|
|
|
<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-col> |
|
|
|
</el-row> |
|
|
@ -86,7 +107,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 +157,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 +174,7 @@ export default { |
|
|
|
adJ_DETAIL: [], |
|
|
|
}); |
|
|
|
//
|
|
|
|
const refreshRef = ref(true); |
|
|
|
const columns1 = { |
|
|
|
type: "object", |
|
|
|
title: "发票和结算分组对应关系", |
|
|
@ -281,6 +300,7 @@ export default { |
|
|
|
}, |
|
|
|
}; |
|
|
|
const setup2columns = { |
|
|
|
properties: { |
|
|
|
lu: { |
|
|
|
type: "string", |
|
|
|
title: "零件号", |
|
|
@ -297,6 +317,7 @@ export default { |
|
|
|
type: "number", |
|
|
|
title: "金额", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
delete columns5.properties["oldInvBillNum"]; |
|
|
|
delete columns5.properties["invGroupNum"]; |
|
|
@ -310,6 +331,7 @@ export default { |
|
|
|
const importDialogVisible = ref(false); |
|
|
|
const setup2table1Ref = ref(null); |
|
|
|
const setup2table2Ref = ref(null); |
|
|
|
const setup3Model = ref(null); |
|
|
|
const showSetupDialog = () => { |
|
|
|
//重开发票号
|
|
|
|
//invBillNum=
|
|
|
@ -439,34 +461,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;
|
|
|
|
// 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(() => { |
|
|
|
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) => { |
|
|
|
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 { |
|
|
|
setupDialogVisable.value = false; |
|
|
|
refreshRef.value = false; |
|
|
|
nextTick(() => { |
|
|
|
refreshRef.value = true; |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
const submitReOpen = async () => {}; |
|
|
|
//
|
|
|
|
onMounted(async () => { |
|
|
|
loading.value = true; |
|
|
@ -515,6 +606,8 @@ export default { |
|
|
|
next, |
|
|
|
setup2table1Ref, |
|
|
|
setup2table2Ref, |
|
|
|
refreshRef, |
|
|
|
setup3Model, |
|
|
|
}; |
|
|
|
}, |
|
|
|
}; |
|
|
|