提交 1ec485b7 authored 作者: lidongxu's avatar lidongxu

refactor(inspectiontask/*): 修改:勤策移动端_售点稽查_照片按照年月分组

上级 b1f5468e
......@@ -325,7 +325,10 @@ const handleClickLocation = () => {
/*************** 门头照上传 ***************/
// 上传照片
const commitStorePhotosRead = async (file) => {
const pictureUrl = await uploadFileToOSSAPI(`risk/storeFrontPhoto/${useUserStore().empInfo.empNo}/${form.storeCode}.png`, file.file)
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`risk/storeFrontPhoto/${date.getFullYear()}-${month}/${useUserStore().empInfo.empNo}/${form.storeCode}.png`, file.file)
form.commitStorePicture = [{
url: pictureUrl
}]
......@@ -400,7 +403,10 @@ const handleRemarkChange = async () => {
// 大日期照片上传
const longTimePictureArrRead = async (file) => {
const pictureUrl = await uploadFileToOSSAPI(`risk/longTimePicture/${useUserStore().empInfo.empNo}/${form.storeCode}/${uuidv4()}.png`, file.file)
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`risk/longTimePicture/${date.getFullYear()}-${month}/${useUserStore().empInfo.empNo}/${form.storeCode}/${uuidv4()}.png`, file.file)
form.longTimePictureArr.push({
url: pictureUrl
})
......
......@@ -183,9 +183,11 @@ const handleCostChange = async (index) => {
const displayPhotosRead = async (file, { name, index }) => {
// name:是当前照片组件所在陈列组的索引
// index: 当前照片组的索引
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const target = displayGroup.value[name]
const pictureUrl = await uploadFileToOSSAPI(`risk/displayPhoto/${useUserStore().empInfo.empNo}/${props.form.storeCode}/${uuidv4()}.png`, file.file)
const pictureUrl = await uploadFileToOSSAPI(`risk/displayPhoto/${date.getFullYear()}-${month}/${useUserStore().empInfo.empNo}/${props.form.storeCode}/${uuidv4()}.png`, file.file)
target.photoArr.push({
url: pictureUrl
})
......
......@@ -181,9 +181,11 @@ const handleCostChange = async (index) => {
const displayPhotosRead = async (file, { name, index }) => {
// name:是当前照片组件所在陈列组的索引
// index: 当前照片组的索引
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const target = displayGroup.value[name]
const pictureUrl = await uploadFileToOSSAPI(`risk/scheduleAdjustmentPhoto/${useUserStore().empInfo.empNo}/${props.form.storeCode}/${uuidv4()}.png`, file.file)
const pictureUrl = await uploadFileToOSSAPI(`risk/scheduleAdjustmentPhoto/${date.getFullYear()}-${month}/${useUserStore().empInfo.empNo}/${props.form.storeCode}/${uuidv4()}.png`, file.file)
target.photoArr.push({
url: pictureUrl
})
......
......@@ -76,7 +76,7 @@
</template>
<script setup>
import { uploadFileToOSSAPI, createInspectionTaskAPI, createInspectionTaskDetailAPI, deleteInspectionTaskAPI } from '@/api'
import { uploadFileToOSSAPI, createInspectionTaskAPI, createInspectionTaskDetailAPI, deleteInspectionTaskAPI } from '@/api'
import useUserStore from '@/store/modules/user'
import { v4 as uuidv4 } from 'uuid'
......@@ -181,9 +181,11 @@ const handleCostChange = async (index) => {
const displayPhotosRead = async (file, { name, index }) => {
// name:是当前照片组件所在陈列组的索引
// index: 当前照片组的索引
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const target = displayGroup.value[name]
const pictureUrl = await uploadFileToOSSAPI(`risk/scheduleDisplayPhoto/${useUserStore().empInfo.empNo}/${props.form.storeCode}/${uuidv4()}.png`, file.file)
const pictureUrl = await uploadFileToOSSAPI(`risk/scheduleDisplayPhoto/${date.getFullYear()}-${month}/${useUserStore().empInfo.empNo}/${props.form.storeCode}/${uuidv4()}.png`, file.file)
target.photoArr.push({
url: pictureUrl
})
......
......@@ -37,7 +37,8 @@
label="门店类型"
label-align="top"
placeholder="请选择"
@click="showTypePopup = true" :rules="[{ required: true, message: '请选择门店类型' }]"/>
@click="showTypePopup = true"
:rules="[{ required: true, message: '请选择门店类型' }]" />
<van-popup v-model:show="showTypePopup"
position="bottom"
@close="showTypePopup = false">
......@@ -80,7 +81,10 @@ const showTypePopup = ref(false);
// 门头照上传逻辑
const posPhotosRead = async (file) => {
const pictureUrl = await uploadFileToOSSAPI(`risk/newTerminal-storePhoto/${useUserStore().empInfo.empNo}/${uuidv4()}.png`, file.file)
const date = new Date()
const month = date.getMonth() + 1
const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`risk/newTerminal-storePhoto/${date.getFullYear()}-${month}/${useUserStore().empInfo.empNo}/${uuidv4()}.png`, file.file)
form.storePicture = [{
url: pictureUrl
}]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论