caipin 4 年之前
父节点
当前提交
da97524380
共有 37 个文件被更改,包括 16046 次插入624 次删除
  1. 26 0
      global/css/global.css
  2. 48 0
      global/vue/fee/fee_receipt_data.js
  3. 90 0
      global/vue/fee/receipt_create.js
  4. 186 0
      global/vue/fee/receipt_create_fn.js
  5. 91 0
      global/vue/fee/receipt_office_component.js
  6. 63 0
      global/vue/fee/receipt_train_component.js
  7. 494 0
      global/vue/fee/receipt_trave_component.js
  8. 11965 0
      global/vue/vue.js
  9. 6 0
      global/vue/vue.min.js
  10. 175 0
      protected/class/comm_cld.php
  11. 6 0
      protected/config/acl.conf.php
  12. 1 0
      protected/config/js.edition.conf.php
  13. 10 0
      protected/config/routes_receipt.php
  14. 104 1
      protected/controller/ReceiptController.php
  15. 374 70
      protected/controller/fee/fee_controller.php
  16. 24 0
      protected/model/cld/account_item_cld.php
  17. 33 0
      protected/model/cld/category_cld.php
  18. 120 0
      protected/model/cld/receipt_cld.php
  19. 60 0
      protected/model/cld/region_cld.php
  20. 17 27
      protected/model/cld/staff_cld.php
  21. 51 0
      protected/model/cld/verify_cld.php
  22. 18 6
      protected/model/invoice.php
  23. 2 0
      protected/model/invoiceReceivables.php
  24. 1 0
      protected/model/invoiceTraining.php
  25. 9 8
      protected/plugin/TemplateTag.php
  26. 641 0
      protected/services/fee_service.php
  27. 17 0
      protected/services/office_service.php
  28. 16 0
      protected/services/region_service.php
  29. 24 22
      protected/view/admin/approvalExpenses.html
  30. 1 1
      protected/view/admin/invoiceAS.html
  31. 275 0
      protected/view/fee/approval/receipt.html
  32. 471 0
      protected/view/fee/approval/receipt_compatible.html
  33. 72 0
      protected/view/fee/create/loanDetail.html
  34. 327 466
      protected/view/fee/create/receipt.html
  35. 112 0
      protected/view/fee/menu.html
  36. 77 0
      protected/view/fee/test.html
  37. 39 23
      protected/view/receipt/receiptFee.html

+ 26 - 0
global/css/global.css

@@ -4156,4 +4156,30 @@ td div.dlLev3{
 }
 .hidden{
   display: none !important;
+}
+.saeasideMnav{
+  padding: 20px 20px 0 20px;
+  border-right: 1px solid #ddd;
+  background: #fff;
+}
+.saeaScreen{
+  margin: 0 0 20px 0;
+}
+.saeaScreen span{
+  display: inline-block;
+  padding:5px;
+  background: #ccc;
+}
+.popupTip{
+  position: absolute;
+  top: 0px;
+  z-index: 999;
+  width: 960px;
+  text-align: center;
+}
+.popupTipText{
+  background: #f70000;
+  color: #fff;
+  padding: 5px 10px;
+  border-radius:0 0 5px 5px;
 }

+ 48 - 0
global/vue/fee/fee_receipt_data.js

@@ -0,0 +1,48 @@
+/*
+ * @description: 报销单交互Data
+ * @Author: CP
+ * @Date: 2020-11-14 08:37:31
+ * @FilePath: \cld\global\vue\fee\fee_receipt_data.js
+ */
+let data = {
+    receiptTypeMenu: [
+        {
+            id: 0,
+            name: "办事处相关费用",
+            show: false,
+            anchor: "officeAnchor",
+            active: false,
+            daily: accountItem.daily,
+            other: accountItem.other,
+            officeExplain: [{ officeExplain: "" }],
+        },
+        {
+            id: 1,
+            name: "差旅相关费用",
+            show: false,
+            anchor: "traveAnchor",
+            active: false,
+            trave: accountItem.trave,
+            traveList: [],
+            traveExplain: [{ traveExplain: "" }],
+        },
+        {
+            id: 2,
+            name: "内部培训费用",
+            show: false,
+            anchor: "trainAnchor",
+            train: accountItem.train,
+            active: false,
+            trainExplain: [{ trainExplain: "" }],
+        },
+
+    ],
+    verify: verify,
+    verifyId: '',
+    remittanceBankType:0,
+    enclosurFiles:[],
+
+    
+    aletMsg: '', // 弹出框中的提示语
+    displayStsates: 'none',
+}

+ 90 - 0
global/vue/fee/receipt_create.js

@@ -0,0 +1,90 @@
+/*
+ * @description: 创建报销单
+ * @Author: CP
+ * @Date: 2020-11-13 12:03:08
+ * @FilePath: \cld\global\vue\fee\receipt_create.js
+ */
+new Vue({
+  el: '#receipt_create',
+  data: data,
+  // mounted: function () {
+  //   SetReceiptData(this);
+  // },
+  methods: {
+    // 报销单选择菜单栏
+    selectReceipt: function (event, menu) {
+      // 是否选中
+      selected = event.target.classList.toggle("active");
+      menu.show = !menu.show
+    },
+    // 报销单导航栏
+    navigation: function (receiptTypeMenu, menu) {
+      receiptTypeMenu.forEach(element => {
+        element.active = false;
+      });
+      menu.active = !menu.active;
+    },
+    // 验证费用表单
+    checkReceipt: function (event) {
+     
+      checkReceipt(event, this);
+      // dev 不提交
+      // event.preventDefault();
+    },
+    // 附件上传
+    enclosurFile: function (event) {
+      let form_data = new FormData();
+      let file_data = event.target.files[0];
+      form_data.append("Filename", file_data.name);
+      form_data.append("Filedata", file_data);
+      // let index = this.enclosurFiles.length;
+      let objData = this.enclosurFiles;
+
+      $.ajax({
+        type: "POST",
+        url: "/swfupload",
+        dataType: "json",
+        processData: false,
+        contentType: false,
+        data: form_data
+      }).success(function (msg) {
+        let file = {
+          name: file_data.name,
+          size: toDecimal2(file_data.size / 1024) + 'kb',
+          path: msg.filename
+        }
+        objData.push(file);
+      }).fail(function (msg) {
+        this.alertDia("附件上传失败");
+      });
+
+    },
+    enclosurFileDel(index) {
+      this.enclosurFiles.splice(index, 1)
+    },
+    alertDia(msg) {
+      this.displayStsates = 'block'
+      this.aletMsg = msg
+      // 延迟2秒后消失 自己可以更改时间
+      window.setTimeout(() => {
+        this.displayStsates = 'none'
+      }, 3500)
+    },
+
+  },
+  computed: {
+    receiptPrice: function () {
+      let num = 0.00;
+      if (this.receiptTypeMenu[0].show) {
+        num += Number(officePrice(this.receiptTypeMenu[0]));
+      }
+      if (this.receiptTypeMenu[1].show) {
+        num += Number(travePrice(this.receiptTypeMenu[1].traveList));
+      }
+      if (this.receiptTypeMenu[2].show) {
+        num += Number(trainPrice(this.receiptTypeMenu[2].train));
+      }
+      return num.toFixed(2);
+    }
+  },
+})

+ 186 - 0
global/vue/fee/receipt_create_fn.js

@@ -0,0 +1,186 @@
+/*
+ * @description: 创建报销单业务处理
+ * @Author: CP
+ * @Date: 2020-11-13 15:20:41
+ * @FilePath: \cld\global\vue\fee\receipt_create_fn.js
+ */
+// 验证费用表单
+function checkReceipt(event, obj) {
+  let flag = false;
+  //1.选择办事处费用 
+  if (obj.receiptTypeMenu[0].show) {
+    if (obj.receiptTypeMenu[0].officeExplain[0].officeExplain == "") {
+      obj.alertDia("请填写 办事处相关费用 报销说明");
+      flag = true;
+    }
+  }
+
+   //2.选择办事处费用 
+   if (obj.receiptTypeMenu[2].show) {
+    if (obj.receiptTypeMenu[2].trainExplain[0].trainExplain == "") {
+      obj.alertDia("请填写 内部培训费用 报销说明");
+      flag = true;
+    }
+  }
+
+  // 选择费用类型
+  if (obj.receiptTypeMenu[0].show === false && obj.receiptTypeMenu[1].show === false && obj.receiptTypeMenu[2].show === false) {
+    obj.alertDia("请选择 费用类型");
+    flag = true;
+  }
+
+ 
+
+ 
+
+  // 设置参数
+  // 1.办事处相关费用
+  let officeData_input_dom = obj.$refs.officeData_input;
+  officeData_input_dom.value="";
+  if (obj.receiptTypeMenu[0].show) {
+    officeData_input_dom.value=JSON.stringify(obj.receiptTypeMenu[0]);
+  }
+  // 2.差旅相关费用
+  let traveData_input_dom = obj.$refs.traveData_input;
+  traveData_input_dom.value="";
+  if (obj.receiptTypeMenu[1].show) {
+    
+    traveData_input_dom.value=JSON.stringify(obj.receiptTypeMenu[1]);
+  }
+   // 3.差旅相关费用
+   let trainData_input_dom = obj.$refs.trainData_input;
+   trainData_input_dom.value="";
+   if (obj.receiptTypeMenu[2].show) {
+    trainData_input_dom.value=JSON.stringify(obj.receiptTypeMenu[2]);
+  }
+
+  // 4.附件内容相关
+  let enclosurFiles_input_dom = obj.$refs.enclosurFiles_input;
+  enclosurFiles_input_dom.value="";
+  if(obj.enclosurFiles.length!=0){
+    enclosurFiles_input_dom.value=JSON.stringify(obj.enclosurFiles);
+  }
+
+  // 校验设置后的参数
+  if( obj.verifyId===""){
+    obj.alertDia("请选择 审批组");
+    flag = true;
+  }
+ 
+  if (flag) {
+    event.preventDefault();
+  }
+
+  
+
+  // // 1-2日常费用
+  // let officeDailyData_input_dom = obj.$refs.officeDailyData_input;
+  // // 1-2填写过金额
+  // let daily = [];
+  // obj.receiptTypeMenu[0].daily.forEach(element => {
+  //   if (element.price != 0) {
+  //     daily.push(element);
+  //   }
+  // });
+  // officeDailyData_input_dom.value = JSON.stringify(daily);
+
+  // let officeOtherData_input_dom = obj.$refs.officeOtherData_input;
+  // let other = [];
+  // obj.receiptTypeMenu[0].other.forEach(element => {
+  //   if (element.price != 0) {
+  //     other.push(element);
+  //   }
+  // });
+  // officeOtherData_input_dom.value = JSON.stringify(other);
+  // let officeExplain_input_dom = obj.$refs.officeExplain_input;
+  // officeExplain_input_dom.value = obj.receiptTypeMenu[0].officeExplain[0].officeExplain;
+
+
+  
+
+}
+// 办事处相关费用合计
+function officePrice(obj) {
+  sum = 0;
+  obj.daily.forEach(element => {
+    sum += Number(element.price);
+  });
+  obj.other.forEach(element => {
+    sum += Number(element.price);
+  });
+  return sum.toFixed(2);
+}
+// 差旅相关费用
+function travePrice(obj) {
+  let sum = 0;
+  obj.forEach(element => {
+    element.tripList.forEach(elementlv2 => {
+      elementlv2.tripItem.forEach(elementlv3 => {
+        sum += Number(elementlv3.price);
+      });
+    });
+  });
+  return sum.toFixed(2);
+}
+// 内部培训费用
+function trainPrice(obj) {
+  let sum = 0;
+  obj.forEach(element => {
+    sum += Number(element.price);
+  });
+  return sum.toFixed(2);
+}
+
+// 
+function NewTraveItem() {
+  let newTripItem = new Array();
+  accountItem.trave.forEach(element => {
+    newTripItem.push({
+      "name": element.name,
+      "price": 0.00,
+      "remark": "",
+    });
+  });
+  return newTripItem;
+}
+
+function toDecimal2(x) {
+  var f = parseFloat(x);
+  if (isNaN(f)) {
+    return false;
+  }
+  var f = Math.round(x * 100) / 100;
+  var s = f.toString();
+  var rs = s.indexOf('.');
+  if (rs < 0) {
+    rs = s.length;
+    s += '.';
+  }
+  while (s.length <= rs + 2) {
+    s += '0';
+  }
+  return s;
+}
+
+function delEnclosurByKey(id){
+	
+	var url = "/ajaxRemEnclousur";
+	$.ajax({
+		url : url,
+		type : "post",
+		cache : false,
+		dataType : "json",
+		data : {
+			key : id
+		},
+		global : true,
+		success : function(data) {
+			
+			if (data.status == 1) {
+				$('#'+id).remove(); 
+			} 
+		},
+		error : function(err) {
+		}
+	});
+}

+ 91 - 0
global/vue/fee/receipt_office_component.js

@@ -0,0 +1,91 @@
+/*
+ * @description: 费用-办事处相关组件
+ * @Author: CP
+ * @Date: 2020-11-16 14:52:08
+ * @FilePath: \cld\global\vue\fee\receipt_office_component.js
+ */
+
+Vue.component("office", {
+    props:['daily','other','officeExplain'],
+    computed: {
+        officePrice: function () {
+            return officePrice(this);
+        },
+        dailyTotal:function(){
+            let sum = 0;
+            this.daily.forEach(element => {
+                sum += Number(element.price);
+            });
+            return sum.toFixed(2);
+        },
+        otherTotal:function(){
+            let sum = 0;
+            this.other.forEach(element => {
+                sum += Number(element.price);
+            });
+            return sum.toFixed(2);
+        },
+    },
+    template:
+        `
+<div>
+    <div class="seTable">
+        <table class="table table-bordered table-condensed table-hover mb-0">
+            <tbody>
+                <tr>
+                    <th colspan="2" class="taC">办事处相关费用</th>
+                </tr>
+                <tr v-for="item in daily" >
+                    <th>{{ item.name }}</th>
+                    <td width="200" class="taR">¥<input type="number" v-model="item.price"  pattern="[0-9]" step="0.01"
+                             min="0" class="span2"></td>
+                </tr>
+                <tr>
+                    <th class="taR">小计</th>
+                    <td class="colGreen taR">¥{{ dailyTotal }}</td>
+                </tr>
+
+                <tr>
+                    <th colspan="2" class="taC">其他</th>
+                </tr>
+                <tr v-for="item in other">
+                    <th>{{ item.name }}</th>
+                    <td width="200" class="taR">¥<input type="number" v-model="item.price"  pattern="[0-9]" step="0.01"
+                             min="0" class="span2"></td>
+                </tr>
+                <tr>
+                    <th class="taR">小计</th>
+                    <td class="colGreen taR">¥{{ otherTotal }}</td>
+                </tr>
+                <tr class="warning">
+                    <td class="taR"><b>办事处相关费用合计</b></td>
+                    <td class="colGreed taR"><b style="font-size: 24px">¥{{ officePrice }}</b></td>
+                </tr>
+                <tr>
+                    <th colspan="2" class="taC">报销说明</th>
+                </tr>
+                <tr>
+                    <th colspan="2" v-for="item in officeExplain">
+                    <textarea required rows="6" style="width: 99%"  v-model="item.officeExplain" placeholder="办事处相关费用说明">
+                    </textarea>
+                    </th>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+    <div class="seCensor receipt-censor">
+        <div class="title">报销单填写说明</div>
+        <div class="detail">
+            <p>1 办事处水电费标准100元,标准内实报;</p>
+            <p>
+                2 <b>产生费用所在办事处</b> 默认使用您所在的第一个办事处;
+            </p>
+            <p>
+                3 邮寄费、公关费、办公费等详细说明请填写到 <b>报销说明</b>。
+            </p>
+        </div>
+    </div>
+</div>
+    `
+})
+

+ 63 - 0
global/vue/fee/receipt_train_component.js

@@ -0,0 +1,63 @@
+/*
+ * @description: 费用-内部培训组件
+ * @Author: CP
+ * @Date: 2020-11-26 15:12:47
+ * @FilePath: \cld\global\vue\fee\receipt_train_component.js
+ */
+
+Vue.component("train", {
+    props: ['train','trainExplain'],
+    computed: {
+        trainTotal: function () {
+            return trainPrice(this.train);
+        }
+    },
+    template:
+        `
+<div>
+ 
+<div class="seTable">
+    <table class="table table-bordered table-condensed table-hover mb-0">
+        <tbody>
+            <tr>
+                <th colspan="2" class="taC" id="neibupeixun">内部培训费用</th>
+            </tr>
+
+            <tr v-for="item in train" >
+                <th>{{ item.name }}</th>
+                <td width="200" class="taR">¥<input type="number" v-model="item.price"  pattern="[0-9]" step="0.01"
+                        min="0" class="span2"></td>
+            </tr>
+            
+            
+            <tr>
+                <th class="taR">合计</th>
+                <td class="colGreen taR">¥{{ trainTotal }}</td>
+            </tr>
+            <tr class="warning">
+                <td class="taR"><b>内部培训费用合计</b></td>
+                <td class="colGreed taR"><b style="font-size: 24px">¥{{ trainTotal }}</b>
+                </td>
+            </tr>
+            <tr>
+                <th colspan="2" class="taC">报销说明</th>
+            </tr>
+            <tr>
+                <th colspan="2" v-for="item in trainExplain" >
+                <textarea required rows="6" style="width: 99%" v-model="item.trainExplain" placeholder="内部培训费用说明"></textarea>
+                </th>
+            </tr>
+        </tbody>
+    </table>
+</div>
+<div class="seCensor receipt-censor">
+    <div class="title">报销单填写说明</div>
+    <div class="detail">
+        <p>1 此项费用,仅用于纵横内部培训;</p>
+        <p>2 用于客户的培训费用,请创建“培训班结算”。</p>
+    </div>
+</div>
+
+</div>
+    `
+})

+ 494 - 0
global/vue/fee/receipt_trave_component.js

