|
@ -1,7 +1,14 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="[...PurchaseClaimRequestMain.allSchemas.searchSchema,...PurchaseClaimRequestDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="[ |
|
|
|
|
|
...PurchaseClaimRequestMain.allSchemas.searchSchema, |
|
|
|
|
|
...PurchaseClaimRequestDetail.allSchemas.searchSchema |
|
|
|
|
|
]" |
|
|
|
|
|
@search="setSearchParams" |
|
|
|
|
|
@reset="setSearchParams" |
|
|
|
|
|
/> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
|
<TableHead |
|
|
<TableHead |
|
@ -15,7 +22,8 @@ |
|
|
/> |
|
|
/> |
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<Table v-clientTable |
|
|
<Table |
|
|
|
|
|
v-clientTable |
|
|
:columns="tableColumns" |
|
|
:columns="tableColumns" |
|
|
:data="tableObject.tableList" |
|
|
:data="tableObject.tableList" |
|
|
:loading="tableObject.loading" |
|
|
:loading="tableObject.loading" |
|
@ -32,14 +40,17 @@ |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row, $index }"> |
|
|
<template #action="{ row, $index }"> |
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase |
|
|
|
|
|
:Butttondata="butttondata(row, $index)" |
|
|
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="formRef" |
|
|
ref="formRef" |
|
|
:isOpenSearchTable="true" |
|
|
:isOpenSearchTable="false" |
|
|
fieldTableColumn="itemCode" |
|
|
fieldTableColumn="itemCode" |
|
|
:rules="PurchaseClaimRequestMainRules" |
|
|
:rules="PurchaseClaimRequestMainRules" |
|
|
:formAllSchemas="PurchaseClaimRequestMain.allSchemas" |
|
|
:formAllSchemas="PurchaseClaimRequestMain.allSchemas" |
|
@ -69,16 +80,28 @@ |
|
|
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" |
|
|
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" |
|
|
/> |
|
|
/> |
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/deliver-plan-main/import" :importTemplateData="importTemplateData" |
|
|
<ImportForm |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend= "businessType"/> |
|
|
ref="importFormRef" |
|
|
|
|
|
url="/wms/deliver-plan-main/import" |
|
|
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
|
|
@success="importSuccess" |
|
|
|
|
|
:updateIsDisable="true" |
|
|
|
|
|
:coverIsDisable="true" |
|
|
|
|
|
:mode="2" |
|
|
|
|
|
:extend="businessType" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { PurchaseClaimRequestMain,PurchaseClaimRequestMainRules,PurchaseClaimRequestDetailRules,PurchaseClaimRequestDetail} from './PurchaseClaimRequestMain.data' |
|
|
import { |
|
|
|
|
|
PurchaseClaimRequestMain, |
|
|
|
|
|
PurchaseClaimRequestMainRules, |
|
|
|
|
|
PurchaseClaimRequestDetailRules, |
|
|
|
|
|
PurchaseClaimRequestDetail |
|
|
|
|
|
} from './PurchaseClaimRequestMain.data' |
|
|
import * as PurchaseClaimRequestMainApi from '@/api/wms/PurchaseClaimRequestMain' |
|
|
import * as PurchaseClaimRequestMainApi from '@/api/wms/PurchaseClaimRequestMain' |
|
|
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail' |
|
|
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail' |
|
|
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail' |
|
|
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
@ -91,9 +114,12 @@ const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const businessType = ref() |
|
|
const businessType = ref() |
|
|
const tableColumns = ref([...PurchaseClaimRequestMain.allSchemas.tableColumns,...PurchaseClaimRequestDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([ |
|
|
|
|
|
...PurchaseClaimRequestMain.allSchemas.tableColumns, |
|
|
|
|
|
...PurchaseClaimRequestDetail.allSchemas.tableMainColumns |
|
|
|
|
|
]) |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: PurchaseClaimRequestMainApi.getPurchaseClaimRequestMainPage // 分页接口 |
|
|
getListApi: PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage // 分页接口 |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
@ -105,6 +131,7 @@ const tableData = ref([]) |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(async () => { |
|
|
nextTick(async () => { |
|
@ -116,44 +143,37 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
message.warning(`物料${itemCodes.join(',')}已经存在`) |
|
|
message.warning(`物料${itemCodes.join(',')}已经存在`) |
|
|
} |
|
|
} |
|
|
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) |
|
|
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) |
|
|
if(val.length==0) return |
|
|
if(val.length==0){ |
|
|
val.forEach(item=>{ |
|
|
return |
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
} |
|
|
row[formField] = item[searchField] |
|
|
let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) |
|
|
newRow['uom'] = item['customerUom'] |
|
|
newVal.forEach(item=>{ |
|
|
newRow['id'] = item['id'] |
|
|
let tfk = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
.push(newRow) |
|
|
tfk['itemCode'] = item['itemCode'] |
|
|
|
|
|
tfk['itemName'] = item['itemName'] |
|
|
|
|
|
tfk['uom'] = item['supplierUom'] |
|
|
|
|
|
tableData.value.push(tfk) |
|
|
}) |
|
|
}) |
|
|
}else{ |
|
|
|
|
|
row[formField] = val[0][searchField] |
|
|
|
|
|
} |
|
|
} |
|
|
// if(formField == 'itemCode') { |
|
|
} |
|
|
// row['uom'] = val[0]['customerUom'] |
|
|
|
|
|
// } |
|
|
|
|
|
// 明细查询页赋值 |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
const setV = {} |
|
|
const setV = {} |
|
|
if(formField == 'customerStatementNumber') { |
|
|
if(formField === 'supplierCode'){ |
|
|
//客户对账单 |
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
setV['customer'] = val[0]['customerCode'] |
|
|
setV['supplierName'] = val[0]['name'] |
|
|
setV['customerName'] = val[0]['customerName'] |
|
|
tableData.value = [] |
|
|
CustomerStatementDetailApi.getCustomerStatementDetailPage({ |
|
|
|
|
|
pageNo:1, |
|
|
|
|
|
pageNSize: 100, |
|
|
|
|
|
masterId:val[0]['id'] |
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
console.log(55,res) |
|
|
|
|
|
tableData.value = res.list && res.list.length > 0 ?res.list : [] |
|
|
|
|
|
}) |
|
|
|
|
|
// tableData.value = [] |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
setV[formField] = val[0][searchField] |
|
|
|
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
} |
|
|
// else { |
|
|
|
|
|
// // 主表查询页赋值 |
|
|
|
|
|
// if (formField == 'supplierCode') { |
|
|
|
|
|
// setV['supplierName'] = val[0].name |
|
|
|
|
|
// } |
|
|
|
|
|
// setV[formField] = val[0][searchField] |
|
|
|
|
|
// formRef.setValues(setV) |
|
|
|
|
|
// } |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查询页面返回——详情 |
|
|
// 查询页面返回——详情 |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -170,12 +190,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:`wms:${routeName.value}:create` }), // 新增 |
|
|
defaultButtons.defaultAddBtn({ hasPermi: `wms:purchaseClaimRequest:create` }), // 新增 |
|
|
defaultButtons.defaultImportBtn({hasPermi:`wms:${routeName.value}:import` }), // 导入 |
|
|
defaultButtons.defaultImportBtn({ hasPermi: `wms:purchaseClaimRequest:import` }), // 导入 |
|
|
defaultButtons.defaultExportBtn({hasPermi:`wms:${routeName.value}:export` }), // 导出 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: `wms:purchaseClaimRequest:export` }), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
// { |
|
|
// { |
|
|
// label: '自定义扩展按钮', |
|
|
// label: '自定义扩展按钮', |
|
|
// name: 'zdy', |
|
|
// name: 'zdy', |
|
@ -187,13 +207,17 @@ const HeadButttondata = [ |
|
|
] |
|
|
] |
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { |
|
|
|
|
|
// 新增 |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { |
|
|
|
|
|
// 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
|
} else if (val == 'export') { // 导出 |
|
|
} else if (val == 'export') { |
|
|
|
|
|
// 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { |
|
|
|
|
|
// 刷新 |
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0) { |
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0) { |
|
|
searchFormClick({ |
|
|
searchFormClick({ |
|
|
filters: tableObject.params.filters |
|
|
filters: tableObject.params.filters |
|
@ -201,8 +225,10 @@ const buttonBaseClick = (val, item) => { |
|
|
} else { |
|
|
} else { |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
} |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} else { |
|
|
|
|
|
// 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -216,31 +242,67 @@ const isShowMainButton = (row,val) => { |
|
|
} |
|
|
} |
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = (row, $index) => { |
|
|
const butttondata = (row, $index) => { |
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
const findIndex = row['masterId'] |
|
|
|
|
|
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId']) |
|
|
|
|
|
: -1 |
|
|
if (findIndex > -1 && findIndex < $index) { |
|
|
if (findIndex > -1 && findIndex < $index) { |
|
|
return [] |
|
|
return [] |
|
|
} |
|
|
} |
|
|
return [ |
|
|
return [ |
|
|
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:`wms:${routeName.value}:open`}), // 打开 |
|
|
defaultButtons.mainListPlanSubBtn({ |
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:`wms:${routeName.value}:close`}), // 关闭 |
|
|
hide: isShowMainButton(row, ['0']), |
|
|
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:submit`}), // 提交审批 |
|
|
hasPermi: `wms:purchaseClaimRequest:sub` |
|
|
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:reject`}), // 驳回 |
|
|
}), // 提交审批 |
|
|
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:`wms:${routeName.value}:agree`}), // 审批通过 |
|
|
defaultButtons.mainListPlanTurBtn({ |
|
|
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:`wms:${routeName.value}:publish`}), // 发布 |
|
|
hide: isShowMainButton(row, ['3']), |
|
|
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:`wms:${routeName.value}:resetting`}), // 重置 |
|
|
hasPermi: `wms:purchaseClaimRequest:reject` |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:`wms:${routeName.value}:update`}), // 编辑 |
|
|
}), // 驳回 |
|
|
|
|
|
defaultButtons.mainListPlanAppBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['3']), |
|
|
|
|
|
hasPermi: `wms:purchaseClaimRequest:agree` |
|
|
|
|
|
}), // 审批通过 |
|
|
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['0']), |
|
|
|
|
|
hasPermi: `wms:purchaseClaimRequest:update` |
|
|
|
|
|
}) // 编辑 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'edit') { |
|
|
|
|
|
// 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { |
|
|
|
|
|
// 提交审批 |
|
|
|
|
|
handleSub(row.id) |
|
|
|
|
|
} |
|
|
|
|
|
else if (val == 'delete') { |
|
|
|
|
|
// 删除 |
|
|
handleDelete(row.masterId) |
|
|
handleDelete(row.masterId) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 提交审批按钮操作 */ |
|
|
|
|
|
const handleSub = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
// 关闭的二次确认 |
|
|
|
|
|
await message.confirm(t('ts.是否提交审批所选中数据?')) |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
// 发起关闭 |
|
|
|
|
|
await PurchaseClaimRequestMainApi.subPurchaseClaimRequestMain(id) |
|
|
|
|
|
message.success(t('ts.提交审批成功!')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm = async (type: string, row?: number) => { |
|
|
const openForm = async (type: string, row?: number) => { |
|
@ -275,7 +337,9 @@ const handleExport = async () => { |
|
|
// 发起导出 |
|
|
// 发起导出 |
|
|
loadStart() |
|
|
loadStart() |
|
|
const excelTitle = ref(route.meta.title) |
|
|
const excelTitle = ref(route.meta.title) |
|
|
const data = await PurchaseClaimRequestMainApi.exportPurchaseClaimRequestMain(tableObject.params) |
|
|
const data = await PurchaseClaimRequestMainApi.exportPurchaseClaimRequestMain( |
|
|
|
|
|
tableObject.params |
|
|
|
|
|
) |
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) |
|
|
} catch { |
|
|
} catch { |
|
|
} finally { |
|
|
} finally { |
|
@ -287,7 +351,7 @@ const handleExport = async () => { |
|
|
* tableForm方法 |
|
|
* tableForm方法 |
|
|
*/ |
|
|
*/ |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
PurchaseClaimRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
PurchaseClaimRequestDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -303,7 +367,7 @@ const handleDeleteTable = (item, index) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const tableSelectionDelete = (selection) => { |
|
|
const tableSelectionDelete = (selection) => { |
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
tableData.value = tableData.value.filter((item) => !selection.includes(item)) |
|
|
} |
|
|
} |
|
|
//为true表示子表数据中存在数量为0的数据 |
|
|
//为true表示子表数据中存在数量为0的数据 |
|
|
const flag = ref(false) |
|
|
const flag = ref(false) |
|
@ -315,44 +379,36 @@ const submitForm = async (formType, submitData) => { |
|
|
data.id = data.masterId |
|
|
data.id = data.masterId |
|
|
} |
|
|
} |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList.forEach(item=>{ |
|
|
data.subList.forEach((item) => { |
|
|
item.toWarehouseCode = data.toWarehouseCode |
|
|
item.toWarehouseCode = data.toWarehouseCode |
|
|
item.toLocationCode = data.toLocationCode |
|
|
item.toLocationCode = data.toLocationCode |
|
|
}) |
|
|
}) |
|
|
data.businessType = businessType.value |
|
|
data.businessType = businessType.value |
|
|
// 判断是否重复物料 |
|
|
// 判断是否重复物料 |
|
|
let isExist = false |
|
|
let isExist = false |
|
|
tableData.value.forEach(item => { |
|
|
tableData.value.forEach((item) => { |
|
|
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode)) |
|
|
let rs = tableData.value.filter((filterItem) => filterItem.itemCode == item.itemCode) |
|
|
if (rs.length > 1) isExist = true |
|
|
if (rs.length > 1) isExist = true |
|
|
}) |
|
|
}) |
|
|
if (isExist) { |
|
|
if (isExist) { |
|
|
formRef.value.formLoading = false |
|
|
formRef.value.formLoading = false |
|
|
return message.warning('物料代码重复') |
|
|
return message.warning('物料代码重复') |
|
|
} |
|
|
} |
|
|
data.subList.forEach(obj => { |
|
|
data.subList.forEach((obj) => { |
|
|
if(obj.qty == 0){ |
|
|
if (obj.claimQty == 0) { |
|
|
message.error(`数量不能为0!`) |
|
|
message.error(`索赔数量不能为0!`) |
|
|
flag.value = true |
|
|
flag.value = true |
|
|
return; |
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (obj.claimAmount == 0) { |
|
|
|
|
|
message.error(`索赔金额不能为0!`) |
|
|
|
|
|
flag.value = true |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (flag.value) { |
|
|
if (flag.value) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
var isHave =PurchaseClaimRequestMain.allSchemas.formSchema.some(function (item) { |
|
|
|
|
|
return item.field === 'beginTime' || item.field === 'endTime'; |
|
|
|
|
|
}); |
|
|
|
|
|
if(isHave){ |
|
|
|
|
|
if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){ |
|
|
|
|
|
message.error('结束时间要大于开始时间') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
console.log(data.beginTime) |
|
|
|
|
|
if(!data.beginTime)data.beginTime = null; |
|
|
|
|
|
if(!data.planDate)data.planDate = null; |
|
|
|
|
|
if(!data.endTime)data.endTime = null; |
|
|
|
|
|
formRef.value.formLoading = true |
|
|
formRef.value.formLoading = true |
|
|
try { |
|
|
try { |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|