|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2020-02-03 14:37
- * 描 述:疫情记录
- */
- var acceptClick;
- var keyValue = request('keyValue');
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- $('.lr-form-wrap').lrscroll();
- page.bind();
- page.initData();
- },
- bind: function () {
- $('#Department').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' });
- $('#UnitName').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
- $('#Type').lrDataItemSelect({ code: 'EUserType' });
- $('#RelationShip').lrDataItemSelect({ code: 'ERelationship' });
- $('#OutReason').lrDataItemSelect({ code: 'OutReason' });
- $('#Gender').lrDataItemSelect({ code: 'usersex' });
-
- $('#Provice').lrDataSourceSelect({
- code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
- select: function (item) {
- if (!!item) {
- $('#OutArea').lrselectRefresh({
- url: "/DIC_CITY/GetListByProvinceCode",
- param: { ProvinceCode: item.pcode },
- value: 'CCODE',
- text: 'CNAME'
- });
- $('#City').lrselectRefresh({
- url: "",
- data: []
- });
- }
- }
- });
- $('#OutArea').lrselect({
- select: function (item) {
- if (!!item) {
- $('#City').lrselectRefresh({
- url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode",
- param: { cityCode: item.CCODE },
- value: 'ACODE',
- text: 'ANAME'
- });
- }
- }
- });
- $('#City').lrselect();
- $('#Vehicle').lrDataItemSelect({ code: 'Vehicle' });
- $('#ContactsDetails').jfGrid({
- headData: [
- {
- label: '名字', name: 'Name', width: 100, align: 'left',
- edit: { type: 'input' }
- },
- {
- label: '性别', name: 'Gender', width: 100, align: 'left'
- , edit: {
- type: 'select',
- init: function (row, $edit) {
- console.log(row);
- console.log($edit);
-
- },
- datatype: 'dataItem',
- code: 'usersex'
- }
- },
- // {
- // label: '区域', name: 'Area', width: 100, align: 'left'
- // , edit: {
- // type: 'select',
- // init: function (row, $edit) {
- // var province = '110000';
- // learun.httpAsync('GET', '/DIC_CITY/GetListByProvinceCode', { ProvinceCode: province }, function (data) {
-
- // var res = [];
- // $.each(data, function (_index, _item) {
- // res.push({ value: _item.CCODE, text: _item.CNAME });
- // });
-
- // $edit.lrselectRefresh({
- // data: res,
-
- // });
-
-
-
- // });
-
-
- // },
- // datatype: 'dataItem',
- // code: 'usersex'
- // }
- //},
-
- {
- label: '联系方式', name: 'Mobile', width: 100, align: 'left', edit: { type: 'input' }
- },
- {
- label: '身份证号', name: 'IDCard', width: 100, align: 'left', edit: { type: 'input' }
- },
- {
- label: '隔离方式', name: 'QTType', width: 100, align: 'left'
- , edit: {
- type: 'select',
- init: function (data, $edit) {
-
- },
- datatype: 'dataItem',
- code: 'QuarantineType'
- }
- },
- {
- label: '隔离地点', name: 'QTAddress', width: 100, align: 'left', edit: { type: 'input' }
- },
- {
- label: '隔离时间', name: 'QTTime', width: 100, align: 'left'
- , edit: {
- type: 'datatime',
- dateformat: '1'
- }
- },
- {
- label: '接触隔离时间', name: 'QTContactTime', width: 100, align: 'left'
- , edit: {
- type: 'datatime',
- dateformat: '1'
- }
- },
- {
- label: '是否发热', name: 'Fever', width: 100, align: 'left'
- , edit: {
- type: 'select',
- init: function (data, $edit) {
-
- },
- datatype: 'dataItem',
- code: 'YesOrNoInt'
- }
- },
- ],
-
- isMultiselect: true,
- isEdit: true,
- height: 200
- });
-
-
- //添加当前登录人员
- if ($("#Creater").val() == '') {
- var loginInfo = top.learun.clientdata.get(['userinfo']);
- console.log(loginInfo);
- $("#Creater").val(loginInfo.realName);
- var time = new Date();
- var _dateFmt = $("#CreateTime").attr('data-dateFmt') || 'yyyy-MM-dd';
- $("#CreateTime").val(learun.formatDate(time.toLocaleDateString(), _dateFmt));
- $('#Department').lrselectSet(loginInfo.departmentId);
- $('#UnitName').lrselectSet(loginInfo.companyId);
- }
-
- },
- initData: function () {
-
-
- if (!!keyValue) {
- $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/EpidemicSituation/GetFormData?keyValue=' + keyValue, function (data) {
- for (var id in data) {
- if (!!data[id].length && data[id].length > 0) {
- $('#' + id).jfGridSet('refreshdata', data[id]);
- }
- else {
- $('[data-table="' + id + '"]').lrSetFormData(data[id]);
- }
- }
- });
- }
- }
- };
- // 保存数据
- acceptClick = function (callBack) {
- if (!$('body').lrValidform()) {
- return false;
- }
- var postData = {};
- postData.strEntity = JSON.stringify($('[data-table="EpidemicSituation"]').lrGetFormData());
- postData.strcontactsDetailsList = JSON.stringify($('#ContactsDetails').jfGridGet('rowdatas'));
- $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/EpidemicSituation/SaveForm?keyValue=' + keyValue, postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- };
- page.init();
- }
|