|
@@ -65,22 +65,29 @@
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
- <view class="tui-title">送货</view>
|
|
|
|
|
|
|
+ <view class="tui-title">配送方式</view>
|
|
|
<button @tap="courier(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">自取</button>
|
|
<button @tap="courier(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">自取</button>
|
|
|
<button @click="courier(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">配送</button>
|
|
<button @click="courier(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">配送</button>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
|
|
- <view class="tui-title">结算类型</view>
|
|
|
|
|
- <button @tap="form.debt = 1" class="admin-button-com mini-btn" :class="form.debt == 1 ? 'blue' : 'default'">欠款</button>
|
|
|
|
|
- <button @click="form.debt = 0" class="admin-button-com mini-btn" :class="form.debt == 0 ? 'blue' : 'default'">已收款</button>
|
|
|
|
|
- </tui-list-cell>
|
|
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" v-show="form.sendType == 1" >
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" v-show="form.sendType == 1" >
|
|
|
<view class="tui-title">运费</view>
|
|
<view class="tui-title">运费</view>
|
|
|
<input @blur="sendCostBlur" type="number" placeholder="请填写,留空免运费" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
|
|
<input @blur="sendCostBlur" type="number" placeholder="请填写,留空免运费" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :arrow="true" v-if="form.debt == 0">
|
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
|
|
+ <view class="tui-title">结账状态</view>
|
|
|
|
|
+ <button @click="form.hasPay = 0" class="admin-button-com mini-btn" :class="form.hasPay == 0 ? 'blue' : 'default'">待结账</button>
|
|
|
|
|
+ <button @tap="form.hasPay = 1" class="admin-button-com mini-btn" :class="form.hasPay == 1 ? 'blue' : 'default'">已结账</button>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" v-if="form.hasPay == 1" :hover="false" :arrow="false">
|
|
|
|
|
+ <view class="tui-title">结账方式</view>
|
|
|
|
|
+ <button @click="form.debt = 0" class="admin-button-com mini-btn" :class="form.debt == 0 ? 'blue' : 'default'">已付款</button>
|
|
|
|
|
+ <button @tap="form.debt = 1" class="admin-button-com mini-btn" :class="form.debt == 1 ? 'blue' : 'default'">记欠款</button>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :arrow="true" v-if="form.hasPay == 1 && form.debt == 0">
|
|
|
<div class="tui-title">收款方式</div>
|
|
<div class="tui-title">收款方式</div>
|
|
|
<picker mode="selector" :value="form.payWay" :range="payWayList" range-key="name" @change="payWayChange" class="tui-input" >
|
|
<picker mode="selector" :value="form.payWay" :range="payWayList" range-key="name" @change="payWayChange" class="tui-input" >
|
|
|
<input v-model="form.payWay" name="payWay" type="text" hidden />
|
|
<input v-model="form.payWay" name="payWay" type="text" hidden />
|
|
@@ -88,6 +95,12 @@
|
|
|
</picker>
|
|
</picker>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
|
|
+ <view class="tui-title">打印小票</view>
|
|
|
|
|
+ <button @click="form.needPrint = 1" class="admin-button-com mini-btn" :class="form.needPrint == 1 ? 'blue' : 'default'">打印</button>
|
|
|
|
|
+ <button @tap="form.needPrint = 2" class="admin-button-com mini-btn" :class="form.needPrint == 2? 'blue' : 'default'">不打</button>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
<view class="tui-title">总金额</view>
|
|
<view class="tui-title">总金额</view>
|
|
|
<text style="color: #3385FF" v-if="form.sendType == 1">{{ parseFloat((allPrice + Number(form.sendCost)).toFixed(2)) }}</text>
|
|
<text style="color: #3385FF" v-if="form.sendType == 1">{{ parseFloat((allPrice + Number(form.sendCost)).toFixed(2)) }}</text>
|
|
@@ -103,9 +116,7 @@
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
<view class="tui-title">
|
|
<view class="tui-title">
|
|
|
- <text>
|
|
|
|
|
- <text v-if="form.debt == 1">应收金额</text><text v-else>已收金额</text>
|
|
|
|
|
- </text>
|
|
|
|
|
|
|
+ <text>最终金额</text>
|
|
|
</view>
|
|
</view>
|
|
|
<text style="color: #3385FF">{{parseFloat(finalPrice)}}</text>
|
|
<text style="color: #3385FF">{{parseFloat(finalPrice)}}</text>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
@@ -123,12 +134,12 @@
|
|
|
<view class="under-bar">
|
|
<view class="under-bar">
|
|
|
<view class="price-view">
|
|
<view class="price-view">
|
|
|
<text class="price-title" v-if="isBilling">
|
|
<text class="price-title" v-if="isBilling">
|
|
|
- <text>{{form.debt == 1 ? "欠款" : "已收款"}}</text>
|
|
|
|
|
|
|
+ <text>最终金额</text>
|
|
|
</text>
|
|
</text>
|
|
|
<text class="price-title" v-else>金额</text>
|
|
<text class="price-title" v-else>金额</text>
|
|
|
<text class="price-number">¥<text class="large">{{ finalPrice }}</text></text>
|
|
<text class="price-number">¥<text class="large">{{ finalPrice }}</text></text>
|
|
|
</view>
|
|
</view>
|
|
|
- <button class="admin-button-com blue middle" @click="confirmSubmit">开单</button>
|
|
|
|
|
|
|
+ <button class="admin-button-com blue middle" @click="confirmSubmit">提交</button>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -151,7 +162,7 @@ import { mapActions, mapGetters } from "vuex";
|
|
|
import { getUserDet} from "@/api/member";
|
|
import { getUserDet} from "@/api/member";
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
import ModalModule from "@/components/plugin/modal";
|
|
|
export default {
|
|
export default {
|
|
|
- name: "BillingAffirm", // 开单确认
|
|
|
|
|
|
|
+ name: "BillingAffirm",
|
|
|
components: {
|
|
components: {
|
|
|
TuiListCell,
|
|
TuiListCell,
|
|
|
AppAvatarModule,
|
|
AppAvatarModule,
|
|
@@ -171,7 +182,7 @@ export default {
|
|
|
payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
|
|
payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
|
|
|
payWayindex:0,
|
|
payWayindex:0,
|
|
|
form: {
|
|
form: {
|
|
|
- debt: 1, //付款方式 1欠款订单 0正常订单
|
|
|
|
|
|
|
+ debt:0, //1欠款 0已收款
|
|
|
shopId: "",
|
|
shopId: "",
|
|
|
shopName: "",
|
|
shopName: "",
|
|
|
receiveProvince: "",
|
|
receiveProvince: "",
|
|
@@ -190,6 +201,7 @@ export default {
|
|
|
remark:"",
|
|
remark:"",
|
|
|
payWay:0,
|
|
payWay:0,
|
|
|
needPrint:1,//订单生成时打印订单1需要2不需要
|
|
needPrint:1,//订单生成时打印订单1需要2不需要
|
|
|
|
|
+ hasPay:0
|
|
|
},
|
|
},
|
|
|
money: "",
|
|
money: "",
|
|
|
showCustomer: false,
|
|
showCustomer: false,
|
|
@@ -225,7 +237,6 @@ export default {
|
|
|
that.$forceUpdate()
|
|
that.$forceUpdate()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
onShow(){
|
|
onShow(){
|
|
|
if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
|
|
if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
|
|
@@ -312,34 +323,8 @@ export default {
|
|
|
this.form.customId = info.id;
|
|
this.form.customId = info.id;
|
|
|
this.form.customName = info.name;
|
|
this.form.customName = info.name;
|
|
|
},
|
|
},
|
|
|
- confirmFn (options) {
|
|
|
|
|
- let that = this
|
|
|
|
|
- if (options.sendType == 2) {
|
|
|
|
|
- options.sendCost = "";
|
|
|
|
|
- }
|
|
|
|
|
- let Fn = createOrder
|
|
|
|
|
- let params = {...options,modifyPrice: this.finalPrice,newVersion:1};
|
|
|
|
|
- if(this.option.orderId && this.option.orderId > 0){
|
|
|
|
|
- Fn = updateOrder
|
|
|
|
|
- params = {...params,id:this.option.orderId}
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //小菊
|
|
|
|
|
- let xj = uni.getStorageSync("xj"+this.option.customId)
|
|
|
|
|
- params = {...params,xj:JSON.stringify(xj)}
|
|
|
|
|
-
|
|
|
|
|
- Fn(params).then((res) => {
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- //删除记忆花材
|
|
|
|
|
- this.removeMemoryDirect(that.option.customId)
|
|
|
|
|
- const {data: { id, orderSn },} = res;
|
|
|
|
|
- this.$util.pageTo({ url: '/admin/billing/result',type:2,query: {orderId:id,orderSn:orderSn}})
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
confirmSubmit () {
|
|
confirmSubmit () {
|
|
|
let self = this;
|
|
let self = this;
|
|
|
-
|
|
|
|
|
let rules = [
|
|
let rules = [
|
|
|
{
|
|
{
|
|
|
name: "customId",
|
|
name: "customId",
|
|
@@ -347,63 +332,60 @@ export default {
|
|
|
msg: ["请选择客户"],
|
|
msg: ["请选择客户"],
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
|
- let checkRes = formUtil.validation(this.form, rules);
|
|
|
|
|
- if (checkRes) {
|
|
|
|
|
- this.$msg(checkRes);
|
|
|
|
|
|
|
+ let hasError = formUtil.validation(this.form, rules);
|
|
|
|
|
+ if (hasError) {
|
|
|
|
|
+ this.$msg(hasError);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
- title: "提示",
|
|
|
|
|
- content: "打印小票?",
|
|
|
|
|
- cancelText: "不打",
|
|
|
|
|
- confirmText: "打印",
|
|
|
|
|
- confirmColor: '#39B54A',
|
|
|
|
|
- cancelColor: '#777777',
|
|
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '确认提交?',
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
|
|
- self.form.needPrint = 1
|
|
|
|
|
- self.formSubmit();
|
|
|
|
|
- }else{
|
|
|
|
|
- self.form.needPrint = 2
|
|
|
|
|
- self.formSubmit();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ self.formSubmit();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- // 表单验证
|
|
|
|
|
async formSubmit () {
|
|
async formSubmit () {
|
|
|
- try {
|
|
|
|
|
- this.form;
|
|
|
|
|
- let formData = this.form;
|
|
|
|
|
- let price = 0;
|
|
|
|
|
- const product = this.selectList.map((ele) => {
|
|
|
|
|
- price += ele.bigCount * Number(ele.bigPrice);
|
|
|
|
|
- price += ele.smallCount * Number(ele.smallPrice);
|
|
|
|
|
- return {
|
|
|
|
|
- productId: ele.id,
|
|
|
|
|
- bigNum: ele.bigCount,
|
|
|
|
|
- smallNum: ele.smallCount,
|
|
|
|
|
- classId: ele.classId,
|
|
|
|
|
- itemId: ele.itemId,
|
|
|
|
|
- price: ele.userPrice>0?ele.userPrice:price,
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- formData.product = JSON.stringify(product);
|
|
|
|
|
- if (!this.getMerchantInfo) {
|
|
|
|
|
- await this.initMerchantInfo();
|
|
|
|
|
- }
|
|
|
|
|
- formData.shopId = this.getMerchantInfo.id;
|
|
|
|
|
- let checkRes = formUtil.validation(formData, []);
|
|
|
|
|
- // 验证通过!
|
|
|
|
|
- if (!checkRes) {
|
|
|
|
|
- this.confirmFn(formData);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$msg(checkRes);
|
|
|
|
|
- }
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ let formData = this.form;
|
|
|
|
|
+ let price = 0;
|
|
|
|
|
+ const product = this.selectList.map((ele) => {
|
|
|
|
|
+ price += ele.bigCount * Number(ele.bigPrice);
|
|
|
|
|
+ price += ele.smallCount * Number(ele.smallPrice);
|
|
|
|
|
+ return {
|
|
|
|
|
+ productId: ele.id,
|
|
|
|
|
+ bigNum: ele.bigCount,
|
|
|
|
|
+ smallNum: ele.smallCount,
|
|
|
|
|
+ classId: ele.classId,
|
|
|
|
|
+ itemId: ele.itemId,
|
|
|
|
|
+ price: ele.userPrice>0?ele.userPrice:price,
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ formData.product = JSON.stringify(product);
|
|
|
|
|
+ if (!this.getMerchantInfo) {
|
|
|
|
|
+ await this.initMerchantInfo();
|
|
|
}
|
|
}
|
|
|
|
|
+ formData.shopId = this.getMerchantInfo.id;
|
|
|
|
|
+ if (formData.sendType == 2) {
|
|
|
|
|
+ formData.sendCost = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ let Fn = createOrder
|
|
|
|
|
+ let params = {...formData,modifyPrice: this.finalPrice,newVersion:1};
|
|
|
|
|
+ if(this.option.orderId && this.option.orderId > 0){
|
|
|
|
|
+ Fn = updateOrder
|
|
|
|
|
+ params = {...params,id:this.option.orderId}
|
|
|
|
|
+ }
|
|
|
|
|
+ Fn(params).then((res) => {
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ const {data: { id, orderSn,actPrice }} = res;
|
|
|
|
|
+ if(this.form.hasPay == 0){
|
|
|
|
|
+ this.$util.pageTo({ url: '/admin/billing/toPay',type:2,query: {orderId:id,orderSn:orderSn,actPrice:actPrice}})
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.$util.pageTo({ url: '/admin/billing/result',type:2,query: {orderId:id,orderSn:orderSn}})
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
gobackEvent () {
|
|
gobackEvent () {
|
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|