Sfoglia il codice sorgente

实现pc管理端设备管理动态获取厂商功能

humingfen 7 anni fa
parent
commit
2c39df2534

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/DeviceManufacturerController.java

@ -117,7 +117,7 @@ public class DeviceManufacturerController extends BaseController {
    public String findAll(){
        try{
            List<DeviceManufacturer> manufacturer = deviceManufacturerService.findAll();
            return write(200,"操作成功");
            return write(200,"操作成功","data",manufacturer);
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败");

+ 2 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/WlyyDeviceController.java

@ -1,6 +1,5 @@
package com.yihu.wlyy.controller.manager.device;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.device.entity.WlyyDevice;
@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
/**
@ -47,8 +45,8 @@ public class WlyyDeviceController extends BaseController {
    }
    @RequestMapping(value = "createInit")
    public String initCreatePage(@RequestParam(value = "id",required = false) Integer id){
        request.setAttribute("id",id);
    public String initCreatePage(){
//        request.setAttribute("id",id);
        return  "device/device_create";
    }

+ 0 - 2
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/device_create.jsp

@ -9,7 +9,6 @@
</head>
<body>
<div id="div_patient_info_form" data-role-form class="m-form-inline f-mt20 f-ml30" data-role-form>
	<input type="hidden" id="inp_id" value='${id}'/>
	<div class="m-form-group" style="padding:10 0 10 0">
		<label class="label_title" style="width:120px">设备名称</label>
		<div class="l-text-wrapper m-form-control essential">
@ -115,5 +114,4 @@
</body>
<%@ include file="../head/page_foot.jsp"%>
<%@ include file="device_create_js.jsp" %>
<%--<script src="${ctx}/static/js/device/device_create.js"></script>--%>
</html>

+ 8 - 67
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/device_create_js.jsp

@ -4,16 +4,12 @@
	(function ($, win) {
		$(function () {
			var Util = $.Util;
			var id = $('#inp_id').val();
			var deviceInfo = "";
			var jValidation = $.jValidation;
			var deviceCodeOld = '';
			function pageInit() {
				deviceInfo.init();
				if (id) {
					deviceInfo.initForm();
				}
			}
			deviceInfo = {
@ -38,91 +34,36 @@
					$("#inp_deviceModel").ligerTextBox({width: 240})//设备型号
					$("#inp_deviceCode").ligerTextBox({width: 240})//设备唯一标识
					$("#inp_sim").ligerTextBox({width: 240})//设备sim码
					$("#inp_manufacturer").ligerTextBox({width: 240})//厂家名称
					//$("#inp_manufacturer").ligerTextBox({width: 240})//厂家名称
					$("#inp_address").ligerTextBox({width: 240})//厂家地址
					$("#inp_representative").ligerTextBox({width: 240})//法人代表
					$("#inp_applicantName").ligerTextBox({width: 240})//申请注册人
					$("#inp_applicantIdentity").ligerTextBox({width: 240})//申请人身份证号
					$("#inp_applicantTel").ligerTextBox({width: 240})//申请人手机
					$("#inp_applicantMail").ligerTextBox({width: 240})//申请人邮箱
					$("#sel_manufacturer").ligerComboBox({
						data: [
							{text: '三诺生物传感股份有限公司', id: 'threeNod'},
							{text: '深圳市优瑞恩科技有限公司', id: 'urion'},
							{text: '爱奥乐医疗器械(深圳)有限公司', id: 'bioland'} ,
							{text: '中兴云湃*脉搏波', id: 'yunpai'} ,
							{text: '康为血糖仪', id: 'comvee'}
						]
					});
					this.bindEvents();
				},
                //请求初始化设备厂商
                initComboBox: function () {
                    this.rAjax( this.url.manufacturerList, function (data) {
				    var that = this;
                    this.rAjax( this.url.manufacturerList,{} ,function (data) {
                        var d = [];
                        for (var i = 0; i < data.list.length; i++) {
                        for (var i = 0; i < data.data.length; i++) {
                            d.push({
                                text: data.list[i].manufacturerName,
                                statusId: data.list[i].manufacturerCode
                                text: data.data[i].manufacturerName,
                                id: data.data[i].manufacturerCode
                            });
                        }
                        me.initInpCat( d, me);
                        that.initInpCat( d, that);
                    })
                },
                //设备厂商下拉框
                initInpCat: function ( d, me) {
                    $("#inp_manufacturer").ligerComboBox({
                        width: 150,
                    $("#sel_manufacturer").ligerComboBox({
                        data: d,
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                },
				initForm: function () {
					var _this = this;
					//修改、查看
					$.ajax({
						url: ctx + "/admin/device/device",
						method: "post",
						dataType: "json",
						async: false,
						data: {id: id},
						success: function (result) {
							if (result.status == '200') {
								var data = result.data;
								deviceCodeOld = data.deviceCode;
								_this.$form.Fields.fillValues({
									applyDate: data.applyDate,
									orgName: data.orgName,
									linkman: data.linkman,
									tel: data.tel,
									serverIp: data.serverIp,
									deviceName: data.deviceName,
									sim: data.sim,
									deviceModel: data.deviceModel,
									address: data.address,
									representative: data.representative,
									applicantName: data.applicantName,
									applicantIdentity: data.applicantIdentity,
									applicantTel: data.applicantTel,
									applicantMail: data.applicantMail
								});
								//填值
								$("#sel_manufacturer").ligerComboBox("selectValue",data.manufacturerCode);
							} else {
								$.Notice.error(result.msg);
							}
						},
						error: function (data) {
							$.Notice.error("系统异常,请联系管理员!");
						}
					});
					this.$form.show();
				},
				//绑定事件
				bindEvents: function () {

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/device_list_js.jsp

@ -190,7 +190,7 @@
						self.deviceInfoDialog = $.ligerDialog.open({
							height: 770,
							width: 560,
							urlParms: {"id": id},
							// urlParms: {"id": id},
							title: title,
							url: ctx + '/admin/device/createInit'
						})

+ 33 - 19
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/device_modify_js.jsp

@ -18,8 +18,11 @@
			deviceInfo = {
				//变量
				$form: $("#div_patient_info_form"),
                $manufacturer: $("#sel_manufacturer"),
				init: function () {
					this.$form.attrScan();
                    _this = this;
                    this.$form.attrScan();
					$("#inp_applyDate").ligerTextBox({width: 240}) //申请日期
					$("#inp_orgName").ligerTextBox({width: 240})//机构名称
					$("#inp_linkman").ligerTextBox({width: 240})//联系人
@ -29,26 +32,37 @@
					$("#inp_deviceModel").ligerTextBox({width: 240})//设备型号
					$("#inp_deviceCode").ligerTextBox({width: 240})//设备唯一标识
					$("#inp_sim").ligerTextBox({width: 240})//设备sim
					$("#inp_manufacturer").ligerTextBox({width: 240})//厂家名称
					// $("#inp_manufacturer").ligerTextBox({width: 240})//厂家名称
					$("#inp_address").ligerTextBox({width: 240})//厂家地址
					$("#inp_representative").ligerTextBox({width: 240})//法人代表
					$("#inp_applicantName").ligerTextBox({width: 240})//申请注册人
					$("#inp_applicantIdentity").ligerTextBox({width: 240})//申请人身份证号
					$("#inp_applicantTel").ligerTextBox({width: 240})//申请人手机
					$("#inp_applicantMail").ligerTextBox({width: 240})//申请人邮箱
				},
				initForm: function () {
					var _this = this;
					_this.manufacturerBox = $("#sel_manufacturer").ligerComboBox({
						data: [
							{text: '三诺生物传感股份有限公司', id: 'threeNod'},
							{text: '深圳市优瑞恩科技有限公司', id: 'urion'},
							{text: '爱奥乐医疗器械(深圳)有限公司', id: 'bioland'} ,
                            {text: '中兴云湃*脉搏波', id: 'yunpai'} ,
							{text: '康为血糖仪', id: 'comvee'}
						]
					});
                    //厂商下拉框
                    _this.manufacturerBox = _this.$manufacturer.ligerComboBox({
                        url: ctx + "/admin/manufacturer/findAll",
                        parms: {},
                        dataParmName: "data",
                        textField: "manufacturerName",
                        valueField: "manufacturerCode",
                        isMultiSelect: false,
                        ajaxBeforeSend: function (xhr) {
                            if (ajaxHeaderName) {
                                xhr.setRequestHeader(ajaxHeaderName, ajaxHeaderValue);
                            }
                        },
                    });
                    //厂商下拉框刷新
                    _this.reloadManufacturerBox = function () {
                        deviceInfo.manufacturerBox.reload();
                    };
                },
				initForm: function () {
                    _this = this;
					//修改、查看
					$.ajax({
@ -76,11 +90,10 @@
									applicantName: data.applicantName,
									applicantIdentity: data.applicantIdentity,
									applicantTel: data.applicantTel,
									applicantMail: data.applicantMail
									applicantMail: data.applicantMail,
								});
								//填值
								_this.manufacturerBox.selectValue(data.manufacturerCode);
							} else {
								$.Notice.error(result.msg);
							}
@ -144,8 +157,9 @@
					$("#btn_save").click(function () {
						var values = self.$form.Fields.getValues();
						//厂家代码
						values.manufacturerCode = $("#sel_manufacturer").ligerComboBox("getValue");
						//厂家名称
						values.manufacturerCode = self.manufacturerBox.getValue();
                        values.manufacturer = self.manufacturerBox.getText();
						if (!validator.validate()) {
							return;
						}
@ -173,7 +187,7 @@
					$("#btn_cancel").click(function () {
						parent.window.closeDeviceInfoDialog();
					});
				}
				},
			}
			pageInit();
		});