浏览代码

2.1.0 变更令版本no.1 up

likeku 7 年之前
父节点
当前提交
a46be79d90
共有 73 个文件被更改,包括 25457 次插入103 次删除
  1. 221 0
      201to210.sql
  2. 23 0
      global/css/assets/styles.css
  3. 184 0
      global/css/dataTables.bootstrap.css
  4. 1 0
      global/css/dataTables.bootstrap.min.css
  5. 1 0
      global/css/fixedColumns.bootstrap.min.css
  6. 14 0
      global/css/style.css
  7. 233 0
      global/css/toastr.css
  8. 二进制
      global/css/ztree/img/diy/1_close.png
  9. 二进制
      global/css/ztree/img/diy/1_open.png
  10. 二进制
      global/css/ztree/img/diy/2.png
  11. 二进制
      global/css/ztree/img/diy/3.png
  12. 二进制
      global/css/ztree/img/diy/4.png
  13. 二进制
      global/css/ztree/img/diy/5.png
  14. 二进制
      global/css/ztree/img/diy/6.png
  15. 二进制
      global/css/ztree/img/diy/7.png
  16. 二进制
      global/css/ztree/img/diy/8.png
  17. 二进制
      global/css/ztree/img/diy/9.png
  18. 二进制
      global/css/ztree/img/line_conn.gif
  19. 二进制
      global/css/ztree/img/loading.gif
  20. 二进制
      global/css/ztree/img/zTreeStandard.gif
  21. 二进制
      global/css/ztree/img/zTreeStandard.png
  22. 97 0
      global/css/ztree/zTreeStyle.css
  23. 2 0
      global/js/SimpleAjaxUploader.min.js
  24. 182 0
      global/js/dataTables.bootstrap.js
  25. 8 0
      global/js/dataTables.bootstrap.min.js
  26. 35 0
      global/js/dataTables.fixedColumns.min.js
  27. 2 0
      global/js/jl.js
  28. 711 0
      global/js/jlzf-change-new.js
  29. 1 0
      global/js/jlzf-change-new.min.js
  30. 108 0
      global/js/jlzf-change-pnumset.js
  31. 11 0
      global/js/jlzf-change-table.js
  32. 717 0
      global/js/jlzf-change-update.js
  33. 1 0
      global/js/jlzf-change-update.min.js
  34. 15345 0
      global/js/jquery.dataTables.js
  35. 167 0
      global/js/jquery.dataTables.min.js
  36. 7 0
      global/js/toastr.min.js
  37. 1913 0
      global/js/ztree/jquery.ztree.core.js
  38. 628 0
      global/js/ztree/jquery.ztree.excheck.js
  39. 214 3
      jlweb201.sql
  40. 307 0
      protected/class/change.php
  41. 303 0
      protected/class/extras/Uploader.php
  42. 34 0
      protected/class/extras/cors.php
  43. 45 0
      protected/class/extras/sessionProgress.php
  44. 44 0
      protected/class/extras/uploadProgress.php
  45. 4 0
      protected/class/measureauditact.php
  46. 5 0
      protected/class/profile.php
  47. 2 1
      protected/config/acl.conf.php
  48. 28 0
      protected/config/routes.conf.php
  49. 1 1
      protected/config/ver.conf.php
  50. 1529 0
      protected/controller/ChangeController.php
  51. 91 1
      protected/controller/ClientController.php
  52. 7 1
      protected/controller/ProjectController.php
  53. 7 1
      protected/controller/RProjectController.php
  54. 6 1
      protected/controller/SProjectController.php
  55. 6 1
      protected/controller/SignController.php
  56. 6 1
      protected/controller/UserController.php
  57. 46 0
      protected/model/change.php
  58. 31 0
      protected/model/changeatt.php
  59. 110 0
      protected/model/changeaudit.php
  60. 35 0
      protected/model/changeauditlist.php
  61. 24 0
      protected/model/changecompany.php
  62. 42 0
      protected/model/changelist.php
  63. 15 11
      protected/module/admin/view/admin-userlist.html
  64. 6 1
      protected/plugin/TemplateTag.php
  65. 467 0
      protected/view/biangeng-approval.html
  66. 43 0
      protected/view/biangeng-dealbills.html
  67. 220 0
      protected/view/biangeng-detail.html
  68. 436 0
      protected/view/biangeng-new.html
  69. 210 0
      protected/view/biangeng-poj.html
  70. 515 0
      protected/view/biangeng-update.html
  71. 2 1
      protected/view/left.html
  72. 4 4
      protected/view/sign-list-need_sign.html
  73. 0 75
      protected/viewc/sign-list-need_sign.php

+ 221 - 0
201to210.sql

@@ -0,0 +1,221 @@
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change`
+--
+
+CREATE TABLE `jl_change` (
+  `cid` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '对应的标段id',
+  `uid` int(11) NOT NULL COMMENT '创建人id',
+  `pnum` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '申请编号',
+  `pname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '工程名称',
+  `mnum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '桩号',
+  `odname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '原设计图名称',
+  `onum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '原图号',
+  `cdname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更设计图名称',
+  `cnum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更图号',
+  `description` text COLLATE utf8_unicode_ci NOT NULL COMMENT '工程变更理由及内容',
+  `basis` text COLLATE utf8_unicode_ci NOT NULL COMMENT '工程变更合同依据',
+  `remarks` varchar(5000) COLLATE utf8_unicode_ci NOT NULL COMMENT '备注',
+  `ctype` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更类型,以逗号分隔',
+  `category` tinyint(4) NOT NULL COMMENT '变更类别',
+  `cnature` tinyint(4) NOT NULL COMMENT '变更性质',
+  `companyid` int(11) NOT NULL COMMENT '变更提出单位',
+  `bear` tinyint(4) NOT NULL COMMENT '费用承担方,1为业主,2为承包方',
+  `totalamount` double UNSIGNED NOT NULL COMMENT '变更总金额',
+  `times` tinyint(4) NOT NULL DEFAULT '0' COMMENT '次数',
+  `status` enum('uncheck','checking','checked','checkno','back') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'uncheck' COMMENT '变更令状态',
+  `intime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '添加时间',
+  `cintime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更状态发生时间',
+  `sintime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '完成审批时间'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更令信息表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_attachment`
+--
+
+CREATE TABLE `jl_change_attachment` (
+  `id` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '标段id',
+  `cid` int(11) NOT NULL COMMENT '对应于变更令id',
+  `uid` int(11) NOT NULL COMMENT '上传者id',
+  `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件名称',
+  `fileext` varchar(5) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件后缀',
+  `filesize` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件大小',
+  `filepath` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件存储路径',
+  `intime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '添加时间'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更令附件表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_audit`
+--
+
+CREATE TABLE `jl_change_audit` (
+  `id` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '标段id',
+  `cid` int(11) NOT NULL COMMENT '对应于变更表id',
+  `times` tinyint(4) NOT NULL COMMENT '次数',
+  `usite` tinyint(4) NOT NULL COMMENT '审批顺序,0为提交人',
+  `usort` int(11) NOT NULL COMMENT '排序',
+  `uid` int(11) NOT NULL COMMENT '审批人id',
+  `company` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '所属单位',
+  `jobs` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '职称',
+  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '审批人名字',
+  `status` enum('uncheck','checking','checked','checkno','back','backnew') COLLATE utf8_unicode_ci NOT NULL COMMENT '审批状态',
+  `sdesc` varchar(1000) COLLATE utf8_unicode_ci NOT NULL COMMENT '审批意见',
+  `sintime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '审批时间',
+  `list_json` text COLLATE utf8_unicode_ci NOT NULL COMMENT '填写的变更数量清单json'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更令审批表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_audit_list`
+--
+
+CREATE TABLE `jl_change_audit_list` (
+  `id` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '标段id',
+  `cid` int(11) NOT NULL COMMENT '对应于变更表id',
+  `lid` int(11) NOT NULL COMMENT '对应于签约清单里的id,新增添加的清单为0',
+  `lnum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '清单编号',
+  `lname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称',
+  `unit` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '单位',
+  `unitprice` float NOT NULL COMMENT '单价',
+  `oamount` float NOT NULL COMMENT '原数量',
+  `camount` float NOT NULL COMMENT '变更数量',
+  `samount` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '审批变更后数量',
+  `auditjson` varchar(5000) COLLATE utf8_unicode_ci NOT NULL COMMENT '用户变更json数据'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更用户申报清单关联表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_company`
+--
+
+CREATE TABLE `jl_change_company` (
+  `id` int(11) NOT NULL,
+  `cid` int(11) NOT NULL COMMENT '对应的变更令id',
+  `name` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称',
+  `csort` int(11) NOT NULL COMMENT '排序'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更令单位表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_list`
+--
+
+CREATE TABLE `jl_change_list` (
+  `id` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '标段id',
+  `lnum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '清单编号',
+  `lname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称',
+  `unit` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '单位',
+  `unitprice` float NOT NULL COMMENT '单价',
+  `amount` float NOT NULL COMMENT '数量'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='签约清单表';
+
+--
+-- Indexes for dumped tables
+--
+
+--
+-- Indexes for table `jl_change`
+--
+ALTER TABLE `jl_change`
+  ADD PRIMARY KEY (`cid`),
+  ADD KEY `status` (`status`),
+  ADD KEY `pmid` (`pmid`);
+
+--
+-- Indexes for table `jl_change_attachment`
+--
+ALTER TABLE `jl_change_attachment`
+  ADD PRIMARY KEY (`id`),
+  ADD KEY `cid` (`cid`),
+  ADD KEY `uid` (`uid`);
+
+--
+-- Indexes for table `jl_change_audit`
+--
+ALTER TABLE `jl_change_audit`
+  ADD PRIMARY KEY (`id`),
+  ADD KEY `cid` (`cid`),
+  ADD KEY `uid` (`uid`);
+
+--
+-- Indexes for table `jl_change_audit_list`
+--
+ALTER TABLE `jl_change_audit_list`
+  ADD PRIMARY KEY (`id`);
+
+--
+-- Indexes for table `jl_change_company`
+--
+ALTER TABLE `jl_change_company`
+  ADD PRIMARY KEY (`id`);
+
+--
+-- Indexes for table `jl_change_list`
+--
+ALTER TABLE `jl_change_list`
+  ADD PRIMARY KEY (`id`),
+  ADD KEY `pid` (`pid`),
+  ADD KEY `stid` (`stid`),
+  ADD KEY `pmid` (`pmid`);
+
+--
+-- 在导出的表使用AUTO_INCREMENT
+--
+
+--
+-- 使用表AUTO_INCREMENT `jl_change`
+--
+ALTER TABLE `jl_change`
+  MODIFY `cid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_attachment`
+--
+ALTER TABLE `jl_change_attachment`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_audit`
+--
+ALTER TABLE `jl_change_audit`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_audit_list`
+--
+ALTER TABLE `jl_change_audit_list`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_company`
+--
+ALTER TABLE `jl_change_company`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_list`
+--
+ALTER TABLE `jl_change_list`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;COMMIT;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

+ 23 - 0
global/css/assets/styles.css

@@ -0,0 +1,23 @@
+.container {
+    width: auto;
+    max-width: 680px;
+    padding: 0 15px;
+}
+
+.progress {
+    margin-bottom:0;
+    margin-top:6px;
+    margin-left:10px;
+}
+
+.btn.focus {
+    outline:thin dotted #333;
+    outline:5px auto -webkit-focus-ring-color;
+    outline-offset:-2px;
+}
+
+.btn.hover {
+    color:#ffffff;
+    background-color:#3276b1;
+    border-color:#285e8e;
+}

+ 184 - 0
global/css/dataTables.bootstrap.css

@@ -0,0 +1,184 @@
+table.dataTable {
+  clear: both;
+  margin-top: 6px !important;
+  margin-bottom: 6px !important;
+  max-width: none !important;
+  border-collapse: separate !important;
+}
+table.dataTable td,
+table.dataTable th {
+  -webkit-box-sizing: content-box;
+  box-sizing: content-box;
+}
+table.dataTable td.dataTables_empty,
+table.dataTable th.dataTables_empty {
+  text-align: center;
+}
+table.dataTable.nowrap th,
+table.dataTable.nowrap td {
+  white-space: nowrap;
+}
+
+div.dataTables_wrapper div.dataTables_length label {
+  font-weight: normal;
+  text-align: left;
+  white-space: nowrap;
+}
+div.dataTables_wrapper div.dataTables_length select {
+  width: 75px;
+  display: inline-block;
+}
+div.dataTables_wrapper div.dataTables_filter {
+  text-align: right;
+}
+div.dataTables_wrapper div.dataTables_filter label {
+  font-weight: normal;
+  white-space: nowrap;
+  text-align: left;
+}
+div.dataTables_wrapper div.dataTables_filter input {
+  margin-left: 0.5em;
+  display: inline-block;
+  width: auto;
+}
+div.dataTables_wrapper div.dataTables_info {
+  padding-top: 8px;
+  white-space: nowrap;
+}
+div.dataTables_wrapper div.dataTables_paginate {
+  margin: 0;
+  white-space: nowrap;
+  text-align: right;
+}
+div.dataTables_wrapper div.dataTables_paginate ul.pagination {
+  margin: 2px 0;
+  white-space: nowrap;
+}
+div.dataTables_wrapper div.dataTables_processing {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  width: 200px;
+  margin-left: -100px;
+  margin-top: -26px;
+  text-align: center;
+  padding: 1em 0;
+}
+
+table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting,
+table.dataTable thead > tr > td.sorting_asc,
+table.dataTable thead > tr > td.sorting_desc,
+table.dataTable thead > tr > td.sorting {
+  padding-right: 30px;
+}
+table.dataTable thead > tr > th:active,
+table.dataTable thead > tr > td:active {
+  outline: none;
+}
+table.dataTable thead .sorting,
+table.dataTable thead .sorting_asc,
+table.dataTable thead .sorting_desc,
+table.dataTable thead .sorting_asc_disabled,
+table.dataTable thead .sorting_desc_disabled {
+  cursor: pointer;
+  position: relative;
+}
+table.dataTable thead .sorting:after,
+table.dataTable thead .sorting_asc:after,
+table.dataTable thead .sorting_desc:after,
+table.dataTable thead .sorting_asc_disabled:after,
+table.dataTable thead .sorting_desc_disabled:after {
+  position: absolute;
+  bottom: 8px;
+  right: 8px;
+  display: block;
+  font-family: 'Glyphicons Halflings';
+  opacity: 0.5;
+}
+table.dataTable thead .sorting:after {
+  opacity: 0.2;
+  content: "\e150";
+  /* sort */
+}
+table.dataTable thead .sorting_asc:after {
+  content: "\e155";
+  /* sort-by-attributes */
+}
+table.dataTable thead .sorting_desc:after {
+  content: "\e156";
+  /* sort-by-attributes-alt */
+}
+table.dataTable thead .sorting_asc_disabled:after,
+table.dataTable thead .sorting_desc_disabled:after {
+  color: #eee;
+}
+
+div.dataTables_scrollHead table.dataTable {
+  margin-bottom: 0 !important;
+}
+
+div.dataTables_scrollBody > table {
+  border-top: none;
+  margin-top: 0 !important;
+  margin-bottom: 0 !important;
+}
+div.dataTables_scrollBody > table > thead .sorting:after,
+div.dataTables_scrollBody > table > thead .sorting_asc:after,
+div.dataTables_scrollBody > table > thead .sorting_desc:after {
+  display: none;
+}
+div.dataTables_scrollBody > table > tbody > tr:first-child > th,
+div.dataTables_scrollBody > table > tbody > tr:first-child > td {
+  border-top: none;
+}
+
+div.dataTables_scrollFoot > table {
+  margin-top: 0 !important;
+  border-top: none;
+}
+
+@media screen and (max-width: 767px) {
+  div.dataTables_wrapper div.dataTables_length,
+  div.dataTables_wrapper div.dataTables_filter,
+  div.dataTables_wrapper div.dataTables_info,
+  div.dataTables_wrapper div.dataTables_paginate {
+    text-align: center;
+  }
+}
+table.dataTable.table-condensed > thead > tr > th {
+  padding-right: 20px;
+}
+table.dataTable.table-condensed .sorting:after,
+table.dataTable.table-condensed .sorting_asc:after,
+table.dataTable.table-condensed .sorting_desc:after {
+  top: 6px;
+  right: 6px;
+}
+
+table.table-bordered.dataTable th,
+table.table-bordered.dataTable td {
+  border-left-width: 0;
+}
+table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child,
+table.table-bordered.dataTable td:last-child,
+table.table-bordered.dataTable td:last-child {
+  border-right-width: 0;
+}
+table.table-bordered.dataTable tbody th,
+table.table-bordered.dataTable tbody td {
+  border-bottom-width: 0;
+}
+
+div.dataTables_scrollHead table.table-bordered {
+  border-bottom-width: 0;
+}
+
+div.table-responsive > div.dataTables_wrapper > div.row {
+  margin: 0;
+}
+div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:first-child {
+  padding-left: 0;
+}
+div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:last-child {
+  padding-right: 0;
+}

文件差异内容过多而无法显示
+ 1 - 0
global/css/dataTables.bootstrap.min.css


文件差异内容过多而无法显示
+ 1 - 0
global/css/fixedColumns.bootstrap.min.css


+ 14 - 0
global/css/style.css

@@ -195,6 +195,9 @@ div.userInfo .btn-group .dropdown-menu{
   background:#f7f7f7;
   color:#666
 }
+.proSection{
+  margin:10px;
+}
 .project .proSection{
   margin:0 0 50px 0;
 }
@@ -1056,6 +1059,13 @@ left:5px
   border-right:1px solid #ddd;
   box-sizing: border-box;
 }
+.bg-content {
+  border-right:none;
+  border-left:1px solid #ddd;
+  background:#fff;
+  overflow-x: hidden;
+  overflow-y: auto;
+}
 .sign-content .page{
   margin:0 auto;
   width:1085px;
@@ -1226,3 +1236,7 @@ left:5px
   background-repeat: repeat-x;
   filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ccc', endColorstr='#bbb', GradientType=0);
 }
+
+.alert-pnone{
+  padding:0 15px !important;
+}

文件差异内容过多而无法显示
+ 233 - 0
global/css/toastr.css


二进制
global/css/ztree/img/diy/1_close.png


二进制
global/css/ztree/img/diy/1_open.png


二进制
global/css/ztree/img/diy/2.png


二进制
global/css/ztree/img/diy/3.png


二进制
global/css/ztree/img/diy/4.png


二进制
global/css/ztree/img/diy/5.png


二进制
global/css/ztree/img/diy/6.png


二进制
global/css/ztree/img/diy/7.png


二进制
global/css/ztree/img/diy/8.png


二进制
global/css/ztree/img/diy/9.png


二进制
global/css/ztree/img/line_conn.gif


二进制
global/css/ztree/img/loading.gif


二进制
global/css/ztree/img/zTreeStandard.gif


二进制
global/css/ztree/img/zTreeStandard.png


+ 97 - 0
global/css/ztree/zTreeStyle.css

@@ -0,0 +1,97 @@
+/*-------------------------------------
+zTree Style
+
+version:	3.5.19
+author:		Hunter.z
+email:		hunter.z@263.net
+website:	http://code.google.com/p/jquerytree/
+
+-------------------------------------*/
+
+.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif}
+.ztree {margin:0; padding:5px; color:#333}
+.ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0}
+.ztree li ul{ margin:0; padding:0 0 0 18px}
+.ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;}
+
+.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent;
+	text-decoration:none; vertical-align:top; display: inline-block}
+.ztree li a:hover {text-decoration:underline}
+.ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;}
+.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;}
+.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid;
+	opacity:0.8; filter:alpha(opacity=80)}
+.ztree li a.tmpTargetNode_prev {}
+.ztree li a.tmpTargetNode_next {}
+.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0;
+	font-size:12px; border:1px #7EC4CC solid; *border:0px}
+.ztree li span {line-height:16px; margin-right:2px}
+.ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle;
+	border:0 none; cursor: pointer;outline:none;
+	background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
+	background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")}
+
+.ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto}
+.ztree li span.button.chk.checkbox_false_full {background-position:0 0}
+.ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px}
+.ztree li span.button.chk.checkbox_false_part {background-position:0 -28px}
+.ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px}
+.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px}
+.ztree li span.button.chk.checkbox_true_full {background-position:-14px 0}
+.ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px}
+.ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px}
+.ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px}
+.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px}
+.ztree li span.button.chk.radio_false_full {background-position:-28px 0}
+.ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px}
+.ztree li span.button.chk.radio_false_part {background-position:-28px -28px}
+.ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px}
+.ztree li span.button.chk.radio_false_disable {background-position:-28px -56px}
+.ztree li span.button.chk.radio_true_full {background-position:-42px 0}
+.ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px}
+.ztree li span.button.chk.radio_true_part {background-position:-42px -28px}
+.ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px}
+.ztree li span.button.chk.radio_true_disable {background-position:-42px -56px}
+
+.ztree li span.button.switch {width:18px; height:18px}
+.ztree li span.button.root_open{background-position:-92px -54px}
+.ztree li span.button.root_close{background-position:-74px -54px}
+.ztree li span.button.roots_open{background-position:-92px 0}
+.ztree li span.button.roots_close{background-position:-74px 0}
+.ztree li span.button.center_open{background-position:-92px -18px}
+.ztree li span.button.center_close{background-position:-74px -18px}
+.ztree li span.button.bottom_open{background-position:-92px -36px}
+.ztree li span.button.bottom_close{background-position:-74px -36px}
+.ztree li span.button.noline_open{background-position:-92px -72px}
+.ztree li span.button.noline_close{background-position:-74px -72px}
+.ztree li span.button.root_docu{ background:none;}
+.ztree li span.button.roots_docu{background-position:-56px 0}
+.ztree li span.button.center_docu{background-position:-56px -18px}
+.ztree li span.button.bottom_docu{background-position:-56px -36px}
+.ztree li span.button.noline_docu{ background:none;}
+
+.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle}
+.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle}
+.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle}
+.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle}
+.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle}
+
+.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
+
+ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)}
+
+span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute;
+	background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
+	background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")}
+
+ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)}
+.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
+
+/* level style*/
+/*.ztree li span.button.level0 {
+	display:none;
+}
+.ztree li ul.level0 {
+	padding:0;
+	background:none;
+}*/

文件差异内容过多而无法显示
+ 2 - 0
global/js/SimpleAjaxUploader.min.js


+ 182 - 0
global/js/dataTables.bootstrap.js

