|
|
@@ -8,31 +8,9 @@
|
|
|
<view class="nav-left">
|
|
|
<view class="item-list"> 收银 </view>
|
|
|
</view>
|
|
|
+ <!-- 已选花材列表 -->
|
|
|
<view class="itemList-box">
|
|
|
- <view class="title">花材列表</view>
|
|
|
- <view class="itemList-item_box">
|
|
|
- <view v-for="item in itemList" :key="item.id" @click="selectCurrentActive(item)" class="show-item_box">
|
|
|
- <view :class="[ 'item-body_box', selectCurrentActiveItem.id===item.id?'active':'not-active']">
|
|
|
- <view class="flower-name_box">
|
|
|
- <view class="current-item-title"><text class="name">{{item.name}}</text><text @click.stop="delSelectItem" class="del">删除</text></view>
|
|
|
- </view>
|
|
|
- <view class="item-price-num">
|
|
|
- <view>{{parseFloat(item.currentUnitPrice)}}元/{{item.currentUnit}}</view>
|
|
|
- <view>{{item.currentNum}} {{item.currentUnit}}</view>
|
|
|
- <view>¥{{item.currentNum * item.currentUnitPrice}}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="itemList-footer_box">
|
|
|
- <view> 数量
|
|
|
- <text style="margin-left:5upx;">
|
|
|
- <text v-if="Number(totalShop.bigUnit)>0">{{totalShop.bigUnit}}扎</text>
|
|
|
- <text v-if="Number(totalShop.smallUnit)>0">{{totalShop.smallUnit}}支</text>
|
|
|
- </text>
|
|
|
- </view>
|
|
|
- <view> 合计 <text style="margin-left:5upx;">¥{{totalShop.totalPrice}}</text> </view>
|
|
|
- </view>
|
|
|
+ <leftItemComponent></leftItemComponent>
|
|
|
</view>
|
|
|
<!-- 按钮操作 -->
|
|
|
<view class="open-box">
|
|
|
@@ -40,43 +18,39 @@
|
|
|
</view>
|
|
|
<!-- 分类和花材图片 -->
|
|
|
<view class="all-item-area">
|
|
|
- <rightItemArea @showAddModelFn="showAddModelFn"> </rightItemArea>
|
|
|
+ <rightItemArea> </rightItemArea>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { mapGetters,mapActions } from "vuex";
|
|
|
-import autoUpdateMixins from "@/mixins/autoUpdate";
|
|
|
+import { mapGetters } from "vuex";
|
|
|
+import autoUpdateApp from "@/mixins/autoUpdate";
|
|
|
import rightItemArea from './components/rightItemArea.vue'
|
|
|
import middleButton from './components/middleButton.vue'
|
|
|
+import leftItemComponent from './components/leftItem.vue'
|
|
|
import loginComponent from './login.vue'
|
|
|
-import { createCreateOrder, wastageCreateOrder } from '@/api/home/index'
|
|
|
export default {
|
|
|
name: "workbench",
|
|
|
- components: { rightItemArea,middleButton, loginComponent },
|
|
|
- mixins: [autoUpdateMixins],
|
|
|
+ components: { rightItemArea,middleButton, loginComponent, leftItemComponent },
|
|
|
+ mixins: [autoUpdateApp],
|
|
|
data() {
|
|
|
return {
|
|
|
itemList:[],
|
|
|
currenSelectShop:{},
|
|
|
selectItem: {},
|
|
|
selectCurrentActiveItem:{},
|
|
|
- totalShop:{ bigUnit: 0, smallUnit:0, totalPrice: 0 },
|
|
|
selectItemUser:{},
|
|
|
isLogin:false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(["getLoginInfo"]),
|
|
|
- ...mapGetters({ myShopInfo: "getMyShopInfo" }),
|
|
|
+ ...mapGetters(["getLoginInfo"])
|
|
|
},
|
|
|
- onLoad(option) {
|
|
|
+ onLoad() {
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
- this.init();
|
|
|
- uni.stopPullDownRefresh();
|
|
|
},
|
|
|
onShow() {
|
|
|
},
|
|
|
@@ -92,71 +66,11 @@ export default {
|
|
|
this.isLogin = true
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- itemList(){
|
|
|
- if(this.$util.isEmpty(this.itemList)) {
|
|
|
- this.totalShop = { bigUnit: 0, smallUnit:0, totalPrice: 0 }
|
|
|
- }
|
|
|
- this.totalShop = this.itemList.reduce((total,val)=>{
|
|
|
- if(val.unitType === 0) {
|
|
|
- total.bigUnit = total.bigUnit + (val.currentNum *1)
|
|
|
- }else {
|
|
|
- total.smallUnit = total.smallUnit +(1*val.currentNum)
|
|
|
- }
|
|
|
- total.totalPrice = total.totalPrice + (1*val.currentNum) * (val.currentUnitPrice*1)
|
|
|
- return total
|
|
|
- },{ bigUnit: 0, smallUnit:0, totalPrice: 0 })
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- //结算创建订单
|
|
|
- async setCreateOrder(){
|
|
|
- try {
|
|
|
- let arr = this.itemList.map(i=>({ productId:i.id, unitType: i.unitType, num: i.currentNum, property: i.property, unitPrice: i.currentUnitPrice }))
|
|
|
- const {settleId,payId,payUserId,isPrint,proceeds,freight} = this.$refs.settlePop
|
|
|
- await createCreateOrder({
|
|
|
- customId: this.selectItemUser.id,
|
|
|
- product: JSON.stringify(arr),
|
|
|
- modifyPrice: proceeds,
|
|
|
- sendType: 1,
|
|
|
- hasPay: settleId,
|
|
|
- payWay: payId,
|
|
|
- getUserId: payUserId,
|
|
|
- needPrint: isPrint,
|
|
|
- sendCost: freight,
|
|
|
- remark:''
|
|
|
- })
|
|
|
- this.$refs.settlePopRef.close()
|
|
|
- this.$refs.selectPayWayRef.open('center')
|
|
|
- this.$msg('订单创建成功')
|
|
|
- }catch(err) {
|
|
|
- console.log(err)
|
|
|
- }
|
|
|
- },
|
|
|
- cancelPay(){
|
|
|
- this.$refs.selectPayWayRef.close()
|
|
|
- },
|
|
|
- async settleReturn(){
|
|
|
- this.setCreateOrder()
|
|
|
- },
|
|
|
- selectCurrentActive(item){
|
|
|
- this.selectCurrentActiveItem = item
|
|
|
- },
|
|
|
- selectUserReturn(val){
|
|
|
- this.selectItemUser = val
|
|
|
- this.$refs.selectUserRef.close()
|
|
|
- },
|
|
|
- cancelSelectUser(){
|
|
|
- this.$refs.selectUserRef.close()
|
|
|
- },
|
|
|
- selectUser(){
|
|
|
- this.$refs.selectUserRef.open('center')
|
|
|
- },
|
|
|
init() {
|
|
|
},
|
|
|
- selectPayWayBack(price){
|
|
|
- console.log(price)
|
|
|
- }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
@@ -173,7 +87,7 @@ export default {
|
|
|
flex: 5;
|
|
|
background-color: rgba(72, 91, 107, 1);
|
|
|
& .item-list {
|
|
|
- margin-top: 30upx;
|
|
|
+ margin-top: 20upx;
|
|
|
font-size: 16upx;
|
|
|
text-align: center;
|
|
|
padding: 15upx 0;
|
|
|
@@ -184,70 +98,6 @@ export default {
|
|
|
& .itemList-box {
|
|
|
flex: 25;
|
|
|
height: 100%;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- & .title {
|
|
|
- padding: 3upx;
|
|
|
- font-size: 12upx;
|
|
|
- background-color: rgba(72, 91, 107, 1);
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
- & .itemList-item_box {
|
|
|
- overflow-y: auto;
|
|
|
- flex: 1;
|
|
|
- border: 1px solid #eee;
|
|
|
- & .show-item_box {
|
|
|
- padding: 2upx;
|
|
|
- & .item-body_box {
|
|
|
- border-radius: 2upx;
|
|
|
- padding: 2upx;
|
|
|
- font-size: 14upx;
|
|
|
- color:#666666;
|
|
|
- &.active {
|
|
|
- background-color: #d4d6d6;
|
|
|
- }
|
|
|
- &.not-active {
|
|
|
- background-color: #e7e9e9;
|
|
|
- }
|
|
|
- .item-price-num{
|
|
|
- color:#afaeae;
|
|
|
- font-size:10upx;
|
|
|
- }
|
|
|
- & .flower-name_box {
|
|
|
- padding: 0 5upx;
|
|
|
- .current-item-title {
|
|
|
- .name{
|
|
|
- color: #333333;
|
|
|
- font-weight: bold;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow:ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
- width:50upx;
|
|
|
- }
|
|
|
- .del{
|
|
|
- color:orange;
|
|
|
- font-size:12upx;
|
|
|
- float:right;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- & > view:nth-child(2) {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- padding-top: 15upx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- & .itemList-footer_box {
|
|
|
- height: 20upx;
|
|
|
- border: 1px solid #eee;
|
|
|
- font-size: 10upx;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-around;
|
|
|
- }
|
|
|
}
|
|
|
& .open-box {
|
|
|
flex: 8;
|