提交 31e332d1 authored 作者: lidongxu's avatar lidongxu

feat(audit_activity/inspectiontast): 新增:勤策移动端_售点稽核的 JS 功能完成稽查任务部分

上级 78f1f18a
...@@ -7,3 +7,28 @@ export function getTerminalStoreListAPI(params) { ...@@ -7,3 +7,28 @@ export function getTerminalStoreListAPI(params) {
params params
}) })
} }
// 售点稽查-单条任务详情
export function getInspectionTaskDetailAPI(params) {
return request({
url: '/operation/risk/query/i_store',
params
})
}
// 售点稽查-创建/修改任务总体(页面对应外框总体)
export function createInspectionTaskAPI(data) {
return request({
url: '/operation/risk/core/i_store',
method: 'POST',
data
})
}
// 售点稽查-创建/修改任务明细(4 个tab页)
export function createInspectionTaskDetailAPI(params) {
return request({
url: '/operation/risk/create/i_store',
params
})
}
...@@ -42,7 +42,6 @@ router.beforeEach((to, from, next) => { ...@@ -42,7 +42,6 @@ router.beforeEach((to, from, next) => {
useVersionStore().getVersion().then((res) => { useVersionStore().getVersion().then((res) => {
// 生成可访问路由表 // 生成可访问路由表
accessRoutes.forEach(route => { accessRoutes.forEach(route => {
console.log('挂载路由', route)
if (!isHttp(route.path) ) { if (!isHttp(route.path) ) {
router.addRoute(route) router.addRoute(route)
} }
......
...@@ -10,11 +10,18 @@ ...@@ -10,11 +10,18 @@
<!-- 终端名称 --> <!-- 终端名称 -->
<div class="terminal-wrap"> <div class="terminal-wrap">
<div> <div>
<van-image width="2.25rem" <van-image fit="scale-down"
height="3.5rem"></van-image> width="2.25rem"
height="3.5rem"
:src="form.storePicture || form.commitStorePicture[0]?.url"
@click="previewStoreImage"></van-image>
</div> </div>
<div class="terminal-info"> <div class="terminal-info">
<p>终端名称:世纪港湾广缘超时</p> <div class="terminal-name">
<span>终端名称:</span>
<van-field v-model="form.storeName"
placeholder="请输入终端名" />
</div>
<p>终端编码:P0500052306</p> <p>终端编码:P0500052306</p>
<p>经销商:秦皇岛红朗森商贸有限公司</p> <p>经销商:秦皇岛红朗森商贸有限公司</p>
<p>地址:河北省秦皇岛市海港区北环路街道秦皇岛冻结附录</p> <p>地址:河北省秦皇岛市海港区北环路街道秦皇岛冻结附录</p>
...@@ -36,18 +43,21 @@ ...@@ -36,18 +43,21 @@
<van-field label="门头照" <van-field label="门头照"
label-align="top"> label-align="top">
<template #input> <template #input>
<van-uploader :max-count="2" <van-uploader :max-count="1"
accept="image/*" accept="image/*"
v-model="form.posPhotos" capture="camera"
:after-read="posPhotosRead" reupload
preview-size="120" :model-value="form.commitStorePicture"
@delete="deletePosPhotos"> :after-read="commitStorePhotosRead"
preview-size="78"
@delete="deleteCommitStorePhotos">
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
</div> </div>
<!-- 门店类型选择 --> <!-- 门店类型选择 -->
<van-field :model-value="form.selectedType.join('')" <van-field :model-value="form.selectedType.join('')"
readonly
label="门店类型" label="门店类型"
label-align="top" label-align="top"
placeholder="请选择" placeholder="请选择"
...@@ -84,7 +94,7 @@ ...@@ -84,7 +94,7 @@
<van-field label="礼盒/礼袋是否在售:" <van-field label="礼盒/礼袋是否在售:"
label-align="top"> label-align="top">
<template #input> <template #input>
<van-checkbox-group v-model="form.verify" <van-checkbox-group v-model="form.lhldArr"
direction="horizontal" direction="horizontal"
shape="square"> shape="square">
<van-checkbox name="礼盒">礼盒</van-checkbox> <van-checkbox name="礼盒">礼盒</van-checkbox>
...@@ -92,10 +102,13 @@ ...@@ -92,10 +102,13 @@
</van-checkbox-group> </van-checkbox-group>
</template> </template>
</van-field> </van-field>
<van-field label="我品 SKU 总数:" <van-field v-model="form.skuNum"
label="我品 SKU 总数:"
type="number"
placeholder="请输入" placeholder="请输入"
label-align="top" /> label-align="top" />
<van-field label="备注:" <van-field v-model="form.remark"
label="备注:"
placeholder="请输入" placeholder="请输入"
label-align="top" label-align="top"
type="textarea" type="textarea"
...@@ -105,12 +118,14 @@ ...@@ -105,12 +118,14 @@
<van-field label="大日期产品照片" <van-field label="大日期产品照片"
label-align="top"> label-align="top">
<template #input> <template #input>
<van-uploader :max-count="2" <van-uploader :max-count="4"
accept="image/*" accept="image/*"
v-model="form.posPhotos" capture="camera"
:after-read="posPhotosRead" reupload
preview-size="120" :model-value="form.longTimePictureArr"
@delete="deletePosPhotos"> :after-read="longTimePictureArrRead"
preview-size="78"
@delete="deleteLongTimePictureArr">
</van-uploader> </van-uploader>
</template> </template>
</van-field> </van-field>
...@@ -121,19 +136,51 @@ ...@@ -121,19 +136,51 @@
</template> </template>
<script setup> <script setup>
import { uploadFileToOSSAPI, getLocation } from '@/api' import { uploadFileToOSSAPI, getLocation, getInspectionTaskDetailAPI, createInspectionTaskAPI } from '@/api'
import { typeOptions as typeOption } from '@/views/mobile/constant' import { typeOptions as typeOption } from '@/views/mobile/constant'
import convention from './tabs/conventionalDisplay.vue' import convention from './tabs/conventionalDisplay.vue'
import scheduleDisplay from './tabs/scheduleDisplay.vue' import scheduleDisplay from './tabs/scheduleDisplay.vue'
import scheduleAdjustment from './tabs/scheduleAdjustment.vue' import scheduleAdjustment from './tabs/scheduleAdjustment.vue'
import categoryInfomation from './tabs/categoryInfomation.vue' import categoryInfomation from './tabs/categoryInfomation.vue'
import { showImagePreview } from 'vant';
import useUserStore from '@/store/modules/user'
import { v4 as uuidv4 } from 'uuid'
const router = useRouter(); const router = useRouter()
const form = reactive({ const route = useRoute()
/*************** 稽查任务总体 ***************/
const form = reactive({ // 当前页信息总对象
selectedType: [], // 门店类型 selectedType: [], // 门店类型
storePicture: route.query.storePicture, // 门店照片(原始门店照片)
storeName: route.query.storeName, // 门店名称
storeCode: route.query.storeCode, // 门店编码
dealersName: route.query.dealersName, // 经销商名称
storeAddr: route.query.storeAddr, // 门店地址
commitStorePicture: [], // 上报拍摄的门店照片
lhldArr: [], // 其他-礼盒礼袋是否在售
skuNum: '', // 我品 SKU 总数
remark: '', // 备注
longTimePictureArr: [], // 大日期产品照片
}) })
// 地理定位 // 稽查任务详情
const getInspectionTaskDetailFn = async () => {
const res = await getInspectionTaskDetailAPI({
storeCode: form.storeCode
})
console.log(res)
}
getInspectionTaskDetailFn()
// 门店图片预览
const previewStoreImage = () => {
showImagePreview({
images: [form.storePicture],
})
}
/*************** 地理定位 ***************/
const addressStr = ref('') const addressStr = ref('')
const addressLoading = ref(true) const addressLoading = ref(true)
const getLocationFn = () => { const getLocationFn = () => {
...@@ -178,40 +225,45 @@ const handleClickLocation = () => { ...@@ -178,40 +225,45 @@ const handleClickLocation = () => {
}, 1500) }, 1500)
} }
// 门头照 /*************** 门头照上传 ***************/
// 门头照上传逻辑 // 上传照片
// POS 两张照片 const commitStorePhotosRead = async (file) => {
const posPhotosRead = async (file) => { const pictureUrl = await uploadFileToOSSAPI(`risk/${form.storeCode}storeFrontPhoto/${useUserStore().userInfo.employeeNo}/${uuidv4()}.png`, file.file)
form.commitStorePicture = [{
// 处理上传的文件
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`risk/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
// 判断 objectUrl
const index = form.value.posPhotos.findIndex(o => o.objectUrl)
form.value.posPhotos[index] = {
url: pictureUrl url: pictureUrl
} }]
showNotify({ type: 'success', message: '门头照,上传成功' })
} }
// 删除 照片 // 删除照片
const deletePosPhotos = async () => { const deleteCommitStorePhotos = async () => {
if (isInitializing.value) return form.commitStorePicture = []
showNotify({ type: 'success', message: '门头照,删除成功' })
showNotify({ type: 'success', message: 'POS 照片删除成功' })
} }
// 门店类型 /*************** 门店类型 ***************/
const showTypePopup = ref(false)
const typeOptions = ref(typeOption); // 门店类型 const typeOptions = ref(typeOption); // 门店类型
const showTypePopup = ref(false)
// 确认门店类型 // 确认门店类型
const handleTypeConfirm = (val) => { const handleTypeConfirm = ({ selectedValues }) => {
form.selectedType = val; form.selectedType = selectedValues;
showTypePopup.value = false; showTypePopup.value = false;
}; };
// 信息填写组 /****** 大日期产品照片 ***************/
const longTimePictureArrRead = async (file) => {
const pictureUrl = await uploadFileToOSSAPI(`risk/${form.storeCode}longTimePicture/${useUserStore().userInfo.employeeNo}/${uuidv4()}.png`, file.file)
form.longTimePictureArr.push({
url: pictureUrl
})
showNotify({ type: 'success', message: '大日期产品照片,上传成功' })
}
// 删除照片
const deleteLongTimePictureArr = async (file, { name, index }) => {
form.longTimePictureArr.splice(index, 1)
showNotify({ type: 'success', message: '大日期产品照片,删除成功' })
}
/*************** 信息填写组 ***************/
const active = ref(0) const active = ref(0)
</script> </script>
...@@ -247,17 +299,28 @@ const active = ref(0) ...@@ -247,17 +299,28 @@ const active = ref(0)
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
.terminal-name {
color: black;
font-size: 15px;
font-weight: bold;
display: flex;
align-items: center;
span {
display: inline-block;
width: 120px;
}
.van-cell {
padding: 0;
}
}
p { p {
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
color: #a1a1a1; color: #a1a1a1;
} }
p:first-child {
color: black;
font-size: 15px;
font-weight: bold;
}
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
</template> </template>
</van-field> </van-field>
<van-field v-model="selectedTypeObj.price" <van-field v-model="selectedTypeObj.price"
type="number"
:label="selectedTypeObj.label + ' 价格:'" :label="selectedTypeObj.label + ' 价格:'"
label-width="4rem" label-width="4rem"
placeholder="请输入价格" placeholder="请输入价格"
...@@ -39,19 +40,16 @@ ...@@ -39,19 +40,16 @@
:key="index"> :key="index">
<div class="table-cell first-column">{{ obj.name }}</div> <div class="table-cell first-column">{{ obj.name }}</div>
<div class="table-cell second-column"> <div class="table-cell second-column">
<van-field :model-value="obj.value" <van-field type="text"
type="text"
placeholder="请输入" placeholder="请输入"
:border="false" :border="false"
class="cell-input"> class="cell-input">
<template #input> <template #input>
<el-date-picker v-model="obj.value" <el-date-picker v-model="obj.value"
type="month" type="month"
placeholder="选择月份" placeholder="选择月份" />
:size="size" />
</template> </template>
</van-field> </van-field>
</div> </div>
</div> </div>
</div> </div>
...@@ -350,6 +348,7 @@ const selectedTypeObj = ref(typeOptions.value[0]) ...@@ -350,6 +348,7 @@ const selectedTypeObj = ref(typeOptions.value[0])
::v-deep(.van-cell__value) { ::v-deep(.van-cell__value) {
display: flex; display: flex;
align-items: center; align-items: center;
.van-field__control { .van-field__control {
.el-input { .el-input {
width: auto; width: auto;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
:rules="[{ required: true, message: '请输入形式' }]" /> :rules="[{ required: true, message: '请输入形式' }]" />
<van-field v-model="obj.cost" <van-field v-model="obj.cost"
name="cost" name="cost"
type="number"
label="费用" label="费用"
placeholder="费用" placeholder="费用"
auto-complete="off" auto-complete="off"
...@@ -23,9 +24,12 @@ ...@@ -23,9 +24,12 @@
<template #input> <template #input>
<van-uploader :max-count="2" <van-uploader :max-count="2"
accept="image/*" accept="image/*"
v-model="obj.displayPhotos" capture="camera"
reupload
:model-value="obj.displayPhotos"
:name="index"
:after-read="displayPhotosRead" :after-read="displayPhotosRead"
preview-size="120" preview-size="78"
@delete="deletedisplayPhotos"> @delete="deletedisplayPhotos">
</van-uploader> </van-uploader>
</template> </template>
...@@ -65,7 +69,13 @@ ...@@ -65,7 +69,13 @@
</template> </template>
<script setup> <script setup>
// 陈列组信息 import { uploadFileToOSSAPI } from '@/api'
import useUserStore from '@/store/modules/user'
import { v4 as uuidv4 } from 'uuid'
const route = useRoute()
/*************** 陈列组信息 ***************/
// 陈列组
const displayGroup = ref([ const displayGroup = ref([
{ {
modality: '', // 形式 modality: '', // 形式
...@@ -84,31 +94,28 @@ const addItem = () => { ...@@ -84,31 +94,28 @@ const addItem = () => {
}) })
} }
/*************** 陈列照片 ***************/
// 上传照片
const displayPhotosRead = async (file, { name, index }) => {
// name:是当前照片组件所在陈列组的索引
// index: 当前照片组的索引
const target = displayGroup.value[name]
// 陈列照片 const pictureUrl = await uploadFileToOSSAPI(`risk/${route.query.storeCode}/displayPhoto/${useUserStore().userInfo.employeeNo}/${uuidv4()}.png`, file.file)
const displayPhotosRead = async (file) => { target.displayPhotos.push({
// 处理上传的文件
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`risk/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
// 判断 objectUrl
const index = form.value.posPhotos.findIndex(o => o.objectUrl)
form.value.posPhotos[index] = {
url: pictureUrl url: pictureUrl
} })
showNotify({ type: 'success', message: '常规陈列照片,上传成功' })
} }
// 删除 照片 // 删除照片
const deletedisplayPhotos = async () => { const deletedisplayPhotos = async (file, { name, index }) => {
if (isInitializing.value) return const target = displayGroup.value[name]
target.displayPhotos.splice(index, 1)
showNotify({ type: 'success', message: 'POS 照片删除成功' }) showNotify({ type: 'success', message: '常规陈列照片,删除成功' })
} }
// 总体核查结果 /*************** 总体核查结果 ***************/
const overAll = ref({}) const overAll = ref({})
</script> </script>
...@@ -129,6 +136,7 @@ const overAll = ref({}) ...@@ -129,6 +136,7 @@ const overAll = ref({})
/* 每个分组 */ /* 每个分组 */
.item { .item {
margin-bottom: 10px; margin-bottom: 10px;
.van-cell-group { .van-cell-group {
padding: 0; padding: 0;
margin: 0; margin: 0;
......
...@@ -23,9 +23,12 @@ ...@@ -23,9 +23,12 @@
<template #input> <template #input>
<van-uploader :max-count="2" <van-uploader :max-count="2"
accept="image/*" accept="image/*"
v-model="obj.displayPhotos" capture="camera"
reupload
:model-value="obj.displayPhotos"
:name="index"
:after-read="displayPhotosRead" :after-read="displayPhotosRead"
preview-size="120" preview-size="78"
@delete="deletedisplayPhotos"> @delete="deletedisplayPhotos">
</van-uploader> </van-uploader>
</template> </template>
...@@ -65,7 +68,12 @@ ...@@ -65,7 +68,12 @@
</template> </template>
<script setup> <script setup>
// 陈列组信息 import { uploadFileToOSSAPI } from '@/api'
import useUserStore from '@/store/modules/user'
import { v4 as uuidv4 } from 'uuid'
const route = useRoute()
/*************** 陈列组信息 ***************/
const displayGroup = ref([ const displayGroup = ref([
{ {
modality: '', // 形式 modality: '', // 形式
...@@ -84,27 +92,20 @@ const addItem = () => { ...@@ -84,27 +92,20 @@ const addItem = () => {
}) })
} }
/*************** 照片 ***************/
// 陈列照片 const displayPhotosRead = async (file, { name, index }) => {
const displayPhotosRead = async (file) => { const target = displayGroup.value[name]
const pictureUrl = await uploadFileToOSSAPI(`risk/${route.query.storeCode}/scheduleAdjustmentPhoto/${useUserStore().userInfo.employeeNo}/${uuidv4()}.png`, file.file)
// 处理上传的文件 target.displayPhotos.push({
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`risk/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
// 判断 objectUrl
const index = form.value.posPhotos.findIndex(o => o.objectUrl)
form.value.posPhotos[index] = {
url: pictureUrl url: pictureUrl
} })
showNotify({ type: 'success', message: '照片上传成功' })
} }
// 删除 照片 // 删除照片
const deletedisplayPhotos = async () => { const deletedisplayPhotos = async (file, { name, index }) => {
if (isInitializing.value) return const target = displayGroup.value[name]
target.displayPhotos.splice(index, 1)
showNotify({ type: 'success', message: 'POS 照片删除成功' }) showNotify({ type: 'success', message: '照片删除成功' })
} }
......
...@@ -23,9 +23,12 @@ ...@@ -23,9 +23,12 @@
<template #input> <template #input>
<van-uploader :max-count="2" <van-uploader :max-count="2"
accept="image/*" accept="image/*"
v-model="obj.displayPhotos" capture="camera"
reupload
:model-value="obj.displayPhotos"
:name="index"
:after-read="displayPhotosRead" :after-read="displayPhotosRead"
preview-size="120" preview-size="78"
@delete="deletedisplayPhotos"> @delete="deletedisplayPhotos">
</van-uploader> </van-uploader>
</template> </template>
...@@ -65,7 +68,12 @@ ...@@ -65,7 +68,12 @@
</template> </template>
<script setup> <script setup>
// 陈列组信息 import { uploadFileToOSSAPI } from '@/api'
import useUserStore from '@/store/modules/user'
import { v4 as uuidv4 } from 'uuid'
const route = useRoute()
/*************** 陈列组信息 ***************/
const displayGroup = ref([ const displayGroup = ref([
{ {
modality: '', // 形式 modality: '', // 形式
...@@ -84,30 +92,21 @@ const addItem = () => { ...@@ -84,30 +92,21 @@ const addItem = () => {
}) })
} }
/*************** 照片 ***************/
// 陈列照片 const displayPhotosRead = async (file, { name, index }) => {
const displayPhotosRead = async (file) => {
// 处理上传的文件 // 处理上传的文件
const date = new Date() const pictureUrl = await uploadFileToOSSAPI(`risk/${route.query.storeCode}/scheduleDisplayPhoto/${useUserStore().userInfo.employeeNo}/${uuidv4()}.png`, file.file)
const month = date.getMonth() + 1 displayGroup.value[name].displayPhotos.push({
const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`risk/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
// 判断 objectUrl
const index = form.value.posPhotos.findIndex(o => o.objectUrl)
form.value.posPhotos[index] = {
url: pictureUrl url: pictureUrl
} })
showNotify({ type: 'success', message: '照片上传成功' })
} }
// 删除 照片 // 删除 照片
const deletedisplayPhotos = async () => { const deletedisplayPhotos = async (file, { name, index }) => {
if (isInitializing.value) return displayGroup.value[name].displayPhotos.splice(index, 1)
showNotify({ type: 'success', message: '照片删除成功' })
showNotify({ type: 'success', message: 'POS 照片删除成功' })
} }
// 总体核查结果 // 总体核查结果
const overAll = ref({}) const overAll = ref({})
</script> </script>
......
...@@ -69,7 +69,9 @@ import { uploadFileToOSSAPI } from '@/api' ...@@ -69,7 +69,9 @@ import { uploadFileToOSSAPI } from '@/api'
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { typeOptions as typeOption } from '@/views/mobile/constant' import { typeOptions as typeOption } from '@/views/mobile/constant'
const router = useRouter(); const router = useRouter();
const form = ref({ const form = ref({
selectedType: [] selectedType: []
}) })
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<van-tag type="primary" <van-tag type="primary"
round round
size="medium" size="medium"
@click="router.push({ path: '/taskList' })">稽查记录</van-tag> @click="clickRecord">稽查记录</van-tag>
</template> </template>
</van-nav-bar> </van-nav-bar>
<!-- 头部区域 --> <!-- 头部区域 -->
...@@ -59,7 +59,7 @@ import { getTerminalStoreListAPI } from '@/api' ...@@ -59,7 +59,7 @@ import { getTerminalStoreListAPI } from '@/api'
const router = useRouter(); const router = useRouter();
/*************** 终端门店列表 *******************/ /*************** 终端门店列表 ***************/
const query = reactive({ const query = reactive({
col: '', col: '',
pageNum: 1, pageNum: 1,
...@@ -105,10 +105,11 @@ const handlerSearch = () => { ...@@ -105,10 +105,11 @@ const handlerSearch = () => {
getTerminalStoreListFn() getTerminalStoreListFn()
} }
/*******新增终端********/ /*************** 跳转路由 ***************/
const addNewTerminal = () => { // 稽查记录
const clickRecord = () => {
router.push({ router.push({
path: '/newTerminal' path: '/taskList'
}) })
} }
...@@ -117,11 +118,21 @@ const handleClickStore = (item) => { ...@@ -117,11 +118,21 @@ const handleClickStore = (item) => {
router.push({ router.push({
path: '/inspectionTask', path: '/inspectionTask',
query: { query: {
storeName: item.name, storeName: item.storeName,
storeCode: item.code storeCode: item.storeCode,
dealersName: item.dealersName,
storeAddr: item.storeAddr,
storePicture: item.storePictures?.split(",")[0]
} }
}) })
} }
// 新建终端
const addNewTerminal = () => {
router.push({
path: '/newTerminal'
})
}
</script> </script>
<style lang="scss" <style lang="scss"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论