|
|
@@ -0,0 +1,356 @@
|
|
|
+<template>
|
|
|
+ <view class="affirm-page">
|
|
|
+ <view class="affirm-view overscroll">
|
|
|
+ <!-- 门店信息 -->
|
|
|
+ <form>
|
|
|
+ <!-- 登录信息 -->
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
+ <appFormSend :form.sync="form" :customId="customId"> </appFormSend>
|
|
|
+ </view>
|
|
|
+ </form>
|
|
|
+ </view>
|
|
|
+ <view class="under-bar">
|
|
|
+ <view class="price-view">
|
|
|
+<!-- <text class="price-title">收款</text>-->
|
|
|
+<!-- <text class="price-number">-->
|
|
|
+<!-- ¥ <text class="large">{{ allPrice }}</text>-->
|
|
|
+<!-- </text>-->
|
|
|
+ </view>
|
|
|
+ <button class="admin-button-com blue middle" @click="formSubmit">
|
|
|
+ 下单
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ <!-- 选择客户 -->
|
|
|
+ <AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import TuiListCell from "@/components/plugin/list-cell";
|
|
|
+import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
+import SimpleAddress from "@/components/plugin/simple-address";
|
|
|
+import AppAreaSel from "@/components/app-area-sel";
|
|
|
+import AppCustomerSel from "@/components/app-customer-sel";
|
|
|
+import productMins from "@/mixins/product";
|
|
|
+import appFormRadioBtn from "@/components/app-formRadio-btn";
|
|
|
+import appAddressGroup from "@/components/app-address-group";
|
|
|
+import appSendTime from "@/components/app-send-time";
|
|
|
+import appFormSend from "@/components/app-form-send1";
|
|
|
+const formUtil = require("@/utils/formValidation.js");
|
|
|
+import { createOrder } from "@/api/order/index";
|
|
|
+import { getUserDet } from "@/api/member/index";
|
|
|
+import { mapActions, mapGetters } from "vuex";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "BillingAffirm", // 开单确认
|
|
|
+ components: {
|
|
|
+ TuiListCell,
|
|
|
+ AppAvatarModule,
|
|
|
+ SimpleAddress,
|
|
|
+ AppAreaSel,
|
|
|
+ AppCustomerSel,
|
|
|
+ appFormRadioBtn,
|
|
|
+ appAddressGroup,
|
|
|
+ appSendTime,
|
|
|
+ appFormSend
|
|
|
+ },
|
|
|
+ mixins: [productMins],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ customId:'',
|
|
|
+ autoLoad: false,
|
|
|
+ form: {
|
|
|
+ shopId: "",
|
|
|
+ shopName: "",
|
|
|
+ receiveProvince: "",
|
|
|
+ receiveCity: "",
|
|
|
+ receiveFloor: "",
|
|
|
+ receiveAddress: "",
|
|
|
+ receiveLong: "",
|
|
|
+ receiveLat: "",
|
|
|
+ sendType: "3",
|
|
|
+ sendSide: "2",
|
|
|
+ sendDate: "",
|
|
|
+ sendTime: "",
|
|
|
+ sendCost: "",
|
|
|
+ customId: "",
|
|
|
+ product: ""
|
|
|
+ },
|
|
|
+
|
|
|
+ // 详细地址
|
|
|
+ // showRegion: false,
|
|
|
+ showCustomer: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad(e) {
|
|
|
+ this.customId = e.id
|
|
|
+ if (!this.getMerchantInfo) {
|
|
|
+ this.initMerchantInfo().then(data => {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: data.merchantName
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: this.getMerchantInfo.merchantName
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getMerchantInfo", "getLoginInfo"])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions(["initMerchantInfo"]),
|
|
|
+ init() {
|
|
|
+ this._getDet();
|
|
|
+ },
|
|
|
+ // api
|
|
|
+ _getDet() {
|
|
|
+ let data = uni.getStorageSync("modifyShopB");
|
|
|
+ if (this.$util.isEmpty(data)) return;
|
|
|
+ Object.keys(this.form).forEach((i, index) => {
|
|
|
+ // if (i != 'password') {
|
|
|
+ this.form[i] = data[i];
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ changeCustomerFn(info) {
|
|
|
+ console.log("changeCustomerFn", info);
|
|
|
+ this.form.customId = info.id;
|
|
|
+ this.form.customName = info.name;
|
|
|
+ },
|
|
|
+ confirmFn(options) {
|
|
|
+ createOrder(options).then(res => {
|
|
|
+ // this.$msg("下单成功");
|
|
|
+ this.resetSelectInfoByType(this.pageType);
|
|
|
+ const {
|
|
|
+ data: { orderId, orderSn }
|
|
|
+ } = res;
|
|
|
+ // 如果是客户跳转到客户成功页pagesClient/official/clientApply 供货员工下单到 /admin/billing/result
|
|
|
+ let url =
|
|
|
+ this.getLoginInfo.identity == "1"
|
|
|
+ ? "pagesClient/official/clientApply"
|
|
|
+ : `/admin/billing/result?orderId=${orderId}&orderSn=${orderSn}`;
|
|
|
+ uni.redirectTo({
|
|
|
+ url: url,
|
|
|
+ success: result => {},
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {}
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 表单验证
|
|
|
+ async formSubmit(e) {
|
|
|
+ try {
|
|
|
+ // 表单规则
|
|
|
+ let rules = [
|
|
|
+ {
|
|
|
+ name: "sendTime",
|
|
|
+ rule: ["required"],
|
|
|
+ msg: ["请输入具体时间"]
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ // 进行表单检查
|
|
|
+ let formData = this.form;
|
|
|
+ console.log(formData);
|
|
|
+ return;
|
|
|
+ if (formData.sendType == "1") {
|
|
|
+ } else {
|
|
|
+ let temp = [
|
|
|
+ {
|
|
|
+ name: "receiveProvince",
|
|
|
+ rule: ["required"],
|
|
|
+ msg: ["请选择地址"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "receiveAddress",
|
|
|
+ rule: ["required"],
|
|
|
+ msg: ["请填写详细地址"]
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ rules = rules.concat(temp);
|
|
|
+ }
|
|
|
+
|
|
|
+ const product = this.selectList.map(ele => {
|
|
|
+ return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
|
|
|
+ });
|
|
|
+ formData.product = JSON.stringify(product);
|
|
|
+ if (!this.getMerchantInfo) {
|
|
|
+ await this.initMerchantInfo();
|
|
|
+ }
|
|
|
+ formData.shopId = this.getMerchantInfo.id;
|
|
|
+ if (this.waySele == 1) {
|
|
|
+ formData.sendCost = "免运费";
|
|
|
+ }
|
|
|
+ console.log(9999, formData);
|
|
|
+ let checkRes = formUtil.validation(formData, rules);
|
|
|
+ // 验证通过!
|
|
|
+ if (!checkRes) {
|
|
|
+ this.confirmFn(formData);
|
|
|
+ } else {
|
|
|
+ this.$msg(checkRes);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(999999, error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ gobackEvent() {
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.affirm-page {
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .affirm-view {
|
|
|
+ flex: 1;
|
|
|
+ padding: 20px;
|
|
|
+ background-color: #f0f2f6;
|
|
|
+
|
|
|
+ .commodity-view {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .commodity-list {
|
|
|
+ padding: 20px;
|
|
|
+ .commodity-item {
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ .item-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 140px;
|
|
|
+ height: 140px;
|
|
|
+ }
|
|
|
+ .item-info {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 20px;
|
|
|
+ .info-line {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: flex-end;
|
|
|
+ .item-name {
|
|
|
+ color: #666;
|
|
|
+ font-size: 28px;
|
|
|
+ }
|
|
|
+ .item-price {
|
|
|
+ color: #333;
|
|
|
+ font-size: 22px;
|
|
|
+ .price {
|
|
|
+ font-size: 32px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .item-type {
|
|
|
+ color: #999;
|
|
|
+ font-size: 24px;
|
|
|
+ }
|
|
|
+ .item-count {
|
|
|
+ color: #666;
|
|
|
+ font-size: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .summary-bar {
|
|
|
+ padding: 0 20px;
|
|
|
+ height: 90px;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ border-top: 1px solid #eeeeee;
|
|
|
+ .operate-view {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ align-items: center;
|
|
|
+ color: #3385ff;
|
|
|
+ font-size: 26px;
|
|
|
+ .iconfont {
|
|
|
+ margin-right: 20px;
|
|
|
+ font-size: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .describe-view {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ align-items: center;
|
|
|
+ color: #333;
|
|
|
+ font-size: 24px;
|
|
|
+ .price {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 36px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .module-com {
|
|
|
+ background-color: #fff;
|
|
|
+ margin-bottom: 20px;
|
|
|
+
|
|
|
+ border-radius: 10px;
|
|
|
+ overflow: hidden;
|
|
|
+ .member-wrap {
|
|
|
+ .member-det {
|
|
|
+ font-size: 24px;
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .remark-wrap {
|
|
|
+ align-items: flex-start;
|
|
|
+ .remark {
|
|
|
+ height: 240px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // .tui-placeholder,
|
|
|
+ // .tui-input {
|
|
|
+ // padding-right: 30px;
|
|
|
+ // width: 100%;
|
|
|
+ // text-align: right;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .under-bar {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 20px;
|
|
|
+ width: 100%;
|
|
|
+ height: 100px;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ box-shadow: 0px -1px 6px 0px rgba(4, 0, 0, 0.06);
|
|
|
+ .price-view {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 24px;
|
|
|
+ .price-title {
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ .price-number {
|
|
|
+ margin: 0 20px;
|
|
|
+ color: #ff2842;
|
|
|
+ .large {
|
|
|
+ font-size: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .admin-button-com {
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|