提交 c24e0cc6 authored 作者: lidongxu's avatar lidongxu

fix(hooks): 修改了 hooks 里代码冲突问题

同上
...@@ -9,7 +9,7 @@ VITE_APP_PUBLIC_PATH = '/' ...@@ -9,7 +9,7 @@ VITE_APP_PUBLIC_PATH = '/'
VITE_APP_BASE_API = '/dev-api' # 小卤 VITE_APP_BASE_API = '/dev-api' # 小卤
# VITE_APP_BASE_API = '/ql_local' # 小卤 # VITE_APP_BASE_API = '/ql_local' # 小卤
# VITE_APP_BASE_API = '/bc_local' # 小卤 # VITE_APP_BASE_API = '/bc_local' # 小卤
VITE_APP_PROMOTION = '/promotion-api' # 促销 VITE_APP_PROMOTION = '/dev-promotion-api' # 促销
# 飞书服务回调地址(本地测试已经通过并上线,后台飞书登录接口重定向地址已经不是 localhost 了所以本地开发无需使用飞书登录,线上已经可用) # 飞书服务回调地址(本地测试已经通过并上线,后台飞书登录接口重定向地址已经不是 localhost 了所以本地开发无需使用飞书登录,线上已经可用)
VITE_APP_REDIRECT_URL = 'http://localhost:8085' VITE_APP_REDIRECT_URL = 'http://localhost:8085'
......
...@@ -14,8 +14,5 @@ VITE_APP_REDIRECT_URL = 'https://sfa.wxl66.cn/link/' ...@@ -14,8 +14,5 @@ VITE_APP_REDIRECT_URL = 'https://sfa.wxl66.cn/link/'
# 积木报表服务地址 # 积木报表服务地址
VITE_APP_REPORT_URL = 'https://sfa.wxl66.cn' VITE_APP_REPORT_URL = 'https://sfa.wxl66.cn'
# 模板表格 # 模板表格
VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF3.0.xlsx' VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF3.0.xlsx'
\ No newline at end of file
...@@ -84,15 +84,12 @@ export function updatePlanByWebAPI(data) { ...@@ -84,15 +84,12 @@ export function updatePlanByWebAPI(data) {
} }
// 查询门店列表 // 查询门店列表
export function getPlanStoreListAPI(queryParams = {}) { export function getPlanStoreListAPI(data) {
return request({ return request({
baseURL: VITE_APP_PROMOTION, baseURL: VITE_APP_PROMOTION,
url: '/user/clientele/query/store/list', url: '/user/clientele/query/store/list',
method: 'POST', method: 'POST',
data: { data
storeNameVague: queryParams.storeName,
storeCode: queryParams.storeCode,
}
}) })
} }
......
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
/** /**
* 判断计划是否可编辑/删除 * 判断计划是否可变更/删除
* @param {*} row 计划信息对象 * @param {*} row 计划信息对象
* @returns boolean true 可编辑/删除,false 不可编辑/删除 * @returns boolean true 可变更/删除,false 不可变更/删除
*/ */
export const checkPlanExpire = (row) => { export const checkPlanExpire = (row) => {
// 1. 计划已经开始,不可编辑/删除 // 1. 计划已经开始,不可编辑/删除
...@@ -23,6 +23,18 @@ export const checkPlanExpire = (row) => { ...@@ -23,6 +23,18 @@ export const checkPlanExpire = (row) => {
} }
} }
/**
* 判断计划是否可变更(单独判断按钮禁用状态)
* 活动日期小于等于今日日期,则禁用变更按钮
* @param {*} row 计划信息对象
* @returns boolean true 可变更,false 不可变更
*/
export const checkPlanChangeExpire = (row) => {
const date = new Date()
const rowDate = new Date(row.date)
return !(rowDate <= date)
}
/** /**
* 判断任务是否可删除 * 判断任务是否可删除
* @param {*} row 计划信息对象 * @param {*} row 计划信息对象
......
...@@ -14,6 +14,10 @@ const props = defineProps({ ...@@ -14,6 +14,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false default: false
}, },
setNowMaxMonth: { // 设置当前月为最大日期
type: Boolean,
default: false
},
defaultDate: { // 默认日期 defaultDate: { // 默认日期
type: [Array, Date, String], type: [Array, Date, String],
default: () => { default: () => {
...@@ -40,6 +44,10 @@ const searchMinDate = computed(() => { ...@@ -40,6 +44,10 @@ const searchMinDate = computed(() => {
// 设置最大日期选择范围 // 设置最大日期选择范围
const searchMaxDate = computed(() => { const searchMaxDate = computed(() => {
if (props.setNextMaxMonth) { if (props.setNextMaxMonth) {
// 设置当月最后一日为最大范围
if (props.setNowMaxMonth) {
return new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0)
}
// 设置下个月最后一日为最大范围 // 设置下个月最后一日为最大范围
return new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0) return new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0)
} else { } else {
......
...@@ -82,6 +82,16 @@ ...@@ -82,6 +82,16 @@
<van-radio name="未达标">未达标</van-radio> <van-radio name="未达标">未达标</van-radio>
</van-radio-group> </van-radio-group>
</div> </div>
<!-- 话术未达标备注输入 -->
<div class="form-item"
v-if="form.temHs === '未达标'">
<label>话术未达标备注:</label>
<van-field v-model="form.temHsRemark"
type="textarea"
placeholder="请输入话术未达标备注"
style="margin-top: 10px;"
@blur="changeForm('temHsRemark')" />
</div>
<div class="form-item"> <div class="form-item">
<label>物料是否齐全:</label> <label>物料是否齐全:</label>
<van-radio-group v-model="form.temWl" <van-radio-group v-model="form.temWl"
...@@ -90,6 +100,33 @@ ...@@ -90,6 +100,33 @@
<van-radio name="缺少">缺少</van-radio> <van-radio name="缺少">缺少</van-radio>
</van-radio-group> </van-radio-group>
</div> </div>
<!-- 试吃品是否齐全 -->
<div class="form-item">
<label>试吃品是否齐全:</label>
<van-radio-group v-model="form.temWlScp"
@change="changeForm('temWlScp')">
<van-radio name="齐全">齐全</van-radio>
<van-radio name="缺少">缺少</van-radio>
</van-radio-group>
</div>
<!-- 是否有试吃台 -->
<div class="form-item">
<label>是否有试吃台:</label>
<van-radio-group v-model="form.temWlSct"
@change="changeForm('temWlSct')">
<van-radio name="有"></van-radio>
<van-radio name="无"></van-radio>
</van-radio-group>
</div>
<!-- 是否有试吃托盘 -->
<div class="form-item">
<label>是否有试吃托盘:</label>
<van-radio-group v-model="form.temWlSctp"
@change="changeForm('temWlSctp')">
<van-radio name="有"></van-radio>
<van-radio name="无"></van-radio>
</van-radio-group>
</div>
<div class="form-item"> <div class="form-item">
<label>着装是否达标:</label> <label>着装是否达标:</label>
<van-radio-group v-model="form.temZz" <van-radio-group v-model="form.temZz"
...@@ -169,7 +206,25 @@ ...@@ -169,7 +206,25 @@
</van-uploader> </van-uploader>
</div> </div>
<!-- 促销员工资 -->
<div class="form-item">
<label>促销员工资:</label>
<van-field v-model="form.temSalary"
type="number"
:controls="true"
placeholder="请输入促销员工资"
style="margin-top: 10px;"
@change="changeForm('temSalary')" />
</div>
<!-- 备注 -->
<div class="form-item">
<label>备注:</label>
<van-field v-model="form.remark"
type="textarea"
placeholder="请输入备注"
style="margin-top: 10px;"
@change="changeForm('remark')" />
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -197,6 +252,11 @@ const form = ref({ ...@@ -197,6 +252,11 @@ const form = ref({
temHs: '未达标', // 话述 temHs: '未达标', // 话述
temWl: '缺少', // 物料 temWl: '缺少', // 物料
temZz: '未达标', // 着装 temZz: '未达标', // 着装
temWlScp: '缺少', // 试吃品
temWlSct: '无', // 试吃台
temWlSctp: '无', // 试吃托盘
temSalary: 0, // 促销员工资
remark: '', // 备注
temWorkPhotos: [], // 在/离岗取证照片 temWorkPhotos: [], // 在/离岗取证照片
storeTcPhoto: [], // 特陈照 storeTcPhoto: [], // 特陈照
storeZhjPhoto: [], // 主货架照 storeZhjPhoto: [], // 主货架照
...@@ -270,12 +330,20 @@ const getDetail = async () => { ...@@ -270,12 +330,20 @@ const getDetail = async () => {
form.value.temHs = res.data.temHs === null ? '达标' : res.data.temHs form.value.temHs = res.data.temHs === null ? '达标' : res.data.temHs
form.value.temWl = res.data.temWl === null ? '齐全' : res.data.temWl form.value.temWl = res.data.temWl === null ? '齐全' : res.data.temWl
form.value.temZz = res.data.temZz === null ? '达标' : res.data.temZz form.value.temZz = res.data.temZz === null ? '达标' : res.data.temZz
form.value.temWlScp = res.data.temWlScp === null ? '齐全' : res.data.temWlScp
form.value.temWlSct = res.data.temWlSct === null ? '有' : res.data.temWlSct
form.value.temWlSctp = res.data.temWlSctp === null ? '有' : res.data.temWlSctp
form.value.temSalary = res.data.temSalary || 0
} else { } else {
form.value.storeDd = res.data.storeDd === null ? '否' : res.data.storeDd form.value.storeDd = res.data.storeDd === null ? '否' : res.data.storeDd
form.value.temOnWork = res.data.temOnWork === null ? '离岗' : res.data.temOnWork form.value.temOnWork = res.data.temOnWork === null ? '离岗' : res.data.temOnWork
form.value.temHs = res.data.temHs === null ? '未达标' : res.data.temHs form.value.temHs = res.data.temHs === null ? '未达标' : res.data.temHs
form.value.temWl = res.data.temWl === null ? '缺少' : res.data.temWl form.value.temWl = res.data.temWl === null ? '缺少' : res.data.temWl
form.value.temZz = res.data.temZz === null ? '未达标' : res.data.temZz form.value.temZz = res.data.temZz === null ? '未达标' : res.data.temZz
form.value.temWlScp = res.data.temWlScp === null ? '缺少' : res.data.temWlScp
form.value.temWlSct = res.data.temWlSct === null ? '无' : res.data.temWlSct
form.value.temWlSctp = res.data.temWlSctp === null ? '无' : res.data.temWlSctp
form.value.temSalary = res.data.temSalary || 0
} }
form.value.temWorkPhotos = res.data?.temWorkPhotos ? (res.data.temWorkPhotos.map(o => { form.value.temWorkPhotos = res.data?.temWorkPhotos ? (res.data.temWorkPhotos.map(o => {
...@@ -402,6 +470,18 @@ const changeTemZz = async () => { ...@@ -402,6 +470,18 @@ const changeTemZz = async () => {
}) })
} }
// 选项值改变调用接口
const changeForm = async (arg) => {
await createExamine({
id: form.value.id,
[arg]: form.value[arg],
// temHsRemark: form.value.temHsRemark,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
}
// 在/离岗照片上传 // 在/离岗照片上传
const temWorkPhotosRead = async (file) => { const temWorkPhotosRead = async (file) => {
// 处理上传的文件 // 处理上传的文件
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<van-cell-group inset> <van-cell-group inset>
<van-field v-model="form.storeName" <van-field v-model="form.storeName"
is-link is-link
:disabled="!!planId"
label="选择门店" label="选择门店"
required required
:rules="[{ required: true, message: '请选择门店' }]" :rules="[{ required: true, message: '请选择门店' }]"
...@@ -24,8 +23,7 @@ ...@@ -24,8 +23,7 @@
readonly readonly
:value="form.storeName" :value="form.storeName"
name="storeName" name="storeName"
placeholder="点击选择门店" placeholder="点击选择门店">
:disabled="!!planId">
<p v-if="form.storeName && !planId">{{ form.storeAddr }} - {{ form.storeCode }}</p> <p v-if="form.storeName && !planId">{{ form.storeAddr }} - {{ form.storeCode }}</p>
</div> </div>
</template> </template>
...@@ -33,7 +31,6 @@ ...@@ -33,7 +31,6 @@
<van-field :modelValue="parseTime(form.date, '{y}-{m}-{d}')" <van-field :modelValue="parseTime(form.date, '{y}-{m}-{d}')"
is-link is-link
readonly readonly
:disabled="!!planId"
name="date" name="date"
label="活动日期" label="活动日期"
placeholder="点击选择时间" placeholder="点击选择时间"
...@@ -44,6 +41,7 @@ ...@@ -44,6 +41,7 @@
:default-date="form.date" :default-date="form.date"
:min-date="planMinDate" :min-date="planMinDate"
setNextMaxMonth setNextMaxMonth
:setNowMaxMonth="!!planId"
type="single" type="single"
@confirm="confirmCalendar" /> @confirm="confirmCalendar" />
<van-field v-model="form.pattern" <van-field v-model="form.pattern"
...@@ -177,6 +175,7 @@ const route = useRoute() ...@@ -177,6 +175,7 @@ const route = useRoute()
const clickBack = () => { const clickBack = () => {
router.back() router.back()
} }
const editDealerId = ref(null) // 变更计划的经销商 ID
const planId = route.params.planId const planId = route.params.planId
const init = async () => { const init = async () => {
...@@ -188,6 +187,8 @@ const init = async () => { ...@@ -188,6 +187,8 @@ const init = async () => {
form.inTime = parseTime(res.data.planInfo.clockInTime, "{h}:{i}") form.inTime = parseTime(res.data.planInfo.clockInTime, "{h}:{i}")
form.outTime = parseTime(res.data.planInfo.clockOutTime, "{h}:{i}") form.outTime = parseTime(res.data.planInfo.clockOutTime, "{h}:{i}")
minTime.value = form.inTime + ":00" minTime.value = form.inTime + ":00"
editDealerId.value = res.data.planInfo.dealerId
} }
if (planId) { if (planId) {
init() init()
...@@ -241,7 +242,8 @@ const selStoreName = async () => { ...@@ -241,7 +242,8 @@ const selStoreName = async () => {
// 获取门店列表 // 获取门店列表
const getStoreList = async (storeName) => { const getStoreList = async (storeName) => {
const res = await getPlanStoreListAPI({ const res = await getPlanStoreListAPI({
storeName storeNameVague: storeName,
dealerId: editDealerId.value
}) })
columns.value = res.data.map(item => ({ columns.value = res.data.map(item => ({
text: item.storeName, text: item.storeName,
...@@ -268,7 +270,12 @@ const planMinDate = computed(() => { ...@@ -268,7 +270,12 @@ const planMinDate = computed(() => {
date.setDate(1) date.setDate(1)
return date return date
} else { } else {
return new Date() // 如果是变更计划,则选择明天以后的日期
const date = new Date()
if (planId) {
date.setDate(date.getDate() + 1)
}
return date
} }
}) })
...@@ -352,6 +359,7 @@ const reset = () => { ...@@ -352,6 +359,7 @@ const reset = () => {
form.outTime = '' form.outTime = ''
form.salary = 0 form.salary = 0
form.incidentals = 0 form.incidentals = 0
editDealerId.value = null
} }
// Picker 选择器 // Picker 选择器
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
v-if="!showSelect && !query.isDeleted"> v-if="!showSelect && !query.isDeleted">
<van-button square <van-button square
type="success" type="success"
text="编辑" text="变更"
@click="editPlan(item)" /> @click="editPlan(item)" />
<van-button square <van-button square
type="danger" type="danger"
...@@ -88,7 +88,7 @@ defineOptions({ ...@@ -88,7 +88,7 @@ defineOptions({
}) })
import userStore from '@/store/modules/user' import userStore from '@/store/modules/user'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { checkPlanExpire } from '@/hooks' import { checkPlanExpire, checkPlanChangeExpire } from '@/hooks'
import { PROMOTION_STATUS, getPromotionActiveStatus } from '@/dicts' import { PROMOTION_STATUS, getPromotionActiveStatus } from '@/dicts'
import { getPlanListAPI, deletePlanAPI, batchUpdatePlanAPI, getChargeListAPI } from '@/api' import { getPlanListAPI, deletePlanAPI, batchUpdatePlanAPI, getChargeListAPI } from '@/api'
import PlanSearch from './planSearch.vue' import PlanSearch from './planSearch.vue'
...@@ -194,10 +194,14 @@ const querySearch = () => { ...@@ -194,10 +194,14 @@ const querySearch = () => {
getPlanList() getPlanList()
} }
// 编辑计划 // 变更计划
const editPlan = (row) => { const editPlan = (row) => {
if (!checkPlanExpire(row)) { if (!checkPlanExpire(row)) {
return proxy.$modal.msgWarning('无法编辑,已执行或之前计划') return proxy.$modal.msgWarning('无法变更,已执行或之前计划')
}
// 日期小于等于今日,无法变更
if (!checkPlanChangeExpire(row)) {
return proxy.$modal.msgWarning('无法变更,日期小于等于今日')
} }
router.push(`/m/promotion_plan_editing/${row.id}`) router.push(`/m/promotion_plan_editing/${row.id}`)
} }
......
...@@ -190,7 +190,6 @@ export function debounce(func, wait = 500, immediate) { ...@@ -190,7 +190,6 @@ export function debounce(func, wait = 500, immediate) {
// 如果延时不存在,重新设定延时 // 如果延时不存在,重新设定延时
if (!timeout) timeout = setTimeout(later, wait) if (!timeout) timeout = setTimeout(later, wait)
if (callNow) { if (callNow) {
console.log(args, 'args')
result = func.apply(context, args) result = func.apply(context, args)
context = args = null context = args = null
} }
......
...@@ -148,8 +148,8 @@ async function checkAutoLogin() { ...@@ -148,8 +148,8 @@ async function checkAutoLogin() {
if (state) { if (state) {
// 有 state 代表网页回调-自动登录 // 有 state 代表网页回调-自动登录
autoLoginLoading.value = true autoLoginLoading.value = true
state === 'fs' && loginByType('fs', { code }) state.includes('fs') && loginByType('fs', { code })
state === 'STATE' && loginByType('qc', { code }) state.includes('STATE') && loginByType('qc', { code })
} }
} }
checkAutoLogin() checkAutoLogin()
......
...@@ -80,9 +80,9 @@ ...@@ -80,9 +80,9 @@
<template #default="scope"> <template #default="scope">
<el-button type="success" <el-button type="success"
link link
:disabled="!selectableFn(scope.row)" :disabled="!selectableFn(scope.row) || !checkPlanChangeExpire(scope.row)"
@click="editFn(scope.row)"> @click="editFn(scope.row)">
编辑 变更
</el-button> </el-button>
<el-button type="danger" <el-button type="danger"
link link
...@@ -152,8 +152,7 @@ ...@@ -152,8 +152,7 @@
clearable clearable
@change="selStoreInfo" @change="selStoreInfo"
remote remote
:remote-method="remoteStoreMethod" :remote-method="remoteStoreMethod">
:disabled="!!addOrEditPlanForm.id">
<el-option v-for="item in storeList" <el-option v-for="item in storeList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
...@@ -177,9 +176,7 @@ ...@@ -177,9 +176,7 @@
<el-date-picker v-model="addOrEditPlanForm.date" <el-date-picker v-model="addOrEditPlanForm.date"
:clearable="false" :clearable="false"
start-placeholder="活动日期" start-placeholder="活动日期"
value-format="YYYY-MM-DDTHH:mm:ss" :disabled-date="disabledDateFn" />
:disabled-date="disabledDateFn"
:disabled="!!addOrEditPlanForm.id" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -320,7 +317,7 @@ ...@@ -320,7 +317,7 @@
<script setup> <script setup>
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { getPlanListAPI, uploadFileToOSSAPI, addPlanAPI, savePlanAPI, deletePlanAPI, addPlanByRoleAPI, getChargeListAPI, addPlanByWebAPI, updatePlanByWebAPI, getPlanStoreListAPI, updatePlanAPI, batchUpdatePlanAPI } from '@/api' import { getPlanListAPI, uploadFileToOSSAPI, addPlanAPI, savePlanAPI, deletePlanAPI, addPlanByRoleAPI, getChargeListAPI, addPlanByWebAPI, updatePlanByWebAPI, getPlanStoreListAPI, updatePlanAPI, batchUpdatePlanAPI } from '@/api'
import { checkPlanExpire } from '@/hooks' import { checkPlanExpire, checkPlanChangeExpire } from '@/hooks'
import userStore from '@/store/modules/user' import userStore from '@/store/modules/user'
import { PROMOTION_ACTIVITY_MODE_LIST,getPromotionActiveStatus } from '@/dicts' import { PROMOTION_ACTIVITY_MODE_LIST,getPromotionActiveStatus } from '@/dicts'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
...@@ -409,23 +406,28 @@ const uploadChangeFile = async (file) => { ...@@ -409,23 +406,28 @@ const uploadChangeFile = async (file) => {
} }
// 单条 // 单条
const editFn = (row) => { const editFn = (row) => {
proxy.resetForm("addOrEditPlanRef");
addOrEditPlanForm.value = { addOrEditPlanForm.value = {
...row, ...row,
inTime: parseTime(row.clockInTime, "{h}:{i}:{s}"), inTime: parseTime(row.clockInTime, "{h}:{i}:{s}"),
outTime: parseTime(row.clockOutTime, "{h}:{i}:{s}") outTime: parseTime(row.clockOutTime, "{h}:{i}:{s}")
} }
editDealerId.value = row.dealerId
getStoreList()
addOrEditPlanVisible.value = true addOrEditPlanVisible.value = true
} }
/*************** 新增/修改计划弹框 ***************/ /*************** 新增/修改计划弹框 ***************/
// 新增/编辑计划表单弹框 // 新增/变更计划表单弹框
const addOrEditPlanVisible = ref(false) const addOrEditPlanVisible = ref(false)
const addOrEditPlanForm = ref({}) const addOrEditPlanForm = ref({})
const activityModeList = ref(PROMOTION_ACTIVITY_MODE_LIST) // 活动模式 const activityModeList = ref(PROMOTION_ACTIVITY_MODE_LIST) // 活动模式
const editDealerId = ref(null) // 经销商 ID
// 重置表单 // 重置表单
const resetAddOrEditPlanForm = () => { const resetAddOrEditPlanForm = () => {
addOrEditPlanForm.value = {} addOrEditPlanForm.value = {}
selecteStoreInfo.value = '' selecteStoreInfo.value = ''
editDealerId.value = null
isInfoError.value = false isInfoError.value = false
} }
// 表单验证(所有都是必填项) // 表单验证(所有都是必填项)
...@@ -494,7 +496,8 @@ const selecteStoreInfo = ref('') ...@@ -494,7 +496,8 @@ const selecteStoreInfo = ref('')
const isInfoError = ref(false) const isInfoError = ref(false)
const getStoreList = async () => { const getStoreList = async () => {
const { data } = await getPlanStoreListAPI({ const { data } = await getPlanStoreListAPI({
storeName: addOrEditPlanForm.value.storeName storeNameVague: addOrEditPlanForm.value.storeName,
dealerId: editDealerId.value
}) })
allStoreList.value = data allStoreList.value = data
storeList.value = data.map(item => { storeList.value = data.map(item => {
...@@ -545,8 +548,9 @@ const disabledDateFn = (time) => { ...@@ -545,8 +548,9 @@ const disabledDateFn = (time) => {
} else { } else {
// 职能角色能添加当月今天往后和下个月一整个月 // 职能角色能添加当月今天往后和下个月一整个月
const now = new Date(); const now = new Date();
const thisMonthStart = new Date(now.getFullYear(), now.getMonth(), now.getDate()); // 变更计划时,只能选择明天以后的
const nextMonthEnd = new Date(now.getFullYear(), now.getMonth() + 2, 0); const thisMonthStart = new Date(now.getFullYear(), now.getMonth(), addOrEditPlanForm.value.id ? now.getDate() + 1 : now.getDate());
const nextMonthEnd = new Date(now.getFullYear(), addOrEditPlanForm.value.id ? now.getMonth() + 1 : now.getMonth() + 2, 0);
return time.getTime() < thisMonthStart.getTime() || time.getTime() > nextMonthEnd.getTime(); return time.getTime() < thisMonthStart.getTime() || time.getTime() > nextMonthEnd.getTime();
} }
} }
...@@ -586,8 +590,7 @@ const selEmployee = () => { ...@@ -586,8 +590,7 @@ const selEmployee = () => {
proxy.$refs.addOrEditPlanRef.clearValidate('employeeNo'); proxy.$refs.addOrEditPlanRef.clearValidate('employeeNo');
} }
// 保存新增/变更计划
// 保存新增/编辑计划
const handleAddOrEditPlan = async () => { const handleAddOrEditPlan = async () => {
// 表单校验 // 表单校验
await proxy.$refs.addOrEditPlanRef.validate() await proxy.$refs.addOrEditPlanRef.validate()
......
...@@ -23,12 +23,13 @@ export default defineConfig(({ mode, command }) => { ...@@ -23,12 +23,13 @@ export default defineConfig(({ mode, command }) => {
open: true, open: true,
proxy: { proxy: {
'/dev-api': { '/dev-api': {
target: 'http://192.168.100.55:8080', // target: 'http://192.168.100.55:8080',
target: 'https://sfa-qa.wxl66.cn/api',
changeOrigin: true, changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '') rewrite: (p) => p.replace(/^\/dev-api/, '')
}, },
'/promotion-api': { '/dev-promotion-api': {
target: 'http://192.168.100.55:8010', target: 'https://sfa-qa.wxl66.cn/promotion-api',
changeOrigin: true, changeOrigin: true,
rewrite: (p) => p.replace(/^\/promotion-api/, '') rewrite: (p) => p.replace(/^\/promotion-api/, '')
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论