Explorar o código

1.9.0 no.1 up

likeku %!s(int64=7) %!d(string=hai) anos
pai
achega
45d009f20a
Modificáronse 31 ficheiros con 2261 adicións e 61 borrados
  1. 74 0
      global/css/nprogress.css
  2. 3 1
      global/css/style.css
  3. BIN=BIN
      global/images/intermediate-help1.png
  4. BIN=BIN
      global/images/intermediate-help2.png
  5. 2 1
      global/js/jl.js
  6. 480 0
      global/js/nprogress.js
  7. 39 6
      protected/class/sign.php
  8. 36 0
      protected/config/routes.conf.php
  9. 1 1
      protected/config/sms.conf.php
  10. 43 0
      protected/controller/AppController.php
  11. 132 4
      protected/controller/ClientController.php
  12. 11 13
      protected/controller/LoginController.php
  13. 1 0
      protected/controller/ProjectController.php
  14. 359 0
      protected/controller/SProjectController.php
  15. 116 8
      protected/controller/SignController.php
  16. 3 1
      protected/model/sign.php
  17. 16 0
      protected/module/admin/controller/AdminController.php
  18. 41 0
      protected/module/admin/controller/SysController.php
  19. 3 1
      protected/module/admin/model/aconfig.php
  20. 98 0
      protected/module/admin/view/admin-intermediate.html
  21. 85 4
      protected/module/admin/view/admin-sms.html
  22. 1 0
      protected/module/admin/view/menu.html
  23. 1 0
      protected/view/s-project-section-detail.html
  24. 1 0
      protected/view/s-project-section-files-recover.html
  25. 1 0
      protected/view/s-project-section-files.html
  26. 431 0
      protected/view/s-project-section-intermediate-detail.html
  27. 166 0
      protected/view/s-project-section-intermediate.html
  28. 24 2
      protected/view/sign-list-all.html
  29. 2 2
      protected/view/sign-view-page.html
  30. 2 1
      protected/view/sign-view-set_signer.html
  31. 89 16
      protected/view/sign-view-signer_sign.html

+ 74 - 0
global/css/nprogress.css

@@ -0,0 +1,74 @@
+/* Make clicks pass-through */
+#nprogress {
+  pointer-events: none;
+}
+
+#nprogress .bar {
+  background: #29d;
+
+  position: fixed;
+  z-index: 1031;
+  top: 0;
+  left: 0;
+
+  width: 100%;
+  height: 2px;
+}
+
+/* Fancy blur effect */
+#nprogress .peg {
+  display: block;
+  position: absolute;
+  right: 0px;
+  width: 100px;
+  height: 100%;
+  box-shadow: 0 0 10px #29d, 0 0 5px #29d;
+  opacity: 1.0;
+
+  -webkit-transform: rotate(3deg) translate(0px, -4px);
+      -ms-transform: rotate(3deg) translate(0px, -4px);
+          transform: rotate(3deg) translate(0px, -4px);
+}
+
+/* Remove these to get rid of the spinner */
+#nprogress .spinner {
+  display: block;
+  position: fixed;
+  z-index: 1031;
+  top: 15px;
+  right: 15px;
+}
+
+#nprogress .spinner-icon {
+  width: 18px;
+  height: 18px;
+  box-sizing: border-box;
+
+  border: solid 2px transparent;
+  border-top-color: #29d;
+  border-left-color: #29d;
+  border-radius: 50%;
+
+  -webkit-animation: nprogress-spinner 400ms linear infinite;
+          animation: nprogress-spinner 400ms linear infinite;
+}
+
+.nprogress-custom-parent {
+  overflow: hidden;
+  position: relative;
+}
+
+.nprogress-custom-parent #nprogress .spinner,
+.nprogress-custom-parent #nprogress .bar {
+  position: absolute;
+}
+
+@-webkit-keyframes nprogress-spinner {
+  0%   { -webkit-transform: rotate(0deg); }
+  100% { -webkit-transform: rotate(360deg); }
+}
+@keyframes nprogress-spinner {
+  0%   { transform: rotate(0deg); }
+  100% { transform: rotate(360deg); }
+}
+

+ 3 - 1
global/css/style.css

@@ -1062,6 +1062,7 @@ left:5px
   border: 9px solid transparent;
   position: relative;
   overflow: hidden;
