Browse Source

开单逻辑

master
tianyi@bogon 3 years ago
parent
commit
76b7a565a3
  1. 2
      pages/billing/changeGoods.vue
  2. 211
      pages/billing/changeGoods1.vue
  3. 64
      pages/index/peopleList.vue
  4. 5
      pages/inventory/addGoods.vue
  5. 61
      pages/inventory/goodsList1.vue
  6. 20
      pages/inventory/inventory.vue
  7. 47
      pages/staff/addStaff/addStaff.vue
  8. 18
      pages/staff/staff.vue

2
pages/billing/changeGoods.vue

@ -75,6 +75,8 @@
onLoad(options) { onLoad(options) {
this.goodsDetail = JSON.parse(decodeURIComponent(options.info)) this.goodsDetail = JSON.parse(decodeURIComponent(options.info))
let newObj = JSON.parse(this.goodsDetail.attributeList) let newObj = JSON.parse(this.goodsDetail.attributeList)
console.log("1111")
console.log(newObj)
let newArr = [] let newArr = []
for (let val in newObj) { for (let val in newObj) {
let valueObj = []; let valueObj = [];

211
pages/billing/changeGoods1.vue

@ -12,7 +12,7 @@
</view> </view>
</view> </view>
<view class="content-right"> <view class="content-right">
<view class="right-box" v-for="item in shopList" :key="item"> <view class="right-box" v-for="item in shopList" :key="item" @tap="toggle('bottom',item)">
<view class="box-left"> <view class="box-left">
<img :src="item.productPicture" alt=""> <img :src="item.productPicture" alt="">
</view> </view>
@ -38,11 +38,11 @@
</view> </view>
</view> </view>
</view> </view>
<checkbox-group @change="checkboxChange"> <!-- <checkbox-group @change="checkboxChange">
<label> <label>
<checkbox :value="item.id" class="checkbox" /> <checkbox :value="item.id" class="checkbox" />
</label> </label>
</checkbox-group> </checkbox-group> -->
</view> </view>
</view> </view>
</view> </view>
@ -53,7 +53,7 @@
<text class="uni-tab__text">已选择</text> <text class="uni-tab__text">已选择</text>
</view> </view>
<text style="background-color:#ff0000;color:#fff;position: absolute;top: 0;right: 10rpx;" <text style="background-color:#ff0000;color:#fff;position: absolute;top: 0;right: 10rpx;"
class="uni-tab__dot">{{ info }}</text> class="uni-tab__dot">{{carList.length}}</text>
</view> </view>
<view class="bottom-right"> <view class="bottom-right">
<view class="bottom-btn" open-type="share" @tap="toggle('bottom')">选好了</view> <view class="bottom-btn" open-type="share" @tap="toggle('bottom')">选好了</view>
@ -68,43 +68,44 @@
<img src="/static/images/logo.png" alt=""> <img src="/static/images/logo.png" alt="">
</view> </view>
<view class="popup-title-right"> <view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">创意小众单肩包</view> <view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
<view class="popup-title-right-box">QS2023101001</view> </view>
<view class="popup-title-right-box">{{goodsDetail.barcode}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> <view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥0.00</text> <text style="margin-right:20rpx;">¥{{goodsDetail.price}}</text>
<uni-icons color="#088FEB" type="compose" size="16" style="color:#088FEB"></uni-icons> <text style="color:blue;">临时改价</text>
</view> </view>
</view> </view>
</view> </view>
<view class="popup-container"> <view class="popup-container">
<ul> <ul>
<!-- <li v-for="items in attrList" :key="items.id"> --> <li v-for="(items,index) in goodsDetail.attributeList" :key="index">
<li>
<view class="title-fur"> <view class="title-fur">
<view class="name">男装</view> <view class="name">{{items.name}}</view>
</view> </view>
<view class="content-fur"> <view class="attrs">
<!-- <view class="content-low" v-for="item in items.attributeValue" :key="item.id" @tap="delItem(item, 'attrNameDel')">男装</view> --> <uni-data-checkbox v-model="value" :localdata="range"
<view class="content-low">男装</view> @change="change"></uni-data-checkbox>
<text v-for="(itemTag, index1) in items.value" :key="index1"
@tap.stop="attrNameChange(index,index1) "
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text>
</view> </view>
</li> </li>
</ul> </ul>
<view class="checkList"> <view class="checkList" v-for="item in temporaryList">
<view class="checkList-box"> <view class="checkList-box">
<text>女装</text> {{item.name}}
<text>S码</text>
<text>黄色</text>
</view> </view>
<uni-number-box :value="numberValue" @change="change" /> <uni-number-box :value="item.temporaryNum" @change="temporaryChange" />
</view> </view>
</view> </view>
<view class="popup-bottom"> <view class="popup-bottom" v-for="item in temporaryList">
<view class="popup-bottom-left"> <view class="popup-bottom-left">
<text>2 款 9 件</text> <text>{{item.num}} 件</text>
<text>¥2952.00</text> <text>¥{{item.num * item.price}}</text>
</view> </view>
<view class="popup-bottom-right"> <view class="popup-bottom-right">
<view class="bottom-btn" @tap="">选好了</view> <view class="bottom-btn" @tap="temporaryCheck">选好了</view>
</view> </view>
</view> </view>
</view> </view>
@ -113,50 +114,23 @@
<!-- 弹出输入框 --> <!-- 弹出输入框 -->
<uni-popup ref="inputDialog" type="dialog"> <uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="临时改价" placeholder="请输入临时售价" <uni-popup-dialog ref="inputClose" mode="input" title="临时改价" placeholder="请输入临时售价"
@confirm="dialogInputConfirm"></uni-popup-dialog> @confirm="changePrice"></uni-popup-dialog>
</uni-popup> </uni-popup>
<!-- 购物车弹出层 --> <!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change"> <uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content"> <view class="popup-content">
<view class="popup-title"> <view v-for="item in carList">
<view class="popup-title-left">
<img src="/static/images/logo.png" alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">创意小众单肩包</view>
<view class="popup-title-right-box">QS2023101001</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥0.00</text>
<uni-icons color="#088FEB" type="compose" size="16"></uni-icons>
<view style="position: absolute;top: 30rpx;right: 30rpx;">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
</view>
</view>
<view class="popup-container">
<view class="checkList">
<view style="margin-right:5%;">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
<text>女装</text>
<text>S码</text>
<text>黄色</text>
</view>
<uni-number-box :value="numberValue" @change="change" />
</view>
</view>
<view class="popup-title"> <view class="popup-title">
<view class="popup-title-left"> <view class="popup-title-left">
<img src="/static/images/logo.png" alt=""> <img src="/static/images/logo.png" alt="">
</view> </view>
<view class="popup-title-right"> <view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">创意小众单肩包</view> <view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
<view class="popup-title-right-box">QS2023101001</view> <view class="popup-title-right-box">{{item.productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> <view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥0.00</text> <text style="margin-right:20rpx;">¥{{item.price}}</text>
<uni-icons color="#088FEB" type="compose" size="16"></uni-icons> <uni-icons color="#088FEB" type="compose" size="16"></uni-icons>
<view style="position: absolute;top: 30rpx;right: 30rpx;"> <view style="position: absolute;top: 30rpx;right: 30rpx;">
<uni-icons color="red" type="trash" size="26"></uni-icons> <uni-icons color="red" type="trash" size="26"></uni-icons>
@ -178,19 +152,8 @@
<uni-number-box :value="numberValue" @change="change" /> <uni-number-box :value="numberValue" @change="change" />
</view> </view>
</view> </view>
<view class="popup-container">
<view class="checkList">
<view style="margin-right:5%;">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
<text>女装</text>
<text>S码</text>
<text>黄色</text>
</view>
<uni-number-box :value="numberValue" @change="change" />
</view>
</view> </view>
<view class="popup-bottom"> <view class="popup-bottom">
<view class="popup-bottom-left"> <view class="popup-bottom-left">
<text>2 款 9 件</text> <text>2 款 9 件</text>
@ -218,7 +181,11 @@
searchName: '', //搜索框输入值 searchName: '', //搜索框输入值
shopId: '', //店铺id, shopId: '', //店铺id,
checkbox: [], //需要分享的商品id checkbox: [], //需要分享的商品id
numberValue: 0, temporaryNum: 0,
goodsDetail: [],
attrNameList: [],
temporaryList: [],
carList: []
} }
}, },
onLoad() { onLoad() {
@ -243,14 +210,45 @@
} else {} } else {}
}).catch((res) => {}) }).catch((res) => {})
}, },
attrNameChange(index, index1) {
this.goodsDetail.attributeList[index].value.forEach(item => {
item.isChecked = false;
})
this.goodsDetail.attributeList[index].isChecked = true;
this.goodsDetail.attributeList[index].value[index1].isChecked = true;
console.log(this.goodsDetail)
var name = '';
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) {
console.log(Ien[m])
if (Ien[m].isChecked == true) {
name += Ien[m].value
}
}
}
this.temporaryList = [{
id: this.goodsDetail.id,
barcode: this.goodsDetail.barcode,
price: this.goodsDetail.price,
name: name,
num: this.temporaryNum,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn
}]
},
temporaryChange(val) {
console.log(val)
this.temporaryList[0].num = val
},
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", { this.tui.request("/app/product/getShareList", "POST", {
shopId: '002', shopId: '002',
// categoryId:id || '1695090289036890112', categoryId: id,
categoryId: '1695090289036890112', // categoryId: '1695090289036890112',
// supplierName:this.searchName || '测试', supplierName: this.searchName,
supplierName: '测试', // supplierName: '测试',
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
}, false, true).then((res) => { }, false, true).then((res) => {
@ -264,13 +262,15 @@
change(e) { change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show); console.log('当前模式:' + e.type + ',状态:' + e.show);
}, },
//弹出商品规格选择 //弹出购物车或者商品规格选择弹窗
toggle(type) { toggle(type, item) {
this.type = type this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') { if (type == 'carPopup') {
this.$refs.carPopup.open('bottom') this.$refs.carPopup.open('bottom')
} else { } else {
this.checkGoods(item);
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
} }
@ -282,6 +282,34 @@
// icon: 'none' // icon: 'none'
// }) // })
// }, // },
//选择商品查询商品规格
checkGoods(item) {
this.goodsDetail = item
if (typeof(this.goodsDetail.attributeList) == 'string') {
let newObj = JSON.parse(this.goodsDetail.attributeList)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
this.attrNameList.push({
value: newObj[val][i],
name: val,
isChecked: false
})
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
}
},
//底部右侧两个分享按钮 //底部右侧两个分享按钮
buttonClick(e) { buttonClick(e) {
@ -343,6 +371,20 @@
inputDialogToggle() { inputDialogToggle() {
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },
//临时改价
changePrice(val) {
this.goodsDetail.price = this.temporaryList[0].price = val
},
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
this.carList.push(this.temporaryList[0]);
this.$refs.popup.close()
// for (var i =0;i<this.shopList.length;i++) {
// if(this.shopList[i].id == this.temporaryList[0].id){
// this.shopList[i].temporaryList = this.temporaryList[0]
// }
// }
}
} }
} }
</script> </script>
@ -636,4 +678,23 @@
border-radius: 70rpx; border-radius: 70rpx;
} }
} }
.attrs {
text {
display: inline-block;
border: 1px solid #5fd9ee;
margin: 20rpx;
background-color: #fff;
color: #5fd9ee;
width: 100rpx;
line-height: 70rpx;
height: 70rpx;
text-align: center;
}
.checkedText {
background-color: $u-primary;
color: #fff;
}
}
</style> </style>

