index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <div class="app-container">
  3. <el-form inline :model="dataForm">
  4. <el-form-item>
  5. <el-select v-model="dataForm.actId" placeholder="请选择活动名" clearable filterable @change="getDataList()">
  6. <el-option
  7. v-for="item in actList"
  8. :key="item.actId"
  9. :label="item.name"
  10. :value="item.actId">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item>
  15. <el-button icon="el-icon-refresh-left" @click="getDataList">搜索</el-button>
  16. </el-form-item>
  17. <el-form-item>
  18. <el-button icon="el-icon-refresh-left" @click="resetSearch">重置</el-button>
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button @click="save" style="float: right">保存</el-button>
  22. </el-form-item>
  23. </el-form>
  24. <el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;">
  25. <el-table-column
  26. prop="branName"
  27. header-align="center"
  28. align="center"
  29. label="承包单位"
  30. v-if="loginContractorId === 1">
  31. </el-table-column>
  32. <el-table-column
  33. prop="actId"
  34. header-align="center"
  35. align="center"
  36. width="400"
  37. label="活动名">
  38. <template slot-scope="scope">
  39. <span v-if="scope.row.actId === 110">入库</span>
  40. <span v-if="scope.row.actId === 120">出库</span>
  41. <span v-if="scope.row.actId === 130">货转</span>
  42. <span v-if="scope.row.actId === 140">调拨</span>
  43. <span v-if="scope.row.actId === 210">对账</span>
  44. <span v-if="scope.row.actId === 220">收费</span>
  45. <span v-if="scope.row.actId === 230">付费</span>
  46. <span v-if="scope.row.actId === 310">仓储费</span>
  47. <span v-if="scope.row.actId === 320">计划费</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column
  51. prop="reviewConditions"
  52. header-align="center"
  53. align="center"
  54. width="250"
  55. label="审核条件">
  56. <template slot-scope="scope">
  57. <span v-if="scope.row.reviewConditions === 'O'">
  58. 正常流程
  59. </span>
  60. <span v-if="scope.row.reviewConditions === 'I'">
  61. 非正常流程
  62. </span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column
  66. prop="pathId"
  67. header-align="center"
  68. align="center"
  69. label="审核路径">
  70. <template slot-scope="scope">
  71. <el-select v-model="scope.row.pathId" placeholder="审核路径" filterable style="width: 100%">
  72. <el-option
  73. v-for="item in optionsPathIds"
  74. :key="item.id"
  75. :label="item.pathName"
  76. :value="item.id">
  77. </el-option>
  78. </el-select>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. <pagination
  83. v-show="total>0"
  84. :total="total"
  85. :page.sync="dataForm.pageNum"
  86. :limit.sync="dataForm.pageSize"
  87. @pagination="getDataList"
  88. />
  89. </div>
  90. </template>
  91. <script>
  92. import {addCharge,preservation} from '@/api/system/auditConfiguration'
  93. export default {
  94. data () {
  95. return {
  96. dataForm: {
  97. branchId: this.$store.state.user.loginContractorId,
  98. actId: null,
  99. pageNum: 1,
  100. pageSize: 10,
  101. },
  102. total:0,
  103. dataList: [],
  104. optionsBranch: [],
  105. optionsPathIds: [],
  106. dataListLoading: false,
  107. loginContractorId: null,
  108. totalPage: 0,
  109. actList: [{
  110. name: '入库', actId: 110
  111. },{
  112. name: '出库', actId: 120
  113. },{
  114. name: '货转', actId: 130
  115. },{
  116. name: '调拨', actId: 140
  117. },{
  118. name: '对账', actId: 210
  119. },{
  120. name: '收费', actId: 220
  121. },{
  122. name: '付费', actId: 230
  123. },{
  124. name: '仓储费', actId: 310
  125. },{
  126. name: '计划费', actId: 320
  127. }
  128. ]
  129. }
  130. },
  131. activated () {
  132. // this.$http({
  133. // url: this.$http.adornUrl('/sys/user/getLoginContractorId'),
  134. // method: 'post'
  135. // }).then(({data}) => {
  136. // this.loginContractorId = data.loginContractorId
  137. // this.$set(this.dataForm, 'branchId', data.loginContractorId)
  138. // })
  139. // this.$http({
  140. // url: this.$http.adornUrl('/engineering/bbranchs/selectBranchs'),
  141. // method: 'post',
  142. // data: ({postAddr: 'audit'})
  143. // }).then(({data}) => {
  144. // if (typeof data.list !== 'undefined' && data.list !== null) {
  145. // if (typeof data.list.branchs !== 'undefined' && data.list.branchs !== null) {
  146. // this.optionsBranch = data.list.branchs
  147. // }
  148. // }
  149. // })
  150. this.$nextTick(function () {
  151. this.getDataList()
  152. })
  153. },
  154. methods: {
  155. // 获取数据列表
  156. getDataList () {
  157. console.log(this.dataForm)
  158. addCharge(this.dataForm).then(data =>{
  159. console.log(data)
  160. this.dataList = data.auditPathAct
  161. this.optionsPathIds = data.auditPath
  162. this.total = data.count
  163. })
  164. },
  165. // 保存
  166. save () {
  167. let formData = new window.FormData()
  168. formData.append('auditPathsActs', JSON.stringify(this.dataList))
  169. preservation(formData).then(data =>{
  170. console.log(data)
  171. this.$message.success('保存成功');
  172. })
  173. },
  174. // 每页数
  175. sizeChangeHandle (val) {
  176. this.dataForm.size = val
  177. this.dataForm.current = 1
  178. this.getDataList()
  179. },
  180. // 当前页
  181. currentChangeHandle (val) {
  182. this.dataForm.current = val
  183. this.getDataList()
  184. },
  185. resetSearch () {
  186. this.dataForm.actId = null
  187. this.dataForm.current = 1
  188. this.dataForm.size = 10
  189. this.getDataList()
  190. }
  191. }
  192. }
  193. </script>