Explorar el Código

采购报价单-筛选条件修改

jingbb hace 4 meses
padre
commit
c834e97237

+ 1 - 1
src/views/purchase/purchaseInquiryForm/purchaseInquiryForm.api.ts

@@ -16,7 +16,7 @@ enum Api {
   purCodeInquiryFormProductList = '/purCode/purInquiryForm/queryPurInquiryFormProductByMainId',
   submitBatch='/purCode/purInquiryForm/submitBatch',
   cancelSubmitBatch='/purCode/purInquiryForm/returnSubmitBatch',
-  supplierList='/cuspCode/cuspSupplierProfile/list?pageSize=-1',
+  supplierList='/cuspCode/cuspSupplierProfile/list',
   customerList='/cuspCode/cuspCustomerProfile/list',
   projectList='/baseCode/baseProjectArchive/list',
   classList='baseCode/baseProductClass/list',

+ 10 - 2
src/views/purchase/purchaseQuotationFrm/PurchaseQuotationForm.api.ts

@@ -16,7 +16,9 @@ enum Api {
   purCodeQuotationFormProductList = '/purCode/purPurchaseQuotation/queryPurPurchaseInquiryProductByMainId',
   submitBatch='/purCode/purPurchaseQuotation/submitBatch',
   cancelSubmitBatch='/purCode/purPurchaseQuotation/returnSubmitBatch',
-  classList='baseCode/baseProductClass/list' 
+  classList='baseCode/baseProductClass/list',
+  supplierList='/cuspCode/cuspSupplierProfile/list',
+  projectList='/baseCode/baseProjectArchive/list',
 }
 /**
  * 导出api
@@ -123,4 +125,10 @@ export const cancelBatchSubmit = (params, handleSuccess) => {
       });
     }
   });
-}
+}
+//获取供应商列表
+export const supplierOption = (params) => defHttp.get({url: Api.supplierList, params});
+
+
+//获取项目下拉框列表
+export const ProjectOption = (params) => defHttp.get({ url: Api.projectList, params });

+ 21 - 25
src/views/purchase/purchaseQuotationFrm/components/SelectSupplierInquiryModal.vue

@@ -25,7 +25,7 @@
                     <a-col :md="6" :sm="8">
                         <a-form-item label="询价项目(inquiry project)">
                             <ApiSelect
-                                :api="projectListList"
+                                :api="ProjectOption"
                                 showSearch
                                 v-model:value="queryParams.inquiryProject"
                                 optionFilterProp="label"
@@ -39,7 +39,15 @@
                     <template v-if="toggleSearchStatus">
                         <a-col :md="6" :sm="8">
                             <a-form-item label="询价供应商(inquiry supplier)"  :label-col="labelCol1" :wrapper-col="wrapperCol1">
-                                <a-input placeholder="请输入" v-model:value="queryParams.inquirySuppiler" ></a-input>
+                                <ApiSelect
+                                :api="supplierOption"
+                                showSearch
+                                v-model:value="queryParams.inquirySuppiler"
+                                optionFilterProp="label"
+                                resultField="records"
+                                labelField="name"
+                                valueField="id"
+                             />
                             </a-form-item>
                         </a-col>
                         <a-col :md="6" :sm="8">
@@ -49,7 +57,15 @@
                         </a-col>
                         <a-col :md="6" :sm="8">
                             <a-form-item label="产品分类(production class)" >
-                                <JSelectInput   v-model:value="queryParams.productionClass"  placeholder="请选择" :options="classOption" ></JSelectInput>
+                                <ApiSelect
+                                :api="ClassList"
+                                showSearch
+                                v-model:value="queryParams.productionClass"
+                                optionFilterProp="label"
+                                resultField="records"
+                                labelField="name"
+                                valueField="id"
+                             />
                             </a-form-item>
                         </a-col>
                         <a-col :md="6" :sm="8">
@@ -114,9 +130,8 @@
     import { filterObj } from '/@/utils/common/compUtils';
     import { JDictSelectTag} from '/@/components/Form';
     import {  ApiSelect, } from '/@/components/Form/index';
-    import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
+    import {ProjectOption,supplierOption,ClassList} from '../PurchaseQuotationForm.api';
     const emit = defineEmits([ 'selectCustomerInquiry']); //定义emit
-    let classOption = ref([])
     var visible = ref(false)
     const columns = [
         {
@@ -317,25 +332,7 @@
         pagination.value.pageSize = paginations.pageSize;
         loadData()
     };
-    function getOptiom(){
-    defHttp
-        .get({ url: 'baseCode/baseProductClass/list'}, { isTransformResponse: false })
-        .then((res) => {
-            if (res.success) {
-              classOption.value = []
-              res.result.records.forEach(element => {
-                  var obj = {
-                    label: element.name?element.name:'无名称请维护',
-                    value: element.id?element.id:''
-                  };
-                  classOption.value.push( obj)
-              });    
-            }
-        })
-        .finally(() => {
-            // loading.value = false;
-        });
-  }
+    
     function searchQuery(){
         loadData();
     }
@@ -417,7 +414,6 @@
             fatherSourceCode.value = ''
         }
         loadData()
-        getOptiom()
     }
     function changeBillDate(prop){
        if(prop){

+ 35 - 56
src/views/purchase/purchaseQuotationFrm/purchaseQuotationFormList.vue

@@ -18,15 +18,33 @@
           </a-col>           
           <template v-if="toggleSearchStatus">
             <a-col :lg="8">
-              <a-form-item name="quotatioProject">
+              <a-form-item name="quotationProject">
                 <template #label><span title="报价项目(quotation project)">报价项目(quotation project)</span></template>
-                <a-input placeholder="请输入询价项目(inquiry project)" v-model:value="queryParam.quotatioProject" allow-clear AutoComplete="off"></a-input>
+                <ApiSelect
+                    :api="ProjectOption"
+                    showSearch
+                    v-model:value="queryParam.quotationProject"
+                    :filterOption="false"
+                    resultField="records"
+                    labelField="name"
+                    valueField="id"
+                    :params='{pageSize:-1}'
+                  />
               </a-form-item>
             </a-col>
             <a-col :lg="8">
               <a-form-item name="quotationSuppiler">
                 <template #label><span title="报价供应商(quotation supplier)">报价供应商(quotation supplier)</span></template>
-                <JSelectInput   v-model:value="queryParam.quotationSuppiler"  placeholder="请选择" :options="supplierOption" ></JSelectInput>
+                <ApiSelect
+                  :api="supplierOption"
+                  showSearch
+                  v-model:value="queryParam.quotationSuppiler"
+                  :filterOption="false"
+                  resultField="records"
+                  labelField="name"
+                  valueField="id"
+                  :params='{pageSize:-1}'
+                />
               </a-form-item>
             </a-col>
             <a-col :lg="8">
@@ -38,7 +56,16 @@
             <a-col :lg="8">
               <a-form-item name="productionClass" >
                 <template #label><span title="产品分类(production class)">产品分类(production class)</span></template>
-                <JSelectInput   v-model:value="queryParam.productionClass"  placeholder="请选择" :options="classOption" ></JSelectInput>
+                <ApiSelect
+                  :api="ClassList"
+                  showSearch
+                  v-model:value="queryParam.productionClass"
+                  :filterOption="false"
+                  resultField="records"
+                  labelField="name"
+                  valueField="id"
+                  :params='{pageSize:-1}'
+                />
               </a-form-item>
             </a-col>
             <a-col :lg="8">
@@ -133,11 +160,10 @@
   import {useModal} from '/@/components/Modal';
   import PurchaseQuotationFormModal from './components/PurchaseQuotationFormModal.vue'
   import {columns,} from './PurchaseQuotationForm.data';
-  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit} from './PurchaseQuotationForm.api';
+  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit,ProjectOption,supplierOption,ClassList} from './PurchaseQuotationForm.api';
   import { cloneDeep } from "lodash-es";
   import { defHttp } from '/@/utils/http/axios';
-  import { JDictSelectTag} from '/@/components/Form';
-  import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
+  import { JDictSelectTag,ApiSelect} from '/@/components/Form';
   import { message } from 'ant-design-vue';
   import { useGlobSetting } from '/@/hooks/setting';
   const { domainUrl } = useGlobSetting();
@@ -146,8 +172,6 @@
   const queryParam = reactive<any>({});
   //注册model
   const [registerModal, {openModal}] = useModal();
-  var classOption = ref([]);
-  var supplierOption = ref([])
    //注册table数据
   const { tableContext,onExportXls } = useListPage({
       tableProps:{
@@ -181,11 +205,6 @@
 
   const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
 
-   // 自动请求并暴露内部方法
-   onMounted(() => {
-    getOptiom()
-    getSupplierOption()
-  });
 
    /**
     * 新增事件
@@ -205,48 +224,8 @@
        isUpdate: true,
        showFooter: true,
      });
-   }
-  //  产品分类
-  function getOptiom(){
-        defHttp
-            .get({ url: 'baseCode/baseProductClass/list'}, { isTransformResponse: false })
-            .then((res) => {
-                if (res.success) {
-                  classOption.value = []
-                  res.result.records.forEach(element => {
-                      var obj = {
-                        label: element.name?element.name:'无名称请维护',
-                        value: element.id?element.id:''
-                      };
-                      classOption.value.push( obj)
-                  });    
-                }
-            })
-            .finally(() => {
-                // loading.value = false;
-            });
-  }
-  // 供应商档案
-  function getSupplierOption(){
-        defHttp
-            .get({ url: '/cuspCode/cuspSupplierProfile/list'}, { isTransformResponse: false })
-            .then((res) => {
-                if (res.success) {
-                  supplierOption.value = []
-                  res.result.records.forEach(element => {
-                      var obj = {
-                        label: element.name?element.name:'无名称请维护',
-                        value: element.id?element.id:''
-                      };
-                      supplierOption.value.push( obj)
-                  });    
-                }
-            })
-            .finally(() => {
-                // loading.value = false;
-            });
-      }
-   /**
+    }
+      /**
     * 详情
    */
   function handleDetail(record: Recordable) {