Browse Source

采购退货申请(新)--铺页面

hella_online_20240815
wangyufei 3 months ago
parent
commit
abd38f40e2
  1. 3
      src/components/BasicForm/src/BasicForm.vue
  2. 1034
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue
  3. 879
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMain.data.ts

3
src/components/BasicForm/src/BasicForm.vue

@ -22,6 +22,9 @@
@onEnter="onEnter" @onEnter="onEnter"
@onFocus="onFocus" @onFocus="onFocus"
> >
<template v-for="name in Object.keys($slots)" :key="name" #[name]>
<slot :name="name"></slot>
</template>
<template #crontab="formSchema1" v-if="fromeWhere == 'countPlan'"> <template #crontab="formSchema1" v-if="fromeWhere == 'countPlan'">
<crontab <crontab
v-model="formSchema1.crontab" v-model="formSchema1.crontab"

1034
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

File diff suppressed because it is too large

879
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMain.data.ts

@ -0,0 +1,879 @@
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'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize: 10,
pageNo: 1,
code: 'PurchaseReturnRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {}
// 获取当前操作人的部门
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]
// 采购收货记录展示列
export const PurchasereceiptRecordMain1 = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
fixed: 'left',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '采购收货记录单号',
field: 'number',
fixed: 'left',
sort: 'custom',
table: {
width: 200
},
isSearch: true
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
table: {
width: 180
},
sortTableDefault: 2,
isSearch: true
},
{
label: '采购订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
}
},
{
label: '批次', // 实际是子表的从批次,为了不影响页面,单独放上面
field: 'fromBatch',
sort: 'custom',
isForm: false,
isTableForm: false,
table: {
width: 150
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
}
},
// {
// label: '包装规格',
// field: 'packUnit',
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '从库位代码',
// field: 'fromLocationCode',
// sort: 'custom',
// table: {
// width: 150
// },
//
// },
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
}
}
])
)
/**
* @returns {Array} 退
*/
export const PurchasereturnRequestMain = 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: '供应商1',
field: 'supplierCode1',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Select',
componentProps: {
options: [{
id:123,
nickname:'供应商'
}],
optionsAlias: {
labelField: 'id',
valueField: 'id'
},
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: 'purchaseReceiptRecordNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '发货单号',
field: 'asnNumber1',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_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',
componentProps: {
options: [{
id:123,
nickname:'供应商'
}],
optionsAlias: {
labelField: 'id',
valueField: 'id'
},
filterable: true,
}
}
},
{
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 PurchasereturnRequestMainRules = reactive({
supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'blur' }
],
dueTime: [
{ required: true, message: '请选择截止时间', trigger: 'blur' }
],
purchaseReceiptRecordNumber: [
{ required: true, message: '请输入采购收货记录单号', trigger: 'blur' }
],
carrierCode: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
],
vehiclePlateNumber: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
fromWarehouseCode: [
{ required: true, message: '请输入从仓库代码', trigger: 'blur' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],
autoAgree: [
{ required: true, message: '请选择是否自动通过', trigger: 'change' }
],
autoExecute: [
{ required: true, message: '请选择是否自动执行', trigger: 'change' }
],
directCreateRecord: [
{ required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
})
/**
* @returns {Array} 退
*/
export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '状态',
field: 'status',
sort: 'custom',
table: {
width: 150
},
tableForm:{
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:{
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:{
disabled:true,
type:'InputNumber',
min:0,
precision: 6
}
},
{
label: '退货原因',
field: 'status',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
// isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true,
type: 'Select',
},
form: {
componentProps:{
disabled:true
}
}
},
{
label: '退货原因描述',
field: 'remark',
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 PurchasereturnRequestDetailRules = reactive({
})
export const PurchasereReturnRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
isTableForm: true,
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true
},
isTableForm: true,
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
isTable:false,
isTableForm: false,
isForm: false
},
// {
// label: '器具号',
// field: 'containerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false
// },
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
disabled:true,
min: 1,
precision: 6
},
},
tableForm: {
disabled:true,
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '从库位代码1',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '生产日期',
field: 'produceDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
disabled:true,
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
tableForm:{
disabled:true,
type:'FormDate',
placeholder: '请选择生产日期',
valueFormat: 'x',
},
},
// {
// label: '替代批次',
// field: 'altBatch',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false
// },
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
tableForm: {
type: 'Select'
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true,
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
disabled: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: true
},
{
label: '包装规格',
field: 'packUnit',
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true
}
},
tableForm:{
disabled:true
},
isTableForm: true,
isForm: true
},
]))
Loading…
Cancel
Save