Jelajahi Sumber

整改发货

jf 5 tahun lalu
induk
melakukan
fa93402c1f

+ 13 - 0
ghsApp/src/api/order/index.js

@@ -64,6 +64,19 @@ export const getDetB = data => {
 	return https.get("/order/detail", data);
 };
 
+/** *
+	* 延期收款 --姜枫 2021.03.20
+	*/
+export const debtPay = data => {
+	return https.get("/order/debt", data);
+};
+/** *
+	* 已收款 --姜枫 2021.03.20
+	*/
+export const hasPay = data => {
+	return https.get("/order/has-pay", data);
+};
+
 /** *
  * 未支付订单重选花材
  */

+ 12 - 0
ghsApp/src/components/app-address-group.vue

@@ -54,6 +54,7 @@
 import SimpleAddress from "@/components/plugin/simple-address";
 import AppAreaSel from "@/components/app-area-sel";
 import TuiListCell from "@/components/plugin/list-cell";
+import { getUserDet } from "@/api/member/index";
 export default {
 	name: "AppAddressGroup",
 	components: {
@@ -62,6 +63,7 @@ export default {
 		TuiListCell
 	},
 	props: {
+		customId:'',
 		cityTitle: {
 			type: String,
 			default: "所在城市"
@@ -95,7 +97,17 @@ export default {
 			showRegion: false
 		};
 	},
+	mounted(){
+		if(this.customId!=''){this.initAdress();}
+	},
 	methods: {
+		initAdress(){
+			return getUserDet({ id: this.customId }).then(res => {
+				this.form.province = res.data.province;
+				this.form.city = res.data.city;
+				this.$emit("selectAdress", this.form);
+			})
+		},
 		formatForm() {
 			Object.keys(this.form).forEach(i => {
 				this.form[i] = this.getFormObj[i];

+ 159 - 0
ghsApp/src/components/app-form-send1.vue

@@ -0,0 +1,159 @@
+<template>
+	<view>
+		<tui-list-cell class="line-cell" :hover="false" :arrow="true" >
+			<view class="tui-title">配送方</view>
+			<picker mode="selector" :value="sendSideIndex" :range="deliveryList" :range-key="'name'" @change="selectSideEvent" class="tui-input">
+				<view v-if="formData.sendSide" class="tui-input">
+					{{ deliveryList[sendSideIndex].name }}
+				</view>
+				<view v-else class="tui-placeholder">请选择快递公司</view>
+				<input name="sendSide" hidden />
+			</picker>
+		</tui-list-cell>
+		<!-- 门店送或快递送需要设置地址 -->
+		<appAddressGroup :customId="customId" cityTitle="配送城市" @selectAdress="selectAdress" ></appAddressGroup>
+		<appSendTime :sendDate.sync="formData.sendDate" :sendTime.sync="formData.sendTime"></appSendTime>
+
+
+
+		<tui-list-cell class="line-cell" :hover="false" :arrow="false">
+			<view class="tui-title">运费</view>
+			<view v-if="formData.sendCost" class="tui-input">
+				{{ formData.sendCost }}
+			</view>
+			<view v-else class="tui-placeholder">留空表示免运费</view>
+			<input name="sendCost" hidden />
+		</tui-list-cell>
+	</view>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import { freight } from "@/api/order";
+import appFormRadioBtn from "@/components/app-formRadio-btn";
+import appAddressGroup from "@/components/app-address-group";
+import appSendTime from "@/components/app-send-time";
+import {mapGetters} from "vuex";
+export default {
+	components: {
+		TuiListCell,
+		appFormRadioBtn,
+		appAddressGroup,
+		appSendTime
+	},
+	props: {
+		customId:'',
+		form: {
+			type: Object
+		}
+	},
+	data() {
+		return {
+			formData: {
+				sendCost: "",
+				receiveProvince: "",
+				receiveCity: "",
+				receiveFloor: "",
+				receiveAddress: "",
+				receiveLong: "",
+				receiveLat: "",
+				sendSide: "2",
+				sendType: "3", //1自取 2本店送 3快递送
+				sendDate: "",
+				sendTime: ""
+			},
+			sendSideIndex:0,
+			deliveryList: []
+		};
+	},
+	created() {
+		this.initData();
+	},
+
+	computed: {
+		...mapGetters(["getDictionariesInfo"]),
+		getCurSideName() {
+			let name = "";
+			if (this.formData.sendSide) {
+				const curItem = this.deliveryList.find(ele => {
+					return ele.value == this.formData.sendSide;
+				});
+				if (curItem) {
+					name = curItem.name;
+				}
+			}
+			return name;
+		}
+	},
+	methods: {
+		initData() {
+			// this.deliveryList
+			let list = this.getDictionariesInfo.expressList
+			for (let i=0;i<list.length;i++){
+				this.deliveryList.push({name:list[i].deliveryName,value:list[i].deliveryId,id:list[i].id})
+			}
+			for (const key in this.formData) {
+				if (Object.hasOwnProperty.call(this.formData, key)) {
+					const element = this.form[key];
+					this.formData[key] = element;
+				}
+			}
+		},
+		selectAdress(info) {
+			this.formData.receiveProvince = info.province;
+			this.formData.receiveCity = info.city;
+			this.formData.receiveFloor = info.floor;
+			this.formData.receiveAddress = info.address;
+			this.formData.receiveLong = info.longitude;
+			this.formData.receiveLat = info.latitude;
+
+			this.$nextTick(() => {
+				let params = {
+					sendSide: this.formData.sendSide,
+					receiveLong: info.longitude,
+					receiveLat: info.latitude
+				};
+				this.freightCount(params);
+			});
+		},
+		// 计算运费
+		freightCount(option) {
+			freight(option).then(res => {
+				this.formData.sendCost = res.data.sedCost;
+			});
+		},
+		selectSideEvent(event) {
+			console.log(event);
+			console.log(event.detail.value);
+			const {
+				detail: { value }
+			} = event;
+			this.sendSideIndex = value;
+			this.formData.sendSide = this.deliveryList[value].value;
+		}
+	},
+	watch: {
+		formData: {
+			handler(val) {
+				if (val) {
+					let info = { ...this.form, ...val };
+					if (this.formData.sendTime) {
+						info.sendTime = `${this.formData.sendDate} ${this.formData.sendTime}`;
+					}
+					console.log(2222, info);
+					this.$emit("update:form", info);
+				}
+			},
+			deep: true
+		},
+		["formData.sendType"](val) {
+			if (val != "3") {
+				//不是快递配送不包含运费
+				this.formData.sendCost = "";
+			}
+		}
+	}
+};
+</script>
+
+<style></style>

+ 15 - 14
ghsApp/src/components/app-send-time.vue

@@ -1,18 +1,18 @@
 <template>
 	<view>
-		<tui-list-cell class="line-cell" :hover="false" :arrow="true">
-			<div class="tui-title">{{ dateLabel }}</div>
-			<!-- <picker
-							mode="date"
-							:value="sendTime"
-							@change="selTimeFn"
-							class="tui-input"
-						>
-							<div v-if="form.sendTime">{{ sendTime }}</div>
-							<div class="tui-placeholder" v-else>请选择送达时间</div>
-						</picker> -->
-			<text>今天</text>
-		</tui-list-cell>
+<!--		<tui-list-cell class="line-cell" :hover="false" :arrow="true">-->
+<!--			<div class="tui-title">{{ dateLabel }}</div>-->
+<!--			&lt;!&ndash; <picker-->
+<!--							mode="date"-->
+<!--							:value="sendTime"-->
+<!--							@change="selTimeFn"-->
+<!--							class="tui-input"-->
+<!--						>-->
+<!--							<div v-if="form.sendTime">{{ sendTime }}</div>-->
+<!--							<div class="tui-placeholder" v-else>请选择送达时间</div>-->
+<!--						</picker> &ndash;&gt;-->
+<!--			<text>今天</text>-->
+<!--		</tui-list-cell>-->
 		<tui-list-cell class="line-cell" :hover="false" :arrow="true">
 			<div class="tui-title">{{ timeLabel }}</div>
 			<picker
@@ -51,7 +51,7 @@ export default {
 		},
 		timeLabel: {
 			type: String,
-			default: "具体时间"
+			default: "配送时间"
 		},
 		placeholder: {
 			type: String,
@@ -98,6 +98,7 @@ export default {
 	},
 	methods: {
 		changeTimeFn(e) {
+			console.log(e);
 			let oneIndex = e.detail.value[0] || 0;
 			let twoIndex = e.detail.value[1] || 0;
 			this.timeValue = e.detail.value;

+ 7 - 36
ghsApp/src/pages.json

@@ -149,47 +149,18 @@
 		{
 			"root": "pagesOrder",
 			"pages": [
-				{
-					"path": "detail",
-					"style": {
-						"navigationBarTitleText": "订单详情"
-					}
-				},
-				{
-					"path": "ship",
-					"style": {
-						"navigationBarTitleText": "发货"
-					}
-				},
-				{
-					"path": "select",
-					"style": {
-						"navigationBarTitleText": "重选花材"
-					}
-				},
-				{
-					"path": "print",
-					"style": {
-						"navigationBarTitleText": "连接蓝牙"
-					}
-				}
+				{"path": "detail","style": {"navigationBarTitleText": "订单详情"}},
+				{"path": "ship","style": {"navigationBarTitleText": "发货"}},
+				{"path": "shipInfo","style": {"navigationBarTitleText": "发货"}},
+				{"path": "select","style": {"navigationBarTitleText": "重选花材"}},
+				{"path": "print","style": {"navigationBarTitleText": "连接蓝牙"}}
 			]
 		},
 		{
 			"root": "pagesStore",
 			"pages": [
-				{
-					"path": "me/withdraw",
-					"style": {
-						"navigationBarTitleText": "提现记录"
-					}
-				},
-				{
-					"path": "me/incomeExpenses",
-					"style": {
-						"navigationBarTitleText": "收支记录"
-					}
-				}
+				{"path": "me/withdraw","style": {"navigationBarTitleText": "提现记录"}},
+				{"path": "me/incomeExpenses","style": {"navigationBarTitleText": "收支记录"}}
 			]
 		},
 		{

+ 42 - 10
ghsApp/src/pagesOrder/detail.vue

@@ -56,7 +56,7 @@
 				</view>
 				<view class="order-info_box">
 					<view>欠款:</view>
-					<view>{{ detailInfo.debt==1?'是':'' }}</view>
+					<view>{{ detailInfo.debt==1?'是':'-' }}</view>
 				</view>
 				<view class="order-info_box">
 					<view>订单状态:</view>
@@ -150,7 +150,7 @@
 					v-if="s.show == 1"
 					:disabled="s.disable === 1"
 					class="admin-button-com default" :class="s.disable === 1?'active':''">
-					{{ s.type === "item" ? "花材" : s.type === "selfGet" ? "自取" :s.type === "print" ? "打印" : "发货" }}
+					{{ s.type === "item" ? "花材" : s.type === "selfGet" ? "自取" :s.type === "print" ? "打印" :s.type === "debtPay" ? "延期收款" :s.type === "hasPay" ? "已收款" : "发货" }}
 				</button>
 			</template>
 <!--			<button-->
@@ -177,7 +177,7 @@
 <script>
 import stepStatus from "./components/stepStatus";
 import TuiListCell from "@/components/plugin/list-cell";
-import { getDetail, freeShipping } from "@/api/order/index";
+import { getDetail,debtPay,hasPay, freeShipping } from "@/api/order/index";
 import productMins from "@/mixins/product";
 import { ORDER_STATUS } from "@/utils/declare";
 
@@ -221,20 +221,52 @@ export default {
 			this.freeShipModal = false;
 		},
 		openBt(s, item) {
+			console.log(s)
+			console.log(s.item === "send")
 			// 花材
-			if (s.item === "item") {
+			if (s.type === "item") {
 				// 自取
-			} else if (s.item === "selfGet") {
+			} else if (s.type === "selfGet") {
 				this.freeShipModal = true;
 				// this.operateData = item;
+				//打印
+			} else if (s.type === "print") {
+					this.pageTo({url: "/pagesOrder/print",query: {id: item.id}});
 				//发货
-			} else if (s.item === "send") {
-				this.pageTo({
-					url: "/pagesOrder/ship",
-					query: {
-						id: item.id
+			} else if (s.type === "send") {
+				this.pageTo({url: "/pagesOrder/ship",query: {id: item.id}});
+			}else if (s.type === "debtPay") {
+				let self = this;
+				//延期收款
+				uni.showModal({
+					content: '您确认要延期收款',
+					success: function (res) {
+						if (res.confirm) {
+							return debtPay({ id: self.option.id }).then(res => {
+								console.log(res)
+								uni.showToast({title:'操作成功!',icon:'none'})
+								self.init();
+							})
+						}
+					}
+				});
+
+				// this.pageTo({url: "/pagesOrder/ship",query: {id: item.id}});
+			}else if (s.type === "hasPay") {
+				let self = this;
+				//已收款
+				uni.showModal({
+					content: '您确认已收款',
+					success: function (res) {
+						if (res.confirm) {
+							return hasPay({ id: self.option.id }).then(res => {
+								uni.showToast({title:'操作成功!',icon:'none'})
+								self.init();
+							})
+						}
 					}
 				});
+				// this.pageTo({url: "/pagesOrder/ship",query: {id: item.id}});
 			}
 		},
 		copy(val) {

+ 4 - 2
ghsApp/src/pagesOrder/ship.vue

@@ -223,7 +223,9 @@ export default {
 		},
 		// 快递送
 		sendParcel(){
-			this.shipModal = true;
+			this.pageTo({url: "/pagesOrder/shipInfo",query: {id: this.orderInfo.customId}});
+			console.error('快递送')
+			// this.shipModal = true;
 		},
 		// 计算运费
 		freightCount(){
@@ -248,7 +250,7 @@ export default {
 					this.modalCancel();
 				})
 			}
-			
+
 		},//关闭
 		modalCancel(){
 			this.shipModal = false;

+ 356 - 0
ghsApp/src/pagesOrder/shipInfo.vue

@@ -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>