sen
2025-08-18 4dbd65ead93823f2e31847667e3ecf454700ab04
ui/admin-ui3/src/views/cwgl/estimatedReceivableBill/index.vue
@@ -148,6 +148,9 @@
} from "@/api/cwgl/estimatedReceivableBill";
import useCurrentInstance from "@/utils/useCurrentInstance";
import { computed, reactive, ref, toRefs } from "vue";
import {
  getSelectCustomNam,
} from "@/api/cwgl/pendingSettlementBusiness";
import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
import { usePagePlus } from "@/hooks/usePagePlus";
import { hasPermission } from "@/utils/permissionUtils";
@@ -232,15 +235,15 @@
        }
      ],
    },
    customerName: {
      label: '客户名称',
      rules: [
        {
          required: true,
          message: "客户名称不能为空", trigger: "blur"
        }
      ],
      search: true,
      minWidth: 220,
      search: true,
      type: 'select',           // 设置为下拉框类型
      dicData: [], // 使用 selectCustomName 作为数据源
      disabled: false  // 根据需要设置是否禁用
    },
    dispatchCount: {
@@ -350,9 +353,9 @@
    },
    handleSelectionChangeFunc: (selection: any) => {
      selectionList.value = selection;
    },
    },
  })
const dialog = reactive({
  visible: false,
@@ -424,11 +427,27 @@
}
const newFormRef = ref();
const submitForm = () => {
  if(newTableData.value.length == 0) {
  if (newTableData.value.length == 0) {
    proxy.$message.error('无关联明细,无法结算');
  }else {
    return; // 添加 return 中断执行
  } else {
    newFormRef.value!.validate(valid => {
      if (valid) {
        // 添加校验逻辑:本次结算金额不能大于应结算金额
        const settlementAmount = parseFloat(newForm.value.settlementAmount);
        const totalAmount = parseFloat(importForm.value.totalAmount);
        // 检查输入是否为有效数字
        if (isNaN(settlementAmount) || isNaN(totalAmount)) {
          proxy.$message.error('金额格式不正确');
          return;
        }
        if (settlementAmount > totalAmount) {
          proxy.$message.error('本次结算金额不能大于应结算金额');
          return; // 关键:在这里添加 return 中断后续执行
        }
        let data = {
          billId: newForm.value.id,
          fileName: newForm.value.attachment
@@ -441,24 +460,22 @@
                proxy.$message.success('操作成功');
                dialog.visible = false;
                newForm.value = {};
              }
            })
          }
        })
      } else {
        // 表单验证失败
        return false;
      }
    });
  }
}
const submitFormTow = () => {
  proxy.$modal.confirm(`是否确认修改账单名称?`).then(function () {
    return updateEstimatedReceivableBillNmae(importForm.value);
  }).then((res) => {
     onLoad(page.value);
    onLoad(page.value);
    proxy.$modal.msgSuccess(res.msg);
  })
@@ -540,6 +557,21 @@
  })
}
const selectCustomName = ref([]);
const getSelectCustomName = () => {
  getSelectCustomNam().then((res) => {
    if (res.code === 200) {
      // selectCustomName.value = res.data;
      selectCustomName.value = res.data.map(item => ({
        dictLabel: item,
        dictValue: item
      }));
      option.value.column.customerName.dicData = selectCustomName.value || [];
    }
  })
}
getSelectCustomName()
</script>
<style scoped>
::v-deep .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell {