瀏覽代碼

项目商机联系人调整

qymljy 9 月之前
父節點
當前提交
ee5898638d

+ 14 - 8
src/HDrpManagement/projectChange/modules/modules/contacts/components/add.vue

@@ -108,7 +108,7 @@
                         </div>
                         <slot name="footerLeft"></slot>
                       </div>
-                  <el-input readonly  slot="reference" :disabled="form.contactsid !== 0 || !form.sys_phonebookid"  autosize v-model="form.enterprisename" placeholder="请选择关联企业" @input="associatedCustomersList"></el-input>
+                  <el-input readonly  slot="reference" :disabled="form.sys_phonebookid == ''"  autosize v-model="form.enterprisename" placeholder="请选择关联企业" @input="associatedCustomersList"></el-input>
                 </el-popover>
               </el-form-item>
             </el-col>
@@ -238,7 +238,7 @@ export default {
         ownertable: "sa_project",
         isTelephone:'0',
         areaCode:'',
-        telephone:''
+        telephone:'',
       },
       rules:{
         name: [
@@ -304,8 +304,6 @@ export default {
             "sys_phonebookid":'',
             "where": {
               "condition": "",
-              "sa_projectid":'',
-              "type":4,
             }
           }
         },
@@ -516,7 +514,6 @@ export default {
       this.form.address = val.address
       this.form.remarks = val.remarks
       this.form.sys_phonebookid = val.sys_phonebookid
-      this.associatedCustomers.param.content.sys_phonebookid = val.sys_phonebookid
       this.associatedCustomersList('联系人')
     },
     handleSizeChangeMy(val) {
@@ -531,20 +528,21 @@ export default {
     },
     /*关联客户*/
     async associatedCustomersList(val){
+      this.associatedCustomers.param.content.sys_phonebookid = this.form.sys_phonebookid
       const res = await this.$api.requested(this.associatedCustomers.param)
       this.associatedCustomers.listData = res.data
       this.associatedCustomers.total = res.total
       this.associatedCustomers.currentPage = res.pageNumber
       if (val == '联系人'){
-        this.form.sys_enterpriseid = ''
+        this.form.contactsid = ''
         this.form.enterprisename = ''
-        this.form.sys_enterpriseid = res.data[0].sys_enterpriseid
+        this.form.contactsid = res.data[0].contactsid
         this.form.enterprisename = res.data[0].enterprisename
       }
 
     },
     associatedCustomersSelect(val){
-      this.form.sys_enterpriseid = val.sys_enterpriseid
+      this.form.contactsid = val.contactsid
       this.form.enterprisename = val.enterprisename
       this.associatedCustomers.show = false
     },
@@ -630,6 +628,14 @@ export default {
       let _isSame = arr2.some(tag=>item.tag === tag)
       return _isSame
     },
+    watch:{
+      'associatedCustomers.show':function (val){
+        console.log(val)
+        if (val){
+          this.associatedCustomersList()
+        }
+      }
+    }
   }
 }
 

+ 60 - 55
src/HDrpManagement/projectChange/modules/modules/contacts/components/edit.vue

@@ -62,52 +62,53 @@
                     width="900"
                     v-model="associatedCustomers.show"
                     trigger="click">
