songguoqiang 2 weeks ago
parent
commit
e2e1cd09a8
  1. 41
      src/api/wms/purchaseClaimRecordDetail/index.ts
  2. 69
      src/api/wms/purchaseClaimRecordMain/index.ts
  3. 1
      src/api/wms/purchaseClaimRequestDetail/index.ts
  4. 6
      src/api/wms/purchaseClaimRequestMain/index.ts
  5. 57
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts
  6. 2
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  7. 349
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts
  8. 453
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/index.vue
  9. 22
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts
  10. 56
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

41
src/api/wms/purchaseClaimRecordDetail/index.ts

@ -0,0 +1,41 @@
import request from '@/config/axios'
// 获得采购索赔子分页
export const getPurchaseClaimRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchaseClaim-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/purchaseClaim-record-detail/page`, params })
}
}
// 创建采购索赔子
export const createPurchaseClaimRecordDetail = async (data) => {
return await request.post({ url: `/wms/purchaseClaim-record-detail/create`, data })
}
// 修改采购索赔子
export const updatePurchaseClaimRecordDetail = async (data) => {
return await request.put({ url: `/wms/purchaseClaim-record-detail/update`, data })
}
// 删除采购索赔子
export const deletePurchaseClaimRecordDetail = async (id) => {
return await request.delete({ url: `/wms/purchaseClaim-record-detail/delete?id=` + id })
}
// 获得采购索赔子
export const getPurchaseClaimRecordDetail = async (id) => {
return await request.get({ url: `/wms/purchaseClaim-record-detail/get?id=` + id })
}
// 导出采购索赔子 Excel
export const exportPurchaseClaimRecordDetailExcel = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({url: `/wms/purchaseClaim-record-detail/export-excel-senior`, data})
} else {
return await request.download({ url: `/wms/purchaseClaim-record-detail/export-excel`, params })
}
}

69
src/api/wms/purchaseClaimRecordMain/index.ts

@ -0,0 +1,69 @@
import request from '@/config/axios'
export interface PurchaseClaimRecordMainVO {
id: number
number: string
supplierCode: string
claimTime: Date
status: string
supplierinvoiceNumber: string
remark: string
available: string
siteId: string
concurrencyStamp: string
}
// 查询采购索赔主列表
export const getPurchaseClaimRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchaseClaim-record-main/senior', data })
} else {
return await request.get({ url: `/wms/purchaseClaim-record-main/page`, params })
}
}
// 查询采购索赔主详情
export const getPurchaseClaimRecordMain = async (id: number) => {
return await request.get({ url: `/wms/purchaseClaim-record-main/get?id=` + id })
}
// 新增采购索赔主
export const createPurchaseClaimRecordMain = async (data: PurchaseClaimRecordMainVO) => {
return await request.post({ url: `/wms/purchaseClaim-record-main/create`, data })
}
// 修改采购索赔主
export const updatePurchaseClaimRecordMain = async (data: PurchaseClaimRecordMainVO) => {
return await request.put({ url: `/wms/purchaseClaim-record-main/update`, data })
}
// 删除采购索赔主
export const deletePurchaseClaimRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-record-main/delete?id=` + id })
}
// 提交审批采购索赔
export const subPurchaseClaimRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-record-main/subPurchaseClaimRecordMain?id=` + id })
}
// 审批通过采购索赔
export const agreePurchaseClaimRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-record-main/agreePurchaseClaimRecordMain?id=` + id })
}
// 审批驳回采购索赔
export const rejectPurchaseClaimRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-record-main/rejectPurchaseClaimRecordMain?id=` + id })
}
// 导出采购索赔主 Excel
export const exportPurchaseClaimRecordMain = async (params) => {
return await request.download({ url: `/wms/purchaseClaim-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchaseClaim-record-main/get-import-template' })
}

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

@ -29,7 +29,6 @@ export const getPurchaseClaimRequestDetail = async (id) => {
return await request.get({ url: `/wms/purchase-claim-request-detail/get?id=` + id })
}
// 导出采购索赔子 Excel
export const exportPurchaseClaimRequestDetailExcel = async (params) => {
if (params.isSearch) {

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

@ -46,17 +46,17 @@ export const deletePurchaseClaimRequestMain = async (id: number) => {
// 提交审批采购索赔
export const subPurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/subPurchaseClaimRequestMain?id=` + id })
return await request.post({ url: `/wms/purchaseClaim-request-main/sub?id=` + id })
}
// 审批通过采购索赔
export const agreePurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/agreePurchaseClaimRequestMain?id=` + id })
return await request.post({ url: `/wms/purchaseClaim-request-main/agree?id=` + id })
}
// 审批驳回采购索赔
export const rejectPurchaseClaimRequestMain = async (id: number) => {
return await request.delete({ url: `/wms/purchaseClaim-request-main/rejectPurchaseClaimRequestMain?id=` + id })
return await request.post({ url: `/wms/purchaseClaim-request-main/reject?id=` + id })
}
// 导出采购索赔主 Excel

