|
|
@ -1,4 +1,5 @@ |
|
|
|
import AppList from "../../../components/list/index.js"; |
|
|
|
import AppForm from "../../../components/form/index.js"; |
|
|
|
import html from "html"; |
|
|
|
import { reactive, ref } from "vue"; |
|
|
|
import useConfig from "../../../models/invoice/invoice_map_group.js"; |
|
|
@ -6,124 +7,121 @@ import request from "../../../request/index.js"; |
|
|
|
import AppTable from "../../components/table/index.js"; |
|
|
|
import { ElMessageBox } from "element-plus"; |
|
|
|
import { post } from "../../../request/index.js"; |
|
|
|
import { schemaToModel } from "html"; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { AppList, AppTable }, |
|
|
|
components: { AppList, AppForm, AppTable }, |
|
|
|
template: html`<app-list :config="config" @command="onCommand" />
|
|
|
|
<el-drawer v-model="drawer" destroy-on-close size="50%" class="page-drawer"> |
|
|
|
<template #header> <span class="el-dialog__title"> 结算明细 </span> </template> |
|
|
|
<el-row style="height:calc(100vh - 160px);" v-loading="loading"> |
|
|
|
<el-col> |
|
|
|
<el-tabs> |
|
|
|
<el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_WAIT_DETAIL.length"> |
|
|
|
<el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_MAP_GROUP.length"> |
|
|
|
<el-scrollbar> |
|
|
|
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" /> |
|
|
|
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns2" /> |
|
|
|
</el-scrollbar> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_MAP_GROUP.length"> |
|
|
|
<el-tab-pane label="发票明细" v-if="model.invoicE_WAIT_DETAIL.length"> |
|
|
|
<el-scrollbar> |
|
|
|
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns2" /> |
|
|
|
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" /> |
|
|
|
</el-scrollbar> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="invoicE_NOT_SETTLE" v-if="model.invoicE_NOT_SETTLE.length"> |
|
|
|
<el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_NOT_SETTLE.length"> |
|
|
|
<el-scrollbar> |
|
|
|
<app-table :data="model.invoicE_NOT_SETTLE" :columns="columns3" /> |
|
|
|
</el-scrollbar> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="发票调整明细" v-if="model.adJ_DETAIL.length"> |
|
|
|
<el-scrollbar> |
|
|
|
<app-table :data="model.adJ_DETAIL" :columns="columns4" /> |
|
|
|
</el-scrollbar> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<template #footer> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="drawer=false"> 返回 </el-button> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
@click="dialogVisible = true" |
|
|
|
v-if="model.adJ_DETAIL.length===0&&prop==='invbillNum'" |
|
|
|
> |
|
|
|
重开 |
|
|
|
<el-button type="primary" @click="showSetupDialog" v-if="model.adJ_DETAIL.length===0&&prop==='invbillNum'"> |
|
|
|
重开发票 |
|
|
|
</el-button> |
|
|
|
<el-dialog v-model="dialogVisible" title="发票调整明细" width="50%" :before-close="handleClose"> |
|
|
|
<template #title> |
|
|
|
<div style="display: flex; justify-content: space-between; align-items: center;"> |
|
|
|
<span>发票调整明细</span> |
|
|
|
<span> |
|
|
|
<el-button type="primary" @click="innerVisible = true" style="margin-left: auto;">新建</el-button> |
|
|
|
<el-button type="primary" @click="openImport = true" style="margin-left: 10px;">导入 </el-button> |
|
|
|
<el-button type="primary" @click="deleteRow" style="margin-left: 10px;">删除</el-button> |
|
|
|
<el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">关闭</el-button> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<el-table :data="invoiceValue" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column width="50" type="selection"> |
|
|
|
<!-- <el-checkbox v-model="selectedRows" /> --> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column property="oldInvBillNum" label="作废发票号" /> |
|
|
|
<el-table-column property="invBillNum" label="发票号" /> |
|
|
|
<el-table-column property="settleDate" label="下线日期" /> |
|
|
|
<el-table-column property="invGroupNum" label="发票分组号" /> |
|
|
|
<el-table-column property="lu" label="零件号" /> |
|
|
|
<el-table-column property="pn" label="标识号" /> |
|
|
|
<el-table-column property="qty" label="数量" /> |
|
|
|
<el-table-column property="groupNum" label="结算分组" /> |
|
|
|
</el-table> |
|
|
|
<el-dialog v-model="innerVisible" width="45%" title="新建数据"> |
|
|
|
<el-form :inline="true" :model="formInline" label-width="100px"> |
|
|
|
<span> |
|
|
|
<el-button type="primary" @click="submitForm">提交</el-button> |
|
|
|
<el-button type="primary" @click="">下一页</el-button> |
|
|
|
</span> |
|
|
|
<el-form-item label="作废发票号"> |
|
|
|
<el-input v-model="formInline.oldInvBillNum"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="发票号"> |
|
|
|
<el-input v-model.number="formInline.invBillNum " type="string"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="下线日期"> |
|
|
|
<el-input v-model.number="formInline.settleDate " type="string"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="发票分组号"> |
|
|
|
<el-input v-model.number="formInline.invGroupNum " type="string"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="零件号"> |
|
|
|
<el-input v-model.number="formInline.lu" type="string"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="标识号"> |
|
|
|
<el-input v-model.number="formInline.pn" type="string"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="数量"> |
|
|
|
<el-input v-model.number="formInline.qty" type="number"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="结算分组"> |
|
|
|
<el-input v-model.number="formInline.groupNum " type="string"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog v-model="openImport" width="30%"> |
|
|
|
<app-form> |
|
|
|
<div> |
|
|
|
<el-form-item :label="$t('文件')" label-width="80px"> |
|
|
|
<el-upload |
|
|
|
ref="uploadRef" |
|
|
|
class="upload" |
|
|
|
drag |
|
|
|
accept=".xlsx" |
|
|
|
:auto-upload="false" |
|
|
|
:on-change="handleChange" |
|
|
|
> |
|
|
|
<el-icon class="el-icon--upload"><ep-upload-filled /></el-icon> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<el-button type="primary" @click="openImportHandler" style="margin-left: 10px;">确定</el-button> |
|
|
|
</app-form> |
|
|
|
</el-dialog> |
|
|
|
<el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">下一页</el-button> |
|
|
|
</el-dialog> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-drawer>`, |
|
|
|
</el-drawer> |
|
|
|
<el-dialog class="re-open" v-model="dialogVisible" align-center destroy-on-close style="width:50%;height:50%"> |
|
|
|
<template #header>发票重开</template> |
|
|
|
<el-steps :active="setupRef" align-center style="height:60px;"> |
|
|
|
<el-step title="调整明细列表" /> |
|
|
|
<el-step title="发票明细对比" /> |
|
|
|
<el-step title="发票预览" /> |
|
|
|
</el-steps> |
|
|
|
<el-row style="padding:14px 0;height:60px;"> |
|
|
|
<el-col> |
|
|
|
<el-button type="primary" @click="addAdj">新建</el-button> |
|
|
|
<el-button type="primary" @click="importAdj">导入</el-button> |
|
|
|
<el-button type="primary" @click="deleteAdj">删除</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-scrollbar> |
|
|
|
<el-row style="height:100%;"> |
|
|
|
<el-col style="height:calc(100% - 180px);"> |
|
|
|
<app-table ref="adjListRef" :data="adjList" :columns="columns5" /> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-scrollbar> |
|
|
|
<template #footer> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<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="submitReOpen" v-if="setupRef==3">确定</el-button> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog v-model="addDialogVisible" align-center destroy-on-close style="width:380px;height:480px;"> |
|
|
|
<template #header>添加调整明细</template> |
|
|
|
<el-scrollbar> |
|
|
|
<el-row> |
|
|
|
<el-col> |
|
|
|
<app-form |
|
|
|
ref="addAdjFormRef" |
|
|
|
v-if="addDialogVisible&&adjModel" |
|
|
|
:schema="adjSchema" |
|
|
|
v-model="adjModel" |
|
|
|
:hideButton="true" |
|
|
|
inline |
|
|
|
@submit="" |
|
|
|
/> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-scrollbar> |
|
|
|
<template #footer> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="submitAdj">确定</el-button> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog v-model="importDialogVisible" align-center destroy-on-close style="width:50%;height:50%"> |
|
|
|
<app-form> |
|
|
|
<div> |
|
|
|
<el-form-item :label="$t('文件')" label-width="80px"> |
|
|
|
<el-upload |
|
|
|
ref="uploadRef" |
|
|
|
class="upload" |
|
|
|
drag |
|
|
|
accept=".xlsx" |
|
|
|
:auto-upload="false" |
|
|
|
:on-change="handleChange" |
|
|
|
> |
|
|
|
<el-icon class="el-icon--upload"><ep-upload-filled /></el-icon> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<el-button type="primary" @click="openImportHandler" style="margin-left: 10px;">确定</el-button> |
|
|
|
</app-form> |
|
|
|
</el-dialog>`, |
|
|
|
styles: html` <style>
|
|
|
|
.page-drawer .el-tab-pane { |
|
|
|
width: 100%; |
|
|
@ -134,6 +132,17 @@ export default { |
|
|
|
width: 100%; |
|
|
|
height: calc(100vh - 160px - 40px); |
|
|
|
} |
|
|
|
.re-open .el-dialog__footer { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
} |
|
|
|
.el-dialog__body { |
|
|
|
height: calc(100% - 120px); |
|
|
|
} |
|
|
|
.re-open .el-scrollbar, |
|
|
|
.re-open .el-scrollbar__view { |
|
|
|
height: calc(100% - 120px); |
|
|
|
} |
|
|
|
</style>`, |
|
|
|
setup() { |
|
|
|
const fileList = ref([]); |
|
|
@ -154,45 +163,11 @@ export default { |
|
|
|
} |
|
|
|
await post(url, formData, method); |
|
|
|
}; |
|
|
|
const formInline = reactive({ |
|
|
|
oldInvBillNum: "", |
|
|
|
invBillNum: "", |
|
|
|
settleDate: "", |
|
|
|
invGroupNum: "", |
|
|
|
lu: "", |
|
|
|
pn: "", |
|
|
|
qty: null, |
|
|
|
groupNum: "", |
|
|
|
}); |
|
|
|
//create
|
|
|
|
const invoiceValue = ref([]); |
|
|
|
const submitForm = () => { |
|
|
|
const newFormInline = { ...formInline }; |
|
|
|
invoiceValue.value.push(newFormInline); |
|
|
|
Object.keys(formInline).forEach((key) => { |
|
|
|
delete formInline[key]; |
|
|
|
}); |
|
|
|
innerVisible.value = false; |
|
|
|
}; |
|
|
|
//delete
|
|
|
|
const selectedRows = ref([]); |
|
|
|
const deleteRow = async () => { |
|
|
|
const indexes = selectedRows.value.map((row) => invoiceValue.value.indexOf(row)); |
|
|
|
indexes.forEach((index) => { |
|
|
|
invoiceValue.value.splice(index, 10000000000); |
|
|
|
}); |
|
|
|
selectedRows.value = []; |
|
|
|
}; |
|
|
|
const innerVisible = ref(false); |
|
|
|
const openImport = ref(false); |
|
|
|
const addDialogVisible = ref(false); |
|
|
|
const importDialogVisible = ref(false); |
|
|
|
const dialogVisible = ref(false); |
|
|
|
const handleClose = (done) => { |
|
|
|
ElMessageBox.confirm("确认关闭") |
|
|
|
.then(() => { |
|
|
|
done(); |
|
|
|
}) |
|
|
|
.catch(() => {}); |
|
|
|
}; |
|
|
|
const config = useConfig(); |
|
|
|
const drawer = ref(false); |
|
|
|
const loading = ref(false); |
|
|
@ -213,6 +188,28 @@ export default { |
|
|
|
loading.value = false; |
|
|
|
}; |
|
|
|
const columns1 = [ |
|
|
|
{ |
|
|
|
dataKey: "version", |
|
|
|
title: "期间", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "invbillNum", |
|
|
|
title: "发票号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "invGroupNum", |
|
|
|
title: "发票分组号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "settleGroupNum", |
|
|
|
title: "结算分组号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "amt", |
|
|
|
title: "金额", |
|
|
|
}, |
|
|
|
]; |
|
|
|
const columns2 = [ |
|
|
|
{ |
|
|
|
key: "version", |
|
|
|
dataKey: "version", |
|
|
@ -247,15 +244,11 @@ export default { |
|
|
|
title: "业务分类", |
|
|
|
}, |
|
|
|
]; |
|
|
|
const columns2 = [ |
|
|
|
const columns3 = [ |
|
|
|
{ |
|
|
|
dataKey: "version", |
|
|
|
title: "期间", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "invbillNum", |
|
|
|
title: "发票号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "invGroupNum", |
|
|
|
title: "发票分组号", |
|
|
@ -265,32 +258,127 @@ export default { |
|
|
|
title: "结算分组号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "amt", |
|
|
|
title: "金额", |
|
|
|
dataKey: "lu", |
|
|
|
title: "可结算分组号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "lu1", |
|
|
|
title: "不可结算分组号", |
|
|
|
}, |
|
|
|
]; |
|
|
|
const columns3 = [ |
|
|
|
const columns4 = [ |
|
|
|
{ |
|
|
|
dataKey: "version", |
|
|
|
title: "期间", |
|
|
|
dataKey: "oldInvBillNum", |
|
|
|
title: "作废发票号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "invBillNum", |
|
|
|
title: "发票号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "settleDate", |
|
|
|
title: "下线日期", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "invGroupNum", |
|
|
|
title: "发票分组号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "settleGroupNum", |
|
|
|
title: "结算分组号", |
|
|
|
dataKey: "lu", |
|
|
|
title: "零件号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "lu", |
|
|
|
title: "可结算分组号", |
|
|
|
dataKey: "pn", |
|
|
|
title: "标识号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "lu1", |
|
|
|
title: "不可结算分组号", |
|
|
|
dataKey: "qty", |
|
|
|
title: "数量", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "groupNum", |
|
|
|
title: "结算分组", |
|
|
|
}, |
|
|
|
]; |
|
|
|
const columns5 = columns4.filter((o) => o.dataKey !== "oldInvBillNum" && o.dataKey !== "invGroupNum"); |
|
|
|
columns5.unshift({ |
|
|
|
input: "selection", |
|
|
|
}); |
|
|
|
//
|
|
|
|
const setupRef = ref(1); |
|
|
|
const adjListRef = ref(null); |
|
|
|
const adjList = ref([]); |
|
|
|
const showSetupDialog = () => { |
|
|
|
adjList.value = []; |
|
|
|
for (let i = 0; i < 100; i++) { |
|
|
|
adjList.value.push({ invBillNum: i }); |
|
|
|
} |
|
|
|
setupRef.value = 1; |
|
|
|
dialogVisible.value = true; |
|
|
|
}; |
|
|
|
const deleteAdj = () => { |
|
|
|
const list = adjListRef.value.getSelection(); |
|
|
|
list.forEach((o) => adjList.value.splice(o, 1)); |
|
|
|
adjListRef.value.clearSelection(); |
|
|
|
}; |
|
|
|
const adjSchema = { |
|
|
|
type: "object", |
|
|
|
properties: { |
|
|
|
invBillNum: { |
|
|
|
type: "string", |
|
|
|
title: "发票号", |
|
|
|
rules: [{ required: true }], |
|
|
|
}, |
|
|
|
settleDate: { |
|
|
|
type: "string", |
|
|
|
title: "下线日期", |
|
|
|
input: "datetime", |
|
|
|
rules: [{ required: true }], |
|
|
|
}, |
|
|
|
lu: { |
|
|
|
type: "string", |
|
|
|
title: "零件号", |
|
|
|
rules: [{ required: true }], |
|
|
|
}, |
|
|
|
pn: { |
|
|
|
type: "string", |
|
|
|
title: "标识号", |
|
|
|
rules: [{ required: true }], |
|
|
|
}, |
|
|
|
qty: { |
|
|
|
type: "string", |
|
|
|
title: "数量", |
|
|
|
input: "number", |
|
|
|
rules: [{ required: true }], |
|
|
|
}, |
|
|
|
groupNum: { |
|
|
|
type: "string", |
|
|
|
title: "结算分组", |
|
|
|
rules: [{ required: true }], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
const defaultAdjModel = schemaToModel(adjSchema); |
|
|
|
const adjModel = ref(Object.assign({}, defaultAdjModel)); |
|
|
|
const addAdjFormRef = ref(null); |
|
|
|
const addAdj = () => { |
|
|
|
adjModel.value = Object.assign({}, defaultAdjModel); |
|
|
|
addDialogVisible.value = true; |
|
|
|
}; |
|
|
|
const submitAdj = async () => { |
|
|
|
try { |
|
|
|
const valid = await addAdjFormRef.value.validate(); |
|
|
|
if (valid) { |
|
|
|
adjList.value.unshift(JSON.parse(JSON.stringify(adjModel.value))); |
|
|
|
addDialogVisible.value = false; |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.log(error); |
|
|
|
} |
|
|
|
}; |
|
|
|
const importAdj = async () => { |
|
|
|
importDialogVisible.value = true; |
|
|
|
}; |
|
|
|
return { |
|
|
|
config, |
|
|
|
onCommand, |
|
|
@ -300,17 +388,26 @@ export default { |
|
|
|
columns1, |
|
|
|
columns2, |
|
|
|
columns3, |
|
|
|
innerVisible, |
|
|
|
columns4, |
|
|
|
columns4, |
|
|
|
columns5, |
|
|
|
addDialogVisible, |
|
|
|
dialogVisible, |
|
|
|
handleClose, |
|
|
|
prop, |
|
|
|
formInline, |
|
|
|
submitForm, |
|
|
|
invoiceValue, |
|
|
|
deleteRow, |
|
|
|
selectedRows, |
|
|
|
openImport, |
|
|
|
importDialogVisible, |
|
|
|
openImportHandler, |
|
|
|
setupRef, |
|
|
|
showSetupDialog, |
|
|
|
adjList, |
|
|
|
adjListRef, |
|
|
|
deleteAdj, |
|
|
|
addAdj, |
|
|
|
submitAdj, |
|
|
|
addAdjFormRef, |
|
|
|
adjSchema, |
|
|
|
adjModel, |
|
|
|
importAdj, |
|
|
|
}; |
|
|
|
}, |
|
|
|
}; |
|
|
|