Commit b7fd9af3 by cen

Merge branch 'V4.56.0' of http://192.168.3.233:8090/glsx/gl_tape into V4.56.0

2 parents 1cf8281a 594c7e74

148 KB | W: | H:

82 KB | W: | H:

assets/images/common/warning-notice.png
assets/images/common/warning-notice.png
assets/images/common/warning-notice.png
assets/images/common/warning-notice.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
} }
]), ]),
loadComplete: false, loadComplete: false,
requested: false requested: false
} }
}, },
onBackPress (options) { onBackPress (options) {
...@@ -222,9 +222,9 @@ export default { ...@@ -222,9 +222,9 @@ export default {
}, },
// 查询素材 // 查询素材
async getSoure () { async getSoure () {
let baseConfigData = await uni.$api.systemApi.getBoutiqueMockData(true), let baseConfigData = await uni.$api.systemApi.getBoutiqueMockData(true),
{moduleList, toolList, defaultCarId } = baseConfigData { moduleList, toolList, defaultCarId } = baseConfigData
this.$store.state.boutique.baseConfigData = baseConfigData this.$store.state.boutique.baseConfigData = baseConfigData
this.moduleList = moduleList this.moduleList = moduleList
this.toolList = toolList this.toolList = toolList
this.defaultCarId = defaultCarId this.defaultCarId = defaultCarId
...@@ -327,9 +327,12 @@ export default { ...@@ -327,9 +327,12 @@ export default {
/**客户邀约接待 */ /**客户邀约接待 */
reception (customer) { reception (customer) {
this.currentCarId = '' this.currentCarId = ''
this.$nextTick(() => { this.$nextTick(async () => {
let { customerType } = this let { customerType } = this
if (customerType == -1) this.start(false) //开始接待 if (customerType == -1) {
const flag = await this.start(false)
if (!flag) return
} //开始接待
this.customerType = 0 this.customerType = 0
this.jumpPage() this.jumpPage()
this.$nextTick(() => this.$store.dispatch('setCustomerInfo', customer)) this.$nextTick(() => this.$store.dispatch('setCustomerInfo', customer))
......
<template> <template>
<!-- :key="dateKey" --> <!-- -->
<view class="daily-report"> <view class="daily-report">
<view class="common-title">填写日报</view> <view class="common-title">填写日报</view>
<scroll-view <scroll-view
:class="['repoet-view',{full:!orderObj.isDateWithin7Days}]" :class="['repoet-view',{full:!orderObj.isDateWithin7Days}]"
scroll-y scroll-y
:scroll-into-view="to"
@scroll="to = ''"
> >
<template v-if="loadComplete"> <view
<view class="box"> class="repoet-box"
<view class="sub-title">轻改日报</view> :key="dateKey"
>
<template v-for="(i,index) in formObject.report"> <template v-if="loadComplete">
<view <view class="box">
class="form-item flex" <view class="sub-title">轻改日报</view>
:key="index"
> <template v-for="(i,index) in reportObject">
<view class="label flex">
{{i.label}}
<template v-if="i.required">
<view class="required">*</view>
</template>
</view>
<view class="value flex">
<template v-if="i.type == 'input'">
<input
class="input"
:type="i.inputType || 'text'"
:value="orderObj[i.value]"
:placeholder="i.placeholder || '请输入'"
placeholder-class="placeholder"
@blur="handleBlur($event, i)"
:disabled="filterDisabled(isEditReport)"
>
</template>
<template v-else-if="i.type == 'picker'">
<picker
class="picker flex"
:value="orderObj[i.value]"
:range="i.range"
:range-key="i.rangeKey"
@change="orderObj[i.value] = $event.detail.value"
:disabled="filterDisabled(isEditReport)"
>
{{i.range[orderObj[i.value]][i.rangeKey] || ''}}
<uni-icons
type="right"
:size="16"
color="#999"
class="arrow"
></uni-icons>
</picker>
</template>
<template v-else>
{{orderObj[i.value]}}
</template>
</view>
</view>
</template>
</view>
<view class="box">
<view class="sub-title">其他信息</view>
<view class="form-item flex">
<view class="label flex">
备注
</view>
<view class="value">
<input
class="input"
type="text"
v-model="orderObj.remark"
placeholder-class="placeholder"
placeholder="请输入 (500字以内)"
:maxlength="500"
:disabled="filterDisabled(isEditReport)"
>
</view>
</view>
</view>
<template v-for="(item,index) in carBandList">
<view
class="box"
:key="index"
>
<view class="sub-title flex">
{{title(item)}}
<view
class="staff-name"
v-if="orderObj.staffName && index == 0"
>{{orderObj.staffName}}</view>
</view>
<template v-for="(i,ind) in filterTemplateList">
<view <view
:class="['form-item flex',{name:i.name}]" class="form-item flex"
:key="ind" :key="index"
:id="i.refId || ''"
> >
<template v-if="i.name"> <view class="label flex">
个人相关 {{i.label}}
</template> <template v-if="index != 0 || (i.required && orderObj.pickerValue == 0)">
<template v-else> <view class="required">*</view>
<view class="label flex"> </template>
{{i.label}} </view>
<template v-if="i.required"> <view class="value flex">
<view class="required">*</view> <template v-if="i.type == 'input'">
</template>
</view>
<view class="value flex">
<input <input
class="input" class="input"
:type="i.type || 'text'" :type="i.inputType || 'text'"
:value="item[i.key]" :value="orderObj[i.value]"
:placeholder="i.inputPlaceholder || '请输入'" :placeholder="i.placeholder || '请输入'"
placeholder-class="placeholder" placeholder-class="placeholder"
@blur="handleCarInputBlur($event, i , item)" @blur="handleBlur($event, i)"
:disabled="filterDisabled(isEditReport) || i.disabled" :disabled="filterDisabled(isEditReport)"
>
</template>
<template v-else-if="i.type == 'picker'">
<picker
class="picker flex"
:value="orderObj[i.value]"
:range="i.range"
:range-key="i.rangeKey"
@change="orderObj[i.value] = $event.detail.value"
:disabled="filterDisabled(isEditReport)"
> >
</view> {{i.range[orderObj[i.value]][i.rangeKey] || ''}}
</template> <uni-icons
type="right"
:size="16"
color="#999"
class="arrow"
></uni-icons>
</picker>
</template>
<template v-else>
{{orderObj[i.value]}}
</template>
</view>
</view> </view>
</template> </template>
</view> </view>
<view class="box">
<view class="sub-title">其他信息</view>
<view class="form-item flex">
<view class="label flex">
备注
</view>
<view class="value">
<input
class="input"
type="text"
v-model="orderObj.remark"
placeholder-class="placeholder"
placeholder="请输入 (500字以内)"
:maxlength="500"
:disabled="filterDisabled(isEditReport)"
>
</view>
</view>
</view>
<template v-for="(item,index) in carBandList">
<view
class="box"
:key="index"
>
<view class="sub-title flex">
{{title(item)}}
<view
class="staff-name"
v-if="orderObj.staffName && index == 0"
>{{orderObj.staffName}}</view>
</view>
<template v-for="(i,ind) in filterTemplateList">
<view
:class="['form-item flex',{name:i.name}]"
:key="ind"
:id="i.refId ? `${i.refId}_${index}` : ''"
>
<template v-if="i.name">
个人相关
</template>
<template v-else>
<view class="label flex">
{{i.label}}
<template v-if="i.required && orderObj.pickerValue == 0">
<view class="required">*</view>
</template>
</view>
<view class="value flex">
<input
class="input"
:type="i.type || 'text'"
:value="item[i.key]"
:placeholder="i.inputPlaceholder || '请输入'"
placeholder-class="placeholder"
@blur="handleCarInputBlur($event, i , item)"
:disabled="filterDisabled(isEditReport) || i.disabled"
>
</view>
</template>
</view>
</template>
</view>
</template>
</template> </template>
</template> </view>
</scroll-view> </scroll-view>
<template v-if="orderObj.isDateWithin7Days"> <template v-if="orderObj.isDateWithin7Days">
<view class="btn-box flex"> <view class="btn-box flex">
...@@ -151,10 +161,12 @@ ...@@ -151,10 +161,12 @@
</view> </view>
</template> </template>
<NoticePopup <NoticePopup
ref="notice" ref="reportNotice"
title="提交成功" title="提交成功"
text="您的日报已提交成功" text="您的日报已提交成功"
type="success" type="success"
:buttons="buttons"
@buttonClick="back"
></NoticePopup> ></NoticePopup>
</view> </view>
</template> </template>
...@@ -178,38 +190,39 @@ export default { ...@@ -178,38 +190,39 @@ export default {
name: 'DailyReport', name: 'DailyReport',
data () { data () {
return { return {
to: '',
dateKey: Date.now(), dateKey: Date.now(),
loadComplete: false, loadComplete: false,
formObject: { reportObject: Object.freeze([
report: [ {
{ label: '今日驻店人数(按店)',
label: '今日驻店人数(按店)', value: 'staffCount',
value: 'staffCount', type: 'input',
type: 'input', required: true,
required: true, inputType: 'number',
inputType: 'number' refId: 'staffCount'
}, },
{ {
label: '当日调休', label: '当日调休',
value: 'pickerValue', value: 'pickerValue',
type: 'picker', type: 'picker',
required: true, required: true,
rangeKey: 'name', rangeKey: 'name',
range: [ range: [
{ id: 'N', name: '否' }, { id: 'N', name: '否' },
{ id: 'Y', name: '是' } { id: 'Y', name: '是' }
] ]
}, },
{ {
label: '个人成交总金额', label: '个人成交总金额',
value: 'totalOrderMoney', value: 'totalOrderMoney',
}, required: true,
},
] ]),
},
orderObj: {}, orderObj: {},
carBandList: [], carBandList: [],
hwOhterObjArray: [ hwOhterObjArray: Object.freeze([
{ {
label: '店端实际交车数', label: '店端实际交车数',
key: 'deliveryCount', key: 'deliveryCount',
...@@ -217,6 +230,7 @@ export default { ...@@ -217,6 +230,7 @@ export default {
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
refId: 'deliveryCount'
}, },
{ {
label: '店端总未触客数', label: '店端总未触客数',
...@@ -225,6 +239,7 @@ export default { ...@@ -225,6 +239,7 @@ export default {
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
refId: 'notDeliveryCount'
}, },
{ {
label: '实际售前触客数', label: '实际售前触客数',
...@@ -233,7 +248,8 @@ export default { ...@@ -233,7 +248,8 @@ export default {
required: true, required: true,
min: 0, min: 0,
max: 100, max: 100,
inputPlaceholder: '' inputPlaceholder: '',
refId: 'equityToShopCount'
}, },
{ {
label: '实际售后触客数', label: '实际售后触客数',
...@@ -257,9 +273,15 @@ export default { ...@@ -257,9 +273,15 @@ export default {
disabled: true, disabled: true,
inputPlaceholder: '自动填入系统数据' inputPlaceholder: '自动填入系统数据'
} }
], ]),
weeklyList: [], weeklyList: [],
isEditReport: false isEditReport: false,
buttons: Object.freeze([
{
text: '返回首页',
type: 'primary'
}
])
} }
}, },
computed: { computed: {
...@@ -291,18 +313,18 @@ export default { ...@@ -291,18 +313,18 @@ export default {
}, },
currentDate: { currentDate: {
handler (val) { handler (val) {
this.getStaffDailyReportDetail() if (this.carBandList.length) this.getStaffDailyReportDetail()
// console.log(val)
}, },
deep: true, deep: true,
// immediate: true
} }
}, },
mounted () { mounted () {
this.initData() this.initData()
this.getDailyReportCarBrand()
}, },
methods: { methods: {
back () {
uni.navigateBack()
},
initData () { initData () {
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo
this.orderObj = { this.orderObj = {
...@@ -313,7 +335,7 @@ export default { ...@@ -313,7 +335,7 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
merchantName: shopMerchantName merchantName: shopMerchantName
} }
this.getStaffDailyReportDetail() this.getDailyReportCarBrand()
}, },
async getDailyReportCarBrand () { async getDailyReportCarBrand () {
let { userInfo } = this, let { userInfo } = this,
...@@ -323,7 +345,7 @@ export default { ...@@ -323,7 +345,7 @@ export default {
sceneType: 1 sceneType: 1
}) })
this.carBandList = data this.carBandList = data
console.log(this.carBandList) this.getStaffDailyReportDetail()
}, },
setMonthDay () { setMonthDay () {
let { mouthNumber } = this, let { mouthNumber } = this,
...@@ -388,6 +410,9 @@ export default { ...@@ -388,6 +410,9 @@ export default {
hwOhterObjArray, hwOhterObjArray,
orderObj } = this, orderObj } = this,
{ shopMerchantId, merchantId, uuid } = userInfo { shopMerchantId, merchantId, uuid } = userInfo
uni.showLoading({
mask: true
})
const data = await uni.$api.boutiqueApi.getStaffDailyReportDetail({ const data = await uni.$api.boutiqueApi.getStaffDailyReportDetail({
yqMerchantId: merchantId, yqMerchantId: merchantId,
merchantId: shopMerchantId, merchantId: shopMerchantId,
...@@ -396,6 +421,7 @@ export default { ...@@ -396,6 +421,7 @@ export default {
sceneType: 1, sceneType: 1,
reportTypeList: [-1] reportTypeList: [-1]
}) })
uni.hideLoading()
let { brandDataList, remark } = data let { brandDataList, remark } = data
if (brandDataList && brandDataList.length) { if (brandDataList && brandDataList.length) {
carBandList = carBandList.map(item => { carBandList = carBandList.map(item => {
...@@ -459,7 +485,7 @@ export default { ...@@ -459,7 +485,7 @@ export default {
staffCountError: false, staffCountError: false,
} }
this.loadComplete = true this.loadComplete = true
this.dateKey = Date.now()
}, },
title (item) { title (item) {
let title = '' let title = ''
...@@ -502,12 +528,35 @@ export default { ...@@ -502,12 +528,35 @@ export default {
item.equityToShopCount = item.equityToShopCount || 0 item.equityToShopCount = item.equityToShopCount || 0
}) })
} }
if (orderObj.pickerValue == 0) {
if (orderObj.staffCount == null) throw {
message: '今日驻店人数(按店)',
refId: 'staffCount'
}
orderObj.brandDataList.map((e, index) => {
if (e.deliveryCount == null) throw { message: '店端实际交车数', refId: `deliveryCount_${index}` }
if (!e.notDeliveryCount == null) throw { message: '店端总未触客数', refId: `notDeliveryCount_${index}` }
if (!e.equityToShopCount == null) throw { message: '实际售前触客数', refId: `equityToShopCount_${index}` }
})
}
const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj) const data = await uni.$api.boutiqueApi.saveStaffDailyReport(orderObj)
if (data) { if (data) {
this.isEditReport = false this.isEditReport = false
this.$refs.notice.open() this.$refs.reportNotice.open()
} }
} catch (error) { } catch (errorObj) {
console.log(errorObj)
if (errorObj.message) {
uni.showToast({
title: `${errorObj.message}不能为空`,
icon: 'none'
})
this.to = errorObj.refId
} else uni.showToast({
title: typeof errorObj == 'string' ? errorObj : errorObj.toString(),
icon: 'none'
})
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!