invoiceCheck.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
  7. <template slot="left">
  8. <el-input v-model="listQuery.keyword" placeholder="关键字搜索..." clearable
  9. style="margin-left: 20px;width: 500px;float: left;">
  10. </el-input>
  11. <el-date-picker
  12. style="margin-left: 20px;float: left;"
  13. v-model="planDate"
  14. type="daterange"
  15. align="center"
  16. unlink-panels
  17. range-separator="至"
  18. start-placeholder="计划开票(开始)"
  19. end-placeholder="计划开票(结束)"
  20. :picker-options="pickerOptions" value-format="yyyy-MM-dd">
  21. </el-date-picker>
  22. <el-date-picker
  23. style="margin-left: 20px;float: left;"
  24. v-model="applyDate"
  25. type="daterange"
  26. align="center"
  27. unlink-panels
  28. range-separator="至"
  29. start-placeholder="申请时间(开始)"
  30. end-placeholder="申请时间(结束)"
  31. :picker-options="pickerOptions" value-format="yyyy-MM-dd">
  32. </el-date-picker>
  33. <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList" round>搜索
  34. </el-button>
  35. <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置
  36. </el-button>
  37. </template>
  38. <parentTable :data="pageData.records" slot="table" style="width: 100%;">
  39. <el-table-column label="业务类型" align="center">
  40. <template slot-scope="{row}">
  41. <span>{{ businessTypeAlias(row.businessType) }}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="订单名称" align="center" width="300" show-overflow-tooltip>
  45. <template slot-scope="{row}">
  46. <span>{{ row.orderName }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="订单号" align="center" width="200">
  50. <template slot-scope="{row}">
  51. <span>{{ row.orderId }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="发票抬头" align="center">
  55. <template slot-scope="{row}">
  56. <span>{{ row.title }}</span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="税号" align="center">
  60. <template slot-scope="{row}">
  61. <span>{{ row.taxNo }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="发票类型" align="center">
  65. <template slot-scope="{row}">
  66. <span>{{ row.type }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="待开金额" align="center">
  70. <template slot-scope="{row}">
  71. <span>{{ row.planAmount }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="计划开票时间" align="center">
  75. <template slot-scope="{row}">
  76. <span>{{ row.planMakeDate}}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="备注" align="center" show-overflow-tooltip>
  80. <template slot-scope="{row}">
  81. <span>{{ row.remark==null?'-':row.remark}}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="申请人" align="center">
  85. <template slot-scope="{row}">
  86. <span>{{ row.applyName }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="申请时间" align="center" width="250">
  90. <template slot-scope="{row}">
  91. <span>{{ row.created }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="开票状态" align="center">
  95. <template slot-scope="{row}">
  96. <span style="color:red;font-weight:bold">{{ row.state }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="操作" align="center" width="150" fixed="right">
  100. <template slot-scope="{row}">
  101. <PermissionButton menu-code="_views_make_invoice_check" class-name="filter-item" type="success"
  102. :page-jump="false" round size="mini" @click="openMakeDialog(row)" />
  103. </template>
  104. </el-table-column>
  105. </parentTable>
  106. </y-page-list-layout>
  107. <el-dialog :visible.sync="newInvoiceDialog" width="75%" center custom-class="doWarehouseClass">
  108. <el-form ref="invoice" :model="invoice" >
  109. <el-divider content-position="left">开票信息</el-divider>
  110. <el-row>
  111. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  112. <el-form-item
  113. label="发票抬头:"
  114. :rules="{required: true, message: '发票抬头不能为空', trigger: 'blur'}"
  115. prop="title"
  116. label-width="140px"
  117. class="postInfo-container-item"
  118. >
  119. <el-input v-model.trim="invoice.title" class="filter-item" readonly disabled />
  120. </el-form-item>
  121. </el-col>
  122. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  123. <el-form-item
  124. label="发票类型:"
  125. :rules="{required: true, message: '发票类型不能为空', trigger: 'blur'}"
  126. prop="type"
  127. label-width="140px"
  128. class="postInfo-container-item"
  129. >
  130. <el-select v-model="invoice.type" style="width:206px" readonly disabled>
  131. <el-option label="普票" value="普票"></el-option>
  132. <el-option label="专票" value="专票"></el-option>
  133. </el-select>
  134. </el-form-item>
  135. </el-col>
  136. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  137. <el-form-item
  138. label="税号:"
  139. :rules="{required: true, message: '税号不能为空', trigger: 'blur'}"
  140. prop="taxNo"
  141. label-width="140px"
  142. class="postInfo-container-item"
  143. >
  144. <el-input v-model.trim="invoice.taxNo" class="filter-item" readonly disabled />
  145. </el-form-item>
  146. </el-col>
  147. </el-row>
  148. <el-row>
  149. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  150. <el-form-item
  151. label="计划开票金额(元):"
  152. prop="planAmount"
  153. :rules="{required: true, message: '使用权面积不能为空', trigger: 'blur'}"
  154. label-width="140px"
  155. class="postInfo-container-item"
  156. >
  157. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="invoice.planAmount" type="number" readonly disabled
  158. style="width:206px" class="filter-item" />
  159. </el-form-item>
  160. </el-col>
  161. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  162. <el-form-item
  163. label="计划开票日期:"
  164. prop="planMakeDate"
  165. :rules="{required: true, message: '计划开票日期不能为空', trigger: 'blur'}"
  166. label-width="140px"
  167. class="postInfo-container-item"
  168. >
  169. <el-date-picker
  170. v-model="invoice.planMakeDate" type="date" placeholder="选择日期" style="width:206px" readonly disabled>
  171. </el-date-picker>
  172. </el-form-item>
  173. </el-col>
  174. </el-row>
  175. <el-row>
  176. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  177. <el-form-item
  178. label="实开金额:"
  179. :rules="{required: true, message: '实际开票金额不能为空', trigger: 'blur'}"
  180. prop="realAmount"
  181. label-width="140px"
  182. class="postInfo-container-item"
  183. >
  184. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="invoice.realAmount" type="number"
  185. style="width:206px" class="filter-item" />
  186. </el-form-item>
  187. </el-col>
  188. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  189. <el-form-item
  190. label="实开日期:"
  191. prop="realMakeDate"
  192. :rules="{required: true, message: '实际开票日期不能为空', trigger: 'blur'}"
  193. label-width="140px"
  194. class="postInfo-container-item"
  195. >
  196. <el-date-picker
  197. v-model="invoice.realMakeDate" type="date" placeholder="选择日期" style="width:206px">
  198. </el-date-picker>
  199. </el-form-item>
  200. </el-col>
  201. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  202. <el-form-item
  203. label="全额收款:"
  204. prop="isPayAll"
  205. label-width="140px"
  206. class="postInfo-container-item"
  207. >
  208. <el-radio :value="invoice.isPayAll" :label="false||null" border size="medium" readonly>否</el-radio>
  209. <el-radio :value="invoice.isPayAll" :label="true" border size="medium" readonly>是</el-radio>
  210. </el-form-item>
  211. </el-col>
  212. </el-row>
  213. <el-row>
  214. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  215. <el-form-item
  216. label="业务类型:"
  217. prop="businessType"
  218. label-width="140px"
  219. class="postInfo-container-item"
  220. >
  221. <el-input :value="businessTypeAlias(invoice.businessType)" class="filter-item" readonly disabled />
  222. </el-form-item>
  223. </el-col>
  224. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  225. <el-form-item
  226. label="报告号:"
  227. prop="reprotNo"
  228. label-width="140px"
  229. class="postInfo-container-item"
  230. >
  231. <el-input v-model.trim="invoice.reportNo" class="filter-item" readonly disabled />
  232. </el-form-item>
  233. </el-col>
  234. </el-row>
  235. <el-divider content-position="left">银行信息</el-divider>
  236. <el-row>
  237. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  238. <el-form-item
  239. label="开户行:"
  240. prop="bankName"
  241. label-width="140px"
  242. class="postInfo-container-item"
  243. >
  244. <el-input v-model.trim="invoice.bankName" class="filter-item" />
  245. </el-form-item>
  246. </el-col>
  247. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  248. <el-form-item
  249. label="银行账号:"
  250. prop="bankAccount"
  251. label-width="140px"
  252. class="postInfo-container-item"
  253. >
  254. <el-input v-model.trim="invoice.bankAccount" class="filter-item" />
  255. </el-form-item>
  256. </el-col>
  257. </el-row>
  258. <el-row>
  259. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  260. <el-form-item
  261. label="地址:"
  262. prop="bankAddress"
  263. label-width="140px"
  264. class="postInfo-container-item"
  265. >
  266. <el-input v-model.trim="invoice.bankAddress" class="filter-item" />
  267. </el-form-item>
  268. </el-col>
  269. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  270. <el-form-item
  271. label="电话:"
  272. prop="bankTel"
  273. label-width="140px"
  274. class="postInfo-container-item"
  275. >
  276. <el-input v-model.trim="invoice.bankTel" class="filter-item" />
  277. </el-form-item>
  278. </el-col>
  279. </el-row>
  280. <el-divider content-position="left">发票信息</el-divider>
  281. <el-row>
  282. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  283. <el-form-item
  284. label="开票项目:"
  285. prop="makeItem"
  286. label-width="140px"
  287. class="postInfo-container-item"
  288. >
  289. <el-input v-model.trim="invoice.makeItem" class="filter-item" />
  290. </el-form-item>
  291. </el-col>
  292. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  293. <el-form-item
  294. label="项目数量:"
  295. prop="itemQuantity"
  296. label-width="140px"
  297. class="postInfo-container-item"
  298. >
  299. <el-input v-model.trim="invoice.itemQuantity" class="filter-item" />
  300. </el-form-item>
  301. </el-col>
  302. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  303. <el-form-item
  304. label="计量单位:"
  305. prop="itemUnit"
  306. label-width="140px"
  307. class="postInfo-container-item"
  308. >
  309. <el-input v-model.trim="invoice.itemUnit" class="filter-item" placeholder="个/套/箱/次/斤/公斤/..."/>
  310. </el-form-item>
  311. </el-col>
  312. </el-row>
  313. <el-row>
  314. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  315. <el-form-item
  316. label="税点:"
  317. prop="taxRate"
  318. label-width="140px"
  319. class="postInfo-container-item"
  320. >
  321. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="invoice.taxRate" type="number"
  322. style="width:206px" class="filter-item" />
  323. </el-form-item>
  324. </el-col>
  325. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  326. <el-form-item
  327. label="税额:"
  328. prop="taxAmount"
  329. label-width="140px"
  330. class="postInfo-container-item"
  331. >
  332. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="invoice.taxAmount" type="number"
  333. style="width:206px" class="filter-item" />
  334. </el-form-item>
  335. </el-col>
  336. </el-row>
  337. <el-row>
  338. <el-col :xs="24" :sm="12" :lg="18" :span="6">
  339. <el-form-item
  340. label="备注:"
  341. prop="remark"
  342. label-width="140px"
  343. class="postInfo-container-item"
  344. >
  345. <el-input v-model.trim="invoice.remark" type="textarea" class="filter-item" />
  346. </el-form-item>
  347. </el-col>
  348. </el-row>
  349. </el-form>
  350. <span slot="footer" class="dialog-footer">
  351. <el-button @click="newInvoiceDialog = false">取 消</el-button>
  352. <el-button type="primary" @click="makeInvoice()" :disabled="this.invoice.state!='审核中'">确认开票</el-button>
  353. <el-button type="danger" @click="refuseApply()" :disabled="this.invoice.state!='审核中'">拒绝申请</el-button>
  354. </span>
  355. </el-dialog>
  356. </div>
  357. </template>
  358. <script>
  359. import YPageListLayout from '@/components/YPageListLayout'
  360. import Breadcrumb from '@/components/Breadcrumb'
  361. export default {
  362. name: 'invoiceCheck',
  363. components: {
  364. Breadcrumb,
  365. YPageListLayout,
  366. },
  367. filters: {
  368. },
  369. data() {
  370. return {
  371. pageData: { records: [] },
  372. listQuery: {
  373. page: 1,
  374. size: 10,
  375. descs: 'id',
  376. keyword:null
  377. },
  378. newInvoiceDialog:false,
  379. invoice:{
  380. id:null,
  381. productionFundId:null,
  382. title:null,
  383. type:null,
  384. taxNo:null,
  385. planAmount:null,
  386. planMakeDate:null,
  387. bankName:null,
  388. bankAccount:null,
  389. bankAddress:null,
  390. bankTel:null,
  391. makeItem:null,
  392. itemQuantity:null,
  393. itemUnit:null,
  394. taxRate:null,
  395. taxAmount:null,
  396. remark:null,
  397. businessType:null,
  398. reportNo:null
  399. },
  400. planDate:"",
  401. applyDate:"",
  402. pickerOptions: {
  403. shortcuts: [{
  404. text: '最近一周',
  405. onClick(picker) {
  406. const end = new Date();
  407. const start = new Date();
  408. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  409. picker.$emit('pick', [start, end]);
  410. }
  411. }, {
  412. text: '最近一个月',
  413. onClick(picker) {
  414. const end = new Date();
  415. const start = new Date();
  416. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  417. picker.$emit('pick', [start, end]);
  418. }
  419. }, {
  420. text: '最近三个月',
  421. onClick(picker) {
  422. const end = new Date();
  423. const start = new Date();
  424. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  425. picker.$emit('pick', [start, end]);
  426. }
  427. }]
  428. },
  429. }
  430. },
  431. created() {
  432. this.getList();
  433. },
  434. methods: {
  435. resetSearch() {
  436. this.$router.push({ query: {} });
  437. this.planDate = '';
  438. this.applyDate = '';
  439. this.listQuery = {
  440. current: 1,
  441. size: 10,
  442. descs: 'id',
  443. }
  444. this.getList()
  445. },
  446. searchList() {
  447. // 重置分页
  448. this.listQuery.page = 1
  449. this.listQuery.size = 10
  450. if (this.planDate){
  451. this.listQuery.pStartDate = this.planDate[0];
  452. this.listQuery.pEndDate = this.planDate[1];
  453. }
  454. if (this.applyDate){
  455. this.listQuery.aStartDate = this.applyDate[0]+' 00:00:00';
  456. this.listQuery.aEndDate = this.applyDate[1]+' 23:59:59';
  457. }
  458. this.getList()
  459. },
  460. getList() {
  461. this.$api.financeInvoice.list(Object.assign({}, this.listQuery)).then(res=>{
  462. if (res.code ===200){
  463. this.pageData = res.data;
  464. }
  465. })
  466. },
  467. businessTypeAlias(code){
  468. return '大中型'
  469. },
  470. openMakeDialog(row){
  471. this.newInvoiceDialog= true;
  472. this.invoice = row;
  473. },
  474. makeInvoice(){
  475. this.$refs.invoice.validate(valid=>{
  476. if(valid){
  477. this.$confirm('请确认开票信息是否正确操作后无法修改!','提示',{
  478. confirmButtonText: '确定',
  479. cancelButtonText: '取消',
  480. type: 'warning',
  481. center: true
  482. }).then(()=>{
  483. if (this.invoice.realAmount===0){
  484. this.$notify({
  485. title: '提示',
  486. message: '实开金额不能为0.00',
  487. type: 'info',
  488. duration: 2000
  489. });
  490. return;
  491. }
  492. this.$api.financeInvoice.edit(this.invoice).then(res=>{
  493. if (res.code === 200 && res.data){
  494. this.$notify({
  495. title: '成功',
  496. message: '操作成功',
  497. type: 'success',
  498. duration: 2000
  499. });
  500. this.newInvoiceDialog= false;
  501. this.getList();
  502. }else {
  503. this.$notify({
  504. title: '失败',
  505. message: '操作失败',
  506. type: 'error',
  507. duration: 2000
  508. });
  509. }
  510. })
  511. })
  512. }
  513. })
  514. },
  515. refuseApply(){
  516. this.$prompt('请填写拒绝理由,若无可直接点击确认按钮。','提示',{
  517. confirmButtonText: '确认',
  518. cancelButtonText: '取消',
  519. type: "warning",
  520. }).then(({value})=>{
  521. this.invoice.reason = value;
  522. this.invoice.state = '驳回';
  523. this.$api.financeInvoice.edit(this.invoice).then(res=>{
  524. if (res.code === 200 && res.data){
  525. this.$notify({
  526. title: '成功',
  527. message: '操作成功',
  528. type: 'success',
  529. duration: 2000
  530. });
  531. this.newInvoiceDialog= false;
  532. this.getList();
  533. }else {
  534. this.$notify({
  535. title: '失败',
  536. message: '操作失败',
  537. type: 'error',
  538. duration: 2000
  539. });
  540. }
  541. })
  542. })
  543. }
  544. },
  545. }
  546. </script>
  547. <style lang="scss" scoped>
  548. /deep/.doWarehouseClass {
  549. border-radius: 10px;
  550. }
  551. </style>