+  box-sizing: content-box;
 }
 .warp-printer .page{
   margin:0 auto;
@@ -1069,6 +1070,7 @@ left:5px
   border: 9px solid transparent;
   position: relative;
   overflow: hidden;
+  box-sizing: content-box;
 }
 .sign-side{
   width:220px;
@@ -1135,7 +1137,7 @@ left:5px
   background:rgba(255,0,0,0.1);
 }
 .user-sign img{
-  width:inherit;
+  /*width:inherit;*/
   width: 100%;
 }
 .user-sign .img-bar {

BIN=BIN
global/images/intermediate-help1.png


BIN=BIN
global/images/intermediate-help2.png


+ 2 - 1
global/js/jl.js

@@ -1,6 +1,7 @@
 function autoFlashHeight() {
     var signSide = $(".sign-side").width();
     var viewInfo = $(".view-info").height();
+    var btnBar = $(".btn-bar").height();
     $(".body").height($(window).height());
     $(".mainContainer").height($(window).height() - 51);
     $(".adminContent").height($(window).height() - 117);
@@ -14,7 +15,7 @@ function autoFlashHeight() {
     $(".sign-content").width($(window).width() - signSide - 69);
     $(".sign-content-warp").height($(window).height() - 30);
     $(".sign-content-warp").width($(window).width());
-    $(".signed-list").height($(window).height()-viewInfo-186);
+    $(".signed-list").height($(window).height()-viewInfo-btnBar-140);
 };
 $(window).resize(autoFlashHeight);
 

+ 480 - 0
global/js/nprogress.js

@@ -0,0 +1,480 @@
+/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
+ * @license MIT */
+
+;(function(root, factory) {
+
+  if (typeof define === 'function' && define.amd) {
+    define(factory);
+  } else if (typeof exports === 'object') {
+    module.exports = factory();
+  } else {
+    root.NProgress = factory();
+  }
+
+})(this, function() {
+  var NProgress = {};
+
+  NProgress.version = '0.2.0';
+
+  var Settings = NProgress.settings = {
+    minimum: 0.08,
+    easing: 'linear',
+    positionUsing: '',
+    speed: 200,
+    trickle: true,
+    trickleSpeed: 200,
+    showSpinner: true,
+    barSelector: '[role="bar"]',
+    spinnerSelector: '[role="spinner"]',
+    parent: 'body',
+    template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
+  };
+
+  /**
+   * Updates configuration.
+   *
+   *     NProgress.configure({
+   *       minimum: 0.1
+   *     });
+   */
+  NProgress.configure = function(options) {
+    var key, value;
+    for (key in options) {
+      value = options[key];
+      if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value;
+    }
+
+    return this;
+  };
+
+  /**
+   * Last number.
+   */
+
+  NProgress.status = null;
+
+  /**
+   * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`.
+   *
+   *     NProgress.set(0.4);
+   *     NProgress.set(1.0);
+   */
+
+  NProgress.set = function(n) {
+    var started = NProgress.isStarted();
+
+    n = clamp(n, Settings.minimum, 1);
+    NProgress.status = (n === 1 ? null : n);
+
+    var progress = NProgress.render(!started),
+        bar      = progress.querySelector(Settings.barSelector),
+        speed    = Settings.speed,
+        ease     = Settings.easing;
+
+    progress.offsetWidth; /* Repaint */
+
+    queue(function(next) {
+      // Set positionUsing if it hasn't already been set
+      if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS();
+
+      // Add transition
+      css(bar, barPositionCSS(n, speed, ease));
+
+      if (n === 1) {
+        // Fade out
+        css(progress, {
+          transition: 'none',
+          opacity: 1
+        });
+        progress.offsetWidth; /* Repaint */
+
+        setTimeout(function() {
+          css(progress, {
+            transition: 'all ' + speed + 'ms linear',
+            opacity: 0
+          });
+          setTimeout(function() {
+            NProgress.remove();
+            next();
+          }, speed);
+        }, speed);
+      } else {
+        setTimeout(next, speed);
+      }
+    });
+
+    return this;
+  };
+
+  NProgress.isStarted = function() {
+    return typeof NProgress.status === 'number';
+  };
+
+  /**
+   * Shows the progress bar.
+   * This is the same as setting the status to 0%, except that it doesn't go backwards.
+   *
+   *     NProgress.start();
+   *
+   */
+  NProgress.start = function() {
+    if (!NProgress.status) NProgress.set(0);
+
+    var work = function() {
+      setTimeout(function() {
+        if (!NProgress.status) return;
+        NProgress.trickle();
+        work();
+      }, Settings.trickleSpeed);
+    };
+
+    if (Settings.trickle) work();
+
+    return this;
+  };
+
+  /**
+   * Hides the progress bar.
+   * This is the *sort of* the same as setting the status to 100%, with the
+   * difference being `done()` makes some placebo effect of some realistic motion.
+   *
+   *     NProgress.done();
+   *
+   * If `true` is passed, it will show the progress bar even if its hidden.
+   *
+   *     NProgress.done(true);
+   */
+
+  NProgress.done = function(force) {
+    if (!force && !NProgress.status) return this;
+
+    return NProgress.inc(0.3 + 0.5 * Math.random()).set(1);
+  };
+
+  /**
+   * Increments by a random amount.
+   */
+
+  NProgress.inc = function(amount) {
+    var n = NProgress.status;
+
+    if (!n) {
+      return NProgress.start();
+    } else if(n > 1) {
+      return;
+    } else {
+      if (typeof amount !== 'number') {
+        if (n >= 0 && n < 0.2) { amount = 0.1; }
+        else if (n >= 0.2 && n < 0.5) { amount = 0.04; }
+        else if (n >= 0.5 && n < 0.8) { amount = 0.02; }
+        else if (n >= 0.8 && n < 0.99) { amount = 0.005; }
+        else { amount = 0; }
+      }
+
+      n = clamp(n + amount, 0, 0.994);
+      return NProgress.set(n);
+    }
+  };
+
+  NProgress.trickle = function() {
+    return NProgress.inc();
+  };
+
+  /**
+   * Waits for all supplied jQuery promises and
+   * increases the progress as the promises resolve.
+   *
+   * @param $promise jQUery Promise
+   */
+  (function() {
+    var initial = 0, current = 0;
+
+    NProgress.promise = function($promise) {
+      if (!$promise || $promise.state() === "resolved") {
+        return this;
+      }
+
+      if (current === 0) {
+        NProgress.start();
+      }
+
+      initial++;
+      current++;
+
+      $promise.always(function() {
+        current--;
+        if (current === 0) {
+            initial = 0;
+            NProgress.done();
+        } else {
+            NProgress.set((initial - current) / initial);
+        }
+      });
+
+      return this;
+    };
+
+  })();
+
+  /**
+   * (Internal) renders the progress bar markup based on the `template`
+   * setting.
+   */
+
+  NProgress.render = function(fromStart) {
+    if (NProgress.isRendered()) return document.getElementById('nprogress');
+
+    addClass(document.documentElement, 'nprogress-busy');
+
+    var progress = document.createElement('div');
+    progress.id = 'nprogress';
+    progress.innerHTML = Settings.template;
+
+    var bar      = progress.querySelector(Settings.barSelector),
+        perc     = fromStart ? '-100' : toBarPerc(NProgress.status || 0),
+        parent   = document.querySelector(Settings.parent),
+        spinner;
+
+    css(bar, {
+      transition: 'all 0 linear',
+      transform: 'translate3d(' + perc + '%,0,0)'
+    });
+
+    if (!Settings.showSpinner) {
+      spinner = progress.querySelector(Settings.spinnerSelector);
+      spinner && removeElement(spinner);
+    }
+
+    if (parent != document.body) {
+      addClass(parent, 'nprogress-custom-parent');
+    }
+
+    parent.appendChild(progress);
+    return progress;
+  };
+
+  /**
+   * Removes the element. Opposite of render().
+   */
+
+  NProgress.remove = function() {
+    removeClass(document.documentElement, 'nprogress-busy');
+    removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent');
+    var progress = document.getElementById('nprogress');
+    progress && removeElement(progress);
+  };
+
+  /**
+   * Checks if the progress bar is rendered.
+   */
+
+  NProgress.isRendered = function() {
+    return !!document.getElementById('nprogress');
+  };
+
+  /**
+   * Determine which positioning CSS rule to use.
+   */
+
+  NProgress.getPositioningCSS = function() {
+    // Sniff on document.body.style
+    var bodyStyle = document.body.style;
+
+    // Sniff prefixes
+    var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' :
+                       ('MozTransform' in bodyStyle) ? 'Moz' :
+                       ('msTransform' in bodyStyle) ? 'ms' :
+                       ('OTransform' in bodyStyle) ? 'O' : '';
+
+    if (vendorPrefix + 'Perspective' in bodyStyle) {
+      // Modern browsers with 3D support, e.g. Webkit, IE10
+      return 'translate3d';
+    } else if (vendorPrefix + 'Transform' in bodyStyle) {
+      // Browsers without 3D support, e.g. IE9
+      return 'translate';
+    } else {
+      // Browsers without translate() support, e.g. IE7-8
+      return 'margin';
+    }
+  };
+
+  /**
+   * Helpers
+   */
+
+  function clamp(n, min, max) {
+    if (n < min) return min;
+    if (n > max) return max;
+    return n;
+  }
+
+  /**
+   * (Internal) converts a percentage (`0..1`) to a bar translateX
+   * percentage (`-100%..0%`).
+   */
+
+  function toBarPerc(n) {
+    return (-1 + n) * 100;
+  }
+
+
+  /**
+   * (Internal) returns the correct CSS for changing the bar's
+   * position given an n percentage, and speed and ease from Settings
+   */
+
+  function barPositionCSS(n, speed, ease) {
+    var barCSS;
+
+    if (Settings.positionUsing === 'translate3d') {
+      barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };
+    } else if (Settings.positionUsing === 'translate') {
+      barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };
+    } else {
+      barCSS = { 'margin-left': toBarPerc(n)+'%' };
+    }
+
+    barCSS.transition = 'all '+speed+'ms '+ease;
+
+    return barCSS;
+  }
+
+  /**
+   * (Internal) Queues a function to be executed.
+   */
+
+  var queue = (function() {
+    var pending = [];
+
+    function next() {
+      var fn = pending.shift();
+      if (fn) {
+        fn(next);
+      }
+    }
+
+    return function(fn) {
+      pending.push(fn);
+      if (pending.length == 1) next();
+    };
+  })();
+
+  /**
+   * (Internal) Applies css properties to an element, similar to the jQuery
+   * css method.
+   *
+   * While this helper does assist with vendor prefixed property names, it
+   * does not perform any manipulation of values prior to setting styles.
+   */
+
+  var css = (function() {
+    var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ],
+        cssProps    = {};
+
+    function camelCase(string) {
+      return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) {
+        return letter.toUpperCase();
+      });
+    }
+
+    function getVendorProp(name) {
+      var style = document.body.style;
+      if (name in style) return name;
+
+      var i = cssPrefixes.length,
+          capName = name.charAt(0).toUpperCase() + name.slice(1),
+          vendorName;
+      while (i--) {
+        vendorName = cssPrefixes[i] + capName;
+        if (vendorName in style) return vendorName;
+      }
+
+      return name;
+    }
+
+    function getStyleProp(name) {
+      name = camelCase(name);
+      return cssProps[name] || (cssProps[name] = getVendorProp(name));
+    }
+
+    function applyCss(element, prop, value) {
+      prop = getStyleProp(prop);
+      element.style[prop] = value;
+    }
+
+    return function(element, properties) {
+      var args = arguments,
+          prop,
+          value;
+
+      if (args.length == 2) {
+        for (prop in properties) {
+          value = properties[prop];
+          if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value);
+        }
+      } else {
+        applyCss(element, args[1], args[2]);
+      }
+    }
+  })();
+
+  /**
+   * (Internal) Determines if an element or space separated list of class names contains a class name.
+   */
+
+  function hasClass(element, name) {
+    var list = typeof element == 'string' ? element : classList(element);
+    return list.indexOf(' ' + name + ' ') >= 0;
+  }
+
+  /**
+   * (Internal) Adds a class to an element.
+   */
+
+  function addClass(element, name) {
+    var oldList = classList(element),
+        newList = oldList + name;
+
+    if (hasClass(oldList, name)) return;
+
+    // Trim the opening space.
+    element.className = newList.substring(1);
+  }
+
+  /**
+   * (Internal) Removes a class from an element.
+   */
+
+  function removeClass(element, name) {
+    var oldList = classList(element),
+        newList;
+
+    if (!hasClass(element, name)) return;
+
+    // Replace the class name.
+    newList = oldList.replace(' ' + name + ' ', ' ');
+
+    // Trim the opening and closing spaces.
+    element.className = newList.substring(1, newList.length - 1);
+  }
+
+  /**
+   * (Internal) Gets a space separated list of the class names on the element.
+   * The list is wrapped with a single space on each end to facilitate finding
+   * matches within the list.
+   */
+
+  function classList(element) {
+    return (' ' + (element && element.className || '') + ' ').replace(/\s+/gi, ' ');
+  }
+
+  /**
+   * (Internal) Removes an element from the DOM.
+   */
+
+  function removeElement(element) {
+    element && element.parentNode && element.parentNode.removeChild(element);
+  }
+
+  return NProgress;
+});

+ 39 - 6
protected/class/sign.php

@@ -27,10 +27,10 @@ class Signn
     }
 
     public function getUnSignNum($sql,$uid){
-        return $this->_sign->count(array('where' => $sql.' and status="uncheck" AND (`ownuid`='.$uid.' OR tender IN (SELECT pmid FROM jl_measure_audit WHERE auditoruid='.$uid.' GROUP BY auditoruid) OR project IN (SELECT pid FROM jl_project_measure WHERE uid='.$uid.'))', 'asArray' => TRUE));    }
+        return $this->_sign->count(array('where' => $sql.' and status="uncheck" AND (`isinter`=0 OR `isinter`=3) AND (`ownuid`='.$uid.' OR tender IN (SELECT pmid FROM jl_measure_audit WHERE auditoruid='.$uid.' GROUP BY auditoruid) OR project IN (SELECT pid FROM jl_project_measure WHERE uid='.$uid.'))', 'asArray' => TRUE));    }
 
     public function getDoingSignNumbyUid($uid, $sql = ' 1'){
-        return $this->_sign->count(array('where' => $sql.' and status="checking" and sid in(select `jl_sign_audit`.sid from `jl_sign_audit` where `jl_sign_audit`.audituid=?)', 'param' => array($uid), 'asArray' => TRUE));
+        return $this->_sign->count(array('where' => $sql.' and (status="checking" or status="back") and sid in(select `jl_sign_audit`.sid from `jl_sign_audit` where `jl_sign_audit`.audituid=?)', 'param' => array($uid), 'asArray' => TRUE));
     }
 
     public function getDoneSignNumbyUid($uid, $sql = ' 1'){
@@ -73,11 +73,13 @@ class Signn
         return $this->_signaudit->getOne(array('where' => 'sid=? and audituid=?', 'param' => array($sid,$uid), 'asArray' => TRUE));
     }
 
-    public function updateSignAudit($satid,$status){
+    public function updateSignAudit($satid,$status,$time = 0){
         $this->_signaudit->satid = $satid;
         $this->_signaudit->status = $status;
         if($status == 'checked'){
             $this->_signaudit->intime = time();
+        }else{
+            $this->_signaudit->intime = $time;
         }
         return $this->_signaudit->update();
     }
@@ -110,7 +112,7 @@ class Signn
     }
 
     public function getDoingSignListbyUid($uid,$sql = ' 1', $limit){
-        return $this->_sign->find(array('where' => $sql.' and status="checking" and sid in(select `jl_sign_audit`.sid from `jl_sign_audit` where `jl_sign_audit`.audituid=?)', 'param' => array($uid), 'desc' => 'sid', 'limit' => $limit, 'asArray' => TRUE));
+        return $this->_sign->find(array('where' => $sql.' and (status="checking" or status="back") and sid in(select `jl_sign_audit`.sid from `jl_sign_audit` where `jl_sign_audit`.audituid=?)', 'param' => array($uid), 'desc' => 'sid', 'limit' => $limit, 'asArray' => TRUE));
     }
 
     public function getMySignListbyUid($uid,$sql = ' 1',$limit){
@@ -124,14 +126,14 @@ class Signn
     }
 
     public function getUnSignList($sql, $uid, $limit){
-        return $this->_sign->find(array('where' => $sql.' and status="uncheck" AND (`ownuid`='.$uid.' OR tender IN (SELECT pmid FROM jl_measure_audit WHERE auditoruid='.$uid.' GROUP BY auditoruid) OR project IN (SELECT pid FROM jl_project_measure WHERE uid='.$uid.'))', 'desc' => 'sid', 'limit' => $limit, 'asArray' => TRUE));
+        return $this->_sign->find(array('where' => $sql.' and status="uncheck" AND (`isinter`=0 OR `isinter`=3) AND (`ownuid`='.$uid.' OR tender IN (SELECT pmid FROM jl_measure_audit WHERE auditoruid='.$uid.' GROUP BY auditoruid) OR project IN (SELECT pid FROM jl_project_measure WHERE uid='.$uid.'))', 'desc' => 'sid', 'limit' => $limit, 'asArray' => TRUE));
     }
 
     public function getSignList($sql, $limit){
         return $this->_sign->find(array('where' => $sql, 'desc' => 'sid', 'limit' => $limit, 'asArray' => TRUE));
     }
 
