| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="对账期间:"> |
| | | <el-date-picker v-model="filters.startMonth" type="month" placeholder="开始月份" value-format="YYYY-MM" style="width: 140px;" /> |
| | | <span style="margin: 0 10px;">至</span> |
| | | <el-date-picker v-model="filters.endMonth" type="month" placeholder="结束月份" value-format="YYYY-MM" style="width: 140px;" /> |
| | | <el-form-item label="对账日期:"> |
| | | <el-date-picker |
| | | v-model="filters.dateRange" |
| | | type="daterange" |
| | | placeholder="请选择对账日期" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | range-separator="至" |
| | | clearable |
| | | style="width: 300px;" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="onSearch">搜索</el-button> |
| | |
| | | <FormDialog title="对账明细" v-model="detailDialogVisible" width="900px" @confirm="printDetail" @cancel="detailDialogVisible = false" operationType="detail"> |
| | | <div class="statement-header"> |
| | | <h3>{{ currentSupplier }} 应付对账单</h3> |
| | | <p>对账期间: {{ currentPeriod }}</p> |
| | | <p>对账日期: {{ currentPeriod }}</p> |
| | | </div> |
| | | <el-table :data="detailData" border style="width: 100%" v-loading="detailLoading"> |
| | | <el-table-column prop="date" label="日期" width="120" /> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="对账月份" prop="statementMonth"> |
| | | <el-form-item label="对账日期" prop="statementMonth"> |
| | | <el-date-picker |
| | | v-model="generateForm.statementMonth" |
| | | type="month" |
| | | placeholder="选择月份" |
| | | value-format="YYYY-MM" |
| | | type="date" |
| | | placeholder="选择对账日期" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | style="width: 100%;" |
| | | @change="onStatementMonthChange" |
| | | /> |
| | |
| | | </el-form> |
| | | |
| | | <div v-if="statementDetailLoaded" class="purchase-section"> |
| | | <div v-if="purchaseData.length > 0" class="section-title">本月采购数据</div> |
| | | <div v-if="purchaseData.length > 0" class="section-title">对账日期采购数据</div> |
| | | <el-table |
| | | v-if="purchaseData.length > 0" |
| | | ref="purchaseTableRef" |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="remark" label="备注" /> |
| | | </el-table> |
| | | <el-empty v-else description="该供应商本月暂无明细数据" :image-size="80" /> |
| | | <el-empty v-else description="该供应商当日暂无明细数据" :image-size="80" /> |
| | | |
| | | <div class="summary-row"> |
| | | <span>期初余额: <strong class="text-primary">¥{{ formatMoney(generateForm.openingBalance) }}</strong></span> |
| | |
| | | </div> |
| | | |
| | | <div v-else-if="generateForm.supplierId && generateForm.statementMonth && !purchaseLoading" class="empty-tip"> |
| | | <el-empty description="该供应商本月暂无采购数据" /> |
| | | <el-empty description="该供应商当日暂无采购数据" /> |
| | | </div> |
| | | |
| | | <template #footer> |
| | |
| | | |
| | | const filters = reactive({ |
| | | supplierId: "", |
| | | startMonth: "", |
| | | endMonth: "", |
| | | dateRange: [], |
| | | }); |
| | | |
| | | const pagination = reactive({ |
| | |
| | | const columns = [ |
| | | { label: "对账单号", prop: "statementNumber", width: "150" }, |
| | | { label: "供应商", prop: "supplierName", width: "180" }, |
| | | { label: "对账期间", prop: "statementMonth", width: "150" }, |
| | | { label: "对账日期", prop: "statementMonth", width: "150" }, |
| | | { label: "期初余额", prop: "openingBalance", dataType: "slot", slot: "openingBalance" }, |
| | | { label: "本期应付", prop: "currentPlan", dataType: "slot", slot: "currentPlan" }, |
| | | { label: "本期付款", prop: "currentActually", dataType: "slot", slot: "currentActually" }, |
| | |
| | | if (filters.supplierId) { |
| | | result.customerId = filters.supplierId; |
| | | } |
| | | if (filters.startMonth && filters.endMonth && filters.startMonth === filters.endMonth) { |
| | | result.statementMonth = filters.startMonth; |
| | | } else if (filters.startMonth) { |
| | | result.startMonth = filters.startMonth; |
| | | } |
| | | if (filters.endMonth && filters.startMonth !== filters.endMonth) { |
| | | result.endMonth = filters.endMonth; |
| | | if (Array.isArray(filters.dateRange) && filters.dateRange.length === 2) { |
| | | result.startDate = filters.dateRange[0]; |
| | | result.endDate = filters.dateRange[1]; |
| | | } |
| | | return result; |
| | | }; |
| | |
| | | |
| | | const resetFilters = () => { |
| | | filters.supplierId = ""; |
| | | filters.startMonth = ""; |
| | | filters.endMonth = ""; |
| | | filters.dateRange = []; |
| | | pagination.currentPage = 1; |
| | | getTableData(); |
| | | }; |
| | |
| | | const viewDetail = (row) => { |
| | | const partnerId = row.customerId ?? row.supplierId; |
| | | if (!partnerId || !row.statementMonth) { |
| | | ElMessage.warning("缺少供应商或对账月份,无法查询明细"); |
| | | ElMessage.warning("缺少供应商或对账日期,无法查询明细"); |
| | | return; |
| | | } |
| | | |