Browse Source

YT-1093审批中的采购索赔申请应该只能编辑索赔金额

intex
zhang_li 4 days ago
parent
commit
c196d97334
  1. 12
      src/api/wms/purchaseClaimRequestDetail/index.ts
  2. 20
      src/components/Detail/src/Detail.vue
  3. 16
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/PurchaseClaimRequestMain.data.ts
  4. 46
      src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue

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

@ -15,29 +15,29 @@ export const getPurchaseClaimRequestDetailList = async (supplierCode) => {
}
// 创建采购索赔子
export const createPurchaseClaimRequestDetail = async (data) => {
return await request.post({ url: `/wms/purchase-claim-request-detail/create`, data })
return await request.post({ url: `/wms/purchaseClaim-request-detail/create`, data })
}
// 修改采购索赔子
export const updatePurchaseClaimRequestDetail = async (data) => {
return await request.put({ url: `/wms/purchase-claim-request-detail/update`, data })
return await request.put({ url: `/wms/purchaseClaim-request-detail/update`, data })
}
// 删除采购索赔子
export const deletePurchaseClaimRequestDetail = async (id) => {
return await request.delete({ url: `/wms/purchase-claim-request-detail/delete?id=` + id })
return await request.delete({ url: `/wms/purchaseClaim-request-detail/delete?id=` + id })
}
// 获得采购索赔子
export const getPurchaseClaimRequestDetail = async (id) => {
return await request.get({ url: `/wms/purchase-claim-request-detail/get?id=` + id })
return await request.get({ url: `/wms/purchaseClaim-request-detail/get?id=` + id })
}
// 导出采购索赔子 Excel
export const exportPurchaseClaimRequestDetailExcel = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({url: `/wms/purchase-claim-request-detail/export-excel-senior`, data})
return await request.downloadPost({ url: `/wms/purchaseClaim-request-detail/export-excel-senior`, data})
} else {
return await request.download({ url: `/wms/purchase-claim-request-detail/export-excel`, params })
return await request.download({ url: `/wms/purchaseClaim-request-detail/export-excel`, params })
}
}

20
src/components/Detail/src/Detail.vue

@ -476,6 +476,12 @@ const props = defineProps({
required: false,
default: 8
},
//
isChangeDetailDrawer:{
type:Array,
required: false,
default: () => []
},
})
const allSchemas = ref(props.allSchemas)
const detailAllSchemasRef = ref(props.detailAllSchemas)
@ -1015,10 +1021,24 @@ const buttonTableClick = async (val, row) => {
}
}
/** 添加/修改操作 */
//
const isShowChangeDetailDrawer = (row, val) => {
if(!val || val &&val.length == 0) return false;
if (val.indexOf(row.status) > -1) {
return true
} else {
return false
}
}
const openForm = async (type: string, row?: number) => {
//
if (isShowChangeDetailDrawer(curRow.value,props.isChangeDetailDrawer)) {
emit('detailOpenForm', type, row, masterParmas.value)
}else{
formRef.value.open(type, row, masterParmas.value)
emit('detailOpenForm', type, row)
}
}
// form
const submitForm = async (formType, data) => {
try {

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

@ -344,3 +344,19 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isTableForm: false,
}
]))
export const PurchaseClaimRequestAmount = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '索赔金额',
field: 'claimAmount',
sort: 'custom',
isSearch: false,
isTable: true,
table: {
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 5
}
},
]))

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

@ -72,7 +72,7 @@
ref="detailRef"
:isBasic="false"
:allSchemas="PurchaseClaimRequestMain.allSchemas"
:detailAllSchemas="PurchaseClaimRequestDetail.allSchemas"
:detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="PurchaseClaimRequestDetailRules"
:apiCreate="PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail"
:apiUpdate="PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail"
@ -80,6 +80,9 @@
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail"
:detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false"
:detailButtonIsShowAddStatusArray="['1','2']"
:isChangeDetailDrawer="['2']"
@detailOpenForm="detailOpenForm"
/>
<!-- 导入 -->
<ImportForm
@ -92,6 +95,15 @@
:mode="2"
:extend="businessType"
/>
<BasicForm
ref="detailFormRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:rules="PurchaseClaimRequestMainRules"
:formAllSchemas="PurchaseClaimRequestAmount.allSchemas"
:isBusiness="false"
@success="submitFormDetail"
/>
</template>
<script setup lang="ts">
@ -100,7 +112,8 @@ import {
PurchaseClaimRequestMain,
PurchaseClaimRequestMainRules,
PurchaseClaimRequestDetailRules,
PurchaseClaimRequestDetail
PurchaseClaimRequestDetail,
PurchaseClaimRequestAmount
} from './PurchaseClaimRequestMain.data'
import * as PurchaseClaimRequestMainApi from '@/api/wms/PurchaseClaimRequestMain'
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail'
@ -120,6 +133,8 @@ const tableColumns = ref([
...PurchaseClaimRequestMain.allSchemas.tableColumns,
...PurchaseClaimRequestDetail.allSchemas.tableMainColumns
])
const detailAllSchemas = ref(PurchaseClaimRequestDetail.allSchemas)
const { tableObject, tableMethods } = useTable({
getListApi: PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage //
})
@ -384,7 +399,9 @@ const openForm = async (type: string, row?: any) => {
}
/** 详情操作 */
const detailRef = ref()
const detailData = ref({})
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailData.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'planDeliverMain')
}
@ -528,7 +545,32 @@ const searchFormClick = (searchData) => {
}
getList() //
}
const detailFormRef = ref()
const detailOpenForm = (type, row, masterParmas) => {
//
if (masterParmas) {
detailFormRef.value.open(type, row, masterParmas)
}
}
//
const submitFormDetail =async (formType,data) => {
detailFormRef.value.formLoading = true
try {
if (formType === 'create') {
await PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail(data)
message.success(t('common.createSuccess'))
} else {
await PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail(data)
message.success(t('common.updateSuccess'))
}
console.log(detailRef.value.formRef.dialogVisible)
detailFormRef.value.dialogVisible = false
detailRef.value.updateList()
} catch {
detailFormRef.value.formLoading = false
}
}
/** 初始化 **/
onMounted(async () => {
getList()

Loading…
Cancel
Save