| | |
| | | <el-form-item label="产品信息:" prop="entryDate"> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-table :data="productData" border @selection-change="productSelected" show-summary style="width: 100%"> |
| | | :summary-method="summarizeChildrenTable" |
| | | > |
| | | <el-table :data="productData" border @selection-change="productSelected" show-summary style="width: 100%" :summary-method="summarizeChildrenTable"> |
| | | <el-table-column align="center" label="序号" type="index" width="60" /> |
| | | <el-table-column label="产品大类" prop="productCategory" /> |
| | | <el-table-column label="规格型号" prop="specificationModel" /> |
| | |
| | | <el-table-column label="不含税总价(元)" width="150" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" /> |
| | | <el-table-column label="本次来票数" prop="ticketsNum" width="170"> |
| | | <template #default="scope"> |
| | | <el-input-number v-model="scope.row.ticketsNum" placeholder="请选择" min="0" :step="0.1" clearable style="width: 100%" |
| | | <el-input-number v-model="scope.row.ticketsNum" placeholder="请选择" :min="0" :step="0.1" clearable style="width: 100%" |
| | | @change="invoiceNumBlur(scope.row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="本次来票金额(元)" prop="ticketsAmount" min="0" :step="0.1" :formatter="formattedNumber" @change="invoiceAmountBlur" width="170"> |
| | | <el-table-column label="本次来票金额(元)" prop="ticketsAmount" :min="0" :step="0.1" :formatter="formattedNumber" @change="invoiceAmountBlur" width="170"> |
| | | <template #default="scope"> |
| | | <el-input-number v-model="scope.row.ticketsAmount" placeholder="请选择" min="0" :step="0.1" clearable style="width: 100%" |
| | | <el-input-number v-model="scope.row.ticketsAmount" placeholder="请选择" :min="0" :step="0.1" clearable style="width: 100%" |
| | | @change="invoiceAmountBlur(scope.row)" /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import { |
| | | addOrUpdateRegistration, |
| | | delRegistration, |
| | | gePurchaseList, |
| | | gePurchaseListPage, |
| | | getInfo, |
| | | getProduct, |
| | | getPurchaseNoById, |
| | |
| | | page.current = 1 |
| | | getList() |
| | | } |
| | | const paginationChange = ({ current, limit }) => { |
| | | page.current = current; |
| | | page.size = limit; |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList() |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true |
| | | gePurchaseList({ ...searchForm.value, ...page }).then(res => { |
| | | gePurchaseListPage({ ...searchForm.value, ...page }).then(res => { |
| | | tableLoading.value = false |
| | | tableData.value = res.rows |
| | | tableData.value = res.records; |
| | | tableData.value.map(item => { |
| | | item.children = [] |
| | | }) |
| | |
| | | row.futureTickets = row.tempFutureTickets - row.ticketsNum |
| | | // 计算未来票金额 |
| | | row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount |
| | | calculateinvoiceAmount() |
| | | } |
| | | // 本次来票金额失焦操作 |
| | | const invoiceAmountBlur = (row) => { |
| | |
| | | row.futureTickets = row.tempFutureTickets - row.ticketsNum |
| | | // 计算未来票金额 |
| | | row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount |
| | | calculateinvoiceAmount() |
| | | } |
| | | |
| | | // 获取当前日期函数 |
| | |
| | | if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0 |
| | | return `${year}-${month}-${strDate}` |
| | | } |
| | | |
| | | |
| | | function calculateinvoiceAmount() { |
| | | console.log('productData',productData.value) |
| | | var invoiceAmountTotal = 0 |
| | | productData.value.forEach(item => { |
| | | if(item.ticketsAmount){ |
| | | invoiceAmountTotal += item.ticketsAmount |
| | | } |
| | | }) |
| | | form.value.invoiceAmount = invoiceAmountTotal.toFixed(2) |
| | | |
| | | } |
| | | |
| | | getList() |
| | | </script> |
| | | |