Browse Source

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

intex
zhang_li 1 week ago
parent
commit
c196d97334
  1. 12
      src/api/wms/purchaseClaimRequestDetail/index.ts
  2. 24
      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) => { 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) => { 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) => { 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) => { 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 // 导出采购索赔子 Excel
export const exportPurchaseClaimRequestDetailExcel = async (params) => { export const exportPurchaseClaimRequestDetailExcel = async (params) => {
if (params.isSearch) { if (params.isSearch) {
const data = {...params} 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 { } 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 })
} }
} }

24
src/components/Detail/src/Detail.vue

@ -476,6 +476,12 @@ const props = defineProps({
required: false, required: false,
default: 8 default: 8
}, },
//
isChangeDetailDrawer:{
type:Array,
required: false,
default: () => []
},
}) })
const allSchemas = ref(props.allSchemas) const allSchemas = ref(props.allSchemas)
const detailAllSchemasRef = ref(props.detailAllSchemas) const detailAllSchemasRef = ref(props.detailAllSchemas)
@ -1015,9 +1021,23 @@ 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) => { const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value) //
emit('detailOpenForm', type, row) 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 // form
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {

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

@ -344,3 +344,19 @@ export const PurchaseClaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
isTableForm: false, 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" ref="detailRef"
:isBasic="false" :isBasic="false"
:allSchemas="PurchaseClaimRequestMain.allSchemas" :allSchemas="PurchaseClaimRequestMain.allSchemas"
:detailAllSchemas="PurchaseClaimRequestDetail.allSchemas" :detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="PurchaseClaimRequestDetailRules" :detailAllSchemasRules="PurchaseClaimRequestDetailRules"
:apiCreate="PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail" :apiCreate="PurchaseClaimRequestDetailApi.createPurchaseClaimRequestDetail"
:apiUpdate="PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail" :apiUpdate="PurchaseClaimRequestDetailApi.updatePurchaseClaimRequestDetail"
@ -80,6 +80,9 @@
:apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" :apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail"
:detailButtonIsShowDelete="false" :detailButtonIsShowDelete="false"
:detailButtonIsShowAdd="false" :detailButtonIsShowAdd="false"
:detailButtonIsShowAddStatusArray="['1','2']"
:isChangeDetailDrawer="['2']"
@detailOpenForm="detailOpenForm"
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
@ -92,6 +95,15 @@
:mode="2" :mode="2"
:extend="businessType" :extend="businessType"
/> />
<BasicForm
ref="detailFormRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
:rules="PurchaseClaimRequestMainRules"
:formAllSchemas="PurchaseClaimRequestAmount.allSchemas"
:isBusiness="false"
@success="submitFormDetail"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -100,7 +112,8 @@ import {
PurchaseClaimRequestMain, PurchaseClaimRequestMain,
PurchaseClaimRequestMainRules, PurchaseClaimRequestMainRules,
PurchaseClaimRequestDetailRules, PurchaseClaimRequestDetailRules,
PurchaseClaimRequestDetail PurchaseClaimRequestDetail,
PurchaseClaimRequestAmount
} from './PurchaseClaimRequestMain.data' } 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'
@ -120,6 +133,8 @@ const tableColumns = ref([
...PurchaseClaimRequestMain.allSchemas.tableColumns, ...PurchaseClaimRequestMain.allSchemas.tableColumns,
...PurchaseClaimRequestDetail.allSchemas.tableMainColumns ...PurchaseClaimRequestDetail.allSchemas.tableMainColumns
]) ])
const detailAllSchemas = ref(PurchaseClaimRequestDetail.allSchemas)
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage // getListApi: PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailPage //
}) })
@ -384,7 +399,9 @@ const openForm = async (type: string, row?: any) => {
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const detailData = ref({})
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailData.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'planDeliverMain') detailRef.value.openDetail(row, titleName, titleValue, 'planDeliverMain')
} }
@ -528,7 +545,32 @@ const searchFormClick = (searchData) => {
} }
getList() // 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 () => { onMounted(async () => {
getList() getList()

Loading…
Cancel
Save