liche update for admin goods better

This commit is contained in:
xxb
2021-08-27 20:39:02 +08:00
committed by xiaoyu
parent c9e9caab77
commit 3ca1a14362
7 changed files with 443 additions and 53 deletions
+41
View File
@@ -160,4 +160,45 @@ class Attr extends HD_Controller{
}
/**
* 属性选项列表
* @return bool
*/
function json_lists(){
$s_id = $this->input->post('s_id');
$status = $this->input->post('status');
$type = $this->input->post('type');
$page = $this->input->post('page');
$size = $this->input->post('size');
$where = array();
$s_id && $where['s_id'] = $s_id;
strlen($type) > 0 && $where['type'] = $type;
if(strlen($status) > 0){
$where['status'] = $status;
} else {
$where['status>-1'] = null;
}
$total = $this->auto_attr_model->count($where);
$lists = array();
if($total){
$orderby = 'id desc';
$select = 'id, title';
$rows = $this->auto_attr_model->select($where, $orderby, $page, $size, $select);
foreach($rows as $v){
$lists[] = array(
'id' => $v['id'],
'title' => $v['title'],
);
}
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+1 -1
View File
@@ -172,7 +172,7 @@ class Brand extends HD_Controller{
}
$this->data = array('total' => $total, 'list' => $lists);
return $this->show_json(SYS_CODE_SUCCESS, '添加成功');
return $this->show_json(SYS_CODE_SUCCESS);
}
}
+59 -13
View File
@@ -43,6 +43,13 @@ class Goods extends HD_Controller
if ($params['v_id']) {
$where['v_id'] = $params['v_id'];
}
//车身颜色
if ($params['cor_id']) {
$where['cor_id'] = $params['cor_id'];
} else {
$params['cor_id'] = '';
}
if($params['addr_id']){
$where['addr_id'] = $params['addr_id'];
} else if($params['city_id']){
@@ -73,16 +80,25 @@ class Goods extends HD_Controller
if($params['vin']){
$where["vin like '%{$params['vin']}%'"] = null;
}
//精品筛选
if($params['fine_ids']){
$fine_count = substr_count($params['fine_ids'], ',') + 1;
$sql = "select item_id from lc_items_relate where type=1 and status=1 and type_id in ({$params['fine_ids']}) group by item_id having count(item_id)={$fine_count}";
$where["id in ($sql)"] = null;
}
$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
$count = $this->mdItems->count($where);
$lists = array();
$fine_ids = array();
if ($count) {
$fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,p_time,addr_id';
$fileds = 'id,brand_id,s_id,vin,v_id,cor_id,incor_id,in_time,addr_id';
$rows = $this->mdItems->select($where, 'id desc', $page, $size, $fileds);
$brand_id_arr = array();
$addr_ids = array();
$ids = array();
foreach($rows as $v){
$ids[] = $v['id'];
!in_array($v['brand_id'], $brand_id_arr) && $brand_id_arr[] = $v['brand_id'];
$v['addr_id'] && !in_array($v['addr_id'], $addr_ids) && $addr_ids[] = $v['addr_id'];
}
@@ -95,6 +111,7 @@ class Goods extends HD_Controller
$attr_corid_rows = $this->mdAutoAttr->get_map_by_ids($attr_corid_arr, 'id,title');
$attr_incorid_arr = array_unique(array_column($rows, 'incor_id'));
$attr_incorid_rows = $this->mdAutoAttr->get_map_by_ids($attr_incorid_arr, 'id,title');
//获取存放地址
$map_addr = array();
if($addr_ids){
$str_ids = implode(',', $addr_ids);
@@ -103,11 +120,17 @@ class Goods extends HD_Controller
$select = 'id, title';
$map_addr = $this->addr_model->map('id', 'title', $where, $orderby, 0, 0, $select);
}
//获取精品加装
$str_ids = implode(',', $ids);
$where = array("item_id in ({$str_ids})" => null, 'type' => 1, 'status' => 1);
$rows_fine = $this->items_relate_model->select($where, '', 0, 0, 'item_id, type_id');
$map_fine = array();
foreach($rows_fine as $v){
!in_array($v['type_id'], $fine_ids) && $fine_ids[] = $v['type_id'];
$map_fine[$v['item_id']][] = $v['type_id'];
}
foreach ($rows as $key => $val) {
$p_days = '';
if('0000-00-00 00:00:00' != $val['p_time']){
$p_days = intval((time() - strtotime($val['p_time']))/3600/24);
}
$setVal = array();
$setVal['id'] = $val['id'];
$setVal['brand_name'] = isset($brands_rows[$val['brand_id']]) ? $brands_rows[$val['brand_id']][0]['name'] : '';
@@ -117,12 +140,13 @@ class Goods extends HD_Controller
$setVal['incor_name'] = isset($attr_incorid_rows[$val['incor_id']]) ? $attr_incorid_rows[$val['incor_id']][0]['title'] : '';
$setVal['vin'] = $val['vin'];
$setVal['address'] = $val['addr_id'] ? $map_addr[$val['addr_id']] : '';
$setVal['p_time'] = '0000-00-00 00:00:00' == $val['p_time'] ? '' : $val['p_time'];
$setVal['p_days'] = $p_days;
$setVal['in_time'] = '0000-00-00 00:00:00' == $val['in_time'] ? '' : $val['in_time'];
$setVal['fine_ids'] = $map_fine[$val['id']] ? $map_fine[$val['id']] : array();
$lists[] = $setVal;
}
}
$this->data['lists'] = $lists;
$this->data['fine_ids'] = $fine_ids;
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
$this->data['params'] = $params;
$this->data['autoList'] = $autoList;
@@ -146,7 +170,7 @@ class Goods extends HD_Controller
}
$info = $re;
$info['pro_time'] = $re['pro_time'] != '0000-00-00 00:00:00' ? $re['pro_time'] : '';
$info['p_time'] = $re['p_time'] != '0000-00-00 00:00:00' ? $re['p_time'] : '';
$info['in_time'] = $re['in_time'] != '0000-00-00 00:00:00' ? $re['in_time'] : '';
$info['out_time'] = $re['out_time'] != '0000-00-00 00:00:00' ? $re['out_time'] : '';
$info['bill_time'] = $re['bill_time'] != '0000-00-00 00:00:00' ? $re['bill_time'] : '';
if ($re['brand_id']) {
@@ -181,6 +205,7 @@ class Goods extends HD_Controller
$info['county_id'] = '';
$info['addr_id'] = '';
$info['fine_ids'] = array();
$info['in_time'] = date('Y-m-d H:i:s');
$_title = '新增商品';
$edit_url = '/items/goods/goods/add';
}
@@ -223,7 +248,7 @@ class Goods extends HD_Controller
$info['buy_price'] = $re['buy_price'] . '元';
$info['discount'] = $re['discount'] ? $re['discount'] . '%' : '100%';
$info['pro_time'] = $re['pro_time'] != '0000-00-00 00:00:00' ? $re['pro_time'] : '';
$info['p_time'] = $re['p_time'] != '0000-00-00 00:00:00' ? $re['p_time'] : '';
$info['in_time'] = $re['in_time'] != '0000-00-00 00:00:00' ? $re['in_time'] : '';
$info['out_time'] = $re['out_time'] != '0000-00-00 00:00:00' ? $re['out_time'] : '';
$info['bill_time'] = $re['bill_time'] != '0000-00-00 00:00:00' ? $re['bill_time'] : '';
if($info['addr_id']){
@@ -267,6 +292,16 @@ class Goods extends HD_Controller
if (!$checkInfo['code']) {
return $this->show_json($checkInfo['code'], $checkInfo['msg']);
}
if($info['vin']){
//车架号不重复
$where = array('vin' => $info['vin']);
$count = $this->mdItems->count($where);
if($count>0){
return $this->show_json(SYS_CODE_FAIL, 'vin码已存在');
}
}
$addData['brand_id'] = $info['brand_id'];
$addData['s_id'] = $info['s_id'];
$addData['v_id'] = $info['v_id'];
@@ -287,7 +322,7 @@ class Goods extends HD_Controller
$addData['buy_price'] = $info['buy_price'] ? $info['buy_price'] : 0.00;
$addData['pro_time'] = $info['pro_time'] ? $info['pro_time'] : '0000-00-00 00:00:00';
$addData['p_time'] = $info['p_time'] ? $info['p_time'] : '0000-00-00 00:00:00';
$addData['in_time'] = $info['in_time'] ? $info['in_time'] : date('Y-m-d H:i:s');
$addData['out_time'] = $info['out_time'] ? $info['out_time'] : '0000-00-00 00:00:00';
$addData['bill_time'] = $info['bill_time'] ? $info['bill_time'] : '0000-00-00 00:00:00';
$addData['c_time'] = time();
@@ -371,6 +406,7 @@ class Goods extends HD_Controller
'cor_id' => $cor_id,
'incor_id' => $incor_id,
'vin' => $vin ? $vin : '',
'in_time' => date('Y-m-d H:i:s'),
'c_time' => time()
);
$id = $this->mdItems->add($addData);
@@ -391,6 +427,16 @@ class Goods extends HD_Controller
if (!$checkInfo['code']) {
return $this->show_json($checkInfo['code'], $checkInfo['msg']);
}
if($info['vin']){
//车架号不重复
$where = array('vin' => $info['vin'], "id<>{$info['id']}" => null);
$count = $this->mdItems->count($where);
if($count>0){
return $this->show_json(SYS_CODE_FAIL, 'vin码已存在');
}
}
$editData['brand_id'] = $info['brand_id'];
$editData['s_id'] = $info['s_id'];
$editData['v_id'] = $info['v_id'];
@@ -411,7 +457,7 @@ class Goods extends HD_Controller
$editData['buy_price'] = $info['buy_price'];
$editData['pro_time'] = $info['pro_time'];
$editData['p_time'] = $info['p_time'];
$editData['in_time'] = $info['in_time'];
$editData['out_time'] = $info['out_time'];
$editData['bill_time'] = $info['bill_time'];
//存货地址
@@ -540,7 +586,7 @@ class Goods extends HD_Controller
'if_pack' =>'精品加装',
'status' =>'状态',
'pro_time' =>'生产时间',
'p_time' =>'分配时间',
'in_time' =>'分配时间',
'out_time' =>'出库时间',
'bill_time' =>'开票时间',
);
@@ -615,7 +661,7 @@ class Goods extends HD_Controller
'if_pack' => $v['if_pack'],
'status' => $this->statusAry[$v['status']],
'pro_time' => '0000-00-00 00:00:00' == $v['pro_time'] ? '' : $v['pro_time'],
'p_time' => '0000-00-00 00:00:00' == $v['p_time'] ? '' : $v['p_time'],
'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'],
'bill_time' => '0000-00-00 00:00:00' == $v['bill_time'] ? '' : $v['bill_time'],
);
+4 -4
View File
@@ -189,8 +189,8 @@
</td>-->
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">分配日期</div>
<input id="p_time_id" type="text" value="<?= $info['p_time'] ?>" placeholder="请输入分配日期">
<div class="input-group-addon">入库日期</div>
<input id="in_time_id" type="text" value="<?= $info['in_time'] ?>" placeholder="请输入或选择入库日期">
</div>
</td>
<!--<td class="table-td">
@@ -409,7 +409,7 @@
saveEdit: function () {
var vm = this;
vm.info.pro_time = $('#pro_time_id').val();
vm.info.p_time = $('#p_time_id').val();
vm.info.in_time = $('#in_time_id').val();
vm.info.out_time = $('#out_time_id').val();
vm.info.bill_time = $('#bill_time_id').val();
@@ -672,7 +672,7 @@
elem: '#pro_time_id', type: 'datetime'
});
laydate.render({
elem: '#p_time_id', type: 'datetime'
elem: '#in_time_id', type: 'datetime'
});
laydate.render({
elem: '#out_time_id', type: 'datetime'
+1 -1
View File
@@ -61,7 +61,7 @@
<table width="100%" style="margin:10px 10px 10px 10px;">
<tr>
<td class="table-td">
分配日期:<?= $info['p_time'] ?>
入库日期:<?= $info['in_time'] ?>
</td>
</tr>
<tr>
+336 -33
View File
@@ -1,3 +1,41 @@
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="/static/css/appitem/AdminLTE.min.css">
<style>
.label-group-wrap {
margin-top: 10px;
font-size: 0;
}
.label-group {
display: inline-block;
margin-right: 4px;
margin-bottom: 16px;
font-size: 0;
white-space: nowrap;
}
.label-group-wrap .label, .label-group>.label {
font-size: 10px;
font-weight: normal;
margin-right: 1px;
white-space: normal;
line-height: 1.4;
}
.label {
font-weight: normal;
}
.label-group>span+a.label {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: 1px solid #fff;
margin-left: -3px;
}
.label-group-wrap .label, .label-group>.label {
font-size: 10px;
font-weight: normal;
margin-right: 1px;
white-space: normal;
line-height: 1.4;
}
</style>
<div class="coms-table-wrap mt10">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/items/goods/goods">
@@ -22,7 +60,7 @@
<div class="am-para-inline w120">
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
data-refurl="/common/auto?pid={value}&type=3"
data-next="#bd-auto3-id">
data-next="#bd-auto3-id" @change="set_sery">
<option value="0">选择车系</option>
<?php if ($autoList[2]) {
foreach ($autoList[2] as $v) { ?>
@@ -46,6 +84,14 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w120">
<select name="cor_id" v-model="params.cor_id">
<option value="">车身颜色</option>
<option :value="v.id" v-for="(v,i) in attrs_cor">{{v.title}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">存放地:</label>
<div class="am-para-inline w120">
@@ -80,12 +126,27 @@
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-form-group">
<label class="am-para-label w100">车架号:</label>
<div class="am-para-inline w120">
<input type="text" name="vin" placeholder="车架号关键字" v-model="params.vin" />
</div>
</div>
<div class="am-form-group">
<label class="am-para-label w100">精品:</label>
<div class="am-para-inline">
<div class="label-group-wrap label-group-sortable" style="display: inline">
<div class="label-group" v-for="(v,i) in fines">
<span class="label label-default sort-shop-list" :data-id="v.id" :data-name="v.title"
:data-sort="i">{{v.title}}</span>
<a href="javascript:void(0);" @click="rm_fine(i)" class="label label-default"><i
class="fa fa-remove"></i></a>
</div>
</div>
<input type="hidden" name="fine_ids" v-model="params.fine_ids" />
<button type="button" class="am-btn am-btn-default am-btn-sm" @click="fine_modal">+</button>
</div>
</div>
<div class="am-form-group fl ml100">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
@@ -108,36 +169,32 @@
<thead>
<tr>
<th width="5%"><span>ID</span></th>
<th width="30%"><span>车辆</span></th>
<th width="25%"><span>车辆</span></th>
<th width="15%"><span>车架号</span></th>
<th width="15%"><span>存放地</span></th>
<th width="15%"><span>分配日期</span></th>
<th width="6%"><span>存放天数</span></th>
<th width="15%"><span>入库日期</span></th>
<th width="15%"><span>精品家装</span></th>
<th width=""><span>操作</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['brand_name'] ?>-<?= $v['s_name'] ?>-<?= $v['v_name'] ?>-<?= $v['cor_name'] ?>-内饰<?= $v['incor_name'] ?></td>
<td><?= $v['vin'] ?></td>
<td><?= $v['address'] ?></td>
<td><?= $v['p_time'] ?></td>
<td><?= $v['p_days'] ?></td>
<td>
<a href="javascript:void(0);"
data-modal="/items/goods/goods/get_info?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs"
data-title="详情">查看</a>
<a href="javascript:void(0);"
data-open="/items/goods/goods/get?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">编辑</a>
</td>
</tr>
<?php }
} ?>
<tr v-for="(v,i) in lists">
<td>{{v.id}}</td>
<td>{{v.brand_name}}-{{v.s_name}}-{{v.v_name}}-{{v.cor_name}}</td>
<td>{{v.vin}}</td>
<td>{{v.address}}</td>
<td>{{v.in_time}}</td>
<td>{{v.auto_fine}}</td>
<td>
<a href="javascript:void(0);"
:data-modal="'/items/goods/goods/get_info?id='+v.id"
class="am-btn am-btn-primary am-btn-xs"
data-title="详情">查看</a>
<a href="javascript:void(0);"
:data-open="'/items/goods/goods/get?id='+v.id"
class="am-btn am-btn-primary am-btn-xs">编辑</a>
</td>
</tr>
</tbody>
</table>
</div>
@@ -164,6 +221,62 @@
</div>
</div>
</div>
<div id="fine-modal" style="display: none;">
<div class="modal-body">
<table width="100%">
<tr>
<td width="20%">ID</td>
<td width="35%" style="font-weight: bold;padding-left: 8px;">精品</td>
<td width="40%" style="padding-right: 8px;"><label class="sr-only" for="search">搜精品</label>
<div class="input-group input-group-sm">
<input type="text" class="form-control" style="font-size: 1.2rem;font-weight: bold;"
v-model='modal_fine.title' placeholder="精品关键字">
<div class="input-group-btn">
<button type="button" @click='get_fines(0);' class="btn btn-default">搜</button>
</div>
</div>
</td>
</tr>
</table>
<div style="border-bottom: 1px solid #ddd;height: 1px;margin-top: 8px;"></div>
<table class="table table-middle">
<colgroup>
<col width="15%"/>
<col width="45%"/>
<col width="20%"/>
</colgroup>
<tbody>
<tr v-for="(v,i) in modal_fine.lists">
<td>{{v.id}}</td>
<td>{{v.title}}</td>
<td class="text-right">
<a v-if="v.checked==0 || !v.checked" href="javascript:void(0);" @click="set_fine(i,1)"
class="btn btn-primary btn-sm">选择</a>
<a v-else-if="v.checked==1" href="javascript:void(0);" @click="set_fine(i,0)"
class="btn btn-default btn-sm">移除</a>
</td>
</tr>
</tbody>
</table>
<div class="clearfix">
<span class="pull-left text-muted">第{{modal_fine.page}}页(每页{{modal_fine.size}}条,共{{modal_fine.total}}条)</span>
<nav class="pull-right" aria-label="Page navigation">
<ul class="pagination pagination-sm">
<li v-if="modal_fine.page>1">
<a href="javascript:void(0);" @click="get_fines(-1);" aria-label="上一页">
<span class="glyphicon glyphicon-menu-left"></span>
</a>
</li>
<li v-if="modal_fine.next>0">
<a href="javascript:void(0);" @click="get_fines(1);" aria-label="下一页">
<span class="glyphicon glyphicon-menu-right"></span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<script>
function load_goods() {
@@ -206,18 +319,26 @@
el: '.coms-table-wrap',
data: {
params:[],
statusAry:[],
cityAry:[],
countyAry:[],
addrAry:[]
statusAry:[],//状态
cityAry:[],//城市
countyAry:[],//行政区
addrAry:[],//地址
fines:[],//搜索条件精品列表
fine_ids:[],//列表所有选中的精品列表
lists:[],
attrs_cor:[],//车身颜色选项
modal_fine:{title:'', lists:[], selected:[], page:1, size:10, total:0}
},
mounted:function() {
var vm = this;
var lists = [];
lists = <?=json_encode($lists)?>;
vm.lists = <?=json_encode($lists)?>;
vm.params = <?=json_encode($params)?>;
vm.statusAry = <?=json_encode($statusAry)?>;
vm.fine_ids = <?=json_encode($fine_ids)?>;
vm.init_citys();
vm.init_fines();
vm.init_fines_lists();
vm.set_sery();
},
methods:{
init_citys:function() {
@@ -237,6 +358,188 @@
}
}
});
},
init_fines:function(){
var vm = this;
if(vm.params.fine_ids.length > 0){
$.ajax({
type: 'post',
url: '/auto/fine/json_lists',
dataType: 'json',
data: {
id: vm.params.fine_ids,
status:1
},
success:function(response){
if (response.code == 1) {
vm.fines = response.data.list;
}
}
});
}
},
init_fines_lists:function(){
var vm = this;
if(vm.fine_ids.length > 0){
$.ajax({
type: 'post',
url: '/auto/fine/json_lists',
dataType: 'json',
data: {
id: vm.fine_ids.join(','),
status:1
},
success:function(response){
if (response.code == 1) {
var fines = response.data.list;
var map_fine = {};
for(var i in fines){
var fine = fines[i];
map_fine[fine.id] = fine;
}
for(i in vm.lists){
var goods = vm.lists[i];
var auto_fine = '';
for(var j in goods.fine_ids){
var fine_id = goods.fine_ids[j];
fine = map_fine[fine_id];
auto_fine += fine.title + " ";
}
goods.auto_fine = auto_fine;
}
}
}
});
}
},
fine_modal:function(){
//选择门店
var vm = this;
var selects = JSON.parse(JSON.stringify(vm.fines));
vm.modal_fine = {title:'', lists:[], selected:selects, page:1, size:10, total:0, next:0};
vm.get_fines();
layer.open({
type: 1,
area: ['50%', '80%'], //宽高
content: $('#fine-modal'),
title: '选取精品',
shade: false,
btn: ['选好了'],
yes: function (index) {
layer.close(index);
vm.fines = JSON.parse(JSON.stringify(vm.modal_fine.selected));
var fine_ids = '';
for(var i in vm.fines){
var fine = vm.fines[i];
if('' == fine_ids){
fine_ids = fine.id;
} else{
fine_ids += ','+ fine.id
}
}
vm.params.fine_ids = fine_ids;
}
});
},
get_fines:function(page){
var vm = this;
if(0 == page){
vm.modal_fine.page = 1;
vm.modal_fine.total = 0;
vm.modal_fine.next = 0;
} else if(1 == page){
vm.modal_fine.page+=1;
} else if(-1 == page) {
vm.modal_fine.page-=1;
}
$.ajax({
type: 'post',
url: '/auto/fine/json_lists',
dataType: 'json',
data: {
page: vm.modal_fine.page,
size: vm.modal_fine.size,
status:1,
title:vm.modal_fine.title
},
success:function(response){
if (response.code == 1) {
vm.modal_fine.lists = response.data.list;
vm.modal_fine.total = response.data.total;
if(vm.modal_fine.page * vm.modal_fine.size < vm.modal_fine.total){
vm.modal_fine.next=1;
} else {
vm.modal_fine.next=0;
}
for(var i in vm.modal_fine.lists){
var fine = vm.modal_fine.lists[i];
fine.checked = 0;
for(var j in vm.modal_fine.selected){
var selected = vm.modal_fine.selected[j];
if(fine.id == selected.id){
fine.checked = 1;
}
}
}
}
}
});
},
set_fine:function(index, checked){
var vm = this;
var fine = vm.modal_fine.lists[index];
fine.checked = checked;
if(checked == 1){
var selected = {id:fine.id, title:fine.title};
vm.modal_fine.selected.push(selected);
} else {
for(var i in vm.modal_fine.selected){
selected = vm.modal_fine.selected[i];
if(fine.id == selected.id){
vm.modal_fine.selected.splice(i, 1);
break;
}
}
}
vm.$forceUpdate();
},
rm_fine:function(index){
var vm = this;
vm.fines.splice(index, 1);
var fine_ids = '';
for(var i in vm.fines){
var fine = vm.fines[i];
if('' == fine_ids){
fine_ids = fine.id;
} else{
fine_ids += ','+ fine.id
}
}
vm.params.fine_ids = fine_ids;
},
set_sery:function(){
var vm = this;
var s_id = $('#bd-auto2-id').val();
if(s_id > 0){
$.ajax({
type: 'post',
url: '/auto/attr/json_lists',
dataType: 'json',
data: {
s_id: s_id,
status:1,
type:0
},
success:function(response){
if (response.code == 1) {
vm.attrs_cor = response.data.list;
}
}
});
} else {
vm.attrs_cor = [];
vm.params.cor_id = '';
}
}
},
watch:{
@@ -334,7 +637,7 @@
$('#bd-auto1-id').change(function () {
$('#bd-auto2-id').empty();
$('#bd-auto3-id').empty();
$("#bd-auto3-id").prepend("<option value='0'>选择车型</option>")
$("#bd-auto3-id").prepend("<option value='0'>选择车型</option>");
});
$('#bd-auto2-id').change(function () {
$('#bd-auto3-id').empty();
+1 -1
View File
@@ -34,8 +34,8 @@ create table lc_items (
primary key (id)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商品表';
alter table lc_items drop column frame_num;
alter table lc_items modify if_pack varchar(256) not null default '' comment '精品加装';
alter table lc_items add column addr_id int unsigned not null default 0 comment '存放地址ID' after address;
alter table lc_items add column in_time timestamp not null default '0000-00-00 00:00:00' comment '入库时间' after out_time;
-- ----------------------------
-- Title:商品关联