edit-admin-cus_cancel
This commit is contained in:
@@ -588,7 +588,7 @@ class Clues extends HD_Controller
|
||||
foreach ($ids_arr as $val) {
|
||||
$clues_row = $clues_rows[$val][0];
|
||||
//判断是否已分配
|
||||
$cus_row = $this->customers_model->get(['rid' => $val]);
|
||||
$cus_row = $this->customers_model->get(['rid' => $val,'status>='=>0]);
|
||||
if ($clues_row && !$cus_row) {
|
||||
$jsondata = json_decode($clues_row['jsondata'], true);
|
||||
$add_data = [
|
||||
|
||||
@@ -432,7 +432,17 @@ class Customer extends HD_Controller
|
||||
|
||||
public function del()
|
||||
{
|
||||
// TODO: Implement del() method.
|
||||
$id = $this->input->post('id');
|
||||
$row = $this->customers_model->get(['id'=>$id,'cf_title'=>'平台分配']);
|
||||
if(!$row){
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
|
||||
}
|
||||
$res = $this->customers_model->update(['status'=>-1],['id'=>$id]);
|
||||
if($res){
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '删除成功');
|
||||
}else{
|
||||
return $this->show_json(SYS_CODE_FAIL, '删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
public function batch()
|
||||
@@ -444,7 +454,29 @@ class Customer extends HD_Controller
|
||||
{
|
||||
// TODO: Implement export() method.
|
||||
}
|
||||
|
||||
//改派
|
||||
public function edit_adviser(){
|
||||
$id = $this->input->get_post('id');
|
||||
$biz_id = $this->input->post('biz_id');
|
||||
$row = $this->customers_model->get(['id'=>$id,'cf_title'=>'平台分配']);
|
||||
if(!$row){
|
||||
return $this->show_json(SYS_CODE_FAIL, '客户不存在!');
|
||||
}
|
||||
if($this->input->post()){
|
||||
if(!$biz_id) return $this->show_json(SYS_CODE_FAIL, '请选择门店');
|
||||
if($biz_id == $row['biz_id']) return $this->show_json(SYS_CODE_FAIL, '请选择不同门店');
|
||||
$res = $this->customers_model->update(['biz_id'=>$biz_id,'admin_id'=>0],['id'=>$id]);
|
||||
if($res){
|
||||
$log = "改派订单";
|
||||
$this->addLog(['customer_id'=>$row['id'],'log'=>$log,'type'=>0]);
|
||||
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
|
||||
}else{
|
||||
return $this->show_json(SYS_CODE_FAIL, '保存失败');
|
||||
}
|
||||
}
|
||||
$this->data['id'] = $id;
|
||||
return $this->show_view('receiver/customer/get_adviser');
|
||||
}
|
||||
/**
|
||||
* Notes:增加日志
|
||||
* Created on: 2021/7/23 10:48
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
<form class="am-form am-form-horizontal ptb20 pr20 mt10" data-auto="true" method="post" style="padding-top: 10px;padding-bottom: 10px;"
|
||||
action="/receiver/clues/edit_adviser" id="edit-form">
|
||||
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">商家地址:</label>
|
||||
<div class="am-para-input">
|
||||
<div class="am-form-inline">
|
||||
<div class="am-form-group w100">
|
||||
<select name="city_id" v-model="city_id">
|
||||
<option value="0">城市</option>
|
||||
<template v-for="(v,i) in cityAry">
|
||||
<option :value="v.id">{{v.name}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group w100">
|
||||
<select name="county_id" v-model="county_id">
|
||||
<option value="0">行政区</option>
|
||||
<template v-for="(v,i) in countyAry">
|
||||
<option :value="v.id">{{v.name}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-para-label">门店:</label>
|
||||
<div class="am-para-input w300">
|
||||
<select name="biz_id" v-model="biz_id">
|
||||
<option value="">请选择门店</option>
|
||||
<template v-for="(v,i) in bizList">
|
||||
<option :value="v.id">{{v.biz_name}}</option>
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-para-input">
|
||||
<button class="am-btn am-btn-secondary" type="button" @click="save()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$(function () {
|
||||
vue_obj = new Vue({
|
||||
el: '#edit-form',
|
||||
data: {
|
||||
city_id:<?=$params['city_id']?$params['city_id']:0?>,
|
||||
county_id:<?=$params['county_id']?$params['county_id']:0?>,
|
||||
cityAry:[],
|
||||
countyAry:[],
|
||||
bizList:[],
|
||||
biz_id:'',
|
||||
id:'<?=$id?>',
|
||||
},
|
||||
mounted: function(){
|
||||
this.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_citys:function(){
|
||||
var vm = this;
|
||||
$.get('common/area',{id:'350',key:'city',type:1},function(response){
|
||||
if (response.code == 1) {
|
||||
vm.cityAry = response.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
save:function(){
|
||||
pdata = {'biz_id':this.biz_id,'id':this.id}
|
||||
$.post('receiver/customer/edit_adviser',pdata,function(response){
|
||||
if (response.code == 1) {
|
||||
layer.msg(response.msg,{'icon':1},function(){
|
||||
layer.closeAll();
|
||||
$.form.reload();
|
||||
})
|
||||
}else{
|
||||
layer.msg(response.msg,{'icon':2});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'city_id':function(nv, ov){
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
that.countyAry = [];
|
||||
that.county_id = '';
|
||||
} else {
|
||||
$.get('common/area',{id:nv,key:'county',type:1},function(response){
|
||||
if (response.code == 1) {
|
||||
that.countyAry = response.data;
|
||||
}
|
||||
});
|
||||
$.post('receiver/clues/get_adviser',{city_id:that.city_id,county_id:that.county_id},function(response){
|
||||
if (response.code == 1) {
|
||||
that.bizList = response.data.bizList;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
'county_id':function(nv, ov){
|
||||
var that = this;
|
||||
$.post('receiver/clues/get_adviser',{city_id:that.city_id,county_id:that.county_id},function(response){
|
||||
if (response.code == 1) {
|
||||
that.bizList = response.data.bizList;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@@ -196,6 +196,13 @@
|
||||
<div class="col-md-4 align-l">
|
||||
</div>
|
||||
<div class="col-md-8 align-r" style="padding-right: 30px;">
|
||||
<template v-if="v.cf_title=='平台分配'">
|
||||
<a :data-modal="'/receiver/customer/edit_adviser?id='+v.id" data-title="改派"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs">改派</a>
|
||||
<a href="javascript:void (0);" data-ajax="post"
|
||||
data-action="/receiver/customer/del" :data-params-id="v.id"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs">取消派单</a>
|
||||
</template>
|
||||
<a :data-modal="'/common/bind_mobile?id='+v.id+'&type=customer'"
|
||||
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
|
||||
data-title="获取手机号">拨打电话</a>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div><b>二、结算信息</b></div>
|
||||
<div>应付款合计 <?=number_format($price+$total_price,2)?> ,其中包含:车辆价款 <?=number_format($price,2)?>,委托代办款项 <?=number_format($total_price,2)?></div>
|
||||
<div>应付款合计 <?=number_format($price+$total_price,2)?> ,其中包含:车辆价款 <?=number_format($price,2)?><?if($total_price){?>,委托代办款项 <?=number_format($total_price,2)?><?}?></div>
|
||||
<div>已付款合计 <?=number_format($pay_price,2)?></div>
|
||||
<div><b>三、证件资料交接信息</b></div>
|
||||
<div>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div><b>二、结算信息</b></div>
|
||||
<div>应付款合计 <?=number_format($price+$total_price,2)?> ,其中包含:车辆价款 <?=number_format($price,2)?>,委托代办款项 <?=number_format($total_price,2)?></div>
|
||||
<div>应付款合计 <?=number_format($price+$total_price,2)?> ,其中包含:车辆价款 <?=number_format($price,2)?><?if($total_price){?>,委托代办款项 <?=number_format($total_price,2)?><?}?></div>
|
||||
<div>已付款合计 <?=number_format($pay_price,2)?></div>
|
||||
<div><b>三、证件资料交接信息</b></div>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user