Răsfoiți Sursa

修改银行选项

hurx 17 ore în urmă
părinte
comite
0ee2f3d922

+ 75 - 0
src/api/company/bank/index.ts

@@ -0,0 +1,75 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { BankVO, BankForm, BankQuery } from '@/api/company/bank/types';
+
+/**
+ * 查询银行信息列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listBank = (query?: BankQuery): AxiosPromise<BankVO[]> => {
+  return request({
+    url: '/system/bank/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询银行信息详细
+ * @param id
+ */
+export const getBank = (id: string | number): AxiosPromise<BankVO> => {
+  return request({
+    url: '/system/bank/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增银行信息
+ * @param data
+ */
+export const addBank = (data: BankForm) => {
+  return request({
+    url: '/system/bank',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改银行信息
+ * @param data
+ */
+export const updateBank = (data: BankForm) => {
+  return request({
+    url: '/system/bank',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除银行信息
+ * @param id
+ */
+export const delBank = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/system/bank/' + id,
+    method: 'delete'
+  });
+};
+
+export function changeShowStatus(id: string | number, isShow: string) {
+  const data = {
+    id,
+    isShow
+  };
+  return request({
+    url: '/system/bank/changeStatus',
+    method: 'put',
+    data: data
+  });
+}

+ 155 - 0
src/api/company/bank/types.ts

@@ -0,0 +1,155 @@
+export interface BankVO {
+  /**
+   * 主键ID
+   */
+  id: string | number;
+
+  /**
+   * 网点编号
+   */
+  bnId: string;
+
+  /**
+   * 网点名称
+   */
+  bnName: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource: string;
+
+  /**
+   * 网点地址
+   */
+  bnAddr: string;
+
+  /**
+   * 网点分类ID
+   */
+  bnCatgId: string | number;
+
+  /**
+   * 传真号码
+   */
+  faxNo: string;
+
+  /**
+   * 联系电话
+   */
+  telNo: string;
+
+  /**
+   * 是否显示(0-是,1-否)
+   */
+  isShow: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+}
+
+export interface BankForm extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id?: string | number;
+
+  /**
+   * 网点编号
+   */
+  bnId?: string;
+
+  /**
+   * 网点名称
+   */
+  bnName?: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource?: string;
+
+  /**
+   * 网点地址
+   */
+  bnAddr?: string;
+
+  /**
+   * 网点分类ID
+   */
+  bnCatgId?: string | number;
+
+  /**
+   * 传真号码
+   */
+  faxNo?: string;
+
+  /**
+   * 联系电话
+   */
+  telNo?: string;
+
+  /**
+   * 是否显示(0-是,1-否)
+   */
+  isShow?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+}
+
+export interface BankQuery extends PageQuery {
+  /**
+   * 网点编号
+   */
+  bnId?: string;
+
+  /**
+   * 网点名称
+   */
+  bnName?: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource?: string;
+
+  /**
+   * 网点地址
+   */
+  bnAddr?: string;
+
+  /**
+   * 网点分类ID
+   */
+  bnCatgId?: string | number;
+
+  /**
+   * 传真号码
+   */
+  faxNo?: string;
+
+  /**
+   * 联系电话
+   */
+  telNo?: string;
+
+  /**
+   * 是否显示(0-是,1-否)
+   */
+  isShow?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 2 - 2
src/views/customer/customerFile/customerInfo/components/addContactDialog.vue

@@ -111,7 +111,7 @@ const form = reactive<CustomerContactForm>({
   phone: '',
   officePhone: '',
   officePhoneTwo: '',
-  gender: '',
+  gender: '0',
   roleId: undefined,
   deptId: undefined,
   email: '',
@@ -199,7 +199,7 @@ const handleClose = () => {
     phone: '',
     officePhone: '',
     officePhoneTwo: '',
-    gender: '',
+    gender: '0',
     roleId: undefined,
     isPrimary: '1',
     addressDetail: '',

+ 21 - 10
src/views/customer/customerFile/customerInfo/components/addInvoiceDialog.vue

@@ -23,14 +23,9 @@
 
       <el-row :gutter="20">
         <el-col :span="24">
-          <el-form-item label="开户行名称" prop="bankName">
-            <el-select v-model="form.bankName" placeholder="请选择" class="w-full" filterable>
-              <el-option label="中国工商银行" value="中国工商银行" />
-              <el-option label="中国农业银行" value="中国农业银行" />
-              <el-option label="中国银行" value="中国银行" />
-              <el-option label="中国建设银行" value="中国建设银行" />
-              <el-option label="交通银行" value="交通银行" />
-              <el-option label="招商银行" value="招商银行" />
+          <el-form-item label="开户行名称" prop="bankId">
+            <el-select v-model="form.bankId" placeholder="请选择" class="w-full" filterable>
+              <el-option v-for="bank in bankList" :key="bank.id" :label="`${bank.bnId} , ${bank.bnName}`" :value="bank.id" />
             </el-select>
           </el-form-item>
         </el-col>
@@ -64,8 +59,7 @@
         <el-col :span="24">
           <el-form-item label="是否主账号" prop="isPrimaryAccount">
             <el-radio-group v-model="form.isPrimaryAccount">
-              <el-radio value="0">是</el-radio>
-              <el-radio value="1">否</el-radio>
+              <el-radio v-for="dict in sys_platform_yes_no" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
             </el-radio-group>
           </el-form-item>
         </el-col>
@@ -83,7 +77,12 @@
 
 <script setup lang="ts">
 import type { InvoiceInfoForm } from '@/api/customer/customerFile/invoiceInfo/types';
+import { listBank } from '@/api/company/bank';
+import { BankVO } from '@/api/company/bank/types';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { sys_platform_yes_no } = toRefs<any>(proxy?.useDict('sys_platform_yes_no'));
 
+const bankList = ref<BankVO[]>([]);
 interface Props {
   modelValue: boolean;
   editData?: InvoiceInfoForm;
@@ -150,6 +149,18 @@ const handleConfirm = async () => {
   }
 };
 
+// 获取银行列表
+const getBankList = async () => {
+  try {
+    const res = await listBank({ pageNum: 1, pageSize: 9999, isShow: '0' });
+    bankList.value = res.rows || [];
+  } catch (error) {
+    console.error('获取银行列表失败', error);
+  }
+};
+onMounted(() => {
+  getBankList();
+});
 // 关闭
 const handleClose = () => {
   formRef.value?.resetFields();