Commit e1e5dc7f by liaoym

Merge branch 'SAAS+V5.5.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.5.0

2 parents cae85bec 6b4c5283
...@@ -11,6 +11,7 @@ import sceneMarketApi from './sceneMarketApi' ...@@ -11,6 +11,7 @@ import sceneMarketApi from './sceneMarketApi'
import interceptionApi from './interceptionApi' import interceptionApi from './interceptionApi'
import popupApi from './popupApi' import popupApi from './popupApi'
import usedCarApi from './usedCar' import usedCarApi from './usedCar'
import equitApi from './equit'
module.exports = { module.exports = {
commonApi, commonApi,
...@@ -25,5 +26,6 @@ module.exports = { ...@@ -25,5 +26,6 @@ module.exports = {
popupApi, popupApi,
evaluationApi, evaluationApi,
usedCarApi, usedCarApi,
activityApi activityApi,
equitApi
} }
<template>
<view class="list">
<view @click="currentId = ''" :class="['item flex', { active: !currentId }]">
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view :key="index" @click="currentId = i.value" :class="['item flex', { active: currentId == i.value }]">
<view class="sprite-icon icon-tag-checked"></view>
{{ i.name }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ContractList',
inject: ['userInfo'],
data () {
return {
list: [],
currentId: '',
// 合同协议状态数据
zyPayStatus: [{
name: '待上传',
value: '1'
}, {
name: '已上传',
value: '2'
}],
}
},
props: {
params: Object,
data: [Object, Array],
},
watch: {
currentId: {
handler (value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted () {
this.initList(this.zyPayStatus)
},
methods: {
initList (list) {
this.list = list
let { data, params: { idKey } } = this
this.currentId = data[idKey]
this.$emit('onComplete')
},
}
}
</script>
<style scoped lang="scss">
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="list">
<view
v-for="(item, index) in options"
:key="index"
@click="selectOption(item)"
:class="['item flex', { active: currentId === item.value }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ item.label }}
</view>
</view>
</template>
<script>
export default {
name: 'CourseOptionList',
data() {
return {
currentId: '',
options: []
}
},
props: {
params: Object,
data: [Object, Array]
},
watch: {
currentId: {
handler(value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted() {
this.getList()
},
methods: {
getList() {
const { params } = this
this.options = params.options || []
// 初始化选中值
let { data, params: { idKey } } = this
if (data && data[idKey]) {
this.currentId = data[idKey]
}
this.$emit('onComplete')
},
selectOption(item) {
// 如果点击已选中的选项,则取消选中
if (this.currentId === item.value) {
this.currentId = ''
} else {
this.currentId = item.value
}
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
<template>
<view class="employee-list">
<view
@click="currentIds = []"
:class="['item flex',{active:!currentIds.length}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i)"
:class="['item flex',{active:checkActive(i)}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.staffName}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'EmployeeList',
inject: ['userInfo'],
data () {
return {
list: [],
currentIds: []
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentIds: {
handler (val) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value: val.length ? val : null
})
},
deep: true
}
},
mounted () {
this.getList()
},
methods: {
async getList () {
const { userInfo, params } = this,
{ cacheData } = params
if (cacheData && cacheData.length) {
this.initList(cacheData)
return
}
const { shopMerchantId, sceneType, merchantId } = userInfo,
data = await uni.$api.popupApi.getOrderScreenEmployeeList({
merchantId: params.idKey == 'sellerUserIdList' ? merchantId : shopMerchantId,
sceneList: params.idKey == 'sellerUserIdList' ? '' : [sceneType]
})
if (data && data.length) {
this.initList(data)
params.cacheData = data
this.$emit('update:params', params)
}
},
initList (list) {
let { data, params: {idKey} } = this
this.list = list
let paramsData = idKey ? data[idKey] : data
if (paramsData && paramsData.length) paramsData.map(e => {
this.currentIds.push(e)
})
this.$emit('onComplete')
},
choose (i) {
if (i) {
let { uuid } = i,
{ currentIds } = this,
index = currentIds.indexOf(uuid)
if (index == -1) this.currentIds.push(uuid)
else this.currentIds.splice(index, 1)
}
},
checkActive (i) {
let { currentIds } = this,
active = false
if (currentIds.length) active = currentIds.includes(i.uuid)
return active
// return this.currentIds.includes(i.uuid)
},
}
}
</script>
<style scoped lang='scss'>
.employee-list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="currentId = i.id"
:class="['item flex',{active:currentId == i.id}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'OrderStatusList',
inject: ['userInfo'],
data () {
return {
list: Object.freeze([
{
name: '待跟进',
value: [1],
id: 1
},
{
name: '已支付',
value: [4],
id: 2
},
{
name: '待支付',
value: [3],
id: 3
},
{
name: '已撤销',
value: [9],
id: 4
},
{
name: '战败',
value: [2],
id: 5
},
{
name: '已评价',
value: [6],
id: 6
},
{
name: '已关闭',
value: [10],
id: 7
},
{
name: '已失效',
value: [11],
id: 8
},
{
name: '未施工',
value: ['N'],
id: 9
},
{
name: '已施工',
value: ['Y'],
id: 10
},
{
name: '已退款',
value: [5, 12],
id: 11
}
]),
currentId: '',
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentId: {
handler (val) {
let { params: { idKey } } = this,
{ list } = this,
item = list.find(item => item.id == val)
this.$emit('choose', {
key: idKey,
value: item ? item.value : null
})
},
deep: true
}
},
mounted () {
this.initList()
},
methods: {
initList () {
let { data, params: { idKey }, list } = this
if (data[idKey]) {
let item = list.find(val => val.value.join(',') == data[idKey].join(','))
this.currentId = item ? item.id : ''
}
this.$emit('onComplete')
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="currentId = i.value"
:class="['item flex',{active:currentId == i.value}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
const payTypeList = [{
name: '门店收款',
value: 2
},
{
name: '微信支付',
value: 1
},
{
name: 'POS机支付',
value: 3
},
{
name: '支付宝支付',
value: 4
},
{
name: '嘀加收款',
value: 5
}
]
export default {
name: 'PayList',
inject: ['userInfo'],
data () {
return {
list: [],
currentId: '',
}
},
props: {
params: Object,
data: [Object, Array],
},
watch: {
currentId: {
handler (value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted () {
this.getList()
},
methods: {
async getList () {
const { userInfo, params } = this,
{ cacheData } = params
if (cacheData && cacheData.length) {
this.initList(cacheData)
return
}
const { merchantId } = userInfo,
data = await uni.$api.popupApi.getYqStoreConfig({
yqMerchantId: merchantId
})
if (data) {
let obj = data || {}
let m = obj.supportPayTypes || []
let n = JSON.parse(JSON.stringify(payTypeList))
let payList = n.filter(k => {
let idx = m.find(j => j == k.value)
return idx >= 0
})
payList = [
...payList,
{
name: '对公转账',
value: '6'
},
{
name: '其它收款',
value: '7'
}
]
this.initList(payList)
params.cacheData = payList
this.$emit('update:params', params)
}
},
initList (list) {
this.list = list
let { data, params: { idKey } } = this
this.currentId = data[idKey]
this.$emit('onComplete')
},
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="choose(i.id)"
:class="['item flex',{active:currentId == i.id}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
<template v-if="currentId == 3 && customDate.startDate && customDate.endDate">
<view
class="calendar flex"
@click="$refs.calendar.open()"
>
<view class="item flex active">
{{customDate.startDate}}
</view>
<view class="splice">-</view>
<view class="item flex active">
{{customDate.endDate}}
</view>
</view>
</template>
<template v-else>
<view
@click="$refs.calendar.open()"
:class="['item flex']"
>
自定义
</view>
</template>
<uni-calendar
ref="calendar"
:insert="false"
range
:clearDate="false"
startDate="2020-10-01"
:endDate="endDate"
@confirm="confirmCalendar"
:rangeValue="rangeValue"
hideMask
showBottomBtn
/>
</view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
export default {
name: 'TimeList',
inject: ['userInfo'],
data () {
return {
list: Object.freeze([
{
name: '今日',
startDate: dayjs().format('YYYY-MM-DD'),
endDate: dayjs().format('YYYY-MM-DD'),
id: 1
}, {
name: '本月',
startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
endDate: dayjs().format('YYYY-MM-DD'),
id: 2
}
]),
currentId: '',
endDate: dayjs().format('YYYY-MM-DD'),
customDate: {
startDate: '',
endDate: ''
},
rangeValue: {}
}
},
props: {
params: Object,
data: [Array, Object],
},
watch: {
currentId: {
handler (val) {
let { params: { idKey, currentIdKey } } = this
let { list } = this,
value = {}
if (val) {
let [startDateName, endDateName] = idKey
if (val == 3) {
value = {
[startDateName]: this.customDate.startDate,
[endDateName]: this.customDate.endDate
}
} else {
let item = list.find(e => e.id == val)
value = {
[startDateName]: item.startDate,
[endDateName]: item.endDate
}
}
}
this.$emit('choose', {
currentIdKey,
currentId: val,
keys: idKey,
value
})
},
deep: true
}
},
mounted () {
this.initList()
},
methods: {
async initList () {
let { data, params: { idKey, currentIdKey } } = this
if (data[currentIdKey] == 3) {
this.customDate = {
startDate: data[idKey[0]],
endDate: data[idKey[1]]
}
this.rangeValue = {
before: data[idKey[0]],
after: data[idKey[1]]
}
}
this.currentId = data[currentIdKey]
this.$emit('onComplete')
},
choose (i) {
this.currentId = i
},
confirmCalendar ({range}) {
let { data } = range
this.customDate = {
startDate: data[0] || dayjs().format('YYYY-MM-DD'),
endDate: data[data.length - 1] || dayjs().format('YYYY-MM-DD')
}
this.rangeValue = range
if (this.currentId == 3) {
let { params: { idKey } } = this,
[startDateName, endDateName] = idKey
this.$emit('choose', {
currentId: 3,
keys: idKey,
value: {
[startDateName]: this.customDate.startDate,
[endDateName]: this.customDate.endDate
}
})
} else this.currentId = 3
}
}
}
</script>
<style scoped lang='scss'>
.list {
display: flex;
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
width: toRpx(348);
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
const screenList = [
{
title: '转化人员',
suffix: 'merchantName',
componentName: 'EmployeeList',
params: {
cacheData: [],
idKey: 'sellerUserIdList'
},
hasToggle: true,
toggle: false
},
{
title: '销售顾问',
suffix: 'shopMerchantName',
componentName: 'EmployeeList',
params: {
cacheData: [],
idKey: 'userIdList'
},
hasToggle: true,
toggle: false
},
{
title: '订单时间',
componentName: 'TimeList',
params: {
idKey: ['placeOrderStartDateStr', 'placeOrderEndDateStr'],
currentIdKey: 'orderTimeId'
}
},
{
title: '支付时间',
componentName: 'TimeList',
params: {
idKey: ['installUpgradeBeginTimeStr', 'installUpgradeEndTimeStr'],
currentIdKey: 'payTimeId'
}
},
{
title: '订单状态',
componentName: 'OrderStatusList',
params: {
idKey: 'statusList'
}
},
{
title: '支付方式',
componentName: 'PayList',
params: {
idKey: 'payType'
}
},
{
title: '合同协议',
componentName: 'ContractList',
params: {
idKey: 'zyPayStatus'
}
}
]
export default { screenList }
const screenList = [
{
title: '选必修',
componentName: 'CourseOptionList',
params: {
idKey: 'required',
options: [
{ label: '必修', value: 'required' },
{ label: '选修', value: 'optional' }
]
}
},
{
title: '课程类型',
componentName: 'CourseOptionList',
params: {
idKey: 'courseType',
options: [
{ label: '视频', value: 'video' },
{ label: '文档', value: 'document' }
]
}
},
{
title: '评分',
componentName: 'CourseOptionList',
params: {
idKey: 'rating',
options: [
{ label: '4星以上', value: '4' },
{ label: '3星以上', value: '3' }
]
}
}
]
export default { screenList }
<template>
<popup ref="popup" @onConfirm="confirm" @onCancel="clear" cancelText="清除">
<view class="popup-title flex">
{{ popupTitle }}
<view class="popup-close flex" @click="close">
<uni-icons type="closeempty" size="16"></uni-icons>
</view>
</view>
<view class="popup-body" :key="viewKey">
<scroll-view scroll-y :class="['popup-scroll-view', { 'popup-show': loadComplete }]">
<template v-for="(i, index) in screenList">
<view class="item-box" :key="index">
<view class="title flex">
{{ i.title }}
<template v-if="i.suffix">({{ userInfo[i.suffix] }})</template>
<template v-if="i.hasToggle">
<view class="toggle-btn" @click="i.toggle = !i.toggle">{{ i.toggle ? '收起' : '展开' }}</view>
</template>
</view>
<view :class="['box', { fold: i.hasToggle }, { show: i.toggle }]">
<component :ref="`${i.componentName}_${index}`" :is="i.componentName" :params.sync="i.params" @choose="choose" :data="chooseContent" @onComplete="onComplete" :key="componentKey" />
</view>
</view>
</template>
</scroll-view>
<image v-if="!loadComplete" class="loading" src="../../assets/images/common/loadding.gif" />
</view>
</popup>
</template>
<script type="text/ecmascript-6">
import Popup from '@/components/Popup.vue'
import config from './config'
import EmployeeList from './components/EmployeeList.vue'
import TimeList from './components/TimeList.vue'
import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue'
import CourseOptionList from './components/CourseOptionList.vue'
import ContractList from './components/ContractList.vue'
export default {
components: {
Popup,
EmployeeList,
TimeList,
OrderStatusList,
PayList,
CourseOptionList,
ContractList
},
name: 'OrderScreen',
props: {
configData: {
type: Object,
default: null
},
title: {
type: String,
default: '工单筛选'
}
},
data() {
return {
screenList: this.configData ? this.configData.screenList : config.screenList,
chooseContent: {},
viewKey: Date.now(),
componentKey: Date.now(),
onCompleteNum: 0
}
},
provide() {
return {
userInfo: this.userInfo,
}
},
computed: {
popupTitle() {
return this.title
},
userInfo() {
return uni.$storage.get("userInfo")
},
loadComplete() {
return this.onCompleteNum == this.screenList.length
}
},
mounted() {
},
methods: {
open(data) {
this.$refs.popup.open()
},
clear() {
this.chooseContent = {}
this.viewKey = Date.now()
},
close() {
this.$refs.popup.close()
},
choose(i) {
let { key, value, keys, currentIdKey, currentId } = i;
let updatedChooseContent = { ...this.chooseContent };
let needRefresh = false;
// 有订单状态,将合同协议状态置为全部
if (key == 'statusList' && value) {
if (updatedChooseContent.zyPayStatus !== undefined) {
this.$delete(updatedChooseContent, 'zyPayStatus')
needRefresh = true
}
}
// 有合同协议状态时,将订单状态置为全部
if (key == 'zyPayStatus' && value) {
if (updatedChooseContent.statusList !== undefined) {
this.$delete(updatedChooseContent, 'statusList')
needRefresh = true
}
}
if (keys) {
if (currentIdKey) this.$set(updatedChooseContent, currentIdKey, currentId || '')
keys.map(e => {
if (value[e]) this.$set(updatedChooseContent, e, value[e])
else this.$delete(updatedChooseContent, e)
})
} else {
if (value) this.$set(updatedChooseContent, key, value)
else this.$delete(updatedChooseContent, key)
}
this.chooseContent = updatedChooseContent;
if (needRefresh) {
this.componentKey = Date.now()
}
},
confirm() {
let chooseContent = JSON.parse(JSON.stringify(this.chooseContent))
delete chooseContent.payTimeId
delete chooseContent.orderTimeId
Object.keys(chooseContent).map(e => {
if (e == 'placeOrderStartDateStr' || e == 'installUpgradeBeginTimeStr') chooseContent[e] = `${chooseContent[e]} 00:00:00`
if (e == 'placeOrderEndDateStr' || e == 'installUpgradeEndTimeStr') chooseContent[e] = `${chooseContent[e]} 23:59:59`
})
this.$emit('onConfirm', chooseContent)
this.close()
},
onComplete() {
console.log('complete',this.chooseContent)
if (this.onCompleteNum == this.screenList.length) return
this.onCompleteNum += 1
}
}
}
</script>
<style scoped lang="scss">
.popup-box {
border-radius: toRpx(32) toRpx(32) 0 0;
background: #ffffff;
height: 70vh;
.popup-title {
height: toRpx(104);
justify-content: center;
position: relative;
color: #333333;
font-size: toRpx(36);
font-weight: 500;
.popup-close {
position: absolute;
height: 100%;
top: 0;
right: 0;
padding: 0 toRpx(48);
font-weight: 400;
color: #1a1a1a;
}
}
.popup-tips {
color: #999ea8;
font-size: toRpx(28);
padding-left: toRpx(48);
}
.popup-body {
height: calc(100% - #{toRpx(312)});
position: relative;
.popup-scroll-view {
opacity: 0;
height: 100%;
padding-top: toRpx(8);
.item-box {
margin-bottom: toRpx(32);
.title {
color: #888888;
font-size: toRpx(28);
height: toRpx(40);
background: #f5f7fa;
padding-left: toRpx(48);
margin-bottom: toRpx(16);
line-height: toRpx(40);
.toggle-btn {
margin-left: auto;
padding: 0 toRpx(48);
color: #4673ff;
font-size: toRpx(24);
}
}
.box {
overflow: hidden;
}
.fold {
height: toRpx(72);
}
.show {
height: auto !important;
}
}
}
.popup-show {
opacity: 1;
}
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(64);
height: toRpx(64);
}
.show {
opacity: 1;
}
}
}
</style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</view> </view>
</view> </view>
<view class="tab-container flex justify-between"> <view class="tab-container flex">
<view class="flex"> <view class="flex">
<view class="tab-item" :class="{ active: tabIndex === index }" v-for="(item, index) in tabList" :key="index" @click="switchTab(index)"> <view class="tab-item" :class="{ active: tabIndex === index }" v-for="(item, index) in tabList" :key="index" @click="switchTab(index)">
<text>{{ item.tabName }}</text> <text>{{ item.tabName }}</text>
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</scroll-view> </scroll-view>
</template> </template>
</PublishPopup> </PublishPopup>
<order-screen ref="openFilter" @onConfirm="openFilterConfirm" /> <OrderScreenContract ref="openFilter" @onConfirm="openFilterConfirm" />
</view> </view>
</template> </template>
...@@ -149,14 +149,14 @@ import OrderCard from './OrderCard' ...@@ -149,14 +149,14 @@ import OrderCard from './OrderCard'
import PublishPopup from '@/components/PublishPopup.vue' import PublishPopup from '@/components/PublishPopup.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import utils from '@/utils/utils' import utils from '@/utils/utils'
import OrderScreen from '@/components/OrderScreen/index.vue' import OrderScreenContract from '@/components/OrderScreenContract/index.vue'
export default { export default {
name: 'OrderManagement', name: 'OrderManagement',
mixins: [ZPMixin, interceptionMixin], mixins: [ZPMixin, interceptionMixin],
components: { components: {
OrderCard, OrderCard,
PublishPopup, PublishPopup,
OrderScreen OrderScreenContract
}, },
computed: { computed: {
orderObj() { orderObj() {
...@@ -194,9 +194,12 @@ export default { ...@@ -194,9 +194,12 @@ export default {
], ],
tabList: [ tabList: [
{ tabName: '全部', num: 0 }, { tabName: '全部', num: 0 },
{ tabName: '待跟进', num: 0 }, { tabName: '待报价', num: 0 },
{ tabName: '已升级', num: 0 }, { tabName: '待支付', num: 0 },
{ tabName: '战败', num: 0 } { tabName: '已支付', num: 0 },
{ tabName: '已完成', num: 0 },
{ tabName: '战败', num: 0 },
{ tabName: '待上传协议', num: 0 }
], ],
tabIndex: 0, tabIndex: 0,
waitinputorderTabList: [ waitinputorderTabList: [
...@@ -362,99 +365,93 @@ export default { ...@@ -362,99 +365,93 @@ export default {
}) })
}, },
queryList(pageNo, pageSize) { queryList(pageNo, pageSize) {
console.log(this.searchObj) // let { pageSize, currentPage, orderStatus, customerName, userInfo, storeInfo, nothing, staffUuid, zyPayStatus } = this.data,
let obj = { // { screenForm } = this,
keyword: this.keyword, // merchantId = ''
pageSize, // if (!screenForm) screenForm = {}
pageNum: pageNo, // if (nothing) {
sceneType: 1, // return
...this.searchObj // }
} // let params = {
// 待跟进状态需要特殊处理避免带出已关闭 // pageSize,
if ([2, 3].includes(this.tabIndex)) { // currentPage,
let target = { // customerName,
1: 'R', // orderStatus,
2: 'Y', // merchantId,
3: 'N' // zyPayStatus
} // }
obj.upgradeFinishFlag = target[this.tabIndex] // if (!userInfo.isSuper && userInfo.loginRole != 3 && userInfo?.loginRole != 6) {
} else if (this.tabIndex == 1) { // // debugger
obj.statusList = [1] // params.transferIds = [userInfo.uuid]
} // }
console.log(this.searchObj.statusList) // if (staffUuid) {
console.log(this.searchObj.statusList && this.searchObj.statusList[0]) // params.transferIds = [staffUuid]
if ((this.searchObj.statusList && this.searchObj.statusList[0] == 'Y') || (this.searchObj.statusList && this.searchObj.statusList[0] == 'N')) { // } else {
this.searchObj.constructionFlag = this.searchObj.statusList[0] // params.merchantId = storeInfo?.merchantId
delete obj.statusList // }
} // uni.$api.equitApi
// .quotationPage(obj)
uni.$api.boutiqueApi // .then(result => {
.getWorkPackageGoodsList(obj) // const { list, total } = result
.then(result => { // // 这个是用来判断哪些用户可以撤销的
const { list, total } = result // let userType = (!this.localUserInfo.isSuper && this.localUserInfo.merchantType) || (this.localUserInfo.loginRole !== 3 && this.localUserInfo?.loginRole !== 6)
// 这个是用来判断哪些用户可以撤销的 // // let userType = true
let userType = (!this.localUserInfo.isSuper && this.localUserInfo.merchantType) || (this.localUserInfo.loginRole !== 3 && this.localUserInfo?.loginRole !== 6) // list.map(e => {
// let userType = true // if (e.orderTime) e.orderTime = dayjs(new Date(e.orderTime)).format('YYYY-MM-DD HH:mm:ss')
// e.subOrderList.map(i => {
list.map(e => { // i.totalPrice = Number(utils.decimal(i.totalPrice, 2)).toFixed(2)
if (e.orderTime) e.orderTime = dayjs(new Date(e.orderTime)).format('YYYY-MM-DD HH:mm:ss') // })
e.subOrderList.map(i => { // e.total_price = e.totalPrice
i.totalPrice = Number(utils.decimal(i.totalPrice, 2)).toFixed(2) // e.totalPrice = Number(utils.decimal(e.totalPrice, 2)).toFixed(2)
}) // // 开票按钮
e.total_price = e.totalPrice // e.invoiceName = e.invoiceStatus == 2 ? '查看发票' : '申请开票'
e.totalPrice = Number(utils.decimal(e.totalPrice, 2)).toFixed(2) // // && e.status != 1 待跟进现在也能撤销
// 开票按钮 // let orderType = (this.localUserInfo.userType == 1 || this.localUserInfo.userType == 2) && e.status != 9 && ![1, 3, 4].includes(e.selectPayType)
e.invoiceName = e.invoiceStatus == 2 ? '查看发票' : '申请开票' // // let orderType = this.localUserInfo.userType !== 1 && e.status != 9 && e.status != 1 && e.selectPayType != 3 && e.selectPayType != 1
// && e.status != 1 待跟进现在也能撤销 // // console.log(userType);
let orderType = (this.localUserInfo.userType == 1 || this.localUserInfo.userType == 2) && e.status != 9 && ![1, 3, 4].includes(e.selectPayType) // // console.log(orderType);
// let orderType = this.localUserInfo.userType !== 1 && e.status != 9 && e.status != 1 && e.selectPayType != 3 && e.selectPayType != 1 // e.repeal = userType && orderType
// console.log(userType); // // 处理subOrderList 商品为空的情况
// console.log(orderType); // e.subOrderList = e.subOrderList.filter(item => item.merchantGoodsId)
e.repeal = userType && orderType // e.packageGoodsList?.forEach(item => {
// 处理subOrderList 商品为空的情况 // item.packageGoodsOrderList.forEach(g => {
e.subOrderList = e.subOrderList.filter(item => item.merchantGoodsId) // g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice
// })
e.packageGoodsList?.forEach(item => { // item.goodsList = item.packageGoodsOrderList
item.packageGoodsOrderList.forEach(g => { // item.price = item.goodsList.reduce((prev, cur) => {
g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice // return prev + Number(cur.totalPrice) / Number(cur.number)
}) // }, 0)
item.goodsList = item.packageGoodsOrderList // item.count = item.goodsList.length ? item.goodsList[0].number : 1
item.price = item.goodsList.reduce((prev, cur) => { // let total = item.price * item.count
return prev + Number(cur.totalPrice) / Number(cur.number) // item.totalPrice = utils.decimal(total, 2)
}, 0) // })
item.count = item.goodsList.length ? item.goodsList[0].number : 1 // if (e.packageGoodsList && e.packageGoodsList.length) {
let total = item.price * item.count // e.subOrderList = e.subOrderList.concat(e.packageGoodsList)
item.totalPrice = utils.decimal(total, 2) // }
}) // // e.subOrderList = e.subOrderList.filter(item => item.id)
if (e.packageGoodsList && e.packageGoodsList.length) { // // 处理显示订单右上角文字
e.subOrderList = e.subOrderList.concat(e.packageGoodsList) // let text = this.status[e.status].text
} // let color = this.status[e.status].color
// let background = this.status[e.status].background
// e.subOrderList = e.subOrderList.filter(item => item.id) // // 不是订单失效状态优先显示已施工
// if (![9, 11, 12].includes(e.status) && e.constructionFlag == 'Y') {
// 处理显示订单右上角文字 // text = '已施工'
let text = this.status[e.status].text // color = '#347BFF'
let color = this.status[e.status].color // background = '#F3F7FC'
let background = this.status[e.status].background // }
// 不是订单失效状态优先显示已施工 // e.statusText = text
if (![9, 11, 12].includes(e.status) && e.constructionFlag == 'Y') { // e.statuscolor = color
text = '已施工' // e.statusbackground = background
color = '#347BFF' // // 商品是否包含太阳膜
background = '#F3F7FC' // e.isFilmOrder = e.subOrderList?.findIndex(subE => subE?.upgradeGoodsType == 1) > -1
} // })
e.statusText = text // console.log(list)
e.statuscolor = color this.$refs.paging.complete([])
e.statusbackground = background // })
// 商品是否包含太阳膜 // .catch(err => {
e.isFilmOrder = e.subOrderList?.findIndex(subE => subE?.upgradeGoodsType == 1) > -1 // this.$refs.paging.complete(false)
}) // console.log(err)
console.log(list) // })
this.$refs.paging.complete(list)
})
.catch(err => {
this.$refs.paging.complete(false)
console.log(err)
})
}, },
// 10s轮询一次待补录 // 10s轮询一次待补录
getWaitOrder() { getWaitOrder() {
...@@ -623,6 +620,20 @@ export default { ...@@ -623,6 +620,20 @@ export default {
// justify-content: start; // justify-content: start;
padding: toRpx(0) toRpx(48); padding: toRpx(0) toRpx(48);
margin-bottom: toRpx(24); margin-bottom: toRpx(24);
position: relative;
.flex:first-child {
display: flex;
flex: 1;
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
margin-right: toRpx(20);
&::-webkit-scrollbar {
display: none;
}
}
.filter-item { .filter-item {
// width: toRpx(164); // width: toRpx(164);
height: toRpx(72); height: toRpx(72);
...@@ -633,6 +644,8 @@ export default { ...@@ -633,6 +644,8 @@ export default {
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
padding: toRpx(0) toRpx(40); padding: toRpx(0) toRpx(40);
flex-shrink: 0;
white-space: nowrap;
} }
} }
...@@ -651,7 +664,7 @@ export default { ...@@ -651,7 +664,7 @@ export default {
font-weight: normal; font-weight: normal;
background: #fff; background: #fff;
border: toRpx(2) solid #ffffffcc; border: toRpx(2) solid #ffffffcc;
flex-shrink: 0;
&.active { &.active {
border: toRpx(2) solid #ffffff; border: toRpx(2) solid #ffffff;
background: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%); background: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!