index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <div class="mod-auditPaths">
  3. <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
  4. <el-form-item>
  5. <el-input v-model="dataForm.pathName" placeholder="审核路径名称" clearable style="width: 138PX;"></el-input>
  6. </el-form-item>
  7. <el-form-item style="float: right">
  8. <el-button icon="el-icon-search" @click="getDataList()">查询</el-button>
  9. <el-button icon="el-icon-refresh-left" @click="resetSearch">重置</el-button>
  10. <el-button type="primary" @click="addOrUpdateHandle()">
  11. 新增
  12. </el-button>
  13. </el-form-item>
  14. </el-form>
  15. <el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
  16. <el-table-column
  17. header-align="center"
  18. align="center"
  19. type="index"
  20. width="80"
  21. label="序号">
  22. </el-table-column>
  23. <el-table-column
  24. prop="pathName"
  25. header-align="center"
  26. align="center"
  27. width="220"
  28. label="审核路径名称">
  29. </el-table-column>
  30. <el-table-column
  31. prop="opUserName"
  32. header-align="center"
  33. align="center"
  34. width="150"
  35. label="维护人">
  36. </el-table-column>
  37. <el-table-column
  38. prop="opDate"
  39. header-align="center"
  40. align="center"
  41. width="150"
  42. label="维护时间">
  43. </el-table-column>
  44. <el-table-column
  45. prop="branName"
  46. header-align="center"
  47. align="center"
  48. width="180"
  49. label="公司名称">
  50. </el-table-column>
  51. <el-table-column
  52. prop="status"
  53. header-align="center"
  54. align="center"
  55. width="90"
  56. label="状态">
  57. <template slot-scope="scope">
  58. <!-- <span v-if="scope.row.status === 'N'">新建</span>-->
  59. <span v-if="scope.row.status === 'A'">有效</span>
  60. <span v-if="scope.row.status === 'S'">停用</span>
  61. <span v-if="scope.row.status === 'Z'">暂存</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column
  65. prop="remarks"
  66. header-align="center"
  67. align="center"
  68. label="备注">
  69. </el-table-column>
  70. <el-table-column
  71. fixed="right"
  72. header-align="center"
  73. align="center"
  74. width="150"
  75. label="操作">
  76. <template slot-scope="scope">
  77. <el-button type="text" size="small"
  78. @click="addOrUpdateHandle(scope.row.id)">修改
  79. </el-button>
  80. <el-button type="text" size="small"
  81. @click="deleteHandle(scope.row.id)">删除
  82. </el-button>
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. <el-pagination
  87. @size-change="sizeChangeHandle"
  88. @current-change="currentChangeHandle"
  89. :current-page="dataForm.current"
  90. :page-sizes="[10, 20, 50, 100]"
  91. :page-size="dataForm.size"
  92. :total="totalPage"
  93. layout="total, sizes, prev, pager, next, jumper">
  94. </el-pagination>
  95. <!-- 弹窗, 新增 / 修改 -->
  96. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" :dataForm="editModel"></add-or-update>
  97. </div>
  98. </template>
  99. <script>
  100. import AddOrUpdate from './auditPaths-add-or-update'
  101. import {addCharge,delCharge} from '@/api/system/toConfigure'
  102. export default {
  103. data () {
  104. return {
  105. loginContractorId: null,
  106. dataForm: {
  107. pathId: null,
  108. pathName: null,
  109. opUserId: null,
  110. opUserName: null,
  111. opDate: null,
  112. status: 'A',
  113. remarks: null,
  114. current: 1,
  115. size: 10
  116. },
  117. editModel: {},
  118. dataList: [],
  119. totalPage: 0,
  120. dataListLoading: false,
  121. addOrUpdateVisible: false
  122. }
  123. },
  124. components: {
  125. AddOrUpdate
  126. },
  127. activated () {
  128. // this.$http({
  129. // url: this.$http.adornUrl('/sys/user/getLoginContractorId'),
  130. // method: 'post'
  131. // }).then(({data}) => {
  132. // this.loginContractorId = data.loginContractorId
  133. // })
  134. this.getDataList()
  135. },
  136. methods: {
  137. // 获取数据列表
  138. getDataList () {
  139. this.dataListLoading = true
  140. addCharge(this.dataForm).then(data => {
  141. console.log(data)
  142. if (typeof data.rows !== 'undefined' && data.rows !== null) {
  143. this.dataList = data.rows
  144. this.totalPage = data.rows.total
  145. } else {
  146. this.dataList = []
  147. this.totalPage = 0
  148. }
  149. this.dataListLoading = false
  150. })
  151. },
  152. resetSearch () {
  153. this.dataForm.pathName = null
  154. this.dataForm.opUserName = null
  155. this.dataForm.opDate = null
  156. this.dataForm.current = 1
  157. this.dataForm.size = 10
  158. this.getDataList()
  159. },
  160. // 每页数
  161. sizeChangeHandle (val) {
  162. this.dataForm.size = val
  163. this.dataForm.current = 1
  164. this.getDataList()
  165. },
  166. // 当前页
  167. currentChangeHandle (val) {
  168. this.dataForm.current = val
  169. this.getDataList()
  170. },
  171. // 新增 / 修改
  172. addOrUpdateHandle (val) {
  173. this.addOrUpdateVisible = true
  174. this.$nextTick(() => {
  175. this.$refs.addOrUpdate.init(val)
  176. })
  177. },
  178. // 删除
  179. deleteHandle (id) {
  180. this.$confirm('是否确认删除财务数据主编号为"' + id + '"的数据项?', '警告', {
  181. confirmButtonText: '确定',
  182. cancelButtonText: '取消',
  183. type: 'warning'
  184. }).then(function() {
  185. return delCharge(id)
  186. }).then(() => {
  187. this.getList()
  188. this.msgSuccess('删除成功')
  189. })
  190. // this.$confirm(`确定进行删除操作?`, '提示', {
  191. // confirmButtonText: '确定',
  192. // cancelButtonText: '取消',
  193. // type: 'warning'
  194. // }).then(() => {
  195. // this.$http({
  196. // url: this.$http.adornUrl('/engineering/auditPaths/delete'),
  197. // method: 'post',
  198. // data: (id)
  199. // }).then(({data}) => {
  200. // if (data && data.code === 0) {
  201. // this.$message({
  202. // message: '操作成功',
  203. // type: 'success',
  204. // duration: 600,
  205. // onClose: () => {
  206. // this.getDataList()
  207. // }
  208. // })
  209. // } else {
  210. // this.$message.error(data.msg)
  211. // }
  212. // })
  213. // }).catch(() => {
  214. // })
  215. }
  216. }
  217. }
  218. </script>