|
|
@@ -3,11 +3,27 @@
|
|
|
<appResult>
|
|
|
<button class="admin-button-com blue big" @click="gotoPlace">返回</button>
|
|
|
<button class="admin-button-com blue big" @click="gotoDetail">订单详情</button>
|
|
|
+
|
|
|
+
|
|
|
+ <view style="margin-top:50upx;">
|
|
|
+ <block v-for="(item, index) in orderInfo.itemInfoList" :key="index">
|
|
|
+ <view style="text-align:center;margin-bottom:10upx;" v-if="item.unitType == 1">
|
|
|
+ <text style="font-size:30upx;">
|
|
|
+ {{item.name}}
|
|
|
+ </text>
|
|
|
+ <button class="admin-button-com middle blue" style="margin:10upx auto 0 auto;" @click="subHalf(item)">减半份</button>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
</appResult>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
import appResult from "@/components/app-result";
|
|
|
+import { getDetB} from "@/api/order";
|
|
|
+import { changeHalf } from "@/api/item"
|
|
|
export default {
|
|
|
name: "result",
|
|
|
components: {
|
|
|
@@ -17,12 +33,29 @@ export default {
|
|
|
return {
|
|
|
name:'',
|
|
|
index:0,
|
|
|
- type:[]
|
|
|
+ type:[],
|
|
|
+ orderInfo: {}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ subHalf(item){
|
|
|
+ let that = this
|
|
|
+ let orderSn = this.orderInfo.orderSn
|
|
|
+ let remark = "开零售单"+orderSn+",减少半份"
|
|
|
+ that.$util.confirmModal({content:'确认减少半份?'},() => {
|
|
|
+ uni.showLoading()
|
|
|
+ changeHalf({productId:item.itemId,add:0,remark:remark}).then((res) => {
|
|
|
+ uni.hideLoading()
|
|
|
+ let stock = res.data.stock ? res.data.stock : 0
|
|
|
+ uni.showToast({title: '成功,剩 '+stock,duration:2600,icon:'success'})
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
init(){
|
|
|
-
|
|
|
+ let orderId = this.option.orderId?this.option.orderId:0
|
|
|
+ getDetB({id: orderId}).then(res => {
|
|
|
+ this.orderInfo = res.data
|
|
|
+ })
|
|
|
},
|
|
|
gotoDetail() {
|
|
|
this.pageTo({url:`/admin/order/detail?id=${this.option.orderId}`, type: 2})
|