approval.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="企业名称" prop="companyName">
  5. <el-input
  6. v-model="queryParams.companyName"
  7. placeholder="请输入企业名称"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item label="证照类型" prop="licenseType">
  13. <el-select
  14. clearable
  15. v-model="queryParams.licenseType"
  16. style="width: 200px"
  17. >
  18. <el-option
  19. v-for="level in licenseTypeList"
  20. :key="level.value"
  21. :label="level.label"
  22. :value="level.value"
  23. >
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="证照名称" prop="licenseName">
  28. <el-input
  29. v-model="queryParams.licenseName"
  30. placeholder="请输入证照名称"
  31. clearable
  32. @keyup.enter.native="handleQuery"
  33. />
  34. </el-form-item>
  35. <el-form-item>
  36. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  37. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  38. </el-form-item>
  39. </el-form>
  40. <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
  41. <el-table-column type="selection" width="55" align="center" />
  42. <el-table-column label="企业属性" align="center" prop="companyAttributes">
  43. <template slot-scope="scope">
  44. {{ scope.row.companyAttributes == '1' ? '客户' : scope.row.companyAttributes == '0' ? '供应商' : '未知' }}
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="企业名称" align="center" prop="companyName" />
  48. <el-table-column label="证照类型" align="center" prop="licenseType" />
  49. <el-table-column label="证照编号" align="center" prop="licenseNumber" />
  50. <el-table-column label="证照名称" align="center" prop="licenseName" />
  51. <el-table-column label="颁发日期 " align="center" prop="licenseDate" />
  52. <el-table-column label="预警天数" align="center" prop="warningDays" />
  53. <el-table-column label="有效期至" align="center" prop="validUntil" />
  54. <el-table-column label="工单状态" align="center" prop="workState">
  55. <template slot-scope="scope">
  56. {{ scope.row.workState == '1' ? '草稿' : scope.row.workState == '2' ? '审批中' : scope.row.workState == '3' ? '已审批' : '待处理' }}
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  60. <template slot-scope="scope">
  61. <el-button
  62. size="mini"
  63. type="text"
  64. @click="handleUpdate(scope.row)"
  65. >编辑</el-button>
  66. <el-button
  67. size="mini"
  68. type="text"
  69. @click="handleInfo(scope.row)"
  70. >查看</el-button>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <pagination
  75. v-show="total>0"
  76. :total="total"
  77. :page.sync="queryParams.pageNum"
  78. :limit.sync="queryParams.pageSize"
  79. @pagination="getList"
  80. />
  81. </div>
  82. </template>
  83. <script>
  84. import { listInfo, getLicenseType } from "@/api/qualityControl/qualityControl.js";
  85. export default {
  86. name: "Info",
  87. data() {
  88. return {
  89. // 遮罩层
  90. loading: true,
  91. // 选中数组
  92. ids: [],
  93. // 非单个禁用
  94. single: true,
  95. // 非多个禁用
  96. multiple: true,
  97. // 显示搜索条件
  98. showSearch: true,
  99. // 总条数
  100. total: 0,
  101. // 合作企业证照表格数据
  102. infoList: [],
  103. // 弹出层标题
  104. title: "",
  105. // 是否显示弹出层
  106. open: false,
  107. // 查询参数
  108. queryParams: {
  109. pageNum: 1,
  110. pageSize: 10,
  111. status: 0,
  112. companyAttributes: null,
  113. companyName: null,
  114. licenseType: null,
  115. licenseNumber: null,
  116. licenseName: null,
  117. licenseDate: null,
  118. warningDays: null,
  119. validUntil: null,
  120. workState: null,
  121. },
  122. licenseTypeList : [{
  123. value: 'A',
  124. label: 'A'
  125. }, {
  126. value: 'B',
  127. label: 'B'
  128. }, {
  129. value: 'C',
  130. label: 'C'
  131. }],
  132. // 表单参数
  133. form: {},
  134. // 表单校验
  135. rules: {
  136. }
  137. };
  138. },
  139. created() {
  140. this.getList();
  141. getLicenseType().then(res=>{
  142. if(res.code == '200'){
  143. this.licenseTypeList = res.data
  144. }
  145. });
  146. },
  147. methods: {
  148. /** 查询合作企业证照列表 */
  149. getList() {
  150. this.loading = true;
  151. listInfo(this.queryParams).then(response => {
  152. this.infoList = response.rows;
  153. this.total = response.total;
  154. this.loading = false;
  155. });
  156. },
  157. // 取消按钮
  158. cancel() {
  159. this.open = false;
  160. this.reset();
  161. },
  162. // 表单重置
  163. reset() {
  164. this.form = {
  165. status: 0,
  166. companyAttributes: null,
  167. companyName: null,
  168. licenseType: null,
  169. licenseNumber: null,
  170. licenseName: null,
  171. licenseDate: null,
  172. warningDays: null,
  173. validUntil: null,
  174. workState: null
  175. };
  176. this.resetForm("form");
  177. },
  178. /** 搜索按钮操作 */
  179. handleQuery() {
  180. this.queryParams.pageNum = 1;
  181. this.getList();
  182. },
  183. /** 重置按钮操作 */
  184. resetQuery() {
  185. this.resetForm("queryForm");
  186. this.handleQuery();
  187. },
  188. // 多选框选中数据
  189. handleSelectionChange(selection) {
  190. this.ids = selection.map(item => item.id)
  191. this.single = selection.length!==1
  192. this.multiple = !selection.length
  193. },
  194. /** 修改按钮操作 */
  195. handleUpdate(row) {
  196. this.reset();
  197. if(row.companyAttributes == '1'){
  198. // 客户
  199. this.$router.push({ path: '/qualityControl/khDetail', query:{'companyCode': row.companyId, 'licenseNumber': row.id, 'isFlag': false} });
  200. }
  201. if(row.companyAttributes == '0'){
  202. // 供应商
  203. this.$router.push({ path: '/qualityControl/gysDetail', query:{'companyCode': row.companyId, 'licenseNumber': row.id, 'isFlag': false} });
  204. }
  205. if(row.companyAttributes == '3'){
  206. // 客户和供应商
  207. }
  208. },
  209. /** 查看按钮操作 */
  210. handleInfo(row) {
  211. this.reset();
  212. if(row.companyAttributes == '1'){
  213. // 客户
  214. this.$router.push({ path: '/qualityControl/khDetail', query:{'companyCode': row.companyId, 'licenseNumber': row.id, 'isFlag': true} });
  215. }
  216. if(row.companyAttributes == '0'){
  217. // 供应商
  218. this.$router.push({ path: '/qualityControl/gysDetail', query:{'companyCode': row.companyId, 'licenseNumber': row.id, 'isFlag': true} });
  219. }
  220. if(row.companyAttributes == '3'){
  221. // 客户和供应商
  222. }
  223. },
  224. }
  225. };
  226. </script>