From c5a5643302b866bcf6fd5a35f4811d6cb09f9f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=83=9C=E6=A5=A0?= <2792649152@qq.com> Date: Thu, 9 Nov 2023 10:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionplan/workMain/index.vue | 14 +- .../productionplan/workMain/workMain.data.ts | 134 ++++++++++++++---- 2 files changed, 107 insertions(+), 41 deletions(-) diff --git a/src/views/wms/productionManage/productionplan/workMain/index.vue b/src/views/wms/productionManage/productionplan/workMain/index.vue index 1bc3c3673..fd1f7cd97 100644 --- a/src/views/wms/productionManage/productionplan/workMain/index.vue +++ b/src/views/wms/productionManage/productionplan/workMain/index.vue @@ -44,7 +44,6 @@ @success="getList" :rules="WorkMainRules" :formAllSchemas="WorkMain.allSchemas" - :searchTableParams="searchTableParams" :tableAllSchemas="WorkDetail.allSchemas" :tableFormRules="WorkDetailRules" :tableData="tableData" @@ -64,7 +63,6 @@ :allSchemas="WorkMain.allSchemas" :detailAllSchemas="WorkDetail.allSchemas" :detailAllSchemasRules="WorkDetailRules" - :searchTableParams="searchTableParams" :apiCreate="WorkDetailApi.createWorkDetail" :apiUpdate="WorkDetailApi.updateWorkDetail" :apiPage="WorkDetailApi.getWorkDetailPage" @@ -99,22 +97,12 @@ const updataTableColumns = (val) => { tableColumns.value = val } -// 查询列表页面参数设置 -const searchTableParams = ref([ -//{ -// formField: 'productItemCode', -// searchTableTitle: '物料信息', -// searchTableAllSchemas: Itembasic.allSchemas, -// searchTablePage: ItembasicApi.getItembasicPage -//} -]) - // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { if (type == 'tableForm') { // 明细查询页赋值 - //row[formField] = val[0][searchField] + row[formField] = val[0][searchField] //row['poLine'] = val[0]['poLine'] //row['batch'] = val[0]['toBatch'] //row['altBatch'] = val[0]['altBatch'] diff --git a/src/views/wms/productionManage/productionplan/workMain/workMain.data.ts b/src/views/wms/productionManage/productionplan/workMain/workMain.data.ts index cae3ed8ef..1a593714a 100644 --- a/src/views/wms/productionManage/productionplan/workMain/workMain.data.ts +++ b/src/views/wms/productionManage/productionplan/workMain/workMain.data.ts @@ -1,6 +1,9 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import { fa } from 'element-plus/es/locale' +import * as CustomerApi from '@/api/wms/customer' +import { Customer } from '@/views/wms/basicDataManage/customerManage/customer/customer.data' +import * as ItembasicApi from '@/api/wms/itembasic' +import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' const { t } = useI18n() // 国际化 /** @@ -8,12 +11,31 @@ const { t } = useI18n() // 国际化 */ export const WorkMain = useCrudSchemas(reactive([ { - label: '供应商代码', + label: '客户代码', field: 'customerCode', sort: 'custom', table: { width: 150 }, + tableForm:{ + isInpuFocusShow: true, + searchListPlaceholder: '请选择客户代码', + searchField: 'code', + searchTitle: '客户信息', + searchAllSchemas: Customer.allSchemas, + searchPage: CustomerApi.getCustomerPage + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选择客户代码', + searchField: 'code', + searchTitle: '客户信息', + searchAllSchemas: Customer.allSchemas, + searchPage: CustomerApi.getCustomerPage + } + } }, { label: '订单类型', @@ -26,6 +48,7 @@ export const WorkMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false, }, { label: '订单日期', @@ -74,6 +97,7 @@ export const WorkMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false, }, { label: '单据号', @@ -176,6 +200,7 @@ export const WorkMain = useCrudSchemas(reactive([ table: { width: 150 }, + isForm: false, }, { label: '是否可用', @@ -210,27 +235,27 @@ export const WorkMainRules = reactive({ customerCode: [ { required: true, message: '请选择客户代码', trigger: 'change' } ], - type: [ - { required: true, message: '请选择订单类型', trigger: 'change' } - ], + // type: [ + // { required: true, message: '请选择订单类型', trigger: 'change' } + // ], orderDate: [ - { required: true, message: '请输入订单日期', trigger: 'change' } + { required: true, message: '请选择订单日期', trigger: 'change' } ], available: [ { required: true, message: '请选择是否可用', trigger: 'change' } ], - createTime: [ - { required: true, message: '请输入创建时间', trigger: 'blur' } - ], - creator: [ - { required: true, message: '请输入创建者', trigger: 'blur' } - ], - number: [ - { required: true, message: '请输入单据号', trigger: 'blur' } - ], - businessType: [ - { required: true, message: '请输入业务类型', trigger: 'blur' } - ], + // createTime: [ + // { required: true, message: '请输入创建时间', trigger: 'blur' } + // ], + // creator: [ + // { required: true, message: '请输入创建者', trigger: 'blur' } + // ], + // number: [ + // { required: true, message: '请输入单据号', trigger: 'blur' } + // ], + // businessType: [ + // { required: true, message: '请输入业务类型', trigger: 'blur' } + // ], }) /** @@ -244,6 +269,8 @@ export const WorkDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false }, { label: '项目代码', @@ -252,6 +279,8 @@ export const WorkDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false }, { label: '完工数量', @@ -262,7 +291,18 @@ export const WorkDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', - } + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type:'InputNumber', + min: 1, + precision: 6 + }, + isTableForm: false, + isForm: false }, { label: '单据号', @@ -272,6 +312,11 @@ export const WorkDetail = useCrudSchemas(reactive([ width: 150 }, isTableForm: false, + form: { + componentProps: { + disabled: true + } + } }, { label: '物品代码', @@ -280,6 +325,25 @@ export const WorkDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm:{ + isInpuFocusShow: true, + searchListPlaceholder: '请选择物品代码', + searchField: 'code', + searchTitle: '物品基础信息', + searchAllSchemas: Itembasic.allSchemas, + searchPage: ItembasicApi.getItembasicPage + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选择物品代码', + searchField: 'code', + searchTitle: '物品基础信息', + searchAllSchemas: Itembasic.allSchemas, + searchPage: ItembasicApi.getItembasicPage + } + } }, { label: '备注', @@ -330,12 +394,21 @@ export const WorkDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', - } + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type:'InputNumber', + min: 1, + precision: 6 + }, }, { label: '计量单位', field: 'uom', - dictType: DICT_TYPE.TRUE_FALSE, + dictType: DICT_TYPE.UOM, dictClass: 'string', isSearch: true, isTable: true, @@ -343,6 +416,9 @@ export const WorkDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + type: 'Select' + } }, { label: '最后更新时间', @@ -394,7 +470,9 @@ export const WorkDetail = useCrudSchemas(reactive([ inactiveValue: 'FALSE', activeValue: 'TRUE' } - } + }, + isTableForm: false, + isForm: false }, { label: '操作', @@ -411,12 +489,12 @@ export const WorkDetail = useCrudSchemas(reactive([ //表单校验 export const WorkDetailRules = reactive({ - lineNumber: [ - { required: true, message: '请输入行号', trigger: 'change' } - ], - available: [ - { required: true, message: '请选择是否可用', trigger: 'change' } - ], + // lineNumber: [ + // { required: true, message: '请输入行号', trigger: 'change' } + // ], + // available: [ + // { required: true, message: '请选择是否可用', trigger: 'change' } + // ], uom: [ { required: true, message: '请选择计量单位', trigger: 'change' } ],