Browse Source

创建标签功能

master
陈薪名 11 months ago
parent
commit
09a46bc3d3
  1. 75
      src/views/wms/basicDataManage/labelManage/manufacturePackage/index.vue
  2. 395
      src/views/wms/basicDataManage/labelManage/manufacturePackage/manufacturePackage.data.ts
  3. 67
      src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue
  4. 543
      src/views/wms/basicDataManage/labelManage/purchasePackage/purchasePackage.data.ts

75
src/views/wms/basicDataManage/labelManage/manufacturePackage/index.vue

@ -41,12 +41,11 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="getList" @success="formsSuccess"
:rules="PackageRules" :rules="PackageRulesInventor"
:formAllSchemas="Package.allSchemas" :formAllSchemas="PackageInventory.allSchemas"
:searchTableParams="searchTableParams" :apiUpdate="PackageApi.updatePackage"
:apiUpdate="BarbasicApi.updateBarbasic" :apiCreate="PackageApi.createPackageLabel"
:apiCreate="BarbasicApi.createBarbasic"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
/> />
@ -61,12 +60,15 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { Package,PackageRules } from './manufacturePackage.data' import { Package,PackageRules,PackageInventory,PackageRulesInventor } from './manufacturePackage.data'
import * as BarbasicApi from '@/api/wms/barbasic' import * as BarbasicApi from '@/api/wms/barbasic'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PackageApi from '@/api/wms/package'
import { formatTime } from '@/utils/index'
import * as Itempackaging from '@/api/wms/itempackaging'
// //
defineOptions({ name: 'ManufacturePackage' }) defineOptions({ name: 'PurchasePackage' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -76,6 +78,7 @@ const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(Package.allSchemas.tableColumns) const tableColumns = ref(Package.allSchemas.tableColumns)
/** /**
* PurchasePackage type = PurchaseLabel 采购件标签记录页面 * PurchasePackage type = PurchaseLabel 采购件标签记录页面
* ManufacturePackage type = MakeLabel 制造件标签记录页面 * ManufacturePackage type = MakeLabel 制造件标签记录页面
@ -89,15 +92,27 @@ const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
//
const searchTableParams = ref([
])
// //
const searchTableSuccess = (formField, searchField, val, basicFormRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, basicFormRef, type, row ) => {
nextTick(() => { nextTick(async () => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if (formField == 'itemCode') {
setV['itemCode'] = val[0]['code']
setV['itemName'] = val[0]['name']
setV['itemDesc1'] = val[0]['desc1']
setV['itemDesc2'] = val[0]['desc2']
await Itempackaging.getItempackagingPage({
itemCode: val[0]['code']
}).then(res => {
if (res) {
if (res.list.length > 0) {
setV['stdPackQty'] = res.list[0].stdPackQty
setV['stdPackUnit'] = res.list[0].stdPackUnit
}
}
})
}
basicFormRef.setValues(setV) basicFormRef.setValues(setV)
}) })
} }
@ -111,7 +126,7 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), // defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:package:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:package:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
@ -175,14 +190,19 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if (val == 'point') { // } else if (val == 'point') { //
handlePoint(row.relateNumber) handlePoint(row)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm =async (type: string, row?: number) => { const openForm = (type: string, row?: number) => {
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
if (type == 'create') {
nextTick(() => {
basicFormRef.value.formRef.formModel.batch = formatTime(new Date(), 'yyyyMMdd')
})
}
} }
/** 详情操作 */ /** 详情操作 */
@ -213,7 +233,7 @@ const handleExport = async () => {
// //
exportLoading.value = true exportLoading.value = true
const data = await BarbasicApi.exportBarbasic(tableObject.params) const data = await BarbasicApi.exportBarbasic(tableObject.params)
download.excel(data, '制造件标签.xlsx') download.excel(data, '采购件标签.xlsx')
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -221,10 +241,23 @@ const handleExport = async () => {
} }
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/899811206721347584?token=' + getAccessToken()) const src = ref(BASE_URL + '/jmreport/view/899807302088564736?token=' + getAccessToken())
// //
const handlePoint = async (number) => { const handlePoint = async (row) => {
window.open(src.value+'&number='+number) window.open(src.value+'&number='+row.relateNumber)
}
// form
const formsSuccess = async (formType,data) => {
if (formType === 'create') {
await PackageApi.createPackageLabel(data)
message.success(t('common.createSuccess'))
} else {
await PackageApi.updatePackage(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
} }
/** 导入 */ /** 导入 */

395
src/views/wms/basicDataManage/labelManage/manufacturePackage/manufacturePackage.data.ts

@ -1,6 +1,15 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { Itembasic } from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
import * as ItembasicApi from "@/api/wms/itembasic";
import { Productionline } from "@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data";
import * as ProductionlineApi from "@/api/wms/productionline";
import { Shift } from "@/views/wms/basicDataManage/orderManage/shift/shift.data";
import * as ShiftApi from "@/api/wms/shift";
import { Team } from "@/views/wms/basicDataManage/orderManage/team/team.data";
import * as TeamApi from "@/api/wms/team";
// 表单校验 // 表单校验
export const PackageRules = reactive({ export const PackageRules = reactive({
number: [required], number: [required],
@ -102,3 +111,389 @@ export const Package = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
])) ]))
export const PackageInventory = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择物品代码',
searchField: 'code',
searchTitle: '物品信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.getItembasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '替代批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
table: {
width: 180,
},
},
{
label: '有效期(日)',
field: 'validityDays',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 0
},
value: 0
},
table: {
width: 150,
},
},
{
label: '失效日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
table: {
width: 180,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
},
value: 0
},
},
{
label: '替代计量单位',
field: 'altUom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
table: {
width: 150,
},
},
{
label: '替代数量',
field: 'altQty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
},
value: 0
},
},
{
label: '转换率',
field: 'convertRate',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '标包数量',
field: 'stdPackQty',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps:{
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '标包单位',
field: 'stdPackUnit',
sort: 'custom',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
table: {
width: 150,
},
form: {
component: 'Select',
componentProps:{
disabled: true
}
},
tableForm: {
disabled: true
}
},
// {
// label: '生产订单号',
// field: 'woNumber',
// sort: 'custom',
// table: {
// width: 150,
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择物品代码',
// searchField: 'code',
// searchTitle: '物品信息',
// searchAllSchemas: Itembasic.allSchemas,
// searchPage: ItembasicApi.getItembasicPage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// }
// },
// {
// label: '生产订单行',
// field: 'woLine',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
{
label: '生产线代码',
field: 'productionLineCodePackage',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '班组代码',
field: 'teamCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Team.allSchemas,
searchPage: TeamApi.getTeamPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '班次代码',
field: 'shiftCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Shift.allSchemas,
searchPage: ShiftApi.getShiftPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
//表单校验
export const PackageRulesInventor = reactive({
itemCode: [
{ required: true, message: '请选择物品代码', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
produceDate: [
{ required: true, message: '请选择生产日期', trigger: 'change' }
],
validityDays: [
{ required: true, message: '请输入有效期(日)', trigger: 'blur' }
],
expireDate: [
{ required: true, message: '请选择失效日期', trigger: 'change' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
qty: [
{ required: true, message: '请输入数量', trigger: 'blur' }
],
woNumber: [
{ required: true, message: '请选择生产订单号', trigger: 'change' }
],
woLine: [
{ required: true, message: '请选择生产订单行', trigger: 'change' }
],
productionLineCodePackage: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
})

67
src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue

@ -41,12 +41,11 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="getList" @success="formsSuccess"
:rules="PackageRules" :rules="PackageRulesInventor"
:formAllSchemas="Package.allSchemas" :formAllSchemas="PackageInventory.allSchemas"
:searchTableParams="searchTableParams" :apiUpdate="PackageApi.updatePackage"
:apiUpdate="BarbasicApi.updateBarbasic" :apiCreate="PackageApi.createPackageLabel"
:apiCreate="BarbasicApi.createBarbasic"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
/> />
@ -61,9 +60,12 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { Package,PackageRules } from './purchasePackage.data' import { Package,PackageRules,PackageInventory,PackageRulesInventor } from './purchasePackage.data'
import * as BarbasicApi from '@/api/wms/barbasic' import * as BarbasicApi from '@/api/wms/barbasic'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PackageApi from '@/api/wms/package'
import { formatTime } from '@/utils/index'
import * as Itempackaging from '@/api/wms/itempackaging'
// //
defineOptions({ name: 'PurchasePackage' }) defineOptions({ name: 'PurchasePackage' })
@ -90,22 +92,27 @@ const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
// //
const searchTableSuccess = (formField, searchField, val, basicFormRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, basicFormRef, type, row ) => {
nextTick(() => { nextTick(async () => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if (formField == 'itemCode') {
setV['itemCode'] = val[0]['code']
setV['itemName'] = val[0]['name']
setV['itemDesc1'] = val[0]['desc1']
setV['itemDesc2'] = val[0]['desc2']
await Itempackaging.getItempackagingPage({
itemCode: val[0]['code']
}).then(res => {
if (res) {
if (res.list.length > 0) {
setV['stdPackQty'] = res.list[0].stdPackQty
setV['stdPackUnit'] = res.list[0].stdPackUnit
}
}
})
}
basicFormRef.setValues(setV) basicFormRef.setValues(setV)
}) })
} }
@ -119,7 +126,7 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), // defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:package:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:package:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
@ -189,8 +196,13 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm =async (type: string, row?: number) => { const openForm = (type: string, row?: number) => {
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
if (type == 'create') {
nextTick(() => {
basicFormRef.value.formRef.formModel.batch = formatTime(new Date(), 'yyyyMMdd')
})
}
} }
/** 详情操作 */ /** 详情操作 */
@ -235,6 +247,19 @@ const handlePoint = async (row) => {
window.open(src.value+'&number='+row.relateNumber) window.open(src.value+'&number='+row.relateNumber)
} }
// form
const formsSuccess = async (formType,data) => {
if (formType === 'create') {
await PackageApi.createPackageLabel(data)
message.success(t('common.createSuccess'))
} else {
await PackageApi.updatePackage(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 导入 */ /** 导入 */
const importFormRef = ref() const importFormRef = ref()
const handleImport = () => { const handleImport = () => {

543
src/views/wms/basicDataManage/labelManage/purchasePackage/purchasePackage.data.ts

@ -1,6 +1,25 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { Itembasic } from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
import * as ItembasicApi from "@/api/wms/itembasic";
import { Warehouse } from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WarehouseApi from "@/api/wms/warehouse";
import { Dock } from "@/views/wms/basicDataManage/factoryModeling/dock/dock.data";
import * as DockApi from "@/api/wms/dock";
import { Location } from "@/views/wms/basicDataManage/factoryModeling/location/location.data";
import * as LocationApi from "@/api/wms/location";
import { Supplier } from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data";
import * as SupplierApi from "@/api/wms/supplier";
import { PurchaseMain } from "@/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data";
import * as PurchaseMainApi from "@/api/wms/purchaseMain";
import { PurchaseDetail } from "@/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data";
import * as PurchaseDetailApi from "@/api/wms/purchaseDetail";
import { PurchasePlanMain } from "@/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data";
import * as PurchasePlanMainApi from "@/api/wms/purchasePlanMain";
import { SupplierdeliverRecordMain } from "@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/supplierdeliverRecordMain.data";
import * as SupplierdeliverRecordMainApi from "@/api/wms/supplierdeliverRecordMain";
// 表单校验 // 表单校验
export const PackageRules = reactive({ export const PackageRules = reactive({
number: [required], number: [required],
@ -101,3 +120,527 @@ export const Package = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
])) ]))
export const PackageInventory = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择物品代码',
searchField: 'code',
searchTitle: '物品信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.getItembasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '替代批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
table: {
width: 180,
},
},
{
label: '有效期(日)',
field: 'validityDays',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 0
},
value: 0
},
table: {
width: 150,
},
},
{
label: '失效日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
table: {
width: 180,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
},
value: 0
},
},
{
label: '替代计量单位',
field: 'altUom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
table: {
width: 150,
},
},
{
label: '替代数量',
field: 'altQty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
},
value: 0
},
},
{
label: '转换率',
field: 'convertRate',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '标包数量',
field: 'stdPackQty',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps:{
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '标包单位',
field: 'stdPackUnit',
sort: 'custom',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
table: {
width: 150,
},
form: {
component: 'Select',
componentProps:{
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择仓库代码',
searchField: 'code',
searchTitle: '仓库信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '月台代码',
field: 'toDockCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择仓库代码',
searchField: 'code',
searchTitle: '仓库信息',
searchAllSchemas: Dock.allSchemas,
searchPage: DockApi.getDockPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.getLocationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择供应商代码',
searchField: 'code',
searchTitle: '供应商信息',
searchAllSchemas: Supplier.allSchemas,
searchPage: SupplierApi.getSupplierPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '供应商物品代码',
field: 'supplierItemCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '采购订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择采购订单号',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [
{
key: 'supplierCode',
value: 'supplierCode',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '采购订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择采购订单行',
searchField: 'lineNumber',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseDetail.allSchemas,
searchPage: PurchaseDetailApi.getPurchaseDetailPage,
searchCondition: [
{
key: 'number',
value: 'poNumber',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '采购计划单号',
field: 'rpNumber',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择采购订单号',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchasePlanMain.allSchemas,
searchPage: PurchasePlanMainApi.getPurchasePlanMainPage,
searchCondition: [
{
key: 'supplierCode',
value: 'supplierCode',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
table: {
width: 182,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择发货单号',
searchField: 'asnNumber',
searchTitle: '发货信息',
searchAllSchemas: SupplierdeliverRecordMain.allSchemas,
searchPage: SupplierdeliverRecordMainApi.getSupplierdeliverRecordMainPage,
searchCondition: [
{
key: 'supplierCode',
value: 'supplierCode',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
//表单校验
export const PackageRulesInventor = reactive({
itemCode: [
{ required: true, message: '请选择物品代码', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
produceDate: [
{ required: true, message: '请选择生产日期', trigger: 'change' }
],
validityDays: [
{ required: true, message: '请输入有效期(日)', trigger: 'blur' }
],
expireDate: [
{ required: true, message: '请选择失效日期', trigger: 'change' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
qty: [
{ required: true, message: '请输入数量', trigger: 'blur' }
],
toWarehouseCode: [
{ required: true, message: '请选择仓库代码', trigger: 'change' }
],
toDockCode: [
{ required: true, message: '请选择月台代码', trigger: 'change' }
],
toLocationCode: [
{ required: true, message: '请选择库位代码', trigger: 'change' }
],
supplierCode: [
{ required: true, message: '请选择供应商代码', trigger: 'change' }
],
supplierItemCode: [
{ required: true, message: '请选择供应商物品代码', trigger: 'change' }
],
poNumber: [
{ required: true, message: '请选择采购订单号', trigger: 'change' }
],
poLine: [
{ required: true, message: '请选择采购订单行', trigger: 'change' }
],
rpNumber: [
{ required: true, message: '请选择采购计划单号', trigger: 'change' }
],
asnNumber: [
{ required: true, message: '请选择发货单号', trigger: 'change' }
],
})
Loading…
Cancel
Save