Commit 1f605298 by 李伟康

feat(dailyReport): 重构日报系统并新增多项功能

- 修改环境配置将默认索引从2改为1,更新IP地址配置
- 新增日报模板API接口包括新版本检查、月度待邀约数、草稿保存等功能
- 重构入口组件实现动态获取入口列表并根据用户场景过滤显示
- 优化日报页面结构支持多种日报类型并新增洽谈明细编辑功能
- 添加日报详情页面支持查看历史记录和当前填写状态
- 新增日报组件混合类封装通用的数据处理和验证逻辑
- 优化洽谈明细编辑页面支持表格数据编辑和保存功能
- 调整日报页面UI样式和布局提升用户体验和交互效果
1 parent 00dbb88a
import http from '../request/http'
import { env } from '../../env'
const ENV = env == 'ip' ? 'develop' : env,
configUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?env=${ENV}`
/**
*
* @param {*} templateType 1: 驻店 2:门店 3:洽谈
......@@ -33,7 +35,7 @@ const getReportList = async (data = {}) => {
method: 'dj.api.smartcarlife.dailyReport.weekly.list',
projectName: 'boutique',
...data
})
}, false, 'ip')
}
/**
查询日报详情
......@@ -43,12 +45,78 @@ const getReportDetail = async (data = {}) => {
method: 'dj.api.smartcarlife.dailyReport.detail.get',
projectName: 'boutique',
...data
})
}, false, 'ip')
}
/**
是否需要新版本日报填报
*/
const isNewVersionNeed = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.new.version.isNeed',
projectName: 'boutique',
...data
}, false, 'ip')
}
/**
查询门店日报本月待邀约数
*/
const getMonthlyPendingCount = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.monthly.pending.count',
projectName: 'boutique',
...data
}, false, 'ip')
}
/**
查询洽谈明细驻店人员名单
*/
const getDiscussionStaffList = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.discussion.staff.list',
projectName: 'boutique',
...data
}, false, 'ip')
}
/**
日报草稿数据保存
*/
const saveDraft = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.dynamic.draft.save',
projectName: 'boutique',
...data
}, false, 'ip')
}
/**
日报数据提交
*/
const submitReport = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.dailyReport.dynamic.save',
projectName: 'boutique',
...data
}, false, 'ip')
}
/**
* 当前门店驻店人员在选中成交日期交付的延保及权益订单
*/
const getGoodsOrderList = async (data = {}) => {
return http.post({
method: 'dj.api.smartcarlife.goodsOrder.product.outputValue.list',
projectName: 'boutique',
...data
}, false, 'ip')
}
module.exports = {
getDailyTemplate,
getReportList,
getReportDetail
getReportDetail,
isNewVersionNeed,
getMonthlyPendingCount,
saveDraft,
getDiscussionStaffList,
submitReport,
getGoodsOrderList
}
......@@ -5,7 +5,7 @@ const HOST = {
scrm: domain,
dj: djDomain,
merchant: merchantDomain,
ip: 'http://192.168.1.125:8080'
ip: 'http://192.168.1.96:8292'
}
/** 接口 message 转可展示的 Toast 文案(非字符串、过长在部分端上会导致不弹提示) */
......
......@@ -42,125 +42,17 @@ export default {
// 工资申诉入口是否允许显示
wageAppealAllowed: false,
// 工资申诉入口加载中,加载完成前不展示避免误显示
loadingEntrance: true
loadingEntrance: true,
entranceList: []
}
},
created () {
this.getEntranceList()
// 组件创建时请求工资申诉入口权限
this.fetchWageAppealEntrance()
},
computed: {
entranceList () {
let { sceneType } = uni.$storage.get('userInfo') || {},
entranceList = [
{
icon: 'daily-report',
label: '驻店日报',
name: 'DailyReport',
sceneType: [0, 1, 7],
noInterception:true
},
{
icon: 'create-order',
label: '新建工单',
name: 'CreateOrder',
sceneType: [0, 1]
},
{
icon: 'equity-order',
label: '权益提单',
name: 'EquityManagement',
sceneType: [0]
},
{
icon: 'defeat-order',
label: '战败下单',
name: 'DefeatOrder',
sceneType: [0, 1]
},
{
icon: 'order-management',
label: '工单列表',
name: 'OrderManagement',
sceneType: [0, 1]
},
{
icon: 'wage-appeal',
label: '工资申诉',
name: 'WageAppeal',
sceneType: [0, 1],
noInterception:true
},
{
icon: 'evaluation-management',
label: '评估单管理',
name: 'EvaluationFormList',
sceneType: [7]
},
{
icon: 'carInfoIcon',
label: '车况信息',
name: 'CarConditionInfo',
page: '/pages/usedCar/inspectionReport/index?h5Entry=carInfo',
sceneType: [7]
},
{
icon: 'delivery-management',
label: '交付管理',
name: 'DeliveryManagement',
page: '/pages/usedCar/deliveryManagement/index',
sceneType: [7],
checkDailyReport:false
},
{
icon: 'report-management',
label: '报告管理',
name: 'ReportManagement',
page: '/pages/usedCar/reportManagement/index',
sceneType: [7],
checkDailyReport:false
},
{
icon: 'report',
label: '检测管理',
name: 'InspectionReport',
page: '/pages/usedCar/inspectionReport/index',
sceneType: [7],
noInterception:true
},
{
icon: 'daily-report',
label: '驻店日报 (新)',
page: '/pages/common/dailyNewspaper/index',
name: 'staffDailyReport',
sceneType: [0, 1],
noInterception:true
},
{
icon: 'store-daily-report',
label: '门店日报',
name: 'storeDailyReport',
page: '/pages/common/dailyNewspaper/index',
sceneType: [0, 1],
noInterception:true
},
{
icon: 'negotiation-detail',
name: 'NegotiationDetailList',
label: '洽谈明细',
page: '/pages/common/dailyNewspaper/index',
sceneType: [0, 1],
noInterception:true
},
]
// 先根据场景过滤
let list = entranceList.filter(e => e.sceneType.includes(sceneType))
// 加载阶段或不允许显示时,移除工资申诉入口
if (this.loadingEntrance || !this.wageAppealAllowed) {
list = list.filter(e => e.name !== 'WageAppeal')
}
return list
}
},
methods: {
// 请求工资申诉入口权限,并设置显示开关
......@@ -195,6 +87,121 @@ export default {
handleClick (item) {
// 这里可以根据实际需求进行跳转或功能处理
this.$emit('entranceClick', item)
},
isNewVersionNeed (merchantId) {
return uni.$api.dailyTemplateApi.isNewVersionNeed({ merchantId })
},
async getEntranceList () {
let entranceList = [
{
icon: 'daily-report',
label: '驻店日报',
name: 'DailyReport',
sceneType: [0, 1, 7],
noInterception: true
},
{
icon: 'create-order',
label: '新建工单',
name: 'CreateOrder',
sceneType: [0, 1]
},
{
icon: 'equity-order',
label: '权益提单',
name: 'EquityManagement',
sceneType: [0]
},
{
icon: 'defeat-order',
label: '战败下单',
name: 'DefeatOrder',
sceneType: [0, 1]
},
{
icon: 'order-management',
label: '工单列表',
name: 'OrderManagement',
sceneType: [0, 1]
},
{
icon: 'wage-appeal',
label: '工资申诉',
name: 'WageAppeal',
sceneType: [0, 1],
noInterception: true
},
{
icon: 'evaluation-management',
label: '评估单管理',
name: 'EvaluationFormList',
sceneType: [7]
},
{
icon: 'carInfoIcon',
label: '车况信息',
name: 'CarConditionInfo',
page: '/pages/usedCar/inspectionReport/index?h5Entry=carInfo',
sceneType: [7]
},
{
icon: 'delivery-management',
label: '交付管理',
name: 'DeliveryManagement',
page: '/pages/usedCar/deliveryManagement/index',
sceneType: [7],
checkDailyReport: false
},
{
icon: 'report-management',
label: '报告管理',
name: 'ReportManagement',
page: '/pages/usedCar/reportManagement/index',
sceneType: [7],
checkDailyReport: false
},
{
icon: 'report',
label: '检测管理',
name: 'InspectionReport',
page: '/pages/usedCar/inspectionReport/index',
sceneType: [7],
noInterception: true
},
{
icon: 'store-daily-report',
label: '门店日报',
name: 'storeDailyReport',
page: '/pages/common/dailyNewspaper/index',
// sceneType: [0, 1],
noInterception: true
},
{
icon: 'negotiation-detail',
name: 'NegotiationDetail',
label: '洽谈明细',
page: '/pages/common/dailyNewspaper/index',
// sceneType: [0, 1],
noInterception: true
},
]
let userInfo = uni.$storage.get('userInfo'),
{ sceneType, shopMerchantId } = userInfo,
newReport = await this.isNewVersionNeed(shopMerchantId)
if (!newReport && sceneType != 7) {
entranceList[0].name = 'staffDailyReport'
entranceList[0].page = '/pages/common/dailyNewspaper/index'
entranceList.map(e => {
if (['storeDailyReport', 'NegotiationDetail'].includes(e.name)) e.sceneType = [0, 1]
})
}
// 先根据场景过滤
let list = entranceList.filter(e => e.sceneType?.includes(sceneType))
// 加载阶段或不允许显示时,移除工资申诉入口
if (this.loadingEntrance || !this.wageAppealAllowed) {
list = list.filter(e => e.name !== 'WageAppeal')
}
this.entranceList = list
}
}
}
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2
const index = 1
/**
*
0本地
......@@ -50,7 +50,7 @@ const domain = {
const djDomain = {
// ip: 'http://dj.dev.glsx.com.cn',
ip: 'http://192.168.1.104:8292',
ip: 'http://192.168.1.96:8292',
dev: 'http://dj.dev.glsx.com.cn',
beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425
uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac
......
<template>
<view class="daily-report">
<view class="common-title">
</view>
<template v-if="loadComplete">
<template v-if="list.length">
<view class="list-box">
<view class="list-title">{{ }}</view>
<view >
<Table
:columns="columns"
:data="list"
tableStyle="padding-right:32rpx"
/>
</view>
<view class="list-title">{{ }}</view>
<view >
<Table
:columns="columns"
:data="list"
tableStyle="padding-right:32rpx"
/>
</view>
</view>
</template>
<nothing v-else />
</template>
</view>
</template>
<script type='text/ecmascript-6'>
import Table from '../components/Table'
import Nothing from '../components/Nothing'
export default {
components: { Table, Nothing },
name: 'detail',
data () {
return {
columns: [
{ title: '数据1' },
{ title: '数据2' },
{ title: '数据3' },
{ title: '数据4' },
{ title: '数据5' },
{ title: '数据6' },
{ title: '数据7' },
{ title: '数据8' },
{ title: '数据9' },
{ title: '数据10' },
{ title: '数据11' },
{ title: '数据12' },
{ title: '数据13' },
{ title: '数据14' },
{ title: '数据15' },
{ title: '数据16' },
{ title: '数据17' },
{ title: '数据18' },
{ title: '数据19' },
{ title: '数据20' },
],
loadComplete: false,
list: [
{
rowHeader: '交车日期',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '部门',
data: ['3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3']
},
{
rowHeader: '推荐人',
data: ['5', '5', '5', '1', '5', '5', '4', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5']
},
{
rowHeader: '客户名称',
data: ['张三', '张三', '张三23423423234SCSDSDsdsd多少点', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三']
},
{
rowHeader: '客户电话',
data: ['12345678901', 'ddd', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', 123]
}
]
}
},
computed: {
},
mounted () {
this.loadComplete = true
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.daily-report {
height: 100%;
position: relative;
.common-title {
position: absolute;
top: 0;
left: 0;
}
.list-box {
position: absolute;
width: calc(100% - #{toRpx(96)});
height: calc(100% - #{toRpx(80)});
border-radius: 32rpx;
background: #fff;
top: 48rpx;
left: 50%;
transform: translateX(-50%);
padding: 0 0 32rpx 32rpx;
overflow-x: auto;
.list-title {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 32rpx 0 24rpx;
position: sticky;
top: 0;
z-index: 50;
background: #fff;
}
}
}
</style>
\ No newline at end of file
......@@ -46,7 +46,10 @@
</view>
<view class="footer">
<Footer>
<view class="btn">保存</view>
<view
class="btn"
@click="$emit('saveReport',list)"
>保存</view>
</Footer>
</view>
</template>
......@@ -68,7 +71,7 @@ import utils from '@/utils/utils'
import EditForm from '../components/EditForm'
export default {
components: { Table, Nothing, Footer, EditForm },
name: 'NegotiationDetailList',
name: 'edit',
inject: ['sceneType'],
props: {
templateData: {
......@@ -85,8 +88,11 @@ export default {
watch: {
templateData: {
handler (val) {
if (!this.list.length) this.list = utils.deepClone(val)
this.loadComplete = true
this.loadComplete = false
this.list = utils.deepClone(val)
setTimeout(() => {
this.loadComplete = true
}, 100)
},
immediate: true,
deep: true
......@@ -104,7 +110,7 @@ export default {
},
addItem (index) {
let { templateData } = this
this.list[index].children.push(templateData[index].children[0])
this.list[index].children.push(templateData[index].origin_children)
let data = this.list[index].children[this.list[index].children.length - 1],
c_index = this.list[index].children.length - 1,
parent = this.list[index]
......
<template>
<view class="daily-report">
<view class="common-title">
</view>
<template v-if="loadComplete">
<template v-if="list.length">
<view class="list-box">
<view class="list-title">{{ title }}</view>
<view :class="[checkTable(list)]">
<Table
:columns="columns"
:data="list"
tableStyle="padding-right:32rpx"
close
/>
</view>
<view class="list-title">{{ title }}</view>
<view :class="[checkTable(list)]">
<Table
:columns="columns"
:data="list"
tableStyle="padding-right:32rpx"
/>
</view>
</view>
</template>
<nothing v-else />
<view class="report-content ">
<template v-if="!isToday">
<Detail />
</template>
<template v-else>
<Edit
:templateData="templateData"
@saveReport="saveReport"
/>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
import Table from '../components/Table'
import Nothing from '../components/Nothing'
import mixins from '../mixins'
import Detail from './detail'
import Edit from './edit'
export default {
components: { Table, Nothing },
name: 'NegotiationDetailList',
inject: ['sceneType'],
components: { Detail, Edit },
mixins: [mixins],
name: 'NegotiationDetail',
data () {
return {
columns: [
{ title: '数据1' },
{ title: '数据2' },
{ title: '数据3' },
{ title: '数据4' },
{ title: '数据5' },
{ title: '数据6' },
{ title: '数据7' },
{ title: '数据8' },
{ title: '数据9' },
{ title: '数据10' },
{ title: '数据11' },
{ title: '数据12' },
{ title: '数据13' },
{ title: '数据14' },
{ title: '数据15' },
{ title: '数据16' },
{ title: '数据17' },
{ title: '数据18' },
{ title: '数据19' },
{ title: '数据20' },
],
loadComplete: false,
list: [
{
rowHeader: '交车日期',
data: ['XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX', 'XX']
},
{
rowHeader: '部门',
data: ['3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3', '3']
},
{
rowHeader: '推荐人',
data: ['5', '5', '5', '1', '5', '5', '4', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5']
},
{
rowHeader: '客户名称',
data: ['张三', '张三', '张三23423423234SCSDSDsdsd多少点', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三', '张三']
},
{
rowHeader: '客户电话',
data: ['12345678901', 'ddd', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', '12345678901', 123]
}
]
}
},
computed: {
title () {
let sceneName = {
0: '延保/权益',
1: '轻改'
}[this.sceneType]
return `洽谈明细 (${sceneName})`
}
},
mounted () {
this.loadComplete = true
},
methods: {
checkTable (list) {
return list.length >= 12 ? 'table-box' : ''
}
}
}
</script>
<style scoped lang='scss'>
.daily-report {
.report-content {
height: 100%;
position: relative;
.common-title {
position: absolute;
top: 0;
left: 0;
}
.list-box {
position: absolute;
width: calc(100% - #{toRpx(96)});
height: calc(100% - #{toRpx(80)});
border-radius: 32rpx;
background: #fff;
top: 48rpx;
left: 50%;
transform: translateX(-50%);
padding: 0 0 32rpx 32rpx;
overflow-x: auto;
.list-title {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 32rpx 0 24rpx;
position: sticky;
top: 0;
z-index: 50;
background: #fff;
}
}
}
</style>
\ No newline at end of file
<template>
<div>
详情
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file
<template>
<view class="daily-report">
<view class="common-title">
基础信息
</view>
<template v-if="loadComplete">
<template v-if="list.length">
<view class="daily-report-container">
<template v-for="(i,index) in list">
<view
:class="['list-item',{'block':['group','divider','textarea'].includes(i.type)},{'list-box':i.type == 'group'}]"
:key="index"
v-if="itemShow(i)"
>
<template v-if="i.type != 'group'">
<template v-if="i.type == 'divider'">
<view class="divider flex">
<view class="text">{{ i.label }}</view>
</view>
</template>
<template v-else>
<FormItem
:formItem="i"
:rules="i.rules"
@onSelect="onSelect($event, index)"
@onInput="onInput($event, index)"
:disabled="itemDisabled(i)"
/>
</template>
</template>
<template v-else>
<view class="list-title flex">
{{ i.label }}
</view>
<template v-if="i.children.length">
<template v-for="(c,c_index) in i.children">
<FormItem
class="form-item"
:formItem="c"
:key="c_index"
:rules="i.childrenRules[c.key]"
@onSelect="onSelect($event,index, c_index)"
@onInput="onInput($event, index, c_index)"
:disabled="itemDisabled(c)"
/>
</template>
</template>
</template>
</view>
</template>
</view>
<view class="footer">
<Footer>
<view class="btn">保存</view>
</Footer>
</view>
</template>
<nothing v-else />
</template>
<EditForm
ref="editForm"
@onDel="delItem"
@onConfirm="confirm"
/>
</view>
</template>
<script type='text/ecmascript-6'>
import Nothing from '../components/Nothing'
import Table from '../components/Table'
import Footer from '../components/Footer'
import utils from '@/utils/utils'
import EditForm from '../components/EditForm'
import FormItem from '../components/FormItem.vue'
export default {
name: 'StoreDailyReport',
components: { Table, Nothing, Footer, EditForm, FormItem },
props: {
templateData: {
type: Array,
default: () => []
}
},
data () {
return {
loadComplete: false,
list: []
}
},
watch: {
templateData: {
handler (val) {
this.loadComplete = false
this.list = utils.deepClone(val)
setTimeout(() => {
this.loadComplete = true
}, 100)
},
immediate: true,
deep: true
}
},
mounted () {
},
methods: {
itemShow (i) {
if (i.rules) {
let { keys, result } = i.rules,
{ list } = this
if (keys && result) {
let params = keys.map((c, index) => `val${index + 1}`),
// 将 new Function 改为 eval 方式
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = []
keys.map(key => {
let item = list.find(i => i.key == key)
if (item) value.push(item.value || null)
})
return func(...value)
} else return true
} else {
return true
}
},
handleRowClick (row, rowIndex, index) {
let parent = this.list[index]
this.$refs.editForm.open(row, rowIndex, index, parent)
},
delItem (c_index, index) {
this.list[index].children.splice(c_index, 1)
},
addItem (index) {
let { templateData } = this
this.list[index].children.push(templateData[index].children[0])
let data = this.list[index].children[this.list[index].children.length - 1],
c_index = this.list[index].children.length - 1,
parent = this.list[index]
this.$refs.editForm.open(data, c_index, index, parent)
},
confirm (data, c_index, index) {
this.$set(this.list[index].children, c_index, utils.deepClone(data))
},
onInput (val, index, c_index = -1) {
if (c_index == -1) this.$set(this.list[index], 'value', val)
else this.$set(this.list[index].children[c_index], 'value', val)
},
onSelect (val, index, c_index = -1) {
if (c_index == -1) this.$set(this.list[index], 'value', val)
else this.$set(this.list[index].children[c_index], 'value', val)
},
itemDisabled (i) {
let disabled = i.disabled
if (i.disabledFun) {
let { keys, result } = i.disabledFun,
{ list } = this,
params = keys.map((i, index) => `val${index + 1}`),
// 将 new Function 改为 eval 方式
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = []
keys.map(key => {
let item = list.find(i => i.key == key)
if (item) value.push(item.value || null)
})
return func(...value)
}
return disabled
},
}
}
</script>
<style scoped lang='scss'>
.daily-report {
height: 100%;
position: relative;
&-container {
height: calc(100% - #{toRpx(256)});
padding: 0 48rpx;
box-sizing: border-box;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
gap: 24rpx 32rpx;
align-content: start;
.list-item,
.form-item {
width: calc((100% - 32rpx) / 2);
}
.block {
width: 100%;
}
.divider {
color: #999999;
font-size: 24rpx;
line-height: 32rpx;
position: relative;
justify-content: center;
.text {
position: relative;
padding: 0 24rpx;
}
&::before,
&:after {
content: '';
position: absolute;
top: 50%;
transform: translateY(-50%);
border-top: 1px dashed #999999;
width: calc(50% - #{toRpx(72)});
height: 0;
}
&::before {
left: 0;
}
&::after {
right: 0;
}
}
.list-box {
width: 100%;
border-radius: 32rpx;
display: flex;
flex-wrap: wrap;
gap: 24rpx 32rpx;
.list-title {
color: #333333;
width: 100%;
font-size: 32rpx;
font-weight: 500;
line-height: 48rpx;
padding: 8rpx 32rpx 0 0;
}
}
.no-child {
padding-bottom: 0;
}
}
&-box {
position: absolute;
width: calc(100% - #{toRpx(96)});
height: calc(100% - #{toRpx(80)});
border-radius: 32rpx;
background: #fff;
top: 48rpx;
left: 50%;
transform: translateX(-50%);
padding: 0 0 32rpx 32rpx;
overflow-x: auto;
.list-title {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 32rpx 0 24rpx;
position: sticky;
top: 0;
z-index: 50;
background: #fff;
}
}
.footer {
height: 136rpx;
.btn {
margin: 0 168rpx;
width: 100%;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 80rpx;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: 28rpx;
font-weight: 500;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="daily-report">
<view class="common-title">
基础信息
</view>
<template v-if="loadComplete">
<template v-if="list.length">
<view class="daily-report-container">
<template v-for="(i,index) in list">
<view
:class="['list-item',{'block':['group','divider','textarea'].includes(i.type)},{'list-box':i.type == 'group'}]"
:key="index"
v-if="itemShow(i)"
>
<template v-if="i.type != 'group'">
<template v-if="i.type == 'divider'">
<view class="divider flex">
<view class="text">{{ i.label }}</view>
</view>
</template>
<template v-else>
<FormItem
:formItem="i"
:rules="i.rules"
@onSelect="onSelect($event, index)"
@onInput="onInput($event, index)"
:disabled="itemDisabled(i)"
/>
</template>
</template>
<template v-else>
<view class="list-title flex">
{{ i.label }}
</view>
<template v-if="i.children.length">
<template v-for="(c,c_index) in i.children">
<FormItem
class="form-item"
:formItem="c"
:key="c_index"
:rules="i.childrenRules[c.key]"
@onSelect="onSelect($event,index, c_index)"
@onInput="onInput($event, index, c_index)"
:disabled="itemDisabled(c)"
/>
</template>
</template>
</template>
</view>
</template>
</view>
<view class="footer">
<Footer>
<view class="btn">保存</view>
</Footer>
</view>
</template>
<nothing v-else />
<view class="report-content ">
<template v-if="!isToday">
<Detail />
</template>
<EditForm
ref="editForm"
@onDel="delItem"
@onConfirm="confirm"
/>
<template v-else>
<Edit :templateData="templateData" />
</template>
</view>
</template>
<script type='text/ecmascript-6'>
import Nothing from '../components/Nothing'
import Table from '../components/Table'
import Footer from '../components/Footer'
import utils from '@/utils/utils'
import EditForm from '../components/EditForm'
import FormItem from '../components/FormItem.vue'
import mixins from '../mixins'
import Detail from './detail'
import Edit from './edit'
export default {
name: 'StoreDailyReport',
components: { Table, Nothing, Footer, EditForm, FormItem },
props: {
templateData: {
type: Array,
default: () => []
}
},
components: { Detail, Edit },
mixins: [mixins],
name: 'StaffDailyReport',
data () {
return {
loadComplete: false,
list: []
}
},
watch: {
templateData: {
handler (val) {
if (!this.list.length) this.list = utils.deepClone(val)
this.loadComplete = true
},
immediate: true,
deep: true
}
computed: {
},
mounted () {
this.loadComplete = true
},
methods: {
itemShow (i) {
if (i.rules) {
let { keys, result } = i.rules,
{ list } = this
if (keys && result) {
let params = keys.map((c, index) => `val${index + 1}`),
// 将 new Function 改为 eval 方式
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = []
keys.map(key => {
let item = list.find(i => i.key == key)
if (item) value.push(item.value || null)
})
return func(...value)
} else return true
} else {
return true
}
},
handleRowClick (row, rowIndex, index) {
let parent = this.list[index]
this.$refs.editForm.open(row, rowIndex, index, parent)
},
delItem (c_index, index) {
this.list[index].children.splice(c_index, 1)
},
addItem (index) {
let { templateData } = this
this.list[index].children.push(templateData[index].children[0])
let data = this.list[index].children[this.list[index].children.length - 1],
c_index = this.list[index].children.length - 1,
parent = this.list[index]
this.$refs.editForm.open(data, c_index, index, parent)
},
confirm (data, c_index, index) {
this.$set(this.list[index].children, c_index, utils.deepClone(data))
},
onInput (val, index, c_index = -1) {
if (c_index == -1) this.$set(this.list[index], 'value', val)
else this.$set(this.list[index].children[c_index], 'value', val)
},
onSelect (val, index, c_index = -1) {
if (c_index == -1) this.$set(this.list[index], 'value', val)
else this.$set(this.list[index].children[c_index], 'value', val)
},
itemDisabled (i) {
let disabled = i.disabled
if (i.disabledFun) {
let { keys, result } = i.disabledFun,
{ list } = this,
params = keys.map((i, index) => `val${index + 1}`),
// 将 new Function 改为 eval 方式
func = eval(`(function(${params.join(',')}) { return ${result}; })`),
value = []
keys.map(key => {
let item = list.find(i => i.key == key)
if (item) value.push(item.value || null)
})
return func(...value)
}
return disabled
},
}
}
</script>
<style scoped lang='scss'>
.daily-report {
.report-content {
height: 100%;
position: relative;
&-container {
height: calc(100% - #{toRpx(256)});
padding: 0 48rpx;
box-sizing: border-box;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
gap: 24rpx 32rpx;
align-content: start;
.list-item ,.form-item{
width: calc((100% - 32rpx) / 2);
}
.block {
width: 100%;
}
.divider {
color: #999999;
font-size: 24rpx;
line-height: 32rpx;
position: relative;
justify-content: center;
.text {
position: relative;
padding: 0 24rpx;
}
&::before,
&:after {
content: '';
position: absolute;
top: 50%;
transform: translateY(-50%);
border-top: 1px dashed #999999;
width: calc(50% - #{toRpx(72)});
height: 0;
}
&::before {
left: 0;
}
&::after {
right: 0;
}
}
.list-box {
width: 100%;
border-radius: 32rpx;
display: flex;
flex-wrap: wrap;
gap: 24rpx 32rpx;
.list-title {
color: #333333;
width: 100%;
font-size: 32rpx;
font-weight: 500;
line-height: 48rpx;
padding: 8rpx 32rpx 0 0;
}
}
.no-child {
padding-bottom: 0;
}
}
&-box {
position: absolute;
width: calc(100% - #{toRpx(96)});
height: calc(100% - #{toRpx(80)});
border-radius: 32rpx;
background: #fff;
top: 48rpx;
left: 50%;
transform: translateX(-50%);
padding: 0 0 32rpx 32rpx;
overflow-x: auto;
.list-title {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 32rpx 0 24rpx;
position: sticky;
top: 0;
z-index: 50;
background: #fff;
}
}
.footer {
height: 136rpx;
.btn {
margin: 0 168rpx;
width: 100%;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 80rpx;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: 28rpx;
font-weight: 500;
}
}
}
</style>
\ No newline at end of file
<template>
<div>
门店详情
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file
<template>
<view class="list">
<view class="common-title">
</view>
<view class="list-box">
<template v-if="loadComplete">
<template v-if="staffList.length">
<scroll-view scroll-x>
<view class="name-list">
<view
:class="['name-item', currentIndex === index ? 'active' : '', 'flex']"
v-for="(item, index) in staffList"
:key="index"
@click="changeSatffView(index)"
>{{ item.staffName }}</view>
</view>
</scroll-view>
<view class="content">
<template v-for="(i,index) in list">
<view
class="table-box"
:key="`t-${index}`"
v-if="i.children && i.children.length"
>
<view class="table-title">{{ i.label }}</view>
<Table
:columns="i.columns"
:data="i.dataList"
tableStyle="padding-right:32rpx"
/>
</view>
</template>
</view>
</template>
<Nothing v-else />
</template>
</view>
<view class="footer">
<Footer>
<view
class="btn"
@click="$emit('back')"
>返回</view>
</Footer>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import Nothing from '../components/Nothing'
import Footer from '../components/Footer'
import Table from '../components/Table'
export default {
name: 'negotiationList',
components: { Nothing, Footer, Table },
inject: ['userInfo'],
props: {
currentDate: {
type: String,
default: ''
}
},
watch: {
currentDate: {
handler (val) {
if (val) {
this.getDiscussionStaffList(val)
this.currentIndex = 0
}
},
immediate: true,
deep: true
},
},
data () {
return {
staffList: [],
loadComplete: false,
currentIndex: 0,
list: []
}
},
mounted () {
},
methods: {
changeSatffView (index) {
if (this.currentIndex === index) return
this.currentIndex = index
this.getReportDetail(this.staffList[index])
},
async getDiscussionStaffList (reportDate) {
this.loadComplete = false
const { shopMerchantId } = this.userInfo,
data = await uni.$api.dailyTemplateApi.getDiscussionStaffList({
merchantId: shopMerchantId,
reportDate
})
this.staffList = data || []
this.loadComplete = true
if (data && data.length) this.getReportDetail(data[0])
},
async getReportDetail (item) {
const { shopMerchantId } = this.userInfo,
{ currentDate } = this,
data = await uni.$api.dailyTemplateApi.getReportDetail({
merchantId: shopMerchantId,
staffUuid: item.staffUuid,
templateType: 3,
reportDate: currentDate
})
if (data) {
let list = JSON.parse(data.jsonContent || '[]')
list.map(item => {
let columns = [],
dataList = [],
values = {}
if (item.children && item.children.length) {
item.children.map((child, index) => {
child.map(k => {
if (!values[k.key]) values[k.key] = []
values[k.key].push(k.value)
})
columns.push({ title: `数据${index + 1}` })
})
let rowData = item.children[0] || []
rowData.map(row => {
dataList.push({
rowHeader: row.label,
data: values[row.key]
})
})
}
item.columns = columns
item.dataList = dataList
})
this.list = list
}
},
}
}
</script>
<style scoped lang='scss'>
.list {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 2;
animation: list-left-in 0.5s ease-in-out;
.common-title {
position: absolute;
top: 0;
left: 0;
}
&-box {
height: calc(100% - #{toRpx(136)});
box-sizing: border-box;
.name-list {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
overflow-x: auto;
gap: 16rpx;
padding: 48rpx 48rpx 32rpx;
.name-item {
padding: 0 48rpx;
height: 72rpx;
color: #6c6f75;
font-size: 28rpx;
line-height: 40rpx;
border-radius: 16rpx;
background: #f5f7fa;
box-sizing: border-box;
border: 2rpx solid #f5f7fa;
}
.active {
border-color: #fff;
font-weight: 500;
color: #fff;
background: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
}
}
.content {
height: calc(100% - #{toRpx(152)});
box-sizing: border-box;
margin: 0 48rpx;
padding: 0 32rpx 32rpx;
border-radius: 32rpx;
background: #fff;
overflow-y: auto;
.table-title {
font-size: 32rpx;
font-weight: 600;
line-height: 44rpx;
padding: 32rpx 0 24rpx;
position: sticky;
top: 0;
z-index: 50;
background: #fff;
}
}
}
.footer {
height: 136rpx;
.btn {
margin: 0 168rpx;
width: 100%;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 80rpx;
background: #3b73ff1a;
color: #4673ff;
font-size: 28rpx;
font-weight: 500;
}
}
}
@keyframes list-left-in {
0% {
left: 100%;
}
100% {
left: 0;
}
}
</style>
\ No newline at end of file
<template>
<view class="order-list">
<template v-for="(i, index) in listData">
<view
:key="index"
@click="choose(i)"
:class="['item flex', { active: checkActive(i) }]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ i.productName }}
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import popupmixin from './popupmixin'
export default {
mixins: [popupmixin],
name: 'OrderList',
inject: ['userInfo'],
data () {
return {
}
},
computed: {
idKey () {
let { params: { idKey }, sceneType } = this
return Array.isArray(idKey) ? idKey[sceneType] : idKey
}
},
mounted () {
},
methods: {
async getList (searchValue, search) {
const { userInfo, params, data } = this,
{ cacheData } = params
this.currentId = ''
if (!search && cacheData && cacheData.length) {
this.initData(cacheData)
return
}
this.componentLoading(params)
console.log(data)
const { shopMerchantId,uuid } = userInfo,
apiParams = {
merchantId: shopMerchantId,
sellerUserId: uuid,
carBrandTypeFlag: '',
saleDate: ''
}
const res = await uni.$api.dailyTemplateApi.getGoodsOrderList(apiParams)
this.updateParams(params, res || [])
},
initData (list) {
const { data, data: { key }, params: { multiple } } = this
if (data[key]) {
this.currentId = data[key]
let item = list.find(i => i.orderCode == this.currentId)
this.$emit('choose', item)
}
this.list = list
this.$emit('onComplete')
},
originalDataSearch (searchValue) {
if (!searchValue) this.searchStatus = false
else {
searchValue = searchValue.toUpperCase()
let { list } = this,
orderList = JSON.parse(JSON.stringify(list)),
arr = []
orderList.map(e => {
if (e.staffName && e.staffName.toUpperCase().indexOf(searchValue) != -1) arr.push(e)
})
this.searchList = arr
this.searchStatus = true
}
},
choose (i) {
this.currentId = i.orderCode
this.$emit('choose', i)
},
checkActive (i) {
let { currentId, data: { key }, data } = this
return currentId ? i.orderCode == currentId : i.orderCode == data[key]
}
}
}
</script>
<style scoped lang="scss">
.order-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
......@@ -52,7 +52,15 @@ const componentConfig = {
noData: false,
},
4: {
name: 'OrderList',
title: '选择订单',
placeholder: '请输入订单号',
idKey: ['orderCode'],
cacheData: [],
loadComplete: false,
searchValue: '',
noData: false,
hideSearch: true
},
}
......
......@@ -94,6 +94,8 @@ import Popup from '@/components/Popup.vue'
import config from './config'
import EmployeeList from './components/EmployeeList.vue'
import CarModelList from './components/CarModelList.vue'
import OrderList from './components/OrderList.vue'
import dayjs from 'dayjs';
export default {
......@@ -101,6 +103,7 @@ export default {
Popup,
EmployeeList,
CarModelList,
OrderList,
},
name: '',
props: {
......
......@@ -128,6 +128,7 @@ export default {
* @param parent 父级数据
*/
open (data, c_index, index, parent) {
console.log(data, c_index, index, parent)
this.data = utils.deepClone(data) || {}
this.c_index = c_index || 0
this.index = index || 0
......@@ -179,7 +180,9 @@ export default {
this.$set(this.data[index], 'value', val)
},
onSelect (val, index) {
this.$set(this.data[index], 'value', val)
console.log(this.data[index])
},
openSelect (item, type, index) {
this.currentItem = item
......
......@@ -30,6 +30,7 @@
:maxlength="11"
placeholder-class="placeholderStyle"
type="tel"
@input="input"
/>
</template>
<template v-else-if="item.type == 'textarea'">
......@@ -169,6 +170,7 @@ export default {
multipleSelect: 1,
datetime: 5,
carBrandSelect: 3
}[item.type] || 0
return popupType
},
......@@ -189,7 +191,8 @@ export default {
select (e) {
let { item, popupType } = this
if (item.optionsKey || item.type == 'datetime' || item.type == 'carBrandSelect') {
if(item.optionsKey == 'storeStaffList') popupType = 2
if (item.optionsKey == 'storeStaffList') popupType = 2
if(item.optionsKey == 'orderList') popupType = 4
this.$emit('openSelect', item, popupType)
} else {
this.$emit('onSelect', item.options[e.detail.value].value)
......
......@@ -144,7 +144,9 @@ export default {
data: {
handler (val) {
this.tableData = val || []
this.getTableWidth()
this.$nextTick(() => {
this.getTableWidth()
})
},
immediate: true
}
......@@ -166,12 +168,12 @@ export default {
getTableWidth () {
const query = uni.createSelectorQuery()
query.select(`#${this.id}`).boundingClientRect(data => {
if (data && data.width) this.tableWidth = data.width + 'px'
if (data && data.width) this.tableWidth = data.width + 'px'
}).exec()
if (!this.tableWidth) setTimeout(() => {
this.getTableWidth()
}, 500)
}
}
}
......
......@@ -16,8 +16,8 @@
<view class="detail-content">
<view class="detail-left">
<view class="common-title">
<div :class="['sprite-icon',`icon-${titleIcon}-mini`]"></div>
{{ title }}
<div :class="['sprite-icon',`icon-${assignIcon || titleIcon}-mini`]"></div>
{{assignTitle || title }}
</view>
<view class="content">
<image
......@@ -36,7 +36,7 @@
backgroundColor="transparent"
:selected="selectedDays"
:date="currentDate"
:calendarItemStyle="{width:'84rpx',height:'84rpx'}"
:calendarItemStyle="{width:'84rpx',height:'90rpx'}"
/>
</view>
</view>
......@@ -46,6 +46,8 @@
:ref="`ref-${componentName}`"
:is="componentName"
:templateData="templateData"
:currentDate="currentDate"
@changeComponent="changeComponent"
/>
</view>
</view>
......@@ -63,19 +65,22 @@ import dayjs from 'dayjs'
import NoticePopup from '@/components/NoticePopup.vue'
import StaffDailyReport from './StaffDailyReport/index.vue'
import StoreDailyReport from './StoreDailyReport/index.vue'
import NegotiationDetailList from './NegotiationDetail/index.vue'
import NegotiationDetail from './NegotiationDetail/index.vue'
import EditNegotiationDetail from './NegotiationDetail/edit.vue'
export default {
components: {
NoticePopup,
StaffDailyReport,
StoreDailyReport,
NegotiationDetailList,
NegotiationDetail,
EditNegotiationDetail
},
provide () {
return {
sceneType: this.SCENE_TYPE
sceneType: this.SCENE_TYPE,
userInfo: this.userInfo,
templateType: () => this.templateType,
dailyReportRecordId: () => this.dailyReportRecordId,
}
},
data () {
......@@ -88,7 +93,10 @@ export default {
selectedDays: [], // 填写日报日期
lastMonth: dayjs().subtract(1, 'month').format('YYYY-MM'), // 上个月份
enterType: '',
templateData: []
templateData: [],
assignTitle: '',
assignIcon: '',
dailyReportRecordId:''
}
},
computed: {
......@@ -113,32 +121,26 @@ export default {
return {
staffdailyreport: '驻店日报',
storedailyreport: '门店日报',
negotiationdetaillist: '洽谈明细',
editnegotiationdetail: '洽谈明细'
negotiationdetail: '洽谈明细'
}[this.componentName.toLowerCase()]
},
titleIcon () {
return {
staffdailyreport: 'daily-report',
storedailyreport: 'store-daily-report',
negotiationdetaillist: 'negotiation-detail',
editnegotiationdetail: 'negotiation-detail'
negotiationdetail: 'negotiation-detail'
}[this.componentName.toLowerCase()]
},
componentName () {
let { currentDate, options } = this,
let { options } = this,
componentName = options.componentName || ''
if (componentName && componentName.toLowerCase() == 'negotiationdetaillist' && currentDate == dayjs().format('YYYY-MM-DD')) {
componentName = 'EditNegotiationDetail'
}
return componentName
},
templateType () {
return {
staffdailyreport: 1,
storedailyreport: 2,
negotiationdetaillist: 3,
editnegotiationdetail: 3
negotiationdetail: 3,
}[this.componentName.toLowerCase()]
},
dayList () {
......@@ -159,9 +161,10 @@ export default {
},
onLoad (options) {
this.options = options
if (options.currentDate) this.setCurrentDate(options.currentDate)
this.getReportList()
this.getDailyTemplate(options.componentName)
if (options.currentDate) this.setCurrentDate(options.currentDate)
this.getReportDetail()
// this.getDailyTemplate()
},
onUnload () {
},
......@@ -169,7 +172,6 @@ export default {
async getReportList () {
const { uuid, shopMerchantId } = this.userInfo,
{ templateType, dayList } = this
const data = await uni.$api.dailyTemplateApi.getReportList({
merchantId: shopMerchantId,
staffUuid: uuid,
......@@ -177,10 +179,15 @@ export default {
reportStartDate: dayList[0],
reportEndDate: dayList[dayList.length - 1]
})
console.log(data)
let selectedDay = []
dayList.map(e => {
if (!data.includes(e)) selectedDay.push({
date: e
})
})
this.selectedDays = selectedDay
},
async getDailyTemplate (componentName) {
async getDailyTemplate () {
const hasCommonElement = (arrA, arrB) => {
return arrA.some(item => arrB.includes(item))
}
......@@ -189,14 +196,8 @@ export default {
const setA = new Set(arrA);
return arrB.every(item => setA.has(item));
}
const type = {
staffdailyreport: 1,
storedailyreport: 2,
negotiationdetaillist: 3,
editnegotiationdetail: 3
}[componentName.toLowerCase()],
{ SCENE_TYPE, CAR_BRAND_ID, BASE_SCENE_CODE } = this,
data = await uni.$api.dailyTemplateApi.getDailyTemplate(type)
const { templateType, CAR_BRAND_ID, BASE_SCENE_CODE } = this,
data = await uni.$api.dailyTemplateApi.getDailyTemplate(templateType)
let templateData = Object.values(data)
// .filter(item => {
// // 场景类型过滤
......@@ -239,8 +240,11 @@ export default {
}
else return item.baseSceneCode?.length ? hasCommonElement(item.baseSceneCode, BASE_SCENE_CODE) : true
})
templateData.map(e =>{
if(e.children && e.type == 'subform') e.origin_children = e.children[0]
})
console.log(templateData)
this.templateData = templateData
console.log(templateData)
},
setCurrentDate (currentDate) {
console.log(currentDate)
......@@ -248,7 +252,28 @@ export default {
this.currentMonth = dayjs(currentDate).format('YYYY-MM')
},
changeCurrentDate (e) {
this.templateData = []
this.currentDate = e.fulldate
this.getReportDetail()
},
async getReportDetail () {
const { uuid, shopMerchantId } = this.userInfo,
nowDate = dayjs().format('YYYY-MM-DD'),
{ templateType, currentDate } = this,
data = await uni.$api.dailyTemplateApi.getReportDetail({
merchantId: shopMerchantId,
staffUuid: uuid,
templateType,
reportDate: currentDate
})
if (data) {
this.dailyReportRecordId = data.id
this.templateData = JSON.parse(data.jsonContent || '[]')
console.log(this.templateData)
}
else {
if (nowDate == currentDate) this.getDailyTemplate()
}
},
changeMonth (e) {
this.currentMonth = `${e.year}-${e.month}`
......@@ -264,6 +289,10 @@ export default {
this.transmissionOfData = val
}
},
changeComponent (val) {
this.assignTitle = val.title
this.assignIcon = val.icon
}
}
}
......
import dayjs from "dayjs"
export default {
inject: ['sceneType', 'userInfo', 'templateType', 'dailyReportRecordId'],
data () {
return {
dayjs,
nowDate: dayjs().format('YYYY-MM-DD'),
}
},
props: {
currentDate: String,
templateData: {
type: Array,
default: () => ([])
}
},
computed: {
isToday () {
return this.currentDate == this.nowDate
},
reportParams () {
let { shopMerchantId, shopMerchantName, uuid, name } = this.userInfo,
{ currentDate, templateType,dailyReportRecordId } = this
return {
merchantId: shopMerchantId,
merchantName: shopMerchantName,
reportDate: currentDate,
staffUuid: uuid,
staffName: name,
dailyReportSource: 2,//1:生意助手员工版小程序,2:平板电脑
templateType: templateType(),
dailyReportRecordId: dailyReportRecordId()
}
},
},
watch: {
},
methods: {
async saveReport (list) {
try {
let { reportParams } = this
console.log('保存日报', reportParams)
console.log(list)
list.map(e => {
if (e.children && e.children.length) e.children.map((c, cIndex) => {
let isArray = Array.isArray(c)
if (isArray) {
c.map(i => {
// if(i.required && (i.value == null || i.value == undefined)) throw `${e.label}第${cIndex+1}项${i.label}不能为空`
})
} else {
}
})
})
reportParams.jsonContent = JSON.stringify(list)
const data = await uni.$api.dailyTemplateApi.saveDraft(reportParams)
console.log(data)
} catch (error) {
uni.showToast({ title: error, icon: 'none' })
}
},
submitReport () {
console.log('提交日报')
},
}
}
\ No newline at end of file
......@@ -166,7 +166,7 @@ $uni-primary: #4673ff !default;
.uni-calendar-item__weeks-box-circle {
position: absolute;
bottom: toRpx(10);
bottom: toRpx(6);
left: 50%;
transform: translate(-50%, -50%);
width: toRpx(12);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!