-    public function insertSign($pid, $tid, $phaseno, $name, $ownuid,$intime,$widhei){
+    public function insertSign($pid, $tid, $phaseno, $name, $ownuid,$intime,$widhei,$isinter = 0, $internum = 0){
         $this->_sign->project = $pid;
         $this->_sign->tender = $tid;
         $this->_sign->phaseno = $phaseno;
@@ -139,6 +141,8 @@ class Signn
         $this->_sign->ownuid = $ownuid;
         $this->_sign->intime = $intime;
         $this->_sign->widhei = $widhei;
+        $this->_sign->isinter = $isinter;
+        $this->_sign->internum = $internum;
         return $this->_sign->insert();
     }
 
@@ -185,6 +189,7 @@ class Signn
 
     public function delSignbysid($sid,$status){
         if($status == 'checking'){
+
             $this->_signaudit->sid = $sid;
             $this->_signaudit->delete();
 
@@ -202,4 +207,32 @@ class Signn
         $this->_signatt->delete();
     }
 
+    public function updateInterMediateStatus($sid,$status){
+        $this->_sign->sid= $sid;
+        $this->_sign->isinter = $status;
+        return $this->_sign->update();
+    }
+
+    public function getOneSignAtt($sid,$num){
+        return  $this->_signatt->getOne(array('where' => 'sid=? and curnum=?', 'param' => array($sid,$num), 'asArray' => TRUE));
+    }
+
+    public function updateSignAtt($sid,$curnum,$path){
+        $signattmsg = $this->_signatt->getOne(array('where' => 'sid=? and curnum=?', 'param' => array($sid,$curnum), 'asArray' => TRUE));
+        if(!empty($signattmsg)){
+            $this->_signatt->said = $signattmsg['said'];
+            $this->_signatt->filepath = $path;
+            return $this->_signatt->update();
+        }else{
+            return false;
+        }
+    }
+
+    public function updateSignStatusAndTime($sid,$status,$time = ''){
+        $this->_sign->sid = $sid;
+        $this->_sign->status = $status;
+        $this->_sign->sintime = $time;
+        return $this->_sign->update();
+    }
+
 }

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

@@ -213,6 +213,7 @@ $route['*']['/manage/restore/list'] = array('[admin]RestoreController', 'restore
 $route['*']['/manage/sys/info'] = array('[admin]SysController', 'sysinfo');
 $route['*']['/manage/sys/sms/switch'] = array('[admin]SysController', 'smsSwitch');
 $route['*']['/manage/sys/sign/switch'] = array('[admin]SysController', 'signSwitch');
+$route['*']['/manage/sys/intermediate/switch'] = array('[admin]SysController', 'interMediateSwitch');
 
 $route['*']['/manage/item/index'] = array('[admin]ProController', 'index');
 $route['*']['/manage/item/:pid/section'] = array('[admin]ProController', 'section');
@@ -348,6 +349,41 @@ $route['*']['/api/client/tender/concernaudit/del'] = array('ClientController', '
  */
 $route['*']['/api/client/sign/switch'] = array('ClientController', 'signSwitch');
 
+/**
+ * 创建中间计量表
+ */
+$route['*']['/api/client/intermediate/create'] = array('ClientController', 'getInterMediateCreate');
+/*
+ * 上传中间计量表图片,一张一张传
+ */
+$route['*']['/api/client/intermediate/upload'] = array('ClientController', 'getInterMediateUpload');
+/**
+ * 获取报表列表
+ */
+$route['*']['/api/client/intermediate/list'] = array('ClientController', 'getInterMediateList');
+
+/*
+ * 获取签名
+ */
+$route['*']['/api/app/sign/catch'] = array('AppController', 'getSignPic');
+/*
+ * 上传签名照
+ */
+$route['*']['/api/app/sign/upload'] = array('AppController', 'uploadSignPic');
+
+// S 中间计量表
+$route['*']['/sproject/:pid/section/:pmid/intermediate'] = array('SProjectController', 'proSectionInterMediate');
+$route['*']['/sproject/:pid/section/:pmid/intermediate/page/:pindex'] = array('SProjectController', 'proSectionInterMediate');
+$route['*']['/sproject/:pid/section/:pmid/phaseno/:mpid/intermediate'] = array('SProjectController', 'proSectionInterMediate');
+$route['*']['/sproject/:pid/section/:pmid/phaseno/:mpid/intermediate/page/:pindex'] = array('SProjectController', 'proSectionInterMediate');
+$route['*']['/sproject/make/intermediate/:sid'] = array('SProjectController', 'interMediateMake');
+$route['*']['/sproject/make/intermediate/:sid/page/:page'] = array('SProjectController', 'interMediateMake');
+$route['*']['/sproject/upload/intermediate/:sid'] = array('SProjectController', 'interMediateUpload');
+$route['*']['/sproject/intermediate/view/:sid'] = array('SProjectController', 'signView');
+/**
+ * 中间计量表添加草图功能开关
+ */
+$route['*']['/api/client/intermediate/switch'] = array('ClientController', 'interMediateSwitch');
 
 //手机app扫码登录
 $route['*']['/api/app/scan/validate'] = array('AppController', 'scanValidate');

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
protected/config/sms.conf.php


+ 43 - 0
protected/controller/AppController.php

@@ -402,6 +402,49 @@ class AppController extends DooController {
         }
     }
 
+    public function getSignPic(){
+        if(isset($_POST['uid']) && is_numeric($_POST['uid'])){
+            $userArray = $this->profile->getProWithUid($_POST['uid']);
+            if(!empty($userArray)){
+                $signPic = $userArray['signpath'];
+                $status = array('status' => TRUE, 'msg' => '', 'signpic' => Doo::conf()->APP_URL . $signPic);
+                echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                die();
+            }
+        }
+        $status = array('status' => FALSE, 'msg' => '参数有误');
+        echo json_encode($status, JSON_UNESCAPED_UNICODE);
+        die();
+    }
+
+    public function uploadSignPic(){
+        if(isset($_POST['uid']) && is_numeric($_POST['uid']) && isset($_POST['signbase64'])){
+            $userArray = $this->profile->getProWithUid($_POST['uid']);
+            if(!empty($userArray)){
+                $img = base64_decode($_POST['signbase64']);
+                $dir = 'global/signpath';
+                $fileName = date("YmdHis") . '_' . floor(microtime() * 1000) . '_' . self::createRandomCode(8);
+                $virtualPath = "$dir/php_sign_$fileName.jpg";
+                $a = file_put_contents(Doo::conf()->SITE_PATH .$virtualPath,$img);
+//                move_uploaded_file($_FILES['sign']["tmp_name"], Doo::conf()->SITE_PATH .$virtualPath);
+                if($a){
+                    $this->profile->setSignPath($this->params['uid'], $virtualPath);
+                    $status = array('status' => TRUE, 'msg' => '');
+                    echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                    die();
+                }else{
+                    $status = array('status' => FALSE, 'msg' => '上传签名照失败');
+                    echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+
+            }
+        }
+        $status = array('status' => FALSE, 'msg' => '参数有误');
+        echo json_encode($status, JSON_UNESCAPED_UNICODE);
+        die();
+    }
+
 //二维数组去掉重复值 并保留键值
     function array_unique_fb($array2D)
     {

+ 132 - 4
protected/controller/ClientController.php

@@ -1588,10 +1588,20 @@ class ClientController extends DooController
         }
         $signlist = $this->sign->getSignListbyClient($wheresql);
         if(!empty($signlist)){
-//            foreach($signlist as $k => $v){
-//                $signlist[$k]['pdfpath'] = 'signs/'.$v['sid'].'/'.$v['intime'].'.pdf';
-//            }
-            echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $signlist), JSON_UNESCAPED_UNICODE);
+            $interMediatelist = array();
+            foreach($signlist as $k => $v){
+                $interMediatelist[$k]['signid'] = $v['sid'];
+                $interMediatelist[$k]['md5_sign'] = md5(Doo::conf()->SITE_PATH . 'signs/' . $v['sid']);
+                $interMediatelist[$k]['project'] = $v['project'];
+                $interMediatelist[$k]['tender'] = $v['tender'];
+                $interMediatelist[$k]['phaseno'] = $v['phaseno'];
+                $interMediatelist[$k]['name'] = $v['name'];
+                $interMediatelist[$k]['ownuid'] = $v['ownuid'];
+                $interMediatelist[$k]['status'] = $v['isinter'];
+                $interMediatelist[$k]['currnum'] = $v['pagenum'];
+                $interMediatelist[$k]['totalnum'] = $v['internum'];
+            }
+            echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $interMediatelist), JSON_UNESCAPED_UNICODE);
             die();
         }else{
             $status = array('status' => TRUE, 'msg' => '当前没有签署报表','info' => '');
@@ -1600,6 +1610,115 @@ class ClientController extends DooController
         }
     }
 
