certification.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!--资质证照-->
  2. <template>
  3. <div class="app-container approval_handle">
  4. <div class="approval_handle-page" v-if="pageType == 1">
  5. <el-form :model="queryParams" ref="queryForm" style="margin-top:20px;" :inline="true">
  6. <el-form-item label="关键字" prop="name">
  7. <el-input
  8. v-model="queryParams.searchValue"
  9. placeholder="请输入名称"
  10. clearable
  11. maxLength="30"
  12. size="small"
  13. />
  14. </el-form-item>
  15. <el-form-item label="类型" prop="type" label-width="80px">
  16. <el-select v-model="queryParams.type" placeholder="请选择" clearable size="small">
  17. <el-option label="供应商资质" value="1"/>
  18. <el-option label="人员证照" value="2" />
  19. <el-option label="车辆证照" value="3" />
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item>
  23. <p class="inquire-button-one" @click="handleQuery">查询</p>
  24. <p class="reset-button-one" @click="resetQuery">重置</p>
  25. </el-form-item>
  26. <el-form-item label="" prop="title" style="float: right">
  27. <el-col :span="1.5" style="margin-left: 10px;">
  28. <p class="add-button-one-90"
  29. @click="handleClick('','','add')"
  30. v-hasPermi="['airbottle:qualification:certificate:add']"
  31. ><i class="el-icon-plus"></i>新增</p>
  32. </el-col>
  33. </el-form-item>
  34. </el-form>
  35. <el-table border v-loading="loading" :data="tableData">
  36. <el-table-column label="名称" align="left" prop="name"/>
  37. <el-table-column label="类型" align="left" prop="type">
  38. <template slot-scope="scope">
  39. <span v-if="scope.row.type==1">供应商资质</span>
  40. <span v-if="scope.row.type==2">人员证照</span>
  41. <span v-if="scope.row.type==3">车辆证照</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="是否必填" align="left" prop="required">
  45. <template slot-scope="scope">
  46. <span v-if="scope.row.required==1">是</span>
  47. <span v-if="scope.row.required==0">否</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="需选择有效期" align="left" prop="validity">
  51. <template slot-scope="scope">
  52. <span v-if="scope.row.validity==1">是</span>
  53. <span v-if="scope.row.validity==0">否</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="添加时间" align="left" prop="createTime"></el-table-column>
  57. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="260">
  58. <template slot-scope="scope">
  59. <div class="table-button-box">
  60. <p class="table-button-null"></p>
  61. <p class="table-button-p"
  62. @click="handleClick('',scope.row,'edit')"
  63. v-hasPermiAnd="['airbottle:qualification:certificate:edit']"
  64. >编辑</p>
  65. <p class="table-button-p"
  66. @click="handleClick('',scope.row,'delete')"
  67. v-hasPermi="['airbottle:qualification:certificate:remove']"
  68. >删除</p>
  69. <p class="table-button-null"></p>
  70. </div>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <pagination
  75. :total="total"
  76. layout="total, prev, pager, next, sizes, jumper"
  77. :page.sync="queryParams.pageNum"
  78. :limit.sync="queryParams.pageSize"
  79. @pagination="getList"
  80. />
  81. </div>
  82. <!--新增页面-->
  83. <add-page v-if="pageType==2" :pageData="pageData"></add-page>
  84. </div>
  85. </template>
  86. <script>
  87. import {
  88. certificationDelete,
  89. certificationList,
  90. gasCategoryList,
  91. specificationDelete,
  92. specificationList
  93. } from '@/api/gasManage3_0/gasManage'
  94. import { getToken } from "@/utils/auth";
  95. import addPage from "./certificationAdd.vue"
  96. export default {
  97. name: "Approval",
  98. components: {
  99. addPage
  100. },
  101. data() {
  102. return {
  103. //页面状态
  104. pageType:1,
  105. loading:false,
  106. headers: {
  107. Authorization: "Bearer " + getToken()
  108. },
  109. // 查询参数
  110. queryParams: {
  111. pageNum: 1,
  112. pageSize:20,
  113. searchValue:'',
  114. type:'',
  115. },
  116. total:0,
  117. tableData:[{}],
  118. dateRange:[],
  119. pageData:{},
  120. };
  121. },
  122. methods: {
  123. handleClick(index,row,doType){
  124. let _this=this;
  125. if(doType=='add'){//添加
  126. _this.pageData.status=0
  127. _this.pageType=2;
  128. }else if(doType=='edit'){//编辑
  129. _this.pageData.status=1
  130. _this.pageData.id=row.id
  131. _this.pageType=2;
  132. }else if(doType=='delete'){//删除
  133. this.$confirm('是否确认删除?', "警告", {
  134. confirmButtonText: "确定",
  135. cancelButtonText: "取消",
  136. type: "warning"
  137. }).then(function() {
  138. certificationDelete(row.id).then( response => {
  139. let res=response.rows;
  140. _this.getList();
  141. _this.msgSuccess("删除成功");
  142. });
  143. }).then(() => {
  144. }).catch(() => {});
  145. }else if(doType=='back'){//重新申请
  146. _this.pageType=1;
  147. }
  148. },
  149. /** 搜索按钮操作 */
  150. handleQuery() {
  151. this.queryParams.pageNum = 1;
  152. this.getList();
  153. },
  154. /** 重置按钮操作 */
  155. resetQuery() {
  156. this.queryParams.searchValue = "";
  157. this.queryParams.type = "";
  158. this.handleQuery();
  159. },
  160. getList(){
  161. let _this=this;
  162. if(this.dateRange&&this.dateRange.length>0) {
  163. this.queryParams.startTime=this.dateRange[0]
  164. this.queryParams.endTime=this.dateRange[1]
  165. } else {
  166. this.queryParams.startTime=null;
  167. this.queryParams.endTime=null
  168. }
  169. certificationList(_this.queryParams).then( response => {
  170. let res=response.rows;
  171. _this.tableData=res;
  172. _this.total=response.total
  173. });
  174. },
  175. },
  176. mounted() {
  177. this.getList()
  178. }
  179. };
  180. </script>
  181. <style scoped lang="scss">
  182. .approval_handle {
  183. display: flex!important;
  184. flex-direction: column;
  185. .approval_handle-page{
  186. flex:1;
  187. display: flex!important;
  188. flex-direction: column;
  189. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  190. padding:20px 20px 20px!important;
  191. border-radius:10px;
  192. .button-box{
  193. width:200px;
  194. display: flex;
  195. }
  196. }
  197. }
  198. </style>