wangfukang 2 years ago
parent
commit
eef851cda5
  1. BIN
      package1/index/.DS_Store
  2. 184
      package1/index/feedBack.vue
  3. 296
      package1/index/order.vue
  4. 1613
      package1/index/orderDetail.vue
  5. 495
      package1/index/peopleList.vue

BIN
package1/index/.DS_Store

Binary file not shown.

184
package1/index/feedBack.vue

@ -0,0 +1,184 @@
<!-- 底部菜单--库存--新增商品 -->
<template>
<view>
<view class="formBox">
<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="85px">
<uni-forms-item label="问题图片" name="productPicture">
<view v-if="formData.productPicture !=''">
<img :src="formData.productPicture" alt="" class="upload-img">
</view>
<u-upload :fileList="formData.productPicture" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="1"></u-upload>
</uni-forms-item>
<uni-forms-item label="问题说明" name="productIntro">
<uni-easyinput type="textarea" autoHeight v-model="formData.productIntro" placeholder="请简要描述问题"
trim="all" />
</uni-forms-item>
</uni-forms>
<u-button type="primary" @tap.stop="submit()">保存</u-button>
</view>
<view class="make-call" @tap="makeCall('15533910775')">联系客服</view>
</view>
</template>
<script>
export default {
data() {
return {
fileList1: [],
formData: {
productPicture: '',
productIntro: ''
},
categoryList: [],
productId:'',
arrtList: [],
arrtChange: [],
dataList:[],
shopName:'',
rules: {
productIntro: {
rules: [{
required: true,
errorMessage: '请简要描述问题',
}, ],
}
}
}
},
onLoad(option) {
this.shopName = uni.getStorageSync('shopName')
},
methods: {
// 删除图片
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead(event) {
let lists = [].concat(event.file)
if (this.formData.productPicture == undefined) this.formData.productPicture = [];
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: 'https://dev.xenjoyou.com/hiver/upload/file',
filePath: url,
name: 'file',
header: {
"content-type": "multipart/form-data",
'accessToken': this.tui.getToken()
},
formData: {},
success: (uploadFileRes) => {
let path = JSON.parse(uploadFileRes.data)
//后端返回的地址,存入图片地址
this.formData.productPicture = path.result
}
});
})
},
makeCall(phone) {
uni.makePhoneCall({
phoneNumber: phone + ''
});
},
// 触发提交表单
submit() {
let that = this;
let url = ''
this.$refs.form.validate().then(res => {
that.tui.request('/app/problemFeedback/saveOrUpdateProblemFeedback', "post", {
problemPicture:that.formData.productPicture,
problemContent:that.formData.productIntro,
shopName:this.shopName
}, false, false).then((res1) => {
if (res1.code == 200) {
this.tui.toast('反馈成功!')
setTimeout(res=>{
uni.navigateBack({
delta: 2
})
},1000)
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}).catch(err => {
})
}
}
}
</script>
<style lang="scss" scoped>
.formBox {
margin: 20rpx;
padding: 20rpx 26rpx;
border-radius: 14rpx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
background-color: #fff;
.uni-data-select {
width: 100%;
}
.attrs {
text {
display: inline-block;
border: 1px solid $u-primary;
padding: 7px 20rpx;
margin: 20rpx;
background-color: #fff;
color: $u-primary;
}
.checkedText {
background-color: $u-primary;
color: #fff;
}
}
}
.upload-img{
width: 160rpx;
height: 160rpx;
}
.make-call{
text-decoration: underline;
color: blue;
position: fixed;
bottom: 60rpx;
text-align: center;
width: 100%;
}
</style>

296
package1/index/order.vue

@ -0,0 +1,296 @@
<template>
<view>
<view class="search" style="position: fixed;top: 0;z-index: 99;">
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" @change="searchList" type="daterange" />
<uni-search-bar class="uni-mt-10" radius="5" placeholder="输入客户名称/销售人员搜索" cancelButton="none"
@confirm="searchList" />
</view>
<!-- <u-alert description="点击列表可跳转至销售单" type="primary"></u-alert> -->
<view class="u-transition" style="display:flex;background: #ecf5ff;width: 100%;color: #5fd9ee;height: 80rpx;line-height: 80rpx;padding-left: 20rpx;">
<view>点击列表可跳转至销售单</view>
<!-- <view @tap.stop="printCodeBtn" class="dayin-text" v-if="btnStatus">打印商品码</view>
<view @tap.stop="printCodeBtn" class="dayin-text" v-else>取消操作</view> -->
</view>
<view class="ulList" v-if="inventoryList.length > 0" style="overflow: scroll;margin-top:300rpx;">
<ul :style="{'margin-bottom':btnStatus==false?'160rpx':''}">
<li v-for="(item,index) in inventoryList" :key="index">
<checkbox-group @change="checkboxChange">
<label class="uni-list-cell uni-list-cell-pd" >
<checkbox v-if="btnStatus==false" :value="item" style="float: left;width: 60rpx;line-height: 300rpx;margin: 0 20rpx;" />
<view :style="{width:btnStatus==false?'95%':'100%'}" @tap="gotoDetail(item.id)">
<uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="item.createTime == null ?'暂无':item.createTime" :extra="'数量:'+(item.productCount == null ?'暂无':item.productCount)"
:thumbnail="item.saleDetailDTOList[0].productPicture">
<view class="uni-body"><text class="cardText">销售员:</text> {{item.createByName == null ?'暂无':item.createByName}}</view>
<view class="uni-body"> <text class="cardText"> 营业额:</text> <text class="priceText">
{{item.realAmount == null ?'暂无':item.realAmount}} </text> <text decode class="cardText">
{{'&nbsp;&nbsp;&nbsp;&nbsp; 欠款: '}} </text> <text class="priceText">{{item.noEarn == null ?'暂无':item.noEarn}}
</text></view>
<view class="uni-body"> <text class="cardText">
订单状态:</text>{{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}}
</view>
<view class="floatRight" v-if="item.status == 6" @tap.stop="goSaleGoods(item)">去开单</view>
<view class="floatRight" style="color: red;width: 150rpx;" @tap.stop="delItemModal(item)" v-if="item.status == 6">删除订单</view>
</uni-card>
</view>
</label>
</checkbox-group>
</li>
<u-loadmore :status="status" />
</ul>
</view>
<u-empty v-else mode="order" margin-top="200"></u-empty>
</view>
</template>
<script>
export default {
data() {
return {
searchStr: '',
type: '',
inventoryList: [],
status: 'loadmore',
page: 1,
totalPages: 0,
// type:'',
range:[],
btnStatus:true
};
},
onLoad(options) {
this.type = options.type;
this.listStatus = options.listStatus
},
onShow(){
this.getOrderInfoList()
},
onReachBottom() {
if (this.page >= this.totalPages) return;
this.status = 'loading';
this.page = ++this.page;
this.getOrderInfoList();
},
methods: {
gotoDetail(id) {
this.page = 1
uni.navigateTo({
url: '/package1/index/orderDetail?id=' + id
})
},
searchList(res) {
this.searchStr = res.value
this.page = 1;
this.inventoryList = [];
this.getOrderInfoList()
},
// 订单查询
getOrderInfoList() {
this.status = 'loading';
this.tui.request("/app/sale/listPages", "POST", {
pageVo: {
pageSize: 10,
pageNumber: this.page
},
startTime:this.range[0],
endTime:this.range[1],
searchStr:this.searchStr,
status:this.listStatus
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
if (this.page == 1) {
this.inventoryList = res.result.records
} else {
this.inventoryList = [...this.inventoryList, ...res.result.records]
}
this.totalPages = res.result.pages
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
},
//带参数跳转到开单页
goSaleGoods(item) {
let dataList = []
if(item.saleDetailDTOList){
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
let obj = {}
let attrMap = new Map()
let newSaleDetailDTOList = []
let num = 0
for(let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++){
if(attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true){
let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount].productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount)
}else{
item.saleDetailDTOList[i].stockLogList1[m].name = this.sliceMsg(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m])
attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList,num)
num++
}
}
obj.saleDetailQueryDTO = newSaleDetailDTOList
obj.num = 0
obj.id = item.saleDetailDTOList[i].productId
obj.price = item.saleDetailDTOList[i].price
obj.lsprice = item.saleDetailDTOList[i].price
obj.categoryId=item.saleDetailDTOList[i].categoryId
obj.zPrice = item.saleDetailDTOList[i].discountAmount
obj.unitPrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i].wholesalePrice
obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture+'?time='+new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.saleId = item.id
obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj)
}
}else{
let obj = {}
obj.num = 0
obj.price = 0
obj.saleId = item.id
obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj)
}
let khName = {
name:item.userName,
id:item.userId,
area:item.area,
city:item.city,
address:item.receiveAddress,
province:item.province,
}
item.name = item.userName;
item.id = item.userId
uni.setStorageSync('khName',JSON.stringify(item))
uni.setStorageSync('carList1',JSON.stringify(dataList))
uni.setStorageSync('hangOrder', true)
uni.switchTab({
url: '/pages/inventory/goodsList1'
})
},
//点击打印按钮
printCodeBtn(){
this.btnStatus = !this.btnStatus
},
// checkboxChange(e){
// },
delItemModal(item) {
let that = this;
uni.showModal({
title: "提示",
content: "确定删除此条待配货订单吗?",
success: function(res) {
if (res.confirm) {
that.tui.request("/app/sale/delById", "post", {
id: item.id,
}, false, true).then((res) => {
if (res.code == 200) {
that.getOrderInfoList();
uni.showToast({
title:"删除成功",
icon: 'none'
})
} else {
uni.showToast({
title:"删除失败",
icon: 'none'
})
}
}).catch((res) => {})
}
}
})
}
}
}
</script>
<style lang="scss">
.u-transition{
width: 100%;
position: fixed;
top: 226rpx;
z-index: 99;
}
.search {
padding: 20upx;
background-color: #fff;
width: 100%;
background-color: #fff;
}
.uni-searchbar{
padding: 20rpx 0 !important;
}
.dayin-text{
flex: 1;
text-align: right;
padding-right: 20rpx;
text-decoration: underline;
color: blue;
}
.ulList {
ul {
li {
font-size: 12px;
.floatRight {
float: right;
padding: 14rpx;
color: $u-primary;
font-size: 26upx;
}
.cardText {
font-size: 12px;
}
.priceText {
color: $u-primary;
font-size: 14px;
}
}
}
}
.order-bottom{
background: #fff;
height: 120rpx;
width: 100%;
position: fixed;
bottom:0;
button{
width: 90%;
height: 80rpx;
margin: 0 auto;
background: #088FEB;
color: #fff;
margin-top: 20rpx;
}
}
</style>

