Commit ba862df15315ede0eb85c61811de5717c935097d

Authored by 徐烜
1 parent a2767ff0

update

src/main/java/com/bsth/controller/CarDeviceController.java 0 → 100644
  1 +package com.bsth.controller;
  2 +
  3 +import com.bsth.entity.CarDevice;
  4 +import org.springframework.web.bind.annotation.RequestBody;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RequestMethod;
  7 +import org.springframework.web.bind.annotation.RestController;
  8 +
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * Created by xu on 16/6/15.
  13 + */
  14 +@RestController
  15 +@RequestMapping("carDevice")
  16 +public class CarDeviceController extends BaseController<CarDevice, Long> {
  17 +
  18 + /**
  19 + * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
  20 + * @Title: save
  21 + * @Description: TODO(持久化对象)
  22 + * @param @param t
  23 + * @param @return 设定文件
  24 + * @return Map<String,Object> {status: 1(成功),-1(失败)}
  25 + * @throws
  26 + */
  27 + @RequestMapping(method = RequestMethod.POST)
  28 + public Map<String, Object> save(@RequestBody CarDevice t){
  29 + return baseService.save(t);
  30 + }
  31 +}
src/main/java/com/bsth/repository/CarDeviceRepository.java 0 → 100644
  1 +package com.bsth.repository;
  2 +
  3 +import com.bsth.entity.CarDevice;
  4 +import org.springframework.stereotype.Repository;
  5 +
  6 +/**
  7 + * Created by xu on 16/6/15.
  8 + */
  9 +@Repository
  10 +public interface CarDeviceRepository extends BaseRepository<CarDevice, Long> {
  11 +}
src/main/java/com/bsth/service/CarDeviceService.java 0 → 100644
  1 +package com.bsth.service;
  2 +
  3 +import com.bsth.entity.CarDevice;
  4 +
  5 +/**
  6 + * Created by xu on 16/6/15.
  7 + */
  8 +public interface CarDeviceService extends BaseService<CarDevice, Long> {
  9 +}
src/main/java/com/bsth/service/impl/CarDeviceServiceImpl.java 0 → 100644
  1 +package com.bsth.service.impl;
  2 +
  3 +import com.bsth.entity.CarDevice;
  4 +import com.bsth.service.CarDeviceService;
  5 +import org.springframework.stereotype.Service;
  6 +
  7 +/**
  8 + * Created by xu on 16/6/15.
  9 + */
  10 +@Service
  11 +public class CarDeviceServiceImpl extends BaseServiceImpl<CarDevice, Long> implements CarDeviceService {
  12 +}
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>车辆设备详细信息</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">基础信息</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="deviceInfoManage">车辆设备信息管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">车辆设备详细信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="DeviceInfoManageDetailCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase"
  30 + ng-bind="ctrl.title"></span>
  31 + </div>
  32 + </div>
  33 +
  34 + <div class="portlet-body form">
  35 + <form class="form-horizontal" novalidate name="myForm">
  36 + <div class="form-body">
  37 + <div class="form-group has-success has-feedback">
  38 + <label class="col-md-2 control-label">所属公司*:</label>
  39 + <div class="col-md-3">
  40 + <input type="text" class="form-control" name="gsName"
  41 + ng-model="ctrl.deviceInfoForDetail.gsName" readonly/>
  42 + </div>
  43 + </div>
  44 + <div class="form-group has-success has-feedback">
  45 + <label class="col-md-2 control-label">车辆内部编号/自编号*:</label>
  46 + <div class="col-md-3">
  47 + <input type="text" class="form-control" name="clZbh"
  48 + ng-model="ctrl.deviceInfoForDetail.clZbh" readonly/>
  49 + </div>
  50 + </div>
  51 + <div class="form-group has-success has-feedback">
  52 + <label class="col-md-2 control-label">线路*:</label>
  53 + <div class="col-md-3">
  54 + <input type="text" class="form-control" name="xlName"
  55 + ng-model="ctrl.deviceInfoForDetail.xlName" readonly/>
  56 + </div>
  57 + </div>
  58 + <div class="form-group has-success has-feedback">
  59 + <label class="col-md-2 control-label">旧终端号*:</label>
  60 + <div class="col-md-3">
  61 + <input type="text" class="form-control" name="oldDeviceNo"
  62 + ng-model="ctrl.deviceInfoForDetail.oldDeviceNo" readonly/>
  63 + </div>
  64 + </div>
  65 + <div class="form-group has-success has-feedback">
  66 + <label class="col-md-2 control-label">新终端号*:</label>
  67 + <div class="col-md-3">
  68 + <input type="text" class="form-control" name="newDeviceNo"
  69 + ng-model="ctrl.deviceInfoForDetail.newDeviceNo" readonly/>
  70 + </div>
  71 + </div>
  72 +
  73 + <div class="form-group">
  74 + <label class="col-md-2 control-label">旧SIM卡号:</label>
  75 + <div class="col-md-4">
  76 + <input type="text" class="form-control" name="oldSimNo"
  77 + ng-model="ctrl.deviceInfoForDetail.oldSimNo" readonly/>
  78 + </div>
  79 + </div>
  80 + <div class="form-group">
  81 + <label class="col-md-2 control-label">新SIM卡号:</label>
  82 + <div class="col-md-4">
  83 + <input type="text" class="form-control" name="newSimNo"
  84 + ng-model="ctrl.deviceInfoForDetail.newSimNo" readonly/>
  85 + </div>
  86 + </div>
  87 +
  88 + <div class="form-group">
  89 + <label class="col-md-2 control-label">故障描述:</label>
  90 + <div class="col-md-10">
  91 + <textarea rows="3" class="form-control" name="troubleDesc"
  92 + ng-model="ctrl.deviceInfoForDetail.troubleDesc" readonly></textarea>
  93 + </div>
  94 + </div>
  95 +
  96 + <div class="form-group">
  97 + <label class="col-md-2 control-label">保修描述:</label>
  98 + <div class="col-md-10">
  99 + <textarea rows="3" class="form-control" name="guaranteeDesc"
  100 + ng-model="ctrl.deviceInfoForDetail.guaranteeDesc" readonly></textarea>
  101 + </div>
  102 + </div>
  103 +
  104 + <!-- 其他form-group -->
  105 +
  106 + </div>
  107 + </form>
  108 + </div>
  109 +
  110 +</div>
