edit-admin-settle_brand

This commit is contained in:
lccsw
2022-08-10 16:36:02 +08:00
parent d4c7f1da41
commit 8223e96c24
10 changed files with 139 additions and 65 deletions
+12 -7
View File
@@ -3,12 +3,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Seprice extends HD_Controller
{
private $employee_price_arr = ['4000.00','6000.00','8000.00'];
public function __construct()
{
parent::__construct();
$this->load->model('biz/biz_model');
$this->load->model("biz/biz_info_model");
$this->load->model('biz/biz_settle_price_model');
$this->load->model('auto/auto_business_model');
}
@@ -80,15 +82,16 @@ class Seprice extends HD_Controller
return $this->show_json(SYS_CODE_FAIL,'参数错误');
}
$biz_id = $biz_row['id'];
$biz_info_row = $this->biz_info_model->get(['biz_id'=>$biz_id]);
$info['money_json'] = [
'rent' => '',
'base_manager' => '',
'base_employees' => '',
'wat_ele' => '',
'media' => '',
'rent' => $biz_info_row['rent'] ? $biz_info_row['rent'] : '',
'base_manager' => $biz_info_row['manager_wage'] ? $biz_info_row['manager_wage'] : '',
'base_employees' => 0,
'wat_ele' => $biz_info_row['wat_ele'] ? $biz_info_row['wat_ele'] : '',
'media' => $biz_info_row['margin'] ? $biz_info_row['margin'] : '',
'marketing' => '',
'drive' => '',
'commission' => '',
'commission' => $biz_info_row['commission'] ? $biz_info_row['commission'] : '',
'trucking' => ''
];
$info['year'] = date('Y');
@@ -99,11 +102,13 @@ class Seprice extends HD_Controller
$this->data['info'] = $info;
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
$this->data['employee_price_arr'] = $this->employee_price_arr;
$this->show_view('biz/seprice/get');
}
public function add(){
$info = $this->input->post('info');
$employee_price_list = $this->input->post('employee_price_list');
$biz_row = $this->biz_model->get(['id'=>$info['biz_id']]);
if(!$biz_row){
return $this->show_json(SYS_CODE_FAIL,'参数错误');
+4 -2
View File
@@ -60,7 +60,6 @@ class Srv extends HD_Controller{
];
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['typeAry'] = $this->biz_settle_srv_model->get_type();
@@ -92,7 +91,10 @@ class Srv extends HD_Controller{
$info['is_def'] = $row['is_def'];
$info['s_effect_time'] = $row['s_effect_time'];
$info['action'] = 'biz/srv/edit';
$info['jsondata'] = json_decode($row['jsondata'],true);
$jsondata = json_decode($row['jsondata'],true);
$jsondata['s_time'] && $jsondata['s_time'] = date('Y-m-d H:i:s',$jsondata['s_time']);
$jsondata['e_time'] && $jsondata['e_time'] = date('Y-m-d H:i:s',$jsondata['e_time']);
$info['jsondata'] = $jsondata;
}
$this->data['yearAry'] = $this->auto_business_model->year();
$this->data['monthAry'] = $this->auto_business_model->month();
+5 -5
View File
@@ -1040,13 +1040,13 @@ class Store extends HD_Controller
'biz_id' => $base_info['biz_id'],
'name' => $base_info['name'],
'mobile' => $base_info['mobile'],
'margin' => $base_info['margin'],
'margin' => $base_info['margin']>0 ? $base_info['margin'] : '',
'area' => $base_info['area'],
'rent' => $base_info['rent'],
'wat_ele' => $base_info['wat_ele'],
'rent' => $base_info['rent']>0 ? $base_info['rent'] : '',
'wat_ele' => $base_info['wat_ele']>0 ? $base_info['wat_ele'] : '',
'employee_wage' => $base_info['employee_wage'],
'manager_wage' => $base_info['manager_wage'],
'commission' => $base_info['commission'],
'manager_wage' => $base_info['manager_wage']>0 ? intval($base_info['manager_wage']) : 8000,
'commission' => $base_info['commission']>0 ? $base_info['commission'] : '',
'num' => $base_info['num'],
's_time' => $base_info['s_time'] ? date('Y-m-d', $base_info['s_time']) : '',
'e_time' => $base_info['e_time'] ? date('Y-m-d', $base_info['e_time']) : '',
+44 -13
View File
@@ -6,18 +6,6 @@
<input type="number" placeholder="房租" v-model="info.money_json.rent">
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">店长底薪:</label>
<div class="am-para-input">
<input type="number" placeholder="店长底薪" v-model="info.money_json.base_manager"/>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">销售底薪:</label>
<div class="am-para-input">
<input type="number" placeholder="销售底薪" v-model="info.money_json.base_employees"/>
</div>
</div>
<div class="am-form-group wp50 fl">
<label class="am-para-label">水电物业:</label>
<div class="am-para-input">
@@ -54,6 +42,31 @@
<input type="number" placeholder="拖车费" v-model="info.money_json.trucking"/>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">店长底薪:</label>
<div class="am-para-input">
<select v-model="info.money_json.base_manager">
<option value="8000.00">8000</option>
<option value="10000.00">10000</option>
<option value="12000.00">12000</option>
</select>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">销售薪资:</label>
<div class="am-para-input">
<div>
<span class="btn btn-success" @click="add_employee_price()">新增</span>
销售薪资总和:{{info.money_json.base_employees}}
</div>
<div class="mt10" v-for="(val,key) in employee_price_list">
<select style="display: inline;width: 100px;" v-model="employee_price_list[key]" @change="up_employee_price()">
<option v-for="item in employee_price_arr" :value="item">{{item}}</option>
</select>
<a class="btn btn-default" @click="del_employee_price(key)">删除</a>
</div>
</div>
</div>
<div class="am-form-group wp50">
<label class="am-para-label">日期:</label>
<div class="am-para-input">
@@ -85,6 +98,8 @@
action:'',
yearAry:[],
monthAry:[],
employee_price_arr:[],
employee_price_list:[]
},
mounted:function(){
var vm = this;
@@ -92,8 +107,24 @@
vm.action = '<?=$info['action']?>';
vm.yearAry = <?=json_encode($yearAry)?>;
vm.monthAry = <?=json_encode($monthAry)?>;
vm.employee_price_arr = <?=json_encode($employee_price_arr)?>;
},
methods:{
del_employee_price:function (index){
this.employee_price_list.splice(index, 1);
this.up_employee_price()
},
add_employee_price:function (){
this.employee_price_list.push('4000.00');
this.up_employee_price()
},
up_employee_price:function (){
var price = 0
this.employee_price_list.forEach((elem, index) => {
price = price+Number.parseInt(elem)
});
this.info.money_json.base_employees = price
},
saveEdit:function(){
var vm = this;
@@ -105,7 +136,7 @@
url: vm.action,
type: 'post',
dataType: 'json',
data: {info:vm.info},
data: {info:vm.info,employee_price_list:vm.employee_price_list},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
+2 -2
View File
@@ -6,7 +6,7 @@
<input type="text" placeholder="供应商" v-model="info.title">
</div>
</div>
<div class="am-form-group wp50">
<div class="am-form-group wp50" v-if="info.type!=2">
<label class="am-para-label">生效时间:</label>
<div class="am-para-input">
<input type="text" placeholder="" id="id-time" v-model="info.s_effect_time" autocomplete="off"/>
@@ -64,7 +64,7 @@
</div>
</div>
</template>
<div class="am-form-group" :style="{'display':info.type==2 ? 'block':'none'}">
<div class="am-form-group" :style="{'display':info.type==2 ? 'block':'none'}" v-if="info.is_def==0">
<label class="am-para-label">时间区间:</label>
<div class="am-para-input wp60">
<div class="am-para-inline w200">
+18 -24
View File
@@ -1,3 +1,15 @@
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<div id="recom-stat"></div>
<ul class="nav nav-tabs" role="tablist">
<?foreach ($typeAry as $key=>$val){?>
<li role="presentation" class="<?=$params['type']==$key ? 'active' : ''?>">
<a href="javascript:void (0);" data-open="/biz/srv/lists?id=<?=$params['id']?>&type=<?=$key?>">
<?=$val?>
</a>
</li>
<?}?>
</ul>
</div>
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/biz/srv/lists">
@@ -12,15 +24,6 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">类型:</label>
<div class="am-para-inline w100">
<select name="type" v-model="params.type">
<option value="">请选择</option>
<option v-for="(v,i) in typeAry" :value="i">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">供应商:</label>
<div class="am-para-inline w100">
@@ -31,6 +34,7 @@
</div>
</div>
<div class="am-form-group fl ml20">
<input type="hidden" :value="params.type" name="type">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml20">
@@ -100,30 +104,20 @@
el: '#vue-app',
data: {
params: [],
typeAry:<?=$typeAry ? json_encode($typeAry) : '[]'?>,
titleAry:[]
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
$.get('/biz/srv/get_title', {"type":<?=$params['type']?>},function(result){
if(result.code && result.data.lists){
vm.titleAry = result.data.lists
}
},'json')
},
methods: {
},
watch: {
'params.type': function (nv, ov) {
if(nv){
var that = this;
console.log(nv);
var data = {"type":nv}
$.get('/biz/srv/get_title',data,function(result){
if(result.code && result.data.lists){
that.titleAry = result.data.lists
}
},'json')
}else{
that.titleAry = []
}
}
}
});
$(function () {
+37
View File
@@ -31,6 +31,43 @@
狸车:<span>{{100-info.rate}}%</span> (说明:有效值0~100,输入数值的百分比)
</div>
</div>
<template v-if="info.biz_type==1">
<div class="am-form-group">
<label class="am-para-label">房租:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入房租" name="" type="number" v-model="info.rent"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">水电:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入水电" name="" type="number" v-model="info.wat_ele"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">垂媒:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入垂媒" name="" type="number" v-model="info.margin"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">销售提成:</label>
<div class="am-para-input w150">
<input type="text" placeholder="输入销售提成" name="" type="number" v-model="info.commission"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">店长底薪:</label>
<div class="am-para-input w150">
<select v-model="info.manager_wage">
<option value="8000">8000</option>
<option value="10000">10000</option>
<option value="12000">12000</option>
</select>
</div>
</div>
</template>
<template v-if="info.biz_type==2">
<div class="am-form-group">
<label class="am-para-label">保证金:</label>
+1 -1
View File
@@ -162,7 +162,7 @@
<a data-open="/biz/seprice/lists?biz_id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">费用管理
</a>
<a data-open="/biz/srv/lists?id=<?= $v['id'] ?>"
<a data-open="/biz/srv/lists?id=<?= $v['id'] ?>&type=1"
class="am-btn am-btn-primary am-btn-xs">水平业务配置
</a>
<?}?>
+15 -10
View File
@@ -187,21 +187,26 @@ class Biz extends HD_Controller
$size = $this->input->get('size');
!$size && $size = 5;
$t1 = 'lc_receiver_orders_v2';
$t2 = 'lc_biz_settle';
$t3 = 'lc_biz';
$t1 = 'lc_receiver_order_status';
$t2 = 'lc_receiver_orders_v2';
$t3 = 'lc_biz_settle';
$t4 = 'lc_biz';
$fields = "$t1.*";
$fields = "$t2.*,$t4.city_id";
$where = [
"$t1.pid_status" => 3,
"$t1.status" => 1,
"$t1.id>=" => Orders_v2_entity::V2_START_ID,
"$t2.id is null" => null,
"$t3.type" => 1,
"$t2.status in (0,1)" => null,
"$t2.id>=" => Orders_v2_entity::V2_START_ID,
"$t2.bill_time !='0000-00-00 00:00:00'" => null,
"$t3.id is null" => null,
"$t4.type" => 2,
];
$id && $where["{$t1}.id"] = $id;
$this->db->from("$t1");
$this->db->join("$t2", "$t2.o_id=$t1.id",'left');
$this->db->join("$t3", "$t3.id=$t1.biz_id",'left');
$this->db->join("$t2", "$t2.id=$t1.o_id",'left');
$this->db->join("$t3", "$t3.o_id=$t1.o_id",'left');
$this->db->join("$t4", "$t4.id=$t2.biz_id",'left');
$this->db->select($fields);
$this->db->where($where);
+1 -1
View File
@@ -19,7 +19,7 @@ class Biz_settle_price_model extends HD_Model
$jsondata_cn = [
'rent' => '房租',
'base_manager' => '店长底薪',
'base_employees' => '销售薪',
'base_employees' => '销售薪',
'wat_ele' => '水电物业',
'media' => '垂直媒体',
'marketing' => '市场营销费',