57
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts

@ -1720,14 +1720,6 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive<CrudSchema[]>(
table: {
width: 150
},
tableForm: {
disabled: true,
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '数量',
@ -1840,8 +1832,55 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive<CrudSchema[]>(
table: {
width: 150
},
isTable: false,
tableForm: {
disabled: true
enterSearch: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}, {
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
isMainValue: true
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}, {
key: 'workshopCode',
value: 'workshopCode',
message: '请填写车间代码!',
isMainValue: true
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{

2
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -1185,7 +1185,7 @@ const clearInput = async (field, row, index) => {
}
const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
const src = ref(BASE_URL + '/jmreport/view/1016548504713515008?token=' + getAccessToken())
getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage //
//

349
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/PurchaseClaimRecordMain.data.ts

@ -0,0 +1,349 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
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 {
Supplieritem
} from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data";
import * as SupplieritemApi from "@/api/wms/supplieritem";
// 表单校验
export const PurchaseClaimRecordMainRules = reactive({
supplierCode: [
{ required: true, message: '请选择供应商代码', trigger: 'blur' }
],
supplierName: [
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
],
})
export const PurchaseClaimRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 150
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {    
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
},
{
label: '供应商名称',
field: 'supplierName',
isDetail: true,
isSearch: true,
table: {
width: 180
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
}
}
},
{
label: '索赔时间',
field: 'claimTime',
sort: 'custom',
formatter: dateFormatter,
table: {
width: 180
},
search: {
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: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '供应商发票申请单号',
field: 'supplierinvoiceNumber',
sort: 'custom',
isSearch: true,
isForm:false,
form: {
componentProps: {
disabled: true
}
},
table: {
width: 180
},
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.PURCHASECLAIM_REQUEST_STATUS,
dictClass: 'string',
isTable: true,
isForm:false,
sort: 'custom',
table: {
width: 150
},
isSearch: true,
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
isForm:false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isSearch: false,
search: {
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')]
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
isForm:false,
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const PurchaseClaimRecordDetailRules = reactive({
itemCode: [
{ required: true, message: '请输入物料代码', trigger: 'blur' }
],
claimQty: [
{ required: true, message: '请输入索赔数量', trigger: 'blur' }
],
claimAmount: [
{ required: true, message: '请输入索赔金额', trigger: 'blur' }
],
})
export const PurchaseClaimRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: false,
table: {
width: 150,
},
tableForm:{
multiple:false,//多选
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码',// 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},{
key: 'supplierCode',
value: 'supplierCode',
action: '==',
message: '供应商代码不能为空!',
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,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'supplierCode',
value: 'supplierCode',
message: '供应商代码不能为空!',
isMainValue:true
}
],
verificationParams: [
{
key: 'itemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled:true,
type: 'Select'
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
disabled:true,
type: 'Select'
},
},
{
label: '索赔数量',
field: 'claimQty',
sort: 'custom',
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 0
}
},
{
label: '索赔金额',
field: 'claimAmount',
sort: 'custom',
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 5
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
hiddenInMain:true,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))

453
src/views/wms/supplierManage/purchaseClaim/purchaseClaimRecord/index.vue

@ -0,0 +1,453 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="[
...PurchaseClaimRecordMain.allSchemas.searchSchema,
...PurchaseClaimRecordDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchaseClaimRecordMain.allSchemas"
:detailAllSchemas="PurchaseClaimRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
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"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row, $index }">
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
:isOpenSearchTable="false"
fieldTableColumn="itemCode"
:rules="PurchaseClaimRecordMainRules"
:formAllSchemas="PurchaseClaimRecordMain.allSchemas"
:tableAllSchemas="PurchaseClaimRecordDetail.allSchemas"
:tableFormRules="PurchaseClaimRecordDetailRules"
:tableData="tableData"
:apiUpdate="PurchaseClaimRecordMainApi.updatePurchaseClaimRecordMain"
:apiCreate="PurchaseClaimRecordMainApi.createPurchaseClaimRecordMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true"
@tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PurchaseClaimRecordMain.allSchemas"
:detailAllSchemas="PurchaseClaimRecordDetail.allSchemas"
:detailAllSchemasRules="PurchaseClaimRecordDetailRules"
:apiCreate="PurchaseClaimRecordDetailApi.createPurchaseClaimRecordDetail"
:apiUpdate="PurchaseClaimRecordDetailApi.updatePurchaseClaimRecordDetail"
:apiPage="PurchaseClaimRecordDetailApi.getPurchaseClaimRecordDetailPage"
:apiDelete="PurchaseClaimRecordDetailApi.deletePurchaseClaimRecordDetail"
/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/wms/deliver-plan-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:updateIsDisable="true"
:coverIsDisable="true"
:mode="2"
:extend="businessType"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
PurchaseClaimRecordMain,
PurchaseClaimRecordMainRules,
PurchaseClaimRecordDetailRules,
PurchaseClaimRecordDetail
} from './PurchaseClaimRecordMain.data'
import * as PurchaseClaimRecordMainApi from '@/api/wms/PurchaseClaimRecordMain'
import * as PurchaseClaimRecordDetailApi from '@/api/wms/purchaseClaimRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
defineOptions({ name: 'purchaseClaimRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const tableColumns = ref([
...PurchaseClaimRecordMain.allSchemas.tableColumns,
...PurchaseClaimRecordDetail.allSchemas.tableMainColumns
])
const { tableObject, tableMethods } = useTable({
getListApi: PurchaseClaimRecordDetailApi.getPurchaseClaimRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
const tableData = ref([])
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
if(formField == 'itemCode'){
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(itemCodes.length>0){
itemCodes = itemCodes.map(item=>(item['itemCode']))
message.warning(`物料${itemCodes.join(',')}已经存在`)
}
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
if(val.length==0){
return
}
let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']))
newVal.forEach(item=>{
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk['itemCode'] = item['itemCode']
tfk['itemName'] = item['itemName']
tfk['uom'] = item['supplierUom']
tableData.value.push(tfk)
})
}
}
const setV = {}
if(formField === 'supplierCode'){
setV['supplierCode'] = val[0]['code']
setV['supplierName'] = val[0]['name']
tableData.value = []
}
formRef.setValues(setV)
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
setV['remark'] = val[0]['remark']
setV['uom'] = val[0]['customerUom']
formRef.setValues(setV)
})
}
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: `wms:purchaseClaimRecord:create` }), //
defaultButtons.defaultImportBtn({ hasPermi: `wms:purchaseClaimRecord:import` }), //
defaultButtons.defaultExportBtn({ hasPermi: `wms:purchaseClaimRecord:export` }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row, $index) => {
const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return []
}
return [
defaultButtons.mainListPlanSubBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: `wms:purchaseClaimRecord:sub`
}), //
defaultButtons.mainListPlanTurBtn({
hide: isShowMainButton(row, ['3']),
hasPermi: `wms:purchaseClaimRecord:reject`
}), //
defaultButtons.mainListPlanAppBtn({
hide: isShowMainButton(row, ['3']),
hasPermi: `wms:purchaseClaimRecord:agree`
}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['0']),
hasPermi: `wms:purchaseClaimRecord:update`
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'mainPlanSub') {
//
handleSub(row.masterId)
}
else if (val == 'delete') {
//
handleDelete(row.masterId)
}
}
/** 提交审批按钮操作 */
const handleSub = async (masterId: number) => {
try {
//
await message.confirm(t('ts.是否提交审批所选中数据?'))
tableObject.loading = true
//
await PurchaseClaimRecordMainApi.subPurchaseClaimRecordMain(masterId)
message.success(t('ts.提交审批成功!'))
tableObject.loading = false
//
await getList()
} catch {
} finally {
tableObject.loading = false
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'planDeliverMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
tableObject.loading = true
//
await PurchaseClaimRecordMainApi.deletePurchaseClaimRecordMain(id)
tableObject.loading = false
message.success(t('common.delSuccess'))
//
buttonBaseClick('refresh', null)
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await PurchaseClaimRecordMainApi.exportPurchaseClaimRecordMain(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
PurchaseClaimRecordDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
let itemIndex = tableData.value.indexOf(item)
if (itemIndex > -1) {
tableData.value.splice(itemIndex, 1)
}
}
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter((item) => !selection.includes(item))
}
//true0
const flag = ref(false)
//
const submitForm = async (formType, submitData) => {
let data = { ...submitData }
if (data.masterId) {
data.id = data.masterId
}
data.subList = tableData.value //
data.subList.forEach((item) => {
item.toWarehouseCode = data.toWarehouseCode
item.toLocationCode = data.toLocationCode
})
data.businessType = businessType.value
//
let isExist = false
tableData.value.forEach((item) => {
let rs = tableData.value.filter((filterItem) => filterItem.itemCode == item.itemCode)
if (rs.length > 1) isExist = true
})
if (isExist) {
formRef.value.formLoading = false
return message.warning('物料代码重复')
}
data.subList.forEach((obj) => {
if (obj.claimQty == 0) {
message.error(`索赔数量不能为0!`)
flag.value = true
return
}
if (obj.claimAmount == 0) {
message.error(`索赔金额不能为0!`)
flag.value = true
return
}
})
if (flag.value) {
return
}
formRef.value.formLoading = true
try {
if (formType === 'create') {
await PurchaseClaimRecordMainApi.createPurchaseClaimRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await PurchaseClaimRecordMainApi.updatePurchaseClaimRecordMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
} else {
buttonBaseClick('refresh', null)
}
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: `${route.meta.title}】导入模版.xlsx`
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await PurchaseClaimRecordMainApi.importTemplate()
})
</script>

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

@ -66,6 +66,12 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 180
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
}
}
},
{
label: '索赔时间',
@ -170,7 +176,7 @@ export const PurchaseClaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
isDetail: false,
table: {
width: 150,
width: 250,
fixed: 'right'
}
}
@ -195,8 +201,6 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
sort: 'custom',
isSearch: false,
table: {
width: 150,
},
tableForm:{
multiple:false,//多选
@ -275,7 +279,10 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled:true,
type: 'Select'
},
},
{
@ -287,11 +294,11 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
disabled:true,
type: 'Select'
}
},
},
{
label: '索赔数量',
@ -300,7 +307,6 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
type: 'InputNumber',
@ -315,7 +321,6 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isSearch: false,
isTable: true,
table: {
width: 110
},
tableForm: {
type: 'InputNumber',
@ -330,7 +335,6 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isForm: false,
hiddenInMain:true,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,

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

@ -242,16 +242,16 @@ const butttondata = (row, $index) => {
hide: isShowMainButton(row, ['0']),
hasPermi: `wms:purchaseClaimRequest:sub`
}), //
defaultButtons.mainListPlanTurBtn({
hide: isShowMainButton(row, ['3']),
hasPermi: `wms:purchaseClaimRequest:reject`
}), //
defaultButtons.mainListPlanAppBtn({
hide: isShowMainButton(row, ['3']),
hide: isShowMainButton(row, ['2']),
hasPermi: `wms:purchaseClaimRequest:agree`
}), //
defaultButtons.mainListPlanTurBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: `wms:purchaseClaimRequest:reject`
}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['0']),
hide: isShowMainButton(row, ['0','2']),
hasPermi: `wms:purchaseClaimRequest:update`
}) //
]
@ -266,6 +266,14 @@ const buttonTableClick = async (val, row) => {
//
handleSub(row.masterId)
}
else if (val == 'mainPlanApp') {
//
handleAgree(row.masterId)
}
else if (val == 'mainPlanTur') {
//
handleReject(row.masterId)
}
else if (val == 'delete') {
//
handleDelete(row.masterId)
@ -291,6 +299,42 @@ const handleSub = async (masterId: number) => {
}
}
/** 审批通过按钮操作 */
const handleAgree = async (masterId: number) => {
try {
//
await message.confirm(t('ts.是否审批通过所选中数据?'))
tableObject.loading = true
//
await PurchaseClaimRequestMainApi.agreePurchaseClaimRequestMain(masterId)
message.success(t('ts.审批通过成功!'))
tableObject.loading = false
//
await getList()
} catch {
} finally {
tableObject.loading = false
}
}
/** 审批驳回按钮操作 */
const handleReject = async (masterId: number) => {
try {
//
await message.confirm(t('是否审批驳回所选中数据?'))
tableObject.loading = true
//
await PurchaseClaimRequestMainApi.rejectPurchaseClaimRequestMain(masterId)
message.success(t('审批驳回成功!'))
tableObject.loading = false
//
await getList()
} catch {
} finally {
tableObject.loading = false
}
}
/** 添加/修改操作 */
const formRef = ref()

Loading…
Cancel
Save