瀏覽代碼

客户档案-添加中间人下拉框数据源

jingbb 5 月之前
父節點
當前提交
106206f19c

+ 22 - 6
src/views/cuspCode/CustomerProfile/CuspCustomerProfile.data.ts

@@ -1,9 +1,11 @@
 import {BasicColumn} from '/@/components/Table';
 import {FormSchema} from '/@/components/Table';
-import { rules} from '/@/utils/helper/validator';
-import { render } from '/@/utils/common/renderUtils';
+// import { rules} from '/@/utils/helper/validator';
+// import { render } from '/@/utils/common/renderUtils';
 import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
-import { getWeekMonthQuarterYear } from '/@/utils';
+import { defHttp } from '/@/utils/http/axios';
+import { ref } from 'vue';
+var intermediatorOption = ref([]);
 //列表数据
 export const columns: BasicColumn[] = [
    {
@@ -54,7 +56,7 @@ export const columns: BasicColumn[] = [
    {
     title: '中间人(intermediator)',
     align:"center",
-    dataIndex: 'intermediator'
+    dataIndex: 'intermediator_dictText'
    },
    {
     title: '折扣(discount)',
@@ -341,9 +343,9 @@ export const formSchema: FormSchema[] = [
     field: 'intermediator',
     colProps: {span: 12},
     labelWidth: 200,
-    component: 'JDictSelectTag',
+    component: 'JSelectInput',
     componentProps:{
-        dictCode:"intermediator"
+      options:intermediatorOption
      },
   },
   {
@@ -488,3 +490,17 @@ export function getBpmFormSchema(_formData): FormSchema[]{
 // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
   return formSchema;
 }
+export function getIntermediatorOptions(){
+  let params = {pageSize:'-1',status:1}
+  defHttp.get({url:'/cuspCode/cuspIntermediator/list',params}, { isTransformResponse: false }).then(res=>{
+    if(res){
+      intermediatorOption.value.splice(0,intermediatorOption.value.length);
+        res.result.records.forEach(item=>{
+          intermediatorOption.value.push({
+            label: item.name,
+            value: item.id
+          })
+        })      
+    }
+  })
+}

+ 5 - 3
src/views/cuspCode/CustomerProfile/CuspCustomerProfileList.vue

@@ -37,12 +37,12 @@
 </template>
 
 <script lang="ts" name="cuspCode-cuspCustomerProfile" setup>
-  import {ref, reactive, computed, unref} from 'vue';
+  import {ref, reactive, computed, unref,onMounted} from 'vue';
   import {BasicTable, useTable, TableAction} from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage'
   import {useModal} from '/@/components/Modal';
   import CuspCustomerProfileModal from './components/CuspCustomerProfileModal.vue'
-  import {columns, searchFormSchema, superQuerySchema} from './CuspCustomerProfile.data';
+  import {columns, searchFormSchema, superQuerySchema,getIntermediatorOptions} from './CuspCustomerProfile.data';
   import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './CuspCustomerProfile.api';
   import {downloadFile} from '/@/utils/common/renderUtils';
   import { useUserStore } from '/@/store/modules/user';
@@ -88,7 +88,9 @@
     })
 
   const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
-
+  onMounted(() => {
+    getIntermediatorOptions()
+  })
   // 高级查询配置
   const superQueryConfig = reactive(superQuerySchema);