|
@@ -10,60 +10,117 @@
|
|
|
:show-close="false"
|
|
|
@close="onClose">
|
|
|
<div class="drawer__panel">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="24">
|
|
|
- <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="802px" :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-input slot="reference" :readonly="true" v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户" @input="selectCustomer"></el-input>-->
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-tabs type="border-card">
|
|
|
+ <el-tab-pane label="客户">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <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="802px" :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="260">
|
|
|
+ <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-input slot="reference" :readonly="true" v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户" @input="selectCustomer"></el-input>-->
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="经销商">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input
|
|
|
+ style="width:300px;margin-bottom: 10px"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="distributorParam.content.where.condition"
|
|
|
+ clearable
|
|
|
+ @clear="distributorList(distributorParam.content.pageNumber = 1)"
|
|
|
+ size="mini"
|
|
|
+ @keyup.enter.native="distributorList(distributorParam.content.pageNumber = 1)">
|
|
|
+ <i slot="prefix" class="el-icon-search" @click="distributorList(distributorParam.content.pageNumber = 1)"></i>
|
|
|
+ </el-input>
|
|
|
+ <el-table :data="distributor.distributorData" @row-click="distributorData" height="802px" :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="260">
|
|
|
+ <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-input slot="reference" :readonly="true" v-model="form.enterprisename" autocomplete="off" placeholder="请选择客户" @input="selectCustomer"></el-input>-->
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
</div>
|
|
|
<div class="fixed__btn__panel">
|
|
|
<el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
|
|
|
+<!-- <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>-->
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
<enterprise
|
|
@@ -109,7 +166,19 @@ export default {
|
|
|
"pageSize": 20,
|
|
|
"where": {
|
|
|
"condition": "",
|
|
|
- "type":5,
|
|
|
+ "type":6,
|
|
|
+ "sa_projectid":""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ distributorParam:{
|
|
|
+ "id": 20220920083901,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "type":8,
|
|
|
"sa_projectid":""
|
|
|
}
|
|
|
}
|
|
@@ -119,6 +188,11 @@ export default {
|
|
|
total:0,
|
|
|
currentPage:0,
|
|
|
},
|
|
|
+ distributor:{
|
|
|
+ distributorData:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -140,6 +214,30 @@ export default {
|
|
|
this.onClose()
|
|
|
})
|
|
|
},
|
|
|
+ async addDistributor(){
|
|
|
+ this.form.sa_projectid = this.$route.query.id
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221027143602,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.setType(res.data.sa_project_partiesid)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async setType(id){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221116142502,
|
|
|
+ "content":{
|
|
|
+ "sa_projectid":this.$route.query.id,
|
|
|
+ "sa_project_partiesid": id,
|
|
|
+ "type": "经销商"
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.$emit('addSuccess')
|
|
|
+ this.onClose()
|
|
|
+ })
|
|
|
+ },
|
|
|
onClose(){
|
|
|
this.visible = false
|
|
|
this.form={
|
|
@@ -167,10 +265,10 @@ export default {
|
|
|
this.customer.total = res.total
|
|
|
this.customer.currentPage = res.pageNumber
|
|
|
},
|
|
|
- selectCustomer(){
|
|
|
+ /*selectCustomer(){
|
|
|
this.customerParam.content.where.condition = this.form.enterprisename
|
|
|
this.customerList()
|
|
|
- },
|
|
|
+ },*/
|
|
|
/*客户选择信息*/
|
|
|
customerData(val){
|
|
|
this.form.sys_enterpriseid = val.sys_enterpriseid
|
|
@@ -188,10 +286,34 @@ export default {
|
|
|
this.customerParam.content.pageNumber = val
|
|
|
this.customerList()
|
|
|
},
|
|
|
+ async distributorList(){
|
|
|
+ this.distributorParam.content.where.sa_projectid = this.$route.query.id
|
|
|
+ const res = await this.$api.requested(this.distributorParam)
|
|
|
+ this.distributor.distributorData = res.data
|
|
|
+ this.distributor.total = res.total
|
|
|
+ this.distributor.currentPage = res.pageNumber
|
|
|
+ },
|
|
|
+ distributorData(val){
|
|
|
+ this.form.sys_enterpriseid = val.sys_enterpriseid
|
|
|
+ this.form.enterprisename = val.enterprisename
|
|
|
+ this.addDistributor()
|
|
|
+ },
|
|
|
+ /*经销商分页*/
|
|
|
+ handleSizeChangeDistributor(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.customerParam.content.pageSize = val
|
|
|
+ this.distributorList()
|
|
|
+ },
|
|
|
+ handleCurrentChangeDistributor(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.customerParam.content.pageNumber = val
|
|
|
+ this.distributorList()
|
|
|
+ },
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.selectCustomer()
|
|
|
+ this.customerList()
|
|
|
+ this.distributorList()
|
|
|
}
|
|
|
}
|
|
|
</script>
|