tb-invoice-info-list.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <sa-item type="text" name="客户名称" v-model="p.customerName"></sa-item>
  25. <div class="c-item">
  26. <label class="c-label">开票状态:</label>
  27. <el-select v-model="p.status" placeholder="请选择">
  28. <el-option label="不限" value=""></el-option>
  29. <el-option label="未开票" :value="0"></el-option>
  30. <el-option label="已开票" :value="1"></el-option>
  31. </el-select>
  32. </div>
  33. <div class="c-item">
  34. <label class="c-label">开票时间:</label>
  35. <el-date-picker size="mini" v-model="selectTime" type="daterange" range-separator="至"
  36. start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日"
  37. value-format="yyyy-MM-dd">
  38. </el-date-picker>
  39. </div>
  40. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  41. <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
  42. <br />
  43. </el-form>
  44. <!-- ------------- 快捷按钮 ------------- -->
  45. <!-- ------------- 数据列表 ------------- -->
  46. <el-table class="data-table" ref="data-table" :data="dataList">
  47. <sa-td type="selection"></sa-td>
  48. <sa-td name="编号" prop="no" width="129"></sa-td>
  49. <sa-td name="客户名称" prop="customerName" width="180"></sa-td>
  50. <sa-td name="账单金额" prop="totalMoney"></sa-td>
  51. <sa-td name="开票状态" prop="status" type="enum" :jv="{0: '未开票', 1: '已开票',2:'申请中',3:'红冲',6:'作废'}">
  52. </sa-td>
  53. <sa-td name="开票种类" prop="isElec" type="enum" :jv="{0: '纸质普票', 1: '电子普票', 2:'纸质专票'}"></sa-td>
  54. <sa-td name="申请时间" prop="createTime" width="180"></sa-td>
  55. <sa-td name="开票时间" prop="invoiceTime"></sa-td>
  56. <sa-td name="发票号" prop="invoiceNo" width="150">
  57. <template slot-scope="s">
  58. <div>{{s.row.invoiceNo}}
  59. <i @click="updateInvoiceNo(s.row)" class="el-icon-edit"
  60. v-if="s.row.status===1&& currentCustomerId==1"
  61. style="cursor: pointer;padding-left: 10px;color: blue;"></i>
  62. </div>
  63. </template>
  64. </sa-td>
  65. <el-table-column label="主体名称">
  66. <template slot-scope="s">
  67. <span>{{s.row.entityName}}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="税号" width="156">
  71. <template slot-scope="s">
  72. <span>{{s.row.taxIdNo}}</span>
  73. </template>
  74. </el-table-column>
  75. <!-- <sa-td name="地址" prop="address" ></sa-td>-->
  76. <!-- <sa-td name="电话" prop="phone" ></sa-td>-->
  77. <!-- <sa-td name="开户银行" prop="bank" ></sa-td>-->
  78. <!-- <sa-td name="银行账号" prop="bankNo" ></sa-td>-->
  79. <!-- <sa-td name="邮箱" prop="email" ></sa-td>-->
  80. <el-table-column label="操作" width="240px">
  81. <template slot-scope="s">
  82. <el-button v-if="s.row.isElec==1&&currentCustomerId==1&&s.row.status==0" class="c-btn"
  83. type="primary" @click="onlineFn(s.row)">线上开票</el-button>
  84. <el-button v-if="s.row.status==0 && currentCustomerId==1" class="c-btn" type="primary"
  85. @click="completeFn(s.row.id)">线下开票</el-button>
  86. <el-button v-if="s.row.isElec==1&&s.row.status==1" class="c-btn" type="primary"
  87. @click="onlineFn(s.row)">发票详情</el-button>
  88. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  89. </el-button>
  90. <el-button v-if="s.row.status==0" class="c-btn" type="primary" icon="el-icon-edit"
  91. @click="update(s.row)">修改</el-button>
  92. <el-button v-if="s.row.status==0 && currentCustomerId==1" class="c-btn" type="danger"
  93. icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <!-- ------------- 分页 ------------- -->
  98. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  99. </sa-item>
  100. </div>
  101. <el-dialog title="完成开票" :visible.sync="completeDate.visible" width="38%">
  102. <div class="c-item">
  103. <label class="c-label">开票时间:</label>
  104. <el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
  105. v-model="completeDate.form.invoiceTime"></el-date-picker>
  106. </div>
  107. <br />
  108. <sa-item type="text" name="发票号" v-model="completeDate.form.invoiceNo"></sa-item>
  109. <span slot="footer" class="dialog-footer">
  110. <el-button @click="completeDate.visible = false">取 消</el-button>
  111. <el-button type="primary" @click="complete">确 定</el-button>
  112. </span>
  113. </el-dialog>
  114. </div>
  115. <script>
  116. var app = new Vue({
  117. components: {
  118. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  119. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  120. },
  121. el: '.vue-box',
  122. data: {
  123. p: { // 查询参数
  124. id: '', // 主键
  125. customerId: '', // 客户id
  126. customerName: '', // 客户名称
  127. totalMoney: '', // 账单金额
  128. status: '', // 支付状态(0=未开票,1=已开票)
  129. invoiceTime: '', // 开票时间
  130. invoiceNo: '', // 发票号
  131. entityId: '', // 主体id
  132. entityName: '', // 主体名称
  133. taxIdNo: '', // 税号
  134. address: '', // 地址
  135. phone: '', // 电话
  136. bank: '', // 开户银行
  137. bankNo: '', // 银行账号
  138. email: '', // 邮箱
  139. createTime: '', // 创建时间
  140. beginTime: '', //查询开始时间
  141. endTime: '', //查询结束时间
  142. pageNo: 1, // 当前页
  143. pageSize: 10, // 页大小
  144. sortType: 0 // 排序方式
  145. },
  146. dataCount: 0,
  147. dataList: [], // 数据集合
  148. completeDate: {
  149. visible: false,
  150. form: {
  151. id: '',
  152. invoiceTime: '',
  153. invoiceNo: '',
  154. },
  155. },
  156. currentCustomerId: '1',
  157. selectTime: [],
  158. selectTimeRange: {
  159. beginTime: '', //查询开始时间
  160. endTime: '', //查询结束时间
  161. },
  162. },
  163. methods: {
  164. onlineFn(data) {
  165. sa.showIframe('线上开票', 'online-invioce.html?id=' + data.id, '1000px', '90%');
  166. },
  167. updateInvoiceNo(data) {
  168. layer.prompt({
  169. title: '修改发票号'
  170. }, function(pass, index) {
  171. layer.close(index);
  172. sa.ajax('/TbInvoiceInfo/updateInvoiceNo', {
  173. id: data.id,
  174. invoiceNo: pass
  175. }, function(res) {
  176. data.invoiceNo = pass;
  177. layer.msg('修改成功');
  178. }.bind(this))
  179. });
  180. },
  181. completeFn(id) {
  182. this.completeDate.visible = true;
  183. this.completeDate.form.id = id;
  184. },
  185. complete() {
  186. sa.checkNull(this.completeDate.form.invoiceTime, '请选择 [开票时间]');
  187. sa.checkNull(this.completeDate.form.invoiceNo, '输入 [发票号]');
  188. sa.ajax('/TbInvoiceInfo/complete?', this.completeDate.form, function(res) {
  189. this.completeDate.visible = false;
  190. sa.alert('开票成功', this.f5);
  191. }.bind(this))
  192. },
  193. getCustomer() {
  194. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  195. this.currentCustomerId = resp.data;
  196. }.bind(this));
  197. },
  198. // 刷新
  199. f5: function() {
  200. if (this.selectTime != null && this.selectTime.length != 0) {
  201. this.p.beginTime = this.selectTime[0];
  202. this.p.endTime = this.selectTime[1];
  203. }
  204. sa.ajax('/TbInvoiceInfo/getList', sa.removeNull(this.p), function(res) {
  205. this.dataList = res.data; // 数据
  206. this.dataCount = res.dataCount; // 数据总数
  207. sa.f5TableHeight(); // 刷新表格高度
  208. }.bind(this));
  209. },
  210. // 查看
  211. get: function(data) {
  212. sa.showIframe('数据详情', 'tb-invoice-info-info.html?id=' + data.id, '1050px', '90%');
  213. },
  214. // 查看 - 根据选中的
  215. getBySelect: function(data) {
  216. var selection = this.$refs['data-table'].selection;
  217. if (selection.length == 0) {
  218. return sa.msg('请选择一条数据')
  219. }
  220. this.get(selection[0]);
  221. },
  222. // 修改
  223. update: function(data) {
  224. sa.showIframe('主体信息修改', 'tb-invoice-info-add.html?id=' + data.id, '550px', '80%');
  225. },
  226. // 新增
  227. add: function(data) {
  228. sa.showIframe('新增数据', 'tb-invoice-info-add.html?id=-1&customerId=' + this.currentCustomerId,
  229. '550px', '80%');
  230. },
  231. // 删除
  232. del: function(data) {
  233. sa.confirm('是否删除,此操作不可撤销', function() {
  234. sa.ajax('/TbInvoiceInfo/delete?id=' + data.id, function(res) {
  235. sa.arrayDelete(this.dataList, data);
  236. sa.ok('删除成功');
  237. sa.f5TableHeight(); // 刷新表格高度
  238. }.bind(this))
  239. }.bind(this));
  240. },
  241. // 批量删除
  242. deleteByIds: function() {
  243. // 获取选中元素的id列表
  244. let selection = this.$refs['data-table'].selection;
  245. let ids = sa.getArrayField(selection, 'id');
  246. if (selection.length == 0) {
  247. return sa.msg('请至少选择一条数据')
  248. }
  249. // 提交删除
  250. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  251. sa.ajax('/TbInvoiceInfo/deleteByIds', {
  252. ids: ids.join(',')
  253. }, function(res) {
  254. sa.arrayDelete(this.dataList, selection);
  255. sa.ok('删除成功');
  256. sa.f5TableHeight(); // 刷新表格高度
  257. }.bind(this))
  258. }.bind(this));
  259. },
  260. },
  261. created: function() {
  262. this.f5();
  263. this.getCustomer();
  264. sa.onInputEnter();
  265. }
  266. })
  267. </script>
  268. </body>
  269. </html>