提交 5ceac0f6 authored 作者: lidongxu's avatar lidongxu

refactor(inspectiontask/*): 修改:勤策移动端_售点稽查_查看和新增任务代码修改

上级 f93a46da
......@@ -178,7 +178,6 @@ export const dynamicRoutes = [
}
]
const router = createRouter({
// 路由模式:createWebHashHistory,createWebHistory
history: createWebHashHistory(),
......
......@@ -26,9 +26,9 @@
</div>
<div class="terminal-info">
<p>终端编码:P0500052306</p>
<p>经销商:秦皇岛红朗森商贸有限公司</p>
<p>地址:河北省秦皇岛市海港区北环路街道秦皇岛冻结附录</p>
<p>终端编码:{{ form.storeCode }}</p>
<p>经销商:{{ form.dealerName }}</p>
<p>地址:{{ form.address }}</p>
</div>
</div>
......@@ -60,10 +60,10 @@
</template>
</van-field>
</div>
<!-- 门店类型选择 -->
<!-- 渠道类型选择 -->
<van-field label-width="150px"
label-position="top"
label="门店类型:"
label="渠道类型:"
:model-value="form.selectedType"
placeholder="请选择">
<template #input>
......@@ -78,7 +78,7 @@
</van-field>
<!-- <van-field :model-value="form.selectedType.join('')"
readonly
label="门店类型"
label="渠道类型"
label-align="top"
placeholder="请选择"
@click="showTypePopup = true"
......@@ -200,7 +200,7 @@ const categoryInformationRef = ref(null)
/*************** 稽查任务总体 ***************/
const isInitializing = ref(true)
const form = reactive({ // 当前页信息总对象
rstId: '', // 稽查任务 ID(获取详情接口有则保存,没有则主动新建一次并获取 id)
rstId: route.query.rstId, // 稽查任务 ID(获取详情接口有则保存,没有则主动新建一次并获取 id)
storePicture: route.query.storePicture, // 门店照片(原始门店照片,来自于上一页的接口)
storeName: route.query.storeName, // 门店名称
storeCode: route.query.storeCode, // 门店编码
......@@ -212,13 +212,14 @@ const form = reactive({ // 当前页信息总对象
longTimePictureArr: [], // 大日期产品照片
// 前端特有属性和后端接口不一致
commitStorePicture: [], // 上报拍摄的门店照片
selectedType: "", // 门店类型
selectedType: "", // 渠道类型
})
// 稽查任务详情
const getInspectionTaskDetailFn = async () => {
const res = await getInspectionTaskDetailAPI({
storeCode: form.storeCode
storeCode: form.storeCode,
rstId: form.rstId,
})
if (res.data) {
Object.assign(form, res.data)
......@@ -256,6 +257,7 @@ const getInspectionTaskDetailFn = async () => {
// 没有的话调用新建接口,得到一个总体稽查任务 id
const res = await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName
})
form.rstId = res.data.rstId
}
......@@ -271,7 +273,21 @@ const getInspectionTaskDetailFn = async () => {
// 一定在这里获取地理位置(保证稽查任务 id 创建完毕)
getLocationFn()
}
getInspectionTaskDetailFn()
onMounted(async () => {
if (route.query.taskStatus) {
// 从新建稽查任务页面过来的,直接初始化
// 先走一次创建任务,再走查询详情
// 没有的话调用新建接口,得到一个总体稽查任务 id
const res = await createInspectionTaskAPI({
storeName: route.query.storeName,
storePicture: route.query.storePicture,
selectedType: route.query.selectedType
})
form.rstId = res.data.rstId
}
getInspectionTaskDetailFn()
})
// 门店图片预览
const previewStoreImage = () => {
......@@ -284,6 +300,7 @@ const previewStoreImage = () => {
const handleStoreNameChange = async () => {
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
rStoreName: form.storeName // 修改门店名称
})
......@@ -357,6 +374,7 @@ const commitStorePhotosRead = async (file) => {
}]
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
storePicture: pictureUrl
})
......@@ -368,6 +386,7 @@ const deleteCommitStorePhotos = async () => {
form.commitStorePicture = []
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
storePicture: ""
})
......@@ -375,16 +394,18 @@ const deleteCommitStorePhotos = async () => {
showNotify({ type: 'success', message: '门头照,删除成功' })
}
/*************** 门店类型 ***************/
const typeOptions = ref(typeOption) // 门店类型
/*************** 渠道类型 ***************/
const typeOptions = ref(typeOption) // 渠道类型
const showTypePopup = ref(false)
// 确认门店类型
// 确认渠道类型
const handleTypeConfirm = async () => {
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
storeType: form.selectedType
})
showNotify({ type: 'success', message: '渠道类型,修改成功' })
}
/*************** tabs 组 ***************/
......@@ -396,6 +417,7 @@ const handleLhldArrChange = async () => {
if (isInitializing.value) return
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
lhldArr: form.lhldArr
})
......@@ -406,6 +428,7 @@ const handleLhldArrChange = async () => {
const handleSkuNumChange = async () => {
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
skuNum: form.skuNum * 1
})
......@@ -416,6 +439,7 @@ const handleSkuNumChange = async () => {
const handleRemarkChange = async () => {
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
remark: form.remark
})
......@@ -433,6 +457,7 @@ const longTimePictureArrRead = async (file) => {
})
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
longTimePictureArr: form.longTimePictureArr.map(o => o.url)
})
......@@ -443,6 +468,7 @@ const deleteLongTimePictureArr = async (file, { name, index }) => {
form.longTimePictureArr.splice(index, 1)
await createInspectionTaskAPI({
storeCode: form.storeCode,
storeName: form.storeName,
rstId: form.rstId,
longTimePictureArr: form.longTimePictureArr.map(o => o.url)
})
......
......@@ -31,13 +31,13 @@
</template>
</van-field>
</div>
<!-- 门店类型选择 -->
<!-- 渠道类型选择 -->
<van-field label-width="150px"
label-position="top"
label="门店类型:"
label="渠道类型:"
:model-value="form.selectedType"
placeholder="请选择"
:rules="[{ required: true, message: '请选择门店类型' }]">
:rules="[{ required: true, message: '请选择渠道类型' }]">
<template #input>
<el-select v-model="form.selectedType"
placeholder="请选择">
......@@ -49,11 +49,11 @@
</van-field>
<!-- <van-field :model-value="form.selectedType.join('')"
readonly
label="门店类型"
label="渠道类型"
label-align="top"
placeholder="请选择"
@click="showTypePopup = true"
:rules="[{ required: true, message: '请选择门店类型' }]" />
:rules="[{ required: true, message: '请选择渠道类型' }]" />
<van-popup v-model:show="showTypePopup"
position="bottom"
@close="showTypePopup = false">
......@@ -91,7 +91,7 @@ const form = reactive({
storePicture: [],
selectedType: ''
})
const typeOptions = ref(typeOption); // 门店类型
const typeOptions = ref(typeOption); // 渠道类型
const showTypePopup = ref(false);
// 门头照上传逻辑
......@@ -111,7 +111,7 @@ const deletePosPhotos = async () => {
showNotify({ type: 'success', message: '照片删除成功' })
}
// 确认门店类型
// 确认渠道类型
// const handleTypeConfirm = ({ selectedValues }) => {
// form.selectedType = selectedValues;
// showTypePopup.value = false;
......@@ -128,7 +128,6 @@ const handleCreateTask = () => {
query: {
taskStatus: true,
storeName: form.storeName,
storeCode: null,
storePicture: form.storePicture[0]?.url,
selectedType: form.selectedType
}
......
......@@ -121,7 +121,7 @@ const handleClickStore = (item) => {
// 确实提示
showConfirmDialog({
title: '提示',
message: '是否创建本店稽查任务?',
message: '是否创建/查看本店稽查任务?',
confirmButtonText: '前往',
cancelButtonText: '取消'
}).then(() => {
......
......@@ -81,7 +81,6 @@
import { getInspectionTaskListAPI} from '@/api'
import { parseTime } from '@/utils'
import { showNotify } from 'vant';
defineOptions({
name: 'Sales_point_inspection'
......@@ -140,6 +139,7 @@ const handleClickStore = (item) => {
query: {
storeName: item.storeName,
storeCode: item.storeCode,
rstId: item.rstId,
storePicture: item.storePictures?.split(",")[0]
}
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论