Commit 51533a8b by 杨北旺

提交战败下单模块

1 parent feb47780
...@@ -64,12 +64,20 @@ ...@@ -64,12 +64,20 @@
{ {
"root": "tabDate", "root": "tabDate",
"name": "tabDate", "name": "tabDate",
"pages": ["pages/detail/detail", "pages/apprManage/apprManage", "pages/userPortrait/userPortrait"] "pages": [
"pages/detail/detail",
"pages/apprManage/apprManage",
"pages/userPortrait/userPortrait"
]
}, },
{ {
"root": "tabMine", "root": "tabMine",
"name": "tabMine", "name": "tabMine",
"pages": ["pages/technicianSetup/technicianSetup", "pages/completeBuild/completeBuild", "pages/collectCoupons/collectCoupons"] "pages": [
"pages/technicianSetup/technicianSetup",
"pages/completeBuild/completeBuild",
"pages/collectCoupons/collectCoupons"
]
}, },
{ {
"root": "tabWorkOrder", "root": "tabWorkOrder",
...@@ -118,18 +126,32 @@ ...@@ -118,18 +126,32 @@
"pages/aiInspectionDetail/aiInspectionDetail", "pages/aiInspectionDetail/aiInspectionDetail",
"pages/aiInspectionReception/aiInspectionReception", "pages/aiInspectionReception/aiInspectionReception",
"pages/trainingMaterials/trainingMaterials", "pages/trainingMaterials/trainingMaterials",
"pages/trainingMaterials/pages/playVideo/index" "pages/trainingMaterials/pages/playVideo/index",
"pages/createDeafeatOrder/createDeafeatOrder"
] ]
}, },
{ {
"root": "tabOperating", "root": "tabOperating",
"name": "tabOperating", "name": "tabOperating",
"pages": ["pages/4sOverview/4sOverview", "pages/index/index", "pages/operatingShow/operatingShow"] "pages": [
"pages/4sOverview/4sOverview",
"pages/index/index",
"pages/operatingShow/operatingShow"
]
}, },
{ {
"root": "packageCrowdFunding", "root": "packageCrowdFunding",
"name": "packageCrowdFunding", "name": "packageCrowdFunding",
"pages": ["pages/TabBar/crowdFundingPage", "pages/activityPage/paidOrder/orderList", "pages/activityPage/activityList/activityList", "pages/activityPage/activityPay/activityPay", "pages/activityPage/paymentSuccess/paymentSuccess", "pages/activityPage/balanceNote/balanceNote", "pages/activityPage/newOrder/newOrder", "pages/activityPage/additionRecordOrder/additionRecordOrder"] "pages": [
"pages/TabBar/crowdFundingPage",
"pages/activityPage/paidOrder/orderList",
"pages/activityPage/activityList/activityList",
"pages/activityPage/activityPay/activityPay",
"pages/activityPage/paymentSuccess/paymentSuccess",
"pages/activityPage/balanceNote/balanceNote",
"pages/activityPage/newOrder/newOrder",
"pages/activityPage/additionRecordOrder/additionRecordOrder"
]
}, },
{ {
"root": "subvehicleConversion", "root": "subvehicleConversion",
...@@ -172,11 +194,15 @@ ...@@ -172,11 +194,15 @@
"preloadRule": { "preloadRule": {
"pages/tabWorkOrder/pages/index/index": { "pages/tabWorkOrder/pages/index/index": {
"network": "all", "network": "all",
"packages": ["tabWorkOrder"] "packages": [
"tabWorkOrder"
]
}, },
"tabIndex/pages/index/index": { "tabIndex/pages/index/index": {
"network": "all", "network": "all",
"packages": ["tabWorkOrder"] "packages": [
"tabWorkOrder"
]
} }
}, },
"resolveAlias": { "resolveAlias": {
...@@ -190,4 +216,4 @@ ...@@ -190,4 +216,4 @@
}, },
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"resizable": true "resizable": true
} }
\ No newline at end of file \ No newline at end of file
import {
ImgUrl
} from '~/config';
import { quotationGoodsList } from '../../api'
import NP from 'number-precision'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL: ImgUrl,
scanIcon: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/ocr_icon.png',
name: 'createdOrder',
dateObj: {
beforeDay: '',
today: '',
nextDay: '',
maxDate: '',
todayShow: ''
},
customer: {
customerName: '',
customerPhone: ''
},
reasonList: [{
select: false,
name: '回去考虑一下'
}, {
select: false,
name: '完全不需要'
}, {
select: false,
name: '问家里意见'
}, {
select: false,
name: '没钱'
}, {
select: false,
name: '开一两年就不用了'
}, {
select: false,
name: '车开不了那么久换车'
}],
deafeatReason: '',
orderObj: {},
customerInfoBox: false
},
/**设置日期 */
setTimeList(dateNum) {
let maxDate = new Date().format('yyyy-MM-dd')
let today = dateNum || new Date().format('yyyy-MM-dd')
/**
* 根据日期字符串获取星期几
* @param dateString 日期字符串(如:2020-05-02)
* @returns {String}
*/
var dateArray = today.split('-')
let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2])
let todayShow = ' 周' + '日一二三四五六'.charAt(date.getDay())
todayShow = dateArray[0] + '年' + dateArray[1] + '月' + dateArray[2] + '日 ' + todayShow
this.setData({
dateObj: {
today,
maxDate,
todayShow
}
})
},
// 获取选中天数
rangeSelect(e) {
let {
date
} = e.detail
this.setTimeList(date)
},
onLoad: function (res) {
this.setTimeList()
this.handlerUserInfo()
this.getGoodsProduct()
},
onShow: function () { },
toSelectReason(e) {
let { deafeatReason } = this.data
const { item, index } = e.currentTarget.dataset
let str = deafeatReason
str = deafeatReason + item.name
if (str.length > 30) {
str = deafeatReason
}
this.setData({
deafeatReason: str
})
},
intReason(e) {
this.setData({
deafeatReason: e.detail.value
})
},
showPopup(e) {
let {
showName
} = e.currentTarget.dataset
this.setData({
[showName]: true,
})
},
handlerUserInfo() {
let userInfo = wx.$util.getUserInfo()
let {
orderObj
} = this.data
orderObj.sellerMerchantName = userInfo.merchantName
orderObj.sellerMerchantId = userInfo.merchantId
orderObj.sellerName = userInfo.name
orderObj.sellerUserId = userInfo.uuid
this.setData({
orderObj,
userInfo
})
},
showCustomPop(e) {
this.setData({
customerInfoBox: true,
})
},
chooseCustomerInfo(e) {
console.log(e);
let {
detail
} = e
let customer = {
customerName: detail.customer.customerName,
customerSex: detail.customer.customerSex,
customerPhone: detail.customer.customerPhone,
carBrandId: detail.customer.carBrandId,
carBrand: detail.customer.carBrand,
carChildsBrandId: detail.customer.carChildsBrandId,
carChildsBrandName: detail.customer.carChildsBrandName,
carSeriesId: detail.customer.carSeriesId,
carSeriesName: detail.customer.carSeriesName,
standNo: detail.customer.standNo,
plateNumber: detail.customer.plateNumber
}
this.setData({
customer
})
},
input(e) {
let {
value
} = e.detail
let {
name
} = e.currentTarget.dataset
this.setData({
[name]: value
})
},
// 提交完停留当前页面清空数据
toContinueSumbit() {
const params = this.handlerParams()
console.log(params);
},
// 提交完跳转订单列表页面
toSumbit() {
const params = this.handlerParams()
console.log(params);
// wx.$router.redirectTo('packageEquity.equityPage', {
// tabIndex: 1
// })
},
// 获取商品列表数据
getGoodsProduct() {
let {
default4SStoreInfo
} = wx.$util.getUserInfo()
quotationGoodsList({
merchantId: default4SStoreInfo.merchantId,
suitCarPrice: ''
})
.then(result => {
let {
data
} = result
data = data.map(ele => {
if (ele.goods) {
let item = ele.goods
ele.goods = {
...item,
goodsId: item.merchantGoodsId,
goodsNameAlias: item.upgradeGoodsAlias,
appreciation: item?.appreciation,
goodsName: item?.upgradeGoodsName,
quotationGoodsServiceItemsRelationDTOList: item?.upgradeGoodsServiceItemsList,
titlePictureUrl: item.goodsInfo?.thumbUrl
}
}
if (ele.packageGoods) {
let item = ele.packageGoods
ele.packageGoods.sellPrice = item.goodsList.reduce((pre, item) => {
pre = NP.plus(pre, item.sellPrice)
return pre
}, 0)
}
return ele
})
this.setDefailtInfo(data)
})
.catch(err => {
console.log(err);
})
},
// 处理默认隐藏信息
setDefailtInfo(data) {
let vdQuotationGoodsList = []
if (Array.isArray(data)) {
const firstItem = data[0].goods
let item = {
goodsId: firstItem.goodsId,
goodsName: firstItem.goodsName,
goodsNameAlias: firstItem.goodsNameAlias,
goodsPrice: NP.times(100, firstItem.sellPrice),
}
vdQuotationGoodsList.push(item)
}
let {
default4SStoreInfo
} = wx.$util.getUserInfo()
const msg = {
total: 1,
mode: 1,
check: true,
insurancePrice: 0,
merchantId4s: default4SStoreInfo.merchantId,
merchantName4s: default4SStoreInfo.merchantName,
minEquityPrice: 0,
payType: 1,
paymentDocList: [],
quotedPriceUpdate: 0,
referrer: '',//推荐人,
referrerId: '',//
transactionNo: '',
vdQuotationGoodsList,
owner: {
ageRange: '',
carBrand: '',
carBrandId: '',
carChildsBrandId: '',
carChildsBrandName: '',
carColor: '',
carSeriesId: '',
carSeriesName: '',
carVin: '',
certificateNo: '',
city: '',
companion: '',
confirmStatus: false,
owner: '',//客户姓名
ownerGender: '',
phone: '',//客户手机号
price: '',
salesType: '',
saveStatus: false,
seat: 5,
}
}
this.defaultMsg = msg
},
// 同步选择信息
handlerParams() {
let params = this.defaultMsg, { customer, orderObj, deafeatReason } = this.data
params.owner.owner = customer.customerName
params.owner.phone = customer.customerPhone
params.referrer = orderObj.employeeName
params.referrerId = orderObj.userId
if (!orderObj.employeeName) return this.showToast(`请选择推荐人员`)
if (!customer.customerName) return this.showToast(`请输入车主姓名`)
if (!customer.customerPhone) return this.showToast(`请输入车主手机号`)
const phoneRex = /^[1]([3-9])[0-9]{9}$/
if (!phoneRex.test(customer.customerPhone)) {
this.showToast(`请输入正确的手机号`)
return
}
if (!deafeatReason) return this.showToast(`请输入战败原因`)
return params
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"merchant-seles": "/components/Merchant-Seles/Merchant-Seles",
"customerInfo": "/components/CustomerInfo/CustomerInfo"
},
"navigationBarTitleText":"战败下单"
}
\ No newline at end of file \ No newline at end of file
<view class="main">
<view class="createData">
<view class="label">战败时间</view>
<calendar id="calender" class="calendar" allowSameDay shortcut bindselect="rangeSelect" rangeAll dateType="single" calenderColor="#347BFF" vertical minDate="2020-10-01" maxDate="{{ dateObj.maxDate }}" isComponents>
<view class="calendarItem text-center dateNum">
{{dateObj.todayShow}}
<image class="solidArrow" src="/tabIndex/images/arrSolid.png" />
</view>
</calendar>
</view>
<view class="wrapper">
<view class="cell">
<gl-cell border valueAlign="right" label="推荐人员" requiredAfter labelWidth="var(--fontSize140)" required haveArrow bindclick="showPopup" data-show-name="selesBox" placeholder="点击选择">
<view class="between">
<view class="start text-hide {{orderObj.employeeName?'':'placeholder-class'}}">{{orderObj.employeeName || '请选择'}}</view>
</view>
</gl-cell>
</view>
<view class="cell two-cell">
<gl-cell border valueAlign="right" label="车主姓名" titleBtn="客户档案" bindtitleClick="showCustomPop" data-index="{{ ind }}" requiredAfter labelWidth="var(--fontSize290)" required>
<input placeholder="点击输入" class="input" placeholder-class="placeholder-class" maxlength="16" value="{{ customer.customerName }}" bindinput="input" data-index="{{ ind }}" data-name="customer.customerName" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="手机号" requiredAfter labelWidth="var(--fontSize140)" required>
<input placeholder="点击输入" class="input" type="number" maxlength="11" placeholder-class="placeholder-class" value="{{ customer.customerPhone }}" bindinput="input" data-index="{{ ind }}" data-name="customer.customerPhone" always-embed></input>
</gl-cell>
</view>
<view class="cell cell-textarea">
<view class="label">战败原因</view>
<view class="inner">
<textarea class="cus-textarea" bindinput="intReason" value="{{deafeatReason}}" placeholder="请输入" placeholder-class="textarea-placeholder" maxlength="30"></textarea>
<text class="maxCount">{{deafeatReason.length || 0}}/30</text>
</view>
<view class="select-content">
<block wx:for="{{reasonList}}" wx:key="index">
<view bind:tap="toSelectReason" data-item="{{item}}" data-index="{{index}}" class="reason">
{{item.name}}
</view>
</block>
</view>
</view>
<view class="btn-group">
<view bind:tap="toSumbit" class="btn-class primary">立即提交</view>
<view bind:tap="toContinueSumbit" class="btn-class">提交后继续添加</view>
</view>
</view>
</view>
<merchant-seles show="{{ selesBox }}" title="选择合作门店" sub-title="选择销售顾问" orderObj="{{ orderObj }}" userInfo="{{ userInfo }}" singleSeller="{{ true }}" type="1" />
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" />
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/pages/defeatOrder/defeatOrder.wxss */
page {
background-color: #F7F8FA;
transition: none !important;
}
.main {
padding: 0 0 var(--fontSize136);
}
.createData {
margin: var(--fontSize20);
background: #FFFFFF;
box-shadow: 0 var(--fontSize4) var(--fontSize20) 0 #0000001a;
border-radius: var(--fontSize16);
box-sizing: border-box;
width: calc(100% - var(--fontSize40));
height: var(--fontSize120);
background-color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--fontSize40);
}
.label {
font-size: var(--fontSize28);
font-weight: 500;
color: #292D33;
}
.calendarItem {
/* width: var(--fontSize300); */
background: #F2F3F5;
border: none !important;
}
.solidArrow {
width: var(--fontSize40);
height: var(--fontSize40);
margin-left: var(--fontSize10);
margin-top: var(--fontSize5);
}
.dateNum {
color: #292D33;
padding: var(--fontSize12) var(--fontSize24);
border-radius: var(--fontSize8);
border: 1px solid #DEE0E3;
font-size: var(--fontSize26);
font-weight: 500;
}
.wrapper {
padding: 0 var(--fontSize20);
}
.cell {
overflow: hidden;
box-shadow: 0 var(--fontSize6) var(--fontSize16) 0 #cdcdd159;
border-radius: var(--fontSize16);
}
.between {
display: flex;
align-items: center;
justify-content: flex-end;
}
.between .start {
max-width: 70%;
}
.two-cell {
margin-top: var(--fontSize20);
}
.input {
text-align: right;
font-size: var(--fontSize28);
height: 100%;
}
.placeholder-class {
color: #BEC1C7;
}
.cell-textarea {
margin-top: var(--fontSize20);
background: #fff;
padding: var(--fontSize40);
/* height: var(--fontSize476); */
}
.inner {
width: 100%;
height: var(--fontSize172);
border: var(--fontSize2) solid #EFF0F2;
border-radius: var(--fontSize12);
margin-top: var(--fontSize24);
box-sizing: border-box;
padding: var(--fontSize20) var(--fontSize24);
position: relative;
}
.cus-textarea {
height: 100%;
font-size: var(--fontSize28);
}
.textarea-placeholder {
font-weight: 400;
font-size: var(--fontSize28);
color: #BEC1C7;
}
.select-content{
margin-top: var(--fontSize24);
}
.select-content .reason{
display: inline-block;
width: fit-content;
padding: var(--fontSize12) var(--fontSize24);
background: #F7F7F7;
border-radius: var(--fontSize4);
font-weight: 400;
font-size: var(--fontSize24);
margin-right: var(--fontSize16);
margin-bottom: var(--fontSize16);
color: #5A5E66;
border: var(--fontSize2) solid #fff;
}
.select-content .active{
background: #347bff1a;
border: var(--fontSize2) solid #347BFF;
color: #347BFF;
}
.maxCount{
position: absolute;
right: var(--fontSize24);
bottom: var(--fontSize20);
font-weight: 400;
font-size: var(--fontSize24);
color: #BEC1C7;
}
.btn-group{
margin-top: var(--fontSize40);
box-sizing: border-box;
padding: 0 var(--fontSize44)
}
.btn-group .btn-class{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: var(--fontSize88);
background: #FFFFFF;
border-radius: var(--fontSize12);
font-weight: 400;
font-size: var(--fontSize32);
color: #347BFF;
}
.btn-group .primary{
background: #347BFF;
color: #fff;
margin-bottom: var(--fontSize20);
}
\ No newline at end of file \ No newline at end of file
...@@ -92,7 +92,11 @@ Component({ ...@@ -92,7 +92,11 @@ Component({
menuText: '培训资料', menuText: '培训资料',
icon: 'peixun_icon', icon: 'peixun_icon',
path: 'packageEquity.trainingMaterials' path: 'packageEquity.trainingMaterials'
}], },{
menuText: '战败下单',
icon: 'deafeat_order',
path: 'packageEquity.createDeafeatOrder'
},],
loginRoleLabel: { loginRoleLabel: {
1: '超管', 1: '超管',
2: '商户管理员', 2: '商户管理员',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!