Explorar o código

调整客户报价客户选择范围

qymljy %!s(int64=3) %!d(string=hai) anos
pai
achega
c48a52613c

+ 163 - 1
src/Form/QuotedPrice/edit.vue

@@ -86,7 +86,7 @@
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
             <el-col :span="24">
             <el-col :span="24">
-              <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
+              <el-form-item label="客户名称:" label-width="100px" prop="enterprisename" v-if="isQuotedPrice">
                 <el-popover
                 <el-popover
                     placement="bottom"
                     placement="bottom"
                     width="700"
                     width="700"
@@ -142,6 +142,114 @@
                 </el-popover>
                 </el-popover>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
+            <el-col :span="24">
+              <el-form-item label="客户名称:" label-width="100px" prop="enterprisename" v-if="!isQuotedPrice">
+                <el-popover
+                    placement="bottom"
+                    width="700"
+                    trigger="click"
+                    v-model="customerShow"
+                    @show="customerList">
+                  <el-tabs type="border-card" v-model="activeName"  @tab-click="handleClick">
+                    <el-tab-pane label="客户" name="客户">
+                      <el-input
+                          style="width:300px;margin-bottom: 10px"
+                          placeholder="请输入内容"
+                          v-model="customerParam.content.where.condition"
+                          clearable
+                          @clear="customerList(customerParam.content.pageNumber = 1)"
+                          size="mini"
+                          @keyup.enter.native="customerList(customerParam.content.pageNumber = 1)">
+                        <i slot="prefix" class="el-icon-search" @click="customerList(customerParam.content.pageNumber = 1)"></i>
+                      </el-input>
+                      <el-table :data="customer.customerData" @row-click="customerData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                        <el-table-column
+                            label="客户编号"
+                            width="180">
+                          <template slot-scope="scope">
+                            <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                            label="客户名称"
+                            width="200">
+                          <template slot-scope="scope">
+                            <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</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>
+                      <div class="container normal-panel" style="text-align:right">
+                        <el-pagination
+                            background
+                            small
+                            @size-change="handleSizeChangeCustomer"
+                            @current-change="handleCurrentChangeCustomer"
+                            :page-sizes="[10,20,50,100]"
+                            layout="total,sizes, prev, pager, next, jumper"
+                            :current-page="customer.currentPage"
+                            :total="customer.total">
+                        </el-pagination>
+                      </div>
+                    </el-tab-pane>
+                    <el-tab-pane label="经销商" name="经销商">
+                      <el-input
+                          style="width:300px;margin-bottom: 10px"
+                          placeholder="请输入内容"
+                          v-model="customerParam.content.where.condition"
+                          clearable
+                          @clear="distributorList(customerParam.content.pageNumber = 1)"
+                          size="mini"
+                          @keyup.enter.native="distributorList(customerParam.content.pageNumber = 1)">
+                        <i slot="prefix" class="el-icon-search" @click="distributorList(customerParam.content.pageNumber = 1)"></i>
+                      </el-input>
+                      <el-table :data="distributor.distributorData" @row-click="distributorData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                        <el-table-column
+                            label="客户编号"
+                            width="180">
+                          <template slot-scope="scope">
+                            <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                            label="客户名称"
+                            width="200">
+                          <template slot-scope="scope">
+                            <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</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>
+                      <div class="container normal-panel" style="text-align:right">
+                        <el-pagination
+                            background
+                            small
+                            @size-change="handleSizeChangeDistributor"
+                            @current-change="handleCurrentChangeDistributor"
+                            :page-sizes="[10,20,50,100]"
+                            layout="total,sizes, prev, pager, next, jumper"
+                            :current-page="distributor.currentPage"
+                            :total="distributor.total">
+                        </el-pagination>
+                      </div>
+                    </el-tab-pane>
+                  </el-tabs>
+                  <el-input slot="reference"  :readonly="true"  v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户"  @input="selectCustomer"></el-input>
+                </el-popover>
+              </el-form-item>
+            </el-col>
             <el-col  :span="24">
             <el-col  :span="24">
               <el-form-item label="电话:" label-width="100px" >
               <el-form-item label="电话:" label-width="100px" >
                 <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
                 <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
