Browse Source

供应商发票申请

master_hella_20240701
yufei0306 5 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
export const exportSupplierinvoiceRecordMain = async (params) => {
return await request.download({ url: `/wms/supplierinvoice-record-main/export-excel`, params })
export const exportSupplierinvoiceRecordMain = async (data) => {
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 })
}
// 采购--驳回供应商发货申请主
export const rejSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/rej?id=` + id })
export const rejSupplierinvoiceRequestMain = async (data) => {
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 })
}
// 财务--驳回供应商发货申请主
export const financerejSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/financeRej?id=` + id })
export const financerejSupplierinvoiceRequestMain = async (data) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/financeRej`, data })
}
// 作废--供应商发货申请主
@ -118,11 +118,11 @@ export const printSupplierRecordByMasterId = async (masterId:number) => {
}
// 导出供应商发票申请主 Excel
export const exportSupplierinvoiceRequestMain = async (params) => {
if(params.isSearch){
return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel-senior`, params })
export const exportSupplierinvoiceRequestMain = async (data) => {
if(data.isSearch){
return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel-senior`, data })
}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:sort="tableObjectRef.sort"
>
<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>
<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>
<template #differencePrice="{row}">
<slot name="differencePrice" :row="row"></slot>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"

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

@ -1,7 +1,7 @@
<template>
<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>
<!-- 列表头部 -->
@ -17,7 +17,9 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table ref="tableRef"
:selection="true"
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -27,12 +29,16 @@
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
@getSelectionRows="getSelectionRows"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, t('ts.单据号'), 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>
@ -94,7 +100,11 @@
:detailAllSchemas="SupplierinvoiceRecordDetail.allSchemas"
:detailAllSchemasRules="SupplierinvoiceRecordDetailRules"
:apiPage="SupplierinvoiceRecordDetailApi.getSupplierinvoiceRecordDeatilPage"
/>
>
<template #differencePrice="{row}">
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span>
</template>
</Detail>
</template>
<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))
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 handleExport = async () => {
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
})
try {
//
await message.exportConfirm()
//
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`)
} catch {
} finally {
@ -226,3 +257,14 @@ onMounted(async () => {
getList()
})
</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>
<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>

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

@ -580,6 +580,28 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
},
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: '财务审批时间',
field: 'financialCreateTime',
@ -1165,8 +1187,18 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive<CrudSchema[]
isTableForm: false,
}
]))
// 批次校验
const validateSinglePrice = (rule: any, value: any, callback: any) => {
if (Number(value)>0) {
callback();
} else {
callback(new Error('请输入合同价格'));
}
}
//表单校验
export const SupplierinvoiceRequestDetailRules = reactive({
singlePrice: [
{ required: true, message: '请输入合同价格', trigger: 'change' },
{ validator: validateSinglePrice, trigger: 'change' }
],
})

Loading…
Cancel
Save