浏览代码

产品档案-分类查询条件下拉框配置

jingbb 1 周之前
父节点
当前提交
22cfdd676d
共有 1 个文件被更改,包括 23 次插入1 次删除
  1. 23 1
      src/views/BasicData/productArchive.vue

+ 23 - 1
src/views/BasicData/productArchive.vue

@@ -7,7 +7,7 @@
                     <a-col :md="6" :sm="8">
                         <a-form-item label="分类(class)">
                             <!-- <a-input placeholder="请输入" v-model:value="queryParams.classId"></a-input> -->
-                            <JDictSelectTag v-model:value="queryParams.classId" placeholder="请选择" dictCode="project-class"/>
+                            <JSelectInput   v-model:value="queryParams.classId"  placeholder="请选择" :options="classOption" ></JSelectInput>
                         </a-form-item>
                     </a-col>
                     <a-col :md="6" :sm="8">
@@ -142,8 +142,10 @@
     import { message } from 'ant-design-vue';
     import { filterObj, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
     import { JDictSelectTag} 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)',
@@ -295,6 +297,7 @@
     onMounted(() => {
         //初始加载页面
         loadData();
+        getOptiom()
     });
     function loadData(){
         let params = getQueryParams();
@@ -326,6 +329,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 searchQuery(){
         loadData();
     }