0 \ No newline at end of file 111 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js
1 // 设备信息维护 service controller 等写在一起 1 // 设备信息维护 service controller 等写在一起
2 2
3 -angular.module('ScheduleApp').factory('DeviceInfoManageService', ['$resource', function($resource) {  
4 - // TODO:测试  
5 - var pageInfo = {  
6 - totalItems: 64,  
7 - currentPage: 4,  
8 - infos: []  
9 - }; 3 +angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) {
  4 + /** 公司字典 */
  5 + var gses = [
  6 + {gsdm: "55", gsmc: "上南公司"},
  7 + {gsdm: "22", gsmc: "金高公司"},
  8 + {gsdm: "05", gsmc: "杨高公司"},
  9 + {gsdm: "26", gsmc: "南汇公司"}
  10 + ];
  11 +
  12 + /** 当前的查询条件信息 */
  13 + var currentSearchCondition = {};
  14 +
  15 + /** 当前第几页 */
  16 + var currentPageNo = 1;
10 17
11 return { 18 return {
12 - pi: function() {  
13 - console.log("pi");  
14 - return pageInfo; 19 + /**
  20 + * 获取公司字典。
  21 + */
  22 + getGses: function() {
  23 + return gses;
  24 + },
  25 + /**
  26 + * 获取查询条件信息,
  27 + * 用于给controller用来和页面数据绑定。
  28 + */
  29 + getSearchCondition: function() {
  30 + return currentSearchCondition;
15 }, 31 },
16 - setCP: function(cp) {  
17 - console.log("setCP");  
18 - pageInfo.currentPage = cp; 32 + /**
  33 + * 重置查询条件信息。
  34 + */
  35 + resetSearchCondition: function() {
  36 + var key;
  37 + for (key in currentSearchCondition) {
  38 + currentSearchCondition[key] = "";
  39 + }
  40 + },
  41 + /**
  42 + * 设置当前页码。
  43 + * @param cpn 从1开始,后台是从0开始的
  44 + */
  45 + setCurrentPageNo: function(cpn) {
  46 + currentPageNo = cpn;
  47 + },
  48 + /**
  49 + * 组装查询参数,返回一个promise查询结果。
  50 + * @param params 查询参数
  51 + * @return 返回一个 promise
  52 + */
  53 + getPage: function() {
  54 + var params = currentSearchCondition; // 查询条件
  55 + params.page = currentPageNo - 1; // 服务端页码从0开始
  56 + return service.list(params).$promise;
  57 + },
  58 + /**
  59 + * 获取明细信息。
  60 + * @param id 车辆id
  61 + * @return 返回一个 promise
  62 + */
  63 + getDetail: function(id) {
  64 + var params = {id: id};
  65 + return service.get(params).$promise;
  66 + },
  67 + /**
  68 + * 保存信息。
  69 + * @param obj 车辆详细信息
  70 + * @return 返回一个 promise
  71 + */
  72 + saveDetail: function(obj) {
  73 + return service.save(obj).$promise;
19 } 74 }
20 - } 75 + };
  76 +
21 }]); 77 }]);
22 78
23 -angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { 79 +angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) {
  80 + var self = this;
  81 +
  82 + // 切换到form状态
  83 + self.goForm = function() {
  84 + //alert("切换");
  85 + $state.go("deviceInfoManage_form");
  86 + }
  87 +
24 88
25 }]); 89 }]);
26 90
27 angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { 91 angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) {
28 - // TODO:模拟数据  
29 var self = this; 92 var self = this;
30 - self.pi = deviceInfoManageService.pi(); 93 + self.pageInfo = {
  94 + totalItems : 0,
  95 + currentPage : 1,
  96 + infos: []
  97 + };
  98 +
  99 + // 初始创建的时候,获取一次列表数据
  100 + deviceInfoManageService.getPage().then(
  101 + function(result) {
  102 + self.pageInfo.totalItems = result.totalElements;
  103 + self.pageInfo.currentPage = result.number + 1;
  104 + self.pageInfo.infos = result.content;
  105 + deviceInfoManageService.setCurrentPageNo(result.number + 1);
  106 + },
  107 + function(result) {
  108 + alert("出错啦!");
  109 + }
  110 + );
  111 +
  112 + // 翻页的时候调用
31 self.pageChanaged = function() { 113 self.pageChanaged = function() {
32 - console.log("go:" + deviceInfoManageService.pi().currentPage); 114 + deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);
  115 + deviceInfoManageService.getPage().then(
  116 + function(result) {
  117 + self.pageInfo.totalItems = result.totalElements;
  118 + self.pageInfo.currentPage = result.number + 1;
  119 + self.pageInfo.infos = result.content;
  120 + deviceInfoManageService.setCurrentPageNo(result.number + 1);
  121 + },
  122 + function(result) {
  123 + alert("出错啦!");
  124 + }
  125 + );
  126 + };
  127 + // 获取查询条件数据
  128 + self.searchCondition = function() {
  129 + return deviceInfoManageService.getSearchCondition();
  130 + };
  131 + // 重置查询条件
  132 + self.resetSearchCondition = function() {
  133 + return deviceInfoManageService.resetSearchCondition();
33 }; 134 };
34 135
35 }]); 136 }]);
36 137
37 -angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { 138 +angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) {
  139 + var self = this;
  140 +
  141 + // 欲保存的busInfo信息,绑定
  142 + self.deviceInfoForSave = {};
  143 +
  144 + // 公司 selectedItem
  145 + self.deviceInfoForSave.gs_selected = null;
  146 + self.gses = deviceInfoManageService.getGses();
  147 + self.gs_selected_change = function($item, $model) {
  148 + self.deviceInfoForSave.gsName = $item.gsmc;
  149 + };
  150 + self.gs_selected_remove = function() {
  151 + self.deviceInfoForSave.gs_selected = null;
  152 + self.deviceInfoForSave.gsName = null;
  153 + };
  154 +
  155 + // 获取传过来的id,有的话就是修改,获取一遍数据
  156 + var id = $stateParams.id;
  157 + if (id) {
  158 + self.deviceInfoForSave.id = id;
  159 + deviceInfoManageService.getDetail(id).then(
  160 + function(result) {
  161 + var key;
  162 + for (key in result) {
  163 + self.deviceInfoForSave[key] = result[key];
  164 + }
  165 + // 填写所有的 select 控件选中框数据
  166 + // 公司字典
  167 + if (self.deviceInfoForSave.gsName) {
  168 + angular.forEach(self.gses, function(data) {
  169 + if (self.deviceInfoForSave.gsName == data.gsmc) {
  170 + self.deviceInfoForSave.gs_selected = data;
  171 + }
  172 + });
  173 + }
  174 + },
  175 + function(result) {
  176 + alert("出错啦!");
  177 + }
  178 + );
  179 + }
  180 +
  181 + // 提交方法
  182 + self.submit = function() {
  183 + console.log(self.deviceInfoForSave);
  184 + deviceInfoManageService.saveDetail(self.deviceInfoForSave).then(
  185 + function(result) {
  186 + // TODO:弹出框方式以后改
  187 + if (result.status == 'SUCCESS') {
  188 + alert("保存成功!");
  189 + $state.go("deviceInfoManage");
  190 + } else {
  191 + alert("保存异常!");
  192 + }
  193 + },
  194 + function(result) {
  195 + // TODO:弹出框方式以后改
  196 + alert("出错啦!");
  197 + }
  198 + );
  199 + };
38 200
39 }]); 201 }]);
40 202
41 -angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { 203 +angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) {
  204 + var self = this;
  205 + self.title = "";
  206 + self.deviceInfoForDetail = {};
  207 + self.deviceInfoForDetail.id = $stateParams.id;
  208 +
  209 + // 当转向到此页面时,就获取明细信息并绑定
  210 + deviceInfoManageService.getDetail($stateParams.id).then(
  211 + function(result) {
  212 + var key;
  213 + for (key in result) {
  214 + self.deviceInfoForDetail[key] = result[key];
  215 + }
42 216
  217 + self.title = "车辆 " + self.deviceInfoForDetail.clZbh + " 详细信息";
  218 + },
  219 + function(result) {
  220 + // TODO:弹出框方式以后改
  221 + alert("出错啦!");
  222 + }
  223 + );
43 }]); 224 }]);
44 \ No newline at end of file 225 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>修改车辆设备信息</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">基础信息</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="deviceInfoManage">车辆设备信息管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">修改车辆设备信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="DeviceInfoManageFormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 + <div class="form-body">
  36 + <div class="form-group has-success has-feedback">
  37 + <label class="col-md-2 control-label">所属公司*:</label>
  38 + <div class="col-md-3">
  39 + <div class="input-group">
  40 + <ui-select ng-model="ctrl.deviceInfoForSave.gs_selected"
  41 + on-select="ctrl.gs_selected_change($item, $model)"
  42 + theme="bootstrap" name="gs" required>
  43 + <ui-select-match placeholder="请选择所属公司...">{{$select.selected.gsmc}}</ui-select-match>
  44 + <ui-select-choices repeat="item in ctrl.gses">
  45 + <span ng-bind="item.gsmc"></span>
  46 + </ui-select-choices>
  47 + </ui-select>
  48 + <span class="input-group-btn">
  49 + <button type="button" ng-click="ctrl.gs_selected_remove()" class="btn btn-default">
  50 + <span class="glyphicon glyphicon-trash"></span>
  51 + </button>
  52 + </span>
  53 + </div>
  54 + </div>
  55 + <!-- 隐藏块,显示验证信息 -->
  56 + <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required">
  57 + 公司必须选择
  58 + </div>
  59 + </div>
  60 +
  61 + <div class="form-group has-success has-feedback">
  62 + <label class="col-md-2 control-label">车辆内部编号/自编号*:</label>
  63 + <div class="col-md-3">
  64 + <input type="text" class="form-control"
  65 + name="clZbh" ng-model="ctrl.deviceInfoForSave.clZbh"
  66 + required placeholder="请输入车辆内部编号/自编号"/>
  67 + </div>
  68 + <!-- 隐藏块,显示验证信息 -->
  69 + <div class="alert alert-danger well-sm" ng-show="myForm.clZbh.$error.required">
  70 + 车辆内部编号/自编号必须填写
  71 + </div>
  72 + </div>
  73 +
  74 + <div class="form-group has-success has-feedback">
  75 + <label class="col-md-2 control-label">线路*:</label>
  76 + <div class="col-md-3">
  77 + <input type="text" class="form-control"
  78 + name="xlName" ng-model="ctrl.deviceInfoForSave.xlName"
  79 + required placeholder="请输入线路"/>
  80 + </div>
  81 + <!-- 隐藏块,显示验证信息 -->
  82 + <div class="alert alert-danger well-sm" ng-show="myForm.xlName.$error.required">
  83 + 线路必须填写
  84 + </div>
  85 + </div>
  86 +
  87 + <div class="form-group has-success has-feedback">
  88 + <label class="col-md-2 control-label">旧终端号*:</label>
  89 + <div class="col-md-3">
  90 + <input type="text" class="form-control"
  91 + name="oldDeviceNo" ng-model="ctrl.deviceInfoForSave.oldDeviceNo"
  92 + required placeholder="请输入旧终端号"/>
  93 + </div>
  94 + <!-- 隐藏块,显示验证信息 -->
  95 + <div class="alert alert-danger well-sm" ng-show="myForm.oldDeviceNo.$error.required">
  96 + 旧终端号必须填写
  97 + </div>
  98 + </div>
  99 +
  100 + <div class="form-group has-success has-feedback">
  101 + <label class="col-md-2 control-label">新终端号*:</label>
  102 + <div class="col-md-3">
  103 + <input type="text" class="form-control"
  104 + name="newDeviceNo" ng-model="ctrl.deviceInfoForSave.newDeviceNo"
  105 + required placeholder="请输入新终端号"/>
  106 + </div>
  107 + <!-- 隐藏块,显示验证信息 -->
  108 + <div class="alert alert-danger well-sm" ng-show="myForm.newDeviceNo.$error.required">
  109 + 新终端号必须填写
  110 + </div>
  111 + </div>
  112 +
  113 + <div class="form-group">
  114 + <label class="col-md-2 control-label">旧SIM卡号:</label>
  115 + <div class="col-md-4">
  116 + <input type="text" class="form-control" ng-model="ctrl.deviceInfoForSave.oldSimNo"
  117 + placeholder="请输入旧SIM卡号"/>
  118 + </div>
  119 + </div>
  120 +
  121 + <div class="form-group">
  122 + <label class="col-md-2 control-label">新SIM卡号:</label>
  123 + <div class="col-md-4">
  124 + <input type="text" class="form-control" ng-model="ctrl.deviceInfoForSave.newSimNo"
  125 + placeholder="请输入新SIM卡号"/>
  126 + </div>
  127 + </div>
  128 +
  129 + <div class="form-group">
  130 + <label class="col-md-2 control-label">故障描述:</label>
  131 + <div class="col-md-10">
  132 + <textarea rows="3" class="form-control" name="descriptions"
  133 + ng-model="ctrl.deviceInfoForSave.troubleDesc"></textarea>
  134 + </div>
  135 + </div>
  136 +
  137 + <div class="form-group">
  138 + <label class="col-md-2 control-label">保修描述:</label>
  139 + <div class="col-md-10">
  140 + <textarea rows="3" class="form-control" name="descriptions"
  141 + ng-model="ctrl.deviceInfoForSave.guaranteeDesc"></textarea>
  142 + </div>
  143 + </div>
  144 +
  145 + <!-- 其他form-group -->
  146 +
  147 + </div>
  148 +
  149 + <div class="form-actions">
  150 + <div class="row">
  151 + <div class="col-md-offset-3 col-md-4">
  152 + <button type="submit" class="btn green" ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  153 + <a type="button" class="btn default" ui-sref="deviceInfoManage" ><i class="fa fa-times"></i> 取消</a>
  154 + </div>
  155 + </div>
  156 + </div>
  157 + </form>
  158 + </div>
  159 +
  160 +</div>