@@ -0,0 +1,182 @@
+/*! DataTables Bootstrap 3 integration
+ * ©2011-2015 SpryMedia Ltd - datatables.net/license
+ */
+
+/**
+ * DataTables integration for Bootstrap 3. This requires Bootstrap 3 and
+ * DataTables 1.10 or newer.
+ *
+ * This file sets the defaults and adds options to DataTables to style its
+ * controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
+ * for further information.
+ */
+(function( factory ){
+	if ( typeof define === 'function' && define.amd ) {
+		// AMD
+		define( ['jquery', 'datatables.net'], function ( $ ) {
+			return factory( $, window, document );
+		} );
+	}
+	else if ( typeof exports === 'object' ) {
+		// CommonJS
+		module.exports = function (root, $) {
+			if ( ! root ) {
+				root = window;
+			}
+
+			if ( ! $ || ! $.fn.dataTable ) {
+				// Require DataTables, which attaches to jQuery, including
+				// jQuery if needed and have a $ property so we can access the
+				// jQuery object that is used
+				$ = require('datatables.net')(root, $).$;
+			}
+
+			return factory( $, root, root.document );
+		};
+	}
+	else {
+		// Browser
+		factory( jQuery, window, document );
+	}
+}(function( $, window, document, undefined ) {
+'use strict';
+var DataTable = $.fn.dataTable;
+
+
+/* Set the defaults for DataTables initialisation */
+$.extend( true, DataTable.defaults, {
+	dom:
+		"<'row'<'col-sm-6'l><'col-sm-6'f>>" +
+		"<'row'<'col-sm-12'tr>>" +
+		"<'row'<'col-sm-5'i><'col-sm-7'p>>",
+	renderer: 'bootstrap'
+} );
+
+
+/* Default class modification */
+$.extend( DataTable.ext.classes, {
+	sWrapper:      "dataTables_wrapper form-inline dt-bootstrap",
+	sFilterInput:  "form-control input-sm",
+	sLengthSelect: "form-control input-sm",
+	sProcessing:   "dataTables_processing panel panel-default"
+} );
+
+
+/* Bootstrap paging button renderer */
+DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
+	var api     = new DataTable.Api( settings );
+	var classes = settings.oClasses;
+	var lang    = settings.oLanguage.oPaginate;
+	var aria = settings.oLanguage.oAria.paginate || {};
+	var btnDisplay, btnClass, counter=0;
+
+	var attach = function( container, buttons ) {
+		var i, ien, node, button;
+		var clickHandler = function ( e ) {
+			e.preventDefault();
+			if ( !$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action ) {
+				api.page( e.data.action ).draw( 'page' );
+			}
+		};
+
+		for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
+			button = buttons[i];
+
+			if ( $.isArray( button ) ) {
+				attach( container, button );
+			}
+			else {
+				btnDisplay = '';
+				btnClass = '';
+
+				switch ( button ) {
+					case 'ellipsis':
+						btnDisplay = '&#x2026;';
+						btnClass = 'disabled';
+						break;
+
+					case 'first':
+						btnDisplay = lang.sFirst;
+						btnClass = button + (page > 0 ?
+							'' : ' disabled');
+						break;
+
+					case 'previous':
+						btnDisplay = lang.sPrevious;
+						btnClass = button + (page > 0 ?
+							'' : ' disabled');
+						break;
+
+					case 'next':
+						btnDisplay = lang.sNext;
+						btnClass = button + (page < pages-1 ?
+							'' : ' disabled');
+						break;
+
+					case 'last':
+						btnDisplay = lang.sLast;
+						btnClass = button + (page < pages-1 ?
+							'' : ' disabled');
+						break;
+
+					default:
+						btnDisplay = button + 1;
+						btnClass = page === button ?
+							'active' : '';
+						break;
+				}
+
+				if ( btnDisplay ) {
+					node = $('<li>', {
+							'class': classes.sPageButton+' '+btnClass,
+							'id': idx === 0 && typeof button === 'string' ?
+								settings.sTableId +'_'+ button :
+								null
+						} )
+						.append( $('<a>', {
+								'href': '#',
+								'aria-controls': settings.sTableId,
+								'aria-label': aria[ button ],
+								'data-dt-idx': counter,
+								'tabindex': settings.iTabIndex
+							} )
+							.html( btnDisplay )
+						)
+						.appendTo( container );
+
+					settings.oApi._fnBindAction(
+						node, {action: button}, clickHandler
+					);
+
+					counter++;
+				}
+			}
+		}
+	};
+
+	// IE9 throws an 'unknown error' if document.activeElement is used
+	// inside an iframe or frame. 
+	var activeEl;
+
+	try {
+		// Because this approach is destroying and recreating the paging
+		// elements, focus is lost on the select button which is bad for
+		// accessibility. So we want to restore focus once the draw has
+		// completed
+		activeEl = $(host).find(document.activeElement).data('dt-idx');
+	}
+	catch (e) {}
+
+	attach(
+		$(host).empty().html('<ul class="pagination"/>').children('ul'),
+		buttons
+	);
+
+	if ( activeEl !== undefined ) {
+		$(host).find( '[data-dt-idx='+activeEl+']' ).focus();
+	}
+};
+
+
+return DataTable;
+}));

文件差异内容过多而无法显示
+ 8 - 0
global/js/dataTables.bootstrap.min.js


文件差异内容过多而无法显示
+ 35 - 0
global/js/dataTables.fixedColumns.min.js


+ 2 - 0
global/js/jl.js

@@ -16,6 +16,8 @@ function autoFlashHeight() {
     $(".sign-content-warp").height($(window).height() - 30);
     $(".sign-content-warp").width($(window).width());
     $(".signed-list").height($(window).height()-viewInfo-btnBar-140);
+    $(".ztree").height($(window).height()-$('.sign-title-height').height()-$('.wrapHeader').height()-6);
+    $(".ztree").css("overflow","auto");
 };
 $(window).resize(autoFlashHeight);
 

文件差异内容过多而无法显示
+ 711 - 0
global/js/jlzf-change-new.js


文件差异内容过多而无法显示
+ 1 - 0
global/js/jlzf-change-new.min.js


+ 108 - 0
global/js/jlzf-change-pnumset.js

@@ -0,0 +1,108 @@
+$(function(){
+    //重置申请编号
+    $('#resetnumber').click(function(){
+        $('#pnum').val($(this).attr('data-num'));
+        toastr.success('已重置申请编号');
+    });
+    //设置自动编号
+    $('.autonumber').click(function(){
+        var str1 = $('#pnum').val();
+        $('#numhtmlshow').html('');
+        if(str1.trim() !== ''){
+            var match1 = /(?!\d{3,6})(\D|\d)|\d{3,6}/g;
+            var result = str1.match(match1);
+            var arr = new Array();
+            var j = 0;
+            var numhtml = '';
+            for(var i=0; i<result.length;i++){
+                if(result[i].length == 1){
+                    if(i == 0 || result[i-1].length >1){
+                        arr.push(result[i]);
+                        j++;
+                    }else if(i>=1 && result[i-1].length ==1){
+                        arr[j-1] = arr[j-1]+result[i];
+                    }
+                }else {
+                    arr.push(result[i]);
+                    j++;
+                }
+            }
+            $.each(arr,function(k,v){
+                numhtml += '<span class="label label-default" style="margin: 5px 0;display: inline-block">'+v+' <a href="#" class="delrule btn btn-default btn-xs"><i class="glyphicon glyphicon-remove"></i></a></span> ';
+            });
+            $('#numhtmlshow').html(numhtml);
+        }
+        $('#autonumber').modal('show');
+    });
+
+    $('body').on('click','.delrule',function(){
+        $(this).parents('.label').remove();
+    });
+    //tools change
+    $('#tools').change(function(){
+        if($(this).val() == 1){
+            $('.toolshow').hide();
+            $('#noteshow').show();
+        }else if($(this).val() == 2){
+            $('.toolshow').hide();
+            $('#yearshow').show();
+        }else if($(this).val() == 3){
+            $('.toolshow').hide();
+            $('.numbershow').show();
+        }else{
+            $('.toolshow').hide();
+        }
+    });
+    //add tools
+    $('#addtools').click(function(){
+        var numhtml = '';
+        if($('#tools').val() == 0){
+            toastr.error('请选择组件再添加');
+            return false;
+        }else if($('#tools').val() == 1){
+            if($('#noteshow input').val().trim() != ''){
+                numhtml += '<span class="label label-default" style="margin: 5px 0;display: inline-block">'+$('#noteshow input').val().trim()+' <a href="#" class="delrule btn btn-default btn-xs"><i class="glyphicon glyphicon-remove"></i></a></span> ';
+            }else{
+                toastr.error('请输入你想添加的文本内容');
+                return false;
+            }
+        }else if($('#tools').val() == 2){
+            numhtml += '<span class="label label-default" style="margin: 5px 0;display: inline-block">'+$('#yearshow input').val()+' <a href="#" class="delrule btn btn-default btn-xs"><i class="glyphicon glyphicon-remove"></i></a></span> ';
+        }else if($('#tools').val() == 3){
+            numhtml += '<span class="label label-default" style="margin: 5px 0;display: inline-block">'+$('#setnumber').val()+' <a href="#" class="delrule btn btn-default btn-xs"><i class="glyphicon glyphicon-remove"></i></a></span> ';
+        }
+        $('#numhtmlshow').append(numhtml);
+    });
+    //位数number编号大小设置
+    $('#numsite').on("valuechange", function (e, previous) {
+        if($(this).val() == '' || parseInt($(this).val()) > 6 || parseInt($(this).val()) <3){
+            toastr.error('请输入编号位数区间在3到6位');
+            return false;
+        }else{
+            var num = parseInt($(this).val());
+            var str = makenum(num);
+            $('#setnumber').val(str);
+        }
+    });
+    //生成编号
+    $('#setcnum').click(function(){
+        var cnum = '';
+        $('#numhtmlshow span').each(function(){
+            cnum += $(this).text().trim();
+        });
+        $('#pnum').val(cnum);
+        $('#autonumber').modal('hide');
+    });
+    //根据位数生成编号,3位-》001 ,5位-》00001
+    function makenum(num){
+        var arr = new Array(num);
+        for(var i=0;i< num;i++){
+            if(i != num-1){
+                arr[i] = 0;
+            }else{
+                arr[i] = 1;
+            }
+        }
+        return arr.join('');
+    }
+});

+ 11 - 0
global/js/jlzf-change-table.js

@@ -0,0 +1,11 @@
+$(function(){
+    //datatables基本设置
+    $.extend( $.fn.dataTable.defaults, {
+        paging: false,
+        ordering: false,
+        searching: false,
+        info: false,
+        scrollX: true,
+        scrollCollapse: true
+    } );
+});

文件差异内容过多而无法显示
+ 717 - 0
global/js/jlzf-change-update.js


文件差异内容过多而无法显示
+ 1 - 0
global/js/jlzf-change-update.min.js


文件差异内容过多而无法显示
+ 15345 - 0
global/js/jquery.dataTables.js


文件差异内容过多而无法显示
+ 167 - 0
global/js/jquery.dataTables.min.js


文件差异内容过多而无法显示
+ 7 - 0
global/js/toastr.min.js


文件差异内容过多而无法显示
+ 1913 - 0
global/js/ztree/jquery.ztree.core.js


+ 628 - 0
global/js/ztree/jquery.ztree.excheck.js

@@ -0,0 +1,628 @@
+/*
+ * JQuery zTree excheck v3.5.28
+ * http://treejs.cn/
+ *
+ * Copyright (c) 2010 Hunter.z
+ *
+ * Licensed same as jquery - MIT License
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * email: hunter.z@263.net
+ * Date: 2017-01-20
+ */
+(function($){
+	//default consts of excheck
+	var _consts = {
+		event: {
+			CHECK: "ztree_check"
+		},
+		id: {
+			CHECK: "_check"
+		},
+		checkbox: {
+			STYLE: "checkbox",
+			DEFAULT: "chk",
+			DISABLED: "disable",
+			FALSE: "false",
+			TRUE: "true",
+			FULL: "full",
+			PART: "part",
+			FOCUS: "focus"
+		},
+		radio: {
+			STYLE: "radio",
+			TYPE_ALL: "all",
+			TYPE_LEVEL: "level"
+		}
+	},
+	//default setting of excheck
+	_setting = {
+		check: {
+			enable: false,
+			autoCheckTrigger: false,
+			chkStyle: _consts.checkbox.STYLE,
+			nocheckInherit: false,
+			chkDisabledInherit: false,
+			radioType: _consts.radio.TYPE_LEVEL,
+			chkboxType: {
+				"Y": "ps",
+				"N": "ps"
+			}
+		},
+		data: {
+			key: {
+				checked: "checked"
+			}
+		},
+		callback: {
+			beforeCheck:null,
+			onCheck:null
+		}
+	},
+	//default root of excheck
+	_initRoot = function (setting) {
+		var r = data.getRoot(setting);
+		r.radioCheckedList = [];
+	},
+	//default cache of excheck
+	_initCache = function(treeId) {},
+	//default bind event of excheck
+	_bindEvent = function(setting) {
+		var o = setting.treeObj,
+		c = consts.event;
+		o.bind(c.CHECK, function (event, srcEvent, treeId, node) {
+			event.srcEvent = srcEvent;
+			tools.apply(setting.callback.onCheck, [event, treeId, node]);
+		});
+	},
+	_unbindEvent = function(setting) {
+		var o = setting.treeObj,
+		c = consts.event;
+		o.unbind(c.CHECK);
+	},
+	//default event proxy of excheck
+	_eventProxy = function(e) {
+		var target = e.target,
+		setting = data.getSetting(e.data.treeId),
+		tId = "", node = null,
+		nodeEventType = "", treeEventType = "",
+		nodeEventCallback = null, treeEventCallback = null;
+
+		if (tools.eqs(e.type, "mouseover")) {
+			if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
+				tId = tools.getNodeMainDom(target).id;
+				nodeEventType = "mouseoverCheck";
+			}
+		} else if (tools.eqs(e.type, "mouseout")) {
+			if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
+				tId = tools.getNodeMainDom(target).id;
+				nodeEventType = "mouseoutCheck";
+			}
+		} else if (tools.eqs(e.type, "click")) {
+			if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
+				tId = tools.getNodeMainDom(target).id;
+				nodeEventType = "checkNode";
+			}
+		}
+		if (tId.length>0) {
+			node = data.getNodeCache(setting, tId);
+			switch (nodeEventType) {
+				case "checkNode" :
+					nodeEventCallback = _handler.onCheckNode;
+					break;
+				case "mouseoverCheck" :
+					nodeEventCallback = _handler.onMouseoverCheck;
+					break;
+				case "mouseoutCheck" :
+					nodeEventCallback = _handler.onMouseoutCheck;
+					break;
+			}
+		}
+		var proxyResult = {
+			stop: nodeEventType === "checkNode",
+			node: node,
+			nodeEventType: nodeEventType,
+			nodeEventCallback: nodeEventCallback,
+			treeEventType: treeEventType,
+			treeEventCallback: treeEventCallback
+		};
+		return proxyResult
+	},
+	//default init node of excheck
+	_initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
+		if (!n) return;
+		var checkedKey = setting.data.key.checked;
+		if (typeof n[checkedKey] == "string") n[checkedKey] = tools.eqs(n[checkedKey], "true");
+		n[checkedKey] = !!n[checkedKey];
+		n.checkedOld = n[checkedKey];
+		if (typeof n.nocheck == "string") n.nocheck = tools.eqs(n.nocheck, "true");
+		n.nocheck = !!n.nocheck || (setting.check.nocheckInherit && parentNode && !!parentNode.nocheck);
+		if (typeof n.chkDisabled == "string") n.chkDisabled = tools.eqs(n.chkDisabled, "true");
+		n.chkDisabled = !!n.chkDisabled || (setting.check.chkDisabledInherit && parentNode && !!parentNode.chkDisabled);
+		if (typeof n.halfCheck == "string") n.halfCheck = tools.eqs(n.halfCheck, "true");
+		n.halfCheck = !!n.halfCheck;
+		n.check_Child_State = -1;
+		n.check_Focus = false;
+		n.getCheckStatus = function() {return data.getCheckStatus(setting, n);};
+
+		if (setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL && n[checkedKey] ) {
+			var r = data.getRoot(setting);
+			r.radioCheckedList.push(n);
+		}
+	},
+	//add dom for check
+	_beforeA = function(setting, node, html) {
+		var checkedKey = setting.data.key.checked;
+		if (setting.check.enable) {
+			data.makeChkFlag(setting, node);
+			html.push("<span ID='", node.tId, consts.id.CHECK, "' class='", view.makeChkClass(setting, node), "' treeNode", consts.id.CHECK, (node.nocheck === true?" style='display:none;'":""),"></span>");
+		}
+	},
+	//update zTreeObj, add method of check
+	_zTreeTools = function(setting, zTreeTools) {
+		zTreeTools.checkNode = function(node, checked, checkTypeFlag, callbackFlag) {
+			var checkedKey = this.setting.data.key.checked;
+			if (node.chkDisabled === true) return;
+			if (checked !== true && checked !== false) {
+				checked = !node[checkedKey];
+			}
+			callbackFlag = !!callbackFlag;
+
+			if (node[checkedKey] === checked && !checkTypeFlag) {
+				return;
+			} else if (callbackFlag && tools.apply(this.setting.callback.beforeCheck, [this.setting.treeId, node], true) == false) {
+				return;
+			}
+			if (tools.uCanDo(this.setting) && this.setting.check.enable && node.nocheck !== true) {
+				node[checkedKey] = checked;
+				var checkObj = $$(node, consts.id.CHECK, this.setting);
+				if (checkTypeFlag || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
+				view.setChkClass(this.setting, checkObj, node);
+				view.repairParentChkClassWithSelf(this.setting, node);
+				if (callbackFlag) {
+					this.setting.treeObj.trigger(consts.event.CHECK, [null, this.setting.treeId, node]);
+				}
+			}
+		}
+
+		zTreeTools.checkAllNodes = function(checked) {
+			view.repairAllChk(this.setting, !!checked);
+		}
+
+		zTreeTools.getCheckedNodes = function(checked) {
+			var childKey = this.setting.data.key.children;
+			checked = (checked !== false);
+			return data.getTreeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey], checked);
+		}
+
+		zTreeTools.getChangeCheckedNodes = function() {
+			var childKey = this.setting.data.key.children;
+			return data.getTreeChangeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey]);
+		}
+
+		zTreeTools.setChkDisabled = function(node, disabled, inheritParent, inheritChildren) {
+			disabled = !!disabled;
+			inheritParent = !!inheritParent;
+			inheritChildren = !!inheritChildren;
+			view.repairSonChkDisabled(this.setting, node, disabled, inheritChildren);
+			view.repairParentChkDisabled(this.setting, node.getParentNode(), disabled, inheritParent);
+		}
+
+		var _updateNode = zTreeTools.updateNode;
+		zTreeTools.updateNode = function(node, checkTypeFlag) {
+			if (_updateNode) _updateNode.apply(zTreeTools, arguments);
+			if (!node || !this.setting.check.enable) return;
+			var nObj = $$(node, this.setting);
+			if (nObj.get(0) && tools.uCanDo(this.setting)) {
+				var checkObj = $$(node, consts.id.CHECK, this.setting);
+				if (checkTypeFlag == true || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
+				view.setChkClass(this.setting, checkObj, node);
+				view.repairParentChkClassWithSelf(this.setting, node);
+			}
+		}
+	},
+	//method of operate data
+	_data = {
+		getRadioCheckedList: function(setting) {
+			var checkedList = data.getRoot(setting).radioCheckedList;
+			for (var i=0, j=checkedList.length; i<j; i++) {
+				if(!data.getNodeCache(setting, checkedList[i].tId)) {
+					checkedList.splice(i, 1);
+					i--; j--;
+				}
+			}
+			return checkedList;
+		},
+		getCheckStatus: function(setting, node) {
+			if (!setting.check.enable || node.nocheck || node.chkDisabled) return null;
+			var checkedKey = setting.data.key.checked,
+			r = {
+				checked: node[checkedKey],
+				half: node.halfCheck ? node.halfCheck : (setting.check.chkStyle == consts.radio.STYLE ? (node.check_Child_State === 2) : (node[checkedKey] ? (node.check_Child_State > -1 && node.check_Child_State < 2) : (node.check_Child_State > 0)))
+			};
+			return r;
+		},
+		getTreeCheckedNodes: function(setting, nodes, checked, results) {
+			if (!nodes) return [];
+			var childKey = setting.data.key.children,
+			checkedKey = setting.data.key.checked,
+			onlyOne = (checked && setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL);
+			results = !results ? [] : results;
+			for (var i = 0, l = nodes.length; i < l; i++) {
+				if (nodes[i].nocheck !== true && nodes[i].chkDisabled !== true && nodes[i][checkedKey] == checked) {
+					results.push(nodes[i]);
+					if(onlyOne) {
+						break;
+					}
+				}
+				data.getTreeCheckedNodes(setting, nodes[i][childKey], checked, results);
+				if(onlyOne && results.length > 0) {
+					break;
+				}
+			}
+			return results;
+		},
+		getTreeChangeCheckedNodes: function(setting, nodes, results) {
+			if (!nodes) return [];
+			var childKey = setting.data.key.children,
+			checkedKey = setting.data.key.checked;
+			results = !results ? [] : results;
+			for (var i = 0, l = nodes.length; i < l; i++) {
+				if (nodes[i].nocheck !== true && nodes[i].chkDisabled !== true && nodes[i][checkedKey] != nodes[i].checkedOld) {
+					results.push(nodes[i]);
+				}
+				data.getTreeChangeCheckedNodes(setting, nodes[i][childKey], results);
+			}
+			return results;
+		},
+		makeChkFlag: function(setting, node) {
+			if (!node) return;
+			var childKey = setting.data.key.children,
+			checkedKey = setting.data.key.checked,
+			chkFlag = -1;
+			if (node[childKey]) {
+				for (var i = 0, l = node[childKey].length; i < l; i++) {
+					var cNode = node[childKey][i];
+					var tmp = -1;
+					if (setting.check.chkStyle == consts.radio.STYLE) {
+						if (cNode.nocheck === true || cNode.chkDisabled === true) {
+							tmp = cNode.check_Child_State;
+						} else if (cNode.halfCheck === true) {
+							tmp = 2;
+						} else if (cNode[checkedKey]) {
+							tmp = 2;
+						} else {
+							tmp = cNode.check_Child_State > 0 ? 2:0;
+						}
+						if (tmp == 2) {
+							chkFlag = 2; break;
+						} else if (tmp == 0){
+							chkFlag = 0;
+						}
+					} else if (setting.check.chkStyle == consts.checkbox.STYLE) {
+						if (cNode.nocheck === true || cNode.chkDisabled === true) {
+							tmp = cNode.check_Child_State;
+						} else if (cNode.halfCheck === true) {
+							tmp = 1;
+						} else if (cNode[checkedKey] ) {
+							tmp = (cNode.check_Child_State === -1 || cNode.check_Child_State === 2) ? 2 : 1;
+						} else {
+							tmp = (cNode.check_Child_State > 0) ? 1 : 0;
+						}
+						if (tmp === 1) {
+							chkFlag = 1; break;
+						} else if (tmp === 2 && chkFlag > -1 && i > 0 && tmp !== chkFlag) {
+							chkFlag = 1; break;
+						} else if (chkFlag === 2 && tmp > -1 && tmp < 2) {
+							chkFlag = 1; break;
+						} else if (tmp > -1) {
+							chkFlag = tmp;
+						}
+					}
+				}
+			}
+			node.check_Child_State = chkFlag;
+		}
+	},
+	//method of event proxy
+	_event = {
+
+	},
+	//method of event handler
+	_handler = {
+		onCheckNode: function (event, node) {
+			if (node.chkDisabled === true) return false;
+			var setting = data.getSetting(event.data.treeId),
+			checkedKey = setting.data.key.checked;
+			if (tools.apply(setting.callback.beforeCheck, [setting.treeId, node], true) == false) return true;
+			node[checkedKey] = !node[checkedKey];
+			view.checkNodeRelation(setting, node);
+			var checkObj = $$(node, consts.id.CHECK, setting);
+			view.setChkClass(setting, checkObj, node);
+			view.repairParentChkClassWithSelf(setting, node);
+			setting.treeObj.trigger(consts.event.CHECK, [event, setting.treeId, node]);
+			return true;
+		},
+		onMouseoverCheck: function(event, node) {
+			if (node.chkDisabled === true) return false;
+			var setting = data.getSetting(event.data.treeId),
+			checkObj = $$(node, consts.id.CHECK, setting);
+			node.check_Focus = true;
+			view.setChkClass(setting, checkObj, node);
+			return true;
+		},
+		onMouseoutCheck: function(event, node) {
+			if (node.chkDisabled === true) return false;
+			var setting = data.getSetting(event.data.treeId),
+			checkObj = $$(node, consts.id.CHECK, setting);
+			node.check_Focus = false;
+			view.setChkClass(setting, checkObj, node);
+			return true;
+		}
+	},
+	//method of tools for zTree
+	_tools = {
+
+	},
+	//method of operate ztree dom
+	_view = {
+		checkNodeRelation: function(setting, node) {
+			var pNode, i, l,
+			childKey = setting.data.key.children,
+			checkedKey = setting.data.key.checked,
+			r = consts.radio;
+			if (setting.check.chkStyle == r.STYLE) {
+				var checkedList = data.getRadioCheckedList(setting);
+				if (node[checkedKey]) {
+					if (setting.check.radioType == r.TYPE_ALL) {
+						for (i = checkedList.length-1; i >= 0; i--) {
+							pNode = checkedList[i];
+							if (pNode[checkedKey] && pNode != node) {
+								pNode[checkedKey] = false;
+								checkedList.splice(i, 1);
+
+								view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
+								if (pNode.parentTId != node.parentTId) {
+									view.repairParentChkClassWithSelf(setting, pNode);
+								}
+							}
+						}
+						checkedList.push(node);
+					} else {
+						var parentNode = (node.parentTId) ? node.getParentNode() : data.getRoot(setting);
+						for (i = 0, l = parentNode[childKey].length; i < l; i++) {
+							pNode = parentNode[childKey][i];
+							if (pNode[checkedKey] && pNode != node) {
+								pNode[checkedKey] = false;
+								view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
+							}
+						}
+					}
+				} else if (setting.check.radioType == r.TYPE_ALL) {
+					for (i = 0, l = checkedList.length; i < l; i++) {
+						if (node == checkedList[i]) {
+							checkedList.splice(i, 1);
+							break;
+						}
+					}
+				}
+
+			} else {
+				if (node[checkedKey] && (!node[childKey] || node[childKey].length==0 || setting.check.chkboxType.Y.indexOf("s") > -1)) {
+					view.setSonNodeCheckBox(setting, node, true);
+				}
+				if (!node[checkedKey] && (!node[childKey] || node[childKey].length==0 || setting.check.chkboxType.N.indexOf("s") > -1)) {
+					view.setSonNodeCheckBox(setting, node, false);
+				}
+				if (node[checkedKey] && setting.check.chkboxType.Y.indexOf("p") > -1) {
+					view.setParentNodeCheckBox(setting, node, true);
+				}
+				if (!node[checkedKey] && setting.check.chkboxType.N.indexOf("p") > -1) {
+					view.setParentNodeCheckBox(setting, node, false);
+				}
+			}
+		},
+		makeChkClass: function(setting, node) {
+			var checkedKey = setting.data.key.checked,
+			c = consts.checkbox, r = consts.radio,
+			fullStyle = "";
+			if (node.chkDisabled === true) {
+				fullStyle = c.DISABLED;
+			} else if (node.halfCheck) {
+				fullStyle = c.PART;
+			} else if (setting.check.chkStyle == r.STYLE) {
+				fullStyle = (node.check_Child_State < 1)? c.FULL:c.PART;
+			} else {
+				fullStyle = node[checkedKey] ? ((node.check_Child_State === 2 || node.check_Child_State === -1) ? c.FULL:c.PART) : ((node.check_Child_State < 1)? c.FULL:c.PART);
+			}
+			var chkName = setting.check.chkStyle + "_" + (node[checkedKey] ? c.TRUE : c.FALSE) + "_" + fullStyle;
+			chkName = (node.check_Focus && node.chkDisabled !== true) ? chkName + "_" + c.FOCUS : chkName;
+			return consts.className.BUTTON + " " + c.DEFAULT + " " + chkName;
+		},
+		repairAllChk: function(setting, checked) {
+			if (setting.check.enable && setting.check.chkStyle === consts.checkbox.STYLE) {
+				var checkedKey = setting.data.key.checked,
+				childKey = setting.data.key.children,
+				root = data.getRoot(setting);
+				for (var i = 0, l = root[childKey].length; i<l ; i++) {
+					var node = root[childKey][i];
+					if (node.nocheck !== true && node.chkDisabled !== true) {
+						node[checkedKey] = checked;
+					}
+					view.setSonNodeCheckBox(setting, node, checked);
+				}
+			}
+		},
+		repairChkClass: function(setting, node) {
+			if (!node) return;
+			data.makeChkFlag(setting, node);
+			if (node.nocheck !== true) {
+				var checkObj = $$(node, consts.id.CHECK, setting);
+				view.setChkClass(setting, checkObj, node);
+			}
+		},
+		repairParentChkClass: function(setting, node) {
+			if (!node || !node.parentTId) return;
+			var pNode = node.getParentNode();
+			view.repairChkClass(setting, pNode);
+			view.repairParentChkClass(setting, pNode);
+		},
+		repairParentChkClassWithSelf: function(setting, node) {
+			if (!node) return;
+			var childKey = setting.data.key.children;
+			if (node[childKey] && node[childKey].length > 0) {
+				view.repairParentChkClass(setting, node[childKey][0]);
+			} else {
+				view.repairParentChkClass(setting, node);
+			}
+		},
+		repairSonChkDisabled: function(setting, node, chkDisabled, inherit) {
+			if (!node) return;
+			var childKey = setting.data.key.children;
+			if (node.chkDisabled != chkDisabled) {
+				node.chkDisabled = chkDisabled;
+			}
+			view.repairChkClass(setting, node);
+			if (node[childKey] && inherit) {
+				for (var i = 0, l = node[childKey].length; i < l; i++) {
+					var sNode = node[childKey][i];
+					view.repairSonChkDisabled(setting, sNode, chkDisabled, inherit);
+				}
+			}
+		},
+		repairParentChkDisabled: function(setting, node, chkDisabled, inherit) {
+			if (!node) return;
+			if (node.chkDisabled != chkDisabled && inherit) {
+				node.chkDisabled = chkDisabled;
+			}
+			view.repairChkClass(setting, node);
+			view.repairParentChkDisabled(setting, node.getParentNode(), chkDisabled, inherit);
+		},
+		setChkClass: function(setting, obj, node) {
+			if (!obj) return;
+			if (node.nocheck === true) {
+				obj.hide();
+			} else {
+				obj.show();
+			}
+            obj.attr('class', view.makeChkClass(setting, node));
+		},
+		setParentNodeCheckBox: function(setting, node, value, srcNode) {
+			var childKey = setting.data.key.children,
+			checkedKey = setting.data.key.checked,
+			checkObj = $$(node, consts.id.CHECK, setting);
+			if (!srcNode) srcNode = node;
+			data.makeChkFlag(setting, node);
+			if (node.nocheck !== true && node.chkDisabled !== true) {
+				node[checkedKey] = value;
+				view.setChkClass(setting, checkObj, node);
+				if (setting.check.autoCheckTrigger && node != srcNode) {
+					setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
+				}
+			}
+			if (node.parentTId) {
+				var pSign = true;
+				if (!value) {
+					var pNodes = node.getParentNode()[childKey];
+					for (var i = 0, l = pNodes.length; i < l; i++) {
+						if ((pNodes[i].nocheck !== true && pNodes[i].chkDisabled !== true && pNodes[i][checkedKey])
+						|| ((pNodes[i].nocheck === true || pNodes[i].chkDisabled === true) && pNodes[i].check_Child_State > 0)) {
+							pSign = false;
+							break;
+						}
+					}
+				}
+				if (pSign) {
+					view.setParentNodeCheckBox(setting, node.getParentNode(), value, srcNode);
+				}
+			}
+		},
+		setSonNodeCheckBox: function(setting, node, value, srcNode) {
+			if (!node) return;
+			var childKey = setting.data.key.children,
+			checkedKey = setting.data.key.checked,
+			checkObj = $$(node, consts.id.CHECK, setting);
+			if (!srcNode) srcNode = node;
+
+			var hasDisable = false;
+			if (node[childKey]) {
+				for (var i = 0, l = node[childKey].length; i < l; i++) {
+					var sNode = node[childKey][i];
+					view.setSonNodeCheckBox(setting, sNode, value, srcNode);
+					if (sNode.chkDisabled === true) hasDisable = true;
+				}
+			}
+
+			if (node != data.getRoot(setting) && node.chkDisabled !== true) {
+				if (hasDisable && node.nocheck !== true) {
+					data.makeChkFlag(setting, node);
+				}
+				if (node.nocheck !== true && node.chkDisabled !== true) {
+					node[checkedKey] = value;
+					if (!hasDisable) node.check_Child_State = (node[childKey] && node[childKey].length > 0) ? (value ? 2 : 0) : -1;
+				} else {
+					node.check_Child_State = -1;
+				}
+				view.setChkClass(setting, checkObj, node);
+				if (setting.check.autoCheckTrigger && node != srcNode && node.nocheck !== true && node.chkDisabled !== true) {
+					setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
+				}
+			}
+
+		}
+	},
+
+	_z = {
+		tools: _tools,
+		view: _view,
+		event: _event,
+		data: _data
+	};
+	$.extend(true, $.fn.zTree.consts, _consts);
+	$.extend(true, $.fn.zTree._z, _z);
+
+	var zt = $.fn.zTree,
+	tools = zt._z.tools,
+	consts = zt.consts,
+	view = zt._z.view,
+	data = zt._z.data,
+	event = zt._z.event,
+	$$ = tools.$;
+
+	data.exSetting(_setting);
+	data.addInitBind(_bindEvent);
+	data.addInitUnBind(_unbindEvent);
+	data.addInitCache(_initCache);
+	data.addInitNode(_initNode);
+	data.addInitProxy(_eventProxy, true);
+	data.addInitRoot(_initRoot);
+	data.addBeforeA(_beforeA);
+	data.addZTreeTools(_zTreeTools);
+
+	var _createNodes = view.createNodes;
+	view.createNodes = function(setting, level, nodes, parentNode, index) {
+		if (_createNodes) _createNodes.apply(view, arguments);
+		if (!nodes) return;
+		view.repairParentChkClassWithSelf(setting, parentNode);
+	}
+	var _removeNode = view.removeNode;
+	view.removeNode = function(setting, node) {
+		var parentNode = node.getParentNode();
+		if (_removeNode) _removeNode.apply(view, arguments);
+		if (!node || !parentNode) return;
+		view.repairChkClass(setting, parentNode);
+		view.repairParentChkClass(setting, parentNode);
+	}
+
+	var _appendNodes = view.appendNodes;
+	view.appendNodes = function(setting, level, nodes, parentNode, index, initFlag, openFlag) {
+		var html = "";
+		if (_appendNodes) {
+			html = _appendNodes.apply(view, arguments);
+		}
+		if (parentNode) {
+			data.makeChkFlag(setting, parentNode);
+		}
+		return html;
+	}
+})(jQuery);

