index.vue 6.3 KB

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