gaoluyang
17 小时以前 15375a133f255a93a9734d9c66fb0b90dfd12341
src/views/salesManagement/receiptPayment/index.vue
@@ -4,22 +4,6 @@
      <el-form :inline="true" :model="searchForm" style="width: 100%">
        <el-row justify="space-between">
          <el-col :span="24">
            <el-form-item label="回款登记">
              <el-input
                v-model="searchForm.searchText"
                placeholder="输入客户名称/合同号搜索"
                clearable
                prefix-icon="Search"
                @change="handleQuery"
              />
            </el-form-item>
            <el-form-item>
              <el-checkbox
                v-model="searchForm.status"
                label="不显示待回款为0"
                @change="handleQuery"
              />
            </el-form-item>
            <el-form-item label="客户名称">
              <el-input
                v-model="searchForm.customerName"
@@ -48,6 +32,13 @@
              />
            </el-form-item>
            <el-form-item>
              <el-checkbox
                v-model="searchForm.status"
                label="不显示待回款为0"
                @change="handleQuery"
              />
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="handleQuery"> 搜索 </el-button>
            </el-form-item>
          </el-col>
@@ -58,7 +49,7 @@
      <div class="actions">
        <div></div>
        <div>
          <el-button type="primary" icon="Plus" @click="openForm('add')">
          <el-button type="primary" @click="openForm('add')">
            新增回款
          </el-button>
          <el-button icon="Download" @click="handleOut"> 导出 </el-button>
@@ -74,7 +65,8 @@
        :summary-method="summarizeMainTable"
        :expand-row-keys="expandedRowKeys"
        @expand-change="expandChange"
        height="calc(100vh - 18.5em)"
        height="calc(100vh - 21.5em)"
      >
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column type="expand">
@@ -94,10 +86,13 @@
              <el-table-column label="回款日期" prop="receiptPaymentDate" />
              <el-table-column label="回款金额" prop="receiptPaymentAmount">
                <template #default="scope">
                  <el-input
                    v-model="scope.row.receiptPaymentAmount"
                    :disabled="!scope.row.editType"
                  ></el-input>
                           <el-input-number :step="0.01" :min="0" style="width: 100%"
                                                    v-model="scope.row.receiptPaymentAmount"
                                                    :disabled="!scope.row.editType"
                                                    :precision="2"
                                                    placeholder="请输入"
                                                    clearable
                           />
                </template>
              </el-table-column>
              <el-table-column label="回款方式" prop="receiptPaymentType">
@@ -127,6 +122,7 @@
                    size="small"
                    @click="changeEditType(scope.row)"
                    v-if="!scope.row.editType"
                              :disabled="scope.row.registrant !== userStore.nickName"
                    >编辑</el-button
                  >
                  <el-button
@@ -135,6 +131,7 @@
                    size="small"
                    @click="saveReceiptPayment(scope.row)"
                    v-if="scope.row.editType"
                              :disabled="scope.row.registrant !== userStore.nickName"
                    >保存</el-button
                  >
                  <el-button
@@ -142,6 +139,7 @@
                    type="primary"
                    size="small"
                    @click="delReceiptRecord(scope.row)"
                              :disabled="scope.row.registrant !== userStore.nickName"
                    >删除</el-button
                  >
                </template>
@@ -154,49 +152,59 @@
          label="销售合同号"
          prop="salesContractNo"
          show-overflow-tooltip
          width="240"
        />
        <el-table-column
          label="客户合同号"
          prop="customerContractNo"
          show-overflow-tooltip
          width="240"
        />
        <el-table-column
          label="客户名称"
          prop="customerName"
          show-overflow-tooltip
          width="240"
        />
        <el-table-column
          label="项目名称"
          prop="projectName"
          show-overflow-tooltip
          width="340"
        />
        <el-table-column
          label="产品大类"
          prop="productCategory"
          show-overflow-tooltip
          width="100"
        />
        <el-table-column
          label="发票号"
          prop="invoiceNo"
          show-overflow-tooltip
          width="200"
        />
        <el-table-column
          label="发票金额(元)"
          prop="invoiceTotal"
          show-overflow-tooltip
          :formatter="formattedNumber"
          width="200"
        />
        <el-table-column label="税率" prop="taxRate" show-overflow-tooltip />
        <el-table-column label="税率(%)" prop="taxRate" show-overflow-tooltip />
        <el-table-column
          label="回款金额(元)"
          prop="receiptPaymentAmountTotal"
          show-overflow-tooltip
          :formatter="formattedNumber"
          width="200"
        />
        <el-table-column
          label="待回款金额(元)"
          prop="noReceiptAmount"
          show-overflow-tooltip
          width="200"
        >
          <template #default="{ row, column }">
            <el-text type="danger">
@@ -283,12 +291,10 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="本次回款金额:" prop="receiptPaymentAmount">
              <el-input
                type="number"
                min="0"
              <el-input-number :step="0.01" :min="0" style="width: 100%"
                                              :precision="2"
                v-model="form.receiptPaymentAmount"
                placeholder="请输入"
                :step="0.01"
                clearable
              />
            </el-form-item>
@@ -432,13 +438,20 @@
  getList();
};
const getList = () => {
  expandedRowKeys.value = [];
  tableLoading.value = true;
  bindInvoiceNoRegPage({ ...searchForm, ...page })
    .then((res) => {
      tableLoading.value = false;
      tableData.value = res.data.records;
      total.value = res.data.total;
         if (expandedRowKeys.value.length > 0) {
            const arr = []
            const index = tableData.value.findIndex(item => item.id === expandedRowKeys.value[0]);
            if (index > -1) {
               arr.push(tableData.value[index]);
               expandChange(tableData.value[index], arr)
            }
         }
    })
    .catch(() => {
      tableLoading.value = false;
@@ -500,10 +513,8 @@
    proxy.$modal.msgError("请选择一条数据");
    return;
  }
  //
  console.log("(selectedRows.value", selectedRows.value);
  if (selectedRows.value[0].noReceiptAmount === 0) {
    proxy.$modal.msgError("待回款金额为0元");
  if (selectedRows.value[0].noReceiptAmount == 0) {
    proxy.$modal.warning("无需再回款");
    return;
  }
  invoiceInfo({ id: selectedRows.value[0].id }).then((res) => {
@@ -571,6 +582,8 @@
  };
  receiptPaymentSaveOrUpdate(updateData).then((res) => {
    row.editType = !row.editType;
      getList();
      proxy.$modal.msgSuccess("提交成功");
  });
};
@@ -582,7 +595,12 @@
    type: "warning",
  })
    .then(() => {
      proxy.download("/receiptPayment/export", {}, "回款登记档案.xlsx");
      const ids = selectedRows.value.map((item) => item.id);
      proxy.download(
        `/receiptPayment/export`,
        { ids: `${ids}` },
        "回款登记档案.xlsx"
      );
    })
    .catch(() => {
      proxy.$modal.msg("已取消");