yufei_wang
2 months ago
4 changed files with 5320 additions and 0 deletions
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,597 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime' |
|||
const { t } = useI18n() // 国际化
|
|||
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' |
|||
import { |
|||
PurchasereceiptRecordDetail, |
|||
PurchasereceiptRecordMain |
|||
} from '../../purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data' |
|||
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' |
|||
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' |
|||
import * as SupplierApi from '@/api/wms/supplier' |
|||
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' |
|||
import * as ItemPackageApi from '@/api/wms/itempackage/index' |
|||
import * as LocationApi from '@/api/wms/location' |
|||
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' |
|||
import * as BalanceApi from '@/api/wms/balance' |
|||
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' |
|||
|
|||
import * as InspectionQ2Api from '@/api/qms/inspectionQ2' |
|||
import { Q2 } from '@/views/qms/inspectionQ2/inspectionQ2.data' |
|||
|
|||
import * as ItembasicApi from '@/api/wms/itembasic' |
|||
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' |
|||
|
|||
let locationList = await LocationApi.selectBusinessTypeOutLocationAll({ |
|||
businessType:'PurchaseReturn', |
|||
isIn:'out' |
|||
}) |
|||
locationList = locationList.list.map(item=>({ |
|||
label :item.code, |
|||
value :item.code |
|||
})) |
|||
|
|||
console.log('locationList',locationList) |
|||
|
|||
|
|||
// 获取当前操作人的部门
|
|||
import { useUserStore } from '@/store/modules/user' |
|||
import { TableColumn } from '@/types/table' |
|||
const userStore = useUserStore() |
|||
const userDept = userStore.userSelfInfo.dept |
|||
// id 转str 否则form回显匹配不到
|
|||
userDept.id = userDept.id.toString() |
|||
const userDeptArray: any = [userDept] |
|||
|
|||
/** |
|||
* @returns {Array} 采购退货申请主表 |
|||
*/ |
|||
export const PurchasereturnRequestMainNew = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '物料代码', |
|||
field: 'itemCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table:{ |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
// labelMessage: '信息提示说明!!!',
|
|||
componentProps: { |
|||
enterSearch:true, |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
|
|||
searchField: 'code', // 查询弹窗赋值字段
|
|||
searchTitle: '物料基础信息', // 查询弹窗标题
|
|||
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
|
|||
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
action: '==', |
|||
isSearch: true, |
|||
isMainValue: false |
|||
}], |
|||
verificationParams: [{ |
|||
key: 'code', |
|||
action: '==', |
|||
value: '', |
|||
isMainValue: false, |
|||
isSearch: 'true', |
|||
isFormModel: true |
|||
}], // 失去焦点校验参数
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '物料名称', |
|||
field: 'itemName', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商', |
|||
field: 'supplierCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: [], |
|||
optionsAlias: { |
|||
labelField: 'supplierCode', |
|||
valueField: 'supplierCode' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'supplierName', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180, |
|||
}, |
|||
isForm: true, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: ' ', |
|||
field: 'hahaha', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
isTable:false, |
|||
isDetail:false, |
|||
form: { |
|||
componentProps: { |
|||
type: 'slot', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: ' ', |
|||
field: 'hehehe', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
isTable:false, |
|||
isDetail:false, |
|||
form: { |
|||
componentProps: { |
|||
type: 'slot', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '采购订单号', |
|||
field: 'poNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '采购订单行', |
|||
field: 'poLine', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '收货单号', |
|||
field: 'receiptNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '发货单号', |
|||
field: 'asnNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
dictType: DICT_TYPE.INVENTORY_STATUS, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
isForm: false, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
sortTableDefault: 1, |
|||
form: { |
|||
value: '1', |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '退货库位', |
|||
field: 'locationCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
value:locationList[0]['value'], |
|||
componentProps: { |
|||
options: locationList |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: 'Q2通知单号', |
|||
field: 'q2Number', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isDetail: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
// labelMessage: '信息提示说明!!!',
|
|||
componentProps: { |
|||
enterSearch: true, |
|||
// multiple: true,
|
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择Q2通知单号', // 输入框占位文本
|
|||
searchField: 'number', // 查询弹窗赋值字段
|
|||
searchTitle: 'Q2通知单号', // 查询弹窗标题
|
|||
searchAllSchemas: Q2.allSchemas, // 查询弹窗所需类
|
|||
searchPage: InspectionQ2Api.getQ2Page, // 查询弹窗所需分页方法
|
|||
searchCondition: [ |
|||
{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
isMainValue: false |
|||
}, |
|||
{ |
|||
key: 'status', |
|||
value: '0', |
|||
isMainValue: false |
|||
}, |
|||
{ |
|||
key: 'supplierCode', |
|||
value: 'supplierCode', |
|||
isMainValue: true |
|||
} |
|||
], |
|||
verificationParams: [ |
|||
{ |
|||
key: 'number', |
|||
action: '==', |
|||
value: '', |
|||
isMainValue: false, |
|||
isSearch: true, |
|||
isFormModel: true |
|||
} |
|||
] // 失去焦点校验参数
|
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isDetail: false, |
|||
isForm: false, |
|||
table: { |
|||
width: 300, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
//表单校验
|
|||
export const PurchasereturnRequestMainRulesNew = reactive({ |
|||
itemCode: [ |
|||
{ required: true, message: '请输入供应商代码', trigger: 'blur' } |
|||
], |
|||
supplierCode: [ |
|||
{ required: true, message: '请输入供应商代码', trigger: 'blur' } |
|||
], |
|||
poNumber: [ |
|||
{ required: true, message: '请选择采购订单号', trigger: 'blur' } |
|||
], |
|||
poLine: [ |
|||
{ required: true, message: '请选择订单行', trigger: 'blur' } |
|||
], |
|||
locationCode: [ |
|||
{ required: true, message: '请选择收货单明细', trigger: 'blur' } |
|||
] |
|||
}) |
|||
|
|||
export const PurchasereturnPurchasereceiptRecordNew = useCrudSchemas( |
|||
reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '收货日期', |
|||
field: 'currentDeliveryDate', |
|||
isTable: true, |
|||
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: 'receiptNumber', |
|||
sort: 'custom', |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '发货单号', |
|||
field: 'asnNumber', |
|||
sort: 'custom', |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '订单号', |
|||
field: 'poNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '订单行', |
|||
field: 'poLine', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '批次', |
|||
field: 'batch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'qty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
} |
|||
]) |
|||
) |
|||
|
|||
|
|||
|
|||
/** |
|||
* @returns {Array} 采购退货申请子表 |
|||
*/ |
|||
export const PurchasereturnRequestDetailNew = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '批次', |
|||
field: 'batch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'inventoryStatus', |
|||
dictType: DICT_TYPE.INVENTORY_STATUS, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
type: 'Select', |
|||
disabled:true |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '隔离库存数量', |
|||
field: 'inventoryBalance', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
componentProps: { |
|||
disabled: true, |
|||
min: 0, |
|||
precision: 6 |
|||
} |
|||
}, |
|||
tableForm:{ |
|||
disabled:true, |
|||
hidden:false,//控制列是否展示
|
|||
type:'InputNumber', |
|||
min:0, |
|||
precision: 6 |
|||
}, |
|||
hiddenInMain: true, |
|||
isTable: false, |
|||
isDetail: false, |
|||
}, |
|||
{ |
|||
label: '退货数量', |
|||
field: 'qty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
componentProps: { |
|||
min: 0, |
|||
precision: 6, |
|||
disabled:false |
|||
} |
|||
}, |
|||
isTable:false, |
|||
isTableForm:true, |
|||
tableForm:{ |
|||
type:'InputNumber', |
|||
min:0, |
|||
precision: 6 |
|||
} |
|||
}, |
|||
{ |
|||
label: '退货原因', |
|||
field: 'reasonType', |
|||
dictType: DICT_TYPE.RETURN_REASON_TYPE, |
|||
dictClass: 'string', |
|||
// isSearch: true,
|
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
type: 'Select', |
|||
}, |
|||
form: { |
|||
componentProps:{ |
|||
disabled:true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '退货原因描述', |
|||
field: 'reason', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isTable: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
hiddenInMain:true, |
|||
field: 'action', |
|||
isDetail: false, |
|||
isForm: false , |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
}, |
|||
isTableForm:false, |
|||
} |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const PurchasereturnRequestDetailRulesNew = reactive({ |
|||
}) |
|||
|
|||
|
Loading…
Reference in new issue