Просмотр исходного кода

基础数据-修改客户下拉框

jingbb 3 месяцев назад
Родитель
Сommit
5433ef7875

+ 6 - 34
src/views/baseCode/ProjectArchive/BaseProjectArchive.data.ts

@@ -59,24 +59,10 @@ export const searchFormSchema: FormSchema[] = [
   {
     label: '客户(customer)',
     field: 'customerId',
-    component: 'ApiSelect',
+    component: 'JSelect',
     componentProps: {
-      // mode: 'multiple',//multiple: 多选;不填写为单选
-      //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }}
-      api: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list',params:{pageSize: -1}}),
-      //数值转成String
-      numberToString: false,
-      //标题字段
-      labelField: 'name',
-      //值字段
-      valueField: 'id',
-      //请求参数
-      params: { pageSize: -1 },
-      //返回结果字段
-      resultField: 'records',
-      filterOption: 'true',
-      optionFilterProp: 'label',
-      showSearch: 'true',
+      getOptionUrl: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1'}),
+      showField:"currency+name"
     },
     //colProps: {span: 6},
   },
@@ -104,28 +90,14 @@ export const formSchema: FormSchema[] = [
   {
     label: '客户(customer)',
     field: 'customerId',
-    component: 'ApiSelect',
+    component: 'JSelect',
     // componentProps:{
     //     dictCode: 'customer',
     //  },
     required: true,
     componentProps: {
-      // mode: 'multiple',//multiple: 多选;不填写为单选
-      //请求api,返回结果{ result: { records: [{'id':'1',name:'scott'},{'id':'2',name:'小张'}] }}
-      api: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list',params:{pageSize: -1}}),
-      //数值转成String
-      numberToString: false,
-      //标题字段
-      labelField: 'name',
-      //值字段
-      valueField: 'id',
-      //请求参数
-      params: { pageSize: -1 },
-      //返回结果字段
-      resultField: 'records',
-      filterOption: 'true',
-      optionFilterProp: 'label',
-      showSearch: 'true',
+      getOptionUrl: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1'}),
+      showField:"currency+name",
       getPopupContainer: (node) => document.body,
     },
   },

+ 6 - 9
src/views/baseCode/ShipArchive/BaseShipArchive.data.ts

@@ -46,26 +46,23 @@ export const searchFormSchema: FormSchema[] = [
     field: 'imo',
     component: 'JInput',
     labelWidth: 150,
-    //colProps: {span: 6},
+    // colProps: {span: 8},
   },
   {
     label: '船名称(ship name)',
     field: 'shipName',
     labelWidth: 150,
     component: 'JInput',
-    //colProps: {span: 6},
+    // colProps: {span: 8},
+
   },
   {
     label: '关联客户(relate customer)',
     field: 'relateCustomer',
-    component: 'ApiSelect',
+    component: 'JSelect',
     componentProps: {
-      api: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1'}),
-      numberToString: false,
-      labelField: 'name',
-      valueField: 'id',
-      params: {},
-      resultField: 'records',
+      getOptionUrl: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1'}),
+      showField:"currency+name"
     },
     labelWidth: 180,
   },

+ 3 - 10
src/views/baseCode/ShipArchive/BaseShipArchiveRelateCustomer.data.ts

@@ -50,17 +50,10 @@ export const formSchema: FormSchema[] = [
   {
     label: '客户(customer)',
     field: 'customerId',
-    component: 'ApiSelect',
+    component: 'JSelect',
     componentProps: {
-      api: ()=> defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1' }),
-      numberToString: false,
-      labelField: 'name',
-      valueField: 'id',
-      params:{},
-      resultField:'records',
-      optionFilterProp:"label",
-      filterOption:true,
-      showSearch: true,
+      getOptionUrl: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1'}),
+      showField:"currency+name",
       getPopupContainer: (node) => document.body,
     },
     show: ({ values }) => {