|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2022-07-18 17:52
- * 描 述:疫情
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 220, 400);
- //$('#VaccineType').lrDataItemSelect({ code: 'VaccineType' });
- $('#DepartmentId').lrselect({
- type: 'tree',
- allowSearch: true,
- url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
- param: {}
- });
- $('#DeptNo').lrselect({
- value: "deptno",
- text: "deptname",
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
- select: function (item) {
- if (item) {
- $('#MajorNo').lrselectRefresh({
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
- param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" }
- });
- }
- else {
- $('#MajorNo').lrselectRefresh({
- url: "",
- data: []
- });
- }
- $('#ClassNo').lrselectRefresh({
- url: "",
- data: []
- });
- }
- });
- $('#MajorNo').lrselect({
- value: "majorno",
- text: "majorname",
- select: function (item) {
- if (item) {
- $('#ClassNo').lrselectRefresh({
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
- param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" }
- });
- }
-
- }
- });
- $('#MajorNo').on("click",
- function () {
- var data = $('#DeptNo').lrselectGet();
- if (!data) {
- learun.alert.error('请先选择系');
- }
- });
- $('#ClassNo').on("click",
- function () {
- var data1 = $('#DeptNo').lrselectGet();
- var data2 = $('#MajorNo').lrselectGet();
- if (!data1 || !data2) {
- learun.alert.error('请先选择系和专业');
- }
- });
- $('#ClassNo').lrselect({
- value: "classno",
- text: "classname"
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- //// 新增
- //$('#lr_add').on('click', function () {
- // learun.layerForm({
- // id: 'form',
- // title: '新增',
- // url: top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/Form',
- // width: 600,
- // height: 400,
- // callBack: function (id) {
- // return top[id].acceptClick(refreshGirdData);
- // }
- // });
- //});
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/TeachForm?keyValue=' + keyValue,
- width: 600,
- height: 430,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 一键生成
- $('#lr_create').on('click', function () {
- var userId = learun.clientdata.get(['userinfo']).userId;
- learun.layerConfirm('是否确认一键生成!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/CreateFrom', { userId: userId, Description: 1 }, function () {
- refreshGirdData();
- });
- }
- });
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/GetPageListForTeacher',
- headData: [
- { label: "职工编号", name: "EmpNo", width: 100, align: "left" },
- { label: "姓名", name: "EmpName", width: 150, align: "left" },
- {
- label: "员工状态", name: "IsInActiveStatus", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'JobStatus',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
-
- { label: "身份证", name: "CardId", width: 160, align: "left" },
- {
- label: "部门", name: "DepartmentId", width: 200, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
- key: value,
- keyId: 'id',
- callback: function (_data) {
- callback(_data['name']);
- }
- });
- }
- },
- { label: "电话号码", name: "Mobile", width: 120, align: "left" },
- {
- label: "疫苗类型", name: "VaccineType", width: 100, align: "left",
- //formatterAsync: function (callback, value, row, op, $cell) {
- // learun.clientdata.getAsync('dataItem', {
- // key: value,
- // code: 'VaccineType',
- // callback: function (_data) {
- // callback(_data.text);
- // }
- // });
- //}
- },
- { label: "接种地", name: "VaccineAddress", width: 100, align: "left" },
- {
- label: "第一针时间", name: "FirstNeedle", width: 100, align: "left",
- formatter: function (cellvalue) {
- return learun.formatDate(cellvalue, 'yyyy-MM-dd');
- }
- },
- {
- label: "第二针时间", name: "SecondNeedle", width: 100, align: "left",
- formatter: function (cellvalue) {
- return learun.formatDate(cellvalue, 'yyyy-MM-dd');
- }
- },
- {
- label: "第三针时间", name: "ThirdNeedle", width: 100, align: "left",
- formatter: function (cellvalue) {
- return learun.formatDate(cellvalue, 'yyyy-MM-dd');
- }
- },
- { label: "未接种原因", name: "NotReason", width: 200, align: "left" },
- { label: "备注", name: "Remark", width: 300, align: "left" },
- ],
- mainId: 'Id',
- sidx: 'CreateTime desc',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.StuOrTeach = 1;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|