Commit adde4322 by 前端

Merge branch 'master' into 'develop'

Master ===> develop

See merge request !7
2 parents 006ed4c3 6326d9a1
Showing 52 changed files with 4929 additions and 326 deletions
......@@ -163,7 +163,7 @@ const getProListApi = params => {
// 获取无忧卡套餐列表
const getPackageListApi = params => {
params.method = `scrm.api.equity.service.package.dj.list.get`
// params.method = `scrm.api.equity.service.package.list.get`
// params.method = `scrm.api.equity.service.package.list.get`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
......@@ -325,50 +325,106 @@ const spaAgressData = params => {
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
sign: true
})
}
// 店铺信息
const merchantInfo = params => {
params.method = 'scrm.api.equity.common.merchant.detail.det'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
})
}
// 卡号---获取期限
params.method = 'scrm.api.equity.common.merchant.detail.det'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 卡号---获取期限
const dateBycarNo = params => {
params.method = 'scrm.api.equity.service.cfc.get.by.seqno'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取活码列表-
const activeCodeList = params => {
params.method = 'entmicro.api.code.getFreeChannelCode'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 更新活码
const updateActiveCode = params => {
params.method = 'scrm.api.equity.service.merchant.qrcode.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getWriteOffList = params => {
params.method = `scrm.api.equity.service.claims.list`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
// 导出核赔列表
const exportWriteOffData = params => {
params.method = `scrm.api.equity.service.claims.list.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取活码列表-
const activeCodeList = params => {
params.method = 'entmicro.api.code.getFreeChannelCode'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true,
})
}
// 更新活码
const updateActiveCode = params => {
params.method = 'scrm.api.equity.service.merchant.qrcode.update'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
})
}
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, judgeSetting, spaAgressData, merchantInfo, dateBycarNo,activeCodeList,updateActiveCode }
\ No newline at end of file
// 核赔判断并获取服务
const getWriteOffService = params => {
params.method = `scrm.api.equity.service.claims.create.before.init`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取核赔订单详情
const getWriteOffDetail = params => {
params.method = `scrm.api.equity.service.claims.detail`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 保存核赔订单
const saveWriteOff = params => {
params.method = `scrm.api.equity.service.claims.save`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getUserInfoApi, getCountNoDataApi, getListApi, getMerchantApi, getExportApi, getPriteApi, getCarBrandListApi, getCarChildListApi, getCarTypeListApi, getCarSeriesListApi, getHotlineApi, getDefaultCarbrandApi, updateHotlineApi, updateCarBrandApi, getProListApi, getPackageListApi, getEquityApi, updateEquityApi, createCodeApi, getOrderAttrApi, getAllOrderValueApi, verifyOrderApi, checkOrderApi, updateOrderApi, uploadImgApi, backOrderApi, aduitOrderApi, judgeSetting, spaAgressData, merchantInfo, dateBycarNo, activeCodeList, updateActiveCode, getWriteOffList, exportWriteOffData, getWriteOffService, getWriteOffDetail, saveWriteOff }
import { http } from '@/main'
import { http, http_common } from '@/main'
const defaultPath = 'scrm.api.live.'
......@@ -43,4 +43,15 @@ const getZoneList = params => {
})
}
export { getGoodsList, uploadImg, getMerchantList, getZoneList }
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload }
import { http, http2 } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
const customerList = params => {
params.type = 1
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerGroupList = params => {
params.type = 2
params.method = `${path}page`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const insert = params => {
params.method = `${path}insert`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const detail = params => {
params.type = 2
params.method = `${path}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const findLordGroup = params => {
params.method = 'entmicro.api.staff.findLordGroup'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const querylabeltree = params => {
// params.method = 'scrm.api.datahub.label.querylabeltree'
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http2({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const groupList = params => {
params.method = 'entmicro.api.customer.group.list.by.merchant'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const customerCount = params => {
params.method = 'entmicro.api.mass.detail.customer.filter.count'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
// 客户群发、客户群群发基本信息详情
const customerDetail = params => {
params.method = `${path}detail`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发统计
const detailStatistic = params => {
params.method = `${path}detail.statistic`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群群发统计
const groupDetailStatistic = params => {
params.method = `${path}group.detail.statistic`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发员工列表
const staffList = params => {
params.method = `${path}staff.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发客户列表
const customerDetailList = params => {
params.method = `${path}customer.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群群发列表
const groupDetailList = params => {
params.method = `${path}group.detail.sender.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 根据id提醒用户 ,列表
const listRemindOperate = params => {
params.method = `${path}listRemindOperate`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 详情页客户群提醒
const remindUserGroup = params => {
params.method = `${path}remindUserGroup`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
url: '/rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status'
return http({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateDetail = params => {
params.method = `${path}template.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const groupDetailUpdate = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const followerType = params => {
params.method = 'entmicro.api.staff.listEntFollowerType'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
customerList,
customerGroupList,
insert,
detail,
remindUserGroup,
listRemindOperate,
listDepartmentTree,
querylabeltree,
groupList,
customerCount,
customerDetail,
detailStatistic,
groupDetailStatistic,
staffList,
customerDetailList,
groupDetailList,
getMerchant,
getCard,
getCoupon,
merchant,
merchantOpen,
getPackage,
getActivity,
nameVaild,
getStatus,
templatePage,
templateSave,
templateUpdate,
createdNameList,
templateDetail,
groupDetailUpdate,
findLordGroup,
followerType
}
import { http, http_brand, request_merchant } from '@/main'
const getExpertList = params => {
params.method = 'entmicro.api.operation.page'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getDepartment = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const saveExpert = params => {
params.method = 'entmicro.api.operation.save'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const delExpert = params => {
params.method = 'entmicro.api.operation.delete'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const editExpert = params => {
params.method = 'entmicro.api.operation.update'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const expertDetail = params => {
params.method = 'entmicro.api.operation.detail'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getMenberType = params => {
params.method = 'merchants.api.menu.findAllDictData'
return request_merchant({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getExpertList, getDepartment, saveExpert, delExpert, editExpert, expertDetail, getMenberType }
......@@ -7,7 +7,7 @@
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, .3);
background-color: rgba(144, 147, 153, 0.3);
}
.h1_title {
......@@ -44,7 +44,7 @@
.h6_title {
font-size: 16px;
font-weight: 500;
color: #3A3A3A;
color: #3a3a3a;
}
.h7_title {
......@@ -56,7 +56,7 @@
.h8_title {
font-size: 24px;
font-weight: 600;
color: #3A3A3A;
color: #3a3a3a;
}
.h9_title {
......@@ -68,7 +68,7 @@
.h10_title {
font-size: 12px;
font-weight: 400;
color: #3A3A3A;
color: #3a3a3a;
}
.h11_title {
......@@ -92,19 +92,19 @@
.h14_title {
font-size: 14px;
font-weight: 400;
color: #37383A;
color: #37383a;
}
.h15_title {
font-size: 14px;
font-weight: 500;
color: #5850FF;
color: #5850ff;
}
.h16_title {
font-size: 12px;
font-weight: 500;
color: #5850FF;
color: #5850ff;
}
.h17_title {
......@@ -161,20 +161,64 @@
flex-direction: column;
}
.el-message{
z-index: 3000!important;
.el-message {
z-index: 3000 !important;
}
.customConfirm{
.customConfirm {
.el-message-box__btns button:nth-child(2) {
margin-left: 20px;
}
}
.el-message.el-message--error.customMessage{
&>p{
&>p{
.el-message.el-message--error.customMessage {
& > p {
& > p {
white-space: nowrap;
}
}
}
\ No newline at end of file
}
.my-footer {
width: 100%;
position: fixed;
bottom: 0;
height: 64px;
left: 0;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 0;
}
.expert-cascader .el-cascader-menu {
max-height: 500px;
}
.my-search-btn {
.el-button--primary.is-plain {
color: #5850ff;
background-color: #fff;
border-color: #5850ff;
}
.el-button--primary.is-plain:hover {
color: #7973ff;
background-color: #fff;
border-color: #7973ff;
}
.el-button--primary.is-plain:active {
color: #3a32e1;
background-color: #fff;
border-color: #3a32e1;
}
}
.loadingClass{
.el-icon-loading{
font-size: 22px;
}
.el-icon-loading,
.el-loading-text{
color: #fff!important;
}
}
<!-- 搜索 -->
<template>
<div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<el-form @submit.native.prevent :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px': '30px', ...item.style }" :label="item.label" :prop="item.name">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
......@@ -12,11 +12,11 @@
{{ item.label }}
</span>
<span v-else-if="!item.isHide && item.label" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth ? (item.labelWidth + labelPaddingRight) + 'px' : '', 'padding-right': isEdit ? '12px' : (labelPaddingRight + 'px') }">{{ item.label }}</span>
<span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span>
</span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur="e => handleInputBlur(e, item)">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur="e => handleInputBlur(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
......@@ -24,7 +24,7 @@
</div>
<!-- 选择-输入框 -->
<el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || defaultWidth }" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || labelWidth + 'px' }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
</el-input>
......@@ -57,6 +57,11 @@
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" :disabled="item.isDisabled" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
<!-- 当存在range-separato,start-placeholder,end-placeholder这几个属性时,日期可以限制,时间不可以限制 -->
<el-date-picker v-else-if="item.type === 'limitDatePicker'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.selectWidth || defaultWidth }" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]" @change="e => handleDateChange(e, item)" @focus="e => item.focus(e)"></el-date-picker>
<el-checkbox-group v-else-if="item.type === 'checkbox'" v-model="formObj[item.name]">
<el-checkbox v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]" :border="item.border">{{ subItem[item.optionLabel] }}</el-checkbox>
</el-checkbox-group>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
......@@ -99,10 +104,10 @@
</template>
<slot name="footer"></slot>
</el-form>
<el-dialog v-if="isImgVisible" :append-to-body="true" :modal-append-to-body="true" title="查看" :visible.sync="isImgVisible">
<el-dialog v-if="isImgVisible" :append-to-body="true" :modal-append-to-body="true" title="查看" :visible.sync="isImgVisible">
<div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4">
<source :src="dialogObj.url" type="video/mp4" />
</video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
......@@ -111,7 +116,7 @@
</template>
<script>
import { beforeRangePickerOptions, afterRangePickerOptions,afterTodayRangePickerOptions } from './common'
import { beforeRangePickerOptions, afterRangePickerOptions, afterTodayRangePickerOptions } from './common'
export default {
name: 'glsx-combi-form',
data() {
......@@ -185,14 +190,17 @@ export default {
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
remoteMethod(value){
console.log(value,111)
remoteMethod(value) {
console.log(value, 111)
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
}
},
handleDateChange(value, targetItem) {
targetItem.handleDateChange && targetItem.handleDateChange(value, targetItem)
},
handleInputBlur(e, item) {
item.inputBlur && item.inputBlur(e, item)
},
......@@ -358,7 +366,7 @@ export default {
.glsx-combi-form .activity-img {
position: relative;
color: #999999;
background-color: #F7F7F7;
background-color: #f7f7f7;
border: 1px dotted #d9d9d9;
cursor: pointer;
}
......@@ -438,16 +446,16 @@ export default {
/* 图片上传 */
.glsx-combi-form .el-tag.el-tag--info .el-tag__close {
color: #E8E8EA;
color: #e8e8ea;
background-color: #5850ff !important;
}
.glsx-combi-form .el-tag.el-tag--info {
border-color: #5850ff;
}
.glsx-combi-form .el-tag--plain.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA;
background-color: #e8e8ea;
}
.glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA;
background-color: #e8e8ea;
}
</style>
......@@ -18,11 +18,11 @@ export const fetchConfig = function(isEnv = true) {
// return Promise.resolve(cfg)
// }
return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get(' https://oss-config.test.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config')
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file
}
......@@ -19,3 +19,5 @@ start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_brand = params => Vue.prototype.$http_brand(params)
export const http_common = params => Vue.prototype.$http_common(params)
export const request_merchant = params => Vue.prototype.$request_merchant(params)
const staticRoutes = Object.freeze([{
const staticRoutes = Object.freeze([
{
name: 'index',
path: '/inSale/index',
component: resolve => require([`@/views/inSale/index.vue`], resolve),
meta: {}
}, {
},
{
name: 'upgrade',
path: '/inSale/upgrade',
component: resolve => require([`@/views/inSale/upgrade.vue`], resolve),
meta: {}
}, {
},
{
name: 'guestComments',
path: '/inSale/guestComments',
component: resolve => require([`@/views/inSale/guestComments.vue`], resolve),
meta: {}
}, {
},
{
name: 'accountRules',
path: '/inSale/accountRules',
component: resolve => require([`@/views/inSale/accountRules.vue`], resolve),
......@@ -30,17 +34,20 @@ const staticRoutes = Object.freeze([{
path: '/beforeSale/equityList',
component: resolve => require([`@/views/beforeSale/equityList.vue`], resolve),
meta: {}
}, {
},
{
name: 'introduct',
path: '/inSale/introduct',
component: resolve => require([`@/views/inSale/introduct.vue`], resolve),
meta: {}
}, {
},
{
name: 'afterSales',
path: '/afterSales/index',
component: resolve => require([`@/views/afterSales/index.vue`], resolve),
meta: {}
}, {
},
{
name: 'index',
path: '/beforeSale/index',
component: resolve => require([`@/views/beforeSale/index.vue`], resolve),
......@@ -64,5 +71,35 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/ghPreSale/index.vue`], resolve),
meta: {}
},
{
name: 'writeOffList',
path: '/ghPreSale/index',
component: resolve => require([`@/views/ghPreSale/writeOff/writeOffList`], resolve),
meta: {}
},
{
name: 'addwriteOff',
path: '/ghPreSale/writeOff/addwriteOff',
component: resolve => require([`@/views/ghPreSale/writeOff/addwriteOff`], resolve),
meta: {}
},
{
name: 'writeOffDetail',
path: '/ghPreSale/writeOff/writeOffDetail/:id',
component: resolve => require([`@/views/ghPreSale/writeOff/writeOffDetail`], resolve),
meta: {}
},
{
name: 'index',
path: '/expert/index',
component: resolve => require([`@/views/expert/index.vue`], resolve),
meta: {}
},
{
name: 'detail',
path: '/expert/detail/:id',
component: resolve => require([`@/views/expert/detail.vue`], resolve),
meta: {}
}
])
export default staticRoutes
\ No newline at end of file
export default staticRoutes
import Vue from 'vue'
import ElementUI from 'element-ui'
import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
......@@ -10,13 +11,16 @@ let routes = []
let router = null
let instance = null
Vue.use(GLTable)
Vue.use(ElementUI)
// Vue.use(Table)
// Vue.use(TableColumn)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request_brand, sign, secret } = await fetchConfig()
const { response, request, request_brand, request_common, request_merchant, sign_common, sign, secret } = await fetchConfig()
// 本地切换域名,不需要Mock上面改动 const => let
// request.baseURL = 'https://scrm.dev.glsx.com.cn'
// request_brand.baseURL = 'https://scrm.dev.glsx.com.cn'
// request.baseURL = 'http://192.168.1.78:8064'
// request_brand.baseURL = 'http://192.168.1.78:8064'
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......@@ -26,8 +30,10 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$defaultStartDate = '2021-07-01'
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: '3c50d4be-7211-45c1-a2c6-9792bbb3c0d9' } })
// Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: '3c50d4be-7211-45c1-a2c6-9792bbb3c0d9' } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$request_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: 'scrm-base-c13d1275-bc81-4a5f-b909-72c60316945b-rop' } })
// Vue.prototype.$http_brand = new common.Http({ response, request: request_brand, sign, secret, alert: message.error, headers: { token: 'scrm-base-c13d1275-bc81-4a5f-b909-72c60316945b-rop' } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
......@@ -51,4 +57,4 @@ function subscribe({ messenger }) {
messenger.subscribe(v => {
// console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
\ No newline at end of file
}
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
]
export default emoji
......@@ -38,44 +38,51 @@ util.getDateStr = function(num) {
let now = new Date()
now.setDate(now.getDate() + num)
util.dateFormat(now)
// let y = now.getFullYear()
// let m = (now.getMonth() + 1) < 10 ? '0' + (now.getMonth() + 1) : (now.getMonth() + 1)
// let d = now.getDate() < 10 ? '0' + now.getDate() : now.getDate()
// let y = now.getFullYear()
// let m = (now.getMonth() + 1) < 10 ? '0' + (now.getMonth() + 1) : (now.getMonth() + 1)
// let d = now.getDate() < 10 ? '0' + now.getDate() : now.getDate()
// return y + "-" + m + "-" + d
return util.dateFormat(now)
}
util.getExplorer = function() {
var ua = navigator.userAgent.toLocaleLowerCase();
var browserType = null;
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = "IE";
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = "火狐";
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = "UC";
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = "欧朋";
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = "百度";
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = "搜狗";
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = "QQ";
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = "遨游";
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
util.debounce=(fn,timer)=> {
let timeout = null;
return function () {
clearTimeout(timeout);
timeout = setTimeout(() => {
fn.apply(this, arguments);
}, timer);
};
util.debounce = (fn, timer) => {
let timeout = null
return function() {
clearTimeout(timeout)
timeout = setTimeout(() => {
fn.apply(this, arguments)
}, timer)
}
}
util.openUrl = function(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
export default util
\ No newline at end of file
export default util
......@@ -295,7 +295,7 @@ export default {
}
],
invoicePrice: [{ required: true, message: '请输入车辆价格', trigger: 'change' }],
// vehicleColor: [{ required: true, message: '请输入车身颜色', trigger: 'change' }],
vehicleColor: [{ required: true, message: '请输入车身颜色', trigger: 'change' }],
vehicleBrandId: [{ required: true, message: '请选择车品牌', trigger: 'change' }],
vehicleSubBrandId: [{ required: true, message: '请选择车子品牌', trigger: 'change' }],
vehicleSeriesId: [{ required: true, message: '请选择车系', trigger: 'change' }],
......@@ -979,9 +979,9 @@ export default {
let arrt4 = `attributes[${blackArr[i][j].index}].attributeDTOList[${j}].sort`
let obj = {
[arrt1]: blackArr[i][j].value.attributeGroup,
[arrt2]: blackArr[i][j].value.attributeName,
[arrt2]: blackArr[i][j].value.attributeName == 'afterTireScale' ? 'tireScale' : blackArr[i][j].value.attributeName,
[arrt3]: this.priceFormat(blackArr[i][j].value.attributeName, blackArr[i][j].value.attributeValue),
[arrt4]: blackArr[i][j].value.sort
[arrt4]: blackArr[i][j].value.attributeName == 'afterTireScale' ? 1 : blackArr[i][j].value.sort
}
newParaArr.push(obj)
}
......@@ -992,7 +992,6 @@ export default {
concactArr.forEach(item => {
this.formatProduct = Object.assign(this.formatProduct, item)
})
// console.log(this.formatProduct, '自选权益')
} else {
concactArr.forEach(item => {
this.autoFormatProduct = Object.assign(this.autoFormatProduct, item)
......@@ -1135,7 +1134,7 @@ export default {
// var idxPrice = this.editForm.attributeList.findIndex(i => i.attributeName == 'additional_price')
// this.editForm.attributeList[idxPrice].attributeValue = this.editForm.attributeList[idxPrice].attributeValue ? (this.editForm.attributeList[idxPrice].attributeValue / 100).toFixed(2) : ''
// }
this.editForm.vehicle.billingDate = this.editForm.vehicle.billingDate ? new Date(this.editForm.vehicle.billingDate) : ''
this.editForm.effectiveDate = this.editForm.effectiveDate ? new Date(this.editForm.effectiveDate) : ''
if ([2, 3, 4].includes(this.routeInfo.addOrEdit)) {
......@@ -1160,13 +1159,29 @@ export default {
}
this.editForm.packageCode && this.packageAttr(true, productArrData, res)
const spaItem = this.baseData.agreeList.find(item => item.id == this.editForm.specialAppointId)
if(spaItem){
if (spaItem) {
this.editForm.specialAppoint = spaItem.spaContent
}
})
},
getPackageList() {
this.$apis.beforeSale.getPackageListApi({}).then(res => {
res.forEach((item, index) => {
let obj = null
let id = -1
item.groupAttributeList.forEach((e, idx) => {
if (e.groupName == 'tireScale') {
if (e?.attributeList && e?.attributeList[0]) {
e.attributeList[0].attributeDesc = '规格型号(前轮)'
obj = JSON.parse(JSON.stringify(e))
obj.attributeList[0].attributeDesc = '规格型号(后轮)'
obj.attributeList[0].attributeName = 'afterTireScale'
id = idx
}
}
})
if (id > -1) item.groupAttributeList.splice(id + 1, 0, obj)
})
this.toTestProductData(res)
})
},
......@@ -1194,7 +1209,10 @@ export default {
if (item.attributeName.includes('price')) {
item.attributeValue = item.attributeValue / 100
}
if(item.attributeName=="buy_car_type"&&item.attributeValue==1){
if (item.attributeName == 'tireScale' && item.sort == 1) {
item.attributeName = 'afterTireScale'
}
if (item.attributeName == 'buy_car_type' && item.attributeValue == 1) {
this.compensationNameDisable = true
}
this.productModal.vip[item.attributeName] = item.attributeValue
......@@ -1226,7 +1244,10 @@ export default {
} else if (item.attributeName == 'planId') {
this.getCase(parseInt(item.attributeValue))
}
if(item.attributeName=="buy_car_type"&&item.attributeValue==1){
if (item.attributeName == 'tireScale' && item.sort == 1) {
item.attributeName = 'afterTireScale'
}
if (item.attributeName == 'buy_car_type' && item.attributeValue == 1) {
this.compensationNameDisable = true
}
this.productModal[targetItem.idName][item.attributeName] = item.attributeValue
......@@ -1246,7 +1267,7 @@ export default {
if (ele.attributeName == 'effective_date') {
ele.disabled = true
}
if (ele.attributeName == 'buy_car_type'&&ele.attributeValue==1) {
if (ele.attributeName == 'buy_car_type' && ele.attributeValue == 1) {
ele.disabled = true
}
})
......
<template>
<div class="ly-emotion">
<slot></slot>
</div>
</template>
<script>
import emoji from '@/util/emo'
export default {
name: 'ly-emotion',
mounted() {
const name = this.$el.innerHTML
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(name)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => {
this.$el.innerHTML = imgHTML
})
}
}
</script>
<style scoped>
.ly-emotion {
display: inline-block;
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
<template>
<div class="square-main">
<el-dialog title="选择活动" :visible.sync="dialogVisible" width="1088px" :before-close="handleClose">
<div class="model-panel">
<div class="model-panel-tab">
<label>活动类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card">
<el-tab-pane :disabled="disableChangeTab" label="权益卡试用" name="3"></el-tab-pane>
<el-tab-pane :disabled="disableChangeTab" label="权益套餐" name="4"></el-tab-pane>
<el-tab-pane :disabled="disableChangeTab" label="商城券" name="2"></el-tab-pane>
<el-tab-pane :disabled="disableChangeTab" label="秒杀活动" name="5"></el-tab-pane>
<el-tab-pane :disabled="disableChangeTab" label="无忧服务" name="6" v-if="openFlag"></el-tab-pane>
</el-tabs>
</div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
<div class="model-item" :class="{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<div class="model-item-title" :title="item.equityName" v-show="activeName == 3">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 2">{{ item.couponName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 6">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.packageName" v-show="activeName == 4">{{ item.packageName }}</div>
<div class="model-item-title" :title="item.activityName" v-show="activeName == 5">{{ item.activityName }}</div>
<div class="model-item-content" v-show="activeName == 3">领取方式:免费领用</div>
<div class="model-item-content" v-show="activeName == 4">领取方式:付费购买</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 6">有效期:{{ item.effectiveDays }}天</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 3">有效期:无限制</div>
<div class="model-item-content" v-show="activeName == 2 && item.effectiveType == 2">有效期:{{ item.effectiveStartTime ? item.effectiveStartTime.split(' ')[0] : '' }}~{{ item.effectiveEndTime ? item.effectiveEndTime.split(' ')[0] : '' }}</div>
<div class="model-item-content" v-show="activeName == 6">获取方式:需先购买无忧服务套餐</div>
<div class="model-item-content" v-show="activeName == 6">获取限制:每个服务套餐限领一次</div>
<div class="model-item-content" v-show="activeName == 3"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 3">
试用天数:
<span>{{ item.freeDay }}天</span>
</div>
<div class="model-item-content" v-show="activeName == 2">
使用途径:
{{ item.useChannel == 1 ? '线上商品' : '到店核销' }}
</div>
<div class="model-item-content model-item-weight" v-show="activeName == 6">
赠送天数:
<span>{{ item.effectiveType == 2 ? item.effectivedDay + '天' : '永久有效' }}</span>
</div>
<div class="model-item-content" v-show="activeName == 4 || activeName == 5"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 4">
销售价格:
<span>{{ item.packagePrice }}元</span>
</div>
<div class="model-item-content" v-if="activeName == 5">
开始时间:
{{ item.startTime }}
</div>
<div class="model-item-content" v-if="activeName == 5">
结束时间:
{{ item.endTime }}
</div>
<div class="model-item-content model-item-contents" v-show="activeName == 2">
数量:
<span>{{ item.residueAmount }}</span>
</div>
</div>
</div>
<div class="model-item-empty" v-else v-loading="loading">
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination v-if="activeName != 3" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[12, 24, 36, 48]" :page-size="pageSize" :total="tableTotal" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect" v-show="modelList.length">确 定</el-button>
<el-button size="small" type="primary" @click="handleOpen" v-show="modelList.length == 0 && activeName == 2 && memberMenu">立即添加</el-button>
<el-button size="small" type="primary" @click="handleOpen" v-show="modelList.length == 0 && activeName == 4 && couponMenu">立即添加</el-button>
<el-button size="small" type="primary" @click="handleOpen" v-show="modelList.length == 0 && activeName == 5 && activityMenu">立即添加</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/util/util'
export default {
name: 'ActivityModel',
data() {
return {
dialogVisible: false,
couponMenu: false,
loading: false,
activeName: '3',
modelList: [],
pageNum: 1,
pageSize: 12,
tableTotal: 0,
openFlag: 0,
selectItem: {
id: ''
},
disableChangeTab: false
}
},
methods: {
handleSelectItem(item) {
this.selectItem = item
if (item.equityClassId) {
this.selectItem.id = item.equityClassId
}
console.log(this.selectItem)
},
handleSelect() {
if (!this.selectItem.id) {
this.$message({
type: 'error',
message: '请选择活动'
})
return
}
this.dialogVisible = false
this.$emit('selectActivity', { marketingId: this.selectItem.id ? this.selectItem.id : this.selectItem.equityClassId, marketingType: this.activeName, marketingName: this.activeName == 3 ? this.selectItem.equityName : this.activeName == 4 ? this.selectItem.packageName : this.activeName == 5 ? this.selectItem.activityName : this.activeName == 2 ? this.selectItem.couponName : this.selectItem.equityName })
},
handleSizeChange(val) {
this.pageSize = val
this.getModelList()
},
handleCurrentChange(val) {
this.pageNum = val
this.getModelList()
},
handleOpen() {
let url
switch (this.activeName) {
case '2':
url = '/marketing/couponManage/index'
break
case '4':
url = '/marketing/memberCenter/setmealAddUpdate?%24title=%25E5%2588%259B%25E5%25BB%25BA%25E5%25A5%2597%25E9%25A4%2590'
break
case '5':
url = '/marketing/seckillActivity/editActivity/1'
break
}
util.openUrl(location.origin + url)
this.dialogVisible = false
},
getModelList() {
this.modelList = []
this.loading = true
let market = ''
switch (this.activeName) {
case '6':
market = 'merchant'
break
case '2':
market = 'getMerchant'
break
case '3':
market = 'getCard'
break
case '4':
market = 'getPackage'
break
case '5':
market = 'getActivity'
break
}
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
if (this.activeName == 3) {
params.tryAble = 1
params.merchantId = this.$globalState.session.merchantId
}
if (this.activeName == 2) {
params.discountTypes = [2, 3, 4]
params.validType = 'valid'
}
if (this.activeName == 5) {
params.currentPage = this.pageNum
params.activityStatus = 2
}
if (this.activeName == 6) {
params.merchantId = this.$globalState.session.merchantId
}
this.disableChangeTab = true
this.$apis.customerTransform[market](params)
.then(res => {
if (this.activeName == 3 || this.activeName == 6) {
this.modelList = res
} else {
this.modelList = res.list ? res.list : res.data
this.tableTotal = res.total
}
this.loading = false
this.disableChangeTab = false
})
.catch(() => {
this.loading = false
this.disableChangeTab = false
})
},
merchantOpen() {
let channel = null
if (location.host == 'scrm.cgacar.com') {
channel = 2
}
this.$apis.customerTransform.merchantOpen({ merchantId: this.$globalState.session.merchantId, channel }).then(res => {
this.openFlag = res.openFlag
})
},
init() {
this.merchantOpen()
this.couponMenu = false
this.activityMenu = false
this.memberMenu = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (item.name == 'marketing') {
if (!item.children) {
return
}
item.children.forEach(itm => {
console.log(itm.path)
if (itm.path == '/couponManage/index') {
this.couponMenu = true
}
if (itm.path == '/seckillActivity/index') {
this.activityMenu = true
}
if (itm.path == '^') {
this.memberMenu = true
}
})
}
})
this.dialogVisible = true
this.getModelList()
this.selectItem = {}
},
handleClick() {
this.getModelList()
}
}
}
</script>
<style lang="scss" scoped>
.square-main {
/deep/ {
.el-dialog__footer {
text-align: center;
}
}
}
.model-panel {
.model-panel-tab {
display: flex;
align-items: center;
margin-bottom: 18px;
label {
font-size: 16px;
font-weight: 400;
color: #000000;
line-height: 24px;
}
/deep/ {
.el-checkbox:last-of-type {
margin-right: 8px;
}
.el-tabs__nav {
border: 0;
}
.el-tabs__header {
border: 0;
background-color: #f4f6fc;
margin: 0px;
}
.el-tabs__item {
border: none;
width: 180px;
height: 32px;
line-height: 32px;
margin: 2px;
text-align: center;
}
.el-tabs__item.is-active {
background-color: #fff;
border-radius: 4px;
font-weight: 600;
}
}
}
.model-item-empty {
> img {
display: block;
margin: 50px auto 0px;
width: 60px;
height: auto;
}
.empty-item {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
}
.model-item-panel {
// display: grid;
// grid-template-columns: repeat(4, 25%);
// grid-row-gap: 10px;
max-height: 38vh;
overflow: auto;
display: flex;
flex-wrap: wrap;
align-items: stretch;
flex-direction: row;
.model-item {
width: 240px;
margin-right: 24px;
margin-bottom: 24px;
padding: 12px 16px;
position: relative;
height: 128px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e6e6e6;
padding: 14px 24px;
box-sizing: border-box;
&:nth-child(4n) {
margin-right: 0px;
}
&.checked {
background: rgba(88, 80, 255, 0.1);
border: 1px solid #5850ff;
}
&-qrcode {
position: absolute;
right: 10px;
bottom: 10px;
width: 60px;
height: 60px;
border: 1px solid #979797;
}
&-title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-bottom: 5px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&-content {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 16px;
height: 16px;
margin-top: 6px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&.model-item-weight {
line-height: 20px;
height: 20px;
}
span {
color: #5850ff;
font-size: 20px;
}
}
&-contents {
line-height: 22px;
height: 22px;
}
}
}
}
</style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</emotion>
</div>
</div>
</div>
</template>
<script>
import emoji from '@/util/emo'
import Emotion from './Emotion'
export default {
props: {
height: {
type: Number,
default: 200
}
},
data() {
return {
list: emoji
}
},
methods: {
clickHandler(i) {
let emotion = `${i}`
this.$emit('emotion', emotion)
}
},
components: {
Emotion
}
}
</script>
<style scoped lang="scss">
.emotion-box {
z-index: 2004;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
width: 300px;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
overflow-y: auto;
}
.emotion-box-line {
display: flex;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
line-height: 23px;
/deep/ {
img {
width: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
}
}
}
</style>
<template>
<div class="square-main">
<el-dialog title="选择模板" :visible.sync="dialogVisible" width="1142px" :before-close="handleClose" :close-on-click-modal="false">
<div class="model-panel">
<el-form :inline="true" class="message-form" :model="searchForm" ref="searchForm">
<el-form-item label="模板标题">
<el-input v-model="searchForm.title" :size="size" placeholder="请输入模板名称搜索"></el-input>
</el-form-item>
<el-form-item label="创建者">
<el-select v-model="searchForm.createdBy" :size="size" placeholder="全部">
<el-option v-for="item in createdList" :key="item.id" :label="item.createdName" :value="item.createdBy"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
<el-form-item style="float: right;margin-right: 0;">
<el-button :size="size" icon="el-icon-plus" @click="createModel">新增模板</el-button>
</el-form-item>
</el-form>
<!-- <div class="model-panel-tab">
<label>模板类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card">
<el-tab-pane label="售前" name="1"></el-tab-pane>
<el-tab-pane label="售中" name="2"></el-tab-pane>
<el-tab-pane label="售后" name="3"></el-tab-pane>
</el-tabs>
</div>-->
<div class="model-item-panel" v-if="!loading && modelList.length > 0" v-loading="loading">
<div class="model-item" v-for="item in modelList" :key="item.id">
<div class="model-item-radio">
<el-radio v-model="messageRadio" :label="item"></el-radio>
</div>
<div class="model-item-title">
<div class="model-title-h1">{{ item.title }}</div>
<div class="model-title-h2">{{ item.content }}</div>
</div>
<div class="model-item-content">
<div class="model-content">创建人:{{ item.createdName }}</div>
<div class="model-content">创建日期:{{ item.createdTime }}</div>
</div>
<div class="model-item-btn">
<el-button v-if="item.createdBy == userId" type="text" :size="size" @click="editModel(item.id)">编辑</el-button>
</div>
</div>
</div>
<div class="model-item-panel" v-else>
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[10, 20, 30, 40]" :page-size="pageSize" :total="tableTotal" :layout="layout"></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="selectModelItem">复制文本</el-button>
</span>
</el-dialog>
<el-dialog :title="modelTitle" :visible.sync="createVisible" width="547px" :before-close="handleCreateClose" :close-on-click-modal="false">
<el-form :model="templateForm" :rules="templateRules" ref="templateForm" label-width="100px" class="templateForm">
<el-form-item label="标题" prop="title">
<el-input v-model="templateForm.title" maxlength="10" show-word-limit placeholder="输入10个字以内的标题,如活动促销"></el-input>
</el-form-item>
<el-form-item label="内容说明" prop="content">
<el-input type="textarea" v-model="templateForm.content" maxlength="600" :rows="7" show-word-limit placeholder="输入不超过600字内的文字说明"></el-input>
</el-form-item>
</el-form>
<div class="template-footer">
<el-button size="small" @click="createModel">取 消</el-button>
<el-button size="small" type="primary" :loading="createLoading" @click="handleCreate">立即创建</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'MessageModel',
data() {
return {
dialogVisible: false,
createVisible: false,
loading: false,
activeName: '1',
messageRadio: {},
modelList: [
// {
// title: '121',
// content: 'jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开',
// createdTime: '2022-01-04'
// }
],
pageNum: 1,
pageSize: 10,
tableTotal: 0,
layout: '',
searchForm: {},
templateForm: {},
templateRules: {
title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
content: [{ required: true, message: '请输入标题', trigger: 'blur' }]
},
createLoading: false,
createdList: [],
modelTitle: '创建群发模板',
userId: ''
}
},
mounted() {
if (this.$globalState) {
this.userId = this.$globalState.session.id
}
},
methods: {
init() {
this.pageNum = 1
this.messageRadio = {}
this.dialogVisible = true
this.dracImMessage()
this.getCreatedList()
},
selectModelItem() {
this.dialogVisible = false
this.$emit('selectItem', this.messageRadio)
},
handleClick() {
this.dracImMessage()
},
search() {
this.dracImMessage(this.searchForm)
},
handleClose() {
this.dialogVisible = false
this.modelList = []
this.tableTotal = 0
},
dracImMessage(searcher) {
this.modelList = []
this.loading = true
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
if (searcher) {
params.title = searcher.title
params.createdBy = searcher.createdBy
}
this.$apis.customerTransform.templatePage(params).then(res => {
console.log(res)
if (res) {
this.modelList = res.data
this.tableTotal = res.count
if (res.count > 10) {
this.layout = 'pager'
}
}
this.loading = false
})
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`)
},
handleCurrentChange(val) {
this.pageNum = val
this.dracImMessage()
console.log(`当前页: ${val}`)
},
createModel() {
this.createVisible = !this.createVisible
if (!this.createVisible) {
this.templateForm = {}
}
},
handleCreate() {
this.$refs.templateForm.validate(valid => {
if (valid) {
console.log(this.templateForm)
this.createLoading = true
const params = {
title: this.templateForm.title,
content: this.templateForm.content
}
let api = 'templateSave'
if (this.templateForm.id) {
api = 'templateUpdate'
params.id = this.templateForm.id
}
console.log(params)
this.$apis.customerTransform[api](params).then(res => {
console.log(res)
this.createLoading = false
if (res) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.pageNum = 1
this.createModel()
this.dracImMessage()
}
})
}
})
},
editModel(id) {
this.createModel()
this.modelTitle = '编辑群发模板'
this.getTemplateDetail(id)
},
getCreatedList() {
this.$apis.customerTransform.createdNameList({}).then(res => {
this.createdList = res
})
},
getTemplateDetail(id) {
this.$apis.customerTransform.templateDetail({ id }).then(res => {
console.log(res)
if (res) {
this.templateForm = res
}
})
}
}
}
</script>
<style lang="scss" scoped>
.model-panel {
padding: 0 20px;
.model-panel-tab {
display: flex;
align-items: center;
margin-bottom: 18px;
label {
font-size: 16px;
font-weight: 400;
color: #000000;
line-height: 24px;
}
/deep/ {
.el-checkbox:last-of-type {
margin-right: 8px;
}
.el-tabs__nav {
border: 0;
}
.el-tabs__header {
border: 0;
background-color: #f4f6fc;
margin: 0px;
}
.el-tabs__item {
border: none;
width: 180px;
height: 32px;
line-height: 32px;
margin: 2px;
text-align: center;
}
.el-tabs__item.is-active {
background-color: #fff;
border-radius: 4px;
}
}
}
.model-item-panel {
max-height: 400px;
overflow: auto;
> img {
display: block;
margin: 50px auto 0px;
width: 60px;
height: auto;
}
.empty-item {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
.model-item {
display: flex;
padding: 20px;
border-bottom: 1px solid #e9e9e9;
&:last-child {
border-bottom: none;
}
&-radio {
width: 60px;
/deep/ {
.el-radio__input {
margin-top: 10px;
}
.el-radio__label {
display: none;
}
}
}
&-content {
min-width: 210px;
margin-right: 50px;
.model-content {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
&-title {
flex: 1;
.model-title-h1 {
font-size: 14px;
font-weight: 400;
max-width: 658px;
color: #333333;
line-height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.model-title-h2 {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
max-width: 658px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
&-btn {
width: 30px;
height: 40px;
}
}
}
}
.message-form .el-form-item {
margin-bottom: 0 !important;
}
/deep/ .el-pager {
height: 30px;
}
.el-pagination {
margin-top: 21px;
}
.templateForm {
padding: 0 20px;
/deep/ {
.el-textarea__inner {
background-color: #fff;
}
.el-textarea .el-input__count {
background-color: #fff;
}
}
}
.template-footer {
text-align: center;
border-top: 1px solid #e6e6e6;
padding-top: 16px;
margin-bottom: -14px;
}
/deep/ {
.el-dialog__body {
padding: 30px 0;
}
}
</style>
<template>
<div class="member-wrapper">
<div class="member-left">
<!-- <div class="member-title">
预选
<span>仅筛选有外部客户联系人的成员</span>
</div> -->
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="所在门店/部门" style="margin-bottom: 0;">
<el-popover ref="popover" placement="bottom" width="215" trigger="click" v-model="popoverVisible" @show="onShowPopover" @hide="onHidePopover">
<el-tree class="select-tree" :data="treeData" :props="defaultProps" default-expand-all @node-click="handleNodeClick"></el-tree>
<el-input v-model="searchForm.department" slot="reference" :size="size" readonly placeholder="请选择所在门店/部门" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" @keyup.enter.native="search"></el-input>
</el-popover>
</el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0;">
<el-input :size="size" v-model.trim="searchForm.name" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item style="margin-bottom: 0;padding-top: 1px;">
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
</el-form>
<div class="table-content" style="max-height: 456px;">
<GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @row-click="rowClick">
<div slot="radio" slot-scope="scope">
<el-radio :disabled="scope.scope.isOperationConfig == 0" v-model="selectPerson" :label="scope.scope">&nbsp;</el-radio>
</div>
<div slot="staffName" slot-scope="scope">
<span>{{ scope.scope.staffName }}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div>
</GLTable>
</div>
</div>
<div class="member-checked">
<div class="name">
已选择:{{ selectPerson && selectPerson.staffName }}
<span v-if="selectPerson && selectPerson.staffTitle" style="font-size:12px;">|&nbsp;{{ selectPerson && selectPerson.staffTitle }}</span>
</div>
<el-checkbox v-model="checked" @change="checkChange">仅看跟进专员</el-checkbox>
</div>
</div>
<!-- <div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">成员名称({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div> -->
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectMember',
props: ['selectData'],
data() {
return {
url: url,
size: 'small',
selectPerson: null,
searchForm: {},
checked: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// // 多选ref的名称
// mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '',
prop: 'radio',
addHtml: 'radio',
width: '50'
},
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerName',
formatter: cellValue => {
return cellValue.followerName ? cellValue.followerName : '-'
}
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: []
}
},
mounted() {
console.log(123456)
this.listDepartmentTree(false)
},
methods: {
selectionTable(val) {
console.log(456)
this.innerTags = val
// this.$emit('selectTable', val)
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
listDepartmentTree(isFollowerStaff) {
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = true
params.isFollowerStaff = isFollowerStaff
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
console.log(res)
this.loading = false
if (res) {
this.tableEmpData = this.getEmployee(res)
this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res)
this.treeData = res
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
if (this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
handleNodeClick(data) {
console.log(data)
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.tableEmpData = []
const data = this.currentTreeData
const keyword = this.searchForm.name
let arr = []
// this.loading = true
console.log(keyword, data, this.tableEmpData)
if (data instanceof Array) {
if (keyword) {
data.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
console.log(this.allTreeData, '---')
this.tableEmpData = this.allTreeData
}
} else if (data instanceof Object) {
if (data.entmicroStaffResponses) {
if (keyword) {
data.entmicroStaffResponses.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
this.tableEmpData = this.tableEmpData.concat(data.entmicroStaffResponses)
}
}
if (data.children) {
data.children.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
if (keyword) {
if (j.staffName.indexOf(keyword) != -1) {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
} else {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
})
}
})
}
}
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
// this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
if (row.isOperationConfig === 0) return
this.selectPerson = row
},
checkChange(val) {
console.log(val)
this.searchForm = {}
this.listDepartmentTree(val)
}
}
}
</script>
<style lang="scss" scoped>
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 600;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-size: 500;
}
}
.member-left {
width: 800px;
.member-content {
.member-form {
padding: 16px 0;
/deep/ .el-input__inner {
height: 32px;
}
/deep/.el-button--primary {
padding: 8px 20px;
}
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
}
.member-checked {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-top: 12px;
.name {
display: flex;
align-items: center;
color: #5850ff;
}
/deep/ .el-checkbox__label {
font-size: 14px;
color: #333333;
}
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
</style>
<template>
<div class="w-textarea" ref="wTextarea">
<div contenteditable="true" class="w-textarea_input" ref="wTextareaContent" :id="contentId" @click="inputClick($event)" @focus="onFocus" @blur="onBlur" @keydown.delete="handleDelete($event)" @input="handleInput($event.target)"></div>
<!-- <div class="w-textarea_tools" v-if="tools.length > 0 || maxlength">
<button
class="w-textarea_tools__item"
v-for="item in tools"
:key="item.type"
@click="openTagDialog(item.type)"
>{{item.text}}</button>
<span
:class="['w-textarea_tools__text',
count.num < 0 ? '__danger' : '']"
v-if="maxlength"
>{{count.text}}</span>
</div>-->
<!-- <div class="w-textarea_dialog">
<slot></slot>
</div>-->
</div>
</template>
<script>
import emoji from '@/util/emo'
export default {
name: 'wTextarea',
data() {
return {
// 记录currentText以计算长度
currentText: this.value,
// 为input区域生成随机id,当在页面上有多个组件时,用于监听光标的变化
contentId: `content${this.getGuid()}`,
// 输入的时候锁定,禁止更新innerHTML
isLocked: false,
isInsert: false,
// 记录当前选中tag的ID
currentTagId: null,
// 当前光标位置
savedRange: {}
}
},
props: {
value: {
type: String,
default: ''
},
tag: {
// 自定义模版标签的标签名
type: String,
// 默认使用wise作为标签名,并添加了默认样式
// 当使用其他标签名的时候,需要另写标签样式
default: 'wise'
},
tools: {
// 自定义扩展功能:超链接'link',模版标签'tag'
type: Array,
default() {
return [
{ type: 'link', text: '添加超链接' },
{ type: 'tag', text: '添加模版标签' }
]
}
},
maxlength: {
// 最大输入长度
type: [String, Number],
default: ''
}
},
computed: {
count() {
// 字符长度记数
let num = this.maxlength - this.currentText.length
let text = num < 0 ? `已超出${Math.abs(num)}个字符` : `还可以输入${num}个字符`
return { num, text }
}
},
mounted() {
// 初始化数据
this.currentText && (this.$refs.wTextareaContent.innerHTML = this.currentText)
// 创建模版标签的style
this.createStyle()
// 每次光标变化的时候,保存 range
document.addEventListener('selectionchange', this.selectHandler)
},
beforeDestroy() {
// 卸载事件
document.removeEventListener('selectionchange', this.selectHandler)
},
methods: {
updateData(text) {
this.$emit('input', text)
},
createStyle() {
// 为自定义的模版标签添加样式,使之不可编辑
let style = document.createElement('style')
style.innerHTML = `.w-textarea ${this.tag} {
cursor: default;
-webkit-user-modify: read-only !important;
}`
this.$refs.wTextarea.appendChild(style)
},
closeModal() {
this.form.text = ''
this.showModal = false
},
openTagDialog(type) {
// if (addLink)
// 将事件抛给父组件处理
// 处理后需要调用 addTag() 或者 addLink() 将内容传回来
this.$emit('add', type)
},
addTag(text) {
// 创建模版标签
let node = document.createElement(this.tag)
if (navigator.userAgent.indexOf('Firefox') > 0) {
node.setAttribute('contenteditable', 'false')
}
node.innerText = text
// 添加id便于删除
node.id = this.getGuid()
this.insertNode(node)
let textarea = document.getElementsByClassName('w-textarea_input')
},
addCardLink() {
let span = document.createElement('span')
// span.id = this.getGuid()
// span.setAttribute('style', '-webkit-user-modify: read-only !important;')
let text = '车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
if (this.value) text = '<br>' + text
span.innerHTML = text
this.insertNode(span)
},
addNode() {
let target = this.$refs.wTextareaContent
this.updateData(target.innerHTML)
},
promiseAdd(item, num) {
return new Promise((resolve, reject) => {
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML += item
document.querySelector('.w-textarea_input').focus()
resolve()
}, num * 100)
})
},
promiseAddNode(item, num) {
return new Promise((resolve, reject) => {
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML += item
document.querySelector('.w-textarea_input').focus()
resolve()
}, num * 100)
})
},
addContent(attContent) {
attContent.forEach(async (item, index) => {
await this.promiseAdd(item, index)
this.addTag('@昵称')
// await this.promiseAddNode(item, index)
// this.addNode()
// t2(item)
})
// for (let i = 0; i < attContent.length; i++) {
// if (attContent[i] || (i == 0 && !attContent[i])) {
// document.querySelector('.w-textarea_input').innerHTML += attContent[i]
// document.querySelector('.w-textarea_input').focus()
// document.querySelector('.w-textarea_input').click()
// this.$nextTick(()=>{
// this.addTag('@昵称')
// })
// }
// // 代码格式
// // (function(a) {})(b)
// }
},
addLink(text, url) {
// 创建a标签
let node = document.createElement('a')
node.innerText = text
node.href = url
node.target = 'blank'
this.insertNode(node)
},
addImg(url) {
// 创建a标签
let node = document.createElement('img')
node.src = url
// node.setAttribute('ondragstart', 'return false;')
this.insertNode(node)
},
onFocus() {
this.isLocked = true
this.isInsert = true
},
onBlur() {
this.isLocked = false
},
insertNode(node) {
// 在内容中插入标签
// 删掉选中的内容(如有)
if (this.savedRange.startContainer) {
this.insertNodeFirst(node)
} else {
document.querySelector('.w-textarea_input').focus()
setTimeout(() => {
this.insertNodeFirst(node)
document.querySelector('.w-textarea_input').blur()
}, 100)
}
},
insertNodeFirst(node) {
this.savedRange.deleteContents()
// 插入链接
if (this.isInsert) {
this.savedRange.insertNode(node)
} else {
document.querySelector('.w-textarea_input').appendChild(node)
}
this.isInsert = false
// 更新双向绑定数据
let target = this.$refs.wTextareaContent
if (navigator.userAgent.indexOf('Firefox') > 0 || navigator.userAgent.indexOf('QQBrowser') > 0) {
this.updateData(target.innerHTML + '&nbsp;')
} else {
this.updateData(target.innerHTML)
}
let htm = target.innerHTML
const list = emoji.flat(Infinity)
const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText.substring(0, 600)
this.$emit('updateText', this.currentText)
},
placeCaretAtEnd(el) {
//传入光标要去的jq节点对象
el.focus()
if (typeof window.getSelection != 'undefined' && typeof document.createRange != 'undefined') {
var range = document.createRange()
range.selectNodeContents(el)
range.collapse(false)
var sel = window.getSelection()
sel.removeAllRanges()
sel.addRange(range)
} else if (typeof document.body.createTextRange != 'undefined') {
var textRange = document.body.createTextRange()
textRange.moveToElementText(el)
textRange.collapse(false)
textRange.select()
}
},
handleInput(target) {
// 即时更新数据
this.updateData(target.innerHTML)
let htm = target.innerHTML
const list = emoji.flat(Infinity)
const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText.substring(0, 600)
this.$emit('updateText', this.currentText)
},
handleDelete(e) {
// 监听“删除”事件
if (this.currentTagId) {
// 若已选中模版标签,直接删除dom节点
let t = document.getElementById(this.currentTagId)
this.$refs.wTextareaContent.removeChild(t)
this.currentTagId = null
// 阻止浏览器默认的删除事件,并手动更新数据
e.preventDefault()
this.handleInput(e.target)
}
},
inputClick(e) {
// 监听点击事件
this.isLocked = true
const TAG_NAME = e.target.nodeName
if (TAG_NAME === this.tag.toUpperCase()) {
// 点击模版标签时,记录id
this.currentTagId = e.target.id
e.target.className = 'active'
} else if (this.currentTagId) {
// 清空active样式
let target = document.getElementById(this.currentTagId)
target.className = ''
this.currentTagId = null
} else {
this.currentTagId = null
}
},
getGuid() {
// 生成随机ID
return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}`
},
selectHandler() {
// 监听选定文本的变动
let sel = window.getSelection()
let range = sel.rangeCount > 0 ? sel.getRangeAt(0) : null
if (range && range.commonAncestorContainer.ownerDocument.activeElement.id === this.contentId) {
this.savedRange = range
}
}
},
watch: {
value(val) {
// 非锁定状态下,实时更新innerHTML
if (val == '<span><br></span>') {
this.$refs.wTextareaContent.innerHTML = ''
this.value = ''
}
if (!this.isLocked) {
this.$refs.wTextareaContent.innerHTML = val
}
}
}
}
</script>
<style lang="scss">
// 给标签默认样式,不可scoped
.w-textarea {
wise {
border-radius: 2px;
background-color: #fff;
font-size: 14px;
color: #5850ff;
line-height: 20px;
padding: 2px;
margin: 0 5px;
color: #26a2ff;
// padding: 0 1px;
white-space: nowrap;
cursor: default;
-webkit-user-modify: read-only !important;
}
img {
width: 24px;
height: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
}
.active {
background: #dcdfe6;
}
}
</style>
<style lang="scss" scoped>
$borderColor: #dcdfe6;
$bgColor: #f5f7fa;
$textColor: #666;
.w-textarea {
width: 100%;
box-sizing: border-box;
// border-radius: 4px;
border: 1px solid $borderColor;
overflow: hidden;
min-height: 200px;
// margin-bottom: 15px;
overflow: hidden;
position: relative;
&_input {
width: 100%;
height: 200px;
max-height: 320px;
overflow-y: auto;
box-sizing: border-box;
padding: 10px;
line-height: 1.5;
word-break: break-word;
// 允许编辑,禁止富文本
-webkit-user-modify: read-write-plaintext-only !important;
&:focus {
outline: none;
}
}
&_tools {
padding: 0 10px;
height: 40px;
line-height: 40px;
border-top: 1px solid $borderColor;
background-color: $bgColor;
color: $textColor;
font-size: 12px;
&__item {
display: inline-block;
line-height: 1;
padding: 5px 8px;
margin-right: 8px;
color: $textColor;
cursor: pointer;
border: 1px solid $borderColor;
border-radius: 4px;
background: #fff;
transition: all 0.3s;
&:hover {
background: $bgColor;
opacity: 0.7;
}
&:focus {
outline: none;
}
}
&__text {
display: inline-block;
line-height: 40px;
padding: 0 8px;
float: right;
color: $textColor;
cursor: default;
transition: all 0.3s;
&:hover {
opacity: 1;
}
&.__danger {
color: red;
}
}
}
}
</style>
<template>
<div class="welcome-box">
<!-- <div class="required">入群欢迎语</div> -->
<div class="content">
<div class="content-bg">
<!-- <div id="nick" contenteditable="false" class="nickname">
@昵称
<i class="el-icon-error"></i>
</div>-->
<!-- <div id="toolbar-container" style="display: none;"></div>
<div id="text-container" class="editor-container"></div>-->
<wTextarea ref="textContent" v-model="textValue" @updateText="updateText"></wTextarea>
<!-- <el-input
type="textarea"
:rows="9"
maxlength="600"
show-word-limit
v-model="guestForm.name"
@input="textInput"
style="-webkit-user-modify: read-write-plaintext-only !important;"
placeholder="请输入内容"
></el-input>-->
<div v-for="(itm, index) in previewList" :key="itm.id">
<div class="welcome-file" v-if="itm.attType != 1">
<template v-if="itm.attType == 2">
<i v-show="index == previewList.length - 1 && loading" class="el-icon-loading"></i>
<img v-show="!loading" src="@/assets/guestCustom/icon-img.png" alt />
<span :title="itm.attContent">{{ itm.attContent }}</span>
</template>
<template v-else-if="itm.attType == 3">
<img src="@/assets/guestCustom/icon-img.png" alt />
<span :title="itm.attContent">{{ itm.attContent }}</span>
</template>
<template v-else-if="itm.attType == 7">
<img src="@/assets/guestCustom/icon-applet.png" alt />
<span :title="itm.attContent.marketingName">{{ itm.attContent.marketingName }}</span>
</template>
<template v-else-if="itm.attType == 5">
<img src="@/assets/guestCustom/icon-applet.png" alt />
<span :title="itm.attContent.title">{{ itm.attContent.title }}</span>
</template>
<i class="el-icon-circle-close" @click="close(index)"></i>
</div>
</div>
<div class="btn-group">
<div class="add-btn" v-for="item in btnList" :key="item.id">
<!-- <i class="el-icon-circle-plus-outline"></i> -->
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" alt v-if="item.id == 1" @click="selectEmotion" />
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" v-else alt />
<span v-if="item.id == 1" @click.stop="selectEmotion">{{ item.name }}</span>
<span v-else>{{ item.name }}</span>
<input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" />
<input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" />
<el-link v-else-if="item.type == 'link' || item.type == 'nickname' || item.type == 'acivity'" style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link>
</div>
</div>
</div>
<div v-show="emotionStatus" class="emotion-panel">
<emotion class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion>
</div>
<!-- <div class="tips-text">
<p>当「精品升级」小程序提交升级订单时,</p>
<p>
客户扫描订单质保码添加
<span style="color:#409eff">&nbsp;待选择</span>
,
</p>
<p>客户添加成功自动推送欢迎语,建议插入质保链接。</p>
</div> -->
</div>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
<MessageModel ref="message" @selectItem="selectMessage"></MessageModel>
</div>
</template>
<script>
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7
}
import emoji from '@/util/emo'
import ActivityModel from './activityModel'
import MessageModel from './messageModel'
import Emotion from './emotionWords'
import wTextarea from './tag-textarea'
import { utils } from 'glsx-common'
import { pictureUpload } from '@/api/modules/common'
export default {
name: 'WelcomeWords',
components: {
ActivityModel,
Emotion,
wTextarea,
MessageModel
},
props: { eventBus: Object, btnList: Array, form: String },
data() {
return {
loading: false,
emotionStatus: false,
// btnList: [
// {
// id: 1,
// name: '表情',
// funcName: '',
// type: 'expression',
// limitSize: 10
// },
// {
// id: 2,
// name: '图片',
// funcName: '',
// type: 'img',
// limitSize: 10
// },
// {
// id: 3,
// name: '昵称',
// type: 'nickname',
// funName: 'nickname'
// },
// {
// id: 4,
// name: '活动',
// type: 'acivity',
// funName: 'activity'
// }
// ],
guestForm: {},
previewList: [],
sendType: '',
sendTime: '',
sendDate: '',
editor: {},
textValue: ''
}
},
mounted() {
// const _this = this
// this.editor = new E('#toolbar-container', '#text-container')
// this.editor.config.zIndex = 100
// this.editor.config.height = 165
// this.editor.config.colors = ['#000000', '#f7f7f7']
// this.editor.config.focus = false
// this.editor.config.onchange = function(newHtml) {
// console.log('change 之后最新的 html', newHtml)
// console.log(_this.editor.txt.text())
// const val = _this.editor.txt.text()
// _this.textInput(val)
// }
// this.editor.config.onchangeTimeout = 500
// this.editor.create()
this.eventBus.$emit('update', this.previewList)
},
methods: {
setDetail(list) {
list.forEach(item => {
if (item.attType == 1) {
this.setTextarea(item.attContent)
} else {
if (item.attType == 7) {
item.attContent = JSON.parse(item.attContent)
}
this.previewList.push(item)
}
})
},
setTextarea(val) {
// let val = '[鄙视]@昵称@昵称[鄙视][做哼][ ]车主朋友,您好!我是您的福利官,欢迎您领取电子质保卡,请点击下方链接进行领取及查看:https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/祝您用车愉快!'
let reg1 = /\[(.+?)\]/gi
let arr = val.match(reg1) || []
const list = emoji.flat(Infinity)
arr.forEach(item => {
let str = item.slice(1, item.length - 1)
if (list.indexOf(str) > -1) {
let index = list.indexOf(str) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let img = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
val = val.replaceAll(item, img)
}
})
val = val.replaceAll('@昵称', '<wise>@昵称</wise>')
let welcomeStr = '车主朋友,您好!我是您的福利官,欢迎您领取电子质保卡,请点击下方链接进行领取及查看:https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/祝您用车愉快!'
let text = '<br>车主朋友,您好!<br>我是您的福利官,欢迎您领取电子质保卡,<br>请点击下方链接进行领取及查看:<br><span style="color:#409eff;">https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/</span><br>祝您用车愉快!<br>'
val = val.replaceAll(welcomeStr, text)
let span = document.createElement('span')
if (val && val.indexOf('<br>') == 0) {
val = val.substring(4)
}
span.innerHTML = val
this.$refs.textContent.insertNode(span)
},
selectEmotion() {
this.emotionStatus = !this.emotionStatus
},
handleEmotion(i) {
this.emotionStatus = false
const list = emoji.flat(Infinity)
let index = list.indexOf(i) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`)
},
updateText(val) {
this.textInput(val)
},
// 上传图片
handleImgChange(e, targetItem) {
const imgList = this.previewList.filter(item=>{
return item.attType == 2
})
if(imgList.length==9){
this.$message.error('最多只能上传9张图片!')
document.querySelector('.upload-img').value = ''
return;
}
var reader = new FileReader()
var file = e.srcElement.files[0]
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
document.querySelector('.upload-img').value = ''
return true
}
this.loading = true
reader.readAsDataURL(file)
this.previewList.push({
attType: ATT_TYPE.IMAGE,
attContent: ''
})
reader.onload = e => {
var image = new Image()
image.src = e.target.result
image.onload = () => {
const imgFile = e.target.result
let name = file.name.split('.')
const base64 = name[name.length-1] + '@' + imgFile.split(',')[1]
pictureUpload({ file: base64 }).then(res => {
if (res) {
let len = this.previewList.length - 1
this.previewList[len].attContent = res
document.querySelector('.upload-img').value = ''
} else {
let len = this.previewList.length - 1
this.previewList.splice(len, 1)
}
this.loading = false
})
}
}
},
// 上传视频
handleVideoChange(e, targetItem) {
var file = e.srcElement.files[0]
var reader = new FileReader()
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
pictureUpload({ file: base64 }).then(res => {
if (res) {
this.previewList.push({
attType: ATT_TYPE.VEDIO,
attContent: res
})
}
})
}
},
handleFun(name) {
if (name == 'nickname') {
this.$refs.textContent.addTag('@昵称')
} else if (name == 'activity') {
this.$refs.activity.init()
} else if (name == 'message') {
this.$refs.message.init()
} else if (name == 'link') {
// 车主朋友,您好!
// 我是您的福利官,欢迎您领取电子质保卡,
// 请点击下方链接进行领取及查看:https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/祝您用车愉快!
this.$refs.textContent.addCardLink('@昵称')
}
},
close(index) {
this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList)
},
textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1)
if (val) {
if (hasText) {
this.$set(this.previewList, 0, {
attContent: val,
attType: ATT_TYPE.TEXT
})
} else {
this.previewList.unshift({
attContent: val,
attType: ATT_TYPE.TEXT
})
}
} else {
this.previewList.shift(0)
}
},
selectActivity(val) {
let idx
const hasActivity = this.previewList.some((item, index) => {
if (item.attType == 7) {
idx = index
return item
}
})
if (val) {
if (hasActivity) {
this.$set(this.previewList, idx, {
attContent: val,
attType: ATT_TYPE.ACTIVITY
})
} else {
this.previewList.push({
attContent: val,
attType: ATT_TYPE.ACTIVITY
})
}
}
},
selectMessage(val) {
console.log(val)
const content = val.content
this.updateText(content)
this.textValue = content
// this.previewList[0] = {
// attContent: content,
// attType: ATT_TYPE.TEXT
// }
},
insertHtmlAtCaret(html) {
var sel, range, frag
if (window.getSelection) {
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
var el = document.createElement('span')
el.innerHTML = '<span contenteditable="false" class="nickname">@昵称<i class="el-icon-error"></i></span>'
// var el = document.createElement('div')
// el.innerHTML = html
frag = document.createDocumentFragment()
var node
var lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
if (lastNode) {
range = range.cloneRange()
range.setEndAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
}
},
changeInput: utils.debounce(function() {
var allNodes = document.getElementById('editor').childNodes
var str = ''
allNodes.forEach(item => {
if (item.className == 'nickname') {
str += item.innerText
} else if (item.data) {
str += item.data
}
})
this.textInput(str)
}, 300),
updateList(val) {
console.log(val)
this.previewList = val
this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1)
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
document.querySelector('.w-textarea_input').focus()
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
}, 100)
}
}
}
</script>
<style lang="scss" scoped>
/deep/.w-textarea_input {
background-color: #fff;
}
.welcome-box {
}
.emotion-panel {
position: relative;
height: 0px;
&-box {
position: absolute;
top: -320px;
}
}
.content-bg {
background-color: #f7f7f7;
}
.content {
display: inline-block;
vertical-align: text-top;
// width: calc(100% - 103px);
width: 640px;
// margin-left: 12px;
.welcome-file {
display: flex;
align-items: center;
color: #999;
line-height: 20px;
padding: 10px;
margin-bottom: 10px;
border-left: 1px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
img {
width: 20px;
height: 20px;
margin-right: 5px;
}
span {
display: inline-block;
margin-right: 20px;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px;
}
i {
font-size: 16px;
cursor: pointer;
}
.el-icon-loading {
font-size: 24px;
}
&:last-child {
margin-bottom: 0;
}
}
.btn-group {
background-color: #fff;
padding: 6px 0 6px 20px;
border: 1px solid #dcdfe6;
border-top: 0;
.add-btn {
display: inline-flex;
position: relative;
align-items: center;
padding-right: 25px;
font-size: 16px;
color: #666;
cursor: pointer;
span {
font-size: 14px;
margin-left: 5px;
cursor: pointer;
}
input {
position: absolute;
width: 100%;
cursor: pointer;
font-size: 0;
height: 40px;
}
img {
width: 16px;
height: 16px;
cursor: pointer;
}
.el-link {
position: absolute;
width: 100%;
}
}
}
.date-picker {
margin-top: 10px;
font-size: 14px;
color: #999;
}
}
.required {
display: inline-block;
line-height: 40px;
text-align: right;
width: 90px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4 px;
}
.form-tips {
font-size: 12px;
color: #999;
}
.form-upload {
position: absolute;
top: 0;
width: 140px;
// width: 100%;
height: 100%;
cursor: pointer;
z-index: 1;
}
/deep/ {
.el-textarea__inner {
background-color: #f7f7f7;
border-radius: 0;
}
.el-textarea__inner:focus {
border-color: #dcdfe6;
}
.el-textarea .el-input__count {
background-color: #f7f7f7;
}
}
.upload {
position: relative;
}
.upload-bg {
position: relative;
width: 140px;
height: 140px;
background-color: #f7f7f7;
color: #999;
border: 1px dashed #dcdfe6;
i {
position: absolute;
top: 40px;
left: 50%;
transform: translateX(-50%);
font-size: 30px;
}
.upload-text {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
font-size: 12px;
}
}
.tips-text {
margin-top: 8px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 24px;
}
// .tips-text {
// display: flex;
// align-items: center;
// justify-self: center;
// color: #000;
// font-size: 14px;
// padding: 0 16px;
// margin-top: 10px;
// background-color: rgba(230, 233, 255, 0.49);
// border: 1px solid rgba(88, 80, 255, 0.49);
// border-radius: 4px;
// .tips-icon {
// width: 14px;
// height: 14px;
// margin-right: 8px;
// }
// }
// 编辑器
.editor-container {
border: 1px solid #dcdfe6;
min-height: 165px;
/deep/ {
.w-e-text {
background-color: #f7f7f7;
}
}
}
.text-editor {
outline: 0;
width: 100%;
min-height: 200px;
max-height: 200px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
padding: 5px;
line-height: 20px;
font-size: 12px;
word-wrap: break-word;
overflow-x: hidden;
overflow-y: auto;
_overflow-y: visible;
}
/deep/.nickname {
display: inline;
// width: 64px;
// height: 20px;
border-radius: 2px;
background-color: #fff;
font-size: 14px;
color: #5850ff;
line-height: 20px;
padding: 2px;
margin: 0 5px;
i {
font-size: 10px;
}
}
</style>
<template>
<div class="expert-detail">
<div class="header">
<span class="title">基础信息</span>
<span class="tip">该配置页面用于配置「精品升级」小程序质保卡客户拉新,配置订单类型后,客户扫码质保卡活码即可添加员工企微号。</span>
</div>
<div class="detail-wrap">
<el-form class="form" ref="form" :model="basicForm" label-width="112px">
<el-form-item label="客户类型:">
<span class="client">{{ clientType }}</span>
</el-form-item>
<el-form-item required label="轻改专家:">
<span v-if="selectPerson && selectPerson.staffName" class="tag-info">
<i class="el-icon-user-solid person"></i>
<span class="client name">{{ selectPerson && selectPerson.staffName }}</span>
<i class="el-icon-close del" @click="delPerson"></i>
</span>
<el-button class="checkNumber" v-else size="small" icon="el-icon-plus" @click="openMembers">
选择成员
</el-button>
<span v-if="selectPerson && selectPerson.departmentName" class="depart-name">{{ selectPerson && selectPerson.departmentName }}</span>
</el-form-item>
<el-form-item label="欢迎语:">
<!-- <label slot="label" class="required">群发内容</label> -->
<WelcomeWords ref="welcome" :btnList="btnList" :eventBus="eventBus"></WelcomeWords>
<div class="tips-text">
<p>当「精品升级」小程序提交升级订单时,</p>
<p>
客户扫描订单质保码添加
<span style="color:#409eff">{{ ' ' }}{{ (selectPerson && selectPerson.staffName) || '待选择' }}</span>
,
</p>
<p>客户添加成功自动推送欢迎语,建议插入质保链接。</p>
</div>
</el-form-item>
</el-form>
</div>
<glsx-dialog class="numberDialog" :title="'选择成员'" btnSize="small" :width="'850px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible">
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"></SelectMember>
</glsx-dialog>
<div class="my-footer btn-box box">
<el-button size="small" type="primary" @click="handleSave">提交</el-button>
<el-button type="default" size="small" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import Vue from 'vue'
import emoji from '@/util/emo'
import WelcomeWords from './components/welcomeWords.vue'
import SelectMember from './components/selectMember.vue'
import glsxDialog from '@/components/glsx-dialog/index.vue'
// import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'expert_detail',
components: {
WelcomeWords,
SelectMember,
glsxDialog
},
data() {
return {
size: 'small',
eventBus: new Vue(),
clientType: '升级客户',
expertId: '',
btnList: [
{
id: 1,
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
id: 2,
name: '图片',
funcName: '',
type: 'img',
limitSize: 10
},
{
id: 3,
name: '昵称',
type: 'nickname',
funName: 'nickname'
},
{
id: 4,
name: '活动',
type: 'acivity',
funName: 'activity'
}
// {
// id: 5,
// name: '模板',
// type: 'nickname',
// funName: 'message'
// },
// {
// id: 6,
// name: '插入质保链接',
// type: 'link',
// funName: 'link'
// }
],
membersVisible: false,
selectData: [],
basicForm: {},
selectPerson: null,
numberTypeList: []
}
},
mounted() {
const urlParam = this.$route.params
let param = JSON.parse(urlParam.id)
this.clientType = param.clientType
if (this.clientType == '升级客户') {
let obj = {
id: 6,
name: '插入质保链接',
type: 'link',
funName: 'link'
}
this.btnList.push(obj)
}
if (param.expertId) {
this.expertId = param.expertId
this.getDetail(param.expertId)
}
this.getTypeList()
},
methods: {
getTypeList() {
this.$apis.expert.getMenberType({ dictType: 'operation_type' }).then(res => {
if (res) {
this.numberTypeList = res
}
})
},
getDetail(id) {
this.$apis.expert.expertDetail({ id }).then(res => {
if (res?.id) {
this.selectPerson = res
this.$refs.welcome.setDetail(res.welcomeInfo)
this.clientType = res.businessTypeName
}
})
},
delPerson() {
this.selectPerson = null
},
// 成员弹窗
handleConfirm() {
if (this.$refs.membersForm.selectPerson) {
this.selectPerson = this.$refs.membersForm.selectPerson
this.openMembers()
} else {
this.$message({
type: 'error',
message: '请选择成员'
})
}
},
openMembers() {
this.membersVisible = !this.membersVisible
},
edit() {
this.$apis.expert.editExpert().then(res => {
if (res) {
this.$router.push({
path: '/expert/index'
})
}
})
},
handleSave() {
if (!this.selectPerson?.staffId) {
return this.$message.error('请选择轻改专家')
}
let preList = [...this.$refs.welcome.previewList]
preList.forEach(item => {
if(item.attType ==1 && !item.attContent.trim()){
item.attContent = '\n'
}
if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
}
})
const typeItem = preList.find(item=>{
return item.attType ==1
})
if(!typeItem){
preList.unshift({attType:'1',attContent:'\n'})
}
const targetItem = this.numberTypeList.find(item => {
return item.dictLabel == this.clientType
})
let params = {
businessType: targetItem.dictValue,
staffId: this.selectPerson.staffId,
// welcomeInfo: this.$refs.welcome.previewList
welcomeInfo: preList
}
let API = this.expertId ? this.$apis.expert.editExpert : this.$apis.expert.saveExpert
if (this.expertId) params.id = this.expertId
API(params).then(res => {
if (res) {
this.$message({
type: 'success',
message: '提交成功'
})
this.$router.push({
path: '/expert/index'
})
}
})
},
handleCancel() {
this.$router.push({
path: '/expert/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.expert-detail {
background-color: #fff;
min-height: calc(100vh - 144px);
margin-bottom: 64px;
/deep/ .checkNumber {
padding: 8px 12px;
& > span {
margin-left: 4px;
}
}
.numberDialog {
/deep/ .el-dialog__header {
height: 56px;
padding: 0 20px;
line-height: 56px;
font-size: 18px;
font-weight: 600;
color: #000000;
.el-dialog__headerbtn {
top: 17px;
}
}
/deep/ .el-dialog__body {
padding-top: 0;
}
/deep/ .el-dialog__footer > div {
display: flex;
flex-direction: row-reverse;
.el-button:first-child {
margin-left: 16px;
}
}
}
.header {
height: 56px;
font-size: 16px;
color: #333;
font-weight: 600;
border-bottom: 1px solid #d8d8d8;
line-height: 56px;
padding: 0 24px;
.tip {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
margin-left: 8px;
}
}
.detail-wrap {
padding: 32px 20px;
min-height: 520px;
.client {
color: #333;
}
.tag-info {
display: inline-block;
border: 1px solid #e8e8ea !important;
border-radius: 4px;
min-width: 78px;
padding: 0 8px;
height: 28px;
line-height: 28px;
text-align: center;
.name {
margin: 0 5px;
}
.person {
color: #75acff;
}
.del {
cursor: pointer;
}
}
.depart-name {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 20px;
margin-left: 8px;
}
.form {
/deep/.el-form-item {
&:nth-child(-n+2){
height: 36px;
}
// height: 36px;
line-height: 36px;
margin-bottom: 20px;
& > .el-form-item__label {
padding: 0;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
}
}
}
.tips-text {
margin-top: 8px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 24px;
}
}
}
</style>
<template>
<div class="expert-container">
<div v-if="userType != 2">
<div class="btn-area">
<GLButton id="clientBtn" :size="size" fn="新增配置" type="primary" @click.stop="addConfig('top')">
新增配置
<i class="el-icon-arrow-down"></i>
</GLButton>
<ul v-if="showClientType" class="client">
<li v-for="item in numberTypeList" :key="item.dictValue" @click.stop="selectClientType(item.dictLabel)">{{ item.dictLabel }}</li>
</ul>
</div>
<span class="btnTip">配置门店轻改专家,形成业务活码,客户可通过「精品升级」订单扫码来添加该员工。</span>
</div>
<div class="expert-wrap">
<glsx-combi-form ref="expertRef" labelWidth="112px" defaultWidth="215px" :formObj="batchListSearch" :formData="expertForm">
<div slot="department">
<el-cascader clearable popper-class="expert-cascader" ref="cascaderRef" @change="getCurDepartment" placeholder="请选择门店" :show-all-levels="false" v-model="batchListSearch.departmentId" :props="mypropParam1" :options="departmentList" size="small" style="width: 215px" separator=" " filterable>
<template slot-scope="{ data }">
<el-tooltip popper-class="myToolTipClass" style="border: none" :disabled="data.departmentName.length > 12 ? false : true" class="item" effect="light" :content="data.departmentName" placement="top-end">
<div class="limitText" style="width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ data.departmentName }}</div>
</el-tooltip>
</template>
</el-cascader>
</div>
<span slot="footer" class="footer-btns" style="display: inline-flex;padding-top: 1px;margin-bottom:20px;">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" class="resetBtn" @click="handleReset">重置</el-button>
</span>
</glsx-combi-form>
<div>
<GLTable :noDataImg="url" :class="[{ hasDataTable: !hasData }]" ref="expertTable" :hasNum="false" :pageConf="batchPageConf" :searchForm="batchListSearch" :tableParams="batchTableParams" :getListApi="getListApi">
<span slot="status" slot-scope="scope">
<!-- <el-switch :value="scope.scope.status == 0" active-color="#5850ff" inactive-color="#eee" @change="changStatus(scope.scope.status, scope.scope.id)"></el-switch>
{{ scope.scope.status == 0 ? '启用' : '停用' }} -->
<GLButton v-if="userType != 2" class="switch" mode="el-switch" fn="禁用" :value="scope.scope.status == 0" active-color="#5850ff" inactive-color="#eee" :active-text="scope.scope.status == 0 ? '启用' : '停用'" @change="changStatus(scope.scope.status, scope.scope.id)">{{ scope.scope.status == 0 ? '启用' : '停用' }}</GLButton>
</span>
<div class="table-btns" slot="table-btns" slot-scope="scope">
<GLButton v-if="userType != 2" fn="编辑" type="text" @click="selectClientType(scope.scope.businessTypeName, scope.scope.id)">编辑</GLButton>
<GLButton v-if="userType != 2" fn="删除" type="text" @click="handleDel(scope.scope)">删除</GLButton>
</div>
</GLTable>
<div v-if="!hasData" class="default-box">
<img class="default-img" :src="imagBaseURL + 'serviceser.png'" alt="" />
<span class="tip">用于「精品升级」客户线上化,配置轻改专家成员,可通过精品升级的质保卡活码拉新。</span>
<div v-if="userType != 2" class="btn-area my-search-btn">
<GLButton id="clientBtn" plain :size="size" fn="新增配置" type="primary" @click.stop="addConfig('center')">
新增配置
<i class="el-icon-arrow-down"></i>
</GLButton>
<ul v-if="showCenterClientType" class="client">
<li v-for="item in numberTypeList" :key="item.dictValue" @click.stop="selectClientType(item.dictLabel)">{{ item.dictLabel }}</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
const imagBaseURL = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/'
// import imagBaseURL from '@/assets/notExpert.png'
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
import url from '@/assets/empty.png'
export default {
name: 'expert_index',
data() {
return {
userType: 1,
url,
imagBaseURL,
shopName: '',
departmentList: [],
mypropParam1: {
label: 'departmentName',
value: 'id',
children: 'children',
checkStrictly: true
},
numberTypeList: [],
hasData: true,
size: 'small',
getListApi: this.$apis.expert.getExpertList,
showClientType: false,
showCenterClientType: false,
batchPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
batchListSearch: {
departmentId: '',
staffName: '',
businessType: ''
},
expertForm: [
{
label: '门店',
name: 'departmentId',
addHtml: 'department'
},
{
label: '员工',
name: 'staffName',
type: 'input',
maxlength: 15,
isClear: true
},
{
label: '客户类型',
name: 'businessType',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'memberType'
}
],
batchTableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '编号',
prop: 'stateId',
formatter: cellValue => {
return cellValue.stateId || '-'
}
},
{
label: '所属门店/部门',
prop: 'departmentName',
width: '200',
formatter: cellValue => {
return cellValue.departmentName || '-'
}
},
{
label: '员工',
prop: 'staffName',
formatter: cellValue => {
return cellValue.staffName || '-'
}
},
{
label: '客户类型',
prop: 'businessTypeName',
width: 200,
formatter: cellValue => {
return cellValue.businessTypeName || '-'
}
},
{
label: '欢迎语',
prop: 'isWelcomeWord',
width: 200,
formatter: cellValue => {
return cellValue.isWelcomeWord == -1 ? '无' : '有'
}
},
{
label: '状态',
prop: 'status',
addHtml: 'status',
width: '100'
},
{
label: '操作',
prop: '',
width: '100px',
fixed: 'right',
addHtml: 'table-btns'
}
]
}
}
},
components: {
glsxCombiForm
},
computed: {},
created() {
this.getDepartmentList()
this.isEmptyTable()
},
mounted() {
document.getElementById('app').addEventListener('click', this.setClientType)
this.getTypeList()
const { session } = this.$globalState || {}
this.userType = session.userType
},
beforeDestroy() {
document.getElementById('app').removeEventListener('click', this.setClientType)
},
methods: {
// 获取当前选择的商户
getCurDepartment(val) {
let id = val[val.length - 1]
this.batchListSearch.departmentId = id
this.$refs.cascaderRef.dropDownVisible = false
},
getTypeList() {
this.$apis.expert.getMenberType({ dictType: 'operation_type' }).then(res => {
if (res) {
this.numberTypeList = res
let targetItem = this.expertForm.find(item => {
return item.name == 'businessType'
})
let obj = { dictValue: '', dictLabel: '全部' }
targetItem.optionList = [obj, ...res]
}
})
},
handleDel({ id }) {
this.$confirm('是否确认删除?', '退单', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: 'customConfirm'
}).then(() => {
this.$apis.expert.delExpert({ id }).then(res => {
if (res) {
this.handleSearch()
this.isEmptyTable()
this.$message({
type: 'success',
message: '删除成功!'
})
}
})
})
},
isEmptyTable() {
let params = {
departmentId: '',
staffName: '',
businessType: '',
pageSize: 10,
pageNum: 1
}
this.$apis.expert.getExpertList(params).then(res => {
this.hasData = !!res?.data?.length
})
},
getDepartmentList() {
this.$apis.expert.getDepartment({ id: 1 }).then(res => {
this.departmentList = this.traverse(1, res, 'relevanceMerchant')
})
},
getMerchantList() {
this.$apis.expert.getMerchantTree({ id: 1, flag: true }).then(res => {
console.log(res)
this.shopList = this.traverse(2, res, 'relevanceMerchant')
// this.$apis.baseInfo.getDepartment({ id: 1, flag: true }).then(res => {
// this.departmentList = this.traverse(1, res, 'relevanceMerchant')
// })
})
},
traverse(type, arr, string1, string2, arr1 = []) {
arr.map(item => {
// if (item[string1] || (item[string2] != 4 && type == 2)) {
// item.disabled = true
// } else {
// item.disabled = false
// }
if (item.children && item.children instanceof Array) {
this.traverse(type, item.children, string1, string2, (arr1 = []))
}
return item
})
return arr
},
setClientType() {
if (this.showClientType) this.showClientType = false
if (this.showCenterClientType) this.showCenterClientType = false
},
changStatus(status, id) {
this.$apis.expert.editExpert({ id, status: status == 0 ? -1 : 0 }).then(res => {
if (res) {
this.handleSearch()
}
})
},
addConfig(area) {
if (area == 'top') {
this.showClientType = true
} else {
this.showCenterClientType = true
}
},
goDetail() {
this.$router.push({ path: '/expert/detail/5' })
},
selectClientType(type, id) {
this.showCenterClientType = false
this.showClientType = false
let paraFormat = {
clientType: type
}
if (id) {
paraFormat.expertId = id
}
const urlpara = JSON.stringify(paraFormat)
this.$router.push({ path: '/expert/detail/' + urlpara, query: { $title: id ? '编辑' : '新增配置' } })
},
// beforeSearchFn() {
// return new Promise((resolve, reject) => {
// this.batchListSearch = { ...this.setParams() }
// resolve()
// })
// },
// setParams() {
// const params = {}
// params.searchText = 'dasda'
// return params
// },
handleSearch() {
this.$refs.expertTable.refreshTable()
},
handleReset(type) {
this.batchListSearch = {
departmentId: '',
staffName: '',
businessType: ''
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .hasDataTable {
.el-table__empty-block,
.el-pagination {
display: none;
}
}
/deep/ .el-form-item {
margin-right: 12px !important;
}
.btn-area {
display: inline-block;
position: relative;
.client {
background-color: #fff;
list-style: none;
position: absolute;
z-index: 1;
width: 108px;
padding: 4px 0;
box-shadow: 0px 6px 20px 0px rgba(122, 122, 122, 0.2);
border-radius: 4px;
top: calc(100% + 8px);
li {
height: 32px;
line-height: 32px;
text-align: center;
background: #ffffff;
cursor: pointer;
font-size: 14px;
font-weight: 400;
color: #666666;
&:hover {
background-color: #f4f6fc;
color: #5850ff;
}
}
}
}
.btnTip,
.tip {
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
}
.btnTip {
font-size: 14px;
line-height: 22px;
margin-left: 16px;
}
.expert-wrap {
margin-top: 16px;
padding: 20px 20px 0;
background-color: #fff;
min-height: calc(100vh - 148px);
/deep/.switch {
.el-switch__label--right {
margin-left: 8px;
}
.el-switch__label,
.is-active {
color: #666;
}
}
/deep/.el-table__empty-text {
line-height: 30px;
height: 100px;
margin-top: 20px;
}
/deep/ .el-cascader {
.el-icon-arrow-down {
margin-top: 1px;
}
}
.select_wrapper {
display: flex;
align-items: center;
.label {
box-sizing: border-box;
padding-right: 10px;
font-size: 14px;
font-weight: 400;
color: #333333;
text-align: right;
white-space: nowrap;
}
}
.default-box {
display: flex;
flex-direction: column;
align-items: center;
.default-img {
width: 400px;
height: 174px;
margin-top: 48px;
}
.tip {
font-size: 16px;
line-height: 24px;
white-space: nowrap;
margin: 24px;
}
}
}
</style>
<!-- 编辑权益 -->
<template>
<div class="before-sale edit-equity edit-order">
<div style="padding: 17px 0 55px;">
<!-- <div class="help-service">
<div class="before-sale edit-equity edit-order">
<div style="padding: 17px 0 55px;">
<!-- <div class="help-service">
<img class="service-img" src="./image/code.png" />
<p>提单及服务咨询</p>
<p class="service-hotline">服务热线</p>
<p class="service-phone">18938907441</p>
</div> -->
<div class="container">
<p class="edit-title">车辆信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="144px" defaultWidth="320px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(0, 7)" :formRules="editRuleCar">
</glsx-combi-form>
<glsx-combi-form ref="editFormRefBrand" labelWidth="144px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(7)" :formRules="editRuleCar">
<template slot="vehicleBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicle.vehicleBrandId)" style="width:144px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSubBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSubBrandId" placeholder="请选择子品牌" filterable @change="getCarSeriesList()" style="width:144px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSeriesId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSeriesId" filterable placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width:215px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleShapeId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleShapeId" filterable placeholder="请选择车型" style="width:215px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carTypeOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
</glsx-combi-form>
</div>
<div class="container">
<p class="edit-title">客户信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefUser" labelWidth="144px" defaultWidth="320px" formRef="editChildRefUser" :formObj="editForm" :formData="editFormDataUser" :formRules="editRuleUser"></glsx-combi-form>
</div>
<div class="container select-product">
<p class="edit-title">选择产品</p>
<!-- <glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="144px" formRef="editChildRefPro" :formObj="editForm" :formData="editFormDataPro" :formRules="editRulePro"> -->
<glsx-combi-form class="edit-form-container" labelWidth="144px" defaultWidth="320px" :formObj="editForm" :formData="editFormDataPro">
<template slot="packageCode" slot-scope="scope">
<el-radio-group class="package-code-box" v-model="editForm[scope.scope.name]" :disabled="scope.scope.isDisabled" @change="scope.scope.handleRadioChange">
<el-radio class="package-code" v-for="subItem in scope.scope.optionList" :key="subItem[scope.scope.optionId]" :label="subItem[scope.scope.optionId]">
<span class="package-title">{{ subItem[scope.scope.optionLabel] }}</span>
<div class="radio-add-block" @click.stop.prevent="e => handleCancelBubble(e)">
<p class="package-subtitle">{{ subItem.serviceItems }}</p>
<div class="sub-el-form" v-if="editForm.packageCode == subItem[scope.scope.optionId]">
<glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="160px" defaultWidth="320px" formRef="editChildRefPro" :isBlock="isBlock" :formObj="editFormPro" :formData="subItem.editFormData" :formRules="editRulePro">
<template slot="table" slot-scope="scope">
<table style="marginLeft: 160px" class="table-style">
<tbody>
<tr>
<td v-for="(m, n) in scope.scope.attributeList" :key="n" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">{{ m.attributeDesc }}</td>
</tr>
<tr v-for="(m, n) in scope.scope.tableList" :key="n">
<td v-for="(i, j) in m" :key="j" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">
<el-input :disabled="i.isDisabled" :class="{ 'border-red': !editFormPro[i.name] }" placeholder="请输入" v-model="editFormPro[i.name]" :maxlength="i.maxlength">
<el-popover v-show="!editFormPro[i.name]" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="i.attributeDesc + '是必填项'">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</td>
</tr>
</tbody>
</table>
</template>
</glsx-combi-form>
</div>
<div class="container">
<p class="edit-title">车辆信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefCar" labelWidth="144px" defaultWidth="320px" formRef="editChildRefCar" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(0, 7)" :formRules="editRuleCar"></glsx-combi-form>
<glsx-combi-form ref="editFormRefBrand" labelWidth="144px" defaultWidth="215px" formRef="editChildRefBrand" :formObj.sync="editForm.vehicle" :formData="editFormDataCar.slice(7)" :formRules="editRuleCar">
<template slot="vehicleBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleBrandId" placeholder="请选择品牌" filterable @change="handleChangeBrand(editForm.vehicle.vehicleBrandId)" style="width:144px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carBrandOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSubBrandId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSubBrandId" placeholder="请选择子品牌" filterable @change="getCarSeriesList()" style="width:144px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carChildOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleSeriesId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleSeriesId" filterable placeholder="请选择车系" @change="getCarTypeList(editForm.vehicle.vehicleSeriesId)" style="width:215px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carSeriesOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
<template slot="vehicleShapeId" slot-scope="scope">
<el-select v-model="editForm.vehicle.vehicleShapeId" filterable placeholder="请选择车型" style="width:215px;" :disabled="scope.scope.isDisabled">
<el-option v-for="item in baseData.carTypeOptions" :key="item.id" :value="item.id" :label="item.name" />
</el-select>
</template>
</glsx-combi-form>
</div>
<div class="container">
<p class="edit-title">客户信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefUser" labelWidth="144px" defaultWidth="320px" formRef="editChildRefUser" :formObj="editForm" :formData="editFormDataUser" :formRules="editRuleUser"></glsx-combi-form>
</div>
<div class="container select-product">
<p class="edit-title">选择产品</p>
<!-- <glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="144px" formRef="editChildRefPro" :formObj="editForm" :formData="editFormDataPro" :formRules="editRulePro"> -->
<glsx-combi-form class="edit-form-container" labelWidth="144px" defaultWidth="320px" :formObj="editForm" :formData="editFormDataPro">
<template slot="packageCode" slot-scope="scope">
<el-radio-group class="package-code-box" v-model="editForm[scope.scope.name]" :disabled="scope.scope.isDisabled" @change="scope.scope.handleRadioChange">
<el-radio class="package-code" v-for="subItem in scope.scope.optionList" :key="subItem[scope.scope.optionId]" :label="subItem[scope.scope.optionId]">
<span class="package-title">{{ subItem[scope.scope.optionLabel] }}</span>
<div class="radio-add-block" @click.stop.prevent="e => handleCancelBubble(e)">
<p class="package-subtitle">{{ subItem.serviceItems }}</p>
<div class="sub-el-form" v-if="editForm.packageCode == subItem[scope.scope.optionId]">
<glsx-combi-form class="edit-form-container" ref="editFormRefPro" labelWidth="160px" defaultWidth="320px" formRef="editChildRefPro" :isBlock="isBlock" :formObj="editFormPro" :formData="subItem.editFormData" :formRules="editRulePro">
<template slot="table" slot-scope="scope">
<table style="marginLeft: 160px" class="table-style">
<tbody>
<tr>
<td v-for="(m, n) in scope.scope.attributeList" :key="n" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">{{ m.attributeDesc }}</td>
</tr>
<tr v-for="(m, n) in scope.scope.tableList" :key="n">
<td v-for="(i, j) in m" :key="j" :style="{ width: 100 / scope.scope.attributeList.length + '%' }">
<el-input :disabled="i.isDisabled" :class="{ 'border-red': !editFormPro[i.name] }" placeholder="请输入" v-model="editFormPro[i.name]" :maxlength="i.maxlength">
<el-popover v-show="!editFormPro[i.name]" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="i.attributeDesc + '是必填项'">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</td>
</tr>
</tbody>
</table>
</template>
</glsx-combi-form>
</div>
</el-radio>
</el-radio-group>
</template>
</glsx-combi-form>
</div>
<div class="container">
<p class="edit-title">其他信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefOther" labelWidth="144px" defaultWidth="320px" formRef="editChildRefOther" :formObj="editForm" :formData="editFormDataOther" :formRules="editRuleOther"></glsx-combi-form>
</div>
</div>
</el-radio>
</el-radio-group>
</template>
</glsx-combi-form>
</div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer operate-btn">
<el-button size="small" class="reset-btn" v-show="routeInfo.addOrEdit == '1'" @click="handleReset">重置</el-button>
<el-button size="small" v-show="!['3', '5'].includes(routeInfo.addOrEdit)" class="plain" @click="handleDraft">草稿</el-button>
<el-button size="small" v-show="routeInfo.addOrEdit != '5'" type="primary" @click="handleConfirm">{{routeInfo.addOrEdit != '3' ? '提单' : '确定'}}</el-button>
<el-button v-if="routeInfo.addOrEdit != 5" size="small" @click="handleCancel">返回</el-button>
<el-button v-else size="small" type="primary" @click="handleCancel">返回</el-button>
<div class="container">
<p class="edit-title">其他信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRefOther" labelWidth="144px" defaultWidth="320px" formRef="editChildRefOther" :formObj="editForm" :formData="editFormDataOther" :formRules="editRuleOther"></glsx-combi-form>
</div>
</div>
<!-- <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> -->
<div class="footer operate-btn">
<el-button size="small" class="reset-btn" v-show="routeInfo.addOrEdit == '1'" @click="handleReset">重置</el-button>
<el-button size="small" v-show="!['3', '5'].includes(routeInfo.addOrEdit)" class="plain" @click="handleDraft">草稿</el-button>
<el-button size="small" v-show="routeInfo.addOrEdit != '5'" type="primary" @click="handleConfirm">{{ routeInfo.addOrEdit != '3' ? '提单' : '确定' }}</el-button>
<el-button v-if="routeInfo.addOrEdit != 5" size="small" @click="handleCancel">返回</el-button>
<el-button v-else size="small" type="primary" @click="handleCancel">返回</el-button>
</div>
<qrCode :bottom="320" :codeUrl="qrcodUrl" phoneTitle="提单及服务咨询" phone="189 3890 7441"></qrCode>
</div>
......@@ -148,30 +147,39 @@ export default {
seatesNum: 5,
billingDate: new Date()
},
actualSalesPerson:'',
actualSalesPersonId:'',
actualSalesPerson: '',
actualSalesPersonId: '',
insuranceType: 'i'
},
// 车辆信息
editRuleCar: {
// licensing: [{ required: true, message: '请选择是否上牌', trigger: 'change' }],
licensePlate: [{
validator: (rule, value, callback) => {
return value ? ((/.{7,8}/).test(value) ? callback() : callback(new Error('请输入7位或8位车牌号码'))) : callback()
}, trigger: 'change'
}],
vin: [{ required: true, message: '请输入车架号', trigger: 'change' },
{
validator: (rule, value, callback) => {
return (/^[a-zA-Z0-9]{17}$/).test(value) ? callback() : callback(new Error('请输入17位数字和字母'))
}, trigger: 'change'
}],
engineNo: [{ required: true, message: '请输入发动机号', trigger: 'change' },
{
validator: (rule, value, callback) => {
return (/^[a-zA-Z0-9]{6,16}$/).test(value) ? callback() : callback(new Error('请输入6-16位数字和字母组合'))
}, trigger: 'change'
}],
licensePlate: [
{
validator: (rule, value, callback) => {
return value ? (/.{7,8}/.test(value) ? callback() : callback(new Error('请输入7位或8位车牌号码'))) : callback()
},
trigger: 'change'
}
],
vin: [
{ required: true, message: '请输入车架号', trigger: 'change' },
{
validator: (rule, value, callback) => {
return /^[a-zA-Z0-9]{17}$/.test(value) ? callback() : callback(new Error('请输入17位数字和字母'))
},
trigger: 'change'
}
],
engineNo: [
{ required: true, message: '请输入发动机号', trigger: 'change' },
{
validator: (rule, value, callback) => {
return /^[a-zA-Z0-9]{6,16}$/.test(value) ? callback() : callback(new Error('请输入6-16位数字和字母组合'))
},
trigger: 'change'
}
],
invoicePrice: [{ required: true, message: '请输入发票价格', trigger: 'change' }],
// vehicleColor: [{ required: true, message: '请输入车身颜色', trigger: 'change' }],
vehicleBrandId: [{ required: true, message: '请选择车品牌', trigger: 'change' }],
......@@ -263,24 +271,32 @@ export default {
customerType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
customerName: [{ required: true, message: '请输入客户姓名', trigger: 'change' }],
cardType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
cardNo: [{
required: true,
validator: (rule, value, callback) => {
return value ? callback() : callback(new Error('请输入' + (this.editForm.cardType == '1' ? '身份证' : '统一社会信息代码')))
}, trigger: 'change'
},
{
validator: (rule, value, callback) => {
return (/[a-zA-Z0-9]{18}/).test(value) ? callback() : callback(new Error('请输入18位数字或字母'))
}, trigger: 'change'
}],
customerPhone: [{ required: true, message: '请输入联系号码', trigger: 'change' },
{
validator: (rule, value, callback) => {
let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/;
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
}, trigger: 'change'
}],
cardNo: [
{
required: true,
validator: (rule, value, callback) => {
return value ? callback() : callback(new Error('请输入证件号码'))
},
trigger: 'change'
},
{
validator: (rule, value, callback) => {
let reg = (this.editForm.cardType == 1|| this.editForm.cardType == 2) ? (/[a-zA-Z0-9]{18}/).test(value) : (/\S\s{0,18}/).test(value)
let tip = (this.editForm.cardType == 1|| this.editForm.cardType == 2) ? '请输入18位数字或字母' :'请输入证件号码'
return reg ? callback() : callback(new Error(tip))
}, trigger: 'change'
}
],
customerPhone: [
{ required: true, message: '请输入联系号码', trigger: 'change' },
{
validator: (rule, value, callback) => {
let phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
},
trigger: 'change'
}
],
customerAddress: [{ required: true, message: '请输入联系地址', trigger: 'change' }]
},
editFormDataUser: [
......@@ -297,6 +313,7 @@ export default {
this.editForm.cardType = value
var idx = this.editFormDataUser.findIndex(item => item.name == 'cardNo')
this.editFormDataUser[idx].label = this.baseData.cardTypeList.find(item => item.confId == value).confName
this.$refs.editFormRefUser.$refs.editChildRefUser.validateField('cardNo')
}
},
{
......@@ -366,7 +383,7 @@ export default {
],
servicePeriod: [{ required: true, message: '请选择服务期限', trigger: 'change' }],
effectiveDate: [{ required: true, message: '请选择生效日期', trigger: 'change' }],
actualSalesPersonId: [{ required: true, message: '请输入实际销售人', trigger: 'change' }]
// actualSalesPersonId: [{ required: true, message: '请输入实际销售人', trigger: 'change' }]
},
editFormDataOther: [
{
......@@ -420,7 +437,7 @@ export default {
optionList: [],
optionId: 'userOneid',
optionLabel: 'staffName',
changeAttr: (userOneid,targetItem)=>{
changeAttr: (userOneid, targetItem) => {
const target = targetItem.optionList.find(item => {
return item.userOneid == userOneid
})
......@@ -433,12 +450,12 @@ export default {
type: 'radio',
optionList: [
{
confLabel:'无忧卡首保',
confId:'i'
confLabel: '无忧卡首保',
confId: 'i'
},
{
confLabel:'无忧卡续保',
confId:'c'
confLabel: '无忧卡续保',
confId: 'c'
}
],
optionId: 'confId',
......@@ -486,6 +503,22 @@ export default {
{
confId: 2,
confName: '企业'
},
{
confId: 3,
confName: '个人(港澳)'
},
{
confId: 4,
confName: '个人(台)'
},
{
confId: 5,
confName: '个人(军官)'
},
{
confId: 6,
confName: '其他'
}
],
cardTypeList: [
......@@ -496,6 +529,22 @@ export default {
{
confId: 2,
confName: '统一社会信息代码'
},
{
confId: 3,
confName: '港澳返乡证'
},
{
confId: 4,
confName: '台胞证'
},
{
confId: 5,
confName: '军官证'
},
{
confId: 6,
confName: '其他证件'
}
],
servicePeriodList: [
......@@ -560,17 +609,17 @@ export default {
},
methods: {
getSalePeople(val){
getSalePeople(val) {
const params = {
staffName: val ? val.trim() : ''
// departmentId: ''
}
this.$apis.ghBeforeSale.getSalesPersonApi(params).then(res => {
if(res.code==='0') {
const id = this.editFormDataOther.findIndex((item)=>{
if (res.code === '0') {
const id = this.editFormDataOther.findIndex(item => {
return item.name == 'actualSalesPersonId'
})
this.$nextTick(() =>{
this.$nextTick(() => {
this.editFormDataOther[id].optionList = res.data
})
}
......@@ -592,7 +641,7 @@ export default {
})
}
},
handleCancelBubble(e) { },
handleCancelBubble(e) {},
getDefaultCarbrand() {
this.$apis.ghBeforeSale.getDefaultCarbrandApi({}).then(res => {
// 获取套餐列表
......@@ -615,14 +664,15 @@ export default {
},
getInfo() {
this.$apis.ghBeforeSale.getEquityApi({ contractNo: this.routeInfo.contractNo }).then(res => {
if(this.routeInfo.isSuper){ //超管不能修改以及不能获取到全部员工的列表
const id = this.editFormDataOther.findIndex((item)=>{
if (this.routeInfo.isSuper) {
//超管不能修改以及不能获取到全部员工的列表
const id = this.editFormDataOther.findIndex(item => {
return item.name == 'actualSalesPersonId'
})
this.editFormDataOther[id].optionList = [{userOneid: res?.actualSalesPersonId ,staffName: res?.actualSalesPerson}]
this.editFormDataOther[id].optionList = [{ userOneid: res?.actualSalesPersonId, staffName: res?.actualSalesPerson }]
this.editFormDataOther[id].isDisabled = true
}
this.editForm = {
...res
}
......@@ -677,25 +727,26 @@ export default {
this.editForm.suggestedSellingPrice = ''
if (this.editForm.vehicle.invoicePrice) {
var invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(2)
targetItem && targetItem.servicePackagePrices.forEach(item => {
if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) {
this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2)
this.editForm.actualSalesPrice = recovery ? (this.editForm.actualSalesPrice || (item.retailPrice / 100).toFixed(2)) : (item.retailPrice / 100).toFixed(2)
}
})
targetItem &&
targetItem.servicePackagePrices.forEach(item => {
if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) {
this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2)
this.editForm.actualSalesPrice = recovery ? this.editForm.actualSalesPrice || (item.retailPrice / 100).toFixed(2) : (item.retailPrice / 100).toFixed(2)
}
})
}
},
// 舒享版只能续保,'尊享版', '优享版'只能首保
setInsuranceType(targetItem){
setInsuranceType(targetItem) {
const targetNameList = ['尊享版', '优享版', '舒享版']
if(targetNameList.includes(targetItem.packageName)){
if(targetItem.packageName==='舒享版'){
if (targetNameList.includes(targetItem.packageName)) {
if (targetItem.packageName === '舒享版') {
this.editForm.insuranceType = 'c'
}else{
} else {
this.editForm.insuranceType = 'i'
}
const id = this.editFormDataOther.findIndex((item)=>{
const id = this.editFormDataOther.findIndex(item => {
return item.name == 'insuranceType'
})
this.editFormDataOther[id].isDisabled = true
......@@ -709,41 +760,45 @@ export default {
this.editRulePro = {}
this.editFormPro = {}
var attrName = ''
targetItem && targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) {
attrName = item.attributeList[0].attributeName
this.$set(this.editFormPro, attrName, tempObj.hasOwnProperty(attrName) ? tempObj[attrName] : '')
if (item.attributeList[0].required == 1) {
this.editRulePro[item.attributeList[0].attributeName] = [
{
required: true,
message: '请输入' + item.attributeList[0].attributeDesc,
trigger: 'change'
}
]
}
} else {
for (var i = 0; i < item.num; i++) {
item.attributeList.forEach(k => {
attrName = k.attributeName
this.$set(this.editFormPro, attrName + i, tempObj.hasOwnProperty(attrName + i) ? tempObj[attrName + i] : '')
})
targetItem &&
targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) {
attrName = item.attributeList[0].attributeName
this.$set(this.editFormPro, attrName, tempObj.hasOwnProperty(attrName) ? tempObj[attrName] : '')
if (item.attributeList[0].required == 1) {
this.editRulePro[item.attributeList[0].attributeName] = [
{
required: true,
message: '请输入' + item.attributeList[0].attributeDesc,
trigger: 'change'
}
]
}
} else {
for (var i = 0; i < item.num; i++) {
item.attributeList.forEach(k => {
attrName = k.attributeName
this.$set(this.editFormPro, attrName + i, tempObj.hasOwnProperty(attrName + i) ? tempObj[attrName + i] : '')
})
}
}
}
})
})
if (recovery) {
this.recoveryEditFormPro()
}
},
recoveryEditFormPro() {
this.editForm.attributeList.length && this.editForm.attributeList.forEach((item, idx) => {
let hashObj = {}
this.editForm.attributeList.map(i => i.attributeName).forEach((i, subIdx) => {
Object.keys(hashObj).includes(i) ? (hashObj[i] = hashObj[i] + 1) : (hashObj[i] = 1)
this.editForm.attributeList.length &&
this.editForm.attributeList.forEach((item, idx) => {
let hashObj = {}
this.editForm.attributeList
.map(i => i.attributeName)
.forEach((i, subIdx) => {
Object.keys(hashObj).includes(i) ? (hashObj[i] = hashObj[i] + 1) : (hashObj[i] = 1)
})
this.$set(this.editFormPro, hashObj[item.attributeName] != 1 ? item.attributeName + item.sort : item.attributeName, item.attributeValue)
})
this.$set(this.editFormPro, hashObj[item.attributeName] != 1 ? (item.attributeName + item.sort) : item.attributeName, item.attributeValue)
})
},
autoGenerate() {
var tempList = []
......@@ -760,8 +815,7 @@ export default {
})
if (k.attributeList[0].attributeType == 'datePicker') {
tempList[idx].dateType = 'date'
tempList[idx].valueFormat = 'yyyy-MM-dd',
tempList[idx].pickerOptions = 'beforeRangePickerOptions'
;(tempList[idx].valueFormat = 'yyyy-MM-dd'), (tempList[idx].pickerOptions = 'beforeRangePickerOptions')
}
} else {
var tableList = []
......@@ -815,8 +869,8 @@ export default {
}
} else {
this[formName].forEach((item, index) => {
if(item.optionsName){
if (item.type === 'select' && this.baseData[item.optionsName].length) {
if (item.optionsName) {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
......@@ -830,7 +884,7 @@ export default {
}
},
// 获取品牌车型
getAllVehicleBrand(fn = () => { }) {
getAllVehicleBrand(fn = () => {}) {
const params = {}
this.$apis.ghBeforeSale.getCarBrandListApi(params).then(res => {
this.baseData.carBrandOptions = res || []
......@@ -924,11 +978,11 @@ export default {
targetItem.groupAttributeList.forEach(item => {
if (item.attributeList.length == 1) {
let targetAttributeValue = ''
if(item.attributeList[0].attributeGroup == 'additional_price'){
if (item.attributeList[0].attributeGroup == 'additional_price') {
targetAttributeValue = this.editFormPro[item.attributeList[0].attributeGroup] ? (this.editFormPro[item.attributeList[0].attributeGroup] * 100).toFixed(0) : ''
}else if(item.attributeList[0].attributeGroup == 'additional_date'){
} else if (item.attributeList[0].attributeGroup == 'additional_date') {
targetAttributeValue = this.editFormPro[item.attributeList[0].attributeGroup] ? utils.dateFormat(this.editFormPro[item.attributeList[0].attributeGroup]) : ''
}else{
} else {
targetAttributeValue = this.editFormPro[item.attributeList[0].attributeGroup] ? this.editFormPro[item.attributeList[0].attributeGroup] : ''
}
params.attributeList.push({
......@@ -977,25 +1031,31 @@ export default {
updateEquity(params) {
const loading = this.$loading({
lock: true,
text: 'Loading',
text: '订单待审核中,请等待1-2分钟后刷新页面。若一直待审核,请主动联系erp项目组。',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
background: 'rgba(0, 0, 0, 0.5)',
customClass:'loadingClass'
})
this.$apis.ghBeforeSale.updateEquityApi(params).then(res => {
loading.close();
this.submit = false
if (res.errId == 'A1307') {
loading.close()
this.whereToGo('vin')
this.$message({
message: res.message,
type: 'error'
})
} else {
this.$router.push({
path: '/ghPreSale/equityList',
// name: 'beforeSale',
params: res
})
setTimeout(()=>{
loading.close()
this.$router.push({
path: '/ghPreSale/equityList',
// name: 'beforeSale',
params: res
})
},5000)
}
})
},
......@@ -1024,7 +1084,7 @@ export default {
var params = this.getParams()
params.operationType = 1
if (['2', '3', '4'].includes(this.routeInfo.addOrEdit)) {
if (this.routeInfo.addOrEdit == '4' && this.editForm.orderStatus != 3) {
if (this.routeInfo.addOrEdit == '4') {
params.contractNo = ''
params.oldContractNo = this.routeInfo.contractNo
} else {
......@@ -1071,8 +1131,8 @@ export default {
seatesNum: 5,
billingDate: new Date()
},
actualSalesPerson:'',
actualSalesPersonId:'',
actualSalesPerson: '',
actualSalesPersonId: '',
insuranceType: 'i'
}
this.$apis.ghBeforeSale.getDefaultCarbrandApi({}).then(res => {
......@@ -1120,10 +1180,10 @@ export default {
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
}
.edit-order{
padding-top: 0!important;
height:100%;
overflow-y:auto;
.edit-order {
padding-top: 0 !important;
height: 100%;
overflow-y: auto;
}
.help-service .service-img {
......@@ -1146,7 +1206,7 @@ export default {
.edit-order .container {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 0!important;
padding: 0 !important;
margin-bottom: 10px;
}
......@@ -1160,14 +1220,14 @@ export default {
.before-sale .footer {
width: 100%;
position: absolute;
position: fixed;
bottom: 0;
height: 64px;
left: 0;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
z-index: 0;
}
/* .operate-btn .el-button{
......@@ -1179,7 +1239,6 @@ export default {
margin-top: 20px;
}
.before-sale .flex {
display: flex;
justify-content: space-between;
......@@ -1232,25 +1291,25 @@ export default {
margin-bottom: 20px;
}
/deep/ .select-product{
.package-code>.el-radio__input{
/deep/ .select-product {
.package-code > .el-radio__input {
margin-left: 73px;
}
.package-code>.el-radio__label>.radio-add-block>.package-subtitle{
.package-code > .el-radio__label > .radio-add-block > .package-subtitle {
margin-left: 76px;
}
}
}
.select-product .el-radio__label{
.select-product .el-radio__label {
padding-left: 7px;
}
.select-product .package-title{
.select-product .package-title {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 600;
}
.select-product .package-subtitle{
.select-product .package-subtitle {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
......@@ -1271,7 +1330,7 @@ export default {
}
/deep/ .no-label.el-form-item--small .el-form-item__content {
width: auto;
}
}
/* 表格 */
/* .edit-equity .spesc-label {
padding: 1px 10px;
......@@ -1314,16 +1373,16 @@ export default {
cursor: pointer;
}
.plain{
.plain {
border: 1px solid #5850ff;
color: #5850ff;
}
.reset-btn{
.reset-btn {
border: 1px solid #909090;
color: #333333;
}
.sub-el-form{
.sub-el-form {
margin-left: 50px;
}
/* 表格 */
......
......@@ -24,14 +24,14 @@
<!-- 表格区域 开始 -->
<GLTable ref="equityRef" :pageSizes="sizeList" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<GLButton v-if="[2, 4, 5,7,8,9,10,11].includes(scope.scope.orderStatus)" fn="查看" type="text" @click="handleEdit(5, scope.scope)">查看</GLButton>
<GLButton v-if="[2, 4, 5,7,8,9,10,11,12].includes(scope.scope.orderStatus)" fn="查看" type="text" @click="handleEdit(5, scope.scope)">查看</GLButton>
<!-- <el-button v-if="[2, 4, 5].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(5, scope.scope)">查看</el-button> -->
<el-button v-if="[2,8,10,11].includes(scope.scope.orderStatus)" type="text" @click="handlePdf(scope.scope)">打印</el-button>
<el-button v-if="[2,8,10,11].includes(scope.scope.orderStatus)" style="position: relative;" type="text" @click="handleUpload(scope.scope)">上传资料<span v-show="scope.scope.dataPerfection == 0" class="circule-tips"></span></el-button>
<el-button v-if="[2,8,10,11,12].includes(scope.scope.orderStatus)" type="text" @click="handlePdf(scope.scope)">打印</el-button>
<el-button v-if="[2,7,8,9,10,11,12].includes(scope.scope.orderStatus)" style="position: relative;" type="text" @click="handleUpload(scope.scope)">上传资料<span v-show="scope.scope.dataPerfection == 0" class="circule-tips"></span></el-button>
<!-- <el-button v-if="[0].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button> -->
<!-- <el-button v-if="[2].includes(scope.scope.orderStatus)" type="text" @click="handleEdit(3, scope.scope)">修改</el-button> -->
<GLButton v-if="[0].includes(scope.scope.orderStatus)" fn="编辑" type="text" @click="handleEdit(2, scope.scope)">编辑</GLButton>
<GLButton v-if="[2,8,10,11].includes(scope.scope.orderStatus)&&(!scope.scope.hasPrint)" fn="修改" type="text" @click="handleEdit(3, scope.scope)">修改</GLButton>
<GLButton v-if="[2,8,10,11].includes(scope.scope.orderStatus)&&(!scope.scope.hasPrint || userInfo.admin)" fn="修改" type="text" @click="handleEdit(3, scope.scope)">修改</GLButton>
<el-button v-if="[2,8,10,11].includes(scope.scope.orderStatus)" type="text" @click="handleBack(scope.scope)">退单</el-button>
<GLButton v-if="[1,3, 4, 5].includes(scope.scope.orderStatus)" fn="重新提单" type="text" @click="handleEdit(4, scope.scope)">重新提单</GLButton>
<el-button v-if="userInfo.admin" type="text" @click="showFailModal(scope.scope)">失败</el-button>
......@@ -363,6 +363,10 @@ export default {
confId: 11,
confName: 'ERP修改失败'
},
{
confId: 12,
confName: 'ERP出单审核中'
}
],
dataPerfectionList: [
{
......@@ -580,10 +584,12 @@ export default {
this.$apis.ghBeforeSale[this.secondObj.apiName](this.secondObj.apiParams).then(res => {
// this.handleSecondCancel()
// this.isTipVisible = true
this.$message({
if(res.code != '0'){
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
}
this.editNotify = res
// clearTimeout(this.timer)
// this.timer = setTimeout(() => {
......
<template>
<div id="writeOff" class="writeOff">
<template v-if="!isSavePage">
<div class="header">客户信息</div>
<div class="main box">
<glsx-combi-form ref="writeOff" :formRules="checkRule" labelWidth="128px" defaultWidth="308px" :formObj="batchListSearch" :formData="writeOffForm"></glsx-combi-form>
<div class="signal-img">
<p>核销码示意图</p>
<img :src="url" alt="" />
</div>
</div>
</template>
<template v-if="isSavePage">
<div class="custom box">
<div class="header">报案信息(客户提交)</div>
<div class="custom-info">
<span class="code label">核销码:</span>
<span class="code">{{ customObj.writeOffCode }}</span>
<glsx-combi-form ref="customRef" :formRules="customRule" labelWidth="160px" defaultWidth="300px" :formObj="customObj" :formData="customForm"></glsx-combi-form>
</div>
</div>
<div class="handler box" style="margin-top: 10px">
<div class="header">报案信息(店面补充)</div>
<div class="handler-info">
<glsx-combi-form ref="handlerRef" :formRules="customRule" labelWidth="160px" defaultWidth="300px" :formObj="customObj" :formData="handlerForm"></glsx-combi-form>
</div>
</div>
</template>
<div class="my-footer btn-box box">
<el-button v-if="!isSavePage" size="small" type="primary" @click="handleNextStep">下一步</el-button>
<el-button v-else size="small" type="primary" @click="handleSave">提交</el-button>
<el-button type="default" size="small" @click="handleCancel">取消</el-button>
</div>
<qrCode :bottom="320" :codeUrl="serviceImg" phoneTitle="提单及服务咨询" phone="189 3890 7441"></qrCode>
</div>
</template>
<script type="text/ecmascript-6">
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
import url from '@/assets/write_off.png'
import serviceImg from '../image/code.png'
import qrCode from '@/components/qr-code/index.vue'
const phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
export default {
name: 'addwriteOff',
data() {
return {
url,
serviceImg,
isSavePage: false,
batchListSearch: {
writeOffCode: ''
},
errMeg: '',
checkRule: {
writeOffCode: [
{
validator: (rule, value, callback) => {
let writeOffCodeReg = /^[0-9]{8}$/
return writeOffCodeReg.test(value) ? callback() : callback(new Error('请输入正确的核销码'))
},
trigger: 'change'
},
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('核销码不能为空'))
} else if (this.errMeg) {
callback(new Error(this.errMeg))
} else {
callback()
}
},
trigger: 'blur'
}
]
},
writeOffForm: [
{
label: '核销码',
name: 'writeOffCode',
type: 'input',
maxlength: 8,
placeholder: '请输入核销码',
isClear: true
}
],
customObj: {
writeOffCode: '',
reporterName: '',
reporterPhone: '',
reporterDate: '',
reimbursementDate: '',
handlerName: '',
handlerPhone: '',
serviceCodes: []
},
customRule: {
reporterName: [{ required: true, message: '请输入报案人', trigger: 'change' }],
handlerName: [{ required: true, message: '请输入经办人', trigger: 'change' }],
reporterDate: [{ required: true, message: '请选择报案日期', trigger: 'change' }],
reimbursementDate: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('请选择出险日期'))
} else {
if(new Date(value).getTime() > new Date(this.customObj.reporterDate).getTime()){
callback(new Error('出险日期不能大于报案日期'))
}else{
callback()
}
}
},
trigger: 'change'
}
],
reporterPhone: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('请输入手机号'))
} else if (phoneReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的手机号'))
}
},
trigger: 'change'
}
],
handlerPhone: [
{
required: true,
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('请输入手机号'))
} else if (phoneReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的手机号'))
}
},
trigger: 'change'
}
],
serviceCodes: [
{
type: 'array',
required: true,
message: '请选择最少一项核赔服务',
trigger: 'change'
}
]
},
customForm: [
{
label: '报案人',
name: 'reporterName',
type: 'input',
isClear: true
},
{
label: '报案人联系号码',
name: 'reporterPhone',
type: 'input',
maxlength: 11,
isClear: true
},
{
label: '报案日期',
name: 'reporterDate',
type: 'limitDatePicker',
dateType: 'datetime',
isClear: true,
customPickerOptions: {
disabledDate(date) {
return date > new Date();
},
selectableRange: ''
},
focus:(e)=>{
if(e.value){
this.updateTimeLimit(e.value, 'reporterDate')
}
},
handleDateChange: e => {
console.log(111)
if (e) this.$refs.customRef.$refs.formRef.validateField('reimbursementDate')
}
},
{
label: '出险日期',
name: 'reimbursementDate',
type: 'limitDatePicker',
dateType: 'datetime',
isClear: true,
customPickerOptions: {
disabledDate:(date)=> {
return date > new Date();
},
selectableRange: ''
},
focus:(e)=>{
if(e.value){
this.updateTimeLimit(e.value, 'reimbursementDate')
}
}
}
],
handlerForm: [
{
label: '经办人',
name: 'handlerName',
type: 'input',
isClear: true
},
{
label: '经办人联系号码',
name: 'handlerPhone',
type: 'input',
maxlength: 11,
isClear: true
},
{
label: '申请核赔服务',
name: 'serviceCodes',
type: 'checkbox',
border: true,
optionList: [],
optionId: 'serviceItemCode',
optionLabel: 'serviceItemName'
}
]
}
},
components: {
glsxCombiForm,
qrCode
},
mounted() {},
watch:{
'customObj.reporterDate'(newVal, oldVal){
if(newVal){
this.updateTimeLimit(newVal,'reporterDate')
}
},
'customObj.reimbursementDate'(newVal, oldVal){
if(newVal){
this.updateTimeLimit(newVal, 'reimbursementDate')
}
}
},
methods: {
updateTimeLimit(newVal,key){
let limitTime = ''
// 当不是同一天,时间限制为'00:00:00 - 23:59:59',否则'00:00:00 - endTime'
let endTime = new Date().getTime()
if (util.dateFormat(endTime) === util.dateFormat(new Date(newVal))) {
limitTime = `00:00:00 - ${util.dateFormat(new Date(new Date().setHours(new Date().getHours() + 1)), 'HH:mm:ss')}`
} else {
limitTime = '00:00:00 - 23:59:59'
}
const Item = this.customForm.find(item => item.name === key)
this.$set(Item.customPickerOptions,'selectableRange',limitTime)
},
handleNextStep() {
this.$refs.writeOff.$refs.formRef.validate(valid => {
if (valid) {
const { writeOffCode } = this.batchListSearch
this.$apis.beforeSale.getWriteOffService({ writeOffCode }).then(res => {
if (res.code == '0') {
this.isSavePage = true
const { writeOffCode, reporterName, reporterPhone, serviceItemsList } = res.data
const reporterDate = new Date();
const reimbursementDate = new Date();
this.customObj = { ...this.customObj, writeOffCode, reporterName, reporterPhone, reporterDate, reimbursementDate }
const id = this.handlerForm.findIndex(item => {
return item.name === 'serviceCodes'
})
this.$nextTick(() => {
this.handlerForm[id].optionList = serviceItemsList
})
} else {
this.errMeg = res.message
this.$refs.writeOff.$refs.formRef.validate(valid => {
this.gotoValidView('writeOffCode')
this.errMeg = ''
})
}
})
} else {
this.gotoValidView('writeOffCode')
}
})
},
handleSave() {
this.$refs.customRef.$refs.formRef.validate(valid => {
if (valid) {
this.$refs.handlerRef.$refs.formRef.validate(secondValid => {
if (secondValid) {
let params = {...this.customObj}
params.reimbursementDate = util.dateFormat(this.customObj.reimbursementDate, 'YYYY-MM-DD HH:mm:ss')
params.reporterDate = util.dateFormat(this.customObj.reporterDate, 'YYYY-MM-DD HH:mm:ss')
this.$apis.beforeSale.saveWriteOff({ ...params }).then(res => {
if (res.code == '0') {
this.$message({
message: '保存成功',
type: 'success'
})
this.$router.push({
path: '/ghPreSale/writeOff/writeOffList'
})
} else {
this.gotoValidView('writeOff')
this.$message({
message: res.message,
type: 'error'
})
}
})
} else {
this.gotoValidView('reporterName')
}
})
} else {
this.gotoValidView('reporterName')
}
})
},
gotoValidView(id) {
document.getElementById(id) && document.getElementById(id).scrollIntoView()
},
handleCancel() {
this.$router.push({
path: '/ghPreSale/writeOff/writeOffList'
})
}
}
}
</script>
<style lang="scss" scoped>
.writeOff {
margin-top: 17px;
// height: calc(100vh - 206px);
margin-bottom: 64px;
background-color: #fff;
.header {
height: 60px;
line-height: 60px;
padding: 0 20px;
border-bottom: 1px solid #eeeeee;
font-family: PingFangSC-Medium;
font-size: 14px;
color: #333333;
font-weight: 700;
}
/deep/ .el-form-item__label {
padding: 0;
}
/deep/ .el-form-item {
margin-right: 0;
}
.custom-info {
padding: 30px 0;
box-sizing: border-box;
.code {
color: #666;
font-size: 14px;
display: inline-block;
width: 160px;
height: 32px;
line-height: 32px;
margin-bottom: 10px;
box-sizing: border-box;
}
.label {
text-align: right;
}
}
.handler-info {
height: 437px;
padding: 30px 0;
box-sizing: border-box;
/deep/ #serviceCodes {
display: block;
.el-form-item__content {
max-width: 800px;
}
}
/deep/ .el-checkbox {
width: 240px;
margin-right: 20px;
margin-left: 0;
display: inline-block;
}
}
.main {
padding: 30px 0 15px;
.signal-img {
margin-left: 128px;
p {
height: 18px;
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #5850ff;
line-height: 20px;
}
img {
width: 824px;
height: 568px;
}
}
}
// .btn-box {
// display: flex;
// justify-content: center;
// align-items: center;
// }
}
</style>
<template>
<div class="writeOff">
<div class="box">
<div class="header title" style="height: 53px; line-height: 53px">
<span style="height: 53px; cursor: pointer; display: flex; align-items: center" @click="back">
<i class="el-icon-arrow-left" style="font-size: 18px"></i>
返回
</span>
</div>
<div class="custom-info">
<p class="title" style="margin-bottom: 20px">报案信息(客户提交)</p>
<div class="info">
<span class="item" v-for="(val, key) in customObj" :key="key">
<span class="label">{{ val ? val + ':' : '' }}</span>
{{ info[key] }}
</span>
</div>
</div>
</div>
<div class="box" style="margin-top: 10px">
<div class="header title">报案信息(店面补充)</div>
<div class="handler-info">
<span class="item" v-for="(val, key) in handlerObj" :key="key">
<span class="label">{{ val ? val + ':' : '' }}</span>
{{ info[key] }}
</span>
<div class="item service">
<span class="label">申请核赔服务:</span>
<div class="sevice-box">
<div v-for="(item, index) in info.serviceItemsList" :key="index" class="service-item">
{{ item.serviceItemName }}
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import util from '@/util/util'
export default {
name: 'writeOffDetail',
data() {
return {
info: {},
customObj: {
writeOffCode: '核销码',
nullval: '',
reporterName: '报案人',
reporterPhone: '报案人联系号码',
reporterDate: '报案日期',
reimbursementDate: '出险日期'
},
handlerObj: {
handlerName: '经办人',
handlerPhone: '经办人联系号码'
}
}
},
mounted() {
this.getDetail(this.$route.params)
},
methods: {
getDetail({ id }) {
this.$apis.beforeSale.getWriteOffDetail({ writeOffCode: id }).then(res => {
if (res.code == '0') {
this.info = res.data
}
})
},
back() {
this.$router.push({
path: '/ghPreSale/writeOff/writeOffList'
})
}
}
}
</script>
<style lang="scss" scoped>
.writeOff {
margin-top: 17px;
.box {
background-color: #fff;
}
p {
margin: 0;
}
.item {
width: 350px;
padding: 15px 0;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #6c6f71;
line-height: 17px;
display: inline-block;
margin-right: 120px;
.label {
width: 140px;
text-align: right;
display: inline-block;
}
}
.service {
margin-right: 0 !important;
display: flex;
width: 100%;
.label {
height: 36px;
line-height: 36px;
white-space: nowrap;
}
.sevice-box {
width: 800px;
.service-item {
width: 240px;
height: 36px;
background: #f7f7f7;
border: 1px solid #e9e9e9;
display: inline-flex;
align-items: center;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #6c6f71;
line-height: 17px;
padding: 0 12px;
box-sizing: border-box;
margin: 0 20px 20px 0;
}
}
}
.title {
font-family: PingFangSC-Medium;
font-size: 16px;
color: #333333;
font-weight: 700;
}
.header {
border-bottom: 1px solid #eeeeee;
height: 60px;
background-color: #fff;
line-height: 60px;
padding: 0 20px;
}
.custom-info {
height: 220px;
padding: 20px;
box-sizing: border-box;
.info {
width: 950px;
}
}
.handler-info {
padding: 20px;
}
}
</style>
<template>
<div class="writeOff">
<GLButton size="small" style="margin-bottom: 10px;" fn="新增核赔" class="el-icon-plus" type="primary" @click="addWriteOff(1)">新增核赔</GLButton>
<div class="contain equity-wrap">
<div class="search-wrap">
<glsx-combi-form ref="showSearch" labelWidth="100px" defaultWidth="230px" :formObj="batchListSearch" :formData="writeOffForm">
<!-- <span slot="footer" class="footer-btns">
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleReset('reset')">重置</el-button>
</span> -->
</glsx-combi-form>
</div>
<div class="my-search-btn" style="float: right; margin-right: 0; margin-bottom: 20px">
<el-button plain type="primary" size="small" @click="handleReset('reset')">重置</el-button>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleExport" class="selectBtn">导出</el-button>
</div>
<GLTable ref="writeOffTable" :pageSizes="sizeList" :searchForm="searchForm" :tableParams="batchTableParams" :getListApi="getListApi" :pageConf="batchPageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="table-btns" slot-scope="scope">
<GLButton fn="查看" type="text" @click="handleView(scope.scope)">查看</GLButton>
</div>
</GLTable>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
export default {
name: 'writeOffList',
data() {
return {
sizeList: [5, 10, 20, 30, 40],
getListApi: this.$apis.beforeSale.getWriteOffList,
batchListSearch: {
searchText: '',
activeTime: []
},
searchForm: {},
writeOffForm: [
{
label: '搜索内容',
name: 'searchText',
type: 'input',
placeholder: '请输入车主姓名、核销码、合同号',
isClear: true
},
{
label: '提交时间',
name: 'activeTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
pickerOptions: 'beforeRangePickerOptions',
isClear: true
}
],
// 序号、核销码、客户名、合同号、价格区间、门店提交时间、服务名称、操作
batchTableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '核销码',
prop: 'writeOffCode',
width: 120,
formatter: cellValue => {
return cellValue.writeOffCode || '-'
}
},
{
label: '客户名',
prop: 'reporterName',
width: 200,
formatter: cellValue => {
return cellValue.reporterName || '-'
}
},
{
label: '合同号',
prop: 'contractNo',
width: 200,
formatter: cellValue => {
return cellValue.contractNo || '-'
}
},
{
label: '价格区间',
prop: 'priceSection',
width: 200,
formatter: cellValue => {
return cellValue.priceSection || '-'
}
},
{
label: '门店提交时间',
prop: 'commitTime',
width: 200,
formatter: cellValue => {
return cellValue.commitTime ? util.dateFormat(cellValue.commitTime, 'YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: '服务名称',
prop: 'serviceName',
formatter: cellValue => {
return cellValue.serviceName || '-'
}
},
{
label: '操作',
prop: '',
width: '100px',
fixed: 'right',
addHtml: 'table-btns'
}
]
},
batchPageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
components: {
glsxCombiForm
},
mounted() {},
methods: {
handleView({ writeOffCode }) {
this.$router.push(`/ghPreSale/writeOff/writeOffDetail/${writeOffCode}`)
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = { ...this.setParams() }
resolve()
})
},
setParams() {
const params = {}
if (Array.isArray(this.batchListSearch.activeTime) && this.batchListSearch.activeTime.length > 0) {
params.commitTimeStart = util.dateFormat(this.batchListSearch.activeTime[0]) + ' 00:00:00'
params.commitTimeEnd = util.dateFormat(this.batchListSearch.activeTime[1]) + ' 23:59:59'
}
params.searchText = this.batchListSearch.searchText
return params
},
handleExport() {
const parmas = { ...this.setParams() }
this.$apis.beforeSale.exportWriteOffData(parmas).then(({ code, data, message }) => {
if (code == '0') {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', data)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
} else {
this.$message.error(message)
}
})
},
handleSearch() {
this.$refs.writeOffTable.refreshTable()
},
handleReset(type) {
this.batchListSearch = {
searchText: '',
activeTime: []
}
if (type === 'reset') {
this.handleSearch()
}
},
addWriteOff(type) {
this.$router.push('/ghPreSale/writeOff/addwriteOff')
}
}
}
</script>
<style lang="scss" scoped>
.writeOff {
margin-top: 17px;
.equity-wrap {
background-color: #fff;
padding: 20px;
.search-wrap {
margin-top: 20px;
// padding: 20px 20px 0;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!