tb-invoice-order-list.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>开票订单表-列表</title>
  5. <meta 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. </head>
  18. <style>
  19. .c1-label {
  20. width: 7em;
  21. color: #333;
  22. padding-right: 4px;
  23. display: inline-block;
  24. text-align: right;
  25. vertical-align: top;
  26. }
  27. </style>
  28. <body>
  29. <div class="vue-box" style="display: none;" :style="'display: block;'">
  30. <div class="c-panel">
  31. <!-- ------------- 检索参数 ------------- -->
  32. <div class="c-title">检索参数</div>
  33. <el-form ref="form" :model='p' @submit.native.prevent>
  34. <div class="c-item">
  35. <label class="c1-label">开票信息编号:</label>
  36. <el-input type="text" v-model="p.infoNo"></el-input>
  37. </div>
  38. <div class="c-item">
  39. <label class="c1-label">车牌号:</label>
  40. <el-input type="text" v-model="p.carNo"></el-input>
  41. </div>
  42. <div class="c-item">
  43. <label class="c1-label">微信支付订单:</label>
  44. <el-input type="text" v-model="p.transactionId"></el-input>
  45. </div>
  46. <div class="c-item">
  47. <label class="c-label">开票状态:</label>
  48. <el-select v-model="p.status" placeholder="请选择">
  49. <el-option label="不限" value=""></el-option>
  50. <el-option label="待申请" :value="0"></el-option>
  51. <el-option label="已申请" :value="1"></el-option>
  52. <el-option label="已开票" :value="2"></el-option>
  53. </el-select>
  54. </div>
  55. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  56. <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
  57. <br/>
  58. </el-form>
  59. <!-- ------------- 快捷按钮 ------------- -->
  60. <el-form ref="form" :model='p' @submit.native.prevent>
  61. <el-button style="display: inline;" type="primary" @click="add()">上传账单截图</el-button>
  62. <el-button style="display: inline;" type="primary" @click="applyFn()">申请开票</el-button>
  63. </el-form>
  64. <!-- ------------- 数据列表 ------------- -->
  65. <el-table class="data-table" ref="data-table" :data="dataList">
  66. <sa-td type="selection"></sa-td>
  67. <sa-td name="业务名称" prop="businessName" width="150px"></sa-td>
  68. <sa-td name="车牌号" prop="carNo" width="150px"></sa-td>
  69. <el-table-column label="业务订单号" width="150px">
  70. <template slot-scope="s">
  71. <el-tooltip :content="s.row.businessNo" placement="bottom" effect="light">
  72. <el-button class="keyButton">{{ s.row.businessNo }}</el-button>
  73. </el-tooltip>
  74. </template>
  75. </el-table-column>
  76. <!-- <sa-td name="业务订单号" prop="businessNo" width="150" ></sa-td>-->
  77. <sa-td name="微信支付订单号" prop="transactionId" width="210px"></sa-td>
  78. <sa-td name="账单金额" prop="billMoney"></sa-td>
  79. <sa-td name="账单截图" prop="billImage" type="img"></sa-td>
  80. <sa-td name="开票状态" prop="status" type="enum" :jv="{0: '待申请', 1: '已申请', 2: '已开票'}"></sa-td>
  81. <sa-td name="开票时间" prop="invoiceTime" width="140px"></sa-td>
  82. <sa-td name="开票信息" prop="infoNo" width="130"></sa-td>
  83. <el-table-column label="操作" fixed="right" width="240px">
  84. <template slot-scope="s">
  85. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  86. <el-button v-if="s.row.status==0" class="c-btn" type="danger" icon="el-icon-delete"
  87. @click="del(s.row)">删除
  88. </el-button>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <!-- ------------- 分页 ------------- -->
  93. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  94. </div>
  95. <el-dialog title="申请开票" :visible.sync="applyDate.visible" width="38%">
  96. <sa-item name="发票总额" v-model="applyDate.form.totalMoney" type="num" :disabled="true"></sa-item>
  97. <sa-item name="开票种类" v-model="applyDate.form.isElec" type="enum"
  98. :jv="{1: '电子普票', 0: '纸质普票', 2:'纸质专票'}"></sa-item>
  99. <div class="c-item">
  100. <label class="c-label">开票主体:</label>
  101. <el-select v-model="applyDate.form.entityId" placeholder="请选择" filterable @change="changeEntity">
  102. <el-option v-for="item in entityList" :key="item.id"
  103. :label="item.name" :value="item.id">
  104. </el-option>
  105. </el-select>
  106. </div>
  107. <sa-item type="text" name="企业名称" v-model="applyDate.entity.name" :disabled="true"></sa-item>
  108. <sa-item type="text" name="税号" v-model="applyDate.entity.taxIdNo" :disabled="true"></sa-item>
  109. <sa-item type="text" name="地址" v-model="applyDate.entity.address" :disabled="true"></sa-item>
  110. <sa-item type="text" name="电话" v-model="applyDate.entity.phone" :disabled="true"></sa-item>
  111. <sa-item type="text" name="开户银行" v-model="applyDate.entity.bank" :disabled="true"></sa-item>
  112. <sa-item type="text" name="银行账号" v-model="applyDate.entity.bankNo" :disabled="true"></sa-item>
  113. <span slot="footer" class="dialog-footer">
  114. <el-button @click="applyDate.visible = false">取 消</el-button>
  115. <el-button type="primary" @click="apply">确 定</el-button>
  116. </span>
  117. </el-dialog>
  118. </div>
  119. <script>
  120. var app = new Vue({
  121. components: {
  122. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  123. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  124. },
  125. el: '.vue-box',
  126. data: {
  127. p: { // 查询参数
  128. id: '', // 主键 、
  129. customerId: '', // 客户id
  130. businessId: '', // 业务订单id
  131. businessName: '', // 业务名称
  132. businessNo: '', // 业务订单号
  133. carNo: '', //车牌号
  134. transactionId: '', // 微信支付订单号
  135. billMoney: '', // 账单金额
  136. status: '', // 支付状态(0=未开票,1=已开票)
  137. invoiceTime: '', // 开票时间
  138. createTime: '', // 创建时间
  139. infoId: '', // 开票信息id
  140. infoNo: '', // 开票信息no
  141. pageNo: 1, // 当前页
  142. pageSize: 10, // 页大小
  143. sortType: 0 // 排序方式
  144. },
  145. dataCount: 0,
  146. dataList: [], // 数据集合
  147. entityList: [],
  148. applyDate: {
  149. visible: false,
  150. form: {
  151. ids: '',
  152. entityId: '',
  153. isElec: 1,
  154. totalMoney: 0,
  155. customerId: '',
  156. customerName: '',
  157. },
  158. entity: {},
  159. },
  160. currentCustomerId: '1',
  161. currentCustomerName: '',
  162. },
  163. methods: {
  164. apply() {
  165. sa.checkNull(this.applyDate.form.entityId, '请选择 [主体信息]');
  166. sa.checkNull(this.applyDate.form.isElec, '请选择 [电子发票]');
  167. sa.ajax('/TbInvoiceInfo/generate', this.applyDate.form, function (res) {
  168. this.applyDate.visible = false;
  169. sa.alert('成功生成开票信息', this.f5);
  170. }.bind(this));
  171. },
  172. applyFn() {
  173. let selection = this.$refs['data-table'].selection;
  174. if (selection.length == 0) {
  175. return sa.msg('请至少选择一条数据')
  176. }
  177. let ids = sa.getArrayField(selection, 'id');
  178. for (var i = 0; i < selection.length; i++) {
  179. if (selection[i].status == 1 || selection[i].status == 2) {
  180. return sa.msg('请选择待申请的订单')
  181. }
  182. }
  183. let billMoneys = sa.getArrayField(selection, 'billMoney');
  184. var totalMoney = 0;
  185. for (var i = billMoneys.length - 1; i >= 0; i--) {
  186. totalMoney += billMoneys[i];
  187. }
  188. this.applyDate.form.totalMoney = totalMoney;
  189. this.applyDate.visible = true;
  190. this.applyDate.form.ids = ids.join(',');
  191. this.getEntityList();
  192. },
  193. changeEntity(value) {
  194. let entity = this.entityList.filter(obj => obj.id == value).pop();
  195. this.applyDate.entity = entity;
  196. },
  197. getEntityList() {
  198. sa.ajax('/TbEntity/getList', function (res) {
  199. this.entityList = res.data; // 数据
  200. }.bind(this));
  201. },
  202. getCustomer() {
  203. sa.ajax('/TbCostomer/getCurrentCustomer', function (resp) {
  204. this.currentCustomerId = resp.data.id;
  205. this.currentCustomerName = resp.data.name;
  206. this.applyDate.form.customerId = resp.data.id;
  207. this.applyDate.form.customerName = resp.data.name;
  208. }.bind(this));
  209. },
  210. // 刷新
  211. f5: function () {
  212. sa.ajax('/TbInvoiceOrder/getList', sa.removeNull(this.p), function (res) {
  213. this.dataList = res.data; // 数据
  214. this.dataCount = res.dataCount; // 数据总数
  215. sa.f5TableHeight(); // 刷新表格高度
  216. }.bind(this));
  217. },
  218. // 查看
  219. get: function (data) {
  220. sa.showIframe('数据详情', 'tb-invoice-order-info.html?id=' + data.id, '1200px', '90%');
  221. },
  222. // 查看 - 根据选中的
  223. getBySelect: function (data) {
  224. var selection = this.$refs['data-table'].selection;
  225. if (selection.length == 0) {
  226. return sa.msg('请选择一条数据')
  227. }
  228. this.get(selection[0]);
  229. },
  230. // 修改
  231. update: function (data) {
  232. sa.showIframe('修改数据', 'tb-invoice-order-add.html?id=' + data.id, '550px', '80%');
  233. },
  234. // 新增
  235. add: function (data) {
  236. sa.showIframe('新增数据', 'tb-invoice-order-add.html?id=-1&customerId=' + this.currentCustomerId, '550px', '60%');
  237. },
  238. // 删除
  239. del: function (data) {
  240. sa.confirm('是否删除,此操作不可撤销', function () {
  241. sa.ajax('/TbInvoiceOrder/delete?id=' + data.id, function (res) {
  242. sa.arrayDelete(this.dataList, data);
  243. sa.ok('删除成功');
  244. sa.f5TableHeight(); // 刷新表格高度
  245. }.bind(this))
  246. }.bind(this));
  247. },
  248. // 批量删除
  249. deleteByIds: function () {
  250. // 获取选中元素的id列表
  251. let selection = this.$refs['data-table'].selection;
  252. let ids = sa.getArrayField(selection, 'id');
  253. if (selection.length == 0) {
  254. return sa.msg('请至少选择一条数据')
  255. }
  256. // 提交删除
  257. sa.confirm('是否批量删除选中数据?此操作不可撤销', function () {
  258. sa.ajax('/TbInvoiceOrder/deleteByIds', {ids: ids.join(',')}, function (res) {
  259. sa.arrayDelete(this.dataList, selection);
  260. sa.ok('删除成功');
  261. sa.f5TableHeight(); // 刷新表格高度
  262. }.bind(this))
  263. }.bind(this));
  264. },
  265. },
  266. created: function () {
  267. this.f5();
  268. this.getCustomer();
  269. sa.onInputEnter();
  270. }
  271. })
  272. </script>
  273. </body>
  274. </html>