Commit d497b2a2 by zhangxw

工单管理,预约管理筛选改版开发联调

1 parent 9ad979f4
......@@ -12,7 +12,8 @@ Component({
if (n) {
this.setData({
scrollTop: 0,
pageNum: 1
pageNum: 1,
nothing: false
})
this.getList(true)
}
......@@ -136,7 +137,7 @@ Component({
if (val.active && val.merchantId) arr.push(val)
})
this.setData({
selectedData: this.arrayUnique(arr.concat(selectedData), 'merchantId')
selectedData: storeRangeList[0]?.active ? [] : this.arrayUnique(arr.concat(selectedData), 'merchantId')
})
},
arrayUnique(arr, name) {
......
......@@ -33,6 +33,9 @@
.title{
margin-bottom: 20rpx;
color: #292D33;
font-weight: 400;
font-size: 32rpx;
}
.store-select-box{
......
......@@ -4,14 +4,14 @@ import api from '~/utils/request/request.js'
module.exports = {
/** 预约列表 */
getInviteList(data) {
// return api.post('dj.api.smartcarlife.inviteRecord.query', {
// pageSize: 10,
// ...data
// })
return api.post('dj.api.smartcarlife.inviteRecord.query.new', {
return api.post('dj.api.smartcarlife.inviteRecord.query', {
pageSize: 10,
...data
})
// return api.post('dj.api.smartcarlife.inviteRecord.query.new', {
// pageSize: 10,
// ...data
// })
},
/**撤销预约跟进记录 */
updateInviteRecordrStatus(data) {
......
......@@ -81,7 +81,7 @@ Component({
},
/**转化人员 & 销售人员*/
getConversionEmployeeList(merchantId, type) {
let target = type == 0 ? 'form.conversionEmployeeList' : 'form.salesmanList'
let target = type == 0 ? 'form.sellerUserIdList' : 'form.userIdList'
if (merchantId) {
api
......@@ -141,8 +141,20 @@ Component({
let { index, listName } = e.currentTarget.dataset
let target = this.data.form[listName]
if (target[index].disabled) return
target.map(i => (i.active = false))
target[index].active = true
if (listName === 'sellerUserIdList' || listName === 'userIdList') {
if (index == 0) {
target.forEach(i => i.active = false)
target[index].active = true
} else {
target[index].active = true
target[0].active = false
}
} else {
target.forEach(i => {
i.active = false
})
target[index].active = true
}
this.setData({
[`form.${listName}`]: target,
isReset: false
......@@ -252,46 +264,53 @@ Component({
})
},
reset() {
let { salesmanList, conversionEmployeeList } = this.data.form
salesmanList?.map((val, index) => {
let { userIdList, sellerUserIdList } = this.data.form
userIdList?.map((val, index) => {
val.active = false
if (index == 0) val.active = true
})
conversionEmployeeList?.map((val, index) => {
sellerUserIdList?.map((val, index) => {
val.active = false
if (index == 0) val.active = true
})
this.setData({
'form.selectedYqMerchantList': [],
'form.selectedMerchantList': [],
'form.conversionEmployeeList': conversionEmployeeList,
'form.salesmanList': salesmanList
'form.sellerUserIdList': sellerUserIdList,
'form.userIdList': userIdList
})
this.init()
},
confirm() {
let { form, userInfo, isReset } = this.data
let obj = {}
Object.keys(form).map(e => {
form[e].map(i => {
Object.keys(form).forEach((e) => {
let arr = []
form[e].forEach((i) => {
if (i.active) {
obj[e] = i.value
let { startDate, endDate } = i
// 预约时间
let { value, startDate, endDate, merchantId } = i
obj[e] = value
if (e == 'inviteStatusList') {
obj['inviteStatus'] = value[0]
delete obj[e]
}
if (startDate && endDate) {
startDate = `${startDate} 00:00:00`
endDate = `${endDate} 23:59:59`
obj.inviteDateStartDate = startDate
obj.inviteDateEndDate = endDate
}
// 超管销售顾问
// if (e == 'selectedMerchantList') obj[]
// // 超管转化人员
// if (e == 'selectedYqMerchantList') obj
// 非超管
if (!userInfo?.isSuper) {
if (obj?.sellerUserIdList?.length) obj['sellerMerchantId'] = [userInfo?.merchantId]
if (obj?.userIdList?.length) obj['merchantId'] = [userInfo?.shopMerchantId]
if (e == 'sellerUserIdList' || e == 'userIdList') {
arr.push(value[0])
obj[e] = arr
}
if (e == 'selectedMerchantList') {
arr.push(merchantId)
obj['merchantIdList'] = arr
}
if (e == 'selectedYqMerchantList') {
arr.push(merchantId)
obj['sellerMerchantIds'] = arr
}
}
})
......
......@@ -8,12 +8,12 @@
转化人员
<view class="title-tips" wx:if="{{!userInfo.isSuper}}">{{userInfo.merchantName}}</view>
</view>
<view wx:if="{{form.conversionEmployeeList.length > 12}}" bindtap="showMore" data-type="1" class="collapse-btn {{!employShowMore ? 'rotate-180' : ''}}"><image src="{{IMG_URL}}collapse_icon.png" mode=""/></view>
<view wx:if="{{form.sellerUserIdList.length > 12}}" bindtap="showMore" data-type="1" class="collapse-btn {{!employShowMore ? 'rotate-180' : ''}}"><image src="{{IMG_URL}}collapse_icon.png" mode=""/></view>
</view>
<view class="list-box">
<block wx:for="{{form.conversionEmployeeList}}" wx:key="index">
<block wx:for="{{form.sellerUserIdList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose"
data-list-name="conversionEmployeeList" data-index="{{index}}" hidden="{{index >= 12 && !employShowMore}}">
data-list-name="sellerUserIdList" data-index="{{index}}" hidden="{{index >= 12 && !employShowMore}}">
<view class="text-item">{{item.staffName}}</view>
</view>
</block>
......@@ -44,11 +44,11 @@
销售顾问
<view class="title-tips" wx:if="{{!userInfo.isSuper}}">{{userInfo.shopMerchantName}}</view>
</view>
<view wx:if="{{form.salesmanList.length > 12}}" bindtap="showMore" data-type="2" class="collapse-btn {{!salesmanShowMore ? 'rotate-180' : ''}}"><image src="{{IMG_URL}}collapse_icon.png" mode=""/></view>
<view wx:if="{{form.userIdList.length > 12}}" bindtap="showMore" data-type="2" class="collapse-btn {{!salesmanShowMore ? 'rotate-180' : ''}}"><image src="{{IMG_URL}}collapse_icon.png" mode=""/></view>
</view>
<view class="list-box">
<block wx:for="{{form.salesmanList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-list-name="salesmanList"
<block wx:for="{{form.userIdList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-list-name="userIdList"
data-index="{{index}}">
<view class="text-item">{{item.staffName}}</view>
</view>
......
......@@ -265,7 +265,6 @@ Page({
})
},
tabClick(e) {
console.log('tabClick', e.detail);
let {
searchObj
} = this.data
......@@ -425,11 +424,9 @@ Page({
}
if (keyword) obj.keyword = keyword
if (tabIndex != 0) obj.inviteStatusList = tabIndex == 1 ? [2, 4, 5, 7] : [1, 3, 6]
console.log(tabIndex, obj);
// debugger
api.getInviteList(obj).then(res => {
wx.hideLoading()
console.log(obj, res)
let {
code,
data,
......@@ -444,12 +441,11 @@ Page({
if (e.customerCoupon.createdDate) e.customerCoupon.time = new Date(e.customerCoupon.createdDate).format('yyyy-MM-dd hh:mm:ss')
}
if (e.customer) {
if (e.customerCoupon.employeeName) e.employeeName = e.customerCoupon.employeeName
if (e.customerCoupon?.employeeName) e.employeeName = e.customerCoupon.employeeName
e.merchantName = e.customer.merchantName
e.yqMerchantName = e.customer.yqMerchantName
}
})
console.log(data.list, 'list')
const userType = !userInfo?.isSuper && userInfo?.merchantType && (userInfo.userType == 1 || userInfo?.userType == 2)
list = data.list.map(item => {
item.repeal = userType && [1, 2].includes(item.inviteStatus)
......@@ -472,7 +468,6 @@ Page({
})
},
showDateBox(e) {
console.log(e)
let {
item
} = e.currentTarget.dataset
......@@ -497,7 +492,6 @@ Page({
})
.then(res => {
wx.hideLoading()
console.log(res)
let {
code,
message
......@@ -541,7 +535,6 @@ Page({
this.search()
})
}
console.log(options, 'options');
},
/**
* 生命周期函数--监听页面初次渲染完成
......
......@@ -17,7 +17,6 @@ Component({
let { userInfo } = this.data
// 非超管 获取转化人员 销售顾问
if (!userInfo?.isSuper) {
console.log(wx.$orderListRefresh)
if (wx.$orderListRefresh) {
this.getScreenList()
}
......@@ -274,8 +273,20 @@ Component({
let { index, listName } = e.currentTarget.dataset
let target = this.data.form[listName]
if (target[index].disabled) return
target.map(i => (i.active = false))
target[index].active = true
if (listName === 'sellerUserIdList' || listName === 'userIdList') {
if (index == 0) {
target.forEach(i => i.active = false)
target[index].active = true
} else {
target[index].active = true
target[0].active = false
}
} else {
target.forEach(i => {
i.active = false
})
target[index].active = true
}
this.setData({
[`form.${listName}`]: target,
isReset: false
......@@ -376,12 +387,12 @@ Component({
confirm() {
let { form, userInfo, isReset } = this.data
let obj = {}
let arr = []
Object.keys(form).map(e => {
Object.keys(form).forEach(e => {
let arr = []
form[e]?.map(i => {
if (i.active) {
obj[e] = i.value
let { orderStartDate, orderEndDate, payStartDate, payEndDate } = i
let { orderStartDate, orderEndDate, payStartDate, payEndDate, value, merchantId } = i
obj[e] = value
// 订单时间
if (orderStartDate && orderEndDate) {
orderStartDate = `${orderStartDate} 00:00:00`
......@@ -396,21 +407,20 @@ Component({
obj.installUpgradeBeginTimeStr = payStartDate
obj.installUpgradeEndTimeStr = payEndDate
}
if (e == 'sellerUserIdList' || e == 'userIdList') {
arr.push(value[0])
obj[e] = arr
}
// 超管销售顾问
if (e == 'selectedMerchantList') {
arr.push(i?.merchantId)
arr.push(merchantId)
obj['merchantIdList'] = arr
}
// 超管转化人员
if (e == 'selectedYqMerchantList') {
arr.push(i?.merchantId)
arr.push(merchantId)
obj['sellerMerchantIds'] = arr
}
// 非超管
if (!userInfo?.isSuper) {
if (obj?.sellerUserIdList?.length) obj['sellerMerchantId'] = [userInfo?.merchantId]
if (obj?.userIdList?.length) obj['merchantId'] = [userInfo?.shopMerchantId]
}
}
})
})
......
......@@ -470,6 +470,10 @@ this.setData({
},
getStatByStatus() {
let { searchObj, keyword, tabList, tabListTemplate } = this.data
if ((searchObj.statusList && searchObj.statusList[0] == 'Y') || (searchObj.statusList && searchObj.statusList[0] == 'N')) {
searchObj.constructionFlag = searchObj.statusList[0]
delete searchObj.statusList
}
api
.statByStatus({
...searchObj,
......
......@@ -70,33 +70,23 @@ transform: rotate(-90deg);
width: 194rpx;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 6rpx 12rpx 0 #0000000d;
/* box-shadow: 0 6rpx 12rpx 0 #0000000d; */
border-radius: 16rpx;
height: 264rpx;
}
.search-box .select_box .option_box::after{
height: 0;
width: 0;
content: '';
position: absolute;
border: 14rpx solid transparent;
border-right: 14rpx solid #FFFFFF;
top: -24rpx;
left: 88rpx;
z-index:-1;
transform: rotate(90deg);
filter: drop-shadow(2rpx 2rpx 10rpx #0000004D);
}
.search-box .select_box .option_box::before{
height: 0;
width: 0;
content: '';
content: "";
position: absolute;
border: 14rpx solid transparent;
border-right: 14rpx solid #FFFFFF;
top: -24rpx;
top: -30rpx;
left: 88rpx;
z-index:-1;
transform: rotate(90deg);
width: 0;
height: 0;
border-top: 14rpx solid transparent;
border-bottom: 14rpx solid #fafafa;
border-left: 14rpx solid transparent;
border-right: 14rpx solid transparent;
z-index: 1;
}
.search-box .select_box .option_box .option{
display: block;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!