瀏覽代碼

产品档案-分类下拉框

jingbb 5 月之前
父節點
當前提交
b0b05bf151
共有 1 個文件被更改,包括 23 次插入1 次删除
  1. 23 1
      src/views/BasicData/components/productArchiveModel.vue

+ 23 - 1
src/views/BasicData/components/productArchiveModel.vue

@@ -13,7 +13,7 @@
            <a-row :gutter="24">
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="classId" label="分类(class)">
-                   <JDictSelectTag v-model:value="model.classId" placeholder="请选择" dictCode="project-class"/>
+                <JSelectInput   v-model:value="model.classId"  placeholder="请选择" :options="classOption" ></JSelectInput>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
@@ -105,12 +105,14 @@
   import { defHttp } from '/@/utils/http/axios';
   import { message } from 'ant-design-vue';
   import { JDictSelectTag} from '/@/components/Form';
+  import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
   import { ref, reactive, toRaw, toRefs, watch, nextTick, onMounted, getCurrentInstance } from 'vue';
   const emit = defineEmits([ 'success']); //定义emit
   const form = ref()
   var visible = ref(false)
   let title = ref('')
   let loading = ref(false)
+  let classOption = ref([])
   let model = ref({
     classId:'',
     code:'',
@@ -171,6 +173,25 @@
           });
     
   }
+  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 handleCancel() {
     visible.value = false
     form.value.resetFields()
@@ -185,6 +206,7 @@
         title.value = '编辑档案(edit)'
         model.value = record
     }
+    getOptiom()
   }
   
   defineExpose({