Browse Source

采购索赔申请 代码上传

intex_online20241111
YEJIAXING-PC\lenovo 1 month ago
parent
commit
509da05ff1
  1. 4
      src/api/wms/purchaseClaimRequestDetail/index.ts
  2. 15
      src/api/wms/purchaseClaimRequestMain/index.ts
  3. 1
      src/utils/dict.ts
  4. 360
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts
  5. 226
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

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

@ -4,9 +4,9 @@ export const getPurchaseClaimRequestDetailPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/wms/purchase-claim-request-detai/senior', data }) return await request.post({ url: '/wms/purchaseClaim-request-detail/senior', data })
} else { } else {
return await request.get({ url: `/wms/purchase-claim-request-detai/page`, params }) return await request.get({ url: `/wms/purchaseClaim-request-detail/page`, params })
} }
} }

15
src/api/wms/purchaseClaimRequestMain/index.ts

@ -44,6 +44,21 @@ export const deletePurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/delete?id=` + id }) return await request.delete({ url: `/wms/purchaseClaim-request-main/delete?id=` + id })
} }
// 提交审批采购索赔
export const subPurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/subPurchaseClaimRequestMain?id=` + id })
}
// 审批通过采购索赔
export const agreePurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/agreePurchaseClaimRequestMain?id=` + id })
}
// 审批驳回采购索赔
export const rejectPurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/rejectPurchaseClaimRequestMain?id=` + id })
}
// 导出采购索赔主 Excel // 导出采购索赔主 Excel
export const exportPurchaseClaimRequestMain = async (params) => { export const exportPurchaseClaimRequestMain = async (params) => {
return await request.download({ url: `/wms/purchaseClaim-request-main/export-excel`, params }) return await request.download({ url: `/wms/purchaseClaim-request-main/export-excel`, params })

1
src/utils/dict.ts

@ -347,6 +347,7 @@ export enum DICT_TYPE {
SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态 SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态
SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态 SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态
PURCHASECLAIM_REQUEST_STATUS = 'purchaseClaim_request_status', //采购索赔状态
INVOICE_REQUEST_STATUS = 'invoice_request_status', //待开票申请状态 INVOICE_REQUEST_STATUS = 'invoice_request_status', //待开票申请状态
// ========== system - 消息通知优化 - ========== // ========== system - 消息通知优化 - ==========

360
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts

@ -1,16 +1,21 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import * as ItembasicApi from "@/api/wms/itembasic";
import { import {
CustomerStatementMain, Supplieritem
} from '../../../deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data' } from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data";
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' import * as SupplieritemApi from "@/api/wms/supplieritem";
// 表单校验 // 表单校验
export const PurchaseClaimRequestMainRules = reactive({ export const PurchaseClaimRequestMainRules = reactive({
beforeTaxAmount: [required], supplierCode: [
taxRate: [required], { required: true, message: '请选择供应商代码', trigger: 'blur' }
taxAmount: [required], ],
adTaxAmount: [required], supplierName: [
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
],
}) })
export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -20,144 +25,126 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: false,
table: {
width: 150
}, },
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
isForm: false,
// 0:新增1:已发布2已作废
}, },
{ {
label: '客户对账单', label: '供应商代码',
field: 'customerStatementNumber', field: 'supplierCode',
sort: 'custom', sort: 'custom',
table: {
width: 150
},
isSearch: true, isSearch: true,
form: { form: {
componentProps: { // labelMessage: '信息提示说明!!!',
componentProps: {    
enterSearch:true, enterSearch:true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本 searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题 searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类 searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法 searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法
searchCondition: [{ verificationParams: [{
key: 'available', key: 'code',
value: 'TRUE', action: '==',
isMainValue: false value: '',
}] isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
} }
} }
}, },
{ {
label: '客户代码', label: '供应商名称',
field: 'customer', field: 'supplierName',
isDetail: true,
table: {
width: 180
},
},
{
label: '索赔时间',
field: 'invoiceTime',
sort: 'custom', sort: 'custom',
isSearch: true, formatter: dateFormatter,
form: { table: {
width: 110
},
search: {
component: 'DatePicker',
componentProps: { componentProps: {
disabled: true valueFormat: 'YYYY-MM-DD HH:mm:ss',
} type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
{
label: '客户名称',
field: 'customerName',
sort: 'custom',
form: { form: {
component: 'DatePicker',
componentProps: { componentProps: {
disabled: true type: 'datetime',
} valueFormat: 'x'
} }
}, },
},
{ {
label: '未税金额', label: '供应商发票申请单号',
field: 'beforeTaxAmount', field: 'supplierinvoiceNumber',
sort: 'custom', sort: 'custom',
isSearch: true,
isForm:false,
form: { form: {
componentProps: { componentProps: {
disabled: true disabled: true
} }
} },
table: {
width: 180
},
}, },
{ {
label: '税率(%)', label: '状态',
field: 'taxRate', field: 'status',
dictType: DICT_TYPE.TAX_RATE_DICT, dictType: DICT_TYPE.PURCHASECLAIM_REQUEST_STATUS,
dictClass: 'string', dictClass: 'string',
sortTableDefault: 3,
isTable: true, isTable: true,
isForm:false,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, isSearch: true,
{
label: '税额',
field: 'taxAmount',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '价税合计金额',
field: 'adTaxAmount',
sort: 'custom',
form: { form: {
value: '1',
componentProps: { componentProps: {
disabled: true disabled: true
} }
} }
}, },
{ {
label: '金税票号', label: '创建时间',
field: 'goldenTaxInvoiceNumber', field: 'createTime',
sort: 'custom', formatter: dateFormatter,
isForm:false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
{
label: '开票日期',
field: 'invoiceTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, table: {
search: { width: 180
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
}, },
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
type: 'datetime', type: 'datetime',
valueFormat: 'x' dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
} }
}, },
}, isSearch: true,
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
isTable: false,
isForm: false
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -166,7 +153,15 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
isForm:false, isForm:false,
table: {
width: 150
},
}, },
{ {
label: '操作', label: '操作',
@ -180,108 +175,149 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
])) ]))
// 表单校验 // 表单校验
export const PurchaseClaimRequestDetailRules = reactive({ export const PurchaseClaimRequestDetailRules = reactive({
beforeTaxAmount: [required], itemCode: [
taxRate: [required], { required: true, message: '请输入物料代码', trigger: 'blur' }
taxAmount: [required], ],
adTaxAmount: [required], claimQty: [
{ required: true, message: '请输入索赔数量', trigger: 'blur' }
],
claimAmount: [
{ required: true, message: '请输入索赔金额', trigger: 'blur' }
],
}) })
export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '品番', label: '物料代码',
field: 'number', field: 'itemCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
isForm: false, table: {
tableForm: { width: 150
disabled: true
}
}, },
{ tableForm:{
label: '品号', multiple:false,//多选
field: 'articleNumber', isInpuFocusShow: true, // 开启查询弹窗
sort: 'custom', searchListPlaceholder: '请选择物料代码',// 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true, isSearch: true,
isForm: false, isMainValue: false
// 0:新增1:已发布2已作废 },{
}, key: 'supplierCode',
{ value: 'supplierCode',
label: '数量', action: '==',
field: 'qty', message: '供应商代码不能为空!',
sort: 'custom', isFormModel:true, // filters中添加筛选的数据--取于formModel
required:true, // 前置添加必有,和isFormModel结合使用
isSearch: true,
isMainValue: false
}],
verificationPage: ItembasicApi.getItemListByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法
isShowTableFormSearch: false, //tableForm下方是否出现输入框
verificationParams: [{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true, isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: { form: {
// labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
disabled:true,
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户对账单', // 输入框占位文本 searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: '', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '客户对账单信息', // 查询弹窗标题 searchTitle: '供应商物料信息', // 查询弹窗标题
searchAllSchemas: CustomerStatementMain.allSchemas, // 查询弹窗所需类 searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: CustomerStatementMainApi.getCustomerStatementMainPage, // 查询弹窗所需分页方法 searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [
{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}] },{
key: 'supplierCode',
value: 'supplierCode',
message: '供应商代码不能为空!',
isMainValue:true
} }
} ],
}, verificationParams: [
{ {
label: '销售单价', key: 'itemCode',
field: 'price', action: '==',
sort: 'custom', value: '',
isMainValue: false,
isSearch: true, isSearch: true,
form: { isFormModel: true
componentProps: { }
disabled: true ] // 失去焦点校验参数
} }
} }
}, },
{ {
label: '模具分摊单价', label: '物料名称',
field: 'allocationPrice', field: 'itemName',
sort: 'custom', sort: 'custom',
form: { table: {
componentProps: { width: 150
disabled: true },
}
}
}, },
{ {
label: '合计单价', label: '计量单位',
field: 'beforeTaxAmount', field: 'uom',
sort: 'custom', sort: 'custom',
form: { dictType: DICT_TYPE.UOM,
componentProps: { dictClass: 'string',
disabled: true isSearch: false,
} isTable: true,
table: {
width: 110
},
tableForm: {
type: 'Select'
} }
}, },
{ {
label: '未税金额', label: '索赔数量',
field: 'taxRate', field: 'claimQty',
sort: 'custom', sort: 'custom',
isSearch: false,
isTable: true,
table: {
width: 110
}, },
{ tableForm: {
label: '税额', type: 'InputNumber',
field: 'taxAmount', min: 0,
sort: 'custom', precision: 0
form: {
componentProps: {
disabled: true
}
} }
}, },
{ {
label: '含税金额', label: '索赔金额',
field: 'adTaxAmount', field: 'claimAmount',
sort: 'custom', sort: 'custom',
form: { isSearch: false,
componentProps: { isTable: true,
disabled: true table: {
} width: 110
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 5
} }
}, },
])) ]))

226
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

@ -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))
} }
//true0 //true0
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') {

Loading…
Cancel
Save