ZYjames 4 miesięcy temu
rodzic
commit
d227105f7b
4 zmienionych plików z 797 dodań i 400 usunięć
  1. 158 0
      tpl/forward/js/list.js
  2. 286 335
      tpl/forward/js/yuguidang.js
  3. 161 0
      tpl/forward/ygdlist.html
  4. 192 65
      tpl/forward/yuguidang.html

+ 158 - 0
tpl/forward/js/list.js

@@ -0,0 +1,158 @@
+'use strict';
+
+var app = angular.module('app', [
+  'angularUtils.directives.dirPagination'
+]);
+app.controller("listCtrl", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) {
+    var self = this;
+    var s4 = new SM4Util();
+    self.userId = $.cookie("GlWorkPlatform-userid");
+    self.userName = $.cookie("GlWorkPlatform-chineseName");
+    self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
+    self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
+
+    var postCfg = {
+        headers: {
+            'Content-Type': 'application/json',
+            'Authorization': "Bearer " + self.get_AccessToken
+        }
+    }
+
+    self.loading = false;
+    self.noDataTip = 1;//没有数据时赋变量为0,先默认为1
+    self.listTotal1 = [];
+    self.listTotal2 = [];
+    self.list = [];
+    self.pageno = 1;
+    self.total_count = 0;
+    self.itemsPerPage = 10;
+    self.pageOptions = [10, 20, 30, 40];
+
+    self.search = JSON.parse($.cookie("ygdlist-search"));
+
+    //1为已提交、2为退回、3为合并提交、4为合并草稿、5为封装、6为已整理提交
+    self.getData = function (pageno, type) {
+        if (self.search == null) {
+            self.search = {
+                title: "",
+                dah: ""
+            }
+        }
+        $.cookie("ygdlist-search", JSON.stringify(self.search), { path: '/', expires: 1 });
+        self.loading = true;
+        self.pageno = pageno;
+        $scope.__default__currentPage = self.pageno;   //设置页面样式在第几页
+        self.list = [];
+        var data = {
+            tablename: "DA_YGD",
+            pagesize: self.itemsPerPage,
+            pageno: self.pageno,
+            colums: "ID,ROUTEINFOID,TITLE_PROPER,OFFICE_ARCHIVAL_CODE,RETENTION_PERIOD,TO_CHAR(DATE_OF_CREATION,'yyyy-mm-dd')as DATE_OF_CREATION",
+            order: "ID",
+            sqlwhere: "",
+            sqlorwhere: "",
+            sqlinwhere: "",
+            sqllikewhere: {
+                TITLE_PROPER: self.search.title,
+                OFFICE_ARCHIVAL_CODE: self.search.dah
+            }
+        };
+        $http.post(apiurljs.login + "g2app/dataabase/queryDataByColWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
+        .success(function (obj) {
+            var res = strToJson(s4.decryptData_CBC(obj.data));
+            self.loading = false;
+            if (res.totalCount == 0) {
+                self.noDataTip = 0;
+            } else if (res.data == null || res.data == undefined || res.data == "") {
+                self.noDataTip = 0;
+                self.getData(self.pageno - 1)
+            } else {
+                self.noDataTip = 1;
+                self.list = res.data;
+            }
+        })
+    }
+
+    self.load = function () {
+        if (self.get_lastReturnPageno == undefined || self.get_lastReturnPageno == null || self.get_lastReturnPageno == "") {
+            self.getData(self.pageno);
+        } else {
+            $timeout(function () {
+                self.getData(parseInt(self.get_lastReturnPageno));
+            }, 1)
+        }
+    }
+
+    self.load();
+
+    self.refresh = function () {
+        self.CrossPage.type = null;
+        self.getData(self.pageno);
+    }
+    ///查询-打开弹出层
+    self.openSearchLayer = function () {
+        if (self.search == null) {
+            self.search = {
+                title: "",
+                dah: ""
+            }
+        }
+        sp.layer("#search");
+    }
+
+    self.btnSearch = function () {
+        self.getData(1);
+        sp.layerhide()
+    }
+    self.closeSeach = function () {
+        self.search = {
+            title: "",
+            dah: ""
+        }
+        sp.layerhide();
+        $.cookie("ygdlist-search", null, { path: '/', expires: -1 });
+        self.getData(1);
+    };
+
+    self.Edit = function (item) {
+        window.location.href = "yuguidang.html?ID=" + item.ID + "&routeinfoid=" + item.ROUTEINFOID + "&lastReturn=list&lastReturnPageno=" + self.pageno
+        event.stopPropagation()
+    }
+
+    self.Delete = function (id) {
+        var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
+        var dialogBody = "<div class=\"sp-dialog-body\">您确认要删除此记录吗?</div>";
+        var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='upDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
+        $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
+        sp.openCenter(".sp-dialog");
+        $('.sp-closeDialog').click(function (event) {
+            sp.dialoghide();
+            event.preventDefault();
+            event.stopPropagation();
+        });
+        $("#upDataTrue").click(function () {
+            sp.dialoghide();
+            var data = {
+                tablename: "DA_YGD",
+                id: 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.getData(self.pageno);
+                }
+            })
+        })
+    }
+
+    //头部下滚冻结
+    $(function () {
+        //页面高度撑满
+        setTimeout(function () {
+            if ($(".ibox-content").height() < $(window).height() - 31) {
+                $(".ibox-content").css("height", $(window).height() - 31)
+            }
+        }, 1)
+    })
+}])

