فهرست منبع

Merge branch 'greenUrgent' into redUrgent

# Conflicts:
#	src/Form/salerPrivatecustomer/add.vue
qymljy 1 سال پیش
والد
کامیت
caa80019c2
2فایلهای تغییر یافته به همراه97 افزوده شده و 86 حذف شده
  1. 12 86
      src/Form/salerPrivatecustomer/add.vue
  2. 85 0
      src/template/businessInquiry/index.vue

+ 12 - 86
src/Form/salerPrivatecustomer/add.vue

@@ -18,54 +18,13 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <el-popover
-                  placement="right"
-                  width="900"
-                  v-model="businessShow"
-                  trigger="manual">
-                <div style="margin-bottom: 10px;display: flex;justify-content: space-between">
-                  <el-input
-                      style="width:300px;"
-                      placeholder="请输入内容"
-                      v-model="form.enterprisename"
-                      clearable
-                      @clear="businessSearch"
-                      size="mini"
-                      @keyup.enter.native="businessSearch">
-                    <i slot="prefix" class="el-icon-search" @click="businessSearch" ></i>
-                  </el-input>
-                  <el-button style="color: #333333;" size="mini" @click="businessShow = false">关闭</el-button>
-                </div>
-                <el-table :data="businessData" @row-click="businessSelect" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
-                  <el-table-column width="260" label="客户名称">
-                    <template slot-scope="scope">
-                      <span style="margin-left: 10px">{{ scope.row.companyName?scope.row.companyName:'--' }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column  label="客户地址">
-                    <template slot-scope="scope">
-                      <span style="margin-left: 10px">{{ scope.row.address?scope.row.address:'--' }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column width="200"  label="客户税号">
-                    <template slot-scope="scope">
-                      <span style="margin-left: 10px">{{ scope.row.taxNum?scope.row.taxNum:'--' }}</span>
-                    </template>
-                  </el-table-column>
-                </el-table>
-                <el-button size="mini" type="primary" style="width: 100%" @click="businessSearch" slot="reference" :disabled="form.enterprisename === ''">工商查询</el-button>
-              </el-popover>
+              <businessInquiry ref="businessRef" @businessData="businessSelect" :keyword="form.enterprisename"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="企业简称:" prop="abbreviation">
                 <el-input v-model="form.abbreviation" placeholder="请输入企业简称" style="width: 100%"></el-input>
               </el-form-item>
             </el-col>
-<!--            <el-col :span="24">
-              <el-form-item label="erp编号:" prop="erpagentnum">
-                <el-input v-model="form.erpagentnum" placeholder="请输入erp编号" style="width: 100%"></el-input>
-              </el-form-item>
-            </el-col>-->
             <el-col :span="24" >
               <el-form-item label="客户类型:" prop="type">
                 <el-select v-model="form.type" placeholder="请选择客户类型" style="width: 100%">
@@ -74,8 +33,6 @@
                       :key="item.value"
                       :label="item.value"
                       :value="item.value">
-<!--                    <span style="float: left">{{ item.value }}</span>
-                    <span v-if="item.remarks !== ''" style="float: right; color: #8492a6; font-size: 10px">{{ item.remarks }}</span>-->
                     <span style="float: left">{{ item.value }}</span>
                     <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>
                   </el-option>
@@ -110,19 +67,6 @@
                 </el-select>
               </el-form-item>
             </el-col>
-<!--            <el-col :span="24">
-              <el-form-item label="客户行业:" >
-                <el-select v-model="form.industry" placeholder="请选择所属行业" style="width: 100%">
-                  <el-option
-                      v-for="item in options.industryData"
-                      :key="item.value"
-                      :label="item.value"
-                      :value="item.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>-->
-
             <el-col :span="24">
               <el-form-item  label="客户行业:" prop="industry">
                 <el-select
@@ -355,9 +299,10 @@ import enterprise from '@/SDrpManagement/salerPrivatecustomer/components/enterpr
 // import duplicateCheck from "@/SDrpManagement/salerPrivatecustomer/components/duplicateCheck";
 import duplicateCheck from "@/components/duplicatesCheck/customerCheck";
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
 export default {
   name: "add",
-  components:{enterprise,duplicateCheck,contactsNewTemplate},
+  components:{enterprise,duplicateCheck,contactsNewTemplate,businessInquiry},
   data(){
     return {
       activeName:'first',
@@ -409,7 +354,7 @@ export default {
           sys_phonebookid:0
         },
       },
-      value:'',
+      value:[],
       options:{
         type:[],
         parentCustomers:[],
@@ -540,51 +485,31 @@ export default {
       this.queryCustomerGrade()
       this.enterpriseContactList()
     },
-    /*工商查询*/
-    async businessSearch(){
-      this.businessParam.content.keyword = this.form.enterprisename
-      const res = await this.$api.requested(this.businessParam)
-      console.log(res,"工商查询结果")
-      this.businessData = res.data
-      this.total = res.total
-      this.currentPage = res.pageNumber
-      this.businessShow = true
-    },
     /*选择工商信息*/
-    businessSelect(val){
-      console.log("选择的工商信息",val)
+    businessSelect(val,regProvince){
       this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        this.businessShow = false
+        this.$refs.businessRef.businessShow = false
         this.form.enterprisename = val.companyName
         this.form.address = val.address === "-" ? '' : val.address
         this.form.taxno = val.taxNum
-        this.value = [val.regProvince,val.regCity,val.regArea]
-        this.form.province = val.regProvince
+        this.value = [regProvince,val.regCity,val.regArea]
+        this.form.province = regProvince
         this.form.city = val.regCity
         this.form.county = val.regArea
         this.form.contact = val.legalPerson
+        this.form.telephone = val.phone
       }).catch(() => {
-        this.businessShow = false
+        this.$refs.businessRef.businessShow = false
         this.$message({
           type: 'info',
           message: '已取消更新'
         });
       })
     },
-    /*handleSizeChange(val) {
-      // console.log(`每页 ${val} 条`);
-      this.param.content.pageSize = val
-      this.businessSearch()
-    },
-    handleCurrentChange(val) {
-      // console.log(`当前页: ${val}`);
-      this.param.content.pageNumber = val
-      this.businessSearch()
-    },*/
     /*查重检查*/
     onCheck(){
       this.$refs.form.validate((valid) => {
@@ -719,7 +644,8 @@ export default {
 
       this.form = Object.assign({},this.form,{province:val[0],city:val[1],county:val[2]})
       this.$refs.form.validateField('province')
-
+      console.log(val,'选择222')
+      console.log(this.value,'3333')
     },
     /*客户分类*/
     async gradeList(){

+ 85 - 0
src/template/businessInquiry/index.vue

@@ -0,0 +1,85 @@
+<template>
+  <div>
+    <el-popover
+        placement="right"
+        width="900"
+        v-model="businessShow"
+        trigger="manual">
+      <div style="margin-bottom: 10px;display: flex;justify-content: space-between">
+        <el-input style="width:200px;" placeholder="搜索" :suffix-icon="param.content.keyword?param.content.keyword.length > 0?'':'':'el-icon-search'"
+                  v-model="param.content.keyword" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="clearSearchValue" size="small"
+                  class="input-with-select inline-16 layout_search__panel" clearable>
+        </el-input>
+        <el-button style="color: #333333;" size="mini" @click="businessShow = false">关闭</el-button>
+      </div>
+      <el-table :data="list" @row-click="businessSelect" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+        <el-table-column width="260" label="名称">
+          <template slot-scope="scope">
+            <span style="margin-left: 10px">{{ scope.row.companyName?scope.row.companyName:'--' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column  label="法人">
+          <template slot-scope="scope">
+            <span style="margin-left: 10px">{{ scope.row.legalPerson?scope.row.legalPerson:'--' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column width="200"  label="税号">
+          <template slot-scope="scope">
+            <span style="margin-left: 10px">{{ scope.row.taxNum?scope.row.taxNum:'--' }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-button size="mini" type="primary" style="width: 100%" @click="onSearch" slot="reference" :disabled="keyword === ''">工商查询</el-button>
+    </el-popover>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index",  //工商查询
+  props:['keyword'],
+  data(){
+    return {
+      businessShow:false,
+      param:{
+        "id": "20221208103601",
+        "content": {
+          "keyword":"",
+          "pageNumber":1,
+          "pageSize":5
+        },
+      },
+      list:[]
+    }
+  },
+  methods:{
+    onSearch(){
+      this.businessShow = true
+      this.param.content.keyword = this.keyword
+      this.listData()
+    },
+    async listData(){
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+    },
+    clearSearchValue () {
+      this.$store.dispatch('clearSearchValue')
+      this.listData(this.param.content.pageNumber = 1)
+    },
+    async businessSelect(val){
+      const res = await this.$api.requested({
+        "id": "2024060715002601",
+        "content": {
+          "companyName":val.companyName
+        },
+      })
+      this.$emit('businessData',res.data,val.regProvince)
+    }
+  }
+
+}
+</script>
+
+<style scoped>
+
+</style>