Browse Source

YT-1974:SCP供应商模具费用导入变更

intex_online20250311
songguoqiang 1 month ago
parent
commit
9212d76132
  1. 14
      src/api/wms/suppliperMoldCostMain/index.ts
  2. 93
      src/components/ImportForm/src/ImportSupplierMoldCostForm.vue
  3. 40
      src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue
  4. 25
      src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/supplierMoldCostMain.data.ts

14
src/api/wms/suppliperMoldCostMain/index.ts

@ -26,8 +26,8 @@ export const importTemplate = () => {
return request.download({ url: '/wms/supplier-tool-apport-statement-main/get-import-template' })
}
// 导入客户对账单前校验是否有相同客户代码和年月的数据存在
export const verifyDataExist = async (yearsMonthStr: String,supplierCode:String) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/verifyDataExist?yearsMonthStr=` + yearsMonthStr+'&supplierCode='+supplierCode })
export const verifyDataExist = async (versionNumber: String,supplierCode:String) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/versionNumber?versionNumber=` + versionNumber+'&supplierCode='+supplierCode })
}
@ -46,4 +46,14 @@ export const nodeAbrogate = async (id: number) => {
// 退回
export const sendBack = async (id: number) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-main/sendBack?id=` + id })
}
// 关闭明细
export const close = async (id: number) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-detail/close?id=` + id })
}
// 重新打开明细
export const reOpen = async (id: number) => {
return await request.get({ url: `/wms/supplier-tool-apport-statement-detail/reOpen?id=` + id })
}

93
src/components/ImportForm/src/ImportSupplierMoldCostForm.vue

@ -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 () => {//

40
src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue

@ -57,8 +57,13 @@
}]"
:apiPage="SuppliperMoldCostDetailApi.getSupplierMoldCostDetailPage"
:detailButtonIsShowAdd="false"
:detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="false"
:buttondataTable="buttondataTable"
:otherHeadButttonData = "[]"
@buttonBaseClick="detailButtonBaseClick"
@tableFormButton="tableFormButton"
/>
<!-- 导入 -->
<ImportSupplierMoldCostForm
@ -126,7 +131,26 @@
defaultButtons.defaultSetBtn(null) //
]
// table
const buttondataTable =[{
label: '关闭',
name: 'close',
hide: false,
type: 'danger',
icon: '',
color: '',
hasPermi: '',
link: true, //
},{
label: '重新打开',
name: 'reOpen',
hide: false,
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
},]
//
const buttonBaseClick = (val, item) => {
if (val == 'import') {
@ -226,8 +250,18 @@ const buttonBaseClick = (val, item) => {
}
/** 详情操作 */
//
const tableFormButton = async (val , row) => {
if (val == 'close') { //
await SuppliperMoldCostMainApi.close(row.id)
detailRef.value.getList();
}else if(val=='reOpen'){
await SuppliperMoldCostMainApi.reOpen(row.id)
detailRef.value.getList();
}
}
/** 详情操作 */
const detailRef = ref()
const tableObjectExtend = ref([])
const openDetail = (row: any, titleName: any, titleValue: any) => {

25
src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/supplierMoldCostMain.data.ts

@ -29,12 +29,7 @@ export const SupplierMoldCostMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '版本号',
field: 'versionNumber',
sort: 'custom',
isTable: false
},
{
label: '供应商代码',
field: 'supplierCode',
@ -73,6 +68,12 @@ export const SupplierMoldCostMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '版本号',
field: 'versionNumber',
sort: 'custom',
isTable: true
},
{
label: '创建者',
field: 'creator',
@ -174,6 +175,7 @@ export const SupplierMoldCostDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '状态',
field: 'status',
sort: 'custom',
isDetail:false,
dictType: DICT_TYPE.SUPPLIER_TOOL_APPORT_STATEMENT_DETAIL,
dictClass: 'string',
form: {
@ -181,6 +183,17 @@ export const SupplierMoldCostDetail = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select',
},
},
{
label: '操作',
field: 'action',
isForm: false,
isTable:true,
isDetail:false,
table: {
width: 180,
fixed: 'right'
}
}
]))

Loading…
Cancel
Save