liujd 6 anni fa
parent
commit
677329dac3

+ 8 - 8
mobile-code/src/admin/goodsManage/add.vue

@@ -75,8 +75,8 @@
 			<div class="module-com input-line-wrap summary-wrap">
 			<div class="module-com input-line-wrap summary-wrap">
 				<div class="module-tit">商品简介</div>
 				<div class="module-tit">商品简介</div>
 				<div class="module-det" style="padding-bottom: 10px">
 				<div class="module-det" style="padding-bottom: 10px">
-					<span class="app-price">商品简介请在电脑端进行修改</span>
-					<!-- <textarea class="goods-summary" placeholder-class="phcolor" @blur="bindTextAreaBlur" placeholder="请输入商品简介" /> -->
+					<!-- <span class="app-price">商品简介请在电脑端进行修改</span> -->
+					<textarea v-model="form.briefContent" class="goods-summary" placeholder-class="phcolor" placeholder="请输入商品简介" />
 				</div>
 				</div>
 			</div>
 			</div>
 			<!-- button -->
 			<!-- button -->
@@ -95,7 +95,7 @@ import AppUploader from '@/components/app-uploader'
 const form = require('@/utils/formValidation.js')
 const form = require('@/utils/formValidation.js')
 // api
 // api
 import { getCategory } from '@/utils/config'
 import { getCategory } from '@/utils/config'
