Browse Source

中间计量表 no.1 up

likeku 7 years ago
parent
commit
c725187468

+ 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); }
+}
+

+ 7 - 4
global/css/style.css

@@ -1074,6 +1074,9 @@ left:5px
   width:60px;
   color:#999
 }
+.signed-list{
+  overflow-y: auto;
+}
 .signed-list li{
   height:48px;
   line-height:48px;
@@ -1126,11 +1129,11 @@ left:5px
   position: absolute;
   right:0;
   top:0;
-  display:none;
-}
-.user-sign:hover .img-bar{
-  display: block;
+  /*display:none;*/
 }
+/*.user-sign:hover .img-bar{*/
+  /*display: block;*/
+/*}*/
 .draggable{
   display: none;
   cursor: move;

BIN
global/images/intermediate-help1.png


BIN
global/images/intermediate-help2.png


+ 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;
+});

+ 2 - 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');
@@ -372,6 +373,7 @@ $route['*']['/sproject/:pid/section/:pmid/phaseno/:mpid/intermediate/page/:pinde
 $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');
 /**
  * 中间计量表添加草图功能开关
  */

File diff suppressed because it is too large
+ 1 - 1
protected/config/sms.conf.php


+ 101 - 5
protected/controller/SProjectController.php

@@ -77,6 +77,8 @@ class SProjectController 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['imediateSwitch'] = $this->aconfig->getOne(array('select' => 'imediateswitch', 'asArray' => TRUE))['imediateswitch'];
     }
 
     public function index()
@@ -142,6 +144,8 @@ class SProjectController extends DooController
         // 标段
         // 搜索有没有相应的月份,有就把实际赋值,没有就为零
         $this->data['MeasureArray'] = $this->actmeasure->getRowsByPid($this->params['pid']);
+        $this->data['MyMeasureArray'] = array();
+        $i = 0;
         $totalstid = 0;
         $monthArray = [];
         foreach ($this->data['MeasureArray'] as $key => $value) {
@@ -203,6 +207,11 @@ class SProjectController extends DooController
             foreach ($month1 as $k => $v) {
                 $allmonth1[] = $v;
             }
+
+            if($value['uid'] == $this->auth->getUid()){
+                $this->data['MyMeasureArray'][$i] = $this->data['MeasureArray'][$key];
+                $i++;
+            }
         }
 
         // 中文表述年月
@@ -281,7 +290,8 @@ class SProjectController extends DooController
         // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
-        $actmeasureArray = $this->actmeasure->getAll();
+//        $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'])) {
@@ -446,7 +456,8 @@ class SProjectController extends DooController
 // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
-        $actmeasureArray = $this->actmeasure->getAll();
+//        $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'])) {
@@ -561,7 +572,8 @@ class SProjectController extends DooController
 // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
