Commit 968f8263 authored by 沈翠玲's avatar 沈翠玲

是否完成修改

parent fab2fb35
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<template v-if="showEdit"> <template v-if="showEdit">
<el-button type="primary" @click="submitForm">保存</el-button> <el-button type="primary" @click="submitForm">保存</el-button>
</template> </template>
<el-button type="primary" @click="showEdit = true" v-if="currentRow">修改</el-button> <el-button type="primary" @click="showEdit = true" v-if="currentRow && currentRow.complete !== 'Y'">修改</el-button>
<el-button type="danger" @click="delItem" v-if="currentRow">删除</el-button> <el-button type="danger" @click="delItem" v-if="currentRow && currentRow.complete !== 'Y'">删除</el-button>
</div> </div>
<div class="w-full"> <div class="w-full">
<table> <table>
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
showModal.value = false; showModal.value = false;
emits('success', form.value, currentIndex.value); emits('success', form.value, currentIndex.value);
}; };
const openModal = (row, index) => { const openModal = (row, index, complete) => {
if (row) { if (row) {
showEdit.value = false showEdit.value = false
form.value = JSON.parse(JSON.stringify(row)) form.value = JSON.parse(JSON.stringify(row))
...@@ -268,6 +268,9 @@ ...@@ -268,6 +268,9 @@
} }
} }
currentRow.value = row currentRow.value = row
if (row) {
currentRow.value['complete'] = complete
}
currentIndex.value = index currentIndex.value = index
showModal.value = true; showModal.value = true;
}; };
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<template v-if="showEdit"> <template v-if="showEdit">
<el-button type="primary" @click="submitForm">保存</el-button> <el-button type="primary" @click="submitForm">保存</el-button>
</template> </template>
<el-button type="primary" @click="showEdit = true" v-if="currentRow">修改</el-button> <el-button type="primary" @click="showEdit = true" v-if="currentRow && currentRow.complete !== 'Y'">修改</el-button>
<el-button type="danger" @click="delItem" v-if="currentRow">删除</el-button> <el-button type="danger" @click="delItem" v-if="currentRow && currentRow.complete !== 'Y'">删除</el-button>
</div> </div>
<div class="w-full"> <div class="w-full">
<table> <table>
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
emits('success', form.value, currentIndex.value, 'del'); emits('success', form.value, currentIndex.value, 'del');
showModal.value = false; showModal.value = false;
} }
const openModal = (row, index) => { const openModal = (row, index, complete) => {
if (row) { if (row) {
showEdit.value = false showEdit.value = false
form.value = JSON.parse(JSON.stringify(row)) form.value = JSON.parse(JSON.stringify(row))
...@@ -298,6 +298,9 @@ ...@@ -298,6 +298,9 @@
} }
} }
currentRow.value = row currentRow.value = row
if (row) {
currentRow.value['complete'] = complete
}
currentIndex.value = index currentIndex.value = index
showModal.value = true; showModal.value = true;
}; };
......
...@@ -436,11 +436,11 @@ const creditArr = ref([]); ...@@ -436,11 +436,11 @@ const creditArr = ref([]);
const cardSUM = computed(() => cardConfig.data.reduce((pre, cur) => pre + Number(cur.debt),0)); const cardSUM = computed(() => cardConfig.data.reduce((pre, cur) => pre + Number(cur.debt),0));
const creditSUM = computed(() => creditArr.value.reduce((pre, cur) => pre + Number(cur.debt),0)); const creditSUM = computed(() => creditArr.value.reduce((pre, cur) => pre + Number(cur.debt),0));
const pushCreditcard = ({row, rowIndex}) => { const pushCreditcard = ({row, rowIndex}) => {
CreditcardRef.value.openModal(row, rowIndex CreditcardRef.value.openModal(row, rowIndex, form.value.complete
); );
}; };
const pushCredit = ({row, rowIndex}) => { const pushCredit = ({row, rowIndex}) => {
CreditRef.value.openModal(row, rowIndex CreditRef.value.openModal(row, rowIndex, form.value.complete
); );
}; };
const handleQuery = () => { const handleQuery = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment