useGasCheck.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!--用气审核-->
  2. <template>
  3. <div class="app-container approval_handle">
  4. <div class="approval_handle-page" v-if="pageType==1">
  5. <template>
  6. <el-tabs v-model="activeName" @tab-click="handleTabClick">
  7. <el-tab-pane :label="'待审核('+totalWait+')'" name="1"></el-tab-pane>
  8. <el-tab-pane :label="'已通过('+totalPass+')'" name="2"></el-tab-pane>
  9. <el-tab-pane :label="'未通过('+totalRefuse+')'" name="3"></el-tab-pane>
  10. </el-tabs>
  11. </template>
  12. <el-form :model="queryParams" ref="queryForm" style="margin-top:20px;" :inline="true">
  13. <el-form-item label="关键字" prop="safetyPrecautions" >
  14. <el-input v-model="queryParams.searchValue" placeholder="申请人/联系电话" maxlength="50" />
  15. </el-form-item>
  16. <el-form-item>
  17. <p class="inquire-button-one" @click="handleQuery">查询</p>
  18. <p class="reset-button-one" @click="resetQuery">重置</p>
  19. </el-form-item>
  20. </el-form>
  21. <el-table border v-loading="loading" :data="tableData">
  22. <el-table-column label="申请人" align="left" prop="applyUserName"/>
  23. <el-table-column label="联系方式" align="left" prop="applyUserPhone"></el-table-column>
  24. <el-table-column label="使用气体" align="left" prop="useGasName"></el-table-column>
  25. <el-table-column label="申请时间" align="left" prop="applyTime"></el-table-column>
  26. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120">
  27. <template slot-scope="scope">
  28. <div class="table-button-box">
  29. <p class="table-button-null"></p>
  30. <p class="table-button-p"
  31. v-if="activeName==1"
  32. v-hasPermi="['bottle:usegasAuditRecord:add']"
  33. @click="handleClick('',scope.row,'check')"
  34. >审核</p>
  35. <p class="table-button-p"
  36. v-if="activeName==2 || activeName==3"
  37. v-hasPermi="['bottle:usegasAuditRecord:list']"
  38. @click="handleClick('',scope.row,'detail')"
  39. >详情</p>
  40. <p class="table-button-null"></p>
  41. </div>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. <pagination :page-sizes="[20, 30, 40, 50]"
  46. :total="total"
  47. layout="total, prev, pager, next, sizes, jumper"
  48. :page.sync="queryParams.pageNum"
  49. :limit.sync="queryParams.pageSize"
  50. @pagination="getList"
  51. />
  52. </div>
  53. <!--详情页面-->
  54. <detail-page v-if="pageType==2" :pageData2="pageData2"></detail-page>
  55. </div>
  56. </template>
  57. <script>
  58. import { usegasPassApplyList, usegasRefuseApplyList,
  59. usegasTitle,
  60. usegasWaitApplyList
  61. } from '@/api/gasManage3_0/gasManageSYD'
  62. import { getToken } from "@/utils/auth";
  63. import detailPage from '@/views/gasManage_syd/manage/useGasCheck/useGasCheckDetail'
  64. export default {
  65. name: "Approval",
  66. components: {
  67. detailPage
  68. },
  69. data() {
  70. return {
  71. activeName:'1',
  72. //页面状态
  73. pageType:1,
  74. loading:false,
  75. headers: {
  76. Authorization: "Bearer " + getToken()
  77. },
  78. // 查询参数
  79. queryParams: {
  80. pageNum: 1,
  81. pageSize:20,
  82. searchValue:'',
  83. },
  84. total:0,
  85. totalWait:0,
  86. totalPass:0,
  87. totalRefuse:0,
  88. tableData:[],
  89. dateRange:[],
  90. pageData2:{},
  91. form:{
  92. },
  93. rules:{
  94. txt:[
  95. {required: true, message: '请输入播放文字', trigger: 'blur'},
  96. { required: true, message: "请输入播放文字", validator: this.spaceJudgment, trigger: "blur" }
  97. ],
  98. },
  99. };
  100. },
  101. methods: {
  102. handleTabClick(tab, event) {
  103. // console.log(tab, event);
  104. console.log(this.activeName)
  105. this.getList()
  106. },
  107. handleClick(index,row,doType){
  108. let _this=this;
  109. if(doType=='check'){//审核
  110. this.pageType=2;
  111. _this.pageData2.status=0;
  112. _this.pageData2.item=row;
  113. }else if(doType=='detail'){//详情
  114. this.pageType=2;
  115. _this.pageData2.status=1;
  116. _this.pageData2.item=row;
  117. }else if(doType=='back'){//详情
  118. this.pageType=1;
  119. this.usegasTitle()
  120. this.getList()
  121. }
  122. },
  123. /** 搜索按钮操作 */
  124. handleQuery() {
  125. this.queryParams.pageNum = 1;
  126. this.getList();
  127. },
  128. /** 重置按钮操作 */
  129. resetQuery() {
  130. this.queryParams.searchValue = "";
  131. this.handleQuery();
  132. },
  133. // 取消按钮
  134. cancel() {
  135. this.form = {};
  136. this.dialogVisible = false;
  137. },
  138. /*提交*/
  139. submitForm(){
  140. this.$refs["form"].validate(valid => {
  141. if (valid) {
  142. let id = this.subId;
  143. }
  144. });
  145. },
  146. //tab头部数值
  147. usegasTitle(){
  148. usegasTitle().then( response => {
  149. let res=response.data;
  150. this.totalWait=res.waitApplyCount;
  151. this.totalPass=res.passApplyCount;
  152. this.totalRefuse=res.refuseApplyCount;
  153. });
  154. },
  155. getList(){
  156. let _this=this;
  157. if(this.activeName==1){
  158. usegasWaitApplyList(_this.queryParams).then( response => {
  159. let res=response.rows;
  160. _this.tableData=res;
  161. _this.total=response.total;
  162. });
  163. }else if(this.activeName==2){
  164. usegasPassApplyList(_this.queryParams).then( response => {
  165. let res=response.rows;
  166. _this.tableData=res;
  167. _this.total=response.total;
  168. });
  169. }else if(this.activeName==3){
  170. usegasRefuseApplyList(_this.queryParams).then( response => {
  171. let res=response.rows;
  172. _this.tableData=res;
  173. _this.total=response.total;
  174. });
  175. }
  176. },
  177. },
  178. mounted() {
  179. this.usegasTitle()
  180. this.getList()
  181. }
  182. };
  183. </script>
  184. <style scoped lang="scss">
  185. .approval_handle {
  186. display: flex!important;
  187. flex-direction: column;
  188. .approval_handle-page{
  189. flex:1;
  190. display: flex!important;
  191. flex-direction: column;
  192. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  193. padding:20px 20px 20px!important;
  194. border-radius:10px;
  195. .button-box{
  196. width:200px;
  197. display: flex;
  198. }
  199. }
  200. }
  201. </style>