detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <div>
  3. <!-- <el-button size="small" type="text" @click="onShow(dialogFormVisible = true)">明 细</el-button>-->
  4. <el-drawer
  5. title="账户流水明细"
  6. :visible.sync="dialogFormVisible"
  7. size="90%"
  8. direction="rtl"
  9. append-to-body
  10. :show-close="false"
  11. @close="onClose">
  12. <div class="flex-align-stretch drawer__panel" style="margin-bottom: 0 !important;padding-bottom: 10px">
  13. <div class="mt-10">
  14. <label class="search__label">收支类型:</label>
  15. <el-select class="inline-24" v-model="param.content.where.type" placeholder="请选择类型" @change="selectChange" size="small" clearable>
  16. <el-option label="收入" value="1"></el-option>
  17. <el-option label="支出" value="0"></el-option>
  18. </el-select>
  19. </div>
  20. <div class="mt-10">
  21. <label class="search__label" >审核时间:</label>
  22. <el-date-picker
  23. style="margin-right: 24px !important;"
  24. size="small"
  25. @change="selectChange"
  26. value-format="yyyy-MM-dd"
  27. v-model="dateSelect"
  28. type="daterange"
  29. range-separator="至"
  30. start-placeholder="开始日期"
  31. end-placeholder="结束日期"
  32. clearable>
  33. </el-date-picker>
  34. </div>
  35. <div class="mt-10 inline-16">
  36. <el-input style="width:200px;" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
  37. </el-input>
  38. </div>
  39. <div class="mt-10">
  40. <exportFile :param="param" :columns="tablecols" fileName="账户流水明细"></exportFile>
  41. </div>
  42. </div>
  43. <div style="padding:0 16px 0 16px">
  44. <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 154px)" :width="true" :custom="true" >
  45. <template v-slot:customcol="scope">
  46. <div v-if="scope.column.columnname === 'type'">
  47. {{scope.column.data[[scope.column.columnname]] == '1' ? '收入':'支出'}}
  48. </div>
  49. <div v-else-if="scope.column.columnname === 'amount'">
  50. {{tool.formatAmount(scope.column.data[[scope.column.columnname]],2)}}
  51. </div>
  52. <div v-else>
  53. {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
  54. </div>
  55. </template>
  56. <template v-slot:opreation="scope">
  57. <el-button type="text" size="mini" @click="detailGo(scope.data)">详情</el-button>
  58. </template>
  59. </tableNewLayout>
  60. <!-- <div class="container normal-panel" style="text-align:right">
  61. <el-pagination
  62. background
  63. @size-change="handleSizeChange"
  64. @current-change="handleCurrentChange"
  65. :current-page="currentPage"
  66. :page-sizes="[100, 150, 200, 250]"
  67. :page-size="100"
  68. layout="total,sizes, prev, pager, next, jumper"
  69. :total="total">
  70. </el-pagination>
  71. </div>-->
  72. </div>
  73. </el-drawer>
  74. </div>
  75. </template>
  76. <script>
  77. import exportFile from '@/components/export_file/index5.vue'
  78. export default {
  79. name: "detail",
  80. props:["hrid"],
  81. components:{exportFile},
  82. data(){
  83. return {
  84. dialogFormVisible:false,
  85. status:'',
  86. dateSelect:'',
  87. total:0,
  88. currentPage:0,
  89. param:{
  90. "id": 20240111090304,
  91. "content": {
  92. "pageSize": 100,
  93. "pageNumner": 1,
  94. "hrid": "",
  95. "where": {
  96. "condition": "",
  97. "begdate": "",
  98. "enddate": "",
  99. "type":""
  100. }
  101. }
  102. },
  103. tablecols:[],
  104. list:[]
  105. }
  106. },
  107. methods:{
  108. onShow(){
  109. /*this.$emit('detailId',this.hrid)*/
  110. this.listData()
  111. },
  112. async listData(){
  113. this.param.content.hrid = this.$route.query.id
  114. const res = await this.$api.requested(this.param)
  115. this.list = res.data.rows
  116. /*this.total = res.total
  117. this.currentPage = res.pageNumner*/
  118. },
  119. selectChange(){
  120. console.log(this.dateSelect)
  121. if (this.dateSelect){
  122. this.param.content.where.begdate = this.dateSelect[0]
  123. this.param.content.where.enddate = this.dateSelect[1]
  124. }else {
  125. this.param.content.where.begdate = ''
  126. this.param.content.where.enddate = ''
  127. }
  128. this.listData()
  129. },
  130. onClose(){
  131. this.$store.dispatch('changeDetailDrawer',false)
  132. this.dialogFormVisible = false
  133. this.param.content.where = {
  134. "condition": "",
  135. "begdate": "",
  136. "enddate": "",
  137. "type":""
  138. }
  139. },
  140. handleSizeChange(val) {
  141. // console.log(`每页 ${val} 条`);
  142. this.param.content.pageSize = val
  143. this.listData()
  144. },
  145. handleCurrentChange(val) {
  146. // console.log(`当前页: ${val}`);
  147. this.param.content.pageNumber = val
  148. this.listData()
  149. },
  150. detailGo(row){
  151. console.log(row)
  152. if (row.type === '1'){
  153. let route = this.$route
  154. if (route.path !== '/salerIncomeDetail') {
  155. this.oldRoute = {path:route.path,query:route.query}
  156. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  157. }
  158. this.$store.dispatch('changeDetailDrawer',true)
  159. this.$router.push({
  160. path:'/salerIncomeDetail',
  161. query:{
  162. id:row.sa_hrcashbillid,
  163. rowindex:row.rowindex
  164. }
  165. })
  166. }else {
  167. let route = this.$route
  168. if (route.path !== '/salerExpenditureDetail') {
  169. this.oldRoute = {path:route.path,query:route.query}
  170. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  171. }
  172. this.$store.dispatch('changeDetailDrawer',true)
  173. this.$router.push({
  174. path:'/salerExpenditureDetail',
  175. query:{
  176. id:row.sa_hrcashbillid,
  177. rowindex:row.rowindex
  178. }
  179. })
  180. }
  181. },
  182. async drawerGo(id){
  183. this.dialogFormVisible = true
  184. this.param.content.hrid = id
  185. const res = await this.$api.requested(this.param)
  186. this.list = res.data.rows
  187. }
  188. },
  189. mounted() {
  190. this.dialogFormVisible = true
  191. this.listData()
  192. },
  193. created() {
  194. this.tablecols = this.tool.tabelCol(this.$route.name).accountDetailTable.tablecols
  195. }
  196. }
  197. </script>
  198. <style scoped>
  199. </style>