shish 3 лет назад
Родитель
Сommit
7596070df1

+ 2 - 1
ghsApp/src/admin/home/apply.vue

@@ -63,7 +63,8 @@ export default {
                     list:[
                         {name: "员工",img: `${this.$constant.imgUrl}/ghs/home/yggl.png`,url: "/admin/staff/list"},
                         {name: "员工业绩",img: `${this.$constant.imgUrl}/ghs/home/icon_ygyj.png`,url: "/admin/staff/achieve"},
-                        {name: "门店",img: `${this.$constant.imgUrl}/ghs/home/shop.png`,url: "/admin/shop/list"}
+                        {name: "门店",img: `${this.$constant.imgUrl}/ghs/home/shop.png`,url: "/admin/shop/list"},
+                        {name: "物流管理",img: `${this.$constant.imgUrl}/ghs/home/shop.png`,url: "/admin/shop/wl"},
                     ]
                 },
                 {

+ 299 - 0
ghsApp/src/admin/shop/wl.vue

@@ -0,0 +1,299 @@
+<template>
+	<div class="app-content" @click="globalClick">
+		<div class="list-wrap">
+			<block v-if="!$util.isEmpty(list.data)">
+				<div class="list" v-for="(item, index) in list.data" :key="index">
+					<div class="list-index">{{ item.id }}</div>
+					<div class="list-det" @click="editItem(item)">
+						<div class="app-size-28 app-color-0">{{ item.name || '' }}</div>
+						<div class="list-operate">
+							<div class="operate-det">
+								<span>顺序 {{ item.inTurn }}</span>
+							</div>
+							<view class="operate-icon"><i class="iconfont iconbianji" style="font-size:38upx;"></i></view>
+							<view class="operate-icon" @click.stop="delWlFn(item)"><i class="iconfont iconshanchu1" style="font-size:38upx;"></i></view>
+						</div>
+					</div>
+				</div>
+				<operate-module v-if="operateShow" :top="operateTop" :right="30" @clickFn="operateList" :btnData="btnData" />
+			</block>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+			</block>
+		</div>
+		<div class="app-footer">
+			<button class="admin-button-com big blue" @click="addCategoryFn">添加物流</button>
+		</div>
+		<modal-module :show="modifyModal" :maskClosable="false" @cancel="modalCancel" @click="replaceModalClick" :title="modifyTitle" padding="30rpx 30rpx">
+			<template v-slot:content>
+				<div class="app-modal-input-wrap modify-modal">
+					<div class="inp-list-line">
+						<div class="line-label">名称</div>
+						<div class="line-input">
+							<input type="text" v-model="replaceForm.name" :adjust-position="false" class="inp-input" placeholder="请填写名称" />
+						</div>
+					</div>
+					<div class="inp-list-line">
+						<div class="line-label">顺序</div>
+						<div class="line-input">
+							<input type="number" v-model="replaceForm.inTurn" @focus="replaceForm.inTurn=''" :adjust-position="false" class="inp-input" placeholder="越大越靠前" />
+						</div>
+					</div>
+				</div>
+			</template>
+		</modal-module>
+		<modal-module :show="delModal" :maskClosable="false" @cancel="modalCancel" @click="delModalClick" content="确定删除?" color="#333" :size="32" padding="30upx 30upx"></modal-module>
+	</div>
+</template>
+<script>
+import ModalModule from '@/components/plugin/modal'
+import AppUploader from '@/components/app-uploader'
+import OperateModule from '@/admin/home/components/module/operate'
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
+import { list } from '@/mixins'
+import { getWlList,delWl,addWl,updateWl } from '@/api/shop'
+export default {
+	name: 'item-class-list',
+	components: {
+		ModalModule,
+		AppUploader,
+		OperateModule,
+		AppWrapperEmpty
+	},
+	mixins: [list],
+	data() {
+		return {
+			modifyModal: false,
+			modifyTitle: '添加',
+			replaceForm: {
+				id:0,
+				name: '',
+				inTurn: 100
+			},
+			delModal: false,
+			operateShow: false,
+			operateData: {},
+			operateIndex: null,
+			operateTop: 0
+		}
+	},
+	computed: {
+		btnData() {
+			return [
+				{
+					text: '编辑',
+					icon: 'iconbianji',
+					click: () => {
+						this.modifyModal = true
+						this.modifyTitle = '编辑'
+						this.modifyForm = {
+							name: this.operateData.name,
+							id: this.operateData.id,
+							inTurn: this.operateData.inTurn
+						}
+					}
+				},
+				{
+					text: '删除',
+					icon: 'iconshanchu1',
+					click: () => {
+						this.delModal = true
+					}
+				}
+			]
+		}
+	},
+	onPullDownRefresh() {
+		this.resetList()
+		this.getWlData().then(res => {
+			uni.stopPullDownRefresh()
+		})
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.getWlData().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		} else {
+			uni.stopPullDownRefresh()
+		}
+	},
+	onLoad() {
+	},
+	methods: {
+		delWlFn(item){
+			let that = this
+			that.$util.confirmModal({content:'确认删除?'},() => {
+				delWl({id:item.id}).then(res=>{
+					if(res.code == 1){
+						that.$msg('删除成功')
+						that.resetList()
+						that.getWlData()
+					}
+				})
+			})
+		},
+		editItem(item){
+				this.modifyModal = true
+				this.modifyTitle = '编辑'
+				this.replaceForm = {
+                    id:item.id,
+					name: item.name,
+					inTurn: item.inTurn
+				}			
+		},
+		operateList(index){
+			if(index === 0){
+				this.modifyModal = true
+				this.modifyTitle = '编辑'
+				this.replaceForm = {
+                    id:this.operateData.id,
+					name: this.operateData.name,
+					inTurn: this.operateData.inTurn
+				}
+			}else if(index === 1) {
+				this.delModal = true
+			}
+		},
+		async init() {
+			this.getWlData()
+		},
+		getWlData() {
+			return getWlList({page: this.list.page}).then(res => {
+				this.completes(res)
+			})
+		},
+		replaceClass() {
+			if (!this.replaceForm.name) {
+				this.$msg('请填写物流名称')
+				return false
+			}
+			let host = this.replaceForm.id == 0 ?  addWl : updateWl;
+			let form = JSON.parse(JSON.stringify(this.replaceForm))
+			host({ ...form }).then(res => {
+				this.$msg('操作成功')
+				this.modalCancel()
+				this.operateCancle()
+				setTimeout(() => {
+					this.resetList()
+					this.getWlData()
+				}, 1000)
+			})
+		},
+		addCategoryFn() {
+			this.resetForm()
+			this.modifyModal = true
+			this.modifyTitle = '新增'
+		},
+		resetForm() {
+			this.replaceForm = {
+				name: '',
+				inTurn: 0,
+                id:0
+			}
+		},
+		replaceModalClick(e) {
+			if (e.index === 0) {
+				this.modalCancel()
+			} else {
+				this.replaceClass()
+			}
+		},
+		modalCancel() {
+			this.delModal = false
+			this.modifyModal = false
+		},
+		switchChangeFn(e) {
+			this.replaceForm.status = e.detail.value ? 1 : 0
+		},
+		delModalClick(e) {
+			this.modalCancel()
+		},
+		operateCancle() {
+			this.operateData = {}
+			this.operateIndex = null
+			this.operateShow = false
+		},
+        globalClick(){
+            this.operateCancle()
+        }
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+	.app-content {
+		min-height: calc(100vh - 100upx);
+		padding-bottom: 100upx;
+	}
+	.list-wrap {
+		position: relative;
+		background-color: #fff;
+		.list {
+			height: 130upx;
+			@include disFlex(center, flex-start);
+			margin: 0 30upx 0 30upx;
+			color: $fontColor3;
+			border-bottom: 1upx solid $borderColor;
+			.list-index {
+				width: 80upx;
+			}
+			.list-img {
+				img {
+					height: 100%;
+				}
+			}
+			.list-det {
+				width: calc(100% - 50upx);
+				margin-left: 10upx;
+				& > div {
+					margin-top: 14upx;
+					&:first-child {
+						margin-top: 0;
+					}
+				}
+				.list-operate {
+					@include disFlex(center, space-between);
+					.operate-det {
+						& > span {
+							margin-left: 60upx;
+							&:first-child {
+								margin-left: 0;
+							}
+						}
+					}
+					.add-price{
+						text-decoration:underline;
+						font-size:30upx;
+						margin-left:10upx;
+					}
+					.operate-icon{
+						margin-left:5upx;
+					}
+				}
+			}
+		}
+	}
+	.app-footer {
+		justify-content: flex-end;
+		.admin-button-com {
+			width: 200upx;
+			margin-right: 30upx;
+		}
+	}
+	.modify-modal {
+		.prompt-text {
+			color: red;
+			position: relative;
+			right: 52upx;
+			bottom: 24upx;
+		}
+		.line-label {
+			width: 140upx;
+			flex-shrink: 0;
+		}
+		.switch-wrap {
+			margin-top: 30upx;
+		}
+	}
+</style>

+ 4 - 0
ghsApp/src/api/custom/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const changeWl = data => {
+	return https.get('/custom/change-wl', data)
+}
+
 export const changeShowStock = data => {
 	return https.get('/custom/change-show-stock', data)
 }

+ 21 - 0
ghsApp/src/api/shop/index.js

@@ -1,5 +1,26 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const updateWl = data => {
+	return https.post('/wl/update', data)
+}
+
+export const addWl = data => {
+	return https.post('/wl/add', data)
+}
+
+export const delWl = data => {
+	return https.get('/wl/del-wl', data)
+}
+
+//获取所有物流信息
+export const getAllWl = data => {
+	return https.get('/wl/get-all-wl', data)
+}
+
+export const getWlList = data => {
+	return https.get('/wl/list', data)
+}
+
 export const getDetail = data => {
 	return https.get('/shop/detail', data)
 }

+ 2 - 1
ghsApp/src/pages.json

@@ -169,7 +169,8 @@
 				{"path": "sk","style": {"navigationBarTitleText": "我的零售店"}},
 				{"path": "password","style": {"navigationBarTitleText": "密码修改"}},
 				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动记录"}},
-				{"path": "selectShop","style": {"navigationBarTitleText": "选择门店"}}
+				{"path": "selectShop","style": {"navigationBarTitleText": "选择门店"}},
+				{"path": "wl","style": {"navigationBarTitleText": "物流列表"}}
 			]
 		},
 		{

+ 40 - 4
ghsApp/src/pagesClient/member/detail.vue

@@ -105,13 +105,22 @@
             </tui-list-cell>
 
             <tui-list-cell class="line-cell" :hover="false">
-              <div class="tui-title">看库存</div>
+              <div class="tui-title">允许看库存</div>
               <div class="switch_bx">
                 <text></text>
                 <switch :checked="form.showStock == 0 ? false : true" @change="showStockChangeFn" style="transform: scale(0.8,0.8)" />
               </div>
             </tui-list-cell>
 
+            <tui-list-cell class="line-cell" :hover="false" :arrow="true">
+              <div class="tui-title">默认物流</div>
+              <picker mode="selector" :value="form.wlId" :range="wlList" range-key="name" @change="changeWlFn" class="tui-input" >
+                <input v-model="form.wlId" name="wlId" type="text" hidden />
+                <div v-if="Number(form.wlId)>0">{{ wlSelData.name }}</div>
+                <div class="tui-placeholder" v-else>待设置</div>
+              </picker>
+            </tui-list-cell>
+
         </view>
       </view>
     </templete>
@@ -135,7 +144,8 @@ import TuiListCell from '@/components/plugin/list-cell'
 import { share } from "@/mixins";
 import ModalModule from "@/components/plugin/modal"
 import { getUserDet,debt} from "@/api/member";
-import { changeShowStock } from "@/api/custom"
+import { changeShowStock,changeWl } from "@/api/custom"
+import { getAllWl } from "@/api/shop"
 import { updateDebtLimit,updateCustomBlack,changeDiscount,changeName} from "@/api/custom";
 export default {
   name: "detail",
@@ -153,7 +163,9 @@ export default {
         debt: 0,
         black: 1,
         showStock:0,
+        wlId:0
       },
+      wlSelData: {},
       discount:null,
       tabsData: [
         {
@@ -187,12 +199,23 @@ export default {
       ],
       customName:'',
       changeShow:false,
-      changeFocus:false
+      changeFocus:false,
+      wlList: []
     };
   },
   computed: {},
   onLoad() {},
   methods: {
+    changeWlFn(e) {
+      let that = this
+      this.wlSelData = this.wlList[e.detail.value]
+      changeWl({id:this.option.id,wlId:that.wlSelData.id}).then(res=>{
+        if(res.code == 1){
+          this.$msg(res.msg)
+          that.form.wlId = that.wlSelData.id
+        }
+      })
+    },
 		changeNameFn(){
 			this.customName = this.userInfo.name
 			this.changeShow = true
@@ -295,6 +318,7 @@ export default {
       this.getUserDetail()
     },
     getUserDetail() {
+      let that = this
       getUserDet({ id: this.option.id }).then(res => {
         this.debtLimit = res.data.debtLimit;
         this.userInfo = res.data;
@@ -302,7 +326,19 @@ export default {
         this.form.black = this.userInfo.black
         this.form.showStock = this.userInfo.showStock
         this.discount = parseFloat(res.data.discount)
-      });
+        this.form.wlId = this.userInfo.wlId
+        getAllWl().then(res=>{
+          if(res.code == 1){
+            that.wlList = res.data.list
+            let newData = that.wlList.filter(
+              e => this.form.wlId == e.id
+            )
+            if(!this.$util.isEmpty(newData)){
+              that.wlSelData = newData[0]
+            }
+          }
+        })
+      })
     },
     orderMoreFn() {
       this.orderMoreStatus = false;