206 lines
8.6 KiB
PHP
206 lines
8.6 KiB
PHP
<div class="coms-table-wrap mt10">
|
|
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
|
action="/items/goods/goods">
|
|
<div class="am-form am-form-horizontal">
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">车型:</label>
|
|
<div class="am-para-inline w120">
|
|
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
|
|
data-refurl="/common/auto?pid={value}&type=2"
|
|
data-next="#bd-auto2-id">
|
|
<option value="0">选择品牌</option>
|
|
<? if ($autoList[1]) {
|
|
foreach ($autoList[1] as $v) { ?>
|
|
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['brand_id'] ? 'selected' : '' ?>
|
|
><?= $v['name'] ?></option>
|
|
<? }
|
|
} ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<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">
|
|
<option value="0">选择车系</option>
|
|
<?php if ($autoList[2]) {
|
|
foreach ($autoList[2] as $v) { ?>
|
|
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['s_id'] ? 'selected' : '' ?>
|
|
><?= $v['name'] ?></option>
|
|
<?php }
|
|
} ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<div class="am-para-inline w120">
|
|
<select id="bd-auto3-id" name="v_id">
|
|
<option value="0">选择车型</option>
|
|
<?php if ($autoList[3]) {
|
|
foreach ($autoList[3] as $v) { ?>
|
|
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['v_id'] ? 'selected' : '' ?>
|
|
><?= $v['name'] ?></option>
|
|
<?php }
|
|
} ?>
|
|
</select>
|
|
</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>
|
|
</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">新增
|
|
</button>
|
|
</div>
|
|
<div class="am-form-group fl ml10">
|
|
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="coms-table-bd">
|
|
<table class="am-table am-table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th width="5%"><span>商品ID</span></th>
|
|
<th width="10%"><span>品牌</span></th>
|
|
<th width="10%"><span>车系</span></th>
|
|
<th width="10%"><span>车型</span></th>
|
|
<th width="6%"><span>车身颜色</span></th>
|
|
<th width="6%"><span>内饰颜色</span></th>
|
|
<th width="6%"><span>选装包</span></th>
|
|
<th width="6%"><span>市场平台价</span></th>
|
|
<th width="6%"><span>折扣%</span></th>
|
|
<th width="6%"><span>采购成本</span></th>
|
|
<th width="6%"><span>车辆状态</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if ($lists) {
|
|
foreach ($lists as $v) { ?>
|
|
<tr>
|
|
<td><?= $v['id'] ?></td>
|
|
<td><?= $v['brand_name'] ?></td>
|
|
<td><?= $v['s_name'] ?></td>
|
|
<td><?= $v['v_name'] ?></td>
|
|
<td><?= $v['cor_name'] ?></td>
|
|
<td><?= $v['incor_name'] ?></td>
|
|
<td><?= $v['if_pack_name'] ?></td>
|
|
<td><?= $v['ori_price'] ?></td>
|
|
<td><?= $v['discount'] ?></td>
|
|
<td><?= $v['buy_price'] ?></td>
|
|
<td><?= $v['status_name'] ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="11">
|
|
<div class="row">
|
|
<div class="col-md-4 align-l">
|
|
<?= $v['address'] ?>
|
|
</div>
|
|
<div class="col-md-8 align-r" style="padding-right: 30px;">
|
|
<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>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php }
|
|
} ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="coms-table-ft clearfix">
|
|
<div class="coms-pagination fr mr20">
|
|
<?php page_view($pager) ?>
|
|
</div>
|
|
</div>
|
|
<div id="goods-modal" style="display: none;padding: 10px">
|
|
<div class="modal-body">
|
|
<div class="text-center">
|
|
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
|
|
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
|
|
<div class="form-group-action">
|
|
<a href="/temp/goods.xlsx?0819" target="_blank" class="btn btn-default">查看模板</a>
|
|
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
|
|
<form id="import-form">
|
|
<input type="file" id="goods-file" name="file" accept=".xls,.xlsx"
|
|
style="left:-9999px;position:absolute;" onchange="load_goods()">
|
|
</form>
|
|
<span>上传Excel文件</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$('#bd-auto1-id').change(function () {
|
|
$('#bd-auto2-id').empty();
|
|
$('#bd-auto3-id').empty();
|
|
$("#bd-auto3-id").prepend("<option value='0'>选择车型</option>")
|
|
});
|
|
$('#bd-auto2-id').change(function () {
|
|
$('#bd-auto3-id').empty();
|
|
});
|
|
|
|
function load_goods() {
|
|
var file = $("#goods-file");
|
|
if (file.val() == '') {
|
|
layer.msg('文件是空的');
|
|
return 0;
|
|
}
|
|
var loading = layer.load(1, {
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
|
});
|
|
|
|
var options = {
|
|
url: "/items/goods/goods/add_excel",
|
|
type: "post",
|
|
dataType: "json",
|
|
data: {},
|
|
success: function (res) {
|
|
if (res['code']) {
|
|
layer.msg(res.msg, {
|
|
icon: 1,
|
|
time: 2000
|
|
}, function () {
|
|
location.reload();
|
|
});
|
|
} else {
|
|
layer.msg(res.msg, {icon: 2});
|
|
}
|
|
},
|
|
complete: function () {
|
|
file.val('');
|
|
layer.closeAll('loading');
|
|
}
|
|
};
|
|
$("#import-form").ajaxSubmit(options);
|
|
}
|
|
|
|
$(function () {
|
|
$("#import").click(function () {
|
|
$("#goods-file").val('');
|
|
layer.open({
|
|
type: 1,
|
|
area: ['40%'], //宽高
|
|
content: $('#goods-modal'),
|
|
title: '导入线索',
|
|
shade: false,
|
|
btn: ['完成'],
|
|
yes: function (index) {
|
|
layer.close(index);
|
|
}
|
|
});
|
|
|
|
});
|
|
});
|
|
</script>
|