Commit a69506eb by 张立顺

feat 功能开发

1 parent 7817123f
// pages/equity/index.js // pages/equity/index.js
import { get4SStoreList } from '~/store/index' import { get4SStoreList } from '~/store/index'
import api from '~/api/api.js'
import { merchantMode, waitinputorder, staffDailyReportDetailWeeklyList, staffDailyReportMerchantValid, quotationRecording, isBusinessSchoolEnableCurrentUser } from '../../api' import { merchantMode, waitinputorder, staffDailyReportDetailWeeklyList, staffDailyReportMerchantValid, quotationRecording, isBusinessSchoolEnableCurrentUser } from '../../api'
import { getBusinessSchoolScene } from '~/store/index' import { getBusinessSchoolScene } from '~/store/index'
const app = getApp() const app = getApp()
...@@ -141,98 +142,56 @@ Page({ ...@@ -141,98 +142,56 @@ Page({
} }
}) })
} }
// // 获取当前日期
// const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = userInfo
// let timeBean = util.getWeekDayList(0)
// let params = {
// yqMerchantId: merchantId,
// yqMerchantName: merchantName,
// staffName: name,
// staffUuid: uuid,
// merchantId: shopMerchantId,
// merchantName: shopMerchantName,
// ...timeBean
// }
// console.log(params, 'params')
// staffDailyReportDetailWeeklyList(params).then(res => {
// let { code, data, message } = res
// if (code == 0) {
// console.log(data, 'data')
// // timeBean.weekDayList = timeBean.weekDayList.map((item, index) => {
// // // item.weeklyList = data[index]
// // item.hasDailyValue = data.includes(item.date)
// // return item
// // })
// // timeBean
// let dateStaffPop = wx.$storage.get('dateStaffPop')
// // 判断 有没有填写日报
// let hasNeedReport = timeBean.weekDayList.find((item, index) => {
// // item.hasDailyValue =
// return !data.includes(item.date) && !item.disabled
// })
// console.log(hasNeedReport, 'hasNeedReport')
// let nowDate = new Date().format('yyyy-MM-dd')
// let num = 0
// if (dateStaffPop?.date && nowDate == dateStaffPop?.date) {
// num = dateStaffPop?.num || 0
// num = num + 1
// } else {
// num = num + 1
// }
// // num <= 2
// if (hasNeedReport) {
// // if (num <= 2) {
// // wx.$util.showToast('驻店日报未填写,请及时填写')
// if (wx.__HAS_NOREPORT_MODAL || wx.__HAS_NOTLOGIN_MODAL) return false
// wx.__HAS_NOREPORT_MODAL = true
// wx.showModal({
// title: '日报提醒',
// content: '您有未填写的日报,请点击前往。',
// showCancel: false,
// // cancelText: '取消', // '取消
// cancelColor: '#292D33',
// confirmText: '前往填写',
// confirmColor: '#347BFF',
// success(res) {
// if (res.confirm) {
// wx.$router.go('tabWorkOrder.staffDaily', {
// reportDate: hasNeedReport.date
// })
// }
// },
// complete: () => {
// // 这个延迟的目的是为了避免短时间内重复弹出
// // 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
// setTimeout(() => {
// wx.__HAS_NOREPORT_MODAL = false
// }, 2000)
// }
// })
// }
// let num = hasNeedReport ? dateStaffPop?.num + 1 : dateStaffPop?.num
// console.log(num)
// wx.$storage.set('dateStaffPop', {
// date: new Date().format('yyyy-MM-dd'),
// num
// })
// console.log(hasNeedReport, 'hasNeedReport')
// this.setData({
// weeklyList: data,
// timeBean
// })
// } else {
// wx.$util.showToast(message)
// }
// })
}, },
checkDailyRecport() { // 检测一下是否能微信端小程序登录
checkAgreeClient(loginUserObj) {
return new Promise((resolve, reject) => {
let sysInfo = wx.getSystemInfoSync()
// let { environment } = sysInfo
// 1企业微信 0微信
let envName = sysInfo.environment ? 1 : 0
let { merchantId: yqMerchantId } = loginUserObj
api.getYqStoreConfig({ yqMerchantId }).then(res => {
let {
code,
data: { loginControlList = [] }
} = res
if (code == '0') {
// const loginControlList = []
// const loginControlList = [0, 1]
if (loginControlList.includes(envName)) {
resolve(true)
} else {
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: `请在${envName == 0 ? '企业微信' : '微信'}中打开`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
wx.$router.go('pages.accountItems')
}
}
})
resolve(false)
}
}
})
})
},
async checkDailyRecport() {
let { tabIndex } = this.data let { tabIndex } = this.data
const isStaff = app.globalData.isStaff const isStaff = app.globalData.isStaff
// 如果是员工 判读是否要填写日报 // 如果是员工 判读是否要填写日报
isStaff && tabIndex == 0 && this.staffDailyReport(wx.$util.getUserInfo()) isStaff && tabIndex == 0 && this.staffDailyReport(wx.$util.getUserInfo())
if (tabIndex == 0) {
// let checkAgreeClient = await
this.checkAgreeClient(wx.$util.getUserInfo())
// if (!checkAgreeClient) return
}
}, },
getMerchant4SMode() { getMerchant4SMode() {
let storeInfo = wx.$util.getUserInfo()?.default4SStoreInfo || {} let storeInfo = wx.$util.getUserInfo()?.default4SStoreInfo || {}
...@@ -425,7 +384,7 @@ Page({ ...@@ -425,7 +384,7 @@ Page({
.catch(err => { }) .catch(err => { })
} }
}, },
onRoute(options) { onRoute(options) {
console.log(options, 'options') console.log(options, 'options')
if (options && options.tabIndex) { if (options && options.tabIndex) {
......
...@@ -11,7 +11,7 @@ Component({ ...@@ -11,7 +11,7 @@ Component({
if (n) { if (n) {
// this.getOrderBaseGoodsList(n) // this.getOrderBaseGoodsList(n)
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
thisPage.getQuotationInfo() thisPage.getQuotationInfo(true)
} }
} }
}, },
......
...@@ -152,7 +152,7 @@ const firstObj = { ...@@ -152,7 +152,7 @@ const firstObj = {
name: 'city', name: 'city',
labelName: 'city', labelName: 'city',
type: 'region', type: 'region',
columnsNum:'2', columnsNum: '2',
placeholder: '点击选择(非必填)', placeholder: '点击选择(非必填)',
configItem: true configItem: true
}, },
...@@ -170,7 +170,7 @@ const firstObj = { ...@@ -170,7 +170,7 @@ const firstObj = {
maxlength: '200', maxlength: '200',
fieldType: 'textarea', fieldType: 'textarea',
configItem: true, configItem: true,
noCellHeight: true, // noCellHeight: false,
}, },
{ {
label: '陪伴人员', label: '陪伴人员',
...@@ -179,7 +179,7 @@ const firstObj = { ...@@ -179,7 +179,7 @@ const firstObj = {
maxlength: '200', maxlength: '200',
fieldType: 'textarea', fieldType: 'textarea',
configItem: true, configItem: true,
noCellHeight: true, // noCellHeight: false,
}, },
], ],
carFormList: [ carFormList: [
...@@ -197,35 +197,35 @@ const firstObj = { ...@@ -197,35 +197,35 @@ const firstObj = {
configItem: true configItem: true
}, },
{ {
label: '车架号', label: '车架号',
name: 'carVin', name: 'carVin',
type: 'input', type: 'input',
maxlength: '17', maxlength: '17',
required: true, required: true,
requiredAfter: true requiredAfter: true
}, },
{ {
label: '座位数', label: '座位数',
name: 'seat', name: 'seat',
labelName: 'seat', labelName: 'seat',
type: 'select', type: 'select',
optionList: constantList.seatesList, optionList: constantList.seatesList,
optionId: 'optionId', optionId: 'optionId',
optionLabel: 'optionLabel' optionLabel: 'optionLabel'
}, },
{ {
label: '车辆发票价', label: '车辆发票价',
name: 'price', name: 'price',
type: 'input', type: 'input',
fieldType: 'digit', fieldType: 'digit',
maxlength: '8', maxlength: '8',
required: true, required: true,
requiredAfter: true, requiredAfter: true,
labelWidth: 80, labelWidth: 80,
inputLimit: { inputLimit: {
maxVal: 2000000 maxVal: 2000000
}
} }
}
] ]
} }
const firstObjSimple = { const firstObjSimple = {
...@@ -270,7 +270,7 @@ const firstObjSimple = { ...@@ -270,7 +270,7 @@ const firstObjSimple = {
name: 'city', name: 'city',
labelName: 'city', labelName: 'city',
type: 'region', type: 'region',
columnsNum:'2', columnsNum: '2',
placeholder: '点击选择(非必填)', placeholder: '点击选择(非必填)',
configItem: true configItem: true
}, },
...@@ -288,7 +288,7 @@ const firstObjSimple = { ...@@ -288,7 +288,7 @@ const firstObjSimple = {
maxlength: '200', maxlength: '200',
fieldType: 'textarea', fieldType: 'textarea',
configItem: true, configItem: true,
noCellHeight: true, // noCellHeight: true,
}, },
{ {
label: '陪伴人员', label: '陪伴人员',
...@@ -297,7 +297,7 @@ const firstObjSimple = { ...@@ -297,7 +297,7 @@ const firstObjSimple = {
maxlength: '200', maxlength: '200',
fieldType: 'textarea', fieldType: 'textarea',
configItem: true, configItem: true,
noCellHeight: true, // noCellHeight: true,
}, },
], ],
carFormList: [ carFormList: [
...@@ -315,36 +315,36 @@ const firstObjSimple = { ...@@ -315,36 +315,36 @@ const firstObjSimple = {
configItem: true configItem: true
}, },
{ {
label: '车架号', label: '车架号',
name: 'carVin', name: 'carVin',
type: 'input', type: 'input',
maxlength: '17', maxlength: '17',
// required:true, // required:true,
// requiredAfter:true // requiredAfter:true
}, },
{ {
label: '座位数', label: '座位数',
name: 'seat', name: 'seat',
labelName: 'seat', labelName: 'seat',
type: 'select', type: 'select',
optionList: constantList.seatesList, optionList: constantList.seatesList,
optionId: 'optionId', optionId: 'optionId',
optionLabel: 'optionLabel' optionLabel: 'optionLabel'
}, },
{ {
label: '车辆发票价', label: '车辆发票价',
name: 'price', name: 'price',
type: 'input', type: 'input',
fieldType: 'digit', fieldType: 'digit',
maxlength: '8', maxlength: '8',
required: true, required: true,
requiredAfter: true, requiredAfter: true,
labelWidth: 80, labelWidth: 80,
inputLimit: { inputLimit: {
maxVal: 2000000 maxVal: 2000000
}
// fieldType: 'digit'
} }
// fieldType: 'digit'
}
] ]
} }
const optionsSelect = { const optionsSelect = {
......
...@@ -8,7 +8,8 @@ import { ...@@ -8,7 +8,8 @@ import {
quotationGoodsList, quotationGoodsList,
quotationRecording, quotationRecording,
errorOrderById, errorOrderById,
staffDailyReportMerchantValid staffDailyReportMerchantValid,
updateOrderStatus
} from '../../../api' } from '../../../api'
import { quotedImgUrl } from '~/config' import { quotedImgUrl } from '~/config'
import NP from 'number-precision' import NP from 'number-precision'
...@@ -521,6 +522,8 @@ Page({ ...@@ -521,6 +522,8 @@ Page({
// ...insuranceTypeObj // ...insuranceTypeObj
}) })
// this.getQuotationInfo() // this.getQuotationInfo()
// 判断有没有勾选商品,有的话调用一下
orderInfo.vdQuotationGoodsList.length && this.totalFee()
} }
}) })
.catch(err => { }) .catch(err => { })
...@@ -570,6 +573,29 @@ Page({ ...@@ -570,6 +573,29 @@ Page({
} }
return obj return obj
}, },
updateOrderStatus() {
return new Promise((resolve, reject) => {
let { orderInfo } = this.data
updateOrderStatus({
id: orderInfo.id,
orderStatus: 0,
}).then(res => {
let {
code,
message
} = res
if (code == 0) {
resolve(true)
// wx.$util.showToast('提交成功')
// this.onLoad()
} else {
wx.$util.showToast(message)
}
})
})
},
// 不需要检验 存草稿 // 不需要检验 存草稿
async handleEditSave() { async handleEditSave() {
let { owner, orderInfo, saveStatus } = this.data let { owner, orderInfo, saveStatus } = this.data
...@@ -589,6 +615,11 @@ Page({ ...@@ -589,6 +615,11 @@ Page({
this.setData({ this.setData({
orderInfo orderInfo
}) })
// if (orderInfo.orderStatus == -1) {
// await this.updateOrderStatus()
// }
let res = await this.handleSecondConfirmCheck(false) let res = await this.handleSecondConfirmCheck(false)
this.setData({ this.setData({
saveStatus: false saveStatus: false
...@@ -605,11 +636,12 @@ Page({ ...@@ -605,11 +636,12 @@ Page({
}, },
resetGoods() { resetGoods() {
this.setData({ this.setData({
['orderInfo.vdQuotationGoodsList']: [] ['orderInfo.vdQuotationGoodsList']: [],
['orderInfo.quotationGoodsInfoList']: []
}) })
this.getQuotationInfo() this.getQuotationInfo(true) // 不重新调用详情接口 避免修改车辆价格导致重新获取详情 把数据重置了
}, },
getQuotationInfo() { getQuotationInfo(getOrderInfo) {
let { default4SStoreInfo } = wx.$util.getUserInfo() let { default4SStoreInfo } = wx.$util.getUserInfo()
// console.log(default4SStoreInfo, 'default4SStoreInfo') // console.log(default4SStoreInfo, 'default4SStoreInfo')
// debugger // debugger
...@@ -679,13 +711,13 @@ Page({ ...@@ -679,13 +711,13 @@ Page({
// 判断有没有勾选商品,有的话调用一下 // 判断有没有勾选商品,有的话调用一下
orderInfo.vdQuotationGoodsList.length && this.totalFee() orderInfo.vdQuotationGoodsList.length && this.totalFee()
// 获取订单详情 // 获取订单详情
if (id) { if (id && !getOrderInfo) {
this.getOrderInfo() this.getOrderInfo()
} }
}) })
.catch(err => { .catch(err => {
// 获取订单详情 // 获取订单详情
if (id) { if (id && !getOrderInfo) {
this.getOrderInfo() this.getOrderInfo()
} }
}) })
......
...@@ -33,8 +33,8 @@ Page({ ...@@ -33,8 +33,8 @@ Page({
id ? this.qrCodeScene(id) : this.getListSelectAccount() id ? this.qrCodeScene(id) : this.getListSelectAccount()
}, },
async getSceneArr(yqMerchantId, loginUserObj) { async getSceneArr(yqMerchantId, loginUserObj) {
// let checkAgree = await this.checkAgree() let checkAgree = await this.checkAgree()
// if (!checkAgree) return false if (!checkAgree) return false
// 超管开通全部场景 // 超管开通全部场景
if (loginUserObj?.isSuper) return if (loginUserObj?.isSuper) return
// 获取4s店关联场景数据 // 获取4s店关联场景数据
......
...@@ -417,8 +417,8 @@ Page({ ...@@ -417,8 +417,8 @@ Page({
}) })
}, },
async getYqMerchantSceneConfig(loginUserObj, num) { async getYqMerchantSceneConfig(loginUserObj, num) {
// let checkAgreeClient = await this.checkAgreeClient(loginUserObj) let checkAgreeClient = await this.checkAgreeClient(loginUserObj)
// if (!checkAgreeClient) return wx.$router.go('pages.accountItems') if (!checkAgreeClient) return wx.$router.go('pages.accountItems')
// num 0已选园区店、4s店和场景 1已选园区店、4s店 2仅选择园区店 // num 0已选园区店、4s店和场景 1已选园区店、4s店 2仅选择园区店
let pageUrl = ['pages.loading', 'pages.sceneIndex', 'pages.merchantList'] let pageUrl = ['pages.loading', 'pages.sceneIndex', 'pages.merchantList']
let { shopMerchantId, shopMerchantName } = loginUserObj let { shopMerchantId, shopMerchantName } = loginUserObj
......
// tabIndex/pages/index/index.js // tabIndex/pages/index/index.js
import mixins from './index_mixins' import mixins from './index_mixins'
import api from '../../api.js' import api from '../../api.js'
import apiCom from '~/api/api.js'
import NP from 'number-precision' import NP from 'number-precision'
import { getYQInfo, get4SStoreList, getBusinessSchoolScene } from '~/store/index' import { getYQInfo, get4SStoreList, getBusinessSchoolScene } from '~/store/index'
import { env } from '~/config' import { env } from '~/config'
...@@ -676,11 +677,52 @@ Page({ ...@@ -676,11 +677,52 @@ Page({
}) })
} }
}, },
checkDailyRecport() { // 检测一下是否能微信端小程序登录
checkAgreeClient(loginUserObj) {
return new Promise((resolve, reject) => {
let sysInfo = wx.getSystemInfoSync()
// let { environment } = sysInfo
// 1企业微信 0微信
let envName = sysInfo.environment ? 1 : 0
let { merchantId: yqMerchantId } = loginUserObj
apiCom.getYqStoreConfig({ yqMerchantId }).then(res => {
let {
code,
data: { loginControlList = [] }
} = res
if (code == '0') {
// const loginControlList = []
// const loginControlList = [0, 1]
if (loginControlList.includes(envName)) {
resolve(true)
} else {
wx.hideLoading()
wx.showModal({
title: '温馨提示',
content: `请在${envName == 0 ? '企业微信' : '微信'}中打开`,
showCancel: false,
confirmText: '知道了',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) {
wx.$router.go('pages.accountItems')
}
}
})
resolve(false)
}
}
})
})
},
async checkDailyRecport() {
// let { tabIndex } = this.data // let { tabIndex } = this.data
const isStaff = app.globalData.isStaff const isStaff = app.globalData.isStaff
// 如果是员工 判读是否要填写日报 // 如果是员工 判读是否要填写日报
isStaff && this.staffDailyReport(wx.$util.getUserInfo()) isStaff && this.staffDailyReport(wx.$util.getUserInfo())
// let checkAgreeClient = await
this.checkAgreeClient(wx.$util.getUserInfo())
// if (!checkAgreeClient) return wx.$router.go('pages.accountItems')
}, },
onRoute(options) { onRoute(options) {
options && this.checkShowOrderPop(options) options && this.checkShowOrderPop(options)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</view> </view>
</view> </view>
</navigation-bar> </navigation-bar>
<view style="margin-top:{{ statusBarHeight }}px"> <view style="margin-top:{{ statusBarHeight }}px">
<weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar> <weekCalendar timeBean="{{ timeBean }}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar>
</view> </view>
<view class="main {{ isFullSucreen?'isFullSucreen':'' }}"> <view class="main {{ isFullSucreen?'isFullSucreen':'' }}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!