Commit 2c260918 by 张立顺

feat 权益新增配置里面新增规格

1 parent d5f442b1
......@@ -17,6 +17,7 @@
"glsx-common": "^2.1.0",
"glsx-components": "^1.5.7",
"lodash": "^4.17.21",
"rfdc": "^1.4.1",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
......
......@@ -2,54 +2,54 @@ import { http } from '@/main'
const CUR_BASE_URL = 'rop-scrm-equity/router'
const get4SList = params => {
params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
params.method = `scrm.api.carlife.merchant.listWithPageByCurMerchant`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取权益列表
const getEquityList = params => {
params.method = 'scrm.api.equity.serviceterms.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'scrm.api.equity.serviceterms.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const exportEquityApi = params => {
params.method = `scrm.api.equity.serviceterms.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
params.method = `scrm.api.equity.serviceterms.export`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getServiceList = params => {
params.method = `scrm.api.equity.serviceterms.itemslist`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
params.method = `scrm.api.equity.serviceterms.itemslist`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const craeteEquity = params => {
params.method = `scrm.api.equity.serviceterms.insert`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
params.method = `scrm.api.equity.serviceterms.insert`
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const updateEquity = params => {
......@@ -102,7 +102,6 @@ const createCommonConfig = params => {
})
}
const getCommonConfig = params => {
params.method = `scrm.api.equity.service.items.common.config.list`
return http({
......@@ -229,27 +228,51 @@ const getServiceRecordApi = params => {
})
}
// 分页查询车系
const carSeriesPage = params => {
params.method = `scrm.api.equity.common.car.series.page`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 查询延保服务项目详情修改记录列表
const modifyDetailRecord = params => {
params.method = `scrm.api.equity.service.extend.items.modify.detail.record`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
get4SList,
getEquityList,
exportEquityApi,
getServiceList,
craeteEquity,
updateEquity,
getEquityDetail,
getServicesItemsList,
exportServicesItemsApi,
createCommonConfig,
getCommonConfig,
addServicesProject,
getServiceDetailApi,
getSpecificaListApi,
addGradeApi,
getScreeningDataApi,
getExtendedWarrantyListApi,
exportExtendedWarrantyApi,
addExtendedWarrantyApi,
getExtendedWarrantyDetailApi,
getExtendedWarrantyContractListApi,
getServiceRecordApi
}
\ No newline at end of file
get4SList,
getEquityList,
exportEquityApi,
getServiceList,
craeteEquity,
updateEquity,
getEquityDetail,
getServicesItemsList,
exportServicesItemsApi,
createCommonConfig,
getCommonConfig,
addServicesProject,
getServiceDetailApi,
getSpecificaListApi,
addGradeApi,
getScreeningDataApi,
getExtendedWarrantyListApi,
exportExtendedWarrantyApi,
addExtendedWarrantyApi,
getExtendedWarrantyDetailApi,
getExtendedWarrantyContractListApi,
getServiceRecordApi,
carSeriesPage,
modifyDetailRecord
}
......@@ -557,4 +557,23 @@
content: "*";
color: #f56c6c;
margin-right: 4px;
}
.el-dialog {
// margin-top: 6vh !important;
margin-top: 6vh;
&__body {
padding: 20px;
.el-form-item {
margin-bottom: 16px;
}
}
&__footer {
.el-button {
width: 150px;
}
}
}
\ No newline at end of file
......@@ -27,7 +27,8 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
}
}
const liveStatusList = [{
const liveStatusList = [
{
confId: '101',
confName: '直播中'
},
......@@ -56,8 +57,18 @@ const liveStatusList = [{
confName: '已过期'
}
]
const auditStatusList = [{
// /**
// * 深克隆 所有原型链上的对象和属性
// * 例: const bar=deepClone(foo)
// * console.log(bar===foo) false
// * @param {*} obj
// */
function deepClone(obj) {
const clone = require('rfdc')({ proto: false, circles: false })
return clone(obj)
}
const auditStatusList = [
{
confId: 0,
confName: '未审核'
},
......@@ -75,26 +86,34 @@ const auditStatusList = [{
}
]
// 太阳膜升级产品供货模式
const upgradeSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 3,
confName: '门店套码+嘀加'
}, {
confId: 4,
confName: '门店回收原厂+嘀加'
}, {
confId: 5,
confName: '服务商自采+嘀加'
}]
const upgradeSupplyModeList = [
{
confId: 1,
confName: '嘀加'
},
{
confId: 3,
confName: '门店套码+嘀加'
},
{
confId: 4,
confName: '门店回收原厂+嘀加'
},
{
confId: 5,
confName: '服务商自采+嘀加'
}
]
// 1.3场景 升级产品供货模式
const crowdUpgradeSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 2,
confName: '门店'
}]
const crowdUpgradeSupplyModeList = [
{
confId: 1,
confName: '嘀加'
},
{
confId: 2,
confName: '门店'
}
]
export { limitPrice, liveStatusList, auditStatusList, upgradeSupplyModeList, crowdUpgradeSupplyModeList }
\ No newline at end of file
export { limitPrice, deepClone, liveStatusList, auditStatusList, upgradeSupplyModeList, crowdUpgradeSupplyModeList }
<!-- 弹窗 -->
<template>
<div>
<el-dialog :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false" :width="width" :append-to-body="appendToBody" :fullscreen="fullscreen">
<span slot="title">
{{ title }}
<span class="dialog-sub-title">
<slot name="sub-title" />
</span>
</span>
<slot />
<div slot="footer">
<slot name="btn-start" />
<el-button type="primary" v-if="isShowFooter" @click="handleConfirm">
{{ btnOkLabel }}
</el-button>
<el-button v-if="!noCancel" @click="handleClose">取消</el-button>
<slot name="btn-middle" />
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'D2Dialog',
data() {
return {}
},
props: {
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
showClose: {
type: Boolean,
default: true
},
btnOkLabel: {
type: String,
default: '确定'
},
noCancel: {
type: Boolean,
default: false
},
width: {
type: String,
default: '580px'
},
isShowFooter: {
type: Boolean,
default: true
},
appendToBody: {
// 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
type: Boolean,
default: false
},
fullscreen: Boolean
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style scoped>
.dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
......@@ -12,7 +12,11 @@ import apis from './api'
import './public-path'
import '@/assets/css/public.scss'
// import 'glsx-components/dist/glsx-components.css'
// 针对template模板中使用可选链操作符
import chaining from '@/plugins/chaining'
import { start } from '@/setup'
Vue.use(chaining)
Vue.config.productionTip = false
Vue.prototype.$apis = apis
start()
......
// 针对template模板中使用可选链操作符
const chaining = {
install(vue) {
const optionalChaining = (obj, ...rest) => {
console.log('Vue.use', obj, rest)
let tmp = obj
for (const key in rest) {
const name = rest[key]
tmp = tmp?.[name]
}
console.log(tmp)
return tmp || ''
}
// const test = (obj, ...rest) => {
// let tmp = obj
// for (const key in rest) {
// const name = rest[key]
// tmp = tmp?.[name]
// }
// return tmp || ''
// }
// 添加实例方法
vue.prototype.$$ = optionalChaining
// vue.prototype.$sy = test
}
}
export default chaining
export default {
namespaced: true,
state: {
// 商品数据
goodsInfoData: {
id: '',
baseGoodsId: '',
sapCode: '',
supplierCode: '',
supplierName: '',
sceneName: '',
sceneType: '',
goodsName: '',
baseGoodsName: '',
goodsCode: '',
brandMerchantName: '',
specificationType: '1',
thumbUrl: [],
goodsTypeName: '',
goodsImgList: [],
goodsId: [],
specificationDetailList: [],
upgradeGoodsList: [],
distributionType: '0',
goodsSpecificationNameList: [],
status: '',
goodsSpecificationList: [],
goodsPositionList: [],
applicableModelNames: '',
positionNames: '',
shoppingMallFlag: '0',
goodsSpecificationSingleList: [],
specificationSingleDetailList: [],
selectedSceneCode: '',
goodsType: ''
}
},
mutations: {
/**
* @description 数据改变
* @param {Object} state state
*/
setUpdateGoodsInfo(state, data) {
state.goodsInfoData = Object.assign(state.goodsInfoData, data)
}
},
actions: {
},
getters: {
getGoodsInfoData(state) {
return state.goodsInfoData
}
}
}
<!-- 关联门店弹窗 -->
<template>
<d2-dialog title="选择品牌" :is-visible.sync="relateStoreVisible" width="60%" btn-ok-label="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateStore">
<el-form :model="storeSearchForm" ref="relate" :inline="true">
<el-form-item label="品牌名称:">
<el-input v-model.trim="storeSearchForm.brandName" placeholder="品牌名称" max-length="20" @keydown.native="handleStoreInput" clearable />
</el-form-item>
<el-form-item label="子品牌名称:">
<el-input v-model.trim="storeSearchForm.childName" placeholder="子品牌名称" max-length="20" @keydown.native="handleStoreInput" clearable />
</el-form-item>
<el-form-item label="车系名称:">
<el-input v-model.trim="storeSearchForm.seriesName" placeholder="车系名称" max-length="20" @keydown.native="handleStoreInput" clearable />
</el-form-item>
<el-button type="primary" @click="handleCurrentChange(1)">搜索</el-button>
</el-form>
<div class="tableCon">
<div class="tableBox">
<el-table ref="seletingTable" :data="selectingData" height="464px" class="table" border @select="handleChange" @select-all="handleAll">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<el-table-column prop="brandName" label="品牌名称" align="center"></el-table-column>
<el-table-column prop="childName" label="子品牌名称" align="center"></el-table-column>
<el-table-column prop="seriesName" label="车系名称" align="center"></el-table-column>
</el-table>
<el-pagination class="pagination" small background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="total, prev, pager, next" :total="total" />
</div>
<div class="tableRight">
<el-table :data="selectedData" border height="464px">
<el-table-column prop="brandName" label="品牌名称" align="center"></el-table-column>
<el-table-column prop="childName" label="子品牌名称" align="center"></el-table-column>
<el-table-column prop="seriesName" label="车系名称" align="center"></el-table-column>
<!-- <el-table-column prop="merchantName" label="品牌名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.label }}</span>
</template>
</el-table-column> -->
<el-table-column label="删除" align="center" width="80px">
<template slot-scope="scope">
<el-button class="el-icon-delete" @click="handleDelete(scope.row)" type="text" />
</template>
</el-table-column>
</el-table>
</div>
</div>
</d2-dialog>
</template>
<script>
// import { getBrandList } from "@api/contentManager"
import D2Dialog from '@/components/d2-dialog'
export default {
name: 'RelateStoreDialog',
components: {
D2Dialog
},
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
storeSearchForm: {
brandName: '',
childName: '',
seriesName: ''
}
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
storeSelected: {
type: Array,
default: () => []
}
},
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
},
methods: {
recoverySelection() {
var exitIds = this.selectedData.map(item => item.seriesId)
this.selectingData.forEach(item => {
exitIds.includes(item.seriesId) && this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
this.$apis.serviceConfig
.carSeriesPage({
...this.storeSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize
})
.then(res => {
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.seriesId === row.seriesId)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.seriesId !== row.seriesId))
},
handleAll(selection) {
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.seriesId === item.seriesId)
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.seriesId !== row.seriesId)
const obj = this.selectingData.find(v => v.seriesId == row.seriesId)
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.currentPage = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style lang="scss" >
.relateStore .table {
margin: 0 auto 20px !important;
}
.relateStore .tableCon {
margin-top: 20px;
display: flex;
justify-content: space-between;
.tableBox {
flex: 1;
// width: 600px !important;
}
.tableRight {
box-sizing: border-box;
flex: 1;
// margin-left: 35px;
// width: 300px !important;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
.pagination {
.el-pager {
line-height: 20px;
}
}
</style>
<template>
<div>
<div class="input-number-range" :class="{ 'is-disabled': disabled }">
<div class="flex">
<div class="from">
<el-input ref="input_from" v-model="userInputForm" :disabled="disabled" placeholder="最小值" @keyup.enter.native="handleBlurFrom" @blur="handleBlurFrom" @focus="handleFocusFrom" @input="handleInputFrom" @change="handleInputChangeFrom"></el-input>
</div>
<div class="center">
<span>-</span>
</div>
<div class="to from">
<el-input ref="input_to" v-model="userInputTo" :disabled="disabled" placeholder="最大值" @keyup.enter.native="handleBlurTo" @blur="handleBlurTo" @focus="handleFocusTo" @input="handleInputTo" @change="handleInputChangeTo"></el-input>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'InputNumberRange',
props: {
// 初始化范围
value: { required: true },
// 是否禁用
disabled: {
type: Boolean,
default: false
},
// 精度参数
precision: {
type: Number,
default: 0,
validator(val) {
return val >= 0 && val === parseInt(val, 10)
}
},
spescInputVal: {
type: String
}
},
data() {
return {
userInputForm: null,
userInputTo: null
}
},
watch: {
value: {
immediate: true,
handler(value) {
/** 初始化范围 */
if (value instanceof Array && this.precision !== undefined) {
this.userInputForm = typeof value[0] === 'number' ? value[0] : null
this.userInputTo = typeof value[1] === 'number' ? value[1] : null
}
}
}
},
mounted() {
if (this.spescInputVal) {
// let userInputForm = null
// let userInputTo = null
console.log(this.spescInputVal)
let [userInputForm, userInputTo] = this.spescInputVal.split('-')
this.userInputForm = userInputForm
this.userInputTo = userInputTo
}
},
methods: {
// 根据精度保留数字
toPrecision(num, precision) {
if (precision === undefined) precision = 0
return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision))
},
handleBlurFrom(event) {
this.$emit('blurfrom', event)
this.confirm()
},
handleFocusFrom(event) {
this.$emit('focusfrom', event)
},
confirm() {
// 如果两个都有值那就传递事件
if ((this.userInputForm || this.userInputForm == 0) && this.userInputTo) {
this.$emit('confirm', { value: `${this.userInputForm}-${this.userInputTo}` })
}
},
handleBlurTo(event) {
this.confirm()
this.$emit('blurto', event)
},
handleFocusTo(event) {
this.$emit('focusto', event)
},
handleInputFrom(value) {
this.$emit('inputfrom', value)
},
handleInputTo(value) {
this.$emit('inputto', value)
},
// from输入框change事件
handleInputChangeFrom(value) {
// 如果是非数字空返回null
if (isNaN(value) || value === '') {
this.$emit('input', [null, this.userInputTo])
this.$emit('changefrom', this.userInputForm)
return
}
// 初始化数字精度
this.userInputForm = this.setPrecisionValue(value)
// 如果from > to 将from值替换成to
if (typeof this.userInputTo === 'number') {
this.userInputForm = parseFloat(this.userInputForm) <= parseFloat(this.userInputTo) ? this.userInputForm : this.userInputTo
}
this.$emit('input', [this.userInputForm, this.userInputTo])
this.$emit('changefrom', this.userInputForm)
},
// to输入框change事件
handleInputChangeTo(value) {
// 如果是非数字空返回null
if (isNaN(value) || value === '') {
this.$emit('input', [this.userInputForm, null])
this.$emit('changefrom', this.userInputTo)
return
}
// 初始化数字精度
this.userInputTo = this.setPrecisionValue(value)
// 如果to < tfrom 将to值替换成from
if (typeof this.userInputForm === 'number') {
this.userInputTo = parseFloat(this.userInputTo) >= parseFloat(this.userInputForm) ? this.userInputTo : this.userInputForm
}
this.$emit('input', [this.userInputForm, this.userInputTo])
this.$emit('changeto', this.userInputTo)
},
// 设置成精度数字
setPrecisionValue(value) {
if (this.precision !== undefined) {
const val = this.toPrecision(value, this.precision)
return val
}
return null
}
}
}
</script>
<style lang="scss" scoped>
// 取消element原有的input框样式
::v-deep .el-input--mini .el-input__inner {
border: 0px;
margin: 0;
padding: 0 0px;
background-color: transparent;
}
.input-number-range {
.from {
width: 75px;
}
// background-color: #fff;
// border: 1px solid #dcdfe6;
// border-radius: 4px;
}
.flex {
display: flex;
flex-direction: row;
width: 100%;
// justify-content: center;
margin-top: 10px;
align-items: center;
.center {
margin-top: 1px;
}
}
.is-disabled {
background-color: #eef0f6;
border-color: #e4e7ed;
color: #c0c4cc;
cursor: not-allowed;
}
</style>
\ No newline at end of file
<template>
<d2-dialog title="历史记录" :is-visible.sync="relateVisible" width="40%" btn-ok-label="确定" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<div class="record-dialog">
<el-timeline-item v-for="(reviewInfo, index) in recordList" :key="index" color="#5850FF" :timestamp="reviewInfo.updatedDateStr">
<!-- {{ reviewInfo.reviewMessage }} -->
</el-timeline-item>
</div>
</d2-dialog>
</template>
<script>
import { deepClone } from '@/common/constant'
import D2Dialog from '@/components/d2-dialog'
export default {
name: 'recordDialog',
components: {
D2Dialog
},
data() {
return {
recordList: []
}
},
props: {
relateVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => []
}
},
mounted() {
this.getRecordList()
},
methods: {
getRecordList() {
this.$apis.serviceConfig
.modifyDetailRecord({
serviceCode: this.info.serviceCode
// ...this.storeSearchForm,
// currentPage: this.currentPage,
// pageSize: this.pageSize
})
.then(res => {
console.log(res, 'res')
// this.selectingData = res.list
// this.total = res.total
// this.$nextTick(() => {
// this.recoverySelection()
// })
})
},
handleConfirm() {
this.$emit('handleConfirm')
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss" scoped>
</style>
<!-- 关联门店弹窗 -->
<template>
<d2-dialog title="选择品牌" :is-visible.sync="relateStoreVisible" width="40%" btn-ok-label="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateSku">
<el-form :model="searchForm" ref="relate" :inline="true">
<el-form-item class="formItem" :label="`${item.specificationName}:`" v-for="(item, index) in specificationDetailList" :key="index">
<el-select collapse-tags multiple v-model="searchForm[index]" placeholder="请选择规格" value-key="specificationValue">
<el-option v-for="(options, childIndex) in item.specificationValueList" :key="childIndex" :label="options.specificationValue" :value="options.specificationValue"></el-option>
<!-- <el-option :label="'全部'" :value="0"></el-option> -->
</el-select>
</el-form-item>
<el-button type="primary" @click="handleCurrentChange(1)">搜索</el-button>
</el-form>
<div class="tableHeader">
<div class="title">规格组合列表</div>
<div class="btn">
<el-button @click="handleRelateStart">批量启用</el-button>
<el-button @click="handleRelateStop">批量禁用</el-button>
</div>
</div>
<div class="tableCon">
<div class="tableBox">
<el-table ref="seletingTable" fit :data="tableData" height="464px" class="table" border @select="handleChange" @select-all="handleAll">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<el-table-column :label="`${tableItem.specificationName}`" width="150" v-for="(tableItem, tableIndex) in specificationDetailList" :key="tableIndex" type="index" align="center">
<template slot-scope="scope">
{{ scope.row.specsValueList[tableIndex] }}
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="150px">
<template slot-scope="scope">
<el-switch class="elSwitch" v-model="scope.row.useStatus" active-text="启用" inactive-text="禁用" :active-value="0" :inactive-value="1" @input="clickSwitch(scope)"></el-switch>
</template>
</el-table-column>
</el-table>
</div>
</div>
</d2-dialog>
</template>
<script>
import { deepClone } from '@/common/constant'
import D2Dialog from '@/components/d2-dialog'
export default {
name: 'skuDialog',
components: {
D2Dialog
},
data() {
return {
selectedData: [],
tableData: [],
// 分页
// total: 0,
// currentPage: 1,
// pageSize: 20,
searchForm: []
// tableData: []
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
specificationDetailList: {
type: Array,
default: () => []
},
goodsSpecificationList: {
type: Array,
default: () => []
}
},
filters: {
filterRow(row, index) {
console.log(row)
// return row.specsValueList[index]
}
},
computed() {
return {
// goodsSpecificationListTable() {
// return this.goodsSpecificationList.filter(item => {
// return item
// })
// }
}
},
mounted() {
console.log(this.specificationDetailList, 'specificationDetailList')
this.specificationDetailList.forEach((item, index) => {
this.searchForm.push([])
})
this.tableData = deepClone(this.goodsSpecificationList)
console.log(this.tableData, 'tableData')
},
methods: {
handleCurrentChange() {
let tableData = deepClone(this.goodsSpecificationList)
tableData.forEach((item, idx) => {
this.searchForm.forEach((subItem, index) => {
// if (item.flag)
let flag = false
if (subItem.length > 0) {
if (subItem.includes(item.specsValueList[index])) {
flag = true
}
} else {
flag = true
}
// return subItem.includes(item.specsValueList[index])
item.flag = index == 0 ? flag : flag && item.flag
})
})
console.log(tableData, 'tableData')
this.tableData = tableData.filter(item => {
return item.flag
})
console.log(this.tableData, 'this.tableData')
this.selectedData = [] //清空勾选
},
handleRelateStart() {
this.tableData.forEach(item => {
this.selectedData.forEach(subItem => {
if (JSON.stringify(subItem.specsValueList) === JSON.stringify(item.specsValueList)) {
item.useStatus = 0
}
})
})
},
handleRelateStop() {
this.tableData.forEach(item => {
this.selectedData.forEach(subItem => {
if (JSON.stringify(subItem.specsValueList) === JSON.stringify(item.specsValueList)) {
item.useStatus = 1
}
})
})
},
clickSwitch(row, val) {},
recoverySelection() {
var exitIds = this.selectedData.map(item => JSON.stringify(item.specsValueList))
this.tableData.forEach(item => {
exitIds.includes(JSON.stringify(item.specsValueList)) && this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => JSON.stringify(item.specsValueList) === JSON.stringify(row.specsValueList))
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => JSON.stringify(item.specsValueList) !== JSON.stringify(row.specsValueList)))
// console.log(this.selectedData, ' this.selectedData')
},
handleAll(selection) {
this.tableData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => JSON.stringify(subItem.specsValueList) === JSON.stringify(item.specsValueList))
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
// console.log(this.selectedData, ' this.selectedData')
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => JSON.stringify(item.specsValueList) !== JSON.stringify(row.specsValueList))
const obj = this.tableData.find(v => JSON.stringify(v.specsValueList) == JSON.stringify(row.specsValueList))
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleRelateStoreConfirm() {
this.$emit('handleRelateSkuConfirm', this.tableData)
},
handleRelateStoreClose() {
this.$emit('handleSkuClose')
}
}
}
</script>
<style lang="scss" >
.tableHeader {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.title {
font-weight: 600;
font-size: 16px;
color: #333333;
}
}
.relateSku {
.formItem {
margin-bottom: 10px;
}
}
.relateSku .table {
margin: 0 auto 20px !important;
}
.relateSku .tableCon {
margin-top: 20px;
width: 100%;
}
.service-store .relateSku .el-table .cell,
.d2-form .relateSku .el-table .cell {
line-height: 26px !important;
}
.service-store .relateSku .el-table--medium td,
.d2-form .relateSku .el-table--medium td {
padding: 6px 8px !important;
}
.relateSku .red {
color: red;
}
.relateSku .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
.pagination {
.el-pager {
line-height: 20px;
}
}
.elSwitch {
.el-switch {
// width: 38px;
// height: 20px;
width: 44px;
height: 22px;
margin-left: 40px;
}
.el-switch__label {
position: absolute;
display: none;
color: #606266;
}
/*打开时文字位置设置*/
.el-switch__label--right {
z-index: 1;
left: 40px;
// right: 40px;
}
/*关闭时文字位置设置*/
.el-switch__label--left {
z-index: 1;
// right: 30px;
left: 40px;
}
.el-switch__label * {
line-height: 1.5;
font-size: 16px;
display: inline-block;
}
/*显示文字*/
.el-switch__label.is-active {
display: block;
width: 40px;
}
.el-switch .el-switch__core,
.el-switch .el-switch__label {
width: 50px !important;
}
}
</style>
......@@ -21,6 +21,20 @@
</GLTable>
</div>
<pdf-dialog :isVisible="isPdfVisible" title="合同" :pdfUrl="pdfUrl" @closeDialog="handlePdfClose"></pdf-dialog>
<!-- <recordDialog v-if="isRecordView" :relate-visible="isRecordView" @handleConfirm="handleConfirm" @handleClose="handleClose" :info="recordInfo"></recordDialog> -->
<GLDialog :destroy-on-close="isdestroy" :hasFooter="false" :close-on-click-modal="false" title="修改记录" mode="mid" :visible.sync="isRecordView" :before-close="handleClose">
<div class="record-dialog">
<el-timeline>
<el-timeline-item :class="[{ spec: !index }]" v-for="(item, index) in operationRecordData" :key="index" :timestamp="item.createdDateStr">
{{ item.content }}
</el-timeline-item>
</el-timeline>
<div class="noData" v-if="operationRecordData.length == 0">
<img class="noDataImg" :src="url" v-if="url" alt="" />
<div>暂无数据</div>
</div>
</div>
</GLDialog>
</div>
</template>
......@@ -28,15 +42,22 @@
import * as dayjs from 'dayjs'
import utils from '../../util/util'
import pdfDialog from '@/views/beforeSale/pdfDialog'
// import recordDialog from './components/recordDialog'
import url from '@/assets/empty.png'
export default {
name: 'ExtendedWarranty',
components: {
pdfDialog
// recordDialog
},
data() {
return {
url,
isdestroy: true,
size: 'small',
recordInfo: {},
operationRecordData: [],
isRecordView: false,
buttonList: [
{
type: 'el-button',
......@@ -73,6 +94,18 @@ export default {
listeners: {
click: row => this.handlePdf(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '修改记录'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.handleRecordView(row.scope)
}
}
],
searchForm: {
......@@ -199,10 +232,13 @@ export default {
},
methods: {
handleClose() {
this.isRecordView = !this.isRecordView
},
getSearchlist() {
this.$apis.serviceConfig.getScreeningDataApi({}).then(res => {
if (!res) return
let allObj = {key: '', label: '全部'}
let allObj = { key: '', label: '全部' }
let _index = this.searchFormData.findIndex(item => item.name === 'powerType')
res.powerTypeList = res.powerTypeList.map((item, index) => {
return {
......@@ -256,7 +292,40 @@ export default {
handlePdfClose() {
this.isPdfVisible = !this.isPdfVisible
},
handleRecordView(row) {
// this.recordInfo = row
// this.isRecordView = !this.isRecordView
let params = {
pageNum: 1,
pageSize: 10000,
serviceCode: row.serviceCode
}
this.$apis.serviceConfig.modifyDetailRecord(params).then(res => {
const spaces = ' '.repeat(3)
res?.forEach(val => {
val.createdDateStr = `${val.createdBy}${spaces}${dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss')}`
// 规格A,服务年限5年,,投保成本/元 上架成本/元 嘀加成本/元
// val.content = `规格${val.serviceGrade},服务年限${val.servicePeriod}年,`
val.content = `【${val.recordType == 1 ? '删除' : '修改'}】,投保成本${val.insuranceCost}元,上架成本${val.shelfCost}元,嘀加成本${val.salesCost}元,`
let childContent = ''
if (val.recordType == 1) {
val?.deleteList?.forEach((v, index) => {
// const unit = ['maxPrice', 'minPrice']?.includes(v.field) ? '万元' : ['priceCoefficient']?.includes(v.field) ? '' : '元'
childContent = `${v.fieldName}${v.beforeValue}${v.valueUnit}${index < val?.detailList?.length - 1 ? ',' : ''}`
val.content += childContent
})
} else {
val?.detailList?.forEach((v, index) => {
// const unit = ['maxPrice', 'minPrice']?.includes(v.field) ? '万元' : ['priceCoefficient']?.includes(v.field) ? '' : '元'
childContent = `${v.fieldName}由${v.beforeValue}${v.valueUnit}变为${v.afterValue}${v.valueUnit}${index < val?.detailList?.length - 1 ? ',' : ''}`
val.content += childContent
})
}
})
this.operationRecordData = res || []
this.handleClose()
})
},
// 合同预览
handlePdf(row) {
this.pdfUrl = row?.previewUrl
......@@ -332,15 +401,51 @@ export default {
max-height: calc(80vh - 60px);
padding-left: 12px;
.el-timeline-item {
/deep/ .el-timeline-item__node{
/deep/ .el-timeline-item__node {
width: 8px;
height: 8px;
}
/deep/ .el-timeline-item__tail {
left: 2px;
}
/deep/ .el-timeline-item__wrapper {
.el-timeline-item__content {
color: #333333;
line-height: 23px;
font-size: 14px;
}
.el-timeline-item__timestamp {
color: #999999;
font-size: 12px;
}
}
}
.el-timeline-item:first-child {
/deep/ .el-timeline-item__node {
background: #5850ff !important;
}
}
.noData {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
padding: 104px;
}
}
.record-dialog {
max-height: calc(80vh - 60px);
padding-left: 12px;
.el-timeline-item {
/deep/ .el-timeline-item__node {
width: 8px;
height: 8px;
}
/deep/ .el-timeline-item__tail{
/deep/ .el-timeline-item__tail {
left: 2px;
}
/deep/ .el-timeline-item__wrapper {
.el-timeline-item__content{
.el-timeline-item__content {
color: #333333;
line-height: 23px;
font-size: 14px;
......@@ -356,7 +461,7 @@ export default {
background: #5850ff !important;
}
}
.noData{
.noData {
display: flex;
flex-flow: column;
align-items: center;
......
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!