| | |
| | | <el-table :data="recordValue" border> |
| | | <el-table-column label="企业名(企业全称)" prop="companyName"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.companyName"></el-input> |
| | | <div class="flex-box-per"> |
| | | <el-input v-model="scope.row.companyName" @blur="checkImport(scope.row, scope.$index)"></el-input> |
| | | <el-tooltip v-if="scope.row.errorList.length && scope.row.errorList.find(item => item.index == 0)" :content="scope.row.errorList.find(item => item.index == 0).msg"> |
| | | <div class="ml5"> |
| | | <el-icon size="large" color="red" class="ml5"><CircleCloseFilled /></el-icon> |
| | | </div> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="统一社会信用代码" prop="companyCode"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.companyCode"></el-input> |
| | | <div class="flex-box-per"> |
| | | <el-input v-model="scope.row.companyCode" @blur="checkImport(scope.row, scope.$index)"></el-input> |
| | | <el-tooltip v-if="scope.row.errorList.length && scope.row.errorList.find(item => item.index == 1)" :content="scope.row.errorList.find(item => item.index == 1).msg"> |
| | | <div class="ml5"> |
| | | <el-icon size="large" color="red" class="ml5"><CircleCloseFilled /></el-icon> |
| | | </div> |
| | | </el-tooltip> |
| | | |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="企业联系人" prop="companyUser"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.companyUser"></el-input> |
| | | <div class="flex-box-per"> |
| | | <el-input v-model="scope.row.companyUser" @blur="checkImport(scope.row, scope.$index)"></el-input> |
| | | <el-tooltip v-if="scope.row.errorList.length && scope.row.errorList.find(item => item.index == 2)" :content="scope.row.errorList.find(item => item.index == 2).msg"> |
| | | <div class="ml5" v-if="scope.row.errorList.length &&scope.row.errorList.find(item => item.index == 2)"> |
| | | <el-icon size="large" color="red" class="ml5"><CircleCloseFilled /></el-icon> |
| | | </div> |
| | | </el-tooltip> |
| | | |
| | | </div> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="联系人电话" prop="companyPhone"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.companyPhone"></el-input> |
| | | <div class="flex-box-per"> |
| | | <el-input type="numer" :maxlength="11" v-model="scope.row.companyPhone" @blur="checkImport(scope.row, scope.$index, 'companyPhone')"></el-input> |
| | | <el-tooltip v-if="scope.row.errorList.length && scope.row.errorList.find(item => item.index == 3)" :content="scope.row.errorList.find(item => item.index == 3).msg"> |
| | | <div class="ml5"> |
| | | <el-icon size="large" color="red" class="ml5"><CircleCloseFilled /></el-icon> |
| | | </div> |
| | | </el-tooltip> |
| | | |
| | | </div> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="企业地址" prop="companyAddress"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.companyAddress"></el-input> |
| | | <div class="flex-box-per"> |
| | | <el-input v-model="scope.row.companyAddress" @blur="checkImport(scope.row, scope.$index)"></el-input> |
| | | <el-tooltip v-if="scope.row.errorList.length && scope.row.errorList.find(item => item.index == 4)" :content="scope.row.errorList.find(item => item.index == 4).msg"> |
| | | <div class="ml5" v-if="scope.row.errorList.length && scope.row.errorList.find(item => item.index == 4)"> |
| | | <el-icon size="large" color="red" class="ml5"><CircleCloseFilled /></el-icon> |
| | | </div> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" prop="mark"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.mark"></el-input> |
| | | <div class="flex-box-per"> |
| | | <el-input v-model="scope.row.mark" @blur="checkImport(scope.row, scope.$index)"></el-input> |
| | | <el-tooltip v-if="scope.row.errorList.length && scope.row.errorList.find(item => item.index == 5)" :content="scope.row.errorList.find(item => item.index == 5).msg"> |
| | | <div class="ml5"> |
| | | <el-icon size="large" color="red" class="ml5"><CircleCloseFilled /></el-icon> |
| | | </div> |
| | | </el-tooltip> |
| | | |
| | | </div> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { checkImport as checkImportHttp, saveImport } from '@/api/system/company/company' |
| | | import { ElMessage} from 'element-plus' |
| | | const dialogVisible = ref(false) |
| | | const emits = defineEmits() |
| | | const props = defineProps({ |
| | | recordRow: { type: Array, default: () => [] }, |
| | | }) |
| | |
| | | function closeDialog() { |
| | | dialogVisible.value = false |
| | | } |
| | | function checkImport(row, index, item) { |
| | | // row.companyPhone |
| | | if(item && item == 'companyPhone') { |
| | | if(row.companyPhone) { |
| | | const reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/ |
| | | if(!reg.test(row.companyPhone)){ |
| | | ElMessage.error('请输入正确的手机号') |
| | | } |
| | | } |
| | | } |
| | | checkImportHttp({voList: [row]}).then(val => { |
| | | // recordValue.value.splice(index, 1, val.data.voList[0]) |
| | | recordValue.value[index] = val.data.voList[0] |
| | | // ElMessage.success('修改成功') |
| | | }) |
| | | } |
| | | function addCompany() { |
| | | saveImport({voList: recordValue.value}).then(val =>{ |
| | | ElMessage.success('修改成功') |
| | | closeDialog() |
| | | emits('uploadList') |
| | | }) |
| | | } |
| | | defineExpose({ |
| | | openDialog, |
| | | closeDialog |
| | | }) |
| | | </script> |
| | | <style> |
| | | <style > |
| | | .dialog-footer{ |
| | | text-align: center; |
| | | } |
| | | .flex-box-per{ |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | } |
| | | .ml5{ |
| | | /* margin-left: 5px; */ |
| | | line-height: 15px; |
| | | } |
| | | </style> |