0 \ No newline at end of file 161 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>添加车辆设备信息</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">基础信息</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="deviceInfoManage">车辆设备信息管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">添加车辆设备信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="DeviceInfoManageFormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 + <div class="form-body">
  36 + <div class="form-group has-success has-feedback">
  37 + <label class="col-md-2 control-label">所属公司*:</label>
  38 + <div class="col-md-3">
  39 + <div class="input-group">
  40 + <ui-select ng-model="ctrl.deviceInfoForSave.gs_selected"
  41 + on-select="ctrl.gs_selected_change($item, $model)"
  42 + theme="bootstrap" name="gs" required>
  43 + <ui-select-match placeholder="请选择所属公司...">{{$select.selected.gsmc}}</ui-select-match>
  44 + <ui-select-choices repeat="item in ctrl.gses">
  45 + <span ng-bind="item.gsmc"></span>
  46 + </ui-select-choices>
  47 + </ui-select>
  48 + <span class="input-group-btn">
  49 + <button type="button" ng-click="ctrl.gs_selected_remove()" class="btn btn-default">
  50 + <span class="glyphicon glyphicon-trash"></span>
  51 + </button>
  52 + </span>
  53 + </div>
  54 + </div>
  55 + <!-- 隐藏块,显示验证信息 -->
  56 + <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required">
  57 + 公司必须选择
  58 + </div>
  59 + </div>
  60 +
  61 + <div class="form-group has-success has-feedback">
  62 + <label class="col-md-2 control-label">车辆内部编号/自编号*:</label>
  63 + <div class="col-md-3">
  64 + <input type="text" class="form-control"
  65 + name="clZbh" ng-model="ctrl.deviceInfoForSave.clZbh"
  66 + required placeholder="请输入车辆内部编号/自编号"/>
  67 + </div>
  68 + <!-- 隐藏块,显示验证信息 -->
  69 + <div class="alert alert-danger well-sm" ng-show="myForm.clZbh.$error.required">
  70 + 车辆内部编号/自编号必须填写
  71 + </div>
  72 + </div>
  73 +
  74 + <div class="form-group has-success has-feedback">
  75 + <label class="col-md-2 control-label">线路*:</label>
  76 + <div class="col-md-3">
  77 + <input type="text" class="form-control"
  78 + name="xlName" ng-model="ctrl.deviceInfoForSave.xlName"
  79 + required placeholder="请输入线路"/>
  80 + </div>
  81 + <!-- 隐藏块,显示验证信息 -->
  82 + <div class="alert alert-danger well-sm" ng-show="myForm.xlName.$error.required">
  83 + 线路必须填写
  84 + </div>
  85 + </div>
  86 +
  87 + <div class="form-group has-success has-feedback">
  88 + <label class="col-md-2 control-label">旧终端号*:</label>
  89 + <div class="col-md-3">
  90 + <input type="text" class="form-control"
  91 + name="oldDeviceNo" ng-model="ctrl.deviceInfoForSave.oldDeviceNo"
  92 + required placeholder="请输入旧终端号"/>
  93 + </div>
  94 + <!-- 隐藏块,显示验证信息 -->
  95 + <div class="alert alert-danger well-sm" ng-show="myForm.oldDeviceNo.$error.required">
  96 + 旧终端号必须填写
  97 + </div>
  98 + </div>
  99 +
  100 + <div class="form-group has-success has-feedback">
  101 + <label class="col-md-2 control-label">新终端号*:</label>
  102 + <div class="col-md-3">
  103 + <input type="text" class="form-control"
  104 + name="newDeviceNo" ng-model="ctrl.deviceInfoForSave.newDeviceNo"
  105 + required placeholder="请输入新终端号"/>
  106 + </div>
  107 + <!-- 隐藏块,显示验证信息 -->
  108 + <div class="alert alert-danger well-sm" ng-show="myForm.newDeviceNo.$error.required">
  109 + 新终端号必须填写
  110 + </div>
  111 + </div>
  112 +
  113 + <div class="form-group">
  114 + <label class="col-md-2 control-label">旧SIM卡号:</label>
  115 + <div class="col-md-4">
  116 + <input type="text" class="form-control" ng-model="ctrl.deviceInfoForSave.oldSimNo"
  117 + placeholder="请输入旧SIM卡号"/>
  118 + </div>
  119 + </div>
  120 +
  121 + <div class="form-group">
  122 + <label class="col-md-2 control-label">新SIM卡号:</label>
  123 + <div class="col-md-4">
  124 + <input type="text" class="form-control" ng-model="ctrl.deviceInfoForSave.newSimNo"
  125 + placeholder="请输入新SIM卡号"/>
  126 + </div>
  127 + </div>
  128 +
  129 + <div class="form-group">
  130 + <label class="col-md-2 control-label">故障描述:</label>
  131 + <div class="col-md-10">
  132 + <textarea rows="3" class="form-control" name="descriptions"
  133 + ng-model="ctrl.deviceInfoForSave.troubleDesc"></textarea>
  134 + </div>
  135 + </div>
  136 +
  137 + <div class="form-group">
  138 + <label class="col-md-2 control-label">保修描述:</label>
  139 + <div class="col-md-10">
  140 + <textarea rows="3" class="form-control" name="descriptions"
  141 + ng-model="ctrl.deviceInfoForSave.guaranteeDesc"></textarea>
  142 + </div>
  143 + </div>
  144 +
  145 + <!-- 其他form-group -->
  146 +
  147 + </div>
  148 +
  149 + <div class="form-actions">
  150 + <div class="row">
  151 + <div class="col-md-offset-3 col-md-4">
  152 + <button type="submit" class="btn green" ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  153 + <a type="button" class="btn default" ui-sref="deviceInfoManage" ><i class="fa fa-times"></i> 取消</a>
  154 + </div>
  155 + </div>
  156 + </div>
  157 + </form>
  158 + </div>
  159 +
  160 +</div>
