Quellcode durchsuchen

计量支付附件

调整附件一对一关联为多对一
NoNZero vor 8 Jahren
Ursprung
Commit
0800eca8bf

+ 0 - 1
index.php

@@ -1,5 +1,4 @@
 <?php
-ini_set('display_errors', 1);
 include './protected/config/common.conf.php';
 include './protected/config/routes.conf.php';
 include './protected/config/db.conf.php';

+ 10 - 4
protected/class/itemfile.php

@@ -15,6 +15,8 @@ class ItemFile
     public function insertItemFileRecord($postArray)
     {
         $this->__itemfile->ownerid = $postArray['ownerid'];
+        $this->__itemfile->pid = $postArray['pid'];
+        $this->__itemfile->pmid = $postArray['pmid'];
         $this->__itemfile->filename = $postArray['filename'];
         $this->__itemfile->fileext = $postArray['fileext'];
         $this->__itemfile->filesize = $postArray['filesize'];
@@ -23,15 +25,19 @@ class ItemFile
         return $this->__itemfile->insert();
     }
 
-    public function getItemFileList($tenderid)
+    public function getItemFile($iaid)
     {
-        return $tenderid ? $this->__itemfile->find(array('where' => 'mpid=?', 'desc' => 'intime', 'param' => array($tenderid), 'asArray' => TRUE)) : FALSE;
+        return $iaid ? $this->__itemfile->getOne(array('where' => 'iaid=?', 'param' => array($iaid), 'asArray' => TRUE)) : FALSE;
     }
 
-    public function updateItemFields($id, $fname, $tips)
+    public function getFilesAll($pmid)
+    {
+        return $pmid ? $this->__itemfile->find(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE)) : FALSE;
+    }
+
+    public function updateItemFields($id, $fname)
     {
         $this->__itemfile->filename = iconv('GBK', 'UTF-8', $fname);
-        $this->__itemfile->tips = iconv('GBK', 'UTF-8', $tips);
         return $this->__itemfile->update(array('where' => 'iaid=?', 'param' => array($id)));
     }
 

+ 24 - 2
protected/class/itemmeasurenum.php

@@ -18,12 +18,34 @@ class ItemMeasureNumpofper
         $this->__itemMeasureNum->ownerid = $postArray['ownerid'];
         $this->__itemMeasureNum->softwareitemid = $postArray['itemid'];
         $this->__itemMeasureNum->pid = $postArray['pid'];
-        $this->__itemMeasureNum->mpid = $postArray['mpid'];
+        $this->__itemMeasureNum->pmid = $postArray['pmid'];
         $this->__itemMeasureNum->isdel = 0;
         $this->__itemMeasureNum->deltime = 0;
-        $this->__itemMeasureNum->categoryid = 0;
+        $this->__itemMeasureNum->categoryid = $postArray['categoryid'];
         $this->__itemMeasureNum->tips = $postArray['tips'];
+        $this->__itemMeasureNum->numpname = $postArray['numpname'];
         $this->__itemMeasureNum->intime = time();
         return $this->__itemMeasureNum->insert();
     }
+
+    public function getItemMeasureNum($tenderid)
+    {
+        return $this->__itemMeasureNum->find(array('where' => 'pmid=?', 'param' => array($tenderid), 'asArray' => TRUE));
+    }
+
+    public function getRowData($imnid)
+    {
+        return $this->__itemMeasureNum->getOne(array('where' => 'imnid=?', 'param' => array($imnid), 'asArray' => TRUE));
+    }
+
+    public function updateItemFields($id, $tips)
+    {
+        $this->__itemMeasureNum->tips = iconv('GBK', 'UTF-8', $tips);
+        return $this->__itemMeasureNum->update(array('where' => 'imnid=?', 'param' => array($id)));
+    }
+
+    public function delItemFields($imnid)
+    {
+        return $this->__itemMeasureNum->delete(array('where' => 'imnid=?', 'param' => array($imnid)));
+    }
 }

+ 9 - 1
protected/config/routes.conf.php

@@ -15,6 +15,8 @@ $route['*']['/project/:pmid/measure'] = array('ProjectController', 'proMeasure')
 $route['*']['/project/section/get'] = array('ProjectController', 'getAjaxSection');
 $route['*']['/project/:pid/section/:mpid/measure'] = array('ProjectController', 'proSectionMeasure');
 $route['*']['/project/:pid/section/:pmid/detail'] = array('ProjectController', 'proDetail');
+$route['*']['/project/:pid/section/:pmid/files'] = array('ProjectController', 'proSectionFiles');
+$route['*']['/project/:pid/section/:pmid/files/recover'] = array('ProjectController', 'proSectionFilesRecover');
 // R
 $route['*']['/rproject/index'] = array('RProjectController', 'index');
 $route['*']['/rproject/:pid/section'] = array('RProjectController', 'proSection');