1613
package1/index/orderDetail.vue

File diff suppressed because it is too large

495
package1/index/peopleList.vue

@ -0,0 +1,495 @@
<template>
<view class="">
<view style="width: 100%;position: fixed;top: 0;z-index: 99;">
<view v-if="popleType== 'khName' || popleType== 'gysName'" style="background:#fff;padding-top:20rpx;">
<button size="default" type="default" @tap="goAddPeople" hover-class="is-hover">{{popleType=='khName'?'新增客户':'新增供应商'}}</button>
</view>
<view class="title-box" v-if="popleType=='wlName' || popleType=='dbName' || popleType=='fcName'">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入名称或发货地查询" cancelButton="none"
@confirm="search" />
</view>
<view class="title-box" v-else>
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入名称查询" cancelButton="none"
@confirm="search" />
</view>
</view>
<view style="overflow:scroll;" :style="{'margin-top':popleType == 'khName' || popleType == 'gysName'?'230rpx':'110rpx'}">
<view v-if="popleType== 'khName' || popleType== 'gysName'" style="overflow:scroll;">
<!-- 供应商、客户走这一套 -->
<view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)"
style="display: flex;flex-direction: column;height: auto;min-height: 160rpx;padding-bottom: 20rpx;">
<view class="name-tel" style="width: 100%;" v-if="popleType=='gysName'">
<text style="line-height: 75rpx;">{{item.consigneeName}}</text>
<text>{{item.consigneeMobile}}</text>
</view>
<view class="name-tel" style="width: 100%;" v-else>
<text style="line-height: 75rpx;">{{item.name}}</text>
<text v-if="item.name != '散客'">{{item.phone}}</text>
</view>
<view class="name-tel" style="width: 100%;display: flex;flex-direction: column;height:auto;font-size: 30rpx;">
<text>{{item.name == '散客'?'-':item.province + item.city + item.area}}</text>
<text style="width:75%;font-size: 26rpx;color:#747474;height: auto;line-height: 30rpx;">{{item.name == '散客'?'-':item.address}}</text>
</view>
<view v-if="item.name != '散客' && popleType== 'khName'" style="color: red;position: absolute;top: 8px;right: 17px;font-size: 13px;">
欠款:{{item.noEarn?item.noEarn :0}}
</view>
<view v-if="item.name != '散客'" class="name-edit" @tap.stop="goAddPeople('edit',item)" style="bottom: 86rpx;">
编辑
</view>
<view v-if="item.name != '散客'" class="name-edit" @tap.stop="goDetail(item)" style="background: #FF9797;bottom:16rpx">
查看明细
</view>
</view>
</view>
<!-- 物流、发车走这一套 -->
<view class="" v-if="popleType== 'wlName' || popleType== 'fcName'">
<view class="list-1" v-for="(item,index) in popleList[0]" :key="index" v-if="user!='13521030702' && item.shippingMethod != '测试勿选'" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)">
<view class="name-tel">
<text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;" v-if="item.workerName">{{item.workerName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
</view>
<view class="standard-box" @tap.stop="toggle('center',item)">
<view class="">
<text style="padding-left:40rpx;">线路查询</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75rpx;"></uni-icons>
</view>
<view class="phone-btn" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
</view>
<view style="position: absolute;bottom: 0;left: 40rpx;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45rpx;color:red;font-size: 24rpx;" v-if="item.rebateAmount">本单返佣{{item.rebateAmount}}元</text>
</view>
</view>
<view class="no-more" v-if="searchName == ''">
<view>以上结果根据客户地址自动匹配得出</view>
<view>↓↓下方为区域内所有物流公司↓↓</view>
</view>
<view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList[1]" :key="item" v-if="user!='13521030702' && item.companyName != '测试勿选'">
<!-- <view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)">
<view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)">
此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话
</view>
</view> -->
<view class="name-tel">
<text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;" v-if="item.workerName">{{item.workerName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
</view>
<view class="standard-box" @tap.stop="toggle('center',item)">
<view class="">
<text style="padding-left:40rpx;">线路查询</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75rpx;"></uni-icons>
</view>
<view class="phone-btn" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
</view>
<view style="position: absolute;bottom: 0;left: 40rpx;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45rpx;color:red;font-size: 24rpx;" v-if="item.rebateAmount">本单返佣{{item.rebateAmount}}元</text>
</view>
</view>
</view>
<!--快递、拉包工、大巴 -->
<view class="" v-if="popleType== 'kdName' || popleType== 'lbgName' || popleType== 'kdyName' || popleType== 'dbName'">
<view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList" :key="item">
<!-- <view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)">
<view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)">
此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话
</view>
</view> -->
<view class="name-tel">
<text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75rpx;" v-if="item.workerName">{{item.workerName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
</view>
<view class="standard-box" @tap.stop="toggle('center',item)">
<view class="" v-if="popleType !='kdyName' && popleType !='lbgName'">
<text style="padding-left:40rpx;">收费标准</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75rpx;"></uni-icons>
</view>
<view class="phone-btn" :style="{'line-height':(popleType !='kdyName' && popleType !='lbgName')?'':'80rpx'}" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
</view>
<!-- <view style="position: absolute;bottom: 0;left: 40rpx;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45rpx;color:red;font-size: 24rpx;" v-if="item.rebateAmount">本单返佣{{item.rebateAmount}}元</text>
</view> -->
</view>
</view>
<u-loadmore :status="status" />
</view>
<view>
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="popup-title">
<text>收费标准</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute;right: 0;"></uni-icons>
</view>
<view class="popup-container">
<text style="display: inline-block;text-indent: 2em;">{{remark}}</text>
</view>
</view>
</uni-popup>
</view>
</view>
</template>
<script>
export default {
data() {
return {
popleType: '',
popleList: [],
signCompany: '', // 1物流 2快递 3发车
people: '', //快递、物流、发车的id
radioType: '', //选择的是快递还是物流
companyType: '', //运输公司类型 快递公司有值 物流公司直接传空
modelShow:false,
status: 'loadmore',
remark:'',
khName:{},
searchName:'',
pages: 1,
totalPages: 0,
noClick:0,
hour:0,
user:''
}
},
onReachBottom() {
if (this.pages >= this.totalPages) return;
this.status = 'loading';
this.pages = ++this.pages;
this.getPeopleType();
},
onShow(){
if(this.modelShow == true){
this.popleType = this.popleType
this.khOrGysList();
}
},
onLoad(options) {
this.popleType = options.popleType
this.noClick = options.noClick || 0
this.companyType = options.companyType || ''
uni.setStorageSync('clearMsg','1')
this.user = uni.getStorageSync('username')
if(options.khName){
this.khName = JSON.parse(options.khName) || ''
}
if(options.popleType == 'khName'){
uni.setNavigationBarTitle({
title: '客户列表'
});
}else if(options.popleType == 'gysName'){
uni.setNavigationBarTitle({
title: '供应商列表'
});
}
this.getPeopleType();
},
methods: {
getPeopleType(){
if (this.popleType == 'khName' || this.popleType == 'gysName') { //供应商或者客户
this.khOrGysList();
} else if (this.popleType == 'wlName' || this.popleType == 'kdName' || this.popleType == 'fcName' || this.popleType == 'dbName') { //物流快递
this.wlOrKdList(this.popleType)
} else {
this.kdyOrlbgList();
}
},
//客户、供应商列表
khOrGysList() {
this.status = 'loading';
if(this.popleType == 'gysName'){ //供应商
this.tui.request("/app/supplier/getByCondition", "post", {
searchStr:this.searchName,
pageNumber: this.pages,
pageSize: 10
}, false, true).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
if (this.pages == 1) {
this.popleList = res.result.content
} else {
this.popleList = [...this.popleList, ...res.result.content]
}
this.totalPages = res.result.totalPages
}else{
this.tui.toast(res.message)
}
})
}else{ //客户
this.tui.request("/app/customer/list", "post", {
searchStr:this.searchName,
pageNum: this.pages,
pageSize: 10
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
if (this.pages == 1) {
this.popleList = res.result.records
} else {
this.popleList = [...this.popleList, ...res.result.records]
}
this.totalPages = res.result.pages
}else{
this.tui.toast(res.message)
}
})
}
},
//物流或者快递列表
wlOrKdList(e,num) {
this.status = 'loading';
let url,
data = {},
isTrue
//物流:1 快递:2 发车3
if (e == 'wlName') {
url = '/app/operatingArea/getByArea'
isTrue = true
data = {
province:this.searchName == '' ? this.khName.province : '',
city:this.searchName == '' ? this.khName.city : '',
area:this.searchName == '' ? this.khName.area : '',
shippingType:0,
seachParams:this.searchName
}
} else if (e == 'kdName') {
isTrue = false
url = '/app/logitics/getAll'
data = {
signCompany:1
}
} else if (e == 'fcName') {
isTrue = true
data = {
province:this.searchName == '' ? this.khName.province : '',
city:this.searchName == '' ? this.khName.city : '',
area:this.searchName == '' ? this.khName.area : '',
shippingType:4,
seachParams:this.searchName
}
url = '/app/operatingArea/getByArea'
}else if (e == 'dbName') {
isTrue = false
url = '/app/logitics/getAll'
data = {
signCompany:5,
seachParams:this.searchName
}
}
this.tui.request(url, "post", data, false, isTrue).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
if(e == 'kdName' || e == 'dbName'){
this.popleList = res.result;
}else{
this.popleList.push(res.result.operatingAreaList)
this.popleList.push(res.result.logiticsCompanyList)
}
}else{
this.tui.toast(res.message)
}
})
},
//未入库遮罩
clickMask(item){
let title = ''
if(item.delFlag == 0){
title = '请将商品上架后再操作!'
}else{
title = '请将上次入库的采购价维护后再进行操作!'
}
uni.showToast({
title: title,
icon: 'none'
})
},
//点击选择列表,带参数 返回上一页
clickList(item) {
if(item.isOnLine ==0){
this.tui.toast(this.popleType== 'wlName'?'物流公司已下线': this.popleType== 'fcName'?'厢货车已下线': this.popleType== 'dbName'?'大巴车已下线':this.popleType== 'lbgName'?'拉包工已下线':this.popleType== 'kdyName'?'快递员已下线':'公司已下线')
return
}
if(this.isAfterNoon() && this.popleType== 'dbName'){
this.tui.toast('大巴车已下线')
return
}
if(this.noClick == 0){
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例
//客户和供应商用一个名字
if (this.popleType == 'khName' || this.popleType == 'gysName') {
prevPage.$vm.khName = item
} else if (this.popleType == 'kdName' || this.popleType == 'wlName' || this.popleType == 'fcName' ||this.popleType == 'dbName') {
prevPage.$vm.wlName = item
} else if (this.popleType == 'lbgName') {
prevPage.$vm.lbgName = item
} else if (this.popleType == 'kdyName') {
prevPage.$vm.kdyName = item
}
uni.navigateBack({
delta: 1
})
}
},
//大巴车判断是否超过了下午两点,超过不能选择
isAfterNoon() {
const now = new Date();
const hour = now.getHours();
return hour >= 14; // 下午2点对应的小时数是14(注意:JS中的getHours() 返回的是0到23的整数)
},
//拨打电话
clickPhone(phone) {
uni.makePhoneCall({
phoneNumber: phone
});
},
//顶部搜索框
search(res) {
this.pages = 1
this.searchName = res.value
this.popleList = []
this.getPeopleType()
},
//查询拉包工和快递人员的列表
kdyOrlbgList() {
this.status = 'loading';
this.tui.request("/worker/getByCondition", "post", {
ownerCompany: this.companyType, //公司id,如果是快递公司,才需要传
searchStr:this.searchName,
pageNum: this.pages,
pageSize: 10
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
if (this.pages == 1) {
this.popleList = res.result.content
} else {
this.popleList = [...this.popleList, ...res.result.content]
}
this.totalPages = res.result.totalPages
}else{
this.tui.toast(res.message)
}
})
},
//新增人员
goAddPeople(type,data){
this.modelShow = true;
this.pages = 1
this.searchName = ""
this.popleList = []
uni.navigateTo({
url: "/pages/billing/addUser?type="+type+'&data='+JSON.stringify(data) + '&popleType=' + this.popleType
})
},
goDetail(data){
uni.navigateTo({
url: "/pages/index/customAndSupplierProductDetail?popleType="+this.popleType+'&id='+data.id
})
},
//打开弹出层
toggle(type,item) {
uni.setStorageSync("transCompany", item.shippingMethodId || item.id)
uni.navigateTo({
url: "/package1/other/logisticsAddress?type=kaidan"
})
},
//关闭弹出层
close() {
this.$refs.popup.close()
},
}
}
</script>
<style lang="scss" scoped>
button {
color: #ffffff;
background: #5fd9ee;
width: 90%;
}
.list-1 {
display: flex;
height: 150rpx;
border-bottom: 1px solid #eee;
background: #fff;
font-size: 32rpx;
margin: 20rpx auto 0;
width: 95%;
padding-left: 30rpx;
position: relative;
}
.name-tel {
width: 75%;
display: flex;
flex-direction: column;
height: auto;
font-size: 15px;
}
.name-edit{
width: 110rpx;
height: 55rpx;
position: absolute;
right: 35rpx;
background: #088FEB;
color: #fff;
font-size: 22rpx;
line-height: 55rpx;
text-align: center;
border-radius: 5px;
}
.standard-box {
color: #088FEB;
width: 30%;
font-size: 26rpx;
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: 700rpx;
background-color: #fff;
}
.title-box {
background: #fff;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-container {
margin-top: 20rpx;
}
.phone-btn {
width: 150rpx;
color: #088FEB;
font-size: 26rpx;
padding-left:40rpx;
}
.no-more{
text-align: center;
color: #BEBEBE;
margin-top:20rpx;
}
.shop-mask {
width: 100%;
height: 120rpx;
position: absolute;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.6);
}
</style>
Loading…
Cancel
Save