| | |
| | | <template> |
| | | <view class="container"> |
| | | <view class="example"> |
| | | <uni-collapse ref="collapse" v-model="value" @change="change"> |
| | | <uni-collapse-item title="产品数量" > |
| | | <uni-collapse ref="collapse" v-model="value"> |
| | | <uni-collapse-item title="产品数量" name="0" > |
| | | <view class="content"> |
| | | <uni-forms ref="form" labelWidth="100px" v-for="food in foods"> |
| | | <uni-forms-item :label="food.name" :name="food.code"> |
| | |
| | | <button type="primary" @click="submit">开始测算</button> |
| | | </view> |
| | | </uni-collapse-item> |
| | | <uni-collapse-item title="计算结果"> |
| | | <view class="content"> |
| | | <text class="text">折叠内容主体,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段文字。再次点击标题,折叠内容。</text> |
| | | <uni-collapse-item title="计算结果" name="1"> |
| | | <view class="content" v-for="res in calcResult"> |
| | | <uni-section :title="res.maTypeName" type="line"> |
| | | <uni-list v-for="m in res.materialList"> |
| | | <uni-list-item :title="m.maName" :note="'数量:'+m.qty+m.unit+' 成本:'+m.amount+'元'" |
| | | thumb="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" |
| | | thumb-size="sm" rightText="" /> |
| | | </uni-list> |
| | | </uni-section> |
| | | </view> |
| | | </uni-collapse-item> |
| | | </uni-collapse> |
| | |
| | | { code:'A0006',name: '爆辣鸡腿卷饼',qty: 0 }, |
| | | { code:'A0007',name: '藤椒鸡腿卷饼',qty: 0 }, |
| | | ], |
| | | |
| | | calcResult:{}, |
| | | rules: { |
| | | nickName: { |
| | | rules: [{ |
| | |
| | | methods: { |
| | | submit(ref) { |
| | | getFoodMaterialCostList(this.foods).then(response => { |
| | | this.$modal.msgSuccess("修改成功") |
| | | this.calcResult = response.data; |
| | | this.value = ['1']; |
| | | }) |
| | | } |
| | | } |