-import { getDetailB, categoryAddB, categoryUpdateB } from '@/api/goods'
+import { getDetailB, addB, updateB } from '@/api/goods'
 export default {
 export default {
 	name: 'goods-add',
 	name: 'goods-add',
 	components: {
 	components: {
@@ -118,8 +118,7 @@ export default {
 				freightType: '0',
 				freightType: '0',
 				shopImg: []
 				shopImg: []
 				// goodsStyleList: [],
 				// goodsStyleList: [],
-			},
-			shopImg: []
+			}
 		}
 		}
 	},
 	},
 	computed: {
 	computed: {
@@ -139,7 +138,6 @@ export default {
 		_getDet() {
 		_getDet() {
 			return getDetailB({ id: this.option.id }).then(res => {
 			return getDetailB({ id: this.option.id }).then(res => {
 				if (this.$util.isEmpty(res.data)) return
 				if (this.$util.isEmpty(res.data)) return
-				// res.data.categoryData = res.data.festIdList.map(e => e + '')
 				Object.keys(this.form).forEach((i, index) => {
 				Object.keys(this.form).forEach((i, index) => {
 					this.form[i] = res.data[i]
 					this.form[i] = res.data[i]
 				})
 				})
@@ -147,10 +145,12 @@ export default {
 		},
 		},
 		// 确认
 		// 确认
 		confirmFn() {
 		confirmFn() {
-			let host = this.option.id ? categoryUpdateB : categoryAddB
+			let host = this.option.id ? updateB : addB
+			let form = JSON.parse(JSON.stringify(this.form))
+			form.shopImg = this.$util.imgSubstr(form.shopImg)
 			host({
 			host({
 				status: this.status,
 				status: this.status,
-				...this.form
+				...form
 			}).then(res => {
 			}).then(res => {
 				this.$msg('操作成功!')
 				this.$msg('操作成功!')
 			})
 			})

+ 1 - 1
mobile-code/src/admin/home/order.vue

@@ -37,7 +37,7 @@
 							<!-- 配送中 -->
 							<!-- 配送中 -->
 							<div v-if="item.status == 2" class="admin-button-com">继续</div>
 							<div v-if="item.status == 2" class="admin-button-com">继续</div>
 							<!-- 已完成 -->
 							<!-- 已完成 -->
-							<div v-if="item.status == 5" class="admin-button-com default" @click="seeSendFn(item)">查看快递</div>
+							<div v-if="item.status == 5" class="admin-button-com default" @click.stop="seeSendFn(item)">查看快递</div>
 						</div>
 						</div>
 					</div>
 					</div>
 				</div>
 				</div>

+ 41 - 36
mobile-code/src/admin/order/components/sel-ship-confirm.vue

@@ -39,11 +39,16 @@
 						<div class="axis-title">{{ orderComData[2].actionName}}</div>
 						<div class="axis-title">{{ orderComData[2].actionName}}</div>
 						<div class="axis-det">
 						<div class="axis-det">
 							<div class="app-color-0 app-bold">{{ orderComData[2].addTime | formatTime }}</div>
 							<div class="app-color-0 app-bold">{{ orderComData[2].addTime | formatTime }}</div>
-							<div>配送方:{{ orderComData[2].sendInfo.sendSideName }}</div>
-                            <div>距离:{{ orderComData[2].sendInfo.sendDistance }}km</div>
-                            <div>运费:¥{{ orderComData[2].sendInfo.sendCost }}</div>
-                            <div>小费:¥{{ orderComData[2].sendInfo.sendTip }}</div>
-                            <div>状态:{{ orderComData[2].sendInfo.sendStatus | constantfilter('SEND_STATUS') }}</div>
+							<block v-if="!$util.isEmpty(orderComData[2].sendInfo)">
+								<div>配送方:{{ orderComData[2].sendInfo.sendSideName }}</div>
+								<div>距离:{{ orderComData[2].sendInfo.sendDistance }}km</div>
+								<div>运费:¥{{ orderComData[2].sendInfo.sendCost }}</div>
+								<div>小费:¥{{ orderComData[2].sendInfo.sendTip }}</div>
+								<div>状态:{{ orderComData[2].sendInfo.sendStatus | constantfilter('SEND_STATUS') }}</div>
+							</block>
+							<block v-else>
+								<div>配送方:自己送</div>
+							</block>
 						</div>
 						</div>
 					</div>
 					</div>
 				</template>
 				</template>
@@ -55,11 +60,11 @@
 						<div class="axis-title">{{ orderComData[3].actionName}}</div>
 						<div class="axis-title">{{ orderComData[3].actionName}}</div>
 						<div class="axis-det">
 						<div class="axis-det">
 							<div class="app-bold">{{ orderComData[3].addTime | formatTime }}</div>
 							<div class="app-bold">{{ orderComData[3].addTime | formatTime }}</div>
-                            <card-name :info="orderComData[3].receive" />
-                            <div class="btn-wrap-com">
-                                <!-- <button class="admin-button-com default">明细</button> -->
-                                <button class="admin-button-com default" @click="() => { alert('打印功能待开发!') }">打印</button>
-                            </div>
+							<card-name :info="orderComData[3].receive" />
+							<div class="btn-wrap-com">
+								<!-- <button class="admin-button-com default">明细</button> -->
+								<button class="admin-button-com default" @click="() => { alert('打印功能待开发!') }">打印</button>
+							</div>
 						</div>
 						</div>
 					</div>
 					</div>
 				</template>
 				</template>
@@ -108,39 +113,39 @@ export default {
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-    // 发货
-    .confirm-wrap {
+	// 发货
+	.confirm-wrap {
 		.axis-det {
 		.axis-det {
 			margin-top: 20px;
 			margin-top: 20px;
-            margin-bottom: 10px;
-            color: $fontColor2;
-            & > div {
-                margin-top: 10px;
-                &:first-child {
-                    margin-top: 0;
-                }
-            }
-            .admin-button-com {
-                width: 120px;
-                margin-top: 20px;
-            }
-            .modify-btn {
-                color: $mainColor;
-                font-size: 24px;
-                margin-left: 30px;
-            }
+			margin-bottom: 10px;
+			color: $fontColor2;
+			& > div {
+				margin-top: 10px;
+				&:first-child {
+					margin-top: 0;
+				}
+			}
+			.admin-button-com {
+				width: 120px;
+				margin-top: 20px;
+			}
+			.modify-btn {
+				color: $mainColor;
+				font-size: 24px;
+				margin-left: 30px;
+			}
 		}
 		}
-    }
+	}
 	// 打单
 	// 打单
 	.com-wrap {
 	.com-wrap {
 		.axis-det {
 		.axis-det {
 			margin-top: 14px;
 			margin-top: 14px;
-            & > div {
-                margin-top: 20px;
-                &:first-child {
-                    margin-top: 0;
-                }
-            }
+			& > div {
+				margin-top: 20px;
+				&:first-child {
+					margin-top: 0;
+				}
+			}
 		}
 		}
 	}
 	}
 </style>
 </style>

+ 44 - 13
mobile-code/src/admin/order/components/sel-ship-manage.vue

@@ -19,18 +19,32 @@
 				</template>
 				</template>
 			</timeaxis-item>
 			</timeaxis-item>
 			<!-- 送达 -->
 			<!-- 送达 -->
-			<block v-for="(item, index) in orderComData" :key="index">
-				<timeaxis-item class="axis-list com-wrap" bgcolor="none" v-if="index > 0">
-					<template v-slot:content>
-						<div class="axis-slot-wrap">
-							<div class="axis-title">{{ item.actionName }}</div>
-							<div class="axis-det">
-								<div class="app-color-0 app-bold">{{ item.addTime | formatTime }}</div>
-							</div>
+			<timeaxis-item class="axis-list com-wrap" bgcolor="none">
+				<template v-slot:content>
+					<div class="axis-slot-wrap">
+						<div class="axis-title">打单</div>
+						<div class="axis-det">
+							<div class="app-color-0 app-bold">{{ orderComData[1].addTime | formatTime }}</div>
+							<block v-if="!$util.isEmpty(orderComData[1].receive)">
+								<card-name :info="orderComData[1].receive" />
+								<div class="btn-wrap-com">
+									<button class="admin-button-com default" @click="printOrderFn">重打</button>
+								</div>
+							</block>
+						</div>
+					</div>
+				</template>
+			</timeaxis-item>
+			<timeaxis-item class="axis-list com-wrap" bgcolor="none">
+				<template v-slot:content>
+					<div class="axis-slot-wrap">
+						<div class="axis-title">下单</div>
+						<div class="axis-det">
+							<div class="app-color-0 app-bold">{{ orderComData[1].addTime | formatTime }}</div>
 						</div>
 						</div>
-					</template>
-				</timeaxis-item>
-			</block>
+					</div>
+				</template>
+			</timeaxis-item>
 		</time-axis>
 		</time-axis>
 		<!-- ship -->
 		<!-- ship -->
 		<modal-module :show="shipModal" :maskClosable="false" @cancel="modalCancel" @click="shipModalClick" title="确认发货?" padding="30rpx 30rpx">
 		<modal-module :show="shipModal" :maskClosable="false" @cancel="modalCancel" @click="shipModalClick" title="确认发货?" padding="30rpx 30rpx">
@@ -74,7 +88,7 @@ import TimeaxisItem from '@/admin/home/components/plugin/timeaxis-item'
 import CardName from './card-name'
 import CardName from './card-name'
 import ModalModule from '@/components/plugin/modal'
 import ModalModule from '@/components/plugin/modal'
 // api
 // api
-import { orderSend } from '@/api/order'
+import { orderSend, printOrder } from '@/api/order'
 export default {
 export default {
 	name: 'sel-confirm-module',
 	name: 'sel-confirm-module',
 	components: {
 	components: {
@@ -107,7 +121,10 @@ export default {
 			},
 			},
 			sendSideText: '',
 			sendSideText: '',
 			// time
 			// time
-			timeList: [['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'], ['00', '10', '20', '30', '40', '50']],
+			timeList: [
+				['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'],
+				['00', '10', '20', '30', '40', '50']
+			],
 			// deliveryList
 			// deliveryList
 			deliveryList: [
 			deliveryList: [
 				{
 				{
@@ -126,6 +143,20 @@ export default {
 				sendSide: ''
 				sendSide: ''
 			}
 			}
 		},
 		},
+		printOrderFn() {
+			printOrder({
+				id: this.orderData.id,
+				option: 1
+			}).then(res => {
+				this.$util.pageTo({
+					url: '/admin/order/ship',
+					query: {
+						id: this.orderData.id,
+						pageStatus: 7
+					}
+				})
+			})
+		},
 		// moadl
 		// moadl
 		switchChangeFn(e) {
 		switchChangeFn(e) {
 			this.form.sendType = e.detail.value ? 1 : 0
 			this.form.sendType = e.detail.value ? 1 : 0

+ 2 - 2
mobile-code/src/admin/order/components/sel-ship.vue

@@ -23,10 +23,10 @@
 			<timeaxis-item class="axis-list axis-first print-order" bgcolor="none">
 			<timeaxis-item class="axis-list axis-first print-order" bgcolor="none">
 				<template v-slot:content>
 				<template v-slot:content>
 					<div class="axis-slot-wrap">
 					<div class="axis-slot-wrap">
-						<div class="axis-title">{{ orderComData[0].actionName }}</div>
+						<div class="axis-title">打单</div>
 						<div class="axis-det">
 						<div class="axis-det">
 							<div>{{ orderComData[0].addTime | formatTime }}</div>
 							<div>{{ orderComData[0].addTime | formatTime }}</div>
-                            <card-name />
+                            <card-name :info="orderComData[0].receive" />
                             <div class="btn-wrap-com">
                             <div class="btn-wrap-com">
                                 <!-- <button class="admin-button-com default">修改</button> -->
                                 <!-- <button class="admin-button-com default">修改</button> -->
                                 <!-- <button class="admin-button-com default">明细</button> -->
                                 <!-- <button class="admin-button-com default">明细</button> -->

+ 1 - 1
mobile-code/src/admin/order/detail.vue

@@ -48,7 +48,7 @@
 					<div class="order-msg-blo">
 					<div class="order-msg-blo">
 						<div class="msg-list">
 						<div class="msg-list">
 							<div class="label">送达时间</div>
 							<div class="label">送达时间</div>
-							<div class="value">{{ data.reachDate }}</div>
+							<div class="value">{{ data.reachDate || '暂无' }}</div>
 						</div>
 						</div>
 						<div class="msg-list">
 						<div class="msg-list">
 							<div class="label">贺卡</div>
 							<div class="label">贺卡</div>

+ 32 - 2
mobile-code/src/admin/order/ship.vue

@@ -25,7 +25,7 @@
 			</div>
 			</div>
 		</div>
 		</div>
 		<!-- order-bottom -->
 		<!-- order-bottom -->
-		<div class="module-com order-axis">
+		<div class="module-com order-axis" v-if="showIndex != null">
 			<!-- 列表 -->
 			<!-- 列表 -->
 			<!-- 选择订单 -->
 			<!-- 选择订单 -->
 			<block v-if="showIndex == 0">
 			<block v-if="showIndex == 0">
@@ -104,11 +104,15 @@ export default {
 		}
 		}
 	},
 	},
 	onLoad() {
 	onLoad() {
+		uni.showLoading({
+			title: '加载中...',
+			mask: true
+		})
 		this.init()
 		this.init()
 	},
 	},
 	methods: {
 	methods: {
 		init() {
 		init() {
-			this.showIndex = this.option.pageStatus || 0
+			// this.showIndex = this.option.pageStatus || 0
 			this._getDet()
 			this._getDet()
 
 
 			this._orderComDet()
 			this._orderComDet()
@@ -121,7 +125,32 @@ export default {
 		_orderComDet() {
 		_orderComDet() {
 			orderSendDet({ id: this.option.id }).then(res => {
 			orderSendDet({ id: this.option.id }).then(res => {
 				this.orderComData = res.data
 				this.orderComData = res.data
+				this.getPageStatus()
 			})
 			})
+		},
+		getPageStatus() {
+			uni.hideLoading()
+			if (this.$util.isEmpty(this.orderComData)) return false
+			let textStatus = this.orderComData[0].actionName
+			if (textStatus == '打单') {
+				let receive = this.orderComData[0].receive
+				if (this.$util.isEmpty(receive)) {
+					this.showIndex = 0
+				} else {
+					this.showIndex = 1
+				}
+			} else if (textStatus == '发货') {
+				this.showIndex = 7
+			} else if (textStatus == '送达') {
+				this.showIndex = 4
+			} else if (textStatus == '完成') {
+				let classify = this.orderComData[0].classify
+				if (this.$util.isEmpty(classify)) {
+					this.showIndex = 5
+				} else {
+					this.showIndex = 6
+				}
+			}
 		}
 		}
 	}
 	}
 }
 }
@@ -139,6 +168,7 @@ export default {
 	// 订单信息
 	// 订单信息
 	.order-wrap {
 	.order-wrap {
 		@include disFlex(center, space-between);
 		@include disFlex(center, space-between);
+		padding: 20px;
 		border-bottom: 20px solid $backColor;
 		border-bottom: 20px solid $backColor;
 		.order-det {
 		.order-det {
 			font-size: 24px;
 			font-size: 24px;

+ 2 - 2
mobile-code/src/api/goods/index.js

@@ -34,7 +34,7 @@ export const getDetailB = data => {
  * 商品-添加 b
  * 商品-添加 b
  */
  */
 export const addB = data => {
 export const addB = data => {
-	return https.get('/goods/add', data)
+	return https.post('/goods/add', data)
 }
 }
 
 
 /** *
 /** *
@@ -48,7 +48,7 @@ export const delB = data => {
  * 商品-修改 b
  * 商品-修改 b
  */
  */
 export const updateB = data => {
 export const updateB = data => {
-	return https.get('/goods/update', data)
+	return https.post('/goods/update', data)
 }
 }
 
 
 /** *
 /** *

+ 3 - 0
mobile-code/src/m-manifest.json

@@ -37,6 +37,9 @@
             "base" : "/",
             "base" : "/",
             "publicPath" : "/"
             "publicPath" : "/"
         },
         },
+        "async": {
+            "timeout": 200000
+        },
         "devServer": {
         "devServer": {
             "port": 81,
             "port": 81,
             "proxy": {
             "proxy": {

+ 10 - 0
mobile-code/src/utils/util.js

@@ -13,6 +13,15 @@ const isEmpty = (val) => {
 	return false
 	return false
 }
 }
 
 
+// 截取图片上传字符串
+const imgSubstr = (arr) => {
+	return arr.map(e => {
+		let index = e.indexOf('/uploads/')
+		e = e.substring(index)
+		return e
+	})
+}
+
 // 是否为数组
 // 是否为数组
 const isArray = (arr) => {
 const isArray = (arr) => {
 	return (typeof arr == 'object') && arr.constructor == Array
 	return (typeof arr == 'object') && arr.constructor == Array
@@ -191,6 +200,7 @@ export const isLogin = () => {
 }
 }
 export default {
 export default {
 	isEmpty,
 	isEmpty,
+	imgSubstr,
 	parse,
 	parse,
 	checkMobile,
 	checkMobile,
 	checkName,
 	checkName,

+ 3 - 0
mobile-code/src/w-manifest.json

@@ -37,6 +37,9 @@
             "base": "/",
             "base": "/",
             "publicPath": "/"
             "publicPath": "/"
         },
         },
+        "async": {
+            "timeout": 200000
+        },
         "devServer": {
         "devServer": {
             "port": 81,
             "port": 81,
             "proxy": {
             "proxy": {