Commit 823d50e0 by 张立顺

Merge branch 'dev_v4.32.0_1130' of http://192.168.3.233:8090/saas_plus/dj-car-bo…

…utique-work-wechat into dev_v4.32.0_1130
2 parents 6a3d8a28 9a8e4d64
Showing 60 changed files with 911 additions and 363 deletions
......@@ -185,5 +185,14 @@ module.exports = {
// 按客户查找门店工单/预约
searchOrderCustomer(data) {
return api.post('dj.api.smartcarlife.order.searchOrderCustomer', data)
}
},
// 获取服务商库存管理模式(是否使用膜卷号)
getServiceFilmRollSetting(data) {
return api.post('dj.api.smarcarlife.stock.management.mode', data)
},
/**退出*/
logout() {
return api.post('dj.api.smartcarlife.logout')
},
}
......@@ -27,7 +27,8 @@ Component({
type: Number
// value:0
},
isSolarFilm: Boolean
isSolarFilm: Boolean,
baseConfigData: Object
},
/**
......@@ -76,6 +77,18 @@ Component({
goodsList: data
})
},
// 删除数组重复项 都不保留
removeDuplicates(arr, property) {
var uniqueArray = []
for (var i = 0; i < arr.length; i++) {
var value = arr[i][property]
if (!uniqueArray.some(obj => obj[property] === value)) {
uniqueArray.push(arr[i])
}
}
return uniqueArray
},
// 去重保留第二项
arrayUnique(arr, name) {
var hash = {}
......@@ -94,24 +107,33 @@ Component({
let chooseList = []
// 太阳膜下单 需保留已选的商品
if (isSolarFilm) {
let upgradeGoodsList = []
goodsList.map(e => {
let arr = this.arrayUnique(e.upgradeGoodsList.concat(chooseGoodsList), 'id')
arr?.map(c => {
if (c.active) {
if (!c.count) c.count = 1
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.id == c.id) {
c.price = x.price || 0
}
})
} else {
c.price = c.upgradePrice || 0
}
if (!c.price) c.price = c.upgradePrice
chooseList.push(c)
upgradeGoodsList = upgradeGoodsList.concat(e.upgradeGoodsList)
})
let selectActiveArr = []
for (var i = 0; i < upgradeGoodsList?.length; i++) {
let val = upgradeGoodsList[i]
if (val.active) selectActiveArr.push(val)
}
if (!selectActiveArr?.length) return wx.$util.showToast('请勾选商品')
// 将已选商品与当前弹窗数据对比处理数据
let arr = this.removeDuplicates(upgradeGoodsList.concat(chooseGoodsList), 'id')
arr?.map(c => {
if (c.active) {
if (!c.count) c.count = 1
if (chooseGoodsList.length > 0) {
chooseGoodsList.map(x => {
if (x.id == c.id) {
c.price = x.price || 0
}
})
} else {
c.price = c.upgradePrice || 0
}
})
if (!c.price) c.price = c.upgradePrice
chooseList.push(c)
}
})
} else {
goodsList.map(e => {
......
......@@ -25,8 +25,8 @@
data-item="{{i}}">
<view class="name text-hide {{i.active?'textWidth':''}}">
<text>{{filter.replaceItemText(i.upgradeGoodsAlias) ||filter.replaceItemText(i.upgradeGoodsName) || filter.replaceItemText(i.goodsInfo.goodsName)}}</text>
<text wx:if="{{i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">{{'「' + i.positionStr+'」'}}</text>
<text class="warning_text" wx:if="{{!i.merchantGoodsPosition && i.goodsInfo.goodsType == 1}}">无部位</text>
<text wx:if="{{i.merchantGoodsPosition && (i.goodsInfo.goodsType == 1 || i.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)}}">{{'「' + i.positionStr+'」'}}</text>
<text class="warning_text" wx:if="{{!i.merchantGoodsPosition && (i.goodsInfo.goodsType == 1 || i.goodsInfo.goodsType == baseConfigData.selfBuildFilmType)}}">无部位</text>
</view>
<view class="last" wx:if="{{!i.active}}">
<!-- | -->
......
......@@ -31,10 +31,12 @@ Component({
copyStoreList: storeList,
searchValue: '',
edit: false,
customStoreList: [],
customSearchFlag: false,
searchSelectIndex: 0
showSelect: false,
nothing: false,
pageNum: 1
})
this.searchEvent(true)
}
}
},
......@@ -193,10 +195,6 @@ Component({
keyword: searchValue,
sellerMerchantId: userInfo?.isSuper ? '' : (userInfo?.merchantId || '')
}
if (!searchValue) {
this.setData({customStoreList: []})
return
}
if (nothing) return
api.searchOrderCustomer(params).then(res => {
let { code, data, message } = res
......@@ -254,6 +252,7 @@ Component({
} else { // 搜门店
thisPage.changePicker && thisPage.changePicker(storeList[item.index], item.index)
}
wx.$util.refreshPageData()
return
}
// 切换4s店
......@@ -366,6 +365,7 @@ Component({
userInfo: obj
})
}
wx.$util.refreshPageData()
// 除精品升级外 切换门店刷新数据
thisPage.initList && thisPage.initList()
// 精品升级首页数据刷新
......
......@@ -74,7 +74,7 @@
<view><image src="{{IMG_URL}}/user_avatar.png"></image></view>
<view class="text_box">
<view class="custom_text">
<view>
<view class="name_phone">
<text class="custom_name">{{item.customer.customerName}}</text>
<text class="custom_phone">{{item.customer.customerPhone}}</text>
</view>
......
......@@ -259,6 +259,13 @@
margin-bottom: 16rpx;
}
.wrapper .custom_element .text_box .custom_text .name_phone{
max-width: 260rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wrapper .custom_element .text_box .custom_text .custom_name{
font-size: 28rpx;
}
......
......@@ -64,12 +64,12 @@ Component({
let readyLeft = oldLeft > left ? left : oldLeft
let readyWidth = oldLeft > left ? oldLeft - left : left - oldLeft
this.setData({
activeStyle: `width:${readyWidth - oldWidth / 2 + width / 2}px;background-color:#347BFF;border-radius:3rpx;left:${readyLeft + oldWidth / 2}px;transition: all .1s;`
activeStyle: `width: 64rpx;background-color:#347BFF;border-radius:3rpx;left:${readyLeft + readyWidth / 2}px;transition: all .1s;`
})
}
setTimeout(() => {
this.setData({
activeStyle: `width:${width}px;left:${left}px;background-color:#347BFF;`,
activeStyle: `width: 64rpx;left:${left + (width - 32) / 2}px;background-color:#347BFF;`,
tabIndex: index,
width
})
......
......@@ -2,7 +2,7 @@
<block wx:for="{{tabList}}" wx:key="index">
<!-- style="color:{{tabIndex==index?'#347BFF':''}};" -->
<view class="tab-item {{tabIndex==index?'active':''}}" bindtap="change" data-index="{{index}}">
<text id="tab-{{index}}"><text class="tab-item-text">{{item.text || item }}</text><text wx:if="{{item.count}}" style="font-size: 24rpx;">({{item.count}})</text></text>
<text id="tab-{{index}}"><text class="tab-item-text">{{item.text || item }}</text><text wx:if="{{item.count >= 0}}" style="font-size: 20rpx;">({{item.count}})</text></text>
</view>
</block>
<view class="active-doc" style="{{activeStyle}}" />
......
/* components/TabBar/TabBar.wxss */
.tab {
background-color: #fff;
height: 104rpx;
height: 88rpx;
box-sizing: border-box;
display: grid;
align-items: center;
......@@ -19,7 +19,8 @@
.active-doc {
position: absolute;
bottom: 1rpx;
height: 6rpx;
height: 4rpx;
border-radius: 2rpx 2rpx 0 0;
transition: all .25s;
}
......
......@@ -3,10 +3,9 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
padding: 16rpx;
font-weight: 500;
background: #EFF5FE;
height: 72rpx;
width: 100%;
color: #347BFF;
font-size: 24rpx;
......@@ -15,10 +14,12 @@
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
flex-shrink: 0;
}
.closeIcon {
width: 26rpx;
height: 26rpx;
flex-shrink: 0;
}
.tips .contentText {
margin-right: auto;
......
......@@ -138,10 +138,10 @@ Component({
statisticsObj: data || {}
})
this.setData({
['tabList[0]']: TABLIST[0] + '(' + (data.totalOder || 0) + ')',
['tabList[1]']: TABLIST[1] + '(' + (data.ladingOder || 0) + ')',
['tabList[2]']: TABLIST[2] + '(' + (data.failed || 0) + ')',
['tabList[3]']: TABLIST[3] + '(' + (data.success || 0) + ')'
['tabList[0]']: {text: TABLIST[0], count: data.totalOder || 0},
['tabList[1]']: {text: TABLIST[1], count: data.ladingOder || 0},
['tabList[2]']: {text: TABLIST[2], count: data.failed || 0},
['tabList[3]']: {text: TABLIST[3], count: data.success || 0}
})
} else {
wx.$util.showToast(res.message || '接口异常')
......@@ -165,7 +165,7 @@ Component({
pageNum,
customerName,
// item.confName ==
orderStatus: constantData.equityStatusList.find(item => tabList[tabIndex].includes(item.confName))?.confId || '',
orderStatus: constantData.equityStatusList.find(item => tabList[tabIndex].text == item.confName)?.confId || '',
merchantId: storeInfo?.merchantId
}
carLifeApi.equityPage(params).then(res => {
......
......@@ -58,7 +58,8 @@ page{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
font-size: 32rpx;
font-weight: 500;
z-index: 99;
flex-direction: column;
}
......
// pages/accountItems/accountItems.js
import api from '~/api/api'
const app = getApp()
import { getYQorderInfo, get4SStoreList } from '~/store/index'
import { getYQorderInfo, get4SStoreList, getServiceFilmRollSetting } from '~/store/index'
import { getShopSceneConfig } from '~/store/index'
Page({
/**
......@@ -339,12 +339,14 @@ Page({
// app.globalData.YQorderSetting = null
app.globalData.yqdInfo.merchantRange = null
app.globalData.YQorderSetting = null
app.globalData.serviceFilmRollSetting = null
wx.$util.hideLoading()
wx.$util.setUserInfo(data.loginUserInfoList[0])
app.gobalCheckYqdSuper(data.loginUserInfoList[0])
// 获取园区店下单字段配置信息
getYQorderInfo()
// 获取服务商是否使用膜卷号配置
getServiceFilmRollSetting()
// 超管跳过选择4s店
if (data.loginUserInfoList[0] && data.loginUserInfoList[0].isSuper) {
this.get4SStoreList(data.loginUserInfoList[0])
......
......@@ -385,7 +385,7 @@ Page({
})
},
search() {
wx.$refresh = true
wx.$dateListRefresh = false
let {
searchObj,
userInfo
......@@ -532,8 +532,14 @@ Page({
},
searchObj
})
if (wx.$refresh) {
this.search()
if (wx.$dateListRefresh) {
// 清空筛选条件 搜索条件
this.setData({
searchObj: {},
keyword: ''
}, () => {
this.search()
})
}
console.log(options, 'options');
},
......
......@@ -64,7 +64,7 @@ page {
}
.search-box .search .text-center {
font-size: 24rpx;
font-size: 28rpx;
/* background-color: #f7f7f7; */
border-radius: 12rpx;
width: 100%;
......@@ -141,13 +141,17 @@ page {
.list .item .status {
position: absolute;
font-size: 28rpx;
font-size: 24rpx;
top: 32rpx;
font-weight: 500;
right: 32rpx;
height: 44rpx;
background: #F0F0F0;
border-radius: 4rpx;
padding: 4rpx 8rpx;
padding: 0rpx 8rpx;
display: flex;
justify-content: center;
align-items: center;
}
.list .item .status .arc {
......
......@@ -47,7 +47,6 @@
<view class="change_btn" bindtap="changeScene">切换场景</view>
</view>
</view> -->
<scroll-view scroll-y>
<view class="set_box">
<view class="set_item item_1" bindtap="showWork">
<view class="title">工位设置<image class="arrow_icon" src="../../images/arrow_icon.png" mode=""/></view>
......@@ -86,7 +85,6 @@
<image class="icon_image" src="{{IMG_URL}}mine_icon_7.png" mode=""/>
</view>
</view>
</scroll-view>
<!-- <view class="version_box" bindtap="goVersionPage">
<view class="item">
......
/* tabComponents/pages/index/index.wxss */
.main {
padding-bottom: 80rpx;
background: #FFFFFF;
}
.bg {
......
......@@ -56,9 +56,7 @@ Page({
// return animation;
// },
onPageScroll: function (e) {
console.log(e);
const {scrollTop} = e.detail
console.log(scrollTop,'scrollTop');
// const animation = this.createAnimation(); // 创建动画实例
// 滚动时隐藏第一个图标,显示第二个图标
this.setData({
......@@ -154,7 +152,6 @@ this.setData({
} else if (item.constructionFlag == 'Y' && item.status != 10) {
wx.$router.go('tabWorkOrder.constructionOrderDetail', item)
} else {
// console.log(item)
wx.$router.go('tabWorkOrder.' + name, item)
}
},
......@@ -357,7 +354,7 @@ this.setData({
init(userInfo) {},
search() {
wx.$refresh = true
wx.$orderListRefresh = false
let { searchObj, userInfo } = this.data
let merchantId
// 判断是不是超管,不是只能筛选当前4s店的
......@@ -550,7 +547,15 @@ this.setData({
},
searchObj
})
if (wx.$refresh) this.search()
if (wx.$orderListRefresh) {
// 清空筛选条件 搜索条件
this.setData({
searchObj: {},
keyword: ''
}, () => {
this.search()
})
}
// if (wx.$refresh ) {
// this.search()
// // this.getStatByPeriod()
......
......@@ -63,7 +63,7 @@ page {
}
.search-box .search .text-center {
font-size: 24rpx;
font-size: 28rpx;
/* background-color: #f7f7f7; */
border-radius: 12rpx;
width: 100%;
......@@ -148,12 +148,13 @@ page {
.list .item .status {
position: absolute;
font-size: 24rpx;
font-weight: 500;
top: 32rpx;
right: 32rpx;
height: 44rpx;
background: #F0F0F0;
border-radius: 4rpx;
padding: 4rpx 8rpx;
padding: 0rpx 8rpx;
}
.list .item .status .arc {
......
import api from '~/api/api.js'
import { envIndex } from '~/config'
// const app = getApp()
// console.log(app, 'app')
// console.log(wx)globalData
......@@ -134,25 +135,27 @@ export const getYQorderInfo = () => {
}
export const setConfigInfo = globalData => {
// const app = getApp()
const app = getApp()
return new Promise((resolve, reject) => {
// 如果有 直接返回
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting')
// console.log('app.globalData.YQorderSetting', app.globalData.YQorderSetting)
let { configInfo } = globalData
const target = ['develop', 'develop', 'test', 'production', 'beta']
if (configInfo) {
return resolve(configInfo)
} else {
wx.request({
// url: `${domain}${path}?method=${method}`,
url: `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config`,
url: `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-boutique-work-wechat-miniapp&env=${target[envIndex]}`,
// data,
method: 'GET',
// header,
dataType: 'json',
responseType: 'text',
success(response) {
console.log(response, 'response')
app.globalData.configInfo = response.data
resolve(response.data)
},
fail(error) {
console.log(error, 'error')
......@@ -344,4 +347,34 @@ export const getYQList = () => {
})
}
})
}
\ No newline at end of file
}
/** 获取服务商是否使用膜卷号 */
export const getServiceFilmRollSetting = () => {
const app = getApp()
return new Promise((resolve, reject) => {
// 如果有 直接返回
if (app.globalData.serviceFilmRollSetting) {
return resolve(app.globalData.serviceFilmRollSetting)
} else {
let userInfo = wx.$util.getUserInfo()
let { merchantId } = userInfo
wx.$util.showLoading()
api
.getServiceFilmRollSetting({
merchantId
})
.then(res => {
wx.$util.hideLoading()
let { code, data } = res
if (code == 0) {
app.globalData.serviceFilmRollSetting = data
resolve(app.globalData.serviceFilmRollSetting)
}
})
.catch(error => {
console.log(error)
})
}
})
}
......@@ -9,8 +9,8 @@
<view class='select_text'>{{selectData[selectIndex]}}</view>
<image class='select_img {{showSelect&&"select_img_rotate"}}' src='/images/arrow-right.png'></image>
</view>
<view class='option_box' wx:if="{{showSelect}}" style="padding: {{ showSelect ? '20rpx 34rpx' : ''}}">
<view class='option' wx:for='{{selectData}}' wx:key='this' data-index='{{index}}' catchtap='optionTap'>{{item}}</view>
<view class='option_box' wx:if="{{showSelect}}">
<view class='option {{selectIndex == index ? "active" : ""}}' wx:for='{{selectData}}' wx:key='this' data-index='{{index}}' catchtap='optionTap'>{{item}}</view>
</view>
<view class="mask_class" wx:if="{{showSelect}}" bindtap="closeSelect"></view>
</view>
......@@ -76,7 +76,7 @@
</block>
</block>
<view class="order" wx:if="{{item.tailPayedDateStr}}">
<view class="order-label">尾款支付时间 </view>
<view class="order-label">尾款支付</view>
<view class="order-value">
<block>{{item['tailPayedDateStr']}}</block>
</view>
......
......@@ -65,20 +65,59 @@ transform: rotate(-90deg);
.search-box .select_box .option_box{
position: absolute;
z-index: 200;
top: 80rpx;
width: 180rpx;
top: 100rpx;
left: 32rpx;
width: 194rpx;
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 6rpx 12rpx 0 #0000000d;
border-radius: 20rpx;
height: 190rpx;
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);
}
.search-box .select_box .option_box::before{
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);
}
.search-box .select_box .option_box .option{
display: block;
height: 50rpx;
line-height: 50rpx;
text-align: center;
color: #333333;
display: block;
height: 88rpx;
line-height: 88rpx;
text-align: center;
color: #333333;
overflow: hidden;
}
.search-box .select_box .option_box .option:first-child{
border-radius: 16rpx 16rpx 0 0;
}
.search-box .select_box .option_box .option:last-child{
border-radius: 0 0 16rpx 16rpx;
}
.search-box .select_box .option_box .option.active{
background: #347bff1a;
color: #347BFF;
}
.search-box .search-input {
......@@ -177,7 +216,7 @@ background-color: transparent;
} */
.item .item-content {
padding: 20rpx 32rpx 0;
padding: 32rpx 32rpx 0;
}
.list .item-header {
......@@ -224,7 +263,7 @@ margin-left: 16rpx;
}
.list .header-status view{
padding: 4rpx 8rpx;
padding: 0rpx 8rpx;
}
.header-price {
......@@ -238,7 +277,7 @@ margin-left: 16rpx;
}
.red-txt {
color: #EB4E4E;
color: #F24724;
background: #FDECE9;
}
......
......@@ -83,7 +83,8 @@ Page({
if (code == '0') {
wx.$util.showToast("预约成功")
this.refresh()
wx.$refresh = true
// 仅刷新预约管理列表
wx.$util.refreshPageData(true)
} else {
wx.$util.showToast(message)
}
......
......@@ -260,7 +260,8 @@ Page({
inviteDateStr
})
.then(res => {
wx.$refresh = true
// 仅刷新预约管理列表
wx.$util.refreshPageData(true)
wx.hideLoading()
console.log(res)
let {
......@@ -306,7 +307,8 @@ Page({
wx.hideLoading()
_this.showToast('取消成功!')
_this.getInviteDetail(id)
wx.$refresh = true
// 状态更新 需刷新预约管理列表
wx.$util.refreshPageData(true)
} else {
_this.showToast(message)
}
......
......@@ -324,7 +324,8 @@ page {
height: 80rpx;
background: #347BFF;
border-radius: 12rpx;
font-size: 28rpx;
font-size: 32rpx;
font-weight: 500;
color: #FFFFFF;
margin: 10rpx 32rpx;
}
......
......@@ -122,7 +122,8 @@ if (code!= 0 ) return
wx.hideLoading()
if (code == '0') {
wx.$util.showToast('编辑成功')
wx.$refresh = true
// 仅刷新预约管理列表
wx.$util.refreshPageData(true)
wx.$router.back()
} else {
wx.$util.showToast(message)
......
......@@ -71,7 +71,8 @@
background: #ffffff;
display: flex;
text-align: center;
font-size: 28rpx;
font-size: 32rpx;
font-weight: 500;
}
.btn-default {
......
......@@ -198,7 +198,7 @@ Page({
let { item } = e.currentTarget.dataset
console.log(item)
if ('activeIndex' in item) {
wx.$refresh = true
wx.$util.refreshPageData()
item.url && wx.$router.go(item.url,{activeIndex:item.activeIndex})
} else {
item.url && wx.$router.go(item.url)
......
......@@ -147,5 +147,15 @@ module.exports = {
/** 根据订单更新技师信息 */
updateTechnicianInfo(data) {
return api.post('dj.api.smartcarlife.order.updateTechnicianInfo', data)
},
/** 根据订单商品获取膜卷号 */
getfilmRollNoByGoods(data) {
return api.post('dj.api.smarcarlife.stock.filmroll.list', data)
},
/** 子订单设置膜卷号 */
setfilmRollNo(data) {
return api.post('dj.api.smartcarlife.order.updateFilmRoll', data)
}
}
// tabWorkOrder/components/filmRollNoPopup/filmRollNoPopup.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
if (n) {
let { copyfilmRollNoList, filmSelectedItem } = this.data
this.setData({
filmRollNoList: wx.$util.deepClone(copyfilmRollNoList),
selectedNumber: filmSelectedItem,
searchValue: ''
})
}
}
},
title: String,
filmSelectedItem: String,
copyfilmRollNoList: Array
},
/**
* 组件的初始数据
*/
data: {
orderObj: {},
IMG_URL,
filmRollNoList: [],
searchValue: ''
},
/**
* 组件的方法列表
*/
methods: {
search(e) {
let { copyfilmRollNoList } = wx.$util.deepClone(this.data)
let { value } = e.detail
if (!value) {
this.setData({
filmRollNoList: copyfilmRollNoList
})
} else {
let arr = []
copyfilmRollNoList.map(i => {
if (i.indexOf(value) != -1) {
arr.push(i)
}
})
this.setData({
filmRollNoList: arr
})
}
},
changeItem(e) {
let { target } = e.currentTarget.dataset
let { filmRollNoList } = this.data
let { copyfilmRollNoList } = wx.$util.deepClone(this.data)
this.setData({
filmRollNoList,
copyfilmRollNoList,
selectedNumber: target
})
},
cancel() {
let thisPage = wx.$router.getPageInstance()
thisPage.setData({
filmRollNoPopup: false
})
},
// 打开生意助手小程序
goMiniprogram() {
wx.navigateToMiniProgram({
appId: 'wx2c28337db96364d2'
})
},
async confirm() {
let { selectedNumber } = this.data
if (!selectedNumber) {
wx.$util.showToast('请选择膜卷号')
}
this.triggerEvent('confirm', selectedNumber)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--tabWorkOrder/components/filmRollNoPopup/filmRollNoPopup.wxml-->
<popup show="{{show}}" bindconfirm="confirm" bindcancel="cancel" height="60%">
<view class="film-roll-number-select-popup-box" >
<view class="box">
<view class="sub-title text-center">{{title}}</view>
<view class="film-roll-number-box">
<search-input bindsearch="search" value="{{searchValue}}" />
<view class="box-title">
<view>膜卷号</view>
</view>
<scroll-view scroll-y style="height: calc(100% - 194rpx);" enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{filmRollNoList}}" wx:key="index">
<view class="film-roll-numberList {{item == selectedNumber?'active':''}}" bindtap="changeItem" data-target="{{item}}" data-index="{{index}}">
<view class="checked_img">
<image wx:if="{{item == selectedNumber}}" src="{{IMG_URL}}checked.png"></image>
</view>
<view class="text_box"><view class="text-hide">{{item}}</view></view>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</popup>
/* tabWorkOrder/components/filmRollNoPopup/filmRollNoPopup.wxss */
.film-roll-number-select-popup-box{
height: 100%;
width: calc(100% + 64rpx);
transform: translateX(-32rpx);
}
.sub-title {
height: 100rpx;
font-size: 32rpx;
color: #333333;
position: sticky;
left: 0;
top: 0;
background-color: #fff;
z-index: 2;
border-bottom: 2rpx solid #F9F9F9;
}
.text-hide {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
.text-center{
display: flex;
align-items: center;
justify-content: center;
}
.box{
height: 100%;
padding: 0 32rpx;
}
.artificer-box{
height: calc(100% - 102rpx);
overflow: hidden;
transition: all .25s;
}
.box-title{
color: #333333;
font-size: 32rpx;
height: 88rpx;
line-height: 88rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.box-title .tips{
color: #333333;
font-size: 24rpx;
}
.box-title .tips text{
color: #347BFF;
}
.film-roll-numberList {
width: calc(100% - 50rpx);
height: 98rpx;
display: flex;
align-items: center;
font-size: 28rpx;
color: #999999;
padding: 0 25rpx;
transition: all .5s;
}
.checked_img{
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 20rpx;
}
.film-roll-numberList .text_box{
flex: 1;
border-bottom: 2rpx solid #F9F9F9;
height: 100%;
line-height: 98rpx;
}
.film-roll-numberList.active {
color: #347BFF;
font-weight: 700;
position: relative;
}
// tabWorkOrder/pages/createOrder/createOrder.js
// import deepClone from '~/utils/deepClone'
import api from '../../api'
import { getYQorderInfo, getPositionList } from '~/store/index'
import { getYQorderInfo, getPositionList, setConfigInfo } from '~/store/index'
import NP from 'number-precision'
const app = getApp()
let toastList = {
......@@ -75,7 +75,8 @@ Page({
currentWordNumber: 0, // 备注字数
frontGearArr: [],
sideRearGearArr: [],
skylightArr: []
skylightArr: [],
baseConfigData: {}
},
showCustomPop() {
this.setData({
......@@ -121,7 +122,8 @@ Page({
goodsData,
copyGoodsData,
filmOrder,
orderObj: { selectPayType }
orderObj: { selectPayType },
baseConfigData
} = this.data
let { showName, type } = e.currentTarget.dataset
let arr = []
......@@ -137,38 +139,40 @@ Page({
// type 产品类型 1前档 2侧后档 3天窗 4其它精品 根据类型过滤显示商品弹窗数据
copyGoodsData?.forEach((val, index) => {
if (type == 4) {
if (val.goodsType !== 1) {
if (val.goodsType !== 1 && val.goodsType != baseConfigData?.selfBuildFilmType) {
arr.push(val)
}
} else {
if (val.goodsType == 1 && type != 4) {
if ((val.goodsType == 1 || val.goodsType == baseConfigData?.selfBuildFilmType) && type != 4) { // 太阳膜 自建商品-太阳膜商品
arr.push({
goodsType: val.goodsType,
goodsTypeName: val.goodsTypeName,
upgradeGoodsList: []
})
let arr2 = []
val?.upgradeGoodsList?.forEach((subVal, subInd) => {
if (type == 1 && [1].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[0].upgradeGoodsList = arr2
}
if (type == 2 && [2, 3, 4].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[0].upgradeGoodsList = arr2
}
if (type == 3 && [5, 6, 7].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[0].upgradeGoodsList = arr2
}
})
for (var i = 0; i < arr?.length; i++) {
let arr2 = []
val?.upgradeGoodsList?.forEach((subVal, subInd) => {
if (type == 1 && [1].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[i].upgradeGoodsList = arr2
}
if (type == 2 && [2, 3, 4].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[i].upgradeGoodsList = arr2
}
if (type == 3 && [5, 6, 7].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[i].upgradeGoodsList = arr2
}
})
}
}
}
})
if (arr[0]?.upgradeGoodsList?.length < 1 || arr?.length < 1) {
let errorText = ['', '前档', '侧后档', '天窗', '其它精品']
return this.showToast(selectPayType == 0 ? '门店无战败商品': `门店无配置${errorText[type]}商品`)
}
// if (arr[0]?.upgradeGoodsList?.length < 1 || arr?.length < 1) {
// let errorText = ['', '前档', '侧后档', '天窗', '其它精品']
// return this.showToast(selectPayType == 0 ? '门店无战败商品': `门店无配置${errorText[type]}商品`)
// }
this.setData({
goodsData: arr
})
......@@ -500,7 +504,7 @@ Page({
}
})
} else {
wx.$refresh = true
wx.$util.refreshPageData()
// wx.$router.redirectTo('confirmOrder', data)
wx.$router.redirectTo('orderDetail', data)
wx.$storage.rm('outTradeNo') // 去除流水号
......@@ -888,8 +892,11 @@ Page({
})
})
},
onRoute(options) {
async onRoute(options) {
this.getGoodsPosition()
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData)
this.setData({baseConfigData})
let { outTradeNo, totalFee, accountDate, supplementId, filmOrder } = options
// filmOrder补录类型 0太阳膜 1精品升级
console.log(options)
......
......@@ -545,7 +545,8 @@
bindconfirm="chooseGoods"
goodsData="{{goodsData}}"
chooseGoodsList="{{goodsList}}"
isSolarFilm="{{filmOrder !== 1}}"/>
isSolarFilm="{{filmOrder !== 1}}"
baseConfigData="{{baseConfigData}}" />
<modal
id="modal"
class="modal"
......
......@@ -321,7 +321,8 @@ page {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
font-size: 32rpx;
font-weight: 500;
z-index: 99;
flex-direction: column;
}
......
......@@ -64,50 +64,9 @@ Page({
console.log(err)
})
},
updateCustomerInfo() {
let {
orderInfo
} = this.data
console.log(orderInfo)
if (!orderInfo?.customer?.orderCode) {
delete orderInfo?.customer?.orderCode
}
let paramsList = ['orderCode', 'customerId', 'customerName', 'customerPhone', 'customerSex', 'carBrandId', 'carBrand', 'carChildsBrandId', 'carChildsBrandName', 'carSeriesId', 'carSeriesName', 'standNo', 'plateNumber', 'experienceFlag', 'remark', 'technicianUuid', 'technicianId', 'technicianName']
let userInfo = {}
orderInfo = Object.assign(orderInfo, orderInfo.customer)
paramsList.map(item => {
userInfo[item] = orderInfo[item] || ''
})
api
.updateOrderInfo(userInfo)
.then(result => {
wx.$util.hideLoading()
if (result.code == 0 && result.data) {
this.checkPayType()
} else {
wx.showToast({
title: result.message,
icon: 'error'
})
}
})
.catch(err => {
// wx.$util.hideLoading()
console.log(err)
})
},
next() {
let {
orderInfo
} = this.data
let _this = this
// console.log(orderCode)
// 有技师选项 并选择了技师 更新客户信息
if (orderInfo.isOpenArtificer && orderInfo.technicianId) {
_this.updateCustomerInfo()
} else {
_this.checkPayType()
}
_this.checkPayType()
},
checkPayType() {
let {
......@@ -176,7 +135,8 @@ Page({
obj.outTradeNo = outTradeNo
}
wx.$util.showLoading()
wx.$refresh = true
// 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
api.createPayOrder(obj).then(res => {
console.log(res)
let {
......@@ -220,7 +180,8 @@ Page({
})
.then(res => {
console.log(res)
wx.$refresh = true
// 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
let {
code,
message
......@@ -266,7 +227,6 @@ Page({
}
},
onRoute(options) {
// options.orderCode = '231019160629638'
if (options.orderCode) {
wx.$util.showLoading('加载中...')
this.getDetail(options.orderCode)
......@@ -281,7 +241,6 @@ Page({
orderCode
})
.then(res => {
console.log(res)
let {
code,
message,
......@@ -299,7 +258,8 @@ Page({
let couponName = data.customerCoupon ? data.customerCoupon.couponName : ''
let total_price = 0
let warrantyCardList = []
data.subOrderList.map(e => {
for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i]
total_price += e.totalPrice
e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
......@@ -309,7 +269,7 @@ Page({
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName
})
}
})
}
data = {
...data.customer,
...data.payOrder,
......
......@@ -166,7 +166,6 @@ Page({
},
onRoute(options) {
console.log(options)
// options.orderCode = '231008175435623'
if (options.orderCode) {
this.setData({
orderCode: options.orderCode
......@@ -220,7 +219,8 @@ Page({
let total_price = 0
let warrantyCardList = []
data.subOrderList = data.subOrderList.filter(item => item.merchantGoodsId)
data.subOrderList.map(e => {
for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i]
total_price += e.totalPrice
e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
......@@ -231,7 +231,7 @@ Page({
cardCode: e.cardCode
})
}
})
}
data = {
...data.customer,
...data.payOrder,
......
{
"navigationBarTitleText": "完成施工",
"usingComponents": {
"orderRatingPopup": "../../components/orderRatingPopup/orderRatingPopup",
"artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup"
"orderRatingPopup": "/tabWorkOrder/components/orderRatingPopup/orderRatingPopup"
}
}
......@@ -49,11 +49,14 @@
</view>
<view class="subItem_box">
<view style="{{!orderInfo.isOpenArtificer || !item.upgradeGoodsPosition ? 'display: flex; justify-content: space-between; width: 100%;' : 'display: flex;'}}">
<view class="position">{{item.positionStr || item.upgradeGoodsTypeName}}</view>
<view class="type">x{{item.number}}</view>
<view class="position">{{item.positionStr || item.upgradeGoodsTypeName}}<text class="type">x{{item.number}}</text></view>
</view>
<!-- 太阳膜类且配置技师 -->
<view wx:if="{{orderInfo.isOpenArtificer && item.upgradeGoodsPosition}}" class="artificer" bindtap="selectArtificer" data-item="{{item}}">
<!-- 膜卷号 -->
<view wx:if="{{item.filmRollNo}}" class="film-roll disabled" data-item="{{item}}">
<text class="'text-hide'">{{item.filmRollNo}}</text><image src="/components/images/arrow-x.png" mode=""/>
</view>
<!-- 技师 -->
<view wx:if="{{orderInfo.isOpenArtificer && item.upgradeGoodsPosition}}" class="artificer disabled" data-item="{{item}}">
<text class="{{!item.technicianName ? 'grey_text' : ''}} 'text-hide'">{{item.technicianName || '选择技师'}}</text><image src="/components/images/arrow-x.png" mode=""/>
</view>
</view>
......@@ -111,7 +114,7 @@
</block>
<block wx:if="{{orderInfo.selectPayType == 2}}">
<view class="cell">
<view class="label">付款凭证:</view>
<view class="label">付款凭证</view>
<view class="image-box">
<view class="value" bindtap="previewImage" wx:for="{{orderInfo.payVoucherList}}" wx:key="index" data-index="{{index}}" data-url="{{orderInfo.payVoucherList}}">
<view class="image">
......@@ -273,14 +276,6 @@
</view>
</view>
</modal>
<artificer-select-popup
show="{{artificerSelectPopup}}"
title="选择技师"
copyArtificerList="{{artificerList}}"
orderInfo="{{orderInfo}}"
artificerSelectObj="{{artificerSelectObj}}"
bindconfirm="changeArtificer" />
<orderRatingPopup
bind:close="RatingPopupSetting"
title="客户签字"
......
......@@ -199,7 +199,7 @@ page {
width: 100%;
}
.box .goods .item .subItem_box .artificer{
.box .goods .item .subItem_box .artificer,.film-roll{
height: 48rpx;
background: #FFFFFF;
border: 1rpx solid #DEE0E3;
......@@ -212,15 +212,23 @@ page {
font-size: 24rpx;
}
.box .goods .item .subItem_box .artificer.disabled,.film-roll.disabled{
color: #BEC1C7;
}
.artificer text{
max-width: 170rpx;
max-width: 96rpx;
}
.artificer .grey_text{
.film-roll text{
max-width: 120rpx;
}
.artificer .grey_text,.film-roll .grey_text{
color: #BEC1C7;
}
.artificer image{
.artificer image,.film-roll image{
width: 28rpx;
height: 28rpx;
margin-left: 8rpx;
......@@ -605,6 +613,8 @@ margin-right: auto;
margin-left: 16rpx;
margin-top: 3rpx;
font-weight: normal;
display: flex;
align-items: center;
}
......
......@@ -343,7 +343,8 @@ Page({
// console.log(orderObj, res)
let { code, data, message } = res
if (code == 0) {
wx.$refresh = true
// 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
this.showToast({
icon: 'success',
title: '提交成功'
......
......@@ -3,7 +3,8 @@
import api from '../../api'
import {
getYQorderInfo,
getPositionList
getPositionList,
setConfigInfo
} from '~/store/index'
const app = getApp()
let toastList = {
......@@ -82,7 +83,8 @@ Page({
isShowSubShopMerchant: false,
frontGearArr: [], // 前档
sideRearGearArr: [], // 侧后档
skylightArr: [] // 天窗
skylightArr: [], // 天窗
baseConfigData: {}
},
remarkInput(e) {
......@@ -130,7 +132,8 @@ Page({
copyGoodsData,
orderObj: {
selectPayType
}
},
baseConfigData
} = this.data
let {
showName,
......@@ -141,37 +144,39 @@ Page({
// type 产品类型 1前档 2侧后档 3天窗 4其它精品 根据类型过滤显示商品弹窗数据
copyGoodsData?.forEach((val, index) => {
if (type == 4) {
if (val.goodsType !== 1) {
if (val.goodsType !== 1 && val.goodsType !== baseConfigData?.selfBuildFilmType) { // 非太阳膜 非自建商品-太阳膜
arr.push(val)
}
} else {
if (val.goodsType == 1 && type != 4) {
if ((val.goodsType == 1 || val.goodsType == baseConfigData?.selfBuildFilmType) && type != 4) {
arr.push({
goodsType: val.goodsType,
goodsTypeName: val.goodsTypeName,
upgradeGoodsList: []
})
let arr2 = []
val?.upgradeGoodsList?.forEach((subVal, subInd) => {
if (type == 1 && [1].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[0].upgradeGoodsList = arr2
}
if (type == 2 && [2, 3, 4].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[0].upgradeGoodsList = arr2
}
if (type == 3 && [5, 6, 7].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[0].upgradeGoodsList = arr2
}
})
for (var i = 0; i < arr?.length; i++) {
let arr2 = []
val?.upgradeGoodsList?.forEach((subVal, subInd) => {
if (type == 1 && [1].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
if (subVal?.goodsInfo?.goodsType == arr[i]?.goodsType || subVal?.upgradeGoodsType == arr[i]?.goodsType) arr[i].upgradeGoodsList = arr2
}
if (type == 2 && [2, 3, 4].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
if (subVal?.goodsInfo?.goodsType == arr[i]?.goodsType || subVal?.upgradeGoodsType == arr[i]?.goodsType) arr[i].upgradeGoodsList = arr2
}
if (type == 3 && [5, 6, 7].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
if (subVal?.goodsInfo?.goodsType == arr[i]?.goodsType || subVal?.upgradeGoodsType == arr[i]?.goodsType) arr[i].upgradeGoodsList = arr2
}
})
if (!arr[i]?.upgradeGoodsList?.length) arr.splice(i, 1)
}
}
}
})
if (arr[0]?.upgradeGoodsList?.length < 1 || arr?.length < 1) {
let errorText = ['', '前档', '侧后档', '天窗', '其它精品']
return this.showToast(selectPayType == 0 ? '门店无战败商品': `门店无配置${errorText[type]}商品`)
if (arr?.length < 1) {
return this.showToast(`门店无配置其它精品商品`)
}
}
this.setData({
......@@ -498,8 +503,8 @@ Page({
success(_res_) {
if (_res_.confirm) {
if (apiName == 'createPrerecordedOrder') {
// 预录建档跳转到预约列表
wx.$refresh = true
// 预录建档跳转到预约列表 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
wx.$router.go('pages.tabDateIndex')
wx.$util.pointRecord(30)
} else {
......@@ -511,7 +516,8 @@ Page({
}
})
} else {
wx.$refresh = true
// 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
wx.$router.redirectTo('confirmOrder', data)
}
} else {
......@@ -522,6 +528,7 @@ Page({
checkGoods(save, subOrderList, priceDisabled, goodsList, orderObj) {
if (save) return false
// if (orderObj.selectPayType != 0) {
let { baseConfigData } = this.data
let filmArr = []
if (goodsList) {
goodsList.map(e => {
......@@ -533,7 +540,8 @@ Page({
merchantGoodsId: e.id || e.merchantGoodsId
}
if (e.price < e.shopMinPrice && orderObj.selectPayType != 0) priceDisabled = false
if (e?.goodsInfo?.goodsType == 1 || e?.upgradeGoodsType == 1) filmArr.push(obj)
// 太阳膜 自建商品-太阳膜
if (e?.goodsInfo?.goodsType == 1 || e?.upgradeGoodsType == 1 || e?.goodsInfo?.goodsType == baseConfigData?.selfBuildFilmType || e?.upgradeGoodsType == baseConfigData?.selfBuildFilmType) filmArr.push(obj)
subOrderList.push(obj)
})
orderObj.subOrderList = subOrderList
......@@ -797,7 +805,7 @@ Page({
showCancel: false,
success(res) {
if (res.confirm) {
wx.$refresh = true
wx.$util.refreshPageData()
wx.$router.go('index')
}
}
......@@ -879,7 +887,6 @@ Page({
val.active = true
if (val.merchantGoodsId) val.id = val.merchantGoodsId // 改造商品数据 id为null
})
console.log(subOrderList, 'subOrderList')
if (selectPayType) {
//战败特殊处理
// console.log(data[0], 'upgradeGoodsList')
......@@ -1032,6 +1039,9 @@ Page({
// console.log(res, 'onroute')
// res.scene = 'scene=1384'
// console.log()
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData)
this.setData({baseConfigData})
if (res.orderCode && res.page) {
let result = await api.getOrderDetail({
orderCode: res.orderCode
......
......@@ -273,8 +273,8 @@
</view>
<view class="bottom_box">
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{(item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1)}}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{(item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition}}">无部位属性</view>
<view class="position" wx:if="{{(item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType)}}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{(item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition}}">无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
<view class="price">
......@@ -317,9 +317,9 @@
</view>
</view>
<view class="bottom_box">
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{(item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1)}}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{(item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition}}">无部位属性</view>
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{(item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType)}}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{(item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition}}">无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
<view class="price">
......@@ -363,8 +363,8 @@
</view>
<view class="bottom_box">
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view class="position" wx:if="{{(item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1)}}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{(item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition}}">无部位属性</view>
<view class="position" wx:if="{{(item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType)}}">{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view class="position red_text" wx:if="{{(item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition}}">无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
<view class="price">
......@@ -399,7 +399,7 @@
<view class="goods-box">
<block wx:for="{{ goodsList }}" wx:key="index">
<!-- 其它精品 -->
<view class="goods" wx:if="{{item.goodsInfo.goodsType !== 1 && item.upgradeGoodsType !== 1}}">
<view class="goods" wx:if="{{item.goodsInfo.goodsType !== 1 && item.upgradeGoodsType !== 1 && item.goodsInfo.goodsType !== baseConfigData.selfBuildFilmType && item.upgradeGoodsType !== baseConfigData.selfBuildFilmType}}">
<view class="name_box">
<view class="name text-hide">
{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || filter.replaceItemText(item.goodsInfo.goodsName)}}
......@@ -546,7 +546,7 @@
selectPayType="{{orderObj.selectPayType}}"
returnFun="{{ returnFun }}"
/>
<goods show="{{ goodsBox }}" bindconfirm="chooseGoods" goodsData="{{ goodsData }}" chooseGoodsList="{{ goodsList }}" isSolarFilm="{{true}}" />
<goods show="{{ goodsBox }}" bindconfirm="chooseGoods" goodsData="{{ goodsData }}" chooseGoodsList="{{ goodsList }}" isSolarFilm="{{true}}" baseConfigData="{{baseConfigData}}" />
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" />
<!-- <order-popup
orderType="{{remarkBox}}"
......
......@@ -336,7 +336,8 @@ page {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
font-size: 32rpx;
font-weight: 500;
z-index: 99;
flex-direction: column;
}
......
// tabWorkOrder/pages/defeatOrder/defeatOrder.js
import api from '../../api'
import api2 from '~/api/api.js'
import { getYQorderInfo, getPositionList } from '~/store/index'
import { getYQorderInfo, getPositionList, setConfigInfo } from '~/store/index'
const phoneRex = /^[1]([3-9])[0-9]{9}$/
const app = getApp()
let toastList = {
employeeName: '销售顾问不能为空',
subShopMerchantId: '二级流量方不能为空',
......@@ -60,7 +61,8 @@ Page({
frontGearArr: [],
sideRearGearArr: [],
skylightArr: [],
customerInfoBox: false
customerInfoBox: false,
baseConfigData: {}
},
routerBack() {
wx.$router.back()
......@@ -303,45 +305,38 @@ Page({
return (360 * Math.atan(_Y / _X)) / (2 * Math.PI)
},
showPopup(e) {
let { copyGoodsData } = this.data
let { copyGoodsData, baseConfigData } = this.data
let { showName, index, type } = e.currentTarget.dataset
let arr = []
if (showName == 'goodsBox') {
// type 产品类型 1前档 2侧后档 3天窗 4其它精品 根据类型过滤显示商品弹窗数据
// type 产品类型 1前档 2侧后档 3天窗 根据类型过滤显示商品弹窗数据
copyGoodsData?.forEach((val, index) => {
if (type == 4) {
if (val.goodsType == 19) {
arr.push(val)
}
} else {
if (val.goodsType == 1 && type != 4) {
arr.push({
goodsType: val.goodsType,
goodsTypeName: val.goodsTypeName,
upgradeGoodsList: []
})
if (val.goodsType == 1 || val.goodsType == baseConfigData?.selfBuildFilmType) {
arr.push({
goodsType: val.goodsType,
goodsTypeName: val.goodsTypeName,
upgradeGoodsList: []
})
for (var i = 0; i < arr?.length; i++) {
let arr2 = []
val?.upgradeGoodsList?.forEach((subVal, subInd) => {
if (type == 1 && [1].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[index].upgradeGoodsList = arr2
if (subVal?.goodsInfo?.goodsType == arr[i]?.goodsType || subVal?.upgradeGoodsType == arr[i]?.goodsType) arr[i].upgradeGoodsList = arr2
}
if (type == 2 && [2, 3, 4].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[index].upgradeGoodsList = arr2
if (subVal?.goodsInfo?.goodsType == arr[i]?.goodsType || subVal?.upgradeGoodsType == arr[i]?.goodsType) arr[i].upgradeGoodsList = arr2
}
if (type == 3 && [5, 6, 7].includes(subVal.merchantGoodsPosition)) {
arr2.push(subVal)
arr[index].upgradeGoodsList = arr2
if (subVal?.goodsInfo?.goodsType == arr[i]?.goodsType || subVal?.upgradeGoodsType == arr[i]?.goodsType) arr[i].upgradeGoodsList = arr2
}
})
if (!arr[i]?.upgradeGoodsList?.length) arr.splice(i, 1)
}
}
})
if (arr[0]?.upgradeGoodsList?.length < 1) {
let errorText = ['', '前档', '侧后档', '天窗', '其它精品']
return this.showToast(`门店无配置${errorText[type]}商品`)
}
}
this.setData({
[showName]: true,
......@@ -369,7 +364,7 @@ Page({
// 获取商品
async getOrderBaseGoodsList(merchantId) {
const positionTypeList = (await getPositionList()) || []
let { frontGearArr, sideRearGearArr, skylightArr } = this.data
let { frontGearArr, sideRearGearArr, skylightArr, baseConfigData } = this.data
this.setData({
positionTypeList
})
......@@ -382,10 +377,10 @@ Page({
let { code, data, message } = res
if (code == 0) {
wx.hideLoading()
// 筛选出太阳膜商品 goodsType 1太阳膜
// 筛选出太阳膜商品 goodsType 1太阳膜 自建商品-太阳膜
let arrData = []
data?.forEach(val => {
if ([1].includes(val.goodsType)) arrData.push(val)
if ([1, baseConfigData?.selfBuildFilmType].includes(val.goodsType)) arrData.push(val)
val?.upgradeGoodsList?.forEach(subVal => {
subVal.merchantGoodsId = subVal.id
if ([1].includes(subVal.merchantGoodsPosition)) {
......@@ -510,7 +505,8 @@ Page({
wx.hideLoading()
let { code, data, message } = res
if (code == 0) {
wx.$refresh = true
// 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
wx.$util.showToast({
icon: 'success',
title: '提交成功'
......@@ -545,7 +541,7 @@ Page({
item.shopMerchantId == orderObj.merchantId
}) || phoneShow.pop()
notUpgradeOrderList.forEach(item => {
item.customerPhone = item.customerPhone || phoneConfig?.phoneNumber
item.customer.customerPhone = item.customer.customerPhone || phoneConfig?.phoneNumber
})
this.setData({
notUpgradeOrderList
......@@ -686,7 +682,10 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function (res) {},
onRoute(res) {
async onRoute(res) {
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData)
this.setData({baseConfigData})
res && this.initOPtions(res)
this.getSetting()
},
......
......@@ -169,7 +169,7 @@
></input>
</gl-cell>
<gl-cell
required="{{ filter.isIncludesItem(requiredList ,'carBrand') }}"
required="{{ isCarBrand }}"
border
valueAlign="right"
label="选择车型"
......@@ -187,7 +187,7 @@
</gl-cell>
<gl-cell
wx:if="{{ orderObj.selectPayType !=0 }}"
required="{{ filter.isIncludesItem(requiredList ,'standNo') }}"
required="{{ isStandNo }}"
border
iconSrc="{{ scanIcon }}"
bindtitleClick="navOcr"
......@@ -211,7 +211,7 @@
</gl-cell>
<gl-cell
wx:if="{{ orderObj.selectPayType !=0 }}"
required="{{ filter.isIncludesItem(requiredList ,'plateNumber') }}"
required="{{ isPlateNumber }}"
border
valueAlign="right"
iconSrc="{{ scanIcon }}"
......@@ -268,11 +268,11 @@
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view
class="position"
wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) }}"
wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) }}"
>{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view
class="position red_text"
wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}"
wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}"
>无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
......@@ -328,11 +328,11 @@
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view
class="position"
wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) }}"
wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) }}"
>{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view
class="position red_text"
wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}"
wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}"
>无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
......@@ -388,11 +388,11 @@
<!-- merchantGoodsPosition商品列表部位字段 upgradeGoodsPosition订单详情部位字段 -->
<view
class="position"
wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) }}"
wx:if="{{ (item.merchantGoodsPosition || item.upgradeGoodsPosition) && (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) }}"
>{{filter.formatPosition((item.merchantGoodsPosition || item.upgradeGoodsPosition), positionTypeList)}}</view>
<view
class="position red_text"
wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}"
wx:if="{{ (item.goodsInfo.goodsType == 1 || item.upgradeGoodsType == 1 || item.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.upgradeGoodsType == baseConfigData.selfBuildFilmType) && !item.merchantGoodsPosition && !item.upgradeGoodsPosition }}"
>无部位属性</view>
<view class="position" wx:else></view>
<view class="price_count">
......@@ -510,7 +510,8 @@
bindconfirm="chooseGoods"
goodsData="{{ goodsData }}"
chooseGoodsList="{{ notUpgradeOrderList[selectCustomIndex].subOrderList || [] }}"
isSolarFilm="{{ true }}"
isSolarFilm="{{ true }}"
baseConfigData="{{baseConfigData}}"
/>
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" />
<sub-shop-merchant
......
// tabWorkOrder/pages/orderDetail/orderDetail.js
import api from '../../api.js'
import order_mixins from '../order_mixins.js'
import { getPositionList } from '~/store/index'
import { getPositionList, getServiceFilmRollSetting, setConfigInfo } from '~/store/index'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
const app = getApp()
Page({
......@@ -19,7 +19,18 @@ Page({
defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png',
failCustomerService: '../images/kfrefresh.png',
warrantyCardVisible: true,
signatureSwitch: false //不需要走签名逻辑 没有开启签名功能或则是战败订单
signatureSwitch: false, //不需要走签名逻辑 没有开启签名功能或则是战败订单
selectFilmNumberIndex: 0,
filmRollNoList: [],
isUseFilmRoll: false,
filmRollNoPopup: false,
filmSelectedItem: '',
tipsProps: {
tipsText: '技师施工完毕后,点击完成施工按钮结束工单。',
showTips: true,
type: 1
},
baseConfigData: {}
},
jumpUserPortrait (){
wx.$router.go('tabDate.userPortrait', this.data.orderInfo)
......@@ -33,38 +44,71 @@ Page({
wx.$router.go('updateOrderInfo', orderInfo)
},
confirmConstruction() {
let { orderCode, orderInfo } = this.data
let _this = this
let { orderCode, orderInfo, isUseFilmRoll } = this.data
wx.$util.showLoading('加载中...')
// 使用膜卷号
if (isUseFilmRoll) {
let flag = false
for (var i = 0; i < orderInfo?.subOrderList?.length; i++) {
let val = orderInfo?.subOrderList[i]
if (val?.filmNumberData?.length) {
if (!val.filmRollNo) return wx.$util.showToast(`请配置膜卷号`)
flag = true
}
}
if (flag) {
let arr = []
orderInfo?.subOrderList?.forEach(val => {
if (val?.filmNumberData?.length && val.filmRollNo) arr.push({ subOrderCode: val.subOrderCode, filmRollNo: val.filmRollNo })
})
api.setfilmRollNo({subOrderList: arr}).then(res => {
let { code, message } = res
if (code == 0) {
this.confirmEvent(orderInfo, orderCode)
} else {
wx.$util.showToast(message)
}
}).catch(err => {
wx.$util.hideLoading()
})
} else {
this.confirmEvent(orderInfo, orderCode)
}
} else {
this.confirmEvent(orderInfo, orderCode)
}
},
confirmEvent(orderInfo, orderCode) {
let _this = this
api
.confirmConstruction({ orderCode })
.then(result => {
wx.$util.hideLoading()
// console.log(result)
let { code, solution } = result
if (code == 0) {
wx.$refresh = true
wx.$router.redirectTo('constructionOrderDetail', orderInfo)
} else {
// console.log('false')
wx.showModal({
title: '温馨提示',
content: solution,
showCancel: false,
confirmText: '刷新',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
_this.getOrderDetail(orderCode)
}
.confirmConstruction({ orderCode })
.then(result => {
wx.$util.hideLoading()
// console.log(result)
let { code, solution } = result
if (code == 0) {
wx.$util.refreshPageData()
wx.$router.redirectTo('constructionOrderDetail', orderInfo)
} else {
// console.log('false')
wx.showModal({
title: '温馨提示',
content: solution,
showCancel: false,
confirmText: '刷新',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
_this.getOrderDetail(orderCode)
}
})
}
})
.catch(err => {
wx.$util.hideLoading()
console.log(err)
})
}
})
}
})
.catch(err => {
wx.$util.hideLoading()
console.log(err)
})
},
closeTips() {
this.setData({
......@@ -86,8 +130,14 @@ Page({
phoneNumber: data
})
},
onRoute(options) {
async onRoute(options) {
if (options.orderCode) {
// 服务商是否使用膜卷号配置
let isUseFilmRoll = await getServiceFilmRollSetting()
this.setData({isUseFilmRoll})
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData)
this.setData({baseConfigData})
this.getOrderDetail(options.orderCode)
this.setData({
orderCode: options.orderCode
......@@ -97,9 +147,14 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// console.log(options.orderCode)
onLoad: async function (options) {
if (options.orderCode) {
// 服务商是否使用膜卷号配置
let isUseFilmRoll = await getServiceFilmRollSetting()
this.setData({isUseFilmRoll})
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData)
this.setData({baseConfigData})
this.getOrderDetail(options.orderCode)
this.setData({
orderCode: options.orderCode
......@@ -128,8 +183,9 @@ Page({
}
},
async getOrderDetail(orderCode) {
// console.log(orderCode)
console.log(orderCode)
let _this = this
let { signatureSwitch, baseConfigData, isUseFilmRoll } = _this.data
const positionTypeList = await getPositionList() || []
wx.$util.showLoading('加载中...')
......@@ -137,14 +193,19 @@ Page({
.getOrderDetail({
orderCode
})
.then(res => {
.then(async res => {
let { code, message, data } = res
if (code == 0) {
wx.$util.hideLoading()
// 获取对应园区店配置
await this.getServiceBaseInfo(data.merchantId)
await this.getSignatureSwitch(data.merchantId)
let couponName = data.customerCoupon ? data.customerCoupon.couponName : ''
let total_price = 0
let warrantyCardList = []
data.subOrderList.map(e => {
let userInfo = wx.$util.getUserInfo()
for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i]
total_price += e.totalPrice
e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
......@@ -155,7 +216,14 @@ Page({
cardCode: e.cardCode
})
}
})
// 膜类商品 并且服务商开通了使用膜卷号配置 不走签名流程
if (baseConfigData?.membraneTypeList?.includes(e?.upgradeGoodsType) && isUseFilmRoll && !signatureSwitch) {
let result = await api.getfilmRollNoByGoods({upgradeGoodsId: e.upgradeGoodsId, yqMerchantId: userInfo?.merchantId, merchantId: userInfo?.shopMerchantId})
e.filmNumberData = result?.data || []
// 仅配置一个膜卷号 自动选中
if (!e.filmRollNo && e.filmNumberData?.length == 1) e.filmRollNo = e.filmNumberData[0]
}
}
data = {
...data.customer,
...data.payOrder,
......@@ -184,9 +252,6 @@ Page({
// 条形码
warrantyCardList.length && this.getBarCode()
// 获取对应园区店配置
this.getServiceBaseInfo(data.merchantId)
this.getSignatureSwitch(data.merchantId)
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
let { customerObj } = this.data
......@@ -259,6 +324,27 @@ Page({
})
},
// 选择膜卷号
selectfilmRollNo(e) {
let { item, index } = e.currentTarget.dataset
this.setData({
filmRollNoList: item?.filmNumberData,
selectFilmNumberIndex: index,
filmSelectedItem: item.filmRollNo,
filmRollNoPopup: true
})
},
// 选择膜卷号确认
changefilmRollNo(e) {
let { selectFilmNumberIndex } = this.data
let prop = `orderInfo.subOrderList[${selectFilmNumberIndex}].filmRollNo`
this.setData({
[prop]: e?.detail,
filmRollNoPopup: false
})
},
// 选择技师
selectArtificer(e) {
let { item } = e.currentTarget.dataset
......
{
"navigationBarTitleText": "工单详情",
"usingComponents": {
"artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup"
"artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup",
"film-roll-no-popup": "/tabWorkOrder/components/FilmRollNoPopup/FilmRollNoPopup"
}
}
\ No newline at end of file
......@@ -41,8 +41,11 @@
<view class="subItem_box">
<view style="{{!orderInfo.isOpenArtificer || !item.upgradeGoodsPosition ? 'display: flex; justify-content: space-between; width: 100%;' : 'display: flex;'}}">
<!-- 太阳膜类展示部位 精品类展示类目名 -->
<view class="position">{{item.positionStr || item.upgradeGoodsTypeName}}</view>
<view class="type">x{{item.number}}</view>
<view class="position">{{item.positionStr || item.upgradeGoodsTypeName}}<text class="type">x{{item.number}}</text></view>
</view>
<!-- 设置膜卷号(不需走签名 战败订单) -->
<view wx:if="{{(!signatureSwitch || orderInfo.selectPayType == 0) && isUseFilmRoll && item.filmNumberData.length}}" class="film-roll disabled" bindtap="selectfilmRollNo" data-item="{{item}}" data-index="{{index}}">
<text class="{{!item.filmRollNo ? 'grey_text' : ''}} 'text-hide'">{{item.filmRollNo || '选择膜卷号'}}</text><image src="/components/images/arrow-x.png" mode=""/>
</view>
<!-- 太阳膜类且配置技师 -->
<view wx:if="{{orderInfo.isOpenArtificer && item.upgradeGoodsPosition}}" class="artificer" bindtap="selectArtificer" data-item="{{item}}">
......@@ -94,7 +97,7 @@
</block>
<block wx:if="{{orderInfo.selectPayType == 2}}">
<view class="cell">
<view class="label">付款凭证:</view>
<view class="label">付款凭证</view>
<view class="image-box">
<view class="value" bindtap="previewImage" wx:for="{{orderInfo.payVoucherList}}" wx:key="index" data-index="{{index}}" data-url="{{orderInfo.payVoucherList}}">
<view class="image">
......@@ -228,11 +231,7 @@
<view class="btn text-center" bindtap="navOrderSignature">客户签名确认</view>
</view>
<view wx:else class="btn-box {{isFullSucreen?'isFullSucreen-btn':''}}">
<view class="tips" wx:if="{{showTips}}">
<image class="tipsIcon" src="../../../images/tips.png" />
<view class="contentText">技师施工完毕后,点击完成施工按钮结束工单。</view>
<image class="closeIcon" bindtap="closeTips" src="../../images/closeIcon.png" />
</view>
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsProps }}" />
<!-- <view class="btn text-center" bindtap="showAgain">继续下单</view> -->
<view class="btn text-center" bindtap="confirmConstruction">确认完成施工</view>
</view>
......@@ -247,4 +246,9 @@
artificerSelectObj="{{artificerSelectObj}}"
bindconfirm="changeArtificer" />
<!-- <wxs src="/utils/index.wxs" module="common" /> -->
<film-roll-no-popup
show="{{filmRollNoPopup}}"
title="选择膜卷号"
copyfilmRollNoList="{{filmRollNoList}}"
filmSelectedItem="{{filmSelectedItem}}"
bindconfirm="changefilmRollNo" />
......@@ -93,10 +93,11 @@ page {
.box .goods .item .subItem_box{
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.box .goods .item .subItem_box .artificer{
.box .goods .item .subItem_box .artificer,.film-roll{
height: 48rpx;
background: #FFFFFF;
border: 1rpx solid #DEE0E3;
......@@ -110,14 +111,18 @@ page {
}
.artificer text{
max-width: 170rpx;
max-width: 96rpx;
}
.film-roll text{
max-width: 120rpx;
}
.artificer .grey_text{
.artificer .grey_text,.film-roll .grey_text{
color: #BEC1C7;
}
.artificer image{
.artificer image,.film-roll image{
width: 28rpx;
height: 28rpx;
margin-left: 8rpx;
......@@ -540,6 +545,8 @@ page {
font-size: 28rpx;
margin-left: 16rpx;
font-weight: normal;
display: flex;
align-items: center;
}
......
......@@ -4,7 +4,7 @@ import {
} from '~/api/api'
import api from '../../api.js'
import order_mixins from '../order_mixins.js'
import { getPositionList } from '~/store/index'
import { getPositionList, getServiceFilmRollSetting, setConfigInfo } from '~/store/index'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/miniProgram/'
const app = getApp()
Page({
......@@ -55,7 +55,13 @@ Page({
value: 4,
checked: false
}
]
],
selectFilmNumberIndex: 0,
filmRollNoList: [],
isUseFilmRoll: false,
filmRollNoPopup: false,
filmSelectedItem: '',
baseConfigData: {}
},
setSignture(url) {
this.setData({
......@@ -172,13 +178,15 @@ Page({
async getOrderDetail(orderCode) {
// console.log(orderCode)
let _this = this
let { baseConfigData, isUseFilmRoll } = _this.data
let userInfo = wx.$util.getUserInfo()
wx.$util.showLoading('加载中...')
const positionTypeList = await getPositionList() || []
api
.getOrderDetail({
orderCode
})
.then(res => {
.then(async res => {
let {
code,
message,
......@@ -189,18 +197,26 @@ Page({
let couponName = data.customerCoupon ? data.customerCoupon.couponName : ''
let total_price = 0
let warrantyCardList = []
data.subOrderList.map(e => {
for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i]
total_price += e.totalPrice
e.price = Number(wx.$util.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) {
if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName,
cardCode: e.cardCode
})
}
})
// 膜类商品 并且服务商开通了使用膜卷号配置
if (baseConfigData?.membraneTypeList?.includes(e?.upgradeGoodsType) && isUseFilmRoll) {
let result = await api.getfilmRollNoByGoods({upgradeGoodsId: e.upgradeGoodsId, yqMerchantId: userInfo?.merchantId, merchantId: userInfo?.shopMerchantId})
e.filmNumberData = result?.data || []
// 仅配置一个膜卷号 自动选中
if (!e.filmRollNo && e.filmNumberData?.length == 1) e.filmRollNo = e.filmNumberData[0]
}
}
data = {
...data.customer,
...data.payOrder,
......@@ -224,18 +240,18 @@ Page({
// warrantyCardList.length && this.getBarCode()
// this.getServiceBaseInfo(data.merchantId)
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
let { customerObj } = this.data
if (customerObj.findIndex(val => val.key == 'subShopMerchantName') < 0) {
customerObj[customerObj.length - 2] = {
label: '二级流量方',
key: 'subShopMerchantName'
}
}
this.setData({
customerObj
})
}
// if (data.subShopMerchantName) {
// let { customerObj } = this.data
// if (customerObj.findIndex(val => val.key == 'subShopMerchantName') < 0) {
// customerObj[customerObj.length - 2] = {
// label: '二级流量方',
// key: 'subShopMerchantName'
// }
// }
// this.setData({
// customerObj
// })
// }
// 门店是否配置技师
// if (data?.technicianConfigDTOList?.length > 0) {
// this.isArtificer(data)
......@@ -306,6 +322,27 @@ Page({
})
},
// 选择膜卷号
selectfilmRollNo(e) {
let { item, index } = e.currentTarget.dataset
this.setData({
filmRollNoList: item?.filmNumberData,
selectFilmNumberIndex: index,
filmSelectedItem: item?.filmNo,
filmRollNoPopup: true
})
},
// 选择膜卷号确认
changefilmRollNo(e) {
let { selectFilmNumberIndex } = this.data
let prop = `orderInfo.subOrderList[${selectFilmNumberIndex}].filmRollNo`
this.setData({
[prop]: e?.detail,
filmRollNoPopup: false
})
},
// 选择技师
selectArtificer(e) {
let { item } = e.currentTarget.dataset
......@@ -417,7 +454,8 @@ Page({
rating,
orderCode,
orderInfo,
signImage
signImage,
isUseFilmRoll
} = this.data
let that = this
// 校验表单
......@@ -452,13 +490,43 @@ Page({
// tags,
evaluationList
}
console.log(params);
// return
// 使用膜卷号
if (isUseFilmRoll) {
let flag = false
for (var i = 0; i < orderInfo?.subOrderList?.length; i++) {
let val = orderInfo?.subOrderList[i]
if (val?.filmNumberData?.length) {
if (!val.filmRollNo) return wx.$util.showToast(`请配置膜卷号`)
flag = true
}
}
if (flag) {
let arr = []
orderInfo?.subOrderList?.forEach(val => {
if (val?.filmNumberData?.length && val.filmRollNo) arr.push({ subOrderCode: val.subOrderCode, filmRollNo: val.filmRollNo })
})
api.setfilmRollNo({subOrderList: arr}).then(res => {
let { code, message } = res
if (code == 0) {
this.confirmEvent(params, orderInfo)
} else {
wx.$util.showToast(message)
}
}).catch(err => {
wx.$util.hideLoading()
})
} else {
this.confirmEvent(params, orderInfo)
}
} else {
this.confirmEvent(params, orderInfo)
}
},
confirmEvent(params, orderInfo) {
api
.customerConfirmationSignature(params)
.then(result => {
// console.log(this.)
console.log(result)
let {
code,
message
......@@ -469,13 +537,13 @@ Page({
title: '确认评价成功',
icon: 'success'
})
wx.$util.refreshPageData()
wx.$router.redirectTo('constructionOrderDetail', orderInfo)
} else {
wx.$util.showToast(message)
}
})
.catch(err => {})
// console.log(electronicSignature, 'electronicSignature')
},
getSignatureImg() {
let {
......@@ -599,12 +667,17 @@ Page({
})
.exec()
},
onRoute(options) {
async onRoute(options) {
// console.log(options)
// 调试用
// options.orderCode = '231020165619225'
// options.orderCode = '230427135616113'
if (options.orderCode) {
// 服务商是否使用膜卷号配置
let isUseFilmRoll = await getServiceFilmRollSetting()
this.setData({isUseFilmRoll})
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData)
this.setData({baseConfigData})
this.setData({
orderCode: options.orderCode
})
......@@ -615,8 +688,14 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: async function (options) {
if (options.orderCode) {
// 服务商是否使用膜卷号配置
let isUseFilmRoll = await getServiceFilmRollSetting()
this.setData({isUseFilmRoll})
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData)
this.setData({baseConfigData})
this.getOrderDetail(options.orderCode)
this.setData({
orderCode: options.orderCode
......
{
"navigationBarTitleText": "客户签字",
"usingComponents": {
"artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup"
"artificer-select-popup" : "/components/ArtificerSelectPopup/artificerSelectPopup",
"film-roll-no-popup": "/tabWorkOrder/components/FilmRollNoPopup/FilmRollNoPopup"
}
}
......@@ -26,9 +26,12 @@
</view>
<view class="subItem_box">
<view style="{{!orderInfo.isOpenArtificer || !item.upgradeGoodsPosition ? 'display: flex; justify-content: space-between; width: 100%;' : 'display: flex;'}}">
<view class="position">{{item.positionStr}}</view>
<view class="type">x{{item.number}}</view>
<view class="position">{{item.positionStr || item.upgradeGoodsTypeName}}<text class="type">x{{item.number}}</text></view>
</view>
<!-- 设置膜卷号 -->
<view wx:if="{{isUseFilmRoll && item.filmNumberData.length}}" class="film-roll disabled" bindtap="selectfilmRollNo" data-item="{{item}}" data-index="{{index}}">
<text class="{{!item.filmRollNo ? 'grey_text' : ''}} 'text-hide'">{{item.filmRollNo || '选择膜卷号'}}</text><image src="/components/images/arrow-x.png" mode=""/>
</view>
<!-- 太阳膜类且配置技师 -->
<view wx:if="{{orderInfo.isOpenArtificer && item.upgradeGoodsPosition}}" class="artificer" bindtap="selectArtificer" data-item="{{item}}">
<text class="{{!item.technicianName ? 'grey_text' : ''}} 'text-hide'">{{item.technicianName || '选择技师'}}</text><image src="/components/images/arrow-x.png" mode=""/>
......@@ -134,4 +137,10 @@
orderInfo="{{orderInfo}}"
artificerSelectObj="{{artificerSelectObj}}"
bindconfirm="changeArtificer" />
<film-roll-no-popup
show="{{filmRollNoPopup}}"
title="选择膜卷号"
copyfilmRollNoList="{{filmRollNoList}}"
filmSelectedItem="{{filmSelectedItem}}"
bindconfirm="changefilmRollNo" />
......@@ -90,7 +90,7 @@ page {
margin-left: 12rpx;
}
.box .goods .item .subItem_box .artificer{
.box .goods .item .subItem_box .artificer,.film-roll{
height: 48rpx;
background: #FFFFFF;
border: 1rpx solid #DEE0E3;
......@@ -104,16 +104,37 @@ page {
}
.artificer text{
max-width: 170rpx;
max-width: 96rpx;
}
.film-roll text{
max-width: 120rpx;
}
.artificer .grey_text,.film-roll .grey_text{
color: #BEC1C7;
}
.artificer image{
.artificer image,.film-roll image{
width: 28rpx;
height: 28rpx;
margin-left: 8rpx;
flex-shrink: 0;
}
.box .goods .item .subItem_box .artificer{
height: 48rpx;
background: #FFFFFF;
border: 1rpx solid #DEE0E3;
border-radius: 26rpx;
display: flex;
align-items: center;
justify-content: center;
padding: 0 24rpx;
color: #292D33;
font-size: 24rpx;
}
.box .goods .item .goods_name{
color: #333333;
margin-bottom: 22rpx;
......
......@@ -2,7 +2,7 @@
import api from '../../api'
import {
getYQorderInfo,
getPositionList
setConfigInfo
} from '~/store/index'
const app = getApp()
let toastList = {
......@@ -75,7 +75,8 @@ Page({
type: 1
},
positionTypeList: [],
currentWordNumber: 0 // 订单备注字数
currentWordNumber: 0, // 订单备注字数
baseConfigData: {}
},
showCustomPop() {
this.setData({
......@@ -405,8 +406,8 @@ Page({
success(_res_) {
if (_res_.confirm) {
if (apiName == 'createPrerecordedOrder') {
// 预录建档跳转到预约列表
wx.$refresh = true
// 预录建档跳转到预约列表 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
wx.$router.go('pages.tabDateIndex')
wx.$util.pointRecord(30)
} else {
......@@ -418,7 +419,8 @@ Page({
}
})
} else {
wx.$refresh = true
// 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
wx.$router.redirectTo('confirmOrder', data)
}
} else {
......@@ -688,7 +690,6 @@ Page({
showCancel: false,
success(res) {
if (res.confirm) {
wx.$refresh = true
wx.$router.go('index')
}
}
......@@ -700,7 +701,8 @@ Page({
async getOrderBaseGoodsList(merchantId) {
let {
first,
orderObj
orderObj,
baseConfigData
} = this.data
let {
subOrderList
......@@ -723,11 +725,8 @@ Page({
} = res
if (code == 0) {
wx.hideLoading()
data?.forEach((val, index) => {
// 过滤掉太阳膜数据
if (val.goodsType == 1) data.splice(index, 1)
})
let goodsData = data
let filterData = data.filter(val => val.goodsType !== 1 && val.goodsType !== baseConfigData?.selfBuildFilmType)
let goodsData = filterData
const filterList = goodsData.reduce((list, item) => {
// item.upgradeGoodsList.forEach(val => {
// val.positionStr = positionTypeList.filter(v => v.positionValue == val.merchantGoodsPosition)[0]?.positionName
......@@ -877,6 +876,9 @@ Page({
wx.disableAlertBeforeUnload && wx.disableAlertBeforeUnload() //关闭小程序页面返回询问对话框
},
async onRoute(res) {
// 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData)
this.setData({baseConfigData})
if (res.orderCode && res.page) {
let result = await api.getOrderDetail({
orderCode: res.orderCode
......
......@@ -336,7 +336,8 @@ page {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
font-size: 32rpx;
font-weight: 500;
z-index: 99;
flex-direction: column;
}
......
......@@ -196,7 +196,8 @@ Page({
wx.$util.hideLoading()
console.log(result)
if (result.code == 0 && result.data) {
wx.$refresh = true
// 状态更新 需刷新工单列表和预约管理列表
wx.$util.refreshPageData()
this.back(orderObj.orderCode)
} else {
wx.showToast({
......
......@@ -253,7 +253,8 @@ page {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
font-size: 32rpx;
font-weight: 500;
z-index: 99;
flex-direction: column;
}
......
......@@ -259,6 +259,12 @@ const debounce = (func, delay, immediate)=> {
};
}
/** 刷新工单管理 预约管理数据 */
const refreshPageData = (notRefreshOrder) => {
if (!notRefreshOrder) wx.$orderListRefresh = true
wx.$dateListRefresh = true
}
const util = {
onReachBottom,
haveEmoji,
......@@ -280,7 +286,8 @@ const util = {
getTimeState,
checkRule,
pointRecord,
debounce
debounce,
refreshPageData
}
const Util = Object.assign(util, wxApi, format)
// console.log('Util', Util)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!