Commit 925c8c41 by 前端

版本功能代码提交

1 parent 703fd0a6
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
}, },
"@amap/amap-jsapi-loader": { "@amap/amap-jsapi-loader": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz", "resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==" "integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
}, },
"@ampproject/remapping": { "@ampproject/remapping": {
...@@ -3330,7 +3330,7 @@ ...@@ -3330,7 +3330,7 @@
}, },
"camelcase": { "camelcase": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-1.2.1.tgz",
"integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g==" "integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g=="
}, },
"camelcase-keys": { "camelcase-keys": {
...@@ -6515,9 +6515,9 @@ ...@@ -6515,9 +6515,9 @@
} }
}, },
"glsx-common": { "glsx-common": {
"version": "2.1.0", "version": "2.10.1",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.1.0.tgz", "resolved": "https://registry.npmmirror.com/glsx-common/-/glsx-common-2.10.1.tgz",
"integrity": "sha512-wlUFgrZkJODh5MNpnVaT2zswkep1BUnvRgyhUABp2mDrt7d8yemnrdDYCfuBSWT7LCn+httSEieOEtm2XSlc0Q==", "integrity": "sha512-bPEf1VZ25X1JPq63rsbmjLWRjwtnjmnCfDm4ktuIqlSIuG/Ci83OZGYOOXTVX17lQX/nqp7plYdTSbuwvA+39A==",
"requires": { "requires": {
"axios": "^0.21.3", "axios": "^0.21.3",
"md5": "^2.3.0", "md5": "^2.3.0",
...@@ -6526,9 +6526,9 @@ ...@@ -6526,9 +6526,9 @@
} }
}, },
"glsx-components": { "glsx-components": {
"version": "1.5.4", "version": "1.5.7",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.5.4.tgz", "resolved": "https://registry.npmmirror.com/glsx-components/-/glsx-components-1.5.7.tgz",
"integrity": "sha512-TemXhzs6giPF7idPHNhrpeMNvP4O6hbm6q/aKPNJSldZB7o+MbmPxeYXKZydvvz6V53tk+KBLbgVhcSv1F8FIA==", "integrity": "sha512-WEWt1Ev7uf8VgILrEr15ZHxOreqWEVEY2WRP5EmZKzYKTVF/7dQU/oI84+Xo4vSmlz7ltblaATyrwm1U1LDnHg==",
"requires": { "requires": {
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
...@@ -6541,7 +6541,7 @@ ...@@ -6541,7 +6541,7 @@
"dependencies": { "dependencies": {
"glsx-common": { "glsx-common": {
"version": "1.4.9", "version": "1.4.9",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-1.4.9.tgz", "resolved": "https://registry.npmmirror.com/glsx-common/-/glsx-common-1.4.9.tgz",
"integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==", "integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==",
"requires": { "requires": {
"axios": "^0.21.3", "axios": "^0.21.3",
...@@ -12054,7 +12054,7 @@ ...@@ -12054,7 +12054,7 @@
}, },
"sortablejs": { "sortablejs": {
"version": "1.10.2", "version": "1.10.2",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz", "resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A==" "integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
}, },
"source-list-map": { "source-list-map": {
...@@ -13137,7 +13137,7 @@ ...@@ -13137,7 +13137,7 @@
}, },
"uppercamelcase": { "uppercamelcase": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/uppercamelcase/-/uppercamelcase-1.1.0.tgz", "resolved": "https://registry.npmmirror.com/uppercamelcase/-/uppercamelcase-1.1.0.tgz",
"integrity": "sha512-C7YEMvhgrvTEKEEVqA7LXNID/1TvvIwYZqNIKLquS6y/MGSkRQAav9LnTTILlC1RqUM8eTVBOe1U/fnB652PRA==", "integrity": "sha512-C7YEMvhgrvTEKEEVqA7LXNID/1TvvIwYZqNIKLquS6y/MGSkRQAav9LnTTILlC1RqUM8eTVBOe1U/fnB652PRA==",
"requires": { "requires": {
"camelcase": "^1.2.1" "camelcase": "^1.2.1"
...@@ -13328,7 +13328,7 @@ ...@@ -13328,7 +13328,7 @@
}, },
"vue-amap": { "vue-amap": {
"version": "0.5.10", "version": "0.5.10",
"resolved": "https://registry.npmjs.org/vue-amap/-/vue-amap-0.5.10.tgz", "resolved": "https://registry.npmmirror.com/vue-amap/-/vue-amap-0.5.10.tgz",
"integrity": "sha512-9ViNCev1vx32+zZ5RvF/TmUZNbwL9QrdA2/OnD2GlXMfQBkJy7D08Vb7379t6guqnopDPtWJ8K6gg72h9+4GUg==", "integrity": "sha512-9ViNCev1vx32+zZ5RvF/TmUZNbwL9QrdA2/OnD2GlXMfQBkJy7D08Vb7379t6guqnopDPtWJ8K6gg72h9+4GUg==",
"requires": { "requires": {
"uppercamelcase": "^1.1.0" "uppercamelcase": "^1.1.0"
...@@ -13475,7 +13475,7 @@ ...@@ -13475,7 +13475,7 @@
}, },
"vuedraggable": { "vuedraggable": {
"version": "2.24.3", "version": "2.24.3",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz", "resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==", "integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"requires": { "requires": {
"sortablejs": "1.10.2" "sortablejs": "1.10.2"
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^2.0.9", "glsx-common": "^2.10.1",
"glsx-components": "^1.2.5", "glsx-components": "^1.5.7",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2" "vuex": "^3.1.2"
......
import { http } from '@/main'
// 预约记录列表查询
const queryInviteRecord = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.inviteRecord.query`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 预约记录总数查询
const inviteRecordCount = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.inviteRecord.count`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 门店下拉列表查询
const getInviteMerchant = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.inviteRecord.merchant.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询1.1场景登录权限下园区店信息
const yqMerchantPage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.sceneMerchantRef.shopMerchant.LoginPermissionYqMerchant.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 工位设置查询
const inviteStationSetGet = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.inviteStationSet.get`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取指定商户指定日期范围的邀约统计
const inviteStatMerchantList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.inviteStat.merchant.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 工位设置修改
const inviteStationSetUpdate = function(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.inviteStationSet.update`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 修改备注
const followRecordUpdate = function(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.inviteRecord.followRecord.update`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 修改预约时间
const dateUpdate = function(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.inviteRecord.invite.dateUpdate`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 取消预约
const cancelInvite = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.inviteRecord.cancelInvite'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { queryInviteRecord, inviteRecordCount, getInviteMerchant, yqMerchantPage, inviteStationSetGet, inviteStatMerchantList, inviteStationSetUpdate, dateUpdate, cancelInvite, followRecordUpdate }
$color-yellow:#fdb757; $color-yellow:#fdb757;
$color-green:#2cca74; $color-green:#2cca74;
$color-gray:#999; $color-gray:#999;
$color-red:#EB4E4E;
//背景图片 100% //背景图片 100%
@mixin bkgMaxSize($url) { @mixin bkgMaxSize($url) {
background-image: url($url); background-image: url($url);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
@mixin font-setting-group($font-size,$font-family,$font-weight,$color,$line-height){ @mixin font-setting-group($font-size, $font-family, $font-weight, $color, $line-height) {
font-size: $font-size; font-size: $font-size;
font-family: $font-family; font-family: $font-family;
font-weight: $font-weight; font-weight: $font-weight;
color: $color; color: $color;
line-height: $line-height; line-height: $line-height;
} }
//边框圆角 //边框圆角
@mixin borderRadius($radius) { @mixin borderRadius($radius) {
-webkit-border-radius: $radius; -webkit-border-radius: $radius;
-moz-border-radius: $radius; -moz-border-radius: $radius;
-ms-border-radius: $radius; -ms-border-radius: $radius;
-o-border-radius: $radius; -o-border-radius: $radius;
border-radius: $radius; border-radius: $radius;
} }
//定位上下左右居中 //定位上下左右居中
@mixin positionCenter { @mixin positionCenter {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
//定位上下居中 //定位上下居中
@mixin ct { @mixin ct {
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
//定位左右居中 //定位左右居中
@mixin cl { @mixin cl {
position: absolute; position: absolute;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} }
//定位全屏 //定位全屏
@mixin allcover { @mixin allcover {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
} }
//相对定位 //相对定位
@mixin my-absolute($left, $top,$z) { @mixin my-absolute($left, $top, $z) {
position: absolute; position: absolute;
z-index: $z; z-index: $z;
margin-left: $left; margin-left: $left;
margin-top: $top; margin-top: $top;
} }
//宽高-不同 //宽高-不同
@mixin widthHeightN($width, $height){ @mixin widthHeightN($width, $height) {
width: $width; width: $width;
height: $height; height: $height;
} }
//宽高-相同
@mixin widthHeightY($number){ //宽高-相同
@mixin widthHeightY($number) {
width: $number; width: $number;
height: $number; height: $number;
} }
//字体大小,颜色 //字体大小,颜色
@mixin sizeColor($size, $color){ @mixin sizeColor($size, $color) {
font-size: $size; font-size: $size;
color: $color; color: $color;
} }
//flex布局 //flex布局
@mixin center_none{ @mixin center_none {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
@mixin center_center{ @mixin center_center {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
@mixin flex-start_center{ @mixin flex-start_center {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
} }
@mixin space-between_center{ @mixin space-between_center {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
@mixin space-around_center{
@mixin space-around_center {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
} }
@mixin flex-end_center{ @mixin flex-end_center {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
} }
@mixin wrap_flex-start{ @mixin wrap_flex-start {
display: flex; display: flex;
flex-wrap:wrap; flex-wrap: wrap;
align-content:flex-start; align-content: flex-start;
} }
@mixin flex-start_column{ @mixin flex-start_column {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
flex-direction: column; flex-direction: column;
} }
@mixin none_center_column{
@mixin none_center_column {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
} }
@mixin center_center_column{ @mixin center_center_column {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
flex-direction: column; flex-direction: column;
} }
//圆点 //圆点
@mixin dot{ @mixin dot {
width: 6px; width: 6px;
height: 6px; height: 6px;
border-radius: 50%; border-radius: 50%;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
margin-right: 8px; margin-right: 8px;
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,63 +2,73 @@ ...@@ -2,63 +2,73 @@
export const defaultStatusOptions = [ export const defaultStatusOptions = [
{ {
id: 1, id: 1,
label: "待审核" label: '待审核'
}, },
{ {
id: 2, id: 2,
label: "已审核" label: '已审核'
}, },
{ {
id: 3, id: 3,
label: "已取消" label: '已取消'
} }
] ]
// 发货状态 // 发货状态
export const defaultDeliveryStatusOptions = [ export const defaultDeliveryStatusOptions = [
{ {
id: 1, id: 1,
label: "未发货" label: '未发货'
}, },
{ {
id: 2, id: 2,
label: "已发货" label: '已发货'
} }
] ]
// 入库状态 // 入库状态
export const defaultPutStatusOptions = [ export const defaultPutStatusOptions = [
{ {
id: 1, id: 1,
label: "未入库" label: '未入库'
}, },
{ {
id: 2, id: 2,
label: "已入库" label: '已入库'
} }
] ]
export const membraneTypeList = [1, 4, 6, 12, 14] export const membraneTypeList = [1, 4, 6, 12, 14]
// 商户类型 - 除广汇外 // 商户类型 - 除广汇外
export const userType = { export const userType = {
// 1: '员工', // 1: '员工',
// 2: '门店', // 2: '门店',
// 3: '市级经销商', // 3: '市级经销商',
// 4: '省级经销商', // 4: '省级经销商',
// 5: '工厂', // 5: '工厂',
1: "工厂", 1: '工厂',
2: "省代", 2: '省代',
3: "市代", 3: '市代',
4: "门店" 4: '门店'
} }
// 商户类型 - 广汇 // 商户类型 - 广汇
export const ghUserType = { export const ghUserType = {
1: "员工", 1: '员工',
2: "门店", 2: '门店',
3: "片区", 3: '片区',
4: "大区", 4: '大区',
5: "总部", 5: '总部',
6: "供应商" 6: '供应商'
} }
export const warrantyProList = [1, 4, 6, 12, 14] export const warrantyProList = [1, 4, 6, 12, 14]
// 商品库-发卷宝-预约排班-预约状态
export const scheduling_inviteStatus = [
{ confId: 1, confValue: '待预约' },
{ confId: 2, confValue: '已预约' },
{ confId: 3, confValue: '取消预约' },
{ confId: 4, confValue: '超时未到店' },
{ confId: 5, confValue: '已施工' },
{ confId: 6, confValue: '已撤销' }
]
<!-- 备注 -->
<template>
<GLDialog bigTitle="备注"
:visible.sync="dialogShow"
class="accountDailog"
width="600px"
mode="big"
:close-on-click-modal="false"
:before-close="handleClose"
@onOk="handleAddConfirm"
@onCancel="dialogShow = false">
<el-form label-width="120px"
:model="infoForm"
ref="formRef"
:rules="formRules"
:inline="true">
<el-form-item label="备注:"
prop="yqMerchantId">
<el-input type="textarea"
class="default-width"
placeholder="请输入内容"
v-model="infoForm.remark"
maxlength="15"
:rows="4"
show-word-limit></el-input>
</el-form-item>
</el-form>
</GLDialog>
</template>
<script>
export default {
name: 'RemarkDialog',
data() {
return {
infoForm: {
remark: ''
},
dialogConfig: {
title: '备注',
width: '600px'
},
rejectRef: 'rejectRef',
formRules: {
// remark: [{ required: true, message: '请输入驳回原因', trigger: 'blur' }]
},
editFormData: [
{
label: '备注',
name: 'remark',
type: 'input',
maxlength: 15,
inputType: 'textarea',
showLimit: true,
rows: 4
}
],
baseData: {}
}
},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: null
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal })
}
}
},
mounted() {
console.log('paramsObj', this.paramsObj)
this.infoForm.remark = this.$common.utils.deepClone(this.paramsObj.remark)
},
methods: {
handleAddConfirm() {
this.$refs.formRef.validate(valid => {
if (valid) {
var params = {}
params.remark = this.infoForm.remark
params.inviteFollowRecordId = this.paramsObj.inviteFollowRecordId
this.$apis.invitation.followRecordUpdate(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.dialogShow = true
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin-top: 20px;
}
.default-width {
width: 400px;
}
</style>
<template>
<div>
<GLDialog bigTitle="预约时间"
:visible.sync="dialogShow"
class="detail-content-warn"
width="600px"
mode="big"
:close-on-click-modal="false"
:before-close="handleClose"
@onOk="handleAddConfirm"
@onCancel="dialogShow = false">
<div v-loading="loading">
<div class="form_div">
<div class="tipsDiv">
<div class="tipsText">
{{ paramsObj.customer.customerName + ' | ' + paramsObj.customer.customerPhone }}
</div>
</div>
<el-form label-width="100px"
:model="infoForm"
ref="editRef"
:rules="formRules"
:inline="true">
<el-form-item label="预约时间:"
prop="dateTime">
<el-date-picker v-model="infoForm.dateTime"
type="date"
class="default-width"
placeholder="选择日期"
value-format="yyyy-MM-dd"
@change="inviteStatMerchantList"
:picker-options="datePickerOptions"></el-date-picker>
<el-select v-model="infoForm.times"
filterable
placeholder="请选择"
class="default-width timesSle">
<el-option v-for="(item, key) in timesOpt"
:key="key"
:label="item.confValue"
:value="item.confId"
:disabled="item.disabled"></el-option>
</el-select>
<el-button type="text"
size="small"
class="timesSle"
v-if="paramsObj.inviteDate"
@click="cancelInvite">取消预约</el-button>
</el-form-item>
</el-form>
</div>
</div>
</GLDialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'ReservationDialog',
components: {},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: null
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('dialogClose', { flag: val })
}
}
},
mounted() {
this.loading = false
console.log('this.paramsObj', this.paramsObj)
this.inviteDatePush()
},
data() {
var validateDateTime = {
validator: (rule, value, callback) => {
if (!value) {
return callback(new Error(`请选择日期`))
}
const times = this.infoForm.times
if (!times) {
return callback(new Error(`请选择时间段`))
}
callback() // 验证通过
},
trigger: 'change'
}
return {
dialogConfig: {
config: {
title: '预约时间',
width: '600px'
}
},
infoForm: {
dateTime: '',
times: ''
},
editChildRef: 'editChildRef',
formRules: {
dateTime: [validateDateTime]
},
datePickerOptions: {
disabledDate: time => {
const today = new Date()
// 设置时间到当天的开始 (00:00:00.000),避免时分秒影响比较
today.setHours(0, 0, 0, 0)
// 计算一个月后的日期 (今天 + 30天)
const oneMonthLater = new Date(today)
oneMonthLater.setDate(today.getDate() + 30) // 粗略按30天算一个月
// 或者更精确地处理月份 (考虑不同月份天数差异)
// oneMonthLater.setMonth(today.getMonth() + 1);
// 禁用规则:
// 1. 禁用早于今天(包含今天00:00:00之前)的日期
// 2. 禁用晚于一个月后(包含一个月后23:59:59之后)的日期
return time.getTime() < today.getTime() || time.getTime() > oneMonthLater.getTime()
}
},
loading: true,
baseData: {
technicianList: []
},
timesOpt: [
{ confId: '09:00', confValue: '09:00', disabled: false },
{ confId: '10:30', confValue: '10:30', disabled: false },
{ confId: '13:00', confValue: '13:00', disabled: false },
{ confId: '14:30', confValue: '14:30', disabled: false },
{ confId: '16:00', confValue: '16:00', disabled: false }
]
}
},
methods: {
inviteDatePush() {
if (this.paramsObj.inviteDate) {
const dateTimeStr = dayjs(this.paramsObj.inviteDate).format('YYYY-MM-DD HH:mm:ss')
// 截取年月日(空格前)
this.infoForm.dateTime = dateTimeStr.split(' ')[0]
// 截取时分(去掉秒)
this.infoForm.times = dateTimeStr.split(' ')[1].substring(0, 5) // "09:00"
this.inviteStatMerchantList()
}
},
inviteStatMerchantList() {
var params = {}
params.merchantId = this.paramsObj.yqMerchantId
params.startDate = this.infoForm.dateTime
params.endDate = this.infoForm.dateTime
console.log('params', params)
this.$apis.invitation.inviteStatMerchantList(params).then(res => {
const saturdayFlag = res[0].saturdayFlag
const sundayFlag = res[0].sundayFlag
const timeStats = res[0].timeStats
const day = new Date(this.infoForm.dateTime).getDay()
if (saturdayFlag === 'N' && day === 6) {
this.$message.warning('工位设置不允许周六施工,请选择其他时间')
this.infoForm.dateTime = ''
return
} else if (sundayFlag === 'N' && day === 0) {
this.$message.warning('工位设置不允许周日施工,请选择其他时间')
this.infoForm.dateTime = ''
return
}
timeStats.forEach(item => {
this.timesOpt.forEach(optItem => {
if (item.inviteTime === optItem.confValue) {
if (item.inviteNum < item.maxNum) {
optItem.disabled = false
} else {
optItem.disabled = true
}
}
})
})
console.log('this.timesOpt', this.timesOpt)
})
},
handleAddConfirm() {
this.$refs.editRef.validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.infoForm)
params.id = this.paramsObj.id
params.inviteType = this.paramsObj.customerCoupon.couponType
params.inviteDateStr = params.dateTime + ' ' + params.times + ':00'
delete params.dateTime
delete params.times
this.$apis.invitation.dateUpdate(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.dialogShow = true
})
}
})
},
cancelInvite() {
this.$confirm('请确认是否要执行当前操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
})
.then(() => {
var params = {}
params.id = this.paramsObj.id
this.$apis.invitation.cancelInvite(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.dialogShow = true
})
})
.catch(err => {
console.log(err)
})
}
}
}
</script>
<style lang="scss" scoped>
.detail-content-warn {
.div-title {
width: 1040px;
height: 30px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
margin: 10px 0 20px 0;
}
.el-icon-circle-close {
color: #ffffff;
}
.form_div {
color: #333333;
.tipsDiv {
height: 28px;
margin-bottom: 20px;
.tipsText {
font-size: 14px;
}
}
.el-form-item__content {
display: inline-block;
width: calc(100% - 150px);
line-height: 24px;
}
.el-form-item__label {
padding: 0;
line-height: 24px;
}
.el-form-item {
width: 100%;
margin-bottom: 20px;
}
.edit-sub-block {
// padding: 0 10px;
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
.itemDiv {
display: flex;
.halfItem {
width: 33%;
}
}
.onLineItem {
::v-deep .el-form-item__content {
max-width: 80%;
}
}
}
.edit-sub-block-two {
.el-form-item__label {
padding: 0;
}
.el-form-item {
// width: 300px;
margin: 0px;
}
}
.busi-info {
box-sizing: border-box;
width: 890px;
border-radius: 4px;
border: 1px solid #e5e5e5;
padding: 6px 0;
color: #333333;
font-size: 14px;
margin-bottom: 14px;
.info-row {
height: 20px;
line-height: 20px;
margin-bottom: 16px;
}
.info-row:last-child {
margin-bottom: 0;
}
.info-item {
display: inline-block;
width: 50%;
height: 20px;
line-height: 20px;
margin-bottom: 6px;
.item-label {
display: inline-block;
width: 150px;
color: #666666;
text-align: right;
}
}
}
}
.receiptBtn {
margin-left: 20px;
}
.imgCon {
text-align: center;
margin-bottom: 50px;
}
.imgSize {
width: 1040px;
}
.default-width {
width: 170px;
}
.timesSle {
padding-left: 10px;
}
}
</style>
<template>
<div>
<GLDialog bigTitle="工位设置"
:visible.sync="dialogShow"
class="detail-content-warn"
width="600px"
mode="big"
:close-on-click-modal="false"
:before-close="handleClose"
@onOk="handleAddConfirm"
@onCancel="dialogShow = false">
<div v-loading="loading">
<div class="form_div">
<el-form label-width="200px"
:model="infoForm"
ref="editRef"
:rules="formRules"
:inline="true">
<el-form-item label="选择园区店:"
prop="yqMerchantId">
<el-select v-model="infoForm.yqMerchantId"
filterable
placeholder="请选择"
class="default-width"
@change="inviteStationSetGet">
<el-option v-for="(item, key) in baseData.yqMerchantList"
:key="key"
:label="item.merchantName"
:value="item.merchantId"></el-option>
</el-select>
</el-form-item>
<div v-for="(item, key) in infoForm.workItem"
:key="key">
<el-form-item :label="item.label"
:prop="'workItem.' + key + '.maxCount'"
:rules="formRules.maxCount">
<el-input-number v-model="item.maxCount"
placeholder="输入数值"
:precision="0"
:step="1"
:min="0"
:max="10000"
class="numInput"></el-input-number>
<span class="unit">个</span>
</el-form-item>
</div>
<el-form-item label="周六施工">
<el-switch v-model="infoForm.saturdayFlag"
active-value="Y"
inactive-value="N"></el-switch>
</el-form-item>
<el-form-item label="周日施工">
<el-switch v-model="infoForm.sundayFlag"
active-value="Y"
inactive-value="N"></el-switch>
</el-form-item>
</el-form>
<div class="tipsDiv">
<div class="tipsText">
设置门店每日每个时段可接待的客户人数, 施工时段以1个半小时为准,请合理安排施工进度
</div>
</div>
</div>
</div>
</GLDialog>
</div>
</template>
<script>
export default {
name: 'WorkSetDialog',
components: {},
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: null
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('dialogClose', { flag: val })
}
}
},
mounted() {
this.yqMerchantPage()
},
data() {
return {
dialogConfig: {
config: {
title: '工位设置',
width: '600px'
}
},
infoForm: {
yqMerchantId: '',
workItem: [
{
label: '上午 09:00-10:30',
startTime: '09:00',
endTime: '10:30',
maxCount: 0
},
{
label: '上午 10:30-12:00',
startTime: '10:30',
endTime: '12:00',
maxCount: 0
},
{
label: '下午 13:00-14:30',
startTime: '13:00',
endTime: '14:30',
maxCount: 0
},
{
label: '下午 14:30-16:00',
startTime: '14:30',
endTime: '16:00',
maxCount: 0
},
{
label: '下午 16:00-17:30',
startTime: '16:00',
endTime: '17:30',
maxCount: 0
}
],
saturdayFlag: 'N',
sundayFlag: 'N'
},
editChildRef: 'editChildRef',
formRules: {
yqMerchantId: [{ required: true, message: '请选择园区店', trigger: 'change' }],
maxCount: [{ required: true, message: '请输入最大数量', trigger: 'blur' }]
},
loading: true,
baseData: {
yqMerchantList: []
}
}
},
methods: {
inviteStationSetGet(yqMerchantId) {
this.$apis.invitation.inviteStationSetGet({ yqMerchantId: yqMerchantId }).then(res => {
console.log('res', res)
if (res && res.length > 0) {
res.forEach(item => {
this.infoForm.workItem.forEach(workItem => {
if (item.startTime === workItem.startTime && item.endTime === workItem.endTime) {
workItem.maxCount = item.maxCount
}
})
this.infoForm.saturdayFlag = item.saturdayFlag
this.infoForm.sundayFlag = item.sundayFlag
})
}
})
},
yqMerchantPage() {
this.$apis.invitation.yqMerchantPage({ currentPage: 1, pageSize: 99999 }).then(res => {
this.baseData.yqMerchantList = res.list
this.loading = false
})
},
handleAddConfirm() {
this.$refs.editRef.validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.infoForm)
params.setList = params.workItem.map(item => {
const obj = {
startTime: item.startTime,
endTime: item.endTime,
maxCount: item.maxCount,
saturdayFlag: params.saturdayFlag,
sundayFlag: params.sundayFlag
}
return obj
})
delete params.workItem
delete params.saturdayFlag
delete params.sundayFlag
console.log('params', params)
this.$apis.invitation.inviteStationSetUpdate(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.dialogShow = true
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.detail-content-warn {
.div-title {
width: 1040px;
height: 30px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
margin: 10px 0 20px 0;
}
.el-icon-circle-close {
color: #ffffff;
}
.form_div {
color: #333333;
.tipsDiv {
display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
// flex-direction: column;
// background: #f47f131a;
height: 28px;
margin-bottom: 25px;
.tipsText {
display: flex;
align-items: center; /* 垂直居中 */
// font-weight: 500;
font-size: 13px;
color: #888888;
}
.imgCla {
margin-right: 8px;
width: 20px;
height: 20px;
}
}
.el-form-item__content {
display: inline-block;
width: calc(100% - 150px);
line-height: 24px;
}
.el-form-item__label {
padding: 0;
line-height: 24px;
}
.el-form-item {
width: 100%;
margin-bottom: 20px;
}
.edit-sub-block {
// padding: 0 10px;
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
.itemDiv {
display: flex;
.halfItem {
width: 33%;
}
}
.onLineItem {
::v-deep .el-form-item__content {
max-width: 80%;
}
}
}
.edit-sub-block-two {
.el-form-item__label {
padding: 0;
}
.el-form-item {
// width: 300px;
margin: 0px;
}
}
.busi-info {
box-sizing: border-box;
width: 890px;
border-radius: 4px;
border: 1px solid #e5e5e5;
padding: 6px 0;
color: #333333;
font-size: 14px;
margin-bottom: 14px;
.info-row {
height: 20px;
line-height: 20px;
margin-bottom: 16px;
}
.info-row:last-child {
margin-bottom: 0;
}
.info-item {
display: inline-block;
width: 50%;
height: 20px;
line-height: 20px;
margin-bottom: 6px;
.item-label {
display: inline-block;
width: 150px;
color: #666666;
text-align: right;
}
}
}
}
.receiptBtn {
margin-left: 20px;
}
.imgCon {
text-align: center;
margin-bottom: 50px;
}
.imgSize {
width: 1040px;
}
.default-width {
width: 300px;
}
.numInput {
width: 160px;
}
.unit {
padding-left: 10px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!