陈薪名 1 year ago
parent
commit
902be25c54
  1. 9
      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

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

@ -23,9 +23,14 @@ export interface PurchaseclaimRequestMainVO {
// 查询采购索赔申请主列表
export const getPurchaseclaimRequestMainPage = async (params) => {
return await request.get({ url: `/wms/purchaseclaim-request-main/page`, 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 })
}
}
// 查询采购索赔申请主详情
export const getPurchaseclaimRequestMain = async (id: number) => {
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,
default: null
},
// id
masterId: {
type: String,
required: false,
default: null
},
// //
// masterParmas: {
// type: Object,
// required: false,
// default: null
// },
})
const { t } = useI18n() //
@ -219,6 +219,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formRef = ref() // Ref
const formSchema = ref(props.formAllSchemas?.formSchema)
/** 弹层操作 */
// formField form
// 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
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (row) {
console.log(row);
// masterIdnumber
if(masterParmas){
if(!row){
row = {
masterId: masterParmas.masterId,
number: masterParmas.number
}
}
}
if (row.id || row.masterId) {
formLoading.value = true
try {
nextTick(() => {
@ -312,9 +321,10 @@ const submitForm = async () => {
try {
// const data = unref(formRef)?.formModel as ItempackagingApi.ItempackagingVO
const data = unref(formRef)?.formModel
if(props.masterId){
data.masterId = props.masterId
}
// if(props.masterParmas.masterId){
// data.masterId = props.masterParmas.masterId
// data.number = props.masterParmas.number
// }
if (formType.value === 'create') {
await props.apiCreate(data)
message.success(t('common.createSuccess'))

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

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

10
src/utils/disposition/tableColumns.ts

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

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

@ -12,6 +12,7 @@
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
/>
<!-- 列表 -->
@ -63,6 +64,7 @@
:apiUpdate="PurchaseclaimRequestDetailApi.updatePurchaseclaimRequestDetail"
:apiPage="PurchaseclaimRequestDetailApi.getPurchaseclaimRequestDetailPage"
: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) //
@ -147,8 +151,8 @@ const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:purchaseclaim-request-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:purchaseclaim-request-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchaseclaim-request-main:export' }), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
@ -315,6 +319,14 @@ const importTemplateData = reactive({
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {

Loading…
Cancel
Save