Browse Source

产品档案-产品分类查询条件修改

jingbb 2 months ago
parent
commit
8975adf76f
1 changed files with 36 additions and 24 deletions
  1. 36 24
      src/views/BasicData/productArchive.vue

+ 36 - 24
src/views/BasicData/productArchive.vue

@@ -6,8 +6,17 @@
           <a-row :gutter="24">
             <a-col :md="8"  :sm="8">
               <a-form-item label="分类(class)">
-                <!-- <a-input placeholder="请输入" v-model:value="queryParams.classId"></a-input> -->
-                <JSelectInput v-model:value="queryParams.classId" placeholder="请选择" :options="classOption" />
+                <ApiSelect
+                  :api="classOption"
+                  showSearch
+                  v-model:value="queryParams.classId"
+                  :filterOption="true"
+                  resultField="records"
+                  labelField="name"
+                  valueField="id"
+                  :params="{ pageSize: -1 }"
+                  optionFilterProp="label"
+                />
               </a-form-item>
             </a-col>
             <a-col :md="8"  :sm="8">
@@ -147,11 +156,10 @@
   import { defHttp } from '/@/utils/http/axios';
   import { message } from 'ant-design-vue';
   import { filterObj, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
-  import { JDictSelectTag, JInput } from '/@/components/Form';
+  import { JDictSelectTag, JInput ,ApiSelect} from '/@/components/Form';
   import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
   import productArchiveModel from './components/productArchiveModel.vue';
   const productArchiveModelRef = ref();
-  let classOption = ref([]);
   const columns = [
     {
       title: '分类(class)',
@@ -315,7 +323,7 @@
   onMounted(() => {
     //初始加载页面
     loadData();
-    getOptiom();
+    // getOptiom();
   });
   function loadData() {
     let params = getQueryParams();
@@ -347,25 +355,25 @@
     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 getOptiom() {
+  //   defHttp
+  //     .get({ url: 'baseCode/baseProductClass/list', params: {pageSize:-1} }, { 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();
   }
@@ -412,6 +420,10 @@
       searchReset();
     });
   }
+  function classOption(){
+      var params = {pageSize:-1}
+      return defHttp.get({ url: 'baseCode/baseProductClass/list',params})
+  }
 </script>
 <style scoped lang="less">
   /deep/.ant-form-item {