|
@@ -14,34 +14,21 @@
|
|
|
action: () => openModal('add'),
|
|
|
},
|
|
|
]"
|
|
|
- @get-list="getList"
|
|
|
- >
|
|
|
+ @get-list="getList">
|
|
|
</byTable>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog
|
|
|
- :title="modalType == 'add' ? '添加发票' : '编辑发票'"
|
|
|
- v-if="dialogVisible"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="600"
|
|
|
- v-loading="loadingDialog"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="submit"
|
|
|
- >
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加发票' : '编辑发票'" v-if="dialogVisible" v-model="dialogVisible" width="600" v-loading="loadingDialog">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
<template #money>
|
|
|
<div style="width: 100%">
|
|
|
<el-input-number
|
|
|
+ onmousewheel="return false;"
|
|
|
v-model="formData.data.money"
|
|
|
placeholder="请输入开票金额"
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
- :min="0"
|
|
|
- />
|
|
|
+ :min="0" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #file>
|
|
@@ -52,39 +39,27 @@
|
|
|
:data="uploadData"
|
|
|
multiple
|
|
|
:before-upload="uploadFile"
|
|
|
- :on-preview="onPreviewFile"
|
|
|
- >
|
|
|
+ :on-preview="onPreviewFile">
|
|
|
<el-button>上传文件</el-button>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #information>
|
|
|
- <el-table
|
|
|
- :data="formData.data.invoiceDetailsList"
|
|
|
- style="width: 100%; margin-top: 16px"
|
|
|
- >
|
|
|
+ <el-table :data="formData.data.invoiceDetailsList" style="width: 100%; margin-top: 16px">
|
|
|
<el-table-column prop="code" label="采购合同" width="140" />
|
|
|
<el-table-column prop="amount" label="合同金额" width="120" />
|
|
|
- <el-table-column
|
|
|
- prop="sumInvoiceMoney"
|
|
|
- label="已收发票金额"
|
|
|
- width="120"
|
|
|
- />
|
|
|
+ <el-table-column prop="sumInvoiceMoney" label="已收发票金额" width="120" />
|
|
|
<el-table-column label="关联金额">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'invoiceDetailsList.' + $index + '.money'"
|
|
|
- :rules="rules.money"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
+ <el-form-item :prop="'invoiceDetailsList.' + $index + '.money'" :rules="rules.money" :inline-message="true">
|
|
|
<el-input-number
|
|
|
+ onmousewheel="return false;"
|
|
|
v-model="row.money"
|
|
|
placeholder="请输入关联金额"
|
|
|
style="width: 100%"
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
- :min="0"
|
|
|
- />
|
|
|
+ :min="0" />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -93,9 +68,7 @@
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm()" size="large"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -197,15 +170,11 @@ const config = computed(() => {
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- ElMessageBox.confirm(
|
|
|
- "此操作将永久删除该数据, 是否继续?",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
+ ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
proxy
|
|
|
.post("/invoice/delete", {
|
|
|
id: row.id,
|
|
@@ -243,18 +212,16 @@ const getDict = () => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- proxy
|
|
|
- .post("/supplierInfo/page", { pageNum: 1, pageSize: 999 })
|
|
|
- .then((res) => {
|
|
|
- if (res.rows && res.rows.length > 0) {
|
|
|
- supplierList.value = res.rows.map((item) => {
|
|
|
- return {
|
|
|
- label: item.name,
|
|
|
- value: item.id,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ proxy.post("/supplierInfo/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
+ if (res.rows && res.rows.length > 0) {
|
|
|
+ supplierList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
@@ -381,19 +348,12 @@ const submitForm = () => {
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
- if (
|
|
|
- !(
|
|
|
- formData.data.invoiceDetailsList &&
|
|
|
- formData.data.invoiceDetailsList.length > 0
|
|
|
- )
|
|
|
- ) {
|
|
|
+ if (!(formData.data.invoiceDetailsList && formData.data.invoiceDetailsList.length > 0)) {
|
|
|
return ElMessage("该供应商暂无关联合同");
|
|
|
}
|
|
|
let money = 0;
|
|
|
for (let i = 0; i < formData.data.invoiceDetailsList.length; i++) {
|
|
|
- money = parseFloat(
|
|
|
- Number(money) + Number(formData.data.invoiceDetailsList[i].money)
|
|
|
- ).toFixed(2);
|
|
|
+ money = parseFloat(Number(money) + Number(formData.data.invoiceDetailsList[i].money)).toFixed(2);
|
|
|
}
|
|
|
if (money != formData.data.money) {
|
|
|
return ElMessage("开票金额不等于关联金额");
|
|
@@ -420,19 +380,17 @@ const update = (row) => {
|
|
|
modalType.value = "edit";
|
|
|
loadingDialog.value = true;
|
|
|
proxy.post("/invoice/detail", { id: row.id }).then((res) => {
|
|
|
- proxy
|
|
|
- .post("/fileInfo/getList", { businessIdList: [row.id] })
|
|
|
- .then((res) => {
|
|
|
- if (res[row.id] && res[row.id].length > 0) {
|
|
|
- fileList.value = res[row.id].map((item) => {
|
|
|
- return {
|
|
|
- raw: item,
|
|
|
- name: item.fileName,
|
|
|
- url: item.fileUrl,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((res) => {
|
|
|
+ if (res[row.id] && res[row.id].length > 0) {
|
|
|
+ fileList.value = res[row.id].map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
res.invoiceDetailsList = res.invoiceDetailsVoList.map((item) => {
|
|
|
return {
|
|
|
code: item.purchaseCode,
|