|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616 |
- /* * 版 本 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 () {
- $('#Creater').lrDataSourceSelect({ code: 'BaseUser', value: 'f_userid', text: 'f_realname' });
- $('#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' });
- $('#HealthSituation').lrDataItemSelect({ code: 'EpiHealth' });
- $('#IsOut').lrDataItemSelect({
- code: 'YesOrNoInt',
- select: function (item) {
- if (item) {
- console.log(item);
- if (item.text == "是") {
- $("#PassPlaces").parent().show();
- } else {
- $("#PassPlaces").parent().hide();
- }
- } else {
- $("#PassPlaces").parent().hide();
- }
- }
- });
- $('#HasFamily').lrDataItemSelect({
- code: 'YesOrNoInt',
- select: function (item) {
- if (item) {
- console.log(item);
- if (item.text == "是") {
- $("#ContactsDetails").parent().show();
- } else {
- $("#ContactsDetails").parent().hide();
- }
- } else {
- $("#ContactsDetails").parent().hide();
- }
- }
- });
- $('#HasPeople').lrDataItemSelect({
- code: 'YesOrNoInt',
- select: function (item) {
- if (item) {
- console.log(item);
- if (item.text == "是") {
- $("#PeopleDetails").parent().show();
- } else {
- $("#PeopleDetails").parent().hide();
- }
- } else {
- $("#PeopleDetails").parent().hide();
- }
- }
- });
- $('#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' });
- $('#PassPlaces').jfGrid({
- headData: [
-
- {
- label: '类别', name: 'PassType', width: 100, align: 'left'
- , edit: {
- type: 'select',
- init: function (row, $edit) {
- },
- datatype: 'dataItem',
- code: 'EpiPassType'
- }
- },
- {
- label: '省', name: 'Province', width: 100, align: 'left'
- , edit: {
- type: 'select',
- init: function (row, $edit) {
- },
- datatype: 'dataSource',
- code: 'DIC_PROVINCE',
- op: {
- value: 'pcode',
- text: 'pname',
- title: 'pname'
- }
- }
- }, {
- label: '市', name: 'City', width: 100, align: 'left',
- formatter: function (value, row, op, $cell) {
- var province = row.Province;
- var res;
- learun.httpSync('GET', '/DIC_CITY/GetListByProvinceCode', { ProvinceCode: province }, function (data) {
- $.each(data, function (_index, _item) {
- if (value == _item.CCODE) {
-
- res = _item.CNAME;
- }
- });
- });
- return res;
- },
- edit: {
- type: 'select',
- init: function (row, $self) {
- var province = row.Province;
- learun.httpAsync('GET', '/DIC_CITY/GetListByProvinceCode', { ProvinceCode: province }, function (data) {
- var res = [];
- $.each(data, function (_index, _item) {
- res.push(_item);
- });
- $self.lrselectRefresh({
- data: res,
- });
- });
- },
- op: {
- value: 'CCODE',
- text: 'CNAME',
- title: 'CNAME',
-
- }
- }
- },
- {
- label: '区域', name: 'Area', width: 100, align: 'left',
- formatter: function (value, row, op, $cell) {
- var cityCode = row.City;
- var res;
- learun.httpSync('GET', top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", { cityCode: cityCode }, function (data) {
- $.each(data, function (_index, _item) {
- if (value == _item.ACODE) {
-
- res = _item.ANAME;
- }
- });
- });
- return res;
- },
- edit: {
- type: 'select',
- init: function (row, $edit) {
- var cityCode = row.City;
- learun.httpAsync('GET', top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", { cityCode: cityCode }, function (data) {
- var res = [];
- $.each(data, function (_index, _item) {
- res.push(_item);
- });
- $edit.lrselectRefresh({
- data: res,
- });
- });
- },
- op: {
- value: 'ACODE',
- text: 'ANAME',
- title: 'ANAME'
- }
- }
- },
- {
- label: '详细地址', name: 'Address', width: 100, align: 'left'
- , edit: {
- type: 'input',
-
- }
- },
- {
- label: '时间', name: 'Time', width: 100, align: 'left', edit: { type: 'datatime' }
- },
- {
- label: '交通工具', name: 'Vehicle', width: 100, align: 'left', edit: {
- type: 'select',
- init: function (row, $edit) {
- },
- datatype: 'dataItem',
- code: 'Vehicle'
- }
- },
- {
- label: '班次号', name: 'VehicleNo', width: 100, align: 'left'
- , edit: {
- type: 'input',
-
- }
- }],
-
- isMultiselect: true,
- isEdit: true,
- height: 200
- });
-
- $('#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) {
- },
- datatype: 'dataItem',
- code: 'usersex'
- }
- },
- {
- label: '联系方式', name: 'Mobile', 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: 'Province', width: 100, align: 'left'
- , edit: {
- type: 'select',
- init: function (row, $edit) {
- },
- datatype: 'dataSource',
- code: 'DIC_PROVINCE',
- op: {
- value: 'pcode',
- text: 'pname',
- title: 'pname'
- }
- }
- }, {
- label: '市', name: 'City', width: 100, align: 'left',
- formatter: function (value, row, op, $cell) {
- var province = row.Province;
- var res;
- learun.httpSync('GET', '/DIC_CITY/GetListByProvinceCode', { ProvinceCode: province }, function (data) {
- $.each(data, function (_index, _item) {
- if (value == _item.CCODE) {
-
- res = _item.CNAME;
- }
- });
- });
- return res;
- },
- edit: {
- type: 'select',
- init: function (row, $self) {
- var province = row.Province;
- learun.httpAsync('GET', '/DIC_CITY/GetListByProvinceCode', { ProvinceCode: province }, function (data) {
- var res = [];
- $.each(data, function (_index, _item) {
- res.push(_item);
- });
- $self.lrselectRefresh({
- data: res,
- });
- });
- },
- op: {
- value: 'CCODE',
- text: 'CNAME',
- title: 'CNAME',
-
- }
- }
- },
- {
- label: '区域', name: 'Area', width: 100, align: 'left',
- formatter: function (value, row, op, $cell) {
- var cityCode = row.City;
- var res;
- learun.httpSync('GET', top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", { cityCode: cityCode }, function (data) {
- $.each(data, function (_index, _item) {
- if (value == _item.ACODE) {
-
- res = _item.ANAME;
- }
- });
- });
- return res;
- },
- edit: {
- type: 'select',
- init: function (row, $edit) {
- var cityCode = row.City;
- learun.httpAsync('GET', top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", { cityCode: cityCode }, function (data) {
- var res = [];
- $.each(data, function (_index, _item) {
- res.push(_item);
- });
- $edit.lrselectRefresh({
- data: res,
- });
- });
- },
- op: {
- value: 'ACODE',
- text: 'ANAME',
- title: 'ANAME'
- }
- }
- },
- {
- 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: 'EpiHealth'
- }
- },
- ],
-
- isMultiselect: true,
- isEdit: true,
- height: 200
- });
-
-
- $('#PeopleDetails').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) {
- },
- datatype: 'dataItem',
- code: 'usersex'
- }
- },
- {
- label: '联系方式', name: 'Mobile', 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: 'Province', width: 100, align: 'left'
- , edit: {
- type: 'select',
- init: function (row, $edit) {
- },
- datatype: 'dataSource',
- code: 'DIC_PROVINCE',
- op: {
- value: 'pcode',
- text: 'pname',
- title: 'pname'
- }
- }
- }, {
- label: '市', name: 'City', width: 100, align: 'left',
- formatter: function (value, row, op, $cell) {
- var province = row.Province;
- var res;
- learun.httpSync('GET', '/DIC_CITY/GetListByProvinceCode', { ProvinceCode: province }, function (data) {
- $.each(data, function (_index, _item) {
- if (value == _item.CCODE) {
-
- res = _item.CNAME;
- }
- });
- });
- return res;
- },
- edit: {
- type: 'select',
- init: function (row, $self) {
- var province = row.Province;
- learun.httpAsync('GET', '/DIC_CITY/GetListByProvinceCode', { ProvinceCode: province }, function (data) {
- var res = [];
- $.each(data, function (_index, _item) {
- res.push(_item);
- });
- $self.lrselectRefresh({
- data: res,
- });
- });
- },
- op: {
- value: 'CCODE',
- text: 'CNAME',
- title: 'CNAME',
-
- }
- }
- },
- {
- label: '区域', name: 'Area', width: 100, align: 'left',
- formatter: function (value, row, op, $cell) {
- var cityCode = row.City;
- var res;
- learun.httpSync('GET', top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", { cityCode: cityCode }, function (data) {
- $.each(data, function (_index, _item) {
- if (value == _item.ACODE) {
-
- res = _item.ANAME;
- }
- });
- });
- return res;
- },
- edit: {
- type: 'select',
- init: function (row, $edit) {
- var cityCode = row.City;
- learun.httpAsync('GET', top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", { cityCode: cityCode }, function (data) {
- var res = [];
- $.each(data, function (_index, _item) {
- res.push(_item);
- });
- $edit.lrselectRefresh({
- data: res,
- });
- });
- },
- op: {
- value: 'ACODE',
- text: 'ANAME',
- title: 'ANAME'
- }
- }
- },
- {
- 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: 'EpiHealth'
- }
- },
- ],
-
- isMultiselect: true,
- isEdit: true,
- height: 200
- });
-
- var loginInfo = top.learun.clientdata.get(['userinfo']);
- //添加当前登录人员
- if (!keyValue) {
- $("#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);
- $('#Gender').lrselectSet(loginInfo.gender);
- $('#Mobile').lrselectSet(loginInfo.mobile);
- $('#Creater').lrselectSet(loginInfo.userId);
- $('#Objective').val(returnCitySN.cname);
-
- //loginInfo.userId
- if (loginInfo.Description == "学生") {
- $("#Type").lrselectSet(5);
-
- learun.httpSync('GET', top.$.rootUrl + "/PersonnelManagement/EpidemicSituationCopy/GetStudentSource", { studentId: loginInfo.account }, function (data) {
- console.log(data);
- $('#StudentSource').val(data.res);
- $('#HomeAddress').val(data.Address);
- });
-
- } else {
- learun.httpSync('GET', top.$.rootUrl + "/PersonnelManagement/EpidemicSituationCopy/GetEmpSource", { empId: loginInfo.userId }, function (data) {
- $('#HomeAddress').val(data.Address);
- });
- }
- }
- if (loginInfo.Description == "学生") {
- $('#Department').parent().hide();
- $('#StudentSource').parent().show();
- } else {
- $('#Department').parent().show();
- $('#StudentSource').parent().hide();
-
- }
-
- },
- initData: function () {
-
-
- if (!!keyValue) {
- $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/EpidemicSituationCopy/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'));
- postData.passPlaceDetailsList = JSON.stringify($('#PassPlaces').jfGridGet('rowdatas'));
- postData.strpeopleDetailsList = JSON.stringify($('#PeopleDetails').jfGridGet('rowdatas'));
-
- $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/EpidemicSituationCopy/SaveForm?keyValue=' + keyValue, postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- };
- page.init();
- }
|