+    //中间计量表的接口
+    public function getInterMediateCreate(){
+        // TODO:上报数据
+        if (isset($_POST['project']) && isset($_POST['tender']) && isset($_POST['phaseno']) && isset($_POST['name']) && isset($_POST['ownuid']) && isset($_POST['widhei']) && isset($_POST['totalnum'])) {
+            //解压压缩包并把图片存到文件夹中
+            @$_POST['name'] = iconv('GBK', 'UTF-8', $_POST['name']);
+            $samesignname = $this->sign->getSignbyName($_POST['tender'], $_POST['phaseno'], $_POST['name']);
+            if(!empty($samesignname)){
+                $status = array('status' => 'FALSE', 'msg' => '存在同名中间计量表');
+                echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                die();
+            }
+
+            //添加到签署报表中
+            $intime = time();
+            $signid = $this->sign->insertSign($_POST['project'], $_POST['tender'], $_POST['phaseno'], $_POST['name'], $_POST['ownuid'],$intime,$_POST['widhei'],1,$_POST['totalnum']);
+
+            $extPathdir = Doo::conf()->SITE_PATH . 'signs/' . $signid;
+            if (!$this->dir_create2($extPathdir)) {
+                $status = array('status' => 'FALSE', 'msg' => '文件夹创建失败');
+                echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                die();
+            }
+            $status = array('status' => 'TRUE','msg' => '', 'info' => array('signid' => $signid, 'md5_sign' => md5($extPathdir)));
+            echo json_encode($status, JSON_UNESCAPED_UNICODE);
+            die();
+        } else {
+            $status = array('status' => 'FALSE', 'msg' => '上传参数错误');
+            echo json_encode($status, JSON_UNESCAPED_UNICODE);
+            die();
+        }
+    }
+
+    public function getInterMediateUpload(){
+        if(isset($_POST['signid']) && isset($_POST['md5_sign']) && !empty($_FILES['imediate']['name'])){
+            $extPathdir = Doo::conf()->SITE_PATH . 'signs/' . $_POST['signid'];
+            if($_POST['md5_sign'] != md5($extPathdir)){
+                $status = array('status' => 'FALSE', 'msg' => '上传的图表不对应');
+                echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                die();
+            }
+
+            $path = $extPathdir .'/' . $_FILES['imediate']['name'];
+            @chmod(Doo::conf()->SITE_PATH.$path,0777);
+            $k = move_uploaded_file($_FILES['imediate']["tmp_name"], $path);
+            if($k){
+                $signatt = new signn();
+                $result = $signatt->insertSignAtt($_POST['signid'],basename($_FILES['imediate']['name'],".jpg"),'signs/' . $_POST['signid'].'/'.$_FILES['imediate']['name']);
+                if(!empty($result)){
+                    $sign2 = new signn();
+                    $signArray = $sign2->getOneSignbysid($_POST['signid']);
+
+                    $sign2->updateSignPageNum($_POST['signid'],$signArray['pagenum']+1);
+                    if($signArray['pagenum']+1 == $signArray['internum']){
+                        $sign2->updateInterMediateStatus($_POST['signid'],2);
+                    }
+                    $status = array('status' => 'TRUE');
+                    echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                    die();
+                }else{
+                    $status = array('status' => 'FALSE', 'msg' => '图片保存出错');
+                    echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+            }else{
+                $status = array('status' => 'FALSE', 'msg' => '上传图片失败');
+                echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                die();
+            }
+        }else{
+            $status = array('status' => 'FALSE', 'msg' => '上传参数错误');
+            echo json_encode($status, JSON_UNESCAPED_UNICODE);
+            die();
+        }
+    }
+
+    public function getInterMediateList(){
+        $wheresql = 'isinter!=0';
+        if(isset($_POST['project']) && is_numeric($_POST['project'])){
+            $wheresql .= ' and project='.$_POST['project'];
+        }
+        if(isset($_POST['tender']) && is_numeric($_POST['tender'])) {
+            $wheresql .= ' and tender='.$_POST['tender'];
+        }
+        if(isset($_POST['phaseno']) && is_numeric($_POST['phaseno'])){
+            $wheresql .= ' and phaseno='.$_POST['phaseno'];
+        }
+        $signlist = $this->sign->getSignListbyClient($wheresql);
+        if(!empty($signlist)){
+            $interMediatelist = array();
+            foreach($signlist as $k => $v){
+                $interMediatelist[$k]['signid'] = $v['sid'];
+                $interMediatelist[$k]['md5_sign'] = md5(Doo::conf()->SITE_PATH . 'signs/' . $v['sid']);
+                $interMediatelist[$k]['phaseno'] = $v['phaseno'];
+                $interMediatelist[$k]['name'] = $v['name'];
+                $interMediatelist[$k]['ownuid'] = $v['ownuid'];
+                $interMediatelist[$k]['status'] = $v['isinter'];
+                $interMediatelist[$k]['currnum'] = $v['pagenum'];
+                $interMediatelist[$k]['totalnum'] = $v['internum'];
+            }
+            echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $interMediatelist), JSON_UNESCAPED_UNICODE);
+            die();
+        }else{
+            $status = array('status' => TRUE, 'msg' => '当前没有中间计量表','info' => '');
+            echo json_encode($status, JSON_UNESCAPED_UNICODE);
+            die();
+        }
+    }
+
     // public function testzip(){
     //     $this->render('testzip', $this->data);
     // }
@@ -1871,6 +1990,15 @@ class ClientController extends DooController
         echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $reportSwitch), JSON_UNESCAPED_UNICODE);
         die();
     }
+
+    /**
+     * 中间计量表添加草图功能开关
+     */
+    public function interMediateSwitch(){
+        $imediateswitch = $this->aconfig->getOne(array('select' => 'imediateswitch', 'asArray' => TRUE))['imediateswitch'];
+        echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $imediateswitch), JSON_UNESCAPED_UNICODE);
+        die();
+    }
 }
 
 ?>

+ 11 - 13
protected/controller/LoginController.php