-        $actmeasureArray = $this->actmeasure->getAll();
+//        $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'])) {
@@ -613,6 +625,11 @@ class SProjectController extends DooController
 
     public function proSectionInterMediate(){
 
+        //草图功能开关控制
+        if($this->data['imediateSwitch'] == 0){
+            exit('中间计量表草图添加功能未启用...');
+        }
+
         if(isset($_POST['delid']) && is_numeric($_POST['delid'])){
             //删除未签署报表数据和文件
             $signmsg = $this->sign->getOneSignbysid($_POST['delid']);
@@ -663,7 +680,8 @@ class SProjectController extends DooController
         // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
-        $actmeasureArray = $this->actmeasure->getAll();
+//        $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'])) {
@@ -761,6 +779,12 @@ class SProjectController extends DooController
     }
 
     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']);
@@ -797,7 +821,7 @@ class SProjectController extends DooController
                 $this->data['maxheight'] = $maxheight;
 
                 if($this->is_pjax()){
-                    echo '<div class="page" style="width:'.$maxwidth.'px" id="intermediatePage'.$this->data['currnum'].'"><img src="'.Doo::conf()->APP_URL.$signattmsg['filepath'].'"></div>';exit;
+                    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;
@@ -855,6 +879,78 @@ class SProjectController extends DooController
         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';
     }

+ 17 - 7
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';
@@ -234,9 +236,13 @@ class SignController extends DooController
                     //发送签署短信
                     // SMS Start
                     $signArray = $this->sign->getOneSignbysid($_POST['sid']);
-                    $userProArray = $this->profile->getProWithUid($v['audituid']);
+                    $pmname = $this->actmeasure->getRowByPmid($signArray['tender']);
+                    $userProArray = $this->profile->getProWithUid($v);
                     if (isset($userProArray) && !empty($userProArray['mobile'])) {
-                        $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '您好,' . $signArray["name"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR5"]);
+                        $sendarr1 = '“' .$pmname['pmname'].'”的“'. $signArray["name"] .'”';
+                        $sendarr2 = str_replace('【','',$sendarr1);
+                        $sendmsg = str_replace('】','',$sendarr2);
+                        $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '您好,有一份' .$pmname['pmname'].'的'. $signArray["name"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR5"]);
                     }
                     // SMS End
                     break;
@@ -709,7 +715,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;
             }
         }
 
@@ -839,9 +845,13 @@ class SignController extends DooController
             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'])) {
-                    $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '您好,' . $signArray["name"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR5"]);
+                    $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
             }
@@ -1001,8 +1011,8 @@ class SignController extends DooController
 
     private function __auditNotice($mobile, $text)
     {
-        $smsSwitch = $this->aconfig->getOne(array('select' => 'smsSwitch', 'asArray' => TRUE))['smsSwitch'];
-        if ($smsSwitch > 0)
+        $smsSignSwitch = $this->aconfig->getOne(array('select' => 'smssignswitch', 'asArray' => TRUE))['smssignswitch'];
+        if ($smsSignSwitch > 0)
             return $this->sms->sendSms($mobile, $text);
 
     }

+ 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);
+    }
+
 }

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

@@ -17,9 +17,10 @@ class AConfig extends DooModel
     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', 'imediateswitch');
