approved.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 == '2' ? '供应商' : scope.row.companyAttributes == '3' ? '客户和供应商' : '未知' }}
  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="handleInfo(scope.row)"
  65. >查看</el-button>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <pagination
  70. v-show="total>0"
  71. :total="total"
  72. :page.sync="queryParams.pageNum"
  73. :limit.sync="queryParams.pageSize"
  74. @pagination="getList"
  75. />
  76. </div>
  77. </template>
  78. <script>
  79. import { listInfo } from "@/api/qualityControl/qualityControl.js";
  80. export default {
  81. name: "Info",
  82. data() {
  83. return {
  84. // 遮罩层
  85. loading: true,
  86. // 选中数组
  87. ids: [],
  88. // 非单个禁用
  89. single: true,
  90. // 非多个禁用
  91. multiple: true,
  92. // 显示搜索条件
  93. showSearch: true,
  94. // 总条数
  95. total: 0,
  96. // 合作企业证照表格数据
  97. infoList: [],
  98. // 弹出层标题
  99. title: "",
  100. // 是否显示弹出层
  101. open: false,
  102. // 查询参数
  103. queryParams: {
  104. pageNum: 1,
  105. pageSize: 10,
  106. status: 1,
  107. companyAttributes: null,
  108. companyName: null,
  109. licenseType: null,
  110. licenseNumber: null,
  111. licenseName: null,
  112. licenseDate: null,
  113. warningDays: null,
  114. validUntil: null,
  115. workState: null,
  116. },
  117. licenseTypeList : [{
  118. value: 'A',
  119. label: 'A'
  120. }, {
  121. value: 'B',
  122. label: 'B'
  123. }, {
  124. value: 'C',
  125. label: 'C'
  126. }],
  127. // 表单参数
  128. form: {},
  129. // 表单校验
  130. rules: {
  131. }
  132. };
  133. },
  134. created() {
  135. this.getList();
  136. },
  137. methods: {
  138. /** 查询合作企业证照列表 */
  139. getList() {
  140. this.loading = true;
  141. listInfo(this.queryParams).then(response => {
  142. this.infoList = response.rows;
  143. this.total = response.total;
  144. this.loading = false;
  145. });
  146. },
  147. // 取消按钮
  148. cancel() {
  149. this.open = false;
  150. this.reset();
  151. },
  152. // 表单重置
  153. reset() {
  154. this.form = {
  155. status: 1,
  156. companyAttributes: null,
  157. companyName: null,
  158. licenseType: null,
  159. licenseNumber: null,
  160. licenseName: null,
  161. licenseDate: null,
  162. warningDays: null,
  163. validUntil: null,
  164. workState: null
  165. };
  166. this.resetForm("form");
  167. },
  168. /** 搜索按钮操作 */
  169. handleQuery() {
  170. this.queryParams.pageNum = 1;
  171. this.getList();
  172. },
  173. /** 重置按钮操作 */
  174. resetQuery() {
  175. this.resetForm("queryForm");
  176. this.handleQuery();
  177. },
  178. // 多选框选中数据
  179. handleSelectionChange(selection) {
  180. this.ids = selection.map(item => item.id)
  181. this.single = selection.length!==1
  182. this.multiple = !selection.length
  183. },
  184. /** 修改按钮操作 */
  185. handleUpdate(row) {
  186. this.reset();
  187. if(row.companyAttributes == '1'){
  188. // 客户
  189. this.$router.push({ path: '/qualityControl/khDetail', query:{'companyCode': row.companyId, 'licenseNumber': row.id, 'isFlag': false} });
  190. }
  191. if(row.companyAttributes == '2'){
  192. // 供应商
  193. this.$router.push({ path: '/qualityControl/gysDetail', query:{'companyCode': row.companyId, 'licenseNumber': row.id, 'isFlag': false} });
  194. }
  195. if(row.companyAttributes == '3'){
  196. // 客户和供应商
  197. }
  198. },
  199. /** 查看按钮操作 */
  200. handleInfo(row) {
  201. this.reset();
  202. if(row.companyAttributes == '1'){
  203. // 客户
  204. this.$router.push({ path: '/qualityControl/khDetail', query:{'companyCode': row.companyId, 'licenseNumber': row.id, 'isFlag': true} });
  205. }
  206. if(row.companyAttributes == '2'){
  207. // 供应商
  208. this.$router.push({ path: '/qualityControl/gysDetail', query:{'companyCode': row.companyId, 'licenseNumber': row.id, 'isFlag': true} });
  209. }
  210. if(row.companyAttributes == '3'){
  211. // 客户和供应商
  212. }
  213. },
  214. }
  215. };
  216. </script>