diff --git a/app/pages.json b/app/pages.json index 1dfa37f..eb45822 100644 --- a/app/pages.json +++ b/app/pages.json @@ -287,7 +287,7 @@ } }, { - "path": "wish_menu/index", + "path": "day_menu/index", "style": { "navigationBarTitleText": "每日菜单", "navigationBarBackgroundColor": "#FFFFFF", @@ -298,6 +298,18 @@ // #endif } }, + { + "path": "wish_menu/index", + "style": { + "navigationBarTitleText": "祈愿菜单", + "navigationBarBackgroundColor": "#FFFFFF", + "navigationBarTextStyle": "black" + // #ifdef H5 + , + "navigationStyle": "custom" + // #endif + } + }, { "path": "repair/index", "style": { diff --git a/app/pages/index/index.vue b/app/pages/index/index.vue index 9f681fd..f6a6345 100644 --- a/app/pages/index/index.vue +++ b/app/pages/index/index.vue @@ -95,7 +95,7 @@ 物资领用 - + diff --git a/app/pages/supply_chain/day_menu/index.vue b/app/pages/supply_chain/day_menu/index.vue new file mode 100644 index 0000000..74e05d3 --- /dev/null +++ b/app/pages/supply_chain/day_menu/index.vue @@ -0,0 +1,719 @@ + + + + + diff --git a/app/pages/supply_chain/material_receipt/index.vue b/app/pages/supply_chain/material_receipt/index.vue index 2441705..e8468bd 100644 --- a/app/pages/supply_chain/material_receipt/index.vue +++ b/app/pages/supply_chain/material_receipt/index.vue @@ -28,8 +28,8 @@ - {{ item.cargoName }} ({{ item.cargoSpec }}) - × + {{ item.cargoName }} ({{ item.cargoSpec }}) x {{ item.quantity }} + x @@ -82,14 +82,26 @@ class="material-item" v-for="material in filteredMaterials" :key="material.cargoId" - @click="toggleMaterial(material)" > {{ material.cargoName }} {{ material.cargoSpec }} - - + + + - + + + + + + + @@ -113,7 +125,13 @@ 领用单 {{ getStatusText(item) }} @@ -145,7 +163,7 @@ 领用物资 - {{ cargo.cargoName }} ({{ cargo.cargoSpec }}){{ index < item.ckBillCargos.length - 1 ? '、' : '' }} + {{ cargo.cargoName }}{{ cargo.cargoSpec ? ` (${cargo.cargoSpec})` : '' }}{{ cargo.cargoWt ? ` x ${parseFloat(cargo.cargoWt).toFixed(2).replace(/\.?0+$/, '')}` : '' }}{{ index < item.ckBillCargos.length - 1 ? '、' : '' }} @@ -153,8 +171,8 @@ - 取消单据 - 查看凭证 + 取消单据 + 查看凭证 @@ -173,7 +191,7 @@ {{ currentVoucher ? currentVoucher.billNumber : '' }} - + @@ -201,6 +219,7 @@ export default { '已审批': 'status-approved', '已拒绝': 'status-rejected', '已取消': 'status-canceled', + '已核销': 'status-verified', '__default__': 'status-pending' }, materials: [], @@ -273,6 +292,33 @@ export default { isMaterialSelected(cargoId) { return this.tempSelectedMaterials.some(item => item.cargoId === cargoId); }, + // 获取物资数量 + getMaterialQuantity(cargoId) { + const item = this.tempSelectedMaterials.find(item => item.cargoId === cargoId); + return item ? item.quantity : 1; + }, + // 增加数量 + increaseQuantity(cargoId) { + const item = this.tempSelectedMaterials.find(item => item.cargoId === cargoId); + if (item) { + item.quantity += 1; + } + }, + // 减少数量 + decreaseQuantity(cargoId) { + const item = this.tempSelectedMaterials.find(item => item.cargoId === cargoId); + if (item && item.quantity > 1) { + item.quantity -= 1; + } + }, + // 更新数量 + updateQuantity(cargoId, event) { + const item = this.tempSelectedMaterials.find(item => item.cargoId === cargoId); + if (item) { + const value = parseInt(event.target.value) || 1; + item.quantity = Math.max(1, value); + } + }, // 确认物资选择 confirmMaterialSelection() { this.selectedMaterials = [...this.tempSelectedMaterials]; @@ -283,7 +329,7 @@ export default { this.selectedMaterials.splice(index, 1); }, submitReceipt() { - if (this.selectedMaterials.length === 0 || !this.receiptForm.purpose || !this.receiptForm.applicant) { + if (this.selectedMaterials.length === 0 || !this.receiptForm.purpose) { uni.showToast({ title: '请填写完整信息', icon: 'none' @@ -294,16 +340,24 @@ export default { // 准备提交数据 const items = this.selectedMaterials.map(item => ({ cargoId: item.cargoId, - quantity: item.quantity + quantity: item.quantity, + billNumber: item.billNumber, + stockId: item.stockId, + stockCode: item.stockCode, + ckCargoStockId: item.id, })); const submitData = { purpose: this.receiptForm.purpose, items: items }; + uni.showLoading({ + title: '提交中...' + }); // 调用接口提交领用申请 quickOutBill(submitData).then(res => { + uni.hideLoading(); if (res.code === 200) { uni.showToast({ title: '领用申请提交成功', @@ -330,10 +384,15 @@ export default { icon: 'none' }); } - }); + }).catch(() => { + uni.hideLoading(); + }); }, // 获取状态文本 getStatusText(item) { + if (item.billStatus === '1') { + return '已核销'; + } if (item.cancelStatus === '1') { return '已取消'; } @@ -395,16 +454,23 @@ export default { }, // 生成二维码 generateQRCode(billNumber) { + console.log('开始生成二维码'); uQRCode.make({ canvasId: 'qrcode', text: billNumber, size: this.qrcodeSize, margin: 10, success: res => { + console.log(res); }, complete: () => { }, fail: res => { + console.log(res); + uni.showToast({ + title: '二维码生成失败', + icon: 'none' + }); } }); }, @@ -418,7 +484,9 @@ export default { } else { this.$refs.paging.complete([]); } - }); + }).catch(e => { + this.$refs.paging.complete(false); + }); }, refreshList() { if (this.$refs.paging) { @@ -625,6 +693,11 @@ export default { background-color: #F5F5F5; color: #999; } + + .status-verified { + background-color: #E8F5E8; + color: #4CAF50; + } } .header-right { @@ -745,46 +818,79 @@ export default { .material-list { .material-item { - display: flex; - align-items: center; - justify-content: space-between; - padding: 24rpx 30rpx; - border-bottom: 1rpx solid #f0f0f0; - cursor: pointer; - - .material-info { - flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + padding: 24rpx 30rpx; + border-bottom: 1rpx solid #f0f0f0; + + .material-info { + flex: 1; + + .material-name { + display: block; + font-size: 26rpx; + color: #333; + margin-bottom: 8rpx; + } - .material-name { - display: block; - font-size: 26rpx; - color: #333; - margin-bottom: 8rpx; + .material-spec { + font-size: 22rpx; + color: #999; + } } - .material-spec { - font-size: 22rpx; - color: #999; - } - } + .item-actions { + display: flex; + align-items: center; + gap: 20rpx; + + .quantity-input { + display: flex; + align-items: center; + border: 1rpx solid #e5e5e5; + border-radius: 8rpx; + + .quantity-btn { + width: 40rpx; + height: 40rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 24rpx; + color: #666; + background-color: #f5f5f5; + } + + .quantity-input-box { + width: 80rpx; + height: 40rpx; + border: none; + text-align: center; + font-size: 22rpx; + color: #333; + } + } - .checkbox { - width: 36rpx; - height: 36rpx; - border: 2rpx solid #e5e5e5; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - font-size: 24rpx; - color: #fff; + .checkbox { + width: 36rpx; + height: 36rpx; + border: 2rpx solid #e5e5e5; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 24rpx; + color: #fff; + cursor: pointer; - &.checked { - background-color: #409EFF; - border-color: #409EFF; + &.checked { + background-color: #409EFF; + border-color: #409EFF; + } + } } } - } } } @@ -819,7 +925,7 @@ export default { /* 凭证弹窗样式 */ .voucher-popup { - width: 80%; + width: 680rpx; background-color: #fff; border-radius: 20rpx; overflow: hidden; diff --git a/app/pages/supply_chain/wish_menu/index.vue b/app/pages/supply_chain/wish_menu/index.vue index 74e05d3..02409e3 100644 --- a/app/pages/supply_chain/wish_menu/index.vue +++ b/app/pages/supply_chain/wish_menu/index.vue @@ -1,719 +1,8 @@ - + \ No newline at end of file