Browse Source

备件收货申请的新增和采购收货申请的新增功能一致

master_hella_20240701
yufei0306 7 months ago
parent
commit
7d3e69c96b
  1. 80
      src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/index.vue
  2. 224
      src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/sparereceiptRequestMain.data.ts

80
src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/index.vue

@ -56,6 +56,7 @@
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@formFormDateChange="formFormDateChange"
@onEnter="onEnter"
/>
<!-- 详情 -->
@ -115,6 +116,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { getAccessToken } from '@/utils/auth'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import { PurchaseDetail } from '../../supplierdeliver/purchaseMain/purchaseMain.data'
//
defineOptions({ name: 'PurchasereceiptRequestMain' })
@ -147,17 +150,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} else if(formField == 'poNumber') {
row['poNumber'] = val[0]['number']
} else if(formField == 'poLine'){
row['poLine'] = val[0]['lineNumber']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
let supplierCode = formRef.formModel.supplierCode;
let itemCode = val[0]['itemCode']
let queryData = {
supplierCode:supplierCode,
itemCode:itemCode
}
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{
row['defaultToLocationCode'] = res
//--
val.forEach(item=>{
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow['poLine'] = item['lineNumber']
newRow['itemCode'] = item['itemCode']
newRow['uom'] = item['uom']
newRow['poNumber'] = item['number']
let supplierCode = formRef.formModel.supplierCode;
let queryData = {
supplierCode:supplierCode,
itemCode: item['itemCode']
}
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{
newRow['defaultToLocationCode'] = res
tableData.value.push(newRow)
})
})
}else if (formField == 'packQty'){
row['packQty'] = val[0]['packQty']
@ -165,12 +174,59 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
} else {
const setV = {}
if(formField == 'supplierCode'){
setV['supplierCode'] = val[0]['code']
}else if(formField == 'ppNumber') {
//----
setV['supplierCode'] = val[0]['supplierCode']
setV['poNumber'] = val[0]['number']
const newRow = val[0]
newRow['poNumber'] = val[0]['number']
//
getSearchTableData(val[0]['number'])
// tableData.value = [newRow]
// formRef.handleAddTable()
}
setV[formField] = val[0][searchField]
setV['supplierCode'] = val[0]['code']
formRef.setValues(setV)
}
})
}
const onEnter = async (field,value)=>{
console.log(field,value)
getSearchTableData(value,true)
}
const getSearchTableData = async (number,isEnter=false)=>{
const {tableObject ,tableMethods} = useTable({
defaultParams:{number},
getListApi: PurchaseDetailApi.getPurchaseDetailPage //
})
//
const { getList:getList1 } = tableMethods
await getList1()
const tableColumns = PurchaseDetail.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
tableData.value = []
tableObject.tableList.forEach(row=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow['poLine'] = row['lineNumber']
newRow['itemCode'] = row['itemCode']
newRow['uom'] = row['uom']
newRow['poNumber'] =row['number']
newRow['defaultToLocationCode'] =row['defaultLocation']
tableData.value.push(newRow)
if(isEnter){
//--
const setV = {}
setV['poNumber'] = number
setV['supplierCode'] = row.supplierCode
formRef.value.formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {

224
src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/sparereceiptRequestMain.data.ts

@ -51,24 +51,25 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isSearch: true,
},
{
label: '供应商代码',
field: 'supplierCode',
label: '采购订单',
field: 'ppNumber',
sort: 'custom',
table: {
width: 150
width: 180
},
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法
searchListPlaceholder: '请选择采购订单', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '采购订单信息', // 查询弹窗标题
searchAllSchemas: PurchaseMain.allSchemas, // 查询弹窗所需类
searchPage: PurchaseMainApi.getPurchaseMainPage, // 查询弹窗所需分页方法
}
}
},
isForm: true,
},
{
label: '发货单号',
@ -80,42 +81,62 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isForm: true,
},
{
label: '要货计划单号',
field: 'ppNumber',
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 180
width: 150
},
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '要货计划信息', // 查询弹窗标题
searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类
searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},
{
key: 'status',
value: 4,
isMainValue: false
},
{
key: 'available',
value: "TRUE",
isMainValue: false
}]
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法
}
},
isForm: true,
}
},
// {
// label: '要货计划单号',
// field: 'ppNumber',
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '要货计划信息', // 查询弹窗标题
// searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类
// searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'supplierCode',
// value: 'supplierCode',
// message: '请填写供应商代码!',
// isMainValue: true
// },
// {
// key: 'status',
// value: 4,
// isMainValue: false
// },
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }]
// }
// },
// isForm: true,
// },
{
label: '承运商',
field: 'carrierCode',
@ -142,22 +163,22 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
width: 150
},
},
{
label: '数据来源',
field: 'sourceType',
dictType: DICT_TYPE.PURCHASERECEIPT_SOURCE_TYPE,
sort: 'custom',
table: {
width: 150
},
form: {
value: 'spare_PartsReceipt',
componentProps: {
disabled: true
}
},
isSearch: false,
},
// {
// label: '数据来源',
// field: 'sourceType',
// dictType: DICT_TYPE.PURCHASERECEIPT_SOURCE_TYPE,
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// value: 'spare_PartsReceipt',
// componentProps: {
// disabled: true
// }
// },
// isSearch: false,
// },
{
label: '从仓库代码',
field: 'fromWarehouseCode',
@ -304,50 +325,50 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
},
isForm: false,
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
}
},
// {
// label: '截止时间',
// field: 'dueTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// },
// {
// label: '部门',
// field: 'departmentCode',
// sort: 'custom',
// table: {
// width: 150
// },
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return userDeptArray.find((account) => account.id == cellValue)?.name
// },
// form: {
// value: userDept.id,
// component: 'Select',
// api: () => userDeptArray,
// componentProps: {
// disabled: true,
// optionsAlias: {
// labelField: 'name',
// valueField: 'id'
// }
// }
// }
// },
{
label: '状态',
field: 'status',
@ -477,6 +498,9 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
//表单校验
export const PurchasereceiptRequestMainRules = reactive({
ppNumber: [
{ required: true, message: '请输入采购订单', trigger: 'blur' }
],
supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'blur' }
],
@ -486,9 +510,9 @@ export const PurchasereceiptRequestMainRules = reactive({
toAreaTypes: [
{ required: true, message: '请输入到库区类型范围', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
// departmentCode: [
// { required: true, message: '请输入部门', trigger: 'blur' }
// ],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],

Loading…
Cancel
Save