@@ -0,0 +1,494 @@
+/*
+ * @description: 费用-差旅组件
+ * @Author: CP
+ * @Date: 2020-11-16 14:52:08
+ * @FilePath: \cld\global\vue\fee\receipt_trave_component.js
+ */
+
+Vue.component("trave", {
+    data: function () {
+        return {
+            // 行程时间
+            tripTime: "",
+
+            regionOption: region,
+            regionLeve2Option: region[0].child,
+            arrivalLeve2Option: region[0].child,
+
+            // 出发地 省 市
+            departureProvince: region[0].name,
+            departureCity: region[0].child[0].name,
+            // 结束地 省 市
+            arrivalProvince: region[0].name,
+            arrivalCity: region[0].child[0].name,
+            // 目的地数组
+            arrivalList: [],
+
+            tripTimeEdi: "",
+            departureProvinceEdi: '',
+            departureCityEdi: '',
+            arrivalProvinceEdi: '',
+            arrivalCityEdi: '',
+            ediIndex: '',
+            // arrivalListEdi: [],
+        }
+    },
+    props: ['traveItem', 'alertDia', 'traveList','traveExplain'],
+    computed: {
+        travePrice: function () {
+            return travePrice(this.traveList);
+            // let sum = 0;
+            // this.traveList.forEach(element => {
+            //     element.tripList.forEach(elementlv2 => {
+            //         elementlv2.tripItem.forEach(elementlv3 => {
+            //             sum += Number(elementlv3.price);
+            //         });
+            //     });
+            // });
+            // return sum.toFixed(2);
+        }
+    },
+    methods: {
+        changeCount: function (event) {
+            this.tripTime = event.target.value;
+        },
+        changeRegionLeve2: function (event, model) {
+            this.regionOption.forEach(element => {
+                if (element.name == event.target.value) {
+                    if (model == "departureCity") {
+                        this.regionLeve2Option = element.child;
+                        this.departureCity = element.child[0].name;
+                    } else if (model == "arrivalCity") {
+                        this.arrivalLeve2Option = element.child;
+                        this.arrivalCity = element.child[0].name;
+                    }
+                    return
+                }
+            });
+        },
+        // 行程单相关
+        // 打开行程单
+        openTrip: function () {
+            this.arrivalList = [];
+            this.tripTime = "";
+        },
+        deleteTrip(index) {
+            this.traveList.splice(index, 1)
+        },
+        addTrip: function () {
+            if (this.tripTime == "") {
+                this.alertDia("请选择行程时间");
+                return
+            }
+            // 构建行程信息
+            tripList = [];
+            // 出发地
+            var newTripItem = NewTraveItem();
+            tripList.push({
+                province: this.departureProvince,
+                city: this.departureCity,
+                tripItem: newTripItem,
+                subtotal: 0,
+            });
+            // 目的地
+            this.arrivalList.forEach(element => {
+                var newTripItem = NewTraveItem();
+                tripList.push({
+                    province: element.arrivalProvince,
+                    city: element.arrivalCity,
+                    tripItem: newTripItem,
+                    subtotal: 0,
+                });
+            });
+            // 结束地
+            var newTripItem = NewTraveItem();
+            tripList.push({
+                province: this.arrivalProvince,
+                city: this.arrivalCity,
+                tripItem: newTripItem,
+                subtotal: 0.00,
+            });
+            // 构建差旅信息
+            trave = {
+                tripTime: this.tripTime,
+                tripList: tripList,
+                total: 0.00,
+            };
+            this.traveList.push(trave);
+            $('#route-add').modal('hide')
+        },
+        openEdiTrip(index) {
+            this.ediIndex = index;
+            let tripData = this.traveList[index];
+            this.tripTimeEdi = tripData.tripTime;
+            // 出发地
+            this.departureProvinceEdi = tripData.tripList[0].province;
+            this.departureCityEdi = tripData.tripList[0].city;
+            // 结束
+            let endIndex = tripData.tripList.length - 1
+            this.arrivalProvinceEdi = tripData.tripList[endIndex].province;
+            this.arrivalCityEdi = tripData.tripList[endIndex].city;
+            // 目的地
+            this.arrivalList = [];
+            tripData.tripList.forEach((element, index) => {
+                // 获得目的城市下拉菜单
+                let arrivalCityOption = [];
+                this.regionOption.forEach(el => {
+                    if (el.name == element.province) {
+                        arrivalCityOption = el.child;
+                        return
+                    }
+                });
+                if (index !== 0 && index !== endIndex) {
+                    this.arrivalList.push({
+                        "arrivalProvince": element.province,
+                        "arrivalCity": element.city,
+                        "arrivalCityOption": arrivalCityOption
+                    });
+                }
+            });
+        },
+        ediTrip() {
+            if (this.tripTime == "") {
+                this.alertDia("请选择行程时间");
+                return
+            }
+            // 构建行程信息
+            tripList = [];
+            // 出发地
+            var newTripItem = NewTraveItem();
+            tripList.push({
+                province: this.departureProvinceEdi,
+                city: this.departureCityEdi,
+                tripItem: newTripItem,
+                subtotal: 0,
+            });
+            // 目的地
+            this.arrivalList.forEach(element => {
+                var newTripItem = NewTraveItem();
+                tripList.push({
+                    province: element.arrivalProvince,
+                    city: element.arrivalCity,
+                    tripItem: newTripItem,
+                    subtotal: 0,
+                });
+            });
+            // 结束地
+            var newTripItem = NewTraveItem();
+            tripList.push({
+                province: this.arrivalProvinceEdi,
+                city: this.arrivalCityEdi,
+                tripItem: newTripItem,
+                subtotal: 0.00,
+            });
+            // 构建差旅信息
+            trave = {
+                tripTime: this.tripTime,
+                tripList: tripList,
+                total: 0.00,
+            };
+
+            this.traveList[this.ediIndex] = trave;
+
+            // 更新完成
+            this.ediIndex = '';
+            this.tripTimeEdi = '';
+            this.departureProvinceEdi = '';
+            this.departureCityEdi = '';
+            this.arrivalProvinceEdi = '';
+            this.arrivalCityEdi = '';
+            this.arrivalList = [];
+            $('#route-edi').modal('hide')
+        },
+        addArrivalDom: function () {
+            dom = {
+                "arrivalProvince": region[0].name,
+                "arrivalCity": region[0].child[0].name,
+                "arrivalCityOption": region[0].child,
+            }
+            this.arrivalList.push(dom);
+        },
+        delArrivalDom: function (index) {
+            this.arrivalList.splice(index, 1)
+        },
+        changeArrivalLeve2: function (event, index) {
+            this.regionOption.forEach(element => {
+                if (element.name == event.target.value) {
+                    this.arrivalList[index].arrivalCityOption = element.child;
+                    this.arrivalList[index].arrivalCity = element.child[0].name;
+                    return
+                }
+            });
+        },
+        computeTraveItem: function (event) {
+            this.traveItem.forEach((element, index) => {
+                let sum = 0;
+                // 每一列求和
+                this.traveList.forEach(el => {
+                    el.tripList.forEach(elementlv2 => {
+                        elementlv2.tripItem.forEach(elementlv3 => {
+                            if (element.name == elementlv3.name) {
+                                sum += Number(elementlv3.price);
+                            }
+                        });
+                    });
+                });
+                this.traveItem[index].price = sum.toFixed(2);
+            });
+            // 每一个小目的地合计
+            this.traveList.forEach((el, index) => {
+                let total = 0;
+                el.tripList.forEach((elementlv2, indexlv2) => {
+                    let sum = 0;
+                    elementlv2.tripItem.forEach(elementlv3 => {
+                        sum += Number(elementlv3.price);
+                    });
+                    total += sum
+                    this.traveList[index].tripList[indexlv2].subtotal = sum.toFixed(2);
+                });
+                this.traveList[index].total = total.toFixed(2);
+            });
+        },
+    },
+    template:
+        `
+<div>
+<div class="seTable">
+<table class="table table-bordered table-condensed mb-0">
+    <tbody>
+        <tr>
+            <th colspan="2" class="taC">差旅相关费用</th>
+        </tr>
+        <tr>
+            <td colspan="2">
+                <!--行程1-->
+                <table v-for="(trave,index) in traveList" class="table table-bordered table-condensed table-hover"
+                    style="margin-bottom: 5px;">
+                    <tr>
+                        <th colspan="3" class="taC">行程{{ index+1 }}#
+                            {{ trave.tripTime }}
+                            <div class="fR ">
+                                <a href="javascript:void(0)" @click="deleteTrip(index)" class="text-danger" data-toggle="modal">删除</a>
+                                <a href="#route-edi" @click="openEdiTrip(index)" data-toggle="modal">编辑</a>
+                                </div>
+                        </th>
+                    </tr>
+
+                    <tbody v-for="(trip,i) in trave.tripList">
+                    <tr>
+                        <th colspan="3" class="ta"><i class="contactsMark icon-">P</i> {{trip.province}}-{{trip.city}}</th>
+                    </tr>
+                    <tr v-for="item in trip.tripItem" v-if="i!==trave.tripList.length-1" >
+                        <th width="90">{{item.name}}</th>
+                        <td class="taR" width="100">
+                            ¥<input type="number" v-model="item.price" @input="computeTraveItem"  pattern="[0-9]" step="0.01" min="0" class="span1">
+                        </td>
+                        <th>
+                        <textarea required v-model="item.remark" rows="2" style="width: 99%; margin-bottom: 0" ></textarea>
+                        </th>
+                    </tr>
+                    </tbody>
+
+                </table>
+            </td>
+        </tr>
+        <tr>
+            <th colspan="2" class="taC"><a href="#route-add" @click="openTrip" data-toggle="modal"
+                    class="button">添加新行程</a></th>
+        </tr>
+        <tr>
+            <th colspan="2" class="taC">差旅相关费用合计</th>
+        </tr>
+
+        <tr v-for="item in traveItem" >
+            <th>{{ item.name }}</th>
+            <td class="taR" width="200">¥{{ item.price }}</td>
+        </tr>
+        
+        <tr class="warning">
+            <td class="taR"><b>差旅相关费用合计</b></td>
+            <td class="colGreed taR"><b style="font-size: 24px">¥{{travePrice}}</b></td>
+        </tr>
+        <tr>
+            <th colspan="2" class="taC">报销说明</th>
+        </tr>
+        <tr>
+            <th colspan="2" v-for="item in traveExplain"  >
+            <textarea required rows="6" style="width: 99%" v-model="item.traveExplain" placeholder="差旅相关费用额外说明"></textarea>
+            </th>
+        </tr>
+    </tbody>
+</table>
+</div>
+<div class="seCensor receipt-censor">
+<div class="title">报销单填写说明</div>
+<div class="detail">
+    <p>1
+        请按先后发生顺序填写报销明细,交通费(市内交通费及往来交通费)、邮寄费需在批注明注明费用明细(例:珠海-广州70元-佛山20元);</p>
+    <p>2 出差补助30元/天,不需提供发票,只需在报销单上填写清楚;</p>
+    <p>
+        3 <b>产生费用所在办事处</b> 默认使用您所在的第一个办事处。
+    </p>
+</div>
+<div class="itinerary">
+    <h2 class="itineraryTitle">总行程单</h2>
+    <div class="itineraryCon">
+        <ul v-for="(trave,index) in traveList" >
+            <li class="sub-title">行程{{ index+1 }}# {{ trave.tripTime }}</li>
+            <li v-for="(trip,i) in trave.tripList" >
+                <div class="itineraryList">
+                    <div class="addressName">
+                        <i class="contactsMark icon-">P</i> <b>{{trip.city}}</b>
+                    </div>
+                    <div class="pointLine " v-if="i!==trave.tripList.length-1" >
+                        <div class="timeList">
+                            <div class="priceList">
+                                <span class="priceTitle">小计</span> 
+                                <span class="price">¥{{ trip.subtotal }}</span>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </li>
+            <li class="sub-title">行程{{ index+1 }}# 合计:{{ trave.total }}</li>
+        </ul>
+    </div>
+</div>
+</div>
+
+
+<!--弹出 编辑行程 -->
+<div class="modal hide fade" id="route-edi">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h3>编辑行程</h3>
+            </div>
+            <div class="modal-body saeaList">
+                <table class="table table-bordered table-condensed">
+                    <tr>
+                        <th class="taC" colspan="2">行程</th>
+                    </tr>
+                    <tr>
+                        <th>出发/结束日期</th>
+                        <td><input class="datepicker-here span3" placeholder="按时间筛选" type="text" data-range="true"
+                                data-multiple-dates-separator=" - " data-language="zh" @blur.prevent="changeCount" v-model="tripTimeEdi" ></td>
+                    </tr>
+                    <tr>
+                        <th><span>┌</span> 出发地</th>
+                        <td>
+                            <select v-model="departureProvinceEdi" @change="changeRegionLeve2($event,'departureCity')" >
+                                    <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
+                            </select>
+                            <select v-model="departureCityEdi">
+                                <option v-for="option in regionLeve2Option">{{option.name}}</option>
+                            </select>
+                            <a href="javascript:void(0)" @click="addArrivalDom" >+添加目的地</a>
+                        </td>
+                    </tr>
+
+                    
+                    <tr v-for="(item,index) in arrivalList" >
+                        <th><span class="">├</span> 目的地</th>
+                        <td>
+                            <select v-model="item.arrivalProvince" @change="changeArrivalLeve2($event,index)" >
+                                <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
+                            </select>
+                            <select  v-model="item.arrivalCity">
+                                <option v-for="option in item.arrivalCityOption">{{option.name}}</option>
+                            </select> <a href="javascript:void(0)" @click="delArrivalDom(index)">-移除</a>
+                        </td>
+                    </tr>
+
+                    
+                    <tr>
+                        <th><span class="">└</span> 结束</th>
+                        <td>
+                            <select v-model="arrivalProvinceEdi" @change="changeRegionLeve2($event,'arrivalCity')" >
+                                <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
+                            </select>
+                            <select v-model="arrivalCityEdi">
+                                <option v-for="option in arrivalLeve2Option">{{option.name}}</option>
+                            </select>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+            <div class="modal-footer">
+                <a href="javascript:void(0)" class="button" @click="ediTrip" >确认</a>
+                <a href="javascript:void(0)" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+            </div>
+        </div>
+    </div>
+</div>
+
+<!--弹出 添加行程 -->
+<div class="modal hide fade" id="route-add">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h3>添加行程</h3>
+            </div>
+            <div class="modal-body saeaList">
+                <table class="table table-bordered table-condensed">
+                    <tr>
+                        <th class="taC" colspan="2">行程</th>
+                    </tr>
+                    <tr>
+                        <th>出发/结束日期</th>
+                        <td><input class="datepicker-here span3" placeholder="按时间筛选" type="text" data-range="true"
+                                data-multiple-dates-separator=" - " data-language="zh" @blur.prevent="changeCount" v-model="tripTime" ></td>
+                    </tr>
+                    <tr>
+                        <th><span>┌</span> 出发地</th>
+                        <td>
+                            <select v-model="departureProvince" @change="changeRegionLeve2($event,'departureCity')" >
+                                    <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
+                            </select>
+                            <select v-model="departureCity">
+                                <option v-for="option in regionLeve2Option">{{option.name}}</option>
+                            </select>
+                            <a href="javascript:void(0)" @click="addArrivalDom" >+添加目的地</a>
+                        </td>
+                    </tr>
+
+                    
+                    <tr  v-for="(item,index) in arrivalList" >
+                        <th><span class="">├</span> 目的地</th>
+                        <td>
+                            <select v-model="item.arrivalProvince" @change="changeArrivalLeve2($event,index)" >
+                                <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
+                            </select>
+                            <select  v-model="item.arrivalCity">
+                                <option v-for="option in item.arrivalCityOption">{{option.name}}</option>
+                            </select> <a href="javascript:void(0)" @click="delArrivalDom(index)">-移除</a>
+                        </td>
+                    </tr>
+
+                    
+                    <tr>
+                        <th><span class="">└</span> 结束</th>
+                        <td>
+                            <select v-model="arrivalProvince" @change="changeRegionLeve2($event,'arrivalCity')" >
+                                <option v-for="option in regionOption" :value="option.name" >{{option.name}}</option>
+                            </select>
+                            <select v-model="arrivalCity">
+                                <option v-for="option in arrivalLeve2Option">{{option.name}}</option>
+                            </select>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+            <div class="modal-footer">
+                <a href="javascript:void(0)" class="button" @click="addTrip" >确认</a>
+                <a href="javascript:void(0)" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+            </div>
+        </div>
+    </div>
+</div>
+<!--结束 弹出 添加行程 -->
+
+</div>
+    `
+})
+

文件差异内容过多而无法显示
+ 11965 - 0
global/vue/vue.js


文件差异内容过多而无法显示
+ 6 - 0
global/vue/vue.min.js


+ 175 - 0
protected/class/comm_cld.php

@@ -0,0 +1,175 @@
+<?php
+
+/**
+ * 获取get或者POST值
+ *
+ * @param string $name 属性名称
+ * @return fixed 值
+ */
+function get_args($name) {
+	if (isset ( $_GET [$name] )) {
+		return $_GET [$name];
+	} elseif (isset ( $_POST [$name] )) {
+		return $_POST [$name];
+	} else
+		return '';
+}
+
+
+function GetDecryptId($id){
+	Doo::loadClass ( 'XDeode' );
+	$XDeode = new XDeode ( 9 );
+	
+	$id=$XDeode->decode($id);
+	if (!is_numeric($id)){
+		die ( 'illegal request-参数解析错误' );
+	}
+	return $id;
+}
+
+function makeReceiptDataVersion1($receiptList){
+	//办事处费用
+	$receiptList[0]['officeJson']=json_decode($receiptList[0]['officeJson'],true);
+	if (!empty($receiptList[0]['officeJson'])){
+		$receiptList[0]['officeExplain']="<pre>".$receiptList[0]['officeJson']['officeExplain'][0]['officeExplain']."</pre>";
+		$total=0;
+		foreach ($receiptList[0]['officeJson']['daily'] as $value){
+			$total=bcadd($total,$value['price'],2);
+		}
+		$receiptList[0]['dailyTotal']=$total;
+		$total=0;
+		foreach ($receiptList[0]['officeJson']['other'] as $value){
+			$total=bcadd($total,$value['price'],2);
+		}
+		$receiptList[0]['otherTotal']=$total;
+	
+		$receiptList[0]['officeTotal']=bcadd($receiptList[0]['otherTotal'],$receiptList[0]['dailyTotal'],2);
+	}
+		
+	//差旅费用
+	$traveJson=json_decode($receiptList[0]['traveJson'],true);
+	$receiptList[0]['traveJson']=$traveJson;
+		
+	if (!empty($receiptList[0]['traveJson'])){
+		$receiptList[0]['traveExplain']="<pre>".$receiptList[0]['traveJson']['traveExplain'][0]['traveExplain']."</pre>";
+		$total=0;
+		foreach ($traveJson['traveList'] as $key=>$value){
+			$receiptList[0]['traveJson']['traveList'][$key]['index']=$key+1;
+			$detailCity='';
+			$tripTotal=0;
+			$tripItem=array();
+			//1.行程list
+			foreach ($value['tripList'] as $k=>$v){
+				//2.组合各个城市
+				$detailCity.=$v['city'].' ';
+				//3.组合列详情
+				foreach ($v['tripItem'] as $tk=>$tv){
+					if (!isset($tripItem[$tv['name']])){
+						$tripItem[$tv['name']]=0;
+					}
+					$tripItem[$tv['name']]=bcadd($tripItem[$tv['name']],$tv['price'],2);
+					//3.行程金额小计
+					$tripTotal=bcadd($tripTotal,$tv['price'],2);
+				}
+	
+				$count=count($value['tripList'])-1;
+				if($count>$k){
+					$index=$k+1;
+					$receiptList[0]['traveJson']['traveList'][$key]['tripList'][$k]['goCome']=$v['city'].'-'.$value['tripList'][$index]['city'];
+				}
+				$total=bcadd($total,$v['subtotal'],2);
+	
+			}
+			$receiptList[0]['traveJson']['traveList'][$key]['detailCity']=$detailCity;
+			$receiptList[0]['traveJson']['traveList'][$key]['detailTrip']=$tripItem;
+			$receiptList[0]['traveJson']['traveList'][$key]['tripTotal']=$tripTotal;
+				
+		}
+		$receiptList[0]['traveTotal']=$total;
+		//print_r($receiptList[0]['traveJson']);
+	}
+		
+	//内训费用
+	$receiptList[0]['trainJson']=json_decode($receiptList[0]['trainJson'],true);
+	if (!empty($receiptList[0]['trainJson'])){
+		$receiptList[0]['trainExplain']="<pre>".$receiptList[0]['trainJson']['trainExplain'][0]['trainExplain']."</pre>";
+		$total=0;
+		foreach ($receiptList[0]['trainJson']['train'] as $value){
+			$total=bcadd($total,$value['price'],2);
+		}
+		$receiptList[0]['trainTotal']=$total;
+	}
+	return $receiptList;
+}
+
+function num_to_rmb($num) {
+	$c1 = "零壹贰叁肆伍陆柒捌玖";
+	$c2 = "分角元拾佰仟万拾佰仟亿";
+	// 精确到分后面就不要了,所以只留两个小数位
+	$num = round ( $num, 2 );
+	// 将数字转化为整数
+	$num = $num * 100;
+	if (strlen ( $num ) > 10) {
+		return "金额太大,请检查";
+	}
+	$i = 0;
+	$c = "";
+	while ( 1 ) {
+		if ($i == 0) {
+			// 获取最后一位数字
+			$n = substr ( $num, strlen ( $num ) - 1, 1 );
+		} else {
+			$n = $num % 10;
+		}
+		// 每次将最后一位数字转化为中文
+		$p1 = substr ( $c1, 3 * $n, 3 );
+		$p2 = substr ( $c2, 3 * $i, 3 );
+			
+		if ($n != '0' || ($n == '0' && ($p2 == '亿' || $p2 == '万' || $p2 == '元'))) {
+			$c = $p1 . $p2 . $c;
+		} else {
+			$c = $p1 . $c;
+		}
+		$i = $i + 1;
+		// 去掉数字最后一位了
+			
+		$num = $num / 10;
+		// echo $num.'</br>';
+		$num = ( int ) $num;
+		// $num =floor($num);
+		// $num = round ( $num, 0, PHP_ROUND_HALF_DOWN );
+		// echo $num.'</br>';
+		// 结束循环
+		if ($num == 0) {
+			break;
+		}
+	}
+	// echo $c.'</br>';
+	$j = 0;
+	$slen = strlen ( $c );
+	while ( $j < $slen ) {
+		// utf8一个汉字相当3个字符
+		$m = substr ( $c, $j, 6 );
+		// 处理数字中很多0的情况,每次循环去掉一个汉字“零”
+		if ($m == '零元' || $m == '零万' || $m == '零亿' || $m == '零零') {
+			$left = substr ( $c, 0, $j );
+			$right = substr ( $c, $j + 3 );
+			$c = $left . $right;
+			$j = $j - 3;
+			$slen = $slen - 3;
+		}
+		$j = $j + 3;
+	}
+	// 这个是为了去掉类似23.0中最后一个“零”字
+	if (substr ( $c, strlen ( $c ) - 3, 3 ) == '零') {
+		$c = substr ( $c, 0, strlen ( $c ) - 3 );
+	}
+	// 将处理的汉字加上“整”
+	if (empty ( $c )) {
+		return "零元整";
+	} else {
+		return $c . "整";
+	}
+}
+
+?>

+ 6 - 0
protected/config/acl.conf.php

