فهرست منبع

客户名称搜索功能

lizhenhao 3 سال پیش
والد
کامیت
d967138912
2فایلهای تغییر یافته به همراه88 افزوده شده و 6 حذف شده
  1. 1 1
      src/api/sys/WorkClientService.js
  2. 87 5
      src/views/modules/sys/workClient/WorkClientForm.vue

+ 1 - 1
src/api/sys/WorkClientService.js

@@ -40,7 +40,7 @@ export default class WorkClientService {
     return request({
       url: '/workClientInfo/workClientInfo/findListByName',
       method: 'get',
-      params: {id: name}
+      params: {name: name}
     })
   }
 }

+ 87 - 5
src/views/modules/sys/workClient/WorkClientForm.vue

@@ -11,16 +11,45 @@
       <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
                label-width="150px">
         <el-row  :gutter="15">
-          <el-col :span="12">
-            <el-form-item label="客户名称" prop="workClientInfo.name"
-                :rules="[
+          <el-col :span="18">
+            <el-form-item label="客户名称" prop="workClientInfo.name" :rules="[
                   {required: true, message:'请输入客户名称', trigger:'blur'}
                 ]">
               <el-input v-model="inputForm.workClientInfo.name" placeholder="请输入客户名称"></el-input>
             </el-form-item>
           </el-col>
+            <el-col :span="6">
+            <el-popover
+              v-model="visable"
+              placement="left"
+              width="400"
+              trigger="click">
+              <vxe-table
+                border="inner"
+                auto-resize
+                resizable
+                :row-config="{isHover: true}"
+                :data="gridData"
+                :checkbox-config="{}"
+                :row-style="rowStyle"
+                @cell-click="rowClick"
+                :show-header="false"
+              >
+                <vxe-column title="" field="name" ></vxe-column>
+              </vxe-table>
+
+              <el-button type="info" slot="reference" @click="getPopTable" style="width: 100%" plain>查询</el-button>
+
+            </el-popover>
+            <el-form-item>
+
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row  :gutter="15">
 
           <el-col :span="12">
+
             <el-form-item label="是否拥有信用代码" prop="workClientInfo.hasUscc"
                  :rules="[
                   {required: true, message:'请选择是否拥有信用代码', trigger:'blur'}
@@ -364,6 +393,8 @@
   export default {
     data () {
       return {
+        visable: false,
+        gridData: [],
         radio: 0,
         tableData: [],
         dataList: [],
@@ -372,6 +403,36 @@
         method: '',
         visible: false,
         loading: false,
+        returnForm: {
+          workClientInfo: {
+            name: '',
+            lawerPresintnamename: '',
+            lawerPresint: '',
+            orUnicode: '',
+            companyType: '',
+            companyIndustry: '',
+            clientType: '',
+            creditRank: '',
+            areaId: '',
+            zipCode: '',
+            fax: '',
+            taxId: '',
+            email: '',
+            address: '',
+            registerAddress: '',
+            companyUrl: '',
+            remarks: '',
+            companyId: '',
+            officeId: '',
+            areaParentIds: '',
+            telephone: '',
+            hasUscc: '',
+            uscCode: '',
+            number: '',
+            deputy: '',
+            deputyList: []
+          }
+        },
         inputForm: {
           workClientInfo: {
             name: '',
@@ -622,10 +683,9 @@
               this.inputForm.workClientInfo.deputyList = deputyList
               this.inputForm.workClientInfo = JSON.parse(JSON.stringify(this.inputForm.workClientInfo))
               this.inputForm.workClientInfo.hasUscc = JSON.stringify(this.inputForm.workClientInfo.hasUscc)
-              console.log(this.inputForm.workClientInfo)
-              this.loading = false
             })
           }
+          this.loading = false
         })
       },
       // 表单提交
@@ -838,6 +898,28 @@
       closeXTable () {
         this.bankInfos = []
         this.linkmanInfos = []
+      },
+      rowStyle (event) {
+        return 'cursor:pointer;'
+      },
+      async rowClick (event) {
+        let id = this.gridData[event.rowIndex].id
+        await this.workClientService.findById(id).then((data) => {
+          this.inputForm.workClientInfo.hasUscc = JSON.stringify(data.data.workClientInfo.hasUscc)
+          this.inputForm.workClientInfo.uscCode = data.data.workClientInfo.uscCode
+          this.inputForm.workClientInfo.areaId = data.data.workClientInfo.areaId
+          this.inputForm.workClientInfo.areaId = data.data.workClientInfo.areaId
+          this.inputForm.workClientInfo.registerAddress = data.data.workClientInfo.registerAddress
+        })
+        this.visable = false
+      },
+      getPopTable () {
+        let name = this.inputForm.workClientInfo.name
+        if (name !== null && name !== undefined && name !== '') {
+          this.workClientService.findListByName(name).then(({data}) => {
+            this.gridData = data
+          })
+        }
       }
     }
   }