From efb472b17332b6b091dcda82a50dd80abf39cb32 Mon Sep 17 00:00:00 2001 From: chenfang Date: Tue, 9 Apr 2024 17:56:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=94=9F=E4=BA=A7=E6=97=A5=E6=9C=9F=E4=B8=8E?= =?UTF-8?q?=E7=89=A9=E6=96=99=E6=9C=89=E6=95=88=E6=9C=9F=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=87=BA=E5=A4=B1=E6=95=88=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/formatTime.ts | 8 ++++++++ .../strategy/supplieDeliveryStrategy/AddForm.vue | 6 +++--- .../supplierManage/supplier/supplier.data.ts | 1 + .../supplierdeliverRequestMain/index.vue | 11 ++++++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index e2b0e59a5..64bb9c8b3 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -23,6 +23,14 @@ export function formatDate(date: Date | number, format?: string): string { return dayjs(date).format(format) } +/** + * 获取当前的日期+时间 + */ +export function addDay(date: Date | number,addDay:number) { + return dayjs(date).add(addDay,'day') +} + + /** * 获取当前的日期+时间 */ diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue index 50ce4c375..d0531a644 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue @@ -237,7 +237,7 @@ - + @@ -314,8 +314,8 @@ const rules = ref({ name: [{ required: true, message: '请输入名字', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], description: [{ required: true, message: '请输入描述', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], - PhoneNumber: [{ max: 11, message: '不得超过11个字符', trigger: 'blur' }, - {message: '请输入联系电话', trigger: 'blur' ,validator:validateHanset}] + 'configuration.PhoneNumber': [{ max: 11, message: '不得超过11个字符', trigger: 'blur' }, + {message: '请输入正确格式的电话', trigger: 'blur' ,validator:validateHanset}] }) // 所有的范围类型 diff --git a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts index cea87d094..e08c9a14d 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts +++ b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts @@ -300,6 +300,7 @@ export const SupplierRules = reactive({ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], email: [ + { required: true, message: '请输入邮箱', trigger: 'blur' }, { max: 128, message: '不得超过128个字符', trigger: 'blur' }, { validator:validateEmail, message: '请输入正确的邮箱格式', trigger: 'blur'} ], diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 218742190..e046b3943 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -116,7 +116,8 @@ import { import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import { formatDate } from '@/utils/formatTime' +import { formatDate,addDay } from '@/utils/formatTime' +import * as itemBasicApi from '@/api/wms/itembasic' // 供应商发货申请 defineOptions({ name: 'SupplierdeliverRequestMain' }) @@ -148,6 +149,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => row['poLine'] = val[0]['poLine'] row['orderQty'] = val[0]['orderQty'] row['uom'] = val[0]['uom'] + itemBasicApi.getItembasicPage({ + code: val[0]['itemCode'] + }).then((res) => { + let cf = addDay(row['produceDate'],res.list[0].validityDays); + row['expireDate'] = cf; + }).catch((err) => { + console.log(err) + }) } } else { const setV = {} From f6311716b0c2035bcd21c3acdc68691843e46ea0 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Tue, 9 Apr 2024 18:05:22 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/sampleCode/index.ts | 4 ++++ src/views/qms/sampleCode/sampleCode.data.ts | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/api/qms/sampleCode/index.ts b/src/api/qms/sampleCode/index.ts index 3f8e22f45..374a97e8a 100644 --- a/src/api/qms/sampleCode/index.ts +++ b/src/api/qms/sampleCode/index.ts @@ -55,3 +55,7 @@ export const exportSampleCode = async (params) => { export const importTemplate = () => { return request.download({ url: '/qms/sample-code/get-import-template' }) } + +export const getSamplingScheme = async () => { + return await request.get({ url: `/qms/sampling-scheme/get-available-list`}) +} diff --git a/src/views/qms/sampleCode/sampleCode.data.ts b/src/views/qms/sampleCode/sampleCode.data.ts index a17eff756..69876648a 100644 --- a/src/views/qms/sampleCode/sampleCode.data.ts +++ b/src/views/qms/sampleCode/sampleCode.data.ts @@ -1,5 +1,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import {getSamplingScheme} from '@/api/qms/sampleCode/index' // 表单校验 export const SampleCodeRules = reactive({ @@ -7,7 +8,7 @@ export const SampleCodeRules = reactive({ batchUpperLimiting: [required], available: [required], }) - +const samplingSchemeList = await getSamplingScheme() export const SampleCode = useCrudSchemas(reactive([ { label: 'id', @@ -21,6 +22,16 @@ export const SampleCode = useCrudSchemas(reactive([ field: 'code', sort: 'custom', isSearch: true, + form: { + component: 'Select', + componentProps: { + options: samplingSchemeList, + optionsAlias: { + labelField: 'description', + valueField: 'code' + }, + } + } }, { label: '批量下限', @@ -84,7 +95,7 @@ export const SampleCode = useCrudSchemas(reactive([ dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 form: { - component: 'SelectV2' + component: 'Select' }, }, { From 684eec1649c599c4a4a3c5ffe10e39a8a21619f7 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Tue, 9 Apr 2024 18:15:00 +0800 Subject: [PATCH 3/4] inpuFocus --- src/components/BasicForm/src/BasicForm.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 77b9adec3..afc1d884d 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -637,6 +637,9 @@ const handleAddTable = () => { } // 输入框聚焦 const inpuFocus = (headerItem, row, index) => { + + emit('inpuFocus', headerItem, row, index) + opensearchTable( headerItem.field, headerItem.tableForm.searchField, From 632d19358386dd4678a5be7702f9d345b53f64af Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Tue, 9 Apr 2024 19:46:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B4=A8=E9=87=8F?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/disposition/defaultButtons.ts | 13 ++ .../supplierdeliverRequestMain/index.vue | 91 ++++++-- .../supplierdeliverRequestMain.data.ts | 204 ++++++++++++------ 3 files changed, 225 insertions(+), 83 deletions(-) diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 998e0a9ac..664d6d47e 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -471,6 +471,19 @@ export function mainListPlanCloBtn(option:any) { }) } +// 主列表-上传质量报告 +export function mainListPlanUploadQualityReportBtn(option:any) { + return __defaultBtnOption(option,{ + label: '上传质量报告', + name: 'mainPlanUploadQualityReport', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + // 主列表-计划流程-提交审批按钮 export function mainListPlanSubBtn(option:any) { return __defaultBtnOption(option,{ diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index e046b3943..6f933f9f5 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -45,6 +45,8 @@ + + @@ -112,12 +126,12 @@ import { SupplierdeliverRequestDetail, SupplierdeliverRequestDetailRules, SupplierdeliverRequestDetailLabel, + UploadQualityReport } from './supplierdeliverRequestMain.data' import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import { formatDate,addDay } from '@/utils/formatTime' -import * as itemBasicApi from '@/api/wms/itembasic' +import { formatDate } from '@/utils/formatTime' // 供应商发货申请 defineOptions({ name: 'SupplierdeliverRequestMain' }) @@ -139,25 +153,28 @@ const planArriveTimeStr = ref() // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { nextTick(() => { + console.log("type:",type) console.log("formField:",formField) if (type == 'tableForm') { // 明细查询页赋值 - row[formField] = val[0][searchField] - if (formField == 'poNumber') { - row['poNumber'] = val[0]['poNumber'] - row['itemCode'] = val[0]['itemCode'] - row['poLine'] = val[0]['poLine'] - row['orderQty'] = val[0]['orderQty'] - row['uom'] = val[0]['uom'] - itemBasicApi.getItembasicPage({ - code: val[0]['itemCode'] - }).then((res) => { - let cf = addDay(row['produceDate'],res.list[0].validityDays); - row['expireDate'] = cf; - }).catch((err) => { - console.log(err) - }) - } + // row[formField] = val[0][searchField] + // if (formField == 'poNumber') { + // row['poNumber'] = val[0]['poNumber'] + // row['itemCode'] = val[0]['itemCode'] + // row['poLine'] = val[0]['poLine'] + // row['orderQty'] = val[0]['orderQty'] + // row['uom'] = val[0]['uom'] + // } + val.forEach(item=>{ + const newRow = {...row} + newRow[formField] = item[searchField] + newRow['poNumber'] = item['poNumber'] + newRow['itemCode'] = item['itemCode'] + newRow['poLine'] = item['poLine'] + newRow['orderQty'] = item['orderQty'] + newRow['uom'] = item['uom'] + tableData.value.push(newRow) + }) } else { const setV = {} setV[formField] = val[0][searchField] @@ -292,6 +309,7 @@ const isShowMainButtonLabel = (row, val) => { const butttondata = (row) => { return [ defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), // 打开 + defaultButtons.mainListPlanUploadQualityReportBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), // 审批通过 defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), // 驳回按钮 @@ -335,7 +353,10 @@ const buttonTableClick = async (val, row) => { } else if (val == 'mainPurPlanClo') { // 关闭 handleClo(row.id) - } else if (val == 'mainPlanSub') { + } else if (val == 'mainPlanUploadQualityReport') { + // 上传质量报告 + handleUploadQualityReport(row.id) + } else if (val == 'mainPlanSub') { // 提交审批 handleSub(row.id) } else if (val == 'mainPlanApp') { @@ -475,6 +496,38 @@ const handleOpe = async (id: number) => { tableObject.loading = false } } +const ploadQualityReportRef = ref() +const ploadQualityReportTableData = ref([]) +/** 上传质量报告 */ +const handleUploadQualityReport = async (id: number) => { + console.log('UploadQualityReport',UploadQualityReport.allSchemas) + // ploadQualityReportRef.value.dialogVisible = true + ploadQualityReportRef.value.open('create', null, null,'上传质量报告')//创建标签页面 createLabel 标题 + const tableFormKeys = {} + UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + ploadQualityReportTableData.value = [tableFormKeys] +} +const handleAddTableUploadQualityReport = ()=>{ + const tableFormKeys = {} + UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + ploadQualityReportTableData.value.push(tableFormKeys) +} +const handleDeleteTableUploadQualityReport = (item, index) => { + ploadQualityReportTableData.value.splice(index, 1) +} + +const submitFormUploadQualityReport = (formType, data) => { + console.log("formType==",formType) + console.log("data==",data) + ploadQualityReportRef.value.dialogVisible = false + // formLabelRef.value.formLoading = false + // formLabelRef.value.dialogVisible = false + +} /** 提交审批按钮操作 */ const handleSub = async (id: number) => { diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts index 1f34ebe5b..e57d5b280 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts @@ -224,20 +224,20 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive( width: 150 }, }, - { - label: '业务类型', - field: 'businessType', - sort: 'custom', - table: { - width: 150 - }, - form: { - value: 'SupplierDeliver', - componentProps: { - disabled: true, - } - } - }, + // { + // label: '业务类型', + // field: 'businessType', + // sort: 'custom', + // table: { + // width: 150 + // }, + // form: { + // value: 'SupplierDeliver', + // componentProps: { + // disabled: true, + // } + // } + // }, { label: '备注', field: 'remark', @@ -322,29 +322,29 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive( }, isForm: false }, - { - label: '部门', - field: 'departmentCode', - sort: 'custom', - table: { - width: 150 - }, - formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - return userDeptArray.find((account) => account.id == cellValue)?.name - }, - form: { - value: userDept.id, - component: 'Select', - api: () => userDeptArray, - componentProps: { - disabled: true, - optionsAlias: { - labelField: 'name', - valueField: 'id' - } - } - } - }, + // { + // label: '部门', + // field: 'departmentCode', + // sort: 'custom', + // table: { + // width: 150 + // }, + // formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + // return userDeptArray.find((account) => account.id == cellValue)?.name + // }, + // form: { + // value: userDept.id, + // component: 'Select', + // api: () => userDeptArray, + // componentProps: { + // disabled: true, + // optionsAlias: { + // labelField: 'name', + // valueField: 'id' + // } + // } + // } + // }, { label: '状态', field: 'status', @@ -528,9 +528,9 @@ export const SupplierdeliverRequestMainRules = reactive({ planArriveTime: [ { required: true, message: '请输入计划到货时间', trigger: 'blur' } ], - departmentCode: [ - { required: true, message: '请输入部门', trigger: 'blur' } - ], + // departmentCode: [ + // { required: true, message: '请输入部门', trigger: 'blur' } + // ], autoCommit: [ { required: true, message: '请选择是否自动提交', trigger: 'change' } ], @@ -586,19 +586,19 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive { + const reg = /^[_a-zA-Z0-9]+$/; + if (value == '' || value == undefined || value == null) { + callback(); + } else { + if (!reg.test(value)) { + callback(new Error('英文字母、数字或下划线')); + } else { + callback(); + } + } +} //表单校验 export const SupplierdeliverRequestDetailRules = reactive({ // packingNumber: [ @@ -1022,6 +1035,7 @@ export const SupplierdeliverRequestDetailRules = reactive({ batch: [ { required: true, message: '请输入批次', trigger: 'blur' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator: validateBatch, trigger: 'change' } ], produceDate: [ { required: true, message: '请输入生产日期', trigger: 'blur' } @@ -1089,19 +1103,19 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive([ + { + label: '上传质检报告', + field: 'uploadFile', + sort: 'custom', + isTable:false, + isTableForm:false, + form: { + component: 'UploadFile', + componentProps: { + upData:{ + tableId: '', + tableName: '' + }, + limit:1, + } + }, + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isForm:false, + isTableForm:true, + table: { + width: 150, + }, + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + isForm:false, + isTableForm:true, + table: { + width: 150, + }, + }, + { + label: '数量', + field: 'orderQty', + table: { + width: 150 + }, + isForm:false, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 6 + } + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + isForm:false, + table: { + width: 150 + }, + }, ])) \ No newline at end of file