-                  <el-tabs type="border-card" @tab-click="changeTabCustomers">
-
-                      <el-input  style="width:200px;" placeholder="搜索" :suffix-icon="associatedCustomers.param.content.where.condition?associatedCustomers.param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="associatedCustomers.param.content.where.condition" @keyup.native.enter="associatedCustomersList(associatedCustomers.param.content.pageNumber = 1)" @clear="associatedCustomersList(associatedCustomers.param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
-                      </el-input>
-                      <el-table
-                          border
-                          height="500px"
-                          :data="associatedCustomers.listData"
-                          style="margin-top: 10px"
-                          @row-click="associatedCustomersSelect"
-                          :header-cell-style="{background:'#EEEEEE',color:'#333'}"
-                          size="mini">
-                        <el-table-column width="80" label="企业编号">
-                          <template slot-scope="scope">
-                            <span >{{ scope.row.sys_enterpriseid?scope.row.sys_enterpriseid:'--' }}</span>
-                          </template>
-                        </el-table-column>
-                        <el-table-column width="190" label="企业名称">
-                          <template slot-scope="scope">
-                            <span >{{ scope.row.enterprisename?scope.row.enterprisename:'--' }}</span>
-                          </template>
-                        </el-table-column>
-                        <el-table-column  label="企业地址">
-                          <template slot-scope="scope">
-                            <span >{{ scope.row.address?scope.row.address:'--' }}</span>
-                          </template>
-                        </el-table-column>
-                      </el-table>
-                      <div style="display:flex;align-items:center;flex-direction:row-reverse;justify-content:space-between">
-                        <div class="container normal-panel" style="text-align:right">
-                          <el-pagination
-                              background
-                              @size-change="handleSizeAssociatedCustomers"
-                              @current-change="handleCurrentAssociatedCustomers"
-                              :current-page="associatedCustomers.currentPage"
-                              :page-sizes="[20, 50, 100, 200]"
-                              :page-size="20"
-                              layout="total,sizes, prev, pager, next, jumper"
-                              :total="associatedCustomers.total">
-                          </el-pagination>
-                        </div>
-                        <slot name="footerLeft"></slot>
-                      </div>
-
-                  </el-tabs>
-                  <el-input  slot="reference" :disabled="form.contactsid !== 0"  autosize v-model="form.enterprisename" placeholder="请选择关联企业" @input="changeTabCustomers"></el-input>
+                  <el-input  style="width:200px;" placeholder="搜索" :suffix-icon="associatedCustomers.param.content.where.condition?associatedCustomers.param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="associatedCustomers.param.content.where.condition" @keyup.native.enter="associatedCustomersList(associatedCustomers.param.content.pageNumber = 1)" @clear="associatedCustomersList(associatedCustomers.param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+                  </el-input>
+                  <el-table
+                      border
+                      :data="associatedCustomers.listData"
+                      height="500px"
+                      style="margin-top: 10px"
+                      @row-click="associatedCustomersSelect"
+                      :header-cell-style="{background:'#EEEEEE',color:'#333'}"
+                      size="mini">
+                    <el-table-column width="80" label="企业编号">
+                      <template slot-scope="scope">
+                        <span >{{ scope.row.sys_enterpriseid?scope.row.sys_enterpriseid:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column width="190" label="企业名称">
+                      <template slot-scope="scope">
+                        <span >{{ scope.row.enterprisename?scope.row.enterprisename:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column  label="企业地址">
+                      <template slot-scope="scope">
+                        <span >{{ scope.row.address?scope.row.address:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                    <el-table-column  label="负责人">
+                      <template slot-scope="scope">
+                        <span >{{ scope.row.leader?scope.row.leader:'--' }}</span>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                  <div style="display:flex;align-items:center;flex-direction:row-reverse;justify-content:space-between">
+                    <div class="container normal-panel" style="text-align:right">
+                      <el-pagination
+                          background
+                          @size-change="handleSizeAssociatedCustomers"
+                          @current-change="handleCurrentAssociatedCustomers"
+                          :current-page="associatedCustomers.currentPage"
+                          :page-sizes="[20, 50, 100, 200]"
+                          :page-size="20"
+                          layout="total,sizes, prev, pager, next, jumper"
+                          :total="associatedCustomers.total">
+                      </el-pagination>
+                    </div>
+                    <slot name="footerLeft"></slot>
+                  </div>
+                  <el-input readonly  slot="reference" autosize v-model="form.enterprisename" placeholder="请选择关联企业" @blur="associatedCustomersList"></el-input>
                 </el-popover>
               </el-form-item>
             </el-col>
@@ -291,15 +292,12 @@ export default {
       },
       associatedCustomers:{
         param:{
-          "id": 20220920083901,
+          "id": 20231215134204,
           "content": {
             "pageNumber": 1,
             "pageSize": 20,
             "where": {
               "condition": "",
-              "sa_projectid":'',
-              "type":4,
-              "typemx":"",
             }
           }
         },
@@ -350,6 +348,7 @@ export default {
       this.myContactList()
       this.getTag()
       this.form = Object.assign({},this.form,this.data)
+      console.log(this.form,'formData')
       this.tags = this.form.tag
       if ((this.form.phonenumber.indexOf('-')) != '-1'){
         this.form.isTelephone = '1'
@@ -357,7 +356,6 @@ export default {
         this.form.telephone = this.data.phonenumber.substring(this.form.areaCode.length+1)
         this.form.phonenumber = ''
       }
-
     },
     onSubmit(){
       this.$refs['form'].validate(async (valid) => {
@@ -485,16 +483,15 @@ export default {
       this.myContactList()
     },
     /*关联客户*/
-    async associatedCustomersList(){
-      this.associatedCustomers.param.content.where.condition = this.form.enterprisename
-      this.associatedCustomers.param.content.where.sa_projectid = this.data.sa_projectid
+    async associatedCustomersList(val){
+      this.associatedCustomers.param.content.sys_phonebookid = this.form.sys_phonebookid
       const res = await this.$api.requested(this.associatedCustomers.param)
       this.associatedCustomers.listData = res.data
       this.associatedCustomers.total = res.total
       this.associatedCustomers.currentPage = res.pageNumber
     },
     associatedCustomersSelect(val){
-      this.form.sys_enterpriseid = val.sys_enterpriseid
+      this.form.contactsid = val.contactsid
       this.form.enterprisename = val.enterprisename
       this.associatedCustomers.show = false
     },
@@ -584,6 +581,14 @@ export default {
       }
     }
   },
+  watch:{
+    'associatedCustomers.show':function (val){
+      console.log(val)
+      if (val){
+        this.associatedCustomersList()
+      }
+    }
+  }
 }
 </script>