64
pages/index/peopleList.vue

@ -1,30 +1,31 @@
<template> <template>
<view class=""> <view class="">
<view class=""> <view class="">
<view class="" v-if="popleType1== 'khName'" @tap=""> <view class="" v-if="popleType== 'khName'" @tap="">
<!-- 供应商、客户走这一套 --> <!-- 供应商、客户走这一套 -->
<view> <view>
<button size="default" type="default" @tap="" hover-class="is-hover">新增人员</button> <button size="default" type="default" @tap="" hover-class="is-hover">新增人员</button>
</view> </view>
<view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)" <view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)"
style="display: flex;flex-direction: column;height: 150rpx;"> style="display: flex;flex-direction: column;height: 150rpx;">
<view class="name-tel" style=""> <view class="name-tel" style="width: 100%;">
<text style="line-height: 75rpx;">{{item.name}}</text> <text style="line-height: 75rpx;">{{item.name}}</text>
<text>{{item.phone}}</text> <text>{{item.phone}}</text>
</view> </view>
<view class="name-tel"> <view class="name-tel" style="width: 100%;">
<text>{{item.province + item.city + item.area + item.address}}</text> <text>{{item.province + item.city + item.area + item.address}}</text>
</view> </view>
</view> </view>
</view> </view>
<!-- 物流公司、快递公司、啦包公走这一套 --> <!-- 物流公司、快递公司、啦包公走这一套 -->
<view class="" v-else> <view class="" v-else>
<view class="list-1" style="display: flex;height:75rpx;" v-for="item in popleList" :key="item"> <view class="list-1" style="display: flex;height:75rpx;" @tap="clickList(item)" v-for="item in popleList" :key="item">
<view class="name-tel"> <view class="name-tel">
<text style="line-height: 75rpx;">{{item.companyName}}</text> <text style="line-height: 75rpx;">{{item.companyName}}</text>
<text style="line-height: 75rpx;">{{item.workerName}}</text>
</view> </view>
<view class="phone-btn" @tap="clickPhone(item.moblie)">拨打电话</view> <view class="phone-btn" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
<view class="standard-box" @tap="toggle('center')"> <view class="standard-box" @tap.stop="toggle('center')">
收费标准<uni-icons type="info" color='#088FEB' size="16" 收费标准<uni-icons type="info" color='#088FEB' size="16"
style="line-height: 75rpx;padding-right:40rpx;"></uni-icons> style="line-height: 75rpx;padding-right:40rpx;"></uni-icons>
</view> </view>
@ -52,20 +53,24 @@
export default { export default {
data() { data() {
return { return {
popleType1: '', popleType: '',
popleList: [], popleList: [],
signCompany: '', // 1物流 2快递 signCompany: '', // 1物流 2快递 3发车
people: '', //快递、物流、发车的id people: '', //快递、物流、发车的id
radioType:'' //选择的是快递还是物流 radioType: '', //选择的是快递还是物流
companyType: '', //运输公司类型 快递公司有值 物流公司直接传空
} }
}, },
onLoad(options) { onLoad(options) {
this.popleType1 = options.popleType this.popleType = options.popleType
this.people = options.people this.companyType = options.companyType || ''
this.radioType = options.radioType console.log(options.companyType)
if (options.popleType == ('khName' || 'gys')) { //供应商或者客户 // this.radioType = options.radioType
if (options.popleType == ('khName' || 'gysName')) { //供应商或者客户
this.khOrGysList(options.popleType); this.khOrGysList(options.popleType);
} else if(options.popleType == ('khName' || 'gys')){ //物流快递 } else if (options.popleType == 'wlName' || options.popleType == 'kdName') { //物流快递
this.wlOrKdList(options.popleType)
} else if (options.popleType == 'fcName') {
this.wlOrKdList(options.popleType) this.wlOrKdList(options.popleType)
} else { } else {
this.kdyOrlbgList(); this.kdyOrlbgList();
@ -84,7 +89,7 @@
}, },
//物流或者快递列表 //物流或者快递列表
wlOrKdList(e) { wlOrKdList(e) {
//物流:1 快递:2 //物流:1 快递:2 发车3
if (e == 'wlName') { if (e == 'wlName') {
this.signCompany = 1; this.signCompany = 1;
} else if (e == 'kdName') { } else if (e == 'kdName') {
@ -104,16 +109,23 @@
clickList(item) { clickList(item) {
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例 let prevPage = pages[pages.length - 2]; //上一页页面实例
if (this.popleType1 == 'khName') { if (this.popleType == 'khName') {
prevPage.$vm.khName = item prevPage.$vm.khName = item
} else if (this.popleType == 'gysName') {
prevPage.$vm.gysName = item
} else if (this.popleType == 'kdName' || this.popleType == 'wlName' || this.popleType == 'fcName') {
prevPage.$vm.wlName = item
} else if (this.popleType == 'lbgName') {
prevPage.$vm.lbgName = item
} else if (this.popleType == 'kdyName') {
prevPage.$vm.kdyName = item
}
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
} else if (this.popleType1 == 'khName') {
}
}, },
clickPhone(phone) { clickPhone(phone) {
console.log(phone);
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone phoneNumber: phone
}); });
@ -121,20 +133,10 @@
//查询拉包工和快递人员的列表 //查询拉包工和快递人员的列表
kdyOrlbgList() { kdyOrlbgList() {
this.tui.request("/worker/getWXByCondition", "post", { this.tui.request("/worker/getWXByCondition", "post", {
ownerCompany: options.people, //公司id,如果是快递公司,才需要传 ownerCompany: this.companyType, //公司id,如果是快递公司,才需要传
//signPerson: this.radioType ==0 ? 2 : 1 //物流1 快递2 这个参数不传了,判断ownerCompany是空就查拉包工,不是空是就查快递员
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 this.popleList = res.result;
let prevPage = pages[pages.length - 2]; //上一页页面实例
if (this.popleType1 == 'khName') {
prevPage.$vm.khName = item
uni.navigateBack({
delta: 1
})
} else if (this.popleType1 == 'khName') {
}
} }
}) })

5
pages/inventory/addGoods.vue

@ -13,10 +13,9 @@
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="10"></u-upload> :maxCount="10"></u-upload>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label=" 供应商" required name="supplierId"> <!-- <uni-forms-item label=" 供应商" required name="supplierId">
<uni-easyinput type="text" v-model="formData.supplierId" placeholder="请输入供应商" trim="all" /> <uni-easyinput type="text" v-model="formData.supplierId" placeholder="请输入供应商" trim="all" />
<!-- <uni-easyinput type="text" v-model="formData.name" /> --> </uni-forms-item> -->
</uni-forms-item>
<uni-forms-item label="货号" name="productSn" required> <uni-forms-item label="货号" name="productSn" required>
<uni-easyinput type="text" v-model="formData.productSn" placeholder="请输入货号" trim="all" /> <uni-easyinput type="text" v-model="formData.productSn" placeholder="请输入货号" trim="all" />
</uni-forms-item> </uni-forms-item>

61
pages/inventory/goodsList1.vue

@ -6,7 +6,8 @@
<view class="list-name">客户</view> <view class="list-name">客户</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择客户" disabled <input type="text" placeholder="请选择客户" disabled
style="border-bottom: 1px solid #fff;text-align: center;" :value="khName.name" @tap="goPopleList('khName')"> style="border-bottom: 1px solid #fff;text-align: center;" :value="khName.name"
@tap="goPopleList('khName')">
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> <uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
@ -124,7 +125,8 @@
<view class="list-name" style="width: 100%;">发货方式</view> <view class="list-name" style="width: 100%;">发货方式</view>
<view class="list-val" style="display: flex;width: 100%;"> <view class="list-val" style="display: flex;width: 100%;">
<radio-group @change="radioChange" style="display: flex;"> <radio-group @change="radioChange" style="display: flex;">
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in logisticsType" :key="item.value"> <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in logisticsType"
:key="item.value">
<view> <view>
<radio :value="item.value" :checked="index === current" /> <radio :value="item.value" :checked="index === current" />
</view> </view>
@ -137,25 +139,31 @@
<view class="content-list" v-if="radioType == '0' || radioType == '1'"> <view class="content-list" v-if="radioType == '0' || radioType == '1'">
<view class="list-name" style="width:150rpx;">{{radioType == '0'? '选择快递' :'选择物流'}}</view> <view class="list-name" style="width:150rpx;">{{radioType == '0'? '选择快递' :'选择物流'}}</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择" disabled <input type="text" placeholder="请选择" disabled :value="wlName.companyName"
style="border-bottom: 1px solid #fff;text-align: center;" @tap="goPopleList(radioType == '0'? 'kdName' :'wlName')"> style="border-bottom: 1px solid #fff;text-align: center;"
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> @tap="goPopleList(radioType == '0'? 'kdName' :'wlName')">
<uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
<view class="content-list" v-if="radioType == '2'"> <view class="content-list" v-if="radioType == '2'">
<view class="list-name" style="width:150rpx;">选择车号</view> <view class="list-name" style="width:150rpx;">选择车号</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择" disabled <input type="text" placeholder="请选择" disabled
style="border-bottom: 1px solid #fff;text-align: center;" @tap="goPopleList('fcName')"> style="border-bottom: 1px solid #fff;text-align: center;"
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> @tap="goPopleList('fcName')">
<uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
<view class="content-list" v-if="radioType != '4' && radioType !=''"> <view class="content-list" v-if="radioType != '4' && radioType !=''">
<view class="list-name" style="width:150rpx;">{{radioType == '0'? '快递员' :'拉包工'}}</view> <view class="list-name" style="width:150rpx;">{{radioType == '0'? '快递员' :'拉包工'}}</view>
<view class="list-val"> <view class="list-val">
<input type="text" placeholder="请选择" disabled <input type="text" placeholder="请选择" disabled :value="radioType == '0'? kdyName.workerName : lbgName.workerName"
style="border-bottom: 1px solid #fff;text-align: center;" @tap="goPopleList(radioType == '0'? 'kdyName' :'lbgName')"> style="border-bottom: 1px solid #fff;text-align: center;"
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> @tap="goPopleList(radioType == '0'? 'kdyName' :'lbgName')">
<uni-icons type="right" size="16"
style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
<view class="content-list" v-if="radioType == '3'"> <view class="content-list" v-if="radioType == '3'">
@ -223,17 +231,17 @@
radioType: '', //发货方式按钮选择 radioType: '', //发货方式按钮选择
khName: [], //客户 khName: [], //客户
gysName: [], //供应商 gysName: [], //供应商
wlName:[], //物流公司 wlName: [], //物流公司/物流/发车
kdName:[], //快递公司
kdyName: [], //快递员 kdyName: [], //快递员
lbgName: [], //拉包工姓名 lbgName: [], //拉包工姓名
fcName:[],//发车车号
} }
}, },
onShow() { onShow() {
this.khName = JSON.parse(JSON.stringify(this.khName)) this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
console.log(this.khName) this.gysName = JSON.parse(JSON.stringify(this.gysName)) || ''
this.wlName = JSON.parse(JSON.stringify(this.wlName)) || ''
this.kdyName = JSON.parse(JSON.stringify(this.kdyName)) || ''
this.lbgName = JSON.parse(JSON.stringify(this.lbgName)) || ''
}, },
onLoad() { onLoad() {
this.xsyList(); this.xsyList();
@ -262,9 +270,13 @@
this.isCollapse = !this.isCollapse this.isCollapse = !this.isCollapse
}, },
radioChange(e) { radioChange(e) {
this.khName = ''
this.gysName = ''
this.wlName = ''
this.kdyName = ''
this.lbgName = ''
//快递0 物流1 发车2 拼包3 自送4 //快递0 物流1 发车2 拼包3 自送4
this.radioType = e.detail.value; this.radioType = e.detail.value;
console.log(this.radioType);
for (let i = 0; i < this.items.length; i++) { for (let i = 0; i < this.items.length; i++) {
if (this.items[i].value === e.detail.value) { if (this.items[i].value === e.detail.value) {
this.current = i; this.current = i;
@ -273,8 +285,17 @@
} }
}, },
goPopleList(popleType) { goPopleList(popleType) {
if (popleType == 'kdyName' && this.wlName == '') {
uni.showToast({
title: "先选择快递公司",
icon: 'error'
})
return
}
let companyType = this.radioType == 0 ? this.wlName.id : ''
console.log(companyType)
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/peopleList?popleType=' +popleType + '&people=' + people + '&radioType=' + radioType url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType
}) })
}, },
goodsAdd() { goodsAdd() {
@ -298,9 +319,11 @@
</script> </script>
<style lang="scss"> <style lang="scss">
page,.page1{ page,
.page1 {
height: 100%; height: 100%;
} }
.content { .content {
border-top: 1px solid #eee; border-top: 1px solid #eee;
overflow-y: scroll; overflow-y: scroll;

20
pages/inventory/inventory.vue

@ -37,9 +37,10 @@
</view> </view>
<view class="search"> <view class="search">
<!-- <u-search placeholder="输入商品名称/编号查询" v-model="keyword"></u-search> --> <!-- <u-search placeholder="输入商品名称/编号查询" v-model="keyword"></u-search> -->
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/编号" cancelButton="none" <uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/编号" cancelButton="none" @confirm="search" />
@confirm="search" /> <view class="title-right-bottom title-btn"
<view class="title-right-bottom title-btn" style="width:22%;float: left;height:75rpx;line-height: 75rpx;margin-top:20rpx;" @click="onGridClick('2')"> style="width:22%;float: left;height:75rpx;line-height: 75rpx;margin-top:20rpx;"
@click="onGridClick('2')">
新增商品 新增商品
</view> </view>
</view> </view>
@ -197,10 +198,14 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/inventory/gategory' url: '/pages/inventory/gategory'
}) })
}else{ } else if (target == '1') {
uni.navigateTo({ uni.navigateTo({
url: '/pages/inventory/addinventory' url: '/pages/inventory/addinventory'
}) })
} else {
uni.navigateTo({
url: "/pages/inventory/addGoods"
})
} }
} }
}, },
@ -266,6 +271,7 @@
margin: 10rpx auto 10rpx; margin: 10rpx auto 10rpx;
} }
.shop-box { .shop-box {
width: 50%; width: 50%;
} }
@ -368,13 +374,15 @@
.price-box text:first-child { .price-box text:first-child {
color: #ffa200 color: #ffa200
} }
.uni-mt-10 { .uni-mt-10 {
position: relative; position: relative;
width: 74% !important; width: 74% !important;
float: left !important; float: left !important;
} }
.uni-searchbar,.uni-searchbar__box{
.uni-searchbar,
.uni-searchbar__box {
width: 100% !important; width: 100% !important;
} }
</style> </style>

