소스 검색

发运明细-报关要素-报关品名模糊查询

jbb 2 년 전
부모
커밋
add10bab7a
1개의 변경된 파일17개의 추가작업 그리고 5개의 파일을 삭제
  1. 17 5
      src/views/shipment-details/declareElementsModal.vue

+ 17 - 5
src/views/shipment-details/declareElementsModal.vue

@@ -41,7 +41,15 @@
               </a-col>
             <a-col :md="6" :sm="8">
                 <a-form-model-item label="报关品名" prop="declarationName" :rules="[{ required: true, message: '请输入报关品名!' }]">
-                  <a-input placeholder="请输入报关品名" v-model="declareElements.declarationName"></a-input>
+                  <!-- <a-input placeholder="请输入报关品名" v-model="declareElements.declarationName"></a-input> -->
+                  <a-select  v-model="declareElements.declarationName"  show-search     :filterOption="filterOption"> 
+                      <a-select-option
+                     v-for="(item,index) in productNameOption"
+                     :key="index"
+                     :value="item.value">
+                     {{item.text}}
+                     </a-select-option>
+                   </a-select>
                 </a-form-model-item>
              </a-col>
 
@@ -246,16 +254,20 @@ export default {
     //品名下拉框数据
     //获取类别数据字典
     getOption(){
-      debugger
       Dictionaries({code:'customs_declaration_elements'}).then(res => {
          this.arrOption = res
       })
-      debugger
-      Dictionaries({code:'declarationName'}).then(res=>{
+      Dictionaries({code:'declaration_name'}).then(res=>{
          this.productNameOption = res
-         debugger
       })
     },
+    //报关品名下拉框模糊搜索
+    filterOption(input, option) {
+      return (
+        option.componentOptions.children[0].text
+          .toLowerCase()
+          .indexOf(input.toLowerCase()) >= 0
+      )},
     //英文品名转化大写
     convertUppercase(val){
       this.declareElements.englishProductName = val.toUpperCase()