123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- //智能表单
- var Params = {
- pageNumber: 1,
- pageSize: 999,
- FLID: 0,
- BDXXID: "",
- QDID: "",
- XMID: "",
- BDJLID: "",
- BZ: "0",//用于传状态
- TBSJ_START: "",
- TBSJ_END:""
- };
- var viewModel = function () {
- //初始化
- this.init = function () {
-
- let _getTime = this.getTime(1).split(",");
- Params.TBSJ_START = _getTime[0];
- Params.TBSJ_END = _getTime[1];
- $('#start_date').datebox('setValue', Params.TBSJ_START);
- $('#end_date').datebox('setValue', Params.TBSJ_END);
- this.getChannel();
- $("#TBBD").combobox({
- url: '/SmartForm/BdxxSelectList?FLID=' + 0,
- valueField: "ID",
- textField: "MC",
- onSelect: function (data) {
- Params.BDXXID = data.ID;
- $('#dgProblems').datagrid('reload', Params);
- }
- });
- $("#IncludeSearchContent").checkbox(function () {
- alert("checked");
- });
-
- $("#XM").combobox({
- valueField: "ID",
- textField: "名称",
- onLoadSuccess: function (data) { //加载完成后,设置选中第一项
- var val = $(this).combobox("getData");
- $(this).combobox("select", val[0].ID);
- },
- onSelect: function (data) {
- Params.XMID = data.ID;
- $('#dgProblems').datagrid('reload', Params);
- }
- });
-
- $("#fbtn-ref").click(function () {
- Params.TBSJ_START = $('#start_date').datebox('getValue');
- Params.TBSJ_END = $('#end_date').datebox('getValue');
- Params.XMID = $('#XM').combobox('getValue');
- Params.QDID = $('#QD').combobox('getValue');
- Params.BDXXID = $('#TBBD').combobox('getValue');
- Params.BZ = "";
- Params.BZ += $("#IncludeSearchContent").checkbox('options').checked == true? '0,':'';
- Params.BZ += $("#terminissues").checkbox('options').checked == true ? '1,' : '';
- Params.BZ += $("#ckclose").checkbox('options').checked == true ? '2,' : '';
- if (Params.BZ == "") {//一个不选的情况下,默认只显示
- Params.BZ = "0,1,2";
- }
- $('#dgProblems').datagrid('reload', Params);
- });
- //删除
- $("#fbtn-del").click(function () {
- var row = $('#dgProblems').datagrid('getSelected');
- if (!row) {
- top.ZLPMS.Msg("请选择列");
- return;
- }
- if (row.TBZT == 1||row.TBZT == 2) {
- top.ZLPMS.Msg("当前记录不能被删除!");
- return;
- }
- top.ZLPMS.Confirm('您确定要删除选中的记录吗?', 3, function () {
- var param = {
- ID: row.ID,
- BZ: 4
- };
- $.post("/SmartForm/UpdateRecord", param, function (data) {
- if (data.code == 200) {
- $('#dgProblems').datagrid('reload', Params);
- top.ZLPMS.Msg(data.msg);
- } else {
- top.ZLPMS.Msg(data.msg);
- }
- })
- });
- });
- //通过
- $("#fbtn-tg").click(function () {
- var row = $('#dgProblems').datagrid('getSelected');
- if (!row) {
- top.ZLPMS.Msg("请选择列");
- return;
- }
- if (row.TBZT == 1) {
- top.ZLPMS.Msg("当前记录已被通过!");
- return;
- }
- if (row.SHBHFJ == 1)//需要上传附件
- {
- top.ZLPMS.OpenNewWindow("审核", "/SmartForm/UploadFileInfo?id=" + row.ID + "&BDXXID=" + row.BDXXID + "&XM=" + row.XMMC, '388px', '340px', function () {
- $('#dgProblems').datagrid('reload', Params);
- });
- }
- else {
- var param = {
- ID: row.ID,
- TBZT: 1,
- BZ: 2
- };
- $.post("/SmartForm/UpdateRecord", param, function (data) {
- if (data.code == 200) {
- $('#dgProblems').datagrid('reload', Params);
- top.ZLPMS.Msg(data.msg);
- } else {
- top.ZLPMS.Msg(data.msg);
- }
- })
- }
-
- });
- //退回
- $("#fbtn-th").click(function () {
- var row = $('#dgProblems').datagrid('getSelected');
- if (!row) {
- top.ZLPMS.Msg("请选择列");
- return;
- }
- if (row.TBZT == 2) {
- top.ZLPMS.Msg("当前记录已被退回!");
- return;
- }
- var param = {
- ID: row.ID,
- TBZT: 2,
- BZ: 2
- };
- $.post("/SmartForm/UpdateRecord", param, function (data) {
- if (data.code == 200) {
- $('#dgProblems').datagrid('reload', Params);
- top.ZLPMS.Msg(data.msg);
- } else {
- top.ZLPMS.Msg(data.msg);
- }
- })
- });
- },
- this.getTime = function getRecentMonth_Date(n) {
- let result = '';
- const datenow = new Date();
- const dateend =
- datenow.getFullYear().toString() +
- '-' +
- (datenow.getMonth() + 1).toString() +
- '-' +
- datenow.getDate().toString();
- datenow.setMonth(datenow.getMonth() - n);
- let dyear = datenow.getFullYear();
- let dmonth = datenow.getMonth() + 1;
- dmonth = dmonth < 10 ? 0 + dmonth : dmonth;
- let dday = datenow.getDate();
- const datestart =
- dyear.toString() + '-' + dmonth.toString() + '-' + dday.toString();
- result += datestart + ',';
- result += dateend;
- console.log(datestart);
- return result;
- },
- //初始化datagrid
- this.initdatagrid = function () {
- var fill = new Vue({
- el: "#fill",
- data: {
- jsonData: {},
- editData: {},
- isshow: false,
- },
- methods: {
- setFillJson(setFillJson, editJsonData) {
- this.jsonData = setFillJson;
- this.editData = editJsonData;
- this.isshow = false
- this.$nextTick(() => {
- this.isshow = true
- })
- },
- },
- computed: {
- }, mounted() {
- }, created() {
- //json = { "list": [{ "type": "number", "icon": "icon-number", "options": { "width": "", "required": false, "requiredMessage": "", "validatorCheck": false, "validator": "", "defaultValue": 0, "min": 0, "max": 9, "step": 1, "disabled": false, "controls": true, "controlsPosition": "", "customClass": "", "labelWidth": 100, "isLabelWidth": false, "hidden": false, "dataBind": true, "precision": 0, "remoteFunc": "func_9c2xzpdm", "remoteOption": "option_9c2xzpdm", "tableColumn": false, "subform": false }, "events": { "onChange": "", "onFocus": "", "onBlur": "" }, "name": "计数器", "key": "9c2xzpdm", "model": "number_9c2xzpdm", "rules": [] }, { "type": "checkbox", "icon": "icon-check-box", "options": { "inline": false, "defaultValue": [], "showLabel": false, "options": [{ "value": "Option 1" }, { "value": "Option 2" }, { "value": "Option 3" }], "required": false, "requiredMessage": "", "validatorCheck": false, "validator": "", "width": "", "remote": false, "remoteType": "datasource", "remoteOption": "option_8p3ftzrv", "remoteOptions": [], "props": { "value": "value", "label": "label" }, "remoteFunc": "func_8p3ftzrv", "customClass": "", "labelWidth": 100, "isLabelWidth": false, "hidden": false, "dataBind": true, "disabled": false, "tableColumn": false, "subform": false }, "events": { "onChange": "" }, "name": "多选框组", "key": "8p3ftzrv", "model": "checkbox_8p3ftzrv", "rules": [] }], "config": { "labelWidth": 100, "labelPosition": "right", "size": "default", "customClass": "", "ui": "element", "layout": "horizontal", "width": "100%", "hideLabel": false, "hideErrorMessage": false, "eventScript": [{ "key": "mounted", "name": "mounted", "func": "" }, { "key": "refresh", "name": "refresh", "func": "" }] } };
- //this.setFillJson(json);
- }
- });
- var reply = new Vue({
- el: "#reply",
- data: {
- jsonData: {},
- editData: {},
- isreplyshow: false,
- },
- methods: {
- setReplyJson(setReplyJson, editJsonData) {
- this.jsonData = setReplyJson;
- this.editData = editJsonData;
- this.isreplyshow = false
- this.$nextTick(() => {
- this.isreplyshow = true
- })
- },
- getReplyData() {
- this.$refs.fillitem.getData().then(data => {
- var param = {
- ID: Params.BDJLID,
- BDCLJG: escape(JSON.stringify(data)),
- BZ: 1
- };
- $.post("/SmartForm/UpdateRecord", param, function (data) {
- if (data.code == 200) {
- $('#dgProblems').datagrid('reload', Params);
- top.ZLPMS.Msg(data.msg);
- } else {
- top.ZLPMS.Msg(data.msg);
- }
- })
- })
- },
- },
- computed: {
- }, created() {
- //json = { "list": [{ "type": "number", "icon": "icon-number", "options": { "width": "", "required": false, "requiredMessage": "", "validatorCheck": false, "validator": "", "defaultValue": 0, "min": 0, "max": 9, "step": 1, "disabled": false, "controls": true, "controlsPosition": "", "customClass": "", "labelWidth": 100, "isLabelWidth": false, "hidden": false, "dataBind": true, "precision": 0, "remoteFunc": "func_9c2xzpdm", "remoteOption": "option_9c2xzpdm", "tableColumn": false, "subform": false }, "events": { "onChange": "", "onFocus": "", "onBlur": "" }, "name": "计数器", "key": "9c2xzpdm", "model": "number_9c2xzpdm", "rules": [] }, { "type": "checkbox", "icon": "icon-check-box", "options": { "inline": false, "defaultValue": [], "showLabel": false, "options": [{ "value": "Option 1" }, { "value": "Option 2" }, { "value": "Option 3" }], "required": false, "requiredMessage": "", "validatorCheck": false, "validator": "", "width": "", "remote": false, "remoteType": "datasource", "remoteOption": "option_8p3ftzrv", "remoteOptions": [], "props": { "value": "value", "label": "label" }, "remoteFunc": "func_8p3ftzrv", "customClass": "", "labelWidth": 100, "isLabelWidth": false, "hidden": false, "dataBind": true, "disabled": false, "tableColumn": false, "subform": false }, "events": { "onChange": "" }, "name": "多选框组", "key": "8p3ftzrv", "model": "checkbox_8p3ftzrv", "rules": [] }], "config": { "labelWidth": 100, "labelPosition": "right", "size": "default", "customClass": "", "ui": "element", "layout": "horizontal", "width": "100%", "hideLabel": false, "hideErrorMessage": false, "eventScript": [{ "key": "mounted", "name": "mounted", "func": "" }, { "key": "refresh", "name": "refresh", "func": "" }] } };
- //this.setFillJson(json);
- }
- });
- $("#dgProblems").datagrid({
- fit: true,
- width: '100%',
- toolbar: '#toolbar',
- pageSize: 20,
- pageList: [10, 20, 30, 40, 50, 1000],
- rownumbers: true,
- pagination: true,
- border: true,
- singleSelect: true, //单行选择
- queryParams: Params,
- loadMsg: "正在查询数据,请稍候...",
- url: '/SmartForm/SelectRecordList',
- method: "post",
- columns: [[
- { field: 'ID', title: 'ID', width: 20, align: 'center', fixed: true, hidden: true },
- { field: 'FLID', title: '分类id', width: 20, align: 'center', fixed: true, hidden: true },
- { field: 'QDMC', title: '渠道名称', align: 'left', fixed: true, width: 150 },
- { field: 'XMMC', title: '项目名称', align: 'left', fixed: true, width: 200 },
- {
- field: 'BDM', title: '填写表单', align: 'left', fixed: true, width: 80,
- },
- {
- field: 'TBR', title: '填报人', align: 'left', fixed: true, width: 80,
- },
- {
- field: 'TBSJ', title: '填报时间', width: 140, align: 'center', fixed: true,
- },
- {
- field: 'TBZT', title: '状态', align: 'left', fixed: true, width: 80,
- formatter: function (value, rowData, index) {
- if (rowData.TBZT == 0) {
- return "填报";
- }
- else if (rowData.TBZT == 1) {
- return "通过";
- }
- else {
- return "退回";
- }
- }, styler: function (value, rowData, index) {
- if (rowData.TBZT == 0) {
- return "color:#007aff";
- }
- else if (rowData.TBZT == 1) {
- return "color:#4cd964";
- }
- else {
- return "color: red";
- }
-
- },
- },
- {
- field: 'SHR', title: '审核人', align: 'left', fixed: true, width: 80,
- },
- {
- field: 'SHSJ', title: '审核时间', width: 140, align: 'center', fixed: true,
- },
- ]],
- rowStyler: function (index, row) {
- },
- onClickRow: function (rowIndex, rowData) {
- fill.setFillJson(JSON.parse(rowData.BDNR == "" ? "{}" : rowData.BDNR), JSON.parse(rowData.BDJG == "" ? "{}" : rowData.BDJG));
- reply.setReplyJson(JSON.parse(rowData.BDCLNR == "" ? "{}" : rowData.BDCLNR), JSON.parse(rowData.BDCLJG == "" ? "{}" : rowData.BDCLJG));
- Params.BDJLID = rowData.ID;
- }
- });
- //保存问题处理信息
- $("#save").click(function(){
- reply.getReplyData();
- });
- },
- this.getChannel = function () {
- $.ajax({
- url: '/Channel/SearchModuleInfos?search=&page=1&rows=200',
- method: 'post',
- success: function (data) {
- $("#QD").combobox({
- valueField: 'ID',
- textField: '名称',
- data: data.rows,
- onSelect: function (e) {
- $('#XM').combobox('clear');
- $('#XM').combobox('reload', '/ProManager/BingProData?ChannelID=' + e.ID + '&Search='); // reload list data using new URL
- Params.QDID = e.ID;
- },
- });
- }
- })
- },
- this.refresh = function () {
- $('#dgProblems').datagrid('reload', Params);
- },
- //加载问题处理过程
- this.DealProcess=function (ID) {
- var url = "/Problem/GetClc?ID=" + ID;
- $.post(url, {}, function (data) {
- $("#timeLine").empty();
- $.each(data, function (idx, json) {
- if (json != undefined) {
- var attfile = "";
- if (json.附件 != undefined) {
- attfile = "<i class='fa fa-paperclip' style='color:blue' title='包含过程附件'></i>";
- }
- json.描述 = json.描述 != undefined ? json.描述 : "无";
- if (json.描述 != "无") {
- var arrEntities = {
- 'lt': '<',
- 'gt': '>',
- 'nbsp': ' ',
- 'amp': '&',
- 'quot': '"'
- };
- json.描述 = json.描述.replace(/<[^>]+>/g, "").replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) {
- return arrEntities[t]
- });
- if (json.描述.length == 0) {
- json.描述 = "内有图片,点击该过程即可查看";
- }
- }
- if (json.描述.length > 25) {
- json.描述 = json.描述.substring(0, 25) + "...";
- }
- var html = "<li onclick='viewProcess(\"" + json.ID + "\")' class='layui-timeline-item timelineDetail'><i class='layui-icon layui-timeline-axis'></i><div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'><a href='#' >" + json.处理状态 + "</a> " + attfile + "</h3><p>" + json.处理人员 + "(" + json.职务 + ")<br>" + json.记录时间 + (json.耗时 != undefined ? "(" + json.耗时 + ")小时" : "") + "<br>" + "描述:" + (json.描述) + "</p></div></li>";
- $("#timeLine").append(html);
- }
- });
- });
- }
-
-
-
- }
|