+ 286 - 335
tpl/forward/js/yuguidang.js

@@ -13,9 +13,11 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
     self.routeinfoid = sp.getUrlName("routeinfoid");
     self.id = sp.getUrlName("id");
     self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
+    self.lastReturn = sp.getUrlName("lastReturn")
 
     self.info = JSON.parse($.cookie("GlWorkPlatform-gdsp"))
     self.guidangList = []
+    self.show = 1;
 
     var postCfg = {
         headers: {
@@ -23,7 +25,11 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
             '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.readonly = {
@@ -35,68 +41,7 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
         CSYJ: 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 () {
         var data = {
             userid: self.userId
@@ -109,6 +54,7 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
             self.getGDBM();
         })
     }
+    self.getDP()
     self.getGDBM = function () {
         var data = {
             unitid: "AA"
@@ -127,7 +73,7 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
 
     self.getWENHAO = function () {
         var data = {
-            routeinfoid: self.info.ROUTEINFOID,
+            routeinfoid: self.routeinfoid,
             flowid:self.info.FLOWID
         }
         $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 () {
         var data = {
-            tablename: "DA_DAYUGUIDANG",
+            tablename: "DA_YGD",
             colums: "*",
             order: "ID",
-            sqlwhere: { ID: self.id },
+            sqlwhere: { GLROUTEINFOID: self.routeinfoid },
             sqlinwhere: "",
             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)
         .success(function (obj) {
             var res = strToJson(s4.decryptData_CBC(obj.data));
+            console.log(res.data)
             if (res.data[0]) {
                 self.data = {
                     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 {
                 self.data = {
                     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 = {
-            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) {
             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 {
-                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;
-        if (obj.PREFIX == "doc") {
+        if (obj.FILEEXT == "doc") {
             set_convertType = 0;
-        } else if (obj.PREFIX == "pdf") {
+        } else if (obj.FILEEXT == "pdf") {
             set_convertType = 20;
-        } else if (obj.PREFIX == "ofd") {
+        } else if (obj.FILEEXT == "ofd") {
             set_convertType = 570;
         } else {
             set_convertType = 0;
@@ -473,7 +429,7 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
         let postData = {
             convertType: set_convertType,
             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 = {
             headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
@@ -500,9 +456,4 @@ app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function
             }
         }, 1)
     })
-}])
-var parentData = {}
-function getData() {
-    parentData = angular.element(document.getElementById("app")).scope().data
-    return parentData
-}
+}])

+ 161 - 0
tpl/forward/ygdlist.html

@@ -0,0 +1,161 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" ng-app="app">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+
+    <title>档案管理</title>
+    <link href="../../AFrontEnd/css/animate.css" rel="stylesheet" />
+    <link href="../../AFrontEnd/css/fontawesome/css/font-awesome.css" rel="stylesheet" />
+    <link href="../../AFrontEnd/css/bootstrap.css" rel="stylesheet" />
+    <link href="../../AFrontEnd/css/style.css" rel="stylesheet" />
+    <script>document.write("<link href='../../AFrontEnd/css/special.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
+    <style>
+        .func-item {
+            width: 100px;
+            height: 30px;
+            float: left;
+            border-radius: 5px;
+            margin: 0px 4px 8px 4px;
+            cursor: pointer;
+        }
+
+            .func-item .func-item-name {
+                width: 100%;
+                height: 30px;
+                text-align-last: justify;
+                text-align: justify;
+            }
+
+        tr.check {
+            background: #F9F9FA;
+        }
+    </style>
+</head>
+<body>
+    <div ng-controller="listCtrl as ctl" ng-cloak>
+        <div class="loading" ng-if="ctl.loading">
+            <div class="loading-msg">
+                <h3>数据捕获中,请等待</h3>
+                <div class="spinner">
+                    <div class="bounce1"></div>
+                    <div class="bounce2"></div>
+                    <div class="bounce3"></div>
+                </div>
+            </div>
+        </div>
+        <div class="wrapper wrapper-content">
+            <div class="row">
+                <div class="col-md-12">
+                    <div class="ibox float-e-margins">
+                        <div class="ibox-content">
+                            <div class="row">
+                                <div class="col-md-12">
+                                    <div class="sp-page">
+                                        <div class="sp-page-title" style="width:100px">归档台账</div>
+                                        <div class="sp-pull-right">
+                                            <a class="sp-pull-right sp-btn-gray sp-btn-radius" ng-click="ctl.refresh()">
+                                                <i class="fa fa-refresh sp-mr-5"></i>刷 新
+                                            </a>
+                                            <a class="sp-pull-right sp-btn-gray sp-btn-radius" ng-click="ctl.openSearchLayer()">
+                                                <i class="fa fa-search sp-mr-5"></i>查 询
+                                            </a>
+                                        </div>
+                                    </div>
+                                    <div class="sp-page">
+                                        <table class="sp-table sp-mt-10">
+                                            <thead>
+                                                <tr>
+                                                    <th width="50">序号</th>
+                                                    <th>题名</th>
+                                                    <th width="200">档案号</th>
+                                                    <th width="200">保管期限</th>
+                                                    <th width="200">文件日期</th>
+                                                    <th width="180">操 作</th>
+                                                </tr>
+                                            </thead>
+                                            <tbody>
+                                                <tr dir-paginate="item in ctl.list|itemsPerPage:ctl.itemsPerPage" total-items="ctl.total_count" ng-class="{'check':item.checked==true}" ng-click="ctl.changeCheck(item,2)">
+                                                    <td ng-bind="(ctl.pageno-1)*ctl.itemsPerPage+($index+1)"></td>
+                                                    <td>
+                                                        <a ng-click="ctl.Edit(item)" title="{{item.TITLE_PROPER}}"
+                                                           ng-bind="item.TITLE_PROPER" class="sp-color-blue"></a>
+                                                    </td>
+                                                    <td ng-bind="item.OFFICE_ARCHIVAL_CODE"></td>
+                                                    <td ng-bind="item.RETENTION_PERIOD"></td>
+                                                    <td ng-bind="item.DATE_OF_CREATION"></td>
+                                                    <td class="sp-text-center">
+                                                        <button class="sp-btn-blue sp-btn-sm sp-radius" ng-click="ctl.Edit(item)">编&nbsp;辑</button>
+                                                        <button class="sp-btn-red sp-btn-sm sp-radius" ng-click="ctl.Delete(item.ROUTEINFOID)">删&nbsp;除</button>
+                                                    </td>
+                                                </tr>
+                                            </tbody>
+                                        </table>
+                                        <div class="sp-table-tip ng-hide" ng-show="ctl.noDataTip == 0">
+                                            <i class="fa fa-exclamation-circle sp-mr-10"></i>您好,暂未查询到相关信息!
+                                        </div>
+                                        <div class="sp-page" ng-show="ctl.noDataTip != 0">
+                                            <div class="sp-page-col sp-pull-right">
+                                                <div class="sp-lh-34">
+                                                    每页 <select ng-model="ctl.itemsPerPage" ng-options="x for x in ctl.pageOptions"></select> 条
+                                                </div>
+                                            </div>
+                                            <div class="sp-page-col sp-pull-right">
+                                                <dir-pagination-controls max-size="8" direction-links="true" boundary-links="true"
+                                                                         on-page-change="ctl.getData(newPageNumber,ctl.type)">
+                                                </dir-pagination-controls>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="sp-layer" id="search" style="width:450px;">
+            <div class="sp-layer-head" style="background:#2176d6">
+                <div class="sp-page sp-text-center sp-font16">
+                    查&nbsp;&nbsp;询
+                    <div class="sp-layer-close" title="关闭" onclick="sp.closeCenter('.sp-layer')">
+                        ×
+                    </div>
+                </div>
+            </div>
+            <div class="sp-layer-body">
+                <div class="sp-box">
+                    <table class="sp-table">
+                        <tr>
+                            <td style="width:100px">标题</td>
+                            <td>
+                                <input type="text" class="sp-input" ng-model="ctl.search.title" />
+                            </td>
+                        </tr>
+                        <tr>
+                            <td style="width:100px">档案号</td>
+                            <td>
+                                <input type="text" class="sp-input" ng-model="ctl.search.dah" />
+                            </td>
+                        </tr>
+                    </table>
+                </div>
+                <div class="sp-page sp-text-center sp-pt-10">
+                    <a class="sp-btn-blue sp-radius" ng-click="ctl.btnSearch()"><i class="fa fa-check sp-mr-5"></i>确 认</a>
+                    <a class="sp-btn-blue sp-radius" ng-click="ctl.closeSeach()"><i class="fa fa-reply-all sp-mr-5"></i>重 置</a>
+                </div>
+            </div>
+        </div>
+    </div>
+    <script src="../../AFrontEnd/js/jquery/jquery-2.1.4.min.js"></script>
+    <script src="../../AFrontEnd/js/laydate/laydate.js"></script>
+    <script src="../../AFrontEnd/js/angularjs/angular.js"></script>
+    <script src="../../AFrontEnd/js/angularjs/dirPagination.js"></script>
+    <script src="../../apiurljs.js"></script>
+    <script src="../../js/sm4.js"></script>
+    <script>document.write('<scri' + 'pt src="../../AFrontEnd/js/special/special.js?time=' + new Date().getTime() + '" type="text/javascript"></s' + 'cript>')</script>
+    <script>document.write('<scri' + 'pt src="js/list.js?time=' + new Date().getTime() + '" type="text/javascript"></s' + 'cript>')</script>
+    <script src="../../AFrontEnd/js/special/spng.js"></script>
+    <script src="../../AFrontEnd/js/special/spngvld.js"></script>
+</body>
+</html>

+ 192 - 65
tpl/forward/yuguidang.html

@@ -11,6 +11,7 @@
     <link href="../../AFrontEnd/css/fontawesome/css/font-awesome.css" rel="stylesheet" />
     <link href="../../AFrontEnd/css/bootstrap.css" rel="stylesheet" />
     <link href="../../AFrontEnd/css/style.css" rel="stylesheet" />
+    <link href="../../AFrontEnd/js/jquery/jquery-ui.css" rel="stylesheet" />
     <script>document.write("<link href='../../AFrontEnd/css/special.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
     <script>document.write("<link href='../flowchart_app_imgcss/css/formedit.css?time=" + new Date().getTime() + "' rel='stylesheet'>");</script>
     <style>
@@ -24,133 +25,255 @@
     <div ng-controller="formeditCtrl as ctl" id="app" ng-cloak>
         <div class="wrapper wrapper-content">
             <div class="row">
-                <div class="col-md-4">
-                    <div>
-                        <span
-                            style="margin-top: 10px;margin-bottom: 10px;display: inline-block;width: 34px;height: 34px;line-height: 34px;text-align: center;border: 1px solid gray;border-radius: 50%;">1</span>
+                <div class="sp-page-col" style="position: absolute; right: 50px; top: 15px;" ng-if="ctl.lastReturn=='list'">
+                    <button class="sp-btn-blue sp-radius" ng-click="ctl.btnSave()" style="font-size: 13px;" ng-show="ctl.show==1">
+                        保存
+                    </button>
+                    <button class="sp-btn-blue sp-radius" ng-click="ctl.btnSaveFiles()" style="font-size: 13px;" ng-show="ctl.show==2">
+                        保存
+                    </button>
+                    <!--<button class="sp-btn-blue sp-btn-sm sp-radius" ng-click="ctl.goNext()" style="font-size: 13px;" ng-show="ctl.show==3">
+                        确定
+                    </button>-->
+                    <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-radius" ng-show="ctl.show==2" ng-click="ctl.show=1">
+                        上一步
+                    </button>
+                    <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-radius" ng-show="ctl.show==3" ng-click="ctl.show=2">
+                        上一步
+                    </button>
+                    <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-radius" ng-show="ctl.data.ID!=0&&ctl.show==1" ng-click="ctl.show=2">
+                        下一步
+                    </button>
+                    <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-radius" ng-show="ctl.data.ID!=0&&ctl.show==2" ng-click="ctl.MergeByFile()">
+                        合并文件
+                    </button>
+                    <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-radius" ng-click="ctl.goBack()">
+                        返回
+                    </button>
+                </div>
+                <div class="sp-page-center" ng-show="ctl.show==1">
+                    <center class="sp-page" style="position:relative">
+                        <span style="margin-top: 10px;margin-bottom: 10px;display: inline-block;width: 34px;height: 34px;line-height: 34px;text-align: center;border: 1px solid gray;border-radius: 50%;">1</span>
                         <span style="margin-left: 10px;">归档信息</span>
-                    </div>
-                    <table class="sp-table" style="border:none">
+                    </center>
+                    <table class="sp-table formedit" style="border:none">
                         <tr>
-                            <td>年&nbsp;&nbsp;度</td>
-                            <td colspan="3"><input type="text" class="sp-input laydate-logo" sp-laydate laytype="year"
-                                    ng-model="ctl.data.ARCHYEAR" /></td>
+                            <td width="150">全&nbsp;&nbsp;宗</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input" ng-model="ctl.data.FONDS_CODE" readonly />
+                            </td>
                         </tr>
                         <tr>
-                            <td>归档部门</td>
+                            <td>分类号</td>
                             <td colspan="3">
-                                <select class="sp-select" ng-model="ctl.data.ORGANIZATIONMA">
-                                    <option ng-repeat="item in ctl.GDBM" ng-bind="item.SECTION" value="{{item.CODE}}">
-                                    </option>
-                                </select>
+                                <input type="text" class="sp-input" ng-model="ctl.data.SERIES_CODE" />
                             </td>
                         </tr>
                         <tr>
-                            <td>保管期限</td>
+                            <td>文&nbsp;&nbsp;号</td>
                             <td colspan="3">
-                                <select class="sp-select" ng-model="ctl.data.MIJIQIXIAN">
-                                    <option value="10年">10年</option>
-                                    <option value="30年">30年</option>
-                                    <option value="永久">永久</option>
-                                </select>
+                                <input type="text" class="sp-input" ng-model="ctl.data.FILE_CODE" sp-required />
                             </td>
                         </tr>
                         <tr>
-                            <td>档案门类</td>
-                            <td colspan="3"><input type="text" class="sp-input" ng-model="ctl.data.DANGANML" readonly />
+                            <td>题&nbsp;&nbsp;名</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input" ng-model="ctl.data.TITLE_PROPER" sp-required />
                             </td>
                         </tr>
                         <tr>
-                            <td>文&nbsp;&nbsp;号</td>
-                            <td colspan="3"><input type="text" class="sp-input" ng-model="ctl.data.WENHAO" /></td>
+                            <td>文件日期</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input laydate-logp" sp-laydate ng-model="ctl.data.DATE_OF_CREATION" />
+                            </td>
                         </tr>
                         <tr>
-                            <td>题&nbsp;&nbsp;名</td>
+                            <td>OA接收ID</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input" ng-model="ctl.data.OA_ID" sp-required />
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>档案号</td>
                             <td colspan="3">
-                                <textarea class="sp-textarea" rows="2" style="resize:none"
-                                    ng-model="ctl.data.DOCTITLE"></textarea>
+                                <input type="text" class="sp-input" ng-model="ctl.data.OFFICE_ARCHIVAL_CODE" sp-required />
                             </td>
                         </tr>
                         <tr>
                             <td>责任者</td>
-                            <td colspan="3"><input type="text" class="sp-input" ng-model="ctl.data.ZRZ" /></td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input" ng-model="ctl.data.AUTHOR" />
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>页&nbsp;&nbsp;数</td>
+                            <td colspan="3">
+                                <input type="number" class="sp-input" ng-model="ctl.data.AMOUNT_OF_PAGES" />
+                            </td>
                         </tr>
                         <tr>
-                            <td>日&nbsp;&nbsp;期</td>
-                            <td colspan="3"><input type="text" class="sp-input laydate-logo" sp-laydate
-                                    ng-model="ctl.data.DOCISSUEDDATE" /></td>
+                            <td>年&nbsp;&nbsp;度</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input laydate-logp" sp-laydate laytype="year" ng-model="ctl.data.YEAR_CODE" sp-required />
+                            </td>
                         </tr>
                         <tr>
                             <td>件&nbsp;&nbsp;号</td>
-                            <td colspan="3"><input type="text" class="sp-input" ng-model="ctl.data.JIANHAO" readonly />
+                            <td colspan="3">
+                                <input type="number" class="sp-input" ng-model="ctl.data.ITEM_NO" />
                             </td>
                         </tr>
                         <tr>
-                            <td>页&nbsp;&nbsp;数</td>
-                            <td colspan="3"><input type="text" class="sp-input" ng-model="ctl.data.YESHU" /></td>
+                            <td>电子全文数</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input" ng-model="ctl.data.ITEM_COUNT" />
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>保管期限</td>
+                            <td colspan="3">
+                                <select class="sp-select" ng-model="ctl.data.RETENTION_PERIOD" sp-required>
+                                    <option value="10年">10年</option>
+                                    <option value="30年">30年</option>
+                                    <option value="永久">永久</option>
+                                </select>
+                            </td>
                         </tr>
                         <tr>
-                            <td>备&nbsp;&nbsp;注</td>
+                            <td>归档部门</td>
                             <td colspan="3">
-                                <textarea class="sp-textarea" rows="4" style="resize:none"
-                                    ng-model="ctl.data.BEIZHU"></textarea>
+                                <input type="text" class="sp-input" ng-model="ctl.data.FILING_DEPT" sp-required />
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>最终档案文件</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input" ng-model="ctl.data.FILENAME" />
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>归档章顶边距</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input" ng-model="ctl.data.ZHANGTOP" />
+                            </td>
+                        </tr>
+                        <tr>
+                            <td>归档章左边距	</td>
+                            <td colspan="3">
+                                <input type="text" class="sp-input" ng-model="ctl.data.ZHANGLEFT" />
+                            </td>
+                        </tr>
+                        <tr ng-if="!ctl.lastReturn">
+                            <td colspan="2">
+                                <button class="sp-btn-blue sp-btn-sm sp-radius" ng-click="ctl.btnSave()"style="font-size: 13px;">
+                                    保存
+                                </button>
+                                <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-btn-sm sp-radius" onclick="window.parent.sp.closeCenter('.sp-layer')">
+                                    关闭
+                                </button>
+                                <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-btn-sm sp-radius" ng-if="ctl.data.ID!=0" ng-click="ctl.show=2">
+                                    下一步
+                                </button>
                             </td>
                         </tr>
                     </table>
-                    <tr>
-                        <button class="sp-btn-blue sp-btn-sm sp-radius" ng-click="ctl.btnSave('0')"
-                            style="margin-left: 36%;margin-top: 20px;font-size: 13px;">更新</button>
-                        <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-btn-sm sp-radius"
-                            ng-click="ctl.createGuidang()">生成归档目录</button>
-                    </tr>
                 </div>
-                <div class="col-md-4">
-                    <div>
-                        <span
-                            style="margin-top: 10px;margin-bottom: 10px;display: inline-block;width: 34px;height: 34px;line-height: 34px;text-align: center;border: 1px solid gray;border-radius: 50%;">2</span>
+                <div class="sp-box" ng-show="ctl.show==2">
+                    <center class="sp-page">
+                        <span style="margin-top: 10px;margin-bottom: 10px;display: inline-block;width: 34px;height: 34px;line-height: 34px;text-align: center;border: 1px solid gray;border-radius: 50%;">2</span>
                         <span style="margin-left: 10px;">归档目录</span>
+                    </center>
+                    <div style="width: 100%;height: 300px;overflow:auto">
+                        <table class="sp-table">
+                            <thead>
+                                <tr>
+                                    <th width="100">序号</th>
+                                    <th>文件名</th>
+                                    <th width="150">日期</th>
+                                    <th width="200">
+                                        操作
+                                        <span style="display:inline-block;top:0" class="upload sp-pull-right sp-ml-5">
+                                            <span class="upload-tip"></span>
+                                            <input id="fileupload" class="upload-file-single" ng-click="ctl.upload();$event.stopPropagation();" type="file" name="files[]" multiple>
+                                            <i class="fa fa-plus sp-fs-14 sp-mr-10"></i>
+                                            <span class="upload-loading" ng-if="ctl.uploading"><i class="fa fa-spinner fa-pulse sp-fs-20"></i></span>
+                                        </span>
+                                    </th>
+                                </tr>
+                            </thead>
+                            <tbody id="table_tbody">
+                                <tr ng-repeat="item in ctl.guidangList" index="{{$index+1}}" data-col="{{item.ID}}">
+                                    <td ng-bind="$index+1"></td>
+                                    <td ng-bind="item.FILENAMES"></td>
+                                    <td ng-bind="item.FILEDATE"></td>
+                                    <td>
+                                        <button class="sp-btn-blue sp-btn-sm" ng-if="ctl.guidangList.length>1" ng-disabled="$index==0" ng-click="ctl.sortUp($index)">上移</button>
+                                        <button class="sp-btn-blue sp-btn-sm" ng-if="ctl.guidangList.length>1" ng-disabled="$index==ctl.guidangList.length-1" ng-click="ctl.sortDown($index)">下移</button>
+                                        <button class="sp-btn-red sp-btn-sm" ng-click="ctl.delFile(item)">移除</button>
+                                    </td>
+                                </tr>
+                            </tbody>
+                        </table>
                     </div>
-                    <div style="width: 100%;height: 620px;overflow:auto">
+                    <div style="width: 100%;height: 300px;overflow:auto">
                         <table class="sp-table">
                             <thead>
                                 <tr>
-                                    <th>序号</th>
-                                    <th>责任者</th>
-                                    <th>文号</th>
+                                    <th width="100">序号</th>
                                     <th>文件名</th>
-                                    <th>日期</th>
-                                    <th>页数</th>
-                                    <th>备注</th>
+                                    <th width="150">日期</th>
+                                    <th width="200">操作</th>
                                 </tr>
                             </thead>
                             <tbody>
-                                <tr ng-repeat="item in ctl.guidangList" style="cursor:pointer" ng-click="ctl.searchFiles(item)">
-                                    <td ng-bind="item.XH"></td>
-                                    <td ng-bind="item.ZERENMAN"></td>
-                                    <td ng-bind="item.WENHAO"></td>
+                                <tr ng-repeat="item in ctl.fileList" ng-if="item.show">
+                                    <td ng-bind="$index+1"></td>
                                     <td ng-bind="item.WENJIANMING"></td>
                                     <td ng-bind="item.RIQI"></td>
-                                    <td ng-bind="item.YESHU"></td>
-                                    <td ng-bind="item.REMARK"></td>
+                                    <td>
+                                        <span class="sp-btn-blue sp-btn-sm" ng-click="ctl.addFile(item)">添加</span>
+                                    </td>
                                 </tr>
                             </tbody>
                         </table>
                     </div>
+                    <center ng-if="!ctl.lastReturn">
+                        <button class="sp-btn-blue sp-btn-sm sp-radius" ng-click="ctl.btnSaveFiles()" style="font-size: 13px;">
+                            保存
+                        </button>
+                        <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-btn-sm sp-radius" onclick="window.parent.sp.closeCenter('.sp-layer')">
+                            关闭
+                        </button>
+                        <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-btn-sm sp-radius" ng-click="ctl.show=1">
+                            上一步
+                        </button>
+                    </center>
                 </div>
-                <div class="col-md-4">
-                    <div>
-                        <span
-                            style="margin-top: 10px;margin-bottom: 10px;display: inline-block;width: 34px;height: 34px;line-height: 34px;text-align: center;border: 1px solid gray;border-radius: 50%;">3</span>
+                <div class="sp-box" ng-show="ctl.show==3">
+                    <center class="sp-page">
+                        <span style="margin-top: 10px;margin-bottom: 10px;display: inline-block;width: 34px;height: 34px;line-height: 34px;text-align: center;border: 1px solid gray;border-radius: 50%;">3</span>
                         <span style="margin-left: 10px;">查看文件</span>
-                    </div>
+                    </center>
                     <div style="width: 100%;height: 620px;">
                         <iframe src="" frameborder="0" style="width:100%;height:100%" id="filesId"></iframe>
                     </div>
+                    <center ng-if="!ctl.lastReturn">
+                        <button class="sp-btn-blue sp-btn-sm sp-radius" ng-click="ctl.goNext()" style="font-size: 13px;">
+                            确定
+                        </button>
+                        <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-btn-sm sp-radius" onclick="window.parent.sp.closeCenter('.sp-layer')">
+                            关闭
+                        </button>
+                        <button style="margin-left: 20px;font-size: 13px;" class="sp-btn-blue sp-btn-sm sp-radius" ng-click="ctl.show=2">
+                            上一步
+                        </button>
+                    </center>
                 </div>
             </div>
         </div>
     </div>
     <script src="../../AFrontEnd/js/jquery/jquery-2.1.4.min.js"></script>
+    <script src="../../AFrontEnd/js/jquery/jquery-ui-1.10.4.min.js"></script>
     <script src="../../AFrontEnd/js/laydate/laydate.js"></script>
     <script src="../../AFrontEnd/js/angularjs/angular.js"></script>
     <script src="../../AFrontEnd/js/angularjs/dirPagination.js"></script>
@@ -161,6 +284,10 @@
     <!--<script src="../../js/watermark.js"></script>-->
     <script src="../../AFrontEnd/js/special/spng.js"></script>
     <script src="../../AFrontEnd/js/special/spngvld.js"></script>
+    <!--附件-->
+    <script src="../../AFrontEnd/plugins/js.fileupload/vendor/jquery.ui.widget.js"></script>
+    <script src="../../AFrontEnd/plugins/js.fileupload/jquery.iframe-transport.js"></script>
+    <script src="../../AFrontEnd/plugins/js.fileupload/jquery.fileupload.js"></script>
 </body>
 
 </html>