Explorar o código

添加软件删除显示和审批长度限制

laiguoran %!s(int64=7) %!d(string=hai) anos
pai
achega
b1b7965fc8

+ 1 - 1
jlweb211.sql

@@ -95,7 +95,7 @@ CREATE TABLE `jl_change` (
   `totalamount` double NOT NULL COMMENT '变更总金额',
   `times` tinyint(4) NOT NULL DEFAULT '0' COMMENT '次数',
   `decimalnum` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '2_3' COMMENT '金额和数量小数位数,以_分隔',
-  `status` enum('uncheck','checking','checked','checkno','back') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'uncheck' COMMENT '变更令状态',
+  `status` enum('uncheck','checking','checked','checkno','back','del') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'uncheck' COMMENT '变更令状态',
   `intime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '添加时间',
   `cintime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '变更状态发生时间',
   `sintime` varchar(15) COLLATE utf8_unicode_ci NOT NULL COMMENT '完成审批时间'

+ 9 - 1
protected/class/change.php

@@ -145,7 +145,7 @@ class Changes
 
     public function getLastChangePnum($pmid)
     {
-        return $this->__change->getOne(array('select' => 'pnum', 'where' => 'pmid=?', 'param' => array($pmid), 'desc' => 'cid','asArray' => TRUE));
+        return $this->__change->getOne(array('select' => 'pnum', 'where' => 'pmid=? and status!="del"', 'param' => array($pmid), 'desc' => 'cid','asArray' => TRUE));
     }
 
     //搜索该标段有无相同申请编号的变更令
@@ -171,6 +171,14 @@ class Changes
         return $this->__change->update();
     }
 
+    public function updateChangeStatus($cid,$status = 'del')
+    {
+        $this->__change->cid = $cid;
+        $this->__change->status = $status;
+        $this->__change->cintime = time();
+        return $this->__change->update();
+    }
+
 
     //changeatt
     public function insertChangeAtt($files)

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

@@ -436,4 +436,8 @@ $route['*']['/api/client/change/list/create'] = array('ClientController', 'chang
  * 导出变更令内容
  */
 $route['*']['/api/client/change/get/:pmid/list'] = array('ClientController', 'changeList');
+/**
+ * 软件删除变更令后返回结果
+ */
+$route['*']['/api/client/change/delete'] = array('ClientController', 'changeDelete');
 ?>

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

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

+ 2 - 1
protected/controller/ChangeController.php

@@ -31,7 +31,7 @@ class ChangeController extends DooController
 
     private $changeNature = array('1' => '一般设计变更', '2' => '较大设计变更', '3' => '重大设计变更');
 
-    private $changeStatus = array('2' => 'uncheck', '3' => 'checking', '4' => 'checked', '5' => 'checkno');
+    private $changeStatus = array('2' => 'uncheck', '3' => 'checking', '4' => 'checked', '5' => 'checkno', '6' => 'del');
 
     private $changeUnit = array('m','km','m2','m3','kg','t','m3·km','总额','月','项','处','个','根','棵','块','每一试桩','桥长米','公路公里','株','组','座','元','工日','套','台班','艘班','m/处','m/道','m/座','m2/m','m3/m','m3/处','根/米','亩','m3/m2');
 
@@ -267,6 +267,7 @@ class ChangeController extends DooController
         $this->data['num3'] = $this->change->getNumbystatus($pmid,'checking','',$sql);
         $this->data['num4'] = $this->change->getNumbystatus($pmid,'checked','',$sql);
         $this->data['num5'] = $this->change->getNumbystatus($pmid,'checkno','',$sql);
+        $this->data['num6'] = $this->change->getNumbystatus($pmid,'del','',$sql);
 
         //获取列表内容
         Doo::loadHelper('DooPager');

+ 19 - 0
protected/controller/ClientController.php

@@ -2144,6 +2144,25 @@ class ClientController extends DooController
             die();
         }
     }
