online-invioce.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>线上开票确认</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
  8. <!-- 所有的 css js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. <style type="text/css">
  18. .c-panel .c-label {
  19. width: 8em;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <div class="vue-box sbot" style="display: none;" :style="'display: block;'">
  25. <!-- ------- 内容部分 ------- -->
  26. <div class="s-body">
  27. <div class="c-panel">
  28. <el-form>
  29. <el-row>
  30. <el-collapse value='1'>
  31. <el-collapse-item name="1">
  32. <div slot="title">
  33. 基础信息
  34. </div>
  35. <div>
  36. <el-row>
  37. <el-col span="12">
  38. <sa-info name="开票总额" br>{{m.totalMoney}}元</sa-info>
  39. <sa-info name="主体名称" br>{{m.entityName}}</sa-info>
  40. <sa-info name="税号" br>{{m.taxIdNo}}</sa-info>
  41. </el-col>
  42. <el-col span="12">
  43. <sa-info name="开户银行" br>{{m.bank}}</sa-info>
  44. <sa-info name="银行账号" br>{{m.bankNo}}</sa-info>
  45. <sa-info name="地址" br>{{m.address}}</sa-info>
  46. <sa-info name="电话" br>{{m.phone}}</sa-info>
  47. <sa-info name="邮箱" br>{{m.email}}</sa-info>
  48. </el-col>
  49. </el-row>
  50. </div>
  51. </el-collapse-item>
  52. </el-collapse>
  53. </el-row>
  54. <el-row>
  55. <el-collapse value='1'>
  56. <el-collapse-item name="1">
  57. <div slot="title">
  58. 实际开票
  59. </div>
  60. <el-table :data="invioceDetails" style="width: 100%">
  61. <el-table-column type="index" width="50" label="序号"></el-table-column>
  62. <el-table-column label="单据编号" prop="id"></el-table-column>
  63. <el-table-column label="金额(元)" prop="money"></el-table-column>
  64. <el-table-column label="发票号" prop="invoiceNo"></el-table-column>
  65. <el-table-column label="发票代码" prop="invoiceCode"></el-table-column>
  66. <el-table-column label="发票预览">
  67. <template slot-scope="s" >
  68. <img v-if="s.row.imageUrl" :src="s.row.imageUrl" class="td-img" @click="sa.showImage(s.row.imageUrl, '400px', '400px')" />
  69. <span v-else></span>
  70. </template>
  71. </el-table-column>
  72. <sa-td name="发票预览" prop="imageUrl" type="img"></sa-td>
  73. <el-table-column label="操作" width="140px">
  74. <template slot-scope="s">
  75. <el-button class="c-btn" type="success" @click="showFee(s.row.id)">费用详情</el-button>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. </el-collapse-item>
  80. </el-collapse>
  81. </el-row>
  82. </el-form>
  83. </div>
  84. </div>
  85. <!-- ------- 底部按钮 ------- -->
  86. <div class="s-foot">
  87. <el-button v-if="m.applyAble!=1&&m.isApply!=1&&m.isApply!=2&&comfirmButton==0&&m.status==0&&currentCustomerId==1" type="success" @click="comfirmFn">确定开票</el-button>
  88. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  89. </div>
  90. <el-dialog title="费用明细" :visible.sync="showFeeDate.visible" width="90%">
  91. <el-table :data="feeDetails" style="width: 100%">
  92. <el-table-column label="业务类型" prop="itemTypeName" ></el-table-column>
  93. <el-table-column label="数量" prop="num" ></el-table-column>
  94. <el-table-column label="单价(元)" prop="unitPrice" ></el-table-column>
  95. <el-table-column label="总价(元)" prop="itemPrice" ></el-table-column>
  96. <el-table-column label="税率(%)" >
  97. <template slot-scope="s">
  98. <span>{{s.row.taxRate * 100}}</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="税款(元)" >
  102. <template slot-scope="s">
  103. <span>{{Number(s.row.taxPrice).toFixed(2)}}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="不含税金额(元)" >
  107. <template slot-scope="s">
  108. <span>{{Number(s.row.noTaxPrice).toFixed(2)}}</span>
  109. </template>
  110. </el-table-column>
  111. </el-table>
  112. <span slot="footer" class="dialog-footer">
  113. <el-button @click="showFeeDate.visible = false">关闭</el-button>
  114. </span>
  115. </el-dialog>
  116. <el-dialog title="请填写开票人" :visible.sync="drawerDate.visible" width="38%">
  117. <div class="c-item">
  118. <label class="c-label">开票人:</label>
  119. <el-input type="text" v-model="drawerDate.form.drawer"></el-input>
  120. </div>
  121. <span slot="footer" class="dialog-footer">
  122. <el-button @click="drawerDate.visible = false">取 消</el-button>
  123. <el-button type="primary" @click="comfirm">确 定</el-button>
  124. </span>
  125. </el-dialog>
  126. </div>
  127. <script>
  128. var app = new Vue({
  129. components: {
  130. "sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
  131. },
  132. el: '.vue-box',
  133. data: {
  134. infoId: sa.p('id', 0), // 获取数据ID
  135. m: {},
  136. invioceDetails: [],
  137. feeDetails:[],
  138. showFeeDate: {
  139. visible: false,
  140. },
  141. comfirmButton: 0,
  142. drawerDate: {
  143. visible: false,
  144. form: {
  145. infoId: sa.p('id', 0),
  146. drawer:"",
  147. }
  148. },
  149. currentCustomerId: '1',
  150. },
  151. methods: {
  152. getCustomer() {
  153. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  154. this.currentCustomerId = resp.data;
  155. }.bind(this));
  156. },
  157. showFee(id){
  158. sa.ajax('/TbInvoiceDetails/groupFeeDetails?id=' + id, function (res) {
  159. this.feeDetails = res.data;
  160. this.showFeeDate.visible = true;
  161. }.bind(this))
  162. },
  163. comfirmFn() {
  164. // this.drawerDate.visible = true;
  165. this.$confirm(' 点击确定开始开票', '提示', {
  166. confirmButtonText: '确定',
  167. cancelButtonText: '取消',
  168. type: ''
  169. }).then(() => {
  170. sa.ajax('/InvoiceApply/applyInvoice?infoId='+this.infoId, function(resp) {
  171. if(resp.code == 200){
  172. this.comfirmButton = 1;
  173. sa.alert('申请成功', this.close);
  174. }else{
  175. sa.alert('开票失败', this.close);
  176. }
  177. }.bind(this));
  178. });
  179. },
  180. comfirm() {
  181. sa.checkNull(this.drawerDate.form.drawer, '输入 [开票人]');
  182. sa.ajax('/InvoiceApply/applyInvoice', this.drawerDate.form, function () {
  183. this.drawerDate.visible = false;
  184. this.comfirmButton = 1;
  185. sa.alert('操作成功', this.close);
  186. }.bind(this))
  187. },
  188. close(){
  189. parent.app.f5();
  190. sa.closeCurrIframe();
  191. },
  192. getInfo() {
  193. sa.ajax('/TbInvoiceInfo/getById?id=' + this.infoId, function(res) {
  194. this.m = res.data;
  195. if(res.data == null) {
  196. sa.alert('未能查找到 id=' + this.infoId + " 开票信息数据");
  197. }
  198. }.bind(this))
  199. },
  200. getDetails() {
  201. sa.ajax('/TbInvoiceDetails/onlineInvoice?infoId=' + this.infoId, function (res) {
  202. this.invioceDetails = res.data;
  203. }.bind(this))
  204. }
  205. },
  206. mounted: function () {
  207. this.getCustomer();
  208. this.getInfo();
  209. this.getDetails();
  210. }
  211. })
  212. </script>
  213. </body>
  214. </html>