tb-invoice-info-list.html 10 KB

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