+    public $_fields = array('conid', 'proname', 'onoff', 'upgradeinfo', 'smsswitch', 'reportswitch', 'signswitch', 'launchsignswitch', 'imediateswitch', 'smssignswitch');
 
     public function __construct()
     {

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

@@ -0,0 +1,94 @@
+<!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="control-group">
+					<label class="control-label">中间计量草图功能</label>
+					<div class="controls">
+						<!-- if {{imediateswitch}} == 0 -->
+						<div class="btn-group">
+							<button class="btn" 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" 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 hide fade" tabindex="-1" role="dialog" aria-hidden="true">
+	<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>
+<script type="text/javascript">autoFlashHeight();</script>
+<script>
+	$(function(){
+		$('.control-group .btn').on('click',function(){
+			var status = $(this).attr('data-status').split("_");
+			if(!$(this).hasClass('disabled')){
+				if(status[0] == 'on'){
+					$(this).addClass('btn-success').text('已开启');
+					$(this).siblings('button').removeClass('btn-danger').text('关闭');
+				}else{
+					$(this).addClass('btn-danger').text('已关闭');
+					$(this).siblings('button').removeClass('btn-success').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>

File diff suppressed because it is too large
+ 84 - 3
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 - 1
protected/view/s-project-section-detail.html

@@ -63,7 +63,7 @@
 					<a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/detail">标段概况</a>
 				</li>
 				<li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/files">附件</a></li>
-				<li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/intermediate">中间计量草图</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 - 1
protected/view/s-project-section-files-recover.html

@@ -60,7 +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>
-                <li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/intermediate">中间计量草图</a></li>
+                <!-- if {{imediateSwitch}} == 1 --><li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/intermediate">中间计量草图</a></li><!-- endif -->
             </ul>
             <!--导航-->
 

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

@@ -60,7 +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>
-                <li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/intermediate">中间计量草图</a></li>
+                <!-- if {{imediateSwitch}} == 1 --><li><a href="{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/intermediate">中间计量草图</a></li><!-- endif -->
             </ul>
             <!--导航-->
             <!--筛选工具-->

File diff suppressed because it is too large
+ 107 - 66
protected/view/s-project-section-intermediate-detail.html


File diff suppressed because it is too large
+ 1 - 1
protected/view/s-project-section-intermediate.html


+ 5 - 5
protected/view/s-project-section.html

@@ -54,12 +54,12 @@
 						</table>
 						<div style="height:264px;overflow-y:auto">
 							<table class="table table-striped">
-								<!-- loop MeasureArray -->
+								<!-- loop MyMeasureArray -->
 								<tr>
-									<td width="15%"><a href="{{rootUrl}}sproject/{{MeasureArray' value.pid}}/section/{{MeasureArray' value.pmid}}/detail">{{MeasureArray' value.pmname}}</a><br>{{MeasureArray' value.type}}</td><td width="16%" class="taR">¥<b>{{MeasureArray' value.totalplus}}</b><br>第 {{MeasureArray' value.totalnum}} 期(<span class="colOrange">{{MeasureArray' value.ownstatus}}</span>)</td><td width="40%" class="taR"><div class="progress">
-									<div data-original-title="截止上期完成:¥{{MeasureArray' value.nstopnow}}" data-toggle="tooltip" data-placement="bottom" style="width: {{MeasureArray' value.dispstopnow}};" class="bar bar-success">{{MeasureArray' value.dispstopnow}}</div>
-									<div data-original-title="本期完成:¥{{MeasureArray' value.ncurrdone}}" data-toggle="tooltip" data-placement="bottom" style="width:{{MeasureArray' value.dispcurrdone}}" class="bar">{{MeasureArray' value.dispcurrdone}}</div>
-									<div data-original-title="未完成:¥{{MeasureArray' value.nless}}" data-toggle="tooltip" data-placement="bottom" style="width:{{MeasureArray' value.pless}}" class="bar bar-gary">{{MeasureArray' value.pless}}</div>
+									<td width="15%"><a href="{{rootUrl}}sproject/{{MyMeasureArray' value.pid}}/section/{{MyMeasureArray' value.pmid}}/detail">{{MyMeasureArray' value.pmname}}</a><br>{{MyMeasureArray' value.type}}</td><td width="16%" class="taR">¥<b>{{MyMeasureArray' value.totalplus}}</b><br>第 {{MyMeasureArray' value.totalnum}} 期(<span class="colOrange">{{MyMeasureArray' value.ownstatus}}</span>)</td><td width="40%" class="taR"><div class="progress">
+									<div data-original-title="截止上期完成:¥{{MyMeasureArray' value.nstopnow}}" data-toggle="tooltip" data-placement="bottom" style="width: {{MyMeasureArray' value.dispstopnow}};" class="bar bar-success">{{MyMeasureArray' value.dispstopnow}}</div>
+									<div data-original-title="本期完成:¥{{MyMeasureArray' value.ncurrdone}}" data-toggle="tooltip" data-placement="bottom" style="width:{{MyMeasureArray' value.dispcurrdone}}" class="bar">{{MyMeasureArray' value.dispcurrdone}}</div>
+									<div data-original-title="未完成:¥{{MyMeasureArray' value.nless}}" data-toggle="tooltip" data-placement="bottom" style="width:{{MyMeasureArray' value.pless}}" class="bar bar-gary">{{MyMeasureArray' value.pless}}</div>
 								</div></td>
 								</tr>
 								<!-- endloop -->

+ 1 - 1
protected/view/sign-view-page.html

@@ -7,7 +7,7 @@
     <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>
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css?20170828>
     <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>

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

@@ -7,7 +7,7 @@
     <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>
+    <link rel=stylesheet href={{rootUrl}}global/css/style.css?20170828>
     <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>

+ 10 - 3
protected/view/sign-view-signer_sign.html

@@ -50,7 +50,7 @@
                             <!-- endif -->
                         </ul>
                         <div class="btn-bar">
-                            <a  href="javascript:void(0);" onclick="judagedonesign();" class="btn btn-success btn-large btn-block">完成签署</a>
+                            <a href="javascript:void(0);" onclick="judagedonesign();" class="btn btn-success btn-large btn-block">完成签署</a>
                         </div>
                     </div>
                 </div>
@@ -60,7 +60,8 @@
                     <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" style="max-width: 100%">
                             <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>
@@ -105,7 +106,8 @@
 <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++){
@@ -234,6 +236,11 @@
         var maxwidth = $('#maxwidth').val();
         var maxheight = $('#maxheight').val();
         $('.warp-printer').css("max-width",maxwidth+"px");
+        $('.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>';