0 \ No newline at end of file 161 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <span class="caption-subject bold uppercase">设备信息表</span> 27 <span class="caption-subject bold uppercase">设备信息表</span>
28 </div> 28 </div>
29 <div class="actions"> 29 <div class="actions">
30 - <a href="javascirpt:" class="btn btn-circle blue"> 30 + <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()">
31 <i class="fa fa-plus"></i> 31 <i class="fa fa-plus"></i>
32 添加设备信息 32 添加设备信息
33 </a> 33 </a>
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 </div> 58 </div>
59 59
60 <div class="portlet-body"> 60 <div class="portlet-body">
61 - <div ui-view="list"></div> 61 + <div ui-view="deviceInfoManage_list"></div>
62 </div> 62 </div>
63 </div> 63 </div>
64 </div> 64 </div>
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div ng-controller="DeviceInfoManageListCtrl as ctrl"> 2 <div ng-controller="DeviceInfoManageListCtrl as ctrl">
3 <table class="table table-striped table-bordered table-hover table-checkable order-column"> 3 <table class="table table-striped table-bordered table-hover table-checkable order-column">
4 <thead> 4 <thead>
5 - <tr> 5 + <tr role="row" class="heading">
6 <th> 6 <th>
7 <input type="checkbox" class="group-checkable"/> 7 <input type="checkbox" class="group-checkable"/>
8 </th> 8 </th>
@@ -15,16 +15,50 @@ @@ -15,16 +15,50 @@
15 <th>旧SIM卡</th> 15 <th>旧SIM卡</th>
16 <th>新SIM卡</th> 16 <th>新SIM卡</th>
17 <th>操作时间</th> 17 <th>操作时间</th>
18 - <th>操作</th> 18 + <th width="14%">操作</th>
  19 + </tr>
  20 + <tr role="row" class="filter">
  21 + <td></td>
  22 + <td></td>
  23 + <td>
  24 + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().xlName_like"/>
  25 + </td>
  26 + <td>
  27 + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().clZbh_like"/>
  28 + </td>
  29 + <td></td>
  30 + <td>
  31 + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().oldDeviceNo_like"/>
  32 + </td>
  33 + <td>
  34 + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().newDeviceNo_like"/>
  35 + </td>
  36 + <td>
  37 + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().oldSimNo_like"/>
  38 + </td>
  39 + <td>
  40 + <input type="text" class="form-control input-sm" ng-model="ctrl.searchCondition().newSimNo_like"/>
  41 + </td>
  42 + <td></td>
  43 + <td>
  44 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
  45 + ng-click="ctrl.pageChanaged()">
  46 + <i class="fa fa-search"></i> 搜索</button>
  47 +
  48 + <button class="btn btn-sm red btn-outline filter-cancel"
  49 + ng-click="ctrl.resetSearchCondition()">
  50 + <i class="fa fa-times"></i> 重置</button>
  51 + </td>
  52 +