@@ -42,19 +42,17 @@ class LoginController extends DooController
     public function Signin()
     {
         $this->data['tips'] = '';
-        if ($_GET['username']) {
-            if (isset($_GET['username'])) {
-                $retval = $this->auth->checkLoginWithUserName($_GET['username']);
-                if (isset($retval['uid'])) {
-                    $this->auth->setUid($retval['uid']);
-                    $this->auth->setUemail($retval['uemail']);
-                    $_SESSION['token'] = sha1($this->create_randomstr() . $_SESSION['uid']);
-                    $this->auth->updateToken($retval['uid'],$_SESSION['token'],1);
-                    setcookie('token', $_SESSION['token'], 0, '/', Doo::conf()->APP_URL, FALSE, TRUE);
-                    return Doo::conf()->APP_URL . 'project/index';
-                } else {
-                    $this->data['tips'] = '<div class="alert alert-danger"><span data-icon="t" aria-hidden="true"></span> 帐号或密码错误,请检查输入是否有误。</div>';
-                }
+        if (isset($_GET['username'])) {
+            $retval = $this->auth->checkLoginWithUserName($_GET['username']);
+            if (isset($retval['uid'])) {
+                $this->auth->setUid($retval['uid']);
+                $this->auth->setUemail($retval['uemail']);
+                $_SESSION['token'] = sha1($this->create_randomstr() . $_SESSION['uid']);
+                $this->auth->updateToken($retval['uid'],$_SESSION['token'],1);
+                setcookie('token', $_SESSION['token'], 0, '/', Doo::conf()->APP_URL, FALSE, TRUE);
+                return Doo::conf()->APP_URL . 'project/index';
+            } else {
+                $this->data['tips'] = '<div class="alert alert-danger"><span data-icon="t" aria-hidden="true"></span> 帐号或密码错误,请检查输入是否有误。</div>';
             }
         } else {
             if (isset($_POST['uemail']) && isset($_POST['upasswd'])) {

+ 1 - 0
protected/controller/ProjectController.php

@@ -58,6 +58,7 @@ class ProjectController extends DooController
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
         $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
         if (isset($mpidArray[0]['pid'])) {
+            $this->data['numofchecking'] = 0;
             foreach ($mpidArray as $key => $value) {
                 // 审批操作按照时间排序多标段
                 $this->data['numofchecking'] += $this->measureauditact->getCountMyChecking($value['pid'], $this->auth->getUid());

+ 359 - 0
protected/controller/SProjectController.php

@@ -61,6 +61,7 @@ class SProjectController extends DooController
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
         $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
         if (isset($mpidArray[0]['pid'])) {
+            $this->data['numofchecking'] = 0;
             foreach ($mpidArray as $key => $value) {
                 // 审批操作按照时间排序多标段
                 $this->data['numofchecking'] += $this->measureauditact->getCountMyChecking($value['pid'], $this->auth->getUid());
@@ -78,6 +79,9 @@ class SProjectController extends DooController
 
         //获取桌面版本
         $this->getsoftware();
+
+        //草图入口
+        $this->data['imediateSwitch'] = $this->aconfig->getOne(array('select' => 'imediateswitch', 'asArray' => TRUE))['imediateswitch'];
     }
 
     function getsoftware(){
@@ -622,6 +626,338 @@ class SProjectController extends DooController
         return;
     }
 
+    public function proSectionInterMediate(){
+
+        //草图功能开关控制
+        if($this->data['imediateSwitch'] == 0){
+            exit('中间计量表草图添加功能未启用...');
+        }
+
+        if(isset($_POST['delid']) && is_numeric($_POST['delid'])){
+            //删除未签署报表数据和文件
+            $signmsg = $this->sign->getOneSignbysid($_POST['delid']);
+            if(empty($signmsg) && $signmsg['status'] == "checked" && $signmsg['ownuid'] != $this->auth->getUid()){
+                exit(json_encode(array('code' => 400),JSON_UNESCAPED_UNICODE));
+            }
+            $this->sign->delSignbysid($_POST['delid'],$signmsg['status']);
+
+            include (DOO::conf()->SITE_PATH . 'protected/plugin/io.han.php');
+            $this->IoHandler = new IoHandler();
+            $path = DOO::conf()->SITE_PATH."signs/".$_POST['delid'];
+            $this->IoHandler->RemoveDir($path);
+
+            exit(json_encode(array('code' => 200),JSON_UNESCAPED_UNICODE));
+        }
+
+        $this->data['currproArray'] = $this->data['allproArray'] = NULL;
+        $proArray = $this->actmeasure->getGroupProject($this->auth->getUid());
+        foreach ($proArray as $v) {
+            $pidArray[] = $v['pid'];
+        }
+        $pidstr = implode(',', $pidArray);
+        // 项目名称
+        $allproArray = $this->project->getFewRow($pidstr);
+        // 面包屑导航项目
+        foreach ($allproArray as $kk => $vv) {
+            if ($vv['pid'] == $this->params['pid']) {
+                $this->data['currproArray'] = $vv;
+            } else {
+                $this->data['allproArray'][] = $vv;
+            }
+        }
+        // 面包屑导航合同
+        $conArray = $this->contractact->getAll();
+        $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
+        if (isset($measureArray['stid'])) {
+            foreach ($conArray as $kkk => $vvv) {
+                if ($vvv['stid'] == $measureArray['stid']) {
+                    $this->data['currconArray'] = $vvv;
+                } else {
+                    if ($vvv['pid'] == $this->params['pid'])
+                        $this->data['allconArray'][] = $vvv;
+                }
+            }
+        } else {
+            $this->data['currconArray'] = $this->data['allconArray'] = NULL;
+        }
+        // 面包屑导航标段
+        $this->data['curractmeasureArray'] = NULL;
+        $this->data['allactmeasureArray'] = [];
+//        $actmeasureArray = $this->actmeasure->getAll();
+        $actmeasureArray = $this->actmeasure->getRowUser($this->auth->getUid());
+        foreach ($actmeasureArray as $kkkk => $vvvv) {
+            if ($vvvv['stid'] == $measureArray['stid']) {
+                if (($vvvv['pmid'] == $this->params['pmid'])) {
+                    $this->data['curractmeasureArray'] = $vvvv;
+                } else {
+                    $this->data['allactmeasureArray'][] = $vvvv;
+                }
+            }
+        }
+
+        Doo::loadHelper('DooPager');
+        $pagestr = '';
+        $sqlstr = ' 1';
+//        $this->data['project'] = '';
+//        $this->data['tender'] = '';
+        $this->data['phaseno'] = '';
+        $this->data['nosign'] = '';
+
+        //获取项目信息
+        $searchsql = 'isinter!=0 and (`ownuid`='.$this->auth->getUid().' OR `audituid`='.$this->auth->getUid().' OR sid IN (SELECT sid FROM jl_sign_audit WHERE jl_sign_audit.audituid='.$this->auth->getUid().'))';
+//        $itemlist = $this->sign->getSignGroupByProject($searchsql);
+//        if(!empty($itemlist)){
+//            foreach($itemlist as $ik => $iv){
+//                $itemmsg = $this->project->getRowByPid($iv['project']);
+//                $itemlist[$ik]['pname'] = $itemmsg['pname'];
+//            }
+//        }
+
+        if(isset($this->params['pid']) && is_numeric($this->params['pid'])){
+            $pagestr .= '/'.$this->params['pid'];
+            $sqlstr .= ' and project='.$this->params['pid'];
+            //获取标段信息
+//            $tenderlist = $this->sign->getSignGroupByTender($this->params['pid'],$searchsql);
+//            if(!empty($tenderlist)){
+//                foreach($tenderlist as $tk => $tv){
+//                    $tendermsg = $this->actmeasure->getRowByPmid($tv['tender']);
+//                    $tenderlist[$tk]['pmname'] = $tendermsg['pmname'];
+//                }
+//            }
+
+            if(isset($this->params['pmid']) && is_numeric($this->params['pmid'])){
+                $pagestr .= '/section/'.$this->params['pmid'];
+                $sqlstr .= ' and tender='.$this->params['pmid'];
+                //获取期数信息
+                $phasenolist = $this->sign->getSignGroupByPhaseno($this->params['pmid'],$searchsql);
+                if(!empty($phasenolist)){
+                    foreach($phasenolist as $pk => $pv){
+                        $phasenolist[$pk]['numpname'] = $pv['phaseno'];
+                    }
+                }
+
+                if(isset($this->params['mpid']) && is_numeric($this->params['mpid'])){
+                    $this->data['phaseno'] = $this->params['mpid'];
+                    $pagestr .= '/phaseno/'.$this->params['mpid'];
+                    $sqlstr .= ' and phaseno='.$this->params['mpid'];
+                }
+            }
+        }
+
+        $totalArchive = $this->sign->getSignNum($sqlstr.' and '.$searchsql);
+        $pager = new DooPager(Doo::conf()->APP_URL . 'sproject'.$pagestr.'/intermediate/page', $totalArchive, 10, 100);
+        $pager->setCss('', 'disabled', 'active');
+        if (isset($this->params['pindex']))
+            $pager->paginate(intval($this->params['pindex']));
+        else
+            $pager->paginate(1);
+        if ($pager->limit != ' -10,10')
+            $list = $this->sign->getSignList($sqlstr.' and '.$searchsql,$pager->limit);
+        if(isset($list) && !empty($list)){
+            foreach($list as $k => $v){
+                //获取项目名,标段名,标段期数
+                $project = $this->project->getRowByPid($v['project']);
+                $tender = $this->actmeasure->getRowByPmid($v['tender']);
+//                $phaseno = $this->numofperact->getCurrStatus($v['phaseno']);
+
+                $list[$k]['project'] = $project['pname'];
+                $list[$k]['tender'] = $tender['pmname'];
+//                $list[$k]['phaseno'] = $phaseno['numpname'];
+                $list[$k]['ownname'] = $this->auth->getName($v['ownuid']);
+                $list[$k]['auditname'] = $this->auth->getName($v['audituid']);
+                $list[$k]['delstatus'] = $this->auth->getUid() == $v['ownuid'] && $v['status'] != 'checked' ? 1 : 0;
+            }
+        }
+
+        $this->data['list'] = isset($list) ? $list : '';
+//        $this->data['itemlist'] = $itemlist;
+//        $this->data['tenderlist'] = isset($tenderlist) ? $tenderlist : '';
+        $this->data['phasenolist'] = isset($phasenolist) ? $phasenolist : '';
+        $this->data['pager'] = $pager->output;
+
+
+        $this->data['pid'] = $this->params['pid'];
+        $this->data['pmid'] = $this->params['pmid'];
+        $this->render('s-project-section-intermediate', $this->data, TRUE);
+    }
+
+    public function interMediateMake(){
+
+        //草图功能开关控制
+        if($this->data['imediateSwitch'] == 0){
+            exit('中间计量表草图添加功能未启用...');die;
+        }
+
+        if(isset($this->params['sid']) && is_numeric($this->params['sid'])){
+            //获取报表信息
+            $signmsg = $this->sign->getOneSignbysid($this->params['sid']);
+            if(!empty($signmsg) && ($signmsg['isinter'] == 1 || $signmsg['isinter'] == 2)){
+                if($signmsg['pagenum'] == 0){
+                    exit('当前中间计量表还没上传图片~');die;
+                }
+                $this->data['sid'] = $signmsg['sid'];
+                $this->data['pid'] = $signmsg['project'];
+                $this->data['pmid'] = $signmsg['tender'];
+                $this->data['name'] = $signmsg['name'];
+                $this->data['totalnum'] = $signmsg['pagenum'];
+                if(isset($this->params['page']) && is_numeric($this->params['page'])){
+                    $this->data['currnum'] = $this->params['page'];
+                    $this->data['lastnum'] = $this->params['page'] - 1 > 0 ? ($this->params['page'] - 1) : '';
+                    $this->data['nextnum'] = $this->params['page'] + 1 > $signmsg['pagenum'] ? '' : ($this->params['page'] + 1);
+                    $signattmsg = $this->sign->getOneSignAtt($this->params['sid'],$this->params['page']);
+                }else{
+                    $this->data['currnum'] = 1;
+                    $this->data['lastnum'] = '';
+                    $this->data['nextnum'] = 1 + 1 > $signmsg['pagenum'] ? '' : 2;
+                    $signattmsg = $this->sign->getOneSignAtt($this->params['sid'],1);
+                }
+
+                //获取报表图片
+                $maxwidth = 794; //默认图片最大宽度   a4
+                $maxheight = 1123; //默认图片最大高度  a4
+
+                $imgmsg = getimagesize(Doo::conf()->APP_URL.$signattmsg['filepath']);
+                $maxwidth = $imgmsg[0];
+                $maxheight = $imgmsg[1];
+
+                $this->data['maxwidth'] = $maxwidth;
+                $this->data['maxheight'] = $maxheight;
+
+                if($this->is_pjax()){
+                    echo '<div class="page" style="width:'.$maxwidth.'px" id="intermediatePage'.$this->data['currnum'].'"><input type="hidden" value="'.$this->data['currnum'].'" id="pagecurrnum"><img src="'.Doo::conf()->APP_URL.$signattmsg['filepath'].'"></div>';exit;
+                }
+
+                $this->data['attmsg'] = $signattmsg;
+
+                $this->render('s-project-section-intermediate-detail', $this->data, TRUE);die;
+            }
+        }
+        exit('没有中间计量表参数');
+    }
+
+    public function interMediateUpload(){
+        if(isset($this->params['sid']) && is_numeric($this->params['sid']) && isset($_POST['num']) && isset($_POST['data'])){
+            $signmsg = $this->sign->getOneSignbysid($this->params['sid']);
+            if(!empty($signmsg) && ($signmsg['isinter'] == 1 || $signmsg['isinter'] == 2)){
+                if(empty($_POST['data']) && $_POST['num'] == $signmsg['pagenum']){
+                    $this->sign->updateInterMediateStatus($this->params['sid'],3);
+                    $status = array('code' => 202, 'msg' => '最后一张已上传完毕');
+                    echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+                preg_match('/^(data:\s*image\/(\w+);base64,)/', $_POST['data'], $result);
+                $img = base64_decode(str_replace($result[1], '', $_POST['data']));
+                //path
+                $dir = 'signs/'.$this->params['sid'].'/intermediate';
+                if (!$this->dir_create2(Doo::conf()->SITE_PATH . $dir)) {
+                    $status = array('status' => 400, 'msg' => '文件夹创建失败');
+                    echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+                $virtualPath = $dir.'/'.$_POST['num'].'.jpg';
+                $a = file_put_contents(Doo::conf()->SITE_PATH .$virtualPath,$img);
+                if($a){
+                    //更新signatt表信息
+                    $result = $this->sign->updateSignAtt($this->params['sid'],$_POST['num'],$virtualPath);
+                    if($result){
+                        if($_POST['num'] == $signmsg['pagenum']){
+                            $this->sign->updateInterMediateStatus($this->params['sid'],3);
+                            $status = array('code' => 202, 'msg' => '最后一张已上传完毕');
+                            echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                            die();
+                        }else{
+                            $status = array('code' => 200, 'msg' => '');
+                            echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                            die();
+                        }
+                    }
+                }
+                $status = array('code' => 400, 'msg' => '上传中间计量表失败');
+                echo json_encode($status, JSON_UNESCAPED_UNICODE);
+                die();
+            }
+        }
+        $status = array('code' => 400, 'msg' => '参数有误,不存在此中间计量表或此中间计量表已合成');
+        echo json_encode($status, JSON_UNESCAPED_UNICODE);
+        die();
+    }
+
+    /**
+     *
+     * @return type
+     */
+    public function signView()
+    {
+        //草图功能开关控制
+        if($this->data['imediateSwitch'] == 0){
+            exit('中间计量表草图添加功能未启用...');die;
+        }
+
+        if(!isset($this->params['sid']) || !is_numeric($this->params['sid'])){
+            exit('没有报表参数');
+        }
+        //获取报表信息
+        $signmsg = $this->sign->getOneSignbysid($this->params['sid']);
+        if(empty($signmsg) || $signmsg['isinter'] != 3){
+            exit('不存在此中间计量表');
+        }
+
+        $backurl = '/sproject/'.$signmsg['project'].'/section/'.$signmsg['tender'].'/intermediate';
+        //获取项目名,标段名,标段期数
+        $project = $this->project->getRowByPid($signmsg['project']);
+        $tender = $this->actmeasure->getRowByPmid($signmsg['tender']);
+//        $phaseno = $this->numofperact->getCurrStatus($signmsg['phaseno']);
+
+        $signmsg['project'] = $project['pname'];
+        $signmsg['tender'] = $tender['pmname'];
+//        $signmsg['phaseno'] = $phaseno['numpname'];
+
+        //获取签署人列表
+        $signauditlist = $this->sign->getSignAuditList($this->params['sid']);
+        if(!empty($signauditlist)){
+            foreach($signauditlist as $k => $v){
+                //获取签署人头像
+                $signauditlist[$k]['index'] = $k+1;
+                $signauditlist[$k]['avatar'] = $this->auth->getAvatar($v['audituid']);
+            }
+        }
+
+        //获取报表图片
+        $maxwidth = 794; //默认图片最大宽度   a4
+        $maxheight = 1123; //默认图片最大高度  a4
+        if(!empty($signmsg['widhei'])){
+            $widhei = explode('_', $signmsg['widhei']);
+            $style = $widhei[0].'mm '.$widhei[1].'mm';
+        }else{
+            $style = '210mm 297mm';
+        }
+        $signattlist = $this->sign->getSignAttList($this->params['sid']);
+        if(!empty($signattlist)){
+            foreach($signattlist as $sak => $sav){
+                $signattlist[$sak]['auditatt'] = $this->sign->getSignAuditAttList($sav['said']);
+                if($sak == 0){
+                    $imgmsg = getimagesize(Doo::conf()->APP_URL.$sav['filepath']);
+                    $maxwidth = $imgmsg[0];
+                    $maxheight = $imgmsg[1];
+                }
+            }
+        }
+
+        $this->data['signmsg'] = $signmsg;
+        $this->data['auditlist'] = $signauditlist;
+        $this->data['attlist'] = $signattlist;
+        $this->data['backurl'] = $backurl;
+        $this->data['maxwidth'] = $maxwidth;
+        $this->data['maxheight'] = $maxheight;
+        $this->data['style'] = $style;
+
+        $this->render('sign-view-page', $this->data, TRUE);
+    }
+
+    function is_pjax(){
+        return array_key_exists('HTTP_X_PJAX', $_SERVER) && $_SERVER['HTTP_X_PJAX'] === 'true';
+    }
+
     /**
      * 文件下载
      * @param $filepath 文件路径
@@ -674,6 +1010,29 @@ class SProjectController extends DooController
         return strtolower(trim(substr(strrchr($filename, '.'), 1, 10)));
     }
 
+    function dir_create2($path, $mode = 0777)
+    {
+        if (is_dir($path))
+            return TRUE;
+        $path = $this->dir_path($path);
+        $parent = dirname($path);
+        if (!is_dir($parent)){
+            @mkdir($parent, 0777);
+            @chmod($parent, 0777);
+        }
+        @mkdir($path, 0777);
+        @chmod($path, 0777);
+        return is_dir($path);
+    }
+
+    function dir_path($path)
+    {
+        $path = str_replace('\\', '/', $path);
+        if (substr($path, -1) != '/')
+            $path = $path . '/';
+        return $path;
+    }
+
 
 }
 

+ 116 - 8
protected/controller/SignController.php

@@ -9,6 +9,7 @@ Doo::loadClass('actmeasure');
 Doo::loadClass('numofperact');
 Doo::loadClass('measureauditact');
 Doo::loadClass('sign');
+Doo::loadClass('sms');
 Doo::loadModelAt('aconfig', 'admin');
 //define('FPDF_FONTPATH','protected/class/fpdf1.5/font/');
 //Doo::loadClass('fpdf');
@@ -23,7 +24,7 @@ Doo::loadModelAt('aconfig', 'admin');
 class SignController extends DooController
 {
 
-    private $aconfig, $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>');
+    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>');
 
     public function beforeRun($resource, $action)
     {
@@ -49,6 +50,7 @@ class SignController extends DooController
         $this->numofperact = new NumofperAct();
         $this->measureauditact = new MeasureauditAct();
         $this->sign = new Signn();
+        $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
 //        $this->pdf = new FPDF('P','mm','A4');
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'sign';
@@ -133,7 +135,7 @@ class SignController extends DooController
                                 $needlist[$k]['tlist'][$tk]['plist'][$pk]['phaseno'] = $pv['phaseno'];
                                 $needlist[$k]['tlist'][$tk]['plist'][$pk]['signlist'] = array();
 
-                                $signlist = $this->sign->getSignList($searchsql.' and status="checking" and tender='.$tv['tender'].' and phaseno='.$pv['phaseno'], '0,1000');
+                                $signlist = $this->sign->getSignList($searchsql.' and (status="checking" or status="back") and tender='.$tv['tender'].' and phaseno='.$pv['phaseno'], '0,1000');
                                 if(!empty($signlist)) {
                                     foreach ($signlist as $sk => $sv) {
                                         $needlist[$k]['tlist'][$tk]['plist'][$pk]['signlist'][$sk]['sid'] = $sv['sid'];
@@ -160,6 +162,73 @@ class SignController extends DooController
             exit('不是当前签署人无法访问本页');
         }
 
+        if(isset($_POST['status'])){
+            //终止签署
+            if($_POST['status'] == 'stop'){
+                $result = $this->sign->updateSignStatusAndTime($this->params['sid'],'stop',time());
+                $signAudit = $this->sign->getOneSignAudit($this->params['sid'],$this->auth->getUid());
+                $result2 = $this->sign->updateSignAudit($signAudit['satid'],'stop',time());
+                if($result && $result2){
+                    // SMS Start
+                    $signArray = $this->sign->getOneSignbysid($this->params['sid']);
+                    $pmname = $this->actmeasure->getRowByPmid($signArray['tender']);
+                    $userProArray = $this->profile->getProWithUid($signArray['audituid']);
+                    if (isset($userProArray) && !empty($userProArray['mobile'])) {
+                        $sendarr1 = '“' .$pmname['pmname'].'”的“'. $signArray["name"] .'”';
+                        $sendarr2 = str_replace('【','',$sendarr1);
+                        $sendmsg = str_replace('】','',$sendarr2);
+                        $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . $sendmsg .Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR6"]);
+                    }
+                    // SMS End
+                    echo json_encode(array('code' => 200, 'url' => '/sign/list'));
+                    exit;
+                }
+                echo json_encode(array('code' => 400, 'msg' => '终止签署失败'));
+                exit;
+            }elseif($_POST['status'] == 'back'){
+                $signauditlist = $this->sign->getSignAuditList($this->params['sid']);
+                $change = -1;
+                foreach($signauditlist as $k => $v){
+                    if($v['status'] == 'checking' && $k != 0) {
+                        $change = $k-1;
+                        break;
+                    }
+                }
+                if($change != -1){
+                    $result = $this->sign->updateSignStatusAndTime($this->params['sid'],'back',time());
+                    $signAudit = $this->sign->getOneSignAudit($this->params['sid'],$this->auth->getUid());
+                    $result3 = $this->sign->updateSignAudit($signAudit['satid'],'uncheck',0);
+                    $result2 = $this->sign->updateSignAudit($signauditlist[$change]['satid'],'checking',0);
+                    if($result && $result2 && $result3){
+                        //删除上一个签名者的所有签名
+                        $signattlist = $this->sign->getSignAttList($this->params['sid']);
+                        foreach($signattlist as $key => $value){
+                            $sign2 = new SignAuditAtt();
+                            $sign2->audituid = $signauditlist[$change]['audituid'];
+                            $sign2->said = $value['said'];
+                            $sign2->delete();
+                        }
+
+                        // SMS Start
+                        $signArray = $this->sign->getOneSignbysid($this->params['sid']);
+                        $pmname = $this->actmeasure->getRowByPmid($signArray['tender']);
+                        $userProArray = $this->profile->getProWithUid($signauditlist[$change]['audituid']);
+                        if (isset($userProArray) && !empty($userProArray['mobile'])) {
+                            $sendarr1 = '“' .$pmname['pmname'].'”的“'. $signArray["name"] .'”';
+                            $sendarr2 = str_replace('【','',$sendarr1);
+                            $sendmsg = str_replace('】','',$sendarr2);
+                            $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . $sendmsg .Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR7"]);
+                        }
+                        // SMS End
+                        echo json_encode(array('code' => 200, 'url' => '/sign/onlist'));
+                        exit;
+                    }
+                }
+                echo json_encode(array('code' => 400, 'msg' => '退回签署失败'));
+                exit;
+            }
+        }
+
         //获取报表信息
         $signmsg = $this->sign->getOneSignbysid($this->params['sid']);
         //获取项目名,标段名,标段期数
@@ -173,12 +242,16 @@ class SignController extends DooController
 
 
         //获取签署人列表
+        $firstsign = 0;
         $signauditlist = $this->sign->getSignAuditList($this->params['sid']);
         if(!empty($signauditlist)){
             foreach($signauditlist as $k => $v){
                 //获取签署人头像
                 $signauditlist[$k]['index'] = $k+1;
                 $signauditlist[$k]['avatar'] = $this->auth->getAvatar($v['audituid']);
+                if($this->auth->getUid() == $v['audituid'] && $k == 0){
+                    $firstsign = 1;
+                }
             }
         }
 
@@ -211,7 +284,7 @@ class SignController extends DooController
         $this->data['maxwidth'] = $maxwidth;
         $this->data['maxheight'] = $maxheight;
         $this->data['style'] = $style;
-
+        $this->data['firstsign'] = $firstsign;
         $this->render('sign-view-signer_sign',$this->data, TRUE);
     }
 
@@ -242,6 +315,18 @@ class SignController extends DooController
                 if($v['status'] == 'uncheck'){
                     $sign2->updateSignAudit($v['satid'],'checking');
                     $flag = false;
+                    //发送签署短信
+                    // SMS Start
+                    $signArray = $this->sign->getOneSignbysid($_POST['sid']);
+                    $pmname = $this->actmeasure->getRowByPmid($signArray['tender']);
+                    $userProArray = $this->profile->getProWithUid($v['audituid']);
+                    if (isset($userProArray) && !empty($userProArray['mobile'])) {
+                        $sendarr1 = '“' .$pmname['pmname'].'”的“'. $signArray["name"] .'”';
+                        $sendarr2 = str_replace('【','',$sendarr1);
+                        $sendmsg = str_replace('】','',$sendarr2);
+                        $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . $sendmsg .Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR5"]);
+                    }
+                    // SMS End
                     break;
                 }
             }
@@ -250,6 +335,7 @@ class SignController extends DooController
                 echo json_encode(array('code' => 200, 'url' => '/sign/view/'.$_POST['sid'].'?status=done'));
                 exit;
             }else{
+                $this->sign->updateSignStatusAndTime($_POST['sid'],'checking',0);
                 echo json_encode(array('code' => 200, 'url' => '/sign/view/'.$_POST['sid'].'?status=doing'));
                 exit;
             }
@@ -367,7 +453,7 @@ class SignController extends DooController
         $this->data['phaseno'] = '';
 
         //获取项目信息
-        $searchsql = 'status="checking" and sid in(select `jl_sign_audit`.sid from `jl_sign_audit` where `jl_sign_audit`.audituid='.$this->auth->getUid().')';
+        $searchsql = '(status="checking" or status="back") and sid in(select `jl_sign_audit`.sid from `jl_sign_audit` where `jl_sign_audit`.audituid='.$this->auth->getUid().')';
         $itemlist = $this->sign->getSignGroupByProject($searchsql);
         if(!empty($itemlist)){
             foreach($itemlist as $ik => $iv){
@@ -539,7 +625,7 @@ class SignController extends DooController
         $this->data['phaseno'] = '';
 
         //获取项目信息
-        $searchsql = 'status="uncheck" AND (`ownuid`='.$this->auth->getUid().' OR tender IN (SELECT pmid FROM jl_measure_audit WHERE auditoruid='.$this->auth->getUid().') OR project IN (SELECT pid FROM jl_project_measure WHERE uid='.$this->auth->getUid().'))';
+        $searchsql = 'status="uncheck" AND (`isinter`=0 OR `isinter`=3) AND (`ownuid`='.$this->auth->getUid().' OR tender IN (SELECT pmid FROM jl_measure_audit WHERE auditoruid='.$this->auth->getUid().') OR project IN (SELECT pid FROM jl_project_measure WHERE uid='.$this->auth->getUid().'))';
         $itemlist = $this->sign->getSignGroupByProject($searchsql);
         if(!empty($itemlist)){
             foreach($itemlist as $ik => $iv){
@@ -642,7 +728,7 @@ class SignController extends DooController
         $this->data['nosign'] = '';
 
         //获取项目信息
-        $searchsql = '(`ownuid`='.$this->auth->getUid().' OR `audituid`='.$this->auth->getUid().' OR sid IN (SELECT sid FROM jl_sign_audit WHERE jl_sign_audit.audituid='.$this->auth->getUid().'))';
+        $searchsql = '(`isinter`=0 OR `isinter`=3) AND (`ownuid`='.$this->auth->getUid().' OR `audituid`='.$this->auth->getUid().' OR sid IN (SELECT sid FROM jl_sign_audit WHERE jl_sign_audit.audituid='.$this->auth->getUid().'))';
         $itemlist = $this->sign->getSignGroupByProject($searchsql);
         if(!empty($itemlist)){
             foreach($itemlist as $ik => $iv){
@@ -688,7 +774,7 @@ class SignController extends DooController
         if((isset($this->params['nosign']) && ($this->params['nosign'] == 'nosign')) || isset($_GET['nosign'])){
             $this->data['nosign'] = 1;
             $pagestr .= '/nosign';
-            $searchsql = '(`ownuid`='.$this->auth->getUid().' AND `status`="uncheck")';
+            $searchsql = '(`isinter`=0 OR `isinter`=3) AND (`ownuid`='.$this->auth->getUid().' AND `status`="uncheck")';
         }
 
         $totalArchive = $this->sign->getSignNum($sqlstr.' and '.$searchsql);
@@ -712,7 +798,7 @@ class SignController extends DooController
 //                $list[$k]['phaseno'] = $phaseno['numpname'];
                 $list[$k]['ownname'] = $this->auth->getName($v['ownuid']);
                 $list[$k]['auditname'] = $this->auth->getName($v['audituid']);
-                $list[$k]['delstatus'] = $this->auth->getUid() == $v['ownuid'] && $v['status'] != 'checked' ? 1 : 0;
+                $list[$k]['delstatus'] = $this->auth->getUid() == $v['ownuid'] && $v['status'] != 'checked' && $v['isinter'] != 3 ? 1 : 0;
             }
         }
 
@@ -838,6 +924,20 @@ class SignController extends DooController
                 echo json_encode(array('code' => 400, 'msg' => '添加签署人出错'));
                 exit;
             }
+            //发送签署短信
+            if($k == 0){
+                // SMS Start
+                $signArray = $this->sign->getOneSignbysid($_POST['sid']);
+                $pmname = $this->actmeasure->getRowByPmid($signArray['tender']);
+                $userProArray = $this->profile->getProWithUid($v);
+                if (isset($userProArray) && !empty($userProArray['mobile'])) {
+                    $sendarr1 = '“' .$pmname['pmname'].'”的“'. $signArray["name"] .'”';
+                    $sendarr2 = str_replace('【','',$sendarr1);
+                    $sendmsg = str_replace('】','',$sendarr2);
+                    $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . $sendmsg .Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR5"]);
+                }
+                // SMS End
+            }
         }
         //更新报表信息
         $result2 = $this->sign->updateSignMsg($_POST['sid'],$this->auth->getUid());
@@ -992,6 +1092,14 @@ class SignController extends DooController
         return $name;
     }
 
+    private function __auditNotice($mobile, $text)
+    {
+        $smsSignSwitch = $this->aconfig->getOne(array('select' => 'smssignswitch', 'asArray' => TRUE))['smssignswitch'];
+        if ($smsSignSwitch > 0)
+            return $this->sms->sendSms($mobile, $text);
+
+    }
+
 }
 
 ?>

+ 3 - 1
protected/model/sign.php

@@ -21,9 +21,11 @@ class Sign extends DooModel {
     public $status;
     public $sintime;
     public $ishare;
+    public $isinter;
+    public $internum;
     public $_table = 'jl_sign';
     public $_primarykey = 'sid';
-    public $_fields = array('sid', 'project', 'tender', 'phaseno', 'name', 'ownuid', 'intime', 'pagenum', 'widhei', 'audituid', 'aintime', 'status', 'sintime', 'ishare');
+    public $_fields = array('sid', 'project', 'tender', 'phaseno', 'name', 'ownuid', 'intime', 'pagenum', 'widhei', 'audituid', 'aintime', 'status', 'sintime', 'ishare', 'isinter', 'internum');
 
     public function __construct() {
         parent::setupModel(__CLASS__);

+ 16 - 0
protected/module/admin/controller/AdminController.php

@@ -209,4 +209,20 @@ class AdminController extends DooController
         $this->render('admin-userlist', $this->data, TRUE);
     }
 
+    /*     * ************************************************************
+    *  生成指定长度的随机码。
+    *  @param int $length 随机码的长度。
+    *  @access public
+    * ************************************************************ */
+
+    function createRandomCode($length)
+    {
+        $randomCode = "";
+        $randomChars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+        for ($i = 0; $i < $length; $i++) {
+            $randomCode .= $randomChars{mt_rand(0, 35)};
+        }
+        return $randomCode;
+    }
+
 }

+ 41 - 0
protected/module/admin/controller/SysController.php

@@ -66,16 +66,38 @@ class SysController extends DooController
         if (isset($_POST['switch'])) {
             if ($_POST['switch'] == 'off') {
                 $this->aconfig->smsswitch = 0;
+                $this->aconfig->smssignswitch = 0;
                 if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
                     exit(json_encode(array('switch' => 'off')));
             }
             if ($_POST['switch'] == 'on') {
                 $this->aconfig->smsswitch = 1;
+                $this->aconfig->smssignswitch = 1;
                 if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
                     exit(json_encode(array('switch' => 'on')));
             }
         }
+
+        if (isset($_POST['status']) && isset($_POST['type'])) {
+            if($_POST['status'] == 'close'){
+                $ststus = 0;
+            }else{
+                $ststus = 1;
+            }
+            if ($_POST['type'] == 'sign') {
+                $this->aconfig->smssignswitch = $ststus;
+                if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
+                    exit(json_encode(array('switch' => $ststus)));
+            }else if ($_POST['type'] == 'switch') {
+                $this->aconfig->smsswitch = $ststus;
+                if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
+                    exit(json_encode(array('switch' => $ststus)));
+            }
+        }
+
         $this->data['smsSwitch'] = $this->aconfig->getOne(array('select' => 'smsswitch', 'asArray' => TRUE))['smsswitch'];
+        $this->data['smsSignSwitch'] = $this->aconfig->getOne(array('select' => 'smssignswitch', 'asArray' => TRUE))['smssignswitch'];
+        $this->data['Switch'] = $this->data['smsSwitch'] || $this->data['smsSignSwitch'] ? 1 : 0;
         $this->data['menu'] = 4;
         $this->render('admin-sms', $this->data, TRUE);
     }
@@ -114,4 +136,23 @@ class SysController extends DooController
         $this->render('admin-sign', $this->data, TRUE);
     }
 
+    function interMediateSwitch()
+    {
+        if (isset($_POST['switch'])) {
+            if ($_POST['switch'] == 'off') {
+                $this->aconfig->imediateswitch = 0;
+                if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
+                    exit(json_encode(array('switch' => 'off')));
+            }
+            if ($_POST['switch'] == 'on') {
+                $this->aconfig->imediateswitch = 1;
+                if ($this->aconfig->update(array('where' => "conid = 1")) > 0)
+                    exit(json_encode(array('switch' => 'on')));
+            }
+        }
+        $this->data['imediateswitch'] = $this->aconfig->getOne(array('select' => 'imediateswitch', 'asArray' => TRUE))['imediateswitch'];
+        $this->data['menu'] = 7;
+        $this->render('admin-intermediate', $this->data, TRUE);
+    }
+
 }

+ 3 - 1
protected/module/admin/model/aconfig.php

@@ -16,9 +16,11 @@ class AConfig extends DooModel
     public $reportswitch;
     public $signswitch;
     public $launchsignswitch;
+    public $imediateswitch;
+    public $smssignswitch;
     public $_table = 'jl_config';
     public $_primarykey = 'conid';
-    public $_fields = array('conid', 'proname', 'onoff', 'upgradeinfo', 'smsswitch', 'reportswitch', 'signswitch', 'launchsignswitch');
+    public $_fields = array('conid', 'proname', 'onoff', 'upgradeinfo', 'smsswitch', 'reportswitch', 'signswitch', 'launchsignswitch', 'imediateswitch', 'smssignswitch');
 
     public function __construct()
     {

+ 98 - 0
protected/module/admin/view/admin-intermediate.html

@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<html lang=zh-cn>
+<head>
+	<meta charset=utf-8>
+	<title>纵横计量支付系统</title>
+	<meta name=description content=计量支付>
+	<meta name=copyright content=smartcost.com.cn>
+	<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>
+<div class="wrapHeader">
+	<h1 class="mainLogo" title="纵横计量支付"></h1>
+	<div class="sysTools"><a title="返回首页" href="index.html"><i class="icon-circle-arrow-left icon-white"></i></a>&nbsp;&nbsp;&nbsp;<a
+			title="纵横官网" target="_blank" href="http://smartcost.com.cn"><i class="icon-home icon-white"></i></a></div>
+</div>
+<!-- include "top" -->
+<div class="warpAdmin">
+	<!-- include "menu" -->
+	<div class="adminMain">
+		<form class="form-horizontal">
+			<fieldset>
+				<legend>中间计量草图</legend>
+				<!--软件生成报表-->
+				<div class="form-group">
+					<label class="col-sm-2 control-label">中间计量草图功能</label>
+					<div class="col-sm-3">
+						<!-- if {{imediateswitch}} == 0 -->
+						<div class="btn-group">
+							<button class="btn btn-default" data-status="on" title="开启中间计量草图">开启</button>
+							<button class="btn btn-danger disabled" data-status="off" disabled="disabled">已关闭</button>
+						</div>
+						<!-- else -->
+						<div class="btn-group">
+							<button class="btn btn-success disabled" data-status="on"  disabled="disabled">已开启</button>
+							<button class="btn btn-default" data-status="off" title="关闭">关闭</button>
+						</div>
+						<!-- endif -->
+						<a data-toggle="modal" href="#help1">帮助</a>
+					</div>
+				</div>
+			</fieldset>
+		</form>
+	</div>
+</div>
+</div>
+<!-- 帮助1弹出 -->
+<div id="help1" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
+	<div class="modal-dialog">
+		<div class="modal-content">
+			<div class="modal-body">
+				<div class="alert alert-info">
+					此开关用于开启关闭中间计量草图功能入口
+				</div>
+				<div>
+					<img src="{{rootUrl}}global/images/intermediate-help1.png">
+					<img src="{{rootUrl}}global/images/intermediate-help2.png">
+				</div>
+			</div>
+			<div class="modal-footer">
+				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">autoFlashHeight();</script>
+<script>
+	$(function(){
+		$('.form-group .btn').on('click',function(){
+			var status = $(this).attr('data-status').split("_");
+			if(!$(this).hasClass('disabled')){
+				if(status[0] == 'on'){
+					$(this).addClass('btn-success').removeClass('btn-default').text('已开启');
+					$(this).siblings('button').removeClass('btn-danger').addClass('btn-default').text('关闭');
+				}else{
+					$(this).addClass('btn-danger').removeClass('btn-default').text('已关闭');
+					$(this).siblings('button').removeClass('btn-success').addClass('btn-default').text('开启');
+				}
+				$(this).addClass('disabled').attr('disabled', true);
+				$(this).siblings('button').removeClass('disabled').attr('disabled',false);
+			}
+			$.ajax({
+				type: 'post',
+				url: '/manage/sys/intermediate/switch',
+				data:{switch:status[0]},
+				dataType: 'json',
+				success: function(result){
+
+				}
+			});
+			return false;
+		})
+	})
+</script>
+</body>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 85 - 4
protected/module/admin/view/admin-sms.html


+ 1 - 0
protected/module/admin/view/menu.html

@@ -5,6 +5,7 @@
         <li><a href="{{rootUrl}}manage/user/list"<!-- if {{menu}}=='2' --> class="now" <!-- endif -->>用户列表</a></li>
         <li><a href="{{rootUrl}}manage/user/add"<!-- if {{menu}}=='3' --> class="now" <!-- endif -->>添加用户</a></li>
         <li><a href="{{rootUrl}}manage/sys/sign/switch"<!-- if {{menu}}=='6' --> class="now" <!-- endif -->>在线签署</a></li>
+        <li><a href="{{rootUrl}}manage/sys/intermediate/switch"<!-- if {{menu}}=='7' --> class="now" <!-- endif -->>中间计量草图</a></li>
         <!-- <li><a href="{{rootUrl}}manage/item/index"<!-- if {{menu}}=='5' --> class="now" <!-- endif -->>项目管理</a></li> -->
     </ul>
 </div>

+ 1 - 0
protected/view/s-project-section-detail.html

@@ -63,6 +63,7 @@
 					<a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/detail">标段概况</a>
 				</li>
 				<li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/files">附件</a></li>
+				<!-- if {{imediateSwitch}} == 1 --><li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/intermediate">中间计量草图</a></li><!-- endif -->
 			</ul>
 			<div class="project">
 				<div class="proSection clearfix">

+ 1 - 0
protected/view/s-project-section-files-recover.html

@@ -60,6 +60,7 @@
                     <a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/detail">标段概况</a>
                 </li>
                 <li class="active"><a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/files">附件</a></li>
+                <!-- if {{imediateSwitch}} == 1 --><li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/intermediate">中间计量草图</a></li><!-- endif -->
             </ul>
             <!--导航-->
 

+ 1 - 0
protected/view/s-project-section-files.html

@@ -60,6 +60,7 @@
                     <a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/detail">标段概况</a>
                 </li>
                 <li class="active"><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/files">附件</a></li>
+                <!-- if {{imediateSwitch}} == 1 --><li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/intermediate">中间计量草图</a></li><!-- endif -->
             </ul>
             <!--导航-->
             <!--筛选工具-->

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 431 - 0
protected/view/s-project-section-intermediate-detail.html


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 166 - 0
protected/view/s-project-section-intermediate.html


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 24 - 2
protected/view/sign-list-all.html


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 2
protected/view/sign-view-page.html


+ 2 - 1
protected/view/sign-view-set_signer.html

@@ -140,7 +140,8 @@
 <script>
     function printdiv(printpage)
     {
-        $('.warp-printer').css("max-width","1085px");
+        var maxwidth = $('#maxwidth').val();
+        $('.warp-printer').css("max-width",maxwidth+"px");
         var headstr = '<html><head><title></title><link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"><style type="text/css" media="print">' +
                 '@page {size: {{style}}; margin: 0mm; padding: 0mm; border:0mm; } @media print body {margin:0mm;padding:0mm;border: 0mm} .warp-printer .page{margin:0mm;padding:0mm;border: 0mm;widows:0 orphans:0} .sign-content .page{margin:0mm;padding:0mm;border: 0mm;widows:0 orphans:0}' +
                 '</style></head><body>';

+ 89 - 16
protected/view/sign-view-signer_sign.html

@@ -8,7 +8,7 @@
     <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/jquery-ui.min.css">
-    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css?201709061>
     <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>
@@ -49,8 +49,12 @@
                             <!-- endloop -->
                             <!-- endif -->
                         </ul>
-                        <div class="btn-bar">
-                            <a  href="javascript:void(0);" onclick="judagedonesign();" class="btn btn-success btn-large btn-block">完成签署</a>
+                    </div>
+                    <div class="btn-bar">
+                        <a  href="javascript:void(0);" onclick="judagedonesign();" class="btn btn-success btn-large btn-block">完成签署</a>
+                        <div class="clearfix" style="margin-top:15px">
+                            <!-- if {{firstsign}} == 0 --><a href="#backsign" data-toggle="modal" class="btn btn-warning fL">退回签署</a><!-- endif -->
+                            <a href="#stopsign" data-toggle="modal" class="btn btn-danger<!-- if {{firstsign}} == 1 --> btn-large btn-block<!-- else --> fR<!-- endif -->">终止签署</a>
                         </div>
                     </div>
                 </div>
@@ -60,7 +64,18 @@
                     <div class="warp-printer">
                         <!-- if !empty({{attlist}}) -->
                         <!-- loop attlist -->
-                        <div class="page" id="pageContainer{{attlist' value.curnum}}"><img src="{{rootUrl}}{{attlist' value.filepath}}" style="max-width: 99.8%">
+                        <div class="page" id="pageContainer{{attlist' value.curnum}}" style="background: url('{{rootUrl}}{{attlist' value.filepath}}') no-repeat 0 0;background-size:cover;padding:10px">
+                            <img src="{{rootUrl}}{{attlist' value.filepath}}" style="display: none">
+                            <!--<img src="{{rootUrl}}{{attlist' value.filepath}}">-->
+                            <!-- if !empty({{attlist' value.auditatt}}) -->
+                            <!-- loop attlist' value.auditatt -->
+                            <div class="user-sign" style="z-index:10;{{attlist' auditatt' value.position}}">
+                                <div class="">
+                                    <img src="{{attlist' auditatt' value.picpath}}">
+                                </div>
+                            </div>
+                            <!-- endloop -->
+                            <!-- endif -->
                             <div class="user-sign draggable" data-num="{{attlist' value.sid}}_{{attlist' value.said}}" style="position: absolute;top: 10%;left: 10%;z-index: 999;width: 300px;height: 150px;">
                                 <div class="img-bar">
                                     <a href="javascript:void(0);" onclick="setallqm({{attlist' value.curnum}})" title="批量签名" class="allqm" style="display: none"><span data-icon="v" aria-hidden="true" ></span></a>
@@ -71,15 +86,6 @@
                                     <img src="{{picpath}}">
                                 </div>
                             </div>
-                            <!-- if !empty({{attlist' value.auditatt}}) -->
-                            <!-- loop attlist' value.auditatt -->
-                            <div class="user-sign" style="z-index:10;{{attlist' auditatt' value.position}}">
-                                <div class="">
-                                    <img src="{{attlist' auditatt' value.picpath}}">
-                                </div>
-                            </div>
-                            <!-- endloop -->
-                            <!-- endif -->
                         </div>
                         <!-- endloop -->
                         <!-- endif -->
@@ -105,11 +111,42 @@
         </div>
     </div>
 </div>
-<!-- 添加签署人弹出 -->
+<!-- 退回签署人弹出 -->
+<!-- if {{firstsign}} == 0 -->
+<div id="backsign" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-body">
+                <h4>退回上一签署人重新签署?</h4>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+                <button type="button" onclick="backsign();" class="btn btn-warning">确认退回</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!-- endif -->
+<!-- 终止签署人弹出 -->
+<div id="stopsign" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-body">
+                <h4>终止该报表签署?</h4>
+                <h4>终止后,如需要重新发起签署,请在软件重新生成新一份签署报表。</h4>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+                <button type="button" onclick="stopsign();" class="btn btn-danger">确认终止</button>
+            </div>
+        </div>
+    </div>
+</div>
 <script type="text/javascript">autoFlashHeight();</script>
 <script>
     $( function() {
-        $('.page').css('width',$('#maxwidth').val()+'px');
+        $('.page').css('width',parseInt($('#maxwidth').val())-20+'px');
+        $('.page').css('height',parseInt($('#maxheight').val())-20+'px');
 
         $('#sign_msg').scroll(function(){
             for(var i = 1; i <= $('.page').length; i++){
@@ -238,7 +275,11 @@
         var maxwidth = $('#maxwidth').val();
         var maxheight = $('#maxheight').val();
         $('.warp-printer').css("max-width",maxwidth+"px");
-        $('.img-bar').hide();
+        $('.page').css('width',parseInt(maxwidth)+'px');
+        $('.page').css('height',parseInt(maxheight)+'px');
+        $('.page img').show();
+        $('.page').find('.img-bar').hide();
+        $('.page').css('padding','0px');
         var headstr = '<html><head><title></title><link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"><style type="text/css" media="print">' +
                 '@page {size: {{style}}; margin: 0mm; padding: 0mm; border:0mm; } @media print body {margin:0mm;padding:0mm;border: 0mm} .warp-printer .page{margin:0mm;padding:0mm;border: 0mm;widows:0 orphans:0} .sign-content .page{margin:0mm;padding:0mm;border: 0mm;widows:0 orphans:0}' +
                 '</style></head><body>';
@@ -315,5 +356,37 @@
             }
         })
     }
+
+    function stopsign() {
+        $.ajax({
+            type:'post',
+            url:'/sign/needview/{{signsid}}',
+            data:{status:'stop'},
+            dataType: 'json',
+            success: function(result){
+                if(result.code == 200){
+                    window.location.href = result.url;
+                }else{
+                    alert(result.msg);
+                }
+            }
+        })
+    }
+
+    function backsign() {
+        $.ajax({
+            type:'post',
+            url:'/sign/needview/{{signsid}}',
+            data:{status:'back'},
+            dataType: 'json',
+            success: function(result){
+                if(result.code == 200){
+                    window.location.href = result.url;
+                }else{
+                    alert(result.msg);
+                }
+            }
+        })
+    }
 </script>
 </body>