caipin 7 år sedan
förälder
incheckning
ad922e725b

+ 80 - 0
protected/model/invoiceRefund.php

@@ -0,0 +1,80 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+/**
+ * 收款退款相关信息及其操作业务逻辑
+ * @author CP.
+ * @version 1.0
+ * @namespace invoice
+ * @package invoiceModel
+ */
+class invoiceRefund extends DooModel {
+	
+	public $ireid;
+	public $irid;
+	public $refundType;
+	public $refundCompany;
+	public $refundNumber;
+	public $refundPrice;
+	public $refundLog;
+	public $date;
+	public $_table = 'CLD_invoiceRefund';
+	public $_primarykey = 'ireid';
+	public $_fields = array (
+			'ireid',
+			'irid',
+			'refundType',
+			'refundCompany',
+			'refundNumber',
+			'refundPrice',
+			'refundLog',
+			'date' 
+	);
+	
+	/**
+	 * 根据irid获得退款信息
+	 */
+	public function getInvoiceRefundIrid($irid=0){
+		if (empty($irid))
+			return array();
+		return $list = $this->find ( array ( 
+				'where' => 'irid='.$irid,
+				'asArray' => TRUE
+		));
+	}
+	
+	/**
+	 * 添加一个发票并进入审批状态
+	 * @param array $item 发票相关数据
+	 * @return number 返回发票ID
+	 */
+	public function addInvoiceRefund($item = array()) {
+		$lid = 0;
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			$lid = $this->insert ();
+		}
+		return $lid;
+	}
+	
+	/**
+	 * 根据参数字段更新相应字段(主键ID必须传)
+	 * @param array $item 相关需要更新的字段信息
+	 * @return number 返回发票ID
+	 */
+	public function setInvoicePaperByCondition($item = array()) {
+		$lid = 0;
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			$lid = $this->update ();
+		}
+		return $lid;
+	}
+	
+	
+}
+
+?>

+ 65 - 0
protected/model/receiptAuthorityManage.php

@@ -0,0 +1,65 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+/**
+ * 发票相关管理相关信息及其操作业务逻辑
+ * @author CP.
+ * @version 1.0
+ * @namespace invoice
+ * @package invoiceModel
+ */
+class receiptAuthorityManage extends DooModel {
+	/**
+	 *
+	 * @var integer $iid 管理组ID
+	 */
+	public $icid;
+	/**
+	 *
+	 * @var string $staff 管理组人员
+	 */
+	public $staff;
+	public $category;
+	public $cid;
+	
+	public $_table = 'CLD_receiptAuthorityManage';
+	public $_primarykey = 'icid';
+	public $_fields = array (
+			'icid',
+			'staff',
+			'category',
+			'cid'
+	);
+	
+	/**
+	 * 获得查看人员
+	 * @param number $icid
+	 */
+	public function getInvoiceCMByIcid($icid=0){
+		$lsit=array();
+		if (! empty ( $icid ))
+			$lsit = $this->getOne ( array (
+					'where' => 'icid='.$icid,
+					'asArray' => TRUE
+			) );
+		
+		return $lsit;
+	}
+	
+	/**
+	 * 是否有该用户在权限列表中
+	 * @param number $sid
+	 */
+	public function getInvoiceCMByStaff($sid = 0) {
+		$lsit=array();
+		if (! empty ( $sid ))
+			$lsit = $this->find ( array (
+					'select'=>'cid',
+					'where' => 'staff like "%[\"' . $sid . '\",%"',
+					'asArray' => TRUE
+			) );
+	
+			return $lsit;
+	}
+}
+
+// ?>

+ 99 - 0
protected/view/admin/adminReceiptAuthority.html

@@ -0,0 +1,99 @@
+ <!-- include 'header' -->
+ <script type="text/javascript" >
+  var invoiceStaff={{invoiceStaff}};
+</script>
+ <script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/admin.js"></script>
+ 
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include 'menu' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<!-- include 'admin_menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight">
+				<div class="subNav">
+					<ul class="navTabs">
+					
+						<li ><a href="/adminverify">审批组</a></li>
+						<li><a href="/adminRole">审批角色</a></li>
+						<li><a href="/adminExecute">费用执行人</a></li>
+					
+						<li class="active"><a href="/adminReceiptAuthority">汇总权限</a></li>
+					</ul>
+				</div>
+					<form>
+					<legend>添加汇总权限</legend>
+						<table class="table table-striped">
+              <thead>
+                <tr>
+                  <th>办事处名称</th>
+                  <th>可见</th>
+                  <th>操作</th>
+                </tr>
+              </thead>
+              <tbody>
+                 <!-- loop categoryList -->
+                <tr>
+                  <td>{{categoryList' value.title}}</td>
+                  <td>
+                  {{categoryList' value.html}}
+                  </td>
+                  <td><a href="#add" node-iacd data-cidKey="{{categoryList' value.cidKey}}" data-toggle="modal">添加</a></td>
+                </tr>
+                <!-- endloop -->
+               
+              </tbody>
+          	</table>
+					</form>
+			</div>
+		</div>
+	</div>
+<!--弹出(添加可见人)-->
+<div class="modal hide fade" id="add">
+
+  <div class="modal-dialog">
+  <form action="/addReceiptAuthorityManage" id="iscs" method="post">
+  <input type="hidden" id="cidKey" name="cidKey" value="">
+    <div class="modal-content">
+    <div class="modal-header">
+    <h3>添加可见人</h3>
+    </div>
+    <div class="modal-body">
+    	<div class="control-group">
+    		<div class="controls">
+			    <select  style="width:190px" node='category'>
+			    	<!-- loop categoryList -->
+			    	<option value="{{categoryList' value.cidKey}}">{{categoryList' value.title}}</option>
+			    	<!-- endloop -->
+			    	
+			    </select>
+			    <select name="sidKey" node-category='staff' style="width:190px">
+			    </select>
+			</div>
+		</div>
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	    <button type="submit" class="button" data-toggle="modal">确定</button>
+	    
+	</div>
+</div>
+</form>
+</div>
+</div>
+<!--弹出-->
+
+<script type="text/javascript">autoFlashHeight();</script>
+</body>