Browse Source

采购索赔

master
zhangli 1 year ago
parent
commit
50b6f59274
  1. 7
      src/api/wms/purchaseclaimRequestMain/index.ts
  2. 34
      src/components/BasicForm/src/BasicForm.vue
  3. 43
      src/components/Detail/src/Detail.vue
  4. 10
      src/utils/disposition/tableColumns.ts
  5. 14
      src/views/wms/purchaseclaimRequestMain/index.vue

7
src/api/wms/purchaseclaimRequestMain/index.ts

@ -23,9 +23,14 @@ export interface PurchaseclaimRequestMainVO {
// 查询采购索赔申请主列表 // 查询采购索赔申请主列表
export const getPurchaseclaimRequestMainPage = async (params) => { export const getPurchaseclaimRequestMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/purchaseclaim-request-main/senior', data })
} else {
return await request.get({ url: `/wms/purchaseclaim-request-main/page`, params }) return await request.get({ url: `/wms/purchaseclaim-request-main/page`, params })
} }
}
// 查询采购索赔申请主详情 // 查询采购索赔申请主详情
export const getPurchaseclaimRequestMain = async (id: number) => { export const getPurchaseclaimRequestMain = async (id: number) => {
return await request.get({ url: `/wms/purchaseclaim-request-main/get?id=` + id }) return await request.get({ url: `/wms/purchaseclaim-request-main/get?id=` + id })

34
src/components/BasicForm/src/BasicForm.vue

@ -200,12 +200,12 @@ const props = defineProps({
required: true, required: true,
default: null default: null
}, },
// id // //
masterId: { // masterParmas: {
type: String, // type: Object,
required: false, // required: false,
default: null // default: null
}, // },
}) })
const { t } = useI18n() // const { t } = useI18n() //
@ -219,6 +219,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formRef = ref() // Ref const formRef = ref() // Ref
const formSchema = ref(props.formAllSchemas?.formSchema) const formSchema = ref(props.formAllSchemas?.formSchema)
/** 弹层操作 */ /** 弹层操作 */
// formField form // formField form
// searchField // searchField
@ -238,14 +239,22 @@ const searchTableSuccess = (formField,searchField, val, type, row) => {
} }
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, row?: any) => { const open = async (type: string, row?: any, masterParmas?: any) => {
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
if (row) { // masterIdnumber
console.log(row); if(masterParmas){
if(!row){
row = {
masterId: masterParmas.masterId,
number: masterParmas.number
}
}
}
if (row.id || row.masterId) {
formLoading.value = true formLoading.value = true
try { try {
nextTick(() => { nextTick(() => {
@ -312,9 +321,10 @@ const submitForm = async () => {
try { try {
// const data = unref(formRef)?.formModel as ItempackagingApi.ItempackagingVO // const data = unref(formRef)?.formModel as ItempackagingApi.ItempackagingVO
const data = unref(formRef)?.formModel const data = unref(formRef)?.formModel
if(props.masterId){ // if(props.masterParmas.masterId){
data.masterId = props.masterId // data.masterId = props.masterParmas.masterId
} // data.number = props.masterParmas.number
// }
if (formType.value === 'create') { if (formType.value === 'create') {
await props.apiCreate(data) await props.apiCreate(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))

43
src/components/Detail/src/Detail.vue

@ -56,7 +56,6 @@
:isBusiness="false" :isBusiness="false"
:apiUpdate="apiUpdate" :apiUpdate="apiUpdate"
:apiCreate="apiCreate" :apiCreate="apiCreate"
:masterId="masterId"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
/> />
</div> </div>
@ -72,6 +71,7 @@ import * as FileApi from '@/api/wms/file'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import { number } from 'vue-types'
defineOptions({ name: 'Detail' }) defineOptions({ name: 'Detail' })
@ -144,8 +144,13 @@ const props = defineProps({
required: false, required: false,
default: null default: null
}, },
//
Echo: {
type: Array,
required: false,
default: null
},
}) })
console.log(props.detailAllSchemas);
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
const detailLoading = ref(false) const detailLoading = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : '')))
@ -177,7 +182,7 @@ const remarksData = reactive({
const changeRecordData = reactive({ const changeRecordData = reactive({
changeRecordList: [] changeRecordList: []
}) })
const detailData = ref("")// const detailData = ref({})//
// //
const getFileList = async () => { const getFileList = async () => {
detailLoading.value = true detailLoading.value = true
@ -207,7 +212,10 @@ const change = (item, index) => {
} }
const masterId=ref('')//id const masterParmas=ref({
masterId:'',//id
number: '',//
})//
/** 打开弹窗 */ /** 打开弹窗 */
const titleNameRef = ref() const titleNameRef = ref()
const titleValueRef = ref() const titleValueRef = ref()
@ -221,9 +229,10 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
if(!props.isBasic) { if(!props.isBasic) {
// id // id
masterId.value = row.id masterParmas.value.masterId = row.id
masterParmas.value.number = row.number
tableObject.params = { tableObject.params = {
masterId: row.id masterId: row.id,
} }
getList() getList()
} }
@ -310,7 +319,7 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type: string, row?: number) => { const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row) formRef.value.open(type, row, masterParmas.value)
} }
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
@ -319,22 +328,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
setV['ppNumber'] = val[0]['ppNumber'] console.log(formField);
setV['poLine'] = val[0]['poLine'] props.Echo.forEach((item)=>{
setV['batch'] = val[0]['batch'] setV[item] = val[0][item]
setV['altBatch'] = val[0]['altBatch'] })
setV['reason'] = val[0]['reason']
setV['singlePrice'] = val[0]['singlePrice']
setV['amount'] = val[0]['amount']
setV['number'] = val[0]['number']
setV['itemCode'] = val[0]['itemCode']
setV['itemName'] = val[0]['itemName']
setV['itemDesc1'] = val[0]['itemDesc1']
setV['itemDesc2'] = val[0]['itemDesc2']
setV['projectCode'] = val[0]['projectCode']
setV['qty'] = val[0]['qty']
setV['uom'] = val[0]['uom']
setV['remark'] = val[0]['remark']
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })

10
src/utils/disposition/tableColumns.ts

@ -10844,6 +10844,15 @@ export const PurchaseclaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
table: { table: {
width: 150 width: 150
}, },
form:{
componentProps:{
disabled:true,
}
},
isTableForm:false,
// tableForm:{
// disabled:true,
// }
}, },
{ {
label: '物品代码', label: '物品代码',
@ -10851,6 +10860,7 @@ export const PurchaseclaimRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '物品名称', label: '物品名称',

14
src/views/wms/purchaseclaimRequestMain/index.vue

@ -12,6 +12,7 @@
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -63,6 +64,7 @@
:apiUpdate="PurchaseclaimRequestDetailApi.updatePurchaseclaimRequestDetail" :apiUpdate="PurchaseclaimRequestDetailApi.updatePurchaseclaimRequestDetail"
:apiPage="PurchaseclaimRequestDetailApi.getPurchaseclaimRequestDetailPage" :apiPage="PurchaseclaimRequestDetailApi.getPurchaseclaimRequestDetailPage"
:apiDelete="PurchaseclaimRequestDetailApi.deletePurchaseclaimRequestDetail" :apiDelete="PurchaseclaimRequestDetailApi.deletePurchaseclaimRequestDetail"
:Echo="Echo"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -133,6 +135,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} }
}) })
} }
//
const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const exportLoading = ref(false) // const exportLoading = ref(false) //
@ -147,8 +151,8 @@ const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:purchaseclaim-request-main:create' }), // defaultButtons.defaultAddBtn({ hasPermi: 'wms:purchaseclaim-request-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:purchaseclaim-request-main:import' }), // defaultButtons.defaultImportBtn({ hasPermi: 'wms:purchaseclaim-request-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchaseclaim-request-main:export' }), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchaseclaim-request-main:export' }), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// { // {
// label: '', // label: '',
@ -315,6 +319,14 @@ const importTemplateData = reactive({
const importSuccess = () => { const importSuccess = () => {
getList() getList()
} }
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

Loading…
Cancel
Save