@@ -336,6 +444,7 @@ export default {
       userInfo:JSON.parse(window.sessionStorage.getItem('userInfo')),
       userInfo:JSON.parse(window.sessionStorage.getItem('userInfo')),
       primary:'primary',
       primary:'primary',
       text:'',
       text:'',
+      activeName:'客户',
       projectParam:{
       projectParam:{
         "id": 20221020143503,
         "id": 20221020143503,
         "content": {
         "content": {
@@ -375,6 +484,11 @@ export default {
         total:0,
         total:0,
         currentPage:0,
         currentPage:0,
       },
       },
+      distributor:{
+        distributorData:[],
+        total:0,
+        currentPage:0
+      },
       contactsParam:{
       contactsParam:{
         "id": "20221022165503",
         "id": "20221022165503",
         "content": {
         "content": {
@@ -595,6 +709,19 @@ export default {
       this.customerParam.content.where.condition = this.form.enterprisename
       this.customerParam.content.where.condition = this.form.enterprisename
       this.customerList()
       this.customerList()
     },
     },
+    /*可选经销商*/
+    async distributorList(){
+      this.customerParam.content.where.sa_projectid = 0
+      this.customerParam.content.where.type = 5
+      const  res = await this.$api.requested(this.customerParam)
+      this.distributor.distributorData = res.data
+      this.distributor.total = res.total
+      this.distributor.currentPage = res.pageNumber
+    },
+    selectDistributor(){
+      this.customerParam.content.where.condition = this.form.enterprisename
+      this.distributorList()
+    },
     /*可选联系人*/
     /*可选联系人*/
     async contactsList(){
     async contactsList(){
       this.contactsParam.content.sys_enterpriseid = this.form.sys_enterpriseid
       this.contactsParam.content.sys_enterpriseid = this.form.sys_enterpriseid
@@ -684,6 +811,22 @@ export default {
         this.querySalesman()
         this.querySalesman()
       }
       }
     },
     },
+    /*经销商选择信息*/
+    distributorData(val){
+      this.form.sys_enterpriseid = val.sys_enterpriseid
+      this.form.enterprisename = val.enterprisename
+      this.form.contactsid = 0
+      this.form.contactsname = ''
+      this.form.contactsphonenumber = ''
+      this.form.fax = ''
+      this.form.telephone = ''
+      this.customerShow = false
+      if (!this.isQuotedPrice){
+        this.salerParam.content.type = 1
+        this.salerParam.content.sys_enterpriseid = this.form.sys_enterpriseid
+        this.querySalesman()
+      }
+    },
     /*联系人选择信息*/
     /*联系人选择信息*/
     contactsData(val){
     contactsData(val){
       this.form.contactsid = val.contactsid
       this.form.contactsid = val.contactsid
@@ -704,6 +847,17 @@ export default {
       this.projectParam.content.pageNumber = val
       this.projectParam.content.pageNumber = val
       this.projectList()
       this.projectList()
     },
     },
+    /*经销商翻页*/
+    handleSizeChangeDistributor(val) {
+      // console.log(`每页 ${val} 条`);
+      this.customerParam.content.pageSize = val
+      this.distributorList()
+    },
+    handleCurrentChangeDistributor(val) {
+      // console.log(`当前页: ${val}`);
+      this.customerParam.content.pageNumber = val
+      this.distributorList()
+    },
     /*客户翻页*/
     /*客户翻页*/
     handleSizeChangeCustomer(val) {
     handleSizeChangeCustomer(val) {
       // console.log(`每页 ${val} 条`);
       // console.log(`每页 ${val} 条`);
@@ -765,6 +919,14 @@ export default {
     /*修改折扣数据*/
     /*修改折扣数据*/
     discountrateChange(){
     discountrateChange(){
       this.form.discountrate = Math.round(this.form.discountrate * 100)/100
       this.form.discountrate = Math.round(this.form.discountrate * 100)/100
+    },
+    handleClick(tab){
+      console.log(tab.name,'tab')
+      if (tab.name === '经销商'){
+        this.distributorList()
+      }else {
+        this.customerList()
+      }
     }
     }
    /* async mainData(val) {
    /* async mainData(val) {
       const res = await this.$api.requested({
       const res = await this.$api.requested({

+ 163 - 1
src/SDrpManagement/QuotedPrice/modules/ProjectQuotationAdd.vue

@@ -84,7 +84,7 @@
                 <el-input  v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
                 <el-input  v-model="form.projectnum" autocomplete="off" placeholder="项目编号" disabled></el-input>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
-            <el-col  :span="24">
+            <el-col  :span="24" v-if="isQuotedPrice">
               <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
               <el-form-item label="客户名称:" label-width="100px" prop="enterprisename">
                 <el-popover
                 <el-popover
                     placement="bottom"
                     placement="bottom"
@@ -141,6 +141,114 @@
                 </el-popover>
                 </el-popover>
               </el-form-item>
               </el-form-item>
             </el-col>
             </el-col>
+            <el-col :span="24">
+              <el-form-item label="客户名称:" label-width="100px" prop="enterprisename" v-if="!isQuotedPrice">
+                <el-popover
+                    placement="bottom"
+                    width="700"
+                    trigger="click"
+                    v-model="customerShow"
+                    @show="customerList">
+                  <el-tabs type="border-card" v-model="activeName"  @tab-click="handleClick">
+                    <el-tab-pane label="客户" name="客户">
+                      <el-input
+                          style="width:300px;margin-bottom: 10px"
+                          placeholder="请输入内容"
+                          v-model="customerParam.content.where.condition"
+                          clearable
+                          @clear="customerList(customerParam.content.pageNumber = 1)"
+                          size="mini"
+                          @keyup.enter.native="customerList(customerParam.content.pageNumber = 1)">
+                        <i slot="prefix" class="el-icon-search" @click="customerList(customerParam.content.pageNumber = 1)"></i>
+                      </el-input>
+                      <el-table :data="customer.customerData" @row-click="customerData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                        <el-table-column
+                            label="客户编号"
+                            width="180">
+                          <template slot-scope="scope">
+                            <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                            label="客户名称"
+                            width="200">
+                          <template slot-scope="scope">
+                            <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</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>
+                      <div class="container normal-panel" style="text-align:right">
+                        <el-pagination
+                            background
+                            small
+                            @size-change="handleSizeChangeCustomer"
+                            @current-change="handleCurrentChangeCustomer"
+                            :page-sizes="[10,20,50,100]"
+                            layout="total,sizes, prev, pager, next, jumper"
+                            :current-page="customer.currentPage"
+                            :total="customer.total">
+                        </el-pagination>
+                      </div>
+                    </el-tab-pane>
+                    <el-tab-pane label="经销商" name="经销商">
+                      <el-input
+                          style="width:300px;margin-bottom: 10px"
+                          placeholder="请输入内容"
+                          v-model="customerParam.content.where.condition"
+                          clearable
+                          @clear="distributorList(customerParam.content.pageNumber = 1)"
+                          size="mini"
+                          @keyup.enter.native="distributorList(customerParam.content.pageNumber = 1)">
+                        <i slot="prefix" class="el-icon-search" @click="distributorList(customerParam.content.pageNumber = 1)"></i>
+                      </el-input>
+                      <el-table :data="distributor.distributorData" @row-click="distributorData" height="396px" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini">
+                        <el-table-column
+                            label="客户编号"
+                            width="180">
+                          <template slot-scope="scope">
+                            <span style="margin-left: 10px">{{ scope.row.sa_customersid?scope.row.sa_customersid:'--' }}</span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                            label="客户名称"
+                            width="200">
+                          <template slot-scope="scope">
+                            <span style="margin-left: 10px">{{ scope.row.enterprisename?scope.row.enterprisename:'--'}}</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>
+                      <div class="container normal-panel" style="text-align:right">
+                        <el-pagination
+                            background
+                            small
+                            @size-change="handleSizeChangeDistributor"
+                            @current-change="handleCurrentChangeDistributor"
+                            :page-sizes="[10,20,50,100]"
+                            layout="total,sizes, prev, pager, next, jumper"
+                            :current-page="distributor.currentPage"
+                            :total="distributor.total">
+                        </el-pagination>
+                      </div>
+                    </el-tab-pane>
+                  </el-tabs>
+                  <el-input slot="reference"  :readonly="true"  v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户"  @input="selectCustomer"></el-input>
+                </el-popover>
+              </el-form-item>
+            </el-col>
             <el-col  :span="24">
             <el-col  :span="24">
               <el-form-item label="电话:" label-width="100px" >
               <el-form-item label="电话:" label-width="100px" >
                 <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
                 <el-input  v-model="form.telephone" autocomplete="off" placeholder="输入电话" disabled></el-input>
@@ -324,6 +432,7 @@ export default {
       customerShow:false,
       customerShow:false,
       contactsShow:false,
       contactsShow:false,
       salesmanVisible:false,
       salesmanVisible:false,
+      activeName:'客户',
       projectParam:{
       projectParam:{
         "id": 20221020143503,
         "id": 20221020143503,
         "content": {
         "content": {
@@ -363,6 +472,11 @@ export default {
         total:0,
         total:0,
         currentPage:0,
         currentPage:0,
       },
       },
+      distributor:{
+        distributorData:[],
+        total:0,
+        currentPage:0
+      },
       contactsParam:{
       contactsParam:{
         "id": "20221022165503",
         "id": "20221022165503",
         "version": 1,
         "version": 1,
@@ -582,6 +696,19 @@ export default {
       this.customerParam.content.where.condition = this.form.enterprisename
       this.customerParam.content.where.condition = this.form.enterprisename
       this.customerList()
       this.customerList()
     },
     },
+    /*选择经销商*/
+    async distributorList(){
+      this.customerParam.content.where.sa_projectid = 0
+      this.customerParam.content.where.type = 5
+      const  res = await this.$api.requested(this.customerParam)
+      this.distributor.distributorData = res.data
+      this.distributor.total = res.total
+      this.distributor.currentPage = res.pageNumber
+    },
+    selectDistributor(){
+      this.customerParam.content.where.condition = this.form.enterprisename
+      this.distributorList()
+    },
     async contactsList(){
     async contactsList(){
       this.contactsParam.content.sys_enterpriseid = this.form.sys_enterpriseid
       this.contactsParam.content.sys_enterpriseid = this.form.sys_enterpriseid
       const res = await this.$api.requested(this.contactsParam)
       const res = await this.$api.requested(this.contactsParam)
@@ -626,6 +753,22 @@ export default {
         this.querySalesman()
         this.querySalesman()
       }
       }
     },
     },
+    /*经销商选择信息*/
+    distributorData(val){
+      this.form.sys_enterpriseid = val.sys_enterpriseid
+      this.form.enterprisename = val.enterprisename
+      this.form.contactsid = 0
+      this.form.contactsname = ''
+      this.form.contactsphonenumber = ''
+      this.form.fax = ''
+      this.form.telephone = ''
+      this.customerShow = false
+      if (!this.isQuotedPrice){
+        this.salerParam.content.type = 1
+        this.salerParam.content.sys_enterpriseid = this.form.sys_enterpriseid
+        this.querySalesman()
+      }
+    },
     /*联系人选择信息*/
     /*联系人选择信息*/
     contactsData(val){
     contactsData(val){
       this.form.contactsid = val.contactsid
       this.form.contactsid = val.contactsid
@@ -659,6 +802,17 @@ export default {
       this.customerParam.content.pageNumber = val
       this.customerParam.content.pageNumber = val
       this.customerList()
       this.customerList()
     },
     },
+    /*经销商翻页*/
+    handleSizeChangeDistributor(val) {
+      // console.log(`每页 ${val} 条`);
+      this.customerParam.content.pageSize = val
+      this.distributorList()
+    },
+    handleCurrentChangeDistributor(val) {
+      // console.log(`当前页: ${val}`);
+      this.customerParam.content.pageNumber = val
+      this.distributorList()
+    },
     /*联系人分页*/
     /*联系人分页*/
     handleSizeChangeContacts(val) {
     handleSizeChangeContacts(val) {
       // console.log(`每页 ${val} 条`);
       // console.log(`每页 ${val} 条`);
@@ -708,6 +862,14 @@ export default {
     /*修改折扣数据*/
     /*修改折扣数据*/
     discountrateChange(){
     discountrateChange(){
       this.form.discountrate = Math.round(this.form.discountrate * 100)/100
       this.form.discountrate = Math.round(this.form.discountrate * 100)/100
+    },
+    handleClick(tab){
+      console.log(tab.name,'tab')
+      if (tab.name === '经销商'){
+        this.distributorList()
+      }else {
+        this.customerList()
+      }
     }
     }
     /*isSpecial(val){
     /*isSpecial(val){
       console.log("获取")
       console.log("获取")