| | |
| | | :headers="upload.headers" |
| | | :action="upload.url + '?updateSupport=' + upload.updateSupport" |
| | | :disabled="upload.isUploading" |
| | | :on-progress="handleFileUploadProgress" |
| | | :on-success="handleFileSuccess" |
| | | :before-upload="upload.beforeUpload" |
| | | :on-progress="upload.onProgress" |
| | | :on-success="upload.onSuccess" |
| | | :on-error="upload.onError" |
| | | :on-change="upload.onChange" |
| | | :auto-upload="false" |
| | | drag |
| | | > |
| | |
| | | <template #tip> |
| | | <div class="el-upload__tip text-center"> |
| | | <span>仅允许导入xls、xlsx格式文件。</span> |
| | | <el-link |
| | | type="primary" |
| | | :underline="false" |
| | | style="font-size: 12px; vertical-align: baseline" |
| | | @click="importTemplate" |
| | | >下载模板</el-link |
| | | > |
| | | <!-- <el-link--> |
| | | <!-- type="primary"--> |
| | | <!-- :underline="false"--> |
| | | <!-- style="font-size: 12px; vertical-align: baseline"--> |
| | | <!-- @click="importTemplate"--> |
| | | <!-- >下载模板</el-link--> |
| | | <!-- >--> |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | |
| | | { |
| | | label: "地址及联系方式", |
| | | prop: "addressPhone", |
| | | width: 220, |
| | | width: 250, |
| | | }, |
| | | { |
| | | label: "联系人", |
| | |
| | | { |
| | | label: "联系电话", |
| | | prop: "contactPhone", |
| | | width:150 |
| | | }, |
| | | { |
| | | label: "银行基本户", |
| | | prop: "basicBankAccount", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "银行账号", |
| | | prop: "bankAccount", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "开户行号", |
| | | prop: "bankCode", |
| | | width:220 |
| | | }, |
| | | { |
| | | label: "维护人", |
| | |
| | | { |
| | | label: "维护时间", |
| | | prop: "maintenanceTime", |
| | | width: 100, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | align: "center", |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | | name: "编辑", |
| | |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.maintainer !== userStore.nickName |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | const total = ref(0); |
| | |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // 上传的地址 |
| | | url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData", |
| | | // 文件上传前的回调 |
| | | beforeUpload: (file) => { |
| | | console.log('文件即将上传', file); |
| | | // 可以在此处做文件类型或大小校验 |
| | | const isValid = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.name.endsWith('.xlsx') || file.name.endsWith('.xls'); |
| | | if (!isValid) { |
| | | proxy.$modal.msgError("只能上传 Excel 文件"); |
| | | } |
| | | return isValid; |
| | | }, |
| | | // 文件状态改变时的回调 |
| | | onChange: (file, fileList) => { |
| | | console.log('文件状态改变', file, fileList); |
| | | }, |
| | | // 文件上传成功时的回调 |
| | | onSuccess: (response, file, fileList) => { |
| | | console.log('上传成功', response, file, fileList); |
| | | if(response.code === 200){ |
| | | proxy.$modal.msgSuccess("文件上传成功"); |
| | | }else if(response.code === 500){ |
| | | proxy.$modal.msgError(response.msg); |
| | | }else{ |
| | | proxy.$modal.msgWarning(response.msg); |
| | | } |
| | | }, |
| | | // 文件上传失败时的回调 |
| | | onError: (error, file, fileList) => { |
| | | console.error('上传失败', error, file, fileList); |
| | | proxy.$modal.msgError("文件上传失败"); |
| | | }, |
| | | // 文件上传进度回调 |
| | | onProgress: (event, file, fileList) => { |
| | | console.log('上传中...', event.percent); |
| | | } |
| | | }); |
| | | const { searchForm, form, rules } = toRefs(data); |
| | | const addNewContact = () => { |
| | |
| | | }; |
| | | // 提交修改 |
| | | const submitEdit = () => { |
| | | form.value.contactPerson = formYYs.value.contactList.map(item => item.contactPerson).join(","); |
| | | form.value.contactPhone = formYYs.value.contactList.map(item => item.contactPhone).join(","); |
| | | updateCustomer(form.value).then((res) => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeDia(); |
| | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | // 检查是否有他人维护的数据 |
| | | const unauthorizedData = selectedRows.value.filter(item => item.maintainer !== userStore.nickName); |
| | | if (unauthorizedData.length > 0) { |
| | | proxy.$modal.msgWarning("不可删除他人维护的数据"); |
| | | return; |
| | | } |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |