1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012 |
- let s4 = new SM4Util();
- let detailVue = new Vue({
- el: "#detailBox",
- data: {
- apiurl: apiurl,//基础的页面请求地址
- userId: "", //用户id
- userName: "", //用户中文名
- token: "",
- nowTab: "tab1",
- routeid: "",
- routeinfoid: "",
- directionid: "",
- formeditid: "",
- docmode: "",
- dotype: "",
- type: "",
- routerList: [],
- fileList: [],
- isEnd: false,
- startX: 0,
- endX: 0,
- deleteSlider: '',//滑动时的效果
- JJCD: [],
- XXGKSH: [],
- GWZL: [],
- SFXYJD: [],
- ZDGKLM: [],
- ZDGKZT: [],
- BGSFHYJ:[],
- readonly: {
- JJCD: false,
- WLDQFL: false,
- WLDSSL: false,
- XXGKSH: false,
- SFXYJD: false,
- ZDGKLM: false,
- ZDGKZT: false,
- FLSH: false,
- GPJZSC: false,
- BGSFHYJ: false,
- SX: false,
- BMFZRYJ: false,
- NGR: false,
- NGSJ: false,
- HBCSYJ: false,
- GWZL: false,
- YF: false,
- BT: false,
- ZS: false,
- CS: false
- },
- form: {
- ID: "", //多一个id
- JJCD: "",
- JJCD_NAME: "",
- XXGKSH: "",
- XXGKSH_NAME: "",
- SFXYJD: "",
- SFXYJD_NAME: "",
- ZDGKLM: "",
- ZDGKLM_NAME: "",
- ZDGKZT: "",
- ZDGKZT_NAME: "",
- NGR: "",
- NGSJ: "",
- GWZL: "",
- GWZL_NAME: "",
- YF: "",
- BT: "",
- ZS: "",
- CS: "",
- BGSFHYJ:"",
- BGSFHYJ_NAME:"",
- },
- WLDQFL: [],
- WLDSSL: [],
- FLSH: [],
- GPJZSC: [],
- SX: [],
- BMFZRYJ: [],
- HBCSYJ: [],
- WLDQFLEDIT: true,
- WLDSSLEDIT: true,
- FLSHEDIT: true,
- GPJZSCEDIT: true,
- SXEDIT: true,
- BMFZRYJEDIT: true,
- HBCSYJEDIT: true,
- optionType: "",
- optionContent: "",
- showSave: false,
- buttonList: [],
- departList:[],
- fileData1: [],
- fileData2: [],
- fileData3: []
- },
- methods: {
- dateFtt: (fmt, date) => {
- var o = {
- "M+": date.getMonth() + 1, //月份
- "d+": date.getDate(), //日
- "h+": date.getHours(), //小时
- "m+": date.getMinutes(), //分
- "s+": date.getSeconds(), //秒
- "q+": Math.floor((date.getMonth() + 3) / 3), //季度
- "S": date.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt))
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt))
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- return fmt;
- },
- changeTab: (tabCode) => {
- _this.nowTab = tabCode;
- if (_this.nowTab == "tab1") {
- } else if (_this.nowTab == "tab2") {
- _this.getFileList();
- } else if (_this.nowTab == "tab3") {
- _this.getRouterList();
- } else if (_this.nowTab == "tab4") {
- _this.getAllFile();
- }
- },
- getRouterList: () => {
- _this.routerList = [];
- let postData = {
- directionid: _this.directionid,
- userid: _this.userId,
- routeid: _this.routeid,
- routeinfoid: _this.routeinfoid,
- }
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/queryDataRouteList",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- response.data.forEach(function (item) {
- item.mainUser = [];
- item.copyUsers = [];
- item.isNow = false;
- item.USERS.forEach(function (item2) {
- if (item2.KIND == 0) {
- item.mainUser.push(item2.USERNAME);
- } else {
- item.copyUsers.push(item2.USERNAME);
- }
- })
- item.NAME = "【" + item.STARTNODENAME + "】转" + "【" + item.ENDNODENAME + "】"
- item.mainUser = item.mainUser.join(",");
- item.copyUsers = item.copyUsers.join(",");
- })
- _this.routerList = response.data;
- if (_this.routerList[_this.routerList.length - 1].ENDNODENAME == '结束') {
- _this.isEnd = true;
- _this.routerList[_this.routerList.length - 1].isNow = false;
- } else {
- _this.routerList[_this.routerList.length - 1].isNow = true;
- _this.isEnd = false;
- }
- })
- },
- getFileList: () => {
- _this.fileList = [];
- let postData = {
- tablename: "FILE_ATTACH",
- colums: "*",
- order: "ID desc",
- sqlwhere: {ROUTEINFOID: _this.routeinfoid},
- sqlinwhere: "",
- sqllikewhere: ""
- }
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/dataabase/queryDataByCol",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- response.data.forEach(function (item) {
- item.deleteSlider = "transform:translateX(0px)";
- })
- _this.fileList = response.data;
- })
- },
- touchStart(e) {
- _this.startX = e.touches[0].clientX;
- },
- touchEnd(e) {
- let index = e.currentTarget.dataset.index;
- // 当前滑动的父级元素
- _this.endX = e.changedTouches[0].clientX;
- // 左滑
- if (_this.startX - _this.endX > 30) {
- _this.fileList.forEach(function (item) {
- item.deleteSlider = "transform:translateX(0px)";
- })
- _this.fileList[index].deleteSlider = "transform:translateX(-120px)";
- }
- // 右滑
- if (_this.startX - _this.endX < -30) {
- _this.fileList.forEach(function (item) {
- item.deleteSlider = "transform:translateX(0px)";
- })
- }
- _this.startX = 0;
- _this.endX = 0;
- },
- downLoad: (item) => {
- window.open(_this.apiurl + "g2work/files/" + item.FILEURL.slice(7));
- },
- deleteFile: (item) => {
- if (_this.dotype != 0) {
- _this.$nextTick(() => {
- $.confirm("您确定要删除当前附件吗?", "确认删除?", function () {
- let postData = {
- tablename: "FILE_ATTACH",
- id: item.ID
- };
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/dataabase/delDataById",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- if (response.success) {
- _this.getFileList();
- } else {
- $.alert("删除失败,请联系管理员!", "温馨提示");
- }
- })
- }, function () {
- //取消操作
- });
- })
- } else {
- _this.$nextTick(() => {
- $.alert("当前模式下无法删除附件", "温馨提示");
- })
- }
- },
- sendBtn: () => {
- if (_this.dotype != 0) {
- let formData = {};
- for (let key in _this.form) {
- if (key.indexOf("_NAME") == -1) {
- formData[key] = _this.form[key]
- }
- }
- let arrayData = [];
- arrayData.push(formData)
- let postData = {
- ckey: "FW_ZB",
- id: _this.form.ID,
- routeid: _this.routeid,
- routeinfoid: _this.routeinfoid,
- routeinfotitle: _this.form.BT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.BT,
- directionid: _this.directionid,
- formeditid: _this.formeditid,
- data: JSON.stringify(arrayData)
- };
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/saveData",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- if (response.success) {
- location.href = "sendedit.html?routeid=" + _this.routeid + "&routeinfoid=" + _this.routeinfoid + "&directionid=" + _this.directionid + "&formeditid=" + _this.formeditid + "&docmode=" + _this.docmode + "&dotype=" + _this.dotype + "&type" + _this.type;
- } else {
- $.alert("保存表单失败,无法进行转发,请联系管理员!", "温馨提示");
- }
- })
- } else {
- _this.$nextTick(() => {
- $.alert("当前模式下无法进行转发", "温馨提示");
- })
- }
- },
- getItemCodeTable: (tablename) => {
- let postData = {
- ckey: tablename,
- routeinfoid: _this.routeinfoid
- }
- return $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/queryDataCode",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- })
- },
- getAllCodeTable: () => {
- $http.all([_this.getItemCodeTable('CODE_JJCD'),
- _this.getItemCodeTable('CODE_XXGKSH'),
- _this.getItemCodeTable('CODE_GWTYPE'),
- _this.getItemCodeTable('CODE_SFXYJD'),
- _this.getItemCodeTable('CODE_ZDGKLM'),
- _this.getItemCodeTable('CODE_ZDGKZT'),
- _this.getDepartOption(),
- _this.getItemCodeTable('CODE_BGSFHYJ')]).then($http.spread((first, second, third, forth, fifth, sixth,seventh,eighth) => {
- let response1 = _this.utils.strToJson(s4.decryptData_CBC(first.data.data));
- let response2 = _this.utils.strToJson(s4.decryptData_CBC(second.data.data));
- let response3 = _this.utils.strToJson(s4.decryptData_CBC(third.data.data));
- let response4 = _this.utils.strToJson(s4.decryptData_CBC(forth.data.data));
- let response5 = _this.utils.strToJson(s4.decryptData_CBC(fifth.data.data));
- let response6 = _this.utils.strToJson(s4.decryptData_CBC(sixth.data.data));
- let response7 = _this.utils.strToJson(s4.decryptData_CBC(seventh.data.data));
- let response8 = _this.utils.strToJson(s4.decryptData_CBC(eighth.data.data));
- _this.JJCD = response1.data.CODE_JJCD;
- _this.XXGKSH = response2.data.CODE_XXGKSH;
- _this.GWZL = response3.data.CODE_GWTYPE;
- _this.SFXYJD = response4.data.CODE_SFXYJD;
- _this.ZDGKLM = response5.data.CODE_ZDGKLM;
- _this.ZDGKZT = response6.data.CODE_ZDGKZT;
- _this.departList = response7.data;
- _this.BGSFHYJ = response8.data.CODE_BGSFHYJ;
- _this.getFormDetail();
- _this.getAllOption();
- }))
- },
- getFormDetail: () => {
- let postData = {
- ckey: "FW_ZB",
- id: 0,
- directionid: _this.directionid,
- formeditid: _this.formeditid,
- routeid: _this.routeid,
- routeinfoid: _this.routeinfoid
- }
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/queryData",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- console.log(response);
- //0表单禁用
- if (_this.dotype == '0') {
- _this.readonly = {
- JJCD: true,
- WLDQFL: true,
- WLDSSL: true,
- XXGKSH: true,
- SFXYJD: true,
- ZDGKLM: true,
- ZDGKZT: true,
- FLSH: true,
- GPJZSC: true,
- BGSFHYJ: true,
- SX: true,
- BMFZRYJ: true,
- NGR: true,
- NGSJ: true,
- HBCSYJ: true,
- GWZL: true,
- YF: true,
- BT: true,
- ZS: true,
- CS: true
- }
- } else {
- _this.readonly = {
- JJCD: response.data.FW_ZB["JJCD.EREADONLY"] == "true",
- WLDQFL: response.data.FW_ZB["WLDQFL.EREADONLY"] == "true",
- WLDSSL: response.data.FW_ZB["WLDSSL.EREADONLY"] == "true",
- XXGKSH: response.data.FW_ZB["XXGKSH.EREADONLY"] == "true",
- SFXYJD: response.data.FW_ZB["SFXYJD.EREADONLY"] == "true",
- ZDGKLM: response.data.FW_ZB["ZDGKLM.EREADONLY"] == "true",
- ZDGKZT: response.data.FW_ZB["ZDGKZT.EREADONLY"] == "true",
- FLSH: response.data.FW_ZB["FLSH.EREADONLY"] == "true",
- GPJZSC: response.data.FW_ZB["GPJZSC.EREADONLY"] == "true",
- BGSFHYJ: response.data.FW_ZB["BGSFHYJ.EREADONLY"] == "true",
- SX: response.data.FW_ZB["SX.EREADONLY"] == "true",
- BMFZRYJ: response.data.FW_ZB["BMFZRYJ.EREADONLY"] == "true",
- NGR: response.data.FW_ZB["NGR.EREADONLY"] == "true",
- NGSJ: response.data.FW_ZB["NGSJ.EREADONLY"] == "true",
- HBCSYJ: response.data.FW_ZB["HBCSYJ.EREADONLY"] == "true",
- GWZL: response.data.FW_ZB["GWZL.EREADONLY"] == "true",
- YF: response.data.FW_ZB["YF.EREADONLY"] == "true",
- BT: response.data.FW_ZB["BT.EREADONLY"] == "true",
- ZS: response.data.FW_ZB["ZS.EREADONLY"] == "true",
- CS: response.data.FW_ZB["CS.EREADONLY"] == "true",
- }
- }
- _this.form = {
- ID: response.data.FW_ZB.ID,
- JJCD: response.data.FW_ZB.JJCD == "" ? _this.JJCD[0].CODE : response.data.FW_ZB.JJCD,
- XXGKSH: response.data.FW_ZB.XXGKSH == "" ? _this.XXGKSH[0].CODE : response.data.FW_ZB.XXGKSH,
- SFXYJD: response.data.FW_ZB.SFXYJD == "" ? _this.SFXYJD[0].CODE : response.data.FW_ZB.SFXYJD,
- ZDGKLM: response.data.FW_ZB.ZDGKLM == "" ? _this.ZDGKLM[0].CODE : response.data.FW_ZB.ZDGKLM,
- ZDGKZT: response.data.FW_ZB.ZDGKZT == "" ? _this.ZDGKZT[0].CODE : response.data.FW_ZB.ZDGKZT,
- GWZL: response.data.FW_ZB.GWZL == "" ? _this.GWZL[0].CODE : response.data.FW_ZB.GWZL,
- BGSFHYJ: response.data.FW_ZB.BGSFHYJ == "" ? _this.BGSFHYJ[0].CODE : response.data.FW_ZB.BGSFHYJ,
- NGSJ: (response.data.FW_ZB.NGSJ == "" || response.data.FW_ZB.NGSJ == null || response.data.FW_ZB.NGSJ == undefined) ? _this.utils.datefmt("yyyy-MM-dd", _this.utils.getLocalDate1()) : _this.utils.datefmt("yyyy-MM-dd", response.data.FW_ZB.NGSJ),
- NGR: response.data.FW_ZB.NGR,
- YF: response.data.FW_ZB.YF,
- BT: response.data.FW_ZB.BT,
- ZS: response.data.FW_ZB.ZS,
- CS: response.data.FW_ZB.CS
- }
- if (response.data.FW_ZB.JJCD == "") {
- _this.form.JJCD_NAME = _this.JJCD[0].CNAME;
- } else {
- _this.JJCD.forEach(function (item) {
- if (item.CODE == response.data.FW_ZB.JJCD) {
- _this.form.JJCD_NAME = item.CNAME;
- }
- })
- }
- if (response.data.FW_ZB.XXGKSH == "") {
- _this.form.XXGKSH_NAME = _this.XXGKSH[0].CNAME;
- } else {
- _this.XXGKSH.forEach(function (item) {
- if (item.CODE == response.data.FW_ZB.XXGKSH) {
- _this.form.XXGKSH_NAME = item.CNAME;
- }
- })
- }
- if (response.data.FW_ZB.SFXYJD == "") {
- _this.form.SFXYJD_NAME = _this.SFXYJD[0].CNAME;
- } else {
- _this.SFXYJD.forEach(function (item) {
- if (item.CODE == response.data.FW_ZB.SFXYJD) {
- _this.form.SFXYJD_NAME = item.CNAME;
- }
- })
- }
- if (response.data.FW_ZB.ZDGKLM == "") {
- _this.form.ZDGKLM_NAME = _this.ZDGKLM[0].CNAME;
- } else {
- _this.ZDGKLM.forEach(function (item) {
- if (item.CODE == response.data.FW_ZB.ZDGKLM) {
- _this.form.ZDGKLM_NAME = item.CNAME;
- }
- })
- }
- if (response.data.FW_ZB.ZDGKZT == "") {
- _this.form.ZDGKZT_NAME = _this.ZDGKZT[0].CNAME;
- } else {
- _this.ZDGKZT.forEach(function (item) {
- if (item.CODE == response.data.FW_ZB.ZDGKZT) {
- _this.form.ZDGKZT_NAME = item.CNAME;
- }
- })
- }
- if (response.data.FW_ZB.GWZL == "") {
- _this.form.GWZL_NAME = _this.GWZL[0].CNAME;
- } else {
- _this.GWZL.forEach(function (item) {
- if (item.CODE == response.data.FW_ZB.GWZL) {
- _this.form.GWZL_NAME = item.CNAME;
- }
- })
- }
- if (response.data.FW_ZB.BGSFHYJ == "") {
- _this.form.BGSFHYJ_NAME = _this.BGSFHYJ[0].CNAME;
- } else {
- _this.BGSFHYJ.forEach(function (item) {
- if (item.CODE == response.data.FW_ZB.BGSFHYJ) {
- _this.form.BGSFHYJ_NAME = item.CNAME;
- }
- })
- }
- _this.$nextTick(() => {
- _this.initInputPlug();
- })
- })
- },
- initInputPlug: () => {
- $("#NGSJ").calendar({
- onChange: function (p, values, displayValues) {
- _this.form.NGSJ = values[0];
- }
- });
- let listJJCD = [];
- let listXXGKSH = [];
- let listGWZL = [];
- let listSFXYJD = [];
- let listZDGKLM = [];
- let listZDGKZT = [];
- let listBGSFHYJ = [];
- _this.JJCD.forEach(function (item) {
- listJJCD.push(item.CNAME);
- })
- _this.XXGKSH.forEach(function (item) {
- listXXGKSH.push(item.CNAME);
- })
- _this.GWZL.forEach(function (item) {
- listGWZL.push(item.CNAME);
- })
- _this.SFXYJD.forEach(function (item) {
- listSFXYJD.push(item.CNAME);
- })
- _this.ZDGKLM.forEach(function (item) {
- listZDGKLM.push(item.CNAME);
- })
- _this.ZDGKZT.forEach(function (item) {
- listZDGKZT.push(item.CNAME);
- })
- _this.BGSFHYJ.forEach(function (item) {
- listBGSFHYJ.push(item.CNAME);
- })
- $("#JJCD").picker({
- title: "请选择紧急程度",
- cols: [
- {
- textAlign: 'center',
- values: listJJCD
- }
- ],
- onChange: function (p, v, dv) {
- _this.form.JJCD_NAME = v[0];
- _this.JJCD.forEach(function (item) {
- if (item.CNAME == v[0]) {
- _this.form.JJCD = item.CODE;
- }
- })
- },
- });
- $("#XXGKSH").picker({
- title: "请选择信息公开审核",
- cols: [
- {
- textAlign: 'center',
- values: listXXGKSH
- }
- ],
- onChange: function (p, v, dv) {
- _this.form.XXGKSH_NAME = v[0];
- _this.XXGKSH.forEach(function (item) {
- if (item.CNAME == v[0]) {
- _this.form.XXGKSH = item.CODE;
- }
- })
- },
- });
- $("#GWZL").picker({
- title: "请选择公文种类",
- cols: [
- {
- textAlign: 'center',
- values: listGWZL
- }
- ],
- onChange: function (p, v, dv) {
- _this.form.GWZL_NAME = v[0];
- _this.GWZL.forEach(function (item) {
- if (item.CNAME == v[0]) {
- _this.form.GWZL = item.CODE;
- }
- })
- },
- });
- $("#SFXYJD").picker({
- title: "请选择是否需要解读",
- cols: [
- {
- textAlign: 'center',
- values: listSFXYJD
- }
- ],
- onChange: function (p, v, dv) {
- _this.form.SFXYJD_NAME = v[0];
- _this.SFXYJD.forEach(function (item) {
- if (item.CNAME == v[0]) {
- _this.form.SFXYJD = item.CODE;
- }
- })
- },
- });
- $("#ZDGKLM").picker({
- title: "请选择主动公开栏目",
- cols: [
- {
- textAlign: 'center',
- values: listZDGKLM
- }
- ],
- onChange: function (p, v, dv) {
- _this.form.ZDGKLM_NAME = v[0];
- _this.ZDGKLM.forEach(function (item) {
- if (item.CNAME == v[0]) {
- _this.form.ZDGKLM = item.CODE;
- }
- })
- },
- });
- $("#ZDGKZT").picker({
- title: "请选择主动公开主题",
- cols: [
- {
- textAlign: 'center',
- values: listZDGKZT
- }
- ],
- onChange: function (p, v, dv) {
- _this.form.ZDGKZT_NAME = v[0];
- _this.ZDGKZT.forEach(function (item) {
- if (item.CNAME == v[0]) {
- _this.form.ZDGKZT = item.CODE;
- }
- })
- },
- });
- $("#BGSFHYJ").picker({
- title: "请选择办公室复核意见",
- cols: [
- {
- textAlign: 'center',
- values: listBGSFHYJ
- }
- ],
- onChange: function (p, v, dv) {
- _this.form.BGSFHYJ_NAME = v[0];
- _this.BGSFHYJ.forEach(function (item) {
- if (item.CNAME == v[0]) {
- _this.form.BGSFHYJ = item.CODE;
- }
- })
- },
- });
- let optionDepart=[];
- _this.departList.forEach(function (item) {
- optionDepart.push({
- title: item.DEP,
- value: item.DEPCODE,
- description: item.DEP
- })
- })
- $("#ZS").select({
- title: "请选择主送",
- multi: true,
- items:optionDepart,
- onChange: function(d) {
- },
- onClose: function (d) {
- _this.form.ZS=d.data.titles;
- }
- });
- $("#CS").select({
- title: "请选择抄送",
- multi: true,
- items:optionDepart,
- onChange: function(d) {
- },
- onClose: function (d) {
- _this.form.CS=d.data.titles;
- }
- });
- },
- saveBtn: () => {
- if (_this.dotype != 0) {
- let formData = {};
- for (let key in _this.form) {
- if (key.indexOf("_NAME") == -1) {
- formData[key] = _this.form[key]
- }
- }
- let arrayData = [];
- arrayData.push(formData)
- let postData = {
- ckey: "FW_ZB",
- id: _this.form.ID,
- routeid: _this.routeid,
- routeinfoid: _this.routeinfoid,
- routeinfotitle: _this.form.BT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.BT,
- directionid: _this.directionid,
- formeditid: _this.formeditid,
- data: JSON.stringify(arrayData)
- };
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/saveData",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- if (response.success) {
- $.alert("保存成功!", "温馨提示");
- _this.getFormDetail();
- } else {
- $.alert("保存失败,请联系管理员!", "温馨提示");
- }
- })
- } else {
- _this.$nextTick(() => {
- $.alert("当前模式下无法进行保存", "温馨提示");
- })
- }
- },
- getItemOption: (code) => {
- let postData = {
- cmanid: _this.userId,
- routeinfoid: _this.routeinfoid,
- routeid: _this.routeid,
- tableid: "FW_ZB",
- colid: code
- }
- return $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/queryDataOpinion",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- })
- },
- getAllOption: () => {
- _this.WLDQFL = [];
- _this.WLDSSL = [];
- _this.FLSH = [];
- _this.GPJZSC = [];
- //_this.BGSFHYJ = [];
- _this.SX = [];
- _this.BMFZRYJ = [];
- _this.HBCSYJ = [];
- $http.all([_this.getItemOption('WLDQFL'),
- _this.getItemOption('WLDSSL'),
- _this.getItemOption('FLSH'),
- _this.getItemOption('GPJZSC'),
- _this.getItemOption('BGSFHYJ'),
- _this.getItemOption('SX'),
- _this.getItemOption('BMFZRYJ'),
- _this.getItemOption('HBCSYJ')]).then($http.spread((first, second, third, forth, fifth, sixth, seventh, eighth) => {
- let response1 = _this.utils.strToJson(s4.decryptData_CBC(first.data.data));
- let response2 = _this.utils.strToJson(s4.decryptData_CBC(second.data.data));
- let response3 = _this.utils.strToJson(s4.decryptData_CBC(third.data.data));
- let response4 = _this.utils.strToJson(s4.decryptData_CBC(forth.data.data));
- //let response5 = _this.utils.strToJson(s4.decryptData_CBC(fifth.data.data));
- let response6 = _this.utils.strToJson(s4.decryptData_CBC(sixth.data.data));
- let response7 = _this.utils.strToJson(s4.decryptData_CBC(seventh.data.data));
- let response8 = _this.utils.strToJson(s4.decryptData_CBC(eighth.data.data));
- _this.WLDQFL = response1.data;
- _this.WLDSSL = response2.data;
- _this.FLSH = response3.data;
- _this.GPJZSC = response4.data;
- //_this.BGSFHYJ = response5.data;
- _this.SX = response6.data;
- _this.BMFZRYJ = response7.data;
- _this.HBCSYJ = response8.data;
- _this.dealOption('WLDQFL');
- _this.dealOption('WLDSSL');
- _this.dealOption('FLSH');
- _this.dealOption('GPJZSC');
- //_this.dealOption('BGSFHYJ');
- _this.dealOption('SX');
- _this.dealOption('BMFZRYJ');
- _this.dealOption('HBCSYJ');
- }))
- },
- deleteOption: (code) => {
- $.confirm("您确定要删除当前意见吗?", "确认删除?", function () {
- let postData = {
- cmanid: _this.userId,
- routeid: _this.routeid,
- tableid: "FW_ZB",
- colid: code,
- };
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/deleteDataOpinion",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- if (response.success) {
- _this.getAllOption();
- } else {
- $.alert("删除失败,请联系管理员!", "温馨提示");
- }
- })
- }, function () {
- //取消操作
- });
- },
- editOption: (type, index) => {
- _this.optionType = type;
- let nowEditObj = _this[type][index];
- if (_this.optionType == "") {
- $.alert("初始化失败,请联系管理员!", "温馨提示");
- } else {
- _this.optionContent = nowEditObj.OPINION;
- $(".open-popup").eq(0).click();
- }
- },
- addOption: (type) => {
- _this.optionType = type;
- _this.optionContent = "";
- if (_this.optionType == "") {
- $.alert("初始化失败,请联系管理员!", "温馨提示");
- } else {
- $(".open-popup").eq(0).click();
- }
- },
- saveOption: () => {
- $(".close-popup").eq(0).click();
- let postData = {
- cmanid: _this.userId,
- routeinfoid: _this.routeinfoid,
- routeid: _this.routeid,
- tableid: "FW_ZB",
- colid: _this.optionType,
- opiniontype: 0,
- cresult: "",
- opinion: _this.optionContent,
- opinionimage: ""
- };
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/saveDataOpinion",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- if (response.success) {
- _this.getAllOption();
- } else {
- $.alert("删除失败,请联系管理员!", "温馨提示");
- }
- })
- },
- getBtnList: () => {
- let postData = {
- ckey: "FW_ZB",
- id: 0,
- directionid: _this.directionid,
- formeditid: _this.formeditid,
- routeid: _this.routeid,
- routeinfoid: _this.routeinfoid
- }
- $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/abase/queryData",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- }).then(res => {
- let response = _this.utils.strToJson(s4.decryptData_CBC(res.data.data));
- _this.buttonList = _this.dotype == 0 ? [] : response.data["FW_ZB.FUNCLIST"];
- _this.buttonList.forEach(function (item) {
- if (item.CODE == "SAVEITEM") {
- _this.showSave = true;
- }
- })
- })
- },
- //增补一个函数
- dealOption: (key) => {
- let num = 0;
- let keyEdit = key + "EDIT";
- _this[key].forEach(function (item) {
- if (item.ROUTEID == _this.routeid) {
- num++
- }
- })
- if (num > 0) {
- _this[keyEdit] = true;
- } else {
- _this[keyEdit] = false;
- }
- },
- //拿回主动抄送的部门选项,和加载滚动选项一起执行
- getDepartOption: () => {
- return $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/dataabase/getDpList",
- data: {data: s4.encryptData_CBC(JSON.stringify(""))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- })
- },
- //获取单个文稿列表
- getItemFile: (code) => {
- let postData = {
- dockind: code,
- routeinfoid: _this.routeinfoid
- }
- return $http({
- method: 'post',
- baseURL: _this.apiurl,
- url: "g2app/fawenfiles/queryDataList",
- data: {data: s4.encryptData_CBC(JSON.stringify(postData))},
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + _this.token
- }
- })
- },
- //获取全部类型文稿列表
- getAllFile: () => {
- $http.all([_this.getItemFile('D01'),
- _this.getItemFile('D02'),
- _this.getItemFile('D03')]).then($http.spread((first, second, third) => {
- let response1 = _this.utils.strToJson(s4.decryptData_CBC(first.data.data));
- let response2 = _this.utils.strToJson(s4.decryptData_CBC(second.data.data));
- let response3 = _this.utils.strToJson(s4.decryptData_CBC(third.data.data));
- _this.fileData1 = response1.data;
- _this.fileData2 = response2.data;
- _this.fileData3 = response3.data;
- }))
- },
- //调用打开永中的嵌入页
- openOfficePage: (item, type) => {
- let postData={
- type:type,
- obj:item
- }
- let dataString = s4.encryptData_CBC(JSON.stringify(postData));
- let goUrl = "officeedit.html?dataString=" + dataString;
- location.href = goUrl;
- }
- },
- created: function () {
- _this = this;
- let token = localStorage.getItem("mobile-token", _this.token);
- let userName = localStorage.getItem("mobile-userName", _this.userName);
- let userId = localStorage.getItem("mobile-userId", _this.userId);
- _this.userId = userId;
- _this.token = token;
- _this.userName = userName;
- _this.routeid = _this.utils.getUrlName("routeid");
- _this.routeinfoid = _this.utils.getUrlName("routeinfoid");
- _this.directionid = _this.utils.getUrlName("directionid");
- _this.formeditid = _this.utils.getUrlName("formeditid");
- _this.docmode = _this.utils.getUrlName("docmode");
- _this.dotype = _this.utils.getUrlName("dotype");
- _this.type = _this.utils.getUrlName("type");
- },
- mounted: function () {
- _this.getAllCodeTable();
- _this.getBtnList();
- }
- })
|