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 ...@@ -7,7 +7,7 @@ node_modules
.cursorrules .cursorrules
.cursor .cursor
.trae .trae
.vscode/changelists.json
# 本地环境文件不上传 # 本地环境文件不上传
.env.local .env.local
.env.*.local .env.*.local
......
...@@ -15,6 +15,51 @@ ...@@ -15,6 +15,51 @@
"vetur.experimental.templateInterpolationService": false, "vetur.experimental.templateInterpolationService": false,
"editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true, "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.autoIndent": "full",
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
// "source.organizeImports": "explicit", // "source.organizeImports": "explicit",
......
...@@ -106,7 +106,9 @@ export default antfu({ ...@@ -106,7 +106,9 @@ export default antfu({
"SLOT", // v-slot slot "SLOT", // v-slot slot
"TWO_WAY_BINDING", // v-model "TWO_WAY_BINDING", // v-model
"OTHER_DIRECTIVES", // v-custom-directive "OTHER_DIRECTIVES", // v-custom-directive
"OTHER_ATTR", // 自定义属性和其他 "ATTR_STATIC", // 静态属性排最前
"ATTR_SHORTHAND_BOOL", // 布尔简写排中间
"ATTR_DYNAMIC", // 动态绑定排最后
"EVENTS", // @click @focus "EVENTS", // @click @focus
"CONTENT", // v-text v-html "CONTENT", // v-text v-html
], ],
......
...@@ -38,3 +38,15 @@ export function constructionMerchantList(data) { ...@@ -38,3 +38,15 @@ export function constructionMerchantList(data) {
export function constructionSellerList(data) { export function constructionSellerList(data) {
return request({ ...data, method: CONSTRUCTION_SELLER_LIST }, 'post') 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) { ...@@ -237,3 +237,9 @@ export function getAuditOrderDetail(data) {
data.method = `${path2}goodsOrderApplyRecord.detail.select` data.method = `${path2}goodsOrderApplyRecord.detail.select`
return request(data, "post") 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 = {}) { ...@@ -808,6 +808,32 @@ export function assignStoreApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.account.merchant.assign"; data.method = "dj.api.smartcarlife.staffBaseInfo.account.merchant.assign";
return request(data, "post"); 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 = {}) { export function beiSenJobPostPageApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.beiSenJobPost.page"; data.method = "dj.api.smartcarlife.staffBaseInfo.beiSenJobPost.page";
...@@ -828,3 +854,14 @@ export function beiSenEmployeeDisableApi(data = {}) { ...@@ -828,3 +854,14 @@ export function beiSenEmployeeDisableApi(data = {}) {
data.method = "dj.api.smartcarlife.staffBaseInfo.account.disable"; data.method = "dj.api.smartcarlife.staffBaseInfo.account.disable";
return request(data, "post"); 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) { ...@@ -364,4 +364,10 @@ export function importLightChangePhone(data) {
data.method = `${path}servicecenter.short.course.phone.import`; data.method = `${path}servicecenter.short.course.phone.import`;
// 文件参数不参与签名拼接(参考 importProfit) // 文件参数不参与签名拼接(参考 importProfit)
return request(data, RequestMethods.POST, ["file"]); 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 \ No newline at end of file
...@@ -2023,9 +2023,17 @@ export const superviseTaskTypeOpt = [ ...@@ -2023,9 +2023,17 @@ export const superviseTaskTypeOpt = [
confName: "督导日报", confName: "督导日报",
confId: 0, confId: 0,
}, },
// {
// confName: "本周复盘",
// confId: 1,
// },
{ {
confName: "本周复盘", confName: "提报优秀案例录音",
confId: 1, confId: 6,
},
{
confName: "带教要求",
confId: 7,
}, },
{ {
confName: "督导月度计划", confName: "督导月度计划",
......
...@@ -472,3 +472,52 @@ export const rangePickerOptions_deliveryQuantity = { ...@@ -472,3 +472,52 @@ export const rangePickerOptions_deliveryQuantity = {
return !isAllowed; // 不在允许范围则禁用 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 @@ ...@@ -338,15 +338,6 @@
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" /> <img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div> </div>
</GLDialog> </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> </div>
</template> </template>
...@@ -356,12 +347,10 @@ import { rangePickerOptions_30day2 } from "@/common/format"; ...@@ -356,12 +347,10 @@ import { rangePickerOptions_30day2 } from "@/common/format";
import RemoteSelect from "@/components/remoteSearchSelect/index.vue"; import RemoteSelect from "@/components/remoteSearchSelect/index.vue";
import GLDialog from "../glsx-dialog/index.vue"; import GLDialog from "../glsx-dialog/index.vue";
import { afterRangePickerOptions, beforeRangePickerOptions } from "./common"; import { afterRangePickerOptions, beforeRangePickerOptions } from "./common";
import mapView from "./mapView.vue";
export default { export default {
name: "GlsxCombiForm", name: "GlsxCombiForm",
components: { components: {
MapView: mapView,
GLDialog, GLDialog,
RemoteSelect, RemoteSelect,
}, },
...@@ -422,9 +411,6 @@ export default { ...@@ -422,9 +411,6 @@ export default {
afterRangePickerOptions, afterRangePickerOptions,
rangePickerOptions_30day2, rangePickerOptions_30day2,
}, },
subdistrict: 2,
dialogMapVisible: false,
targetItem: {},
isImgVisible: false, isImgVisible: false,
dialogObj: { dialogObj: {
url: "", url: "",
...@@ -839,105 +825,6 @@ export default { ...@@ -839,105 +825,6 @@ export default {
forbidEdit() { forbidEdit() {
this.$refs.textBox.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) { maxLengthInput(value, item) {
if (item.inputType && value.length > item.maxlength) { if (item.inputType && value.length > item.maxlength) {
this.formObj[item.name] = value.slice(0, 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, { ...@@ -34,40 +34,41 @@ Vue.use(VueLazyload, {
attempt: 3, // 尝试加载次数 attempt: 3, // 尝试加载次数
}); });
// 实例化 // 实例化
process.env.NODE_ENV === "production" && Sentry.init({ process.env.NODE_ENV === "production" &&
Vue, Sentry.init({
dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24", Vue,
// 与 vue.config 中 SentryWebpackPlugin.release 一致,sourcemap 才能正确解析栈 dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24",
release: process.env.VUE_APP_VERSION, // 与 vue.config 中 SentryWebpackPlugin.release 一致,sourcemap 才能正确解析栈
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4', release: process.env.VUE_APP_VERSION,
integrations: [ // dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
new BrowserTracing({ integrations: [
routingInstrumentation: Sentry.vueRouterInstrumentation(router), new BrowserTracing({
tracingOrigins: ["localhost", "my-site-url.com", /^\//], routingInstrumentation: Sentry.vueRouterInstrumentation(router),
}), tracingOrigins: ["localhost", "my-site-url.com", /^\//],
], }),
// Set tracesSampleRate to 1.0 to capture 100% ],
// of transactions for performance monitoring. // Set tracesSampleRate to 1.0 to capture 100%
// We recommend adjusting this value in production // of transactions for performance monitoring.
tracesSampleRate: 1.0, // We recommend adjusting this value in production
logErrors: true, tracesSampleRate: 1.0,
// 解决火狐浏览器 无法捕获错误的问题 logErrors: true,
beforeSend(event, hint) { // 解决火狐浏览器 无法捕获错误的问题
const isNonErrorException beforeSend(event, hint) {
= event.exception.values[0].value.startsWith( const isNonErrorException =
"Non-Error exception captured", event.exception.values[0].value.startsWith(
) "Non-Error exception captured"
|| hint.originalException.message.startsWith( ) ||
"Non-Error exception captured", hint.originalException.message.startsWith(
); "Non-Error exception captured"
if (isNonErrorException) { );
// We want to ignore those kind of errors if (isNonErrorException) {
return null; // We want to ignore those kind of errors
} return null;
return event; }
}, return event;
// "send-default-pii": true },
}); // "send-default-pii": true
});
// d2Admin 已导入 // d2Admin 已导入
// import ElementUI from 'element-ui' // import ElementUI from 'element-ui'
...@@ -108,7 +109,7 @@ Vue.directive("preventReClick", { ...@@ -108,7 +109,7 @@ Vue.directive("preventReClick", {
event && event.stopImmediatePropagation(); event && event.stopImmediatePropagation();
} }
}, },
true, true
); );
}, },
}); });
...@@ -129,55 +130,60 @@ let baseConfig = config; ...@@ -129,55 +130,60 @@ let baseConfig = config;
* 只取 .env.production .env 两个文件中的. * 只取 .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); console.log("configCenterUrl", configCenterUrl);
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取 // 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch(configCenterUrl).then( fetch(configCenterUrl)
(response) => { .then(
// 处理http响应 (response) => {
return response.json(); // 处理http响应
}, return response.json();
(error) => { },
// 处理错误 (error) => {
console.log(error); // 处理错误
}, console.log(error);
).then((response) => { }
const { code, data } = response; )
console.log("response", code, response); .then((response) => {
if (code == "200") { const { code, data } = response;
console.log(data); console.log("response", code, response);
baseConfig = data; if (code == "200") {
// console.log("baseConfig", baseConfig) console.log(data);
// window.$fetchConfig = data baseConfig = data;
} else { // console.log("baseConfig", baseConfig)
baseConfig = response; // window.$fetchConfig = data
window.$fetchConfig = response; } else {
console.log(response); baseConfig = response;
window.$gscApi = new Request({ window.$fetchConfig = response;
...response.gsc, console.log(response);
// baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade', window.$gscApi = new Request({
// baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade', ...response.gsc,
session: { // baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade',
requiresSession: true, // baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade',
sessionId: _ => util.cookies.get("token"), session: {
}, requiresSession: true,
events: { sessionId: (_) => util.cookies.get("token"),
error: (error, config) => {
Vue.prototype.$message.error(error.msg);
}, },
logout: (response, config) => { events: {
store.dispatch("d2admin/user/clear"); error: (error, config) => {
util.cookies.remove("token"); Vue.prototype.$message.error(error.msg);
router.replace("/login"); },
Vue.prototype.$message.error("登录超时,请重新登录"); logout: (response, config) => {
store.dispatch("d2admin/user/clear");
util.cookies.remove("token");
router.replace("/login");
Vue.prototype.$message.error("登录超时,请重新登录");
},
}, },
}, });
}); console.log(window.$gscApi, "========");
console.log(window.$gscApi, "========"); }
} })
}).finally(() => { .finally(() => {
init(); init();
}); });
function init() { function init() {
new Vue({ new Vue({
router, router,
......
...@@ -1032,7 +1032,7 @@ export const routerName = { ...@@ -1032,7 +1032,7 @@ export const routerName = {
{ {
authId: "9061934", authId: "9061934",
parentId: "90619", parentId: "90619",
label: "批量设置区域运营", label: "批量设置人员",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleSetBatch", handle: "handleSetBatch",
...@@ -1045,14 +1045,6 @@ export const routerName = { ...@@ -1045,14 +1045,6 @@ export const routerName = {
type: "primary", type: "primary",
handle: "handleSetBatch", handle: "handleSetBatch",
}, },
{
authId: "9061936",
parentId: "90619",
label: "批量设置线上运营",
category: "Button",
type: "primary",
handle: "handleSetBatch",
},
// 门店毛利额操作权限 // 门店毛利额操作权限
{ {
authId: "9061937", authId: "9061937",
......
...@@ -344,6 +344,13 @@ export const routerName = { ...@@ -344,6 +344,13 @@ export const routerName = {
8: "审核", 8: "审核",
}, },
}, },
addRoutePath: [
{
authId: "909060202",
name: "审核",
parentId: "90906",
},
],
handle: "handleCheck", handle: "handleCheck",
}, },
{ {
...@@ -529,6 +536,18 @@ export const routerName = { ...@@ -529,6 +536,18 @@ export const routerName = {
}, },
component: _import("purchase/singleReview"), 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: { 909080401: {
path: "/directorReview/singleReject", path: "/directorReview/singleReject",
name: "singleReject", name: "singleReject",
......
...@@ -1446,10 +1446,36 @@ export const routerName = { ...@@ -1446,10 +1446,36 @@ export const routerName = {
name: "supervisionMissionDetail", name: "supervisionMissionDetail",
meta: { meta: {
title: "详情", title: "详情",
authId: "9122501", authId: "912250101",
parentId: "91225", parentId: "91225",
activePath: "/supervisionMissionManagement", 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( component: _import(
"residentManage/supervisionManagement/mission/detail", "residentManage/supervisionManagement/mission/detail",
), ),
......
...@@ -100,6 +100,7 @@ export default { ...@@ -100,6 +100,7 @@ export default {
{ {
name: 'purchaseGoodsName', name: 'purchaseGoodsName',
label: '产品别名', label: '产品别名',
type: 'input',
width: '432px', width: '432px',
handleInput: true handleInput: true
}, },
......
...@@ -463,7 +463,7 @@ import { ...@@ -463,7 +463,7 @@ import {
} from "@api/order"; } from "@api/order";
import { getAllCategory } from "@api/product"; import { getAllCategory } from "@api/product";
import { mapActions, mapMutations, mapState } from "vuex"; 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 { auditStatusMap, BaseData, djOrderTypeList, djOrderTypeMap, goodsAuditStatusList, manageTypeList, zyVoucherStatusOpt } from "@/common/constants";
import { deepClone, Util } from "@/common/util"; import { deepClone, Util } from "@/common/util";
import chooseRuleDialog from "./chooseRuleDialog"; import chooseRuleDialog from "./chooseRuleDialog";
...@@ -740,7 +740,7 @@ export default { ...@@ -740,7 +740,7 @@ export default {
name: "provinceId", name: "provinceId",
type: "select", type: "select",
optionList: [], optionList: [],
optionId: "adcode", optionId: "code",
optionLabel: "name", optionLabel: "name",
optionsName: "provinceInfoList", optionsName: "provinceInfoList",
}, },
...@@ -1688,69 +1688,11 @@ export default { ...@@ -1688,69 +1688,11 @@ export default {
// 省市区 // 省市区
getProvinceList() { getProvinceList() {
let map = new AMap.Map("district", { getDistrictDetail({ districtName: "中国" }).then((res) => {
resizeEnable: true, if (res && res.length) {
}); this.baseData.provinceInfoList = res[0].districts;
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);
this.getOptionsList(); 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) { ...@@ -13,11 +13,16 @@ export function buildConstructionListQuery(form) {
if (raw.orderCode) out.orderCode = String(raw.orderCode).trim() if (raw.orderCode) out.orderCode = String(raw.orderCode).trim()
if (raw.technicianUuid) out['technicianUuidList[0]'] = String(raw.technicianUuid).trim() if (raw.technicianUuid) out['technicianUuidList[0]'] = String(raw.technicianUuid).trim()
if (raw.sellerUserId) out['sellerUserIdList[0]'] = String(raw.sellerUserId).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))) { if (raw.brandId !== '' && raw.brandId != null && !Number.isNaN(Number(raw.brandId))) {
out.brandId = Number(raw.brandId) out.brandId = Number(raw.brandId)
} }
if (raw.merchantId !== '' && raw.merchantId != null && !Number.isNaN(Number(raw.merchantId))) { if (raw.merchantIdList.length) {
out.merchantId = Number(raw.merchantId) out.merchantIdList = raw.merchantIdList
}
if (raw.sellerMerchantIdList.length) {
out.sellerMerchantIdList = raw.sellerMerchantIdList
} }
if (raw.constructionStatus !== '' && raw.constructionStatus != null) { if (raw.constructionStatus !== '' && raw.constructionStatus != null) {
out['constructionStatusList[0]'] = Number(raw.constructionStatus) out['constructionStatusList[0]'] = Number(raw.constructionStatus)
......
...@@ -442,7 +442,7 @@ import { ...@@ -442,7 +442,7 @@ import {
} from "@api/order"; } from "@api/order";
import { getAllCategory } from "@api/product"; import { getAllCategory } from "@api/product";
import { mapActions, mapMutations, mapState } from "vuex"; 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 { auditStatusMap, BaseData, djOrderTypeList, djOrderTypeMap, goodsAuditStatusList, manageTypeList } from "@/common/constants";
import { Util } from "@/common/util"; import { Util } from "@/common/util";
import chooseRuleDialog from "./chooseRuleDialog"; import chooseRuleDialog from "./chooseRuleDialog";
...@@ -684,7 +684,7 @@ export default { ...@@ -684,7 +684,7 @@ export default {
name: "provinceId", name: "provinceId",
type: "select", type: "select",
optionList: [], optionList: [],
optionId: "adcode", optionId: "code",
optionLabel: "name", optionLabel: "name",
optionsName: "provinceInfoList", optionsName: "provinceInfoList",
}, },
...@@ -899,7 +899,7 @@ export default { ...@@ -899,7 +899,7 @@ export default {
salesTypeList: [ salesTypeList: [
{ {
confId: "0", confId: "0",
confLabel: "门店引流 - 售前", confLabel: "销售端引流 - 售前",
}, },
{ {
confId: "1", confId: "1",
...@@ -909,6 +909,10 @@ export default { ...@@ -909,6 +909,10 @@ export default {
confId: "2", confId: "2",
confLabel: "自然到店", confLabel: "自然到店",
}, },
{
confId: "3",
confLabel: "交付端引流 - 售前",
},
], ],
productTypeList: [], productTypeList: [],
saleFlagList: [ saleFlagList: [
...@@ -1075,13 +1079,14 @@ export default { ...@@ -1075,13 +1079,14 @@ export default {
this.getOptionsList(); this.getOptionsList();
}, },
/** 客户来源:0 门店引流-售前 / 1 门店引流-售后 / 2 自然到店 */ /** 客户来源:0 销售端引流售前 / 1 门店引流-售后 / 2 自然到店 / 3 交付端引流售前 */
getSalesTypeLabel(v) { getSalesTypeLabel(v) {
if (v === null || v === undefined || v === "") return "-"; if (v === null || v === undefined || v === "") return "-";
const map = { const map = {
0: "门店引流 - 售前", 0: "销售端引流 - 售前",
1: "门店引流 - 售后", 1: "门店引流 - 售后",
2: "自然到店", 2: "自然到店",
3: "交付端引流 - 售前",
}; };
const n = Number(v); const n = Number(v);
return map[n] !== undefined ? map[n] : "-"; return map[n] !== undefined ? map[n] : "-";
...@@ -1590,69 +1595,11 @@ export default { ...@@ -1590,69 +1595,11 @@ export default {
// 省市区 // 省市区
getProvinceList() { getProvinceList() {
let map = new AMap.Map("district", { getDistrictDetail({ districtName: "中国" }).then((res) => {
resizeEnable: true, if (res && res.length) {
}); this.baseData.provinceInfoList = res[0].districts;
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);
this.getOptionsList(); 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 @@ ...@@ -129,6 +129,9 @@
- -
</div> </div>
</template> </template>
<template #isAllocateHtml="scope">
<el-checkbox v-model="scope.scope.isAllocate == 1" />
</template>
</d2-table> </d2-table>
</div> </div>
<ExamineRecord v-if="detailInfo.auditDetaiList && !paramsObj.factoryType" :use-expand="false" <ExamineRecord v-if="detailInfo.auditDetaiList && !paramsObj.factoryType" :use-expand="false"
...@@ -248,6 +251,33 @@ export default { ...@@ -248,6 +251,33 @@ export default {
: `${cellValue.goodsNumber}件`; : `${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: "库存总量", label: "库存总量",
prop: "goodsTypeName", prop: "goodsTypeName",
......
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
<template> <template>
<d2-container class="container"> <d2-container class="container">
<div class="header" slot="header"> <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> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary" handle> <el-button :id="tableParams.btnId" size="small" type="primary" handle>
...@@ -25,20 +29,25 @@ ...@@ -25,20 +29,25 @@
@click="handleExport"> @click="handleExport">
导出 导出
</el-button> --> </el-button> -->
<span style="margin-right: 10px"> <!-- 批量审核先屏蔽 -->
<!-- <span style="margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9090606']" /> <auth-button category="Button" :show-btn-ids="['9090606']" />
</span> </span> -->
<auth-button category="Button" :show-btn-ids="['9090605']" /> <auth-button category="Button" :show-btn-ids="['9090605']" />
</span> </span>
</d2-table-header> </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" /> <auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" />
</d2-table> </d2-table>
</div> </div>
<orderDeatilDialog :visible.sync="detailVisible" v-if="detailVisible" :params-obj="paramsObj"></orderDeatilDialog> <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> </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> </rejectDialog>
</d2-container> </d2-container>
</template> </template>
...@@ -68,7 +77,8 @@ export default { ...@@ -68,7 +77,8 @@ export default {
merchantName: '', merchantName: '',
sortType: 2, sortType: 2,
orderTimeStr: [], orderTimeStr: [],
purchasingPattern: '' purchasingPattern: '',
onlyAllocateOrder: false
}, },
tableSearchForm: {}, tableSearchForm: {},
tableData: [], tableData: [],
...@@ -133,7 +143,12 @@ export default { ...@@ -133,7 +143,12 @@ export default {
type: 'input', type: 'input',
isClear: true, isClear: true,
maxlength: 50 maxlength: 50
} },
{
label: "仅查看调拨订单",
name: "onlyAllocateOrder",
addHtml: 'onlyAllocateOrderHtml'
},
], ],
// getListApi: getPurchaseOrderList, // getListApi: getPurchaseOrderList,
getListApi: businessreviewPage, getListApi: businessreviewPage,
...@@ -193,6 +208,11 @@ export default { ...@@ -193,6 +208,11 @@ export default {
prop: 'sendOutMerchantName' prop: 'sendOutMerchantName'
}, },
{ {
label: "关联调拨单号",
prop: "relatedAllocateCode",
width: 150
},
{
label: '发货状态', label: '发货状态',
prop: 'deliveryStatus', prop: 'deliveryStatus',
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -320,6 +340,7 @@ export default { ...@@ -320,6 +340,7 @@ export default {
} }
this.searchForm.sortType = 2 this.searchForm.sortType = 2
this.searchForm.orderTimeStr = [] this.searchForm.orderTimeStr = []
this.searchForm.onlyAllocateOrder = false
this.$refs.purchasementReviewTable.refreshTable() this.$refs.purchasementReviewTable.refreshTable()
}, },
handleExport() { handleExport() {
...@@ -350,8 +371,16 @@ export default { ...@@ -350,8 +371,16 @@ export default {
}, },
// 审核 // 审核
handleCheck(row) { handleCheck(row) {
this.checkVisible = !this.checkVisible // this.checkVisible = !this.checkVisible
this.paramsObj = row // this.paramsObj = row
this.$router.push({
path: '/procurementBusiness/singleBusinessCheck',
query: {
fromPage: 'procurementBusiness',
pageType: 'check',
paramsObj: row
}
})
}, },
// 批量审核 // 批量审核
handleBatchCheck() { handleBatchCheck() {
...@@ -411,4 +440,3 @@ export default { ...@@ -411,4 +440,3 @@ export default {
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
...@@ -5,18 +5,21 @@ ...@@ -5,18 +5,21 @@
<div class="header"> <div class="header">
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
label-width="130px"
:form-data="showFormData" :form-data="showFormData"
:search-form="searchForm"> :search-form="searchForm">
<template #onlyAllocateOrderHtml>
<el-switch v-model="searchForm.onlyAllocateOrder"></el-switch>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" <el-button :id="tableParams.btnId"
handle
size="small" size="small"
type="primary"> type="primary"
handle>
查询 查询
</el-button> </el-button>
<el-button size="small" <el-button size="small" @click="handleReset">
@click="handleReset">
重置 重置
</el-button> </el-button>
</div> </div>
...@@ -49,31 +52,28 @@ ...@@ -49,31 +52,28 @@
<div> <div>
<!-- 查看 --> <!-- 查看 -->
<span style="margin-right: 10px;"> <span style="margin-right: 10px;">
<auth-button :data="scope.scope" <auth-button :data="scope.scope" :show-btn-ids="['9090102']" />
:show-btn-ids="['9090102']" />
</span> </span>
<!-- 取消 --> <!-- 取消 -->
<span v-show="scope.scope.status == 1 && !userInfo.beSuper && userInfo.beYQMerchant" <span v-show="scope.scope.status == 1 && !userInfo.beSuper && userInfo.beYQMerchant"
style="margin-right: 10px;"> style="margin-right: 10px;">
<auth-button :data="scope.scope" <auth-button :data="scope.scope" :show-btn-ids="['9090103']" />
:show-btn-ids="['9090103']" />
</span> </span>
<!-- 入库 --> <!-- 入库 -->
<span v-show="scope.scope.putStatus == 1 && !userInfo.beSuper && userInfo.beYQMerchant" <span v-show="scope.scope.putStatus == 1 && !userInfo.beSuper && userInfo.beYQMerchant"
style="margin-right: 10px;"> style="margin-right: 10px;">
<auth-button :data="scope.scope" <auth-button :data="scope.scope" :show-btn-ids="['9090104']" />
:show-btn-ids="['9090104']" />
</span> </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)" <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;"> style="margin-right: 10px;">
<auth-button :data="scope.scope" <auth-button :data="scope.scope" :show-btn-ids="['9090105']" />
:show-btn-ids="['9090105']" />
</span> </span>
</div> </div>
</template> </template>
</d2-table> </d2-table>
</div> </div>
<OrderDeatilDialog v-if="detailVisible" <OrderDeatilDialog v-if="detailVisible"
:is-allocate="true"
:params-obj="paramsObj" :params-obj="paramsObj"
:show-film-roll-no="paramsObj.purchaseType != 1" :show-film-roll-no="paramsObj.purchaseType != 1"
:visible.sync="detailVisible"> :visible.sync="detailVisible">
...@@ -109,6 +109,7 @@ export default { ...@@ -109,6 +109,7 @@ export default {
orderTimeStr: [], orderTimeStr: [],
// putTimeStr: [], // putTimeStr: [],
purchaseType: "", purchaseType: "",
onlyAllocateOrder: false,
}, },
tableSearchForm: {}, tableSearchForm: {},
tableData: [], tableData: [],
...@@ -168,6 +169,11 @@ export default { ...@@ -168,6 +169,11 @@ export default {
optionLabel: "label", optionLabel: "label",
optionsName: "purchaseTypeList", optionsName: "purchaseTypeList",
}, },
{
label: "仅查看调拨订单",
name: "onlyAllocateOrder",
addHtml: "onlyAllocateOrderHtml",
},
// { // {
// label: '入库时间', // label: '入库时间',
// name: 'warehousingTimeStr', // name: 'warehousingTimeStr',
...@@ -231,6 +237,10 @@ export default { ...@@ -231,6 +237,10 @@ export default {
prop: "merchantName", prop: "merchantName",
}, },
{ {
label: "关联调拨单号",
prop: "relatedAllocateCode",
},
{
label: "采购类型", label: "采购类型",
prop: "purchaseType", prop: "purchaseType",
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -408,6 +418,7 @@ export default { ...@@ -408,6 +418,7 @@ export default {
} }
this.searchForm.sortType = 1; this.searchForm.sortType = 1;
this.searchForm.orderTimeStr = []; this.searchForm.orderTimeStr = [];
this.searchForm.onlyAllocateOrder = false;
// this.searchForm.putTimeStr = [] // this.searchForm.putTimeStr = []
this.$refs.purchaseOrderTable.refreshTable(); this.$refs.purchaseOrderTable.refreshTable();
}, },
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</el-row> </el-row>
<el-row style="font-size: 14px; line-height: 28px;"> <el-row style="font-size: 14px; line-height: 28px;">
<el-col :span="24"> <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-col>
</el-row> </el-row>
</div> </div>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</template> </template>
<script> <script>
import { beiSenEmployeeDisableApi } from "@/api/resident"; import { disableAccountV2Api } from "@/api/resident";
export default { export default {
name: "DisableAccountDialog", name: "DisableAccountDialog",
...@@ -82,14 +82,14 @@ export default { ...@@ -82,14 +82,14 @@ export default {
} }
}, },
merchantName() { merchantName() {
return this.currentRow ? this.currentRow.merchantName : ''; return this.currentRow ? this.currentRow.yqMerchantName : '';
} }
}, },
methods: { methods: {
confirmDisable() { confirmDisable() {
if (!this.currentRow) return; if (!this.currentRow) return;
const row = this.currentRow; const row = this.currentRow;
beiSenEmployeeDisableApi({ accountId: row.id }).then(() => { disableAccountV2Api({ accountRecordId: row.accountRecordId }).then(() => {
this.$message.success('账号已禁用'); this.$message.success('账号已禁用');
this.visible = false; this.visible = false;
this.$emit("refreshDetail"); this.$emit("refreshDetail");
......
...@@ -191,28 +191,51 @@ ...@@ -191,28 +191,51 @@
<h2>账号信息</h2> <h2>账号信息</h2>
<div class="info-wrap"> <div class="info-wrap">
<div class="info-item-line"> <div class="info-item-line">
<d2-table ref="allocateStoreTable" :table-params="tableParams" :table-data="tableData" <el-table :data="tableData" border style="width: 100%" :span-method="objectSpanMethod">
:has-page="false"> <el-table-column label="序号" width="60" align="center">
<template slot="brand" slot-scope="scope"> <template slot-scope="scope">
<el-popover v-if="scope.scope.carBrand" placement="top" width="300" trigger="hover"> {{ getIndex(scope.$index) }}
<div class="merchant-name-box"> </template>
{{ remarkFilter(scope.scope) }} </el-table-column>
</div> <el-table-column prop="yqMerchantName" label="园区店" width="180" align="center">
<div slot="reference"> <template slot-scope="scope">
{{ remarkFilter(scope.scope, 20) }} {{ scope.row.yqMerchantName ? `${scope.row.yqMerchantName}${scope.row.yqMerchantId}` :
</div> '-' }}
</el-popover> </template>
<span v-else>-</span> </el-table-column>
</template> <el-table-column prop="merchantName" label="门店" width="250" align="center">
<template slot="operationHtml" slot-scope="scope"> <template slot-scope="scope">
<!-- N:未删除;I:禁用 --> {{ scope.row.merchantName || '-' }}
<el-switch v-model="scope.scope.deletedFlag" active-value="N" inactive-value="I" </template>
@change="(e) => switchChange(scope.scope)"></el-switch> </el-table-column>
<span class="switch-text">{{ scope.scope.deletedFlag === 'N' ? '禁用账号' : '启用账号' <el-table-column label="适配业务" min-width="150" align="center">
}}</span> <template slot-scope="scope">
{{ scope.row.deletedFlag == 'N' ? scope.row.accountSceneStr || '-' : '-' }}
</template> </template>
</d2-table> </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> </div>
<el-button size="small" @click="handleAllocateStore" class="add-allocate" <el-button size="small" @click="handleAllocateStore" class="add-allocate"
icon="el-icon-plus">新增门店账号</el-button> icon="el-icon-plus">新增门店账号</el-button>
...@@ -684,9 +707,16 @@ ...@@ -684,9 +707,16 @@
<!-- 禁用账号二次确认弹窗 --> <!-- 禁用账号二次确认弹窗 -->
<disable-account-dialog :disable-dialog-visible="disableDialogVisible" :current-row="currentDisableRow" <disable-account-dialog :disable-dialog-visible="disableDialogVisible" :current-row="currentDisableRow"
:staff-name="detail.staffName" :staff-name="detail.staffName"
:formatted-scene-label="currentDisableRow ? currentDisableRow.accountSceneStr : ''" v-if="disableDialogVisible" :formatted-scene-label="currentDisableRow ? currentDisableRow.parkUniqueScenesStr : ''"
@dialogClose="closeDisableDialog" @refreshDetail="getDetail" @disableFailed="handleDisableFailed"> v-if="disableDialogVisible" @dialogClose="closeDisableDialog" @refreshDetail="getDetail"
@disableFailed="handleDisableFailed">
</disable-account-dialog> </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> </div>
</template> </template>
...@@ -697,8 +727,9 @@ import dayjs from "dayjs"; ...@@ -697,8 +727,9 @@ import dayjs from "dayjs";
import assignStoreDialog from "./assignStoreDialog.vue"; import assignStoreDialog from "./assignStoreDialog.vue";
import syncBeiSenDialog from "./syncBeiSenDialog.vue"; import syncBeiSenDialog from "./syncBeiSenDialog.vue";
import disableAccountDialog from "./disableAccountDialog.vue"; import disableAccountDialog from "./disableAccountDialog.vue";
import editStorePermissionDialog from "./editStorePermissionDialog.vue";
import { updateRecordOrderConfig } from "@api/inStoreManage"; 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 { staffLevelList, staffSceneLabelList } from "@/common/constants";
import { Util, deepClone } from "@/common/util"; import { Util, deepClone } from "@/common/util";
import { import {
...@@ -723,6 +754,7 @@ export default { ...@@ -723,6 +754,7 @@ export default {
AssignStoreDialog: assignStoreDialog, AssignStoreDialog: assignStoreDialog,
syncBeiSenDialog, syncBeiSenDialog,
disableAccountDialog, disableAccountDialog,
editStorePermissionDialog
}, },
props: { props: {
queryData: { queryData: {
...@@ -1006,6 +1038,13 @@ export default { ...@@ -1006,6 +1038,13 @@ export default {
// 禁用账号弹窗相关 // 禁用账号弹窗相关
disableDialogVisible: false, disableDialogVisible: false,
currentDisableRow: null, currentDisableRow: null,
// 编辑权限弹窗相关
editPermissionVisible: false,
currentEditRow: null,
spanArr: [],
pos: 0
}; };
}, },
mounted() { mounted() {
...@@ -1247,10 +1286,97 @@ export default { ...@@ -1247,10 +1286,97 @@ export default {
} }
this.detail = Object.assign(res, bsEffectiveRule) || {}; this.detail = Object.assign(res, bsEffectiveRule) || {};
console.log(this.detail, " this.detail"); 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() { getResidentTeacherList() {
getResidentTeacherListApi({ getResidentTeacherListApi({
...@@ -1298,6 +1424,7 @@ export default { ...@@ -1298,6 +1424,7 @@ export default {
}, },
switchChange(row) { switchChange(row) {
console.log(row, 'row')
// N启用状态==》禁止二次弹窗 // N启用状态==》禁止二次弹窗
if (row.deletedFlag === 'I') { if (row.deletedFlag === 'I') {
...@@ -1307,9 +1434,9 @@ export default { ...@@ -1307,9 +1434,9 @@ export default {
this.currentDisableRow = row; this.currentDisableRow = row;
this.disableDialogVisible = true; this.disableDialogVisible = true;
} else { } else {
//添加阻止switch 切换状态
// 当切换到启用时,直接调用接口 row.deletedFlag = 'I';
beiSenEmployeeDisableApi({ accountId: row.id }).then(() => { disableAccountV2Api({ accountRecordId: row.accountRecordId }).then(() => {
this.$message.success('账号已启用'); this.$message.success('账号已启用');
this.getDetail(); this.getDetail();
}).catch(() => { }).catch(() => {
...@@ -1326,6 +1453,16 @@ export default { ...@@ -1326,6 +1453,16 @@ export default {
this.currentDisableRow = null; this.currentDisableRow = null;
}, },
handleEditAccount(row) {
this.currentEditRow = row;
this.editPermissionVisible = true;
},
closeEditPermissionDialog() {
this.getDetail(); // refresh data
this.editPermissionVisible = false;
},
handleDisableFailed(row) { handleDisableFailed(row) {
if (row) { if (row) {
row.deletedFlag = 'N'; // 恢复状态 row.deletedFlag = 'N'; // 恢复状态
...@@ -1581,6 +1718,7 @@ export default { ...@@ -1581,6 +1718,7 @@ export default {
this.getDetail(); this.getDetail();
this.allocateStoreVisible = !this.allocateStoreVisible; this.allocateStoreVisible = !this.allocateStoreVisible;
}, },
...@@ -1675,9 +1813,9 @@ export default { ...@@ -1675,9 +1813,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.edit-staff { .edit-staff {
::v-deep .el-table th { // ::v-deep .el-table th {
background: #f2f4f7; // background: #f2f4f7;
} // }
h2 { h2 {
font-size: 16px; 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 \ 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> <template>
<div class="mission-detail"> <div class="mission-detail">
<d2-container> <d2-container>
<div v-if="detail.taskType == '3'"> <component :is="currentComponent"
<recording :detail="detail"/> ref="currentViewRef"
</div> :detail="detail" />
<div v-else> <div class="footer-btn">
<reviewDetail :detail="detail"/> <el-button class="cancel-btn" @click="handleBack">
</div> 关闭
<div class="footer-btn"> </el-button>
<el-button class="cancel-btn" @click="handleBack"> 关闭 </el-button> </div>
</div> </d2-container>
</d2-container> </div>
</div>
</template> </template>
<script> <script>
import recording from "./components/recording.vue" import { mapActions } from "vuex";
import reviewDetail from "./components/reviewDetail.vue"
import { mapActions } from "vuex"
import { Util } from "@/common/util"; 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 { export default {
name: "MissionDetail", name: "MissionDetail",
components: { components: {
recording, Recording: recording,
reviewDetail ReviewDetail: reviewDetail,
}, Mentorship: mentorship,
data() { PresentCase: presentCase,
return { },
detail: {} data() {
} return {
}, detail: {},
mounted() { };
let detail = JSON.parse(this.$route.query.detail) },
detail = { computed: {
...detail, currentComponent() {
updatedDate: detail.updatedDate ? Util.dateFormate(detail.updatedDate, 'YYYY-MM-DD HH:mm:ss') : '-' const typeMap = {
} 3: recording,
this.detail = detail 6: presentCase,
}, 7: mentorship,
methods: { };
...mapActions({ 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", get: "d2admin/base/get",
close: "d2admin/page/close", close: "d2admin/page/close",
}), }),
handleBack() { handleBack() {
this.close({ tagName: "/supervisionMissionManagement" }) const currentView = this.$refs.currentViewRef;
this.$router.push({ if (currentView && typeof currentView.handleClose === "function") {
name: "supervisionMissionManagement" const intercepted = currentView.handleClose();
}) if (intercepted)
} return;
} }
} this.close({ tagName: "/supervisionMissionManagement" });
this.$router.push({
name: "supervisionMissionManagement",
});
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.footer-btn { .footer-btn {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-top: 20px; margin-top: 20px;
.cancel-btn { .cancel-btn {
width: 100px; width: 100px;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
updateTaskTypeOptionsByTab(tabName) { updateTaskTypeOptionsByTab(tabName) {
const allowMap = { const allowMap = {
"今日任务": [3, 0, 5], "今日任务": [3, 0, 5],
"本周任务": [1], "本周任务": [6, 7],
"月度任务": [2], "月度任务": [2],
"专项任务": [4] "专项任务": [4]
} }
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
const allowMap = { const allowMap = {
"day": [3, 0, 5], "day": [3, 0, 5],
"week": [1], "week": [6, 7],
"month": [2], "month": [2],
"special": [4] "special": [4]
} }
...@@ -208,7 +208,7 @@ export default { ...@@ -208,7 +208,7 @@ export default {
getParams() { getParams() {
const allowMap = { const allowMap = {
"day": [3, 0, 5], "day": [3, 0, 5],
"week": [1], "week": [6, 7],
"month": [2], "month": [2],
"special": [4] "special": [4]
} }
...@@ -241,7 +241,6 @@ export default { ...@@ -241,7 +241,6 @@ export default {
this.getStaticsData(); this.getStaticsData();
}, },
handleDetail(data) { handleDetail(data) {
console.log(data, 'data')
this.close({ tagName: "/supervisionMissionDetail" }); this.close({ tagName: "/supervisionMissionDetail" });
this.$router.push({ this.$router.push({
name: "supervisionMissionDetail", name: "supervisionMissionDetail",
......
...@@ -2,55 +2,44 @@ ...@@ -2,55 +2,44 @@
<template> <template>
<d2-container> <d2-container>
<div class="detail-content"> <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"> <div class="content-box" v-if="Object.keys(detail).length">
<el-tabs v-model="activeName" @tab-click="handleClick"> <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 v-for="item in tabList" :key="item.id" :label="item.name" :name="item.id"></el-tab-pane>
</el-tab-pane>
<div class="container"> <div class="container">
<div class="date-select"> <div class="date-select">
<dateSelectPicker :tab-key="activeName" @change="onDateChange"></dateSelectPicker> <dateSelectPicker :tab-key="activeName" @change="onDateChange"></dateSelectPicker>
</div> </div>
<div class="view"> <div class="view">
<div class="view-item"> <div class="view-item">
<div class="label"> <div class="label">团队人员</div>
团队人员
</div>
<div class="value"> <div class="value">
<span class="orange">{{staticsData.teamStaffCount !== '-' ? staticsData.teamStaffCount : '-'}}</span> <span class="orange">{{ staticsData.teamStaffCount !== '-' ? staticsData.teamStaffCount : '-' }}</span>
</div> </div>
</div> </div>
<div class="view-item"> <div class="view-item">
<div class="label">产值</div> <div class="label">产值</div>
<div class="value"> <div class="value">
<span class="green">{{staticsData.outputValue !== '-' ? `¥${staticsData.outputValue}` : '-'}}</span> <span class="green">{{ staticsData.outputValue !== '-' ? `¥${staticsData.outputValue}` : '-' }}</span>
</div> </div>
</div> </div>
<div class="view-item"> <div class="view-item">
<div class="label"> <div class="label">转化率</div>
转化率
</div>
<div class="value"> <div class="value">
<span class="red">{{staticsData.conversionRate !== '-' ? `${staticsData.conversionRate}%` : '-'}}</span> <span class="red">{{ staticsData.conversionRate !== '-' ? `${staticsData.conversionRate}%` : '-' }}</span>
</div> </div>
</div> </div>
<div class="view-item"> <div class="view-item">
<div class="label"> <div class="label">客单价</div>
客单价
</div>
<div class="value"> <div class="value">
<span class="red">{{staticsData.avgOrderValue !== '-' ? `¥${staticsData.avgOrderValue}` : '-'}}</span> <span class="red">{{ staticsData.avgOrderValue !== '-' ? `¥${staticsData.avgOrderValue}` : '-' }}</span>
</div> </div>
</div> </div>
</div> </div>
<d2-table <d2-table ref="supervisionDetailTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn"></d2-table>
ref="supervisionDetailTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
</d2-table>
</div> </div>
</el-tabs> </el-tabs>
</div> </div>
...@@ -58,73 +47,89 @@ ...@@ -58,73 +47,89 @@
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { getSupervisorDetailSummaryApi, getSupervisorDetailApi } from "@api/resident" import { getSupervisorDetailSummaryApi, getSupervisorDetailApi } from '@api/resident'
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from '@/common/util'
import dateSelectPicker from "../components/dateSelectPicker.vue"; import dateSelectPicker from '../components/dateSelectPicker.vue'
export default { export default {
name: "SupervisionDetail", name: 'SupervisionDetail',
components: { components: {
dateSelectPicker dateSelectPicker
}, },
data() { data() {
return { return {
tabList: [{ tabList: [
name: '全场景', {
id: '0' name: '全场景',
}, { id: '0'
name: '延保', },
id: '1' {
}, { name: '延保',
name: '权益', id: '1'
id: '3' },
}, { {
name: '轻改', name: '权益',
id: '2' id: '3'
}], },
{
name: '轻改',
id: '2'
}
],
getListApi: getSupervisorDetailApi, getListApi: getSupervisorDetailApi,
activeName: '0', activeName: '0',
detail: {}, detail: {},
searchForm: {}, searchForm: {},
searchFormSearch: {}, searchFormSearch: {},
staticsData: {}, staticsData: {
teamStaffCount: '',
outputValue: '',
conversionRate: '',
avgOrderValue: ''
},
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list", listName: 'list',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: "驻店销售", label: '驻店销售',
prop: "staffName", prop: 'staffName'
}, },
{ {
label: "归属业务", label: '归属业务',
prop: "bizNames", prop: 'bizNames',
formatter: (cellValue) => { formatter: cellValue => {
let names = ['', '延保', '轻改', '权益'] let names = ['', '延保', '轻改', '权益']
if (!cellValue.bizNames) return '-' if (!cellValue.bizNames) return '-'
let bizArray = cellValue.bizNames?.split(',')?.map(item => item.trim()).filter(item => item !== '') let bizArray = cellValue.bizNames
let result = bizArray.map(index => names[parseInt(index)]).filter(name => name !== '').join(',') ?.split(',')
?.map(item => item.trim())
.filter(item => item !== '')
let result = bizArray
.map(index => names[parseInt(index)])
.filter(name => name !== '')
.join(',')
return result return result
} }
}, },
{ {
label: "产值", label: '产值',
prop: "outputValue", prop: 'outputValue',
formatter: (cellValue) => { formatter: cellValue => {
return (cellValue.outputValue ?? '') !== '' ? `¥${cellValue.outputValue}` : '-' return (cellValue.outputValue ?? '') !== '' ? `¥${cellValue.outputValue}` : '-'
} }
}, },
{ {
label: "转化率", label: '转化率',
prop: "conversionRate", prop: 'conversionRate',
formatter: (cellValue) => { formatter: cellValue => {
return (cellValue.conversionRate ?? '') !== '' ? `${cellValue.conversionRate}%` : '-' return (cellValue.conversionRate ?? '') !== '' ? `${cellValue.conversionRate}%` : '-'
} }
}, },
{ {
label: "客单价", label: '客单价',
prop: "avgOrderValue", prop: 'avgOrderValue',
formatter: (cellValue) => { formatter: cellValue => {
return (cellValue.avgOrderValue ?? '') !== '' ? `¥${cellValue.avgOrderValue}` : '-' return (cellValue.avgOrderValue ?? '') !== '' ? `¥${cellValue.avgOrderValue}` : '-'
} }
} }
...@@ -154,24 +159,25 @@ export default { ...@@ -154,24 +159,25 @@ export default {
} }
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise(resolve => {
this.searchFormSearch = { this.searchFormSearch = {
supervisorPhone: this.detail.phone, supervisorPhone: this.detail.phone,
...deepClone(this.searchForm), ...deepClone(this.searchForm),
bizType: this.activeName > 0 ? this.activeName : undefined bizType: this.activeName > 0 ? this.activeName : undefined
} }
console.log('searchFormSearch', this.searchFormSearch)
resolve() resolve()
}) })
}, },
handleClick(event) { handleClick(event) {
this.activeName = event.paneName this.activeName = event.paneName
this.searchForm.bizType = event.paneName || '' // this.searchForm.bizType = event.paneName || ''
}, },
onDateChange(e) { onDateChange(e) {
let dateTypes = ['day', 'week', 'month'] let dateTypes = ['day', 'week', 'month']
this.searchForm.dateType = dateTypes?.findIndex(i => i == e.type) this.searchForm.dateType = dateTypes?.findIndex(i => i == e.type)
this.searchForm.startDate = e.startTime?.replace(/\//g, "-") this.searchForm.startDate = e.startTime?.replace(/\//g, '-')
this.searchForm.endDate = e.endTime?.replace(/\//g, "-") this.searchForm.endDate = e.endTime?.replace(/\//g, '-')
this.$refs.supervisionDetailTable?.refreshTable(true, true) this.$refs.supervisionDetailTable?.refreshTable(true, true)
this.getStaticsData() this.getStaticsData()
} }
...@@ -188,7 +194,7 @@ export default { ...@@ -188,7 +194,7 @@ export default {
color: #666666; color: #666666;
height: 52px; height: 52px;
line-height: 52px; line-height: 52px;
background: #FFFFFF; background: #ffffff;
.name { .name {
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
...@@ -201,7 +207,7 @@ export default { ...@@ -201,7 +207,7 @@ export default {
} }
.content-box { .content-box {
margin-top: 12px; margin-top: 12px;
background: #FFFFFF; background: #ffffff;
.container { .container {
padding: 0 20px; padding: 0 20px;
} }
...@@ -228,10 +234,10 @@ export default { ...@@ -228,10 +234,10 @@ export default {
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
margin-top: 4px; margin-top: 4px;
color: #1D1D1D; color: #1d1d1d;
} }
} }
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -25,12 +25,12 @@ const SALES_CATEGORY_LIST = [ ...@@ -25,12 +25,12 @@ const SALES_CATEGORY_LIST = [
title: '预估经营数据', list: [ title: '预估经营数据', list: [
{ label: '转化率', key: 'estimatedConversionRate', unit: '%', type: 'input', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 }, { 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: '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: [ 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: '管理层市场费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: '管理层市场费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 }, { label: '一线阳光激励1', key: 'incentive1', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
......
<template> <template>
<d2-dialog <d2-dialog title="新增课程"
title="新增课程" :is-visible.sync="isVisible"
:is-visible.sync="isVisible" width="1120px"
width="1040px" btn-ok-label="确定"
btn-ok-label="确定" @confirmDialog="handleConfirm"
@confirmDialog="handleConfirm" @closeDialog="handleClose">
@closeDialog="handleClose" <CurriculaVariable ref="curriculaVariable"
> :course-list="courseList"
<curricula-variable :course-total="courseTotal"
ref="curriculaVariable" :selected-rows="selectedDialogRows"
:courseList="courseList" @handleCourse="handleCourse"
:selectedRows="selectedDialogRows" @fromAllocation="fromAllocation">
@handleCourse="handleCourse" </CurriculaVariable>
@fromAllocation="fromAllocation" </d2-dialog>
></curricula-variable>
</d2-dialog>
</template> </template>
<script> <script>
import curriculaVariable from "./allocation" import { getStaffTagCourseList } from "@/api/serviceCentre";
import { getStaffTagCourseList } from "@/api/serviceCentre" import curriculaVariable from "./allocation";
export default { export default {
data() { components: {
return { CurriculaVariable: curriculaVariable,
selectData: [], },
courseList: [] props: {
} isVisible: {
}, type: Boolean,
components: { default: false,
curriculaVariable },
}, selectedRows: {
props: { type: Array,
isVisible: { default: () => [],
type: Boolean, },
default: false staffItem: {
}, type: Object,
selectedRows: { default: () => {},
type: Array, },
default: () => [] },
}, data() {
staffItem: { return {
type: Object, selectData: [],
default: () => {} courseList: [],
} courseTotal: 0,
}, };
watch: { },
isVisible: { computed: {
handler(val) { selectedDialogRows() {
if (val) { return this.selectedRows.map((item) => {
this.getStaffTagCourseList() return item;
} });
}, },
immediate: true },
}, watch: {
selectedRows: { isVisible: {
type: Array, handler(val) {
default: () => [] if (val) {
} // 弹框每次 v-if 重建后 selectData 为空,需从 props 同步已选数据
}, this.selectData = Array.isArray(this.selectedRows)
computed: { ? [...this.selectedRows]
selectedDialogRows() { : [];
console.log(2323232323) this.getStaffTagCourseList();
return this.selectedRows.map((item) => { }
return item },
}) immediate: true,
} },
}, },
methods: { methods: {
getStaffTagCourseList(courseForm = {}) { getStaffTagCourseList(courseForm = {}) {
let params = { let params = {
staffPhone: this.staffItem.phone, staffPhone: this.staffItem.phone,
currentPage: 1, currentPage: 1,
pageSize: 99999, pageSize: 5,
queryAll: false, queryAll: false,
...courseForm ...courseForm,
} };
getStaffTagCourseList(params).then((res) => { getStaffTagCourseList(params).then((res) => {
this.courseList = res ? res.list : [] this.courseList = res ? res.list : [];
}) this.courseTotal = res ? res.total : 0;
}, });
handleCourse(data) { },
this.selectData = data handleCourse(data) {
}, this.selectData = data;
fromAllocation(val) { },
this.getStaffTagCourseList(val) fromAllocation(val) {
}, this.getStaffTagCourseList(val);
// 确认仅返回整条数据数组 },
handleConfirm() { // 确认仅返回整条数据数组
this.$emit("handleConfirm", this.selectData) handleConfirm() {
}, const curriculaRef = this.$refs.curriculaVariable;
handleClose() { const data
this.$emit("handleClose") = curriculaRef && Array.isArray(curriculaRef.selectCourseList)
} ? [...curriculaRef.selectCourseList]
} : [...this.selectData];
} this.$emit("handleConfirm", data);
},
handleClose() {
this.$emit("handleClose");
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.relateEmp { .relateEmp {
::v-deep .el-dialog__header { ::v-deep .el-dialog__header {
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
::v-deep .d2-search .d2-search-block { ::v-deep .d2-search .d2-search-block {
padding: 0px !important; padding: 0px !important;
} }
::v-deep .el-dialog__header { ::v-deep .el-dialog__header {
font-size: 20px; font-size: 20px;
line-height: 24px; line-height: 24px;
} }
.select-text { .select-text {
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
position: relative; position: relative;
right: 65%; right: 65%;
margin-bottom: 8px; margin-bottom: 8px;
} }
.online-status { .online-status {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.dot { .dot {
display: inline-block; display: inline-block;
width: 8px; width: 8px;
height: 8px; height: 8px;
border-radius: 50%; border-radius: 50%;
margin-right: 8px; margin-right: 8px;
} }
} }
} }
</style> </style>
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
<div> <div>
<CurriculaVariable ref="curriculaVariable" <CurriculaVariable ref="curriculaVariable"
:course-list="courseList" :course-list="courseList"
:course-total="courseTotal"
:selected-rows="selectStaffCourseList" :selected-rows="selectStaffCourseList"
@fromAllocation="fromAllocation" @fromAllocation="fromAllocation"
@handleCourse="handleCourse"> @handleCourse="handleCourse">
...@@ -308,6 +309,7 @@ export default { ...@@ -308,6 +309,7 @@ export default {
], ],
staffListData: [], staffListData: [],
courseList: [], courseList: [],
courseTotal: 0,
staffTagCourseList: [], // 已配置的课程列表不可以删除 staffTagCourseList: [], // 已配置的课程列表不可以删除
selectStaffCourseList: [], // 已配置的课程列表可以删除 selectStaffCourseList: [], // 已配置的课程列表可以删除
allStaffCourseList: [], // 合并的数据 allStaffCourseList: [], // 合并的数据
...@@ -417,12 +419,13 @@ export default { ...@@ -417,12 +419,13 @@ export default {
let params = { let params = {
staffPhone: this.staffItem.phone, staffPhone: this.staffItem.phone,
currentPage: 1, currentPage: 1,
pageSize: 99999, pageSize: 5,
queryAll: false, queryAll: false,
...courseForm, ...courseForm,
}; };
getStaffTagCourseList(params).then((res) => { getStaffTagCourseList(params).then((res) => {
this.courseList = res ? res.list : []; this.courseList = res ? res.list : [];
this.courseTotal = res ? res.total : 0;
}); });
}, },
// 查询员工已配置课程 // 查询员工已配置课程
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<div class="header"> <div class="header">
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:form-data="showFormData"
label-width="120px" label-width="120px"
:form-data="showFormData"
:search-form="searchForm"> :search-form="searchForm">
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
...@@ -231,6 +231,16 @@ export default { ...@@ -231,6 +231,16 @@ export default {
width: 120, width: 120,
}, },
{ {
label: "使用门店",
prop: "storeUsage",
width: 120,
},
{
label: "支付时间",
prop: "successDate",
width: 150,
},
{
label: "出入库方式", label: "出入库方式",
prop: "stockMethod", prop: "stockMethod",
width: 120, width: 120,
......
...@@ -316,6 +316,25 @@ export default { ...@@ -316,6 +316,25 @@ export default {
label: "备注", label: "备注",
prop: " remark", 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: "操作人", label: "操作人",
prop: "updatedUserName", prop: "updatedUserName",
width: "100px", width: "100px",
......
<!-- 调拨发货 --> <!-- 调拨发货 -->
<template> <template>
<d2-container class="container"> <d2-container class="container">
<template #header> <template #header>
<div class="header"> <div class="header">
<d2-search ref="showSearch" <d2-search ref="showSearch" class="show-search" :form-data="showFormData" :search-form="searchForm">
class="show-search" </d2-search>
:form-data="showFormData" <div class="up-btns">
:search-form="searchForm"> <el-button :id="tableParams.btnId" handle size="small" type="primary">
</d2-search> 查询
<div class="up-btns"> </el-button>
<el-button :id="tableParams.btnId" <el-button size="small" @click="handleReset">
handle 重置
size="small" </el-button>
type="primary"> </div>
查询 </div>
</el-button> </template>
<el-button size="small" @click="handleReset"> <div class="d2-container-content">
重置 <d2-table-header>
</el-button> <span>
</div> <!-- 导出暂时不做 -->
</div> <!-- <span style="margin-right: 10px">
</template>
<div class="d2-container-content">
<d2-table-header>
<span>
<!-- 导出暂时不做 -->
<!-- <span style="margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9081101']" /> <auth-button category="Button" :show-btn-ids="['9081101']" />
</span> --> </span> -->
<auth-button category="Button" :show-btn-ids="['9081102']" /> <auth-button category="Button" :show-btn-ids="['9081102']" />
</span> </span>
</d2-table-header> </d2-table-header>
<d2-table ref="transferShipmentTable" <d2-table ref="transferShipmentTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :search-form="tableSearchForm" :selectable-fn="selectableFn" :table-data="tableData"
:get-list-api="getListApi" :table-params="tableParams" @selectionTable="handleSelectionChange">
:search-form="tableSearchForm" <template #receiver="scope">
:selectable-fn="selectableFn" <div v-if="scope.scope.receiver">
:table-data="tableData" <el-popover v-if="scope.scope.receiver.length > 12" effect="dark" placement="top" trigger="hover"
:table-params="tableParams" width="300">
@selectionTable="handleSelectionChange"> <div class="merchant-name-box">
<template #receiver="scope"> {{ spanFilter(scope.scope.receiver) }}
<div v-if="scope.scope.receiver"> </div>
<el-popover v-if="scope.scope.receiver.length > 12" <template #reference>
effect="dark" <div>
placement="top" {{ spanFilter(scope.scope.receiver, 12) }}
trigger="hover" </div>
width="300"> </template>
<div class="merchant-name-box"> </el-popover>
{{ spanFilter(scope.scope.receiver) }} <div v-else>
</div> {{ scope.scope.receiver }}
<template #reference> </div>
<div> </div>
{{ spanFilter(scope.scope.receiver, 12) }} <span v-else>-</span>
</div> </template>
</template> <template #address="scope">
</el-popover> <div v-if="scope.scope.address">
<div v-else> <el-popover v-if="scope.scope.address.length > 12" effect="dark" placement="top" trigger="hover"
{{ scope.scope.receiver }} width="300">
</div> <div class="merchant-name-box">
</div> {{ spanFilter(scope.scope.address) }}
<span v-else>-</span> </div>
</template> <template #reference>
<template #address="scope"> <div>
<div v-if="scope.scope.address"> {{ spanFilter(scope.scope.address, 12) }}
<el-popover v-if="scope.scope.address.length > 12" </div>
effect="dark" </template>
placement="top" </el-popover>
trigger="hover" <div v-else>
width="300"> {{ scope.scope.address }}
<div class="merchant-name-box"> </div>
{{ spanFilter(scope.scope.address) }} </div>
</div> <span v-else>-</span>
<template #reference> </template>
<div> <template #auth-button="scope">
{{ spanFilter(scope.scope.address, 12) }} <div>
</div> <span style="margin-right: 10px">
</template> <auth-button :data="scope.scope" :show-btn-ids="['9081103']" />
</el-popover> </span>
<div v-else> <span v-if="scope.scope.deliveryStatus != 2 && scope.scope.billStatus != 7"
{{ scope.scope.address }} style="margin-right: 10px">
</div> <auth-button :data="scope.scope" :show-btn-ids="['9081104']" />
</div> </span>
<span v-else>-</span> <auth-button v-if="scope.scope.billStatus != 7 && scope.scope.deliveryStatus == 1"
</template> :data="scope.scope" :show-btn-ids="['9081105']" />
<template #auth-button="scope"> </div>
<div> </template>
<span style="margin-right: 10px"> </d2-table>
<auth-button :data="scope.scope" :show-btn-ids="['9081103']" /> </div>
</span> <ShipmentDialog v-if="shipmentVisible" :params-obj="shipmentDialogData" :table-list="shipmentTableList"
<span v-if="scope.scope.deliveryStatus != 2 && scope.scope.billStatus != 7" style="margin-right: 10px"> :visible.sync="shipmentVisible" @shipmentClose="shipmentDialogClose">
<auth-button :data="scope.scope" :show-btn-ids="['9081104']" /> </ShipmentDialog>
</span> <RejectDialog v-if="rejectVisible" :reject-data="rejectData" :visible.sync="rejectVisible"
<auth-button v-if="scope.scope.billStatus != 7 && scope.scope.deliveryStatus == 1" @rejectClose="handleRejectClose">
:data="scope.scope" </RejectDialog>
:show-btn-ids="['9081105']" /> <TransferDetailDialog v-if="transferDetailVisible" :params-obj="transferObj" :visible.sync="transferDetailVisible">
</div> </TransferDetailDialog>
</template> </d2-container>
</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> </template>
<script> <script>
...@@ -184,6 +160,12 @@ export default { ...@@ -184,6 +160,12 @@ export default {
type: "input", type: "input",
isClear: true, isClear: true,
}, },
{
label: "采购单号",
name: "purchaseOrderCode",
type: "input",
isClear: true,
},
], ],
getListApi: getTransferShipmentList, getListApi: getTransferShipmentList,
// 表格参数 // 表格参数
...@@ -202,6 +184,11 @@ export default { ...@@ -202,6 +184,11 @@ export default {
width: 150, width: 150,
}, },
{ {
label: "关联采购单号",
prop: "purchaseOrderCode",
width: 150,
},
{
label: "产品名称", label: "产品名称",
prop: "goodsName", prop: "goodsName",
}, },
......
...@@ -70,7 +70,8 @@ ...@@ -70,7 +70,8 @@
format="yyyy-MM" format="yyyy-MM"
placeholder="选择月" placeholder="选择月"
:picker-options="pickerOption" :picker-options="pickerOption"
class="sortInput"> class="sortInput"
@change="handleTargetMonthChange">
</el-date-picker> </el-date-picker>
</div> </div>
<div v-else> <div v-else>
...@@ -79,6 +80,20 @@ ...@@ -79,6 +80,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <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="交付数:" <el-form-item label="交付数:"
:prop="operationType !='detail'?'targetValue':''"> :prop="operationType !='detail'?'targetValue':''">
<div v-if="operationType !='detail'"> <div v-if="operationType !='detail'">
...@@ -92,17 +107,12 @@ ...@@ -92,17 +107,12 @@
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="录入时间:" <el-form-item label="录入时间:"
v-if="operationType!='add'"> v-if="operationType!='add'">
{{ formData.createdDateShow }} {{ formData.createdDateShow }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<div v-if="operationType!='add'"> <div v-if="operationType!='add'">
...@@ -123,14 +133,18 @@ ...@@ -123,14 +133,18 @@
<script> <script>
import { Util, deepClone } from '@/common/util' 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 { getList } from "@api/merchant"
import { outputValue_operTypeOpt } from "@/common/constants.js" import { outputValue_operTypeOpt } from "@/common/constants.js"
import { insertDeliverTargeConfig, updateDeliverTargeConfig, getById_deliver, getCarBrand } from '@api/shopConfig' import { insertDeliverTargeConfig, updateDeliverTargeConfig, getById_deliver, getCarBrand } from '@api/shopConfig'
import periodDateRange from './periodDateRange'
// import reportTrackFunMixin from '@/mixins/reportTrackFunMixin' // import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default { export default {
name: 'EditDialog', name: 'EditDialog',
components: {
periodDateRange
},
// mixins: [reportTrackFunMixin], // mixins: [reportTrackFunMixin],
directives: { directives: {
'el-select-loadmore': { 'el-select-loadmore': {
...@@ -169,7 +183,9 @@ export default { ...@@ -169,7 +183,9 @@ export default {
childId: '', childId: '',
childName: '', childName: '',
targetValue: '', targetValue: '',
targetMonth: '' targetMonth: '',
periodRange: [],
periodDateStr: ''
}, },
oldVal: { oldVal: {
targetValue: '' targetValue: ''
...@@ -183,6 +199,30 @@ export default { ...@@ -183,6 +199,30 @@ export default {
merchantId: [{ required: true, message: '请选择4S门店', trigger: 'change' }], merchantId: [{ required: true, message: '请选择4S门店', trigger: 'change' }],
brand: [{ required: true, message: '请选择品牌', trigger: 'change' }], brand: [{ required: true, message: '请选择品牌', trigger: 'change' }],
targetMonth: [{ 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' }] targetValue: [{ required: true, message: '请输入交付数', trigger: 'blur' }]
}, },
searchForm: { searchForm: {
...@@ -338,10 +378,31 @@ export default { ...@@ -338,10 +378,31 @@ export default {
this.formData.createdDateShow = this.formData.createdDate this.formData.createdDateShow = this.formData.createdDate
? Util.dateFormate(this.formData.createdDate, 'YYYY-MM-DD HH:mm:ss') ? Util.dateFormate(this.formData.createdDate, 'YYYY-MM-DD HH:mm:ss')
: "" : ""
this.fillPeriodRange()
}).catch(() => { }).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) { choose4S(merchantId) {
this.formData.brand = [] this.formData.brand = []
this.formData.brandId = '' this.formData.brandId = ''
...@@ -392,6 +453,9 @@ export default { ...@@ -392,6 +453,9 @@ export default {
this.$refs.infoForm.validate(valid => { this.$refs.infoForm.validate(valid => {
if (valid) { if (valid) {
var params = deepClone(this.formData) var params = deepClone(this.formData)
params.periodStartDate = params.periodRange[0]
params.periodEndDate = params.periodRange[1]
delete params.periodRange
if (params.id) { if (params.id) {
updateDeliverTargeConfig(params).then(res => { updateDeliverTargeConfig(params).then(res => {
this.notice.okTips('操作成功') 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 @@ ...@@ -91,7 +91,26 @@
title="交付数导入" title="交付数导入"
@closeDialog="handleImport" @closeDialog="handleImport"
@confirmDialog="handleConfirmImport" @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" <edit-dialog :visible.sync="editVisible"
v-if="editVisible" v-if="editVisible"
...@@ -106,9 +125,11 @@ import { mapActions, mapState } from "vuex" ...@@ -106,9 +125,11 @@ import { mapActions, mapState } from "vuex"
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import inputRange from './components/inputRange' import inputRange from './components/inputRange'
import editDialog from "./components/editDialog" import editDialog from "./components/editDialog"
import periodDateRange from './components/periodDateRange'
import { listWithPage_deliver, deliverTargeConfigImport, deleteById_deliver, distinctAllBrand } from '@api/shopConfig' import { listWithPage_deliver, deliverTargeConfigImport, deleteById_deliver, distinctAllBrand } from '@api/shopConfig'
import { getList } from "@api/merchant" import { getList } from "@api/merchant"
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin' import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
import { rangePickerOptions_deliveryQuantity_import } from '@/common/format'
export default { export default {
name: "DeliveryQuantity", name: "DeliveryQuantity",
mixins: [reportTrackFunMixin], // 导入混入 mixins: [reportTrackFunMixin], // 导入混入
...@@ -199,6 +220,14 @@ export default { ...@@ -199,6 +220,14 @@ export default {
width: "150" width: "150"
}, },
{ {
label: "归属周期",
prop: "periodDateStr",
width: "200",
formatter: (cellValue) => {
return cellValue.periodDateStr || "-"
}
},
{
label: "交付数", label: "交付数",
prop: "targetValue", prop: "targetValue",
width: "200", width: "200",
...@@ -226,6 +255,11 @@ export default { ...@@ -226,6 +255,11 @@ export default {
pageSize: 20, pageSize: 20,
fileVisible: false, fileVisible: false,
editVisible: false, editVisible: false,
importMonthPickerOption: rangePickerOptions_deliveryQuantity_import,
importForm: {
targetMonth: '',
periodRange: []
},
track_event_code: 'shopConfig_deliver_list', track_event_code: 'shopConfig_deliver_list',
track_businessParam_key: 'searchForm' track_businessParam_key: 'searchForm'
} }
...@@ -233,7 +267,8 @@ export default { ...@@ -233,7 +267,8 @@ export default {
components: { components: {
inputRange, inputRange,
editDialog editDialog,
periodDateRange
}, },
computed: { computed: {
...mapState({ ...mapState({
...@@ -436,12 +471,43 @@ export default { ...@@ -436,12 +471,43 @@ export default {
}, },
handleImport() { handleImport() {
if (this.fileVisible) {
this.resetImportForm()
}
this.fileVisible = !this.fileVisible 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 }) { handleConfirmImport({ fileName, fileData }) {
if (!this.validateImportForm()) return
var params = { var params = {
file: fileData file: fileData,
targetMonth: this.importForm.targetMonth,
periodStartDate: this.importForm.periodRange[0],
periodEndDate: this.importForm.periodRange[1]
} }
deliverTargeConfigImport(params).then(res => { deliverTargeConfigImport(params).then(res => {
if (res) { if (res) {
...@@ -455,6 +521,7 @@ export default { ...@@ -455,6 +521,7 @@ export default {
this.actionSetDownloadList({ list, type: 'updateList' }) this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功') this.notice.okTips('上传成功')
this.$refs.recordTable.refreshTable(false, true) this.$refs.recordTable.refreshTable(false, true)
this.resetImportForm()
this.handleImport() this.handleImport()
} }
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!