Commit 9840e6eb authored by 邓春圆's avatar 邓春圆

修改客户类型

parent b2e681d7
...@@ -495,3 +495,11 @@ export function recycleUnconfirmedCustomer(data){ ...@@ -495,3 +495,11 @@ export function recycleUnconfirmedCustomer(data){
}) })
} }
export function updatecustomerToOld(params){
return request({
url:'ecw/customer/update-customer-new-or-old',
method:'put',
params
})
}
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('国家')" align="center" prop="country" :formatter="countryFormatter"></el-table-column> <el-table-column :label="$t('国家')" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width"> <el-table-column width="200px" :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea" @click="seasPond(scope.row)"--> <!-- <el-button size="mini" type="text" v-show="'development' === env && scope.row.isInOpenSea" @click="seasPond(scope.row)"-->
<!-- v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>--> <!-- v-hasPermi="['ecw:customer:query']">{{$t('掉入公海池')}}</el-button>-->
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
<el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:customer-complaint')]" type="text" icon="el-icon-user" @click="complaint(scope.row)">{{$t('客诉')}}</el-button> <el-button size="mini" v-has-permi="[selectAuthorityFn('ecw:customer:customer-complaint')]" type="text" icon="el-icon-user" @click="complaint(scope.row)">{{$t('客诉')}}</el-button>
<el-button :disabled="scope.row.isInOpenSea" v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{$t('延期')}}</el-button> <el-button :disabled="scope.row.isInOpenSea" v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{$t('延期')}}</el-button>
<el-button v-has-permi="['ecw:customer:treat-recovery']" v-if="scope.row.customerService !== null && scope.row.customerServiceAssignedTime !== null && !scope.row.isCustomerServiceConfirmed && !scope.row.isInOpenSea && path === '/customer/customer'" size="mini" type="text" @click="recovery(scope.row)" > {{$t('回收客户')}} </el-button> <el-button v-has-permi="['ecw:customer:treat-recovery']" v-if="scope.row.customerService !== null && scope.row.customerServiceAssignedTime !== null && !scope.row.isCustomerServiceConfirmed && !scope.row.isInOpenSea && path === '/customer/customer'" size="mini" type="text" @click="recovery(scope.row)" > {{$t('回收客户')}} </el-button>
<el-button v-has-permi="['ecw:customer:performanceType']" v-if="path === '/customer/customer'" size="mini" type="text" @click="dialogVisible = true; customData = scope.row;currentisNew = scope.row.isNew" > {{$t('业绩类型')}} </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -530,23 +531,44 @@ ...@@ -530,23 +531,44 @@
<customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints> <customer-complaints :customer-id="customerId" ref="customerComplaints"></customer-complaints>
<transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer> <transfer-customer :show.sync="transferShow" :customer-ids.sync="selectCustomerList"></transfer-customer>
<add-potential-custom ref="potentialCustom" @change="getList" ></add-potential-custom> <add-potential-custom ref="potentialCustom" @change="getList" ></add-potential-custom>
<!--业绩类型 -->
<el-dialog
title="业绩类型"
:visible.sync="dialogVisible"
width="30%">
<div>
<el-form>
<el-form-item label="客户编号">{{customData.number}}</el-form-item>
<el-form-item label="客户名称">{{customData.name}}</el-form-item>
<el-form-item label="业绩类型">
<el-radio-group v-model="currentisNew">
<el-radio :label="true" >{{$t('新客户')}}</el-radio>
<el-radio :label="false" >{{$t('老客户')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button :disabled="customData.isNew === currentisNew" type="primary" @click="modifyCustomer">修改</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
createCustomer, createCustomer,
updateCustomer, updateCustomer,
deleteCustomer, deleteCustomer,
getCustomer, getCustomer,
getCustomerPage, getCustomerPage,
exportCustomerExcel, exportCustomerExcel,
testEnterToOpenSea, testEnterToOpenSea,
getCustomerDeptPage, getCustomerDeptPage,
changeCustomerAir, changeCustomerAir,
getPotential, getPotential,
setChangeCustomerFcl, potentialExportExcel, deptExportExcel, recycleUnconfirmedCustomer setChangeCustomerFcl, potentialExportExcel, deptExportExcel, recycleUnconfirmedCustomer, updatecustomerToOld
} from "@/api/ecw/customer"; } from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants' import {CommonStatusEnum} from '@/utils/constants'
...@@ -633,7 +655,12 @@ export default { ...@@ -633,7 +655,12 @@ export default {
countryList: [], countryList: [],
creditList:[], creditList:[],
selectCustomerList:[], selectCustomerList:[],
transferShow:false transferShow:false,
dialogVisible:false,
customData:{
},
currentisNew:false
}; };
}, },
computed:{ computed:{
...@@ -949,7 +976,24 @@ export default { ...@@ -949,7 +976,24 @@ export default {
this.getList(); this.getList();
}); });
}); });
} },
} // 修改客户类型
modifyCustomer(){
this.$confirm(this.$t('修改业绩类型后,将会影响客户新订单业绩计算,请问确定吗?'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
}).then(() => {
updatecustomerToOld({customerId:this.customData.id,isNew:this.currentisNew}).then((r) =>{
this.$message.success(this.$t('修改成功'));
this.dialogVisible = false
this.getList()
})
}).catch(() => {
});
}
}
}; };
</script> </script>
...@@ -520,9 +520,15 @@ export default { ...@@ -520,9 +520,15 @@ export default {
}, },
// 修改客户 // 修改客户
setCustom(row) { setCustom(row) {
// console.log(row,'row')
customerUpdateCustomerToOld({customerServiceId:row.customerServiceId}).then(r =>{ this.$confirm(this.$t('是否将当前用户下的客户变成老客户'), this.$t('提示'), {
this.$message.success(this.$t('修改成功!')) confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
type: 'warning'
}).then(r =>{
customerUpdateCustomerToOld({customerServiceId: row.customerServiceId}).then(r => {
this.$message.success(this.$t('修改成功!'))
})
}) })
}, },
// 表单重置 // 表单重置
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment