diff --git a/admin/controllers/biz/Seprice.php b/admin/controllers/biz/Seprice.php index 42325f35..799a9bd3 100644 --- a/admin/controllers/biz/Seprice.php +++ b/admin/controllers/biz/Seprice.php @@ -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,'参数错误'); diff --git a/admin/controllers/biz/Srv.php b/admin/controllers/biz/Srv.php index 25281cef..6f7509ca 100644 --- a/admin/controllers/biz/Srv.php +++ b/admin/controllers/biz/Srv.php @@ -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(); diff --git a/admin/controllers/biz/store/Store.php b/admin/controllers/biz/store/Store.php index 604ed965..09b957ac 100755 --- a/admin/controllers/biz/store/Store.php +++ b/admin/controllers/biz/store/Store.php @@ -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']) : '', diff --git a/admin/views/biz/seprice/get.php b/admin/views/biz/seprice/get.php index 364cbe7a..225f14d6 100644 --- a/admin/views/biz/seprice/get.php +++ b/admin/views/biz/seprice/get.php @@ -6,18 +6,6 @@ -
- -
- -
-
-
- -
- -
-
@@ -54,6 +42,31 @@
+
+ +
+ +
+
+
+ +
+
+ 新增 + 销售薪资总和:{{info.money_json.base_employees}} +
+
+ + 删除 +
+
+
@@ -85,6 +98,8 @@ action:'', yearAry:[], monthAry:[], + employee_price_arr:[], + employee_price_list:[] }, mounted:function(){ var vm = this; @@ -92,8 +107,24 @@ vm.action = ''; vm.yearAry = ; vm.monthAry = ; + vm.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透明度的白色背景 diff --git a/admin/views/biz/srv/get.php b/admin/views/biz/srv/get.php index d3178a03..e9b06280 100644 --- a/admin/views/biz/srv/get.php +++ b/admin/views/biz/srv/get.php @@ -6,7 +6,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
diff --git a/admin/views/biz/srv/lists.php b/admin/views/biz/srv/lists.php index 71bd31a6..6f68a933 100755 --- a/admin/views/biz/srv/lists.php +++ b/admin/views/biz/srv/lists.php @@ -1,3 +1,15 @@ +
+
+ +
-
- -
- -
-
@@ -31,6 +34,7 @@
+
@@ -100,30 +104,20 @@ el: '#vue-app', data: { params: [], - typeAry:, titleAry:[] }, mounted: function () { var vm = this; vm.params = ; + $.get('/biz/srv/get_title', {"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 () { diff --git a/admin/views/biz/store/get_info.php b/admin/views/biz/store/get_info.php index 51402d20..5c1d29cf 100644 --- a/admin/views/biz/store/get_info.php +++ b/admin/views/biz/store/get_info.php @@ -31,6 +31,43 @@ 狸车:{{100-info.rate}}% (说明:有效值0~100,输入数值的百分比)
+