|
@@ -13,9 +13,11 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
|
|
self.routeinfoid = sp.getUrlName("routeinfoid");
|
|
self.routeinfoid = sp.getUrlName("routeinfoid");
|
|
self.id = sp.getUrlName("id");
|
|
self.id = sp.getUrlName("id");
|
|
self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
|
|
self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
|
|
|
|
+ self.lastReturn = sp.getUrlName("lastReturn")
|
|
|
|
|
|
self.info = JSON.parse($.cookie("GlWorkPlatform-gdsp"))
|
|
self.info = JSON.parse($.cookie("GlWorkPlatform-gdsp"))
|
|
self.guidangList = []
|
|
self.guidangList = []
|
|
|
|
+ self.show = 1;
|
|
|
|
|
|
var postCfg = {
|
|
var postCfg = {
|
|
headers: {
|
|
headers: {
|
|
@@ -23,7 +25,11 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
|
|
'Authorization': "Bearer " + self.get_AccessToken
|
|
'Authorization': "Bearer " + self.get_AccessToken
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- self.FormTitle = $.cookie("GlWorkPlatform-SYSNAME");
|
|
|
|
|
|
+
|
|
|
|
+ self.goBack = function () {
|
|
|
|
+ window.location.href = "ygdlist.html?lastReturnPageno=" + sp.getUrlName("lastReturnPageno")
|
|
|
|
+ }
|
|
|
|
+
|
|
//初始化右上角按钮
|
|
//初始化右上角按钮
|
|
self.buttonList = []
|
|
self.buttonList = []
|
|
self.readonly = {
|
|
self.readonly = {
|
|
@@ -35,68 +41,7 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
|
|
CSYJ: false,
|
|
CSYJ: false,
|
|
BZ: false
|
|
BZ: false
|
|
}
|
|
}
|
|
-
|
|
|
|
- self.getDpList = function () {
|
|
|
|
- var data = {
|
|
|
|
- unitid: "AA"
|
|
|
|
- }
|
|
|
|
- $http.post(apiurljs.login + "g2app/dataabase/querySectByCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
- .success(function (obj) {
|
|
|
|
- var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
- self.dpList = [];
|
|
|
|
- res.data.forEach(function (item) {
|
|
|
|
- if (item.CHILD_DATA.length == 0) {
|
|
|
|
- self.dpList.push(item)
|
|
|
|
- } else {
|
|
|
|
- item.CHILD_DATA.forEach(function (item1) {
|
|
|
|
- if (item1.CHILD_DATA.length == 0) {
|
|
|
|
- self.dpList.push(item1)
|
|
|
|
- } else {
|
|
|
|
- item1.CHILD_DATA.forEach(function (item2) {
|
|
|
|
- if (item2.CHILD_DATA.length == 0) {
|
|
|
|
- self.dpList.push(item2)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- self.dpList.forEach(function (item) {
|
|
|
|
- item.checked = false;
|
|
|
|
- })
|
|
|
|
- self.DpList = {
|
|
|
|
- GDCS: JSON.parse(JSON.stringify(self.dpList))
|
|
|
|
- }
|
|
|
|
- self.AllCheckedDp = {};
|
|
|
|
- self.DpLength = {};
|
|
|
|
- self.selectDpList = {};
|
|
|
|
- self.getUserList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- self.getDpList()
|
|
|
|
- self.getUserList = function () {
|
|
|
|
- $http.post(apiurljs.login + "g2app/dataabase/getDpList", { data: s4.encryptData_CBC("") }, postCfg)
|
|
|
|
- .success(function (obj) {
|
|
|
|
- var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
- self.userList = res.data;
|
|
|
|
- self.userList.forEach(function (item) {
|
|
|
|
- item.checked = false;
|
|
|
|
- item.USER.forEach(function (item1) {
|
|
|
|
- item1.checked = false;
|
|
|
|
- item1.USHOWNAME1 = item1.USHOWNAME.length > 3 ? item1.USHOWNAME.slice(0, 3) + "..." : item1.USHOWNAME;
|
|
|
|
- item1.USHOWNAME2 = item1.USHOWNAME.length > 10 ? item1.USHOWNAME.slice(0, 10) + "..." : item1.USHOWNAME
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- self.UserList = {
|
|
|
|
- GDRY: JSON.parse(JSON.stringify(self.userList))
|
|
|
|
- };
|
|
|
|
- self.AllChecked = {};
|
|
|
|
- self.UserLength = {};
|
|
|
|
- self.selectList = {};
|
|
|
|
- self.getDP()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
self.getDP = function () {
|
|
self.getDP = function () {
|
|
var data = {
|
|
var data = {
|
|
userid: self.userId
|
|
userid: self.userId
|
|
@@ -109,6 +54,7 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
|
|
self.getGDBM();
|
|
self.getGDBM();
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ self.getDP()
|
|
self.getGDBM = function () {
|
|
self.getGDBM = function () {
|
|
var data = {
|
|
var data = {
|
|
unitid: "AA"
|
|
unitid: "AA"
|
|
@@ -127,7 +73,7 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
|
|
|
|
|
|
self.getWENHAO = function () {
|
|
self.getWENHAO = function () {
|
|
var data = {
|
|
var data = {
|
|
- routeinfoid: self.info.ROUTEINFOID,
|
|
|
|
|
|
+ routeinfoid: self.routeinfoid,
|
|
flowid:self.info.FLOWID
|
|
flowid:self.info.FLOWID
|
|
}
|
|
}
|
|
$http.post(apiurljs.login + "g2app/DangAn/queryDataByRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
$http.post(apiurljs.login + "g2app/DangAn/queryDataByRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
@@ -145,327 +91,337 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
|
|
//获取数据
|
|
//获取数据
|
|
self.getData = function () {
|
|
self.getData = function () {
|
|
var data = {
|
|
var data = {
|
|
- tablename: "DA_DAYUGUIDANG",
|
|
|
|
|
|
+ tablename: "DA_YGD",
|
|
colums: "*",
|
|
colums: "*",
|
|
order: "ID",
|
|
order: "ID",
|
|
- sqlwhere: { ID: self.id },
|
|
|
|
|
|
+ sqlwhere: { GLROUTEINFOID: self.routeinfoid },
|
|
sqlinwhere: "",
|
|
sqlinwhere: "",
|
|
sqllikewhere: ""
|
|
sqllikewhere: ""
|
|
}
|
|
}
|
|
|
|
+ if (self.lastReturn == "list") {
|
|
|
|
+ data.sqlwhere = { ID: sp.getUrlName("ID") }
|
|
|
|
+ }
|
|
$http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
$http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
.success(function (obj) {
|
|
.success(function (obj) {
|
|
var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ console.log(res.data)
|
|
if (res.data[0]) {
|
|
if (res.data[0]) {
|
|
self.data = {
|
|
self.data = {
|
|
ID: res.data[0].ID,
|
|
ID: res.data[0].ID,
|
|
- LC: res.data[0].LC,
|
|
|
|
- BT: res.data[0].BT,
|
|
|
|
- WH: res.data[0].WH,
|
|
|
|
- GDCS: res.data[0].GDCS,
|
|
|
|
- GDRY: res.data[0].GDRY,
|
|
|
|
- BZ: res.data[0].BZ,
|
|
|
|
-
|
|
|
|
- ARCHYEAR: res.data[0].ARCHYEAR,
|
|
|
|
- ORGANIZATIONMA: res.data[0].ORGANIZATIONMA,
|
|
|
|
- WENHAO: res.data[0].WENHAO,
|
|
|
|
- MIJIQIXIAN: res.data[0].MIJIQIXIAN,
|
|
|
|
- DANGANML: res.data[0].DANGANML,
|
|
|
|
- DOCUMENTTYPE: res.data[0].DOCUMENTTYPE,
|
|
|
|
- DOCTITLE: res.data[0].DOCTITLE,
|
|
|
|
- ZRZ: res.data[0].ZRZ,
|
|
|
|
- DOCISSUEDDATE: sp.format(res.data[0].DOCISSUEDDATE),
|
|
|
|
- JIANHAO: res.data[0].JIANHAO,
|
|
|
|
- YESHU: res.data[0].YESHU,
|
|
|
|
- BEIZHU: res.data[0].BEIZHU,
|
|
|
|
- ARCHCODE: res.data[0].ARCHCODE,
|
|
|
|
- DAROUTEINFOID: res.data[0].DAROUTEINFOID,
|
|
|
|
- DPNAME: res.data[0].DPNAME,
|
|
|
|
- DPCODE: res.data[0].DPCODE,
|
|
|
|
- MOBANNAME: res.data[0].MOBANNAME,
|
|
|
|
- TABLENAME: res.data[0].TABLENAME
|
|
|
|
|
|
+ FONDS_CODE: res.data[0].FONDS_CODE,
|
|
|
|
+ SERIES_CODE: res.data[0].SERIES_CODE,
|
|
|
|
+ FILE_CODE: res.data[0].FILE_CODE,
|
|
|
|
+ TITLE_PROPER: res.data[0].TITLE_PROPER,
|
|
|
|
+ DATE_OF_CREATION: sp.format(res.data[0].DATE_OF_CREATION),
|
|
|
|
+ OA_ID: res.data[0].OA_ID,
|
|
|
|
+ OFFICE_ARCHIVAL_CODE: res.data[0].OFFICE_ARCHIVAL_CODE,
|
|
|
|
+ AUTHOR: res.data[0].AUTHOR,
|
|
|
|
+ AMOUNT_OF_PAGES: res.data[0].AMOUNT_OF_PAGES,
|
|
|
|
+ YEAR_CODE: res.data[0].YEAR_CODE,
|
|
|
|
+ ITEM_NO: res.data[0].ITEM_NO,
|
|
|
|
+ ITEM_COUNT: res.data[0].ITEM_COUNT,
|
|
|
|
+ RETENTION_PERIOD: res.data[0].RETENTION_PERIOD,
|
|
|
|
+ FILING_DEPT: res.data[0].FILING_DEPT,
|
|
|
|
+ FILENAME: res.data[0].FILENAME,
|
|
|
|
+ ZHANGTOP: res.data[0].ZHANGTOP,
|
|
|
|
+ ZHANGLEFT: res.data[0].ZHANGLEFT
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
self.data = {
|
|
self.data = {
|
|
ID: 0,
|
|
ID: 0,
|
|
- LC: self.info.FLOWNAME,
|
|
|
|
- BT: self.info.TITLE,
|
|
|
|
- WH: self.WENHAO,
|
|
|
|
- GDCS: self.userDpName,
|
|
|
|
- GDRY: self.userName,
|
|
|
|
- BZ: "",
|
|
|
|
-
|
|
|
|
- ARCHYEAR: sp.currentYear(),
|
|
|
|
- ORGANIZATIONMA: self.userDpCode,
|
|
|
|
- WENHAO: self.WENHAO,
|
|
|
|
- MIJIQIXIAN: "10年",
|
|
|
|
- DANGANML: "文书",
|
|
|
|
- DOCUMENTTYPE: self.info.FLOWNAME,
|
|
|
|
- DOCTITLE: self.info.TITLE,
|
|
|
|
- ZRZ: "",
|
|
|
|
- DOCISSUEDDATE: sp.format(sp.getLocalDate()),
|
|
|
|
- JIANHAO: 1,
|
|
|
|
- YESHU: "",
|
|
|
|
- BEIZHU: "",
|
|
|
|
- ARCHCODE: "",
|
|
|
|
- DAROUTEINFOID: self.info.ROUTEINFOID,
|
|
|
|
- DPNAME: self.userDpName,
|
|
|
|
- DPCODE: self.userDpCode,
|
|
|
|
- MOBANNAME: self.info.MOBANNAME,
|
|
|
|
- TABLENAME: self.info.TABLENAME
|
|
|
|
|
|
+ FONDS_CODE: "X154",
|
|
|
|
+ SERIES_CODE: "",
|
|
|
|
+ FILE_CODE: self.WENHAO,
|
|
|
|
+ TITLE_PROPER: "",
|
|
|
|
+ DATE_OF_CREATION: "",
|
|
|
|
+ OA_ID: "",
|
|
|
|
+ OFFICE_ARCHIVAL_CODE:"",
|
|
|
|
+ AUTHOR:"",
|
|
|
|
+ AMOUNT_OF_PAGES:"",
|
|
|
|
+ YEAR_CODE: sp.currentYear(),
|
|
|
|
+ ITEM_NO: "",
|
|
|
|
+ ITEM_COUNT:"",
|
|
|
|
+ RETENTION_PERIOD:"10年",
|
|
|
|
+ FILING_DEPT: self.userDpName,
|
|
|
|
+ FILENAME:"",
|
|
|
|
+ ZHANGTOP: "",
|
|
|
|
+ ZHANGLEFT: "",
|
|
|
|
+ GLROUTEINFOID: self.routeinfoid,
|
|
|
|
+ CDATE: sp.getLocalDate()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- $scope.data = self.data;
|
|
|
|
- var n = {}, all = {};
|
|
|
|
- for (var i in self.UserList) {
|
|
|
|
- self.AllChecked[i] = false;
|
|
|
|
- self.UserLength[i] = 0;
|
|
|
|
- self.selectList[i] = []
|
|
|
|
- n[i] = [];
|
|
|
|
- all[i] = 0;
|
|
|
|
- $.each(self.UserList[i], function (index, item) {
|
|
|
|
- n[i].push(0)
|
|
|
|
- $.each(item.USER, function (index1, item1) {
|
|
|
|
- self.UserLength[i]++
|
|
|
|
- if (self.data.GDRY.indexOf(item1.USHOWNAME) != -1 && i == "GDRY") {
|
|
|
|
- n[i][index]++;
|
|
|
|
- item1.checked = true;
|
|
|
|
- self.selectList[i].push(item1);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- if (n[i][index] == item.USER.length && n[i][index] != 0) {
|
|
|
|
- item.checked = true;
|
|
|
|
- all[i]++;
|
|
|
|
- } else {
|
|
|
|
- item.checked == false;
|
|
|
|
|
|
+ self.getYGD()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ self.getYGD = function () {
|
|
|
|
+ var data = {
|
|
|
|
+ routeinfoid: self.routeinfoid,
|
|
|
|
+ converttype: "3"
|
|
|
|
+ }
|
|
|
|
+ $http.post(apiurljs.login + "g2app/DangAn/queryYJYGDWenJianList",{ data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
+ .success(function (obj) {
|
|
|
|
+ var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ self.fileList = res.data[0].DATA;
|
|
|
|
+ self.getGDFile();
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ self.getGDFile = function () {
|
|
|
|
+ var data = {
|
|
|
|
+ tablename: "DA_YJYGDFILEATTACH",
|
|
|
|
+ colums: "*",
|
|
|
|
+ order: "SORTID",
|
|
|
|
+ sqlwhere: { ROUTEINFOID: self.data.ID },
|
|
|
|
+ sqlinwhere: "",
|
|
|
|
+ sqllikewhere: ""
|
|
|
|
+ }
|
|
|
|
+ $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
+ .success(function (obj) {
|
|
|
|
+ var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ self.guidangList = res.data;
|
|
|
|
+
|
|
|
|
+ self.fileList.forEach(function (item) {
|
|
|
|
+ var n = 0;
|
|
|
|
+ self.guidangList.forEach(function (item1) {
|
|
|
|
+ if (item.WENJIANMING == item1.FILENAMES) {
|
|
|
|
+ item.show = false;
|
|
|
|
+ n++
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- if (all[i] == self.UserList[i].length) {
|
|
|
|
- self.AllChecked[i] = true;
|
|
|
|
- } else {
|
|
|
|
- self.AllChecked[i] = false;
|
|
|
|
|
|
+ if (n == 0) {
|
|
|
|
+ item.show = true;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- for (var i in self.DpList) {
|
|
|
|
- self.AllCheckedDp[i] = false;
|
|
|
|
- self.DpLength[i] = 0;
|
|
|
|
- self.selectDpList[i] = []
|
|
|
|
- all[i] = 0;
|
|
|
|
- $.each(self.DpList[i], function (index, item) {
|
|
|
|
- self.DpLength[i]++
|
|
|
|
- if (self.data.GDCS.indexOf(item.SECTION) != -1 && i == "GDCS") {
|
|
|
|
- all[i]++;
|
|
|
|
- item.checked = true;
|
|
|
|
- self.selectDpList[i].push(item);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- if (all[i] == self.DpList[i].length) {
|
|
|
|
- self.AllCheckedDp[i] = true;
|
|
|
|
- } else {
|
|
|
|
- self.AllCheckedDp[i] = false;
|
|
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ $("#table_tbody").sortable({
|
|
|
|
+ cursor: "move",
|
|
|
|
+ stop: function (event, ui) {
|
|
|
|
+ var index = 1;
|
|
|
|
+ $("#table_tbody").children().each(function (x) {
|
|
|
|
+ $(this).attr("index", index)
|
|
|
|
+ $(this).children().eq(0).html(index)
|
|
|
|
+ index++
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- self.openDpList = function (str) {
|
|
|
|
- self.filed = str;
|
|
|
|
- sp.layer("#DpList")
|
|
|
|
- $("#DpList .sp-page").eq(0).scrollTop(0);
|
|
|
|
- }
|
|
|
|
- self.checkAllDp = function () {
|
|
|
|
- self.AllCheckedDp[self.filed] = !self.AllCheckedDp[self.filed];
|
|
|
|
- $.each(self.DpList[self.filed], function (index, item) {
|
|
|
|
- item.checked = self.AllCheckedDp[self.filed];
|
|
|
|
|
|
+ }).disableSelection();
|
|
})
|
|
})
|
|
- self.submitDpList(1)
|
|
|
|
}
|
|
}
|
|
- self.checkDpItem = function (item) {
|
|
|
|
- item.checked = !item.checked;
|
|
|
|
- var n = 0;
|
|
|
|
- $.each(self.DpList[self.filed], function (index, item) {
|
|
|
|
- if (item.checked == true) {
|
|
|
|
- n++
|
|
|
|
|
|
+
|
|
|
|
+ //保存提交
|
|
|
|
+ self.btnSave = function () {
|
|
|
|
+ if (spngvld.submit(".formedit")) {
|
|
|
|
+ var data = {
|
|
|
|
+ tablename: "DA_YGD",
|
|
|
|
+ id: self.data.ID,
|
|
|
|
+ data: {
|
|
|
|
+ FONDS_CODE: self.data.FONDS_CODE,
|
|
|
|
+ SERIES_CODE: self.data.SERIES_CODE,
|
|
|
|
+ FILE_CODE: self.data.FILE_CODE,
|
|
|
|
+ TITLE_PROPER: self.data.TITLE_PROPER,
|
|
|
|
+ DATE_OF_CREATION: self.data.DATE_OF_CREATION,
|
|
|
|
+ OA_ID: self.data.OA_ID,
|
|
|
|
+ OFFICE_ARCHIVAL_CODE: self.data.OFFICE_ARCHIVAL_CODE,
|
|
|
|
+ AUTHOR: self.data.AUTHOR,
|
|
|
|
+ AMOUNT_OF_PAGES: self.data.AMOUNT_OF_PAGES,
|
|
|
|
+ YEAR_CODE: self.data.YEAR_CODE,
|
|
|
|
+ ITEM_NO: self.data.ITEM_NO,
|
|
|
|
+ ITEM_COUNT: self.data.ITEM_COUNT,
|
|
|
|
+ RETENTION_PERIOD: self.data.RETENTION_PERIOD,
|
|
|
|
+ FILING_DEPT: self.data.FILING_DEPT,
|
|
|
|
+ FILENAME: self.data.FILENAME,
|
|
|
|
+ ZHANGTOP: self.data.ZHANGTOP,
|
|
|
|
+ ZHANGLEFT: self.data.ZHANGLEFT,
|
|
|
|
+ GLROUTEINFOID: self.data.GLROUTEINFOID
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- })
|
|
|
|
- if (n == self.DpList[self.filed].length) {
|
|
|
|
- self.AllCheckedDp[self.filed] = true;
|
|
|
|
- } else {
|
|
|
|
- self.AllCheckedDp[self.filed] = false;
|
|
|
|
|
|
+ $http.post(apiurljs.login + "g2app/dataabase/saveChildData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
+ .success(function (obj) {
|
|
|
|
+ var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ self.id = res.data.ID;
|
|
|
|
+ self.getData()
|
|
|
|
+ self.show = 2;
|
|
|
|
+ } else {
|
|
|
|
+ sp.dialog(res.message)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- self.submitDpList(1)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- self.submitDpList = function (n) {
|
|
|
|
- var AllCheckedLength1 = 0;
|
|
|
|
- self.selectDpList[self.filed] = [];
|
|
|
|
- $.each(self.DpList[self.filed], function (index, item) {
|
|
|
|
- if (item.checked == true) {
|
|
|
|
- AllCheckedLength1++;
|
|
|
|
- self.selectDpList[self.filed].push(item)
|
|
|
|
|
|
+ self.addFile = function (obj) {
|
|
|
|
+ var data = {
|
|
|
|
+ tablename: "DA_YJYGDFILEATTACH",
|
|
|
|
+ data: {
|
|
|
|
+ FILENAMES: obj.WENJIANMING,
|
|
|
|
+ FILEOLDNAME: obj.WENJIANMING,
|
|
|
|
+ FILEEXT: obj.PREFIX,
|
|
|
|
+ FILESIZE: "",
|
|
|
|
+ FILEDATE: obj.RIQI,
|
|
|
|
+ FILEID: "",
|
|
|
|
+ FILEURL: obj.URL,
|
|
|
|
+ FILETBURL: "",
|
|
|
|
+ ATTACHTYPE: "",
|
|
|
|
+ FILECDATE: "",
|
|
|
|
+ CONVERTID: "",
|
|
|
|
+ FILEPAGE: obj.YESHU,
|
|
|
|
+ ROUTEINFOID: self.data.ID
|
|
}
|
|
}
|
|
- })
|
|
|
|
- self.data[self.filed] = self.selectDpList[self.filed].map(function (item) {
|
|
|
|
- return item.SECTION
|
|
|
|
- }).join(",")
|
|
|
|
- self.AllCheckedDp[self.filed] = AllCheckedLength1 == self.DpLength[self.filed];
|
|
|
|
- if (n == 0) {
|
|
|
|
- sp.layerhide();
|
|
|
|
}
|
|
}
|
|
|
|
+ $http.post(apiurljs.login + "g2app/dataabase/insertFormData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
+ .success(function (obj) {
|
|
|
|
+ var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ if (res.success) {
|
|
|
|
+ self.getYGD();
|
|
|
|
+ } else {
|
|
|
|
+ sp.dialog(res.message);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
-
|
|
|
|
- self.openUserList = function (str) {
|
|
|
|
- self.filed = str;
|
|
|
|
- sp.layer("#userList")
|
|
|
|
- $("#userList .sp-page").eq(0).scrollTop(0);
|
|
|
|
|
|
+ self.delFile = function (obj) {
|
|
|
|
+ var data = {
|
|
|
|
+ tablename: "DA_YJYGDFILEATTACH",
|
|
|
|
+ id: obj.ID
|
|
|
|
+ };
|
|
|
|
+ $http.post(apiurljs.login + "g2app/dataabase/delDataById", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
+ .success(function (obj) {
|
|
|
|
+ var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ if (res.success) {
|
|
|
|
+ self.getYGD();
|
|
|
|
+ } else {
|
|
|
|
+ sp.dialog(res.message);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- self.checkAllUser = function () {
|
|
|
|
- self.AllChecked[self.filed] = !self.AllChecked[self.filed];
|
|
|
|
- $.each(self.UserList[self.filed], function (index, item) {
|
|
|
|
- item.checked = self.AllChecked[self.filed];
|
|
|
|
- $.each(item.USER, function (index1, item1) {
|
|
|
|
- item1.checked = self.AllChecked[self.filed];
|
|
|
|
- })
|
|
|
|
|
|
+ self.sortUp = function (num) {
|
|
|
|
+ var IDS = [{ ID: self.guidangList[num].ID }, { ID: self.guidangList[num - 1].ID }]
|
|
|
|
+ var SORTIDS = [{ SORTID: self.guidangList[num - 1].SORTID }, { SORTID: self.guidangList[num].SORTID }]
|
|
|
|
+ var data = {
|
|
|
|
+ entity: "DA_YJYGDFILEATTACH",
|
|
|
|
+ data: SORTIDS,
|
|
|
|
+ setwhere: IDS
|
|
|
|
+ }
|
|
|
|
+ $http.post(apiurljs.login + "g2app/Data/UpdataByWhereList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
+ .success(function (obj) {
|
|
|
|
+ var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ if (res.success) {
|
|
|
|
+ self.getGDFile();
|
|
|
|
+ } else {
|
|
|
|
+ sp.dialog(res.message);
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- self.submitUserList(1)
|
|
|
|
}
|
|
}
|
|
- self.checkUserItem = function (item) {
|
|
|
|
- item.checked = !item.checked;
|
|
|
|
- $.each(item.USER, function (index, item1) {
|
|
|
|
- item1.checked = item.checked;
|
|
|
|
- })
|
|
|
|
- var n = 0;
|
|
|
|
- $.each(self.UserList[self.filed], function (index, item) {
|
|
|
|
- if (item.checked == true) {
|
|
|
|
- n++
|
|
|
|
|
|
+ self.sortDown = function (num) {
|
|
|
|
+ var IDS = [{ ID: self.guidangList[num].ID }, { ID: self.guidangList[num + 1].ID }]
|
|
|
|
+ var SORTIDS = [{ SORTID: self.guidangList[num + 1].SORTID }, { SORTID: self.guidangList[num].SORTID }]
|
|
|
|
+ var data = {
|
|
|
|
+ entity: "DA_YJYGDFILEATTACH",
|
|
|
|
+ data: SORTIDS,
|
|
|
|
+ setwhere: IDS
|
|
|
|
+ }
|
|
|
|
+ $http.post(apiurljs.login + "g2app/Data/UpdataByWhereList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
+ .success(function (obj) {
|
|
|
|
+ var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ if (res.success) {
|
|
|
|
+ self.getGDFile();
|
|
|
|
+ } else {
|
|
|
|
+ sp.dialog(res.message);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- if (n == self.UserList[self.filed].length) {
|
|
|
|
- self.AllChecked[self.filed] = true;
|
|
|
|
- } else {
|
|
|
|
- self.AllChecked[self.filed] = false;
|
|
|
|
- }
|
|
|
|
- self.submitUserList(1)
|
|
|
|
}
|
|
}
|
|
- self.checkUser = function (item) {
|
|
|
|
- item.checked = !item.checked;
|
|
|
|
- var n = [], all = 0;
|
|
|
|
- $.each(self.UserList[self.filed], function (x, y) {
|
|
|
|
- n.push(0);
|
|
|
|
- $.each(y.USER, function (x1, y1) {
|
|
|
|
- if (y1.checked == true) {
|
|
|
|
- n[x]++
|
|
|
|
|
|
+ self.uploading = false;
|
|
|
|
+ self.upload = function () {
|
|
|
|
+ //var uploadformat = strToJson(s4.decryptData_CBC(apiurljs.uploadformat)).data.map(function (item) {
|
|
|
|
+ // return item.CNAME
|
|
|
|
+ //})
|
|
|
|
+ $('#fileupload').fileupload({
|
|
|
|
+ url: apiurljs.login + 'g2app/abase/uploadFileWithForm',
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ beforeSend: function (xhr, data) {
|
|
|
|
+ xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
|
|
|
|
+ xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=DA_YJYGDFILEATTACH,routeinfoid=" + self.data.ID));
|
|
|
|
+ },
|
|
|
|
+ add: function (e, data) {
|
|
|
|
+ var num = 0;
|
|
|
|
+ //var acceptFileTypes = eval('/(' + uploadformat.join("|") + ')$/i')
|
|
|
|
+ var acceptFileTypes = eval('/(pdf)$/i')
|
|
|
|
+ //文件类型判断
|
|
|
|
+ $.each(data.originalFiles, function (index, item) {
|
|
|
|
+ if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
|
|
|
|
+ //sp.dialog("您好,请上传" + uploadformat.join("/") + "格式的文件!");
|
|
|
|
+ sp.dialog("您好,请上传pdf格式的文件!");
|
|
|
|
+ return;
|
|
|
|
+ } else {
|
|
|
|
+ num++
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if (num == data.originalFiles.length) {
|
|
|
|
+ self.uploading = true;
|
|
|
|
+ data.submit();
|
|
|
|
+ $scope.$apply();
|
|
}
|
|
}
|
|
- })
|
|
|
|
- if (n[x] == y.USER.length && n[x] != 0) {
|
|
|
|
- y.checked = true;
|
|
|
|
- all++
|
|
|
|
- } else {
|
|
|
|
- y.checked = false;
|
|
|
|
|
|
+ },
|
|
|
|
+ // 上传完成后的执行逻辑
|
|
|
|
+ done: function (e, data) {
|
|
|
|
+ self.uploading = false;
|
|
|
|
+ self.getGDFile()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- if (all == self.UserList[self.filed].length) {
|
|
|
|
- self.AllChecked[self.filed] = true;
|
|
|
|
- } else {
|
|
|
|
- self.AllChecked[self.filed] = false;
|
|
|
|
- }
|
|
|
|
- self.submitUserList(1)
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- self.submitUserList = function (n) {
|
|
|
|
- var AllCheckedLength = 0;
|
|
|
|
- self.selectList[self.filed] = [];
|
|
|
|
- $.each(self.UserList[self.filed], function (index, item) {
|
|
|
|
- $.each(item.USER, function (index1, item1) {
|
|
|
|
- if (item1.checked == true) {
|
|
|
|
- AllCheckedLength++;
|
|
|
|
- self.selectList[self.filed].push(item1)
|
|
|
|
|
|
+ self.btnSaveFiles = function () {
|
|
|
|
+ var IDS = [], SORTIDS = [];
|
|
|
|
+ self.guidangList.forEach(function (item) {
|
|
|
|
+ $("#table_tbody").children().each(function (index) {
|
|
|
|
+ if ($(this).attr("data-col") == item.ID) {
|
|
|
|
+ IDS.push({ ID: item.ID })
|
|
|
|
+ SORTIDS.push({ SORTID: self.guidangList[$(this).attr("index") - 1].SORTID })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- self.data[self.filed] = self.selectList[self.filed].map(function (item) {
|
|
|
|
- return item.USHOWNAME
|
|
|
|
- }).join(",")
|
|
|
|
- if (self.data[self.filed + "ID"] != undefined) {
|
|
|
|
- self.data[self.filed + "ID"] = self.selectList[self.filed].map(function (item) {
|
|
|
|
- return item.USERID
|
|
|
|
- }).join(",")
|
|
|
|
- }
|
|
|
|
- self.AllChecked[self.filed] = AllCheckedLength == self.UserLength[self.filed];
|
|
|
|
- if (n == 0) {
|
|
|
|
- sp.layerhide();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //保存提交
|
|
|
|
- self.btnSave = function (n) {
|
|
|
|
var data = {
|
|
var data = {
|
|
- tablename: "DA_DAYUGUIDANG",
|
|
|
|
- id: self.data.ID,
|
|
|
|
- data: {
|
|
|
|
- LC: self.data.LC,
|
|
|
|
- BT: self.data.BT,
|
|
|
|
- WH: self.data.WH,
|
|
|
|
- GDCS: self.data.GDCS,
|
|
|
|
- GDRY: self.data.GDRY,
|
|
|
|
- BZ: self.data.BZ,
|
|
|
|
-
|
|
|
|
- ARCHYEAR: self.data.ARCHYEAR,
|
|
|
|
- ORGANIZATIONMA: self.data.ORGANIZATIONMA,
|
|
|
|
- WENHAO: self.data.WENHAO,
|
|
|
|
- MIJIQIXIAN: self.data.MIJIQIXIAN,
|
|
|
|
- DANGANML: self.data.DANGANML,
|
|
|
|
- DOCUMENTTYPE: self.data.DOCUMENTTYPE,
|
|
|
|
- DOCTITLE: self.data.DOCTITLE,
|
|
|
|
- ZRZ: self.data.ZRZ,
|
|
|
|
- DOCISSUEDDATE: self.data.DOCISSUEDDATE,
|
|
|
|
- JIANHAO: self.data.JIANHAO,
|
|
|
|
- YESHU: self.data.YESHU,
|
|
|
|
- BEIZHU: self.data.BEIZHU,
|
|
|
|
- ARCHCODE: self.data.ARCHCODE,
|
|
|
|
- DAROUTEINFOID: self.data.DAROUTEINFOID,
|
|
|
|
- DPNAME: self.data.DPNAME,
|
|
|
|
- DPCODE: self.data.DPCODE,
|
|
|
|
- MOBANNAME: self.data.MOBANNAME,
|
|
|
|
- TABLENAME: self.data.TABLENAME
|
|
|
|
- }
|
|
|
|
|
|
+ entity: "DA_YJYGDFILEATTACH",
|
|
|
|
+ data: SORTIDS,
|
|
|
|
+ setwhere: IDS
|
|
}
|
|
}
|
|
- $http.post(apiurljs.login + "g2app/dataabase/saveChildData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
|
|
+ $http.post(apiurljs.login + "g2app/Data/UpdataByWhereList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
.success(function (obj) {
|
|
.success(function (obj) {
|
|
var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
- if (res.code == 0) {
|
|
|
|
- self.id = res.data.ID;
|
|
|
|
- self.getData()
|
|
|
|
|
|
+ if (res.success) {
|
|
|
|
+ self.getGDFile();
|
|
} else {
|
|
} else {
|
|
- sp.dialog(res.message)
|
|
|
|
|
|
+ sp.dialog(res.message);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- // 更新数据
|
|
|
|
- self.updateBtn=function(){
|
|
|
|
- console.log("更新---")
|
|
|
|
- }
|
|
|
|
- // 生成归档目录
|
|
|
|
- self.createGuidang = function () {
|
|
|
|
- var data = {
|
|
|
|
- routeinfoid: self.routeinfoid,
|
|
|
|
|
|
+
|
|
|
|
+ self.MergeByFile = function () {
|
|
|
|
+ var data = {
|
|
|
|
+ files: [],
|
|
|
|
+ converttype: 3,
|
|
|
|
+ routeinfoid: self.data.ID,
|
|
|
|
+ gdzdata: ['全宗号', '年度', '件号', "X154", self.data.YEAR_CODE, self.data.ITEM_NO, '机构', '保管期限', '页数', self.data.FILING_DEPT, self.data.RETENTION_PERIOD, self.data.AMOUNT_OF_PAGES],
|
|
|
|
+ marginLeft: 755,//self.data.ZHANGLEFT,
|
|
|
|
+ marginBottom: 440//self.data.ZHANGTOP
|
|
}
|
|
}
|
|
- $http.post(apiurljs.login + "g2app/DangAn/YJYGDMULU", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
- .success(function (obj) {
|
|
|
|
- var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
- if (res.code == 0) {
|
|
|
|
- self.guidangList = res.data;
|
|
|
|
- } else {
|
|
|
|
- sp.dialog(res.message)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ self.guidangList.forEach(function (item) {
|
|
|
|
+ data.files.push({ fileurl: item.FILEURL })
|
|
|
|
+ })
|
|
|
|
+ $http.post(apiurljs.login + "g2app/DangAn/queryYJYGDMergeByFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
|
|
|
|
+ .success(function (obj) {
|
|
|
|
+ var res = strToJson(s4.decryptData_CBC(obj.data));
|
|
|
|
+ self.seeFiles(res.data.DATA)
|
|
|
|
+ self.show = 3;
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
+
|
|
// 查看文件
|
|
// 查看文件
|
|
- self.searchFiles = function (obj) {
|
|
|
|
|
|
+ self.seeFiles = function (obj) {
|
|
var set_convertType = 0;
|
|
var set_convertType = 0;
|
|
- if (obj.PREFIX == "doc") {
|
|
|
|
|
|
+ if (obj.FILEEXT == "doc") {
|
|
set_convertType = 0;
|
|
set_convertType = 0;
|
|
- } else if (obj.PREFIX == "pdf") {
|
|
|
|
|
|
+ } else if (obj.FILEEXT == "pdf") {
|
|
set_convertType = 20;
|
|
set_convertType = 20;
|
|
- } else if (obj.PREFIX == "ofd") {
|
|
|
|
|
|
+ } else if (obj.FILEEXT == "ofd") {
|
|
set_convertType = 570;
|
|
set_convertType = 570;
|
|
} else {
|
|
} else {
|
|
set_convertType = 0;
|
|
set_convertType = 0;
|
|
@@ -473,7 +429,7 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
|
|
let postData = {
|
|
let postData = {
|
|
convertType: set_convertType,
|
|
convertType: set_convertType,
|
|
isSignature: 1,
|
|
isSignature: 1,
|
|
- fileUrl: apiurljs.login + "g2work/files2/inline/" + obj.URL.slice(7)
|
|
|
|
|
|
+ fileUrl: apiurljs.login + "g2work/files2/inline/" + obj.FILEURL.slice(7)
|
|
};
|
|
};
|
|
var postCfg_transfer = {
|
|
var postCfg_transfer = {
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
@@ -500,9 +456,4 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
|
|
}
|
|
}
|
|
}, 1)
|
|
}, 1)
|
|
})
|
|
})
|
|
-}])
|
|
|
|
-var parentData = {}
|
|
|
|
-function getData() {
|
|
|
|
- parentData = angular.element(document.getElementById("app")).scope().data
|
|
|
|
- return parentData
|
|
|
|
-}
|
|
|
|
|
|
+}])
|