From c7ec97d27a7e7ff322d6db87d4fb5c53c86069ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Fri, 30 Jul 2021 20:43:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E9=A3=9F=E5=A0=82?= =?UTF-8?q?=E7=AB=AF=E5=8F=91=E8=B5=B7=E9=87=87=E8=B4=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- canteen/pages/purchase/launch.vue | 34 +++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/canteen/pages/purchase/launch.vue b/canteen/pages/purchase/launch.vue index 8d5cb42..d26fba8 100644 --- a/canteen/pages/purchase/launch.vue +++ b/canteen/pages/purchase/launch.vue @@ -25,7 +25,7 @@ 收货时间 - {{ date }} + {{ date || '请选择收货时间...' }} @@ -64,7 +64,8 @@ }, data(){ return { - date: this.$shared.recordTime(new Date(), '-', 'date'), // 选择时间 + // date: this.$shared.recordTime(new Date(), '-', 'date'), // 选择时间, 默认今天 + date: '', material_list: {}, // 供应商,物资列表,不被渲染,在底层逻辑运作 show_material: false, // 是否显示采购清单按钮 render_material_list: {} // 渲染出来的物资列表 @@ -142,7 +143,18 @@ let detailValue = event.detailValue; // 取出table input被输入的值 let supplier_item = this.render_material_list[supplier_id]; // 取出所在供应商 let material_item = supplier_item.material_list[material_index]; // 取出物资 - material_item.purchase_number.value = detailValue; // 将输入的值赋值给物资 + if(material_item.purchase_limit <= detailValue){ + material_item.purchase_number.value = detailValue; // 将输入的值赋值给物资 + }else{ + uni.showModal({ + title: '温馨提示', + content: '采购数量必须大于起购数量', + showCancel: false, + success: result => { + material_item.purchase_number.value = material_item.purchase_limit; + } + }) + } console.log("render_material_list_change", this.render_material_list); }, // table 操作按钮被点击 @@ -186,12 +198,16 @@ let material_list = this.render_material_list; let list = []; let is_empty = true; // 物资数据是否为空 + let is_right = true; // 采购份数为正常的情况 for(let i in material_list){ if(Object.keys(material_list[i].material_list).length){ is_empty = false; let material = material_list[i].material_list; // 数组写法 let arr = material.map(item => { + if(item.purchase_limit > item.purchase_number.value){ + is_right = false; + }; return { m_id: item.material_id, m_spec_id: item.spec_id, @@ -219,14 +235,24 @@ } console.log("list", list) + let deadline = this.date; + if(!deadline){ + this.$msg('请选择收货时间'); + return; + } if(is_empty){ this.$msg('您未选择物资'); return; } + if(!is_right){ + this.$msg('采购数量需大于起购数量'); + return; + } let state = ['待发单', '待审核'][_t]; this.$http(this.API.API_CANTEEN_PURCHASEAPPLY, { order: list, - state: state + state: state, + deadline: deadline }).then(res => { console.log("save", res); this.$msg('操作成功'); From fd46b06fad239f49a5397a776cf79790f58627fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Sat, 31 Jul 2021 10:16:38 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=A3=9F=E5=A0=82=E7=AB=AF=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=87=AD=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- canteen/pages/purchase/detail.vue | 194 +++++++++++++++++++++++++++++- 1 file changed, 191 insertions(+), 3 deletions(-) diff --git a/canteen/pages/purchase/detail.vue b/canteen/pages/purchase/detail.vue index 3d18d5c..fa24bb9 100644 --- a/canteen/pages/purchase/detail.vue +++ b/canteen/pages/purchase/detail.vue @@ -32,11 +32,17 @@ - 证明材料 + 证明材料-供应端 + + 证明材料-食堂端 + + + + @@ -55,7 +61,7 @@ - + @@ -63,6 +69,28 @@ 已完成 + + + + + 上传凭证信息 + 请在此处上传检验检疫凭证、售卖资质等证书 + + + + + + + + + + + + 取消 + 确定 + + + @@ -89,17 +117,92 @@ contents: [], order: {}, p_sn: '', - type: 4 + type: 4, + is_show_voucher: false, + voucher_list: [] } }, onLoad(options){ // TODO 1、凭证上传流程变动:当采购单状态为已发货状态时,食堂可以上传凭证图片; // TODO 2、食堂收货时,实到数、实收数默认填充采购数量; + // todo 上传凭证参考页面:/uniapp-supplychain/supplier/pages/gonghuo/detail this.p_sn = options.p_sn || ''; // TODO 显示车辆等信息,显示table信息 this.getData(); }, methods: { + // 预览图片 + lookPopupImage(current){ + if(this.voucher_list.length <= 0) return; + this.$u.throttle(() => { + uni.previewImage({ + urls: this.voucher_list, + current: current + }) + }, 500); + }, + // 移除图片 + removeInage(current){ + this.voucher_list.splice(current, 1); + }, + // 上传凭证图片 + uploadImage(){ + let current_count = this.voucher_count - this.voucher_list.length; + if(current_count == 0) return; + uni.chooseImage({ + count: current_count, + complete: result => { + this.voucher_list.push(...result.tempFilePaths); + } + }) + }, + // 用户点击确定,将图片上传至oss,并将url发送给后端 + submitImage(){ + let that = this; + let voucher_list = that.voucher_list; + if(voucher_list.length <= 0){ + return that.$msg('您未上传图片哦'); + }; + that.is_show_voucher = false; + uni.showLoading({ + title: '正在上传中...' + }) + let http_list = []; + voucher_list.map(item => { + let itemP = new Promise((resolve, reject) => { + uploadFile(item, (res) => { + resolve(res); + }, (err) => { + reject(err); + }, this); + }) + http_list.push(itemP); + }) + + Promise.all(http_list).then(res => { + console.log("上传完毕", res); + let images = res.map(item => item.url); + + // todo 图片上传url给后端 + // that.$http(that.API.API_SUPPLIER_PURCHASESAVEVOUCHER, { + // p_sn: that.p_sn, + // images: images, + // }).then(result => { + // uni.hideLoading(); + // that.voucher_list = []; + // that.$msg('凭证已上传成功!') + // }).catch(err => uni.hideLoading()); + + }).catch(err => { + uni.hideLoading(); + uni.showModal({ + title: '', + content: JSON.stringify(err), + showCancel: false, + confirmColor: '#1833F2' + }) + }) + }, getData(){ this.$http(this.API.API_CANTEEN_PURCHASEDETAIL, { p_sn: this.p_sn @@ -222,4 +325,89 @@ margin-right: 0rpx; } } + + .popup-box{ + width: 686rpx; + height: max-content; + display: flex; + justify-content: space-between; + flex-direction: column; + .content{ + .popup-title{ + font-size: 32rpx; + font-weight: bold; + color: #222222; + text-align: center; + margin-top: 40rpx; + } + .popup-desc{ + font-size: 28rpx; + color: #555555; + text-align: center; + margin-top: 20rpx; + margin-bottom: 18rpx; + } + .popup-images{ + display: flex; + flex-wrap: wrap; + padding: 22rpx; + margin-bottom: 18rpx; + .popup-image-item{ + width: 198rpx; + height: 198rpx; + margin: 8rpx; + background: #F5F5F5; + border-radius: 10rpx; + position: relative; + image{ + width: 100%; + height: 100%; + } + .remove-image{ + position: absolute; + right: -8rpx; + top: -16rpx; + color: #e74c3c; + font-size: 40rpx; + padding: 8rpx; + } + } + .popup-image-item-after::after{ + content: '+'; + position: absolute; + left: 30%; + top: 14%; + font-size: 100rpx; + color: #777777; + } + } + .popup-input{ + padding: 0 60rpx; + box-sizing: border-box; + height: 90rpx; + font-size: 28rpx; + color: #555555; + input{ + text-align: right; + } + } + } + .foot-btn{ + height: 90rpx; + width: 100%; + border-top: 1rpx solid #E5E5E5; + display: flex; + box-sizing: border-box; + .popup-btn{ + width: 50%; + height: 100%; + border: none; + border-radius: initial; + &:last-child{ + border-left: 1rpx solid #E5E5E5; + color: #1833F2; + } + } + } + } From ca65b493f2386c1baaef47aa6ce002d5f54ef204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Sat, 31 Jul 2021 11:38:37 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=8F=91=E8=B5=B7=E6=8A=A5=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- canteen/pages/delivery/apply.vue | 17 ++++++++++++++++- canteen/pages/purchase/launch.vue | 2 +- supplier/pages/offer/index.vue | 9 +++++---- supplier/pages/order/detail.vue | 9 ++++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/canteen/pages/delivery/apply.vue b/canteen/pages/delivery/apply.vue index 6cf15d7..3776533 100644 --- a/canteen/pages/delivery/apply.vue +++ b/canteen/pages/delivery/apply.vue @@ -34,14 +34,29 @@ data(){ return { headers: [{ - label: '菜品名称', + label: '物资名称', key: 'material_name' },{ label: '规格', key: 'spec_name' + },{ + key: 'brand', + label: '品牌' + },{ + key: 'quality_level', + label: '品级' + },{ + label: '编号', + key: 'm_sn' + },{ + label: '供应商', + key: 'supplier_name' },{ label: '批次', key: 'purchase_id' + },{ + key: 'delivery_number', + label: '出库数量' }], contents: [], warehouse_list: {} diff --git a/canteen/pages/purchase/launch.vue b/canteen/pages/purchase/launch.vue index d26fba8..f6baf75 100644 --- a/canteen/pages/purchase/launch.vue +++ b/canteen/pages/purchase/launch.vue @@ -213,7 +213,7 @@ m_spec_id: item.spec_id, tax_price: item.tax_price, non_tax_price: item.non_tax_price, - purchase_number: item.purchase_number.value || 0 + purchase_number: Number(item.purchase_number.value) || item.purchase_limit } }); // 对象写法: diff --git a/supplier/pages/offer/index.vue b/supplier/pages/offer/index.vue index d27e347..a784d2c 100644 --- a/supplier/pages/offer/index.vue +++ b/supplier/pages/offer/index.vue @@ -241,16 +241,17 @@ id: item.quotation_id, tax_price: item.tax_price.value, non_tax_price: item.non_tax_price.value, - purchase_limit: item.purchase_limit.value || 1 + purchase_limit: Number(item.purchase_limit.value) || 1 }) }); // 操作状态,是保存还是直接发起 let state = ['待发起', '待审核'][_t]; this.$http(this.API.API_SUPPLIER_QUOTATIONSAVE, { data: list, - state: state + state: state, + q_sn: this.code }).then(res => { - this.$msg(res.data).then(result => { + this.$msg('操作成功').then(result => { this.$toBack(); }) }) @@ -271,7 +272,7 @@ m_spec_id: item.spec_id, tax_price: item.tax_price.value, non_tax_price: item.non_tax_price.value, - purchase_limit: item.purchase_limit.value || 1 + purchase_limit: Number(item.purchase_limit.value) || 1 }) } }); diff --git a/supplier/pages/order/detail.vue b/supplier/pages/order/detail.vue index df458c3..1c5dba7 100644 --- a/supplier/pages/order/detail.vue +++ b/supplier/pages/order/detail.vue @@ -73,7 +73,8 @@ key: 'non_tax_price' }], contents: [], - q_sn: '' // 订单号 + q_sn: '', // 订单号 + show_count: 0 } }, computed: { @@ -93,6 +94,12 @@ this.q_sn = options.q_sn; this.getDetail(); }, + onShow(options){ + this.show_count++; + if(this.show_count > 1){ + this.getDetail(); + } + }, methods: { stateType(val){ let type = 0; From 82a8c540c14bd1d041da5535a50ba29e7de6b5e9 Mon Sep 17 00:00:00 2001 From: shuixiang Date: Sat, 31 Jul 2021 15:25:08 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- canteen/pages/index/index.vue | 2 +- supplier/pages/index/index.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/canteen/pages/index/index.vue b/canteen/pages/index/index.vue index b0d42f1..9512230 100644 --- a/canteen/pages/index/index.vue +++ b/canteen/pages/index/index.vue @@ -3,7 +3,7 @@ {{ canteen.name }} - {{ canteen.user.canteen.remark }} + {{ canteen.role }} {{ supplier.name }} + {{ supplier.role }}