index.vue 5.8 KB

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