|
|
@ -22,15 +22,16 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="年月" prop="yearsMonthStr"> |
|
|
|
<el-date-picker |
|
|
|
v-model="queryParams.yearsMonthStr" |
|
|
|
<el-form-item label="版本号" prop="versionNumber"> |
|
|
|
<!-- <el-date-picker |
|
|
|
v-model="queryParams.versionNumber" |
|
|
|
type="month" |
|
|
|
placeholder="选择年月" |
|
|
|
format="YYYY-MM" |
|
|
|
value-format="YYYY-MM" |
|
|
|
style="width: 100%" |
|
|
|
/> |
|
|
|
/> --> |
|
|
|
<el-input-number v-model="queryParams.versionNumber" :min="1" label="版本号"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -40,8 +41,10 @@ |
|
|
|
v-model:file-list="fileList" |
|
|
|
:action=" |
|
|
|
importUrl + |
|
|
|
'?yearsMonthStr=' + |
|
|
|
queryParams.yearsMonthStr + |
|
|
|
'?mode=' + |
|
|
|
mode + |
|
|
|
'&versionNumber=' + |
|
|
|
queryParams.versionNumber + |
|
|
|
'&supplierCode=' + |
|
|
|
queryParams.supplierCode + |
|
|
|
'&file=' + |
|
|
@ -69,7 +72,7 @@ |
|
|
|
> |
|
|
|
<Icon icon="ep:upload-filled" color="#c0c4cc" :size="60" /> |
|
|
|
<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="flex" v-if="announcements&&announcements.length>0"> |
|
|
|
<div |
|
|
@ -92,20 +95,22 @@ |
|
|
|
<div class=""> |
|
|
|
<div class="radio"> |
|
|
|
<el-radio-group v-model="mode"> |
|
|
|
<el-radio :label="1" v-show="updateIsShow" :disabled="updateIsDisable">{{ t('ts.更新')}}</el-radio> |
|
|
|
<el-radio :label="2" v-show="appendIsShow" :disabled="appendIsDisable">{{ t('ts.追加') }}</el-radio> |
|
|
|
<el-radio :label="3" v-show="coverIsShow" :disabled="coverIsDisable">{{ t('ts.覆盖') }}</el-radio> |
|
|
|
<el-radio :label="1" v-show="appendIsShow" :disabled="appendIsDisable">{{ t('ts.追加') }}</el-radio> |
|
|
|
<el-radio :label="2" v-show="updateIsShow" :disabled="updateIsDisable">{{ t('ts.更新')}}</el-radio> |
|
|
|
|
|
|
|
<!-- <el-radio :label="3" v-show="coverIsShow" :disabled="coverIsDisable">{{ t('ts.覆盖') }}</el-radio> --> |
|
|
|
</el-radio-group> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="tips color-#acaeb3 font-size-14px"> |
|
|
|
<div class="mt-2">{{t('ts.更新:新增并修改')}}</div> |
|
|
|
<div class="mt-2">{{ t('ts.追加:只新增,不修改') }}</div> |
|
|
|
<div class="mt-2">{{ t('ts.覆盖:只修改不新增') }}</div> |
|
|
|
<div class="mt-2">{{ '追加:只做新增操作,默认所有数据都没有重复' }}</div> |
|
|
|
<div class="mt-2">{{'更新:新增并修改,有重复数据可做更新'}}</div> |
|
|
|
|
|
|
|
<!-- <div class="mt-2">{{ t('ts.覆盖:只修改不新增') }}</div> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex mt-16px"> |
|
|
|
<!-- <div class="flex mt-16px"> |
|
|
|
<div |
|
|
|
class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right" |
|
|
|
style="line-height: 32px" |
|
|
@ -120,7 +125,7 @@ |
|
|
|
<div class="mt-2">{{ t('ts.全部保存:全部数据正确,才能导入') }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
<div class="flex mt-16px" v-if="isShowOut"> |
|
|
|
<div |
|
|
|
class="label h-32px mr-26px color-#acaeb3 font-size-14px w-100px text-right" |
|
|
@ -134,7 +139,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> --> |
|
|
|
</template> |
|
|
|
</el-upload> |
|
|
|
<template #footer> |
|
|
|
<div class="flex items-center"> |
|
|
@ -289,8 +294,8 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
/** 校验数据 */ |
|
|
|
const verifyData = async () => { |
|
|
|
if (queryParams.yearsMonthStr==''||queryParams.yearsMonthStr==null) { |
|
|
|
message.error('请选择年月') |
|
|
|
if (queryParams.versionNumber==null) { |
|
|
|
message.error('请选择版本号') |
|
|
|
return |
|
|
|
} |
|
|
|
if (queryParams.supplierCode==''||queryParams.supplierCode==null) { |
|
|
@ -301,27 +306,29 @@ const verifyData = async () => { |
|
|
|
message.error('请上传文件') |
|
|
|
return |
|
|
|
} |
|
|
|
const data = await SuppliperMoldCostMainApi.verifyDataExist(queryParams.yearsMonthStr,queryParams.supplierCode); |
|
|
|
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 { |
|
|
|
//取消走的 |
|
|
|
} |
|
|
|
}else if(data.status==3){ |
|
|
|
await message.alertWarning('已存在相同供应商编号及年月的对账单,且已提交,无法导入。') |
|
|
|
} |
|
|
|
submitForm(); |
|
|
|
// const data = await SuppliperMoldCostMainApi.verifyDataExist(queryParams.versionNumber,queryParams.supplierCode); |
|
|
|
|
|
|
|
// console.log('data',data) |
|
|
|
// if(data.status==0){ |
|
|
|
|
|
|
|
// }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 { |
|
|
|
// //取消走的 |
|
|
|
// } |
|
|
|
// }else if(data.status==3){ |
|
|
|
// await message.alertWarning('已存在相同供应商编号及年月的对账单,且已提交,无法导入。') |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
/** 提交表单 */ |
|
|
@ -414,7 +421,7 @@ const submitFormError = (): void => { |
|
|
|
/** 重置表单 */ |
|
|
|
const resetForm = () => { |
|
|
|
queryParams.supplierCode = '' |
|
|
|
queryParams.yearsMonthStr = '' |
|
|
|
queryParams.versionNumber = 0 |
|
|
|
// 重置上传状态和文件 |
|
|
|
formLoading.value = false |
|
|
|
uploadRef.value?.clearFiles() |
|
|
@ -434,14 +441,14 @@ const importTemplate = () => { |
|
|
|
const customerList = ref(); |
|
|
|
const queryParams = reactive({ |
|
|
|
supplierCode: '', |
|
|
|
yearsMonthStr: '', |
|
|
|
versionNumber: 0, |
|
|
|
}) |
|
|
|
const rules = ref({ |
|
|
|
supplierCode: [ |
|
|
|
{ required: true, message: '请选择供应商代码', trigger: 'change' }, |
|
|
|
], |
|
|
|
yearsMonthStr: [ |
|
|
|
{ required: true, message: '请选择年月', trigger: 'change' }, |
|
|
|
versionNumber: [ |
|
|
|
{ required: true, message: '请选择版本号', trigger: 'change' }, |
|
|
|
], |
|
|
|
}) |
|
|
|
const getCustomerList = async () => {//获取客户列表 |
|
|
|