|
|
@ -1,43 +1,123 @@ |
|
|
|
import AppList from "../../../components/list/index.js"; |
|
|
|
import html from "html"; |
|
|
|
import { ref } from "vue"; |
|
|
|
import { reactive, ref } from "vue"; |
|
|
|
import useConfig from "../../../models/invoice/invoice_map_group.js"; |
|
|
|
import request from "../../../request/index.js"; |
|
|
|
import AppTable from "../../components/table/index.js"; |
|
|
|
import { ElMessageBox } from "element-plus"; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { AppList, 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"> INVOICE_GRP_DETAIL_DTO </span> </template> |
|
|
|
<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="invoicE_WAIT_DETAIL" v-if="model.invoicE_WAIT_DETAIL.length"> |
|
|
|
<el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_WAIT_DETAIL.length"> |
|
|
|
<el-scrollbar> |
|
|
|
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" /> |
|
|
|
</el-scrollbar> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="invoicE_MAP_GROUP" v-if="model.invoicE_MAP_GROUP.length"> |
|
|
|
<el-auto-resizer> |
|
|
|
<template #default="{ height, width }"> |
|
|
|
<el-table-v2 :data="model.invoicE_MAP_GROUP" :columns="columns2" :width="width" :height="height" /> |
|
|
|
</template> |
|
|
|
</el-auto-resizer> |
|
|
|
<el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_MAP_GROUP.length"> |
|
|
|
<el-scrollbar> |
|
|
|
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns2" /> |
|
|
|
</el-scrollbar> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="invoicE_NOT_SETTLE" v-if="model.invoicE_NOT_SETTLE.length"> |
|
|
|
<el-auto-resizer> |
|
|
|
<template #default="{ height, width }"> |
|
|
|
<el-table-v2 :data="model.invoicE_NOT_SETTLE" :columns="columns3" :width="width" :height="height" /> |
|
|
|
</template> |
|
|
|
</el-auto-resizer> |
|
|
|
<el-scrollbar> |
|
|
|
<app-table :data="model.invoicE_NOT_SETTLE" :columns="columns3" /> |
|
|
|
</el-scrollbar> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<template #footer> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="drawer=false"> {{$t('confirm')}} </el-button> |
|
|
|
<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> |
|
|
|
<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"> |
|
|
|
<el-table-column type="selection" width="50"> |
|
|
|
<el-checkbox v-model="selectedRows"></el-checkbox> |
|
|
|
</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> |
|
|
|
<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-button type="primary" @click="openImportHandler" style="margin-left: 10px;">确定</el-button> |
|
|
|
</el-form-item> |
|
|
|
</app-form> |
|
|
|
</el-dialog> |
|
|
|
<el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">下一页</el-button> |
|
|
|
</el-dialog> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-drawer>`, |
|
|
@ -53,6 +133,51 @@ export default { |
|
|
|
} |
|
|
|
</style>`, |
|
|
|
setup() { |
|
|
|
const openImportHandler = async () => { |
|
|
|
const data = {}; |
|
|
|
const response = await request("settleaccount/vmi/excel-to-json", data, { method: "POST" }); |
|
|
|
console.log(response.data); |
|
|
|
}; |
|
|
|
const formInline = reactive({ |
|
|
|
oldInvBillNum: "", |
|
|
|
invBillNum: "", |
|
|
|
settleDate: "", |
|
|
|
invGroupNum: "", |
|
|
|
lu: "", |
|
|
|
pn: "", |
|
|
|
qty: null, |
|
|
|
groupNum: "", |
|
|
|
}); |
|
|
|
//create
|
|
|
|
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 invoiceValue = ref([]); |
|
|
|
const deleteRow = () => { |
|
|
|
const indexes = selectedRows.value.map((row) => invoiceValue.value.indexOf(row)); |
|
|
|
indexes.sort((a, b) => b - a); |
|
|
|
indexes.forEach((index) => { |
|
|
|
invoiceValue.value.splice(index, 1); |
|
|
|
}); |
|
|
|
selectedRows.value = []; |
|
|
|
}; |
|
|
|
const innerVisible = ref(false); |
|
|
|
const openImport = 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); |
|
|
@ -60,8 +185,11 @@ export default { |
|
|
|
invoicE_WAIT_DETAIL: [], |
|
|
|
invoicE_MAP_GROUP: [], |
|
|
|
invoicE_NOT_SETTLE: [], |
|
|
|
adJ_DETAIL: [], |
|
|
|
}); |
|
|
|
const prop = ref(""); |
|
|
|
const onCommand = async (item, rows) => { |
|
|
|
prop.value = item.path; |
|
|
|
drawer.value = true; |
|
|
|
loading.value = true; |
|
|
|
const data = { [item.path]: rows[0][item.path] }; |
|
|
@ -114,7 +242,7 @@ export default { |
|
|
|
title: "发票号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
dataKey: "inGroupNum", |
|
|
|
dataKey: "invGroupNum", |
|
|
|
title: "发票分组号", |
|
|
|
}, |
|
|
|
{ |
|
|
@ -157,6 +285,17 @@ export default { |
|
|
|
columns1, |
|
|
|
columns2, |
|
|
|
columns3, |
|
|
|
innerVisible, |
|
|
|
dialogVisible, |
|
|
|
handleClose, |
|
|
|
prop, |
|
|
|
formInline, |
|
|
|
submitForm, |
|
|
|
invoiceValue, |
|
|
|
deleteRow, |
|
|
|
selectedRows, |
|
|
|
openImport, |
|
|
|
openImportHandler, |
|
|
|
}; |
|
|
|
}, |
|
|
|
}; |
|
|
|