From ec1dcc80f90af1e1497640adf0f29411f0f8b01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Tue, 31 Oct 2023 11:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E5=93=81=E5=9F=BA=E7=A1=80=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itemManage/bom/bom.data.ts | 186 ++++++++++++++ .../basicDataManage/itemManage/bom/index.vue | 4 +- .../itemManage/itembasic/index.vue | 5 +- .../itemManage/itembasic/itembasic.data.ts | 9 +- .../itemManage/itempackaging/index.vue | 4 +- .../itempackaging/itempackaging.data.ts | 226 ++++++++++++++++++ .../itemManage/productionlineitem/index.vue | 7 +- .../productionlineitem.data.ts | 139 +++++++++++ .../itemManage/stdcostprice/index.vue | 5 +- .../stdcostprice/stdcostprice.data.ts | 150 ++++++++++++ 10 files changed, 722 insertions(+), 13 deletions(-) create mode 100644 src/views/wms/basicDataManage/itemManage/bom/bom.data.ts create mode 100644 src/views/wms/basicDataManage/itemManage/itempackaging/itempackaging.data.ts create mode 100644 src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts create mode 100644 src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts diff --git a/src/views/wms/basicDataManage/itemManage/bom/bom.data.ts b/src/views/wms/basicDataManage/itemManage/bom/bom.data.ts new file mode 100644 index 000000000..11757ec81 --- /dev/null +++ b/src/views/wms/basicDataManage/itemManage/bom/bom.data.ts @@ -0,0 +1,186 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 基础物料清单 +*/ +export const Bom = useCrudSchemas(reactive([ + { + label: '父物料代码', + field: 'productItemCode', + isSearch: true, + sort: 'custom', + table: { + width: 150, + fixed: 'left' + } + }, + { + label: '子物料代码', + field: 'componentItemCode', + isSearch: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '子物料计量单位', + field: 'componentUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + sort: 'custom', + isSearch: true, + isTable: true, + table: { + width: 150 + } + }, + { + label: '子物料数量', + field: 'componentQty', + isSearch: true, + sort: 'custom', + form: { + component: 'InputNumber', + }, + table: { + width: 120 + } + }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + table: { + width: 120 + } + }, + { + label: '版本', + field: 'version', + sort: 'custom' + }, + { + label: '层级', + field: 'layer', + sort: 'custom', + // form: { + // component: 'Input', + // componentProps: { + // // focus: ()=>{console.log('111111111111111111111')}, + // modelValue: '11111' + // } + // } + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + sort: 'custom', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + sort: 'custom', + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { label: '备注', field: 'remark', isTable: false }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + +//表单校验 +export const BomRules = reactive({ + productItemCode: [ + { required: true, message: '请输入父物料代码', trigger: 'blur' } + ], + componentItemCode: [ + { required: true, message: '请输入子物料代码', trigger: 'blur' } + ], + componentUom: [ + { required: true, message: '请选择子物料计量单位', trigger: 'change' } + ], + componentQty: [ + { required: true, message: '请输入子物料数量', trigger: 'blur' } + ], + processCode: [ + { required: true, message: '请输入工序代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) \ No newline at end of file diff --git a/src/views/wms/basicDataManage/itemManage/bom/index.vue b/src/views/wms/basicDataManage/itemManage/bom/index.vue index e00911ad7..6d30a8c2f 100644 --- a/src/views/wms/basicDataManage/itemManage/bom/index.vue +++ b/src/views/wms/basicDataManage/itemManage/bom/index.vue @@ -11,6 +11,7 @@ :routeName="routeName" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" + :allSchemas="Bom.allSchemas" /> @@ -68,7 +69,8 @@ import download from '@/utils/download' import * as BomApi from '@/api/wms/bom' import * as ItembasicApi from '@/api/wms/itembasic' import BasicForm from '@/components/BasicForm/src/BasicForm.vue' -import { Bom, BomRules, Itembasic } from '@/utils/disposition/tableColumns' +import { Itembasic } from './../itembasic/itembasic.data' +import { Bom, BomRules } from './bom.data' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue index acc7c34f6..957ed549a 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue @@ -39,7 +39,7 @@ { tableColumns.value = val diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts b/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts index 954d5c9cb..5a9efb432 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts +++ b/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts @@ -5,7 +5,7 @@ const { t } = useI18n() // 国际化 /** * @returns {Array} 基础物料信息 */ -const crudSchemas = reactive([ +export const Itembasic = useCrudSchemas(reactive([ { label: '代码', field: 'code', @@ -397,8 +397,7 @@ const crudSchemas = reactive([ fixed: 'right' }, } -]) - +])) // 表单校验 export const rules = reactive({ code: [ @@ -470,6 +469,4 @@ export const rules = reactive({ expireTime: [ { required: true, message: '请输入失效时间', trigger: 'change' } ], -}) - -export const { allSchemas } = useCrudSchemas(crudSchemas) +}) \ No newline at end of file diff --git a/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue b/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue index b913869c2..b08e0b311 100644 --- a/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itempackaging/index.vue @@ -11,6 +11,7 @@ :routeName="routeName" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" + :allSchemas="Itempackaging.allSchemas" /> @@ -62,7 +63,8 @@ import download from '@/utils/download' import * as ItempackagingApi from '@/api/wms/itempackaging' import * as ItembasicApi from '@/api/wms/itembasic' import BasicForm from '@/components/BasicForm/src/BasicForm.vue' -import { Itempackaging, ItempackagingRules, Itembasic } from '@/utils/disposition/tableColumns' +import { Itembasic } from './../itembasic/itembasic.data' +import { Itempackaging, ItempackagingRules } from './itempackaging.data' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' diff --git a/src/views/wms/basicDataManage/itemManage/itempackaging/itempackaging.data.ts b/src/views/wms/basicDataManage/itemManage/itempackaging/itempackaging.data.ts new file mode 100644 index 000000000..aa0d624b3 --- /dev/null +++ b/src/views/wms/basicDataManage/itemManage/itempackaging/itempackaging.data.ts @@ -0,0 +1,226 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 基础包装信息 + */ +export const Itempackaging = useCrudSchemas(reactive([ + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + table: { + width: 150, + fixed: 'left' + } + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 120 + } + }, + { + label: '包装单位', + field: 'stdPackUnit', + sort: 'custom', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 120 + } + }, + { + label: '包装数量', + field: 'stdPackQty', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代包装单位1', + field: 'altPackUnit1', + sort: 'custom', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isTable: true, + table: { + width: 150 + } + }, + { + label: '替代包装量1', + field: 'altPackQty1', + sort: 'custom', + table: { + width: 130 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代包装量2', + field: 'altPackQty2', + sort: 'custom', + table: { + width: 130 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代包装单位3', + field: 'altPackUnit3', + sort: 'custom', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + isTable: true, + table: { + width: 150 + } + }, + { + label: '替代包装量3', + field: 'altPackQty3', + sort: 'custom', + table: { + width: 130 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '替代包装单位4', + field: 'altPackUnit4', + sort: 'custom', + dictType: DICT_TYPE.PACK_UNIT, + dictClass: 'string', + table: { + width: 150 + } + }, + { + label: '替代包装量4', + field: 'altPackQty4', + sort: 'custom', + table: { + width: 130 + }, + form: { + component: 'InputNumber', + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + isForm: false, + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + } + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) + +// 表单校验 +export const ItempackagingRules = reactive({ + itemCode: [{ required: true, message: '物品代码不能为空', trigger: 'blur' }], + uom: [{ required: true, message: '计量单位不能为空', trigger: 'change' }], + stdPackUnit: [{ required: true, message: '包装单位不能为空', trigger: 'change' }], + stdPackQty: [{ required: true, message: '包装数量不能为空', trigger: 'blur' }], + available: [{ required: true, message: '是否可用不能为空', trigger: 'change' }] +}) \ No newline at end of file diff --git a/src/views/wms/basicDataManage/itemManage/productionlineitem/index.vue b/src/views/wms/basicDataManage/itemManage/productionlineitem/index.vue index d0f4663fe..b0dbe8f3c 100644 --- a/src/views/wms/basicDataManage/itemManage/productionlineitem/index.vue +++ b/src/views/wms/basicDataManage/itemManage/productionlineitem/index.vue @@ -11,6 +11,7 @@ :routeName="routeName" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" + :allSchemas="Productionlineitem.allSchemas" /> @@ -64,7 +65,11 @@ import * as ProductionlineitemApi from '@/api/wms/productionlineitem' import * as ItembasicApi from '@/api/wms/itembasic' import * as ProductionLineCodeApi from '@/api/wms/productionline' import BasicForm from '@/components/BasicForm/src/BasicForm.vue' -import { Productionlineitem, ProductionlineitemRules, Itembasic, Productionline, Location } from '@/utils/disposition/tableColumns' +// import { Itembasic, Productionline, Location } from '@/utils/disposition/tableColumns' +import { Itembasic } from './../itembasic/itembasic.data' +import { Productionline } from './../productionline/productionline.data' +import { Location } from './../location/location.data' +import { Productionlineitem, ProductionlineitemRules } from './productionlineitem.data' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' diff --git a/src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts b/src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts new file mode 100644 index 000000000..32bba1525 --- /dev/null +++ b/src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts @@ -0,0 +1,139 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 生产线物料关系 + */ +export const Productionlineitem = useCrudSchemas(reactive([ + { + label: '完工收货库位', + field: 'fgLocationCode', + isSearch: true, + sort: 'custom', + table: { + width: 150, + fixed: 'left' + } + }, + { + label: '产线代码' , + field: 'productionLineCode', + isSearch: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '物品代码', + field: 'itemCode', + isSearch: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + sort: 'custom', + isSearch: true, + isTable: true, + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label:'备注', + field: 'remark', + isTable: false + }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + formatter: dateFormatter, + detail: { + dateFormat : 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + +//表单校验 +export const ProductionlineitemRules = reactive({ + fgLocationCode: [ + { required: true, message: '请输入完工收货库位', trigger: 'blur' } + ], + productionLineCode: [ + { required: true, message: '请输入产线代码', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物品代码', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) \ No newline at end of file diff --git a/src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue b/src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue index 07f3d796b..967a2c9bb 100644 --- a/src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue +++ b/src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue @@ -11,6 +11,7 @@ :routeName="routeName" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" + :allSchemas="Stdcostprice.allSchemas" /> @@ -63,7 +64,9 @@ import * as StdcostpriceApi from '@/api/wms/stdcostprice' import * as SupplierApi from '@/api/wms/supplier' import * as ItembasicApi from '@/api/wms/itembasic' import BasicForm from '@/components/BasicForm/src/BasicForm.vue' -import { Stdcostprice, StdcostpriceRules, Supplier, Itembasic } from '@/utils/disposition/tableColumns' +import { Itembasic } from './../itembasic/itembasic.data' +import { Supplier } from './../supplier/supplier.data' +import { Stdcostprice, StdcostpriceRules } from './stdcostprice.data' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' diff --git a/src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts b/src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts new file mode 100644 index 000000000..3876e6713 --- /dev/null +++ b/src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts @@ -0,0 +1,150 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 基础标准成本价格单 + */ +export const Stdcostprice = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCode', + isSearch: true, + sort: 'custom', + table: { + width: 150, + fixed: 'left' + } + }, + { + label: '物料代码', + field: 'itemCode', + isSearch: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '货币', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + sort: 'custom', + isSearch : true, + isTable : true + }, + { + label: '价格', + field: 'price', + sort: 'custom', + isSearch: true + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 120 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + sort: 'custom', + formatter : dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + } + } + }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + sort: 'custom', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '创建者', + field: 'creator', + isForm: false, + isTable: false + }, + { + label: '备注', + field: 'remark', + isTable: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + +//表单校验 +export const StdcostpriceRules = reactive({ + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请输入物料代码', trigger: 'blur' } + ], + currency: [ + { required: true, message: '请选择货币', trigger: 'change' } + ], + price: [ + { required: true, message: '请输入价格', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) \ No newline at end of file