Commit 623cbbbf by 张立顺

Merge branch 'SAAS+V4.46-1031' of http://192.168.3.233:8090/saas_plus/dj-car-lif…

…e-system into SAAS+V4.46-1031
2 parents fd2fe1e4 fccbf2cf
...@@ -3,200 +3,216 @@ import request from "./request" ...@@ -3,200 +3,216 @@ import request from "./request"
const path = "dj.api." const path = "dj.api."
// 内容管理列表查询条件可见门店列表 // 内容管理列表查询条件可见门店列表
export function getMerchantList(data) { export function getMerchantList (data) {
data.method = `dj.smartcarlife.api.shopMerchant.list` data.method = `dj.smartcarlife.api.shopMerchant.list`
return request(data) return request(data)
} }
// 内容管理列表查询 // 内容管理列表查询
export function getContenttList(data) { export function getContenttList (data) {
data.method = `${path}material.record.page` data.method = `${path}material.record.page`
return request(data) return request(data)
} }
// 内容管理详情 // 内容管理详情
export function getContentDetail(data) { export function getContentDetail (data) {
data.method = `${path}material.record.detail` data.method = `${path}material.record.detail`
return request(data) return request(data)
} }
// 批量启停用内容 // 批量启停用内容
export function batchOperaterContent(data) { export function batchOperaterContent (data) {
data.method = `${path}material.record.batch.operate` data.method = `${path}material.record.batch.operate`
return request(data) return request(data)
} }
// 删除内容 // 删除内容
export function delContent(data) { export function delContent (data) {
data.method = `${path}material.record.delete` data.method = `${path}material.record.delete`
return request(data) return request(data)
} }
// 统计列表 // 统计列表
export function getStatisticsList(data) { export function getStatisticsList (data) {
data.method = `dj.api.customer.dynamic.record.page` data.method = `dj.api.customer.dynamic.record.page`
return request(data) return request(data)
} }
// 导出统计列表 // 导出统计列表
export function exportStatisticsList(data) { export function exportStatisticsList (data) {
data.method = `dj.api.customer.dynamic.record.page.export` data.method = `dj.api.customer.dynamic.record.page.export`
return request(data) return request(data)
} }
// 新增内容 // 新增内容
export function addContent(data) { export function addContent (data) {
data.method = `${path}material.record.add` data.method = `${path}material.record.add`
return request(data, "post") return request(data, "post")
} }
// 编辑内容 // 编辑内容
export function updateContent(data) { export function updateContent (data) {
data.method = `${path}material.record.update` data.method = `${path}material.record.update`
return request(data, "post") return request(data, "post")
} }
// 获取会员权益/升级和积分商城 门店 // 获取会员权益/升级和积分商城 门店
export function getAllMerchantList(data) { export function getAllMerchantList (data) {
data.method = `dj.api.merchant.page` data.method = `dj.api.merchant.page`
return request(data, "POST") return request(data, "POST")
} }
// 获取精品升级/次新车转化/售后众筹 门店 // 获取精品升级/次新车转化/售后众筹 门店
export function getMerchantListByScene(data) { export function getMerchantListByScene (data) {
data.method = `dj.api.scenemerchantref.listShop4sByRef.page` data.method = `dj.api.scenemerchantref.listShop4sByRef.page`
return request(data) return request(data)
} }
// 获取精品升级/次新车转化/售后众筹 门店 // 获取精品升级/次新车转化/售后众筹 门店
export function getListShop4sByRef(data) { export function getListShop4sByRef (data) {
data.method = `dj.api.scenemerchantref.listShop4sByRef` data.method = `dj.api.scenemerchantref.listShop4sByRef`
return request(data) return request(data)
} }
// 获取品牌列表 // 获取品牌列表
export function getBrandList(data) { export function getBrandList (data) {
data.method = `dj.api.smartcarlife.common.car.brand.page` data.method = `dj.api.smartcarlife.common.car.brand.page`
return request(data) return request(data)
} }
// 分页查询标签员工 // 分页查询标签员工
export function getListLabelStaffPage(data) { export function getListLabelStaffPage (data) {
data.method = `dj.api.smartcarlife.contentManagerTask.listLabelStaffPage` data.method = `dj.api.smartcarlife.contentManagerTask.listLabelStaffPage`
return request(data) return request(data)
} }
// 员工群发-分页查询列表 // 员工群发-分页查询列表
export function contentManagerTaskPage(data) { export function contentManagerTaskPage (data) {
data.method = `dj.api.smartcarlife.contentManagerTask.page` data.method = `dj.api.smartcarlife.contentManagerTask.page`
return request(data, "POST") return request(data, "POST")
} }
// 员工群发-删除记录 // 员工群发-删除记录
export function deleteTaskById(data) { export function deleteTaskById (data) {
data.method = `dj.api.smartcarlife.contentManagerTask.deleteById` data.method = `dj.api.smartcarlife.contentManagerTask.deleteById`
return request(data, "POST") return request(data, "POST")
} }
// 员工群发-分页查询内容管理统计信息 // 员工群发-分页查询内容管理统计信息
export function getStatisticPage(data) { export function getStatisticPage (data) {
data.method = `dj.api.smartcarlife.contentManagerTask.statistic.page` data.method = `dj.api.smartcarlife.contentManagerTask.statistic.page`
return request(data, "POST") return request(data, "POST")
} }
// 员工群发-添加/修改记录 // 员工群发-添加/修改记录
export function insertOrUpdate(data) { export function insertOrUpdate (data) {
data.method = `dj.api.smartcarlife.contentManagerTask.insertOrUpdate` data.method = `dj.api.smartcarlife.contentManagerTask.insertOrUpdate`
return request(data, "POST") return request(data, "POST")
} }
// 根据ID查询详细信息 // 根据ID查询详细信息
export function contentManagerTaskById(data) { export function contentManagerTaskById (data) {
data.method = `dj.api.smartcarlife.contentManagerTask.getById` data.method = `dj.api.smartcarlife.contentManagerTask.getById`
return request(data, "POST") return request(data, "POST")
} }
// 获取接待场景 // 获取接待场景
export function receptionSceneList(data) { export function receptionSceneList (data) {
data.method = "dj.api.material.reception.scene.list" data.method = "dj.api.material.reception.scene.list"
return request(data, "POST") return request(data, "POST")
} }
// 获取客户标签树 // 获取客户标签树
export function getLabelList(data) { export function getLabelList (data) {
data.method = "dj.api.material.customer.label.list" data.method = "dj.api.material.customer.label.list"
return request(data, "POST") return request(data, "POST")
} }
// 单一商品 // 单一商品
export function listAllInWithPage(data) { export function listAllInWithPage (data) {
data.method = "dj.api.smartcarlife.upgradeGoods.listAllInWithPage" data.method = "dj.api.smartcarlife.upgradeGoods.listAllInWithPage"
return request(data, "POST") return request(data, "POST")
} }
// 套餐商品 // 套餐商品
export function allInPage(data) { export function allInPage (data) {
data.method = "dj.api.smartcarlife.merchantPackageGoodsInfo.allInPage" data.method = "dj.api.smartcarlife.merchantPackageGoodsInfo.allInPage"
return request(data, "POST") return request(data, "POST")
} }
// 获取产品词条列表 // 获取产品词条列表
export function productTextPage(data) { export function productTextPage (data) {
data.method = "dj.api.material.product.text.page" data.method = "dj.api.material.product.text.page"
return request(data, "POST") return request(data, "POST")
} }
// 分页获取产品词条列表 // 分页获取产品词条列表
export function productPage(data) { export function productPage (data) {
data.method = `dj.api.material.product.text.page` data.method = `dj.api.material.product.text.page`
return request(data, "POST") return request(data, "POST")
} }
// 获取产品词条详情 // 获取产品词条详情
export function productDetail(data) { export function productDetail (data) {
data.method = `dj.api.material.product.text.detail` data.method = `dj.api.material.product.text.detail`
return request(data, "POST") return request(data, "POST")
} }
// 删除产品词条 // 删除产品词条
export function productDelete(data) { export function productDelete (data) {
data.method = `dj.api.material.product.text.delete` data.method = `dj.api.material.product.text.delete`
return request(data, "POST") return request(data, "POST")
} }
// 保存产品词条 // 保存产品词条
export function productSave(data) { export function productSave (data) {
data.method = `dj.api.material.product.text.save` data.method = `dj.api.material.product.text.save`
return request(data, "POST") return request(data, "POST")
} }
// 更新产品词条 // 更新产品词条
export function productUpdate(data) { export function productUpdate (data) {
data.method = `dj.api.material.product.text.update` data.method = `dj.api.material.product.text.update`
return request(data, "POST") return request(data, "POST")
} }
// 查询接待素材商户配置 // 查询接待素材商户配置
export function materialPage(data) { export function materialPage (data) {
data.method = `dj.api.smartcarlife.recepiton.material.page` data.method = `dj.api.smartcarlife.recepiton.material.page`
return request(data, "post", [], "", "/rop-dj-car-boutique/router") return request(data, "post", [], "", "/rop-dj-car-boutique/router")
} }
// 查询门店接待素材详情 // 查询门店接待素材详情
export function materialDetail(data) { export function materialDetail (data) {
data.method = `dj.api.smartcarlife.recepiton.material.merchant.detail` data.method = `dj.api.smartcarlife.recepiton.material.merchant.detail`
return request(data, "post", [], "", "/rop-dj-car-boutique/router") return request(data, "post", [], "", "/rop-dj-car-boutique/router")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function recepitonUpdate(data) { export function recepitonUpdate (data) {
data.method = `dj.api.smartcarlife.recepiton.material.merchant.saveOrUpdate` data.method = `dj.api.smartcarlife.recepiton.material.merchant.saveOrUpdate`
return request(data, "post", [], "", "/rop-dj-car-boutique/router") return request(data, "post", [], "", "/rop-dj-car-boutique/router")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function findDictData(data) { export function findDictData (data) {
data.method = `merchants.api.menu.findDictData` data.method = `merchants.api.menu.findDictData`
return request(data, "post") return request(data, "post")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function deleteDictData(data) { export function deleteDictData (data) {
data.method = `merchants.api.menu.deleteDictData` data.method = `merchants.api.menu.deleteDictData`
return request(data, "post") return request(data, "post")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function updateDictData(data) { export function updateDictData (data) {
data.method = `merchants.api.menu.updateDictData` data.method = `merchants.api.menu.updateDictData`
return request(data, "post") return request(data, "post")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function saveDictData(data) { export function saveDictData (data) {
data.method = `merchants.api.menu.saveDictData` data.method = `merchants.api.menu.saveDictData`
return request(data, "post") return request(data, "post")
} }
/**客户标签列表 */
export function getCustomerLabelPage (data) {
data.method = `dj.api.material.customer.label.page`
return request(data, "post")
}
/**新增客户标签 */
export function addCustomerLabel (data) {
data.method = `dj.api.material.customer.label.add`
return request(data, "post")
}
/**修改客户标签 */
export function updateCustomerLabel (data) {
data.method = `dj.api.material.customer.label.update`
return request(data, "post")
}
\ No newline at end of file \ No newline at end of file
<!-- 表格+分页 --> <!-- 表格+分页 -->
<template> <template>
<div class="d2-table"> <div class="d2-table">
<el-table :ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'" <el-table
:ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'"
:data="getListApi ? data : tableData" :data="getListApi ? data : tableData"
:row-key="tableParams.mutiSelectUniqueKey || ''" :row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading" v-loading="loading"
...@@ -11,21 +12,29 @@ ...@@ -11,21 +12,29 @@
@selection-change="handleSelect" @selection-change="handleSelect"
:tree-props="{ children: 'upgradeGoodsList' }" :tree-props="{ children: 'upgradeGoodsList' }"
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
v-bind="$attrs"> v-bind="$attrs"
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" >
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection" type="selection"
align="center" align="center"
:selectable="selectableFn" :selectable="selectableFn"
width="55" /> width="55"
<el-table-column v-if="tableParams.singleSelectUniqueKey" />
<el-table-column
v-if="tableParams.singleSelectUniqueKey"
align="center" align="center"
width="55"> width="55"
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="single-button" <slot
:scope="scope.row" /> name="single-button"
:scope="scope.row"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="hasNum" <el-table-column
v-if="hasNum"
align="center" align="center"
width="60px" width="60px"
label="序号" label="序号"
...@@ -39,8 +48,10 @@ ...@@ -39,8 +48,10 @@
1) * 1) *
(pagination.pageSize ? pagination.pageSize : page.pageSize) + (pagination.pageSize ? pagination.pageSize : page.pageSize) +
1 1
" /> "
<el-table-column v-for="(item, index) in tableParams.tableColumns" />
<el-table-column
v-for="(item, index) in tableParams.tableColumns"
:key="index" :key="index"
:label="item.label" :label="item.label"
:prop="item.prop" :prop="item.prop"
...@@ -49,22 +60,27 @@ ...@@ -49,22 +60,27 @@
:align="item.align || 'center'" :align="item.align || 'center'"
:sortable="item.sortable" :sortable="item.sortable"
:render-header="item.renderHeader" :render-header="item.renderHeader"
:show-overflow-tooltip="item.showOverFlow"> :show-overflow-tooltip="item.showOverFlow"
>
<template slot="header"> <template slot="header">
<span>{{ item.label }}</span> <span>{{ item.label }}</span>
<table-head-search v-if="item.optionConfig" <table-head-search
v-if="item.optionConfig"
:search-form="headSearchForm" :search-form="headSearchForm"
:option-config="item.optionConfig" :option-config="item.optionConfig"
:base-data="baseData" :base-data="baseData"
@handleTableHeadChange="handleTableHeadChange" /> @handleTableHeadChange="handleTableHeadChange"
/>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<slot v-if="item.addHtml" <slot
v-if="item.addHtml"
:name="item.addHtml" :name="item.addHtml"
:scope="scope.row" :scope="scope.row"
:index="scope.$index" :index="scope.$index"
:prop="item.prop" :prop="item.prop"
:width="item.width" /> :width="item.width"
/>
<template v-else-if="item.type == 'ownSerialNum'"> <template v-else-if="item.type == 'ownSerialNum'">
<span>{{ <span>{{
scope.row[item.prop] >= 0 scope.row[item.prop] >= 0
...@@ -81,16 +97,22 @@ ...@@ -81,16 +97,22 @@
}}</span> }}</span>
</template> </template>
<template v-else-if="item.tagLabel"> <template v-else-if="item.tagLabel">
<el-tag v-if="!item.tagName" <el-tag
v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]" :type="tableParams.tag.type[scope.row[item.prop]]"
v-text="tableParams.tag.label[scope.row[item.prop]]" /> v-text="tableParams.tag.label[scope.row[item.prop]]"
<el-tag v-else />
<el-tag
v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]" :type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]" /> v-text="tableParams[item.tagName].label[scope.row[item.prop]]"
/>
</template> </template>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
<span v-if="item.html" <span
v-html="item.formatter(scope.row)" /> v-if="item.html"
v-html="item.formatter(scope.row)"
/>
<template v-if="!item.html"> <template v-if="!item.html">
<span :class="item.className ? item.className(scope.row) : ''" /> <span :class="item.className ? item.className(scope.row) : ''" />
<span v-text="item.formatter(scope.row)" /> <span v-text="item.formatter(scope.row)" />
...@@ -122,30 +144,41 @@ ...@@ -122,30 +144,41 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="tableParams.tableOption" <el-table-column
v-if="tableParams.tableOption"
label="操作" label="操作"
fixed="right" fixed="right"
:align="tableParams.tableOption.align || 'center'" :align="tableParams.tableOption.align || 'center'"
:width="tableParams.tableOption.width || 'auto'"> :width="tableParams.tableOption.width || 'auto'"
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="auth-button" <slot
name="auth-button"
:scope="scope.row" :scope="scope.row"
:index="scope.$index" /> :index="scope.$index"
<slot name="auth-button-other" />
<slot
name="auth-button-other"
:scope="scope.row" :scope="scope.row"
:index="scope.$index" /> :index="scope.$index"
/>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty" <div
class="emptyBg"> slot="empty"
<img class="noDataImg" class="emptyBg"
>
<img
class="noDataImg"
:src="noDataImg" :src="noDataImg"
v-if="noDataImg" /> v-if="noDataImg"
/>
{{ noDataText }} {{ noDataText }}
</div> </div>
</el-table> </el-table>
<el-pagination v-if="hasPage" <el-pagination
v-if="hasPage"
background background
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -153,7 +186,8 @@ ...@@ -153,7 +186,8 @@
:page-sizes="[10, 20, 30, 40]" :page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize" :page-size="page.pageSize"
:total="getListApi ? total : tableTotal" :total="getListApi ? total : tableTotal"
:layout="layout" /> :layout="layout"
/>
</div> </div>
</template> </template>
...@@ -161,7 +195,7 @@ ...@@ -161,7 +195,7 @@
import TableHeadSearch from "./TableHeadSearch" import TableHeadSearch from "./TableHeadSearch"
export default { export default {
name: "D2Table", name: "D2Table",
data() { data () {
return { return {
loading: false, loading: false,
data: [], data: [],
...@@ -318,7 +352,7 @@ export default { ...@@ -318,7 +352,7 @@ export default {
} }
}, },
mounted() { mounted () {
const btn = document.getElementById(this.tableParams.btnId) const btn = document.getElementById(this.tableParams.btnId)
btn && btn.addEventListener("click", this.refreshEmit) btn && btn.addEventListener("click", this.refreshEmit)
this.getListApi && this.refreshTable() this.getListApi && this.refreshTable()
...@@ -326,32 +360,32 @@ export default { ...@@ -326,32 +360,32 @@ export default {
methods: { methods: {
// 排序 // 排序
sortChange({ column, prop, order }) { sortChange ({ column, prop, order }) {
this.sortColum = order ? prop : "" this.sortColum = order ? prop : ""
this.sort = order this.sort = order
this.refreshTable(true, true) this.refreshTable(true, true)
}, },
// 多选 // 多选
handleSelect(val) { handleSelect (val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val this.mutiSelectArr[this.tableParams.mutiSelectName] = val
// 多选 // 多选
this.$emit("selectionTable", val) this.$emit("selectionTable", val)
}, },
// 清空多选 // 清空多选
clearMutiSelect() { clearMutiSelect () {
this.mutiSelectArr[this.tableParams.mutiSelectName] = [] this.mutiSelectArr[this.tableParams.mutiSelectName] = []
this.$refs[this.tableParams.mutiSelectName + "MutiTable"].clearSelection() this.$refs[this.tableParams.mutiSelectName + "MutiTable"].clearSelection()
}, },
// 发布事件,以期查询条件改变后,页面图表需要刷新 // 发布事件,以期查询条件改变后,页面图表需要刷新
refreshEmit() { refreshEmit () {
this.$emit("searchChange") this.$emit("searchChange")
this.refreshTable(true, true) this.refreshTable(true, true)
}, },
refreshTable(clearMuti = false, resetCurrentPage = false) { refreshTable (clearMuti = false, resetCurrentPage = false) {
this.beforeSearchFn().then((res) => { this.beforeSearchFn().then((res) => {
// console.log(res) // console.log(res)
// 清空多选 // 清空多选
...@@ -444,12 +478,12 @@ export default { ...@@ -444,12 +478,12 @@ export default {
}, },
// 表头搜索项-改变 // 表头搜索项-改变
handleTableHeadChange(obj) { handleTableHeadChange (obj) {
this.$emit("handleTableHeadChange", obj) this.$emit("handleTableHeadChange", obj)
}, },
// 每页条数 // 每页条数
handleSizeChange(value) { handleSizeChange (value) {
this.page.pageSize = value this.page.pageSize = value
this.getListApi this.getListApi
? this.refreshTable(false) ? this.refreshTable(false)
...@@ -457,18 +491,18 @@ export default { ...@@ -457,18 +491,18 @@ export default {
}, },
// 页码 // 页码
handleCurrentChange(value) { handleCurrentChange (value) {
this.page.currentPage = value this.page.currentPage = value
this.getListApi this.getListApi
? this.refreshTable(false) ? this.refreshTable(false)
: this.$emit("refreshTable", this.page) : this.$emit("refreshTable", this.page)
}, },
// 重置请求 // 重置请求
resetRefreshTable() { resetRefreshTable () {
this.refreshTable_noApi() this.refreshTable_noApi()
this.refreshTable() this.refreshTable()
}, },
refreshTable_noApi() { refreshTable_noApi () {
this.page = { this.page = {
pageSize: 10, pageSize: 10,
currentPage: 1 currentPage: 1
......
...@@ -306,5 +306,29 @@ export const routerName = { ...@@ -306,5 +306,29 @@ export const routerName = {
}, },
auth: [], auth: [],
component: _import("contentManager/packageConfig/edit") component: _import("contentManager/packageConfig/edit")
} },
91315: {
path: "/customerTags",
name: "customerTags",
meta: {
title: "客户标签",
authId: "91315",
parentId: "913",
cache: false
},
auth: [],
component: _import("contentManager/customerTags/index")
},
91317: {
path: "/customerFile",
name: "customerFile",
meta: {
title: "客户档案",
authId: "91317",
parentId: "913",
cache: false
},
auth: [],
component: _import("contentManager/customerFile/index")
},
} }
<template>
<div>
客户档案
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<d2-dialog
title="新增分类"
:is-visible="visible"
width="40%"
@closeDialog="handleClose"
@confirmDialog="handleConfirm"
>
<div
class="classify-box"
v-loading="loading"
>
<el-form
ref="classifyForm"
:model="dataForm"
:rules="formRules"
label-width="154px"
size="small"
>
<el-form-item
label="一级分类:"
prop="labelName"
>
<el-input
v-model="dataForm.labelName"
placeholder="请输入"
maxlength="30"
/>
</el-form-item>
<el-form-item
label="业务类型:"
prop="scene"
>
<el-select
v-model="dataForm.scene"
placeholder="请选择"
:disabled="currentItem.id"
>
<el-option
v-for="(subItem, subIndex) in businessTypeList"
:key="subIndex"
:value="subItem.id"
:label="subItem.label"
></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</d2-dialog>
</template>
<script type='text/ecmascript-6'>
import { deepClone } from '@/common/util'
import { SCENE_OPTIONS } from "../../constant"
import { addCustomerLabel, updateCustomerLabel } from '@api/contentManager'
export default {
name: 'classifyDialog',
props: {
visible: Boolean,
currentItem: Object
},
data () {
return {
loading: false,
businessTypeList: deepClone(SCENE_OPTIONS),
dataForm: {
labelName: '',
scene: ''
},
formRules: {
labelName: [{ required: true, message: '请输入一级分类', trigger: 'change' }],
scene: [{ required: true, message: '请选择业务类型', trigger: 'change' }],
}
}
},
watch: {
currentItem: {
immediate: true,
handler (newval) {
this.dataForm.scene = newval.scene
this.dataForm.labelName = newval.labelName
}
}
},
mounted () {
},
methods: {
handleClose () {
this.dataForm = this.$options.data.call(this).dataForm
this.$refs.classifyForm.resetFields()
this.loading = false
this.$emit('update:visible', false)
this.$emit('update:currentItem', {})
},
handleConfirm () {
this.$refs.classifyForm.validate(async (valid) => {
if (valid) {
try {
let targetApiName = addCustomerLabel,
params = {
level: 1,
...this.dataForm
},
{ id } = this.currentItem
if (id) {
targetApiName = updateCustomerLabel
params = {
id,
labelName: this.dataForm.labelName
}
}
this.loading = true
const res = await targetApiName(params)
console.log(res)
if (res) {
this.$message.success(id ? '修改成功' : '保存成功')
this.$emit('refresh')
this.handleClose()
this.loading = false
}
} catch (error) {
console.log(error)
this.loading = false
this.$message.error(error)
}
}
})
},
}
}
</script>
<style scoped lang='scss'>
.el-input,
.el-input--small {
width: 215px;
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!