+ 214 - 3
jlweb201.sql

@@ -3,9 +3,9 @@
 -- https://www.phpmyadmin.net/
 --
 -- Host: 10.27.6.148
+-- Generation Time: 2018-01-09 09:29:32
 -- 服务器版本: 5.7.17-13
+-- PHP Version: 7.0.25-0ubuntu0.16.04.1
 
 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
 SET AUTOCOMMIT = 0;
@@ -67,6 +67,140 @@ INSERT INTO `jl_auser` (`auid`, `auname`, `aupass`, `aemail`) VALUES
 -- --------------------------------------------------------
 
 --
+-- 表的结构 `jl_change`
+--
+
+CREATE TABLE `jl_change` (
+  `cid` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '对应的标段id',
+  `uid` int(11) NOT NULL COMMENT '创建人id',
+  `pnum` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '申请编号',
+  `pname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '工程名称',
+  `mnum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '桩号',
+  `odname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '原设计图名称',
+  `onum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '原图号',
+  `cdname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更设计图名称',
+  `cnum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更图号',
+  `description` text COLLATE utf8_unicode_ci NOT NULL COMMENT '工程变更理由及内容',
+  `basis` text COLLATE utf8_unicode_ci NOT NULL COMMENT '工程变更合同依据',
+  `remarks` varchar(5000) COLLATE utf8_unicode_ci NOT NULL COMMENT '备注',
+  `ctype` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更类型,以逗号分隔',
+  `category` tinyint(4) NOT NULL COMMENT '变更类别',
+  `cnature` tinyint(4) NOT NULL COMMENT '变更性质',
+  `companyid` int(11) NOT NULL COMMENT '变更提出单位',
+  `bear` tinyint(4) NOT NULL COMMENT '费用承担方,1为业主,2为承包方',
+  `totalamount` double UNSIGNED NOT NULL COMMENT '变更总金额',
+  `times` tinyint(4) NOT NULL DEFAULT '0' COMMENT '次数',
+  `status` enum('uncheck','checking','checked','checkno','back') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'uncheck' COMMENT '变更令状态',
+  `intime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '添加时间',
+  `cintime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更状态发生时间',
+  `sintime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '完成审批时间'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更令信息表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_attachment`
+--
+
+CREATE TABLE `jl_change_attachment` (
+  `id` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '标段id',
+  `cid` int(11) NOT NULL COMMENT '对应于变更令id',
+  `uid` int(11) NOT NULL COMMENT '上传者id',
+  `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件名称',
+  `fileext` varchar(5) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件后缀',
+  `filesize` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件大小',
+  `filepath` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件存储路径',
+  `intime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '添加时间'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更令附件表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_audit`
+--
+
+CREATE TABLE `jl_change_audit` (
+  `id` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '标段id',
+  `cid` int(11) NOT NULL COMMENT '对应于变更表id',
+  `times` tinyint(4) NOT NULL COMMENT '次数',
+  `usite` tinyint(4) NOT NULL COMMENT '审批顺序,0为提交人',
+  `usort` int(11) NOT NULL COMMENT '排序',
+  `uid` int(11) NOT NULL COMMENT '审批人id',
+  `company` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '所属单位',
+  `jobs` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '职称',
+  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '审批人名字',
+  `status` enum('uncheck','checking','checked','checkno','back','backnew') COLLATE utf8_unicode_ci NOT NULL COMMENT '审批状态',
+  `sdesc` varchar(1000) COLLATE utf8_unicode_ci NOT NULL COMMENT '审批意见',
+  `sintime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '审批时间',
+  `list_json` text COLLATE utf8_unicode_ci NOT NULL COMMENT '填写的变更数量清单json'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更令审批表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_audit_list`
+--
+
+CREATE TABLE `jl_change_audit_list` (
+  `id` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '标段id',
+  `cid` int(11) NOT NULL COMMENT '对应于变更表id',
+  `lid` int(11) NOT NULL COMMENT '对应于签约清单里的id,新增添加的清单为0',
+  `lnum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '清单编号',
+  `lname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称',
+  `unit` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '单位',
+  `unitprice` float NOT NULL COMMENT '单价',
+  `oamount` float NOT NULL COMMENT '原数量',
+  `camount` float NOT NULL COMMENT '变更数量',
+  `samount` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '审批变更后数量',
+  `auditjson` varchar(5000) COLLATE utf8_unicode_ci NOT NULL COMMENT '用户变更json数据'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更用户申报清单关联表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_company`
+--
+
+CREATE TABLE `jl_change_company` (
+  `id` int(11) NOT NULL,
+  `cid` int(11) NOT NULL COMMENT '对应的变更令id',
+  `name` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称',
+  `csort` int(11) NOT NULL COMMENT '排序'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='变更令单位表';
+
+-- --------------------------------------------------------
+
+--
+-- 表的结构 `jl_change_list`
+--
+
+CREATE TABLE `jl_change_list` (
+  `id` int(11) NOT NULL,
+  `pid` int(11) NOT NULL COMMENT '项目id',
+  `stid` int(11) NOT NULL COMMENT '标段类型id',
+  `pmid` int(11) NOT NULL COMMENT '标段id',
+  `lnum` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '清单编号',
+  `lname` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称',
+  `unit` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '单位',
+  `unitprice` float NOT NULL COMMENT '单价',
+  `amount` float NOT NULL COMMENT '数量'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='签约清单表';
+
+-- --------------------------------------------------------
+
+--
 -- 表的结构 `jl_config`
 --
 
@@ -428,6 +562,51 @@ ALTER TABLE `jl_auser`
   ADD PRIMARY KEY (`auid`);
 
 --
+-- Indexes for table `jl_change`
+--
+ALTER TABLE `jl_change`
+  ADD PRIMARY KEY (`cid`),
+  ADD KEY `status` (`status`),
+  ADD KEY `pmid` (`pmid`);
+
+--
+-- Indexes for table `jl_change_attachment`
+--
+ALTER TABLE `jl_change_attachment`
+  ADD PRIMARY KEY (`id`),
+  ADD KEY `cid` (`cid`),
+  ADD KEY `uid` (`uid`);
+
+--
+-- Indexes for table `jl_change_audit`
+--
+ALTER TABLE `jl_change_audit`
+  ADD PRIMARY KEY (`id`),
+  ADD KEY `cid` (`cid`),
+  ADD KEY `uid` (`uid`);
+
+--
+-- Indexes for table `jl_change_audit_list`
+--
+ALTER TABLE `jl_change_audit_list`
+  ADD PRIMARY KEY (`id`);
+
+--
+-- Indexes for table `jl_change_company`
+--
+ALTER TABLE `jl_change_company`
+  ADD PRIMARY KEY (`id`);
+
+--
+-- Indexes for table `jl_change_list`
+--
+ALTER TABLE `jl_change_list`
+  ADD PRIMARY KEY (`id`),
+  ADD KEY `pid` (`pid`),
+  ADD KEY `stid` (`stid`),
+  ADD KEY `pmid` (`pmid`);
+
+--
 -- Indexes for table `jl_config`
 --
 ALTER TABLE `jl_config`
@@ -560,6 +739,36 @@ ALTER TABLE `jl_attachment`
 ALTER TABLE `jl_auser`
   MODIFY `auid` mediumint(9) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
 --
+-- 使用表AUTO_INCREMENT `jl_change`
+--
+ALTER TABLE `jl_change`
+  MODIFY `cid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_attachment`
+--
+ALTER TABLE `jl_change_attachment`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_audit`
+--
+ALTER TABLE `jl_change_audit`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_audit_list`
+--
+ALTER TABLE `jl_change_audit_list`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_company`
+--
+ALTER TABLE `jl_change_company`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
+-- 使用表AUTO_INCREMENT `jl_change_list`
+--
+ALTER TABLE `jl_change_list`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
+--
 -- 使用表AUTO_INCREMENT `jl_config`
 --
 ALTER TABLE `jl_config`
@@ -583,7 +792,7 @@ ALTER TABLE `jl_measure_audit`
 -- 使用表AUTO_INCREMENT `jl_measure_concern`
 --
 ALTER TABLE `jl_measure_concern`
-  MODIFY `mcid` mediumint(9) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
+  MODIFY `mcid` mediumint(9) NOT NULL AUTO_INCREMENT;
 --
 -- 使用表AUTO_INCREMENT `jl_measure_numofper`
 --
@@ -603,7 +812,7 @@ ALTER TABLE `jl_project_measure`
 -- 使用表AUTO_INCREMENT `jl_section_type`
 --
 ALTER TABLE `jl_section_type`
-  MODIFY `stid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=481;
+  MODIFY `stid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=478;
 --
 -- 使用表AUTO_INCREMENT `jl_share`
 --
@@ -643,7 +852,7 @@ ALTER TABLE `jl_users_auth`
 -- 使用表AUTO_INCREMENT `jl_user_token`
 --
 ALTER TABLE `jl_user_token`
-  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
+  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
 --
 -- 使用表AUTO_INCREMENT `jl_zero_audit`
 --

+ 307 - 0
protected/class/change.php

@@ -0,0 +1,307 @@
+<?php
+
+Doo::loadModel('change');
+Doo::loadModel('changeatt');
+Doo::loadModel('changeaudit');
+Doo::loadModel('changeauditlist');
+Doo::loadModel('changelist');
+Doo::loadModel('changecompany');
+
+class Changes
+{
+
+    private $__change,$__changeatt,$__changeaudit,$__changeauditlist,$__changelist,$__changecompany;
+
+    function __construct()
+    {
+        $this->__change = new Change();
+        $this->__changeatt = new ChangeAtt();
+        $this->__changeaudit = new ChangeAudit();
+        $this->__changeauditlist = new ChangeAuditList();
+        $this->__changelist = new ChangeList();
+        $this->__changecompany = new ChangeCompany();
+    }
+
+    //change
+    public function insertChangeMsg($pmArr,$uid,$cmsg)
+    {
+        $this->__change->pid = $pmArr['pid'];
+        $this->__change->stid = $pmArr['stid'];
+        $this->__change->pmid = $pmArr['pmid'];
+        $this->__change->uid = $uid;
+        $this->__change->pnum = $cmsg['pnum'];
+        $this->__change->pname = $cmsg['pname'];
+        $this->__change->mnum = $cmsg['mnum'];
+        $this->__change->odname = $cmsg['odname'];
+        $this->__change->onum = $cmsg['onum'];
+        $this->__change->cdname = $cmsg['cdname'];
+        $this->__change->cnum = $cmsg['cnum'];
+        $this->__change->description = $cmsg['description'];
+        $this->__change->basis = $cmsg['basis'];
+        $this->__change->remarks = $cmsg['remarks'];
+        $this->__change->ctype = !empty($cmsg['ctype']) ? implode(',', $cmsg['ctype']) : '';
+        $this->__change->category = $cmsg['category'];
+        $this->__change->cnature = $cmsg['cnature'];
+        $this->__change->companyid = $cmsg['companyid'];
+        $this->__change->bear = $cmsg['bear'];
+        $this->__change->status = isset($cmsg['uncheck']) ? 'uncheck' : 'checking';
+        $this->__change->intime = time();
+        $this->__change->cintime = time();
+        return $this->__change->insert();
+    }
+
+    public function updateChangeMsg($cid,$cmsg,$times,$status = '')
+    {
+        $this->__change->cid = $cid;
+        $this->__change->pnum = $cmsg['pnum'];
+        $this->__change->pname = $cmsg['pname'];
+        $this->__change->mnum = $cmsg['mnum'];
+        $this->__change->odname = $cmsg['odname'];
+        $this->__change->onum = $cmsg['onum'];
+        $this->__change->cdname = $cmsg['cdname'];
+        $this->__change->cnum = $cmsg['cnum'];
+        $this->__change->description = $cmsg['description'];
+        $this->__change->basis = $cmsg['basis'];
+        $this->__change->remarks = $cmsg['remarks'];
+        $this->__change->ctype = !empty($cmsg['ctype']) ? implode(',', $cmsg['ctype']) : '';
+        $this->__change->category = $cmsg['category'];
+        $this->__change->cnature = $cmsg['cnature'];
+        $this->__change->companyid = $cmsg['companyid'];
+        $this->__change->bear = $cmsg['bear'];
+        $this->__change->times = $times;
+        if($status != ''){
+            $this->__change->status = $status;
+        }
+        $this->__change->cintime = time();
+        return $this->__change->update();
+    }
+
+    public function getListbyMydetail($pmid,$uid,$limit)
+    {
+        return $this->__change->find(array('where' => 'pmid=? and (status="checking" or status="back" or status="uncheck") and cid in(select `jl_change_audit`.cid from `jl_change_audit` where `jl_change_audit`.uid=? and `jl_change_audit`.status="checking")', 'param' => array($pmid,$uid), 'desc' => 'cid', 'limit' => $limit, 'asArray' => TRUE));
+    }
+
+    public function getNumbystatus($pmid,$status,$status2 = '')
+    {
+        if(!empty($status2)){
+            return $this->__change->count(array('where' => 'pmid=? and (status=? or status=?)', 'param' => array($pmid,$status,$status2), 'asArray' => TRUE));
+        }else{
+            return $this->__change->count(array('where' => 'pmid=? and status=?', 'param' => array($pmid,$status), 'asArray' => TRUE));
+        }
+        return $this->__change->count(array('where' => 'pmid=? and status=?', 'param' => array($pmid,$status), 'asArray' => TRUE));
+    }
+
+    public function getListbyStatus($pmid,$status,$limit,$status2 = '')
+    {
+        if(!empty($status2)){
+            return $this->__change->find(array('where' => 'pmid=? and (status=? or status=?)', 'param' => array($pmid,$status,$status2), 'desc' => 'cid', 'limit' => $limit, 'asArray' => TRUE));
+        }else{
+            return $this->__change->find(array('where' => 'pmid=? and status=?', 'param' => array($pmid,$status), 'desc' => 'cid', 'limit' => $limit, 'asArray' => TRUE));
+        }
+    }
+
+    public function updateChangeTotalamount($cid,$total)
+    {
+        $this->__change->cid = $cid;
+        $this->__change->totalamount = $total;
+        $this->__change->update();
+    }
+
+    public function getChangebyid($cid)
+    {
+        return $this->__change->getOne(array('where' => 'cid=?', 'param' => array($cid), 'asArray' => TRUE));
+    }
+
+    public function getNeedChangeAllList($uid)
+    {
+        return $this->__change->find(array('select' => 'cid,pid,stid,pmid', 'where' => 'cid in (select `cid` from `jl_change_audit` where uid=? and status="checking")', 'param' => array($uid), 'asArray' => TRUE));
+    }
+
+    public function getPassChangeListID($pmid)
+    {
+        return $this->__change->find(array('select' =>'cid','where' => 'pmid=? and status="checked"', 'param' => array($pmid), 'asArray' => TRUE));
+    }
+
+    public function getLastChangePnum($pmid)
+    {
+        return $this->__change->getOne(array('select' => 'pnum', 'where' => 'pmid=?', 'param' => array($pmid), 'desc' => 'cid','asArray' => TRUE));
+    }
+
+    //搜索该标段有无相同申请编号的变更令
+    public function getChangebyPnumPmid($pnum,$pmid,$cid = '')
+    {
+        if($cid != ''){
+            return $this->__change->getOne(array('where' => 'pnum=? and pmid=? and cid!=?', 'param' => array($pnum,$pmid,$cid), 'asArray' => TRUE));
+        }else{
+            return $this->__change->getOne(array('where' => 'pnum=? and pmid=?', 'param' => array($pnum,$pmid), 'asArray' => TRUE));
+        }
+
+    }
+
+
+    //changeatt
+    public function insertChangeAtt($files)
+    {
+        $this->__changeatt->pid = $files['pid'];
+        $this->__changeatt->stid = $files['stid'];
+        $this->__changeatt->pmid = $files['pmid'];
+        $this->__changeatt->cid = $files['cid'];
+        $this->__changeatt->uid = $files['uid'];
+        $this->__changeatt->filename = $files['filename'];
+        $this->__changeatt->fileext = $files['fileext'];
+        $this->__changeatt->filesize = $files['filesize'];
+        $this->__changeatt->filepath = $files['filepath'];
+        $this->__changeatt->intime = $files['intime'];
+        return $this->__changeatt->insert();
+    }
+
+    public function getChangeAttbyFid($id)
+    {
+        return $this->__changeatt->getOne(array('where' => 'id=?', 'param' => array($id), 'asArray' => TRUE));
+    }
+
+    public function getChangeAttListbycid($cid)
+    {
+        return $this->__changeatt->find(array('where' => 'cid=?', 'asc' => 'intime', 'param' => array($cid), 'asArray' => TRUE));
+    }
+
+    public function delChangeAttbyFid($fid)
+    {
+        return $this->__changeatt->delete(array('where' => 'id=?', 'param' => array($fid), 'asArray' => TRUE));
+    }
+
+
+    //changeaudit
+    public function getNeedChangeNumbyUid($uid)
+    {
+        return $this->__changeaudit->count(array('where' => 'uid=? and status="checking"', 'param' => array($uid), 'asArray' => TRUE));
+    }
+
+    public function getPmidGroup($uid)
+    {
+        return $this->__changeaudit->find(array('where' => 'uid=?', 'param' => array($uid), 'groupby' => 'pmid', 'asArray' => TRUE));
+    }
+
+    public function getNumbyMydetail($pmid,$uid)
+    {
+        return $this->__changeaudit->count(array('where' => 'pmid=? and uid=? and status="checking"', 'param' => array($pmid,$uid), 'asArray' => TRUE));
+    }
+
+    public function getOneAuditbystatus($cid,$status)
+    {
+        return $this->__changeaudit->getOne(array('where' => 'cid=? and status=? and usite!=0', 'param' => array($cid,$status), 'asArray' => TRUE));
+    }
+
+    public function getChangeAuditsbycid($cid)
+    {
+        return $this->__changeaudit->find(array('where' => 'cid=?', 'asc' => 'id', 'param' => array($cid), 'asArray' => TRUE));
+    }
+
+    public function getChangeAuditsbySort($cid)
+    {
+        return $this->__changeaudit->find(array('where' => 'cid=?', 'asc' => 'usort', 'param' => array($cid), 'asArray' => TRUE));
+    }
+
+    public function getChangeAuditsbycidtime($cid,$times)
+    {
+        return $this->__changeaudit->find(array('where' => 'cid=? and times=? and usite!=0', 'groupby' => 'usite', 'asc' => 'usort', 'param' => array($cid,$times), 'asArray' => TRUE));
+    }
+
+    public function getChangeAuditbylastlist($cid,$times)
+    {
+        $sql = 'SELECT * FROM (SELECT MAX(usort) as ust FROM `jl_change_audit` WHERE cid='.$cid.' and times='.$times.' and usite!=0 GROUP BY usite ) as b JOIN `jl_change_audit` as a ON a.usort = b.ust WHERE cid='.$cid.' and times='.$times.' and usite!=0 ORDER BY usite';
+        $query = Doo::db ()->query ( $sql );
+
+        $result = $query->fetchAll ();
+
+        return $result;
+    }
+
+    public function getOneChangeAudit($uid,$cid,$times)
+    {
+        return $this->__changeaudit->getOne(array('where' => 'cid=? and uid=? and times=? and usite!=0', 'desc' => 'usort', 'param' => array($cid,$uid,$times), 'asArray' => TRUE));
+    }
+
+    public function updateChangeAudit($uid,$cid,$times,$status,$desc,$time,$list = '')
+    {
+        $oneaudit = $this->getOneChangeAudit($uid,$cid,$times);
+
+        $this->__changeaudit->id = $oneaudit['id'];
+        $this->__changeaudit->status = $status;
+        $this->__changeaudit->sdesc = $desc;
+        $this->__changeaudit->sintime = $time;
+        $this->__changeaudit->list_json = $list;
+        $this->__changeaudit->update();
+    }
+
+    //默认取最后一个审批人,site取0则取最后一个创建人
+    public function getChangeAuditLastUser($cid,$site = 1)
+    {
+        $sql = $site == 0 ? ' and usite=0' : '';
+        return $this->__changeaudit->getOne(array('where' => 'cid=?'.$sql, 'desc' => 'usort', 'param' => array($cid), 'asArray' => TRUE));
+    }
+
+
+    //changeauditlist
+    public function getChangeAuditListbycid($cid)
+    {
+        return $this->__changeauditlist->find(array('where' => 'cid=?', 'asc' => 'convert(lnum using gbk)', 'param' => array($cid), 'asArray' => TRUE));
+    }
+
+    public function getOneChangeAuditList($lid)
+    {
+        return $this->__changeauditlist->getOne(array('where' => 'id=?', 'param' => array($lid), 'asArray' => TRUE));
+    }
+
+    public function delChangeAuditListbyCid($cid)
+    {
+        return $this->__changeauditlist->delete(array('where' => 'cid=?', 'param' => array($cid)));
+    }
+
+
+    //changelist
+    public function insertChangelist($pmArray,$listArray)
+    {
+        $this->__changelist->pid = $pmArray['pid'];
+        $this->__changelist->stid = $pmArray['stid'];
+        $this->__changelist->pmid = $pmArray['pmid'];
+        $this->__changelist->lnum = trim($listArray['lnum']);
+        $this->__changelist->lname = trim($listArray['lname']);
+        $this->__changelist->unit = trim($listArray['unit']);
+        $this->__changelist->unitprice = $listArray['unitprice'];
+        $this->__changelist->amount = $listArray['amount'];
+        $this->__changelist->insert();
+    }
+    public function getChangeListbyPmid($pmid)
+    {
+        return $this->__changelist->find(array('where' => 'pmid=?', 'param' => array($pmid), 'asc' => 'convert(lnum using gbk)', 'asArray' => TRUE));
+    }
+
+    public function getChangeListbyid($id)
+    {
+        return $this->__changelist->getOne(array('where' => 'id=?', 'param' => array($id), 'asArray' => TRUE));
+    }
+
+    public function getChangeListbylname($lname)
+    {
+        return $this->__changelist->getOne(array('where' => 'lname=?', 'param' => array(trim($lname)), 'asArray' => TRUE));
+    }
+
+    public function delChangeListbyPmid($pmid)
+    {
+        return $this->__changelist->delete(array('where' => 'pmid=?', 'param' => array($pmid)));
+    }
+
+    //changecompany
+    public function getCompanyList()
+    {
+        return $this->__changecompany->find(array('asArray' => TRUE));
+    }
+
+    public function getCompanybyid($id)
+    {
+        return $this->__changecompany->getOne(array('where' => 'id=?', 'param' => array($id), 'asArray' => TRUE));
+    }
+
+
+}

+ 303 - 0
protected/class/extras/Uploader.php

@@ -0,0 +1,303 @@
+<?php
+
+/**
+* Simple Ajax Uploader
+* Version 2.6.2
+* https://github.com/LPology/Simple-Ajax-Uploader
+*
+* Copyright 2012-2017 LPology, LLC
+* Released under the MIT license
+*
+* View the documentation for an example of how to use this class.
+*/
+
+class FileUpload {
+    private $fileName;                    // Filename of the uploaded file
+    private $fileSize;                    // Size of uploaded file in bytes
+    private $fileExtension;               // File extension of uploaded file
+    private $fileNameWithoutExt;
+    private $savedFile;                   // Path to newly uploaded file (after upload completed)
+    private $errorMsg;                    // Error message if handleUpload() returns false (use getErrorMsg() to retrieve)
+    private $isXhr;
+    public $uploadDir;                    // File upload directory (include trailing slash)
+    public $allowedExtensions;            // Array of permitted file extensions
+    public $sizeLimit = 10485760;         // Max file upload size in bytes (default 10MB)
+    public $newFileName;                  // Optionally save uploaded files with a new name by setting this
+    public $corsInputName = 'XHR_CORS_TARGETORIGIN';
+    public $uploadName = 'uploadfile';
+
+    function __construct($uploadName = null) {
+        if ($uploadName !== null) {
+            $this->uploadName = $uploadName;
+        }
+
+        if (isset($_FILES[$this->uploadName])) {
+            $this->isXhr = false;
+
+            if ($_FILES[$this->uploadName]['error'] === UPLOAD_ERR_OK) {
+                $this->fileName = $_FILES[$this->uploadName]['name'];
+                $this->fileSize = $_FILES[$this->uploadName]['size'];
+
+            } else {
+                $this->setErrorMsg($this->errorCodeToMsg($_FILES[$this->uploadName]['error']));
+            }
+
+        } elseif (isset($_SERVER['HTTP_X_FILE_NAME']) || isset($_GET[$this->uploadName])) {
+            $this->isXhr = true;
+
+            $this->fileName = isset($_SERVER['HTTP_X_FILE_NAME']) ?
+                                    $_SERVER['HTTP_X_FILE_NAME'] : $_GET[$this->uploadName];
+
+            if (isset($_SERVER['CONTENT_LENGTH'])) {
+                $this->fileSize = (int)$_SERVER['CONTENT_LENGTH'];
+
+            } else {
+                throw new Exception('Content length is empty.');
+            }
+        }
+
+        if ($this->fileName) {
+            $this->fileName = $this->sanitizeFilename($this->fileName);
+            $pathinfo = pathinfo($this->fileName);
+
+            if (isset($pathinfo['extension']) &&
+                isset($pathinfo['filename']))
+            {
+                $this->fileExtension = strtolower($pathinfo['extension']);
+                $this->fileNameWithoutExt = $pathinfo['filename'];
+            }
+        }
+    }
+
+    private function sanitizeFilename($name) {
+        $name = trim($this->basename(stripslashes($name)), ".\x00..\x20");
+
+        // Use timestamp for empty filenames
+        if (!$name) {
+            $name = str_replace('.', '-', microtime(true));
+        }
+
+        return $name;
+    }
+
+    private function basename($filepath, $suffix = null) {
+        $splited = preg_split('/\//', rtrim($filepath, '/ '));
+        return substr(basename('X'.$splited[count($splited)-1], $suffix), 1);
+    }
+
+    public function getFileName() {
+        return $this->fileName;
+    }
+
+    public function getFileSize() {
+        return $this->fileSize;
+    }
+
+    public function getFileNameWithoutExt() {
+        return $this->fileNameWithoutExt;
+    }
+
+    public function getExtension() {
+        return $this->fileExtension;
+    }
+
+    public function getErrorMsg() {
+        return $this->errorMsg;
+    }
+
+    public function getSavedFile() {
+        return $this->savedFile;
+    }
+
+    private function errorCodeToMsg($code) {
+        switch($code) {
+            case UPLOAD_ERR_INI_SIZE:
+                $message = '文件大小超出限制。';
+                break;
+            case UPLOAD_ERR_PARTIAL:
+                $message = '上传的文件只是部分上传。';
+                break;
+            case UPLOAD_ERR_NO_FILE:
+                $message = '没有上传文件。';
+                break;
+            case UPLOAD_ERR_NO_TMP_DIR:
+                $message = '缺少临时文件夹。';
+                break;
+            case UPLOAD_ERR_CANT_WRITE:
+                $message = '无法将文件写入磁盘。';
+                break;
+            case UPLOAD_ERR_EXTENSION:
+                $message = '通过扩展停止文件上传。';
+                break;
+            default:
+                $message = '未知上传错误。';
+                break;
+        }
+        return $message;
+    }
+
+    private function checkExtension($ext, $allowedExtensions) {
+        if (!is_array($allowedExtensions))
+            return false;
+
+        if (!in_array(strtolower($ext), array_map('strtolower', $allowedExtensions)))
+            return false;
+
+        return true;
+    }
+
+    private function setErrorMsg($msg) {
+        if (empty($this->errorMsg))
+            $this->errorMsg = $msg;
+    }
+
+    private function fixDir($dir) {
+        if (empty($dir))
+            return $dir;
+
+        $slash = DIRECTORY_SEPARATOR;
+        $dir = str_replace('/', $slash, $dir);
+        $dir = str_replace('\\', $slash, $dir);
+        return substr($dir, -1) == $slash ? $dir : $dir . $slash;
+    }
+
+    // escapeJS and jsMatcher are adapted from the Escaper component of
+    // Zend Framework, Copyright (c) 2005-2013, Zend Technologies USA, Inc.
+    // https://github.com/zendframework/zf2/tree/master/library/Zend/Escaper
+    private function escapeJS($string) {
+        return preg_replace_callback('/[^a-z0-9,\._]/iSu', $this->jsMatcher, $string);
+    }
+
+    private function jsMatcher($matches) {
+        $chr = $matches[0];
+
+        if (strlen($chr) == 1)
+            return sprintf('\\x%02X', ord($chr));
+
+        if (function_exists('iconv'))
+            $chr = iconv('UTF-16BE', 'UTF-8', $chr);
+
+        elseif (function_exists('mb_convert_encoding'))
+            $chr = mb_convert_encoding($chr, 'UTF-8', 'UTF-16BE');
+
+        return sprintf('\\u%04s', strtoupper(bin2hex($chr)));
+    }
+
+    public function corsResponse($data) {
+        if (isset($_REQUEST[$this->corsInputName])) {
+            $targetOrigin = $this->escapeJS($_REQUEST[$this->corsInputName]);
+            $targetOrigin = htmlspecialchars($targetOrigin, ENT_QUOTES, 'UTF-8');
+            return "<script>window.parent.postMessage('$data','$targetOrigin');</script>";
+        }
+        return $data;
+    }
+
+    public function getMimeType($path) {
+        $finfo = new finfo(FILEINFO_MIME_TYPE);
+        $fileContents = file_get_contents($path);
+        $mime = $finfo->buffer($fileContents);
+        $fileContents = null;
+        return $mime;
+    }
+
+    public function isWebImage($path) {
+        $pathinfo = pathinfo($path);
+
+        if (isset($pathinfo['extension'])) {
+            if (!in_array(strtolower($pathinfo['extension']), array('gif', 'png', 'jpg', 'jpeg')))
+                return false;
+        }
+
+        $type = exif_imagetype($path);
+
+        if (!$type)
+            return false;
+
+        return ($type == IMAGETYPE_GIF || $type == IMAGETYPE_JPEG || $type == IMAGETYPE_PNG);
+    }
+
+    private function saveXhr($path) {
+        if (false !== file_put_contents($path, fopen('php://input', 'r')))
+            return true;
+        return false;
+    }
+
+    private function saveForm($path) {
+        if (move_uploaded_file($_FILES[$this->uploadName]['tmp_name'], $path))
+            return true;
+        return false;
+    }
+
+    private function save($path) {
+        if (true === $this->isXhr)
+            return $this->saveXhr($path);
+        return $this->saveForm($path);
+    }
+
+    public function handleUpload($uploadDir = null, $allowedExtensions = null) {
+        if (!$this->fileName) {
+            $this->setErrorMsg('上传文件不正确或没有上传文件');
+            return false;
+        }
+
+        if ($this->fileSize == 0) {
+            $this->setErrorMsg('File is empty');
+            return false;
+        }
+
+        if ($this->fileSize > $this->sizeLimit) {
+            $this->setErrorMsg('文件大小超出限制');
+            return false;
+        }
+
+        if (!empty($uploadDir))
+            $this->uploadDir = $uploadDir;
+
+        $this->uploadDir = $this->fixDir($this->uploadDir);
+
+        if (!file_exists($this->uploadDir)) {
+            $this->setErrorMsg('上传目录不存在');
+            return false;
+
+        } else if (!is_writable($this->uploadDir)) {
+            $this->setErrorMsg('上载目录存在,但不可写。');
+            return false;
+        }
+
+        if (is_array($allowedExtensions))
+            $this->allowedExtensions = $allowedExtensions;
+
+        if (!empty($this->allowedExtensions)) {
+            if (!$this->checkExtension($this->fileExtension, $this->allowedExtensions)) {
+                $this->setErrorMsg('无效的文件类型');
+                return false;
+            }
+        }
+
+        $this->savedFile = $this->uploadDir . $this->fileName;
+
+        if (!empty($this->newFileName)) {
+            $this->fileName = $this->newFileName;
+            $this->savedFile = $this->uploadDir . $this->fileName;
+
+            $this->fileNameWithoutExt = null;
+            $this->fileExtension = null;
+
+            $pathinfo = pathinfo($this->fileName);
+
+            if (isset($pathinfo['filename']))
+                $this->fileNameWithoutExt = $pathinfo['filename'];
+
+            if (isset($pathinfo['extension']))
+                $this->fileExtension = strtolower($pathinfo['extension']);
+        }
+
+        if (!$this->save($this->savedFile)) {
+            $this->setErrorMsg('文件无法保存');
+            return false;
+        }
+
+        return true;
+    }
+
+}

+ 34 - 0
protected/class/extras/cors.php

@@ -0,0 +1,34 @@
+<?php
+
+/**
+* Simple Ajax Uploader
+* Version 2.6.2
+* https://github.com/LPology/Simple-Ajax-Uploader
+*
+* Copyright 2012-2017 LPology, LLC
+* Released under the MIT license
+*
+*/
+
+if (isset($_SERVER['HTTP_ORIGIN'])) {
+    header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
+    header('Access-Control-Allow-Credentials: true');
+    header('Access-Control-Max-Age: 86400');    // cache for 1 day
+}
+
+// Access-Control headers are received during OPTIONS requests
+if (isset($_SERVER['REQUEST_METHOD'])) {
+
+    if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
+
+        if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {
+            header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
+        }
+
+        if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
+            header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
+        }
+
+        exit;
+    }
+}

+ 45 - 0
protected/class/extras/sessionProgress.php

@@ -0,0 +1,45 @@
+<?php
+
+/**
+* Simple Ajax Uploader
+* Version 2.6.2
+* https://github.com/LPology/Simple-Ajax-Uploader
+*
+* Copyright 2012-2017 LPology, LLC
+* Released under the MIT license
+*
+* Returns upload progress updates for browsers that don't support the HTML5 File API.
+* Falling back to this method allows for upload progress support across virtually all browsers.
+* Requires PHP 5.4+
+* Further documentation: http://php.net/manual/en/session.upload-progress.php
+*
+*/
+
+session_start();
+
+if (!isset($_POST[ini_get('session.upload_progress.name')])) {
+    exit(json_encode(array('success' => false)));
+}
+
+$key = ini_get('session.upload_progress.prefix') . $_POST[ini_get('session.upload_progress.name')];
+
+if (!isset($_SESSION[$key])) {
+    exit(json_encode(array('success' => false)));
+}
+
+$progress = $_SESSION[$key];
+$pct = 0;
+$size = 0;
+
+if (is_array($progress)) {
+
+    if (array_key_exists('bytes_processed', $progress) && array_key_exists('content_length', $progress)) {
+
+        if ($progress['content_length'] > 0) {
+            $pct = round(($progress['bytes_processed'] / $progress['content_length']) * 100);
+            $size = round($progress['content_length'] / 1024);
+        }
+    }
+}
+
+echo json_encode(array('success' => true, 'pct' => $pct, 'size' => $size));

+ 44 - 0
protected/class/extras/uploadProgress.php

@@ -0,0 +1,44 @@
+<?php
+
+/**
+* Simple Ajax Uploader
+* Version 2.6.2
+* https://github.com/LPology/Simple-Ajax-Uploader
+*
+* Copyright 2012-2017 LPology, LLC
+* Released under the MIT license
+*
+* Returns upload progress updates for browsers that don't support the HTML5 File API.
+* Falling back to this method allows for upload progress support across virtually all browsers.
+*
+*/
+
+// This "if" statement is only necessary for CORS uploads -- if you're
+// only doing same-domain uploads then you can delete it if you want
+if (isset($_SERVER['HTTP_ORIGIN'])) {
+    header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
+    header('Access-Control-Allow-Credentials: true');
+    header('Access-Control-Max-Age: 86400');    // cache for 1 day
+}
+
+if (isset($_REQUEST['progresskey'])) {
+    $status = apc_fetch('upload_'.$_REQUEST['progresskey']);
+} else {
+    exit(json_encode(array('success' => false)));
+}
+
+$pct = 0;
+$size = 0;
+
+if (is_array($status)) {
+
+    if (array_key_exists('total', $status) && array_key_exists('current', $status)) {
+
+        if ($status['total'] > 0) {
+            $pct = round(($status['current'] / $status['total']) * 100);
+            $size = round($status['total'] / 1024);
+        }
+    }
+}
+
+echo json_encode(array('success' => true, 'pct' => $pct, 'size' => $size));

+ 4 - 0
protected/class/measureauditact.php

@@ -397,4 +397,8 @@ class MeasureauditAct
         return $this->__measureaudit->delete(array('where' => 'pid=?', 'param' => array($pid), 'asArray' => TRUE));
     }
 
+    public function getUserAuditID($pmid){
+        return $this->__measureaudit->find(array('select' => 'maid,auditoruid', 'where' => 'pmid=?', 'param' => array($pmid), 'groupby' => 'auditoruid', 'asArray' => TRUE));
+    }
+
 }

+ 5 - 0
protected/class/profile.php

@@ -98,6 +98,11 @@ class Profile
     {
         return $this->uprofile->count(array('where' => 'mobile=?', 'param' => array($number), 'asArray' => TRUE));
     }
+
+    public function checkUserName($name)
+    {
+        return $this->uprofile->getOne(array('select' => 'userid,name,company,jobs', 'where' => 'name LIKE "%'.$name.'%"', 'userid' => 'asc', 'limit' => 1, 'asArray' => TRUE));
+    }
 }
 
 ?>

+ 2 - 1
protected/config/acl.conf.php

@@ -25,7 +25,8 @@ $acl['vip']['allow'] = array(
     'RProjectController' => '*',
     'SProjectController' => '*',
     'UserController' => '*',
-    'SignController' => '*'
+    'SignController' => '*',
+    'ChangeController' => '*'
 );
 //$acl['audit']['allow'] = array(
 //    'CensorController' => '*',

+ 28 - 0
protected/config/routes.conf.php

@@ -405,4 +405,32 @@ $route['*']['/project/:pid/section/:pmid/phaseno/:mpid/intermediate/page/:pindex
 $route['*']['/project/intermediate/view/:sid'] = array('ProjectController', 'signView');
 
 
+// 变更令
+
+$route['*']['/change/index'] = array('ChangeController', 'index');
+$route['*']['/change/index/:pmid'] = array('ChangeController', 'index');
+$route['*']['/change/index/:pmid/:status'] = array('ChangeController', 'index');
+$route['*']['/change/index/:pmid/:status/page/:pindex'] = array('ChangeController', 'index');
+$route['*']['/change/dealbills/:pmid'] = array('ChangeController', 'dealBills');
+$route['*']['/change/detail/checking/:cid'] = array('ChangeController', 'changeApproval');
+$route['*']['/change/detail/update/:cid'] = array('ChangeController', 'changeReport');
+$route['*']['/change/detail/:cid'] = array('ChangeController', 'changeDetail');
+$route['*']['/change/new/:pmid'] = array('ChangeController', 'changeNew');
+$route['*']['/change/api/update/company'] = array('ChangeController', 'editCompany');
+$route['*']['/change/user/search'] = array('ChangeController', 'searchUser');
+$route['*']['/change/file/upload/:pmid'] = array('ChangeController', 'fileUpload');
+$route['*']['/change/file/upload/:pmid/:cid'] = array('ChangeController', 'fileUpload');
+$route['*']['/change/file/download/:fid'] = array('ChangeController', 'fileDownload');
+$route['*']['/change/file/delete'] = array('ChangeController', 'fileDelete');
+$route['*']['/change/check/pnum'] = array('ChangeController', 'pnumCheck');
+
+// 变更令软件接口
+/**
+ * 签约清单导入
+ */
+$route['*']['/api/client/change/list/create'] = array('ClientController', 'changeListAdd');
+/*
+ * 导出变更令内容
+ */
+$route['*']['/api/client/change/get/:pmid/list'] = array('ClientController', 'changeList');
 ?>

+ 1 - 1
protected/config/ver.conf.php

@@ -1,5 +1,5 @@
 <?php
 
 // Version
-$config['ver'] = 'v2.0.1';
+$config['ver'] = 'v2.1.0';
 

文件差异内容过多而无法显示
+ 1529 - 0
protected/controller/ChangeController.php


+ 91 - 1
protected/controller/ClientController.php

@@ -19,6 +19,7 @@ Doo::loadModelAt('aconfig', 'admin');
 Doo::loadClass('sms');
 Doo::loadClass('sign');
 Doo::loadClass('measureconcerner');
+Doo::loadClass('change');
 
 //
 //                       _oo0oo_
@@ -55,7 +56,13 @@ Doo::loadClass('measureconcerner');
 class ClientController extends DooController
 {
 
-    private $data, $sign, $concern, $client, $auth, $att, $file, $zip, $actmeasure, $contractact, $project, $profile, $numofperact, $measureauditact, $attfile, $users, $itemfile, $modelconfig, $aconfig, $sms, $itemMeasureNum;
+    private $data, $sign, $change, $concern, $client, $auth, $att, $file, $zip, $actmeasure, $contractact, $project, $profile, $numofperact, $measureauditact, $attfile, $users, $itemfile, $modelconfig, $aconfig, $sms, $itemMeasureNum;
+
+    private $changeType = array('1' => 'A.位置', '2' => 'B.数量', '3' => 'C.结构', '4' => 'D.新增', '5' => 'E.取消', '6' => 'F.纠错');
+
+    private $changeCategory = array('1' => 'A类变更(设计变更)', '2' => 'B类变更(施工措施变更)', '3' => 'C类变更(计划变更)', '4' => 'D类变更(条件变更)', '5' => 'E类变更(新增工程)');
+
+    private $changeNature = array('1' => '一般设计变更', '2' => '较大设计变更', '3' => '重大设计变更');
 
     private $statusArray = array('uncheck' => '1', 'checking' => '2', 'checked' => '3', 'checkno' => '4');
     private $fileTypeArray = array('台帐附件');
@@ -81,6 +88,7 @@ class ClientController extends DooController
         $this->aconfig = new AConfig();
         $this->sign = new signn();
         $this->concern = new MeasureConcerner();
+        $this->change = new Changes();
         $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_ACCOUNT, DOO::conf()->SMS_PASSWORD, DOO::conf()->SMS_EXTNO);
     }
 
@@ -2054,6 +2062,88 @@ class ClientController extends DooController
         echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $imediateswitch), JSON_UNESCAPED_UNICODE);
         die();
     }
+
+    /**
+     * 变更令签约清单列表添加
+     */
+    public function changeListAdd(){
+
+        if(isset($_POST['pmid']) && is_numeric($_POST['pmid']) && isset($_POST['listjson']) && !empty($_POST['listjson'])){
+            $pmArray = $this->actmeasure->getRowByPmid($_POST['pmid']);
+            if(!empty($pmArray)){
+                $listjson = json_decode($_POST['listjson'],true);
+                //先删除原有的清单列表再重新添加
+                $this->change->delChangeListbyPmid($_POST['pmid']);
+                Doo::loadModel('changelist');
+                foreach($listjson as $k => $v){
+                    $changelist = new ChangeList();
+                    $changelist->insertChangelist($pmArray,$v);
+                }
+                echo json_encode(array('status' => TRUE, 'info' => ''), JSON_UNESCAPED_UNICODE);
+                die();
+            }else{
+                echo json_encode(array('status' => 'FALSE', 'msg' => '不存在此标段'), JSON_UNESCAPED_UNICODE);
+                die();
+            }
+        }else{
+            echo json_encode(array('status' => 'FALSE', 'msg' => '参数有误'), JSON_UNESCAPED_UNICODE);
+            die();
+        }
+    }
+
+    /*
+     * 标段的变更令内容导出
+     */
+    public function changeList()
+    {
+        if(isset($this->params['pmid']) && is_numeric($this->params['pmid'])){
+            $pmArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
+            if(!empty($pmArray)){
+                $idlist = array();
+                $list = array();
+                $newcidlist = array();
+                //获取所有通过的变更令内容
+                $cidlist = $this->change->getPassChangeListID($this->params['pmid']);
+                if(empty($cidlist)){
+                    echo json_encode(array('status' => 'TRUE', 'msg' => '当前标段不存在变更令内容', 'info' => ''), JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+                foreach($cidlist as $ck => $cv){
+                    array_push($newcidlist,$cv['cid']);
+                }
+                //过滤掉已上传完的list
+                if(isset($_POST['filter']) && !empty($_POST['filter'])){
+                    $filter = explode(',',$_POST['filter']);
+                    $idlist = array_diff($newcidlist,$filter);
+                }else{
+                    $idlist = $newcidlist;
+                }
+                if(empty($idlist)){
+                    echo json_encode(array('status' => 'TRUE', 'msg' => '当前标段不存在需要更新的变更令', 'info' => ''), JSON_UNESCAPED_UNICODE);
+                    die();
+                }else{
+                    $index = 0;
+                    foreach($idlist as $k => $v){
+                        $changeArray = $this->change->getChangebyid($v);
+                        $list[$index] = $changeArray;
+                        $list[$index]['changeCategory'] = $this->changeCategory[$changeArray['category']];
+                        $list[$index]['changeNature'] = $this->changeNature[$changeArray['cnature']];
+                        $list[$index]['company'] = $this->change->getCompanybyid($changeArray['companyid'])['name'];
+                        $list[$index]['changeBills'] = $this->change->getChangeAuditListbycid($v);
+                        $index++;
+                    }
+                    echo json_encode(array('status' => 'TRUE', 'msg' => '', 'info' => $list), JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+            }else{
+                echo json_encode(array('status' => 'FALSE', 'msg' => '不存在此标段'), JSON_UNESCAPED_UNICODE);
+                die();
+            }
+        }else{
+            echo json_encode(array('status' => 'FALSE', 'msg' => '参数有误'), JSON_UNESCAPED_UNICODE);
+            die();
+        }
+    }
 }
 
 ?>

+ 7 - 1
protected/controller/ProjectController.php

@@ -13,6 +13,7 @@ Doo::loadClass('attachment');
 Doo::loadHelper('DooPager');
 Doo::loadClass('sign');
 Doo::loadModelAt('aconfig', 'admin');
+Doo::loadClass('change');
 
 /* * proDetail
  * MainController
@@ -24,7 +25,7 @@ Doo::loadModelAt('aconfig', 'admin');
 class ProjectController extends DooController
 {
 
-    private $data, $sign, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审批</span>', 'checking' => '<span class = "colOrange">审批中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>'), $aconfig, $itemmeasurenum, $itemfle, $att;
+    private $data, $sign, $auth, $attfile, $profile, $change, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审批</span>', 'checking' => '<span class = "colOrange">审批中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>'), $aconfig, $itemmeasurenum, $itemfle, $att;
 
     public function beforeRun($resource, $action)
     {
@@ -53,6 +54,7 @@ class ProjectController extends DooController
         $this->itemfle = new ItemFile();
         $this->att = new attachment();
         $this->sign = new Signn();
+        $this->change = new Changes();
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'p';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
@@ -79,6 +81,10 @@ class ProjectController extends DooController
 
         //草图入口
         $this->data['imediateSwitch'] = $this->aconfig->getOne(array('select' => 'imediateswitch', 'asArray' => TRUE))['imediateswitch'];
+
+        //获取需要你审批的变更令数目
+        $this->data['needChangeNum'] = $this->change->getNeedChangeNumbyUid($this->auth->getUid()) != 0 ? $this->change->getNeedChangeNumbyUid($this->auth->getUid()) : '';
+
     }
 
     function getsoftware(){

+ 7 - 1
protected/controller/RProjectController.php

@@ -14,6 +14,7 @@ Doo::loadClass('itemfile');
 Doo::loadClass('attachment');
 Doo::loadHelper('DooPager');
 Doo::loadClass('sign');
+Doo::loadClass('change');
 
 /**
  * MainController
@@ -25,7 +26,7 @@ class RProjectController extends DooController
 {
 
 
-    private $data, $sign, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审批', 'checking' => '审批中', 'checked' => '已审批', 'checkno' => '未通过'), $aconfig, $sms, $itemfile, $itemmeasurenum, $itemfle, $att;
+    private $data, $sign, $auth, $attfile, $profile, $change, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审批', 'checking' => '审批中', 'checked' => '已审批', 'checkno' => '未通过'), $aconfig, $sms, $itemfile, $itemmeasurenum, $itemfle, $att;
 
     public function __construct()
     {
@@ -43,6 +44,7 @@ class RProjectController extends DooController
         $this->itemfle = new ItemFile();
         $this->att = new attachment();
         $this->sign = new Signn();
+        $this->change = new Changes();
         $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_ACCOUNT, DOO::conf()->SMS_PASSWORD, DOO::conf()->SMS_EXTNO);
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'r';
@@ -70,6 +72,10 @@ class RProjectController extends DooController
 
         //草图入口
         $this->data['imediateSwitch'] = $this->aconfig->getOne(array('select' => 'imediateswitch', 'asArray' => TRUE))['imediateswitch'];
+
+        //获取需要你审批的变更令数目
+        $this->data['needChangeNum'] = $this->change->getNeedChangeNumbyUid($this->auth->getUid()) != 0 ? $this->change->getNeedChangeNumbyUid($this->auth->getUid()) : '';
+
     }
 
     function getsoftware(){

+ 6 - 1
protected/controller/SProjectController.php

@@ -14,6 +14,7 @@ Doo::loadHelper('DooPager');
 Doo::loadClass('sign');
 Doo::loadModelAt('aconfig', 'admin');
 Doo::loadClass('measureconcerner');
+Doo::loadClass('change');
 
 /**
  * MainController
@@ -24,7 +25,7 @@ Doo::loadClass('measureconcerner');
 class SProjectController extends DooController
 {
 
-    private $aconfig,$data, $sign, $concern, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $measureauditact, $itemmeasurenum, $itemfle, $att;
+    private $aconfig,$data, $sign, $concern, $auth, $change, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $measureauditact, $itemmeasurenum, $itemfle, $att;
 
     public function beforeRun($resource, $action)
     {
@@ -57,6 +58,7 @@ class SProjectController extends DooController
         $this->itemfle = new ItemFile();
         $this->att = new attachment();
         $this->sign = new Signn();
+        $this->change = new Changes();
         $this->concern = new MeasureConcerner();
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 's';
@@ -84,6 +86,9 @@ class SProjectController extends DooController
 
         //草图入口
         $this->data['imediateSwitch'] = $this->aconfig->getOne(array('select' => 'imediateswitch', 'asArray' => TRUE))['imediateswitch'];
+
+        //获取需要你审批的变更令数目
+        $this->data['needChangeNum'] = $this->change->getNeedChangeNumbyUid($this->auth->getUid()) != 0 ? $this->change->getNeedChangeNumbyUid($this->auth->getUid()) : '';
     }
 
     function getsoftware(){

+ 6 - 1
protected/controller/SignController.php

@@ -11,6 +11,7 @@ Doo::loadClass('measureauditact');
 Doo::loadClass('sign');
 Doo::loadClass('sms');
 Doo::loadModelAt('aconfig', 'admin');
+Doo::loadClass('change');
 //define('FPDF_FONTPATH','protected/class/fpdf1.5/font/');
 //Doo::loadClass('fpdf');
 
@@ -24,7 +25,7 @@ Doo::loadModelAt('aconfig', 'admin');
 class SignController extends DooController
 {
 
-    private $aconfig, $data, $sms, $sign, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审批</span>', 'checking' => '<span class = "colOrange">审批中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>');
+    private $aconfig, $data, $sms, $sign, $auth, $change, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审批</span>', 'checking' => '<span class = "colOrange">审批中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>');
 
     public function beforeRun($resource, $action)
     {
@@ -50,6 +51,7 @@ class SignController extends DooController
         $this->numofperact = new NumofperAct();
         $this->measureauditact = new MeasureauditAct();
         $this->sign = new Signn();
+        $this->change = new Changes();
         $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_ACCOUNT, DOO::conf()->SMS_PASSWORD, DOO::conf()->SMS_EXTNO);
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'sign';
@@ -75,6 +77,9 @@ class SignController extends DooController
         //获取需要您签署的数目
         $this->data['needSignNum'] = $this->sign->getNeedSignNumbyUid($this->auth->getUid()) != 0 ? $this->sign->getNeedSignNumbyUid($this->auth->getUid()) : '';
 
+        //获取需要你审批的变更令数目
+        $this->data['needChangeNum'] = $this->change->getNeedChangeNumbyUid($this->auth->getUid()) != 0 ? $this->change->getNeedChangeNumbyUid($this->auth->getUid()) : '';
+
         //获取桌面版本
         $this->getsoftware();
     }

+ 6 - 1
protected/controller/UserController.php

@@ -15,6 +15,7 @@ Doo::loadClass('measureauditact');
 Doo::loadClass('sign');
 Doo::loadClass('phpqrcode');
 Doo::loadClass('Hashids/Hashids');
+Doo::loadClass('change');
 /* * proDetail
  * MainController
  * Feel free to delete the methods and replace them with your own code.
@@ -25,7 +26,7 @@ Doo::loadClass('Hashids/Hashids');
 class UserController extends DooController
 {
 
-    private $data, $sign, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $user, $ph, $sms, $aconfig, $__hashids;
+    private $data, $sign, $auth, $attfile, $change, $profile, $project, $contractact, $actmeasure, $numofperact, $user, $ph, $sms, $aconfig, $__hashids;
 
     public function beforeRun($resource, $action)
     {
@@ -59,6 +60,7 @@ class UserController extends DooController
         $this->aconfig = new AConfig();
         $this->measureauditact = new MeasureauditAct();
         $this->sign = new signn();
+        $this->change = new Changes();
         $this->__hashids = new Hashids\Hashids('jlzfuserid', 8);
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = '';
@@ -80,6 +82,9 @@ class UserController extends DooController
         if($this->data['signSwitch'] > 0)
             $this->data['needSignNum'] = $this->sign->getNeedSignNumbyUid($this->auth->getUid()) != 0 ? $this->sign->getNeedSignNumbyUid($this->auth->getUid()) : '';
 
+        //获取需要你审批的变更令数目
+        $this->data['needChangeNum'] = $this->change->getNeedChangeNumbyUid($this->auth->getUid()) != 0 ? $this->change->getNeedChangeNumbyUid($this->auth->getUid()) : '';
+
         //获取桌面版本
         $this->data['version'] = '';
         $this->getsoftware();

+ 46 - 0
protected/model/change.php

@@ -0,0 +1,46 @@
+<?php
+
+Doo::loadCore('db/DooModel');
+
+/**
+ * 变更令表
+ */
+class Change extends DooModel {
+
+    public $cid;
+    public $pid;
+    public $stid;
+    public $pmid;
+    public $uid;
+    public $pnum;
+    public $pname;
+    public $mnum;
+    public $odname;
+    public $onum;
+    public $cdname;
+    public $cnum;
+    public $description;
+    public $basis;
+    public $remarks;
+    public $ctype;
+    public $category;
+    public $cnature;
+    public $companyid;
+    public $bear;
+    public $totalamount;
+    public $times;
+    public $status;
+    public $intime;
+    public $cintime;
+    public $sintime;
+    public $_table = 'jl_change';
+    public $_primarykey = 'cid';
+    public $_fields = array('cid', 'pid', 'stid', 'pmid', 'uid', 'pnum', 'pname', 'mnum', 'odname', 'onum', 'cdname', 'cnum', 'description', 'basis', 'remarks', 'ctype', 'category', 'cnature', 'companyid', 'bear', 'totalamount', 'times', 'status', 'intime', 'cintime', 'sintime');
+
+    public function __construct() {
+        parent::setupModel(__CLASS__);
+    }
+
+}
+
+?>

+ 31 - 0
protected/model/changeatt.php

@@ -0,0 +1,31 @@
+<?php
+
+Doo::loadCore('db/DooModel');
+
+/**
+ * 用户表
+ */
+class ChangeAtt extends DooModel {
+
+    public $id;
+    public $pid;
+    public $stid;
+    public $pmid;
+    public $cid;
+    public $uid;
+    public $filename;
+    public $fileext;
+    public $filesize;
+    public $filepath;
+    public $intime;
+    public $_table = 'jl_change_attachment';
+    public $_primarykey = 'id';
+    public $_fields = array('id', 'pid', 'stid', 'pmid', 'cid', 'uid', 'filename', 'fileext', 'filesize', 'filepath', 'intime');
+
+    public function __construct() {
+        parent::setupModel(__CLASS__);
+    }
+
+}
+
+?>

+ 110 - 0
protected/model/changeaudit.php

@@ -0,0 +1,110 @@
+<?php
+
+Doo::loadCore('db/DooModel');
+
+/**
+ * 变更用户申报清单关联表
+ */
+class ChangeAudit extends DooModel {
+
+    public $id;
+    public $pid;
+    public $stid;
+    public $pmid;
+    public $cid;
+    public $times;
+    public $usite;
+    public $usort;
+    public $uid;
+    public $company;
+    public $jobs;
+    public $name;
+    public $status;
+    public $sdesc;
+    public $sintime;
+    public $list_json;
+    public $_table = 'jl_change_audit';
+    public $_primarykey = 'id';
+    public $_fields = array('id', 'pid', 'stid', 'pmid', 'cid', 'times', 'usite', 'usort', 'uid', 'company', 'jobs', 'name', 'status', 'sdesc', 'sintime', 'list_json');
+
+    public function __construct() {
+        parent::setupModel(__CLASS__);
+    }
+
+    public function insertChangeAudit($auditArray,$status,$sort,$time = '')
+    {
+        $this->pid = $auditArray['pid'];
+        $this->stid = $auditArray['stid'];
+        $this->pmid = $auditArray['pmid'];
+        $this->cid = $auditArray['cid'];
+        $this->times = !empty($time) ? $time : $auditArray['times'];
+        $this->usite = $auditArray['usite'];
+        $this->usort = $sort;
+        $this->uid = $auditArray['uid'];
+        $this->company = $auditArray['company'];
+        $this->jobs = $auditArray['jobs'];
+        $this->jobs = $auditArray['jobs'];
+        $this->name = $auditArray['name'];
+        $this->status = $status;
+        $this->insert();
+    }
+
+    public function getOneChangeAudit($uid,$cid,$times)
+    {
+        return $this->getOne(array('where' => 'cid=? and uid=? and times=? and usite!=0', 'desc' => 'usort', 'param' => array($cid,$uid,$times), 'asArray' => TRUE));
+    }
+
+    public function updateChangeAudit($uid,$cid,$times,$status,$desc,$time, $list = '')
+    {
+        $oneaudit = $this->getOneChangeAudit($uid,$cid,$times);
+
+        $this->id = $oneaudit['id'];
+        $this->status = $status;
+        $this->sdesc = $desc;
+        $this->sintime = $time;
+        $this->list_json = $list;
+        $this->update();
+    }
+
+    public function getChangeAuditsbycidtime($cid,$times)
+    {
+        return $this->find(array('where' => 'cid=? and times=? and usite!=0', 'groupby' => 'usite', 'asc' => 'usort', 'param' => array($cid,$times), 'asArray' => TRUE));
+    }
+
+    public function getChangeAuditbylastlist($cid,$times)
+    {
+        $sql = 'SELECT * FROM (SELECT MAX(usort) as ust FROM `jl_change_audit` WHERE cid='.$cid.' and times='.$times.' and usite!=0 GROUP BY usite ) as b JOIN `jl_change_audit` as a ON a.usort = b.ust WHERE cid='.$cid.' and times='.$times.' and usite!=0 ORDER BY usite';
+        $query = Doo::db ()->query ( $sql );
+
+        $result = $query->fetchAll ();
+
+        return $result;
+    }
+
+    public function getChangeAuditsbycid($cid)
+    {
+        return $this->find(array('where' => 'cid=?', 'asc' => 'id', 'param' => array($cid), 'asArray' => TRUE));
+    }
+
+    public function getChangeAuditsbycidtimeWithout($cid,$times,$lastuid,$uid){
+        return $this->find(array('where' => 'cid=? and times=? and usite!=0 and uid not in(?,?) and status="uncheck"', 'asc' => 'usort', 'param' => array($cid,$times,$lastuid,$uid), 'asArray' => TRUE));
+    }
+
+    public function getChangeAuditbycidsitetime($cid,$times,$sort)
+    {
+        return $this->getOne(array('where' => 'cid=? and times=? and usite=?', 'desc' => 'usort', 'param' => array($cid,$times,$sort), 'asArray' => TRUE));
+    }
+    //默认取最后一个审批人,site取0则取最后一个创建人
+    public function getChangeAuditLastUser($cid,$site = 1)
+    {
+        $sql = $site == 0 ? ' and usite=0' : '';
+        return $this->getOne(array('where' => 'cid=?'.$sql, 'desc' => 'usort', 'param' => array($cid), 'asArray' => TRUE));
+    }
+
+    public function deleteChangeAuditthisTime($cid,$times)
+    {
+        return $this->delete(array('where' => 'cid=? and times=? and usite!=0', 'param' => array($cid,$times)));
+    }
+}
+
+?>

+ 35 - 0
protected/model/changeauditlist.php

@@ -0,0 +1,35 @@
+<?php
+
+Doo::loadCore('db/DooModel');
+
+/**
+ * 变更令审批表
+ */
+class ChangeAuditList extends DooModel {
+
+    public $id;
+    public $pid;
+    public $stid;
+    public $pmid;
+    public $cid;
+    public $lid;
+    public $lnum;
+    public $lname;
+    public $unit;
+    public $unitprice;
+    public $oamount;
+    public $camount;
+    public $samount;
+    public $auditjson;
+    public $_table = 'jl_change_audit_list';
+    public $_primarykey = 'id';
+    public $_fields = array('id', 'pid', 'stid', 'pmid', 'cid', 'lid', 'lnum', 'lname', 'unit', 'unitprice', 'oamount', 'camount', 'samount', 'auditjson');
+
+    public function __construct() {
+        parent::setupModel(__CLASS__);
+    }
+
+}
+
+
+?>

+ 24 - 0
protected/model/changecompany.php

@@ -0,0 +1,24 @@
+<?php
+
+Doo::loadCore('db/DooModel');
+
+/**
+ * 变更令审批表
+ */
+class ChangeCompany extends DooModel {
+
+    public $id;
+    public $cid;
+    public $name;
+    public $csort;
+    public $_table = 'jl_change_company';
+    public $_primarykey = 'id';
+    public $_fields = array('id', 'cid', 'name', 'csort');
+
+    public function __construct() {
+        parent::setupModel(__CLASS__);
+    }
+
+}
+
+?>

+ 42 - 0
protected/model/changelist.php

@@ -0,0 +1,42 @@
+<?php
+
+Doo::loadCore('db/DooModel');
+
+/**
+ * 变更令审批表
+ */
+class ChangeList extends DooModel {
+
+    public $id;
+    public $pid;
+    public $stid;
+    public $pmid;
+    public $lnum;
+    public $lname;
+    public $unit;
+    public $unitprice;
+    public $amount;
+    public $_table = 'jl_change_list';
+    public $_primarykey = 'id';
+    public $_fields = array('id', 'pid', 'stid', 'pmid', 'lnum', 'lname', 'unit', 'unitprice', 'amount');
+
+    public function __construct() {
+        parent::setupModel(__CLASS__);
+    }
+
+    public function insertChangelist($pmArray,$listArray)
+    {
+        $this->pid = $pmArray['pid'];
+        $this->stid = $pmArray['stid'];
+        $this->pmid = $pmArray['pmid'];
+        $this->lnum = trim($listArray['lnum']);
+        $this->lname = trim($listArray['lname']);
+        $this->unit = trim($listArray['unit']);
+        $this->unitprice = $listArray['unitprice'];
+        $this->amount = $listArray['amount'];
+        return $this->insert();
+    }
+
+}
+
+?>

+ 15 - 11
protected/module/admin/view/admin-userlist.html

@@ -67,17 +67,21 @@
     </div>
 </div>
 <!--重置密码-->
-<div class="modal hide fade" id="sendpw">
-    <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-        <h4 class="modal-title">重置密码成功</h4>
-    </div>
-    <div class="modal-body">
-        <p>系统已将新密码发送至该用户的登录邮箱:<b id="email"></b></p>
-        <p>如果长时间无法接收到邮件,请确认该邮箱是否可以正常接收邮件;</p>
-        <p>添加 postmaster@zhzd.sendcloud.org 至邮箱白名单,再重新操作<b>重置密码</b>。</p>
-    </div>
-    <div class="modal-footer">
+<div class="modal fade" id="sendpw">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+                <h4 class="modal-title">重置密码成功</h4>
+            </div>
+            <div class="modal-body">
+                <p>系统已将新密码发送至该用户的登录邮箱:<b id="email"></b></p>
+                <p>如果长时间无法接收到邮件,请确认该邮箱是否可以正常接收邮件;</p>
+                <p>添加 postmaster@zhzd.sendcloud.org 至邮箱白名单,再重新操作<b>重置密码</b>。</p>
+            </div>
+            <div class="modal-footer">
+            </div>
+        </div>
     </div>
 </div>
 <!--重置密码-->

+ 6 - 1
protected/plugin/TemplateTag.php

@@ -3,7 +3,7 @@
 //register global/PHP functions to be used with your template files
 //You can move this to common.conf.php   $config['TEMPLATE_GLOBAL_TAGS'] = array('isset', 'empty');
 //Every public static methods in TemplateTag class (or tag classes from modules) are available in templates without the need to define in TEMPLATE_GLOBAL_TAGS
-Doo::conf()->TEMPLATE_GLOBAL_TAGS = array('upper', 'tofloat', 'sample_with_args', 'debug', 'url', 'url2', 'function_deny', 'zhisset', 'empty', 'formatDate', 'ToChinaseNum');
+Doo::conf()->TEMPLATE_GLOBAL_TAGS = array('upper', 'tofloat', 'sample_with_args', 'debug', 'url', 'url2', 'function_deny', 'zhisset', 'in_phparray', 'empty', 'formatDate', 'ToChinaseNum');
 
 /**
   Define as class (optional)
@@ -47,6 +47,11 @@ function zhisset($val) {
     return isset($val);
 }
 
+function in_phparray($val,$list){
+	$list = explode(',',$list);
+	return in_array($val,$list);
+}
+
 //Build URL based on route id
 function url($id, $param = null, $addRootUrl = false) {
     Doo::loadHelper('DooUrlBuilder');

+ 467 - 0
protected/view/biangeng-approval.html

@@ -0,0 +1,467 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+	<meta charset=utf-8>
+	<title>纵横计量支付系统</title>
+	<meta name=description content=计量支付>
+	<meta name=copyright content=smartcost.com.cn>
+	<meta name="viewport" content="width=device-width,initial-scale=1.0">
+	<link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+	<link rel="stylesheet" type="text/css" href="{{rootUrl}}global/css/dataTables.bootstrap.min.css">
+	<link rel="stylesheet" type="text/css" href="{{rootUrl}}global/css/fixedColumns.bootstrap.min.css">
+	<link rel=stylesheet href={{rootUrl}}global/css/style.css>
+	<link href="{{rootUrl}}global/css/assets/styles.css" rel="stylesheet">
+	<script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+	<script src={{rootUrl}}global/js/bootstrap.js></script>
+	<script src={{rootUrl}}global/js/jl.js></script>
+	<style type="text/css" class="init">
+		#list td input{
+			width: 100%
+		}
+		.allwidth1{
+			/*width: 16% !important;*/
+			max-width: 250px !important;
+		}
+		.allwidth2{
+			/*width: 9% !important;*/
+			max-width: 150px !important;
+		}
+		.allwidth3{
+			/*width: 5% !important;*/
+			max-width: 100px !important;
+		}
+	</style>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+	<!-- include "left" -->
+	<div class="mainContainer" data-spy="scroll" data-target="#navbar-example">
+		<!--内容-->
+		<div class="mainContent">
+			<input id="pmid" type="hidden" value="{{pmArray.pmid}}">
+			<input id="cid" type="hidden" value="{{cid}}">
+			<div class="title" id="xinxi">
+				<div class="bg-top-btn affix"><button class="btn btn-success showapproval" status="pass">通过</button>&nbsp;<button class="btn btn-warning showapproval" status="back">退回</button>&nbsp;<button class="btn btn-danger showapproval" status="stop">不通过</button></div>
+				<h1><a href="/change/index/{{pmArray.pmid}}" title="返回"><span class="closePanel" aria-hidden="true" data-icon="Z"></span></a>&nbsp;{{changeArray.pnum}}</h1>
+			</div>
+			<div class="row">
+				<div class="col-md-2" id="navbar-example">
+					<ul class="nav nav-pills nav-stacked bg-nav affix">
+						<li><a href="#xinxi"><span class="glyphicon glyphicon-info-sign"></span> 变更信息</a></li>
+						<li><a href="#qingdan"><span class="glyphicon glyphicon-list-alt"></span> 变更清单</a></li>
+						<li><a href="#fujian"><span class="glyphicon glyphicon-paperclip"></span> 附件</a></li>
+						<li><a href="#shenpi"><span class="glyphicon glyphicon-check"></span> 审批流程</a></li>
+					</ul>
+				</div>
+				<div class="col-md-10">
+					<div class="bg-con-warp">
+						<legend><span class="glyphicon glyphicon-info-sign"></span> 变更信息</legend>
+						<div class="row">
+							<div class="col-md-4">
+								<div class="form-group">
+									<label>申请编号</label>
+									<input class="form-control" value="{{changeArray.pnum}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>工程名称</label>
+									<input class="form-control" value="{{changeArray.pname}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>桩号</label>
+									<input class="form-control" value="{{changeArray.mnum}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>原设计图名称</label>
+									<input class="form-control" placeholder="" value="{{changeArray.odname}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>原图号</label>
+									<input class="form-control" placeholder="" value="{{changeArray.onum}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>变更设计图名称</label>
+									<input class="form-control" placeholder="" value="{{changeArray.cdname}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>变更图号</label>
+									<input class="form-control" placeholder="" value="{{changeArray.cnum}}" type="text" readonly disabled>
+								</div>
+							</div>
+							<div class="col-md-4">
+								<div class="form-group">
+									<label>工程变更理由及内容</label>
+										    <textarea class="form-control" rows="6" readonly disabled>{{changeArray.description}}</textarea>
+								</div>
+								<div class="form-group">
+									<label>工程变更合同依据</label>
+									<textarea class="form-control" rows="6" readonly disabled>{{changeArray.basis}}</textarea>
+								</div>
+								<div class="form-group">
+									<label>备注</label>
+									<textarea class="form-control" rows="3" readonly disabled>{{changeArray.remarks}}</textarea>
+								</div>
+							</div>
+							<div class="col-md-4">
+								<!-- if !empty({{changeArray.ctype}}) -->
+								<div class="form-group">
+									<label>变更类型</label>
+									<div class="checkbox">
+										<!-- loop changeArray.ctypelist -->
+										<label class="checkbox-inline">
+											<input type="checkbox" checked disabled>{{ctypelist' value.typename}}
+										</label>
+										<!-- endloop -->
+									</div>
+								</div>
+								<!-- endif -->
+								<div class="form-group">
+									<label>变更类别 </label>
+									<select class="form-control" disabled><option>{{changeArray.categoryname}}</option></select>
+								</div>
+								<div class="form-group">
+									<label>变更性质 </label>
+									<select class="form-control" disabled><option>{{changeArray.naturename}}</option></select>
+								</div>
+								<div class="form-group">
+									<label>变更提出单位</label>
+									<select class="form-control" disabled><option>{{changeArray.companyname}}</option></select>
+								</div>
+								<div class="form-group">
+									<label>费用承担方</label>
+									<div class="radio">
+										<label class="radio-inline">
+											<input id="inlineCheckbox1" value="option1" type="radio" checked disabled> <!-- if {{changeArray.bear}} == 1 -->业主<!-- else -->承包人<!-- endif -->
+										</label>
+									</div>
+								</div>
+							</div>
+						</div>
+					</div>
+					<div class="bg-con-warp">
+						<legend id="qingdan"><span class="glyphicon glyphicon-list-alt"></span> 变更清单</legend>
+						{{listtablehtml}}
+					</div>
+					<div class="bg-con-warp">
+						<legend id="fujian"><span class="glyphicon glyphicon-paperclip"></span> 附件&nbsp;&nbsp;<a href="#addfujian" class="btn btn-primary btn-xs" data-toggle="modal"><span class="glyphicon glyphicon-open"></span> 上传附件</a></legend>
+						<table class="table table-bordered">
+							<thead>
+							<tr><th width="50">序号</th><th>名称</th><th width="90">大小</th><th width="100">上传时间</th><th width="100">操作</th></tr>
+							</thead>
+							<tbody id="filesshow">
+							<!-- if !empty({{attlist}}) -->
+							<!-- loop attlist -->
+							<tr><td>{{attlist' value.sort}}</td><td><a href="{{attlist' value.downurl}}">{{attlist' value.filename}}</a></td><td>{{attlist' value.size}}</td><td>{{attlist' value.time}}</td><td><!-- if {{attlist' value.uid}} == {{userid}} --><a id="delatt_{{attlist' value.fid}}" file_id="{{attlist' value.fid}}" class="btn btn-default btn-sm" title="删除附件"><span class="glyphicon glyphicon-trash text-danger"></span></a><!-- endif --></td></tr>
+							<!-- endloop -->
+							<!-- endif -->
+							</tbody>
+						</table>
+					</div>
+					<div class="bg-con-warp">
+						<legend id="shenpi"><span class="glyphicon glyphicon-check"></span> 审批流程</legend>
+						<table class="table table-bordered">
+							<!-- loop auditlist -->
+							<tr>
+								<td width="100"><!-- if {{auditlist' value.usite}} == 0 -->提交人<!-- else -->第{{auditlist' value.usite}}个审批人<!-- endif --></td>
+								<td width="250"><h4 class="media-heading">{{auditlist' value.jobs}} {{auditlist' value.name}}</h4>
+									{{auditlist' value.company}}</td>
+								<!-- if {{auditlist' value.usite}} == 0 -->
+								<!-- if {{auditlist' value.status}} == 'checked' --><td width="100" class="colGreen">上报完成</td><td>{{formatDate(auditlist' value.sintime)}}<br></td>
+								<!-- elseif {{auditlist' value.times}} == 0  && {{auditlist' value.status}} == 'checking' --><td width="100" class="colOrange">上报中</td><td><br></td>
+								<!-- elseif {{auditlist' value.times}} != 0 && {{auditlist' value.status}} == 'checking' --><td width="100" class="colOrange">重新上报中</td><td><br></td>
+								<!-- endif -->
+								<!-- else -->
+								<!-- if {{auditlist' value.status}} == 'checked' --><td width="100" class="colGreen">审批通过</td><td>{{formatDate(auditlist' value.sintime)}}<br>{{auditlist' value.sdesc}}</td>
+								<!-- elseif {{auditlist' value.status}} == 'back' || {{auditlist' value.status}} == 'backnew' --><td width="100" class="colRed">退回</td><td>{{formatDate(auditlist' value.sintime)}}<br>{{auditlist' value.sdesc}}</td>
+								<!-- elseif {{auditlist' value.status}} == 'checkno' --><td width="100" class="colRed">审批不通过</td><td>{{formatDate(auditlist' value.sintime)}}<br>{{auditlist' value.sdesc}}</td>
+								<!-- elseif {{auditlist' value.status}} == 'checking' --><td width="100" class="colOrange">审批中</td><td></td>
+								<!-- else --><td width="100"></td><td></td>
+								<!-- endif -->
+								<!-- endif -->
+							</tr>
+							<!-- endloop -->
+						</table>
+					</div>
+				</div>
+			</div>
+		</div>
+		<!--内容-->
+	</div>
+</div>
+<!-- 审批弹出 -->
+<div id="approval" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+	<div class="modal-dialog">
+		<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+				<h4 class="modal-title">审批变更</h4>
+			</div>
+			<form method="post">
+				<input type="hidden" name="approval" value="1">
+				<input type="hidden" name="clist" id="oneclist" value="">
+				<input type="hidden" name="lastuid" value="{{lastuid}}">
+			<div class="modal-body">
+				<div class="form-group">
+					<label>审批意见</label>
+					<textarea class="form-control" name="desc" rows="4"></textarea>
+				</div>
+				<div class="alert alert-success" style="display: none;" role="alert">审批通过,将由下一审批人继续审批,如果您是终审,变更审批将完成。</div>
+				<div class="alert alert-warning" style="display: none;" role="alert">审批退回,将由上一审批人重新审批或将由原报重新提交变更。</div>
+				<div class="alert alert-danger" style="display: none;" role="alert">审批不通过,将结束本次审批。</div>
+				<div id="backform" style="display: none">
+				<!-- if {{firstcheck}} == 0 -->
+				<label class="radio-inline">
+					<input type="radio" name="back" value="1" checked> 退回上一个审批人 <b>{{lastusername}}</b>
+				</label>
+				<!-- endif -->
+				<label class="radio-inline">
+					<input type="radio" name="back" value="2" <!-- if {{firstcheck}} != 0 -->checked<!-- endif -->> 退回提交人 <b>{{createusername}}</b>
+				</label>
+				</div>
+			</div>
+			<div class="modal-footer" id="submitform">
+				<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
+				<button class="btn btn-success" style="display: none" name="status" value="checked" type="submit">通过</button><button style="display: none" type="submit" name="status" value="back" class="btn btn-warning">退回</button><button style="display: none" type="submit" name="status" value="checkno" class="btn btn-danger">不通过</button>
+			</div>
+			</form>
+		</div>
+	</div>
+</div>
+<!--添加附件-->
+<div class="modal fade" id="addfujian" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
+	<div class="modal-dialog" role="document">
+		<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+				<h4 class="modal-title" id="myModalLabel">附件</h4>
+			</div>
+			<div class="modal-body">
+				<div class="row" style="padding-top:10px;">
+					<div class="col-xs-2">
+						<button id="uploadBtn" class="btn btn-large btn-primary">选择文件</button>
+					</div>
+					<div class="col-xs-10">
+						<div id="progressOuter" class="progress progress-striped active" style="display:none;">
+							<div id="progressBar" class="progress-bar progress-bar-success"  role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="row" style="padding-top:10px;">
+					<div class="col-xs-10">
+						<div id="msgBox">
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+<!--添加附件-->
+<script type="text/javascript">autoFlashHeight();</script>
+<link href="//cdn.bootcss.com/toastr.js/2.1.2/toastr.css" rel="stylesheet">
+<script src="//cdn.bootcss.com/toastr.js/2.1.2/toastr.min.js"></script>
+<script src="{{rootUrl}}global/js/SimpleAjaxUploader.min.js"></script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/jquery.dataTables.min.js"></script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/dataTables.bootstrap.min.js"></script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/dataTables.fixedColumns.min.js"></script>
+<script src="{{rootUrl}}global/js/jlzf-change-table.js"></script>
+<script>
+	function escapeTags( str ) {
+		return String( str )
+				.replace( /&/g, '&amp;' )
+				.replace( /"/g, '&quot;' )
+				.replace( /'/g, '&#39;' )
+				.replace( /</g, '&lt;' )
+				.replace( />/g, '&gt;' );
+	}
+
+	$.event.special.valuechange = {
+		teardown: function (namespaces) {
+			$(this).unbind('.valuechange');
+		},
+
+		handler: function (e) {
+			$.event.special.valuechange.triggerChanged($(this));
+		},
+
+		add: function (obj) {
+			$(this).on('keyup.valuechange cut.valuechange paste.valuechange input.valuechange', obj.selector, $.event.special.valuechange.handler)
+		},
+
+		triggerChanged: function (element) {
+			var current = element[0].contentEditable === 'true' ? element.html() : element.val()
+					, previous = typeof element.data('previous') === 'undefined' ? element[0].defaultValue : element.data('previous');
+			if (current !== previous) {
+				element.trigger('valuechange', [element.data('previous')]);
+				element.data('previous', current);
+			}
+		}
+	};
+
+	$(function(){
+		toastr.options = {
+			"closeButton": false,
+			"debug": false,
+			"newestOnTop": false,
+			"progressBar": false,
+			"positionClass": "toast-top-right",
+			"preventDuplicates": false,
+			"onclick": null,
+			"showDuration": "300",
+			"hideDuration": "1000",
+			"timeOut": "5000",
+			"extendedTimeOut": "1000",
+			"showEasing": "swing",
+			"hideEasing": "linear",
+			"showMethod": "fadeIn",
+			"hideMethod": "fadeOut"
+		};
+
+		var table = $('#tablelist').removeAttr('width').DataTable({
+			columnDefs: [
+				{ className: 'allwidth1', width: 200, targets: 1 },
+				{ className: 'allwidth3', width: 60, targets: 2 },
+				{ className: 'allwidth2', width: 100, targets: '_all' }
+			],
+			fixedColumns: {
+				leftColumns: 4
+			}
+		});
+
+		$('.clist input').on("valuechange", function (e, previous) {
+			var num = $(this).val();
+			var unitprice = $(this).parents('.clist').children('td').eq(3).text();
+			var total = num.trim() != '' && unitprice.trim() != '' ? parseFloat(parseFloat(unitprice)*parseFloat(num)).toFixed(2) : '';
+			$(this).parents('.clist').find('.cnum').text(total);
+
+			//统计合计金额
+			var utotalnum = 0;
+			$('.clist').each(function(){
+				var utotal = $(this).find('.cnum').text();
+				utotalnum = utotal != '' ? parseFloat(utotalnum)+parseFloat(utotal) : parseFloat(utotalnum);
+			});
+			$('#utotalnum').text(parseFloat(utotalnum).toFixed(2));
+		});
+
+		$('.showapproval').on('click',function(){
+			var status = $(this).attr('status');
+			if(status == 'pass'){
+				$('#submitform').find('.btn-success').show();
+				$('#submitform').find('.btn-warning').hide();
+				$('#submitform').find('.btn-danger').hide();
+				$('#approval').find('.alert-success').show();
+				$('#approval').find('.alert-warning').hide();
+				$('#approval').find('.alert-danger').hide();
+				$('#backform').hide();
+			}else if(status == 'back'){
+				$('#submitform').find('.btn-success').hide();
+				$('#submitform').find('.btn-warning').show();
+				$('#submitform').find('.btn-danger').hide();
+				$('#approval').find('.alert-success').hide();
+				$('#approval').find('.alert-warning').show();
+				$('#approval').find('.alert-danger').hide();
+				$('#backform').show();
+			}else{
+				$('#submitform').find('.btn-success').hide();
+				$('#submitform').find('.btn-warning').hide();
+				$('#submitform').find('.btn-danger').show();
+				$('#approval').find('.alert-success').hide();
+				$('#approval').find('.alert-warning').hide();
+				$('#approval').find('.alert-danger').show();
+				$('#backform').hide();
+			}
+			var clist = new Array();
+			$('.clist input').each(function(){
+				var value = $(this).val();
+				var lid = $(this).attr('listid');
+				clist.push(lid+'_'+value);
+			});
+			$('#oneclist').val(clist.join(','));
+			$('#approval').modal('show');
+		});
+
+		//文件上传
+		var btn = document.getElementById('uploadBtn'),
+				wrap = document.getElementById('pic-progress-wrap'),
+				progressBar = document.getElementById('progressBar'),
+				progressOuter = document.getElementById('progressOuter'),
+				msgBox = document.getElementById('msgBox'),
+				filenum = $('#filesshow tr').length+1;
+
+		var uploader = new ss.SimpleUpload({
+			button: btn,
+			url: '/change/file/upload/'+ $('#pmid').val() +'/'+$('#cid').val(),
+//			sessionProgressUrl: '/code/ajaxuploader/sessionProgress.php',
+			name: 'uploadfile',
+			multipart: true,
+			hoverClass: 'hover',
+			focusClass: 'focus',
+			responseType: 'json',
+			startXHR: function() {
+				progressOuter.style.display = 'block'; // make progress bar visible
+				this.setProgressBar( progressBar );
+			},
+			onSubmit: function() {
+				msgBox.innerHTML = ''; // empty the message box
+				btn.innerHTML = '上传中...'; // change button text to "Uploading..."
+			},
+			onComplete: function( filename, response ) {
+				btn.innerHTML = '选择文件';
+				progressOuter.style.display = 'none'; // hide progress bar when upload is completed
+
+				if ( !response ) {
+					toastr.error('无法上传文件');
+					msgBox.innerHTML = '无法上传文件';
+					return;
+				}
+
+				if ( response.success === true ) {
+					toastr.success('附件上传成功。');
+					msgBox.innerHTML = '<strong>' + escapeTags( filename ) + '</strong>' + ' 上传成功。';
+					var filestr = '<tr><td>'+ filenum +'</td><td><a href="'+ response.files.downurl +'">'+ response.files.filename +'</a></td><td>'+ response.files.size +'</td><td>'+ response.files.time +'</td><td><a id="delatt_'+ response.files.id +'" file_id="'+ response.files.id +'" class="btn btn-default btn-sm" title="删除附件"><span class="glyphicon glyphicon-trash text-danger"></span></a></td></tr>';
+					$('#filesshow').append(filestr);
+					filenum++;
+					setTimeout(function(){
+						msgBox.innerHTML = '';
+					},3000);
+				} else {
+					if ( response.msg )  {
+						toastr.error(response.msg);
+						msgBox.innerHTML = escapeTags( response.msg );
+
+					} else {
+						toastr.error('发生错误,上传失败。');
+						msgBox.innerHTML = '发生错误,上传失败。';
+					}
+				}
+			},
+			onError: function() {
+				progressOuter.style.display = 'none';
+				toastr.error('无法上传文件');
+				msgBox.innerHTML = '无法上传文件';
+			}
+		});
+		//删除附件
+		$('body').on('click',"a[id^='delatt_']",function (){
+			var fid = $(this).attr('file_id');
+			$(this).parents('tr').remove();
+			var newsort = 1;
+			$('#filesshow tr').each(function(){
+				$(this).children('td').eq(0).text(newsort);
+				newsort++;
+			});
+			filenum = newsort;
+			$.ajax({
+				type: 'post',
+				url: '/change/file/delete',
+				data:{fid: fid},
+				dataType: 'json',
+				success: function(result){
+
+				}
+			})
+		});
+	});
+</script>
+</body>

+ 43 - 0
protected/view/biangeng-dealbills.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+	<meta charset=utf-8>
+	<title>纵横计量支付系统</title>
+	<meta name=description content=计量支付>
+	<meta name=copyright content=smartcost.com.cn>
+	<meta name="viewport" content="width=device-width,initial-scale=1.0">
+	<link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+	<link rel=stylesheet href={{rootUrl}}global/css/style.css>
+	<script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+	<script src={{rootUrl}}global/js/bootstrap.js></script>
+	<script src={{rootUrl}}global/js/jl.js></script>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+	<!-- include "left" -->
+	<div class="mainContainer" >
+		<!--内容-->
+		<div class="mainContent">
+			<div class="title" id="xinxi">
+				<h1><a href="/change/index/{{pmArray.pmid}}" title="返回"><span class="closePanel" aria-hidden="true" data-icon="Z"></span></a>&nbsp;{{pmArray.pmname}} 签约清单</h1>
+			</div>
+			<table class="table table-bordered">
+				<thead>
+				<tr><th class="text-center" width="100">清单编号</th><th class="text-center">名称</th><th class="text-center">单位</th><th class="text-center">单价</th><th class="text-center">数量</th><th class="text-center">金额</th></tr>
+				</thead>
+				<tbody>
+				<!-- if !empty({{list}}) -->
+				<!-- loop list -->
+				<tr><td>{{list' value.lnum}}</td><td>{{list' value.lname}}</td><td>{{list' value.unit}}</td><td>{{tofloat(list' value.unitprice)}}</td><td>{{list' value.amount}}</td><td>{{tofloat(list' value.totalamount)}}</td></tr>
+				<!-- endloop -->
+				<!-- endif -->
+				</tbody>
+			</table>
+		</div>
+		<!--内容-->
+	</div>
+</div>
+
+<script type="text/javascript">autoFlashHeight();</script>
+</body>

+ 220 - 0
protected/view/biangeng-detail.html

@@ -0,0 +1,220 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+	<meta charset=utf-8>
+	<title>纵横计量支付系统</title>
+	<meta name=description content=计量支付>
+	<meta name=copyright content=smartcost.com.cn>
+	<meta name="viewport" content="width=device-width,initial-scale=1.0">
+	<link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+	<link rel="stylesheet" type="text/css" href="{{rootUrl}}global/css/dataTables.bootstrap.min.css">
+	<link rel="stylesheet" type="text/css" href="{{rootUrl}}global/css/fixedColumns.bootstrap.min.css">
+	<link rel=stylesheet href={{rootUrl}}global/css/style.css>
+	<script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+	<script src={{rootUrl}}global/js/bootstrap.js></script>
+	<script src={{rootUrl}}global/js/jl.js></script>
+	<style type="text/css" class="init">
+		#list td input{
+			width: 100%
+		}
+
+		.allwidth1{
+			/*width: 16% !important;*/
+			max-width: 250px !important;
+		}
+		.allwidth2{
+			/*width: 9% !important;*/
+			max-width: 150px !important;
+		}
+		.allwidth3{
+			 /*width: 5% !important;*/
+			 max-width: 100px !important;
+		}
+
+	</style>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+	<!-- include "left" -->
+	<div class="mainContainer" data-spy="scroll" data-target="#navbar-example">
+		<!--内容-->
+		<div class="mainContent">
+			<div class="title" id="xinxi">
+				<h1><a href="/change/index/{{pmArray.pmid}}" title="返回"><span class="closePanel" aria-hidden="true" data-icon="Z"></span></a>&nbsp;{{changeArray.pnum}}</h1>
+			</div>
+			<div class="row">
+				<div class="col-md-2" id="navbar-example">
+					<ul class="nav nav-pills nav-stacked bg-nav affix">
+						<li><a href="#xinxi"><span class="glyphicon glyphicon-info-sign"></span> 变更信息</a></li>
+						<li><a href="#qingdan"><span class="glyphicon glyphicon-list-alt"></span> 变更清单</a></li>
+						<li><a href="#fujian"><span class="glyphicon glyphicon-paperclip"></span> 附件</a></li>
+						<li><a href="#shenpi"><span class="glyphicon glyphicon-check"></span> 审批流程</a></li>
+					</ul>
+				</div>
+				<div class="col-md-10">
+					<div class="bg-con-warp">
+						<legend><span class="glyphicon glyphicon-info-sign"></span> 变更信息</legend>
+						<div class="row">
+							<div class="col-md-4">
+								<div class="form-group">
+									<label>申请编号</label>
+									<input class="form-control" value="{{changeArray.pnum}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>工程名称</label>
+									<input class="form-control" value="{{changeArray.pname}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>桩号</label>
+									<input class="form-control" value="{{changeArray.mnum}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>原设计图名称</label>
+									<input class="form-control" placeholder="" value="{{changeArray.odname}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>原图号</label>
+									<input class="form-control" placeholder="" value="{{changeArray.onum}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>变更设计图名称</label>
+									<input class="form-control" placeholder="" value="{{changeArray.cdname}}" type="text" readonly disabled>
+								</div>
+								<div class="form-group">
+									<label>变更图号</label>
+									<input class="form-control" placeholder="" value="{{changeArray.cnum}}" type="text" readonly disabled>
+								</div>
+							</div>
+							<div class="col-md-4">
+								<div class="form-group">
+									<label>工程变更理由及内容</label>
+										    <textarea class="form-control" rows="6" readonly disabled>{{changeArray.description}}</textarea>
+								</div>
+								<div class="form-group">
+									<label>工程变更合同依据</label>
+									<textarea class="form-control" rows="6" readonly disabled>{{changeArray.basis}}</textarea>
+								</div>
+								<div class="form-group">
+									<label>备注</label>
+									<textarea class="form-control" rows="3" readonly disabled>{{changeArray.remarks}}</textarea>
+								</div>
+							</div>
+							<div class="col-md-4">
+								<!-- if !empty({{changeArray.ctype}}) -->
+								<div class="form-group">
+									<label>变更类型</label>
+									<div class="checkbox">
+										<!-- loop changeArray.ctypelist -->
+										<label class="checkbox-inline">
+											<input type="checkbox" checked disabled>{{ctypelist' value.typename}}
+										</label>
+										<!-- endloop -->
+									</div>
+								</div>
+								<!-- endif -->
+								<div class="form-group">
+									<label>变更类别 </label>
+									<select class="form-control" disabled><option>{{changeArray.categoryname}}</option></select>
+								</div>
+								<div class="form-group">
+									<label>变更性质 </label>
+									<select class="form-control" disabled><option>{{changeArray.naturename}}</option></select>
+								</div>
+								<div class="form-group">
+									<label>变更提出单位</label>
+									<select class="form-control" disabled><option>{{changeArray.companyname}}</option></select>
+								</div>
+								<div class="form-group">
+									<label>费用承担方</label>
+									<div class="radio">
+										<label class="radio-inline">
+											<input id="inlineCheckbox1" value="option1" type="radio" checked disabled> <!-- if {{changeArray.bear}} == 1 -->业主<!-- else -->承包人<!-- endif -->
+										</label>
+									</div>
+								</div>
+							</div>
+						</div>
+					</div>
+					<div class="bg-con-warp">
+						<legend id="qingdan" ><span class="glyphicon glyphicon-list-alt"></span> 变更清单</legend>
+
+						<table id="tablelist" class="table table-striped table-bordered nowrap" cellspacing="0" width="100%">
+							<thead>
+							<tr><th rowspan="2" class="text-center">清单编号</th><th rowspan="2" class="text-center">名称</th><th rowspan="2" class="text-center">单位</th><th rowspan="2" class="text-center">单价</th><th colspan="2" class="text-center">原设计</th><th colspan="2" class="text-center">申报变更</th><th colspan="2" class="text-center">审批后变更</th></tr>
+							<tr><th class="text-center">数量</th><th class="text-center">金额</th><th class="text-center">数量</th><th class="text-center">金额</th><th class="text-center">数量</th><th class="text-center">金额</th></tr>
+							</thead>
+							<tbody>
+							<!-- loop clist -->
+							<tr><td>{{clist' value.lnum}}</td><td>{{clist' value.lname}}</td><td>{{clist' value.unit}}</td><td>{{tofloat(clist' value.unitprice)}}</td><td>{{clist' value.oamount}}</td><td>{{tofloat(clist' value.osum)}}</td><td>{{clist' value.camount}}</td><td>{{tofloat(clist' value.csum)}}</td><td>{{clist' value.samount}}</td><td><!-- if {{clist' value.ssum}} != '' --> {{tofloat(clist' value.ssum)}}<!-- endif --></td></tr>
+							<!-- endloop -->
+							<tr class="info"><td>合计</td><td></td><td></td><td></td><td></td><td>{{tofloat(ototalnum)}}</td><td></td><td>{{tofloat(ctotalnum)}}</td><td></td><td><!-- if {{stotalnum}} != '' -->{{tofloat(stotalnum)}}<!-- endif --></td></tr>
+							</tbody>
+						</table>
+					</div>
+					<div class="bg-con-warp">
+						<legend id="fujian"><span class="glyphicon glyphicon-paperclip"></span> 附件</legend>
+						<table class="table table-bordered">
+							<thead>
+							<tr><th width="50">序号</th><th>名称</th><th width="90">大小</th><th width="100">上传时间</th></tr>
+							</thead>
+							<tbody>
+							<!-- if !empty({{attlist}}) -->
+							<!-- loop attlist -->
+							<tr><td>{{attlist' value.sort}}</td><td><a href="{{attlist' value.downurl}}">{{attlist' value.filename}}</a></td><td>{{attlist' value.size}}</td><td>{{attlist' value.time}}</td></tr>
+							<!-- endloop -->
+							<!-- endif -->
+							</tbody>
+						</table>
+					</div>
+					<div class="bg-con-warp">
+						<legend id="shenpi"><span class="glyphicon glyphicon-check"></span> 审批流程</legend>
+						<table class="table table-bordered">
+							<!-- loop auditlist -->
+							<tr>
+								<td width="100"><!-- if {{auditlist' value.usite}} == 0 -->提交人<!-- else -->第{{auditlist' value.usite}}个审批人<!-- endif --></td>
+								<td width="250"><h4 class="media-heading">{{auditlist' value.jobs}} {{auditlist' value.name}}</h4>
+									{{auditlist' value.company}}</td>
+								<!-- if {{auditlist' value.usite}} == 0 -->
+									<!-- if {{auditlist' value.status}} == 'checked' --><td width="100" class="colGreen">上报完成</td><td>{{formatDate(auditlist' value.sintime)}}<br></td>
+									<!-- elseif {{auditlist' value.times}} == 0  && {{auditlist' value.status}} == 'checking' --><td width="100" class="colOrange">上报中</td><td><br></td>
+									<!-- elseif {{auditlist' value.times}} != 0 && {{auditlist' value.status}} == 'checking' --><td width="100" class="colOrange">重新上报中</td><td><br></td>
+									<!-- endif -->
+								<!-- else -->
+									<!-- if {{auditlist' value.status}} == 'checked' --><td width="100" class="colGreen">审批通过</td><td>{{formatDate(auditlist' value.sintime)}}<br>{{auditlist' value.sdesc}}</td>
+									<!-- elseif {{auditlist' value.status}} == 'back' || {{auditlist' value.status}} == 'backnew' --><td width="100" class="colRed">退回</td><td>{{formatDate(auditlist' value.sintime)}}<br>{{auditlist' value.sdesc}}</td>
+									<!-- elseif {{auditlist' value.status}} == 'checkno' --><td width="100" class="colRed">审批不通过</td><td>{{formatDate(auditlist' value.sintime)}}<br>{{auditlist' value.sdesc}}</td>
+									<!-- elseif {{auditlist' value.status}} == 'checking' --><td width="100" class="colOrange">审批中</td><td></td>
+									<!-- else --><td width="100"></td><td></td>
+									<!-- endif -->
+								<!-- endif -->
+							</tr>
+							<!-- endloop -->
+						</table>
+					</div>
+				</div>
+			</div>
+		</div>
+		<!--内容-->
+	</div>
+</div>
+<script type="text/javascript">autoFlashHeight();</script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/jquery.dataTables.min.js"></script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/dataTables.bootstrap.min.js"></script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/dataTables.fixedColumns.min.js"></script>
+<script src="{{rootUrl}}global/js/jlzf-change-table.js"></script>
+<script>
+	$(function() {
+		var table = $('#tablelist').removeAttr('width').DataTable({
+			columnDefs: [
+				{ className: 'allwidth1', width: 230, targets: 1 },
+				{ className: 'allwidth3', width: 80, targets: 2 },
+				{ className: 'allwidth2', width: 120, targets: '_all' }
+			],
+			fixedColumns: {
+				leftColumns: 4
+			}
+		});
+	})
+</script>
+</body>

+ 436 - 0
protected/view/biangeng-new.html

@@ -0,0 +1,436 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+	<meta charset=utf-8>
+	<title>纵横计量支付系统</title>
+	<meta name=description content=计量支付>
+	<meta name=copyright content=smartcost.com.cn>
+	<meta name="viewport" content="width=device-width,initial-scale=1.0">
+	<link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+	<link rel="stylesheet" type="text/css" href="{{rootUrl}}global/css/dataTables.bootstrap.min.css">
+	<link rel="stylesheet" type="text/css" href="{{rootUrl}}global/css/fixedColumns.bootstrap.min.css">
+	<link rel=stylesheet href={{rootUrl}}global/css/style.css>
+	<link href="{{rootUrl}}global/css/assets/styles.css" rel="stylesheet">
+	<script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+	<script src={{rootUrl}}global/js/bootstrap.js></script>
+	<script src={{rootUrl}}global/js/jl.js></script>
+	<style type="text/css" class="init">
+		#list td input{
+			width: 100%
+		}
+		#list td select{
+			width: 100%
+		}
+		.allwidth1{
+			width: 15% !important;
+			max-width: 200px !important;
+		}
+		.allwidth2{
+			width: 20% !important;
+			max-width: 300px !important;
+		}
+		.allwidth3{
+			width: 10% !important;
+			max-width: 150px !important;
+		}
+	</style>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+	<!-- include "left" -->
+	<div class="mainContainer" data-spy="scroll" data-target="#navbar-example">
+		<!--内容-->
+		<div class="mainContent">
+			<input id="pmid" type="hidden" value="{{pmArray.pmid}}">
+			<form method="post" onsubmit="return checkform();">
+				<div class="title" id="xinxi">
+					<div class="bg-top-btn affix"><button type="submit" name="uncheck" onclick="newflag=0" class="btn btn-primary" >保存</button>&nbsp;<button type="submit" name="checking" onclick="newflag=1" class="btn btn-success">提交审批</button></div>
+					<h1><a href="/change/index/{{pmArray.pmid}}" title="返回"><span class="closePanel" aria-hidden="true" data-icon="Z"></span></a>&nbsp;</h1>
+				</div>
+				<div class="row">
+					<div class="col-md-2" id="navbar-example">
+						<ul class="nav nav-pills nav-stacked bg-nav affix">
+							<li><a href="#xinxi"><span class="glyphicon glyphicon-info-sign"></span> 变更信息</a></li>
+							<li><a href="#qingdan"><span class="glyphicon glyphicon-list-alt"></span> 变更清单</a></li>
+							<li><a href="#fujian"><span class="glyphicon glyphicon-paperclip"></span> 附件</a></li>
+							<li><a href="#shenpi"><span class="glyphicon glyphicon-check"></span> 审批流程</a></li>
+						</ul>
+					</div>
+					<div class="col-md-10">
+						<div class="bg-con-warp">
+							<legend><span class="glyphicon glyphicon-info-sign"></span> 变更信息</legend>
+							<div class="row">
+								<div class="col-md-4">
+									<div class="form-group">
+										<label><b class="text-danger">*&nbsp;</b>申请编号</label>
+										<a href="" style="float:right;" class="autonumber" data-toggle="modal">设置自动编号</a>
+										<a href="javascript:void(0)" id="resetnumber" data-num="{{pnum}}" style="float:right;margin-right:10px" data-toggle="modal" title="重置"><i class="glyphicon glyphicon-repeat"></i></a>
+										<input class="form-control" id="pnum" name="pnum" value="{{pnum}}" type="text">
+									</div>
+									<div class="form-group">
+										<label><b class="text-danger">*&nbsp;</b>工程名称</label>
+										<input class="form-control" id="pname" name="pname" value="" type="text">
+									</div>
+									<div class="form-group">
+										<label>桩号</label>
+										<input class="form-control" name="mnum" value="" type="text">
+									</div>
+									<div class="form-group">
+										<label>原设计图名称</label>
+										<input class="form-control" name="odname" placeholder="" type="text">
+									</div>
+									<div class="form-group">
+										<label>原图号</label>
+										<input class="form-control" name="onum" placeholder="" type="text">
+									</div>
+									<div class="form-group">
+										<label>变更设计图名称</label>
+										<input class="form-control" name="cdname" placeholder="" type="text">
+									</div>
+									<div class="form-group">
+										<label>变更图号</label>
+										<input class="form-control" name="cnum" placeholder="" type="text">
+									</div>
+								</div>
+								<div class="col-md-4">
+									<div class="form-group">
+										<label><b class="text-danger">*&nbsp;</b>工程变更理由及内容</label>
+										<textarea class="form-control" id="description" name="description" rows="6"></textarea>
+									</div>
+									<div class="form-group">
+										<label>工程变更合同依据</label>
+										<textarea class="form-control" name="basis" rows="6"></textarea>
+									</div>
+									<div class="form-group">
+										<label>备注</label>
+										<textarea class="form-control" name="remarks" rows="3"></textarea>
+									</div>
+								</div>
+								<div class="col-md-4">
+									<div class="form-group">
+										<label>变更类型</label>
+										<div class="checkbox">
+											<label class="checkbox-inline">
+												<input name="ctype[]" value="1" type="checkbox">A.位置
+											</label>
+											<label class="checkbox-inline">
+												<input name="ctype[]" value="2" type="checkbox">B.数量
+											</label>
+											<label class="checkbox-inline">
+												<input name="ctype[]" value="3" type="checkbox">C.结构
+											</label>
+											<label class="checkbox-inline">
+												<input name="ctype[]" value="4" type="checkbox">D.新增
+											</label>
+											<label class="checkbox-inline">
+												<input name="ctype[]" value="5" type="checkbox">E.取消
+											</label>
+											<label class="checkbox-inline">
+												<input name="ctype[]" value="6" type="checkbox">F.纠错
+											</label>
+										</div>
+									</div>
+									<div class="form-group">
+										<label>变更类别 </label>
+										<select class="form-control" name="category">
+											<option value="1">A类变更(设计变更)</option>
+											<option value="2">B类变更(施工措施变更)</option>
+											<option value="3">C类变更(计划变更)</option>
+											<option value="4">D类变更(条件变更)</option>
+											<option value="5">E类变更(新增工程)</option>
+										</select>
+									</div>
+									<div class="form-group">
+										<label>变更性质 </label>
+										<select class="form-control" name="cnature">
+											<option value="1">一般设计变更</option>
+											<option value="2">较大设计变更</option>
+											<option value="3">重大设计变更</option>
+										</select>
+									</div>
+									<div class="form-group">
+										<label>变更提出单位</label>
+										<a href="#editcompany" style="float:right;" class="" data-toggle="modal" id="editcompanybtn">编辑</a>
+										<select class="form-control" id="company" name="companyid">
+											<!-- if !empty({{companylist}}) -->
+											<!-- loop companylist -->
+											<option value="{{companylist' value.id}}">{{companylist' value.name}}</option>
+											<!-- endloop -->
+											<!-- endif -->
+										</select>
+									</div>
+									<div class="form-group">
+										<label>费用承担方</label>
+										<div class="radio">
+											<label class="radio-inline">
+												<input name="bear" value="1" type="radio" checked> 业主
+											</label>
+											<label class="radio-inline">
+												<input name="bear" value="2" type="radio"> 承包人
+											</label>
+										</div>
+									</div>
+								</div>
+							</div>
+						</div>
+						<div class="bg-con-warp">
+							<legend id="qingdan" ><span class="glyphicon glyphicon-list-alt"></span> 变更清单&nbsp;&nbsp;<a href="#addlist" class="btn btn-primary btn-xs" data-toggle="modal"><span class="glyphicon glyphicon-plus"></span> 添加清单</a></legend>
+							<table class="table table-striped table-bordered nowrap" id="tablelist" cellspacing="0" width="100%">
+								<thead>
+								<tr><th rowspan="2" class="text-center">清单编号</th><th rowspan="2" class="text-center">名称</th><th rowspan="2" class="text-center">单位</th><th rowspan="2" class="text-center">单价</th><th colspan="2" class="text-center">原设计</th><th colspan="2" class="text-center">申报变更</th></tr>
+								<tr><th class="text-center">数量</th><th class="text-center">金额</th><th class="text-center">数量</th><th class="text-center">金额</th></tr>
+								</thead>
+								<tbody id="list">
+								<tr class="info"><td>合计</td><td></td><td></td><td></td><td></td><td id="otatalamount"></td><td></td><td id="ctatalamount"></td></tr>
+								</tbody>
+							</table>
+						</div>
+						<div class="bg-con-warp">
+							<legend id="fujian"><span class="glyphicon glyphicon-paperclip"></span> 附件&nbsp;&nbsp;<a href="#addfujian" class="btn btn-primary btn-xs" data-toggle="modal"><span class="glyphicon glyphicon-open"></span> 上传附件</a></legend>
+							<table class="table table-bordered">
+								<thead>
+								<tr><th width="50">序号</th><th>名称</th><th width="90">大小</th><th width="100">上传时间</th><th width="100">操作</th></tr>
+								</thead>
+								<tbody id="filesshow">
+								</tbody>
+							</table>
+						</div>
+						<div class="bg-con-warp">
+							<legend id="shenpi"><span class="glyphicon glyphicon-check"></span> 审批流程&nbsp;&nbsp;<a href="#addshenpi" class="btn btn-primary btn-xs" data-toggle="modal"><span class="glyphicon glyphicon-plus"></span> 添加审批人</a></legend>
+							<table class="table table-bordered">
+								<tr>
+									<td width="100">提交人</td>
+									<td width="250"><h4 class="media-heading">{{userArray.jobs}} {{userArray.name}}</h4>
+										{{userArray.company}}</td>
+									<td width="100"></td>
+									<td></td>
+								</tr>
+								<tbody id="usertableshow">
+
+								</tbody>
+							</table>
+						</div>
+					</div>
+				</div>
+
+				<!--清单、附件、审批人上传数据-->
+				<input type="hidden" name="changelist" id="changelist" value="">
+				<input type="hidden" name="changewhitelist" id="changewhitelist" value="">
+				<input type="hidden" name="changeatt" id="changeatt" value="">
+				<input type="hidden" name="changeaudit" id="changeaudit" value="">
+			</form>
+		</div>
+		<!--内容-->
+	</div>
+</div>
+
+<!--添加清单-->
+<div class="modal fade " tabindex="-1" role="dialog" aria-hidden="true" id="addlist">
+	<div class="modal-dialog modal-lg">
+		<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
+				<h4 class="modal-title" id="mySmallModalLabel">从签约清单中选择</h4>
+			</div>
+			<div class="modal-body">
+				<div style="height:400px;overflow-y:auto">
+					<table class="table table-striped table-bordered table-condensed">
+						<thead><tr><th>序号</th><th>清单编号</th><th>名称</th><th>单位</th><th>单价</th><th>选择</th></tr></thead>
+						<tbody>
+						<!-- loop list -->
+						<tr class="checklist">
+							<td>{{list' value.id}}</td>
+							<td>{{list' value.lnum}}</td>
+							<td>{{list' value.lname}}</td>
+							<td>{{list' value.unit}}</td>
+							<td>{{tofloat(list' value.unitprice)}}</td>
+							<td class="hide">{{list' value.amount}}</td>
+							<td class="hide">{{tofloat(list' value.totalamount)}}</td>
+							<td><input type="checkbox" class="listcheckbox"></td>
+						</tr>
+						<!-- endloop -->
+						</tbody>
+					</table>
+				</div>
+			</div>
+			<div class="modal-footer">
+				<button type="button" class="addlistbtn btn btn-default">添加空白清单</button>
+				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+				<button type="button" class="addlistbtn btn btn-primary">添加</button>
+			</div>
+		</div>
+	</div>
+</div>
+<!--添加清单-->
+
+<!--变更单位-->
+<div class="modal fade" id="editcompany" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
+	<div class="modal-dialog" role="document">
+		<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+				<h4 class="modal-title">变更单位</h4>
+			</div>
+			<div class="modal-body">
+				<div id="companyshow">
+					<!-- if !empty({{companylist}}) -->
+					<!-- loop companylist -->
+					<div class="form-group">
+						<input type="text" id="{{companylist' value.id}}" class="form-control" value="{{companylist' value.name}}">
+					</div>
+					<!-- endloop -->
+					<!-- endif -->
+				</div>
+				<p><button id="addcompany" class="btn btn-primary btn-xs" role="button"><b class="glyphicon glyphicon-plus"></b></button></p>
+				<div id="companyadddiv">
+					<!--<input type="text" class="form-control" placeholder="请输入公司名称">-->
+				</div>
+			</div>
+			<div class="modal-footer">
+				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+				<button type="button" id="updatecompany" class="btn btn-primary">确定</button>
+			</div>
+		</div>
+	</div>
+</div>
+<!--变更单位-->
+
+<!--添加附件-->
+<div class="modal fade" id="addfujian" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
+	<div class="modal-dialog" role="document">
+		<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+				<h4 class="modal-title" id="myModalLabel">附件</h4>
+			</div>
+			<div class="modal-body">
+				<div class="row" style="padding-top:10px;">
+					<div class="col-xs-2">
+						<button id="uploadBtn" class="btn btn-large btn-primary">选择文件</button>
+					</div>
+					<div class="col-xs-10">
+						<div id="progressOuter" class="progress progress-striped active" style="display:none;">
+							<div id="progressBar" class="progress-bar progress-bar-success"  role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="row" style="padding-top:10px;">
+					<div class="col-xs-10">
+						<div id="msgBox">
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+<!--添加附件-->
+
+<!--添加审批人-->
+<div class="modal fade" id="addshenpi" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
+	<div class="modal-dialog" role="document">
+		<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+				<h4 class="modal-title">添加审批人</h4>
+			</div>
+			<div class="modal-body">
+				<input type="hidden" id="usernamelist" value="{{usernamelist}}">
+				<div class="input-group">
+					<input type="text" class="form-control" id="searchname" placeholder="请输入审批人名称">
+						  <span class="input-group-btn">
+						    <button class="btn btn-default" id="searchbtn" type="button"><span class="glyphicon glyphicon-search"></span></button>
+						  </span>
+				</div>
+				<div class="row" id="searchshow" style="margin-top:25px;">
+				</div>
+				<h5>常用审批人</h5>
+				<div class="row">
+					<!-- loop userlist -->
+					<div class="col-md-3 alert alert-pnone">
+						<div class="radio" data-uid="{{userlist' value.userid}}" data-uname="{{userlist' value.name}}" data-ucompany="{{userlist' value.company}}" data-ujobs="{{userlist' value.jobs}}">
+							<label>
+								<input type="radio" value="{{userlist' value.userid}}">{{userlist' value.name}}
+							</label>
+							<div>
+								{{userlist' value.jobs}}
+							</div>
+						</div>
+					</div>
+					<!-- endloop -->
+				</div>
+			</div>
+			<div class="modal-footer">
+				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+				<button type="button" class="btn btn-primary" id="addaudit">添加</button>
+				<input type="hidden" id="selectauditlist" value="">
+			</div>
+		</div>
+	</div>
+</div>
+<!--添加审批人-->
+
+<!--自动编号-->
+<div class="modal fade" id="autonumber" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
+	<div class="modal-dialog" role="document">
+		<div class="modal-content">
+			<div class="modal-header">
+				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+				<h4 class="modal-title">设置自动编号</h4>
+			</div>
+			<div class="modal-body">
+				<legend>当前规则:</legend>
+				<h3 id="numhtmlshow">
+				</h3>
+				<legend>添加新规则组件</legend>
+				<div class="form-group">
+					<select class="form-control" id="tools">
+						<option value="0">请选择组件</option>
+						<option value="1">文本</option>
+						<option value="2">当前年份</option>
+						<option value="3">自增编号</option>
+					</select>
+				</div>
+				<!--文本-->
+				<div class="form-group toolshow" id="noteshow" style="display: none">
+					<label>文本内容</label>
+					<input type="text" class="form-control" placeholder="输入固定的文本内容">
+				</div>
+				<!--年份-->
+				<div class="form-group toolshow" id="yearshow" style="display: none">
+					<label>当前年份</label>
+					<input type="text" class="form-control" readonly placeholder="{{year}}" value="{{year}}">
+				</div>
+				<!--自动编号-->
+				<div class="form-group toolshow numbershow" style="display: none">
+					<label>自动编号位数</label>
+					<input type="number" min="3" id="numsite" class="form-control" step="1" max="6" value="3">
+				</div>
+				<div class="form-group toolshow numbershow" style="display: none">
+					<label>起始编号</label>
+					<input type="text" id="setnumber" class="form-control" value="001">
+				</div>
+				<button class="btn btn-primary" id="addtools">添加组件</button>
+			</div>
+			<div class="modal-footer">
+				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+				<button type="button" class="btn btn-primary" id="setcnum">确定</button>
+			</div>
+		</div>
+	</div>
+</div>
+<!--自动编号-->
+
+<script type="text/javascript">autoFlashHeight();</script>
+<link href="{{rootUrl}}global/css/toastr.css" rel="stylesheet">
+<script src="{{rootUrl}}global/js/toastr.min.js"></script>
+<script src="{{rootUrl}}global/js/SimpleAjaxUploader.min.js"></script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/jquery.dataTables.min.js"></script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/dataTables.bootstrap.min.js"></script>
+<script type="text/javascript" language="javascript" src="{{rootUrl}}global/js/dataTables.fixedColumns.min.js"></script>
+<script src="{{rootUrl}}global/js/jlzf-change-table.js"></script>
+<script src="{{rootUrl}}global/js/jlzf-change-new.js"></script>
+<script src="{{rootUrl}}global/js/jlzf-change-pnumset.js"></script>
+</body>

+ 210 - 0
protected/view/biangeng-poj.html

@@ -0,0 +1,210 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+	<meta charset=utf-8>
+	<title>纵横计量支付系统</title>
+	<meta name=description content=计量支付>
+	<meta name=copyright content=smartcost.com.cn>
+	<meta name="viewport" content="width=device-width,initial-scale=1.0">
+	<link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
+	<link rel=stylesheet href={{rootUrl}}global/css/style.css>
+	<script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
+	<script src={{rootUrl}}global/js/bootstrap.js></script>
+	<script src={{rootUrl}}global/js/jl.js></script>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+	<!-- include "left" -->
+	<div class="mainContainer" style="overflow-y:hidden">
+		<!--内容-->
+		<div class="mainContent signContent">
+			<!-- if empty({{prolist}}) -->
+			<div class="title clearfix sign-title-height">
+				<h1>变更管理</h1>
+			</div>
+			<div class="sign-view clearfix">
+				<div class="sign-content bg-content">
+					<div class="proSection">
+						<h5>当前用户还不存在变更标段</h5>
+					</div>
+				</div>
+			</div>
+			<!-- else -->
+			<div class="title clearfix sign-title-height">
+				<!-- if {{firstuse}} == 0 --><div class="fR sign-topbar"><a href="/change/dealbills/{{pmArray.pmid}}" class="btn btn-default">签约清单</a><!-- if {{userchangepower}} == 1 --> <a href="/change/new/{{pmArray.pmid}}" class="btn btn-primary">创建变更令</a><!-- endif --></div><!-- endif -->
+				<h1>{{pmArray.pmname}} 标段 变更管理</h1>
+			</div>
+			<div class="sign-view clearfix">
+				<div class="sign-side fL side-content">
+					<ul id="treeDemo" class="ztree"></ul>
+				</div>
+				<div class="sign-content bg-content fR">
+					<div class="proSection">
+						<!-- if {{firstuse}} == 1 -->
+						<h5>首次使用,请在软件同步签约清单</h5>
+						<!-- else -->
+						<ul class="nav nav-tabs">
+							<li <!-- if {{status}} == 1 -->class="active"<!-- endif -->>
+							<a href="{{rootUrl}}change/index/{{pmArray.pmid}}/1">待处理 <!-- if {{num1}} != 0 --><span class="label label-warning">{{num1}}</span><!-- endif --></a>
+							</li>
+							<!-- if {{userchangepower}} == 1 -->
+							<li <!-- if {{status}} == 2 -->class="active"<!-- endif -->>
+							<a href="{{rootUrl}}change/index/{{pmArray.pmid}}/2">待上报 <!-- if {{num2}} != 0 --><span class="label label-primary">{{num2}}</span><!-- endif --></a>
+							</li>
+							<!-- endif -->
+							<li <!-- if {{status}} == 3 -->class="active"<!-- endif -->>
+							<a href="{{rootUrl}}change/index/{{pmArray.pmid}}/3">进行中 <!-- if {{num3}} != 0 --><span class="label label-default">{{num3}}</span><!-- endif --></a>
+							</li>
+							<li <!-- if {{status}} == 4 -->class="active"<!-- endif -->>
+							<a href="{{rootUrl}}change/index/{{pmArray.pmid}}/4">已完成 <!-- if {{num4}} != 0 --><span class="label label-default">{{num4}}</span><!-- endif --></a>
+							</li>
+							<li <!-- if {{status}} == 5 -->class="active"<!-- endif -->>
+							<a href="{{rootUrl}}change/index/{{pmArray.pmid}}/5">不通过 <!-- if {{num5}} != 0 --><span class="label label-default">{{num5}}</span><!-- endif --></a>
+							</li>
+						</ul>
+						<!--筛选模块-->
+						<!-- if {{status}} == 1 -->
+						<!--待处理-->
+						<table class="table">
+							<thead>
+							<tr><th width="10%">标段</th><th width="20%">变更令号</th><th width="30%">工程名称</th><th width="10%">变更类别</th><th width="10%">变更金额</th><th width="10%">操作</th></tr>
+							</thead>
+							<tbody>
+							<!-- if !empty({{list}}) -->
+							<!-- loop list -->
+							<!-- if {{list' value.status}} == 'checking' -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/checking/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td><td><a href="/change/detail/checking/{{list' value.cid}}" class="btn btn-warning btn-sm">审批</a></td></tr>
+							<!-- elseif {{list' value.status}} == 'uncheck' -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/update/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td><td><a href="/change/detail/update/{{list' value.cid}}" class="btn btn-primary btn-sm">上报</a></td></tr>
+							<!-- elseif {{list' value.status}} == 'back' -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/update/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td><td><a href="/change/detail/update/{{list' value.cid}}" class="btn btn-primary btn-sm">重新上报</a></td></tr>
+							<!-- endif -->
+							<!-- endloop -->
+							<!-- endif -->
+							</tbody>
+						</table>
+						<!-- elseif {{status}} == 2 && {{userchangepower}} == 1 -->
+						<!--待上报-->
+						<table class="table">
+							<thead>
+							<tr><th width="10%">标段</th><th width="20%">变更令号</th><th width="30%">工程名称</th><th width="10%">变更类别</th><th width="10%">变更金额</th><th width="10%">操作</th></tr>
+							</thead>
+							<tbody>
+							<!-- if !empty({{list}}) -->
+							<!-- loop list -->
+							<!-- if {{list' value.uid}} == {{uid}} && {{list' value.status}} == 'uncheck' -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/update/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td><td><a href="/change/detail/update/{{list' value.cid}}" class="btn btn-primary btn-sm">上报</a></td></tr>
+							<!-- elseif {{list' value.uid}} == {{uid}} && {{list' value.status}} == 'back' -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/update/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td><td><a href="/change/detail/update/{{list' value.cid}}" class="btn btn-primary btn-sm">重新上报</a></td></tr>
+							<!-- elseif {{list' value.uid}} != {{uid}} && {{list' value.status}} == 'uncheck' -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td><td>{{list' value.username}} <span class="colOrange">上报中</span></td></tr>
+							<!-- elseif {{list' value.uid}} != {{uid}} && {{list' value.status}} == 'back' -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td><td>{{list' value.username}} <span class="colOrange">重新上报中</span></td></tr>
+							<!-- endif -->
+							<!-- endloop -->
+							<!-- endif -->
+							</tbody>
+						</table>
+						<!-- elseif {{status}} == 3 -->
+						<!--进行中-->
+						<table class="table">
+							<thead>
+							<tr><th width="10%">标段</th><th width="20%">变更令号</th><th width="30%">工程名称</th><th width="10%">变更类别</th><th width="10%">变更金额</th><th width="10%">审批流程</th></tr>
+							</thead>
+							<tbody>
+							<!-- if !empty({{list}}) -->
+							<!-- loop list -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td><td>{{list' value.checkman}} <span class="colOrange">审批中</span></td></tr>
+							<!-- endloop -->
+							<!-- endif -->
+							</tbody>
+						</table>
+						<!-- elseif {{status}} == 4 -->
+						<!--已完成-->
+						<table class="table">
+							<thead>
+							<tr><th width="10%">标段</th><th width="20%">变更令号</th><th width="30%">工程名称</th><th width="10%">变更类别</th><th width="10%">变更金额</th></tr>
+							</thead>
+							<tbody>
+							<!-- if !empty({{list}}) -->
+							<!-- loop list -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td></tr>
+							<!-- endloop -->
+							<!-- endif -->
+							</tbody>
+						</table>
+						<!-- elseif {{status}} == 5 -->
+						<!--不通过-->
+						<table class="table">
+							<thead>
+							<tr><th width="10%">标段</th><th width="20%">变更令号</th><th width="30%">工程名称</th><th width="10%">变更类别</th><th width="10%">变更金额</th></tr>
+							</thead>
+							<tbody>
+							<!-- if !empty({{list}}) -->
+							<!-- loop list -->
+							<tr><td>{{pmArray.pmname}}</td><td><a href="/change/detail/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{tofloat(list' value.totalamount)}}</td></tr>
+							<!-- endloop -->
+							<!-- endif -->
+							</tbody>
+						</table>
+						<!-- endif -->
+						<!--翻页-->
+						<nav aria-label="Page navigation">
+							<ul class="pagination">
+								{{pager}}
+							</ul>
+						</nav>
+						<!-- endif -->
+					</div>
+				</div>
+			</div>
+			<!-- endif -->
+		</div>
+		<!--内容-->
+	</div>
+</div>
+
+<script type="text/javascript">autoFlashHeight();</script>
+<!--zTree-->
+<link rel="stylesheet" href="{{rootUrl}}global/css/ztree/zTreeStyle.css" type="text/css">
+<script type="text/javascript" src="{{rootUrl}}global/js/ztree/jquery.ztree.core.js"></script>
+<script type="text/javascript" src="{{rootUrl}}global/js/ztree/jquery.ztree.excheck.js"></script>
+<script type="text/javascript">
+	var setting = {
+		view: {
+			fontCss: getFont,
+			nameIsHTML: true
+		}
+	};
+
+	var zNodes =[
+			<!-- if !empty({{prolist}}) -->
+			<!-- loop prolist -->
+		{ name:"{{prolist' value.pname}}", <!-- if {{prolist' value.open}} == 1 -->font:{'font-weight':'bold'},open:true,<!-- elseif {{prolist' value.open}} == 2 -->font:{'color':'#f0ad4e'},open:true,<!-- endif -->
+			children: [
+					<!-- loop prolist' value.stlist -->
+				{ name:"{{prolist' stlist' value.stname}}",<!-- if {{prolist' stlist' value.open}} == 1 -->font:{'font-weight':'bold'},open:true,<!-- elseif {{prolist' stlist' value.open}} == 2 -->font:{'color':'#f0ad4e'},open:true,<!-- endif -->
+					children: [
+							<!-- loop prolist' value' value.pmlist -->
+						{ name:"{{prolist' stlist' pmlist' value.pmname}}", url: '{{rootUrl}}change/index/{{prolist' stlist' pmlist' value.pmid}}', "target":"_self",<!-- if {{prolist' stlist' pmlist' value.open}} == 1 -->font:{'font-weight':'bold'},checked:true<!-- elseif {{prolist' stlist' pmlist' value.open}} == 2 -->font:{'color':'#f0ad4e'}<!-- endif -->},
+							<!-- endloop -->
+					]},
+					<!-- endloop -->
+			]},
+			<!-- endloop -->
+			<!-- endif -->
+	];
+
+	function getFont(treeId, node) {
+		return node.font ? node.font : {};
+	}
+
+	$(document).ready(function(){
+		$.fn.zTree.init($("#treeDemo"), setting, zNodes);
+
+
+	});
+	//-->
+</script>
+</body>

文件差异内容过多而无法显示
+ 515 - 0
protected/view/biangeng-update.html


+ 2 - 1
protected/view/left.html

@@ -5,7 +5,8 @@
 	    <li data-placement="right" data-toggle="tooltip" data-original-title="审批人"><a href="{{rootUrl}}rproject/index" <!-- if {{currChannle}}=='r' --> class="focus" <!-- endif --> title="需审批项目"><div data-icon="C" aria-hidden="true" class="navIcon"></div>审批项目</a><span class="badge badge-warning">{{numofchecking}}</span></li>
 	    <li data-placement="right" data-toggle="tooltip" data-original-title="计量上报人"><a href="{{rootUrl}}sproject/index" <!-- if {{currChannle}}=='s' --> class="focus" <!-- endif --> title="我编制的项目"><div data-icon="B" aria-hidden="true" class="navIcon"></div>编制项目</a></li>
 		<!-- if {{signSwitch}} == 1 --><li><a href="/sign/index" <!-- if {{currChannle}}=='sign' --> class="focus" <!-- endif --> title="报表签署"><div data-icon="D" aria-hidden="true" class="navIcon"></div>报表签署</a><span class="badge badge-warning">{{needSignNum}}</span></li><!-- endif -->
-	    <!--<li><a href="" title="数据汇总"><div data-icon="E" aria-hidden="true" class="navIcon"></div>汇总</a></li>-->
+		<li><a href="{{rootUrl}}change/index" <!-- if {{currChannle}}=='change' --> class="focus" <!-- endif -->title="变更审批"><div data-icon="M" aria-hidden="true" class="navIcon"></div>变更管理</a><span class="badge badge-warning">{{needChangeNum}}</span></li>
+	     <!--<li><a href="" title="数据汇总"><div data-icon="E" aria-hidden="true" class="navIcon"></div>汇总</a></li>-->
 	</ul>
     </div>
 </div>

+ 4 - 4
protected/view/sign-list-need_sign.html

@@ -29,20 +29,20 @@
         <legend>{{needlist' value.project}}</legend>
         <!-- if !empty({{needlist' value.tlist}}) -->
         <!-- loop needlist' value.tlist -->
-        <!-- if !empty({{needlist' tlist' value.plist -->
-        <!-- loop needlist' tlist' value.plist -->
+        <!-- if !empty({{needlist' tlist' value.plist}}) -->
+        <!-- loop needlist' value' value.plist -->
         <table class="table">
           <thead>
           <tr><th colspan="3">{{needlist' tlist' value.tender}} 第{{ToChinaseNum(needlist' tlist' plist' value.phaseno)}}期</th></tr>
           </thead>
           <tbody>
           <!-- if !empty({{needlist' tlist' plist' value.signlist}}) -->
-          <!-- loop needlist' tlist' plist' value.signlist -->
+          <!-- loop needlist' value' value' value.signlist -->
           <tr>
             <td width="50%">{{needlist' tlist' plist' signlist' value.name}}</td>
             <td>
               <div class="sign-avatars">
-                <!-- loop needlist' tlist' plist' signlist' value.auditlist -->
+                <!-- loop needlist' value' value' value' value.auditlist -->
                 <!-- if {{needlist' tlist' plist' signlist' auditlist' value.status}} == 'checked' -->
                 <span class="colGreen" data-toggle="tooltip" data-placement="bottom" data-original-title="{{formatDate(needlist' tlist' plist' signlist' auditlist' value.intime,'Y-m-d')}} 完成签署">{{needlist' tlist' plist' signlist' auditlist' value.aname}}</span>
                 <!-- elseif {{needlist' tlist' plist' signlist' auditlist' value.status}} == 'checking' -->

+ 0 - 75
protected/viewc/sign-list-need_sign.php

@@ -1,75 +0,0 @@
-<!DOCTYPE html>
-<html lang=zh-cn>
-<head>
-  <meta charset=utf-8>
-  <title>纵横计量支付系统</title>
-  <meta name=description content=计量支付>
-  <meta name=copyright content=smartcost.com.cn>
-  <meta name="viewport" content="width=device-width,initial-scale=1.0">
-  <link rel=stylesheet href="<?php echo $data['rootUrl']; ?>global/css/bootstrap.css">
-  <link rel=stylesheet href=<?php echo $data['rootUrl']; ?>global/css/style.css>
-  <script src=<?php echo $data['rootUrl']; ?>global/js/jquery-1.9.1.min.js></script>
-  <script src=<?php echo $data['rootUrl']; ?>global/js/bootstrap.js></script>
-  <script src=<?php echo $data['rootUrl']; ?>global/js/jl.js></script>
-</head>
-<body>
-<?php include Doo::conf()->SITE_PATH .  Doo::conf()->PROTECTED_FOLDER . "viewc//top.php"; ?>
-<div class="wrapContent">
-  <?php include Doo::conf()->SITE_PATH .  Doo::conf()->PROTECTED_FOLDER . "viewc//left.php"; ?>
-    	<div class="mainContainer">
-    		<!--内容-->
-      <div class="mainContent">
-      <div class="title clearfix">
-        <h1><a href="/sign/index" title="返回"><span class="closePanel" aria-hidden="true" data-icon="Z"></span></a>&nbsp;需要我签署</h1>
-      </div>
-    <div class="project">
-      <?php if( !empty($data['needlist']) ): ?>
-      <?php foreach($data['needlist'] as $k1=>$v1): ?>
-      <div class="proSection">
-        <legend><?php echo $v1['project']; ?></legend>
-        <?php if( !empty($v1['tlist']) ): ?>
-        <?php foreach($v1['tlist'] as $k2=>$v2): ?>
-        <?php if( !empty($v2['plist']) ): ?>
-        <?php foreach($v2['plist'] as $k3=>$v3): ?>
-        <table class="table">
-          <thead>
-          <tr><th colspan="3"><?php echo $v2['tender']; ?> 第<?php echo ToChinaseNum($v3['phaseno']); ?>期</th></tr>
-          </thead>
-          <tbody>
-          <?php if( !empty($v3['signlist']) ): ?>
-          <?php foreach($v3['signlist'] as $k4=>$v4): ?>
-          <tr>
-            <td width="50%"><?php echo $v4['name']; ?></td>
-            <td>
-              <div class="sign-avatars">
-                <?php foreach($v4['auditlist'] as $k5=>$v5): ?>
-                <?php if( $v5['status'] == 'checked' ): ?>
-                <span class="colGreen" data-toggle="tooltip" data-placement="bottom" data-original-title="<?php echo formatDate($v5['intime'], 'Y-m-d'); ?> 完成签署"><?php echo $v5['aname']; ?></span>
-                <?php elseif( $v5['status'] == 'checking' ): ?>
-                <span class="colOrange" data-toggle="tooltip" data-placement="bottom" data-original-title="签署中"><?php echo $v5['aname']; ?></span>
-                <?php else: ?>
-                <span><?php echo $v5['aname']; ?></span>
-                <?php endif; ?>
-                <?php endforeach; ?>
-              </div>
-            </td>
-            <td width="10%"><a href="/sign/needview/<?php echo $v4['sid']; ?>" class="btn btn-primary btn-sm">签署</a></td>
-          </tr>
-          <?php endforeach; ?>
-          <?php endif; ?>
-          </tbody>
-        </table>
-        <?php endforeach; ?>
-        <?php endif; ?>
-        <?php endforeach; ?>
-        <?php endif; ?>
-      </div>
-      <?php endforeach; ?>
-      <?php endif; ?>
-    </div>
-  </div>
-        <!--内容-->
-    	</div>
-    </div>
-<script type="text/javascript">autoFlashHeight();</script>
-</body>