|
|
@@ -12,16 +12,34 @@
|
|
|
<view class="info-line">
|
|
|
<text class="item-name">{{ item.name||'' }}</text>
|
|
|
<text class="item-price">
|
|
|
- <text class="price">¥{{item.totalPrice ? item.totalPrice : 0}}</text>
|
|
|
+ <text class="price">¥{{item.userPrice ? item.userPrice : 0}}</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
- <view class="info-line">
|
|
|
- <text class="item-type"></text>
|
|
|
- <text class="item-count">
|
|
|
- <text v-if="Number(item.bigCount)>0">{{`${item.bigCount}`}}扎 × ¥{{item.userPrice}}</text>
|
|
|
- <text v-if="Number(item.smallCount)>0">{{`${item.smallCount}`}}支 × ¥{{item.userPrice}}</text>
|
|
|
+
|
|
|
+
|
|
|
+ <view style="text-align:right;position: relative;">
|
|
|
+
|
|
|
+ <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-if="Number(item.bigCount)>0">¥{{ parseFloat((Number(item.bigCount)*Number(item.userPrice)).toFixed(2)) }}</text>
|
|
|
+ <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-else>¥{{ parseFloat((Number(item.smallCount)*Number(item.userPrice)).toFixed(2)) }}</text>
|
|
|
+
|
|
|
+ <view class="open-bx">
|
|
|
+ <i class="iconfont iconjian" @click.stop="delItemFn(item)" v-if="item.bigCount > 0" ></i>
|
|
|
+ <block v-else>
|
|
|
+ <i class="iconfont iconjian" @click.stop="delItemFn(item)" v-if="item.smallCount > 0" ></i>
|
|
|
+ </block>
|
|
|
+ <text class="num" @click.stop="showAddModelFn(item)" >
|
|
|
+ <text v-if="Number(item.bigCount)>0" style="color:#3385FF;">{{`${item.bigCount}`}}</text>
|
|
|
+ <block v-else>
|
|
|
+ <text v-if="item.smallCount > 0">{{`${item.smallCount}`}}</text>
|
|
|
+ </block>
|
|
|
</text>
|
|
|
+ <i class="iconfont iconzeng" @click.stop="showAddModelFn(item)" ></i>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -197,6 +215,27 @@
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
|
|
|
+ <modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.name" color="#333" :size="32" padding="30rpx 30rpx" :button="showButton" >
|
|
|
+ <template slot="customContent">
|
|
|
+ <view class="select-view">
|
|
|
+ <view class="select-cmd_bx">
|
|
|
+ <view class="num_bx">
|
|
|
+ <input v-model="customData.bigCount" type="number" v-if="cgUnitType == 0" @focus="customData.bigCount = null" placeholder="扎数" @input="bigCountChange" />
|
|
|
+ <input v-model="customData.smallCount" type="number" v-else @focus="customData.smallCount = null" placeholder="支数" @input="smallCountChange" />
|
|
|
+ <input v-model="customData.userPrice" @focus="customData.userPrice = null" type="digit" placeholder="单价" @input="userPriceChange" />
|
|
|
+ <input v-model="customData.totalPrice" @focus="customData.totalPrice = null" type="digit" placeholder="总价" @input="totalPriceChange" />
|
|
|
+ </view>
|
|
|
+ <view v-if="customData.aboutPrice == 1" style="margin-top:16upx;text-align:center;color:blue;font-size:26upx;">单价为近似值</view>
|
|
|
+ <view v-else style="margin-top:16upx;text-align:center;font-size:26upx;">----</view>
|
|
|
+ <view style="text-align: center;">
|
|
|
+ <switch :checked="customData.assignSeat == 1 ? true : false" @change="changeAssignSeat" style="transform: scale(0.7,0.7);" />{{customData.assignSeat == 0?'无':''}}货位
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <image @click="switchUnitType" :src="`${constant.imgUrl}/icon/switch/switch128.png`" mode="widthFix" style="width:60upx;height:60upx;position:absolute;top:32upx;left:30upx;" ></image>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </modal-module>
|
|
|
+
|
|
|
<mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="showPicker = false" />
|
|
|
|
|
|
</view>
|
|
|
@@ -208,13 +247,14 @@ import TuiListCell from "@/components/plugin/list-cell";
|
|
|
import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
import AppCustomerSel from "@/components/app-customer-sel";
|
|
|
const form = require("@/utils/formValidation.js");
|
|
|
-import productMins from "@/mixins/product";
|
|
|
+import productMins from "@/mixins/product2";
|
|
|
import {getPurchaseDetailApi,createPurchaseOrderApi} from "@/api/purchase";
|
|
|
import { PURCHASE_ORDER_STATUS } from "@/utils/declare";
|
|
|
import AppDatePicker from "@/components/app-date-picker";
|
|
|
import { getPrint } from "@/api/shop";
|
|
|
import { getAllStaff } from "@/api/shop-admin"
|
|
|
import { getShopInfoApi } from "@/api/common"
|
|
|
+import ModalModule from "@/components/plugin/modal";
|
|
|
import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -222,7 +262,8 @@ export default {
|
|
|
AppAvatarModule,
|
|
|
AppCustomerSel,
|
|
|
AppDatePicker,
|
|
|
- MxDatePicker
|
|
|
+ MxDatePicker,
|
|
|
+ ModalModule
|
|
|
},
|
|
|
mixins: [productMins],
|
|
|
data() {
|
|
|
@@ -259,8 +300,10 @@ export default {
|
|
|
perKgFreight:0,
|
|
|
location:0,
|
|
|
wcPrintList:[],
|
|
|
+ globalCgMyCharge:0,
|
|
|
+ globalCheckStock:false,
|
|
|
cgUnitType:0,
|
|
|
- globalCgMyCharge:0
|
|
|
+ showButton:[{text: '取消',plain: true}, {text: '确定',plain: false}],
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
@@ -384,6 +427,86 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ delItemFn(info){
|
|
|
+ info.bigCount = 0
|
|
|
+ info.smallCount = 0
|
|
|
+ this.replaceItemFn(info,1)
|
|
|
+ },
|
|
|
+ changeAssignSeat(e){
|
|
|
+ this.customData.assignSeat = e.detail.value == true ? 1 : 0
|
|
|
+ },
|
|
|
+ switchUnitType(){
|
|
|
+ if(this.cgUnitType == 0){
|
|
|
+ this.cgUnitType = 1
|
|
|
+ this.customData.userPrice = parseFloat(this.customData.smallPrice)
|
|
|
+ this.customData.bigCount = null
|
|
|
+ }else{
|
|
|
+ this.cgUnitType = 0
|
|
|
+ this.customData.userPrice = parseFloat(this.customData.bigPrice)
|
|
|
+ this.customData.smallCount = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ userPriceChange(){
|
|
|
+ if(Number(this.customData.userPrice)>0){
|
|
|
+ if(this.cgUnitType == 0){
|
|
|
+ if(Number(this.customData.bigCount)>0){
|
|
|
+ this.customData.totalPrice = Number(this.customData.bigCount)*Number(this.customData.userPrice)
|
|
|
+ this.customData.totalPrice = parseFloat(this.customData.totalPrice.toFixed(2))
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(Number(this.customData.smallCount)>0){
|
|
|
+ this.customData.totalPrice = Number(this.customData.smallCount)*Number(this.customData.userPrice)
|
|
|
+ this.customData.totalPrice = parseFloat(this.customData.totalPrice.toFixed(2))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ bigCountChange(){
|
|
|
+ if(Number(this.customData.bigCount)>0){
|
|
|
+ if(Number(this.customData.userPrice)>0){
|
|
|
+ this.customData.totalPrice = Number(this.customData.bigCount)*Number(this.customData.userPrice)
|
|
|
+ this.customData.totalPrice = parseFloat(this.customData.totalPrice.toFixed(2))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ smallCountChange(){
|
|
|
+ if(Number(this.customData.smallCount)>0){
|
|
|
+ if(Number(this.customData.userPrice)>0){
|
|
|
+ this.customData.totalPrice = Number(this.customData.smallCount)*Number(this.customData.userPrice)
|
|
|
+ this.customData.totalPrice = parseFloat(this.customData.totalPrice.toFixed(2))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ totalPriceChange(){
|
|
|
+ if(Number(this.customData.totalPrice)>0){
|
|
|
+ if(this.cgUnitType == 0){
|
|
|
+ if(Number(this.customData.bigCount)>0){
|
|
|
+ let a = Number(this.customData.totalPrice)/Number(this.customData.bigCount)
|
|
|
+ this.customData.userPrice = Math.floor(a*100)/100
|
|
|
+
|
|
|
+ let newNum = Number(this.customData.userPrice)*Number(this.customData.bigCount)
|
|
|
+ newNum = parseFloat(newNum.toFixed(2))
|
|
|
+ if(Number(this.customData.totalPrice) > Number(newNum)){
|
|
|
+ this.customData.aboutPrice = 1
|
|
|
+ }else{
|
|
|
+ this.customData.aboutPrice = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(Number(this.customData.smallCount)>0){
|
|
|
+ let a = Number(this.customData.totalPrice)/Number(this.customData.smallCount)
|
|
|
+ this.customData.userPrice = Math.floor(a*100)/100
|
|
|
+ let newNum = Number(this.customData.userPrice)*Number(this.customData.smallCount)
|
|
|
+ newNum = parseFloat(newNum.toFixed(2))
|
|
|
+ if(Number(this.customData.totalPrice) > Number(newNum)){
|
|
|
+ this.customData.aboutPrice = 1
|
|
|
+ }else{
|
|
|
+ this.customData.aboutPrice = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
getCgStaff(staff){
|
|
|
this.$refs.staffRef.close()
|
|
|
this.form.cgStaffName = staff.name
|
|
|
@@ -629,6 +752,48 @@ export default {
|
|
|
font-size: 32upx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ & .open-bx {
|
|
|
+ align-items: center;
|
|
|
+ display: inline-flex;
|
|
|
+ & .iconfont {
|
|
|
+ color: #4db0e4;
|
|
|
+ font-size: 55upx;
|
|
|
+ }
|
|
|
+ .icondelete {
|
|
|
+ margin: 0 10upx 0 30upx;
|
|
|
+ color: #ccc;
|
|
|
+ &.edit {
|
|
|
+ color: #4db0e4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ & > .num {
|
|
|
+ display: inline-block;
|
|
|
+ width: 120upx;
|
|
|
+ height:50upx;
|
|
|
+ line-height:50upx;
|
|
|
+ text-align: center;
|
|
|
+ margin: 0 8upx;
|
|
|
+ color: #868686;
|
|
|
+ border-radius: 22upx;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ font-size: 33upx;
|
|
|
+ }
|
|
|
+ .change-input {
|
|
|
+ width: 164upx;
|
|
|
+ height: 60upx;
|
|
|
+ line-height: 60upx;
|
|
|
+ text-align: center;
|
|
|
+ background: #ffffff;
|
|
|
+ border: 1upx solid #dddddd;
|
|
|
+ border-radius: 4upx;
|
|
|
+ font-size: 28upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -723,4 +888,31 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.select-view {
|
|
|
+ margin-bottom: 30upx;
|
|
|
+}
|
|
|
+.select-cmd_bx {
|
|
|
+ margin-top:80upx;
|
|
|
+ & .num_bx {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .kc {
|
|
|
+ width: 80upx;
|
|
|
+ font-size:32upx;
|
|
|
+ }
|
|
|
+ & > text{
|
|
|
+ width:100upx;
|
|
|
+ font-size:30upx;
|
|
|
+ }
|
|
|
+ & > input {
|
|
|
+ flex: 1;
|
|
|
+ height: 80upx;
|
|
|
+ border: 1upx solid #dddddd;
|
|
|
+ border-radius: 4upx;
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 24upx;
|
|
|
+ font-size: 32upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|