Commit ad1b6c62 by wangzhihui

Merge branch 'SAAS+V5.8.2' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into feature/strategy-center
2 parents 01cb25e6 ae7122fa
Showing 52 changed files with 1929 additions and 977 deletions
......@@ -7,7 +7,7 @@ node_modules
.cursorrules
.cursor
.trae
.vscode/changelists.json
# 本地环境文件不上传
.env.local
.env.*.local
......
......@@ -15,6 +15,51 @@
"vetur.experimental.templateInterpolationService": false,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// JavaScript React(如果用 React)
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// TypeScript
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// TypeScript React
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// Vue
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// JSON(普通)
"[json]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// JSONC(带注释的配置文件)
"[jsonc]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// HTML
"[html]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// CSS / SCSS
"[css]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[scss]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[less]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// Markdown
"[markdown]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"editor.autoIndent": "full",
"editor.codeActionsOnSave": {
// "source.organizeImports": "explicit",
......
......@@ -106,7 +106,9 @@ export default antfu({
"SLOT", // v-slot slot
"TWO_WAY_BINDING", // v-model
"OTHER_DIRECTIVES", // v-custom-directive
"OTHER_ATTR", // 自定义属性和其他
"ATTR_STATIC", // 静态属性排最前
"ATTR_SHORTHAND_BOOL", // 布尔简写排中间
"ATTR_DYNAMIC", // 动态绑定排最后
"EVENTS", // @click @focus
"CONTENT", // v-text v-html
],
......
......@@ -38,3 +38,15 @@ export function constructionMerchantList(data) {
export function constructionSellerList(data) {
return request({ ...data, method: CONSTRUCTION_SELLER_LIST }, 'post')
}
// 获取施工单详情时间节点
export const CONSTRUCTION_INFO_DETAIL_TIME_NODE = 'dj.api.smarcarlife.construction.timeline'
export function constructionInfoDetailTimeNode(data) {
return request({ ...data, method: CONSTRUCTION_INFO_DETAIL_TIME_NODE }, 'post')
}
// 获取园区店数据
export const CONSTRUCTION_INFO_PARK_MERCHANT = 'dj.api.smarcarlife.construction.seller.merchant.list'
export function constructionInfoYqMerchant(data) {
return request({ ...data, method: CONSTRUCTION_INFO_PARK_MERCHANT }, 'post')
}
......@@ -237,3 +237,9 @@ export function getAuditOrderDetail(data) {
data.method = `${path2}goodsOrderApplyRecord.detail.select`
return request(data, "post")
}
// 理赔单标记退款拦截
export function orderRefundInterceptApi(data) {
data.method = "dj.api.smartcarlife.vd.equity.order.checkChargeBackAllowed"
return request(data, "post")
}
......@@ -808,6 +808,32 @@ export function assignStoreApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.account.merchant.assign";
return request(data, "post");
}
export function assignStoreV2Api(data = {}) {
data.method =
"dj.api.smartcarlife.staffBaseInfo.account.merchant.assign.v2";
return request(data, "post");
}
export function accountRecordListApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.accountRecord.list";
return request(data, "post");
}
export function accountRecordDetailApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.accountRecord.detail";
return request(data, "post");
}
export function disableAccountV2Api(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.account.disable.v2";
return request(data, "post");
}
export function query4sByYqMerchantApi(data = {}) {
data.method = "dj.api.smartcarlife.merchant.scene.query4sByYqMerchant";
return request(data, "post");
}
//北森岗位
export function beiSenJobPostPageApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.beiSenJobPost.page";
......@@ -828,3 +854,14 @@ export function beiSenEmployeeDisableApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.account.disable";
return request(data, "post");
}
// 获取周任务提报优秀案例录音列表数据
export function getExcellentCaseAudioListApi(data = {}) {
data.method = "dj.api.supervisor.excellent.case.listByTaskId";
return request(data, "post");
}
// 获取周任务完成带教要求列表
export function getTeachingRequirementsListApi(data = {}) {
data.method = "dj.api.supervisor.page.teachingRecords";
return request(data, "post");
}
......@@ -364,4 +364,10 @@ export function importLightChangePhone(data) {
data.method = `${path}servicecenter.short.course.phone.import`;
// 文件参数不参与签名拼接(参考 importProfit)
return request(data, RequestMethods.POST, ["file"]);
}
// 课程管理-查询课程分类树
export function getCourseCategoryList(data = {}) {
data.method = `${path}servicecenter.course.category.list`;
return request(data, RequestMethods.POST);
}
\ No newline at end of file
......@@ -2023,9 +2023,17 @@ export const superviseTaskTypeOpt = [
confName: "督导日报",
confId: 0,
},
// {
// confName: "本周复盘",
// confId: 1,
// },
{
confName: "本周复盘",
confId: 1,
confName: "提报优秀案例录音",
confId: 6,
},
{
confName: "带教要求",
confId: 7,
},
{
confName: "督导月度计划",
......
......@@ -472,3 +472,52 @@ export const rangePickerOptions_deliveryQuantity = {
return !isAllowed; // 不在允许范围则禁用
},
};
/**
* 根据 yyyy-MM 获取当月首尾日期
* @param {string} targetMonth
* @returns {{ startDate: string, endDate: string } | null}
*/
export function getMonthDateRange(targetMonth) {
if (!targetMonth) return null;
const [yearStr, monthStr] = targetMonth.split("-");
const year = parseInt(yearStr, 10);
const month = parseInt(monthStr, 10);
if (!year || !month) return null;
const startDate = `${yearStr}-${monthStr.padStart(2, "0")}-01`;
const lastDay = new Date(year, month, 0).getDate();
const endDate = `${yearStr}-${monthStr.padStart(2, "0")}-${String(lastDay).padStart(2, "0")}`;
return { startDate, endDate };
}
/**
* 店面配置-门店主机厂交付数导入
* 限制:当前日期>20号:仅允许选择当前月份;当前日期≤20号:允许选择当前月份和上个月
*/
export const rangePickerOptions_deliveryQuantity_import = {
disabledDate: (time) => {
const current = new Date();
const currentYear = current.getFullYear();
const currentMonth = current.getMonth();
const currentDay = current.getDate();
const allowedMonths = [];
if (currentDay > 20) {
allowedMonths.push({ year: currentYear, month: currentMonth });
} else {
allowedMonths.push(
{ year: currentYear, month: currentMonth },
currentMonth === 0
? { year: currentYear - 1, month: 11 }
: { year: currentYear, month: currentMonth - 1 },
);
}
const year = time.getFullYear();
const month = time.getMonth();
const isAllowed = allowedMonths.some(
m => m.year === year && m.month === month,
);
return !isAllowed;
},
};
......@@ -338,15 +338,6 @@
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
</GLDialog>
<GLDialog title="选择地址" width="1080px" :has-scroll="false" :is-visible="dialogMapVisible"
:modal-append-to-body="nestedModalAppendToBody" @closeDialog="dialogMapVisible = false"
@confirmDialog="getAddress">
<MapView v-if="dialogMapVisible" ref="mapForm"></MapView>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="">取 消</el-button>
<el-button type="primary" @click="getAddress">确 定</el-button>
</span> -->
</GLDialog>
</div>
</template>
......@@ -356,12 +347,10 @@ import { rangePickerOptions_30day2 } from "@/common/format";
import RemoteSelect from "@/components/remoteSearchSelect/index.vue";
import GLDialog from "../glsx-dialog/index.vue";
import { afterRangePickerOptions, beforeRangePickerOptions } from "./common";
import mapView from "./mapView.vue";
export default {
name: "GlsxCombiForm",
components: {
MapView: mapView,
GLDialog,
RemoteSelect,
},
......@@ -422,9 +411,6 @@ export default {
afterRangePickerOptions,
rangePickerOptions_30day2,
},
subdistrict: 2,
dialogMapVisible: false,
targetItem: {},
isImgVisible: false,
dialogObj: {
url: "",
......@@ -839,105 +825,6 @@ export default {
forbidEdit() {
this.$refs.textBox.forbidEdit();
},
// 地图
handleSelectMap(targetItem) {
this.targetItem = targetItem;
this.dialogMapVisible = true;
this.$nextTick(() => {
if (
this.formObj[targetItem.attrObj.fullAddress]
&& !this.$refs.mapForm.address
) {
this.$refs.mapForm.address
= this.formObj[targetItem.attrObj.fullAddress];
this.$refs.mapForm.lnglat = this.formObj[targetItem.attrObj.lng]
? [
this.formObj[targetItem.attrObj.lng],
this.formObj[targetItem.attrObj.lat],
]
: [];
// this.$refs.mapForm.addMarker([this.formObj[targetItem.attrObj.lng], this.formObj[targetItem.attrObj.lat]])
}
});
},
getAddress() {
const mapInfo = this.$refs.mapForm;
if (!mapInfo.address) {
this.$message({
message: "请选择地址",
type: "error",
customClass: "message-Z-zinde",
});
return;
}
this.formObj[this.targetItem.attrObj.fullAddress] = mapInfo.address;
this.formObj[this.targetItem.attrObj.lat] = mapInfo.lnglat[1];
this.formObj[this.targetItem.attrObj.lng] = mapInfo.lnglat[0];
// var fullAddress = mapInfo.geocoderAddress.addressComponent || this.formObj[this.targetItem.attrObj.fullAddress]
let fullAddress = mapInfo.geocoderAddress.addressComponent;
// if (!fullAddress) {
// this.dialogMapVisible = false
// return
// }
let provincecode
= mapInfo.geocoderAddress.adcode
|| this.formObj[this.targetItem.attrObj.provinceCode];
this.formObj[this.targetItem.attrObj.provinceCode] = provincecode;
// 获取省市
let province = "";
let city = "";
province = fullAddress.province;
city = fullAddress.city ? fullAddress.city : fullAddress.district;
const municipalities = ["北京市", "天津市", "上海市", "重庆市"];
let municipality = municipalities.find(item => item == province);
if (municipality) {
city = city.slice(0, 2) + "城区";
if (municipality === "重庆市") {
provincecode = provincecode.slice(0, 4);
provincecode == 5001
? (city = city.slice(0, 2) + "城区")
: (city = city.slice(0, 2) + "郊县");
}
}
// 判断省市是否匹配
if (this.formObj[this.targetItem.attrObj.provinceName]) {
if (
this.formObj[this.targetItem.attrObj.provinceName] !== province
&& this.formObj[this.targetItem.attrObj.cityName] !== city
) {
this.$message({
message: "您选择的地址错误,请重新选择",
type: "error",
customClass: "message-Z-zinde",
});
this.formObj[this.formObj[this.targetItem.attrObj.fullAddress]] = "";
return;
}
}
this.dialogMapVisible = false;
this.formObj[this.targetItem.attrObj.provinceName] = province;
this.formObj[this.targetItem.attrObj.cityName] = city;
// 当直接点击选择地址时,获取省市ID
this.$refs.provinceForm[0].init(province, city);
},
// 获取省
handleSelectProvince(val, targetItem) {
this.formObj[targetItem.attrObj.fullAddress] = "";
this.formObj[targetItem.attrObj.cityName] = "";
this.formObj[targetItem.attrObj.provinceName] = val.provinceName;
this.formObj[targetItem.attrObj.provinceCode] = val.provinceCode;
},
// 获取市
handleSelectCity(val, targetItem) {
if (val.cityName) {
this.formObj[targetItem.attrObj.cityName] = val.cityName;
this.formObj[targetItem.attrObj.cityCode] = val.cityCode;
} else {
this.formObj[targetItem.attrObj.cityName] = "";
this.formObj[targetItem.attrObj.cityCode] = "";
}
this.formObj[targetItem.attrObj.fullAddress] = "";
},
maxLengthInput(value, item) {
if (item.inputType && value.length > item.maxlength) {
this.formObj[item.name] = value.slice(0, item.maxlength);
......
<template>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'Map',
props: {
mapHeight: {
type: Number,
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() {
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
cursor: 'move'
})
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function () {
// 构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, // 是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) // 加载错误提示
})
},
remoteMethod(query) {
if (query == '') {
return true
}
const _this = this
placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
_this.adrList = result.poiList.pois
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), // 图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
const self = this
let position
if (e.type == 'click') {
position = e.lnglat
} else {
const { lng, lat } = e
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
}
}
</script>
<style scoped lang="scss">
.map-box {
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
......@@ -34,40 +34,41 @@ Vue.use(VueLazyload, {
attempt: 3, // 尝试加载次数
});
// 实例化
process.env.NODE_ENV === "production" && Sentry.init({
Vue,
dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24",
// 与 vue.config 中 SentryWebpackPlugin.release 一致,sourcemap 才能正确解析栈
release: process.env.VUE_APP_VERSION,
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//],
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
logErrors: true,
// 解决火狐浏览器 无法捕获错误的问题
beforeSend(event, hint) {
const isNonErrorException
= event.exception.values[0].value.startsWith(
"Non-Error exception captured",
)
|| hint.originalException.message.startsWith(
"Non-Error exception captured",
);
if (isNonErrorException) {
// We want to ignore those kind of errors
return null;
}
return event;
},
// "send-default-pii": true
});
process.env.NODE_ENV === "production" &&
Sentry.init({
Vue,
dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24",
// 与 vue.config 中 SentryWebpackPlugin.release 一致,sourcemap 才能正确解析栈
release: process.env.VUE_APP_VERSION,
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//],
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
logErrors: true,
// 解决火狐浏览器 无法捕获错误的问题
beforeSend(event, hint) {
const isNonErrorException =
event.exception.values[0].value.startsWith(
"Non-Error exception captured"
) ||
hint.originalException.message.startsWith(
"Non-Error exception captured"
);
if (isNonErrorException) {
// We want to ignore those kind of errors
return null;
}
return event;
},
// "send-default-pii": true
});
// d2Admin 已导入
// import ElementUI from 'element-ui'
......@@ -108,7 +109,7 @@ Vue.directive("preventReClick", {
event && event.stopImmediatePropagation();
}
},
true,
true
);
},
});
......@@ -129,55 +130,60 @@ let baseConfig = config;
* 只取 .env.production .env 两个文件中的.
*/
const configCenterUrl = process.env.VUE_APP_CONFIG_CENTER_URL || "https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config";
const configCenterUrl =
process.env.VUE_APP_CONFIG_CENTER_URL ||
"https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config";
console.log("configCenterUrl", configCenterUrl);
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch(configCenterUrl).then(
(response) => {
// 处理http响应
return response.json();
},
(error) => {
// 处理错误
console.log(error);
},
).then((response) => {
const { code, data } = response;
console.log("response", code, response);
if (code == "200") {
console.log(data);
baseConfig = data;
// console.log("baseConfig", baseConfig)
// window.$fetchConfig = data
} else {
baseConfig = response;
window.$fetchConfig = response;
console.log(response);
window.$gscApi = new Request({
...response.gsc,
// baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade',
// baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade',
session: {
requiresSession: true,
sessionId: _ => util.cookies.get("token"),
},
events: {
error: (error, config) => {
Vue.prototype.$message.error(error.msg);
fetch(configCenterUrl)
.then(
(response) => {
// 处理http响应
return response.json();
},
(error) => {
// 处理错误
console.log(error);
}
)
.then((response) => {
const { code, data } = response;
console.log("response", code, response);
if (code == "200") {
console.log(data);
baseConfig = data;
// console.log("baseConfig", baseConfig)
// window.$fetchConfig = data
} else {
baseConfig = response;
window.$fetchConfig = response;
console.log(response);
window.$gscApi = new Request({
...response.gsc,
// baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade',
// baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade',
session: {
requiresSession: true,
sessionId: (_) => util.cookies.get("token"),
},
logout: (response, config) => {
store.dispatch("d2admin/user/clear");
util.cookies.remove("token");
router.replace("/login");
Vue.prototype.$message.error("登录超时,请重新登录");
events: {
error: (error, config) => {
Vue.prototype.$message.error(error.msg);
},
logout: (response, config) => {
store.dispatch("d2admin/user/clear");
util.cookies.remove("token");
router.replace("/login");
Vue.prototype.$message.error("登录超时,请重新登录");
},
},
},
});
console.log(window.$gscApi, "========");
}
}).finally(() => {
init();
});
});
console.log(window.$gscApi, "========");
}
})
.finally(() => {
init();
});
function init() {
new Vue({
router,
......
......@@ -1032,7 +1032,7 @@ export const routerName = {
{
authId: "9061934",
parentId: "90619",
label: "批量设置区域运营",
label: "批量设置人员",
category: "Button",
type: "primary",
handle: "handleSetBatch",
......@@ -1045,14 +1045,6 @@ export const routerName = {
type: "primary",
handle: "handleSetBatch",
},
{
authId: "9061936",
parentId: "90619",
label: "批量设置线上运营",
category: "Button",
type: "primary",
handle: "handleSetBatch",
},
// 门店毛利额操作权限
{
authId: "9061937",
......
......@@ -344,6 +344,13 @@ export const routerName = {
8: "审核",
},
},
addRoutePath: [
{
authId: "909060202",
name: "审核",
parentId: "90906",
},
],
handle: "handleCheck",
},
{
......@@ -529,6 +536,18 @@ export const routerName = {
},
component: _import("purchase/singleReview"),
},
909060202: {
path: "/procurementBusiness/singleBusinessCheck",
name: "singleBusinessCheck",
meta: {
title: "审核",
authId: "909060202",
parentId: "90906",
cache: false,
activePath: "/procurementBusiness",
},
component: _import("purchase/singleBusinessReview"),
},
909080401: {
path: "/directorReview/singleReject",
name: "singleReject",
......
......@@ -1446,10 +1446,36 @@ export const routerName = {
name: "supervisionMissionDetail",
meta: {
title: "详情",
authId: "9122501",
authId: "912250101",
parentId: "91225",
activePath: "/supervisionMissionManagement",
},
auth: [
{
authId: "9122502",
parentId: "912250101",
label: "通过",
handle: "handlePass",
},
{
authId: "9122503",
parentId: "912250101",
label: "驳回",
handle: "handleReject",
},
{
authId: "9122504",
parentId: "912250101",
label: "下载录音",
handle: "handleDownload",
},
{
authId: "9122505",
parentId: "912250101",
label: "详情",
handle: "handleViewDetail",
}
],
component: _import(
"residentManage/supervisionManagement/mission/detail",
),
......
......@@ -100,6 +100,7 @@ export default {
{
name: 'purchaseGoodsName',
label: '产品别名',
type: 'input',
width: '432px',
handleInput: true
},
......
......@@ -463,7 +463,7 @@ import {
} from "@api/order";
import { getAllCategory } from "@api/product";
import { mapActions, mapMutations, mapState } from "vuex";
import { getBrandList } from "@/api/shopConfig.js";
import { getBrandList, getDistrictDetail } from "@/api/shopConfig.js";
import { auditStatusMap, BaseData, djOrderTypeList, djOrderTypeMap, goodsAuditStatusList, manageTypeList, zyVoucherStatusOpt } from "@/common/constants";
import { deepClone, Util } from "@/common/util";
import chooseRuleDialog from "./chooseRuleDialog";
......@@ -740,7 +740,7 @@ export default {
name: "provinceId",
type: "select",
optionList: [],
optionId: "adcode",
optionId: "code",
optionLabel: "name",
optionsName: "provinceInfoList",
},
......@@ -1688,69 +1688,11 @@ export default {
// 省市区
getProvinceList() {
let map = new AMap.Map("district", {
resizeEnable: true,
});
AMap.plugin(["AMap.DistrictSearch"], () => {
let opts = {
subdistrict: 1, // 返回下一级行政区
level: "city", // 查询的范围
showbiz: true, // 查询行政级别为 市
};
let districtSearch = new AMap.DistrictSearch(opts);
districtSearch.search("中国", (status, result) => {
this.baseData.provinceInfoList = result.districtList[0].districtList;
console.log(this.baseData.provinceInfoList);
getDistrictDetail({ districtName: "中国" }).then((res) => {
if (res && res.length) {
this.baseData.provinceInfoList = res[0].districts;
this.getOptionsList();
// com.getSelect({
// id: 'startp',
// name: 'provinceName',
// url: '/area/list',
// // value: 'provinceId',
// data: provinceInfoList,
// value: 'name',
// text: 'name',
// param: {},
// select: function (data) {
// const { value } = data
// if (value) {
// // var province = provinceInfoList.find(item => item.provinceId == value)
// var province = provinceInfoList.find(item => item.name == value)
// cityInfo = province.districtList
// merchantForm.provinceCode = province.adcode
// merchantForm.provinceName = province.name
// $('#addrEl').val('')
// } else {
// cityInfo = []
// merchantForm.provinceCode = ''
// merchantForm.provinceName = ''
// }
// merchantForm.cityCode = ''
// merchantForm.cityName = ''
// com.getSelect({
// id: 'startc',
// name: 'cityName',
// url: '/area/list',
// value: 'name',
// text: 'name',
// data: cityInfo,
// link: 'startp',
// select: function (data) {
// const { value } = data
// if (value) {
// // var city = cityInfo.find(item => item.cityId == value)
// var city = cityInfo.find(item => item.name == value)
// merchantForm.cityCode = city.adcode
// merchantForm.cityName = city.name
// } else {
// merchantForm.cityCode = ''
// merchantForm.cityName = ''
// }
// }
// })
// }
// })
});
}
});
},
// 审批通过
......
......@@ -13,11 +13,16 @@ export function buildConstructionListQuery(form) {
if (raw.orderCode) out.orderCode = String(raw.orderCode).trim()
if (raw.technicianUuid) out['technicianUuidList[0]'] = String(raw.technicianUuid).trim()
if (raw.sellerUserId) out['sellerUserIdList[0]'] = String(raw.sellerUserId).trim()
if (raw.standNo) out.standNo = String(raw.standNo).trim()
if (raw.customerName) out.customerName = String(raw.customerName).trim()
if (raw.brandId !== '' && raw.brandId != null && !Number.isNaN(Number(raw.brandId))) {
out.brandId = Number(raw.brandId)
}
if (raw.merchantId !== '' && raw.merchantId != null && !Number.isNaN(Number(raw.merchantId))) {
out.merchantId = Number(raw.merchantId)
if (raw.merchantIdList.length) {
out.merchantIdList = raw.merchantIdList
}
if (raw.sellerMerchantIdList.length) {
out.sellerMerchantIdList = raw.sellerMerchantIdList
}
if (raw.constructionStatus !== '' && raw.constructionStatus != null) {
out['constructionStatusList[0]'] = Number(raw.constructionStatus)
......
......@@ -442,7 +442,7 @@ import {
} from "@api/order";
import { getAllCategory } from "@api/product";
import { mapActions, mapMutations, mapState } from "vuex";
import { getBrandList } from "@/api/shopConfig.js";
import { getBrandList, getDistrictDetail } from "@/api/shopConfig.js";
import { auditStatusMap, BaseData, djOrderTypeList, djOrderTypeMap, goodsAuditStatusList, manageTypeList } from "@/common/constants";
import { Util } from "@/common/util";
import chooseRuleDialog from "./chooseRuleDialog";
......@@ -684,7 +684,7 @@ export default {
name: "provinceId",
type: "select",
optionList: [],
optionId: "adcode",
optionId: "code",
optionLabel: "name",
optionsName: "provinceInfoList",
},
......@@ -899,7 +899,7 @@ export default {
salesTypeList: [
{
confId: "0",
confLabel: "门店引流 - 售前",
confLabel: "销售端引流 - 售前",
},
{
confId: "1",
......@@ -909,6 +909,10 @@ export default {
confId: "2",
confLabel: "自然到店",
},
{
confId: "3",
confLabel: "交付端引流 - 售前",
},
],
productTypeList: [],
saleFlagList: [
......@@ -1075,13 +1079,14 @@ export default {
this.getOptionsList();
},
/** 客户来源:0 门店引流-售前 / 1 门店引流-售后 / 2 自然到店 */
/** 客户来源:0 销售端引流售前 / 1 门店引流-售后 / 2 自然到店 / 3 交付端引流售前 */
getSalesTypeLabel(v) {
if (v === null || v === undefined || v === "") return "-";
const map = {
0: "门店引流 - 售前",
0: "销售端引流 - 售前",
1: "门店引流 - 售后",
2: "自然到店",
3: "交付端引流 - 售前",
};
const n = Number(v);
return map[n] !== undefined ? map[n] : "-";
......@@ -1590,69 +1595,11 @@ export default {
// 省市区
getProvinceList() {
let map = new AMap.Map("district", {
resizeEnable: true,
});
AMap.plugin(["AMap.DistrictSearch"], () => {
let opts = {
subdistrict: 1, // 返回下一级行政区
level: "city", // 查询的范围
showbiz: true, // 查询行政级别为 市
};
let districtSearch = new AMap.DistrictSearch(opts);
districtSearch.search("中国", (status, result) => {
this.baseData.provinceInfoList = result.districtList[0].districtList;
console.log(this.baseData.provinceInfoList);
getDistrictDetail({ districtName: "中国" }).then((res) => {
if (res && res.length) {
this.baseData.provinceInfoList = res[0].districts;
this.getOptionsList();
// com.getSelect({
// id: 'startp',
// name: 'provinceName',
// url: '/area/list',
// // value: 'provinceId',
// data: provinceInfoList,
// value: 'name',
// text: 'name',
// param: {},
// select: function (data) {
// const { value } = data
// if (value) {
// // var province = provinceInfoList.find(item => item.provinceId == value)
// var province = provinceInfoList.find(item => item.name == value)
// cityInfo = province.districtList
// merchantForm.provinceCode = province.adcode
// merchantForm.provinceName = province.name
// $('#addrEl').val('')
// } else {
// cityInfo = []
// merchantForm.provinceCode = ''
// merchantForm.provinceName = ''
// }
// merchantForm.cityCode = ''
// merchantForm.cityName = ''
// com.getSelect({
// id: 'startc',
// name: 'cityName',
// url: '/area/list',
// value: 'name',
// text: 'name',
// data: cityInfo,
// link: 'startp',
// select: function (data) {
// const { value } = data
// if (value) {
// // var city = cityInfo.find(item => item.cityId == value)
// var city = cityInfo.find(item => item.name == value)
// merchantForm.cityCode = city.adcode
// merchantForm.cityName = city.name
// } else {
// merchantForm.cityCode = ''
// merchantForm.cityName = ''
// }
// }
// })
// }
// })
});
}
});
},
// 审批通过
......
......@@ -129,6 +129,9 @@
-
</div>
</template>
<template #isAllocateHtml="scope">
<el-checkbox v-model="scope.scope.isAllocate == 1" />
</template>
</d2-table>
</div>
<ExamineRecord v-if="detailInfo.auditDetaiList && !paramsObj.factoryType" :use-expand="false"
......@@ -248,6 +251,33 @@ export default {
: `${cellValue.goodsNumber}件`;
},
},
// 是否转为调拨订单 0-否 1-是
{
label: "是否转调拨",
prop: "isAllocate",
addHtml: "isAllocateHtml",
width: 200,
},
{
label: "调入方门店",
prop: "callInMerchantName",
width: 200,
},
{
label: "调入方仓库",
prop: "callInYqMerchantName",
width: 200,
},
{
label: "调出方门店",
prop: "callOutMerchantName",
width: 200,
},
{
label: "调出方仓库",
prop: "callOutYqMerchantName",
width: 200,
},
{
label: "库存总量",
prop: "goodsTypeName",
......
......@@ -2,7 +2,11 @@
<template>
<d2-container class="container">
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" @handleChangeSelect="handleChangeSelect" :form-data="showFormData">
<d2-search ref="showSearch" class="show-search" label-width="130px" :search-form="searchForm"
@handleChangeSelect="handleChangeSelect" :form-data="showFormData">
<template slot="onlyAllocateOrderHtml">
<el-switch v-model="searchForm.onlyAllocateOrder"></el-switch>
</template>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary" handle>
......@@ -25,20 +29,25 @@
@click="handleExport">
导出
</el-button> -->
<span style="margin-right: 10px">
<!-- 批量审核先屏蔽 -->
<!-- <span style="margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9090606']" />
</span>
</span> -->
<auth-button category="Button" :show-btn-ids="['9090605']" />
</span>
</d2-table-header>
<d2-table ref="purchasementReviewTable" :search-form="tableSearchForm" :table-params="tableParams" :table-data="tableData" :selectable-fn="selectableFn" :get-list-api="getListApi" :before-search-fn="beforeSearchFn">
<d2-table ref="purchasementReviewTable" :search-form="tableSearchForm" :table-params="tableParams"
:table-data="tableData" :selectable-fn="selectableFn" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" />
</d2-table>
</div>
<orderDeatilDialog :visible.sync="detailVisible" v-if="detailVisible" :params-obj="paramsObj"></orderDeatilDialog>
<CheckDialog :check-visible="checkVisible" v-if="checkVisible" :params-obj="paramsObj" from-page="procurementBusiness" @dialogClose="dialogClose">
<CheckDialog :check-visible="checkVisible" v-if="checkVisible" :params-obj="paramsObj" from-page="procurementBusiness"
@dialogClose="dialogClose">
</CheckDialog>
<rejectDialog :reject-visible="rejectVisible" v-if="rejectVisible" :params-obj="paramsObj" from-page="procurementBusiness" :filter-reject-list="[1,2,6]" @dialogClose="dialogClose">
<rejectDialog :reject-visible="rejectVisible" v-if="rejectVisible" :params-obj="paramsObj"
from-page="procurementBusiness" :filter-reject-list="[1, 2, 6]" @dialogClose="dialogClose">
</rejectDialog>
</d2-container>
</template>
......@@ -68,7 +77,8 @@ export default {
merchantName: '',
sortType: 2,
orderTimeStr: [],
purchasingPattern: ''
purchasingPattern: '',
onlyAllocateOrder: false
},
tableSearchForm: {},
tableData: [],
......@@ -133,7 +143,12 @@ export default {
type: 'input',
isClear: true,
maxlength: 50
}
},
{
label: "仅查看调拨订单",
name: "onlyAllocateOrder",
addHtml: 'onlyAllocateOrderHtml'
},
],
// getListApi: getPurchaseOrderList,
getListApi: businessreviewPage,
......@@ -193,6 +208,11 @@ export default {
prop: 'sendOutMerchantName'
},
{
label: "关联调拨单号",
prop: "relatedAllocateCode",
width: 150
},
{
label: '发货状态',
prop: 'deliveryStatus',
formatter: (cellValue) => {
......@@ -320,6 +340,7 @@ export default {
}
this.searchForm.sortType = 2
this.searchForm.orderTimeStr = []
this.searchForm.onlyAllocateOrder = false
this.$refs.purchasementReviewTable.refreshTable()
},
handleExport() {
......@@ -350,8 +371,16 @@ export default {
},
// 审核
handleCheck(row) {
this.checkVisible = !this.checkVisible
this.paramsObj = row
// this.checkVisible = !this.checkVisible
// this.paramsObj = row
this.$router.push({
path: '/procurementBusiness/singleBusinessCheck',
query: {
fromPage: 'procurementBusiness',
pageType: 'check',
paramsObj: row
}
})
},
// 批量审核
handleBatchCheck() {
......@@ -411,4 +440,3 @@ export default {
}
</script>
<style lang="scss" scoped></style>
......@@ -5,18 +5,21 @@
<div class="header">
<d2-search ref="showSearch"
class="show-search"
label-width="130px"
:form-data="showFormData"
:search-form="searchForm">
<template #onlyAllocateOrderHtml>
<el-switch v-model="searchForm.onlyAllocateOrder"></el-switch>
</template>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
handle
size="small"
type="primary">
type="primary"
handle>
查询
</el-button>
<el-button size="small"
@click="handleReset">
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
......@@ -49,31 +52,28 @@
<div>
<!-- 查看 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9090102']" />
<auth-button :data="scope.scope" :show-btn-ids="['9090102']" />
</span>
<!-- 取消 -->
<span v-show="scope.scope.status == 1 && !userInfo.beSuper && userInfo.beYQMerchant"
style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9090103']" />
<auth-button :data="scope.scope" :show-btn-ids="['9090103']" />
</span>
<!-- 入库 -->
<span v-show="scope.scope.putStatus == 1 && !userInfo.beSuper && userInfo.beYQMerchant"
style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9090104']" />
<auth-button :data="scope.scope" :show-btn-ids="['9090104']" />
</span>
<span v-show="(scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 2) || (scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 3) || (scope.scope.purchaseType == 1 && scope.scope.deliveryStatus == 4)"
style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9090105']" />
<auth-button :data="scope.scope" :show-btn-ids="['9090105']" />
</span>
</div>
</template>
</d2-table>
</div>
<OrderDeatilDialog v-if="detailVisible"
:is-allocate="true"
:params-obj="paramsObj"
:show-film-roll-no="paramsObj.purchaseType != 1"
:visible.sync="detailVisible">
......@@ -109,6 +109,7 @@ export default {
orderTimeStr: [],
// putTimeStr: [],
purchaseType: "",
onlyAllocateOrder: false,
},
tableSearchForm: {},
tableData: [],
......@@ -168,6 +169,11 @@ export default {
optionLabel: "label",
optionsName: "purchaseTypeList",
},
{
label: "仅查看调拨订单",
name: "onlyAllocateOrder",
addHtml: "onlyAllocateOrderHtml",
},
// {
// label: '入库时间',
// name: 'warehousingTimeStr',
......@@ -231,6 +237,10 @@ export default {
prop: "merchantName",
},
{
label: "关联调拨单号",
prop: "relatedAllocateCode",
},
{
label: "采购类型",
prop: "purchaseType",
formatter: (cellValue) => {
......@@ -408,6 +418,7 @@ export default {
}
this.searchForm.sortType = 1;
this.searchForm.orderTimeStr = [];
this.searchForm.onlyAllocateOrder = false;
// this.searchForm.putTimeStr = []
this.$refs.purchaseOrderTable.refreshTable();
},
......
......@@ -15,7 +15,7 @@
</el-row>
<el-row style="font-size: 14px; line-height: 28px;">
<el-col :span="24">
<span style="color: #666;">门店:</span><span style="color: #333;">{{ merchantName }}</span>
<span style="color: #666;">园区店:</span><span style="color: #333;">{{ merchantName }}</span>
</el-col>
</el-row>
</div>
......@@ -33,7 +33,7 @@
</template>
<script>
import { beiSenEmployeeDisableApi } from "@/api/resident";
import { disableAccountV2Api } from "@/api/resident";
export default {
name: "DisableAccountDialog",
......@@ -82,14 +82,14 @@ export default {
}
},
merchantName() {
return this.currentRow ? this.currentRow.merchantName : '';
return this.currentRow ? this.currentRow.yqMerchantName : '';
}
},
methods: {
confirmDisable() {
if (!this.currentRow) return;
const row = this.currentRow;
beiSenEmployeeDisableApi({ accountId: row.id }).then(() => {
disableAccountV2Api({ accountRecordId: row.accountRecordId }).then(() => {
this.$message.success('账号已禁用');
this.visible = false;
this.$emit("refreshDetail");
......
......@@ -191,28 +191,51 @@
<h2>账号信息</h2>
<div class="info-wrap">
<div class="info-item-line">
<d2-table ref="allocateStoreTable" :table-params="tableParams" :table-data="tableData"
:has-page="false">
<template slot="brand" slot-scope="scope">
<el-popover v-if="scope.scope.carBrand" placement="top" width="300" trigger="hover">
<div class="merchant-name-box">
{{ remarkFilter(scope.scope) }}
</div>
<div slot="reference">
{{ remarkFilter(scope.scope, 20) }}
</div>
</el-popover>
<span v-else>-</span>
</template>
<template slot="operationHtml" slot-scope="scope">
<!-- N:未删除;I:禁用 -->
<el-switch v-model="scope.scope.deletedFlag" active-value="N" inactive-value="I"
@change="(e) => switchChange(scope.scope)"></el-switch>
<span class="switch-text">{{ scope.scope.deletedFlag === 'N' ? '禁用账号' : '启用账号'
}}</span>
</template>
</d2-table>
<el-table :data="tableData" border style="width: 100%" :span-method="objectSpanMethod">
<el-table-column label="序号" width="60" align="center">
<template slot-scope="scope">
{{ getIndex(scope.$index) }}
</template>
</el-table-column>
<el-table-column prop="yqMerchantName" label="园区店" width="180" align="center">
<template slot-scope="scope">
{{ scope.row.yqMerchantName ? `${scope.row.yqMerchantName}${scope.row.yqMerchantId}` :
'-' }}
</template>
</el-table-column>
<el-table-column prop="merchantName" label="门店" width="250" align="center">
<template slot-scope="scope">
{{ scope.row.merchantName || '-' }}
</template>
</el-table-column>
<el-table-column label="适配业务" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.deletedFlag == 'N' ? scope.row.accountSceneStr || '-' : '-' }}
</template>
</el-table-column>
<el-table-column label="驻店类型" width="150" align="center">
<template slot-scope="scope">
{{ scope.row.deletedFlag == 'N' ? scope.row.stationType === 1 ? '门店常驻' :
scope.row.stationType === 2 ? '临时调动支援' : '-' : '-'
}}
</template>
</el-table-column>
<el-table-column label="开通时间" width="160" align="center">
<template slot-scope="scope">
{{ scope.row.createdDate ? formatDate(scope.row.createdDate) : '-' }}
</template>
</el-table-column>
<el-table-column prop="createdBy" label="开通人" width="150"></el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.deletedFlag" active-value="N" inactive-value="I"
@change="(e) => switchChange(scope.row)"></el-switch>
<span class="switch-text">{{ scope.row.deletedFlag === 'N' ? '禁用账号' : '启用账号' }}</span>
<el-button type="text" style="margin-left: 10px;"
@click="handleEditAccount(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-button size="small" @click="handleAllocateStore" class="add-allocate"
icon="el-icon-plus">新增门店账号</el-button>
......@@ -684,9 +707,16 @@
<!-- 禁用账号二次确认弹窗 -->
<disable-account-dialog :disable-dialog-visible="disableDialogVisible" :current-row="currentDisableRow"
:staff-name="detail.staffName"
:formatted-scene-label="currentDisableRow ? currentDisableRow.accountSceneStr : ''" v-if="disableDialogVisible"
@dialogClose="closeDisableDialog" @refreshDetail="getDetail" @disableFailed="handleDisableFailed">
:formatted-scene-label="currentDisableRow ? currentDisableRow.parkUniqueScenesStr : ''"
v-if="disableDialogVisible" @dialogClose="closeDisableDialog" @refreshDetail="getDetail"
@disableFailed="handleDisableFailed">
</disable-account-dialog>
<!-- 编辑门店权限弹窗 -->
<edit-store-permission-dialog v-if="editPermissionVisible" :visibleSync.sync="editPermissionVisible"
:detail="{ ...detail, staffId: queryData.id }" :currentRow="currentEditRow"
@refreshTable="closeEditPermissionDialog">
</edit-store-permission-dialog>
</div>
</template>
......@@ -697,8 +727,9 @@ import dayjs from "dayjs";
import assignStoreDialog from "./assignStoreDialog.vue";
import syncBeiSenDialog from "./syncBeiSenDialog.vue";
import disableAccountDialog from "./disableAccountDialog.vue";
import editStorePermissionDialog from "./editStorePermissionDialog.vue";
import { updateRecordOrderConfig } from "@api/inStoreManage";
import { updateBatchSalary, beiSenEmployeeDisableApi } from "@/api/resident";
import { updateBatchSalary, accountRecordListApi, disableAccountV2Api } from "@/api/resident";
import { staffLevelList, staffSceneLabelList } from "@/common/constants";
import { Util, deepClone } from "@/common/util";
import {
......@@ -723,6 +754,7 @@ export default {
AssignStoreDialog: assignStoreDialog,
syncBeiSenDialog,
disableAccountDialog,
editStorePermissionDialog
},
props: {
queryData: {
......@@ -1006,6 +1038,13 @@ export default {
// 禁用账号弹窗相关
disableDialogVisible: false,
currentDisableRow: null,
// 编辑权限弹窗相关
editPermissionVisible: false,
currentEditRow: null,
spanArr: [],
pos: 0
};
},
mounted() {
......@@ -1247,10 +1286,97 @@ export default {
}
this.detail = Object.assign(res, bsEffectiveRule) || {};
console.log(this.detail, " this.detail");
this.tableData = res?.accountRecordList || [];
this.getAccountRecordList();
}
);
},
getAccountRecordList() {
accountRecordListApi({ staffPhone: this.queryData?.staffPhone }).then(res => {
this.formatTableData(res || []);
});
},
formatTableData(data) {
let flatData = [];
data.forEach(park => {
// 提取园区店下所有4s店的场景名称并去重
let parkUniqueScenes = [];
if (park.fourSShopList && park.fourSShopList.length > 0) {
const allScenes = [];
park.fourSShopList.forEach(shop => {
if (shop.sceneList && shop.sceneList.length > 0) {
shop.sceneList.forEach(s => {
if (s.sceneName) allScenes.push(s.sceneName);
else if (s.name) allScenes.push(s.name);
});
}
});
parkUniqueScenes = [...new Set(allScenes)];
}
const parkUniqueScenesStr = parkUniqueScenes.join(', ');
if (park.fourSShopList && park.fourSShopList.length > 0) {
park.fourSShopList.forEach(shop => {
let accountSceneStr = (shop.sceneList || []).map(s => s.name || s.sceneName).join(', ');
flatData.push({
staffPhone: park.staffPhone,
yqMerchantId: park.yqMerchantId,
yqMerchantName: park.yqMerchantName,
parkUniqueScenesStr: parkUniqueScenesStr, // 新增的园区店级别合并去重的场景字符串
accountRecordId: shop.accountRecordId,
merchantId: shop.merchantId,
merchantName: shop.merchantName,
stationType: shop.stationType,
sceneList: shop.sceneList || [],
accountSceneStr: accountSceneStr,
createdDate: shop.createdDate,
createdBy: shop.createdBy,
deletedFlag: shop.deletedFlag
});
});
}
});
this.tableData = flatData;
this.getSpanArr(this.tableData);
},
getSpanArr(data) {
this.spanArr = [];
this.pos = 0;
for (let i = 0; i < data.length; i++) {
if (i === 0) {
this.spanArr.push(1);
this.pos = 0;
} else {
if (data[i].yqMerchantId === data[i - 1].yqMerchantId) {
this.spanArr[this.pos] += 1;
this.spanArr.push(0);
} else {
this.spanArr.push(1);
this.pos = i;
}
}
}
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// Merge 序号(0), 园区店(1), 操作(7)
if (columnIndex === 0 || columnIndex === 1 || columnIndex === 7) {
const _row = this.spanArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
};
}
},
getIndex(index) {
let count = 0;
for (let i = 0; i <= index; i++) {
if (this.spanArr[i] > 0) count++;
}
return count;
},
formatDate(date) {
return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
},
// 获取帮带导师数据
getResidentTeacherList() {
getResidentTeacherListApi({
......@@ -1298,6 +1424,7 @@ export default {
},
switchChange(row) {
console.log(row, 'row')
// N启用状态==》禁止二次弹窗
if (row.deletedFlag === 'I') {
......@@ -1307,9 +1434,9 @@ export default {
this.currentDisableRow = row;
this.disableDialogVisible = true;
} else {
// 当切换到启用时,直接调用接口
beiSenEmployeeDisableApi({ accountId: row.id }).then(() => {
//添加阻止switch 切换状态
row.deletedFlag = 'I';
disableAccountV2Api({ accountRecordId: row.accountRecordId }).then(() => {
this.$message.success('账号已启用');
this.getDetail();
}).catch(() => {
......@@ -1326,6 +1453,16 @@ export default {
this.currentDisableRow = null;
},
handleEditAccount(row) {
this.currentEditRow = row;
this.editPermissionVisible = true;
},
closeEditPermissionDialog() {
this.getDetail(); // refresh data
this.editPermissionVisible = false;
},
handleDisableFailed(row) {
if (row) {
row.deletedFlag = 'N'; // 恢复状态
......@@ -1581,6 +1718,7 @@ export default {
this.getDetail();
this.allocateStoreVisible = !this.allocateStoreVisible;
},
......@@ -1675,9 +1813,9 @@ export default {
</script>
<style lang="scss" scoped>
.edit-staff {
::v-deep .el-table th {
background: #f2f4f7;
}
// ::v-deep .el-table th {
// background: #f2f4f7;
// }
h2 {
font-size: 16px;
......
<template>
<baseDialog :dialog-config="dialogConfig" :config="config" :is-show.sync="visible" @handleClick="handleConfirm">
<div class="edit-permission-dialog">
<div class="tip-banner">
可调整门店的业务场景权限(不勾选视为未开通该门店权限)
</div>
<div class="park-store-name">
园区店:{{ currentRow.yqMerchantName }}
</div>
<div class="table-container" v-loading="loading">
<el-table :data="tableData" border style="width: 100%">
<el-table-column prop="shopMerchantName" label="门店" width="250" align="center"></el-table-column>
<el-table-column label="开单业务场景(可多选)" min-width="300" align="center">
<template slot-scope="scope">
<el-checkbox-group v-model="scope.row.checkedScenes" @change="changeSceneLabel(scope.row)">
<el-checkbox v-for="scene in scope.row.sceneList" :key="scene.baseSceneCode"
:label="scene.baseSceneCode">{{ scene.sceneName }}</el-checkbox>
</el-checkbox-group>
</template>
</el-table-column>
<el-table-column label="驻店类型" width="250">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.stationType"
:disabled="!scope.row.checkedScenes || scope.row.checkedScenes.length === 0">
<el-radio :label="1">门店常驻</el-radio>
<el-radio :label="2">临时调动支援</el-radio>
</el-radio-group>
</template>
</el-table-column>
</el-table>
<!-- <div class="tips-block">
<div style="display: flex; align-items: flex-start;">
<i class="el-icon-warning"
style="color: #2A58AD; margin-top: 3px; margin-right: 5px; font-size: 16px;"></i>
<div>
<div style="font-weight: bold;">提示:</div>
<div>1. 不勾选某个门店的业务场景,视为该人员未开通该门店的业务权限。</div>
<div>2. 一次性不要超过10个门店的场景分配,避免页面卡顿负载。</div>
</div>
</div>
</div> -->
</div>
</div>
</baseDialog>
</template>
<script>
import { query4sByYqMerchantApi, accountRecordDetailApi, assignStoreV2Api } from "@api/resident";
export default {
name: "EditStorePermissionDialog",
props: {
visibleSync: {
type: Boolean,
default: false,
},
detail: {
type: Object,
default: () => ({}),
},
currentRow: {
type: Object,
default: () => ({}),
}
},
data() {
return {
config: {
showClose: true,
appendToBody: false,
isShowFooter: true,
cancel_name: "取消",
confirm_name: "保存",
},
dialogConfig: {
title: "编辑门店权限",
width: "1080px",
},
tableData: [],
loading: false,
};
},
computed: {
visible: {
get() {
return this.visibleSync;
},
set(newVal) {
this.$emit("update:visibleSync", newVal);
},
},
},
mounted() {
this.initData();
},
methods: {
changeSceneLabel(row) {
if (row.checkedScenes && row.checkedScenes.length == 0) {
row.stationType = '';
}
},
async initData() {
this.loading = true;
try {
// 1. 获取全量园区店下所有4s店及场景
const allStoresRes = await query4sByYqMerchantApi({
yqMerchantIdList: [this.currentRow.yqMerchantId]
});
let allStores = [];
if (allStoresRes && allStoresRes.length > 0 && allStoresRes[0].shopList) {
allStores = allStoresRes[0].shopList;
}
// 2. 获取已选择的园区店信息
const detailRes = await accountRecordDetailApi({
accountRecordId: this.currentRow.accountRecordId
});
let selectedStores = [];
if (detailRes && detailRes.fourSShopList) {
selectedStores = detailRes.fourSShopList;
}
// 3. 回显数据映射
const formattedData = [];
allStores.forEach(shop => {
const matchedSelected = selectedStores.find(s => s.merchantId === shop.shopMerchantId);
let checkedScenes = [];
let stationType = '';
if (matchedSelected) {
checkedScenes = (matchedSelected.sceneList || []).map(s => s.baseSceneCode);
stationType = matchedSelected.stationType || '';
}
formattedData.push({
yqMerchantId: this.currentRow.yqMerchantId,
yqMerchantName: this.currentRow.yqMerchantName,
shopMerchantId: shop.shopMerchantId,
shopMerchantName: shop.shopMerchantName,
sceneList: shop.sceneList || [],
checkedScenes: checkedScenes,
stationType: stationType
});
});
this.tableData = formattedData;
} catch (error) {
console.error(error);
} finally {
this.loading = false;
}
},
handleConfirm() {
console.log(this.tableData);
// 校验:所有渲染出来的门店中,必须至少勾选一个场景才能提交
let hasSelectedAtLeastOneScene = false;
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].checkedScenes && this.tableData[i].checkedScenes.length > 0) {
hasSelectedAtLeastOneScene = true;
break;
}
}
if (!hasSelectedAtLeastOneScene) {
return this.$message.warning("请至少勾选一个开单业务场景");
}
let hasStationType = false;
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].checkedScenes && this.tableData[i].checkedScenes.length > 0 && this.tableData[i].stationType == '') {
hasStationType = true
break;
}
}
if (hasStationType) {
return this.$message.warning("请选择门店驻店类型");
}
const fourSShopList = [];
this.tableData.forEach(row => {
if (!row.checkedScenes || row.checkedScenes.length === 0) {
return;
}
const sceneList = row.checkedScenes.map(code => {
const sceneObj = row.sceneList.find(s => s.baseSceneCode === code);
return {
baseSceneCode: code,
sceneType: sceneObj ? sceneObj.sceneType : null
};
});
fourSShopList.push({
merchantId: row.shopMerchantId,
merchantName: row.shopMerchantName,
stationType: row.stationType,
sceneList: sceneList
});
});
const shopItemList = [
{
yqMerchantId: this.currentRow.yqMerchantId,
yqMerchantName: this.currentRow.yqMerchantName,
fourSShopList: fourSShopList
}
];
const params = {
staffId: this.detail.staffId || this.detail.id,
staffPhone: this.detail.staffPhone,
staffName: this.detail.staffName,
shopItemList: shopItemList,
editFlag: true // 编辑标识
};
assignStoreV2Api(params).then(() => {
this.$message.success("编辑门店权限成功");
this.$emit("refreshTable");
this.visible = false;
});
}
}
};
</script>
<style scoped lang="scss">
.edit-permission-dialog {
padding: 0 10px;
}
.tip-banner {
background-color: #F5F7FA;
color: #2A58AD;
padding: 10px;
border-radius: 4px;
font-size: 16px;
margin-bottom: 16px;
}
.park-store-name {
font-size: 14px;
color: #666;
margin-bottom: 16px;
}
.table-container {
margin-top: 15px;
}
.tips-block {
background: rgba(42, 88, 173, 0.08);
padding: 12px;
margin-top: 15px;
border-radius: 4px;
font-size: 14px;
color: #333333;
line-height: 20px;
}
</style>
\ No newline at end of file
<template>
<div class="recording-detail">
<div class="header" v-if="viewMode !== 'detail'">
<div class="left">
<span class="title">带教要求</span>
<span>提交人:{{ detail.updatedBy }}</span>
</div>
<div>提交时间:{{ detail.updatedDate }}</div>
</div>
<div class="content">
<div v-if="viewMode === 'detail'">
<ReviewDetail :key="detailForView.id" :detail="detailForView" />
</div>
<d2-table v-else
ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<template #auth-button="scope">
<div>
<auth-button :data="scope.scope"
:show-btn-ids="['9122505']" />
</div>
</template>
</d2-table>
</div>
</div>
</template>
<script>
import { getTeachingRequirementsListApi } from "@api/resident";
import { mapActions } from "vuex";
import reviewDetail from "./reviewDetail.vue";
export default {
name: "Mentorship",
components: {
ReviewDetail: reviewDetail,
},
props: {
detail: {
type: Object,
default: () => {},
},
},
data() {
return {
getListApi: getTeachingRequirementsListApi,
searchFormSearch: {},
viewMode: "list",
detailForView: {},
tableParams: {
btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: "list",
tableOption: { width: "100px" },
tableColumns: [
{
label: "带教场景",
prop: "teachingSceneName",
},
{
label: "带教时间",
prop: "teachingTime",
},
{
label: "带教方式",
prop: "teachingMethodName",
},
{
label: "带教主题",
prop: "teachingTopicName",
},
{
label: "带教门店",
prop: "merchantNames",
},
{
label: "参与人员",
prop: "participantNames",
},
],
},
};
},
mounted() {
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = { id: this.detail.id };
resolve();
});
},
resolveTaskIdForDetail(row) {
if (!row)
return "";
return row.id || row.taskId || row.teachingTaskId || row.supervisorTaskId || row.requirementId || row.teachingRequirementId || row.relatedTaskId || "";
},
handleClose() {
if (this.viewMode !== "detail")
return false;
this.viewMode = "list";
this.detailForView = {};
return true;
},
handleViewDetail(data) {
const id = this.resolveTaskIdForDetail(data);
this.detailForView = { id: id ? `${id}` : "", taskType: "5" };
this.viewMode = "detail";
},
},
};
</script>
<style lang="scss" scoped>
.recording-detail {
.header {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
background: #ffffff;
padding: 14px 20px;
color: #666666;
font-size: 14px;
.title {
color: #333333;
font-weight: 500;
font-size: 16px;
margin-right: 10px;
}
}
.content {
background: #ffffff;
padding: 12px 20px;
}
}
</style>
<template>
<div class="recording-detail">
<div class="header">
<div class="left">
<span class="title">提报优秀案例录音</span>
<span>提交人:{{ detail.updatedBy }}</span>
</div>
<div>提交时间:{{ detail.updatedDate }}</div>
</div>
<div class="content">
<d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn">
<template #statusHtml="scope">
<div>
<div class="online-status">
<span
class="dot"
:style="{
background: getStatusColor(scope && scope.scope && scope.scope.reviewStatus, 'reviewCaseStatusOptMap')
}"
></span>
{{ getStatusItem(baseData, 'reviewCaseStatusOpt', scope.scope, 'reviewStatus') }}
</div>
</div>
</template>
<template #auth-button="scope">
<div>
<!-- 通过 -->
<span v-if="scope.scope.reviewStatus == 0" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9122502']" />
</span>
<!-- 驳回 -->
<span v-if="scope.scope.reviewStatus == 0" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9122503']" />
</span>
<!-- 下载录音 -->
<span v-if="scope.scope.reviewStatus != 0" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9122504']" />
</span>
</div>
</template>
</d2-table>
</div>
</div>
</template>
<script>
import { approveExcellentCase, getExcellentCaseAudioListApi, rejectExcellentCase } from '@/api/resident'
import { Util, deepClone } from '@/common/util'
import { reviewCaseStatusOpt, reviewCaseStatusOptMap } from '@/common/constants.js'
import { set } from 'js-cookie'
export default {
name: 'PresentCase',
props: {
detail: {
type: Object,
default: () => {}
}
},
data() {
return {
getListApi: getExcellentCaseAudioListApi,
searchFormSearch: {},
tableParams: {
listName: 'list',
tableOption: {
width: '170'
},
tableColumns: [
{
label: '驻店销售',
prop: 'salesName',
width: '200px'
},
{
label: '接待日期',
prop: 'receptionTime',
width: '100px'
},
{
label: '接待门店',
prop: 'merchantName',
width: 140
},
{
label: '质检评分',
prop: 'score',
formatter(row) {
return row.score != null ? row.score : '-'
}
},
{
label: '攻防评分',
prop: 'gfScroe',
formatter(row) {
return row.gfScroe != null ? row.gfScroe : '-'
}
},
{
label: '客户类型',
prop: 'customerType',
width: 160
},
{
label: '车型',
prop: 'carModel',
width: 120
},
{
label: '提交人',
prop: 'submitterName',
width: 160
},
{
label: '状态',
prop: 'reviewStatus',
minWidth: 120,
addHtml: 'statusHtml'
},
{
label: '提交时间',
prop: 'createTime',
width: 150,
formatter(row, column) {
return row.createTime ? Util.dateFormate(row.createTime, 'YYYY-MM-DD HH:mm:ss') : '-'
}
}
]
},
baseData: {
reviewCaseStatusOpt: deepClone(reviewCaseStatusOpt),
reviewCaseStatusOptMap: deepClone(reviewCaseStatusOptMap)
}
}
},
mounted() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = { id: this.detail.id }
resolve()
})
},
// 通过
handlePass(data) {
let params = { id: data.id }
approveExcellentCase(params).then(res => {
if (res) {
this.$message.success('操作成功')
this.$refs.recordTable.refreshTable()
}
})
},
// 驳回
handleReject(data) {
const params = {
id: data.id
}
rejectExcellentCase(params).then(res => {
if (res) {
this.$message.success('操作成功')
this.$refs.recordTable.refreshTable()
}
})
},
getStatusColor(status, optKey) {
if (status === null || status === undefined) return '#C0C4CC'
const map = (this.baseData && this.baseData[optKey]) || {}
return map[status] || '#C0C4CC'
},
getStatusItem(baseData, optKey, row, rowKey) {
if (!baseData || !baseData[optKey] || !row) return null
let item = baseData[optKey].find(item => item.confId == row[rowKey])
return (item && item.confValue) || '-'
},
// 下载录音
handleDownload(row) {
const recordingUrl = row.recordingUrl
if (!recordingUrl) {
this.$message.error('录音文件不存在')
return
}
// downLoadFile(recordingUrl);
window.open(recordingUrl)
}
}
}
</script>
<style lang="scss" scoped>
.recording-detail {
.header {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
background: #ffffff;
padding: 14px 20px;
color: #666666;
font-size: 14px;
.title {
color: #333333;
font-weight: 500;
font-size: 16px;
margin-right: 10px;
}
}
.content {
background: #ffffff;
padding: 12px 20px;
}
}
</style>
<!-- 督导任务详情 -->
<template>
<div class="mission-detail">
<d2-container>
<div v-if="detail.taskType == '3'">
<recording :detail="detail"/>
</div>
<div v-else>
<reviewDetail :detail="detail"/>
</div>
<div class="footer-btn">
<el-button class="cancel-btn" @click="handleBack"> 关闭 </el-button>
</div>
</d2-container>
</div>
<div class="mission-detail">
<d2-container>
<component :is="currentComponent"
ref="currentViewRef"
:detail="detail" />
<div class="footer-btn">
<el-button class="cancel-btn" @click="handleBack">
关闭
</el-button>
</div>
</d2-container>
</div>
</template>
<script>
import recording from "./components/recording.vue"
import reviewDetail from "./components/reviewDetail.vue"
import { mapActions } from "vuex"
import { mapActions } from "vuex";
import { Util } from "@/common/util";
import mentorship from "./components/mentorShip.vue";
import presentCase from "./components/presentCase.vue";
import recording from "./components/recording.vue";
import reviewDetail from "./components/reviewDetail.vue";
export default {
name: "MissionDetail",
components: {
recording,
reviewDetail
},
data() {
return {
detail: {}
}
},
mounted() {
let detail = JSON.parse(this.$route.query.detail)
detail = {
...detail,
updatedDate: detail.updatedDate ? Util.dateFormate(detail.updatedDate, 'YYYY-MM-DD HH:mm:ss') : '-'
}
this.detail = detail
},
methods: {
...mapActions({
name: "MissionDetail",
components: {
Recording: recording,
ReviewDetail: reviewDetail,
Mentorship: mentorship,
PresentCase: presentCase,
},
data() {
return {
detail: {},
};
},
computed: {
currentComponent() {
const typeMap = {
3: recording,
6: presentCase,
7: mentorship,
};
return typeMap[this.detail?.taskType] || reviewDetail;
},
},
mounted() {
let detail = JSON.parse(this.$route.query.detail);
detail = {
...detail,
updatedDate: detail.updatedDate ? Util.dateFormate(detail.updatedDate, "YYYY-MM-DD HH:mm:ss") : "-",
};
console.log(detail, "detail");
this.detail = detail;
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
handleBack() {
this.close({ tagName: "/supervisionMissionManagement" })
this.$router.push({
name: "supervisionMissionManagement"
})
}
}
}
handleBack() {
const currentView = this.$refs.currentViewRef;
if (currentView && typeof currentView.handleClose === "function") {
const intercepted = currentView.handleClose();
if (intercepted)
return;
}
this.close({ tagName: "/supervisionMissionManagement" });
this.$router.push({
name: "supervisionMissionManagement",
});
},
},
};
</script>
<style lang="scss" scoped>
.footer-btn {
display: flex;
justify-content: center;
margin-top: 20px;
.cancel-btn {
width: 100px;
}
display: flex;
justify-content: center;
margin-top: 20px;
.cancel-btn {
width: 100px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -170,7 +170,7 @@ export default {
updateTaskTypeOptionsByTab(tabName) {
const allowMap = {
"今日任务": [3, 0, 5],
"本周任务": [1],
"本周任务": [6, 7],
"月度任务": [2],
"专项任务": [4]
}
......@@ -189,7 +189,7 @@ export default {
this.searchFormSearch = deepClone(this.searchForm)
const allowMap = {
"day": [3, 0, 5],
"week": [1],
"week": [6, 7],
"month": [2],
"special": [4]
}
......@@ -208,7 +208,7 @@ export default {
getParams() {
const allowMap = {
"day": [3, 0, 5],
"week": [1],
"week": [6, 7],
"month": [2],
"special": [4]
}
......@@ -241,7 +241,6 @@ export default {
this.getStaticsData();
},
handleDetail(data) {
console.log(data, 'data')
this.close({ tagName: "/supervisionMissionDetail" });
this.$router.push({
name: "supervisionMissionDetail",
......
......@@ -2,55 +2,44 @@
<template>
<d2-container>
<div class="detail-content">
<div class="user-info"><span class="name">{{ detail.name }}</span><span>{{ detail.phone }}</span></div>
<div class="user-info">
<span class="name">{{ detail.name }}</span>
<span>{{ detail.phone }}</span>
</div>
<div class="content-box" v-if="Object.keys(detail).length">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabList" :key="item.id" :label="item.name" :name="item.id">
</el-tab-pane>
<el-tab-pane v-for="item in tabList" :key="item.id" :label="item.name" :name="item.id"></el-tab-pane>
<div class="container">
<div class="date-select">
<dateSelectPicker :tab-key="activeName" @change="onDateChange"></dateSelectPicker>
</div>
<div class="view">
<div class="view-item">
<div class="label">
团队人员
</div>
<div class="label">团队人员</div>
<div class="value">
<span class="orange">{{staticsData.teamStaffCount !== '-' ? staticsData.teamStaffCount : '-'}}</span>
<span class="orange">{{ staticsData.teamStaffCount !== '-' ? staticsData.teamStaffCount : '-' }}</span>
</div>
</div>
<div class="view-item">
<div class="label">产值</div>
<div class="value">
<span class="green">{{staticsData.outputValue !== '-' ? `¥${staticsData.outputValue}` : '-'}}</span>
<span class="green">{{ staticsData.outputValue !== '-' ? `¥${staticsData.outputValue}` : '-' }}</span>
</div>
</div>
<div class="view-item">
<div class="label">
转化率
</div>
<div class="label">转化率</div>
<div class="value">
<span class="red">{{staticsData.conversionRate !== '-' ? `${staticsData.conversionRate}%` : '-'}}</span>
<span class="red">{{ staticsData.conversionRate !== '-' ? `${staticsData.conversionRate}%` : '-' }}</span>
</div>
</div>
<div class="view-item">
<div class="label">
客单价
</div>
<div class="label">客单价</div>
<div class="value">
<span class="red">{{staticsData.avgOrderValue !== '-' ? `¥${staticsData.avgOrderValue}` : '-'}}</span>
<span class="red">{{ staticsData.avgOrderValue !== '-' ? `¥${staticsData.avgOrderValue}` : '-' }}</span>
</div>
</div>
</div>
<d2-table
ref="supervisionDetailTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
</d2-table>
<d2-table ref="supervisionDetailTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn"></d2-table>
</div>
</el-tabs>
</div>
......@@ -58,73 +47,89 @@
</d2-container>
</template>
<script>
import { getSupervisorDetailSummaryApi, getSupervisorDetailApi } from "@api/resident"
import { Util, deepClone } from "@/common/util"
import dateSelectPicker from "../components/dateSelectPicker.vue";
import { getSupervisorDetailSummaryApi, getSupervisorDetailApi } from '@api/resident'
import { Util, deepClone } from '@/common/util'
import dateSelectPicker from '../components/dateSelectPicker.vue'
export default {
name: "SupervisionDetail",
name: 'SupervisionDetail',
components: {
dateSelectPicker
},
data() {
return {
tabList: [{
name: '全场景',
id: '0'
}, {
name: '延保',
id: '1'
}, {
name: '权益',
id: '3'
}, {
name: '轻改',
id: '2'
}],
tabList: [
{
name: '全场景',
id: '0'
},
{
name: '延保',
id: '1'
},
{
name: '权益',
id: '3'
},
{
name: '轻改',
id: '2'
}
],
getListApi: getSupervisorDetailApi,
activeName: '0',
detail: {},
searchForm: {},
searchFormSearch: {},
staticsData: {},
staticsData: {
teamStaffCount: '',
outputValue: '',
conversionRate: '',
avgOrderValue: ''
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
listName: 'list',
tableOption: false,
tableColumns: [
{
label: "驻店销售",
prop: "staffName",
label: '驻店销售',
prop: 'staffName'
},
{
label: "归属业务",
prop: "bizNames",
formatter: (cellValue) => {
label: '归属业务',
prop: 'bizNames',
formatter: cellValue => {
let names = ['', '延保', '轻改', '权益']
if (!cellValue.bizNames) return '-'
let bizArray = cellValue.bizNames?.split(',')?.map(item => item.trim()).filter(item => item !== '')
let result = bizArray.map(index => names[parseInt(index)]).filter(name => name !== '').join(',')
let bizArray = cellValue.bizNames
?.split(',')
?.map(item => item.trim())
.filter(item => item !== '')
let result = bizArray
.map(index => names[parseInt(index)])
.filter(name => name !== '')
.join(',')
return result
}
},
{
label: "产值",
prop: "outputValue",
formatter: (cellValue) => {
label: '产值',
prop: 'outputValue',
formatter: cellValue => {
return (cellValue.outputValue ?? '') !== '' ? `¥${cellValue.outputValue}` : '-'
}
},
{
label: "转化率",
prop: "conversionRate",
formatter: (cellValue) => {
label: '转化率',
prop: 'conversionRate',
formatter: cellValue => {
return (cellValue.conversionRate ?? '') !== '' ? `${cellValue.conversionRate}%` : '-'
}
},
{
label: "客单价",
prop: "avgOrderValue",
formatter: (cellValue) => {
label: '客单价',
prop: 'avgOrderValue',
formatter: cellValue => {
return (cellValue.avgOrderValue ?? '') !== '' ? `¥${cellValue.avgOrderValue}` : '-'
}
}
......@@ -154,24 +159,25 @@ export default {
}
},
beforeSearchFn() {
return new Promise((resolve) => {
return new Promise(resolve => {
this.searchFormSearch = {
supervisorPhone: this.detail.phone,
...deepClone(this.searchForm),
bizType: this.activeName > 0 ? this.activeName : undefined
}
console.log('searchFormSearch', this.searchFormSearch)
resolve()
})
},
handleClick(event) {
this.activeName = event.paneName
this.searchForm.bizType = event.paneName || ''
// this.searchForm.bizType = event.paneName || ''
},
onDateChange(e) {
let dateTypes = ['day', 'week', 'month']
this.searchForm.dateType = dateTypes?.findIndex(i => i == e.type)
this.searchForm.startDate = e.startTime?.replace(/\//g, "-")
this.searchForm.endDate = e.endTime?.replace(/\//g, "-")
this.searchForm.startDate = e.startTime?.replace(/\//g, '-')
this.searchForm.endDate = e.endTime?.replace(/\//g, '-')
this.$refs.supervisionDetailTable?.refreshTable(true, true)
this.getStaticsData()
}
......@@ -188,7 +194,7 @@ export default {
color: #666666;
height: 52px;
line-height: 52px;
background: #FFFFFF;
background: #ffffff;
.name {
font-size: 16px;
color: #333333;
......@@ -201,7 +207,7 @@ export default {
}
.content-box {
margin-top: 12px;
background: #FFFFFF;
background: #ffffff;
.container {
padding: 0 20px;
}
......@@ -228,10 +234,10 @@ export default {
font-size: 20px;
font-weight: 500;
margin-top: 4px;
color: #1D1D1D;
color: #1d1d1d;
}
}
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -25,12 +25,12 @@ const SALES_CATEGORY_LIST = [
title: '预估经营数据', list: [
{ label: '转化率', key: 'estimatedConversionRate', unit: '%', type: 'input', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '升级客单价', key: 'upgradePrice', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '产值', key: 'revenue', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '产值', key: 'revenue', type: 'input', filterRule: 'decimalRange', min: 0, max: 9999999, precision: 2 },
]
},
{
title: '商务政策', list: [
{ label: '流量费', key: 'trafficFee', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '流量费', key: 'trafficFee', type: 'input', filterRule: 'decimalRange', min: 0, max: 9999999, precision: 2 },
{ label: '管理层市场费1', key: 'marketFee1', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '管理层市场费2', key: 'marketFee2', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '一线阳光激励1', key: 'incentive1', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
......
<template>
<d2-dialog
title="新增课程"
:is-visible.sync="isVisible"
width="1040px"
btn-ok-label="确定"
@confirmDialog="handleConfirm"
@closeDialog="handleClose"
>
<curricula-variable
ref="curriculaVariable"
:courseList="courseList"
:selectedRows="selectedDialogRows"
@handleCourse="handleCourse"
@fromAllocation="fromAllocation"
></curricula-variable>
</d2-dialog>
<d2-dialog title="新增课程"
:is-visible.sync="isVisible"
width="1120px"
btn-ok-label="确定"
@confirmDialog="handleConfirm"
@closeDialog="handleClose">
<CurriculaVariable ref="curriculaVariable"
:course-list="courseList"
:course-total="courseTotal"
:selected-rows="selectedDialogRows"
@handleCourse="handleCourse"
@fromAllocation="fromAllocation">
</CurriculaVariable>
</d2-dialog>
</template>
<script>
import curriculaVariable from "./allocation"
import { getStaffTagCourseList } from "@/api/serviceCentre"
import { getStaffTagCourseList } from "@/api/serviceCentre";
import curriculaVariable from "./allocation";
export default {
data() {
return {
selectData: [],
courseList: []
}
},
components: {
curriculaVariable
},
props: {
isVisible: {
type: Boolean,
default: false
},
selectedRows: {
type: Array,
default: () => []
},
staffItem: {
type: Object,
default: () => {}
}
},
watch: {
isVisible: {
handler(val) {
if (val) {
this.getStaffTagCourseList()
}
},
immediate: true
},
selectedRows: {
type: Array,
default: () => []
}
},
computed: {
selectedDialogRows() {
console.log(2323232323)
return this.selectedRows.map((item) => {
return item
})
}
},
methods: {
getStaffTagCourseList(courseForm = {}) {
let params = {
staffPhone: this.staffItem.phone,
currentPage: 1,
pageSize: 99999,
queryAll: false,
...courseForm
}
getStaffTagCourseList(params).then((res) => {
this.courseList = res ? res.list : []
})
},
handleCourse(data) {
this.selectData = data
},
fromAllocation(val) {
this.getStaffTagCourseList(val)
},
// 确认仅返回整条数据数组
handleConfirm() {
this.$emit("handleConfirm", this.selectData)
},
handleClose() {
this.$emit("handleClose")
}
}
}
components: {
CurriculaVariable: curriculaVariable,
},
props: {
isVisible: {
type: Boolean,
default: false,
},
selectedRows: {
type: Array,
default: () => [],
},
staffItem: {
type: Object,
default: () => {},
},
},
data() {
return {
selectData: [],
courseList: [],
courseTotal: 0,
};
},
computed: {
selectedDialogRows() {
return this.selectedRows.map((item) => {
return item;
});
},
},
watch: {
isVisible: {
handler(val) {
if (val) {
// 弹框每次 v-if 重建后 selectData 为空,需从 props 同步已选数据
this.selectData = Array.isArray(this.selectedRows)
? [...this.selectedRows]
: [];
this.getStaffTagCourseList();
}
},
immediate: true,
},
},
methods: {
getStaffTagCourseList(courseForm = {}) {
let params = {
staffPhone: this.staffItem.phone,
currentPage: 1,
pageSize: 5,
queryAll: false,
...courseForm,
};
getStaffTagCourseList(params).then((res) => {
this.courseList = res ? res.list : [];
this.courseTotal = res ? res.total : 0;
});
},
handleCourse(data) {
this.selectData = data;
},
fromAllocation(val) {
this.getStaffTagCourseList(val);
},
// 确认仅返回整条数据数组
handleConfirm() {
const curriculaRef = this.$refs.curriculaVariable;
const data
= curriculaRef && Array.isArray(curriculaRef.selectCourseList)
? [...curriculaRef.selectCourseList]
: [...this.selectData];
this.$emit("handleConfirm", data);
},
handleClose() {
this.$emit("handleClose");
},
},
};
</script>
<style lang="scss" scoped>
.relateEmp {
::v-deep .el-dialog__header {
border-bottom: 1px solid #e5e5e5;
}
::v-deep .d2-search .d2-search-block {
padding: 0px !important;
}
::v-deep .el-dialog__header {
font-size: 20px;
line-height: 24px;
}
.select-text {
color: #333333;
font-size: 14px;
position: relative;
right: 65%;
margin-bottom: 8px;
}
.online-status {
display: flex;
justify-content: center;
align-items: center;
::v-deep .el-dialog__header {
border-bottom: 1px solid #e5e5e5;
}
::v-deep .d2-search .d2-search-block {
padding: 0px !important;
}
::v-deep .el-dialog__header {
font-size: 20px;
line-height: 24px;
}
.select-text {
color: #333333;
font-size: 14px;
position: relative;
right: 65%;
margin-bottom: 8px;
}
.online-status {
display: flex;
justify-content: center;
align-items: center;
.dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
}
.dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
}
}
</style>
......@@ -140,6 +140,7 @@
<div>
<CurriculaVariable ref="curriculaVariable"
:course-list="courseList"
:course-total="courseTotal"
:selected-rows="selectStaffCourseList"
@fromAllocation="fromAllocation"
@handleCourse="handleCourse">
......@@ -308,6 +309,7 @@ export default {
],
staffListData: [],
courseList: [],
courseTotal: 0,
staffTagCourseList: [], // 已配置的课程列表不可以删除
selectStaffCourseList: [], // 已配置的课程列表可以删除
allStaffCourseList: [], // 合并的数据
......@@ -417,12 +419,13 @@ export default {
let params = {
staffPhone: this.staffItem.phone,
currentPage: 1,
pageSize: 99999,
pageSize: 5,
queryAll: false,
...courseForm,
};
getStaffTagCourseList(params).then((res) => {
this.courseList = res ? res.list : [];
this.courseTotal = res ? res.total : 0;
});
},
// 查询员工已配置课程
......
......@@ -5,8 +5,8 @@
<div class="header">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
label-width="120px"
:form-data="showFormData"
:search-form="searchForm">
</d2-search>
<div class="up-btns">
......@@ -231,6 +231,16 @@ export default {
width: 120,
},
{
label: "使用门店",
prop: "storeUsage",
width: 120,
},
{
label: "支付时间",
prop: "successDate",
width: 150,
},
{
label: "出入库方式",
prop: "stockMethod",
width: 120,
......
......@@ -316,6 +316,25 @@ export default {
label: "备注",
prop: " remark",
}, {
label: "出库方式",
prop: "reduceMethod",
width: "200px",
formatter: (cellValue) => {
// 出库方式: 2-扫码出库, 4-手工出库
return cellValue.reduceMethod == 2 ? "扫码出库" : cellValue.reduceMethod == 4 ? "手工出库" : "-";
},
}, {
label: "备注",
prop: " remark",
}, {
label: "支付时间",
prop: "successDate",
width: 150,
formatter: (cellValue) => {
return cellValue.successDate ? Util.dateFormate(cellValue.successDate, "YYYY-MM-DD HH:mm:ss") : "";
},
},
{
label: "操作人",
prop: "updatedUserName",
width: "100px",
......
<!-- 调拨发货 -->
<template>
<d2-container class="container">
<template #header>
<div class="header">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
handle
size="small"
type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<span>
<!-- 导出暂时不做 -->
<!-- <span style="margin-right: 10px">
<d2-container class="container">
<template #header>
<div class="header">
<d2-search ref="showSearch" class="show-search" :form-data="showFormData" :search-form="searchForm">
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" handle size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header>
<span>
<!-- 导出暂时不做 -->
<!-- <span style="margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9081101']" />
</span> -->
<auth-button category="Button" :show-btn-ids="['9081102']" />
</span>
</d2-table-header>
<d2-table ref="transferShipmentTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="tableSearchForm"
:selectable-fn="selectableFn"
:table-data="tableData"
:table-params="tableParams"
@selectionTable="handleSelectionChange">
<template #receiver="scope">
<div v-if="scope.scope.receiver">
<el-popover v-if="scope.scope.receiver.length > 12"
effect="dark"
placement="top"
trigger="hover"
width="300">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.receiver) }}
</div>
<template #reference>
<div>
{{ spanFilter(scope.scope.receiver, 12) }}
</div>
</template>
</el-popover>
<div v-else>
{{ scope.scope.receiver }}
</div>
</div>
<span v-else>-</span>
</template>
<template #address="scope">
<div v-if="scope.scope.address">
<el-popover v-if="scope.scope.address.length > 12"
effect="dark"
placement="top"
trigger="hover"
width="300">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.address) }}
</div>
<template #reference>
<div>
{{ spanFilter(scope.scope.address, 12) }}
</div>
</template>
</el-popover>
<div v-else>
{{ scope.scope.address }}
</div>
</div>
<span v-else>-</span>
</template>
<template #auth-button="scope">
<div>
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081103']" />
</span>
<span v-if="scope.scope.deliveryStatus != 2 && scope.scope.billStatus != 7" style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081104']" />
</span>
<auth-button v-if="scope.scope.billStatus != 7 && scope.scope.deliveryStatus == 1"
:data="scope.scope"
:show-btn-ids="['9081105']" />
</div>
</template>
</d2-table>
</div>
<ShipmentDialog v-if="shipmentVisible"
:params-obj="shipmentDialogData"
:table-list="shipmentTableList"
:visible.sync="shipmentVisible"
@shipmentClose="shipmentDialogClose">
</ShipmentDialog>
<RejectDialog v-if="rejectVisible"
:reject-data="rejectData"
:visible.sync="rejectVisible"
@rejectClose="handleRejectClose">
</RejectDialog>
<TransferDetailDialog v-if="transferDetailVisible"
:params-obj="transferObj"
:visible.sync="transferDetailVisible">
</TransferDetailDialog>
</d2-container>
<auth-button category="Button" :show-btn-ids="['9081102']" />
</span>
</d2-table-header>
<d2-table ref="transferShipmentTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:search-form="tableSearchForm" :selectable-fn="selectableFn" :table-data="tableData"
:table-params="tableParams" @selectionTable="handleSelectionChange">
<template #receiver="scope">
<div v-if="scope.scope.receiver">
<el-popover v-if="scope.scope.receiver.length > 12" effect="dark" placement="top" trigger="hover"
width="300">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.receiver) }}
</div>
<template #reference>
<div>
{{ spanFilter(scope.scope.receiver, 12) }}
</div>
</template>
</el-popover>
<div v-else>
{{ scope.scope.receiver }}
</div>
</div>
<span v-else>-</span>
</template>
<template #address="scope">
<div v-if="scope.scope.address">
<el-popover v-if="scope.scope.address.length > 12" effect="dark" placement="top" trigger="hover"
width="300">
<div class="merchant-name-box">
{{ spanFilter(scope.scope.address) }}
</div>
<template #reference>
<div>
{{ spanFilter(scope.scope.address, 12) }}
</div>
</template>
</el-popover>
<div v-else>
{{ scope.scope.address }}
</div>
</div>
<span v-else>-</span>
</template>
<template #auth-button="scope">
<div>
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081103']" />
</span>
<span v-if="scope.scope.deliveryStatus != 2 && scope.scope.billStatus != 7"
style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9081104']" />
</span>
<auth-button v-if="scope.scope.billStatus != 7 && scope.scope.deliveryStatus == 1"
:data="scope.scope" :show-btn-ids="['9081105']" />
</div>
</template>
</d2-table>
</div>
<ShipmentDialog v-if="shipmentVisible" :params-obj="shipmentDialogData" :table-list="shipmentTableList"
:visible.sync="shipmentVisible" @shipmentClose="shipmentDialogClose">
</ShipmentDialog>
<RejectDialog v-if="rejectVisible" :reject-data="rejectData" :visible.sync="rejectVisible"
@rejectClose="handleRejectClose">
</RejectDialog>
<TransferDetailDialog v-if="transferDetailVisible" :params-obj="transferObj" :visible.sync="transferDetailVisible">
</TransferDetailDialog>
</d2-container>
</template>
<script>
......@@ -184,6 +160,12 @@ export default {
type: "input",
isClear: true,
},
{
label: "采购单号",
name: "purchaseOrderCode",
type: "input",
isClear: true,
},
],
getListApi: getTransferShipmentList,
// 表格参数
......@@ -202,6 +184,11 @@ export default {
width: 150,
},
{
label: "关联采购单号",
prop: "purchaseOrderCode",
width: 150,
},
{
label: "产品名称",
prop: "goodsName",
},
......
......@@ -70,7 +70,8 @@
format="yyyy-MM"
placeholder="选择月"
:picker-options="pickerOption"
class="sortInput">
class="sortInput"
@change="handleTargetMonthChange">
</el-date-picker>
</div>
<div v-else>
......@@ -79,6 +80,20 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属周期:"
:prop="operationType !='detail'?'periodRange':''">
<div v-if="operationType !='detail'">
<period-date-range v-model="formData.periodRange"
:target-month="formData.targetMonth" />
</div>
<div v-else>
{{ formData.periodDateStr || '-' }}
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="交付数:"
:prop="operationType !='detail'?'targetValue':''">
<div v-if="operationType !='detail'">
......@@ -92,17 +107,12 @@
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="录入时间:"
v-if="operationType!='add'">
{{ formData.createdDateShow }}
</el-form-item>
</el-col>
<el-col :span="12">
</el-col>
</el-row>
</el-form>
<div v-if="operationType!='add'">
......@@ -123,14 +133,18 @@
<script>
import { Util, deepClone } from '@/common/util'
import { limitPrice, rangePickerOptions_deliveryQuantity } from '@/common/format'
import { limitPrice, rangePickerOptions_deliveryQuantity, getMonthDateRange } from '@/common/format'
import { getList } from "@api/merchant"
import { outputValue_operTypeOpt } from "@/common/constants.js"
import { insertDeliverTargeConfig, updateDeliverTargeConfig, getById_deliver, getCarBrand } from '@api/shopConfig'
import periodDateRange from './periodDateRange'
// import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default {
name: 'EditDialog',
components: {
periodDateRange
},
// mixins: [reportTrackFunMixin],
directives: {
'el-select-loadmore': {
......@@ -169,7 +183,9 @@ export default {
childId: '',
childName: '',
targetValue: '',
targetMonth: ''
targetMonth: '',
periodRange: [],
periodDateStr: ''
},
oldVal: {
targetValue: ''
......@@ -183,6 +199,30 @@ export default {
merchantId: [{ required: true, message: '请选择4S门店', trigger: 'change' }],
brand: [{ required: true, message: '请选择品牌', trigger: 'change' }],
targetMonth: [{ required: true, message: '请选择交付目标月份', trigger: 'change' }],
periodRange: [{
required: true,
trigger: 'change',
validator: (rule, value, callback) => {
if (!value || value.length !== 2 || !value[0] || !value[1]) {
callback(new Error('请选择归属周期'))
return
}
const monthRange = getMonthDateRange(this.formData.targetMonth)
if (!monthRange) {
callback(new Error('请先选择交付目标月份'))
return
}
if (value[0] !== monthRange.startDate) {
callback(new Error('归属周期开始日期必须为当月1号'))
return
}
if (value[1] < value[0] || value[1] > monthRange.endDate) {
callback(new Error('归属周期结束日期无效'))
return
}
callback()
}
}],
targetValue: [{ required: true, message: '请输入交付数', trigger: 'blur' }]
},
searchForm: {
......@@ -338,10 +378,31 @@ export default {
this.formData.createdDateShow = this.formData.createdDate
? Util.dateFormate(this.formData.createdDate, 'YYYY-MM-DD HH:mm:ss')
: ""
this.fillPeriodRange()
}).catch(() => {
})
},
fillPeriodRange() {
if (this.operationType === 'detail') return
if (this.formData.periodStartDate && this.formData.periodEndDate) {
this.formData.periodRange = [this.formData.periodStartDate, this.formData.periodEndDate]
return
}
if (this.formData.periodDateStr) {
const parts = this.formData.periodDateStr.split('-')
if (parts.length >= 2) {
const start = parts[0].replace(/\//g, '-')
const end = parts.slice(1).join('-').replace(/\//g, '-')
this.formData.periodRange = [start, end]
}
}
},
handleTargetMonthChange() {
this.formData.periodRange = []
},
choose4S(merchantId) {
this.formData.brand = []
this.formData.brandId = ''
......@@ -392,6 +453,9 @@ export default {
this.$refs.infoForm.validate(valid => {
if (valid) {
var params = deepClone(this.formData)
params.periodStartDate = params.periodRange[0]
params.periodEndDate = params.periodRange[1]
delete params.periodRange
if (params.id) {
updateDeliverTargeConfig(params).then(res => {
this.notice.okTips('操作成功')
......
<!-- 归属周期:日期区间 + 全月 -->
<template>
<div class="period-date-range">
<el-date-picker v-model="innerRange"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
format="yyyy/MM/dd"
:disabled="disabled || !targetMonth"
:picker-options="periodPickerOptions"
class="period-picker"
@change="handleRangeChange" />
<el-checkbox v-model="isFullMonth"
:disabled="disabled || !targetMonth"
class="full-month-check"
@change="handleFullMonthChange">
全月
</el-checkbox>
</div>
</template>
<script>
import { getMonthDateRange } from '@/common/format'
export default {
name: 'PeriodDateRange',
props: {
value: {
type: Array,
default: () => []
},
targetMonth: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
innerRange: [],
isFullMonth: false,
rangePickAnchor: null
}
},
computed: {
periodPickerOptions() {
const monthRange = getMonthDateRange(this.targetMonth)
return {
onPick: ({ minDate, maxDate }) => {
if (maxDate) {
this.rangePickAnchor = null
} else if (minDate) {
this.rangePickAnchor = minDate
}
},
disabledDate: (time) => {
if (!monthRange) return true
const { startDate, endDate } = monthRange
const timeStr = this.formatDateStr(time)
if (timeStr < startDate || timeStr > endDate) return true
if (!this.rangePickAnchor) {
return timeStr !== startDate
}
return timeStr < startDate || timeStr > endDate
}
}
}
},
watch: {
value: {
immediate: true,
handler(val) {
this.innerRange = val && val.length ? [...val] : []
this.syncFullMonthState()
}
},
targetMonth(val, oldVal) {
if (val !== oldVal) {
this.rangePickAnchor = null
this.innerRange = []
this.isFullMonth = false
this.emitChange([])
}
}
},
methods: {
formatDateStr(time) {
const y = time.getFullYear()
const m = String(time.getMonth() + 1).padStart(2, '0')
const d = String(time.getDate()).padStart(2, '0')
return `${y}-${m}-${d}`
},
syncFullMonthState() {
if (!this.targetMonth || !this.innerRange || this.innerRange.length !== 2) {
this.isFullMonth = false
return
}
const { startDate, endDate } = getMonthDateRange(this.targetMonth) || {}
this.isFullMonth = this.innerRange[0] === startDate && this.innerRange[1] === endDate
},
normalizeRange(range) {
if (!range || range.length !== 2 || !this.targetMonth) return []
const { startDate, endDate } = getMonthDateRange(this.targetMonth) || {}
if (!startDate || !endDate) return []
let end = range[1]
if (end < startDate) end = startDate
if (end > endDate) end = endDate
return [startDate, end]
},
emitChange(range) {
this.$emit('input', range)
this.$emit('change', range)
},
handleRangeChange(val) {
this.rangePickAnchor = null
if (!val || val.length !== 2) {
this.isFullMonth = false
this.emitChange([])
return
}
const normalized = this.normalizeRange(val)
this.innerRange = normalized
this.syncFullMonthState()
this.emitChange(normalized)
},
handleFullMonthChange(checked) {
if (checked) {
const { startDate, endDate } = getMonthDateRange(this.targetMonth) || {}
if (startDate && endDate) {
this.innerRange = [startDate, endDate]
this.emitChange([startDate, endDate])
}
} else {
this.innerRange = []
this.emitChange([])
}
}
}
}
</script>
<style lang="scss" scoped>
.period-date-range {
display: flex;
align-items: center;
width: 90%;
.period-picker {
flex: 1;
}
.full-month-check {
margin-left: 10px;
white-space: nowrap;
}
}
</style>
......@@ -91,7 +91,26 @@
title="交付数导入"
@closeDialog="handleImport"
@confirmDialog="handleConfirmImport"
@downloadTemplate="exportTemplate" />
@downloadTemplate="exportTemplate">
<template #prepend>
<el-form-item label="交付目标月份:"
required>
<el-date-picker v-model="importForm.targetMonth"
type="month"
value-format="yyyy-MM"
format="yyyy-MM"
placeholder="选择月"
:picker-options="importMonthPickerOption"
style="width: 100%;"
@change="handleImportTargetMonthChange" />
</el-form-item>
<el-form-item label="归属周期:"
required>
<period-date-range v-model="importForm.periodRange"
:target-month="importForm.targetMonth" />
</el-form-item>
</template>
</d2-file-import-dialog>
<!-- 新增&修改&详情 -->
<edit-dialog :visible.sync="editVisible"
v-if="editVisible"
......@@ -106,9 +125,11 @@ import { mapActions, mapState } from "vuex"
import { Util, deepClone } from "@/common/util"
import inputRange from './components/inputRange'
import editDialog from "./components/editDialog"
import periodDateRange from './components/periodDateRange'
import { listWithPage_deliver, deliverTargeConfigImport, deleteById_deliver, distinctAllBrand } from '@api/shopConfig'
import { getList } from "@api/merchant"
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
import { rangePickerOptions_deliveryQuantity_import } from '@/common/format'
export default {
name: "DeliveryQuantity",
mixins: [reportTrackFunMixin], // 导入混入
......@@ -199,6 +220,14 @@ export default {
width: "150"
},
{
label: "归属周期",
prop: "periodDateStr",
width: "200",
formatter: (cellValue) => {
return cellValue.periodDateStr || "-"
}
},
{
label: "交付数",
prop: "targetValue",
width: "200",
......@@ -226,6 +255,11 @@ export default {
pageSize: 20,
fileVisible: false,
editVisible: false,
importMonthPickerOption: rangePickerOptions_deliveryQuantity_import,
importForm: {
targetMonth: '',
periodRange: []
},
track_event_code: 'shopConfig_deliver_list',
track_businessParam_key: 'searchForm'
}
......@@ -233,7 +267,8 @@ export default {
components: {
inputRange,
editDialog
editDialog,
periodDateRange
},
computed: {
...mapState({
......@@ -436,12 +471,43 @@ export default {
},
handleImport() {
if (this.fileVisible) {
this.resetImportForm()
}
this.fileVisible = !this.fileVisible
},
resetImportForm() {
this.importForm = {
targetMonth: '',
periodRange: []
}
},
handleImportTargetMonthChange() {
this.importForm.periodRange = []
},
validateImportForm() {
if (!this.importForm.targetMonth) {
this.notice.warningTips('请选择交付目标月份')
return false
}
const { periodRange } = this.importForm
if (!periodRange || periodRange.length !== 2 || !periodRange[0] || !periodRange[1]) {
this.notice.warningTips('请选择归属周期')
return false
}
return true
},
handleConfirmImport({ fileName, fileData }) {
if (!this.validateImportForm()) return
var params = {
file: fileData
file: fileData,
targetMonth: this.importForm.targetMonth,
periodStartDate: this.importForm.periodRange[0],
periodEndDate: this.importForm.periodRange[1]
}
deliverTargeConfigImport(params).then(res => {
if (res) {
......@@ -455,6 +521,7 @@ export default {
this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功')
this.$refs.recordTable.refreshTable(false, true)
this.resetImportForm()
this.handleImport()
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!