From 7483216b8262a5460539ede52383586dd1d8d3bf Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 11 Mar 2025 09:44:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 5 - env/.env.dev | 4 +- .../orderManagement/components/order-home.vue | 249 ++++++++------ .../components/order-home.vue | 311 ++++++++++-------- 4 files changed, 314 insertions(+), 255 deletions(-) diff --git a/components.d.ts b/components.d.ts index 761092b..5df8ebb 100644 --- a/components.d.ts +++ b/components.d.ts @@ -23,13 +23,11 @@ declare module 'vue' { ElCollapse: typeof import('element-plus/es')['ElCollapse'] ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] - ElCountdown: typeof import('element-plus/es')['ElCountdown'] 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'] @@ -37,18 +35,15 @@ declare module 'vue' { ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] - ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] ElProgress: typeof import('element-plus/es')['ElProgress'] - ElRadio: typeof import('element-plus/es')['ElRadio'] 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'] - ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTag: typeof import('element-plus/es')['ElTag'] diff --git a/env/.env.dev b/env/.env.dev index aaf55ce..5c8e465 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -9,9 +9,9 @@ VITE_API_URL = '/proxyApi' # VITE_proxyTarget = 'http://192.168.0.234:28080' # 马帅 # VITE_proxyTarget = 'http://192.168.2.122:28080' # 梁超 -VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试÷服务 +# VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试÷服务 # VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务 -# VITE_proxyTarget = 'http://192.168.2.75:28080' # 盛旭 +VITE_proxyTarget = 'http://192.168.0.96:28080' # 马帅 # VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型) # VITE_proxyTarget = 'http://10.40.92.16:9502' # 牛 (个人中心 基础信息企业申请认证) diff --git a/src/views/user/orderManagement/components/order-home.vue b/src/views/user/orderManagement/components/order-home.vue index 9fd85af..fad6bc9 100644 --- a/src/views/user/orderManagement/components/order-home.vue +++ b/src/views/user/orderManagement/components/order-home.vue @@ -166,30 +166,38 @@ const onChangeGoods = (index: number) => { } // 确认收获按钮 -const confirmReceipt = () => { - pickUpCodeFormRef.value.validate((valid:any) => { +const confirmReceipt = () => { + pickUpCodeFormRef.value.validate((valid: any) => { if (valid) { ElMessageBox.confirm('是否确定收货?', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning', - }) - .then(() => { - console.log('xxxxxxxxxxxxxxxx',indexPickUpCode.value,pickUpCodeForm.pickUpCode) - return passApi({ orderId: cardList.value[indexPickUpCode.value].orderId, orderStatus: 4,pickupCode:pickUpCodeForm.pickUpCode }) - }) - .then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '确定收货成功', + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }) + .then(() => { + console.log( + 'xxxxxxxxxxxxxxxx', + indexPickUpCode.value, + pickUpCodeForm.pickUpCode, + ) + return passApi({ + orderId: cardList.value[indexPickUpCode.value].orderId, + orderStatus: 4, + pickupCode: pickUpCodeForm.pickUpCode, + }) }) - numberTemp.value = numberTemp.value + 1 - dialogVisiblePickUpCodeOut.value = false - getList() - } - }) - .catch(() => {}) + .then((res) => { + if (res.code === 200) { + ElMessage({ + type: 'success', + message: '确定收货成功', + }) + numberTemp.value = numberTemp.value + 1 + dialogVisiblePickUpCodeOut.value = false + getList() + } + }) + .catch(() => {}) } }) } @@ -357,7 +365,7 @@ const handleViewWord = async (index: Number, row: any) => { // cardList.value = res.rows // 打开租赁协议弹框 if (import.meta.env.VITE_API_URL == '/proxyApi') { - wordUrl.value = res.data.url + wordUrl.value = res.data.url } else { wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url } @@ -392,23 +400,23 @@ const downloadContract = () => { // 下载合同附件 const downloadAnnex = async () => { - const fileUrl = `https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/2025/contract-annex.docx`; - + const fileUrl = `https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/2025/contract-annex.docx` + try { - const response = await fetch(fileUrl); - if (!response.ok) throw new Error('网络响应不正常'); - - const blob = await response.blob(); - const url = window.URL.createObjectURL(blob); - const a = document.createElement('a'); - a.style.display = 'none'; - a.href = url; - a.download = 'contract-annex.docx'; // 设置下载文件名 - document.body.appendChild(a); - a.click(); - window.URL.revokeObjectURL(url); + const response = await fetch(fileUrl) + if (!response.ok) throw new Error('网络响应不正常') + + const blob = await response.blob() + const url = window.URL.createObjectURL(blob) + const a = document.createElement('a') + a.style.display = 'none' + a.href = url + a.download = 'contract-annex.docx' // 设置下载文件名 + document.body.appendChild(a) + a.click() + window.URL.revokeObjectURL(url) } catch (error) { - console.error('下载失败:', error); + console.error('下载失败:', error) } } @@ -495,43 +503,51 @@ const costSubmit = () => { } //取件码弹窗参数 -const dialogVisiblePickUpCode = ref(false); +const dialogVisiblePickUpCode = ref(false) // 新增变量来存储取件码 -const pickUpCode = ref(''); -const pickUpView = async(item: any) => { - console.log('item',item) - const res: any = await getOrderCodeApi({orderId:item.orderId}) - console.log('res',res) +const pickUpCode = ref('') +const pickUpView = async (item: any) => { + console.log('item', item) + const res: any = await getOrderCodeApi({ orderId: item.orderId }) + console.log('res', res) pickUpCode.value = res.data - dialogVisiblePickUpCode.value = true; -}; + dialogVisiblePickUpCode.value = true +} -const indexPickUpCode = ref(0); +const indexPickUpCode = ref(0) //出库弹窗参数 -const dialogVisiblePickUpCodeOut = ref(false); +const dialogVisiblePickUpCodeOut = ref(false) // 新增变量来存储取件码 -const pickUpCodeOut = ref(''); +const pickUpCodeOut = ref('') const pickUpViewOut = (index: number) => { - indexPickUpCode.value = index; - pickUpCodeForm.pickUpCode = ''; - dialogVisiblePickUpCodeOut.value = true; -}; + indexPickUpCode.value = index + pickUpCodeForm.pickUpCode = '' + dialogVisiblePickUpCodeOut.value = true +} const pickUpCodeFormRef = ref() //取件码表单校验规则 const pickUpCodeRules = ref({ - pickUpCode:[ + pickUpCode: [ { required: true, message: '请输入取件码', trigger: 'blur', - } + }, ], }) const pickUpCodeForm = reactive({ pickUpCode: '', }) - +const onJumpDetails = (goods: any) => { + console.log(goods, 'goods') + router.push({ + name: 'equipDetail', + query: { + id: goods.maId, + }, + }) +}