chenrui
3 天以前 b77cb967a3ae670fead19a461daa127a8a4647b2
回款登记记录修改
已修改2个文件
97 ■■■■ 文件已修改
src/views/salesManagement/invoiceRegistration/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/receiptPayment/index.vue 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/invoiceRegistration/index.vue
@@ -55,6 +55,7 @@
        <el-table-column label="业务员" prop="salesman" show-overflow-tooltip/>
        <el-table-column label="项目名称" prop="projectName" show-overflow-tooltip/>
        <el-table-column label="合同金额(元)" prop="contractAmount" show-overflow-tooltip :formatter="formattedNumber"/>
        <el-table-column label="已开票金额(元)" prop="invoiceTotal" show-overflow-tooltip :formatter="formattedNumber"/>
        <el-table-column label="未开票金额(元)" prop="noInvoiceAmountTotal" show-overflow-tooltip :formatter="formattedNumber"/>
      </el-table>
      <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current"
@@ -231,7 +232,7 @@
}
// 主表合计方法
const summarizeMainTable = (param) => {
  return proxy.summarizeTable(param, ['contractAmount','noInvoiceAmountTotal']);
  return proxy.summarizeTable(param, ['contractAmount','noInvoiceAmountTotal','invoiceTotal']);
};
// 子表合计方法
const summarizeChildrenTable = (param) => {
src/views/salesManagement/receiptPayment/index.vue
@@ -33,18 +33,28 @@
                      show-summary
                      :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="单位" prop="unit" width="70"/>
              <el-table-column label="数量" prop="quantity" width="70"/>
              <el-table-column label="税率" prop="taxRate" width="70" />
              <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
              <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
              <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
              <el-table-column label="开票数" prop="invoiceNum" />
              <el-table-column label="开票金额(元)" prop="invoiceAmount" :formatter="formattedNumber" />
              <el-table-column label="未开票数" prop="noInvoiceNum" />
              <el-table-column label="未开票金额(元)" prop="noInvoiceAmount" :formatter="formattedNumber"/>
              <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>
                </template>
              </el-table-column>
              <el-table-column label="回款方式" prop="receiptPaymentType"  >
                <template #default="scope">
                  <el-select v-model="scope.row.receiptPaymentType" placeholder="请选择" clearable :disabled="!scope.row.editType">
                    <el-option v-for="item in receipt_payment_type" :key="item.value" :label="item.label" :value="item.value"/>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column label="登记人" prop="registrant" />
              <el-table-column label="登记日期" prop="createTime"  />
              <el-table-column label="操作" width="150">
                <template #default="scope">
                  <el-button link type="primary" size="small" @click="changeEditType(scope.row)" v-if="!scope.row.editType">编辑</el-button>
                  <el-button link type="primary" size="small" @click="saveReceiptPayment(scope.row)" v-if="scope.row.editType">保存</el-button>
                  <el-button link type="primary" size="small" @click="delReceiptRecord(scope.row)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </template>
        </el-table-column>
@@ -146,9 +156,12 @@
import {
  receiptPaymentSaveOrUpdate,
  bindInvoiceNoRegPage,
  invoiceInfo, receiptPaymentHistoryListNoPage
  invoiceInfo,
  receiptPaymentHistoryListNoPage,
  receiptPaymentDel
} from "../../../api/salesManagement/receiptPayment.js";
import useUserStore from '@/store/modules/user'
import { ElMessage,ElMessageBox } from 'element-plus'
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const tableData = ref([])
@@ -208,6 +221,7 @@
  getList()
}
const getList = () => {
  expandedRowKeys.value = []
  tableLoading.value = true
  bindInvoiceNoRegPage({...searchForm.value, ...page}).then(res => {
    tableLoading.value = false
@@ -226,6 +240,11 @@
        type: 1 }).then(res => {
        const index = tableData.value.findIndex(item => item.id === row.id);
        if (index > -1) {
          if(res?.length > 0) {
            res.forEach(item => {
              item.editType = false
            })
          }
          tableData.value[index].children = res;
        }
        expandedRowKeys.value.push(row.id)
@@ -239,7 +258,8 @@
}
// 表格选择数据
const handleSelectionChange = (selection) => {
  selectedRows.value = selection
  console.log('selection', selection)
  selectedRows.value = selection.filter(item => item.children !== undefined);
}
// 主表合计方法
const summarizeMainTable = (param) => {
@@ -250,7 +270,7 @@
};
// 子表合计方法
const summarizeChildrenTable = (param) => {
  return proxy.summarizeTable(param, ['taxInclusiveUnitPrice', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice','invoiceNum','invoiceAmount','noInvoiceNum','noInvoiceAmount']);
  return proxy.summarizeTable(param, ['receiptPaymentAmount']);
}
// 打开弹框
const openForm = () => {
@@ -290,6 +310,50 @@
  proxy.resetForm("formRef")
  dialogFormVisible.value = false
}
// 删除回款记录
const delReceiptRecord = (row) => {
  console.log('row',row)
  ElMessageBox.confirm("确认删除该记录吗?", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
      .then(async () => {
        try {
          let ids = []
          ids.push(row.id)
          await receiptPaymentDel(ids);
          ElMessage.success("删除成功");
          getList();
        } catch (error) {
          console.error("删除失败:", error);
          ElMessage.error("删除失败");
        }
      })
      .catch(() => {
        ElMessage.info("已取消删除");
      });
}
// 编辑修改状态
const changeEditType = (row) => {
  row.editType = !row.editType
}
// 保存回款记录
const saveReceiptPayment = (row) => {
  let updateData = {
    id:row.id,
    receiptPaymentType: row.receiptPaymentType,
    receiptPaymentAmount: row.receiptPaymentAmount
  }
  receiptPaymentSaveOrUpdate(updateData).then(res => {
    row.editType = !row.editType
  })
}
getList()
</script>