liche update for admin receiver order lists can reset condition

This commit is contained in:
xxb
2021-09-06 21:00:47 +08:00
committed by xiaoyu
parent 2b5abd535e
commit a813d5f178
13 changed files with 358 additions and 25 deletions
+19 -9
View File
@@ -22,18 +22,25 @@ class Member extends HD_Controller{
//数据列表
public function lists($where = array())
{
$input = $this->input->get();
$page = $input['page'];
$size = $input['size'];
$params = $this->input->get();
$page = $params['page'];
$size = $params['size'];
!$page && $page = 1;
!$size && $size = 20;
if ($input['name']) {
$where['uname like "%' . $input['name'] . '%"'] = null;
$this->data['name'] = $input['name'];
if ($params['name']) {
$where['uname like "%' . $params['name'] . '%"'] = null;
$this->data['name'] = $params['name'];
}
if ($input['mobile']) {
$where['mobile'] = $input['mobile'];
$this->data['mobile'] = $input['mobile'];
if ($params['mobile']) {
$where['mobile'] = $params['mobile'];
$this->data['mobile'] = $params['mobile'];
}
if($params['biz_id']){
$where['biz_id'] = $params['biz_id'];
} else {
$params['city_id'] = '';
$params['county_id'] = '';
$params['biz_id'] = '';
}
$count = $this->userM->count($where);
@@ -53,6 +60,7 @@ class Member extends HD_Controller{
}
}
$this->data['app_id'] = 2;
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['_title'] = '用户列表';
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
@@ -111,6 +119,7 @@ class Member extends HD_Controller{
public function edit()
{
$id = $this->input->post('id');
$uname = $this->input->post('uname');
$nickname = $this->input->post('nickname');
$mobile = $this->input->post('mobile');
$group_id = $this->input->post('group_id');
@@ -132,6 +141,7 @@ class Member extends HD_Controller{
$group_id && $upd['group_id'] = $group_id;
$biz_id && $upd['biz_id'] = $biz_id;
$nickname && $upd['nickname'] = $nickname;
$uname && $upd['uname'] = $uname;
$this->userM->update($upd, array('id' => $id));
+7 -3
View File
@@ -90,12 +90,16 @@ class Attr extends HD_Controller{
$info['jsondata'] = json_decode($info['jsondata'],true);
$info['jsondata']['img'] && $info['jsondata']['s_img'] = build_qiniu_image_url($info['jsondata']['img']);
}
$series = $this->auto_series_model->select([],'','','','id,name');
$brand_id= '';
if($info['s_id']){
$row_sery = $this->auto_series_model->get(array('id' => $info['s_id']));
$brand_id = $row_sery['brand_id'];
}
$type_arr = $this->auto_attr_model->get_type();
!$info['type'] && $info['type'] = 0;
!$info['s_id'] && $info['s_id'] = $series[0]['id'];
$info['brand_id'] = $brand_id;
!$info['s_id'] && $info['s_id'] = '';
!$info['jsondata']['img'] && $info['jsondata']['img'] = '';
$this->data['series'] = $series;
$this->data['type_arr'] = $type_arr;
$this->data['info'] = $info;
$this->data['_title'] = $id ? '编辑' : '新增';
+42
View File
@@ -812,6 +812,48 @@ class Store extends HD_Controller{
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
/**
* 获取店铺可选列表
* @return bool
*/
function json_lists(){
$province_id = $this->input->post('province_id');
$city_id = $this->input->post('city_id');
$county_id = $this->input->post('county_id');
$status = $this->input->post('status');
$page = $this->input->post('page');
$size = $this->input->post('size');
$where = array();
if(strlen($status) > 0){
$where['status'] = $status;
} else {
$whre['status > -1'] = null;
}
$province_id && $where['province_id'] = $province_id;
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
$total = $this->biz_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id, biz_name';
$rows = $this->biz_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['biz_name'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
/**
* 获取用户信息(不存在新增,可以修改名称)
* @param $mobile
+127 -2
View File
@@ -14,6 +14,27 @@
<input type="text" name="mobile" value="<?= $mobile ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">门店:</label>
<div class="am-form-group am-para-inline w150">
<select title="城市" name="city_id" v-model="params.city_id">
<option value="">城市</option>
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="行政区" name="county_id" v-model="params.county_id">
<option value="">行政区</option>
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select title="门店" name="biz_id" v-model="params.biz_id">
<option value="">选择门店</option>
<option :value="v.id" v-for="(v,i) in bizAry">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
@@ -69,8 +90,112 @@
</div>
</div>
<script>
$('#bd-hd-city').change(function () {
var city = $(this).find('option:selected').text();
var vm = new Vue({
el: '#vue-app',
data: {
params:[],
cityAry:[],//城市
countyAry:[],//行政区
bizAry:[],
province_id:'350'
},
mounted:function() {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.init_citys(vm.province_id);
},
methods: {
init_citys:function(province_id) {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: province_id,
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
}
});
},
get_bizs:function(){
var that = this;
if(that.params.city_id>0 || that.params.county_id>0){
$.ajax({
type: 'post',
url: '/biz/store/store/json_lists',
dataType: 'json',
data: {
province_id: that.province_id,
city_id: that.params.city_id,
county_id: that.params.county_id,
status:1
},
success:function(response){
if (response.code == 1) {
that.bizAry = response.data.list;
if(that.params.biz_id>0){
var biz_id = '';
for(var i in that.bizAry){
if(that.params.biz_id == thayt.bizAry[i].id){
biz_id = that.params.biz_id;
break;
}
}
that.params.biz_id = biz_id;
}
}
}
});
} else {
that.bizAry = [];
that.params.biz_id = '';
}
console.log(that.bizAry);
}
},
watch:{
'params.city_id':function(nv, ov){
var that = this;
if(nv == ''){
that.countyAry = [];
that.params.county_id = '';
} else {
if(nv.substring(0,4) != that.params.county_id.substring(0, 4)){
that.params.county_id = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key:'county',
type:1
},
success:function(response){
if (response.code == 1) {
that.countyAry = response.data;
}
}
});
}
that.get_bizs();
},
'params.county_id':function(nv, ov){
var that = this;
that.get_bizs();
}
}
});
$(function () {
<?php page_script($pager) ?>
});
$('#majia').change(function () {
+64 -3
View File
@@ -5,11 +5,21 @@
<input type="text" placeholder="输入标题" name="title" v-model="info.title">
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">品牌:</label>
<div class="am-para-inline w150">
<select name="status" v-model="info.brand_id">
<option value="">请选择</option>
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">车系:</label>
<div class="am-para-input w200">
<select v-model="info.s_id">
<option v-for="item in series" :value="item.id">
<option value="">请选择</option>
<option v-for="item in seryAry" :value="item.id">
{{item.name}}
</option>
</select>
@@ -61,15 +71,32 @@
el: '#vue-app',
data: {
info:[],
series:[],
brandAry:[],
seryAry:[],
type_arr:[]
},
mounted: function () {
this.info = <?=json_encode($info)?>;
this.series = <?=json_encode($series)?>;
this.type_arr = <?=json_encode($type_arr)?>;
this.init_brands();
},
methods: {
init_brands:function(){
var vm = this;
$.ajax({
url: '/auto/brand/json_lists',
type: 'post',
dataType: 'json',
data: {status:1},
beforeSend: function () {},
success: function (data) {
if (1 == data.code) {
vm.brandAry = data.data.list;
}
},
complete: function () {}
});
},
saveEdit: function(){
var action = '';
if(this.info.id){
@@ -91,6 +118,40 @@
}
},'json')
}
},
watch:{
'info.brand_id':function(nv, ov){
var vm = this;
vm.seryAry = {};
if(nv > 0){
$.ajax({
url: '/auto/series/json_lists',
type: 'post',
dataType: 'json',
data: {brand_id:nv},
beforeSend: function () {},
success: function (data) {
if (1 == data.code) {
var lists = data.data.list;
vm.seryAry = lists;
var s_id = '';
for(var i in lists){
var sery = lists[i];
if(vm.info.s_id == sery.id){
s_id = vm.info.s_id;
break;
}
}
vm.info.s_id = s_id;
}
},
complete: function () {
loading = 0;
layer.closeAll('loading');
}
});
}
}
}
})
});
+16 -1
View File
@@ -204,6 +204,9 @@
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml20">
<button type="button" data-open="/items/goods/goods/get"
class="am-btn am-btn-success am-btn-sm w100">新增
@@ -662,6 +665,18 @@
$('#sort').val(sort);
$('#order').val(order);
$('.form-search').submit();
},
reset:function(){
var that = this;
that.params.cor_id = '';
that.params.city_id = '';
that.params.status = '';
that.params.vin = '';
that.params.fine_ids = '';
that.fines = [];
$('#bd-auto1-id').val(0);
$('#bd-auto2-id').val(0);
$('#bd-auto3-id').val(0);
}
},
watch:{
@@ -711,7 +726,7 @@
if(that.params.addr_id>0){
var addr_id = '';
for(var i in that.addrAry){
if(that.params.addr_id == thayt.addrAry[i].id){
if(that.params.addr_id == that.addrAry[i].id){
addr_id = that.params.addr_id;
break;
}
+14 -1
View File
@@ -23,7 +23,7 @@
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp">
<select name="search_tp" id="search_tp">
<?php foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
@@ -95,6 +95,9 @@
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
@@ -323,6 +326,16 @@
});
}
},
reset:function(){
var that = this;
$('#search_tp').val('mobile');
$('#title').val('');
$('#id-create-time').val('');
that.city_id = '0';
that.county_id = '0';
that.cfrom_id = 0;
that.cfrom_id2 = 0;
}
},
watch:{
'city_id':function(nv, ov){
+14 -1
View File
@@ -65,7 +65,7 @@
<div class="am-form-group fl">
<label class="am-para-label w100">门店:</label>
<div class="am-form-group am-para-inline w150">
<select name="cf_title">
<select name="cf_title" id="cf_time">
<option value="">客户来源</option>
<option value="平台分配" <?=$params['cf_title'] == '平台分配' ? 'selected' : ''?>>平台分配</option>
<option value="自有资源" <?=$params['cf_title'] == '自有资源' ? 'selected' : ''?>>自有资源</option>
@@ -94,6 +94,9 @@
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
</div>
</div>
</form>
@@ -220,6 +223,16 @@
});
}
},
reset:function(){
var that = this;
that.params.search_tp = 'mobile';
that.params.title = '';
that.params.city_id = '';
that.params.county_id = '';
that.params.biz_id = '';
$('#cf_time').val('');
$('#id-create-time').val('');
}
},
watch: {
'params.city_id':function(nv, ov){
+11 -1
View File
@@ -22,7 +22,7 @@
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp">
<select name="search_tp" id="search_tp">
<?php foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
@@ -91,6 +91,9 @@
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
</div>
</div>
</form>
@@ -201,6 +204,13 @@
},
complete: function () {}
});
},
reset:function(){
var that = this;
$("#search_tp").val('mobile');
$("#title").val('');
$("#id-create-time").val('');
that.params.brand_id = '';
}
},
watch: {
+11 -1
View File
@@ -22,7 +22,7 @@
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp">
<select name="search_tp" id="search_tp">
<?php foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
@@ -91,6 +91,9 @@
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">设置</button>
</div>
</div>
</div>
</form>
@@ -201,6 +204,13 @@
},
complete: function () {}
});
},
reset:function(){
var that = this;
$("#search_tp").val('mobile');
$("#title").val('');
$("#id-create-time").val('');
that.params.brand_id = '';
}
},
watch: {
+11 -1
View File
@@ -22,7 +22,7 @@
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp">
<select name="search_tp" id="search_tp">
<?php foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
@@ -91,6 +91,9 @@
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">设置</button>
</div>
</div>
</div>
</form>
@@ -201,6 +204,13 @@
},
complete: function () {}
});
},
reset:function(){
var that = this;
$("#search_tp").val('mobile');
$("#title").val('');
$("#id-create-time").val('');
that.params.brand_id = '';
}
},
watch: {
+11 -1
View File
@@ -22,7 +22,7 @@
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp">
<select name="search_tp" id="search_tp">
<?php foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
@@ -91,6 +91,9 @@
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">设置</button>
</div>
</div>
</div>
</form>
@@ -201,6 +204,13 @@
},
complete: function () {}
});
},
reset:function(){
var that = this;
$("#search_tp").val('mobile');
$("#title").val('');
$("#id-create-time").val('');
that.params.brand_id = '';
}
},
watch: {
+11 -1
View File
@@ -19,7 +19,7 @@
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp">
<select name="search_tp" id="search_tp">
<?php foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
@@ -88,6 +88,9 @@
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
</div>
</div>
</form>
@@ -202,6 +205,13 @@
},
complete: function () {}
});
},
reset:function(){
var that = this;
$("#search_tp").val('mobile');
$("#title").val('');
$("#id-create-time").val('');
that.params.brand_id = '';
}
},
watch: {