123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- @{
- ViewBag.Title = "岗位管理";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- @using MES.Production.Service;
- @using Central.Control.Domain;
- @using Ant.Service.Common;
- @using Ant.Service.Common.Enums;
- @using CommonToolHelper;
- @using MES.Production.Entity;
- @model PageInfo
- <!-- table star -->
- <div class="row col-lg-12">
- <div class="wrapper wrapper-content animated fadeInUp">
- <div class="ibox">
- <div class="ibox-title">
- <h5>农机管理</h5>
- <div class="ibox-tools rboor">
- <a class="btn btn-primary btn-xs p310" id="insert" action="add"><i class="im-plus"></i> 创建新农机</a>
- <a class="btn btn-primary btn-xs p310" id="modify" action="edit"><i class="im-pencil2"></i> 编辑</a>
- <a class="btn btn-primary btn-xs p310" id="delete" action="remove"><i class="im-remove4"></i> 删除</a>
- </div>
- </div>
- <div class="ibox-content">
- <!-- search star -->
- @using (Ajax.BeginForm("Index", null, new AjaxOptions() { }, new { @id = "form1", @class = "form-horizontal", @method = "get" }))
- {
- <div class="form-horizontal clearfix">
- <div class="col-lg-2 col-sm-3 pl0" style="width:70%;float:left;">
- <div class="form-group">
- <label class="control-label" style="float:left;">经销商:</label>
- <div class="col-lg-8 col-sm-7" style="width:28% !important;">
- <select id="FK_DPTID" name="FK_DPTID" class="form-control select2" onchange="submit()">
- <option value="" @(ViewData["dptid"] == null ? "selected=\"selected\"" : "")>--请选择--</option>
- @{
- var department = ViewData["Department"] as dynamic;
- foreach (var item in department)
- {
- <option value="@item.ID" @(ViewData["dptid"] != null && ViewData["dptid"].ToString() != "" && ViewData["dptid"].ToString() == item.ID ? "selected" : "")>@CommonHtmlHelper.RtfTextToHtml(item.NAME)</option>
- }
- }
- </select>
- </div>
- <label class="control-label" style="float:left;">农机状态:</label>
- <div class="col-lg-4 col-sm-7" style="width:15% !important;">
- <select name="CarSate" id="CarSate" class="form-control" datatype="*" nullmsg="请选择状态" onchange="submit()">
- <option value="-1" selected>请选择</option>
- @{
- var level = ViewData["levels"] as List<SYS_CODE>;
- if (level != null && level.Count > 0)
- {
- foreach (var item in level)
- {
- <option value="@item.CODEVALUE" @(ViewData["CarSate"] != null && ViewData["CarSate"].ToString() != "" && ViewData["CarSate"].ToString() == item.CODEVALUE ? "selected" : "")>@item.NAMETEXT</option>
- }
- }
- }
- </select>
- </div>
- <label class="control-label" style="float:left;">农机类型:</label>
- <div class="col-lg-4 col-sm-7" style="width:15% !important;">
- <select name="LeaseStatus" id="LeaseStatus" class="form-control" datatype="*" nullmsg="请选择车辆类型" onchange="submit()">
- <option value="">请选择</option>
- @{
- var cartype = ViewData["cartype"] as List<SYS_CODE>;
- if (cartype != null && cartype.Count > 0)
- {
- foreach (var item in cartype)
- {
- <option value="@item.CODEVALUE" @(ViewData["typecar"] != null && ViewData["typecar"].ToString() != "" && ViewData["typecar"].ToString() == item.CODEVALUE ? "selected" : "")>@item.NAMETEXT</option>
- }
- }
- }
- </select>
- </div>
- </div>
- </div>
- <div class="col-lg-4 col-sm-4" style="width: 28%;float:right;">
- <div class="form-group">
- <div class="col-lg-12 col-sm-12 input-group" style="float:right;">
- @Html.TextBox("Search", null, new { @class = "input-sm form-control", @placeholder = "请输入农机名称查询" })
- <span class="input-group-btn">
- <button type="button" onclick="submit()" class="btn btn-sm btn-primary">搜索</button>
- </span>
- </div>
- </div>
- </div>
- </div>
- <!-- search end -->
- <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
- <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
- <thead>
- <tr>
- <th class="tn" style="width: 5% !important"><input name="checkall" id="checkall" type="checkbox" value=""></th>
- <th>IMEI号</th>
- <th>条码</th>
- <th>农机名称</th>
- <th>农机型号</th>
- <th>所属经销商</th>
- <th>农机状态</th>
- @*<th style="width: 100px !important">是否绑定</th>*@
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- @{foreach (var item in Model.List)
- {
- <tr>
- <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>
- <td>
- @item.CarID
- </td>
- <td>@item.carBar</td>
- <td>@item.CarName</td>
- <td>@item.CarModel</td>
- <td>@item.DistributorsName</td>
- @{
- switch ((int)item.CarSate)
- {
- case 1:
- {
- <td>已绑定</td>;
- }
- break;
- case 2:
- {
- <td>已出库</td>
- }
- break;
- case 3:
- {
- <td>在途中</td>
- }
- break;
- case 4:
- {
- <td>已入库</td>
- }
- break;
- case 5:
- {
- <td>已销售</td>
- }
- break;
- case 6:
- {
- <td>退货中</td>
- }
- break;
- case 7:
- {
- <td>调拨中</td>
- }
- break;
- case 8:
- {
- <td>返厂中</td>
- }
- break;
- default:
- {
- <td>初始值</td>
- }
- break;
- }
- }
- @*<td>@item.lang</td>*@
- @{
- if (item.CarSate > 0)
- {
- <td><a href="javascript:carview('@item.CarID')" listaction="detail">查看农机信息</a></td>
- }
- else
- {
- <td></td>
- }
- }
- </tr>
- }
- }
- </tbody>
- </table>
- <!-- page -->
- <div class="bottom">
- @if (Model != null)
- {
- <div class="dataTables_info" id="example_info" Post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
- <div class="dataTables_length" id="example_length">
- <label>
- 显示
- <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
- <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
- <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
- <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
- <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
- </select> 项结果
- </label>
- </div>
- @CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url);
- }
- <div class="clear"></div>
- </div>
- <!-- page -->
- </div>
- }
- </div>
- </div>
- </div>
- </div>
- <!-- table end -->
- @section scripts{
- <script type="text/javascript">
- //点击修改
- function modify(n) {
- dig.addModel('添加/编辑农机', '/Sys/Car/Detail/' + n, 700, 500, function () {
- if (this.returnValue == 'yes') {
- location.reload();
- }
- });
- }
- function carview(n) {
- dig.addModel('查看/农机信息', '/Sys/car/carmap/' + n, 700, 800, function () {
- if (this.returnValue == 'yes') {
- location.reload();
- }
- });
- }
- $(function () {
- $('.select2').select2();
- $("example").colResizable();
- //添加
- $('#insert').click(function () {
- dig.addModel('添加/编辑农机', '/Sys/Car/Detail', 700, 500, function () {
- if (this.returnValue == 'yes') {
- location.reload();
- }
- });
- });
- //修改
- $('#modify').click(function () {
- var vals = '';
- var num = 0;
- $('input[name="checkbox_name"]:checked').each(function () {
- vals = $(this).val();
- num++;
- });
- if (!vals) {
- dig.alertError("提示", "对不起,请选中您要操作的记录!");
- return;
- }
- if (num > 1) {
- dig.alertError("提示", "对不起,每次只能修改一条记录!");
- return;
- }
- dig.addModel('添加/编辑农机', '/Sys/Car/Detail/' + vals, 600, 280, function () {
- if (this.returnValue == 'yes') {
- location.reload();
- }
- });
- });
- });
- </script>
- }
|