瀏覽代碼

fix: 委托 客户管理 选择

32197351@qq.com 2 年之前
父節點
當前提交
05d11c26a5
共有 1 個文件被更改,包括 74 次插入27 次删除
  1. 74 27
      itdmWeb/src/views/module-iTDM/weituo/modules/step/Step1.vue

+ 74 - 27
itdmWeb/src/views/module-iTDM/weituo/modules/step/Step1.vue

@@ -5,7 +5,20 @@
     <a-row>
       <a-col :span="24">
         <a-form-model-item label="委托单位名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weituoClient">
-          <a-input v-model="model.weituoClient" placeholder="请输入委托单位名称" :disabled="formDisabled"></a-input>
+          <a-auto-complete
+            :disabled="formDisabled"
+            v-model="model.weituoClient"
+            placeholder="input here"
+            @select="handleSelect"
+            @search="querySearch"
+          >
+          <template slot="dataSource">
+            <a-select-option v-for="email in restaurants" :key="email.weituiClient">{{email.weituiClient}}</a-select-option>
+          </template>
+
+
+          </a-auto-complete>
+
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
@@ -20,18 +33,18 @@
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="委托电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weituoPhone">
-          <a-input v-model="model.weituoPhone" placeholder="请输入委托电话" :disabled="formDisabled" ></a-input>
+          <a-input v-model="model.weituoPhone" placeholder="请输入委托电话" :disabled="formDisabled"></a-input>
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="委托邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weituoEmail">
-          <a-input v-model="model.weituoEmail" placeholder="请输入委托邮箱" :disabled="formDisabled" ></a-input>
+          <a-input v-model="model.weituoEmail" placeholder="请输入委托邮箱" :disabled="formDisabled"></a-input>
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
         <a-form-model-item label="报告用章" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bgyz">
           <j-multi-select-tag v-model="model.bgyz" placeholder="请选择报告形式" :disabled="formDisabled"
-                             dictCode="weituo.bgyz" />
+                              dictCode="weituo.bgyz" />
         </a-form-model-item>
       </a-col>
       <a-col :span="24">
@@ -84,6 +97,7 @@ export default {
   components: {},
   data() {
     return {
+      restaurants: [],
       model: {},
       labelCol: {
         xs: { span: 24 },
@@ -125,27 +139,58 @@ export default {
   },
   created() {
 
+    this.initweituo()
+
   },
   computed: {
-    formDisabled(){
+    formDisabled() {
       return this.disabled
-    },
+    }
   },
 
   methods: {
 
+    initweituo() {
+      getAction('/ItdmWtkehu/itdmWtkehu/olist', {}).then((res) => {
+        if (res.success) {
+          this.restaurants = res.result
+        }
+      })
+    },
+    // 带输入建议的输入框
+    querySearch(queryString) {
+      var restaurants = this.restaurants
+      var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
+      console.log(queryString, results)
+      // 调用 callback 返回建议列表的数据
+
+      this.restaurants=results
+    },
+    createFilter(queryString) {
+      return (restaurant) => {
+        return (restaurant.weituiClient.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
+      }
+    },
+    // 选择委托单位
+    handleSelect(item) {
+      var v = this.restaurants.filter(i => i.weituiClient === item)[0]
+      this.model.weituoAddress = v.weituiAddress
+      this.model.weituoEmail = v.weituiEmail
+      this.model.weituoLxr = v.weituiLxr
+      this.model.weituoPhone = v.weituiPhone
+    },
+
     init() {
       const data = JSON.parse(sessionStorage.getItem('data'))
 
       if (data != null) {
         this.model = data
 
-
-
-
       }
     },
-
+    handleAsyncChange(value) {
+      console.log(value)
+    },
     nextStep() {
       const data = {
         weituoClient: this.model.weituoClient,
@@ -175,21 +220,23 @@ export default {
 </script>
 
 <style scoped>
-  .next{
-    width: 35%;
-    margin-left: 20px;
-    margin-right: 20px;
-    margin-top: 20px;
-  }
-  .buttonAll{
-    width: 100%;
-    align-items: center;
-    justify-content: center;
-  }
-  .all{
-    width: 100%;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-  }
+.next {
+  width: 35%;
+  margin-left: 20px;
+  margin-right: 20px;
+  margin-top: 20px;
+}
+
+.buttonAll {
+  width: 100%;
+  align-items: center;
+  justify-content: center;
+}
+
+.all {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
 </style>