receipt_office_component.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * @description: 费用-办事处相关组件
  3. * @Author: CP
  4. * @Date: 2020-11-16 14:52:08
  5. * @FilePath: \cld\global\vue\fee\receipt_office_component.js
  6. */
  7. Vue.component("office", {
  8. props:['daily','other','officeExplain'],
  9. computed: {
  10. officePrice: function () {
  11. return officePrice(this);
  12. },
  13. dailyTotal:function(){
  14. let sum = 0;
  15. this.daily.forEach(element => {
  16. sum += Number(element.price);
  17. });
  18. return sum.toFixed(2);
  19. },
  20. otherTotal:function(){
  21. let sum = 0;
  22. this.other.forEach(element => {
  23. sum += Number(element.price);
  24. });
  25. return sum.toFixed(2);
  26. },
  27. },
  28. template:
  29. `
  30. <div>
  31. <div class="seTable">
  32. <table class="table table-bordered table-condensed table-hover mb-0">
  33. <tbody>
  34. <tr>
  35. <th colspan="2" class="taC">日常相关费用</th>
  36. </tr>
  37. <tr v-for="item in daily" >
  38. <th>{{ item.name }}</th>
  39. <td width="200" class="taR">¥<input type="number" v-model="item.price" pattern="[0-9]" step="0.01"
  40. min="0" class="span2"></td>
  41. </tr>
  42. <tr>
  43. <th class="taR">小计</th>
  44. <td class="colGreen taR">¥{{ dailyTotal }}</td>
  45. </tr>
  46. <tr>
  47. <th colspan="2" class="taC">其他</th>
  48. </tr>
  49. <tr v-for="item in other">
  50. <th>{{ item.name }}</th>
  51. <td width="200" class="taR">¥<input type="number" v-model="item.price" pattern="[0-9]" step="0.01"
  52. min="0" class="span2"></td>
  53. </tr>
  54. <tr>
  55. <th class="taR">小计</th>
  56. <td class="colGreen taR">¥{{ otherTotal }}</td>
  57. </tr>
  58. <tr class="warning">
  59. <td class="taR"><b>办事处相关费用合计</b></td>
  60. <td class="colGreed taR"><b style="font-size: 24px">¥{{ officePrice }}</b></td>
  61. </tr>
  62. <tr>
  63. <th colspan="2" class="taC">报销说明</th>
  64. </tr>
  65. <tr>
  66. <th colspan="2" v-for="item in officeExplain">
  67. <textarea required rows="6" style="width: 99%" v-model="item.officeExplain" placeholder="办事处相关费用说明">
  68. </textarea>
  69. </th>
  70. </tr>
  71. </tbody>
  72. </table>
  73. </div>
  74. <div class="seCensor receipt-censor">
  75. <div class="title">报销单填写说明</div>
  76. <div class="detail">
  77. <p>
  78. 1 <b>产生费用所在办事处</b> 默认使用您所在的第一个办事处;
  79. </p>
  80. <p>
  81. 2 邮寄费、公关费、办公费等详细说明请填写到 <b>报销说明</b>。
  82. </p>
  83. </div>
  84. </div>
  85. </div>
  86. `
  87. })