|
@ -64,7 +64,7 @@ |
|
|
> |
|
|
> |
|
|
<Icon icon="ep:upload-filled" color="#c0c4cc" :size="60" /> |
|
|
<Icon icon="ep:upload-filled" color="#c0c4cc" :size="60" /> |
|
|
<div class="el-upload__text">{{t('ts.将文件拖到此处,或')}}<em>{{t('ts.点击上传')}}</em></div> |
|
|
<div class="el-upload__text">{{t('ts.将文件拖到此处,或')}}<em>{{t('ts.点击上传')}}</em></div> |
|
|
<template #tip> |
|
|
<!-- <template #tip> |
|
|
<div class="el-upload__tip ml--126px mr--80px"> |
|
|
<div class="el-upload__tip ml--126px mr--80px"> |
|
|
<div class="flex" v-if="announcements&&announcements.length>0"> |
|
|
<div class="flex" v-if="announcements&&announcements.length>0"> |
|
|
<div |
|
|
<div |
|
@ -129,7 +129,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> --> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<div class="flex items-center"> |
|
|
<div class="flex items-center"> |
|
@ -139,7 +139,7 @@ |
|
|
{{ t('ts.下载模板') }} |
|
|
{{ t('ts.下载模板') }} |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">{{ t('ts.确 定') }}</el-button> |
|
|
<el-button :disabled="formLoading" type="primary" @click="verifyData">{{ t('ts.确 定') }}</el-button> |
|
|
<el-button @click="dialogVisible = false">{{ t('ts.取 消') }}</el-button> |
|
|
<el-button @click="dialogVisible = false">{{ t('ts.取 消') }}</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
@ -150,6 +150,7 @@ import { getAccessToken, getTenantId } from '@/utils/auth' |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { getBaseUrl } from '@/utils/systemParam' |
|
|
import { getBaseUrl } from '@/utils/systemParam' |
|
|
import * as CustomerApi from '@/api/wms/customer' |
|
|
import * as CustomerApi from '@/api/wms/customer' |
|
|
|
|
|
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'ImportForm' }) |
|
|
defineOptions({ name: 'ImportForm' }) |
|
|
const { t } = useI18n() |
|
|
const { t } = useI18n() |
|
@ -283,6 +284,44 @@ const open = () => { |
|
|
} |
|
|
} |
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
|
|
|
/** 校验数据 */ |
|
|
|
|
|
const verifyData = async () => { |
|
|
|
|
|
if (queryParams.yearsMonthStr==''||queryParams.yearsMonthStr==null) { |
|
|
|
|
|
message.error('请选择年月') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (queryParams.customerCode==''||queryParams.customerCode==null) { |
|
|
|
|
|
message.error('请选择客户代码') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (fileList.value.length == 0) { |
|
|
|
|
|
message.error('请上传文件') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const data = await CustomerStatementMainApi.verifyDataExist(queryParams.yearsMonthStr,queryParams.customerCode); |
|
|
|
|
|
console.log('data',data) |
|
|
|
|
|
if(data.status==0){ |
|
|
|
|
|
submitForm(); |
|
|
|
|
|
}else if(data.status==2){ |
|
|
|
|
|
try { |
|
|
|
|
|
// 确认 |
|
|
|
|
|
await message.confirm('已存在相同客户编号及年月的对账单,是否确认导入?注意:如确认则上一版本对账单将自动作废。') |
|
|
|
|
|
//确定走的 |
|
|
|
|
|
submitForm(); |
|
|
|
|
|
// await PurchasepriceApi.deletePurchaseprice(id) |
|
|
|
|
|
// tableObject.loading = false |
|
|
|
|
|
// message.success(t('common.delSuccess')) |
|
|
|
|
|
// // 刷新列表 |
|
|
|
|
|
// buttonBaseClick('refresh',null) |
|
|
|
|
|
} catch { |
|
|
|
|
|
//取消走的 |
|
|
|
|
|
alert(123); |
|
|
|
|
|
} |
|
|
|
|
|
}else if(data.status==3){ |
|
|
|
|
|
await message.alertWarning('已存在相同客户编号及年月的对账单,且已提交,无法导入。') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 提交表单 */ |
|
|
/** 提交表单 */ |
|
|
const submitForm = async () => { |
|
|
const submitForm = async () => { |
|
|
if (fileList.value.length == 0) { |
|
|
if (fileList.value.length == 0) { |
|
@ -399,6 +438,7 @@ const getCustomerList = async () => {//获取客户列表 |
|
|
const list = await CustomerApi.getCustomerList(param); |
|
|
const list = await CustomerApi.getCustomerList(param); |
|
|
customerList.value = list; |
|
|
customerList.value = list; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|