@@ -385,6 +385,12 @@ $acl ['EMAIL'] ['allow'] = array (
 $acl ['RECEIPTS'] ['allow'] = array (
 		'fee_controller' => array (
 				'GetViewReceiptCreate',
+				'GetViewReceiptEdit',
+				'PostReceiptCreate',
+				'PostReceiptEdit',
+				'GetViewLoanReceiptCreate',
+				'PostLoanReceiptEdit',
+				'GetViewReceiptApproval',
 		),
 		'ReceiptController' => array (
 				'saeaBorad',

+ 1 - 0
protected/config/js.edition.conf.php

@@ -18,4 +18,5 @@ define ( "invoiceValidator", WEB_SITE_GLOBAL.'js/invoice.validator.js?1.02' );
 
 define ( "autoTag", WEB_SITE_GLOBAL.'js/autoTag.js?1' );
 define ( "email", WEB_SITE_GLOBAL.'js/email.js?1' );
+define ( "vue", WEB_SITE_GLOBAL.'vue/vue.js' );
 ?>

+ 10 - 0
protected/config/routes_receipt.php

@@ -2,5 +2,15 @@
 
 //申请报销单相关 
 $route['get']['/view/receipt/create'] = array('fee/fee_controller', 'GetViewReceiptCreate');
+$route['get']['/view/receipt/edit/:receiptId'] = array('fee/fee_controller', 'GetViewReceiptEdit','extension'=>'.html');
+$route['get']['/view/loan/receipt/add/:receiptId'] = array('fee/fee_controller', 'GetViewLoanReceiptCreate','extension'=>'.html');
+$route['get']['/view/loan/receipt/edi/:receiptId'] = array('fee/fee_controller', 'GetViewLoanReceiptCreate','extension'=>'.html');
+$route['get']['/view/receipt/approval/:receiptId'] = array('fee/fee_controller', 'GetViewReceiptApproval','extension'=>'.html');
+
+
+$route['post']['/receipt/create'] = array('fee/fee_controller', 'PostReceiptCreate');
+$route['post']['/receipt/edit'] = array('fee/fee_controller', 'PostReceiptEdit');
+$route['post']['/loan/receipt/edit'] = array('fee/fee_controller', 'PostLoanReceiptEdit');
+
 
 ?>

+ 104 - 1
protected/controller/ReceiptController.php

@@ -206,6 +206,7 @@ class ReceiptController extends DooController {
 		
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 7 );
+		$XDeode9 = new XDeode ( 9 );
 		
 		$receiptLogList = $receiptLog->getReceiptLogByUid ( $this->staff [0] ['sid'] );
 		
@@ -216,6 +217,9 @@ class ReceiptController extends DooController {
 		) );
 		
 		foreach ( $receiptDetail as $key => $value ) {
+			
+			$receiptDetail [$key] ['receiptId'] = $XDeode9->encode ( $value ['rid'] );
+			
 			$receiptDetail [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
 			$receiptDetail [$key] ['accountItem'] = json_decode ( $value ['accountItem'], true );
 			
@@ -5293,12 +5297,13 @@ class ReceiptController extends DooController {
 		
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 7 );
-		
+		$XDeode9 = new XDeode ( 9 );
 		$Locate = 0;
 		//
 		$reportList = $reportCateList = array ();
 		foreach ( $receiptList as $key => $value ) {
 			
+			$receiptList [$key] ['rid_cld'] = $XDeode9->encode ( $value ['rid'] );
 			$receiptList [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] );
 			
 			$receiptList [$key] ['Locate'] = $Locate;
@@ -7227,6 +7232,14 @@ class ReceiptController extends DooController {
 		$data['inputDate']=date ( "Y-m-d H:i:s" );
 		//print_r($wbDetail);
 		
+		
+		if($receiptList[0]['version']==1){
+			require "protected/class/comm_cld.php";
+			$receiptList=makeReceiptDataVersion1($receiptList);
+		}
+		
+		
+		
 		$data ['receiptList'] = $receiptList;
 		$data ['memu'] = "receipt";
 		$data ['staff'] = $this->staff;
@@ -7901,6 +7914,89 @@ class ReceiptController extends DooController {
 		
 		$receiptList[0]['itinerary']=str_replace('\n','<br/>',$receiptList[0]['itinerary']);
 	
+		
+		
+		if($receiptList[0]['version']==1){
+			require "protected/class/comm_cld.php";
+			$receiptList=makeReceiptDataVersion1($receiptList);
+			
+// 			//办事处费用
+// 			$receiptList[0]['officeJson']=json_decode($receiptList[0]['officeJson'],true);
+// 			if (!empty($receiptList[0]['officeJson'])){
+// 				$receiptList[0]['officeExplain']="<pre>".$receiptList[0]['officeJson']['officeExplain'][0]['officeExplain']."</pre>";
+// 				$total=0;
+// 				foreach ($receiptList[0]['officeJson']['daily'] as $value){
+// 					$total=bcadd($total,$value['price'],2);
+// 				}
+// 				$receiptList[0]['dailyTotal']=$total;
+// 				$total=0;
+// 				foreach ($receiptList[0]['officeJson']['other'] as $value){
+// 					$total=bcadd($total,$value['price'],2);
+// 				}
+// 				$receiptList[0]['otherTotal']=$total;
+				
+// 				$receiptList[0]['officeTotal']=bcadd($receiptList[0]['otherTotal'],$receiptList[0]['dailyTotal'],2);
+// 			}
+			
+// 			//差旅费用
+// 			$traveJson=json_decode($receiptList[0]['traveJson'],true);
+// 			$receiptList[0]['traveJson']=$traveJson;
+			
+// 			if (!empty($receiptList[0]['traveJson'])){
+// 				$receiptList[0]['traveExplain']="<pre>".$receiptList[0]['traveJson']['traveExplain'][0]['traveExplain']."</pre>";
+// 				$total=0;
+// 				foreach ($traveJson['traveList'] as $key=>$value){
+// 					$receiptList[0]['traveJson']['traveList'][$key]['index']=$key+1;
+// 					$detailCity='';
+// 					$tripTotal=0;
+// 					$tripItem=array();
+// 					//1.行程list
+// 					foreach ($value['tripList'] as $k=>$v){
+// 						//2.组合各个城市
+// 						$detailCity.=$v['city'].' ';
+// 						//3.组合列详情
+// 						foreach ($v['tripItem'] as $tk=>$tv){
+// 							if (!isset($tripItem[$tv['name']])){
+// 								$tripItem[$tv['name']]=0;
+// 							}
+// 							$tripItem[$tv['name']]=bcadd($tripItem[$tv['name']],$tv['price'],2);
+// 							//3.行程金额小计
+// 							$tripTotal=bcadd($tripTotal,$tv['price'],2);
+// 						}
+						
+// 						$count=count($value['tripList'])-1;
+// 						if($count>$k){
+// 							$index=$k+1;
+// 							$receiptList[0]['traveJson']['traveList'][$key]['tripList'][$k]['goCome']=$v['city'].'-'.$value['tripList'][$index]['city'];
+// 						}
+// 						$total=bcadd($total,$v['subtotal'],2);
+						
+// 					}
+// 					$receiptList[0]['traveJson']['traveList'][$key]['detailCity']=$detailCity;
+// 					$receiptList[0]['traveJson']['traveList'][$key]['detailTrip']=$tripItem;
+// 					$receiptList[0]['traveJson']['traveList'][$key]['tripTotal']=$tripTotal;
+					
+// 				}
+// 				$receiptList[0]['traveTotal']=$total;
+// 				//print_r($receiptList[0]['traveJson']);
+// 			}
+			
+// 			//内训费用
+// 			$receiptList[0]['trainJson']=json_decode($receiptList[0]['trainJson'],true);
+// 			if (!empty($receiptList[0]['trainJson'])){
+// 				$receiptList[0]['trainExplain']="<pre>".$receiptList[0]['trainJson']['trainExplain'][0]['trainExplain']."</pre>";	
+// 				$total=0;
+// 				foreach ($receiptList[0]['trainJson']['train'] as $value){
+// 					$total=bcadd($total,$value['price'],2);
+// 				}
+// 				$receiptList[0]['trainTotal']=$total;
+// 			}
+			
+			
+			
+		}
+		
+		
 		$data ['rid'] = $rid;
 		$data ['tijdate'] = $tijdate ['date'];
 		$data ['receiptList'] = $receiptList;
@@ -7919,6 +8015,13 @@ class ReceiptController extends DooController {
 		$data ['verifyId'] = $this->verifyId;
 		$data ['executeId'] = $this->executeId;
 		
+		if($receiptList[0]['version']==1){
+			
+			
+			$this->render ( "/fee/approval/receipt_compatible", $data );
+			die;
+		}
+		
 		if($receiptList[0]['receiptClass']==1){
 			$this->render ( "/receipt/feeAgencyApproval", $data );
 		}elseif($receiptList[0]['receiptClass']==2){

+ 374 - 70
protected/controller/fee/fee_controller.php

@@ -1,42 +1,90 @@
 <?php
 /*
- * @description: 费用管理控制类
- * @Author: CP
- * @Date: 2020-11-11 17:51:05
- * @FilePath: \cld\protected\controller\fee\fee_controller.php
+ * @description: 费用管理控制类 @Author: CP @Date: 2020-11-11 17:51:05 @FilePath: \cld\protected\controller\fee\fee_controller.php
  */
+require "protected/services/fee_service.php";
+require "protected/services/region_service.php";
+require "protected/services/office_service.php";
+require "protected/class/comm_cld.php";
 class fee_controller extends DooController {
-	
-	public $staff;
-	
+	private $staff;
+	private $verifyId;
+	private $executeId;
+	private $feeService;
+	private $regionService;
+	private $officeService;
 	public function beforeRun($resource, $action) {
-		
-		$this->accessAuth($resource, $action);
+		$this->accessAuth ( $resource, $action );
 	}
-	
 	function __construct() {
+		$this->session ();
+		$this->feeService = new fee_service ();
+		$this->regionService = new region_service ();
+		$this->officeService = new office_service ();
+	}
+	
+	// 访问权限-费用管理
+	private function accessAuth($resource, $action) {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$sid = $XDeode->decode ( $_COOKIE ["staff"] );
+		// 1.单独判断公司汇总的访问权限
+		if ($action == 'companyCategoryCollect') {
+			Doo::loadModel ( "receiptAuthorityManage" );
+			$invoiceCompanyManage = new receiptAuthorityManage ();
+			
+			$icm = $invoiceCompanyManage->getInvoiceCMByStaff ( $sid );
+			if (empty ( $icm ))
+				die ( 'illegal request-无权访问该页面' );
+		}
+		
+		// 2.获得登陆用户信息
+		Doo::loadModel ( 'cld/staff_cld' );
+		$staff = new staff_cld ();
+		$this->staff = $staff->Get ( $sid );
 		
+		// 3.是否有权限访问
+		$accessModular = 'RECEIPTS';
+		if (empty ( $this->staff ['cldAccessArray'] )) {
+			die ( 'illegal request-无权访问费用页面,向总部申请权限' );
+		} else {
+			if (in_array ( $accessModular, $this->staff ['cldAccessArray'] )) {
+				if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
+					$flag = true;
+				} else {
+					$flag = false;
+				}
+			} else {
+				die ( 'illegal request-无权访问费用页面' );
+			}
+		}
+		if (! $flag)
+			die ( 'illegal request-无权访问费用页面' );
+	}
+	
+	// 登陆判定
+	private function session() {
 		if (isset ( $_COOKIE ["staff"] )) {
-				
+			
 			if (! empty ( $_COOKIE ["staff"] )) {
-		
+				
 				Doo::loadModel ( 'staff' );
 				Doo::loadModel ( 'verify' );
 				$verify = new verify ();
 				$staff = new staff ();
 				Doo::loadModel ( "execute" );
 				$execute = new execute ();
-		
+				
 				$verifyList = $verify->find ( array (
 						'select' => 'staff',
-						'asArray' => true
+						'asArray' => true 
 				) );
 				$list = array ();
-		
+				
 				// 判断角色的审批权限
 				foreach ( $verifyList as $key => $value ) {
 					$ver = json_decode ( $value ['staff'] );
-						
+					
 					foreach ( $ver as $k => $v ) {
 						if ($v [1] == 'ROLE') {
 							$roleList = json_decode ( $v [3] );
@@ -49,37 +97,31 @@ class fee_controller extends DooController {
 							array_push ( $list, $v [0] );
 					}
 				}
-		
+				
 				// 判断执行人的审批权限
 				$executeList = $execute->find ( array (
-						'where'=>'mold !="日常收支"',
+						'where' => 'mold !="日常收支"',
 						'select' => 'staff',
-						'asArray' => true
+						'asArray' => true 
 				) );
 				$list2 = array ();
 				foreach ( $executeList as $key => $value ) {
 					$ver = json_decode ( $value ['staff'] );
-						
+					
 					foreach ( $ver as $k => $v ) {
 						array_push ( $list2, $v [0] );
 					}
 				}
-		
+				
 				$eidList = file_get_contents ( "protected/config/execute/execute.ini" );
 				$eidList = array_filter ( explode ( ",", $eidList ) );
-		
+				
 				$this->executeId = array_merge ( $list2, $eidList );
-				//print_r($this->executeId);
+				// print_r($this->executeId);
 				$this->verifyId = $list;
-				//$this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
-		
-				// 检测用户信息完成
-				$this->data ['isStaffCompleteMsg'] = false;
-				$detail = $staff->checkStaffInfoIsComplete ( $_COOKIE ["staff"] );
-				if (! empty ( $detail ))
-					$this->data ['isStaffCompleteMsg'] = true;
-		
-					return "/";
+				// $this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
+				
+				return "/";
 			}
 		}
 		
@@ -93,56 +135,318 @@ class fee_controller extends DooController {
 		}
 	}
 	
-	//构建申请报销单页面
-	public function GetViewReceiptCreate(){
+	// 构建申请报销单页面
+	public function GetViewReceiptCreate() {
+		// 请求
+		$data ['action'] = "/receipt/create";
 		
+		// 费用 项目细则
+		$accountItem = $this->feeService->GetAccountItem ();
+		$data ['accountItem'] = json_encode ( $accountItem );
+		
+		// 地区
+		$region = $this->regionService->GetRegionTwo ();
+		$data ['region'] = json_encode ( $region );
+		
+		// 审批
+		$data ['verify'] = json_encode ( $this->feeService->GetVerify () );
+		
+		// 办事处
+		$data ['office'] = $this->officeService->GetAll ();
+		// 默认办事处
+		$data ['officeId'] = $this->staff ['cid'];
+		// 附件
+		$data ['enclosurList'] = array ();
+		
+		$data ['staff'] = $this->staff;
+		$data ['verifyId'] = $this->verifyId;
+		$data ['executeId'] = $this->executeId;
+		$data ['receiptMemu'] = 'saeaBorad';
 		$data ['memu'] = "receipt";
-		$this->render ( "/fee/create/receipt",$data );
+		$this->render ( "/fee/create/receipt", $data );
 	}
 	
-	// 访问权限-费用管理
-	private function accessAuth($resource, $action){
-		Doo::loadClass ( 'XDeode' );
-		$XDeode = new XDeode ( 5 );
-		$sid = $XDeode->decode ( $_COOKIE ["staff"] );
-		// 1.单独判断公司汇总的访问权限
-		if ($action == 'companyCategoryCollect') {
-			Doo::loadModel ( "receiptAuthorityManage" );
-			$invoiceCompanyManage = new receiptAuthorityManage ();
-				
-			$icm = $invoiceCompanyManage->getInvoiceCMByStaff ( $sid );
-			if (empty ( $icm ))
-				die ( 'illegal request-无权访问该页面' );
+	// 编辑保险单
+	public function GetViewReceiptEdit() {
+		$receiptId = isset ( $this->params ['receiptId'] ) ? $this->params ['receiptId'] : '';
+		if (empty ( $receiptId )) {
+			die ( 'illegal request-请求参数错误,重新请求' );
 		}
 		
-		//2.获得登陆用户信息
-		Doo::loadModel ( 'cld/staff_cld' );
-		$staff = new staff_cld ();
-		$this->staff = $staff->Get($sid);
+		$receiptId = GetDecryptId ( $receiptId );
+		$detail = $this->feeService->GetReceipt ( $receiptId );
 		
-		//3.是否有权限访问
-		$accessModular = 'RECEIPTS';
-		if (empty ( $this->staff ['cldAccessArray'] )){
-			die ( 'illegal request-无权访问费用页面,向总部申请权限' );
-		}else {
-				if (in_array ( $accessModular, $this->staff ['cldAccessArray'] )) {
-					if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
-						$flag = true;
-					} else {
-						$flag = false;
-					}
-				} else {
-					die ( 'illegal request-无权访问费用页面' );
-				}
-			}
-			if (! $flag)
-				die ( 'illegal request-无权访问费用页面' );
+		// 附件相关
+		Doo::loadModel ( 'enclosur' );
+		$enclosur = new enclosur ();
+		$data ['enclosurList'] = $enclosur->getEnclosurByRid ( $detail ['rid'] );
+		
+		// 费用 项目细则
+		$accountItem = $this->feeService->GetAccountItem ();
+		$data ['accountItem'] = json_encode ( $accountItem );
+		// 报销单数据
+		$data ['data'] = json_encode ( $this->makeReceiptEdiData ( $detail, $accountItem, $this->feeService->GetVerify () ) );
+		// 请求
+		$data ['action'] = "/receipt/edit";
+		
+		// 地区
+		$region = $this->regionService->GetRegionTwo ();
+		$data ['region'] = json_encode ( $region );
+		// 审批
+		$data ['verify'] = "[]";
+		// 办事处
+		$data ['office'] = $this->officeService->GetAll ();
+		// 默认办事处
+		$data ['officeId'] = $detail ['cid'];
+		$data ['receiptId'] = $detail ['receiptId'];
+		
+		$data ['staff'] = $this->staff;
+		$data ['verifyId'] = $this->verifyId;
+		$data ['executeId'] = $this->executeId;
+		$data ['receiptMemu'] = 'saeaBorad';
+		$data ['memu'] = "receipt";
+		$this->render ( "/fee/create/receipt", $data );
+	}
+	
+	// 创建报销单
+	public function PostReceiptCreate() {
+		
+		// 1.获得参数
+		$data = array (
+				"officeData" => get_args ( 'officeData' ),
+				"traveData" => get_args ( 'traveData' ),
+				"trainData" => get_args ( 'trainData' ),
+				"enclosurFiles" => get_args ( 'enclosurFiles' ),
+				"verifyId" => get_args ( 'verifyId' ),
+				"officeId" => get_args ( 'officeId' ),
+				"remittanceName" => get_args ( 'remittanceName' ),
+				"remittanceBankType" => get_args ( 'remittanceBankType' ),
+				"bankName" => get_args ( 'bankName' ),
+				"bankNumber" => get_args ( 'bankNumber' ),
+				"coupletNumber" => get_args ( 'coupletNumber' ) 
+		);
+		
+		// 2.参数校验
+		$data = $this->feeService->ValidRuleReceiptCreate ( $data );
+		
+		// 3.具体数据处理
+		$msg = $this->feeService->ReceiptCreate ( $data, $this->staff );
+		
+		return "/saeaBorad";
+	}
+	
+	// 更新报销单
+	public function PostReceiptEdit() {
+		// 1.获得参数
+		$data = array (
+				"receiptId" => get_args ( 'receiptId' ),
+				"officeData" => get_args ( 'officeData' ),
+				"traveData" => get_args ( 'traveData' ),
+				"trainData" => get_args ( 'trainData' ),
+				"enclosurFiles" => get_args ( 'enclosurFiles' ),
+				"verifyId" => get_args ( 'verifyId' ),
+				"officeId" => get_args ( 'officeId' ),
+				"remittanceName" => get_args ( 'remittanceName' ),
+				"remittanceBankType" => get_args ( 'remittanceBankType' ),
+				"bankName" => get_args ( 'bankName' ),
+				"bankNumber" => get_args ( 'bankNumber' ),
+				"coupletNumber" => get_args ( 'coupletNumber' ) 
+		);
+		
+		// 2.参数校验
+		$data = $this->feeService->ValidRuleReceiptCreate ( $data );
+		// 3.具体数据处理
+		$msg = $this->feeService->ReceiptEdi ( $data, $this->staff );
+		
+		return "/saeaBorad";
 	}
 	
-	private function session(){
+	// 创建借款报销单
+	public function GetViewLoanReceiptCreate() {
+		$receiptId = isset ( $this->params ['receiptId'] ) ? $this->params ['receiptId'] : '';
+		if (empty ( $receiptId )) {
+			die ( 'illegal request-请求参数错误,重新请求' );
+		}
 		
+		$data ['receiptId'] = $receiptId;
+		
+		$receiptId = GetDecryptId ( $receiptId );
+		$detail = $this->feeService->GetReceipt ( $receiptId );
+		
+		// 设置借款信息
+		$loan = $this->feeService->GetLoanReceipt ( $detail ['loanRid'] );
+		$data ['loan'] = $loan;
+		
+		// 费用 项目细则
+		$accountItem = $this->feeService->GetAccountItem ();
+		$data ['accountItem'] = json_encode ( $accountItem );
+		// 报销单数据
+		if ($detail ['status'] != 7) {
+			$detail ['verify'] = '';
+		}
+		$data ['data'] = json_encode ( $this->makeReceiptEdiData ( $detail, $accountItem, $this->feeService->GetVerify () ) );
+		// 地区
+		$region = $this->regionService->GetRegionTwo ();
+		$data ['region'] = json_encode ( $region );
+		
+		// 审批
+		$data ['verify'] = json_encode ( $this->feeService->GetVerify () );
+		
+		// 办事处
+		$data ['office'] = $this->officeService->GetAll ();
+		// 默认办事处
+		$data ['officeId'] = $this->staff ['cid'];
+		// 附件
+		$data ['enclosurList'] = array ();
+		// 请求
+		$data ['action'] = "/loan/receipt/edit";
+		
+		$data ['staff'] = $this->staff;
+		$data ['verifyId'] = $this->verifyId;
+		$data ['executeId'] = $this->executeId;
+		$data ['receiptMemu'] = 'saeaBorad';
+		$data ['memu'] = "receipt";
+		$this->render ( "/fee/create/receipt", $data );
 	}
 	
+	// 保存借款报销单
+	public function PostLoanReceiptEdit() {
+		// 1.获得参数
+		$data = array (
+				"receiptId" => get_args ( 'receiptId' ),
+				"officeData" => get_args ( 'officeData' ),
+				"traveData" => get_args ( 'traveData' ),
+				"trainData" => get_args ( 'trainData' ),
+				"enclosurFiles" => get_args ( 'enclosurFiles' ),
+				"verifyId" => get_args ( 'verifyId' ),
+				"officeId" => get_args ( 'officeId' ),
+				"remittanceName" => get_args ( 'remittanceName' ),
+				"remittanceBankType" => get_args ( 'remittanceBankType' ),
+				"bankName" => get_args ( 'bankName' ),
+				"bankNumber" => get_args ( 'bankNumber' ),
+				"coupletNumber" => get_args ( 'coupletNumber' ) 
+		);
+		// 2.参数校验
+		$data = $this->feeService->ValidRuleReceiptCreate ( $data );
+		
+		// 3.处理借款报销单数据
+		$msg = $this->feeService->LoanReceiptEdi ( $data ['receiptId'] );
+		
+		// 4.具体数据处理
+		$msg = $this->feeService->ReceiptEdi ( $data, $this->staff );
+		
+		return "/saeaBorad";
+	}
+	
+	// 审批页面
+	public function GetViewReceiptApproval() {
+		$receiptId = isset ( $this->params ['receiptId'] ) ? $this->params ['receiptId'] : '';
+		if (empty ( $receiptId )) {
+			die ( 'illegal request-请求参数错误,重新请求' );
+		}
+		$receiptId = GetDecryptId ( $receiptId );
+		$detail = $this->feeService->GetReceipt ( $receiptId );
+		
+		
+		// 设置借款信息
+		if (!empty($detail ['loanRid'])){
+			$loan = $this->feeService->GetLoanReceipt ( $detail ['loanRid'] );
+			$data ['loan'] = $loan;
+		}
+		
+		
+		
+// 		$receiptList [$key] ['loanSumCN'] = $this->num_to_rmb ( $value ['loanSum'] );
+// 		$receiptList [$key] ['sumCN'] = $this->num_to_rmb ( $value ['sum'] );
+	
+// 		$receiptList [$key] ['relustCN'] = $this->num_to_rmb ( abs ( $relust ) );
+		
+		
+		$data['receipt']=$detail;
+		
+		
+		
+		$data ['staff'] = $this->staff;
+		$data ['verifyId'] = $this->verifyId;
+		$data ['executeId'] = $this->executeId;
+		$data ['receiptMemu'] = 'saeaBorad';
+		$data ['memu'] = "receipt";
+		$this->render ( "/fee/approval/receipt", $data );
+		
+	}
+	
+	// 构造页面数据
+	private function makeReceiptEdiData($data, $accountItem, $verify) {
+		$officeJson = array (
+				"id" => 0,
+				"name" => "办事处相关费用",
+				"show" => false,
+				"anchor" => "officeAnchor",
+				"active" => false,
+				"daily" => $accountItem ['daily'],
+				"other" => $accountItem ['other'],
+				"officeExplain" => array (
+						
+						0 => array (
+								"officeExplain" => "" 
+						) 
+				) 
+		);
+		if (! empty ( $data ['officeJson'] )) {
+			$officeJson = json_decode ( $data ['officeJson'], true );
+		}
+		
+		$traveJson = array (
+				"id" => 1,
+				"name" => "差旅相关费用",
+				"show" => false,
+				"anchor" => "traveAnchor",
+				"active" => false,
+				"trave" => $accountItem ['trave'],
+				"traveList" => array (),
+				"traveExplain" => array (
+						
+						0 => array (
+								"traveExplain" => "" 
+						) 
+				) 
+		);
+		if (! empty ( $data ['traveJson'] )) {
+			$traveJson = json_decode ( $data ['traveJson'], true );
+		}
+		
+		$trainJson = array (
+				"id" => 2,
+				"name" => "内部培训费用",
+				"show" => false,
+				"anchor" => "trainAnchor",
+				"active" => false,
+				"train" => $accountItem ['train'],
+				"trainExplain" => array (
+						0 => array (
+								"trainExplain" => "" 
+						) 
+				)
+				 
+		);
+		if (! empty ( $data ['trainJson'] )) {
+			$trainJson = json_decode ( $data ['trainJson'], true );
+		}
+		
+		return array (
+				"receiptTypeMenu" => array (
+						0 => $officeJson,
+						1 => $traveJson,
+						2 => $trainJson 
+				),
+				"verify" => $verify,
+				"verifyId" => $data ['verify'],
+				"remittanceBankType" => 0,
+				"enclosurFiles" => array (),
+				"aletMsg" => '',
+				"displayStsates" => 'none' 
+		);
+	}
 }
 
 ?>

+ 24 - 0
protected/model/cld/account_item_cld.php

@@ -0,0 +1,24 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+class account_item_cld extends DooModel {
+	private $aid;
+	private $category;
+	private $name;
+	public $_table = 'CLD_accountItem';
+	public $_primarykey = 'aid';
+	public $_fields = array (
+			'aid',
+			'category',
+			'name'
+	);
+	
+	//
+	function GetAll(){
+		$detail =$this->find ( array (
+				'asArray' => TRUE
+		) );
+		return $detail;
+	}
+	
+}
+?>

+ 33 - 0
protected/model/cld/category_cld.php

@@ -0,0 +1,33 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+class category_cld extends DooModel {
+	private $cid;
+	private $title;
+	private $defult;
+	private $districtid;
+	public $_table = 'CLD_L_category';
+	public $_primarykey = 'cid';
+	public $_fields = array (
+			'cid',
+			'title',
+			'defult',
+			'districtid' 
+	);
+	
+	// 获得员工信息
+	public function GetAll() {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 9 );
+		$result = $this->find ( array (
+				'asArray' => TRUE 
+		) );
+		
+		foreach ( $result as $key => $value ) {
+			$result [$key] ['cid'] = $XDeode->encode ( $value ['cid'] );
+		}
+		
+		return $result;
+	}
+}
+
+?>

+ 120 - 0
protected/model/cld/receipt_cld.php

@@ -0,0 +1,120 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+class receipt_cld extends DooModel {
+	public $rid;
+	public $accountItem;
+	public $loanItem;
+	public $staff;
+	public $sum;
+	public $date;
+	public $pastDate;
+	public $executeDate;
+	public $loanDate;
+	public $cid;
+	public $status;
+	public $Rtype;
+	public $isBK;
+	public $loanSum;
+	public $loanRid;
+	public $reviseDetail;
+	public $revisePrice;
+	public $receiptOrder;
+	public $verify;
+	public $verifyStaff;
+	public $executeCopy;
+	public $executeStaff;
+	public $verifyBreakup;
+	public $nowStaff;
+	public $explanation;
+	public $implementOpinions;
+	public $notice;
+	public $amount;
+	public $remittanceName;
+	public $bankName;
+	public $bankNumber;
+	public $coupletNumber;
+	public $remittanceBankType;
+	public $trainId;
+	public $trainLoanRid;
+	public $invoiceTrainId;
+	public $paidStatus;
+	public $statusTrain;
+	public $receiptClass;
+	public $itinerary;
+	public $itinerary2;
+	
+	public $officeJson;
+	public $traveJson;
+	public $trainJson;
+	public $version; 
+	
+	public $iti2New;
+
+	public $_table = 'CLD_receipt';
+	public $_primarykey = 'rid';
+	public $_fields = array (
+			'aid',
+			'accountItem',
+			'staff',
+			'sum',
+			'date',
+			'pastDate',
+			'cid',
+			'status',
+			'reviseDetail',
+			'revisePrice',
+			'verify',
+			'verifyStaff',
+			'nowStaff',
+			'receiptOrder',
+			'explanation',
+			'notice',
+			'Rtype',
+			'loanItem',
+			'loanRid',
+			'loanSum',
+			'implementOpinions',
+			'isBK',
+			'executeCopy',
+			'executeStaff',
+			'verifyBreakup',
+			'executeDate',
+			'amount',
+			'loanDate',
+			'remittanceName',
+			'bankName',
+			'bankNumber',
+			'coupletNumber',
+			'remittanceBankType',
+			'trainId',
+			'trainLoanRid',
+			'invoiceTrainId' ,
+            'paidStatus',
+			'statusTrain',
+			'receiptClass',
+			'itinerary',
+			'itinerary2',
+			
+			'officeJson',
+			'traveJson',
+			'trainJson',
+			"version",
+	);
+
+	public  function Get($id){
+		$detail = $this->getOne ( array (
+				'where' => "rid= ? ",
+				'param' => array (
+						$id
+				),
+				'asArray' => TRUE
+		) );
+		
+		
+		
+		return $detail;
+	}
+   
+}
+
+?>

+ 60 - 0
protected/model/cld/region_cld.php

@@ -0,0 +1,60 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+class region_cld extends DooModel {
+	private $id;
+	private $name;
+	private $level;
+	private $usetype;
+	private $upid;
+	private $displayorder;
+	private $area;
+	public $_table = 'CLD_district';
+	public $_primarykey = 'id';
+	public $_fields = array (
+			'id',
+			'name',
+			'level',
+			'usetype',
+			'upid',
+			'displayorder',
+			'area' 
+	);
+	
+	// 获得前2层区域-树
+	public function GetLeveTwoTree() {
+		$list = $this->find ( array (
+				'where' => "level <= ? ",
+				'param' => array (
+						2 
+				),
+				'asArray' => TRUE 
+		) );
+		
+		$region = array ();
+		foreach ( $list as $key => $value ) {
+			if ($value ["level"] == 1) {
+				array_push ( $region, array (
+						"name" => $value ['name'],
+						"id"=>$value ['id'],
+						"child" => array () 
+				) );
+				unset ( $list [$key] );
+			}
+		}
+		foreach ( $region as $k => $v ) {
+			foreach ( $list as $value ) {
+				if ($value ["level"] == 2) {
+					if ($v ['id'] == $value ['upid']) {
+						array_push ( $region [$k] ['child'], array (
+								"name" => $value ['name'] 
+						) );
+					}
+				}
+			}
+		}
+		
+		return $region;
+	}
+}
+
+?>

+ 17 - 27
protected/model/cld/staff_cld.php

@@ -2,25 +2,30 @@
 Doo::loadCore ( 'db/DooModel' );
 class staff_cld extends DooModel {
 	
-	
 	// 获得员工信息
-	public  function Get($id=0){
-		$detail =$this->getOne ( array (
+	public function Get($id = 0) {
+		$detail = $this->getOne ( array (
 				'where' => "sid= ? ",
-				'param' => array($id),
-				'asArray' => TRUE
+				'param' => array (
+						$id 
+				),
+				'asArray' => TRUE 
 		) );
 		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 9 );
+		
+		$detail ['sid_cld']=$XDeode->encode($detail ['sid']);
+		$detail ['cid']=$XDeode->encode($detail ['cid']);
+		
 		//
-		$detail ['cldAccessArray'] =array();
-		if (!empty($detail['cldAccess'])){
-			$detail ['cldAccessArray'] =json_decode($detail['cldAccess']);
+		$detail ['cldAccessArray'] = array ();
+		if (! empty ( $detail ['cldAccess'] )) {
+			$detail ['cldAccessArray'] = json_decode ( $detail ['cldAccess'] );
 		}
-			
 		
 		return $detail;
 	}
-	
 	private $sid;
 	private $username;
 	private $passwork;
@@ -49,11 +54,9 @@ class staff_cld extends DooModel {
 	private $bankNumber;
 	private $coupletNumber;
 	private $remittanceBankType;
-	
 	private $living;
 	private $nativePlace;
 	private $emergencyContacts;
-	
 	private $did;
 	private $didName;
 	private $jobNumber;
@@ -63,20 +66,15 @@ class staff_cld extends DooModel {
 	private $pendingApprovals;
 	private $processApprovals;
 	private $processCC;
-	
 	private $InductionDate;
 	private $pendStatus;
 	private $updateDate;
-	
 	private $probationaryDate;
 	private $regularsDate;
-	
 	private $qualifications;
 	private $marriage;
-	
 	private $salaryCard;
 	private $salaryBank;
-	
 	private $pendingApprovalsLeave;
 	private $processApprovalsLeave;
 	private $processLeaveCC;
@@ -84,18 +82,14 @@ class staff_cld extends DooModel {
 	private $dimissionDate;
 	private $dimissionReason;
 	private $seniorityFormula;
-	
 	private $practiceDate;
-	
 	private $cldAccess;
-	
 	private $IDcards;
 	private $IDcardsImgA;
 	private $certificate;
 	private $diploma;
 	private $professionalTitle;
 	private $IDcardsImgB;
-	
 	private $nation;
 	private $graduateInstitutions;
 	private $major;
@@ -105,11 +99,9 @@ class staff_cld extends DooModel {
 	private $householdRegistrationType;
 	private $IDcardsValidity;
 	private $positionId;
-	
 	private $appliedPromote;
 	private $departmentID;
 	private $applyLeaveDate;
-	
 	public $_table = 'CLD_staff';
 	public $_primarykey = 'sid';
 	public $_fields = array (
@@ -193,17 +185,15 @@ class staff_cld extends DooModel {
 			'dimissionDate',
 			'seniorityFormula',
 			'cldAccess',
-
+			
 			'departmentID',
 			
 			'didName',
 			'positionId',
 			'appliedPromote',
 			
-			'applyLeaveDate',
+			'applyLeaveDate' 
 	);
-	
-	
 }
 
 ?>

+ 51 - 0
protected/model/cld/verify_cld.php

@@ -0,0 +1,51 @@
+<?php
+
+Doo::loadCore('db/DooModel');
+
+class verify_cld extends DooModel {
+
+	private  $vid;
+	private $description;
+	private $staff;
+	private $subordinate;
+
+	public $_table = 'CLD_verify';
+	public $_primarykey = 'vid';
+
+	public $_fields = array('vid', 'description', 'staff','subordinate');
+	
+	//获得所有审批组
+	public function GetAll(){
+		Doo::loadModel ( "role" );
+		$role = new role ();
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 9 );
+		$veList = $this->find ( array (
+				'asArray' => true
+		) );
+		foreach ( $veList as $key => $value ) {
+			
+			$veList[$key] ['vid']=$XDeode->encode($value ['vid']);
+			
+			$v = json_decode ( $value ['staff'] );
+			$list = array ();
+			foreach ( $v as $n => $m ) {
+				if ($m ['1'] == 'ROLE') {
+					$roleInfo = $role->getOne ( array (
+							'where' => 'rid=' . $m [0],
+							'asArray' => true
+					) );
+					$v [$n] [1] = $roleInfo ['name'];
+					array_push ( $list, $roleInfo ['name'] );
+				} else {
+					array_push ( $list, $v [$n] [1] );
+				}
+			}
+			$veList [$key] ['staff'] = implode ( '>', $list );
+		}
+		return $veList;
+	}
+	
+}
+
+?>

+ 18 - 6
protected/model/invoice.php

@@ -660,17 +660,22 @@ class invoice extends DooModel {
 		$sql = 'select receivablesPrice,irid
  				from CLD_invoiceReceivables
  				where irid in ( '.$iridStr.' ) '.$receivablesBank;
+		//echo $sql;
 		$query = Doo::db ()->query ( $sql );
 		$result = $query->fetchAll ();
 		//合计金额-收款不会大于发票金额,大于则重置为发票总金额
 		$sum=0;
-		foreach ($result as $k=>$v){
-			foreach ($resultInvoice as $value){
-				if($value['irid']==$v['irid']&&$value['invoicePrice']<$v['receivablesPrice']){
-					$result[$k]['receivablesPrice']=$value['invoicePrice'];
+		foreach ($resultInvoice as $value){
+			foreach ($result as $k=>$v){
+				if($value['irid']==$v['irid']){
+					if ($value['invoicePrice']<$v['receivablesPrice']){
+						$sum+=$value['invoicePrice'];
+					}else{
+						$sum+=$result[$k]['receivablesPrice'];
+					}
+					break;
 				}
 			}
-			$sum+=$result[$k]['receivablesPrice'];
 		}
 		
 		return array('receivablesPrice'=>$sum,'trainId'=>$itidSql);
@@ -1279,6 +1284,7 @@ class invoice extends DooModel {
 			$paid=$value['invoicePrice']-$value['invoiceBalance'];
 			
 			$list [$key] ['irList'] = $invoiceReceivables->getInvoiceReceivablesInIridString ( $value ['irid'] );// array(0=>array('sumPrice'=>$paid)); // 
+			//替换掉原来的金额汇总
 			if(!empty($list [$key] ['irList'])){
 				$list [$key] ['irList'][0]['sumPrice']=$paid;
 			}
@@ -1293,6 +1299,10 @@ class invoice extends DooModel {
 			$list [$key] ['OL'] = $invoiceOperationLog->getInvoiceOperationInStatus ( $value ['iid'], '2,3,4' );
 			
 			// print_r($list [$key] ['OperationLog']);
+// 			if($value ['irid']==8280){
+// 				echo $list [$key] ['invoicePrice'] ."--". $list [$key] ['irList'] [0] ['sumPrice'].'<br/>';
+// 			}
+			
 			$list [$key] ['sumPrice'] = 0;
 			if (! empty ( $list [$key] ['irList'] )){
 				$list [$key] ['sumPrice'] = $list [$key] ['irList'] [0] ['sumPrice'];
@@ -1300,8 +1310,10 @@ class invoice extends DooModel {
 					$list [$key] ['sumPrice'] = $value['invoicePrice'];
 				}
 			}
+			
 			$list [$key] ['diffPrice'] = $list [$key] ['invoicePrice'];
 			if (! empty ( $list [$key] ['irList'] [0] ['sumPrice'] )){
+				
 				$diffPrice=$list [$key] ['invoicePrice'] - $list [$key] ['irList'] [0] ['sumPrice'];
 				if($diffPrice<=0){
 					$diffPrice=0;
@@ -1309,7 +1321,7 @@ class invoice extends DooModel {
 				$list [$key] ['diffPrice'] = $diffPrice;
 				// $list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
 			}
-				$list [$key] ['lossDetail'] = array ();
+			$list [$key] ['lossDetail'] = array ();
 			if ($value ['lossIid'] != 0) {
 				$detail = $this->getOne ( array (
 						'where' => "iid=" . $value ['lossIid'],

+ 2 - 0
protected/model/invoiceReceivables.php

@@ -320,6 +320,8 @@ class invoiceReceivables extends DooModel {
 		}
 		return $list;
 	}
+	
+	//待修改
 	public function getInvoiceReceivablesInIridString($iridString = "") {
 		$list = array ();
 		if (! empty ( $iridString ))

+ 1 - 0
protected/model/invoiceTraining.php

@@ -434,6 +434,7 @@ class invoiceTraining extends DooModel {
 				}
 			}
 			//入账金额
+			
 			foreach ( $invoiceRecelvablesList as $i => $o ) {
 				if ($detail['itid'] == $o ['trainId']) {
 					$detail ['invoiceArriveAmount'] = $o ['receivablesPrice'];

+ 9 - 8
protected/plugin/TemplateTag.php

@@ -127,14 +127,15 @@ function isShowMenu($menu=''){
 		//是否有登陆者需要审批的员工
 		$list=array();
 		if ($menu=='HR'){
-		Doo::loadClass ( 'XDeode' );
-		$XDeode = new XDeode ( 5 );
-		$uid = $XDeode->decode ( $_COOKIE ["staff"] );
-		$list=$staff->find ( array (
-				'asc' => 'sid',
-				'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5') and ( pendingApprovalsLeave='".$uid."' or pendingApprovals='".$uid."') ",
-				'asArray' => TRUE
-		) );
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			$uid = $XDeode->decode ( $_COOKIE ["staff"] );
+			$list=$staff->find ( array (
+					'asc' => 'sid',
+					'where' => "(pendStatus= '2' or pendStatus='3' or pendStatus='5' or pendStatus='6') and ( pendingApprovalsLeave='".$uid."' or pendingApprovals='".$uid."') ",
+					'asArray' => TRUE
+			) );
+		
 		}
 		
 		if (in_array($menu,$cldAccess)||($st['sid']==superHR&&$menu=='HR')||(count($list)>0&&$menu=='HR')){

+ 641 - 0
protected/services/fee_service.php

@@ -0,0 +1,641 @@
+<?php
+class fee_service {
+	private $accountItem;
+	private $verify;
+	private $receipt;
+	private $XDeode;
+	private $category;
+	function __construct() {
+		Doo::loadModel ( 'cld/account_item_cld' );
+		$this->accountItem = new account_item_cld ();
+		Doo::loadModel ( 'cld/verify_cld' );
+		$this->verify = new verify_cld ();
+		Doo::loadModel ( 'cld/receipt_cld' );
+		$this->receipt = new receipt_cld ();
+		Doo::loadClass ( 'XDeode' );
+		$this->XDeode = new XDeode ( 9 );
+		Doo::loadModel ( 'receiptDetail' );
+		Doo::loadModel ( 'cld/category_cld' );
+		$this->category = new category_cld ();
+	}
+	
+	// 费用 报销单-创建-参数校验
+	public function ValidRuleReceiptCreate($data = array()) {
+		if (empty ( $data ['verifyId'] )) {
+			die ( 'illegal request-请选择审批组' );
+		}
+		$data ['verifyId'] = $this->XDeode->decode ( $data ['verifyId'] );
+		if (! is_numeric ( $data ['verifyId'] )) {
+			die ( 'illegal request-请选择审批组' );
+		}
+		
+		if (empty ( $data ['officeId'] )) {
+			die ( 'illegal request-请选择办事处' );
+		}
+		$data ['officeId'] = $this->XDeode->decode ( $data ['officeId'] );
+		if (! is_numeric ( $data ['officeId'] )) {
+			die ( 'illegal request-请选择办事处' );
+		}
+		
+		if ($data ['traveData'] == "" && $data ['officeData'] == "" && $data ['trainData'] == "") {
+			die ( 'illegal request-请选择费用类型' );
+		}
+		
+		// 字符串转换Json
+		$hasType = 0;
+		if ($data ['traveData'] != "") {
+			$data ['traveJson'] = json_decode ( $data ['traveData'], true );
+			if ($data ['traveJson'] ['show']) {
+				$hasType ++;
+			}
+		}
+		if ($data ['officeData'] != "") {
+			$data ['officeJson'] = json_decode ( $data ['officeData'], true );
+			if ($data ['officeJson'] ['show']) {
+				$hasType ++;
+			}
+		}
+		if ($data ['trainData'] != "") {
+			$data ['trainJson'] = json_decode ( $data ['trainData'], true );
+			if ($data ['trainJson'] ['show']) {
+				$hasType ++;
+			}
+		}
+		if ($hasType == 0) {
+			die ( 'illegal request-请选择费用类型' );
+		}
+		
+		return $data;
+	}
+	
+	// 获得费用的细则
+	public function GetAccountItem() {
+		$data = $this->accountItem->GetAll ();
+		$list = array (
+				'daily' => array (),
+				'other' => array (),
+				'trave' => array (),
+				'train' => array () 
+		);
+		foreach ( $data as $value ) {
+			$value ['price'] = 0;
+			if ($value ['category'] == "日常相关费用") {
+				array_push ( $list ['daily'], $value );
+			}
+			if ($value ['category'] == "其他") {
+				array_push ( $list ['other'], $value );
+			}
+			if ($value ['category'] == "内部培训费用") {
+				array_push ( $list ['train'], $value );
+			}
+			if ($value ['category'] == "差旅相关费用") {
+				$value ['remark'] = "";
+				array_push ( $list ['trave'], $value );
+			}
+		}
+		return $list;
+	}
+	
+	// 审批组
+	public function GetVerify() {
+		$list = $this->verify->GetAll ();
+		return $list;
+	}
+	
+	// 获得报销单
+	public function GetReceipt($receiptId) {
+		$detail = $this->receipt->Get ( $receiptId );
+		$detail ['verify'] = $this->XDeode->encode ( $detail ['verify'] );
+		$detail ['cid'] = $this->XDeode->encode ( $detail ['cid'] );
+		$detail ['receiptId'] = $this->XDeode->encode ( $detail ['rid'] );
+		
+		//费用结算-用于流水
+		$relust = bcsub ( $detail ['sum'], $detail ['loanSum'], 2 );
+		$detail ['relust'] = $relust;
+		$detail ['relustABS'] = abs ( $relust );
+		
+		
+		
+		return $detail;
+	}
+	
+	// 创建报销单
+	public function ReceiptCreate($data, $staff) {
+		$receipt = new receipt_cld ();
+		
+		// 1.办事处相关费用
+		$total = 0;
+		if (! empty ( $data ['officeData'] )) {
+			if ($data ['officeJson'] ['show']) {
+				foreach ( $data ['officeJson'] ['daily'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+				foreach ( $data ['officeJson'] ['other'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		// 差旅相关费用
+		if (! empty ( $data ['traveData'] )) {
+			if ($data ['traveJson'] ['show']) {
+				foreach ( $data ['traveJson'] ['trave'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		// 内部培训费用
+		if (! empty ( $data ['trainData'] )) {
+			if ($data ['trainJson'] ['show']) {
+				foreach ( $data ['trainJson'] ['train'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		
+		$receipt->officeJson = $data ['officeData'];
+		$receipt->traveJson = $data ['traveData'];
+		$receipt->trainJson = $data ['trainData'];
+		
+		$receipt->remittanceName = $data ['remittanceName'];
+		$receipt->bankName = $data ['bankName'];
+		$receipt->bankNumber = $data ['bankNumber'];
+		$receipt->remittanceBankType = $data ['remittanceBankType'];
+		if ($data ['remittanceBankType'] == 1) {
+			$receipt->coupletNumber = $data ['coupletNumber'];
+		}
+		
+		$receipt->status = 5;
+		$receipt->date = date ( "Y-m-d" );
+		$receipt->staff = $staff ['sid'];
+		$receipt->cid = $data ['officeId'];
+		$receipt->verify = $data ['verifyId'];
+		$receipt->sum = $total;
+		$receipt->receiptOrder = "#B" . date ( "Ymd" ) . mt_rand ( 1000, 9999 );
+		
+		Doo::loadModel ( 'execute' );
+		$execute = new execute ();
+		$executeDetail = $execute->getOne ( array (
+				'where' => 'mold="报销单执行人"',
+				'asArray' => true 
+		) );
+		$receipt->executeCopy = $executeDetail ['staff'];
+		$receipt->version = 1;
+		$rid = $receipt->insert ();
+		
+		// 附件
+		if (! empty ( $data ['enclosurFiles'] )) {
+			Doo::loadModel ( 'enclosur' );
+			$data ['enclosurFiles'] = json_decode ( $data ['enclosurFiles'], true );
+			foreach ( $data ['enclosurFiles'] as $value ) {
+				$enclosur = new enclosur ();
+				$enclosur->name = $value ['path'];
+				$enclosur->rid = $rid;
+				$enclosur->insert ();
+			}
+		}
+		
+		// 创建报销单详情
+		$this->makeReceiptDetailCreate ( $data, $staff, $rid );
+		
+		return "";
+	}
+	
+	// 编辑报销单
+	public function ReceiptEdi($data, $staff) {
+		$receiptId = $this->XDeode->decode ( $data ['receiptId'] );
+		if (! is_numeric ( $receiptId )) {
+			die ( 'illegal request-找不到该报销单-参数不正确' );
+		}
+		$detail = $this->receipt->Get ( $receiptId );
+		if (empty ( $detail )) {
+			die ( 'illegal request-找不到该报销单' );
+		}
+		
+		$receipt = new receipt_cld ();
+		// 1.办事处相关费用
+		$total = 0;
+		if (! empty ( $data ['officeData'] )) {
+			if ($data ['officeJson'] ['show']) {
+				foreach ( $data ['officeJson'] ['daily'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+				foreach ( $data ['officeJson'] ['other'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		// 差旅相关费用
+		if (! empty ( $data ['traveData'] )) {
+			if ($data ['traveJson'] ['show']) {
+				foreach ( $data ['traveJson'] ['trave'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		// 内部培训费用
+		if (! empty ( $data ['trainData'] )) {
+			if ($data ['trainJson'] ['show']) {
+				foreach ( $data ['trainJson'] ['train'] as $value ) {
+					$total = bcadd ( $total, $value ['price'], 2 );
+				}
+			}
+		}
+		
+		$receipt->officeJson = $data ['officeData'];
+		$receipt->traveJson = $data ['traveData'];
+		$receipt->trainJson = $data ['trainData'];
+		
+		$receipt->remittanceName = $data ['remittanceName'];
+		$receipt->bankName = $data ['bankName'];
+		$receipt->bankNumber = $data ['bankNumber'];
+		$receipt->remittanceBankType = $data ['remittanceBankType'];
+		if ($data ['remittanceBankType'] == 1) {
+			$receipt->coupletNumber = $data ['coupletNumber'];
+		}
+		
+		$receipt->cid = $data ['officeId'];
+		$receipt->verify = $data ['verifyId'];
+		$receipt->sum = $total;
+		
+		Doo::loadModel ( 'execute' );
+		$execute = new execute ();
+		$executeDetail = $execute->getOne ( array (
+				'where' => 'mold="报销单执行人"',
+				'asArray' => true 
+		) );
+		$receipt->executeCopy = $executeDetail ['staff'];
+		$receipt->rid = $receiptId;
+		$receipt->update ();
+		
+		// 先删除
+		$receiptDetail = new receiptDetail ();
+		$receiptDetail->delete ( array (
+				'where' => 'rid=' . $receiptId 
+		) );
+		// 新增报销单详情
+		$this->makeReceiptDetailCreate ( $data, $staff, $receiptId );
+		
+		// 附件
+		if (! empty ( $data ['enclosurFiles'] )) {
+			Doo::loadModel ( 'enclosur' );
+			$data ['enclosurFiles'] = json_decode ( $data ['enclosurFiles'], true );
+			foreach ( $data ['enclosurFiles'] as $value ) {
+				$enclosur = new enclosur ();
+				$enclosur->name = $value ['path'];
+				$enclosur->rid = $receiptId;
+				$enclosur->insert ();
+			}
+		}
+		return "";
+	}
+	
+	//更新借款报销单数据
+	public function LoanReceiptEdi($receiptId){
+		$receiptId = $this->XDeode->decode ( $receiptId );
+		if (! is_numeric ( $receiptId )) {
+			die ( 'illegal request-找不到该报销单-参数不正确' );
+		}
+		$detail = $this->receipt->Get ( $receiptId );
+		if (empty ( $detail )) {
+			die ( 'illegal request-找不到该报销单' );
+		}
+		
+		$receipt = new receipt_cld ();
+		if ($detail['status']!=7){
+			$receipt->loanSum = $detail ['sum'];
+		}
+		$receipt->status = 7;
+		$receipt->version = 1;
+		$receipt->rid = $receiptId;
+		$receipt->update ();
+		
+	}
+	
+	// 获得借款报销单
+	public function GetLoanReceipt($loanReceiptId) {
+		Doo::loadModel ( 'loanReceipt' );
+		$loanReceipt = new loanReceipt ();
+		$loan = $loanReceipt->getOne ( array (
+				'where' => 'rid=' . $loanReceiptId,
+				'desc' => 'rid',
+				'asArray' => true 
+		) );
+		
+		$categoryDetil = $this->category->getOne ( array (
+				'where' => 'cid=' . $loan ['cid'],
+				'asArray' => true 
+		) );
+		$loan ['category'] = $categoryDetil ['title'];
+		$loan ['accountItem'] = json_decode ( $loan ['accountItem'], true );
+		$loan ['loanItem'] = json_decode ( $loan ['loanItem'], true );
+		$loan ['BIGsum'] = $this->num_to_rmb ( $loan ['sum'] );
+		
+		$loan ['verifyList'] = $this->makeVerifyProcess ( $loan ['verify'], $loan ['verifyStaff'] );
+		
+		return $loan;
+	}
+	
+	// 获得审批流程
+	private function makeVerifyProcess($verifyId, $verifyStaff) {
+		// 检测编辑状态
+		$verifyList = $this->verify->getOne ( array (
+				'where' => 'vid=' . $verifyId,
+				'asArray' => true 
+		) );
+		$verifyList = json_decode ( $verifyList ['staff'], true ); // status opinion
+		$verifyStaff = json_decode ( $verifyStaff, true );
+		
+		Doo::loadModel ( 'role' );
+		$role = new role ();
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		
+		$flag = true;
+		$roleKey = 0;
+		$endStaffArray = array ();
+		$roleArrayCopy = array ();
+		foreach ( $verifyList as $k => $v ) {
+			// init verifyStaff
+			
+			if ($v [1] == 'ROLE') {
+				
+				if (! empty ( $verifyStaff )) {
+					$endStaffArray = end ( $verifyStaff );
+					// if ($v[0]==$endStaffArray['nextStaff']){
+					// $roleId=$v[0];
+					// }
+				}
+				
+				$roleVerify = json_decode ( $v [3], true );
+				$roleKey = $k;
+				$roleArray = array ();
+				$rolename = $role->getOne ( array (
+						'where' => 'rid=' . $v [0],
+						'asArray' => true 
+				) );
+				
+				foreach ( $roleVerify as $o => $p ) {
+					$staffID = explode ( '_', $p );
+					$staffInfo = $staff->getOne ( array (
+							'where' => 'sid=' . $staffID [0],
+							'asArray' => true 
+					) );
+					// print_r($staffID);
+					$exp = array (
+							0 => $staffInfo ['sid'],
+							1 => $staffID [1],
+							2 => $staffInfo ['avatar'],
+							'date' => '',
+							'date' => '',
+							'opinion' => '',
+							'status' => '',
+							'rolename' => $rolename ['name'] 
+					);
+					array_push ( $roleArray, $exp );
+				}
+				$roleArrayCopy [$v [0]] = $roleArray;
+				// $verifyList[$k]['roleArray']=$roleArray;
+			}
+			
+			$verifyList [$k] ['date'] = "";
+			$verifyList [$k] ['opinion'] = "";
+			$verifyList [$k] ['status'] = "";
+			if (empty ( $verifyStaff )) {
+				$verifyList [$k] ['date'] = "";
+				$verifyList [$k] ['opinion'] = "";
+				if (($verifyList [0] [0] == $this->staff [0] ['sid']) && $flag) {
+					$verifyList [$k] ['status'] = 4;
+					$flag = false;
+				}
+			} else {
+				
+				foreach ( $verifyStaff as $m => $u ) {
+					if ($v [0] == $m) {
+						$verifyList [$k] ['date'] = $u ['date'];
+						$verifyList [$k] ['opinion'] = $u ['opinion'];
+						$verifyList [$k] ['status'] = $u ['status'];
+						$flag = false;
+						break;
+					}
+				}
+				
+				$endStaffArray = end ( $verifyStaff );
+				if (isset ( $endStaffArray ['ROLE'] )) {
+				} else {
+				}
+			}
+		}
+		
+		$rolename ['name'] = '';
+		
+		if (! empty ( $verifyStaff ))
+			$endStaffArray = end ( $verifyStaff );
+		
+		$KOP = false;
+		foreach ( $roleArrayCopy as $P => $A ) {
+			
+			foreach ( $A as $MKI => $AVL ) {
+				if (! empty ( $verifyStaff )) {
+					// &&$rolename['rid']==$endStaffArray['nextStaff']
+					if ($this->staff [0] ['sid'] == $AVL [0] && isset ( $endStaffArray ['ROLE'] ) && $rolename ['rid'] == $endStaffArray ['nextStaff']) {
+						$button = 4;
+						$roleArrayCopy [$P] [$MKI] ['status'] = 4;
+					}
+					
+					foreach ( $verifyStaff as $m => $u ) {
+						$AVLFK = $AVL [0] . '_R';
+						// echo $AVLFK.'=='.$m;var_dump($AVLFK==$m);echo '<br/>';
+						
+						if (strcmp ( $AVLFK, $m ) == 0) { // &&isset($u['ROLE'])&&$u['ROLE']==1
+							$roleArrayCopy [$P] [$MKI] ['date'] = $u ['date'];
+							$roleArrayCopy [$P] [$MKI] ['opinion'] = $u ['opinion'];
+							$roleArrayCopy [$P] [$MKI] ['status'] = $u ['status'];
+							
+							break;
+						}
+					}
+				} else {
+					
+					if ($this->staff [0] ['sid'] == $AVL [0] && $verifyList [0] [1] == 'ROLE') {
+						$button = 4;
+						$roleArrayCopy [$P] [$MKI] ['status'] = 4;
+					}
+				}
+				// $roleArray[$MKI]['rolename']=$rolename['name'];
+				$KOP = true;
+			}
+		}
+		
+		foreach ( $roleArrayCopy as $k => $v ) {
+			foreach ( $verifyList as $m => $n ) {
+				if ($n [0] == $k) {
+					array_splice ( $verifyList, $m, 1, $v );
+				}
+			}
+		}
+		
+		return $verifyList;
+	}
+	private function makeReceiptDetailCreate($data, $staff, $rid) {
+		
+		// 报销单详情
+		if (! empty ( $data ['officeData'] )) {
+			if ($data ['officeJson'] ['show']) {
+				foreach ( $data ['officeJson'] ['daily'] as $value ) {
+					if ($value ['price'] != 0) {
+						$itemData = array (
+								"staff" => $staff ['sid'],
+								"itemCategory" => $value ['category'],
+								"item" => $value ['name'],
+								"price" => $value ['price'],
+								"date" => date ( "Y-m-d" ),
+								"cid" => $data ['officeId'],
+								"rid" => $rid,
+								"status" => 4 
+						);
+						$this->ReceiptDetailCreate ( $itemData );
+					}
+				}
+				foreach ( $data ['officeJson'] ['other'] as $value ) {
+					if ($value ['price'] != 0) {
+						$itemData = array (
+								"staff" => $staff ['sid'],
+								"itemCategory" => $value ['category'],
+								"item" => $value ['name'],
+								"price" => $value ['price'],
+								"date" => date ( "Y-m-d" ),
+								"cid" => $data ['officeId'],
+								"rid" => $rid,
+								"status" => 4 
+						);
+						$this->ReceiptDetailCreate ( $itemData );
+					}
+				}
+			}
+		}
+		// 差旅相关费用
+		if (! empty ( $data ['traveData'] )) {
+			if ($data ['traveJson'] ['show']) {
+				foreach ( $data ['traveJson'] ['trave'] as $value ) {
+					if ($value ['price'] != 0) {
+						$itemData = array (
+								"staff" => $staff ['sid'],
+								"itemCategory" => $value ['category'],
+								"item" => $value ['name'],
+								"price" => $value ['price'],
+								"date" => date ( "Y-m-d" ),
+								"cid" => $data ['officeId'],
+								"rid" => $rid,
+								"status" => 4 
+						);
+						$this->ReceiptDetailCreate ( $itemData );
+					}
+				}
+			}
+		}
+		// 内部培训费用
+		if (! empty ( $data ['trainData'] )) {
+			if ($data ['trainJson'] ['show']) {
+				foreach ( $data ['trainJson'] ['train'] as $value ) {
+					if ($value ['price'] != 0) {
+						$itemData = array (
+								"staff" => $staff ['sid'],
+								"itemCategory" => $value ['category'],
+								"item" => $value ['name'],
+								"price" => $value ['price'],
+								"date" => date ( "Y-m-d" ),
+								"cid" => $data ['officeId'],
+								"rid" => $rid,
+								"status" => 4 
+						);
+						$this->ReceiptDetailCreate ( $itemData );
+					}
+				}
+			}
+		}
+	}
+	
+	// 新增报销单详情
+	public function ReceiptDetailCreate($data = array()) {
+		$receiptDetail = new receiptDetail ();
+		$receiptDetail->staff = $data ['staff'];
+		$receiptDetail->item = $data ['item'];
+		$receiptDetail->itemCategory = $data ['itemCategory'];
+		$receiptDetail->price = $data ['price'];
+		$receiptDetail->date = $data ['date'];
+		$receiptDetail->cid = $data ['cid'];
+		$receiptDetail->rid = $data ['rid'];
+		$receiptDetail->status = $data ['status'];
+		$receiptDetail->insert ();
+	}
+	public function num_to_rmb($num) {
+		$c1 = "零壹贰叁肆伍陆柒捌玖";
+		$c2 = "分角元拾佰仟万拾佰仟亿";
+		// 精确到分后面就不要了,所以只留两个小数位
+		$num = round ( $num, 2 );
+		// 将数字转化为整数
+		$num = $num * 100;
+		if (strlen ( $num ) > 10) {
+			return "金额太大,请检查";
+		}
+		$i = 0;
+		$c = "";
+		while ( 1 ) {
+			if ($i == 0) {
+				// 获取最后一位数字
+				$n = substr ( $num, strlen ( $num ) - 1, 1 );
+			} else {
+				$n = $num % 10;
+			}
+			// 每次将最后一位数字转化为中文
+			$p1 = substr ( $c1, 3 * $n, 3 );
+			$p2 = substr ( $c2, 3 * $i, 3 );
+			
+			if ($n != '0' || ($n == '0' && ($p2 == '亿' || $p2 == '万' || $p2 == '元'))) {
+				$c = $p1 . $p2 . $c;
+			} else {
+				$c = $p1 . $c;
+			}
+			$i = $i + 1;
+			// 去掉数字最后一位了
+			
+			$num = $num / 10;
+			// echo $num.'</br>';
+			$num = ( int ) $num;
+			// $num =floor($num);
+			// $num = round ( $num, 0, PHP_ROUND_HALF_DOWN );
+			// echo $num.'</br>';
+			// 结束循环
+			if ($num == 0) {
+				break;
+			}
+		}
+		// echo $c.'</br>';
+		$j = 0;
+		$slen = strlen ( $c );
+		while ( $j < $slen ) {
+			// utf8一个汉字相当3个字符
+			$m = substr ( $c, $j, 6 );
+			// 处理数字中很多0的情况,每次循环去掉一个汉字“零”
+			if ($m == '零元' || $m == '零万' || $m == '零亿' || $m == '零零') {
+				$left = substr ( $c, 0, $j );
+				$right = substr ( $c, $j + 3 );
+				$c = $left . $right;
+				$j = $j - 3;
+				$slen = $slen - 3;
+			}
+			$j = $j + 3;
+		}
+		// 这个是为了去掉类似23.0中最后一个“零”字
+		if (substr ( $c, strlen ( $c ) - 3, 3 ) == '零') {
+			$c = substr ( $c, 0, strlen ( $c ) - 3 );
+		}
+		// 将处理的汉字加上“整”
+		if (empty ( $c )) {
+			return "零元整";
+		} else {
+			return $c . "整";
+		}
+	}
+}
+?>

+ 17 - 0
protected/services/office_service.php

@@ -0,0 +1,17 @@
+<?php
+class office_service {
+	private $category;
+	function __construct() {
+		Doo::loadModel ( 'cld/category_cld' );
+		$this->category = new category_cld ();
+	}
+	
+	// 获得所有办事处
+	public function GetAll() {
+		$list = $this->category->GetAll ();
+		
+		return $list;
+	}
+}
+
+?>

+ 16 - 0
protected/services/region_service.php

@@ -0,0 +1,16 @@
+<?php
+class region_service {
+	private $region;
+	function __construct() {
+		Doo::loadModel ( 'cld/region_cld' );
+		$this->region = new region_cld ();
+	}
+	
+	// 获得区域
+	public function GetRegionTwo() {
+		$regionData = $this->region->GetLeveTwoTree ();
+		return $regionData;
+	}
+}
+
+?>

+ 24 - 22
protected/view/admin/approvalExpenses.html

@@ -157,28 +157,30 @@
 	  							 <!-- endif --> 
 	  							</td>
 	  							<td>
-	  							<!-- if {{receiptDetail' value.status}}==2&&in_array({{staff.0.sid}}, {{receiptDetail' value.nowStaffArray}}) --> 
-	  								<!-- if {{receiptDetail' value.Rtype}}==1 -->
-	  									<!-- if {{receiptDetail' value.isBK}}==1 -->
-	  									<a class="button" target="_blank" href="/receiptburEdi/{{receiptDetail' value.rid}}">去审批</a>
-	  									<!-- else -->
-	  									<a class="button" target="_blank" href="/expensesEdi/{{receiptDetail' value.rid}}">去审批</a>
-	  									<!-- endif --> 
-	  									
-	  								<!-- elseif {{receiptDetail' value.Rtype}}==2 --> 
-	  									<a class="button" target="_blank" href="/remitApproval/{{receiptDetail' value.rid}}">去审批</a>
-	  								<!-- elseif {{receiptDetail' value.Rtype}}==3 --> 
-	  <a class="button" target="_blank" href="/receiptTrain/approval/{{receiptDetail' value.ridKey}}.html">去审批</a>
-	  								<!-- elseif {{receiptDetail' value.Rtype}}==0 -->
-	  									<a class="button" target="_blank" href="/receiptburEdi/{{receiptDetail' value.rid}}">去审批</a>
-	  								<!-- endif -->
-	  							<!-- else --> 
-	  							<!-- if {{receiptDetail' value.Rtype}}==3 --> 
-	  							<a  target="_blank" href="/receiptTrain/approval/{{receiptDetail' value.ridKey}}.html">详情</a>
-	  							<!-- else -->
-	  							<a  target="_blank" href="/expensesDoc/{{receiptDetail' value.rid}}">详情</a>
-	  							<!-- endif --> 
-	  							<!-- endif --> 
+	  							
+		  							<!-- if {{receiptDetail' value.status}}==2&&in_array({{staff.0.sid}}, {{receiptDetail' value.nowStaffArray}}) --> 
+		  								<!-- if {{receiptDetail' value.Rtype}}==1 -->
+		  									<!-- if {{receiptDetail' value.isBK}}==1 -->
+		  									<a class="button" target="_blank" href="/receiptburEdi/{{receiptDetail' value.rid}}">去审批</a>
+		  									<!-- else -->
+		  									<a class="button" target="_blank" href="/expensesEdi/{{receiptDetail' value.rid}}">去审批</a>
+		  									<!-- endif --> 
+		  									
+		  								<!-- elseif {{receiptDetail' value.Rtype}}==2 --> 
+		  									<a class="button" target="_blank" href="/remitApproval/{{receiptDetail' value.rid}}">去审批</a>
+		  								<!-- elseif {{receiptDetail' value.Rtype}}==3 --> 
+		  <a class="button" target="_blank" href="/receiptTrain/approval/{{receiptDetail' value.ridKey}}.html">去审批</a>
+		  								<!-- elseif {{receiptDetail' value.Rtype}}==0 -->
+		  									<a class="button" target="_blank" href="/receiptburEdi/{{receiptDetail' value.rid}}">去审批</a>
+		  								<!-- endif -->
+		  							<!-- else --> 
+		  							<!-- if {{receiptDetail' value.Rtype}}==3 --> 
+		  							<a  target="_blank" href="/receiptTrain/approval/{{receiptDetail' value.ridKey}}.html">详情</a>
+		  							<!-- else -->
+		  							<a  target="_blank" href="/expensesDoc/{{receiptDetail' value.rid}}">详情</a>
+		  							<!-- endif --> 
+		  							<!-- endif --> 
+	  							
 	  							</td>
 	  						</tr>
 	  					<!-- endloop -->	

+ 1 - 1
protected/view/admin/invoiceAS.html

@@ -115,7 +115,7 @@
 							<!-- elseif {{list' value.sumPrice}}>{{list' value.invoicePrice}} -->
 							<b class="colOrange">¥{{list' value.sumPrice}}</b>
 							<!-- elseif {{list' value.sumPrice}}<{{list' value.invoicePrice}} -->
-							<b class="colRed">¥{{list' value.sumPrice}}</b>
+							<b class="colRed">¥{{list' value.diffPrice}}</b>
 							<!-- endif -->
 							</td>
 							

+ 275 - 0
protected/view/fee/approval/receipt.html

@@ -0,0 +1,275 @@
+<!-- include '../../comm/header' -->
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include '../../admin/menuReceipt' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<!-- include '../menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<div class="borad-news">
+					<legend>
+						<div class="fR"></div>
+						费用审批
+					</legend>
+
+					<div class="demandCate">
+						<ul class="cateList">
+							<li><a href="/approvalExpenses/pendApproval">返回</a></li>
+						</ul>
+					</div>
+
+
+					<div class="saeaList">
+
+
+						<div
+							class="entry <!-- if {{receipt.Rtype}}==1 -->  loan-list <!-- elseif  {{receipt.Rtype}}==0 --> receipt-list <!-- endif -->">
+							<div class="seTable reportTable">
+
+
+
+								<!-- if isset({{loan}}) -->
+								<table class="table table-bordered table-condensed table-hover">
+									<tbody>
+										<tr>
+											<th colspan="2" class="taC">借款费用</th>
+										</tr>
+										<!-- loop loan.loanItem.借款费用 -->
+										<tr>
+											<th>{{loanItem' value.name}}</th>
+											<td width="140" class="taR">¥{{loanItem' value.price}}</td>
+										</tr>
+										<!-- endloop -->
+										<tr>
+											<th>借款费用</th>
+											<td width="140" class="taR">¥{{loan.accountItem.cSum.loanSum}}</td>
+										</tr>
+										<tr>
+											<th class="taC" colspan="2">产生费用所在办事处</th>
+										</tr>
+										<tr>
+											<th style="text-align: center" colspan="2">{{loan.category}}</th>
+										</tr>
+										<tr>
+											<th class="taC" colspan="2">费用说明</th>
+										</tr>
+										<tr>
+											<td colspan="2">{{loan.explanation}}</td>
+										</tr>
+										<tr class="warning">
+											<td class="taR"><b>({{loan.receiptOrder}})本次费用合计</b></td>
+											<td class="taR"><b style="font-size: 24px">¥{{loan.sum}}</b><br>{{loan.BIGsum}}
+											</td>
+										</tr>
+									</tbody>
+								</table>
+								<br />
+								<!-- endif -->
+
+
+
+
+
+
+
+
+
+
+
+								<br />
+
+
+								<table class="table table-bordered table-condensed table-hover">
+									<tbody>
+										<tr>
+											<th colspan="2" class="taC">费用结算</th>
+										</tr>
+										<tr>
+											<th>结算结果<br>
+											<span class="colGray">("支出"由公司汇出,"收入"提交人需汇款至公司。)</span></th>
+											<td class="taR" width="200">
+												<!-- if {{receipt.Rtype}}==1 --> <!-- if {{receipt.relust}}>=0 -->
+												<span class="colRed">支出</span> <!-- else --> <span
+												class="colGreen">收入</span> <!-- endif --> <!-- else --> <span
+												class="colRed">支出</span> <!-- endif -->
+
+											</td>
+										</tr>
+										<tr>
+											<th>汇款金额</th>
+											<td class="taR" width="200">¥ <!-- if {{receipt.Rtype}}==1 -->
+												{{receipt.relustABS}} <!-- else --> {{receipt.sum}} <!-- endif -->
+											</td>
+										</tr>
+									</tbody>
+								</table>
+
+
+							</div>
+
+							<div
+								class="seCensor <!-- if {{receipt.Rtype}}==1 --> loan-censor <!-- else --> receipt-censor <!-- endif -->">
+								<form action="/updateApprovalReceipt" method="post" id="verifyOpinion_{{receipt.rid}}" name="verifyOpinion_{{receipt.rid}}">
+									<input type="hidden" id="status_{{receipt.rid}}" name="status" value=""></input> 
+									<input type="hidden" name="rid" value="{{receipt.rid}}"></input> 
+									<input type="hidden" name="amount" value="{{receipt.amount}}">
+									<div class="title">{{receipt.receiptOrder}}
+									</div>
+									<div class="reportButton clearfix" style="display:">
+
+										<!-- if {{receipt.button}}==4 -->
+										<a href="javascript:void(0)"
+											onClick="updateApprovalReceipt(1,{{receipt.rid}})"
+											class="buttonDone buttonBlock">同意支付</a>
+
+
+										<!-- endif -->
+									</div>
+									<div class="censorList clearfix censorHeight">
+										<ul>
+
+											<!-- if {{receiptList' value.Rtype}}==1 -->
+											<li class="post">
+												<div class="avtra">
+													<img src="{{receiptList' value.staffDetail.avatar}}_2.jpg"
+														width="32">
+												</div>
+												<div class="comment">
+													<p>
+														<span class="fR">{{loanReceiptDate}}</span>{{receiptList'
+														value.staffDetail.username}}
+													</p>
+													<p>提交审批</p>
+												</div>
+											</li> {{htmlLoan}}
+
+											<!-- endif -->
+
+
+											<!-- if {{empty(receiptDetail' value.rlList)}} -->
+											<li class="post">
+												<div class="avtra">
+													<img src="{{receiptList' value.staffDetail.avatar}}_2.jpg"
+														width="32">
+												</div>
+												<div class="comment">
+													<p>
+														<span class="fR"> <!-- if {{receiptList' value.Rtype}}==1 -->
+															{{receiptList' value.date}} <!-- else --> {{tijdate}} <!-- endif -->
+														</span>{{receiptList' value.staffDetail.username}}
+													</p>
+													<p>提交审批</p>
+												</div>
+											</li>
+											<!-- endif -->
+
+											<!-- loop receiptDetail' value.rlList -->
+											<li
+												<!-- if {{receiptDetail' value' value.status}}==1 -->
+												class="done" <!-- elseif {{receiptDetail' value' value.status}}==4 -->
+												class="back" <!-- elseif {{receiptDetail' value' value.status}}==2 -->
+												class="post" <!-- endif --> >
+												<div class="avtra">
+													<img src="{{receiptDetail' value' value.img}}_2.jpg"
+														width="32">
+												</div>
+												<div class="comment">
+													<p
+														<!-- if {{receiptDetail' value' value.status}}!=2 -->
+														class="colGray"
+														<!-- endif -->
+														><span class="fR">{{receiptDetail' value'
+															value.date}}</span>{{receiptDetail' value' value.username}}
+														<!-- if {{receiptDetail' value' value.rolename}}!='' -->
+														({{receiptDetail' value' value.rolename}})
+														<!-- endif -->
+													</p>
+													<p>{{receiptDetail' value' value.opinion}}</p>
+												</div>
+											</li>
+											<!-- endloop -->
+
+											<!-- loop receiptDetail' value.verifyList -->
+
+
+											<!-- if  {{receiptDetail' value' value.status}}!=1||{{empty(receiptDetail' value.rlList)}} -->
+											<li
+												<!-- if {{receiptDetail' value' value.status}}==1 -->
+												class="done" <!-- elseif {{receiptDetail' value' value.status}}==3 -->
+												class="undone" <!-- endif -->>
+												<div class="avtra">
+													<img src="{{receiptDetail' value' value.2}}_2.jpg"
+														width="32">
+												</div> <!-- if {{receiptDetail' value' value.status}}==4 -->
+												<div class="comment">
+													{{receiptDetail' value' value.1}}
+													<!-- if isset({{receiptDetail' value' value.rolename}}) -->
+													({{receiptDetail' value' value.rolename}})
+													<!-- endif -->
+													<p>
+														<textarea name="opinion"
+															id="opinion_{{receiptList' value.rid}}"
+															placeholder="填写审批意见(可选)"></textarea>
+													</p>
+												</div> <!-- else -->
+												<div class="comment">
+													<p class="colGray">
+														<span class="fR">{{receiptDetail' value'
+															value.date}}</span>{{receiptDetail' value' value.1}}
+														<!-- if isset({{receiptDetail' value' value.rolename}}) -->
+														({{receiptDetail' value' value.rolename}})
+														<!-- endif -->
+													</p>
+													<p>{{receiptDetail' value' value.opinion}}</p>
+												</div> <!-- endif -->
+											</li>
+											<!-- endif -->
+
+											<!-- endloop -->
+
+										</ul>
+									</div>
+									<div class="reportButton clearfix" style="display:">
+
+										<!-- if {{receiptDetail' value.button}}==4 -->
+
+										<a href="javascript:void(0)" p-d="{{receiptList' value.rid}}"
+											node-ReceiptBack="true"
+											class="buttonBack <!-- if {{receiptList' value.Rtype}}==1 --> buttonBlock  <!-- endif -->"
+											data-placement="top" data-toggle="ctooltip"
+											data-original-title="上报人修改后由你继续审批">撤回</a>
+										<!-- if {{receiptList' value.Rtype}}!=1 -->
+										<a href="javascript:void(0)"
+											onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})"
+											class="buttonUndone" data-placement="top"
+											data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
+										<!-- endif -->
+
+										<!-- endif -->
+									</div>
+								</form>
+							</div>
+
+						</div>
+
+					</div>
+
+				</div>
+
+			</div>
+		</div>
+	</div>
+	<script type="text/javascript">autoFlashHeight();</script>
+</body>

+ 471 - 0
protected/view/fee/approval/receipt_compatible.html

@@ -0,0 +1,471 @@
+<!-- include '../../comm/header' -->
+  <script src="<?= receipt ?>"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include '../../admin/menuReceipt' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						<!-- include '../../admin/receipt_menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight" style="height: 821px;">
+				<div class="borad-news">
+				<legend><div class="fR"></div>
+				费用审批
+				</legend>
+
+				<div class="demandCate">
+				<input type="hidden" name="status" value="{{receiptList.0.status}}"></input>
+					<ul class="cateList">
+						<li><a href="/approvalExpenses/pendApproval">返回</a></li>
+						<li><a id="examine" data="{{rid}}" href="javascript:void(0)">查看下一份费用审批</a></li>
+	  			</ul>
+	  		</div>
+	  		
+	  		
+	  		<div class="saeaList">
+	  		
+	  			<!-- loop receiptList -->
+	  			<div id="{{receiptList' value.Locate}}"  class="entry <!-- if {{receiptList' value.Rtype}}==1 -->  loan-list <!-- elseif  {{receiptList' value.Rtype}}==0 --> receipt-list <!-- endif -->">
+	  			
+	  			
+	  			
+	  			<div class="seTable reportTable">
+	  			<!-- if {{receiptList' value.Rtype}}==1 -->
+	  			
+	  			
+	  			<table class="table table-bordered table-condensed table-hover">
+							<tbody>
+							<tr class="warning"><td class="taR"><b>({{receiptDetail' value.receiptOrder}})本次费用合计</b></td>
+							<td class="taR"><b style="font-size:24px">¥{{receiptDetail' value.loanSum}}</b><br>{{receiptDetail' value.loanSumCN}}</td>
+							</tr>
+							
+							<tr><th class="taC" colspan="2">费用说明</th>
+							</tr><tr><td colspan="2">{{explanation}}</td></tr>
+							
+							<tr><th colspan="2" class="taC">借款费用</th></tr>
+							
+							<!-- loop receiptList' value.loanItem.借款费用 -->
+	  							<tr><th>{{receiptList' value' value.name}}</th><td  width="140" class="taR">¥{{receiptList' value' value.price}}</td></tr>
+	  						<!-- endloop -->
+							
+							<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
+							<tr><th style="text-align:center" colspan="2">{{receiptDetail' value.category}}</th></tr>
+							
+							
+							
+							
+							<tr class="warning" style="display:none"><td class="taR"><b>确认汇款金额</b></td>
+							<td class="taR"><b style="font-size:24px">¥{{receiptDetail' value.loanSum}}</b><br>{{receiptDetail' value.loanSumCN}}</td>
+							</tr>
+							
+							</tbody>
+						</table>
+				
+	  			<br/>
+	  			
+	  					
+	  					
+	  			<!-- endif -->
+	  			<!-- 报销单  -->
+	  					
+	  					<table class="table table-bordered table-condensed table-hover">
+	  					<tbody>
+	  						
+	  						<tr class="warning">
+	  						<td class="taR"><b>({{receiptDetail' value.receiptOrder}})本次费用总计</b></td>
+	  						<td class="taR"><b style="font-size:24px">¥{{receiptDetail' value.sum}}</b><br>{{receiptDetail' value.sumCN}}</td></tr>
+	  						
+	  					</tbody>
+	  					</table>	
+	  						
+	  						<!-- if !empty({{receiptDetail' value.officeJson}}) -->
+	  					<table class="table table-bordered table-condensed table-hover">
+	  					<tbody>
+	  						<tr class="warning"><td ><b>办事处相关费用合计</b></td>
+	  						<td class="colGreed taR"><b style="font-size:24px">¥{{receiptDetail' value.officeTotal}}</b></td></tr>
+	  						
+	  						
+	  						
+		  						<tr><th class="taC" colspan="2">报销说明</th></tr>
+		  						<tr><td colspan="2">{{receiptDetail' value.officeExplain}}</td></tr>
+		  						<tr><th colspan="2" class="taC">日常相关费用</th></tr>
+		  						<!-- loop receiptDetail' value.officeJson.daily -->
+		  							<!-- if {{item' value' value.price}}!=0 -->
+		  							<tr><th>{{item' value' value.name}}<div class="repMark fR"><i class="rmDone">●</i><i class="rmUdone">●</i><i class="rmClear">●</i></div></th><td  width="140" class="taR">¥{{item' value' value.price}}</td></tr>
+		  							<!-- endif -->
+		  						<!-- endloop -->
+		  						<tr><th class="taR">小计</th><td class="colGreen taR">¥{{receiptDetail' value.dailyTotal}}</td></tr>
+		  						<tr><th colspan="2" class="taC">其他</th></tr>
+		  						<!-- loop receiptDetail' value.officeJson.other -->
+		  							<!-- if {{item' value' value.price}}!=0 -->
+		  							<tr><th>{{item' value' value.name}}<div class="repMark fR"><i class="rmDone">●</i><i class="rmUdone">●</i><i class="rmClear">●</i></div></th><td  width="140" class="taR">¥{{item' value' value.price}}</td></tr>
+		  							<!-- endif -->
+		  						<!-- endloop -->
+		  						<tr><th class="taR">小计</th><td class="colGreen taR">¥{{receiptDetail' value.otherTotal}}</td></tr>
+	  						
+	  						
+	  						</tbody>
+	  					</table>
+	  						<!-- endif -->
+	  						
+	  						
+	  						<!-- if !empty({{receiptDetail' value.traveJson}}) -->
+	  						<table class="table table-bordered table-condensed table-hover">
+	  					<tbody>
+	  					
+	  						<tr class="warning"><td ><b>差旅相关费用合计</b></td>
+	  						<td class="colGreed taR"><b style="font-size:24px">¥{{receiptDetail' value.traveTotal}}</b></td></tr>
+	  						
+	  						<tr><th class="taC" colspan="2">报销说明</th></tr>
+		  						<tr><td colspan="2">{{receiptDetail' value.traveExplain}}</td></tr>
+		  						<tr><th colspan="2" class="taC">内部培训费用</th></tr>
+		  						<!-- loop receiptDetail' value.traveJson.traveList -->
+		  							<tr><th colspan="2" class="taL">行程{{item' value' value.index}}# {{item' value' value.tripTime}}<br>
+		  							<i class="contactsMark icon-">P</i> {{item' value' value.detailCity}}</th></tr>
+		  							<!-- 行程单简要详情 -->
+		  							<!-- loop item' value' value.detailTrip -->
+			  							<!-- if {{item' value' value' value}}!=0 -->
+			  							<tr>
+			  							<th>{{item' value' value' key}}<div class="repMark fR"><i class="rmDone">●</i><i class="rmUdone">●</i><i class="rmClear">●</i></div>
+			  							</th><td class="taR" width="140">¥{{item' value' value' value}}</td>
+			  							</tr>
+			  							<!-- endif -->
+		  							<!-- endloop -->
+		  							<tr><th class="taR">合计</th><td class="colGreen taR">¥{{item' value' value.tripTotal}}</td></tr>
+		  							<!-- 行程单详细内容 -->
+										<tr>
+											<td colspan="2">
+												<a href="#" class="close-detail" style="display: none">- 收起详细行程单</a><a href="#" class="open-detail">+ 展开详细行程单</a>
+												<table class="table table-bordered table-condensed table-hover mb-0" style="display: none">
+													
+													<!-- loop item' value' value.tripList -->
+													<!-- if countArray({{item' value' value.tripList}},-1)>{{item' value' value' key}} -->
+													<tr>
+														<th colspan="3" class="ta" width="140">
+														<i class="contactsMark icon-">P</i>{{item'  value' value'  value.goCome}}</th>
+													</tr>
+													<!-- 一段城市相关费用 -->
+													<!-- loop item' value' value' value.tripItem -->
+														<!-- if {{item' value' value' value' value.price}}!=0 -->
+														<tr>
+															<th width="140">{{item' value' value' value' value.name}}
+																<div class="repMark fR">
+																	<i class="rmDone">●</i><i class="rmUdone">●</i><i
+																		class="rmClear">●</i>
+																</div>
+															</th>
+															<td width="140" class="taR">¥{{item' value' value' value' value.price}}</td>
+															<td><pre>{{item' value' value' value' value.remark}}</pre></td>
+														</tr>
+														<!-- endif -->
+													<!-- endloop -->
+													<tr>
+														<th class="taR" width="140">旅途小计</th>
+														<td class="colGreen taR" colspan="2">¥{{item'  value' value'  value.subtotal}}</td>
+													</tr>
+													<!-- endif -->
+													<!-- endloop -->
+													
+													
+													
+													
+													
+													
+													
+												</table></td>
+										</tr>
+
+										<!-- endloop -->
+		  						
+	  						
+	  						
+	  						
+	  						
+	  						</tbody>
+	  					</table>
+	  						<!-- endif -->
+	  						
+	  						<!-- if !empty({{receiptDetail' value.trainJson}}) -->
+	  						<table class="table table-bordered table-condensed table-hover">
+	  					<tbody>
+	  					
+	  						<tr class="warning"><td ><b>内部培训费用合计</b></td>
+	  						<td class="colGreed taR"><b style="font-size:24px">¥{{receiptDetail' value.trainTotal}}</b></td></tr>
+	  						
+	  						<tr><th class="taC" colspan="2">报销说明</th></tr>
+		  						<tr><td colspan="2">{{receiptDetail' value.trainExplain}}</td></tr>
+		  						<tr><th colspan="2" class="taC">内部培训费用</th></tr>
+		  						<!-- loop receiptDetail' value.trainJson.train -->
+		  							<!-- if {{item' value' value.price}}!=0 -->
+		  							<tr><th>{{item' value' value.name}}<div class="repMark fR"><i class="rmDone">●</i><i class="rmUdone">●</i><i class="rmClear">●</i></div></th><td  width="140" class="taR">¥{{item' value' value.price}}</td></tr>
+		  							<!-- endif -->
+		  						<!-- endloop -->
+		  						<tr><th class="taR">小计</th><td class="colGreen taR">¥{{receiptDetail' value.trainTotal}}</td></tr>
+		  						
+	  						
+	  						
+	  						
+	  						
+	  						</tbody>
+	  					</table>
+					<!-- endif -->
+
+							<table class="table table-bordered table-condensed table-hover">
+	  					<tbody>
+	  						
+	  						
+	  						<!-- if {{status}}==2 -->
+	  						<tr><th colspan="2" class="taC">报销金额调整</th></tr>
+	  						<tr class="error"><td colspan="2" class="taR">
+	  						<form class="taR" style="margin:0" action="/revisePrice" method="post"  name="revisePrice_{{receiptList' value.rid}}">
+	  						<input type="text" name="description" placeholder="输入金额调整描述" class="span4"> ¥<span data-placement="top" data-toggle="ctooltip" data-original-title="扣款请在金额前加“-”">
+	  						<input type="number" name="price" placeholder="输入调整金额" pattern="[0-9]" step="0.01" class="span2"></span>
+	  						<input type="hidden" name="rid" value="{{receiptList' value.rid}}">
+	  						<input type="submit" value="添加" class="btn">
+	  						</form>
+	  						</td>
+	  						</tr>
+	  						<!-- elseif -->
+	  						<tr><th colspan="2" class="taC">报销金额调整</th></tr>
+	  						<!-- loop receiptList' value.reviseDetail -->
+	  						<tr><th><a href="/revocationAdjustment/{{receiptList' value' value.sidKey}}/{{receiptList' value' value.price}}/{{receiptList' value.ridKey}}/{{receiptList' value' value.reviseKey}}">撤销</a><span class="interval">|</span>{{receiptList' value' value.name}}:{{receiptList' value' value.description}}</th><td class="taR">¥{{receiptList' value' value.price}}</td></tr>
+	  						<!-- endloop -->
+	  						<tr><th class="taR">合计</th><td class="colOrange taR">¥{{receiptList' value.revisePrice}}</td></tr>
+	  						<!-- endif -->
+	  						
+	  						
+	  						
+	  						
+	  						<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
+	  						<tr><th style="text-align:center" colspan="2">{{receiptDetail' value.category}}</th></tr>
+	  						
+	  						<tr><th colspan="2" class="taC">收款信息</th></tr>
+							<tr><th>收款人户名</th>
+							<td>{{receiptDetail' value.remittanceName}}</td>
+							</tr>
+							<tr>
+							<th>收款银行</th>
+							<td>
+							<!-- if {{receiptDetail' value.remittanceBankType}}==0 -->
+							广发银行
+							<!-- elseif {{receiptDetail' value.remittanceBankType}}==1 -->
+							其他
+							<!-- endif -->
+							</td>
+							</tr>
+							<tr><th>收款开户银行名称</th><td>
+							{{receiptDetail' value.bankName}}
+							</td></tr>
+							<tr><th>收款账号</th><td>
+							{{receiptDetail' value.bankNumber}}
+							</td></tr>
+							<!-- if {{receiptDetail' value.remittanceBankType}}==1 -->
+							<tr><th>联行号</th><td>
+							{{receiptDetail' value.coupletNumber}}
+							</td></tr>
+							<!-- endif -->
+	  						
+	  						
+	  						
+	  						
+	  						
+	  						<tr><th class="taC" colspan="2">附件</th>
+	  						</tr>
+	  						<tr><td colspan="2">
+	  						
+	  						{{enclosurHtml}}
+	  						
+	  						</td></tr>
+	  						
+	  						
+	  						
+
+						</tbody>
+	  					</table>
+	  				
+	  				
+	  				<br/>
+	  				
+		
+		<table class="table table-bordered table-condensed table-hover">
+				<tbody>
+				<tr><th colspan="2" class="taC">费用结算</th></tr>
+				<tr><th>结算结果<br><span class="colGray">("支出"由公司汇出,"收入"提交人需汇款至公司。)</span></th>
+				<td class="taR" width="200">
+				<!-- if {{receiptList' value.Rtype}}==1 -->
+					<!-- if {{receiptDetail' value.relust}}>=0 -->
+					<span class="colRed">支出</span>
+					<!-- else -->
+					<span class="colGreen">收入</span>
+					<!-- endif -->
+				<!-- else -->
+				<span class="colRed">支出</span>
+				<!-- endif -->
+				
+				
+				</td>
+				</tr>
+				<tr><th>汇款金额</th><td class="taR" width="200">¥
+				<!-- if {{receiptList' value.Rtype}}==1 -->
+				{{receiptDetail' value.relustABS}}
+				<!-- else -->
+				{{receiptDetail' value.sum}}
+				<!-- endif -->
+				</td></tr>
+				</tbody>
+			</table>
+		
+	  				
+	  				</div>
+	  				
+	  				<div class="seCensor <!-- if {{receiptList' value.Rtype}}==1 --> loan-censor <!-- else --> receipt-censor <!-- endif -->">
+	  					<form action="/updateApprovalReceipt" method="post" id="verifyOpinion_{{receiptList' value.rid}}" name="verifyOpinion_{{receiptList' value.rid}}">
+	  						<input type="hidden" id="status_{{receiptList' value.rid}}" name="status" value=""></input>
+	  						<input type="hidden" name="rid" value="{{receiptList' value.rid}}"></input>
+	  						<input type="hidden" name="Locate" value="{{receiptList' value.Locate}}"></input>
+	  						<input type="hidden" name="amount" value="{{receiptList' value.amount}}">
+		  					<div class="title">
+		  					{{receiptDetail' value.receiptOrder}}
+		  					</div>		  					
+		  					<div class="reportButton clearfix" style="display:" >
+		  					
+		  						<!-- if {{receiptDetail' value.button}}==4 -->
+		  						<a href="javascript:void(0)" onClick="updateApprovalReceipt(1,{{receiptList' value.rid}})" class="buttonDone buttonBlock">同意支付</a>
+		  						
+	  						
+		  						<!-- endif -->
+		  					</div>
+		  					<div class="censorList clearfix censorHeight">
+		  					<ul>
+		  					
+		  					<!-- if {{receiptList' value.Rtype}}==1 -->
+		  					<li class="post" >
+		  							<div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"></div>
+		  							<div class="comment">
+		  								<p><span class="fR">{{loanReceiptDate}}</span>{{receiptList' value.staffDetail.username}}</p>
+		  								<p>提交审批</p>
+		  							</div>
+		  						</li>
+		  					
+		  					{{htmlLoan}}
+		  					
+		  					<!-- endif -->
+		  					
+		  					
+		  						<!-- if {{empty(receiptDetail' value.rlList)}} -->
+		  						<li class="post" >
+		  							<div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"></div>
+		  							<div class="comment">
+		  								<p><span class="fR">
+		  								<!-- if {{receiptList' value.Rtype}}==1 -->
+		  								{{receiptList' value.date}}
+		  								
+		  								<!-- else -->
+		  								{{tijdate}}
+		  								<!-- endif -->
+		  								</span>{{receiptList' value.staffDetail.username}}</p>
+		  								<p>提交审批</p>
+		  							</div>
+		  						</li>
+		  						<!-- endif -->
+		  					
+		  						<!-- loop receiptDetail' value.rlList -->
+		  						<li  <!-- if {{receiptDetail' value' value.status}}==1 --> class="done" <!-- elseif {{receiptDetail' value' value.status}}==4 --> class="back" <!-- elseif {{receiptDetail' value' value.status}}==2 --> class="post" <!-- endif --> >
+		  							<div class="avtra"><img src="{{receiptDetail' value' value.img}}_2.jpg" width="32"></div>
+		  							<div class="comment">
+		  								<p <!-- if {{receiptDetail' value' value.status}}!=2 --> class="colGray" <!-- endif --> ><span class="fR">{{receiptDetail' value' value.date}}</span>{{receiptDetail' value' value.username}} <!-- if {{receiptDetail' value' value.rolename}}!='' --> ({{receiptDetail' value' value.rolename}}) <!-- endif --></p>
+		  								<p>{{receiptDetail' value' value.opinion}}</p>
+		  							</div>
+		  						</li>
+		  						<!-- endloop -->
+		  						
+		  						<!-- loop receiptDetail' value.verifyList -->
+		  						
+		  						
+		  						<!-- if  {{receiptDetail' value' value.status}}!=1||{{empty(receiptDetail' value.rlList)}} -->
+			  						<li  <!-- if {{receiptDetail' value' value.status}}==1 --> class="done" <!-- elseif {{receiptDetail' value' value.status}}==3 --> class="undone"  <!-- endif -->>
+			  							<div class="avtra"><img src="{{receiptDetail' value' value.2}}_2.jpg" width="32"></div>
+			  							<!-- if {{receiptDetail' value' value.status}}==4 -->
+			  							<div class="comment">
+			  								{{receiptDetail' value' value.1}}<!-- if isset({{receiptDetail' value' value.rolename}}) --> ({{receiptDetail' value' value.rolename}}) <!-- endif -->
+			  								<p><textarea name="opinion" id="opinion_{{receiptList' value.rid}}" placeholder="填写审批意见(可选)"></textarea></p>
+			  							</div>
+			  							<!-- else -->
+			  							<div class="comment">
+			  								<p class="colGray"><span class="fR">{{receiptDetail' value' value.date}}</span>{{receiptDetail' value' value.1}}<!-- if isset({{receiptDetail' value' value.rolename}}) --> ({{receiptDetail' value' value.rolename}}) <!-- endif --></p>
+			  								<p>{{receiptDetail' value' value.opinion}}</p>
+			  							</div>
+			  							<!-- endif -->
+			  						</li>
+		  						<!-- endif -->
+		  						
+		  						<!-- endloop -->
+		  						
+		  					</ul>
+		  					</div>
+					<div class="reportButton clearfix" style="display:" >
+		  					
+		  						<!-- if {{receiptDetail' value.button}}==4 -->
+		  						
+		  						<a href="javascript:void(0)" p-d="{{receiptList' value.rid}}" node-ReceiptBack="true" class="buttonBack <!-- if {{receiptList' value.Rtype}}==1 --> buttonBlock  <!-- endif -->" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
+	  							<!-- if {{receiptList' value.Rtype}}!=1 -->
+	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
+	  							<!-- endif -->
+	  						
+		  						<!-- endif -->
+		  					</div>
+	  					</form>
+	  				</div>
+	  				
+	  			</div>
+	  		<!-- endloop -->
+	  		</div>
+	  		
+	  		</div>
+	  		
+			</div>
+		</div>
+	</div>
+<script type="text/javascript">
+autoFlashHeight();
+$(function(){
+	$("#banshi-sw").click(function(){
+	    $(this).toggleClass("active");$("#banshi").toggle();$(".banshi").toggle();
+	});
+	$("#chalv-sw").click(function(){
+	    $(this).toggleClass("active");$("#chalv").toggle();$(".chalv").toggle();
+	});
+	$("#neibupeixun-sw").click(function(){
+	    $(this).toggleClass("active");$("#neibupeixun").toggle();$(".neibupeixun").toggle();
+	});
+
+	$(".close-detail").click(function(){
+	    $(this).hide().siblings(".table").hide().siblings(".open-detail").show();
+	});
+	$(".open-detail").click(function(){
+	    $(this).hide().siblings(".table").show().siblings(".close-detail").show();
+	});
+	$("#open-jie").click(function(){
+	    $(this).parent("p").hide();
+	    $(this).parent("p").siblings("#jie-con").show();
+	    $(this).parent("p").siblings("#close").show();
+	});
+	$("#close-jie").click(function(){
+	    $(this).parent("#close").hide();
+	    $(this).parent("p").siblings("#jie-con").hide();
+	    $(this).parent("p").siblings("#open").show();
+	});
+});
+</script>	
+</body>

+ 72 - 0
protected/view/fee/create/loanDetail.html

@@ -0,0 +1,72 @@
+<div class="entry loan-list">
+    <div class="seTable">
+        <table class="table table-bordered table-condensed table-hover">
+            <tbody>
+                <tr>
+                    <th colspan="2" class="taC">借款费用{{loan.rid}}</th>
+                </tr>
+                <!-- loop loan.loanItem.借款费用 -->
+                <tr>
+                    <th>{{receiptList' value' value.name}}</th>
+                    <td width="140" class="taR">¥{{receiptList' value' value.price}}</td>
+                </tr>
+                <!-- endloop -->
+                <tr>
+                    <th>借款费用</th>
+                    <td width="140" class="taR">¥{{receiptList' value.accountItem.cSum.loanSum}}</td>
+                </tr>
+                <tr>
+                    <th class="taC" colspan="2">产生费用所在办事处</th>
+                </tr>
+                <tr>
+                    <th style="text-align:center" colspan="2">{{receiptDetail' value.category}}</th>
+                </tr>
+                <tr>
+                    <th class="taC" colspan="2">费用说明</th>
+                </tr>
+                <tr>
+                    <td colspan="2">{{receiptDetail' value.explanation}}</td>
+                </tr>
+                <tr class="warning">
+                    <td class="taR"><b>({{receiptDetail' value.receiptOrder}})本次费用合计</b></td>
+                    <td class="taR"><b
+                            style="font-size:24px">¥{{receiptDetail' value.sum}}</b><br>{{receiptDetail' value.BIGsum}}
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+    <div class="seCensor loan-censor">
+        <div class="title">
+            {{receiptDetail' value.receiptOrder}}
+        </div>
+        <div class="censorList">
+            <ul>
+                <li class="post">
+                    <div class="avtra"><img src="{{staff.0.avatar}}_2.jpg" width="32"></div>
+                    <div class="comment">
+                        <p><span class="fR">{{receiptDetail' value.date}}</span>{{staff.0.username}}</p>
+                        <p>提交审批</p>
+                    </div>
+                </li>
+                <!-- loop receiptDetail' value.verifyList -->
+                <li <!-- if {{receiptDetail' value' value.status}}==1 --> class="done"
+                    <!-- elseif {{receiptDetail' value' value.status}}==3 --> class="undone"
+                    <!-- endif -->>
+                    <div class="avtra"><img src="{{receiptDetail' value' value.2}}_2.jpg"></div>
+
+                    <div class="comment">
+                        <p class="colGray"><span
+                                class="fR">{{receiptDetail' value' value.date}}</span>{{receiptDetail' value' value.1}}
+                            <!-- if isset({{receiptDetail' value' value.rolename}}) -->
+                            ({{receiptDetail' value' value.rolename}})
+                            <!-- endif -->
+                        </p>
+                        <p>{{receiptDetail' value' value.opinion}}</p>
+                    </div>
+                </li>
+                <!-- endloop -->
+            </ul>
+        </div>
+    </div>
+</div>

+ 327 - 466
protected/view/fee/create/receipt.html

@@ -1,7 +1,13 @@
 <!-- include '../../comm/header' -->
 <link href="<?= WEB_SITE_GLOBAL ?>css/datepicker.min.css" rel="stylesheet" type="text/css">
-	<script src="<?= WEB_SITE_GLOBAL ?>js/datepicker.min.js"></script>
-	<script src="<?= WEB_SITE_GLOBAL ?>js/datepicker.zh.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/datepicker.min.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/datepicker.zh.js"></script>
+<style>
+	[v-cloak] {
+		display: none !important;
+	}
+</style>
+<script src="<?= vue ?>"></script>
 
 <body>
 	<div class="mainLayout">
@@ -17,475 +23,330 @@
 			<div class="subMenu fL">
 				<div class="menuItem">
 					<ul>
-						<li class="saeaTitle">费用管理</li>
-						<li><a href="saea-borad.html">公布板</a></li>
-						<li><a href="saea-myList.html" class="selected">我的费用</a></li>
-						<li><a href="saea-slist-1.html">费用汇总</a></li>
-						<li class="topLine"><a href="saea-reportList.html">费用审批</a></li>
-						<li><a href="saea-reportList-pay.html">费用执行</a></li>
-						<li><a href="saea-reportList-remit.html">费用汇款</a></li>
-						<li><a href="saea-dlist-category-year.html">公司汇总</a></li>
+						<!-- include '../menu' -->
 					</ul>
 				</div>
 			</div>
-			<div class="adminContent autoHeight">
-		  		<div class="borad-news">
-		  			<div class="fixedSide" id="fixedSide">
-		  				<ul>
-		  					<li class="banshi active"><a href="#banshi">办事处</a></li>
-		  					<li class="chalv" style="display: none;"><a href="#chalv">差旅相关</a></li>
-		  					<li class="neibupeixun" style="display: none;"><a href="#neibupeixun">内部培训</a></li>
-		  					<li class="shenpi"><a href="#shenpi">审批</a></li>
-		  				</ul>
-		  			</div>
-		  			<div style="margin-left:30px;">
-						<legend><div class="fR"></div>申请报销相关费用</legend>
-				  		<div class="saeaList" id="saeaList">
-				  			<h4 class="saeaTip">请选择一下需要报销的费用类型</h4>
-				  			<ul class="saeaType clearfix">
-				  				<li class="active" id="banshi-sw">
-				  					<i class="icon-">j</i>
-				  					办事处相关费用
-				  				</li>
-				  				<li id="chalv-sw">
-				  					<i class="icon-">j</i>
-				  					差旅相关费用
-				  				</li>
-				  				<li id="neibupeixun-sw">
-				  					<i class="icon-">j</i>
-				  					内部培训费用
-				  				</li>
-				  			</ul>
-				  			<!--办事处相关费用-->
-				  			<div class="entry receipt-list" id="banshi">
-				  				<div class="seTable">
-				  					<table class="table table-bordered table-condensed table-hover mb-0">
-				  					<tbody>
-				  						<tr><th colspan="2" class="taC">办事处相关费用</th></tr>
-				  						<tr><th>市内交通费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入市内交通费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>市内出租费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入市内出租费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>办事处房租</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入办事处房租" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>电话费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入电话费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>水费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入水费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>电费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入电费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>办公费用</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入办公费用" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>邮寄费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入邮寄费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>其他费用</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入其他费用" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th class="taR">小计</th><td class="colGreen taR">¥0.00</td></tr>
-				  						<tr><th colspan="2" class="taC">其他</th></tr>
-				  						<tr><th>公关费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入公关费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>广告费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入公关费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>借款</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入公关费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>可自加费用</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入可自加费用" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th class="taR">小计</th><td class="colGreen taR">¥0.00</td></tr>
-				  						<tr><th colspan="2" class="taC">公关费绑定发票</th></tr>
-				  						<tr><th class="colRed">如本次报销有公关费支出,确认是否涉需要绑定发票</th><td class="taR"><!-- <select class="span2"><option>绑定开票</option><option>不需要</option></select> --></td></tr>
-				  						<tr><th></th><td class="taR"><a class="button" href="#add-invoice" data-toggle="modal">添加发票</a></select></td></tr>
-						  								<tr><th>发票</a></th><td class="taR">公关费(¥500.00)</td></tr>
-						  								<tr><th><a href="#invdetail" data-toggle="modal">#F201909187362</a> <a class="fR">移除</a></th><td class="taR">¥<input type="number" value="0" placeholder="输入可自加费用" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr class="warning"><td class="taR"><b>办事处相关费用合计</b></td><td class="colGreed taR"><b style="font-size:24px">¥2160.00</b></td></tr><tr><th colspan="2" class="taC">报销说明</th></tr>
-				  						<tr><th colspan="2">
-				  									<textarea required rows="6" style="width:99%" placeholder="办事处相关费用说明"></textarea>
-				  						</th></tr>
-				  						</tbody>
-				  					</table>
-				  				</div>
-				  				<div class="seCensor receipt-censor">
-				  					<div class="title">
-				  					报销单填写说明
-				  					</div>
-					  				<div class="detail">
-					  					<p>1 办事处水电费标准100元,标准内实报;</p>
-					  					<p>2 <b>产生费用所在办事处</b> 默认使用您所在的第一个办事处;</p>
-					  					<p>3 邮寄费、公关费、办公费等详细说明请填写到 <b>报销说明</b>。</p>
-				  					</div>
-				  				</div>
-				  			</div>
-				  			<!--差旅相关费用-->
-				  			<div class="entry receipt-list" id="chalv"  style="display: none;">
-				  				<div class="seTable">
-				  					<table class="table table-bordered table-condensed mb-0">
-			  						<tbody>
-				  						<tr><th colspan="2" class="taC">差旅相关费用</th></tr>
-				  						<tr><td colspan="2">
-				  							<!--行程1-->
-				  							<table class="table table-bordered table-condensed table-hover" style="margin-bottom:5px">
-						  						<tr><th colspan="3" class="taC">行程1# 2020-01-03~2020-01-06<div class="fR "><a href="#del" class="text-danger" data-toggle="modal">删除</a> <a  href="#route-add" data-toggle="modal">编辑</a><div></th></tr>
-						  						<tr><th colspan="3" class="ta"><i class="contactsMark icon-">P</i> 珠海-广州</th></tr>
-						  						<tr><th width="90">往来交通费<p><a href="" class="icon-" title="增加费用">H</a></p></th><td class="taR" width="100">¥<input type="number" value="0" placeholder="输入往来交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="往来交通费说明"></textarea>
-						  						</th></tr>
-						  						<tr><th width="90">往来交通费2<p><a href="" class="icon-" title="移除费用">k</a></p></th><td class="taR" width="100">¥<input type="number" value="0" placeholder="输入往来交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="往来交通费说明"></textarea>
-						  						</th></tr>
-						  						<tr><th>市内交通费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入市内交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="市内交通费说明"></textarea></tr>
-						  						<tr><th>出差住宿费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差住宿费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差住宿费说明"></textarea></tr>
-						  						<tr><th>出差补助<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差补助" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差补助说明"></textarea></tr>
-						  						<tr><th>其他费用<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入其他费用" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="其他费用说明"></textarea></tr>
-						  						<tr><th colspan="3" class="ta"><i class="contactsMark icon-">P</i> 广州-东莞</th></tr>
-						  						<tr><th width="90">往来交通费</th><td class="taR" width="100">¥<input type="number" value="0" placeholder="输入场租费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="往来交通费说明"></textarea>
-						  						</th></tr>
-						  						<tr><th>市内交通费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入市内交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="市内交通费说明"></textarea></tr>
-						  						<tr><th>出差住宿费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差住宿费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差住宿费说明"></textarea></tr>
-						  						<tr><th>出差补助<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差补助" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差补助说明"></textarea></tr>
-						  						<tr><th>其他费用<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入其他费用" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="其他费用说明"></textarea></tr>
-						  						<tr><th colspan="3" class="ta"><i class="contactsMark icon-">P</i> 东莞-珠海</th></tr>
-						  						<tr><th width="90">往来交通费</th><td class="taR" width="100">¥<input type="number" value="0" placeholder="输入往来交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="往来交通费说明"></textarea>
-						  						</th></tr>
-						  						<tr><th>市内交通费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入市内交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="市内交通费说明"></textarea></tr>
-						  						<tr><th>出差住宿费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差住宿费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差住宿费说明"></textarea></tr>
-						  						<tr><th>出差补助<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差补助" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差补助说明"></textarea></tr>
-						  						<tr><th>其他费用<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入其他费用" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="其他费用说明"></textarea></tr>
-						  						<tr><th colspan="3" class="taC">行程1# 小计</th></tr>
-						  						<tr><th>往来交通费</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th>市内交通费</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th>出差住宿费</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th>出差补助</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th>其他费用</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th class="taR">合计</th><td class="colGreen taR" colspan="2">¥0.00</td></tr>
-						  					</table>
-				  							<!--行程2-->
-				  							<table class="table table-bordered table-condensed table-hover"style="margin-bottom:5px">
-						  						<tr><th colspan="3" class="taC">行程2# 2020-01-11~2020-01-15<div class="fR "><a href="#del" class="text-danger" data-toggle="modal">删除</a> <a  href="#route-add" data-toggle="modal">编辑</a><div></th></th></tr>
-						  						<tr><th colspan="3" class="ta"><i class="contactsMark icon-">P</i> 珠海-中山</th></tr>
-						  						<tr><th width="90">往来交通费<p><a href="" class="icon-" title="增加费用">H</a></p></th><td class="taR" width="100">¥<input type="number" value="0" placeholder="输入往来交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="往来交通费说明"></textarea>
-						  						</th></tr>
-						  						<tr><th>市内交通费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入市内交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="市内交通费说明"></textarea></tr>
-						  						<tr><th>出差住宿费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差住宿费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差住宿费说明"></textarea></tr>
-						  						<tr><th>出差补助<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差补助" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差补助说明"></textarea></tr>
-						  						<tr><th>其他费用<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入其他费用" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="其他费用说明"></textarea></tr>
-						  						<tr><th colspan="3" class="ta"><i class="contactsMark icon-">P</i> 中山-珠海</th></tr>
-						  						<tr><th width="90">往来交通费</th><td class="taR" width="100">¥<input type="number" value="0" placeholder="输入场租费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="往来交通费说明"></textarea>
-						  						</th></tr>
-						  						<tr><th>市内交通费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入市内交通费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="市内交通费说明"></textarea></tr>
-						  						<tr><th>出差住宿费<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差住宿费" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差住宿费说明"></textarea></tr>
-						  						<tr><th>出差补助<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入出差补助" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="出差补助说明"></textarea></tr>
-						  						<tr><th>其他费用<p><a href="" class="icon-" title="增加费用">H</a></p></th>
-						  						</th><td class="taR" >¥<input type="number" value="0" placeholder="输入其他费用" pattern="[0-9]" step="1" min="0" class="span1"></td><th>
-						  									<textarea required rows="2" style="width:99%;margin-bottom:0" placeholder="其他费用说明"></textarea></tr>
-						  						<tr><th colspan="3" class="taC">行程2# 小计</th></tr>
-						  						<tr><th>往来交通费</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th>市内交通费</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th>出差住宿费</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th>出差补助</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th>其他费用</th><td class="taR" width="200" colspan="2">¥150.00</td></tr>
-						  						<tr><th class="taR">合计</th><td class="colGreen taR" >¥0.00</td><td></td></tr>
-						  					</table>
-				  						</td></tr>
-				  						<tr><th colspan="2" class="taC"><a href="#route-add" data-toggle="modal" class="button">添加新行程</a></th></tr>
-				  						<tr><th colspan="2" class="taC">差旅相关费用合计</th></tr>
-				  						<tr><th>往来交通费</th><td class="taR" width="200">¥150.00</td></tr>
-				  						<tr><th>市内交通费</th><td class="taR" width="200">¥150.00</td></tr>
-				  						<tr><th>出差住宿费</th><td class="taR" width="200">¥150.00</td></tr>
-				  						<tr><th>出差补助</th><td class="taR" width="200">¥150.00</td></tr>
-				  						<tr><th>其他费用</th><td class="taR" width="200">¥150.00</td></tr>
-				  						<tr class="warning"><td class="taR"><b>差旅相关费用合计</b></td><td class="colGreed taR"><b style="font-size:24px">¥495.00</b></td></tr>
-				  						<tr><th colspan="2" class="taC">报销说明</th></tr>
-				  						<tr><th colspan="2">
-				  									<textarea required rows="6" style="width:99%" placeholder="差旅相关费用额外说明"></textarea>
-				  						</th></tr>
-				  						</tbody>
-				  					</table>
-				  				</div>
-				  				<div class="seCensor receipt-censor">
-				  					<div class="title">
-				  					报销单填写说明
-				  					</div>
-					  				<div class="detail">
-					  					<p>1 请按先后发生顺序填写报销明细,交通费(市内交通费及往来交通费)、邮寄费需在批注明注明费用明细(例:珠海-广州70元-佛山20元);</p>
-					  					<p>2 出差补助30元/天,不需提供发票,只需在报销单上填写清楚;</p>
-					  					<p>3 <b>产生费用所在办事处</b> 默认使用您所在的第一个办事处。</p>
-				  					</div>
-				  					<div class="itinerary">
-				  						<h2 class="itineraryTitle">总行程单</h2>
-				  						<div class="itineraryCon">
-				  							<ul>
-				  								<li class="sub-title">行程1# 2020-01-01-2020-01-06</li>
-				  								<li>
-				  									<div class="itineraryList">
-							  							<div class="addressName"><i class="contactsMark icon-">P</i> <b>珠海</b></div>
-							  							<div class="pointLine">
-							  								<div class="timeList">
-							  									<div class="priceList">
-																	<span class="priceTitle">小计</span>
-																	<span class="price">¥1212.00</span>
-																</div>
-							  								</div>
-							  							</div>
-							  						</div>
-				  								</li>
-				  								<li>
-				  									<div class="itineraryList">
-							  							<div class="addressName"><i class="contactsMark icon-">P</i> <b>广州</b></div>
-							  							<div class="pointLine">
-							  								<div class="timeList">
-							  									<div class="priceList">
-																	<span class="priceTitle">小计</span>
-																	<span class="price">¥1212.00</span>
-																</div>
-							  								</div>
-							  							</div>
-							  						</div>
-				  								</li>
-				  								<li>
-				  									<div class="itineraryList">
-							  							<div class="addressName"><i class="contactsMark icon-">P</i> <b>东莞</b></div>
-							  							<div class="pointLine">
-							  								<div class="timeList">
-							  									<div class="priceList">
-																	<span class="priceTitle">小计</span>
-																	<span class="price">¥1212.00</span>
-																</div>
-							  								</div>
-							  							</div>
-							  						</div>
-				  								</li>
-				  								<li>
-				  									<div class="itineraryList">
-							  							<div class="addressName"><i class="contactsMark icon-">P</i> <b>珠海</b></div>
-							  						</div>
-				  								</li>
-				  								<li class="sub-title">行程1# 合计:3636.00</li>
-				  							</ul>
-				  							<ul>
-				  								<li class="sub-title">行程2# 2020-01-11~2020-01-15</li>
-				  								<li>
-				  									<div class="itineraryList">
-							  							<div class="addressName"><i class="contactsMark icon-">P</i> <b>珠海</b></div>
-							  							<div class="pointLine">
-							  								<div class="timeList">
-							  									<div class="priceList">
-																	<span class="priceTitle">小计</span>
-																	<span class="price">¥1212.00</span>
-																</div>
-							  								</div>
-							  							</div>
-							  						</div>
-				  								</li>
-				  								<li>
-				  									<div class="itineraryList">
-							  							<div class="addressName"><i class="contactsMark icon-">P</i> <b>中山</b></div>
-							  							<div class="pointLine">
-							  								<div class="timeList">
-							  									<div class="priceList">
-																	<span class="priceTitle">小计</span>
-																	<span class="price">¥1212.00</span>
-																</div>
-							  								</div>
-							  							</div>
-							  						</div>
-				  								</li>
-				  								<li>
-				  									<div class="itineraryList">
-							  							<div class="addressName"><i class="contactsMark icon-">P</i> <b>珠海</b></div>
-							  						</div>
-				  								</li>
-				  								<li class="sub-title">行程2# 合计:3636.00</li>
-				  							</ul>
-				  						</div>
-				  					</div>
-				  				</div>
-				  			</div>
-				  			<!--内部培训-->
-				  			<div class="entry receipt-list" id="neibupeixun" style="display: none;">
-				  				<div class="seTable">
-				  					<table class="table table-bordered table-condensed table-hover mb-0">
-				  					<tbody>
-				  						<tr><th colspan="2" class="taC" id="neibupeixun">内部培训费用</th></tr>
-				  						<tr><th>场租费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入场租费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>薪酬</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入薪酬" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>住宿费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入住宿费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>交通费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入交通费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>餐饮费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入餐饮费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>办公费</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入办公费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>餐费补助</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入公关费" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th>其他</th><td  width="200" class="taR">¥<input type="number" value="0" placeholder="输入其他" pattern="[0-9]" step="1" min="0" class="span2"></td></tr>
-				  						<tr><th class="taR">合计</th><td class="colGreen taR">¥0.00</td></tr>
-				  						<tr class="warning"><td class="taR"><b>内部培训费用合计</b></td><td class="colGreed taR"><b style="font-size:24px">¥2160.00</b></td></tr>
-				  						<tr><th colspan="2" class="taC">报销说明</th></tr>
-				  						<tr><th colspan="2">
-				  									<textarea required rows="6" style="width:99%" placeholder="内部培训费用说明"></textarea>
-				  						</th></tr>
-				  						</tbody>
-				  					</table>
-				  				</div>
-				  				<div class="seCensor receipt-censor">
-				  					<div class="title">
-				  					报销单填写说明
-				  					</div>
-					  				<div class="detail">
-					  					<p>1 此项费用,仅用于纵横内部培训;</p>
-										<p>2 用于客户的培训费用,请创建“培训班结算”。</p>
-				  					</div>
-				  				</div>
-				  			</div>
-				  			<!--审批流程等-->
-				  			<div class="entry receipt-list" id="shenpi">
-				  				<div class="seTable">
-				  					<table class="table table-bordered table-condensed table-hover mb-0">
-				  						<tr class="warning"><td class="taR"><b>本次报销费用总计</b></td><td class="colGreed taR"><b style="font-size:24px">¥4815.00</b></td></tr>
-				  						<tr><th colspan="2" class="taC">附件</th></tr>
-				  						<tr><td colspan="2">
-				  							<input type="file"><a class="btn btn-primary btn-mini">上传</a>&nbsp;&nbsp;<span>支持jpg、png、doc、docx、els、elsx;最大8M文件。</span>
-				  							<!--已上传文件-->
-				  							<table class="table">
-				  								<thead><th>文件名</th><th>大小</th><th>操作</th></thead>
-				  								<tbody>
-				  									<tr><td><a href="#" target="_blank">发票1.jpg</a></td><td>20kb</td><td><a href="">删除</a></td></tr>
-				  									<tr><td><a href="#" target="_blank">QQ截图20150624170045.png</a></td><td>171kb</td><td><a href="">删除</a></td></tr>
-				  									<tr><td><a href="#" target="_blank">Doc1.docx</a></td><td>47kb</td><td><a href="">删除</a></td></tr>
-				  								</tbody>
-				  							</table>
-				  							<!--已上传文件-->
-				  						</td></tr>
-				  						<tr><th colspan="2" class="taC">报销单审批</th></tr>
-										<tr>
-											<th id="shenpi">选择审批组</th>
-											<td class="taR"><select><option>通用组(何银龄 >  谭玉堂 >赵淑燕)</option></select></td>
-										</tr>
-										<tr><th colspan="2" class="taC">产生费用所在办事处</th></tr>
-										<tr>
-											<th>选择办事处</th>
-											<td class="taR"><select class="span2"><option>总部</option></select></td>
-										</tr>
-										<tr><th colspan="2" class="taC">汇款信息</th></tr>
-										<tr><th>汇款人户名</th><td><input type="text" placeholder="请输入汇款人户名" value="刘飞"></td></tr>
-										<tr><th>汇款开户银行名称</th><td><input type="text" placeholder="请输入汇款开户银行名称" value="建行西安长安路支行"></td></tr>
-										<tr><th>汇款帐号</th><td><input type="text" placeholder="请输入汇款帐号" value="61001720015050000695"></td></tr>
-										<tr><th class="tipFather">联行号&nbsp;<div class="tipContent"><span class="tipGray">?</span><div class="tipConactive"><p>1.如果不是公司广发,务必填上银行联行号</p><p>2.如不清楚银行联行号请咨询报销查款专用 QQ:2870766094</p></div></div></th><td><input type="text" placeholder="请输入联行号" value=""></td></tr>
-				  					</table>
-				  				</div>
-				  				<div class="seCensor receipt-censor">
-				  					<div class="title">
-				  					审批流程
-				  					</div>
-				  				</div>
-				  			</div>
-				  			<div class="btn-display"><a href="saea-confirm.html" class="button">生成报销单 >></a></div>
+			<div class="adminContent autoHeight" id="receipt_create">
+
+
+
+				<div class="borad-news">
+
+					<div class="popupTip" :style="{display: displayStsates}" ref="alertMsg" v-cloak>
+						<span class="popupTipText">{{ aletMsg }}</span>
+					</div>
+					<div class="fixedSide" id="fixedSide">
+						<ul>
+							<li v-bind:class="{ active: menu.active }" v-show="menu.show"
+								v-for="menu in receiptTypeMenu" v-cloak>
+								<a :href="'#'+menu.anchor "
+									@click="navigation(receiptTypeMenu,menu)">{{ menu.name }}</a>
+							</li>
+							<li>
+								<a href="#shenpi">审批</a>
+							</li>
+						</ul>
+					</div>
+					<div style="margin-left: 30px;">
+						<legend>
+							<div class="fR"></div>
+							申请报销相关费用
+						</legend>
+						<div class="saeaList" id="saeaList">
+
+
+
+
+							
+							<!-- if isset({{loan}}) -->
+							<div class="entry loan-list">
+								<div class="seTable">
+									<table class="table table-bordered table-condensed table-hover">
+										<tbody>
+											<tr>
+												<th colspan="2" class="taC">借款费用</th>
+											</tr>
+											<!-- loop loan.loanItem.借款费用 -->
+											<tr>
+												<th>{{loanItem' value.name}}</th>
+												<td width="140" class="taR">¥{{loanItem' value.price}}</td>
+											</tr>
+											<!-- endloop -->
+											<tr>
+												<th>借款费用</th>
+												<td width="140" class="taR">¥{{loan.accountItem.cSum.loanSum}}</td>
+											</tr>
+											<tr>
+												<th class="taC" colspan="2">产生费用所在办事处</th>
+											</tr>
+											<tr>
+												<th style="text-align:center" colspan="2">{{loan.category}}</th>
+											</tr>
+											<tr>
+												<th class="taC" colspan="2">费用说明</th>
+											</tr>
+											<tr>
+												<td colspan="2">{{loan.explanation}}</td>
+											</tr>
+											<tr class="warning">
+												<td class="taR"><b>({{loan.receiptOrder}})本次费用合计</b></td>
+												<td class="taR"><b
+														style="font-size:24px">¥{{loan.sum}}</b><br>{{loan.BIGsum}}
+												</td>
+											</tr>
+										</tbody>
+									</table>
+								</div>
+								<div class="seCensor loan-censor">
+									<div class="title">
+										{{loan.receiptOrder}}
+									</div>
+									<div class="censorList">
+										<ul>
+											<li class="post">
+												<div class="avtra"><img src="{{staff.avatar}}_2.jpg" width="32"></div>
+												<div class="comment">
+													<p><span class="fR">{{loan.date}}</span>{{staff.username}}</p>
+													<p>提交审批</p>
+												</div>
+											</li>
+											<!-- loop loan.verifyList -->
+											<li <!-- if {{loan'  value.status}}==1 --> class="done"
+												<!-- elseif {{verifyList'  value.status}}==3 --> class="undone"
+												<!-- endif -->>
+												<div class="avtra"><img src="{{verifyList'  value.2}}_2.jpg"></div>
+							
+												<div class="comment">
+													<p class="colGray"><span
+															class="fR">{{verifyList' value.date}}</span>{{verifyList'  value.1}}
+														<!-- if isset({{verifyList'  value.rolename}}) -->
+														({{verifyList' value.rolename}})
+														<!-- endif -->
+													</p>
+													<p>{{verifyList'  value.opinion}}</p>
+												</div>
+											</li>
+											<!-- endloop -->
+										</ul>
+									</div>
+								</div>
+							</div>
+
+
+							<!-- endif -->
+
+							
+
+
+
+
+
+
+
+
+
+
+							
+
+
+							<h4 class="saeaTip">请选择一下需要报销的费用类型</h4>
+							<ul class="saeaType clearfix">
+								<li @click="selectReceipt($event,menu)" v-bind:class="{ active: menu.show }" v-for="menu in receiptTypeMenu" v-cloak>
+									<i class="icon-">j</i>{{ menu.name }}
+								</li>
+							</ul>
+
+							<div v-for="menu in receiptTypeMenu" :id="menu.anchor" v-show="menu.show"
+								class="entry receipt-list" v-cloak>
+								<!--办事处相关费用-->
+								<div v-if="menu.id===0">
+									<office :daily="menu.daily" :other="menu.other"
+										:office-explain="menu.officeExplain"></office>
+								</div>
+								<!--差旅相关费用-->
+								<div v-else-if="menu.id===1">
+									<trave :trave-item="menu.trave" :trave-list="menu.traveList" :alert-dia="alertDia"
+										:trave-explain="menu.traveExplain"></trave>
+								</div>
+								<!--内部培训-->
+								<div v-else-if="menu.id===2">
+									<train :train="menu.train" :train-explain="menu.trainExplain"></train>
+								</div>
+							</div>
+
+
+							<!--审批流程等-->
+							<form id="receiptCreate" action="{{action}}" method="POST" @submit="checkReceipt">
+								<div class="entry receipt-list" id="shenpi">
+									<div class="seTable">
+										<table class="table table-bordered table-condensed table-hover mb-0">
+											<tr class="warning">
+												<td class="taR"><b>本次报销费用总计</b></td>
+												<td class="colGreed taR"><b style="font-size: 24px"
+														v-cloak>¥{{ receiptPrice }}</b></td>
+											</tr>
+											<tr>
+												<th colspan="2" class="taC">附件</th>
+											</tr>
+											<tr>
+												<td colspan="2"><input type="file" @change="enclosurFile($event)"
+														accept="image/png,image/gif,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document
+													,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel">
+													&nbsp;&nbsp;<span>支持jpg、png、doc、docx、els、elsx;最大8M文件。</span>
+													<!--已上传文件-->
+													<table class="table">
+														<thead>
+															<th>文件名</th>
+															<th>大小</th>
+															<th>操作</th>
+														</thead>
+														<tbody>
+
+															<!-- loop enclosurList -->
+															<tr id="{{enclosurList' value.eidKey}}">
+																<td><a href="/upload/swfupload/{{enclosurList' value.name}}" target="_blank">{{enclosurList' value.name}}</a></td>
+																<td></td>
+																<td><a href="javascript:void(0)" onclick="delEnclosurByKey('{{enclosurList' value.eidKey}}')">删除</a></td>
+																</tr>
+															<!-- endloop -->
+
+															<tr v-for="(item,index) in enclosurFiles">
+																<td>{{ item.name }}</td>
+																<td>{{ item.size }}</td>
+																<td><a href="javascript:void(0)"
+																		@click="enclosurFileDel(index)">删除</a></td>
+															</tr>
+														</tbody>
+													</table>
+													<!--已上传文件-->
+												</td>
+											</tr>
+											<tr>
+												<th colspan="2" class="taC">报销单审批</th>
+											</tr>
+											<tr>
+												<th id="shenpi">选择审批组</th>
+												<td class="taR">
+													<select name="verifyId" v-model="verifyId">
+														<option value="">请选择审批组</option>
+														<option v-for="item in verify" v-bind:value="item.vid">
+															{{ item.description }}({{ item.staff }})</option>
+													</select>
+												</td>
+											</tr>
+											<tr>
+												<th colspan="2" class="taC">产生费用所在办事处</th>
+											</tr>
+											<tr>
+												<th>选择办事处</th>
+												<td class="taR">
+													<select name="officeId"  class="span2">
+														<!-- loop office -->
+														<option <!-- if {{office' value.cid}}=={{officeId}} -->
+															selected
+															<!-- endif --> value="{{office' value.cid}}"
+															>{{office' value.title}}</option>
+														<!-- endloop -->
+													</select>
+
+												</td>
+											</tr>
+
+											<tr>
+												<th colspan="2" class="taC">收款信息</th>
+											</tr>
+											<tr>
+												<th>收款人户名</th>
+												<td><input type="text" name="remittanceName" id="remittanceName"
+														value="{{staff.remittanceName}}" placeholder="请输入收款人户名"></td>
+											</tr>
+
+											<tr>
+												<th>收款银行</th>
+												<td>
+													<select node-rbt name="remittanceBankType"
+														v-model="remittanceBankType">
+														<option value="0">广发银行</option>
+														<option value="1">其他</option>
+													</select>
+												</td>
+											</tr>
+
+											<tr>
+												<th>收款开户银行名称</th>
+												<td>
+													<input type="text" name="bankName" id="bankName"
+														value="{{staff.bankName}}" placeholder="请输入收款开户银行名称">
+												</td>
+											</tr>
+											<tr>
+												<th>收款账号</th>
+												<td>
+													<input type="text" placeholder="请输入收款账号" id="bankNumber"
+														name="bankNumber" value="{{staff.bankNumber}}">
+												</td>
+											</tr>
+											<tr node-cn v-if="remittanceBankType==1" v-cloak>
+												<th class="tipFather">联行号&nbsp;<div class="tipContent"><span
+															class="tipGray">?</span>
+														<div class="tipConactive">
+															<p>1.如果不是公司广发,务必填上银行联行号</p>
+															<p>2.如不清楚银行联行号请咨询报销查款专用 QQ:2870766094</p>
+														</div>
+													</div>
+												</th>
+												<td>
+													<input type="text" placeholder="请输入联行号" id="coupletNumber"
+														name="coupletNumber" value="{{staff.coupletNumber}}">
+												</td>
+											</tr>
+										</table>
+									</div>
+									<div class="seCensor receipt-censor">
+										<div class="title">审批流程</div>
+									</div>
+								</div>
+								<div class="btn-display">
+									<!-- if isset({{receiptId}}) -->
+									<input type="hidden" name="receiptId" value="{{receiptId}}">
+									<!-- endif -->
+									<input type="hidden" name="officeData" ref='officeData_input'>
+									<input type="hidden" name="traveData" ref='traveData_input'>
+									<input type="hidden" name="trainData" ref='trainData_input'>
+									<input type="hidden" name="enclosurFiles" ref='enclosurFiles_input'>
+
+
+									<input type="submit" class="button" value="生成报销单 >>">
+
+
+								</div>
+							</form>
+
 						</div>
 					</div>
 				</div>
-		</div>
-	</div>
-	<!--弹出 添加行程 -->
-    <div class="modal hide fade" id="route-add">
-        <div class="modal-dialog">
-            <div class="modal-content">
-                <div class="modal-header">
-                    <h3>添加行程</h3>
-                </div>
-                <div class="modal-body saeaList">
-					<table class="table table-bordered table-condensed">
-						<tr><th class="taC" colspan="2">行程</th></tr>
-						<tr><th>出发/结束日期</th><td>
-									<input class="datepicker-here span3" placeholder="按时间筛选" type="text" data-range="true"
-							    data-multiple-dates-separator=" - "
-							    data-language="zh"></td></tr>
-						<tr><th><span class="">┌</span> 出发地</th><td><select><option>广东省</option></select><select><option>珠海市</option></select></td></tr>
-						<tr><th><span class="">├</span> 目的地</th><td><select><option>广东省</option></select><select><option>广州市</option></select><a href="">+添加目的地</a> <a href="">-移除</a></td></tr>
-						<tr><th><span class="">├</span> 目的地</th><td><select><option>广东省</option></select><select><option>东莞市</option></select><a href="">+添加目的地</a> <a href="">-移除</a></td></tr>
-						<tr><th><span class="">└</span> 结束</th><td><select><option>广东省</option></select><select><option>珠海市</option></select></td></tr>
-					</table>
-                </div>
-                <div class="modal-footer">
-                	<a href="#" class="button" data-dismiss="modal" aria-hidden="true">确认</a>
-                    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
-                </div>
-            </div>
-        </div>
-    </div>
-	<!--结束 弹出 添加行程 -->
-	<!--移除-->
-	<div class="modal hide fade" id="del">
-		<div class="modal-dialog">
-			<div class="modal-content">
-			<div class="modal-header">
-			<h3>确认删除</h3>
-			</div>
-			<div class="modal-body">
-				请确认是否移除改行程。
-			</div>
-			<div class="modal-footer">
-					<a href="#" class="button">确定移除</a>
-					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
-			</div>
 			</div>
 		</div>
-	</div>
-			<!--移除-->
-<script type="text/javascript">autoFlashHeight();</script>
-
-<script>
-    $(function () {
-        var fixedSide = $("#fixedSide");
-        var entry = $(".entry");
-        var mainTopArr = new Array();
-        for(
-        	var i=0;i<entry.length;i++){
-            var top = entry.eq(i).offset().top;
-            mainTopArr.push(top);
-        }
-        $(".autoHeight").scroll(function(){
-            var scrollTop = $(this).scrollTop();
-            var k;
-            for(
-            	var i=0;i<mainTopArr.length;i++)
-            	{
-	                if(scrollTop>=mainTopArr[i]){
-	                    k=i;
-                }
-            }
-            fixedSide.find("li").eq(k).addClass("active").siblings().removeClass("active");
-        });
-        $('.fixedSide li').click(function(){
-			var t = $('#saeaList .entry').eq($(this).index()).offset().top;
-			$('body,html').animate({"scrollTop":t},500);
-			$(this).addClass('active').siblings().removeClass('active');
-		});
-    });
-    
-
-</script>
-</body>
+		
+		<script type="text/javascript">
+			autoFlashHeight();
+			let accountItem = JSON.parse('{{accountItem}}');
+			let region = JSON.parse('{{region}}');
+			let verify = JSON.parse(`{{verify}}`);
+		</script>
+		<!-- if {{action}}=='/receipt/edit'||{{action}}=='/loan/receipt/edit' -->
+		<script type="text/javascript">
+			let data=JSON.parse('{{data}}'.replace(/\n/g,"\\n").replace(/\r/g,"\\r"));
+		</script>
+		<!-- else -->
+		
+		<script src="<?= WEB_SITE_GLOBAL ?>vue/fee/fee_receipt_data.js"></script>
+		<!-- endif -->
+		
+		<script src="<?= WEB_SITE_GLOBAL ?>vue/fee/receipt_create_fn.js"></script>
+		<script src="<?= WEB_SITE_GLOBAL ?>vue/fee/receipt_office_component.js"></script>
+		<script src="<?= WEB_SITE_GLOBAL ?>vue/fee/receipt_trave_component.js"></script>
+		<script src="<?= WEB_SITE_GLOBAL ?>vue/fee/receipt_train_component.js"></script>
+		<script src="<?= WEB_SITE_GLOBAL ?>vue/fee/receipt_create.js"></script>
+</body>

+ 112 - 0
protected/view/fee/menu.html

@@ -0,0 +1,112 @@
+<ul>
+<li class="saeaTitle">费用管理</li>
+	<li><a <!-- if {{receiptMemu}}=="saeaBorad" --> class="selected" <!-- endif -->  href="/saeaBorad" >公布板</a></li>
+	<li><a <!-- if {{receiptMemu}}=="expenses" --> class="selected" <!-- endif --> href="/expenses">我的费用</a></li>
+	<li><a href="/personalCollect" <!-- if {{receiptMemu}}=="personalCollect" --> class="selected" <!-- endif --> >费用汇总</a></li>
+						
+						
+<!-- if isPaymentsShow({{staff.sid}}) -->						
+<li><a href="/payments" <!-- if {{receiptMemu}}=="payments" --> class="selected" <!-- endif -->  >日常收支</a></li>
+<!-- endif -->						
+						
+	<!-- if inarray({{staff.sid}},{{verifyId}}) || inarray({{staff.sid}},{{executeId}}) -->
+						
+	<li  class="topLine <!-- if  getGlobals('NEW') !=0 --> news <!-- endif --> ">
+	<a <!-- if {{receiptMemu}}=="approvalExpenses" --> class="selected" <!-- endif --> href="/approvalExpenses/pendApproval">费用审批</a>
+	</li>
+						
+
+<li  class=""><a <!-- if {{receiptMemu}}=="receiptWasteBook" --> class="selected" <!-- endif --> href="/receiptWasteBook">费用流水</a></li>						
+						
+						
+	<!-- if inarray({{staff.sid}},{{executeId}}) -->
+	<li <!-- if  getGlobals('NEW2') !=0 --> class="news" <!-- endif --> ><a <!-- if {{receiptMemu}}=="implement" --> class="selected" <!-- endif --> href="/hisImplement">费用执行</a></li>			
+	<!-- endif -->
+				
+	<li class="hide"><a <!-- if {{receiptMemu}}=="remittanceHky" --> class="selected" <!-- endif --> href="/remittanceHky">费用汇款</a></li>			
+
+	<!-- endif -->
+
+	<!-- if isReceiptTrainShow({{staff.sid}}) -->
+	<li><a href="/receiptTrainRevenue" <!-- if {{receiptMemu}}=="receiptTrainRevenue" --> class="selected" <!-- endif --> >培训班营收</a></li>
+	<!-- endif -->
+
+	<!-- if isReceiptAuthorityShow({{staff.sid}}) -->
+	<li><a href="/companyCategoryCollect" <!-- if {{receiptMemu}}=="companyCategoryCollect" --> class="selected" <!-- endif --> >公司汇总</a></li>			
+	<!-- endif -->
+
+
+	
+	<!-- if isPaymentsShow({{staff.sid}}) -->	
+	<li><a href="/paymentsCollect" <!-- if {{receiptMemu}}=="paymentsCollect" --> class="selected" <!-- endif --> >日常收支汇总</a></li>
+	<li><a href="/wasteBook" <!-- if {{receiptMemu}}=="wasteBook" --> class="selected" <!-- endif --> >公司流水</a></li>
+	<li><a href="/wasteBookReport" <!-- if {{receiptMemu}}=="wasteBookReport" --> class="selected" <!-- endif --> >流水报表</a></li>
+	<!-- endif -->
+	
+	
+	
+	<li <!-- if  isGHNews($_COOKIE ['staffGH'])!=0 --> class="news" <!-- endif --> >
+	<a ghToken  href="javascript:void(0)" data-toggle="modal">工会</a>
+	</li>
+	
+	<li class="topLine"><a href="#welcome" data-toggle="modal">使用帮助</a></li>
+
+	</ul>
+						<!--弹出邮寄-->
+<div class="modal fade" id="welcome">
+	<div class="modal-dialog">
+		<div class="modal-content">
+		    <div class="modal-header">
+		    <h3>欢迎使用费用管理(原报销单)</h3>
+		    </div>
+		    <div class="modal-body saeaList">
+		    	<p style="font-size:18px">请查阅以下文档,了解新的费用管理</p>
+		    	<br>
+				<table class="table table-bordered table-condensed">
+					<tbody>
+					<tr>
+						<th class="taC colRed" width="100">费用管理简介<br>(必读)</th>
+						<td class="taC">
+						<a target="_Blank" href="<?= WEB_SITE_GLOBAL ?>handbook/CLD费用管理简介.pdf">在线查阅《CLD费用管理简介》</a>
+						
+						</td>
+						<td class="taC"><a href="<?= WEB_SITE_GLOBAL ?>handbook/CLD费用管理简介.docx">点击下载《CLD费用管理简介》</a></td>
+					</tr>
+					</tbody>
+				</table>
+				<table class="table table-bordered table-condensed">
+					<tbody>
+					<tr>
+						<th class="taC" width="100">费用申请人</th>
+						<td class="taC"><a target="_Blank" href="<?= WEB_SITE_GLOBAL ?>handbook/费用申请人使用教程.pdf">在线查阅《费用申请人使用手册》</a></td>
+						<td class="taC"><a href="<?= WEB_SITE_GLOBAL ?>handbook/费用申请人使用教程.docx">点击下载《费用申请人使用手册》</a></td>
+					</tr>
+					</tbody>
+				</table>
+				<table class="table table-bordered table-condensed">
+					<tbody>
+					<tr>
+						<th class="taC" width="100">费用审批人</th>
+						<td class="taC"><a target="_Blank" href="<?= WEB_SITE_GLOBAL ?>handbook/费用审批人使用教程.pdf">在线查阅《费用审批人使用手册》</a></td>
+						<td class="taC"><a href="<?= WEB_SITE_GLOBAL ?>handbook/费用审批人使用教程.docx">点击下载《费用审批人使用手册》</a></td>
+					</tr>
+					</tbody>
+				</table>
+				<table class="table table-bordered table-condensed">
+					<tbody>
+					<tr>
+						<th class="taC" width="100">费用执行人</th>
+						<td class="taC"><a target="_Blank" href="<?= WEB_SITE_GLOBAL ?>handbook/费用执行人使用教程.pdf">在线查阅《费用执行人使用手册》</a></td>
+						<td class="taC"><a href="<?= WEB_SITE_GLOBAL ?>handbook/费用执行人使用教程.docx">点击下载《费用执行人使用手册》</a></td>
+					</tr>
+					</tbody>
+				</table>
+		    </div>
+			<div class="modal-footer">
+			    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+			</div>
+		</div>
+	</div>
+</div>
+    <!--邮寄-->	
+						

+ 77 - 0
protected/view/fee/test.html

@@ -0,0 +1,77 @@
+<!--
+ * @description: 
+ * @Author: CP
+ * @Date: 2020-11-16 15:18:12
+ * @FilePath: \cld\protected\view\fee\test.html
+-->
+<div class="seTable">
+    <table class="table table-bordered table-condensed table-hover mb-0">
+        <tbody>
+            <tr>
+                <th colspan="2" class="taC" id="neibupeixun">内部培训费用</th>
+            </tr>
+            <tr>
+                <th>场租费</th>
+                <td width="200" class="taR">¥<input type="number" value="0" placeholder="输入场租费" pattern="[0-9]" step="1"
+                        min="0" class="span2"></td>
+            </tr>
+            <tr>
+                <th>薪酬</th>
+                <td width="200" class="taR">¥<input type="number" value="0" placeholder="输入薪酬" pattern="[0-9]" step="1"
+                        min="0" class="span2"></td>
+            </tr>
+            <tr>
+                <th>住宿费</th>
+                <td width="200" class="taR">¥<input type="number" value="0" placeholder="输入住宿费" pattern="[0-9]" step="1"
+                        min="0" class="span2"></td>
+            </tr>
+            <tr>
+                <th>交通费</th>
+                <td width="200" class="taR">¥<input type="number" value="0" placeholder="输入交通费" pattern="[0-9]" step="1"
+                        min="0" class="span2"></td>
+            </tr>
+            <tr>
+                <th>餐饮费</th>
+                <td width="200" class="taR">¥<input type="number" value="0" placeholder="输入餐饮费" pattern="[0-9]" step="1"
+                        min="0" class="span2"></td>
+            </tr>
+            <tr>
+                <th>办公费</th>
+                <td width="200" class="taR">¥<input type="number" value="0" placeholder="输入办公费" pattern="[0-9]" step="1"
+                        min="0" class="span2"></td>
+            </tr>
+            <tr>
+                <th>餐费补助</th>
+                <td width="200" class="taR">¥<input type="number" value="0" placeholder="输入公关费" pattern="[0-9]" step="1"
+                        min="0" class="span2"></td>
+            </tr>
+            <tr>
+                <th>其他</th>
+                <td width="200" class="taR">¥<input type="number" value="0" placeholder="输入其他" pattern="[0-9]" step="1"
+                        min="0" class="span2"></td>
+            </tr>
+            <tr>
+                <th class="taR">合计</th>
+                <td class="colGreen taR">¥0.00</td>
+            </tr>
+            <tr class="warning">
+                <td class="taR"><b>内部培训费用合计</b></td>
+                <td class="colGreed taR"><b style="font-size: 24px">¥2160.00</b>
+                </td>
+            </tr>
+            <tr>
+                <th colspan="2" class="taC">报销说明</th>
+            </tr>
+            <tr>
+                <th colspan="2"><textarea required rows="6" style="width: 99%" placeholder="内部培训费用说明"></textarea></th>
+            </tr>
+        </tbody>
+    </table>
+</div>
+<div class="seCensor receipt-censor">
+    <div class="title">报销单填写说明</div>
+    <div class="detail">
+        <p>1 此项费用,仅用于纵横内部培训;</p>
+        <p>2 用于客户的培训费用,请创建“培训班结算”。</p>
+    </div>
+</div>

+ 39 - 23
protected/view/receipt/receiptFee.html

@@ -71,33 +71,49 @@
 										</td>
 										<td width="120">
 										<div class="btn-group">
-										<!-- if {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.status}}==8  -->
-										<a class="button btn-block" href="/saeaLoanReceiptAdd/{{receiptDetail' value.rid}}">填写费用报销</a>
-										<!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==5) and {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.isBK}}==0 -->
-										
-										<a class="button btn-gray  btn-inline" href="/saeaLoanEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
-										<a class="button btn-inline" href="/confirmation/{{receiptDetail' value.rid}}">提交审批</a>
+										<!-- if {{receiptDetail' value.version}}==1 -->
 										
-										<!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==5) and {{receiptDetail' value.Rtype}}==0 -->
-										<a class="button btn-gray  btn-inline" href="/editReceipt/{{receiptDetail' value.ridKey}}.html">返回编辑</a><a
-										 class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
-										 <!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==5) and {{receiptDetail' value.Rtype}}==2 -->
-										<a class="button btn-gray  btn-inline" href="/remitEdit/{{receiptDetail' value.ridKey}}.html">返回编辑</a><a
-										 class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
-										 <!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==7) and {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.isBK}}==1 -->
-										 <a class="button btn-gray  btn-inline" href="/saeaLoanReceiptEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
-										 <a class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
-										<!-- elseif {{receiptDetail' value.Rtype}}==3 and ({{receiptDetail' value.status}}==5 or {{receiptDetail' value.status}}==4)  -->
-										 <a class="button btn-gray  btn-inline" href="/receiptTrainEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
+											<!-- if  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==5) and {{receiptDetail' value.Rtype}}==0 -->
+											<a class="button btn-gray  btn-inline" href="/view/receipt/edit/{{receiptDetail' value.receiptId}}.html">返回编辑</a>
+									
+											<!-- 借款报销单 -->
+											<!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==7) and {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.isBK}}==1 -->
+											<!-- <a class="button btn-gray  btn-inline" href="/saeaLoanReceiptEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>  -->
+											
+											<a class="button btn-gray  btn-inline" href="/view/loan/receipt/edi/{{receiptDetail' value.receiptId}}.html">返回编辑</a>
+											<!-- endif -->
+											<a class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
+										<!-- else -->
 										
-										<form action="/receiptTrainDo" method="post" id="receiptTrainApproval" class="nice-validator n-default" novalidate="novalidate">
-				<input type="hidden" name="ridKey" value='{{receiptDetail' value.ridKey}}'>
-				<legend><div class="fR"><button type="submit" class="button" href="#confirm" data-toggle="modal">提交审批</button></div>
-				</legend>
-			</form>
+											<!-- if {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.status}}==8  -->
+											<a class="button btn-block" href="/view/loan/receipt/add/{{receiptDetail' value.receiptId}}.html">填写费用报销</a><br/>
+											<!-- <a class="button btn-block" href="/saeaLoanReceiptAdd/{{receiptDetail' value.rid}}">填写费用报销</a>  -->
+											<!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==5) and {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.isBK}}==0 -->
+											
+											<a class="button btn-gray  btn-inline" href="/saeaLoanEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
+											<a class="button btn-inline" href="/confirmation/{{receiptDetail' value.rid}}">提交审批</a>
+											
+											<!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==5) and {{receiptDetail' value.Rtype}}==0 -->
+											<a class="button btn-gray  btn-inline" href="/editReceipt/{{receiptDetail' value.ridKey}}.html">返回编辑</a><a
+											 class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
+											 <!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==5) and {{receiptDetail' value.Rtype}}==2 -->
+											<a class="button btn-gray  btn-inline" href="/remitEdit/{{receiptDetail' value.ridKey}}.html">返回编辑</a><a
+											 class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
+											 <!-- elseif  ({{receiptDetail' value.status}}==4 or {{receiptDetail' value.status}}==7) and {{receiptDetail' value.Rtype}}==1 and {{receiptDetail' value.isBK}}==1 -->
+											 <a class="button btn-gray  btn-inline" href="/saeaLoanReceiptEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
+											 <a class="button btn-inline" href="/approvedReceipt/{{receiptDetail' value.rid}}">提交审批</a>
+											<!-- elseif {{receiptDetail' value.Rtype}}==3 and ({{receiptDetail' value.status}}==5 or {{receiptDetail' value.status}}==4)  -->
+											 <a class="button btn-gray  btn-inline" href="/receiptTrainEdi/{{receiptDetail' value.ridKey}}.html">返回编辑</a>
+											
+											<form action="/receiptTrainDo" method="post" id="receiptTrainApproval" class="nice-validator n-default" novalidate="novalidate">
+												<input type="hidden" name="ridKey" value='{{receiptDetail' value.ridKey}}'>
+												<legend><div class="fR"><button type="submit" class="button" href="#confirm" data-toggle="modal">提交审批</button></div>
+												</legend>
+											</form>
+											<!-- endif -->
 										
-										 
 										<!-- endif -->
+										
 										</div>
 										</td>
 										</tr>