|
@@ -229,13 +229,13 @@
|
|
|
<button @click="form.sendType=1" class="admin-button-com mini-btn" :class="form.sendType==1?'blue':'default'">配送</button>
|
|
<button @click="form.sendType=1" class="admin-button-com mini-btn" :class="form.sendType==1?'blue':'default'">配送</button>
|
|
|
<button @tap="form.sendType=2" class="admin-button-com mini-btn" :class="form.sendType==2?'blue':'default'">自取</button>
|
|
<button @tap="form.sendType=2" class="admin-button-com mini-btn" :class="form.sendType==2?'blue':'default'">自取</button>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
- <appSendTime :sendDate.sync="form.sendDate" :sendTime.sync="form.sendTime" ></appSendTime>
|
|
|
|
|
|
|
+ <appSendTime @alterTime="purchaseFreight(ghsMsg)" :sendDate.sync="form.sendDate" :sendTime.sync="sendTime" ></appSendTime>
|
|
|
<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 type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder">
|
|
<input type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder">
|
|
|
</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">
|
|
|
- <textarea style="height: 100rpx" placeholder="备注..."/>
|
|
|
|
|
|
|
+ <textarea style="height: 100rpx" v-model="remark" placeholder="备注..."/>
|
|
|
</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>-->
|
|
@@ -250,7 +250,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="under-bar">
|
|
<view class="under-bar">
|
|
|
<view class="price-view">
|
|
<view class="price-view">
|
|
|
- <text class="price-title">{{ form.debt==1?'欠款':'已收款' }}</text>
|
|
|
|
|
|
|
+ <text class="price-title">总金额</text>
|
|
|
<text class="price-number">
|
|
<text class="price-number">
|
|
|
¥ <text class="large">{{ allPrice+Number(form.sendCost) }}</text>
|
|
¥ <text class="large">{{ allPrice+Number(form.sendCost) }}</text>
|
|
|
</text>
|
|
</text>
|
|
@@ -258,7 +258,7 @@
|
|
|
<button class="admin-button-com blue middle" @click="affirmFormSubmit">开单</button>
|
|
<button class="admin-button-com blue middle" @click="affirmFormSubmit">开单</button>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 选择客户 -->
|
|
<!-- 选择客户 -->
|
|
|
- <AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />
|
|
|
|
|
|
|
+<!-- <AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />-->
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -274,9 +274,9 @@ import appAddressGroup from "@/components/app-address-group";
|
|
|
import appSendTime from "@/components/app-send-time";
|
|
import appSendTime from "@/components/app-send-time";
|
|
|
import appFormSend from "@/components/app-form-send";
|
|
import appFormSend from "@/components/app-form-send";
|
|
|
const formUtil = require("@/utils/formValidation.js");
|
|
const formUtil = require("@/utils/formValidation.js");
|
|
|
-import { createOrder,freight } from "@/api/order/index";
|
|
|
|
|
|
|
+// import { createOrder } from "@/api/order/index";
|
|
|
import { getGhsDataApi } from "@/api/ghs/index";
|
|
import { getGhsDataApi } from "@/api/ghs/index";
|
|
|
-// import { freight } from "@/api/order";
|
|
|
|
|
|
|
+import { freight,createOrder } from "@/api/purchase/index";
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -297,6 +297,8 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
autoLoad: false,
|
|
autoLoad: false,
|
|
|
ghsMsg:'',
|
|
ghsMsg:'',
|
|
|
|
|
+ sendTime:'',
|
|
|
|
|
+ remark:'',
|
|
|
form: {
|
|
form: {
|
|
|
debt:1,//结算方式 1欠款订单 0正常订单
|
|
debt:1,//结算方式 1欠款订单 0正常订单
|
|
|
shopId: "",
|
|
shopId: "",
|
|
@@ -350,7 +352,9 @@ export default {
|
|
|
},
|
|
},
|
|
|
getGhsData(id) {
|
|
getGhsData(id) {
|
|
|
getGhsDataApi({id:id}).then(res => {
|
|
getGhsDataApi({id:id}).then(res => {
|
|
|
- this.ghsMsg = res.data
|
|
|
|
|
|
|
+ this.ghsMsg = res.data;
|
|
|
|
|
+ console.log('res.data',this.ghsMsg)
|
|
|
|
|
+ this.purchaseFreight(this.ghsMsg);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
countAllPrices(e){
|
|
countAllPrices(e){
|
|
@@ -372,8 +376,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- changeCustomerFn(info) {
|
|
|
|
|
- console.log("changeCustomerFn", info);
|
|
|
|
|
|
|
+ purchaseFreight(info) {
|
|
|
let params = {
|
|
let params = {
|
|
|
province: info.province,
|
|
province: info.province,
|
|
|
city:info.city,
|
|
city:info.city,
|
|
@@ -381,12 +384,11 @@ export default {
|
|
|
floor:info.floor,
|
|
floor:info.floor,
|
|
|
long: info.long,
|
|
long: info.long,
|
|
|
lat: info.lat,
|
|
lat: info.lat,
|
|
|
|
|
+ sendTime: this.sendTime,
|
|
|
};
|
|
};
|
|
|
freight(params).then(res => {
|
|
freight(params).then(res => {
|
|
|
this.form.sendCost = res.data.sedCost;
|
|
this.form.sendCost = res.data.sedCost;
|
|
|
});
|
|
});
|
|
|
- this.form.customId = info.id;
|
|
|
|
|
- this.form.customName = info.name;
|
|
|
|
|
},
|
|
},
|
|
|
confirmFn(options) {
|
|
confirmFn(options) {
|
|
|
createOrder(options).then(res => {
|
|
createOrder(options).then(res => {
|
|
@@ -409,13 +411,34 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
affirmFormSubmit(){
|
|
affirmFormSubmit(){
|
|
|
|
|
+ if(this.sendTime==''){uni.showToast({title:'请先选择时间',icon:'none'});return}
|
|
|
|
|
+ const product = this.selectList.map(ele => {
|
|
|
|
|
+ return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
|
|
|
|
|
+ });
|
|
|
|
|
+ let parameter = {
|
|
|
|
|
+ getType:this.form.sendType,
|
|
|
|
|
+ sendTime:this.sendTime,
|
|
|
|
|
+ sendCost:this.form.sendCost,
|
|
|
|
|
+ remark:this.remark,
|
|
|
|
|
+ product:product,
|
|
|
|
|
+ supplierId:this.ghsMsg.id,
|
|
|
|
|
+ }
|
|
|
let self = this;
|
|
let self = this;
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
|
content: '确认开单?',
|
|
content: '确认开单?',
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
|
- self.formSubmit();
|
|
|
|
|
|
|
+ createOrder(parameter).then(res => {
|
|
|
|
|
+ self.resetSelectInfoByType(self.pageType);
|
|
|
|
|
+ const {data: { id, orderSn }} = res;
|
|
|
|
|
+ // 如果是客户跳转到客户成功页pagesClient/official/clientApply 供货员工下单到 /admin/billing/result
|
|
|
|
|
+ let url =
|
|
|
|
|
+ self.getLoginInfo.identity == "1"
|
|
|
|
|
+ ? "pagesClient/official/clientApply"
|
|
|
|
|
+ : `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
|
|
|
|
|
+ uni.redirectTo({url: url,});
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|