+
+    /**
+     * 软件删除变更令后返回结果
+     */
+    public function changeDelete() {
+        if(isset($_POST['cid']) && is_numeric($_POST['cid'])) {
+            $cid = $_POST['cid'];
+            $changeArray = $this->change->getChangebyid($cid);
+            if(!empty($changeArray)){
+                $result = $this->change->updateChangeStatus($cid);
+                if($result){
+                    echo json_encode(array('status' => 'TRUE', 'msg' => '删除成功'), JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+            }
+        }
+        echo json_encode(array('status' => 'FALSE', 'msg' => '参数有误'), JSON_UNESCAPED_UNICODE);
+        die();
+    }
 }
 
 ?>

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

@@ -51,6 +51,9 @@
 		<div class="mainContent">
 			<input type="hidden" id="cid" value="{{changeArray.cid}}">
 			<div class="title" id="xinxi">
+				<!-- if {{changeArray.status}} == 'del' -->
+				<div class="bg-top-btn affix"><span class="colRed">该变更令已在软件中删除</span></div>
+				<!-- endif -->
 				<h1><a href="/change/index/tender/{{pmArray.pmid}}" title="返回"><span class="closePanel" aria-hidden="true" data-icon="Z"></span></a>&nbsp;{{changeArray.pnum}}</h1>
 			</div>
 			<div class="row">

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

@@ -50,6 +50,9 @@
 							<li <!-- if {{status}} == 5 -->class="active"<!-- endif -->>
 							<a href="{{rootUrl}}change/index<!-- if !empty({{pmid}}) -->/tender/{{pmid}}<!-- endif -->/status/5">终止 <!-- if {{num5}} != 0 --><span class="label label-default">{{num5}}</span><!-- endif --></a>
 							</li>
+							<li <!-- if {{status}} == 6 -->class="active"<!-- endif -->>
+							<a href="{{rootUrl}}change/index<!-- if !empty({{pmid}}) -->/tender/{{pmid}}<!-- endif -->/status/6">软件删除 <!-- if {{num6}} != 0 --><span class="label label-default">{{num6}}</span><!-- endif --></a>
+							</li>
 						</ul>
 						<!--筛选模块-->
 						<!-- if {{status}} == 1 -->
@@ -136,6 +139,20 @@
 							<!-- endif -->
 							</tbody>
 						</table>
+						<!-- elseif {{status}} == 6 -->
+						<!--软件删除-->
+						<table class="table">
+							<thead>
+							<tr><th width="10%">标段</th><th width="20%">变更令号</th><th width="30%">工程名称</th><th width="10%">变更类别</th><th width="10%">变更金额</th><th width="10%"></th></tr>
+							</thead>
+							<tbody>
+							<!-- if !empty({{list}}) -->
+							<!-- loop list -->
+							<tr><td>{{list' value.pmname}}</td><td><a href="/change/detail/{{list' value.cid}}">{{list' value.pnum}}</a></td><td>{{list' value.pname}}</td><td>{{list' value.changeCategory}}</td><td>{{list' value.totalamount}}</td><td><span class="colRed">软件删除</span></td></tr>
+							<!-- endloop -->
+							<!-- endif -->
+							</tbody>
+						</table>
 						<!-- endif -->
 						<!--翻页-->
 						<nav aria-label="Page navigation">

+ 35 - 20
protected/view/r-project-section-report.html

@@ -209,8 +209,10 @@
 
                 <div class="form">
                     <form>
-                <textarea name="content" id="content" class="form-control" rows="3" placeholder="填写审批通过的意见"
+                        <div>
+                <textarea name="content" class="form-control" rows="3" placeholder="填写审批通过的意见"
                           style="width:510px"></textarea>
+                        </div>
                     </form>
                 </div>
             </div>
@@ -257,8 +259,10 @@
 
                 <div class="form">
                     <form>
-                <textarea name="content" id="content" class="form-control" rows="3" placeholder="填写审批不通过的意见"
+                        <div>
+                <textarea name="content" class="form-control" rows="3" placeholder="填写审批不通过的意见"
                           style="width:510px"></textarea>
+                        </div>
                     </form>
                 </div>
             </div>
@@ -276,25 +280,36 @@
 <script type="text/javascript">
     $(document).ready(function () {
         $(".auditclass").click(function () {
-            var pmid = $(this).attr('pmid');
-            var numpname = $(this).attr('numpname');
-            var times = $(this).attr('times');
-            var content = $(this).parent().parent().find("textarea").val();
-            var act = $(this).attr('act');
-            var maid = $(this).attr('maid');
-            var last = $(this).attr('last');
-            $.ajax({
-                type: "POST",
-                dataType: "json",
-                cache: false,
-                data: {"act": act, "pmid": pmid, "numpname": numpname, "times": times, "content": content, "last": last},
-                url: "/rproject/{{pid}}/section/{{pmid}}/report/{{mpid}}",
-                success: function (data) {
-                    if (data['status'] == 1) {
-                        window.location.href = "{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/report/{{mpid}}";
+            var $textarea = $(this).parent().siblings('.modal-body').find("textarea");
+            var content = $textarea.val();
+            if(content.length <= 255){
+                var pmid = $(this).attr('pmid');
+                var numpname = $(this).attr('numpname');
+                var times = $(this).attr('times');
+                var act = $(this).attr('act');
+                var maid = $(this).attr('maid');
+                var last = $(this).attr('last');
+                $.ajax({
+                    type: "POST",
+                    dataType: "json",
+                    cache: false,
+                    data: {"act": act, "pmid": pmid, "numpname": numpname, "times": times, "content": content, "last": last},
+                    url: "/rproject/{{pid}}/section/{{pmid}}/report/{{mpid}}",
+                    success: function (data) {
+                        if (data['status'] == 1) {
+                            window.location.href = "{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/report/{{mpid}}";
+                        }
                     }
-                }
-            });
+                });
+            }else{
+                $textarea.parent().addClass('has-error');
+                $textarea.parent().append('<span class="help-block">您输入的审批意见太长了,请精简一点点。</span>');
+            }
+        });
+
+        $('textarea[name="content"]').focus(function(){
+            $(this).parent().removeClass('has-error');
+            $(this).parent().children('span').remove();
         });
     })
 </script>