|
|
@@ -1,14 +1,15 @@
|
|
|
<template>
|
|
|
<view class="affirm-page">
|
|
|
+
|
|
|
<view class="affirm-view overscroll">
|
|
|
- <!-- 门店信息 -->
|
|
|
+ <!-- 花材列表 -->
|
|
|
<form>
|
|
|
<view class="module-com">
|
|
|
<view class="commodity-view">
|
|
|
<view class="commodity-list">
|
|
|
<view class="commodity-item" v-for="(item, index) in selectList" :key="index">
|
|
|
<image class="item-icon" :src="item.cover" alt="" />
|
|
|
- <view class="item-info">
|
|
|
+ <view class="item-info" @click="changeItemNum(item)">
|
|
|
<view class="info-line">
|
|
|
<text class="item-name">{{ item.itemName }}</text>
|
|
|
<text class="item-price">
|
|
|
@@ -18,14 +19,19 @@
|
|
|
</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
- <view class="info-line">
|
|
|
- <text class="item-type"></text>
|
|
|
- <text class="item-count">
|
|
|
- <text v-if="item.bigCount > 0 || item.smallCount > 0">{{`${item.bigCount}`}}</text>
|
|
|
- <text v-if="item.smallCount > 0">/</text>
|
|
|
- <text v-if="item.smallCount > 0">{{`${item.smallCount}`}}</text>
|
|
|
- </text>
|
|
|
+
|
|
|
+ <view style="text-align:right;">
|
|
|
+ <view class="open-bx" >
|
|
|
+ <i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delItem(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
|
|
|
+ <text class="num" >
|
|
|
+ <text v-if="item.bigCount > 0 || item.smallCount > 0">{{ `${item.bigCount}` }}</text>
|
|
|
+ <text v-if="item.smallCount > 0">/</text>
|
|
|
+ <text v-if="item.smallCount > 0">{{ `${item.smallCount}` }}</text>
|
|
|
+ </text>
|
|
|
+ <i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addItem(item)"></i>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -39,6 +45,23 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <modal-module :show="currentModelShow" @cancel="addModelCancel" @click="confirmAddModel" :title="currentItemData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
|
|
|
+ <template slot="customContent">
|
|
|
+ <view class="select-cmd_bx" v-if="currentItemData">
|
|
|
+ <view class="kc"><text class="unit_price">库存 {{ parseFloat(currentItemData.stock) }}</text><text class="unit_price"> 单价 {{ parseFloat(currentItemData.price) }}</text>1扎={{currentItemData.ratio}}支</view>
|
|
|
+ <view class="num_bx">
|
|
|
+ <input v-model="currentItemData.bigCount" :focus="currentItemFocus" type="number" />扎
|
|
|
+ <input v-model="currentItemData.smallCount" type="number" style="margin-left:24upx" />支
|
|
|
+ </view>
|
|
|
+ <view class="num_bx">
|
|
|
+ <input style="width: 495rpx" v-model="currentItemData.userPrice" @focus="currentItemData.userPrice = null" type="number" placeholder="每扎单价" />
|
|
|
+ <text>元</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </modal-module>
|
|
|
+
|
|
|
<view class="module-com input-line-wrap">
|
|
|
<view class="" v-if="isBilling">
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" @click="selectCustom">
|
|
|
@@ -101,13 +124,16 @@
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
<view class="tui-title">备注</view>
|
|
|
- <textarea style="height: 100rpx" v-model="form.remark" placeholder="选填"/>
|
|
|
+ <textarea style="height: 100rpx" v-model="form.remark" placeholder="选填" />
|
|
|
</tui-list-cell>
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
</form>
|
|
|
</view>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<view class="under-bar">
|
|
|
<view class="price-view">
|
|
|
<text class="price-title" v-if="isBilling">
|
|
|
@@ -119,6 +145,7 @@
|
|
|
<button class="admin-button-com blue middle" @click="affirmFormSubmit">开单</button>
|
|
|
</view>
|
|
|
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -133,9 +160,10 @@ import appAddressGroup from "@/components/app-address-group";
|
|
|
import appSendTime from "@/components/app-send-time";
|
|
|
import appFormSend from "@/components/app-form-send";
|
|
|
const formUtil = require("@/utils/formValidation.js");
|
|
|
-import { createOrder, freight,wastage,updateOrder } from "@/api/order/index";
|
|
|
+import { createOrder, updateOrder } from "@/api/order/index";
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
import { getUserDet} from "@/api/member";
|
|
|
+import ModalModule from "@/components/plugin/modal";
|
|
|
export default {
|
|
|
name: "BillingAffirm", // 开单确认
|
|
|
components: {
|
|
|
@@ -147,6 +175,7 @@ export default {
|
|
|
appAddressGroup,
|
|
|
appSendTime,
|
|
|
appFormSend,
|
|
|
+ ModalModule
|
|
|
},
|
|
|
mixins: [productMins],
|
|
|
data () {
|
|
|
@@ -179,7 +208,10 @@ export default {
|
|
|
money: "",
|
|
|
modifyPrice: 0,
|
|
|
showCustomer: false,
|
|
|
- customInfo:{discount:1}
|
|
|
+ customInfo:{discount:1},
|
|
|
+ currentItemData: { bigCount: 0, smallCount: 0, userPrice: 0 },
|
|
|
+ currentItemFocus:false,
|
|
|
+ currentModelShow:false
|
|
|
};
|
|
|
},
|
|
|
onLoad (option) {
|
|
|
@@ -222,6 +254,127 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
+ //通过弹框来修改花材数据(区别于点+-号修改花材)
|
|
|
+ changeItemNum(item) {
|
|
|
+ let variety = item.variety
|
|
|
+ //不是小菊或者是小菊但不是在开单
|
|
|
+ if(variety == 0 || this.pageType != 'bill'){
|
|
|
+ if(this.checkStock){
|
|
|
+ if(item.stock<=0){
|
|
|
+ this.$util.noStockRemind()
|
|
|
+ uni.showToast({title:'库存不足',icon:'none'})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!item.bigCount && !item.smallCount){
|
|
|
+ let params = { ...item, bigCount: item.bigCount, smallCount: item.smallCount, userPrice: item.userPrice}
|
|
|
+ this.$emit("groupInfoBeforeShowModel", item,params);
|
|
|
+ }else{
|
|
|
+ this.showAddModel({ ...item, bigCount: item.bigCount, smallCount: item.smallCount, userPrice: item.userPrice })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$msg("小菊请去列表页修改")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addModelCancel() {
|
|
|
+ this.currentModelShow = false;
|
|
|
+ this.currentItemData = {};
|
|
|
+ },
|
|
|
+ confirmAddModel(val) {
|
|
|
+ if (val.index === 0) {
|
|
|
+ if(this.currentItemData.bigCount<=0 && this.currentItemData.smallCount<=0){
|
|
|
+ this.delAllEvent(this.currentItemData)
|
|
|
+ }
|
|
|
+ this.addModelCancel();
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ //二个都不是数值
|
|
|
+ if(/(^[1-9]\d*$)/.test(this.currentItemData.bigCount) == false && /(^[1-9]\d*$)/.test(this.currentItemData.smallCount) == false){
|
|
|
+ this.delAllEvent(this.currentItemData)
|
|
|
+ this.addModelCancel();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(/(^[1-9]\d*$)/.test(this.currentItemData.bigCount)){
|
|
|
+ if(this.currentItemData.bigCount<=0){
|
|
|
+ uni.showToast({title:"数量要大于0",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(/(^[1-9]\d*$)/.test(this.currentItemData.smallCount)){
|
|
|
+ if(this.currentItemData.smallCount<=0){
|
|
|
+ uni.showToast({title:"数量要大于0",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.currentItemData.userPrice) == false){
|
|
|
+ uni.showToast({title:"金额错误",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.currentItemData.userPrice <=0){
|
|
|
+ uni.showToast({title:"金额要大于0",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.currentItemData;
|
|
|
+ const ratioNum = Number(ratio);
|
|
|
+ if (Number(bigCount) * ratioNum + Number(smallCount) > Number(bigNum) * ratioNum + Number(smallNum)) {
|
|
|
+ uni.showToast({ title: '数量还剩'+bigNum, icon: "none" })
|
|
|
+ this.$util.noStockRemind()
|
|
|
+ } else {
|
|
|
+ this.updateItemEvent(this.currentItemData);
|
|
|
+ this.addModelCancel();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ //显示可以修改花材的弹框
|
|
|
+ showAddModel(info) {
|
|
|
+ this.currentModelShow = true
|
|
|
+ this.currentItemData = info;
|
|
|
+ this.currentItemFocus = false;
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.currentItemData.smallCount = this.currentItemData.smallCount==0?null:this.currentItemData.smallCount;
|
|
|
+ this.currentItemData.bigCount = this.currentItemData.bigCount==0?null:this.currentItemData.bigCount;
|
|
|
+ if(this.currentItemData.userPrice == null || this.currentItemData.userPrice == 0){
|
|
|
+ this.currentItemData.userPrice = this.currentItemData.bigPrice;
|
|
|
+ }else{
|
|
|
+ this.currentItemData.userPrice = this.currentItemData.userPrice;
|
|
|
+ }
|
|
|
+ this.currentItemFocus = true;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //删除花材
|
|
|
+ delItem(item) {
|
|
|
+ let variety = item.variety
|
|
|
+ if(variety == 0){
|
|
|
+ this.delEvent(item)
|
|
|
+ }else{
|
|
|
+ this.$msg("小菊请去列表页修改")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //添加花材
|
|
|
+ addItem(item) {
|
|
|
+ let variety = item.variety
|
|
|
+ if(variety == 0){
|
|
|
+ const ratio = Number(item.ratio);
|
|
|
+ if(this.checkStock){
|
|
|
+ if(item.stock<=0){
|
|
|
+ this.$msg("库存不足")
|
|
|
+ this.$util.noStockRemind()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (Number(item.bigCount) * ratio + Number(item.smallCount) >= Number(item.bigNum) * ratio + Number(item.smallNum)) {
|
|
|
+ this.$msg("库存不足")
|
|
|
+ this.$util.noStockRemind()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.addEvent(item)
|
|
|
+ }else{
|
|
|
+ this.$msg("小菊请去列表页修改")
|
|
|
+ }
|
|
|
+ },
|
|
|
init () {
|
|
|
this._getDet();
|
|
|
},
|
|
|
@@ -447,6 +600,59 @@ export default {
|
|
|
font-size: 24upx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+& .open-bx {
|
|
|
+ align-items: center;
|
|
|
+ & .iconfont {
|
|
|
+ color: #3385ff;
|
|
|
+ font-size: 42upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .position{
|
|
|
+ display: block;
|
|
|
+ width: 70upx;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .iconcachu {
|
|
|
+ margin: 0 6px 0 20upx;
|
|
|
+ color: #ccc;
|
|
|
+ &.edit {
|
|
|
+ color: #3385ff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & > .num {
|
|
|
+ display: inline-block;
|
|
|
+ width: 120upx;
|
|
|
+ height:45upx;
|
|
|
+ text-align:center;
|
|
|
+ margin: 0 8upx;
|
|
|
+ color: #868686;
|
|
|
+ border-radius: 22upx;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ padding: 3px 0;
|
|
|
+ font-size: 25upx;
|
|
|
+ }
|
|
|
+ .change-input {
|
|
|
+ width: 164upx;
|
|
|
+ height: 60upx;
|
|
|
+ line-height: 60upx;
|
|
|
+ text-align: center;
|
|
|
+ background: #ffffff;
|
|
|
+ border: 1px solid #dddddd;
|
|
|
+ border-radius: 4upx;
|
|
|
+ font-size: 25upx;
|
|
|
+ }
|
|
|
+ .btn-box{
|
|
|
+ width: 100upx;
|
|
|
+ height: 60upx;
|
|
|
+ line-height: 60upx;
|
|
|
+ color: #ffffff;
|
|
|
+ background: #3385ff;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 10upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -553,5 +759,32 @@ export default {
|
|
|
width: 200upx;
|
|
|
}
|
|
|
}
|
|
|
+ .select-cmd_bx {
|
|
|
+ & .kc {
|
|
|
+ color: #999999;
|
|
|
+ font-size: 28upx;
|
|
|
+ font-weight: 400;
|
|
|
+ margin-bottom: 40upx;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 30upx;
|
|
|
+ .unit_price{
|
|
|
+ padding-right:25upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & .num_bx {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 40upx;
|
|
|
+ & > input {
|
|
|
+ width: 212upx;
|
|
|
+ height: 80upx;
|
|
|
+ border: 1px solid #dddddd;
|
|
|
+ border-radius: 4upx;
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 24upx;
|
|
|
+ font-size: 40upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|