invoice.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div slot="header">
  8. <span>开票管理</span>
  9. <el-form size="small" :inline="true" :model="search" style="float: right;margin-top: -8px;">
  10. <el-form-item>
  11. <com-export-dialog :field_list='exportList' :action_url="export_url" :params="search">
  12. </com-export-dialog>
  13. </el-form-item>
  14. </el-form>
  15. </div>
  16. <div class="table-body">
  17. <div class="input-item">
  18. <el-input size="small" placeholder="请输入会员id" v-model="search.user_id" clearable>
  19. </el-input>
  20. </div>
  21. <div class="input-item">
  22. <el-input size="small" placeholder="请输入会员昵称/手机号" v-model="search.keyword" clearable>
  23. </el-input>
  24. </div>
  25. <div class="input-item">
  26. <el-input size="small" placeholder="请输入订单编号" v-model="search.order_no" clearable>
  27. </el-input>
  28. </div>
  29. <el-select size="small" v-model="search.head_type" class="input-item">
  30. <el-option :key="index" :label="item.name" :value="item.label"
  31. v-for="(item, index) in headTypeList"></el-option>
  32. </el-select>
  33. <el-select size="small" v-model="search.invoice_status" class="input-item">
  34. <el-option :key="index" :label="item.name" :value="item.label"
  35. v-for="(item, index) in invoiceTypeList"></el-option>
  36. </el-select>
  37. <div class="input-item">
  38. <el-button type="primary" size="small" icon="el-icon-search" @click="handleClick" class="search_button">搜索</el-button>
  39. </div>
  40. <el-table :data="list" size="small" stripe @selection-change="handleSelectionChange" v-loading="loading" style="margin-bottom: 15px">
  41. <el-table-column type="selection" align="center" width="60"></el-table-column>
  42. <el-table-column prop="id" label="ID" min-width="100" align="center"></el-table-column>
  43. <el-table-column prop="user.id" label="会员ID" min-width="100" align="center"></el-table-column>
  44. <el-table-column label="基本信息" min-width="200">
  45. <template slot-scope="scope">
  46. <div class="table-info-img-text">
  47. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  48. <div slot="error" class="image-slot">
  49. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  50. </div>
  51. </el-image>
  52. <div class="table-info-text">
  53. <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  54. <div>{{scope.row.user.mobile}}</div>
  55. </div>
  56. </div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column
  60. prop="order_no"
  61. label="订单编号"
  62. align="center"
  63. min-width="250"
  64. >
  65. <template slot-scope="scope">
  66. <el-tooltip effect="dark" content="点击查看订单详情" placement="top">
  67. <el-button @click="goOrder(scope.row.order_id)" size="mini" type="primary" effect="dark">{{scope.row.order_no}}</el-button>
  68. </el-tooltip>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="pay_money" label="发票金额" min-width="100" align="center"></el-table-column>
  72. <el-table-column label="发票类型" prop="type" min-width="120" align="center">
  73. <template slot-scope="scope">
  74. <div v-if="scope.row.type==1">增值税电子普通发票</div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="抬头类型" prop="head_type" min-width="120" align="center">
  78. <template slot-scope="scope">
  79. <div v-if="scope.row.head_type==1">个人/事业单位</div>
  80. <div v-if="scope.row.head_type==2">企业</div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="head_name" label="发票抬头" min-width="100" align="center"></el-table-column>
  84. <el-table-column prop="bank_name" label="开户银行" min-width="100" align="center"></el-table-column>
  85. <el-table-column prop="account" label="开户账户" min-width="100" align="center"></el-table-column>
  86. <el-table-column prop="tax_no" label="税号" min-width="100" align="center"></el-table-column>
  87. <el-table-column prop="email" label="邮箱号" min-width="100" align="center"></el-table-column>
  88. <el-table-column prop="address" label="地址" min-width="100" align="center"></el-table-column>
  89. <el-table-column prop="mobile" label="电话" min-width="100" align="center"></el-table-column>
  90. <el-table-column label="申请时间" min-width="200" align="center">
  91. <template slot-scope="scope">
  92. <div>申请时间:{{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="开票状态" prop="invoice_status" min-width="120" align="center">
  96. <template slot-scope="scope">
  97. <div v-if="scope.row.invoice_status==0">待开票</div>
  98. <div v-if="scope.row.invoice_status==1">已开票</div>
  99. <div v-if="scope.row.invoice_status==2">已驳回</div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column prop="remark" label="备注" min-width="100" align="center"></el-table-column>
  103. <el-table-column label="操作" min-width="200" align="center">
  104. <template slot-scope="scope">
  105. <el-button size="mini" circle style="margin-top: 10px;padding: 0 !important;border: 0;margin: 0 5px;" v-if="scope.row.invoice_status == 0" @click="openDialogForm(scope.row.id,1)">
  106. <el-tooltip class="item" effect="dark" content="同意" placement="top">
  107. <img src="resources/img/mall/pass.png" alt="">
  108. </el-tooltip>
  109. </el-button>
  110. <el-button size="mini" circle style="margin-left: 10px;margin-top: 10px;padding: 0 !important;border: 0;margin: 0 5px;" v-if="scope.row.invoice_status == 0" @click="openDialogForm(scope.row.id,2)">
  111. <el-tooltip class="item" effect="dark" content="拒绝" placement="top">
  112. <img src="resources/img/mall/nopass.png" alt="">
  113. </el-tooltip>
  114. </el-button>
  115. </template>
  116. </el-table-column>
  117. </el-table>
  118. <div flex="box:last cross:center">
  119. <div></div>
  120. <div>
  121. <el-pagination v-if="list.length > 0" style="display: inline-block;float: right;" background :page-size="pagination.defaultPageSize" @current-change="pageChange" layout="prev, pager, next" :current-page="pagination.current_page" :total="pagination.totalCount">
  122. </el-pagination>
  123. </div>
  124. </div>
  125. </div>
  126. </el-card>
  127. <el-dialog :title="new_status == 1 ? '通过' : '驳回'" :visible.sync="dialogFormVisible" width="20%" center :close-on-click-modal="false">
  128. <el-form :model="check_form">
  129. <el-form-item label="备注" label-width="100px" required>
  130. <el-col :span="18">
  131. <el-input v-model="check_form.remark" type="textarea" autocomplete="off"></el-input>
  132. </el-col>
  133. </el-form-item>
  134. </el-form>
  135. <div slot="footer" class="dialog-footer">
  136. <el-button @click="closeDialogForm">取 消</el-button>
  137. <el-button type="primary" v-loading="applyLoading" @click="apply()">确 定</el-button>
  138. </div>
  139. </el-dialog>
  140. </div>
  141. <script>
  142. const app = new Vue({
  143. el: '#app',
  144. data() {
  145. return {
  146. dialogFormVisible: false,
  147. dialogVisible: false,
  148. dialogTitle: '批量审核',
  149. search: {
  150. keyword: '',
  151. user_id: '',
  152. head_type:-1,
  153. invoice_status:-1,
  154. order_no:'',
  155. },
  156. multipleSelection: [],
  157. checkedData: undefined,
  158. alipay: {
  159. content: '',
  160. showAlipay: false,
  161. alipay_way: "",
  162. alitopay_switch: false,
  163. avoidtax_switch: false,
  164. },
  165. loading: false,
  166. activeName: '-1',
  167. list: [],
  168. pagination: null,
  169. export_list: [],
  170. user_id: '',
  171. withdraw_type: '',
  172. withdraw_from: '',
  173. keyword: '',
  174. date: '',
  175. start_date: '',
  176. end_date: '',
  177. page: 1,
  178. batch_cash: {
  179. status: null,
  180. content: null,
  181. },
  182. dialogLoading: false,
  183. apply_status: 1,
  184. check_form: {
  185. remark: '',
  186. },
  187. new_status: 0,
  188. id:0,
  189. is_disabled: false,
  190. mobile : '',
  191. need_risk : 0,
  192. cash_log :null,
  193. applyLoading: false,
  194. headTypeList:[
  195. {
  196. name:'全部',
  197. label:-1,
  198. },
  199. {
  200. name:'个人/事业单位',
  201. label:1,
  202. },
  203. {
  204. name:'企业',
  205. label:2,
  206. },
  207. ],
  208. invoiceTypeList:[
  209. {
  210. name:'全部',
  211. label:-1,
  212. },
  213. {
  214. name:'待开票',
  215. label:0,
  216. },
  217. {
  218. name:'已开票',
  219. label:1,
  220. },
  221. {
  222. name:'驳回开票',
  223. label:2,
  224. },
  225. ],
  226. exportList: {},
  227. export_url: 'mall/order/invoice', // 导出路径
  228. };
  229. },
  230. mounted() {
  231. this.loadData();
  232. },
  233. created() {
  234. },
  235. methods: {
  236. handleSelectionChange(val) {
  237. this.multipleSelection = val;
  238. this.checkedData = val;
  239. },
  240. loadData(status = -1, page = 1) {
  241. this.loading = true;
  242. let params = {
  243. r: 'mall/order/invoice',
  244. status: status,
  245. page: page,
  246. user_id: this.search.user_id,
  247. keyword: this.search.keyword,
  248. invoice_status:this.search.invoice_status,
  249. head_type:this.search.head_type,
  250. order_no:this.search.order_no,
  251. };
  252. if (this.date) {
  253. Object.assign(params, {
  254. start_date: this.date[0],
  255. end_date: this.date[1],
  256. });
  257. }
  258. request({
  259. params,
  260. method: 'get'
  261. }).then(e => {
  262. this.loading = false;
  263. if (e.data.code == 0) {
  264. this.page = page
  265. this.list = e.data.data.list;
  266. this.pagination = e.data.data.pagination;
  267. this.exportList = e.data.data.export_list;
  268. } else {
  269. this.$message.error(e.data.msg);
  270. }
  271. }).catch(e => {
  272. this.loading = false;
  273. });
  274. },
  275. pageChange(page) {
  276. this.loadData(this.activeName, page);
  277. },
  278. handleClick(tab, event) {
  279. // console.log(this.user_id);
  280. // console.log(this.withdraw_type);
  281. // console.log(this.withdraw_from);
  282. // console.log(this.keyword);
  283. this.search.status = this.activeName
  284. this.loadData(this.activeName)
  285. },
  286. openDialogForm(id,status) {
  287. this.dialogFormVisible = true;
  288. this.new_status = status;
  289. this.id = id;
  290. },
  291. apply() {
  292. if (this.applyLoading === true) return;
  293. this.applyLoading = true;
  294. request({
  295. params: {
  296. r: 'mall/order/invoice',
  297. },
  298. method: 'post',
  299. data: {
  300. id: this.id,
  301. status: this.new_status,
  302. remark: this.check_form.remark,
  303. }
  304. }).then(e => {
  305. if (e.data.code === 0) {
  306. this.$message.success(e.data.msg);
  307. this.closeDialogForm();
  308. this.loadData(this.activeName, this.page);
  309. } else {
  310. this.$message.error(e.data.msg);
  311. }
  312. this.applyLoading = false;
  313. }).catch(e => {
  314. this.applyLoading = false;
  315. });
  316. },
  317. goOrder(id){
  318. let params = {
  319. r: 'mall/order/detail'
  320. };
  321. if (id) params = Object.assign(params, {
  322. id: id
  323. });
  324. navigateTo(params);
  325. },
  326. closeDialogForm() {
  327. this.dialogFormVisible = false;
  328. this.new_status = 0;
  329. this.check_form.remark = ''
  330. this.id = 0;
  331. }
  332. }
  333. })
  334. </script>
  335. <style>
  336. .el-tabs__header {
  337. padding: 0 20px;
  338. height: 56px;
  339. line-height: 56px;
  340. background-color: #fff;
  341. }
  342. .export-btn {
  343. position: absolute;
  344. top: 10px;
  345. right: 10px;
  346. z-index: 2;
  347. }
  348. .table-body {
  349. padding: 20px;
  350. background-color: #fff;
  351. }
  352. /* .table-body .el-table__row .el-button {
  353. padding: 0 !important;
  354. border: 0;
  355. margin: 0 5px;
  356. }*/
  357. .el-table th>.cell {
  358. color: #333;
  359. font-weight: bold;
  360. font-size: 14px;
  361. }
  362. .el-table__footer-wrapper,
  363. .el-table__header-wrapper {
  364. border-bottom: 1.4px solid #D6D6D6;
  365. }
  366. .input-item {
  367. display: inline-block;
  368. width: 250px;
  369. margin: 0 0 20px 20px;
  370. }
  371. .search_float {
  372. float: right;
  373. }
  374. .input-item .el-input__inner:hover {
  375. border: 1px solid #dcdfe6;
  376. border-right: 0;
  377. outline: 0;
  378. }
  379. .input-item .el-input__inner:focus {
  380. border: 1px solid #dcdfe6;
  381. border-right: 0;
  382. outline: 0;
  383. }
  384. .input-item .el-input-group__append {
  385. background-color: #fff;
  386. border-left: 0;
  387. width: 10%;
  388. padding: 0;
  389. }
  390. /*.input-item .el-input-group__append .el-button {
  391. padding: 0;
  392. }*/
  393. /*.input-item .el-input-group__append .el-button {
  394. margin: 0;
  395. }*/
  396. .default-avatar {
  397. width: 50px;
  398. height: 50px;
  399. border-radius: 50%;
  400. margin-right: 8px;
  401. }
  402. .uer-nickname {
  403. flex: 1;
  404. }
  405. .user_img {
  406. position: relative;
  407. margin-right: 8px;
  408. /* height: 50px;
  409. width: 50px; */
  410. }
  411. </style>