公司信息登记(去重)
							parent
							
								
									1e2807ad47
								
							
						
					
					
						commit
						fb7dd857ba
					
				| @ -0,0 +1,62 @@ | ||||
| import axios from "@/utils/request"; | ||||
| 
 | ||||
| export function filterList(query) { | ||||
|     return axios( | ||||
|         { | ||||
|             url: "/replicate/company/cert/filterList", | ||||
|             method: "get", | ||||
|             params: query | ||||
|         } | ||||
|     ); | ||||
| } | ||||
| 
 | ||||
| export function insertReplicate(query) { | ||||
|   return axios( | ||||
|     { | ||||
|       url: "/replicate/company/cert/insertReplicate", | ||||
|       method: "post", | ||||
|       data: query | ||||
|     } | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| export function deleteReplicate(query) { | ||||
|   return axios( | ||||
|     { | ||||
|       url: "/replicate/company/cert/deleteReplicate", | ||||
|       method: "get", | ||||
|       params: query | ||||
|     } | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| export function chceckCompany(query) { | ||||
|   return axios( | ||||
|     { | ||||
|       url: "/replicate/company/cert/chceckCompany", | ||||
|       method: "get", | ||||
|       params: query | ||||
|     } | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| export function chceckMobile(query) { | ||||
|   return axios( | ||||
|     { | ||||
|       url: "/replicate/company/cert/chceckMobile", | ||||
|       method: "get", | ||||
|       params: query | ||||
|     } | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| export function updateReplicate(query) { | ||||
|   return axios( | ||||
|     { | ||||
|       url: "/replicate/company/cert/updateReplicate", | ||||
|       method: "post", | ||||
|       data: query | ||||
|     } | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| @ -0,0 +1,376 @@ | ||||
| <template> | ||||
|   <div> | ||||
|         <el-form :model="Query" size="mini" label-width="125px"> | ||||
|           <el-card> | ||||
|           <el-row> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item class="query-form-item" label="公司名称:"> | ||||
|                 <el-input | ||||
|                   v-model="Query.company" | ||||
|                   clearable="true" | ||||
|                   size="mini" | ||||
|                   placeholder="请输入公司名称" | ||||
|                   @blur="inputCompany" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item class="query-form-item" label="联系人:"> | ||||
|                 <el-input | ||||
|                   v-model="Query.contacts" | ||||
|                   style="width: 100%" | ||||
|                   clearable="true" | ||||
|                   placeholder="请输入联系人" | ||||
|                 > | ||||
|                 </el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item class="query-form-item" label="电话1:"> | ||||
|                 <el-input | ||||
|                   v-model="Query.mobile1" | ||||
|                   clearable="true" | ||||
|                   size="mini" | ||||
|                   placeholder="请输入电话1" | ||||
|                   @blur="inputMobile(1)" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|           </el-row> | ||||
|           <el-row> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item label="电话2:" class="query-form-item"> | ||||
|                 <el-input | ||||
|                   v-model="Query.mobile2" | ||||
|                   clearable="true" | ||||
|                   size="mini" | ||||
|                   placeholder="请输入电话2" | ||||
|                   @blur="inputMobile(2)" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item label="电话3:" class="query-form-item"> | ||||
|                 <el-input | ||||
|                   v-model="Query.mobile3" | ||||
|                   clearable="true" | ||||
|                   size="mini" | ||||
|                   placeholder="请输入电话3" | ||||
|                   @blur="inputMobile(3)" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|             <el-col :span="8"> | ||||
|               <el-form-item label="备注:" class="query-form-item"> | ||||
|                 <el-input | ||||
|                   v-model="Query.remark" | ||||
|                   clearable="true" | ||||
|                   size="mini" | ||||
|                   placeholder="请输入备注" | ||||
|                 ></el-input> | ||||
|               </el-form-item> | ||||
|             </el-col> | ||||
|           </el-row> | ||||
|           <div class="top-right-btn" style="display:flex;"> | ||||
|             <el-button-group> | ||||
|               <el-button type="primary" icon="el-icon-refresh" @click="refresh">重置</el-button> | ||||
|               <el-button type="primary" icon="el-icon-plus" @click="submitInfo">新增/修改</el-button> | ||||
|             </el-button-group> | ||||
|           </div> | ||||
|           </el-card> | ||||
|         </el-form> | ||||
| 
 | ||||
|         <el-card> | ||||
|         <el-table | ||||
|           :data="list" | ||||
|           style="width: 100%" | ||||
|           @row-click="intentDetail" | ||||
|           v-loading="loading" | ||||
|           border | ||||
|           highlight-current-row="true" | ||||
|         > | ||||
| 
 | ||||
|           <el-table-column label="序号" type="index"></el-table-column> | ||||
|           <el-table-column | ||||
|             label="公司名称" | ||||
|             prop="company" | ||||
|             show-overflow-tooltip | ||||
|           ></el-table-column> | ||||
|           <el-table-column | ||||
|             label="联系人" | ||||
|             prop="contacts" | ||||
|             show-overflow-tooltip | ||||
|           ></el-table-column> | ||||
|           <el-table-column | ||||
|             label="电话1" | ||||
|             prop="mobile1" | ||||
|             show-overflow-tooltip | ||||
|           ></el-table-column> | ||||
|           <el-table-column | ||||
|             label="电话2" | ||||
|             prop="mobile2" | ||||
|             show-overflow-tooltip | ||||
|           ></el-table-column> | ||||
| 
 | ||||
|           <el-table-column | ||||
|             label="备注" | ||||
|             prop="remark" | ||||
|             show-overflow-tooltip | ||||
|           ></el-table-column> | ||||
| 
 | ||||
|           <el-table-column | ||||
|             label="创建时间" | ||||
|             prop="createTime" | ||||
|             show-overflow-tooltip | ||||
|           ></el-table-column> | ||||
| 
 | ||||
|           <el-table-column label="操作"> | ||||
|             <template slot-scope="scope"> | ||||
|               <el-button | ||||
|                 type="text" | ||||
|                 size="small" | ||||
|                 @click="diDetail(scope.row)" | ||||
|               >删除 | ||||
|               </el-button | ||||
|               > | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|         </el-table> | ||||
|         <pagination | ||||
|           v-show="total>0" | ||||
|           :total="total" | ||||
|           :page.sync="Query.page" | ||||
|           :limit.sync="Query.limit" | ||||
|           @pagination="intentSubSelect" | ||||
|         /> | ||||
|         </el-card> | ||||
| 
 | ||||
| 
 | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| import {filterList, | ||||
|   insertReplicate, | ||||
|   deleteReplicate, | ||||
|   chceckCompany, | ||||
|   chceckMobile, | ||||
|   updateReplicate | ||||
| 
 | ||||
| } from "@/api/replicate/replicates" | ||||
| import {isBlank} from "@/utils/strUtil"; | ||||
| 
 | ||||
| export default { | ||||
|   name: "replicates", | ||||
| 
 | ||||
|   data() { | ||||
|     return { | ||||
|       Query: { | ||||
|         page: 1, | ||||
|         limit: 20, | ||||
|         company:"", | ||||
|         contacts:"", | ||||
|         mobile1:"", | ||||
|         mobile2:"", | ||||
|         mobile3:"", | ||||
|         remark:"", | ||||
|         createTime:null, | ||||
|         status:null | ||||
|       }, | ||||
|       list:[], | ||||
|       loading:false, | ||||
|       total:0, | ||||
|       check:"", | ||||
|       checkMobile:false, | ||||
|       checkCompany:false, | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     }; | ||||
|   }, | ||||
|   methods: { | ||||
|     refresh(){ | ||||
|       this.$router.push({ | ||||
|         path: "" | ||||
|       }); | ||||
|       this.Query = { | ||||
|         page: 1, | ||||
|         limit: 20, | ||||
|         company:"", | ||||
|         contacts:"", | ||||
|         mobile1:"", | ||||
|         mobile2:"", | ||||
|         mobile3:"", | ||||
|         remark:"", | ||||
|         createTime:null, | ||||
|         status:null | ||||
|       } | ||||
|       this.getList(); | ||||
|     }, | ||||
| 
 | ||||
| 
 | ||||
|     getList(){ | ||||
|       this.loading = true | ||||
|       filterList(this.Query) | ||||
|         .then((res) => { | ||||
|           if(res.code = 20000){ | ||||
|               this.list = res.data.list || [] | ||||
|               this.total = res.data.total || 0 | ||||
|           }else{ | ||||
|             this.$message.error(res.message); | ||||
|           } | ||||
|           this.loading = false | ||||
|         }) | ||||
|         .catch(() =>{ | ||||
|           this.loading = false | ||||
|           this.list = [] | ||||
|           this.total = 0 | ||||
| 
 | ||||
|         }) | ||||
| 
 | ||||
|     }, | ||||
|     submitInfo(){ | ||||
|       if(this.checkMobile){ | ||||
|         this.$message.error("号码已存在,不能提交!") | ||||
|         return; | ||||
|       } | ||||
|       if(this.checkCompany){ | ||||
|         this.$message.error("公司已存在,不能提交!") | ||||
|         return; | ||||
|       } | ||||
|       if(isBlank(this.check)){ | ||||
|         insertReplicate(this.Query) | ||||
|           .then((res) => { | ||||
|             if(res.code == 20000){ | ||||
|               this.$message.success("添加成功!"); | ||||
|               this.Query = {}; | ||||
|               this.getList(); | ||||
|             } | ||||
|           }) | ||||
| 
 | ||||
|       }else{ | ||||
|         this.Query.id = this.check | ||||
|         updateReplicate(this.Query) | ||||
|           .then((res =>{ | ||||
|             if(res.code == 20000){ | ||||
|               this.$message.success("修改成功!"); | ||||
|               this.Query = {}; | ||||
|               this.getList(); | ||||
|             } | ||||
|           })) | ||||
| 
 | ||||
|       } | ||||
| 
 | ||||
|     }, | ||||
|     diDetail(row){ | ||||
|       this.$confirm('此操作将永远删除,是否继续','提示',{ | ||||
|         confirmButtonText: '确定', | ||||
|         cancelButtonText: '取消', | ||||
|         type: 'warning' | ||||
|       }).then(() =>{ | ||||
|         let param ={ | ||||
|           id: row.id | ||||
|         } | ||||
|         deleteReplicate(param) | ||||
|           .then((res) =>{ | ||||
|               if(res.code == 20000){ | ||||
|                 this.$message.success("删除成功!") | ||||
|                 this.Query={}; | ||||
|                 this.getList(); | ||||
|               }else{ | ||||
|                 this.$message.error(res.message) | ||||
|               } | ||||
|           }) | ||||
|       }) | ||||
|         .catch(()=>{ | ||||
|           this.$message("取消删除!") | ||||
|         }) | ||||
|     }, | ||||
|     intentDetail(val){ | ||||
|       this.check = val.id; | ||||
|       this.Query = val; | ||||
|     }, | ||||
|     inputCompany(){ | ||||
|       let param={ | ||||
|         company: this.Query.company | ||||
|       } | ||||
|       chceckCompany(param) | ||||
|         .then((res => { | ||||
|           if(res.code != 20000){ | ||||
|               this.$message.error(res.message); | ||||
|               this.checkCompany = true; | ||||
|           }else{ | ||||
|             this.checkCompany = false; | ||||
|           } | ||||
|         })) | ||||
|     }, | ||||
|     inputMobile(val){ | ||||
|       let param ={} | ||||
|       if(val == 1){ | ||||
|          param ={ | ||||
|           mobile:this.Query.mobile1 | ||||
|         } | ||||
|       }else if(val == 2){ | ||||
|          param ={ | ||||
|           mobile:this.Query.mobile2 | ||||
|         } | ||||
|       }else{ | ||||
|          param ={ | ||||
|           mobile:this.Query.mobile3 | ||||
|         } | ||||
|       } | ||||
| 
 | ||||
|       chceckMobile(param) | ||||
|         .then((res) => { | ||||
|           if(res.code != 20000){ | ||||
|             this.$message.error(res.message); | ||||
|             this.checkMobile = true; | ||||
|           }else{ | ||||
|             this.checkMobile = false; | ||||
|           } | ||||
|         }) | ||||
|     }, | ||||
| 
 | ||||
|     intentSubSelect(val){ | ||||
|       this.Query.page =val.page; | ||||
|       this.getList(); | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getList(); | ||||
| 
 | ||||
|   }, | ||||
|   components: { | ||||
| 
 | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| 
 | ||||
| <style scoped> | ||||
| .checkitemTag { | ||||
|   float: left; | ||||
|   text-align: left; | ||||
|   margin-top: 5px; | ||||
|   width: 100%; | ||||
| } | ||||
| 
 | ||||
| div /deep/ .el-table .warning-row { | ||||
|   background: #bebebe; | ||||
| } | ||||
| 
 | ||||
| div /deep/ .el-table .success-row { | ||||
|   background: #ffffff; | ||||
| } | ||||
| 
 | ||||
| .el-card { | ||||
|   margin-right: 20px; | ||||
|   /*transition: all .5s;*/ | ||||
| } | ||||
| 
 | ||||
| .query-form-item { | ||||
|   display: block !important; | ||||
|   margin-right: 10px; | ||||
|   margin-bottom: 5px; | ||||
| } | ||||
| 
 | ||||
| </style> | ||||
					Loading…
					
					
				
		Reference in New Issue