|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="[...SupplierinvoiceRequestMain.allSchemas.searchSchema,...SupplierinvoiceRequestDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search :schema="[...SupplierinvoiceRequestMain.allSchemas.searchSchema,...SupplierinvoiceRequestDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" /> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
@ -18,15 +18,22 @@ |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table v-clientTable :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ |
|
|
|
<Table ref="tableRef" |
|
|
|
:selection="true" |
|
|
|
v-clientTable :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ |
|
|
|
total: tableObject.total |
|
|
|
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort"> |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
@getSelectionRows="getSelectionRows" |
|
|
|
> |
|
|
|
<template #number="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
|
<span>{{ row.number }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #differencePrice="{row}"> |
|
|
|
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span> |
|
|
|
</template> |
|
|
|
<template #action="{ row,$index }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
@ -146,7 +153,11 @@ |
|
|
|
:detailButtonIsShowAdd="false" |
|
|
|
@buttonBaseClick="detailButtonBaseClick" |
|
|
|
@tableFormButton="tableFormButton" |
|
|
|
/> |
|
|
|
> |
|
|
|
<template #differencePrice="{row}"> |
|
|
|
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span> |
|
|
|
</template> |
|
|
|
</Detail> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm |
|
|
@ -174,6 +185,7 @@ |
|
|
|
import * as SupplierApi from '@/api/wms/supplier' |
|
|
|
import { Supplier } from '../../../basicDataManage/supplierManage/supplier/supplier.data' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import { ElMessageBox } from 'element-plus' |
|
|
|
|
|
|
|
defineOptions({ name: 'SupplierinvoiceRequestMain' }) |
|
|
|
|
|
|
@ -199,6 +211,25 @@ |
|
|
|
searchTablePage: SupplierApi.getSupplierPage |
|
|
|
} |
|
|
|
]) |
|
|
|
|
|
|
|
const searchList = (model)=>{ |
|
|
|
selectionRows.value = [] |
|
|
|
setSearchParams(model) |
|
|
|
} |
|
|
|
const selectionRows = ref<any>([]) |
|
|
|
const tableRef = ref() |
|
|
|
const getSelectionRows = (currentPage,currentPageSelectionRows) => { |
|
|
|
console.log("getSelectionRows",currentPage,currentPageSelectionRows) |
|
|
|
const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage) |
|
|
|
if(currentRows){ |
|
|
|
currentRows.selectionRows = currentPageSelectionRows |
|
|
|
}else{ |
|
|
|
selectionRows.value.push({ |
|
|
|
currentPage, |
|
|
|
selectionRows:currentPageSelectionRows |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, searchFormRef, type, row) => { |
|
|
@ -386,13 +417,15 @@ const handleImport = () => { |
|
|
|
} else if (val == 'purchase_mainPlanSub') { // 采购审批通过 |
|
|
|
handleApp(row.masterId) |
|
|
|
} else if (val == 'purchase_mainPlanTur') { // 采购驳回按钮 |
|
|
|
handleTur(row.masterId) |
|
|
|
resonSubmit(val, row) |
|
|
|
// handleTur(row.masterId) |
|
|
|
} else if (val == 'invoice_sent_out') { // 发票寄出确认 |
|
|
|
handleInvoiceSentOut(row.masterId) |
|
|
|
} else if(val == 'finance_mainPlanSub'){ // 财务审批通过 |
|
|
|
handleFinanceApp(row.masterId) |
|
|
|
} else if(val == 'finance_mainPlanTur'){ //财务审批拒绝 |
|
|
|
handleFinaceTur(row.masterId) |
|
|
|
resonSubmit(val, row) |
|
|
|
// handleFinaceTur(row.masterId) |
|
|
|
} else if (val == 'genRecords') { // 处理 |
|
|
|
genRecords(row.masterId) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
@ -559,13 +592,16 @@ const handleImport = () => { |
|
|
|
} |
|
|
|
|
|
|
|
/** 驳回按钮操作 */ |
|
|
|
const handleTur = async (id : number) => { |
|
|
|
const handleTur = async (id : number,cause:string) => { |
|
|
|
try { |
|
|
|
// 驳回的二次确认 |
|
|
|
await message.confirm(t('ts.是否驳回所选中数据?')) |
|
|
|
// await message.confirm(t('ts.是否驳回所选中数据?')) |
|
|
|
tableObject.loading = true |
|
|
|
// 发起驳回 |
|
|
|
await SupplierinvoiceRequestMainApi.rejSupplierinvoiceRequestMain(id) |
|
|
|
await SupplierinvoiceRequestMainApi.rejSupplierinvoiceRequestMain({ |
|
|
|
id, |
|
|
|
cause |
|
|
|
}) |
|
|
|
message.success(t('ts.驳回成功!')) |
|
|
|
tableObject.loading = false |
|
|
|
// 刷新列表 |
|
|
@ -592,14 +628,44 @@ const handleImport = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const resonSubmit = async (val, row)=>{ |
|
|
|
|
|
|
|
ElMessageBox.prompt(t('ts.请输入驳回原因'), t('ts.提示'), { |
|
|
|
confirmButtonText: t('common.ok'), |
|
|
|
cancelButtonText: t('common.cancel'), |
|
|
|
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格 |
|
|
|
inputErrorMessage: t(`ts.${'驳回原因不能为空,且不超过60字'}`), |
|
|
|
inputType:'textarea', |
|
|
|
inputValidator:(value)=>{ |
|
|
|
if(value.length>60||value.length==0){ |
|
|
|
return false |
|
|
|
}else{ |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
}).then(({ value }) => { |
|
|
|
// 驳回原因 |
|
|
|
if (val == 'purchase_mainPlanTur') { // 采购驳回按钮 |
|
|
|
handleTur(row.masterId,value) |
|
|
|
}else if(val == 'finance_mainPlanTur'){ //财务审批拒绝 |
|
|
|
handleFinaceTur(row.masterId,value) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** 驳回按钮操作 */ |
|
|
|
const handleFinaceTur = async (id : number) => { |
|
|
|
const handleFinaceTur = async (id : number,cause:string) => { |
|
|
|
try { |
|
|
|
// 驳回的二次确认 |
|
|
|
await message.confirm(t('ts.是否驳回所选中数据?')) |
|
|
|
// await message.confirm(t('ts.是否驳回所选中数据?')) |
|
|
|
tableObject.loading = true |
|
|
|
// 发起驳回 |
|
|
|
await SupplierinvoiceRequestMainApi.financerejSupplierinvoiceRequestMain(id) |
|
|
|
await SupplierinvoiceRequestMainApi.financerejSupplierinvoiceRequestMain({ |
|
|
|
id, |
|
|
|
cause |
|
|
|
}) |
|
|
|
message.success(t('ts.驳回成功!')) |
|
|
|
tableObject.loading = false |
|
|
|
// 刷新列表 |
|
|
@ -629,12 +695,28 @@ const handleImport = () => { |
|
|
|
/** 导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
const handleExport = async () => { |
|
|
|
let rows:any = [] |
|
|
|
selectionRows.value.forEach(item=>{ |
|
|
|
rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
|
}) |
|
|
|
|
|
|
|
let paramsData =JSON.parse(JSON.stringify(tableObject.params)) |
|
|
|
if(tableObject.params&&tableObject.params.isSearch==true){ |
|
|
|
paramsData.filters.push({ |
|
|
|
action: "in", |
|
|
|
column: "number", |
|
|
|
value: rows.join(",") |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
paramsData = {...paramsData,checkNums:rows} |
|
|
|
} |
|
|
|
console.log('批量导出',paramsData) |
|
|
|
try { |
|
|
|
// 导出的二次确认 |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await SupplierinvoiceRequestMainApi.exportSupplierinvoiceRequestMain(tableObject.params) |
|
|
|
const data = await SupplierinvoiceRequestMainApi.exportSupplierinvoiceRequestMain(paramsData) |
|
|
|
download.excel(data, `${t('ts.供应商发票申请主')}.xlsx`) |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
@ -802,6 +884,9 @@ const importSuccess = () => { |
|
|
|
border-radius:var(--el-border-radius-base); |
|
|
|
border:1px solid var(--el-color-danger); |
|
|
|
box-shadow: 0 0 0 1px var(--el-color-danger) inset; |
|
|
|
|
|
|
|
} |
|
|
|
.red-text{ |
|
|
|
color:var(--el-color-danger); |
|
|
|
font-weight:700; |
|
|
|
} |
|
|
|
</style> |
|
|
|