Commit b3f585ad6527cd3ef2278b9280198a89dd86e125
1 parent
d1f3b587
v1.9 优化申请开票选择明细 bug 处理
Showing
1 changed file
with
29 additions
and
11 deletions
src/views/fee/ownerApplyInvoiceList.vue
| ... | ... | @@ -75,7 +75,14 @@ |
| 75 | 75 | </div> |
| 76 | 76 | |
| 77 | 77 | <el-table :data="feeDetails" border style="width: 100%"> |
| 78 | - <el-table-column type="selection" width="55" align="center" @select-all="handleFeeSelectAll" /> | |
| 78 | + <el-table-column width="55" align="center"> | |
| 79 | + <template slot-scope="scope"> | |
| 80 | + <el-checkbox | |
| 81 | + :checked="formData.detailIds.includes(scope.row.detailId)" | |
| 82 | + @change="handleFeeCheckboxChange(scope.row.detailId, $event)"> | |
| 83 | + </el-checkbox> | |
| 84 | + </template> | |
| 85 | + </el-table-column> | |
| 79 | 86 | <el-table-column prop="feeName" :label="$t('ownerApplyInvoice.feeName')" align="center" /> |
| 80 | 87 | <el-table-column prop="payerObjName" :label="$t('ownerApplyInvoice.payer')" align="center" /> |
| 81 | 88 | <el-table-column :label="$t('ownerApplyInvoice.receivablePaid')" align="center"> |
| ... | ... | @@ -108,7 +115,14 @@ |
| 108 | 115 | </div> |
| 109 | 116 | |
| 110 | 117 | <el-table :data="acctDetails" border style="width: 100%"> |
| 111 | - <el-table-column type="selection" width="55" align="center" @select-all="handleAcctSelectAll" /> | |
| 118 | + <el-table-column width="55" align="center"> | |
| 119 | + <template slot-scope="scope"> | |
| 120 | + <el-checkbox | |
| 121 | + :checked="formData.arIds.includes(scope.row.arId)" | |
| 122 | + @change="handleAcctCheckboxChange(scope.row.arId, $event)"> | |
| 123 | + </el-checkbox> | |
| 124 | + </template> | |
| 125 | + </el-table-column> | |
| 112 | 126 | <el-table-column prop="acctName" :label="$t('ownerApplyInvoice.accountName')" align="center" /> |
| 113 | 127 | <el-table-column prop="acctTypeName" :label="$t('ownerApplyInvoice.accountType')" align="center" /> |
| 114 | 128 | <el-table-column prop="ownerName" :label="$t('ownerApplyInvoice.owner')" align="center" /> |
| ... | ... | @@ -231,21 +245,25 @@ export default { |
| 231 | 245 | this.loadAcctDetails() |
| 232 | 246 | } |
| 233 | 247 | }, |
| 234 | - handleFeeSelectAll(selection) { | |
| 235 | - this.formData.detailIds = selection.length | |
| 236 | - ? this.feeDetails.map(item => item.detailId) | |
| 237 | - : [] | |
| 248 | + handleFeeCheckboxChange(detailId, checked) { | |
| 249 | + if (checked) { | |
| 250 | + this.formData.detailIds.push(detailId) | |
| 251 | + } else { | |
| 252 | + this.formData.detailIds = this.formData.detailIds.filter(id => id !== detailId) | |
| 253 | + } | |
| 238 | 254 | }, |
| 239 | - handleAcctSelectAll(selection) { | |
| 240 | - this.formData.arIds = selection.length | |
| 241 | - ? this.acctDetails.map(item => item.arId) | |
| 242 | - : [] | |
| 255 | + handleAcctCheckboxChange(arId, checked) { | |
| 256 | + if (checked) { | |
| 257 | + this.formData.arIds.push(arId) | |
| 258 | + } else { | |
| 259 | + this.formData.arIds = this.formData.arIds.filter(id => id !== arId) | |
| 260 | + } | |
| 243 | 261 | }, |
| 244 | 262 | async handleSubmit() { |
| 245 | 263 | try { |
| 246 | 264 | // 验证表单 |
| 247 | 265 | if (!this.formData.ownerId) { |
| 248 | - this.$message.warning(this.$t('ownerApplyInvoice.chooseContent')) | |
| 266 | + this.$message.warning(this.$t('ownerApplyInvoice.chooseOwner')) | |
| 249 | 267 | return |
| 250 | 268 | } |
| 251 | 269 | ... | ... |