Kaynağa Gözat

产品分类-下拉框配置

jingbb 1 hafta önce
ebeveyn
işleme
18b7c85dfd

+ 7 - 6
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)">
-                    <a-input placeholder="请输入" v-model:value="model.classId"  AutoComplete='off'/>
+                   <JDictSelectTag v-model:value="model.classId" placeholder="请选择" dictCode="project-class"/>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
@@ -68,22 +68,22 @@
              </a-col>
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="measurementUnit" label="计量单位(measurement unit)">
-                  <a-input  placeholder="请输入" v-model:value="model.measurementUnit" AutoComplete='off'/>
+                <JDictSelectTag v-model:value="model.measurementUnit" placeholder="请选择" dictCode="measurement_unit"/>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="harmfulSubstances" label="有害物质(harmful substances)">
-                  <a-input  placeholder="请输入" v-model:value="model.harmfulSubstances" AutoComplete='off'/>
+                <JDictSelectTag v-model:value="model.harmfulSubstances" placeholder="请选择" dictCode="yes_or_no" stringToNumber/>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="virtualProduct" label="虚拟产品(virtual product)">
-                  <a-input  placeholder="请输入" v-model:value="model.virtualProduct" AutoComplete='off'/>
+                <JDictSelectTag v-model:value="model.virtualProduct" placeholder="请选择" dictCode="yes_or_no" stringToNumber/>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="commissionRebate" label="返佣(commission rebate)">
-                  <a-input  placeholder="请输入" v-model:value="model.commissionRebate" AutoComplete='off'/>
+                <JDictSelectTag v-model:value="model.commissionRebate" placeholder="请选择" dictCode="yes_or_no" stringToNumber/>
                </a-form-item>
              </a-col>
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
@@ -93,7 +93,7 @@
              </a-col>
              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status" label="状态(status)">
-                  <a-input  placeholder="请输入" v-model:value="model.status" AutoComplete='off'/>
+                  <JDictSelectTag v-model:value="model.status" placeholder="请选择" dictCode="valid_status" stringToNumber/>
                </a-form-item>
              </a-col>
            </a-row>
@@ -104,6 +104,7 @@
 <script lang="ts" setup>
   import { defHttp } from '/@/utils/http/axios';
   import { message } from 'ant-design-vue';
+  import { JDictSelectTag} from '/@/components/Form';
   import { ref, reactive, toRaw, toRefs, watch, nextTick, onMounted, getCurrentInstance } from 'vue';
   const emit = defineEmits([ 'success']); //定义emit
   const form = ref()

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

@@ -6,7 +6,8 @@
                 <a-row :gutter="24">
                     <a-col :md="6" :sm="8">
                         <a-form-item label="分类(class)">
-                            <a-input placeholder="请输入" v-model:value="queryParams.classId"></a-input>
+                            <!-- <a-input placeholder="请输入" v-model:value="queryParams.classId"></a-input> -->
+                            <JDictSelectTag v-model:value="queryParams.classId" placeholder="请选择" dictCode="project-class"/>
                         </a-form-item>
                     </a-col>
                     <a-col :md="6" :sm="8">
@@ -47,17 +48,17 @@
                         </a-col>
                         <a-col :md="6" :sm="8">
                             <a-form-item label="状态(status)">
-                                <a-input placeholder="请输入" v-model:value="queryParams.status"></a-input>
+                                <JDictSelectTag v-model:value="queryParams.status" placeholder="请选择" dictCode="valid_status"/>
                             </a-form-item>
                         </a-col>
                         <a-col :md="6" :sm="8">
                             <a-form-item label="虚拟产品(virtual product)" :label-col="labelCol1" :wrapper-col="wrapperCol1">
-                                <a-input placeholder="请输入" v-model:value="queryParams.virtualProduct"></a-input>
+                                <JDictSelectTag v-model:value="queryParams.virtualProduct" placeholder="请选择" dictCode="yes_or_no"/>
                             </a-form-item>
                         </a-col>
                         <a-col :md="6" :sm="8">
                             <a-form-item label="有害物质(harmful substances)" :label-col="labelCol1" :wrapper-col="wrapperCol1">
-                                <a-input placeholder="请输入" v-model:value="queryParams.harmfulSubstances"></a-input>
+                                <JDictSelectTag v-model:value="queryParams.harmfulSubstances" placeholder="请选择" dictCode="yes_or_no"/>
                             </a-form-item>
                         </a-col>
                     </template>
@@ -127,6 +128,7 @@
     import { defHttp } from '/@/utils/http/axios';
     import { message } from 'ant-design-vue';
     import { filterObj, getFileAccessHttpUrl } from '/@/utils/common/compUtils';
+    import { JDictSelectTag} from '/@/components/Form';
     import productArchiveModel from './components/productArchiveModel.vue';
     const productArchiveModelRef = ref()
     const columns = [
@@ -184,20 +186,47 @@
             title: '虚拟产品(virtual product)',
             key: 'virtualProduct',
             dataIndex: 'virtualProduct',
-            align:"center"
+            align:"center",
+            customRender:function (t, r, index) {
+              if(t.text==1){
+                return '是(yes)'
+              }else if(t.text==0){
+                return '否(no)'
+              }else{
+                return ''
+              } 
+            }
         },
         {
             title: '有害物质(harmful substances)',
             key: 'harmfulSubstances',
             dataIndex: 'harmfulSubstances',
             align:"center",
-            width:250
+            width:250,
+            customRender:function (t, r, index) {
+              if(t.text==1){
+                return '是(yes)'
+              }else if(t.text==0){
+                return '否(no)'
+              }else{
+                return ''
+              } 
+            }
         },
         {
             title: '状态(status)',
             key: 'status',
             dataIndex: 'status',
-            align:"center"
+            align:"center",
+            customRender:function (t, r, index) {
+              if(t.text==1){
+                return '启用(enable)'
+              }else if(t.text==0){
+                return '停用(disable)'
+              }else{
+                return ''
+              } 
+            }
         },
         {
             title: '操作(operation)',