|
|
@@ -26,7 +26,7 @@
|
|
|
<text style="color:#3385FF;font-weight:bold;">合计 ¥<text>{{orderTotalPrice}}</text></text>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="form.fromType == 3">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
<view class="tui-title">收款方式</view>
|
|
|
<button @click="form.hasPay = 4" class="admin-button-com middle" :class="form.hasPay == 4 ? 'blue' : 'default'">余额</button>
|
|
|
<button @click="form.hasPay = 0" class="admin-button-com middle" :class="form.hasPay == 0 ? 'blue' : 'default'" style="margin-left:6upx;">扫码</button>
|
|
|
@@ -34,7 +34,7 @@
|
|
|
<button @tap="form.hasPay = 2" class="admin-button-com middle" :class="form.hasPay == 2 ? 'blue' : 'default'" style="margin-left:6upx;">赊账</button>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :arrow="true" v-if="form.hasPay == 1 && form.fromType == 3">
|
|
|
+ <tui-list-cell class="line-cell" :arrow="true" v-if="form.hasPay == 1">
|
|
|
<view class="tui-title">线下渠道</view>
|
|
|
<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 />
|
|
|
@@ -77,11 +77,17 @@
|
|
|
<view>快捷开单</view>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">制作</view>
|
|
|
+ <button @tap="form.needWork = 1" class="admin-button-com middle" :class="form.needWork == 1 ? 'blue' : 'default'">需要</button>
|
|
|
+ <button @tap="form.needWork = 0" class="admin-button-com middle" :class="form.needWork == 0 ? 'blue' : 'default'" style="margin-left:30upx;">不要</button>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
</view>
|
|
|
</form>
|
|
|
<view class="button-group">
|
|
|
- <button class="admin-button-com big default" @click="goBack">取消</button>
|
|
|
- <button class="admin-button-com big blue" @click="handleConfirm">确认</button>
|
|
|
+ <button class="admin-button-com big default" @click="goBack" style="width:200upx;">取消</button>
|
|
|
+ <button class="admin-button-com big blue" @click="confirmOrder" style="width:200upx;margin-left:50upx;">确认</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -90,6 +96,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
+import { createOrder } from "@/api/order";
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
|
export default {
|
|
|
@@ -100,14 +107,14 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
form: {
|
|
|
- fromType: '3',
|
|
|
hasPay: 4,
|
|
|
payWay: 0,
|
|
|
num: 1,
|
|
|
sendType: 0,
|
|
|
reachDate: '',
|
|
|
reachPeriod: "12:00",
|
|
|
- remark: ''
|
|
|
+ remark: '',
|
|
|
+ needWork:1
|
|
|
},
|
|
|
goodsPrice: '',
|
|
|
payWayindex: 0,
|
|
|
@@ -121,7 +128,8 @@ export default {
|
|
|
['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],
|
|
|
['00', '05', '10','15','20','25','30','35','40','45','50','55']
|
|
|
],
|
|
|
- goodsName:''
|
|
|
+ goodsName:'',
|
|
|
+ goodsId:0
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -136,7 +144,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.goodsName = options.name?options.name:'';
|
|
|
+ this.goodsName = options.name?options.name:''
|
|
|
+ this.goodsId = options.id?options.id:0
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
@@ -148,13 +157,30 @@ export default {
|
|
|
goBack() {
|
|
|
uni.navigateBack({})
|
|
|
},
|
|
|
- handleCancel() {
|
|
|
- // 取消操作
|
|
|
- uni.navigateBack({})
|
|
|
- },
|
|
|
- handleConfirm() {
|
|
|
- // 确认操作
|
|
|
- console.log('确认提交', this.form);
|
|
|
+ confirmOrder() {
|
|
|
+ let product = [{productId:this.goodsId,bigNum:this.form.num,smallNum:null,property:0,num:this.form.num,unitType:0,unitPrice:this.form.goodsPrice}]
|
|
|
+ let json = JSON.stringify(product)
|
|
|
+ let customId = this.getMyShopInfo && Number(this.getMyShopInfo.defaultCustomId)>0 ? this.getMyShopInfo.defaultCustomId : 0
|
|
|
+ if(Number(customId)<=0){
|
|
|
+ this.$msg('请设置快捷开单的客户')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let params = {...this.form,modifyPrice: this.orderTotalPrice,version:3,orderType:1,product:json,customId:customId};
|
|
|
+
|
|
|
+ this.$util.confirmModal({content:'确认提交'},() => {
|
|
|
+ uni.showLoading({mask:true})
|
|
|
+ createOrder(params).then((res) => {
|
|
|
+ uni.hideLoading()
|
|
|
+ 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?orderId='+id,type:2})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
payWayChange(e) {
|
|
|
let index = e.detail.value;
|
|
|
@@ -237,7 +263,6 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
- gap: 60upx;
|
|
|
margin-top: 40upx;
|
|
|
padding: 0 30upx;
|
|
|
}
|