From d2a5f2d7bf5844cf8505d767479acf57b1887ec6 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 2 Dec 2024 18:29:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 17 -- src/views/user/goodsManagement/index.vue | 350 ++++------------------- 2 files changed, 54 insertions(+), 313 deletions(-) diff --git a/components.d.ts b/components.d.ts index f759a60..a90f044 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,38 +8,21 @@ export {} declare module 'vue' { export interface GlobalComponents { Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default'] - ElBadge: typeof import('element-plus/es')['ElBadge'] - ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] - ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] - ElCarousel: typeof import('element-plus/es')['ElCarousel'] - ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] ElCascader: typeof import('element-plus/es')['ElCascader'] - ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] - ElCol: typeof import('element-plus/es')['ElCol'] - ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] - ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] - ElHeader: typeof import('element-plus/es')['ElHeader'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] - ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] - ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] - ElProgress: typeof import('element-plus/es')['ElProgress'] - ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] - ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElSelect: typeof import('element-plus/es')['ElSelect'] - ElStep: typeof import('element-plus/es')['ElStep'] - ElSteps: typeof import('element-plus/es')['ElSteps'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTag: typeof import('element-plus/es')['ElTag'] diff --git a/src/views/user/goodsManagement/index.vue b/src/views/user/goodsManagement/index.vue index 44cae40..b4ec803 100644 --- a/src/views/user/goodsManagement/index.vue +++ b/src/views/user/goodsManagement/index.vue @@ -138,191 +138,6 @@ const equipmentDeployment = () => { person: '', personPhone: '', deviceWeight: '', - }) - //编码类型禁止修改数目 - const countDisabled = ref(false) - //装备类目-change - const dialogTypeCascader = ref() - //装备类目-change - const dialogTypeChange = () => { - const deviceTypeList = dialogTypeCascader.value.getCheckedNodes() - console.log(deviceTypeList) - equipmentDeploymentParams.value.unitName = deviceTypeList[0].data.unitName - let manageType = deviceTypeList[0].data.manageType - if(manageType=='1'){//数量 - equipmentDeploymentParams.value.deviceCount=1 - countDisabled.value=false - }else if(manageType=='0'){//编码 - equipmentDeploymentParams.value.deviceCount=1 - countDisabled.value=true - } - } - //获取所属公司下拉数据 - const getCompanyList = async () => { - const res: any = await getCompanyListApi() - console.log(res, '列表数据**--**') - companyDataList.value = res.data - } - // 装备弹框显示隐藏 - const dialogFormVisibleSettlein: any = ref(false) - const ruleFormRef: any = ref(null) - //表单校验规则 - const equipRules = ref({ - deviceName: [ - { - required: true, - message: '请输入装备名称', - trigger: 'blur' - } - ], - deviceTypeList: [ - { - required: true, - message: '请选择装备类目', - trigger: 'change' - } - ], - deviceCount: [ - { - required: true, - message: '请输入装备数量', - trigger: 'blur' - } - ], - brand: [ - { - required: true, - message: '请输入装备品牌', - trigger: 'blur' - } - ], - code: [ - { - required: true, - message: '请输入装备编号', - trigger: 'change' - } - ], - companyId: [ - { - required: true, - message: '请选择所属公司', - trigger: 'change' - } - ], - productionDate: [ - { - required: true, - message: '请选择出厂日期', - trigger: 'change' - } - ], - dayLeasePrice: [ - { - required: true, - message: '请输入日租金', - trigger: 'blur' - } - ], - person: [ - { required: true, message: "联系人不能为空", trigger: "blur" } - ], - personPhone: [ - { required: true, message: "联系电话不能为空", trigger: "blur" }, - { - pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, - message: "请输入正确的手机号码", - trigger: "blur" - } - ], - // deviceWeight: [// - // { required: true, message: "整机重量不能为空", trigger: "blur" } - // ], - }) - // 弹框保存提交 - const submitBtn = () => { - ruleFormRef.value.validate(async (valid: any) => { - if (valid) { - if (equipmentDeploymentParams.value.deviceTypeList&&equipmentDeploymentParams.value.deviceTypeList.length > 0) { - equipmentDeploymentParams.value.typeId = equipmentDeploymentParams.value.deviceTypeList[3] - } else { - equipmentDeploymentParams.value.typeId = "" - } - if(mainFileList.value.length==0||mainFileList.value.length>6){ - ElMessage({type: 'error',message: '主展示图不得少于1张,不得多于6张'}) - return - } - if(detailsFileList.value.length==0||detailsFileList.value.length>6){ - ElMessage({type: 'error',message: '详情展示图不得少于1张,不得多于6张'}) - return - } - let param = { - ...equipmentDeploymentParams.value, - mainFileList:mainFileList.value,//主展示 - detailsFileList:detailsFileList.value,//详情展示 - insurancePdf:insurancePdf.value,//合格证 - examinationPdf:examinationPdf.value,//检测证明 - } - const res: any = await equipmentAddApi(param) - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '保存成功' - }) - dialogFormVisibleSettlein.value = false - // ruleFormRef.value.resetField() - getList() - } - } - }) - } - //草稿 - const saveTemp = async() => { - if (equipmentDeploymentParams.value.deviceTypeList&&equipmentDeploymentParams.value.deviceTypeList.length > 0) { - equipmentDeploymentParams.value.typeId = equipmentDeploymentParams.value.deviceTypeList[3] - } else { - equipmentDeploymentParams.value.typeId = "" - } - if(equipmentDeploymentParams.value.deviceName==""||equipmentDeploymentParams.value.companyId==""){ - ElMessage({type: 'error',message: '保存草稿请至少填写装备名称及所属公司!'}) - return - } - // if(mainFileList.value.length==0||mainFileList.value.length>6){ - // ElMessage({type: 'error',message: '主展示图不得少于1张,不得多于6张'}) - // return - // } - // if(detailsFileList.value.length==0||detailsFileList.value.length>6){ - // ElMessage({type: 'error',message: '详情展示图不得少于1张,不得多于6张'}) - // return - // } - let param = { - ...equipmentDeploymentParams.value, - mainFileList:mainFileList.value,//主展示 - detailsFileList:detailsFileList.value,//详情展示 - insurancePdf:insurancePdf.value,//合格证 - examinationPdf:examinationPdf.value,//检测证明 - } - const res: any = await insertDraftApi(param) - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '保存成功' - }) - dialogFormVisibleSettlein.value = false - // ruleFormRef.value.resetField() - getList() - } - } - /* 关闭按钮 */ - const closeDialogBtn = () => { - ruleFormRef.value.resetFields() - dialogFormVisibleSettlein.value = false - } - /* 关闭对话框 */ - const handleClose = (done: () => void) => { - ruleFormRef.value.resetFields() - done() - dialogFormVisibleSettlein.value = false } mainFileList.value = [] detailsFileList.value = [] @@ -626,10 +441,9 @@ const equipRules = ref({ trigger: 'blur', }, ], - deviceWeight: [ - // - { required: true, message: '整机重量不能为空', trigger: 'blur' }, - ], + // deviceWeight: [// + // { required: true, message: "整机重量不能为空", trigger: "blur" } + // ], }) // 弹框保存提交 const submitBtn = () => { @@ -876,106 +690,55 @@ const handleRemove = (list: any, index: Number) => {