Browse Source

供应商发票申请

master_hella_20240701
yufei0306 9 months ago
parent
commit
a624b37159
  1. 4
      src/api/wms/supplierinvoiceRecordMain/index.ts
  2. 16
      src/api/wms/supplierinvoiceRequestMain/index.ts
  3. 8
      src/components/Detail/src/Detail.vue
  4. 52
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/index.vue
  5. 113
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  6. 36
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

4
src/api/wms/supplierinvoiceRecordMain/index.ts

@ -53,8 +53,8 @@ export const deleteSupplierinvoiceRecordMain = async (id: number) => {
} }
// 导出供应商发票记录主 Excel // 导出供应商发票记录主 Excel
export const exportSupplierinvoiceRecordMain = async (params) => { export const exportSupplierinvoiceRecordMain = async (data) => {
return await request.download({ url: `/wms/supplierinvoice-record-main/export-excel`, params }) return await request.downloadPost({ url: `/wms/supplierinvoice-record-main/export-excel`, data })
} }
// 下载用户导入模板 // 下载用户导入模板

16
src/api/wms/supplierinvoiceRequestMain/index.ts

@ -79,8 +79,8 @@ export const appSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/app?id=` + id }) return await request.post({ url: `/wms/supplierinvoice-request-main/app?id=` + id })
} }
// 采购--驳回供应商发货申请主 // 采购--驳回供应商发货申请主
export const rejSupplierinvoiceRequestMain = async (id: number) => { export const rejSupplierinvoiceRequestMain = async (data) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/rej?id=` + id }) return await request.post({ url: `/wms/supplierinvoice-request-main/rej`,data })
} }
// 供应商--发票寄出 // 供应商--发票寄出
@ -93,8 +93,8 @@ export const financeappSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/financeApp?id=` + id }) return await request.post({ url: `/wms/supplierinvoice-request-main/financeApp?id=` + id })
} }
// 财务--驳回供应商发货申请主 // 财务--驳回供应商发货申请主
export const financerejSupplierinvoiceRequestMain = async (id: number) => { export const financerejSupplierinvoiceRequestMain = async (data) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/financeRej?id=` + id }) return await request.post({ url: `/wms/supplierinvoice-request-main/financeRej`, data })
} }
// 作废--供应商发货申请主 // 作废--供应商发货申请主
@ -118,11 +118,11 @@ export const printSupplierRecordByMasterId = async (masterId:number) => {
} }
// 导出供应商发票申请主 Excel // 导出供应商发票申请主 Excel
export const exportSupplierinvoiceRequestMain = async (params) => { export const exportSupplierinvoiceRequestMain = async (data) => {
if(params.isSearch){ if(data.isSearch){
return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel-senior`, params }) return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel-senior`, data })
}else { }else {
return await request.download({ url: `/wms/supplierinvoice-request-main/export-excel`, params }) return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel`, data })
} }
} }

8
src/components/Detail/src/Detail.vue

@ -72,8 +72,12 @@
v-model:currentPage="tableObjectRef.currentPage" v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort" v-model:sort="tableObjectRef.sort"
> >
<template #photos="{ row }"> <template #photos="{ row }">
<div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div> </template> <div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div>
</template>
<template #differencePrice="{row}">
<slot name="differencePrice" :row="row"></slot>
</template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase <ButtonBase
:Butttondata="buttondata" :Butttondata="buttondata"

52
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...SupplierinvoiceRecordMain.allSchemas.searchSchema,...SupplierinvoiceRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="[...SupplierinvoiceRecordMain.allSchemas.searchSchema,...SupplierinvoiceRecordDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -17,7 +17,9 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table ref="tableRef"
:selection="true"
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -27,12 +29,16 @@
v-model:pageSize="tableObject.pageSize" v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
@getSelectionRows="getSelectionRows"
> >
<template #number="{row}"> <template #number="{row}">
<el-button type="primary" link @click="openDetail(row, t('ts.单据号'), row.number)"> <el-button type="primary" link @click="openDetail(row, t('ts.单据号'), row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #differencePrice="{row}">
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span>
</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>
@ -94,7 +100,11 @@
:detailAllSchemas="SupplierinvoiceRecordDetail.allSchemas" :detailAllSchemas="SupplierinvoiceRecordDetail.allSchemas"
:detailAllSchemasRules="SupplierinvoiceRecordDetailRules" :detailAllSchemasRules="SupplierinvoiceRecordDetailRules"
:apiPage="SupplierinvoiceRecordDetailApi.getSupplierinvoiceRecordDeatilPage" :apiPage="SupplierinvoiceRecordDetailApi.getSupplierinvoiceRecordDeatilPage"
/> >
<template #differencePrice="{row}">
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span>
</template>
</Detail>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -195,16 +205,37 @@ const openDetail = async (row: any, titleName: any, titleValue: any) => {
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue) detailRef.value.openDetail(row, titleName, titleValue)
} }
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 exportLoading = ref(false) // const exportLoading = ref(false) //
const handleExport = async () => { const handleExport = async () => {
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
})
try { try {
// //
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await SupplierinvoiceRecordMainApi.exportSupplierinvoiceRecordMain(tableObject.params) const data = await SupplierinvoiceRecordMainApi.exportSupplierinvoiceRecordMain({...tableObject.params,checkNums:rows})
download.excel(data, `${t('ts.供应商发票记录主')}.xlsx`) download.excel(data, `${t('ts.供应商发票记录主')}.xlsx`)
} catch { } catch {
} finally { } finally {
@ -226,3 +257,14 @@ onMounted(async () => {
getList() getList()
}) })
</script> </script>
<style lang="scss" scoped>
.is-red{
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>

113
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <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> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -18,15 +18,22 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <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 total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" }" 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}"> <template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #differencePrice="{row}">
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span>
</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>
@ -146,7 +153,11 @@
:detailButtonIsShowAdd="false" :detailButtonIsShowAdd="false"
@buttonBaseClick="detailButtonBaseClick" @buttonBaseClick="detailButtonBaseClick"
@tableFormButton="tableFormButton" @tableFormButton="tableFormButton"
/> >
<template #differencePrice="{row}">
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span>
</template>
</Detail>
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
@ -174,6 +185,7 @@
import * as SupplierApi from '@/api/wms/supplier' import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '../../../basicDataManage/supplierManage/supplier/supplier.data' import { Supplier } from '../../../basicDataManage/supplierManage/supplier/supplier.data'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { ElMessageBox } from 'element-plus'
defineOptions({ name: 'SupplierinvoiceRequestMain' }) defineOptions({ name: 'SupplierinvoiceRequestMain' })
@ -199,6 +211,25 @@
searchTablePage: SupplierApi.getSupplierPage 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) => { const searchTableSuccess = (formField, searchField, val, searchFormRef, type, row) => {
@ -386,13 +417,15 @@ const handleImport = () => {
} else if (val == 'purchase_mainPlanSub') { // } else if (val == 'purchase_mainPlanSub') { //
handleApp(row.masterId) handleApp(row.masterId)
} else if (val == 'purchase_mainPlanTur') { // } else if (val == 'purchase_mainPlanTur') { //
handleTur(row.masterId) resonSubmit(val, row)
// handleTur(row.masterId)
} else if (val == 'invoice_sent_out') { // } else if (val == 'invoice_sent_out') { //
handleInvoiceSentOut(row.masterId) handleInvoiceSentOut(row.masterId)
} else if(val == 'finance_mainPlanSub'){ // } else if(val == 'finance_mainPlanSub'){ //
handleFinanceApp(row.masterId) handleFinanceApp(row.masterId)
} else if(val == 'finance_mainPlanTur'){ // } else if(val == 'finance_mainPlanTur'){ //
handleFinaceTur(row.masterId) resonSubmit(val, row)
// handleFinaceTur(row.masterId)
} else if (val == 'genRecords') { // } else if (val == 'genRecords') { //
genRecords(row.masterId) genRecords(row.masterId)
} else if (val == 'edit') { // } else if (val == 'edit') { //
@ -559,13 +592,16 @@ const handleImport = () => {
} }
/** 驳回按钮操作 */ /** 驳回按钮操作 */
const handleTur = async (id : number) => { const handleTur = async (id : number,cause:string) => {
try { try {
// //
await message.confirm(t('ts.是否驳回所选中数据?')) // await message.confirm(t('ts.'))
tableObject.loading = true tableObject.loading = true
// //
await SupplierinvoiceRequestMainApi.rejSupplierinvoiceRequestMain(id) await SupplierinvoiceRequestMainApi.rejSupplierinvoiceRequestMain({
id,
cause
})
message.success(t('ts.驳回成功!')) message.success(t('ts.驳回成功!'))
tableObject.loading = false 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 { try {
// //
await message.confirm(t('ts.是否驳回所选中数据?')) // await message.confirm(t('ts.'))
tableObject.loading = true tableObject.loading = true
// //
await SupplierinvoiceRequestMainApi.financerejSupplierinvoiceRequestMain(id) await SupplierinvoiceRequestMainApi.financerejSupplierinvoiceRequestMain({
id,
cause
})
message.success(t('ts.驳回成功!')) message.success(t('ts.驳回成功!'))
tableObject.loading = false tableObject.loading = false
// //
@ -629,12 +695,28 @@ const handleImport = () => {
/** 导出按钮操作 */ /** 导出按钮操作 */
const exportLoading = ref(false) // const exportLoading = ref(false) //
const handleExport = async () => { 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 { try {
// //
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await SupplierinvoiceRequestMainApi.exportSupplierinvoiceRequestMain(tableObject.params) const data = await SupplierinvoiceRequestMainApi.exportSupplierinvoiceRequestMain(paramsData)
download.excel(data, `${t('ts.供应商发票申请主')}.xlsx`) download.excel(data, `${t('ts.供应商发票申请主')}.xlsx`)
} catch { } catch {
} finally { } finally {
@ -802,6 +884,9 @@ const importSuccess = () => {
border-radius:var(--el-border-radius-base); border-radius:var(--el-border-radius-base);
border:1px solid var(--el-color-danger); border:1px solid var(--el-color-danger);
box-shadow: 0 0 0 1px var(--el-color-danger) inset; box-shadow: 0 0 0 1px var(--el-color-danger) inset;
}
.red-text{
color:var(--el-color-danger);
font-weight:700;
} }
</style> </style>

36
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -580,6 +580,28 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
}, },
isForm: false, isForm: false,
}, },
{
label: '采购驳回原因',
field: 'purchaseRejectCause',
table: {
width: 180
},
isTable: true,
isSearch: false,
isForm: false,
isDetail:false,
},
{
label: '财务驳回原因',
field: 'financeRejectCause',
table: {
width: 180
},
isTable: true,
isSearch: false,
isForm: false,
isDetail:false,
},
{ {
label: '财务审批时间', label: '财务审批时间',
field: 'financialCreateTime', field: 'financialCreateTime',
@ -1165,8 +1187,18 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
isTableForm: false, isTableForm: false,
} }
])) ]))
// 批次校验
const validateSinglePrice = (rule: any, value: any, callback: any) => {
if (Number(value)>0) {
callback();
} else {
callback(new Error('请输入合同价格'));
}
}
//表单校验 //表单校验
export const SupplierinvoiceRequestDetailRules = reactive({ export const SupplierinvoiceRequestDetailRules = reactive({
singlePrice: [
{ required: true, message: '请输入合同价格', trigger: 'change' },
{ validator: validateSinglePrice, trigger: 'change' }
],
}) })

Loading…
Cancel
Save