19 </tr> 53 </tr>
20 </thead> 54 </thead>
21 <tbody> 55 <tbody>
22 - <tr ng-repeat="info in ctrl.infos" class="odd gradeX"> 56 + <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX">
23 <td> 57 <td>
24 <input type="checkbox"/> 58 <input type="checkbox"/>
25 </td> 59 </td>
26 <td> 60 <td>
27 - <span>todo</span> 61 + <span ng-bind="$index + 1"></span>
28 </td> 62 </td>
29 <td> 63 <td>
30 <span ng-bind="info.xlName"></span> 64 <span ng-bind="info.xlName"></span>
@@ -51,7 +85,10 @@ @@ -51,7 +85,10 @@
51 <span ng-bind="info.updateDate | date:'yyyy-MM-dd HH:mm:ss'"></span> 85 <span ng-bind="info.updateDate | date:'yyyy-MM-dd HH:mm:ss'"></span>
52 </td> 86 </td>
53 <td> 87 <td>
54 - <span>todo</span> 88 + <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
  89 + <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
  90 + <a ui-sref="deviceInfoManage_detail({id: info.id})" class="btn default blue-stripe btn-sm"> 详细 </a>
  91 + <a ui-sref="deviceInfoManage_edit({id: info.id})" class="btn default blue-stripe btn-sm"> 修改 </a>