@@ -22,6 +24,8 @@ $route['*']['/rproject/:pid/section/:mpid/measure'] = array('RProjectController'
 $route['*']['/rproject/:pid/section/:pmid/detail'] = array('RProjectController', 'proDetail');
 $route['*']['/rproject/:pmid/measure/detail'] = array('RProjectController', 'proMeasure');
 $route['*']['/rproject/:pid/section/:pmid/report/:mpid'] = array('RProjectController', 'proReport');
+$route['*']['/rproject/:pid/section/:pmid/files/:mpid'] = array('RProjectController', 'proSectionFiles');
+$route['*']['/rproject/section/get/:iaid/attachment'] = array('RProjectController', 'proSectionGetFiles');
 // S
 $route['get']['/sproject/index'] = array('SProjectController', 'index');
 $route['get']['/sproject/:pid/section'] = array('SProjectController', 'proSection');
@@ -128,9 +132,13 @@ $route['*']['/api/client/tender/attachment/:tenderid/list'] = array('ClientContr
  */
 $route['*']['/api/client/tender/attachment/info/:fileid/update'] = array('ClientController', 'updateItemFileDesc');
 /**
+ * 根据关联列表ID删除附件关联关系
+ */
+$route['*']['/api/client/tender/attachment/:fileid/del'] = array('ClientController', 'delItemFile');
+/**
  * 根据标段ID获取全部附件列表
  */
-$route['*']['/api/client/tender/attachment/:itemid/del'] = array('ClientController', 'delItemFile');
+$route['*']['/api/client/tender/attachment/get/:tenderid/files/all'] = array('ClientController', 'getAttaFilesAll');
 /**
  * 根据标段ID和期数获取审核意见
  */

+ 61 - 23
protected/controller/ClientController.php

@@ -1078,20 +1078,19 @@ class ClientController extends DooController
     public function uploadItemFile()
     {
         if (isset($this->params['tenderid']) && isset($this->params['uid'])) {
-            if (!isset($_FILES['upitem']) && !isset($_POST['itemid']) && !isset($_POST['Category'])) {
+            if (!isset($_FILES['upitem']) && !isset($_POST['itemid']) && !isset($_POST['category']) && !isset($_POST['phase'])) {
                 $this->msg(0, '上传参数错误');
             }
             $fileArray = $this->upItemFile('upitem')[0];
             if (isset($fileArray['filepath'])) {
+                $pidArray = $this->actmeasure->getRowByPmid($this->params['tenderid']);
                 $memoStr = iconv('GBK', 'UTF-8', $_POST['Memo']);
                 $fnArray = explode('.', $fileArray['filename']);
                 $filenameStr = iconv('GBK', 'UTF-8', $fnArray[0]);
-//                $postArray = array('mpid' => $this->params['tenderid'], 'ownerid' => $this->params['uid'], 'itemid' => $_POST['itemid'], 'filename' => $filenameStr, 'filesize' => $fileArray['filesize'], 'fileext' => $fileArray['fileext'], 'filepath' => $fileArray['filepath'], 'categoryid' => array_search($_POST['Category'], $this->fileTypeArray), 'tips' => $memoStr);
-                $postArray = array('ownerid' => $this->params['uid'], 'filename' => $filenameStr, 'filesize' => $fileArray['filesize'], 'fileext' => $fileArray['fileext'], 'filepath' => $fileArray['filepath']);
+                $postArray = array('ownerid' => $this->params['uid'], 'pid' => $pidArray['pid'], 'pmid' => $this->params['pmid'], 'filename' => $filenameStr, 'filesize' => $fileArray['filesize'], 'fileext' => $fileArray['fileext'], 'filepath' => $fileArray['filepath']);
                 $iaid = $this->itemfile->insertItemFileRecord($postArray);
                 if ($iaid > 1) {
-                    $pidArray = $this->numofperact->getRowByMpid($this->params['tenderid']);
-                    $itemMeasureNumArray = array('iaid' => $iaid, 'pid' => $pidArray['pid'], 'mpid' => $this->params['tenderid'], 'ownerid' => $this->params['uid'], 'itemid' => $_POST['itemid'], 'tips' => $memoStr);
+                    $itemMeasureNumArray = array('iaid' => $iaid, 'pid' => $pidArray['pid'], 'pmid' => $this->params['tenderid'], 'numpname' => $_POST['phase'], 'ownerid' => $this->params['uid'], 'itemid' => $_POST['itemid'], 'categoryid' => array_search($_POST['category'], $this->fileTypeArray), 'tips' => $memoStr);
                     $this->itemMeasureNum->insert($itemMeasureNumArray);
                     $extPath = pathinfo($fileArray['filepath']);
                     $itemArray = array('onlineFileName' => $extPath['filename'] . '.' . $extPath['extension']);
@@ -1113,16 +1112,15 @@ class ClientController extends DooController
     public function getItemFileList()
     {
         if (isset($this->params['tenderid'])) {
-            $itemfileArray = $this->itemfile->getItemFileList($this->params['tenderid']);
-            $key = array_search(max($itemfileArray), $itemfileArray);
-            if ($key >= 0) {
-                foreach ($itemfileArray as $value) {
-                    $profileArray = $this->profile->getProWithUid($value['ownerid']);
-                    $downArray[] = array('downurl' => Doo::conf()->APP_URL . $value['filepath'], 'filename' => $value['filename'] . '.' . $value['fileext'], 'fileext' => $value['fileext'], 'ownerName' => $profileArray['name'], 'itemid' => $value['itemid'], 'Category' => $this->fileTypeArray[$value['categoryid']], 'Memo' => $value['tips'], 'ownerid' => $value['ownerid'], 'uptime' => date('Y-m-d H:i', $value['intime']), 'fileid' => $value['iaid']);
-                }
-                echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downArray), JSON_UNESCAPED_UNICODE);
-                die();
+            $itemfileArray = $this->itemMeasureNum->getItemMeasureNum($this->params['tenderid']);
+            foreach ($itemfileArray as $value) {
+                $profileArray = $this->profile->getProWithUid($value['ownerid']);
+                $attFileArray = $this->itemfile->getItemFile($value['iaid']);
+                if (isset($attFileArray) && $attFileArray && isset($profileArray) && $profileArray)
+                    $downArray[] = array('downurl' => Doo::conf()->APP_URL . $attFileArray['filepath'], 'filename' => $attFileArray['filename'] . '.' . $attFileArray['fileext'], 'fileext' => $attFileArray['fileext'], 'ownerName' => $profileArray['name'], 'itemid' => $value['softwareitemid'], 'Category' => $value['categoryid'], 'Memo' => $value['tips'], 'ownerid' => $value['ownerid'], 'uptime' => date('Y-m-d H:i', $value['intime']), 'fileid' => $value['imnid'], 'phase' => $value['numpname']);
             }
+            echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $downArray), JSON_UNESCAPED_UNICODE);
+            die();
         } else {
             $this->msg(0, '获取附件列表参数错误');
         }
@@ -1134,7 +1132,11 @@ class ClientController extends DooController
     public function updateItemFileDesc()
     {
         if (isset($this->params['fileid']) && isset($_POST['FileName']) && isset($_POST['Memo'])) {
-            if ($this->itemfile->updateItemFields($this->params['fileid'], $_POST['FileName'], $_POST['Memo']) > 0) {
+            $memoStr = iconv('GBK', 'UTF-8', $_POST['Memo']);
+            $filenameStr = iconv('GBK', 'UTF-8', $_POST['FileName']);
+            $imnidArray = $this->itemMeasureNum->getRowData($this->params['fileid']);
+            if ($this->itemMeasureNum->updateItemFields($this->params['fileid'], $memoStr) > 0) {
+                $this->itemfile->updateItemFields($imnidArray['iaid'], $filenameStr);
                 echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
                 die();
             } else {
@@ -1151,16 +1153,52 @@ class ClientController extends DooController
      */
     public function delItemFile()
     {
-        if (isset($this->params['fileid']) && isset($_POST['FileName']) && isset($_POST['Memo'])) {
-            if ($this->itemfile->updateItemFields($this->params['fileid'], $_POST['FileName'], $_POST['Memo']) > 0) {
-                echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
-                die();
-            } else {
-                echo json_encode(array('status' => 'FALSE', 'msg' => '附件更新接口参数错误'), JSON_UNESCAPED_UNICODE);
-                die();
+        if (isset($this->params['fileid'])) {
+            $this->itemMeasureNum->delItemFields($this->params['fileid']);
+            echo json_encode(array('status' => 'TRUE', 'msg' => ''), JSON_UNESCAPED_UNICODE);
+            die();
+        } else {
+            $this->msg(0, '关联删除接口参数错误');
+        }
+    }
+
+    /**
+     * @return attachment
+     */
+    public function getAttaFilesAll()
+    {
+        if (isset($this->params['tenderid'])) {
+            $itemfileArray = $this->itemfile->getFilesAll($this->params['tenderid']);
+            foreach ($itemfileArray as $value) {
+//                $profileArray = $this->profile->getProWithUid($value['ownerid']);
+//                $attFileArray = $this->itemfile->getItemFile($value['iaid']);
+//                if (isset($attFileArray) && $attFileArray && isset($profileArray) && $profileArray)
+                $filesArray[] = array('downurl' => Doo::conf()->APP_URL . $value['filepath'], 'filename' => $value['filename'] . '.' . $value['fileext'], 'fileext' => $value['fileext'], 'fileid' => $value['iaid']);
             }
+            echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $filesArray), JSON_UNESCAPED_UNICODE);
+            die();
         } else {
-            $this->msg(0, '附件更新接口参数错误');
+            $this->msg(0, '获取附件列表参数错误');
+        }
+    }
+
+    /**
+     * @return attachment
+     */
+    public function createAttWithTender()
+    {
+        if (isset($this->params['tenderid'])) {
+            $itemfileArray = $this->itemfile->getFilesAll($this->params['tenderid']);
+            foreach ($itemfileArray as $value) {
+//                $profileArray = $this->profile->getProWithUid($value['ownerid']);
+//                $attFileArray = $this->itemfile->getItemFile($value['iaid']);
+//                if (isset($attFileArray) && $attFileArray && isset($profileArray) && $profileArray)
+                $filesArray[] = array('downurl' => Doo::conf()->APP_URL . $value['filepath'], 'filename' => $value['filename'] . '.' . $value['fileext'], 'fileext' => $value['fileext'], 'fileid' => $value['iaid']);
+            }
+            echo json_encode(array('status' => TRUE, 'msg' => '', 'info' => $filesArray), JSON_UNESCAPED_UNICODE);
+            die();
+        } else {
+            $this->msg(0, '获取附件列表参数错误');
         }
     }
 

+ 113 - 2
protected/controller/ProjectController.php

@@ -1,5 +1,4 @@
 <?php
-
 Doo::loadClass('auth');
 Doo::loadClass('attfile');
 Doo::loadClass('profile');
@@ -8,6 +7,8 @@ Doo::loadClass('contractact');
 Doo::loadClass('actmeasure');
 Doo::loadClass('numofperact');
 Doo::loadClass('measureauditact');
+Doo::loadClass('itemmeasurenum');
+Doo::loadClass('itemfile');
 
 /* * proDetail
  * MainController
@@ -19,7 +20,7 @@ Doo::loadClass('measureauditact');
 class ProjectController extends DooController
 {
 
-    private $data, $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 $data, $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>'), $itemmeasurenum, $itemfle;
 
     public function beforeRun($resource, $action)
     {
@@ -43,6 +44,8 @@ class ProjectController extends DooController
         $this->actmeasure = new actMeasure();
         $this->numofperact = new NumofperAct();
         $this->measureauditact = new MeasureauditAct();
+        $this->itemmeasurenum = new ItemMeasureNumpofper();
+        $this->itemfle = new ItemFile();
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'p';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
@@ -350,6 +353,114 @@ class ProjectController extends DooController
         $this->render('w-project-section', $this->data, TRUE);
     }
 
+    function proSectionFiles()
+    {
+        // 面包屑导航项目
+        $this->data['currproArray'] = $this->data['allproArray'] = NULL;
+        $this->data['pmid'] = $this->params['pmid'];
+        $allproArray = $this->project->getAll();
+        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();
+        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;
+                }
+            }
+        }
+        $this->data['itemMeasureArray'] = $this->itemmeasurenum->getItemMeasureNum($this->params['pmid']);
+        foreach ($this->data['itemMeasureArray'] as $k => $v) {
+            $fileArray = $this->itemfle->getItemFile($v['iaid']);
+            $this->data['itemMeasureArray'][$k]['realname'] = $this->profile->getProWithUid($v['ownerid'])['name'];
+            $this->data['itemMeasureArray'][$k]['pmname'] = $this->actmeasure->getRowByPmid($v['pmid'])['pmname'];
+            $this->data['itemMeasureArray'][$k]['filename'] = $fileArray['filename'];
+            $this->data['itemMeasureArray'][$k]['fileext'] = $fileArray['fileext'];
+            $this->data['itemMeasureArray'][$k]['tips'] = $v['tips'];
+        }
+        $this->data['pid'] = $this->params['pid'];
+        $this->data['pmid'] = $this->params['pmid'];
+        $this->data['mpid'] = $this->params['mpid'];
+        $this->render('w-project-section-files', $this->data, TRUE);
+    }
+
+    function proSectionFilesRecover()
+    {
+        // 面包屑导航项目
+        $this->data['currproArray'] = $this->data['allproArray'] = NULL;
+        $this->data['pmid'] = $this->params['pmid'];
+        $allproArray = $this->project->getAll();
+        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();
+        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;
+                }
+            }
+        }
+        $this->data['itematta'] = $this->itemfle->getFilesAll($this->params['pmid']);
+        foreach ($this->data['itematta'] as $k => $v) {
+            $this->data['itematta'][$k]['realname'] = $this->profile->getProWithUid($v['ownerid'])['name'];
+            $this->data['itematta'][$k]['pmname'] = $this->actmeasure->getRowByPmid($v['pmid'])['pmname'];
+        }
+        $this->data['pid'] = $this->params['pid'];
+        $this->data['pmid'] = $this->params['pmid'];
+        $this->data['mpid'] = $this->params['mpid'];
+        $this->render('w-project-section-files-recover', $this->data, TRUE);
+    }
+
     Function fNumber($number)
     {
         if ($number == '')

+ 91 - 2
protected/controller/RProjectController.php

@@ -1,5 +1,4 @@
 <?php
-
 Doo::loadClass('auth');
 Doo::loadClass('attfile');
 Doo::loadClass('profile');
@@ -8,6 +7,8 @@ Doo::loadClass('contractact');
 Doo::loadClass('actmeasure');
 Doo::loadClass('measureauditact');
 Doo::loadClass('numofperact');
+Doo::loadClass('itemmeasurenum');
+Doo::loadClass('itemfile');
 
 /**
  * MainController
@@ -18,7 +19,7 @@ Doo::loadClass('numofperact');
 class RProjectController extends DooController
 {
 
-    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审批', 'checking' => '审批中', 'checked' => '已审批', 'checkno' => '未通过');
+    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审批', 'checking' => '审批中', 'checked' => '已审批', 'checkno' => '未通过'), $itemfile, $itemmeasurenum;
 
     public function __construct()
     {
@@ -30,6 +31,8 @@ class RProjectController extends DooController
         $this->actmeasure = new actMeasure();
         $this->measureauditact = new MeasureauditAct();
         $this->numofperact = new NumofperAct();
+        $this->itemfile = new ItemFile();
+        $this->itemmeasurenum = new ItemMeasureNumpofper();
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'r';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
@@ -221,6 +224,92 @@ class RProjectController extends DooController
         $this->render('r-project-section-measure', $this->data, TRUE);
     }
 
+    function proSectionFiles()
+    {
+        $mpidArray = $this->measureauditact->getAuditProject($this->auth->getUid());
+        foreach ($mpidArray as $k1 => $v1) {
+            if ($v1['pid'] != $this->params['pid'])
+                $this->data['allproArray'][] = $this->project->getRowByPid($v1['pid']);
+        }
+        $this->data['currproArray'] = $this->project->getRowByPid($this->params['pid']);
+        $this->data['itematta'] = $this->itemmeasurenum->getItemMeasureNum($this->params['pmid']);
+        foreach ($this->data['itematta'] as $k => $v) {
+            $fileArray = $this->itemfile->getItemFile($v['iaid']);
+            $this->data['itematta'][$k]['realname'] = $this->profile->getProWithUid($v['ownerid'])['name'];
+            $this->data['itematta'][$k]['pmname'] = $this->actmeasure->getRowByPmid($v['pmid'])['pmname'];
+            $this->data['itematta'][$k]['filename'] = $fileArray['filename'];
+            $this->data['itematta'][$k]['fileext'] = $fileArray['fileext'];
+            $this->data['itematta'][$k]['iaid'] = $fileArray['iaid'];
+            $this->data['itematta'][$k]['tips'] = $v['tips'];
+        }
+        $this->data['pid'] = $this->params['pid'];
+        $this->data['pmid'] = $this->params['pmid'];
+        $this->data['mpid'] = $this->params['mpid'];
+        $this->render('r-project-section-files', $this->data, TRUE);
+    }
+
+    /**
+     * @return actMeasure
+     */
+    public function proSectionGetFiles()
+    {
+        $attaArray = $this->itemfile->getItemFile($this->params['iaid']);
+        $this->file_down($attaArray['filepath'], $attaArray['filesize'], $attaArray['filename']);
+        return;
+    }
+
+    /**
+     * 文件下载
+     * @param $filepath 文件路径
+     * @param $filename 文件名称
+     */
+    function file_down($filepath, $filesize, $filename = '')
+    {
+        if (!$filename)
+            $filename = basename($filepath);
+        if ($this->is_ie())
+            $filename = rawurlencode($filename);
+        $filetype = $this->fileext($filename);
+//        $filesize = sprintf("%u", filesize($filepath));
+        if (ob_get_length() !== false)
+            @ob_end_clean();
+        header('Pragma: public');
+        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
+        header('Cache-Control: no-store, no-cache, must-revalidate');
+        header('Cache-Control: pre-check=0, post-check=0, max-age=0');
+        header('Content-Transfer-Encoding: binary');
+        header('Content-Encoding: none');
+        header('Content-type: ' . $filetype);
+        header('Content-Disposition: attachment; filename="' . $filename . '"');
+        header('Content-length: ' . $filesize);
+        @readfile($filepath);
+        exit;
+    }
+
+    /**
+     * IE浏览器判断
+     */
+    function is_ie()
+    {
+        $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
+        if ((strpos($useragent, 'opera') !== false) || (strpos($useragent, 'konqueror') !== false))
+            return false;
+        if (strpos($useragent, 'msie ') !== false)
+            return true;
+        return false;
+    }
+
+    /**
+     * 取得文件扩展
+     *
+     * @param $filename 文件名
+     * @return 扩展名
+     */
+    function fileext($filename)
+    {
+        return strtolower(trim(substr(strrchr($filename, '.'), 1, 10)));
+    }
+
     Function fNumber($number)
     {
         if ($number == '')

+ 8 - 7
protected/model/itematt.php

@@ -5,26 +5,27 @@ Doo::loadCore('db/DooModel');
 /**
  * 用户表
  */
-class ItemAtt extends DooModel {
+class ItemAtt extends DooModel
+{
 
     public $iaid;
-    public $mpid;
     public $ownerid;
-    public $itemid;
+    public $pid;
+    public $pmid;
     public $filename;
     public $fileext;
     public $filesize;
     public $filepath;
-    public $categoryid;
     public $intime;
     public $isdel;
     public $tips;
     public $_table = 'jl_item_attachment';
     public $_primarykey = 'iaid';
-    public $_fields = array('iaid', 'mpid', 'ownerid', 'itemid', 'filename', 'fileext', 'filesize', 'filepath', 'categoryid', 'intime', 'isdel', 'tips');
+    public $_fields = array('iaid', 'ownerid', 'pid', 'pmid', 'filename', 'fileext', 'filesize', 'filepath', 'intime', 'isdel', 'tips');
 
-    public function __construct() {
-	parent::setupModel(__CLASS__);
+    public function __construct()
+    {
+        parent::setupModel(__CLASS__);
     }
 
 }

+ 3 - 2
protected/model/itemmnum.php

@@ -10,7 +10,8 @@ class ItemMeasureNumofper extends DooModel
     public $imnid;
     public $iaid;
     public $pid;
-    public $mpid;
+    public $pmid;
+    public $numpname;
     public $softwareitemid;
     public $isdel;
     public $intime;
@@ -20,7 +21,7 @@ class ItemMeasureNumofper extends DooModel
     public $tips;
     public $_table = 'jl_item_measure_numofper';
     public $_primarykey = 'imnid';
-    public $_fields = array('imnid', 'iaid', 'pid', 'mpid', 'softwareitemid', 'isdel', 'intime', 'deltime', 'ownerid', 'categoryid', 'tips');
+    public $_fields = array('imnid', 'iaid', 'pid', 'pmid', 'numpname', 'softwareitemid', 'isdel', 'intime', 'deltime', 'ownerid', 'categoryid', 'tips');
 
     public function __construct()
     {

Datei-Diff unterdrückt, da er zu groß ist
+ 297 - 273
protected/view/r-project-section-detail.html


+ 154 - 0
protected/view/r-project-section-files.html

@@ -0,0 +1,154 @@
+<!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/fixedheadertable.css>
+    <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>
+    <script src={{rootUrl}}global/js/jquery.fixedheadertable.js></script>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+    <!-- include "left" -->
+    <div class="mainContainer">
+        <!--内容-->
+        <div class="mainContent">
+            <div class="title clearfix">
+                <ul class="nav nav-pills">
+                    <li class="dropdown"><a title="返回" href="{{rootUrl}}rproject/{{pid}}/section"><span
+                            class="closePanel" aria-hidden="true" data-icon="Z"></span></a></li>
+                    <li class="dropdown">
+                        <a href="{{rootUrl}}sproject/{{currproArray.pid}}/section" data-toggle="dropdown"
+                           class="dropdown-toggle">
+                            {{currproArray.pname}}<b class="caret"></b>
+                        </a>
+                        <ul class="dropdown-menu">
+                            <!-- loop allproArray -->
+                            <li><a href="{{rootUrl}}sproject/{{allproArray' value.pid}}/section">{{allproArray'
+                                value.pname}}</a></li>
+                            <!-- endloop -->
+                        </ul>
+                    </li>
+                </ul>
+            </div>
+            <!--导航-->
+            <ul class="nav nav-tabs">
+                <li>
+                    <a href="{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/detail">标段概况</a>
+                </li>
+                <li class="active">
+                    <a href="/rproject/{{pid}}/section/{{pmid}}/files/{{mpid}}">附件</a>
+                </li>
+                <!-- if {{mpid}}>0 -->
+                <li>
+                    <a href="{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/report/{{mpid}}">审批</a>
+                </li>
+                <!-- endif -->
+            </ul>
+            <!--导航-->
+            <!--文件管理-->
+            <div class="filesWrap">
+                <div class="filesList">
+                    <table class="table table-striped table-hover">
+                        <thead>
+                        <tr>
+                            <th width="">文件名</th>
+                            <th width="">节点</th>
+                            <th width="">上传者</th>
+                            <th width="">上传时间</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <!-- loop itematta -->
+                        <tr>
+                            <td width=""><span class="fileico ico-{{itematta' value.fileext}}"></span><a
+                                    fileext="{{itematta' value.fileext}}"
+                                    iaid="{{itematta' value.iaid}}"
+                                    filename="{{itematta' value.filename}}"
+                                    realname="{{itematta' value.realname}}"
+                                    intime="{{formatDate(itematta' value.intime,'Y-m-d')}}"
+                                    tips="{{itematta' value.tips}}"
+                                    href="#"
+                                    numpname="第{{ToChinaseNum(itematta' value.numpname)}}期"
+                                    id="fname_{{itematta' value.imnid}}">{{itematta' value.filename}}</a></td>
+                            <td>{{itematta' value.pmname}}</td>
+                            <td width="">{{itematta' value.realname}}</td>
+                            <td width="">{{formatDate(itematta' value.intime,'Y-m-d')}}</td>
+                        </tr>
+                        <!-- endloop -->
+                        </tbody>
+                    </table>
+                </div>
+                <div class="filesDetail">
+                    <table class="table table-striped">
+                        <thead>
+                        <tr>
+                            <th colspan="4">文件详情</th>
+                            <input type="hidden" value="" id="uuid"/>
+                        </tr>
+                        </thead>
+                        <tr>
+                            <th width="60">文件名</th>
+                            <td colspan="3"><a href="#" id="filename" target="_blank">K0+800-K1+000图纸</a><span
+                                    class="fR"><button
+                                    class="btn btn-mini btn-primary" id="filedown"
+                                    type="button">下载</button></span></td>
+                        </tr>
+                        <tr>
+                            <th width="60">格式</th>
+                            <td id="fileext"><span class="fileico ico-jpg"></span>.jpg</td>
+                            <th width="60">所在类</th>
+                            <td>台帐附件</td>
+                        </tr>
+                        <tr>
+                            <th width="60">上传者</th>
+                            <td id="realname">陈工</td>
+                            <th width="60">上传时间</th>
+                            <td id="intime">2014-11-20 14:20</td>
+                        </tr>
+                        <tr>
+                            <th width="60">备注/描述</th>
+                            <td id="tips" colspan="3">内容内容内容内容</td>
+                        </tr>
+                    </table>
+                </div>
+            </div>
+            <!--文件管理-->
+        </div>
+        <!--内容-->
+    </div>
+</div>
+<script type="text/javascript">autoFlashHeight();</script>
+<script type="text/javascript">
+    $(document).ready(function () {
+        $("a[id^='fname_']").click(function () {
+            var fileext = $(this).attr('fileext');
+            var filename = $(this).attr('filename');
+            var realname = $(this).attr('realname');
+            var intime = $(this).attr('intime');
+            var tips = $(this).attr('tips');
+            var numpname = $(this).attr('numpname');
+            var iaid = $(this).attr('iaid');
+            $("#filename").html(filename);
+            $("#fileico").html(fileext);
+            $("#realname").html(realname);
+            $("#intime").html(intime);
+            $("#tips").html(tips);
+            $("#numpname").html(numpname);
+            $("#fileext").html(fileext);
+            $("#uuid").val(iaid);
+        });
+        $("#filedown").click(function () {
+            var uuid = $("#uuid").val();
+            location.href = "{{rootUrl}}rproject/section/get/" + uuid + "/attachment";
+        });
+    });
+</script>
+</body>

Datei-Diff unterdrückt, da er zu groß ist
+ 189 - 162
protected/view/r-project-section-report.html


+ 3 - 0
protected/view/w-project-section-detail.html

@@ -55,6 +55,9 @@
 			<li class="active">
 			    <a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/detail">标段概况</a>
 			</li>
+				<li>
+					<a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/files/{{mpid}}">附件</a>
+				</li>
 <!--			<li><a href="/project/{{pid}}/section/{{pmid}}/measure">计量台帐</a></li>-->
 		    </ul>
 		    <!--导航-->

+ 256 - 0
protected/view/w-project-section-files-recover.html

@@ -0,0 +1,256 @@
+<!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/fixedheadertable.css>
+    <script src={{rootUrl}}global/js/jquery.fixedheadertable.js></script>
+    <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 title="纵横计量支付" class="mainLogo"></h1>
+    <div class="userInfo"><img src="images/avtra.png" class="fR">
+        <div class="btn-group">
+            <button data-toggle="dropdown" class="btn btn-inverse dropdown-toggle">张三&nbsp;<span class="caret"></span>
+            </button>
+            <ul class="dropdown-menu">
+                <li><a href="#">个人信息</a></li>
+                <li><a href="#"><span data-icon="r" aria-hidden="true"></span>&nbsp;工作组</a></li>
+                <li><a href="#"><span data-icon="B" aria-hidden="true"></span>&nbsp;我的任务</a></li>
+                <li class="divider"></li>
+                <li><a href="#">帮助中心</a></li>
+                <li><a href="#">退出</a></li>
+            </ul>
+        </div>
+    </div>
+</div>
+<div class="wrapContent">
+    <div class="mainSidebar">
+        <div class="mainNav">
+            <ul>
+                <li><a href="w-project.html" title="项目管理" class="focus">
+                    <div data-icon="A" aria-hidden="true" class="navIcon"></div>
+                    项目管理</a></li>
+                <li><a href="r-project.html" title="需审批项目">
+                    <div data-icon="C" aria-hidden="true" class="navIcon"></div>
+                    审批项目</a><span class="badge badge-warning">4</span></li>
+                <li><a href="s-project.html" title="我编制的项目">
+                    <div data-icon="B" aria-hidden="true" class="navIcon"></div>
+                    编制项目</a></li>
+                <li><a href="" title="生成报表">
+                    <div data-icon="D" aria-hidden="true" class="navIcon"></div>
+                    报表</a></li>
+                <li><a href="" title="数据汇总">
+                    <div data-icon="E" aria-hidden="true" class="navIcon"></div>
+                    汇总</a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="mainContainer">
+        <!--内容-->
+        <div class="mainContent">
+            <div class="title clearfix">
+                <ul class="nav nav-pills">
+                    <li class="dropdown"><a title="返回" href="{{rootUrl}}project/{{currproArray.pid}}/section"><span
+                            class="closePanel" aria-hidden="true" data-icon="Z"></span></a></li>
+                    <li class="dropdown">
+
+                    </li>
+                    <li class="dropdown">
+                        <a href="{{rootUrl}}project/{{currproArray.pid}}/section" data-toggle="dropdown"
+                           class="dropdown-toggle">
+                            {{currconArray.stname}}<b class="caret"></b>
+                        </a>
+                        <ul class="dropdown-menu">
+                            <!-- loop allconArray -->
+                            <li><a href="{{rootUrl}}project/{{currproArray.pid}}/section">{{allconArray'
+                                value.stname}}</a></li>
+                            <!-- endloop -->
+                        </ul>
+                    </li>
+                    <li class="dropdown">
+                        <a href="{{rootUrl}}project/{{currproArray.pid}}/section" data-toggle="dropdown"
+                           class="dropdown-toggle">
+                            {{curractmeasureArray.pmname}}<b class="caret"></b>
+                        </a>
+                        <ul class="dropdown-menu">
+                            <!-- loop allactmeasureArray -->
+                            <li>
+                                <a href="{{rootUrl}}project/{{currproArray.pid}}/section/{{allactmeasureArray' value.pmid}}/detail">{{allactmeasureArray'
+                                    value.pmname}}</a></li>
+                            <!-- endloop -->
+                            <!--				    <li class="divider"></li>
+                                                <li><a href="#">共18标段,查看更多</a></li>-->
+                        </ul>
+                    </li>
+                </ul>
+            </div>
+            <!--导航-->
+            <ul class="nav nav-tabs">
+                <li>
+                    <a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/detail">标段概况</a>
+                </li>
+                <li class="active"><a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/files">附件</a></li>
+                <!--<li><a href="w-project-section-measure.html">计量台帐</a></li>-->
+            </ul>
+            <!--导航-->
+
+            <div class="title">
+                <h1>附件回收站</h1>
+            </div>
+            <!--文件管理-->
+            <div class="filesWrap">
+                <div class="filesList">
+                    <table class="table table-striped table-hover">
+                        <thead>
+                        <tr>
+                            <th width="">文件名</th>
+                            <th width="">期</th>
+                            <th width="">节点</th>
+                            <th width="">上传者</th>
+                            <th width="">上传时间</th>
+                            <th width="">删除</th>
+                            <th width="">删除时间</th>
+                            <th width="40">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr>
+                            <!-- loop itematta -->
+                            <td width=""><span class="fileico ico-jpg"></span><a href="#">{{itematta' value.filename}}</a></td>
+                            <td>第二期</td>
+                            <td>203-1-a 挖土方</td>
+                            <td width="">陈工</td>
+                            <td width="">2014-11-20 10:10</td>
+                            <td class="text-error">陈工</td>
+                            <td class="text-error">2014-11-20 10:10</td>
+                            <td>
+                                <div class="btn-group">
+                                    <a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">
+                                        <span class="caret"></span>
+                                    </a>
+                                    <ul class="dropdown-menu">
+                                        <li><a><i class="icon-eye-open"></i>&nbsp;预览</a></li>
+                                        <li><a><i class="icon-download-alt"></i>&nbsp;下载</a></li>
+                                        <li><a href="#file-replace" data-toggle="modal"><i class="icon-repeat"></i>&nbsp;恢复</a>
+                                        </li>
+                                    </ul>
+                                </div>
+                            </td>
+                        </tr>
+                        <!-- endloop -->
+                        </tbody>
+                    </table>
+                    <div class="pagination">
+                        <ul>
+                            <li class="disabled"><a href="#">&laquo;</a></li>
+                            <li class="active"><a href="#">1</a></li>
+                            <li><a href="#">2</a></li>
+                            <li><a href="#">3</a></li>
+                            <li><a href="#">4</a></li>
+                            <li><a href="#">5</a></li>
+                        </ul>
+                    </div>
+                </div>
+                <div class="filesDetail">
+                    <table class="table table-striped">
+                        <thead>
+                        <tr>
+                            <th colspan="4">文件详情</th>
+                        </tr>
+                        </thead>
+                        <tr>
+                            <th width="60">文件名</th>
+                            <td colspan="3"> K0+800-K1+000图纸</td>
+                        </tr>
+                        <tr>
+                            <th width="60">格式</th>
+                            <td><span class="fileico ico-jpg"></span>.jpg</td>
+                            <th width="60">所在期</th>
+                            <td>第二期</td>
+                        </tr>
+                        <tr>
+                            <th width="60">上传者</th>
+                            <td>陈工</td>
+                            <th width="60">上传时间</th>
+                            <td>2014-11-20 14:20</td>
+                        </tr>
+                        <tr>
+                            <th width="60">备注/描述</th>
+                            <td colspan="3">内容内容内容内容</td>
+                        </tr>
+                        <tr>
+                            <th width="60">更多操作</th>
+                            <td colspan="3">
+                                <button class="btn btn-mini btn-danger" type="button" href="#file-del"
+                                        data-toggle="modal"><i class="icon-remove icon-white"></i>彻底删除
+                                </button>
+                                <button class="btn btn-mini btn-danger" type="button" href="#file-del2"
+                                        data-toggle="modal"><i class="icon-remove icon-white"></i>彻底删除
+                                </button>
+                            </td>
+                        </tr>
+                    </table>
+                </div>
+            </div>
+            <!--文件管理-->
+        </div>
+        <!--内容-->
+    </div>
+</div>
+<!-- 替换弹出 -->
+<div id="file-replace" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
+     aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+        <h3 id="myModalLabel">文件恢复</h3>
+    </div>
+    <div class="modal-body">
+        <h5 class="text-success">恢复成功。</h5>
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
+    </div>
+</div>
+<!-- 替换弹出 -->
+<!-- 删除弹出 -->
+<div id="file-del" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
+     aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+        <h3 id="myModalLabel">文件删除</h3>
+    </div>
+    <div class="modal-body">
+        <h5 class="text-error">彻底删除无法还原,所有清单下挂的该文件都将移除。</h5>
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
+        <button class="btn btn-danger">确定删除</button>
+    </div>
+</div>
+</div>
+<!-- 删除弹出 -->
+<!-- 删除弹出 -->
+<div id="file-del2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
+     aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+        <h3 id="myModalLabel">文件删除</h3>
+    </div>
+    <div class="modal-body">
+        <h5 class="text-warning">文件上传者才有彻底删除权限。</h5>
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
+    </div>
+</div>
+</div>
+<!-- 删除弹出 -->
+<script type="text/javascript">autoFlashHeight();</script>
+</body>

+ 327 - 0
protected/view/w-project-section-files.html

@@ -0,0 +1,327 @@
+<!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/fixedheadertable.css>
+    <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>
+    <script src={{rootUrl}}global/js/jquery.fixedheadertable.js></script>
+</head>
+<body>
+<!-- include "top" -->
+<div class="wrapContent">
+    <!-- include "left" -->
+    <div class="mainContainer">
+        <!--内容-->
+        <div class="mainContent">
+            <div class="title clearfix">
+                <ul class="nav nav-pills">
+                    <li class="dropdown"><a title="返回" href="{{rootUrl}}project/{{currproArray.pid}}/section"><span
+                            class="closePanel" aria-hidden="true" data-icon="Z"></span></a></li>
+                    <li class="dropdown">
+
+                    </li>
+                    <li class="dropdown">
+                        <a href="{{rootUrl}}project/{{currproArray.pid}}/section" data-toggle="dropdown"
+                           class="dropdown-toggle">
+                            {{currconArray.stname}}<b class="caret"></b>
+                        </a>
+                        <ul class="dropdown-menu">
+                            <!-- loop allconArray -->
+                            <li><a href="{{rootUrl}}project/{{currproArray.pid}}/section">{{allconArray'
+                                value.stname}}</a></li>
+                            <!-- endloop -->
+                        </ul>
+                    </li>
+                    <li class="dropdown">
+                        <a href="{{rootUrl}}project/{{currproArray.pid}}/section" data-toggle="dropdown"
+                           class="dropdown-toggle">
+                            {{curractmeasureArray.pmname}}<b class="caret"></b>
+                        </a>
+                        <ul class="dropdown-menu">
+                            <!-- loop allactmeasureArray -->
+                            <li>
+                                <a href="{{rootUrl}}project/{{currproArray.pid}}/section/{{allactmeasureArray' value.pmid}}/detail">{{allactmeasureArray'
+                                    value.pmname}}</a></li>
+                            <!-- endloop -->
+                            <!--				    <li class="divider"></li>
+                                                <li><a href="#">共18标段,查看更多</a></li>-->
+                        </ul>
+                    </li>
+                </ul>
+            </div>
+            <!--导航-->
+            <ul class="nav nav-tabs">
+                <li>
+                    <a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/detail">标段概况</a>
+                </li>
+                <li class="active"><a href="{{rootUrl}}project/{{pid}}/section/{{pmid}}/files">附件</a></li>
+                <!--<li><a href="w-project-section-measure.html">计量台帐</a></li>-->
+            </ul>
+            <!--导航-->
+            <!--筛选工具-->
+            <div class="clearfix">
+                <form class="form-inline">
+                    <select class="span2">
+                        <option>不限期数</option>
+                        <option>第二期</option>
+                        <option>第一期</option>
+                    </select>
+                    <select class="span2">
+                        <option>上传者</option>
+                        <option>陈特</option>
+                        <option>任杰</option>
+                    </select>
+                    <select class="span2">
+                        <option>清单</option>
+                        <option>203-1-a 挖土方</option>
+                    </select>
+                    <a href="/project/{{pid}}/section/{{pmid}}/files/recover" class="fR">附件回收站</a>
+                </form>
+            </div>
+            <!--筛选工具-->
+            <!--文件管理-->
+            <div class="filesWrap">
+                <div class="filesList">
+                    <table class="table table-striped table-hover">
+                        <thead>
+                        <tr>
+                            <th width="">文件名</th>
+                            <th width="">期</th>
+                            <th width="">节点</th>
+                            <th width="">上传者</th>
+                            <th width="">上传时间</th>
+                            <th width="40">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <!-- loop itemMeasureArray -->
+                        <tr>
+                            <td width=""><span class="fileico ico-jpg"></span><a
+                                    fileext="{{itemMeasureArray' value.fileext}}"
+                                    imnid="{{itematta' value.imnid}}"
+                                    filename="{{itemMeasureArray' value.filename}}"
+                                    realname="{{itemMeasureArray' value.realname}}"
+                                    intime="{{formatDate(itemMeasureArray' value.intime,'Y-m-d')}}"
+                                    tips="{{itemMeasureArray' value.tips}}"
+                                    href="#"
+                                    numpname="第{{ToChinaseNum(itemMeasureArray' value.numpname)}}期"
+                                    id="fname_{{itemMeasureArray' value.imnid}}">{{itemMeasureArray'
+                                value.filename}}</a></td>
+                            <td>第{{ToChinaseNum(itemMeasureArray' value.numpname)}}期</td>
+                            <td>{{itemMeasureArray' value.pmname}}</td>
+                            <td width="">{{itemMeasureArray' value.realname}}</td>
+                            <td width="">{{formatDate(itemMeasureArray' value.intime,'Y-m-d')}}</td>
+                            <td>
+                                <div class="btn-group">
+                                    <a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">
+                                        <span class="caret"></span>
+                                    </a>
+                                    <ul class="dropdown-menu">
+                                        <li><a><i class="icon-eye-open"></i>&nbsp;预览</a></li>
+                                        <li><a href="#file-edit" data-toggle="modal"><i class="icon-pencil"></i>&nbsp;编辑</a>
+                                        </li>
+                                        <li><a><i class="icon-download-alt"></i>&nbsp;下载</a></li>
+                                    </ul>
+                                </div>
+                            </td>
+                        </tr>
+                        <!-- endloop -->
+                        </tbody>
+                    </table>
+                    <div class="pagination">
+                        <ul>
+                            <li class="disabled"><a href="#">&laquo;</a></li>
+                            <li class="active"><a href="#">1</a></li>
+                            <li><a href="#">2</a></li>
+                            <li><a href="#">3</a></li>
+                            <li><a href="#">4</a></li>
+                            <li><a href="#">5</a></li>
+                        </ul>
+                    </div>
+                </div>
+                <div class="filesDetail">
+                    <table class="table table-striped">
+                        <thead>
+                        <tr>
+                            <th colspan="4">文件详情</th>
+                        </tr>
+                        </thead>
+                        <tr>
+                            <th width="60">文件名</th>
+                            <td colspan="3" id="fn"> K0+800-K1+000图纸</td>
+                        </tr>
+                        <tr>
+                            <th width="60">格式</th>
+                            <td id="fileico"><span class="fileico ico-jpg"></span>.jpg</td>
+                            <th width="60">所在期</th>
+                            <td id="numpname">第二期</td>
+                        </tr>
+                        <tr>
+                            <th width="60">上传者</th>
+                            <td id="realname">陈工</td>
+                            <th width="60">上传时间</th>
+                            <td id="intime">2014-11-20 14:20</td>
+                        </tr>
+                        <tr>
+                            <th width="60">备注/描述</th>
+                            <td colspan="3" id="tips">内容内容内容内容</td>
+                        </tr>
+                        <tr>
+                            <th width="60">更多操作</th>
+                            <td colspan="3">
+                                <button class="btn btn-mini btn-primary" type="button" href="#file-replace"
+                                        data-toggle="modal"><i class="icon-retweet icon-white"></i>替换
+                                </button>
+                                <button class="btn btn-mini btn-info" type="button" href="#file-history"
+                                        data-toggle="modal"><i class="icon-time icon-white"></i>历史版本
+                                </button>
+                                &nbsp;&nbsp;&nbsp;&nbsp;
+                                <button id="deletefile" class="btn btn-mini btn-danger" type="button" href="#file-del"
+                                        data-toggle="modal"><i class="icon-remove icon-white"></i>删除
+                                </button>
+                            </td>
+                        </tr>
+                    </table>
+                </div>
+            </div>
+            <!--文件管理-->
+        </div>
+        <!--内容-->
+    </div>
+</div>
+<!-- 编辑弹出 -->
+<div id="file-edit" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
+     aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+        <h3 id="myModalLabel">文件编辑</h3>
+    </div>
+    <div class="modal-body">
+        <div class="form">
+            <form class="form-horizontal">
+                <div class="control-group">
+                    <label class="control-label" for="inputEmail">文件名称</label>
+                    <div class="controls">
+                        <input type="text">
+                    </div>
+                </div>
+                <div class="control-group">
+                    <label class="control-label" for="inputEmail">备注/描述</label>
+                    <div class="controls">
+                        <textarea></textarea>
+                    </div>
+                </div>
+            </form>
+        </div>
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
+        <button class="btn btn-primary">确定修改</button>
+    </div>
+</div>
+<!-- 编辑弹出 -->
+<!-- 替换弹出 -->
+<div id="file-replace" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
+     aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+        <h3 id="myModalLabel">文件替换</h3>
+    </div>
+    <div class="modal-body">
+        <div class="form">
+            <form class="form-horizontal">
+                <div class="control-group">
+                    <label class="control-label" for="inputEmail">选择文件</label>
+                    <div class="controls">
+                        <input type="file">
+                        <span class="help-block">替换新文件后,所有已下挂该文件的清单都将更新。</span>
+                    </div>
+                </div>
+            </form>
+        </div>
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
+        <button class="btn btn-primary">确定替换</button>
+    </div>
+</div>
+<!-- 替换弹出 -->
+<!-- 删除弹出 -->
+<div id="file-del" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
+     aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+        <h3 id="myModalLabel">文件删除</h3>
+    </div>
+    <div class="modal-body">
+        <h5 class="text-success">文件删除成功,您可以在附件回收站恢复它。</h5>
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
+    </div>
+</div>
+</div>
+<!-- 删除弹出 -->
+<!-- 历史版本弹出 -->
+<div id="file-history" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
+     aria-hidden="true">
+    <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+        <h3 id="myModalLabel">历史版本</h3>
+    </div>
+    <div class="modal-body">
+        <div class="media">
+            <div class="pull-left">
+                <h4>#1</h4>
+            </div>
+            <div class="media-body">
+                <h5>陈特&nbsp;上传于 2016-10-10 10:10</h5>
+                <a href="#" target="_blank">QQ截图20160629164352.png</a>
+            </div>
+        </div>
+        <div class="media">
+            <div class="pull-left">
+                <h4>#2</h4>
+            </div>
+            <div class="media-body">
+                <h5>陈特&nbsp;上传于 2016-9-24 17:30</h5>
+                <a href="#" target="_blank">dfsdf.png</a>
+            </div>
+        </div>
+    </div>
+    <div class="modal-footer">
+        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
+    </div>
+</div>
+</div>
+<!-- 历史版本1弹出 -->
+<script type="text/javascript">autoFlashHeight();</script>
+<script type="text/javascript">
+    $(document).ready(function () {
+        $("a[id^='fname_']").click(function () {
+            var fileext = $(this).attr('fileext');
+            var filename = $(this).attr('filename');
+            var realname = $(this).attr('realname');
+            var intime = $(this).attr('intime');
+            var tips = $(this).attr('tips');
+            var numpname = $(this).attr('numpname');
+            $("#fn").html(filename);
+            $("#fileico").html(fileext);
+            $("#realname").html(realname);
+            $("#intime").html(intime);
+            $("#tips").html(tips);
+            $("#numpname").html(numpname);
+        });
+        $("#deletefile").click(function () {
+
+        });
+    });
+</script>
+</body>