add-admin_item_list_company

This commit is contained in:
lccsw
2021-12-27 14:45:54 +08:00
parent 19ab5a955f
commit 6ef78ac2d8
2 changed files with 30 additions and 13 deletions
+23 -10
View File
@@ -243,12 +243,12 @@ class Goods extends HD_Controller
if ($count) {
switch ($search_type) {
case 1://精品筛选
$fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id,count(type_id) as fine_num';
$fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id,count(type_id) as fine_num,company_id';
$orderby = "{$order} {$sort}";
$rows = $this->mdItems->select_fine($where_1, $orderby, $page, $size, $fileds);
break;
case 2://订单筛选
$fileds = 'm.id, m.brand_id, m.s_id, m.vin, m.v_id, m.cor_id, m.incor_id, m.in_time, m.bill_time, m.biz_id, m.addr_id';
$fileds = 'm.id, m.brand_id, m.s_id, m.vin, m.v_id, m.cor_id, m.incor_id, m.in_time, m.bill_time, m.biz_id, m.addr_id,m.company_id';
if (in_array($order, array('admin_id', 'mobile'))) {
$orderby = "j.{$order} {$sort}";
} else if ('uname' == $order) {
@@ -259,7 +259,7 @@ class Goods extends HD_Controller
$rows = $this->mdItems->select_order($where_2, $orderby, $page, $size, $fileds);
break;
case 3://精品+订单筛选
$fileds = 'm.id, m.brand_id, m.s_id, m.vin, m.v_id, m.cor_id, m.incor_id, m.in_time, m.bill_time, m.biz_id,m.addr_id, count(j2.type_id) as fine_num';
$fileds = 'm.id, m.brand_id, m.s_id, m.vin, m.v_id, m.cor_id, m.incor_id, m.in_time, m.bill_time, m.biz_id,m.addr_id, count(j2.type_id) as fine_num,m.company_id';
if (in_array($order, array('admin_id', 'mobile'))) {
$orderby = "j.{$order} {$sort}";
} else if ('uname' == $order) {
@@ -270,12 +270,12 @@ class Goods extends HD_Controller
$rows = $this->mdItems->select_order_fine($where_3, $orderby, $page, $size, $fileds);
break;
default:
$fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id';
$fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,bill_time,biz_id,addr_id,company_id';
$orderby = "{$order} {$sort}";
$rows = $this->mdItems->select($where, $orderby, $page, $size, $fileds);
}
$brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array();
$company_ids = $brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array();
$ids = array();
foreach ($rows as $v) {
$ids[] = $v['id'];
@@ -286,8 +286,9 @@ class Goods extends HD_Controller
$v['v_id'] && !in_array($v['v_id'], $attr_vids) && $attr_vids[] = $v['v_id'];
$v['cor_id'] && !in_array($v['cor_id'], $attr_corids) && $attr_corids[] = $v['cor_id'];
$v['incor_id'] && !in_array($v['incor_id'], $attr_incorids) && $attr_incorids[] = $v['incor_id'];
$v['company_id'] && !in_array($v['company_id'], $company_ids) && $company_ids[] = $v['company_id'];
}
$map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array();
$map_company = $map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array();
if ($brand_ids) {
$str_ids = implode(',', $brand_ids);
$where = array("id in ({$str_ids})" => null);
@@ -328,6 +329,11 @@ class Goods extends HD_Controller
$map_addr[$v['id']] = "{$v['city_name']} {$v['county_name']} 其它 {$v['title']}";
}
}
if ($company_ids) {
$str_ids = implode(',', $company_ids);
$where = array("id in ({$str_ids})" => null);
$map_company = $this->sys_company_model->map('id', 'short', $where);
}
$map_item_fine = array();
$map_order = array();
@@ -423,6 +429,7 @@ class Goods extends HD_Controller
'in_time' => '0000-00-00 00:00:00' == $v['in_time'] ? '' : substr($v['in_time'], 0, 10),
'sold_time' => '0000-00-00 00:00:00' == $v['bill_time'] ? '' : substr($v['bill_time'], 0, 10),
'fine_ids' => $map_item_fine[$v['id']] ? $map_item_fine[$v['id']] : array(),
'company_name' => $map_company[$v['company_id']] ? $map_company[$v['company_id']] : '',
'admin_name' => $order ? $order['admin_name'] : '',
'uname' => $order ? $order['uname'] : '',
'mobile' => $order ? (SUPER_ADMIN == $this->role ? $order['mobile'] : substr_replace($order['mobile'], '*****', 0, 5)) : '',
@@ -906,7 +913,6 @@ class Goods extends HD_Controller
$params['cor_id'] = '';
}
//地址筛选
//地址筛选
if ($params['biz_id']) {
$where['biz_id'] = $params['biz_id'];
@@ -1077,6 +1083,7 @@ class Goods extends HD_Controller
'stdard_num' => '合格证号',
'bill_num' => '开票号',
'auto_fine' => '精品加装',
'company_name' => '公司归属',
'status' => '状态',
'in_time' => '入库时间',
'out_time' => '出库时间',
@@ -1113,7 +1120,7 @@ class Goods extends HD_Controller
}
$lists[] = $indexs;
$brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array();
$company_ids = $brand_ids = $s_ids = $attr_vids = $attr_corids = $attr_incorids = $biz_ids = $addr_ids = array();
$ids = array();
foreach ($rows as $v) {
$ids[] = $v['id'];
@@ -1124,9 +1131,10 @@ class Goods extends HD_Controller
$v['v_id'] && !in_array($v['v_id'], $attr_vids) && $attr_vids[] = $v['v_id'];
$v['cor_id'] && !in_array($v['cor_id'], $attr_corids) && $attr_corids[] = $v['cor_id'];
$v['incor_id'] && !in_array($v['incor_id'], $attr_incorids) && $attr_incorids[] = $v['incor_id'];
$v['company_id'] && !in_array($v['company_id'], $company_ids) && $company_ids[] = $v['company_id'];
}
$map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array();
$map_company = $map_brand = $map_sery = $map_vid = $map_corid = $map_incorid = $map_biz = $map_addr = array();
if ($brand_ids) {
$str_ids = implode(',', $brand_ids);
$where = array("id in ({$str_ids})" => null);
@@ -1164,7 +1172,11 @@ class Goods extends HD_Controller
$select = 'id, title, city_name, county_name';
$map_addr = $this->addr_model->map('id', '*', $where, $orderby, 0, 0, $select);
}
if ($company_ids) {
$str_ids = implode(',', $company_ids);
$where = array("id in ({$str_ids})" => null);
$map_company = $this->sys_company_model->map('id', 'short', $where);
}
//获取精品加装
$str_ids = implode(',', $ids);
$where = array("item_id in ({$str_ids})" => null, 'type' => 1, 'status' => 1);
@@ -1231,6 +1243,7 @@ class Goods extends HD_Controller
'stdard_num' => $v['stdard_num'],
'bill_num' => $v['bill_num'],
'auto_fine' => $auto_fine,
'company_name' => $map_company[$v['company_id']],
'status' => $this->statusAry[$v['status']],
'in_time' => '0000-00-00 00:00:00' == $v['in_time'] ? '' : $v['in_time'],
'out_time' => '0000-00-00 00:00:00' == $v['out_time'] ? '' : $v['out_time'],
+7 -3
View File
@@ -162,7 +162,7 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="25%">
<th width="24%">
<span :class="'order'+('brand_id'==params.order?' order-on':' order-none')">
<a href="javascript:void(0)" @click="set_order('brand_id')">
<span class="mr10">车辆</span>
@@ -180,7 +180,7 @@
</a>
</span>
</th>
<th width="19%">
<th width="15%">
<span :class="'order'+('addr_id'==params.order?' order-on':' order-none')">
<a href="javascript:void(0)" @click="set_order('addr_id')">
<span>存放地</span>
@@ -189,7 +189,7 @@
</a>
</span>
</th>
<th width="10%">
<th width="8%">
<span :class="'order'+('in_time'==params.order?' order-on':' order-none')">
<a href="javascript:void(0)" @click="set_order('in_time')">
<span>入库日期</span>
@@ -207,6 +207,9 @@
</a>
</span>
</th>
<th width="10%">
<span>公司归属</span>
</th>
<th width=""><span>操作</span></th>
</tr>
</thead>
@@ -221,6 +224,7 @@
<td>{{v.address}}</td>
<td>{{v.in_time}}</td>
<td>{{v.auto_fine}}</td>
<td>{{v.company_name}}</td>
<td><a href="javascript:void(0);"
:data-open="'/items/goods/logs/get?id='+v.id+'&title='+v.title"
class="am-btn am-btn-primary am-btn-xs">轨迹</a>