yyb
10 小时以前 6ba30bed9eb241a76897ad04c01ac7c80be9add9
src/views/financialManagement/receivable/invoiceApply.vue
@@ -48,6 +48,8 @@
        v-loading="tableLoading"
        :column="columns"
        :tableData="dataList"
        isShowSummary
        :summaryMethod="getSummaries"
        :page="{
          current: pagination.currentPage,
          size: pagination.pageSize,
@@ -98,7 +100,7 @@
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="申请单号" prop="applyCode">
              <el-input v-model="form.applyCode" placeholder="系统自动生成" disabled />
              <el-input v-model="form.applyCode" placeholder="保存后自动生成" disabled />
            </el-form-item>
          </el-col>
        </el-row>
@@ -189,6 +191,20 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="创建时间" prop="createTime">
              <el-date-picker
                v-model="formCreateTimeDate"
                type="date"
                placeholder="选择日期"
                value-format="YYYY-MM-DD"
                style="width: 100%;"
                :disabled="isView"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="发票内容" prop="content">
          <el-input v-model="form.content" type="textarea" :rows="3" placeholder="请输入发票内容" :disabled="isView" />
        </el-form-item>
@@ -253,6 +269,7 @@
<script setup>
import { ref, reactive, computed, onMounted, nextTick, getCurrentInstance, defineAsyncComponent } from "vue";
import dayjs from "dayjs";
import { ElMessage, ElMessageBox } from "element-plus";
import FormDialog from "@/components/Dialog/FormDialog.vue";
import { listCustomer } from "@/api/basicData/customer.js";
@@ -524,6 +541,13 @@
  applyDate: "",
  content: "",
  remark: "",
  createTime: "",
});
const formCreateTimeDate = computed({
  get: () => (form.createTime ? String(form.createTime).split(" ")[0] : ""),
  set: (value) => {
    form.createTime = value ? `${value} ${dayjs().format("HH:mm:ss")}` : "";
  },
});
const rules = {
@@ -626,6 +650,27 @@
  proxy.download("/accountInvoiceApplication/exportAccountInvoiceApplication", params, filename);
};
const getSummaries = ({ columns, data }) => {
  const sums = [];
  columns.forEach((col, index) => {
    if (index === 0) {
      sums[index] = "合计";
    } else if (col.property === "amount") {
      const total = data.reduce((prev, cur) => {
        const v = Number(cur.amount);
        return prev + (isNaN(v) ? 0 : v);
      }, 0);
      sums[index] = total.toLocaleString("zh-CN", {
        minimumFractionDigits: 2,
        maximumFractionDigits: 2,
      });
    } else {
      sums[index] = "";
    }
  });
  return sums;
};
const formatMoney = (value) => {
  if (value === undefined || value === null) return "0.00";
  return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
@@ -706,6 +751,7 @@
    status: normalizeStatus(row.status ?? row.auditStatus),
    outboundBatchNos,
    outboundBatches: formatOutboundBatches(row.outboundBatches),
    createTime: row.createTime ?? "",
  });
};
@@ -714,7 +760,7 @@
  isView.value = false;
  dialogTitle.value = "新增开票申请";
  Object.assign(form, {
    applyCode: "KP" + Date.now().toString().slice(-8),
    applyCode: "",
    customerId: "",
    outboundBatchNos: [],
    outboundBatches: "",
@@ -724,6 +770,7 @@
    applyDate: new Date().toISOString().split("T")[0],
    content: "",
    remark: "",
    createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
  });
  outboundBatchList.value = [];
  outboundBatchOptions.value = [];
@@ -752,6 +799,7 @@
    invoiceAmount: form.amount,
    taxRate: form.taxRate,
    status: 0,
    createTime: form.createTime,
  };
  if (forUpdate) {
    payload.id = currentId.value;
@@ -766,6 +814,7 @@
  dialogTitle.value = "编辑开票申请";
  fillFormFromRow(row);
  dialogVisible.value = true;
  loadOutboundBatches(form.customerId, true);
};
const view = (row) => {