Browse Source

招标书-下拉框清空

jingbb 5 months ago
parent
commit
bcf72a1329

+ 15 - 9
src/views/saleCode/rfp/SaleRfp.data.ts

@@ -103,7 +103,8 @@ export const searchFormSchema: FormSchema[] = [
       labelWidth:150,
       component: 'JSelectInput',
       componentProps:{
-        options:customerOption
+        options:customerOption,
+        stringToNumber:true
       },
 
       //colProps: {span: 6},
@@ -211,7 +212,9 @@ export const formSchema: FormSchema[] = [
     field: 'projectId',
     component: 'JSelectInput',
     componentProps:{
-      options:projectOption
+      options:projectOption,
+      onChange: (value) => {
+      },
     },
     labelWidth:150,
     dynamicRules: ({model,schema}) => {
@@ -375,12 +378,13 @@ export function getCustomerOptions(){
   let params = {pageSize:'-1',status:1}
   defHttp.get({url:'/cuspCode/cuspCustomerProfile/list',params}, { isTransformResponse: false }).then(res=>{
     if(res){
-      res.result.records.forEach(item=>{
-        customerOption.value.push({
-          label: item.name,
-          value: item.id
-        })
-      })
+        customerOption.value.splice(0,customerOption.value.length);
+        res.result.records.forEach(item=>{
+          customerOption.value.push({
+            label: item.name,
+            value: item.id
+          })
+        })      
     }
   })
 }
@@ -388,10 +392,12 @@ export function getProjectOptions(){
   let params = {pageSize:'-1'}
   defHttp.get({url:'/baseCode/baseProjectArchive/list',params}, { isTransformResponse: false }).then(res=>{
     if(res){
+      projectOption.value.splice(0,projectOption.value.length);
       res.result.records.forEach(item=>{
         projectOption.value.push({
           label: item.name,
-          value: item.id
+          value: item.id,
+          customerName:item.customerId
         })
       })
     }

+ 3 - 3
src/views/saleCode/rfp/components/SaleRfpModal.vue

@@ -1,11 +1,11 @@
 <template>
-  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" width="95%" @ok="handleSubmit">
+  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" width="95%" @ok="handleSubmit" >
       <BasicForm @register="registerForm" name="SaleRfpForm" />
   </BasicModal>
 </template>
 
 <script lang="ts" setup>
-    import {ref, computed, unref} from 'vue';
+    import {ref, computed, unref,watch} from 'vue';
     import {BasicModal, useModalInner} from '/@/components/Modal';
     import {BasicForm, useForm} from '/@/components/Form/index';
     import {formSchema} from '../SaleRfp.data';
@@ -34,7 +34,7 @@
             });
         }
         // 隐藏底部时禁用整个表单
-       setProps({ disabled: !data?.showFooter })
+       setProps({ disabled: !data?.showFooter })       
     });
     //设置标题
     const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));