提交 207705d1 authored 作者: lidongxu's avatar lidongxu

解决一次冲突文件内容_taskList.vue

...@@ -52,6 +52,6 @@ onMounted(() => { ...@@ -52,6 +52,6 @@ onMounted(() => {
<style scoped <style scoped
lang="scss"> lang="scss">
.wm-class{ .wm-class{
height: 100%; min-height: 100%;
} }
</style> </style>
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<div class="wrap"> <div class="wrap">
<van-nav-bar left-arrow <van-nav-bar left-arrow
left-text="返回" left-text="返回"
fixed
@click-left="router.back()"> @click-left="router.back()">
</van-nav-bar> </van-nav-bar>
<div class="content"> <div class="content">
...@@ -42,7 +43,8 @@ ...@@ -42,7 +43,8 @@
<p v-else>{{ addressStr }}</p> <p v-else>{{ addressStr }}</p>
<van-icon name="replay" <van-icon name="replay"
class="refresh-icon" class="refresh-icon"
@click="handleClickLocation" /> @click="handleClickLocation"
v-if="!isEdit" />
</div> </div>
<!-- 门头照上传 --> <!-- 门头照上传 -->
...@@ -52,7 +54,6 @@ ...@@ -52,7 +54,6 @@
<template #input> <template #input>
<van-uploader :max-count="1" <van-uploader :max-count="1"
accept="image/*" accept="image/*"
capture="camera"
:model-value="form.commitStorePicture" :model-value="form.commitStorePicture"
:after-read="commitStorePhotosRead" :after-read="commitStorePhotosRead"
preview-size="2.13333rem" preview-size="2.13333rem"
...@@ -79,21 +80,7 @@ ...@@ -79,21 +80,7 @@
</el-select> </el-select>
</template> </template>
</van-field> </van-field>
<!-- <van-field :model-value="form.selectedType.join('')"
readonly
label="渠道类型"
label-align="top"
placeholder="请选择"
@click="showTypePopup = true"
class="store-type" />
<van-popup v-model:show="showTypePopup"
position="bottom"
@close="showTypePopup = false">
<van-picker v-model="form.selectedType"
:columns="typeOptions"
@confirm="handleTypeConfirm"
@cancel="showTypePopup = false" />
</van-popup> -->
<!-- 信息填写组 --> <!-- 信息填写组 -->
<van-tabs v-model:active="active" <van-tabs v-model:active="active"
class="tabs" class="tabs"
...@@ -121,6 +108,47 @@ ...@@ -121,6 +108,47 @@
ref="categoryInformationRef" /> ref="categoryInformationRef" />
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<!-- 竞品填写组 -->
<div class="comper-summary">
<p class="title">竞品信息:</p>
<van-field v-model.number="form.competitorWangjiafuSkuTotal"
label="旺家福SKU总数:"
type="number"
placeholder="请输入"
label-align="left"
@change="handleComPePrdChange" />
<van-field v-model.number="form.competitorWangjiafuFacingTotal"
label="旺家福排面总数:"
type="number"
placeholder="请输入"
label-align="left"
@change="handleComPePrdChange" />
<van-field v-model.number="form.competitorQianjiaxiangSkuTotal"
label="钱家香SKU总数:"
type="number"
placeholder="请输入"
label-align="left"
@change="handleComPePrdChange" />
<van-field v-model.number="form.competitorQianjiaxiangFacingTotal"
label="钱家香排面总数:"
type="number"
placeholder="请输入"
label-align="left"
@change="handleComPePrdChange" />
<van-field v-model.number="form.competitorJinchuniangSkuTotal"
label="金厨娘SKU总数:"
type="number"
placeholder="请输入"
label-align="left"
@change="handleComPePrdChange" />
<van-field v-model.number="form.competitorJinchuniangFacingTotal"
label="金厨娘排面总数:"
type="number"
placeholder="请输入"
label-align="left"
@change="handleComPePrdChange" />
</div>
<!-- 任务总结 --> <!-- 任务总结 -->
<div class="task-summary"> <div class="task-summary">
<p class="title">其他:</p> <p class="title">其他:</p>
...@@ -202,6 +230,7 @@ const categoryInformationRef = ref(null) ...@@ -202,6 +230,7 @@ const categoryInformationRef = ref(null)
/*************** 稽查任务总体 ***************/ /*************** 稽查任务总体 ***************/
const isInitializing = ref(true) const isInitializing = ref(true)
const isEdit = ref(Boolean(route.query.rstId))
const form = reactive({ // 当前页信息总对象 const form = reactive({ // 当前页信息总对象
rstId: route.query.rstId, // 稽查任务 ID(获取详情接口有则保存,没有则主动新建一次并获取 id) rstId: route.query.rstId, // 稽查任务 ID(获取详情接口有则保存,没有则主动新建一次并获取 id)
storePicture: route.query.storePicture, // 门店照片(原始门店照片,来自于上一页的接口) storePicture: route.query.storePicture, // 门店照片(原始门店照片,来自于上一页的接口)
...@@ -228,7 +257,7 @@ const getInspectionTaskDetailFn = async () => { ...@@ -228,7 +257,7 @@ const getInspectionTaskDetailFn = async () => {
}) })
if (res.data) { if (res.data) {
Object.assign(form, res.data) Object.assign(form, res.data)
const { storeName, lhldArr, longTimePictureArr, storePicture, storeType, skuNum, cgclRiskRArr, dqclRiskRArr, dealerName, storeAddr } = res.data const { storeName, lhldArr, longTimePictureArr, storePicture, storeType, skuNum, cgclRiskRArr, dqclRiskRArr, dealerName, storeAddr, address } = res.data
// 终端门店照片一直应该是路由上的照片参数,如果路由上没有门头照证明上一个页面列表里这个门店就本身没有照片,那就用门头照拍摄的 // 终端门店照片一直应该是路由上的照片参数,如果路由上没有门头照证明上一个页面列表里这个门店就本身没有照片,那就用门头照拍摄的
if (route.query.storePicture) form.storePicture = route.query.storePicture if (route.query.storePicture) form.storePicture = route.query.storePicture
// 详情接口有门头照照片,需要设置到特有的属性commitStorePicture // 详情接口有门头照照片,需要设置到特有的属性commitStorePicture
...@@ -261,6 +290,12 @@ const getInspectionTaskDetailFn = async () => { ...@@ -261,6 +290,12 @@ const getInspectionTaskDetailFn = async () => {
if (storeType) form.selectedType = storeType if (storeType) form.selectedType = storeType
// 保存地址
if (address) {
addressLoading.value = false
addressStr.value = address
}
} else { } else {
// 没有的话调用新建接口,得到一个总体稽查任务 id // 没有的话调用新建接口,得到一个总体稽查任务 id
const res = await createInspectionTaskAPI({ const res = await createInspectionTaskAPI({
...@@ -270,22 +305,23 @@ const getInspectionTaskDetailFn = async () => { ...@@ -270,22 +305,23 @@ const getInspectionTaskDetailFn = async () => {
dealerCode: form.dealerCode dealerCode: form.dealerCode
}) })
form.rstId = res.data.rstId form.rstId = res.data.rstId
// 一定在这里获取地理位置(保证稽查任务 id 创建完毕)
getLocationFn()
} }
nextTick(() => { nextTick(() => {
isInitializing.value = false isInitializing.value = false
// 初始化 4 个分组
conventionRef.value.init() conventionRef.value.init()
scheduleDisplayRef.value.init() scheduleDisplayRef.value.init()
scheduleAdjustmentRef.value.init() scheduleAdjustmentRef.value.init()
categoryInformationRef.value.init() categoryInformationRef.value.init()
}) })
// 一定在这里获取地理位置(保证稽查任务 id 创建完毕)
getLocationFn()
} }
getInspectionTaskDetailFn() getInspectionTaskDetailFn()
// 门店图片预览 // 门店图片预览
const previewStoreImage = () => { const previewStoreImage = () => {
showImagePreview({ showImagePreview({
...@@ -398,7 +434,6 @@ const deleteCommitStorePhotos = async () => { ...@@ -398,7 +434,6 @@ const deleteCommitStorePhotos = async () => {
showNotify({ type: 'success', message: '门头照,删除成功' }) showNotify({ type: 'success', message: '门头照,删除成功' })
} }
/*************** 渠道类型 ***************/ /*************** 渠道类型 ***************/
const typeOptions = ref(typeOption) // 渠道类型 const typeOptions = ref(typeOption) // 渠道类型
const showTypePopup = ref(false) const showTypePopup = ref(false)
...@@ -416,6 +451,23 @@ const handleTypeConfirm = async () => { ...@@ -416,6 +451,23 @@ const handleTypeConfirm = async () => {
/*************** tabs 组 ***************/ /*************** tabs 组 ***************/
const active = ref(0) const active = ref(0)
/*************** 竞品组 ***************/
const handleComPePrdChange = async () => {
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
// 判断空字符串传 null
"competitorWangjiafuSkuTotal": form.competitorWangjiafuSkuTotal || null,
"competitorWangjiafuFacingTotal": form.competitorWangjiafuFacingTotal || null,
"competitorQianjiaxiangSkuTotal": form.competitorQianjiaxiangSkuTotal || null,
"competitorQianjiaxiangFacingTotal": form.competitorQianjiaxiangFacingTotal || null,
"competitorJinchuniangSkuTotal": form.competitorJinchuniangSkuTotal || null,
"competitorJinchuniangFacingTotal": form.competitorJinchuniangFacingTotal || null,
})
showNotify({ type: 'success', message: '竞品信息,修改成功' })
}
/*************** 其他信息填写 ***************/ /*************** 其他信息填写 ***************/
// 礼盒礼袋在售 // 礼盒礼袋在售
const handleLhldArrChange = async () => { const handleLhldArrChange = async () => {
...@@ -495,8 +547,13 @@ const deleteLongTimePictureArr = async (file, { name, index }) => { ...@@ -495,8 +547,13 @@ const deleteLongTimePictureArr = async (file, { name, index }) => {
min-height: 100vh; min-height: 100vh;
font-size: 16px; font-size: 16px;
.van-nav-bar{
z-index: 1000;
}
.content { .content {
padding: 20px; padding: 20px;
padding-top: 66px;
.title { .title {
margin: 0; margin: 0;
...@@ -573,6 +630,7 @@ const deleteLongTimePictureArr = async (file, { name, index }) => { ...@@ -573,6 +630,7 @@ const deleteLongTimePictureArr = async (file, { name, index }) => {
/* 位置信息 */ /* 位置信息 */
.location-wrap { .location-wrap {
width: 100%;
margin-top: 10px; margin-top: 10px;
padding: 10px; padding: 10px;
background-color: #fff; background-color: #fff;
...@@ -580,7 +638,8 @@ const deleteLongTimePictureArr = async (file, { name, index }) => { ...@@ -580,7 +638,8 @@ const deleteLongTimePictureArr = async (file, { name, index }) => {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; /* justify-content: space-between; */
gap: 20px;
.location-icon { .location-icon {
font-size: 20px; font-size: 20px;
...@@ -591,6 +650,10 @@ const deleteLongTimePictureArr = async (file, { name, index }) => { ...@@ -591,6 +650,10 @@ const deleteLongTimePictureArr = async (file, { name, index }) => {
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
} }
.refresh-icon {
margin-left: auto;
}
} }
/* 门头照 */ /* 门头照 */
...@@ -627,6 +690,24 @@ const deleteLongTimePictureArr = async (file, { name, index }) => { ...@@ -627,6 +690,24 @@ const deleteLongTimePictureArr = async (file, { name, index }) => {
margin-top: 10px; margin-top: 10px;
} }
/* 竞品信息组 */
.comper-summary {
margin-top: 10px;
background: white;
padding: 10px;
color: var(--main-color);
--van-field-label-width: 120px !important;
.title {
margin-bottom: 10px;
}
.van-cell {
padding: 0;
margin-bottom: 20px;
}
}
/* 其他 */ /* 其他 */
.task-summary { .task-summary {
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<template #input> <template #input>
<van-uploader :max-count="1" <van-uploader :max-count="1"
accept="image/*" accept="image/*"
capture="camera"
:model-value="form.storePicture" :model-value="form.storePicture"
:after-read="posPhotosRead" :after-read="posPhotosRead"
preview-size="2.13333rem" preview-size="2.13333rem"
......
...@@ -59,44 +59,60 @@ ...@@ -59,44 +59,60 @@
</template> </template>
</van-field> </van-field>
<!-- 日期区间 --> <!-- 日期区间 -->
<van-field type="text"> <van-field type="text"
<template #input> :model-value="query.operDate.map(item => parseTime(item, '{y}-{m}-{d}')).join(' - ')"
<el-date-picker v-model="query.operDate" label="日期范围:"
type="date" readonly
value-format="YYYY-MM-DD" placeholder="请选择日期范围"
placeholder="输入搜索的日期" @click="showCalendar = true" />
@change="search" />
</template>
</van-field>
<!-- 重置按钮 --> <!-- 重置按钮 -->
<van-button icon="replay" <van-button icon="replay"
class="reset-btn" class="reset-btn"
block block
@click="resetFn">重置</van-button> @click="resetFn">重置</van-button>
</van-popup> </van-popup>
<!-- 搜索日期范围组件 -->
<van-calendar v-model:show="showCalendar"
:min-date="minDate"
:max-date="maxDate"
:default-date="query.operDate"
type="range"
@confirm="handleConfirm" />
</div> </div>
</template> </template>
<script setup> <script setup>
import { getInspectionTaskListAPI} from '@/api' import { getInspectionTaskListAPI } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
const router = useRouter(); const router = useRouter();
// 搜索 // 搜索
const showSearch = ref(false) const showSearch = ref(false) // 搜索抽屉
const showCalendar = ref(false) // 日期选择器
// 当年 1 月 1 日
const minDate = new Date(new Date().getFullYear(), 0, 1)
// 当月最后一天
const maxDate = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())
// 获取列表 // 获取列表
const query = reactive({ const query = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
// 当月 1 号到当前日期
operDate: [new Date(new Date().getFullYear(), new Date().getMonth(), 1), maxDate]
}) })
const resultList = ref([]) const resultList = ref([])
const loading = ref(false); const loading = ref(false);
const finished = ref(true); const finished = ref(true);
const refreshLoading = ref(false) const refreshLoading = ref(false)
const getInspectionTaskListFn = async () => { const getInspectionTaskListFn = async () => {
const res = await getInspectionTaskListAPI(query) const res = await getInspectionTaskListAPI({
...query,
operDateStart: parseTime(query.operDate[0], '{y}-{m}-{d}'),
operDateEnd: parseTime(query.operDate[1], '{y}-{m}-{d}'),
})
resultList.value = [...resultList.value, ...res.data.rows] resultList.value = [...resultList.value, ...res.data.rows]
finished.value = res.data.total <= resultList.value.length finished.value = res.data.total <= resultList.value.length
} }
...@@ -122,7 +138,7 @@ const onLoadMore = async () => { ...@@ -122,7 +138,7 @@ const onLoadMore = async () => {
const resetFn = () => { const resetFn = () => {
query.pageNum = 1 query.pageNum = 1
query.storeName = '' query.storeName = ''
query.operDate = '' query.operDate = [new Date(new Date().getFullYear(), new Date().getMonth(), 1), maxDate]
resultList.value = [] resultList.value = []
getInspectionTaskListFn() getInspectionTaskListFn()
} }
...@@ -168,6 +184,15 @@ const deleteFn = async (item, index) => { ...@@ -168,6 +184,15 @@ const deleteFn = async (item, index) => {
// }) // })
} }
// 日期范围确认
const handleConfirm = (dates) => {
if (dates.length === 2) {
query.operDate = dates
showCalendar.value = false
search()
}
}
</script> </script>
<style scoped <style scoped
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论