index.vue 6.0 KB

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