You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/frontend/views/store-room/store-list-info.php

174 lines
8.1 KiB

6 years ago
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<form id="theFrm">
<input type="hidden" name="id" value="<?= isset($info) ? $info->id : '' ?>">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td class="td_bg">
<select name="category_id">
<option value="1" <?= isset($info) ? (1 == $info->category_id ? 'selected' : '') : '' ?>>配件入库
</option>
<option value="2" <?= isset($info) ? (2 == $info->category_id ? 'selected' : '') : '' ?>>辅料入库
</option>
<option value="3" <?= isset($info) ? (2 == $info->category_id ? 'selected' : '') : '' ?>>办公用品
</option>
</select>
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="100" height="25" class="bg_tr">品牌</td>
<td height="25" class="td_bg" width="300">
<select name="brand_id" id="brand_id">
<option value="">--请选择--</option>
<?php if ($brands): ?>
<?php foreach ($brands as $brand): ?>
<option value="<?= $brand->id ?>" <?= isset($info) ? ($info->brand_id == $brand->id ? 'selected' : '') : '' ?>><?= $brand->name ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</td>
<td width="100" height="25" class="bg_tr">车型</td>
<td height="25" class="td_bg" width="300">
<select name="series_id" id="series_id">
<option value="">--请选择--</option>
<?php if (isset($series)): ?>
<?php foreach ($series as $serie): ?>
<option value="<?= $serie->id ?>" <?= $serie->id == $info->series_id ? 'selected' : '' ?>><?= $serie->name ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</td>
<td width="100" height="25" class="bg_tr">排量</td>
<td height="25" class="td_bg">
<select name="displacement_id" id="displacement_id">
<option value="">--请选择--</option>
<?php if (isset($displacements)): ?>
<?php foreach ($displacements as $displacement): ?>
<option value="<?= $displacement->id ?>" <?= ($displacement->id == $info->displacement_id) ? 'selected' : '' ?>><?= $displacement->name ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">年款</td>
<td height="25" class="td_bg" colspan="5">
<input name="car_year" type="text" readonly onclick="WdatePicker({dateFmt:'yyyy'})"
value="<?= isset($info) ? $info->car_year : '' ?>">
</td>
<td width="100" height="25" class="bg_tr">仓库</td>
<td height="25" class="td_bg">
<input type="text" name="producing_area" value="<?= isset($info) ? $info->store_area : '' ?>">
</td>
<td width="100" height="25" class="bg_tr">货位</td>
<td height="25" class="td_bg">
<input type="text" name="producing_area" value="<?= isset($info) ? $info->store_site : '' ?>">
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="100" height="25" class="bg_tr">分类</td>
<td height="25" class="td_bg" width="300">
<select name="category_1">
<?php if (count($parents) > 0): ?>
<?php foreach ($parents as $parent): ?>
<option value="<?= $parent->id ?>"><?= $parent->name ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</td>
<td width="100" height="25" class="bg_tr">配件名称</td>
<td class="td_bg" width="300">
<input type="text" name="name" value="<?= isset($info) ? $info->name : '' ?>">
</td>
<td width="100" height="25" class="bg_tr">数量</td>
<td class="td_bg">
<input type="text" name="number" value="<?= isset($info) ? $info->number : '' ?>">
</td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">价格</td>
<td height="25" class="td_bg">
<input type="text" name="price" value="<?= isset($info) ? $info->price : '' ?>">
</td>
<td width="100" height="25" class="bg_tr">产地</td>
<td height="25" class="td_bg">
<input type="text" name="producing_area" value="<?= isset($info) ? $info->producing_area : '' ?>">
</td>
<td width="100" height="25" class="bg_tr">采购清单</td>
<td height="25" class="td_bg" colspan="3">
<select>
<option value="0">采购清单</option>
</select>
</td>
</tr>
<tr>
<td height="22" colspan="6" align="center" class="td_bg">
<?php if (!isset($info)): ?>
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
<?php else: ?>
<input id="save-btn" type=button class="ACT_btn" name=Submit1 value=" 保存 "/>
<?php endif; ?>
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
</td>
</tr>
</table>
</form>
<script type="text/javascript" language="javascript">
//提交按钮
$('#submit-btn').on('click', function () {
if (!confirm('确定提交吗')) return false;
var params = $('#theFrm').serialize();
$.post('/store-room/put-in-store-info', params, function (msg) {
alert(msg.msg);
if (msg.success) {
// location.reload();
window.location.href = "/store-room/store-list";
}
}, 'json');
});
//保存按钮
$('#save-btn').on('click', function () {
var params = $('#theFrm').serialize();
$.post('/store-room/store-list-info', params, function (msg) {
alert(msg.msg);
if (msg.success) {
location.reload();
}
}, 'json');
});
//返回按钮
$('#back-btn').on('click', function () {
window.location.href = '/store-room/store-list';
});
$('#brand_id').change(function () {
var brand_id = $(this).val();
$('#series_id').html('<option value="0">---请选择---</option>');
$('#displacement_id').html('<option value="0">---请选择---</option>');
if (brand_id > 0) {
$.get('/car/series', {brand_id: brand_id}, function (obj) {
if (obj.success) {
$('#series_id').html(obj.html);
}
}, 'json');
}
});
$('#series_id').change(function () {
var series_id = $(this).val();
$('#displacement_id').html('<option value="0">---请选择---</option>');
if (series_id > 0) {
$.get('/car/displacement', {series_id: series_id}, function (obj) {
if (obj.success) {
$('#displacement_id').html(obj.html);
}
}, 'json');
}
});
</script>