|
|
@ -1,7 +1,11 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="Q2.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search |
|
|
|
:schema="Q2.allSchemas.searchSchema" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
@ -33,7 +37,10 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="butttondata(row)" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -54,7 +61,12 @@ |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="Q2.allSchemas" /> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/basic/Q2/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
|
url="/basic/Q2/import" |
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -84,7 +96,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
|
const setV = {} |
|
|
|
if (formField == 'supplierCode') { |
|
|
|
setV['itemCode'] = ''; |
|
|
|
setV['itemCode'] = '' |
|
|
|
} |
|
|
|
if (formField == 'itemCode') { |
|
|
|
setV['uom'] = val[0]['supplierUom'] |
|
|
@ -99,7 +111,7 @@ if (formField == 'purchaseReceiptNumber') { |
|
|
|
if (formField == 'q1Number') { |
|
|
|
//Q1通知单号 |
|
|
|
let list = [] |
|
|
|
val.forEach(item=>{ |
|
|
|
val.forEach((item) => { |
|
|
|
list.push(item[searchField]) |
|
|
|
}) |
|
|
|
setV[formField] = list.join(',') |
|
|
@ -130,7 +142,7 @@ const HeadButttondata = [ |
|
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'qms:Q2:export' }), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
|
// { |
|
|
|
// label: '自定义扩展按钮', |
|
|
|
// name: 'zdy', |
|
|
@ -143,16 +155,22 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
if (val == 'add') { |
|
|
|
// 新增 |
|
|
|
openForm('create') |
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
} else if (val == 'import') { |
|
|
|
// 导入 |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
} else if (val == 'export') { |
|
|
|
// 导出 |
|
|
|
handleExport() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
} else if (val == 'refresh') { |
|
|
|
// 刷新 |
|
|
|
getList() |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else { // 其他按钮 |
|
|
|
} else if (val == 'filtrate') { |
|
|
|
// 筛选 |
|
|
|
} else { |
|
|
|
// 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
@ -168,19 +186,31 @@ const isShowMainButton = (row,val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:delete'}), // 删除 |
|
|
|
defaultButtons.mainListFinishBtn({hide:isShowMainButton(row,['0']),hasPermi:'qms:Q2:finish'}), // 完成 |
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
hide: isShowMainButton(row, ['0']), |
|
|
|
hasPermi: 'qms:Q2:update' |
|
|
|
}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({ |
|
|
|
hide: isShowMainButton(row, ['0']), |
|
|
|
hasPermi: 'qms:Q2:delete' |
|
|
|
}), // 删除 |
|
|
|
defaultButtons.mainListFinishBtn({ |
|
|
|
hide: isShowMainButton(row, ['0']), |
|
|
|
hasPermi: 'qms:Q2:finish' |
|
|
|
}) // 完成 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
}else if (val == 'finish') { // 删除 |
|
|
|
} else if (val == 'finish') { |
|
|
|
// 删除 |
|
|
|
handleFinish(row.id) |
|
|
|
} |
|
|
|
} |
|
|
@ -200,12 +230,12 @@ const openForm = (type: string, row?: any) => { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
if (type == 'create') { |
|
|
|
nextTick(() => { |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
handleTime: new Date().getTime(), |
|
|
|
claimTime: new Date().getTime(), |
|
|
|
priority: '3', |
|
|
|
}) |
|
|
|
}) |
|
|
|
priority: '3' |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -213,28 +243,31 @@ nextTick(() => { |
|
|
|
const formsSuccess = async (formType, data) => { |
|
|
|
data.responUser = userStore.getUser.id |
|
|
|
var isHave = Q2.allSchemas.formSchema.some(function (item) { |
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
|
}); |
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime' |
|
|
|
}) |
|
|
|
if (isHave) { |
|
|
|
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|
|
|
message.error('失效时间要大于生效时间') |
|
|
|
return; |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (data.qty > data.wmsQty) { |
|
|
|
message.error('数量不能大于记录中的收货数量') |
|
|
|
return; |
|
|
|
return |
|
|
|
} |
|
|
|
if (data.qty == 0) { |
|
|
|
message.error('数量不能为0') |
|
|
|
return; |
|
|
|
return |
|
|
|
} |
|
|
|
if (data.claimAmount == 0) { |
|
|
|
message.error('索赔金额不能为0') |
|
|
|
return; |
|
|
|
return |
|
|
|
} |
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
|
|
|
|
|
try { |
|
|
|
basicFormRef.value.formLoading = true |
|
|
|
if (formType === 'create') { |
|
|
|
await Q2Api.createQ2(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -243,7 +276,11 @@ message.error('数量不能大于记录中的收货数量') |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
|
basicFormRef.value.formLoading = false |
|
|
|
getList() |
|
|
|
} finally { |
|
|
|
basicFormRef.value.formLoading = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
@ -310,5 +347,4 @@ onMounted(async () => { |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await Q2Api.importTemplate() |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|