47
pages/staff/addStaff/addStaff.vue

@ -17,13 +17,13 @@
<uni-forms-item label="邮箱" name="email"> <uni-forms-item label="邮箱" name="email">
<uni-easyinput type="text" v-model="addForm.email" placeholder="请输入员工邮箱" /> <uni-easyinput type="text" v-model="addForm.email" placeholder="请输入员工邮箱" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="所属门店" required name="shopId"> <!-- <uni-forms-item label="所属门店" required name="shopId">
<uni-data-select <uni-data-select
style="width: 100%" style="width: 100%"
v-model="addForm.shopId" v-model="addForm.shopId"
:localdata="shopList" :localdata="shopList"
></uni-data-select> ></uni-data-select>
</uni-forms-item> </uni-forms-item> -->
<uni-forms-item label="权限" required name="type"> <uni-forms-item label="权限" required name="type">
<uni-data-select <uni-data-select
style="width: 100%" style="width: 100%"
@ -59,7 +59,7 @@ export default {
type:'', type:'',
sex:'', sex:'',
avatar:[], avatar:[],
shopId:'', // shopId:'',
email:'' email:''
}, },
typeList:[ typeList:[
@ -84,9 +84,9 @@ export default {
mobile:{ mobile:{
rules:[{required:true,errorMessage:'不能为空'}] rules:[{required:true,errorMessage:'不能为空'}]
}, },
shopId:{ // shopId:{
rules:[{required:true,errorMessage:'不能为空'}] // rules:[{required:true,errorMessage:'不能为空'}]
}, // },
type:{ type:{
rules:[{required:true,errorMessage:'不能为空'}] rules:[{required:true,errorMessage:'不能为空'}]
}, },
@ -103,31 +103,32 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: type=== 'add'? '新增员工' : '编辑信息' title: type=== 'add'? '新增员工' : '编辑信息'
}); });
this.getShopList() // this.getShopList()
}, },
methods:{ methods:{
getShopList() { // getShopList() {
this.tui.request('/app/common/shops','get',{}, false,true,false).then(res => { // this.tui.request('/app/common/shops','get',{}, false,true,false).then(res => {
if (res.code !== 200) { // if (res.code !== 200) {
return uni.showToast({ // return uni.showToast({
title:res.message, // title:res.message,
icon:'none' // icon:'none'
})} // })}
this.shopList = res.result.map((v) => { // this.shopList = res.result.map((v) => {
return { // return {
text:v.shopName, // text:v.shopName,
value:v.id // value:v.id
} // }
}) // })
}) // })
}, // },
onFormSubmit() { onFormSubmit() {
console.log('submit') console.log('submit')
this.$refs.addForm.validate().then(async () => { this.$refs.addForm.validate().then(async () => {
const res = await this.tui.request('/app/common/user/add','post',this.addForm,false,true,false) const res = await this.tui.request('/app/common/user/add','post',this.addForm,false,true,false)
if (res.code !== 200) return if (res.code == 200){
uni.navigateBack() uni.navigateBack()
console.log(res) console.log(res)
}
},(reason) => { },(reason) => {
console.log(reason) console.log(reason)
}) })

18
pages/staff/staff.vue

@ -23,23 +23,24 @@
<uni-card title="员工列表"> <uni-card title="员工列表">
<uni-list> <uni-list>
<uni-list-item direction="row" clickable @tap="onDotClick(item)" v-for="(item , index) in staffList" :key="index"> <uni-list-item direction="row" clickable @tap="onDotClick(item)" v-for="(item , index) in staffList" :key="index">
<template #header>
<view class="avatar-wrap">
<u-avatar :src="item.avatar" size="24">
</u-avatar>
<text class="staff-name">{{ item.nickname }}</text>
</view>
</template>
<template #body> <template #body>
<view class="tag-wrap"> <view class="tag-wrap">
<view v-if="item.departmentTitle"> <view v-if="item.departmentTitle">
<u-tag :text="item.departmentTitle" size="12" /> <u-tag :text="item.departmentTitle" size="12" />
</view> </view>
<view> <view>
<u-tag text="店长" size="12" /> <u-tag text="店长" v-if="item.type==1" size="12" />
<u-tag text="员工" v-if="item.type==0" size="12" />
</view> </view>
</view> </view>
</template> </template>
<template #header>
<view class="avatar-wrap">
<u-avatar :src="item.avatar" size="24">
</u-avatar>
<text class="staff-name">{{ item.nickname }}</text>
</view>
</template>
<template #footer> <template #footer>
<view><u-icon name="edit-pen-fill" size="28"></u-icon></view> <view><u-icon name="edit-pen-fill" size="28"></u-icon></view>
</template> </template>
@ -105,6 +106,7 @@
} }
.tag-wrap { .tag-wrap {
width: 100rpx;
flex: 1; flex: 1;
display: flex; display: flex;

Loading…
Cancel
Save