wujianwei
昨天 d14994e10797ce5bc0d29668d358f7c5274dcc5b
ui/admin-ui3/src/views/cwgl/fundFlow/index.vue
@@ -17,6 +17,9 @@
          <el-button type="warning" plain icon="Upload" @click="handleImport"
          v-hasPermi="['cwgl:fundFlow:import']">导入
        </el-button>
        <el-button type="primary" plain icon="Refresh" @click="handleSync"
          v-hasPermi="['cwgl:fundFlow:sync']">同步银行流水
        </el-button>
      </template>
      <template #menu="{ size, row, index }">
        <el-link v-if="row.status == '0'" class="link-btn" type="primary" icon="Edit" :underline="false" :size="size"
@@ -50,10 +53,31 @@
    :open="pageF.importOpen" @submit="importSubmit" @cancel="pageF.importOpen = false" />
  <ClaimBillDialog ref="claimDialogRef" @submit="handleClaimSubmit" />
  <!-- 同步银行流水对话框 -->
  <el-dialog title="同步银行流水" v-model="syncDialogVisible" width="500px" append-to-body>
    <el-form ref="syncFormRef" :model="syncForm" :rules="syncRules" label-width="100px">
      <el-form-item label="账号" prop="acctNum">
        <el-input v-model="syncForm.acctNum" placeholder="请输入银行账号" clearable />
      </el-form-item>
      <el-form-item label="开始日期" prop="startDate">
        <el-date-picker v-model="syncForm.startDate" type="date" value-format="YYYY-MM-DD"
          placeholder="请选择开始日期" style="width: 100%" />
      </el-form-item>
      <el-form-item label="结束日期" prop="endDate">
        <el-date-picker v-model="syncForm.endDate" type="date" value-format="YYYY-MM-DD"
          placeholder="请选择结束日期" style="width: 100%" />
      </el-form-item>
    </el-form>
    <template #footer>
      <el-button @click="syncDialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="handleSyncSubmit" :loading="syncLoading">确 定</el-button>
    </template>
  </el-dialog>
</template>
<script setup name="fundFlow" lang="ts">
import { FundFlowI, addFundFlow, delFundFlow, addFundFlowClaimDetailClaim, exportFundFlow, confirmFundFlow, getFundFlow, listFundFlow, updateFundFlow } from "@/api/cwgl/fundFlow";
import { FundFlowI, addFundFlow, delFundFlow, addFundFlowClaimDetailClaim, exportFundFlow, confirmFundFlow, getFundFlow, listFundFlow, updateFundFlow, syncFromCmbs } from "@/api/cwgl/fundFlow";
import useCurrentInstance from "@/utils/useCurrentInstance";
  import { listFundFlowLog} from "@/api/cwgl/fundFlowLog";
@@ -320,5 +344,47 @@
  pageF.importOpen = false;
  onLoad(page.value);
};
// 同步银行流水
const syncDialogVisible = ref(false);
const syncLoading = ref(false);
const syncFormRef = ref();
const syncForm = reactive({
  acctNum: '',
  startDate: '',
  endDate: ''
});
const syncRules = {
  acctNum: [{ required: true, message: '请输入银行账号', trigger: 'blur' }],
  startDate: [{ required: true, message: '请选择开始日期', trigger: 'change' }],
  endDate: [{ required: true, message: '请选择结束日期', trigger: 'change' }]
};
const handleSync = () => {
  syncForm.acctNum = '';
  syncForm.startDate = '';
  syncForm.endDate = '';
  syncDialogVisible.value = true;
};
const handleSyncSubmit = () => {
  syncFormRef.value?.validate((valid: boolean) => {
    if (!valid) return;
    syncLoading.value = true;
    syncFromCmbs(syncForm).then((response: any) => {
      syncLoading.value = false;
      if (response.code === 200) {
        proxy.$modal.msgSuccess(response.msg || '同步成功');
        syncDialogVisible.value = false;
        onLoad(page.value);
      } else {
        proxy.$modal.msgError(response.msg || '同步失败');
      }
    }).catch((err) => {
      syncLoading.value = false;
      proxy.$modal.msgError('同步失败: ' + (err.msg || err.message || ''));
    });
  });
};
/* listFundFlowClaimDetail */
</script>