confirm.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div>
  3. <el-dropdown size="small" :hide-on-click="false" @command="addBtn">
  4. <span class="el-dropdown-link">
  5. <el-button class="inline-16" ref="btn" size="mini" type="primary">确 认</el-button>
  6. </span>
  7. <el-dropdown-menu slot="dropdown">
  8. <el-dropdown-item command="人工">人工</el-dropdown-item>
  9. <el-dropdown-item command="非贷款">非贷款</el-dropdown-item>
  10. </el-dropdown-menu>
  11. </el-dropdown>
  12. <el-dialog :visible.sync="drawer" width="60%" append-to-body>
  13. <el-table
  14. ref="multipleTable"
  15. :data="tableData"
  16. style="width: 100%"
  17. size="mini"
  18. border>
  19. <el-table-column
  20. prop="enterprisename"
  21. label="经销商名称"
  22. width="180">
  23. </el-table-column>
  24. <el-table-column
  25. prop="agentnum"
  26. label="经销商编号"
  27. width="180">
  28. </el-table-column>
  29. <el-table-column
  30. prop="contact"
  31. label="联系人">
  32. </el-table-column>
  33. <el-table-column
  34. label="地址">
  35. <template slot-scope="scope">
  36. {{scope.row.province}}{{scope.row.city}}{{scope.row.county}}{{scope.row.address}}
  37. </template>
  38. </el-table-column>
  39. <el-table-column
  40. label="操作"
  41. width="90">
  42. <template slot-scope="scope">
  43. <el-button type="text" size="small" @click="selectRow(scope.row)">选 择</el-button>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <div style="margin-top:16px;text-align:right">
  48. <el-pagination
  49. background
  50. small
  51. @size-change="handleSizeChange"
  52. @current-change="handleCurrentChange"
  53. :current-page="param.content.pageNumber"
  54. :page-size="param.content.pageSize"
  55. layout="total, prev, pager, next, jumper"
  56. :total="total">
  57. </el-pagination>
  58. </div>
  59. </el-dialog>
  60. </div>
  61. </template>
  62. <script>
  63. export default {
  64. name: '',
  65. components:{},
  66. data() {
  67. return {
  68. drawer:false,
  69. visibleAgent:false,
  70. tableData:[],
  71. total:0,
  72. param:{
  73. "classname": "webmanage.sale.agents.agents",
  74. "method": "query_agentList",
  75. "content": {
  76. "pageNumber": 1,
  77. "pageSize": 20,
  78. "where": {
  79. "condition": ""
  80. }
  81. }
  82. },
  83. };
  84. },
  85. computed:{
  86. },
  87. watch:{
  88. },
  89. created () {
  90. this.listData()
  91. },
  92. methods: {
  93. async addBtn (type) {
  94. if (type == '人工') {
  95. this.drawer = true
  96. } else {
  97. this.$confirm('确定该数据变更为非贷款吗?','提示',{
  98. confirmButtonText:'确定',
  99. cancelButtonText:'取消',
  100. type:'warning'
  101. }).then( async () => {
  102. let res = await this.$api.requested({
  103. "id": 20230106154204,
  104. "content": {
  105. "sa_bankstatementid": this.$route.query.id,
  106. "status":"已确认(非货款)", //已确认(人工),已确认(非货款)
  107. "sys_enterpriseid":''//状态为已确认(非货款)时不传
  108. }
  109. })
  110. console.log(res);
  111. this.tool.showMessage(res,() => {
  112. this.$emit('onSuccess')
  113. })
  114. })
  115. }
  116. },
  117. async listData () {
  118. const res = await this.$api.requested(this.param)
  119. this.tableData = res.data
  120. this.total = res.total
  121. console.log(this.tableData);
  122. },
  123. handleSizeChange(val) {
  124. // console.log(`每页 ${val} 条`);
  125. this.param.content.pageSize = val
  126. this.listData()
  127. },
  128. handleCurrentChange(val) {
  129. // console.log(`当前页: ${val}`);
  130. this.param.content.pageNumber = val
  131. this.listData()
  132. },
  133. selectRow (row) {
  134. this.$confirm('确定该经销商为这条数据的变更人吗?','提示',{
  135. confirmButtonText:'确定',
  136. cancelButtonText:'取消',
  137. type:'warning'
  138. }).then( async () => {
  139. let res = await this.$api.requested({
  140. "id": 20230106154204,
  141. "content": {
  142. "sa_bankstatementid": this.$route.query.id,
  143. "status":"已确认(人工)", //已确认(人工),已确认(非货款)
  144. "sys_enterpriseid":row.sys_enterpriseid//状态为已确认(非货款)时不传
  145. }
  146. })
  147. console.log(res);
  148. this.tool.showMessage(res,() => {
  149. this.$emit('onSuccess')
  150. this.drawer = false
  151. })
  152. })
  153. }
  154. },
  155. };
  156. </script>
  157. <style scoped>
  158. </style>