55 </td> 92 </td>
56 </tr> 93 </tr>
57 </tbody> 94 </tbody>
@@ -59,11 +96,16 @@ @@ -59,11 +96,16 @@
59 </table> 96 </table>
60 97
61 <div style="text-align: right;"> 98 <div style="text-align: right;">
62 - <uib-pagination total-items="ctrl.pi.totalItems"  
63 - ng-model="ctrl.pi.currentPage"  
64 - ng-change="ctrl.pageChanged()" 99 + <uib-pagination total-items="ctrl.pageInfo.totalItems"
  100 + ng-model="ctrl.pageInfo.currentPage"
  101 + ng-change="ctrl.pageChanaged()"
  102 + rotate="false"
  103 + max-size="10"
  104 + boundary-links="true"
  105 + first-text="首页"
65 previous-text="上一页" 106 previous-text="上一页"
66 - next-text="下一页"> 107 + next-text="下一页"
  108 + last-text="尾页">
67 </uib-pagination> 109 </uib-pagination>
68 </div> 110 </div>
69 </div> 111 </div>
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 </div> 86 </div>
87 87
88 <div class="form-group has-success has-feedback"> 88 <div class="form-group has-success has-feedback">
89 - <label class="col-md-2 control-label">工号*:</label> 89 + <label class="col-md-2 control-label">姓名*:</label>
90 <div class="col-md-3"> 90 <div class="col-md-3">
91 <input type="text" class="form-control" 91 <input type="text" class="form-control"
92 name="personnelName" ng-model="ctrl.employeeInfoForSave.personnelName" 92 name="personnelName" ng-model="ctrl.employeeInfoForSave.personnelName"
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js
@@ -8,11 +8,6 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeInfoManageService&#39;, [&#39;EmployeeInf @@ -8,11 +8,6 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeInfoManageService&#39;, [&#39;EmployeeInf
8 {gsdm: "05", gsmc: "杨高公司"}, 8 {gsdm: "05", gsmc: "杨高公司"},
9 {gsdm: "26", gsmc: "南汇公司"} 9 {gsdm: "26", gsmc: "南汇公司"}
10 ]; 10 ];
11 - /** 男女性别类型字典 */  
12 - var sexes = [  
13 - {type: "男"},  
14 - {type: "女"}  
15 - ];  
16 /** 工种类型字典 */ 11 /** 工种类型字典 */
17 var postes = [ 12 var postes = [
18 {type: "公共汽电车驾驶员"}, 13 {type: "公共汽电车驾驶员"},
@@ -50,12 +45,6 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeInfoManageService&#39;, [&#39;EmployeeInf @@ -50,12 +45,6 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeInfoManageService&#39;, [&#39;EmployeeInf
50 return gses; 45 return gses;
51 }, 46 },
52 /** 47 /**
53 - * 获取性别字典。  
54 - */  
55 - getSexes: function() {  
56 - return sexes;  
57 - },  
58 - /**  
59 * 获取工种类型字典。 48 * 获取工种类型字典。
60 */ 49 */
61 getPostes: function() { 50 getPostes: function() {
@@ -121,7 +110,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;EmployeeInfoManageCtrl&#39;, [&#39;EmployeeInf @@ -121,7 +110,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;EmployeeInfoManageCtrl&#39;, [&#39;EmployeeInf
121 // 切换到form状态 110 // 切换到form状态
122 self.goForm = function() { 111 self.goForm = function() {
123 //alert("切换"); 112 //alert("切换");
124 - $state.go("employeeInfoManage_form"); 113 + $state.go("deviceInfoManage_form");
125 } 114 }
126 }]); 115 }]);
127 116
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 </div> 86 </div>
87 87
88 <div class="form-group has-success has-feedback"> 88 <div class="form-group has-success has-feedback">
89 - <label class="col-md-2 control-label">工号*:</label> 89 + <label class="col-md-2 control-label">姓名*:</label>
90 <div class="col-md-3"> 90 <div class="col-md-3">
91 <input type="text" class="form-control" 91 <input type="text" class="form-control"
92 name="personnelName" ng-model="ctrl.employeeInfoForSave.personnelName" 92 name="personnelName" ng-model="ctrl.employeeInfoForSave.personnelName"
src/main/resources/static/pages/scheduleApp/module/main.js
@@ -204,12 +204,6 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi @@ -204,12 +204,6 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi
204 } 204 }
205 }) 205 })
206 206
207 -  
208 -  
209 -  
210 -  
211 -  
212 -  
213 // 车辆设备信息模块配置 207 // 车辆设备信息模块配置
214 .state("deviceInfoManage", { 208 .state("deviceInfoManage", {
215 url: '/deviceInfoManage', 209 url: '/deviceInfoManage',
@@ -217,7 +211,7 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi @@ -217,7 +211,7 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi
217 "": { 211 "": {
218 templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html' 212 templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html'
219 }, 213 },
220 - "list@deviceInfoManage": { 214 + "deviceInfoManage_list@deviceInfoManage": {
221 templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html' 215 templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html'
222 } 216 }
223 }, 217 },
@@ -234,6 +228,68 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi @@ -234,6 +228,68 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi
234 }] 228 }]
235 } 229 }
236 }) 230 })
  231 + .state("deviceInfoManage_form", {
  232 + url: '/deviceInfoManage_form',
  233 + views: {
  234 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'}
  235 + },
  236 + resolve: {
  237 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  238 + return $ocLazyLoad.load({
  239 + name: 'deviceInfoManage_form_module',
  240 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  241 + files: [
  242 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  243 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  244 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  245 + ]
  246 + });
  247 + }]
  248 + }
  249 + })
  250 + .state("deviceInfoManage_edit", {
  251 + url: '/deviceInfoManage_edit/:id',
  252 + views: {
  253 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'}
  254 + },
  255 + resolve: {
  256 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  257 + return $ocLazyLoad.load({
  258 + name: 'deviceInfoManage_edit_module',
  259 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  260 + files: [
  261 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  262 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  263 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  264 + ]
  265 + });
  266 + }]
  267 + }
  268 + })
  269 + .state("deviceInfoManage_detail", {
  270 + url: '/deviceInfoManage_detail/:id',
  271 + views: {
  272 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'}
  273 + },
  274 + resolve: {
  275 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  276 + return $ocLazyLoad.load({
  277 + name: 'deviceInfoManage_module',
  278 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  279 + files: [
  280 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  281 + ]
  282 + });
  283 + }]
  284 + }
  285 + })
  286 +
  287 +
  288 +
  289 +
  290 +
  291 +
  292 +
237 293
238 // 车辆配置模块 294 // 车辆配置模块
239 .state("busConfig", { 295 .state("busConfig", {
@@ -355,6 +411,27 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeInfoManageService_g&#39;, [&#39;$resource @@ -355,6 +411,27 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeInfoManageService_g&#39;, [&#39;$resource
355 } 411 }
356 ); 412 );
357 }]); 413 }]);
  414 +// 车辆设备信息service
  415 +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
  416 + return $resource(
  417 + '/carDevice/:id',
  418 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  419 + {
  420 + list: {
  421 + method: 'GET',
  422 + params: {
  423 + page: 0
  424 + }
  425 + },
  426 + get: {
  427 + method: 'GET'
  428 + },
  429 + save: {
  430 + method: 'POST'
  431 + }
  432 + }
  433 + );
  434 +}]);
358 435
359 436
360 437