index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="mainData.billno"
  6. formPath="revoucher"
  7. :editData="mainData"
  8. :mainAreaData="mainAreaData"
  9. :turnPageId="20221010102903"
  10. :delApiId="20221009103203"
  11. idname="sa_cashbillid"
  12. ownertable="sa_cashbill"
  13. tags=""
  14. :tabs="['核销单查询','详细信息']"
  15. :statusCheck="[{key:'status',value:'审核'}]"
  16. @pageChange="pageChange"
  17. @onEditSuccess="queryMainData($route.query.id)">
  18. <div slot="tags">
  19. <!-- <tagPanl slot="tags" :data="tagObj" :id="mainData.sa_customersid" @onSuccess="queryMainData"/>-->
  20. <!-- 使用此插槽可不传[tags] -->
  21. <!-- :tabs="['经销商团队','代理区域','营销类别','账户余额']" -->
  22. </div>
  23. <div slot="customOperation">
  24. <customBtn
  25. btnName="一键核销"
  26. message="确认核销当前收入凭证吗?"
  27. idName="20230224183304"
  28. keyName="sa_cashbillid"
  29. :id="$route.query.id"
  30. @onSuccess="writeOffSuccess"
  31. class="inline-16"
  32. v-if="mainData.status == '审核' && tool.checkAuth($route.name,'writeoff') && mainData.unwriteoffamount > 0"
  33. />
  34. <examine class="inline-16" v-if="tool.checkAuth($route.name,'check')" :data="mainData" @examineSuccess="onSuccess"></examine>
  35. <customBtn
  36. btnName="对冲"
  37. message="确认对冲当前收入凭证吗?"
  38. idName="20230306102904"
  39. keyName="sa_cashbillid"
  40. :dialog="true"
  41. dialogTitle="请输入对冲金额"
  42. dialogKey="amount"
  43. :id="$route.query.id"
  44. @onSuccess="duichong"
  45. class="inline-16"
  46. :checkContent="true"
  47. v-if="mainData.status == '审核' && tool.checkAuth($route.name,'duichong')"
  48. />
  49. <!-- 此区域提供了自定义操作按钮 -->
  50. <!-- <div class="inline-16" v-if="tool.checkAuth($route.name,'receive') && mainData.freeget === 1 && length === 0 ">
  51. <receive :id="mainData.sa_customersid" @onshow="show"></receive>
  52. </div>
  53. <div class="inline-16" v-if="tool.checkAuth($route.name,'distribution') && length === 0">
  54. <distribution :data="mainData" @onshow="onSuccess" @setSuccess="onSuccess"></distribution>
  55. </div>
  56. <div class="inline-16" v-if="tool.checkAuth($route.name,'toVoid')">
  57. <to_void :id="mainData.sa_customersid" @onshow="onSuccess" @toVoidSuccess="onSuccess"></to_void>
  58. </div>-->
  59. </div>
  60. <div slot="slot1" >
  61. <detailed :detailData="mainData"></detailed>
  62. </div>
  63. <div slot="slot0" >
  64. <writeoffBill ref="bill"></writeoffBill>
  65. </div>
  66. </basicDetails>
  67. </div>
  68. </template>
  69. <script>
  70. import detailed from './modules/detailedData'
  71. import examine from './modules/examine'
  72. import writeoffBill from '../components/writeoffBill'
  73. import { log } from '@antv/g2plot/lib/utils'
  74. export default {
  75. name: "index",
  76. components:{detailed,examine,writeoffBill},
  77. data(){
  78. return {
  79. mainData:{},
  80. mainAreaData:[],
  81. }
  82. },
  83. methods:{
  84. writeOffSuccess (data) {
  85. this.queryMainData(this.$route.query.id)
  86. this.$refs.bill && this.$refs.bill.listData()
  87. let route = this.$route
  88. if (route.path !== '/taskDetails') {
  89. this.oldRoute = {path:route.path,query:route.query}
  90. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  91. }
  92. this.$router.replace({path:'/writeoffbillDetail',query:{id:data[0].sa_writeoffbillid,rowindex:data[0].rowindex}})
  93. },
  94. async queryMainData(id){
  95. const res = await this.$api.requested({
  96. "id": "20221009103003",
  97. "version":1,
  98. "content": {
  99. "sa_cashbillid":id
  100. }
  101. })
  102. this.mainData = res.data
  103. console.log(this.mainData);
  104. this.changeDataStructure()
  105. },
  106. duichong (data) {
  107. this.$store.dispatch('changeDetailDrawer',false)
  108. this.$router.push('/recvoucher')
  109. this.$router.replace({
  110. path:'/recvoucherDetails',
  111. query:{
  112. id:data.sa_cashbillid,
  113. }
  114. })
  115. setTimeout(() => {
  116. /* this.$router.replace({
  117. path:'/recvoucherDetails',
  118. query:{
  119. id:data.sa_cashbillid,
  120. }
  121. })*/
  122. this.$store.dispatch('changeDetailDrawer',true)
  123. /*this.queryMainData(this.$route.query.id)*/
  124. })
  125. },
  126. changeDataStructure(){
  127. let that = this
  128. this.mainAreaData = [
  129. {
  130. label:'单号',
  131. value:this.mainData.billno
  132. },
  133. {
  134. label:'状态',
  135. value:this.mainData.status,
  136. style:function () {
  137. let style = {}
  138. switch (that.mainData.status) {
  139. case '新建':
  140. style = {color:"#000000"}
  141. break;
  142. case '审核':
  143. style = {color:"#52C41A"}
  144. break;
  145. default:
  146. break;
  147. }
  148. return style
  149. }
  150. },
  151. {
  152. label:'账户类型',
  153. value:this.mainData.accountname
  154. },
  155. {
  156. label:'企业名称',
  157. value:this.mainData.enterprisename
  158. },
  159. {
  160. label:'单据日期',
  161. value:this.mainData.createdate
  162. },
  163. {
  164. label:'金额',
  165. value:this.tool.formatAmount(this.mainData.amount,2)
  166. },
  167. {
  168. label:'分类',
  169. value:this.mainData.class
  170. },
  171. {
  172. label:'分类明细',
  173. value:this.mainData.subclass
  174. },
  175. {
  176. label:'凭证来源',
  177. value:this.mainData.sourse
  178. },
  179. {
  180. label:'凭证来源说明',
  181. value:this.mainData.sourcenote
  182. },
  183. {
  184. label:'对冲单号',
  185. value:this.mainData.offsettingbillno
  186. },
  187. {
  188. label:'备注',
  189. value:this.mainData.remarks
  190. },
  191. {
  192. label: '核销金额',
  193. value: this.tool.formatAmount(this.mainData.writeoffamount, 2)
  194. },
  195. {
  196. label:'未核销金额',
  197. value:this.tool.formatAmount(this.mainData.unwriteoffamount,2)
  198. },
  199. ]
  200. },
  201. // 监听切换数据,上一页,下一页
  202. pageChange (id,rowindex) {
  203. this.flag = false
  204. this.$router.replace({path:'/recvoucherDetails',query:{id:id,rowindex:rowindex}})
  205. this.queryMainData(id)
  206. },
  207. onSuccess(){
  208. this.queryMainData(this.$route.query.id)
  209. }
  210. },
  211. mounted() {
  212. this.queryMainData(this.$route.query.id)
  213. },
  214. created() {
  215. }
  216. }
  217. </script>
  218. <style scoped>
  219. </style>