Commit 099e3ead by 吴娟华

Merge branch 'v1.1.1' of http://192.168.3.233:8090/glsx-business/dj-car-life-system into v1.1.1

2 parents 066b4cc9 4190b9cc
......@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq
* @Last Modified time: 2021-01-12 10:58:12
* @Last Modified time: 2021-01-20 11:24:55
*/
// import { LOGIN_URL, REG_URL, ROLE_LIST_URL } from '@/api/sys.account'
......@@ -205,3 +205,16 @@ export const rangePickerOptions = {
return false
}
}
/**
* 时间控件-(0-30天内的日期)
*/
export const appointDays = 35
export const afterTodayOptions = {
disabledDate(date) {
if (date < new Date(new Date().toLocaleDateString()) || (date > new Date(new Date().setDate(new Date().getDate() + (appointDays - 1))))) {
return true
}
return false
}
}
......@@ -138,6 +138,22 @@
</el-input>
</el-form-item>
</div>
<div class="w-50">
<el-form-item label="零售价格">
<el-input
v-model="proInfo.retailPrice"
placeholder="请输入零售价格"
clearable
class="dis-in-block"
@input="handleRetailPrice"
>
<i
slot="suffix"
class="input-suffix"
>元</i>
</el-input>
</el-form-item>
</div>
</el-form>
</div>
<div class="relateProDialog flex">
......@@ -195,6 +211,23 @@
style="width: calc(100% - 180px)"
>
<div class="w-50">
<el-form-item
label="阳光激励费"
title="每笔订单分配给合作商的金额结算比例。"
prop="incentiveCost"
>
<el-input
v-model="proInfo.incentiveCost"
@input="handleIncentiveCost"
placeholder="请输入阳光激励费"
class="dis-in-block"
>
<i
slot="suffix"
class="input-suffix"
>元</i>
</el-input>
</el-form-item>
</div>
<div class="w-50">
<el-form-item
......@@ -220,7 +253,7 @@
<span
class="btn-txt"
slot="btn-start"
>提示:配置的分润规则和比例将优先根据门店打开方式结算。</span>
>提示:配置的分润规则和比例将优先根据门店打款方式结算。</span>
</d2-dialog>
</template>
......@@ -250,7 +283,14 @@ export default {
rules: {
goodsCode: [{ required: true, message: '请选择关联升级商品', trigger: 'change' }],
upgradePrice: [{ required: true, message: '请输入建议升级价', trigger: 'blur' }],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }],
shopPrice: [
{ required: true, message: '请输入到店价', trigger: 'blur' },
{ trigger: 'blur',
validator: (rule, value, callback) => {
(+value > +this.proInfo.upgradePrice) ? callback(new Error('到店价需小于建议升级价格')) : callback()
}
}
],
profitType: [{ required: true, message: '请输入分润规则', trigger: 'change' }],
profitValue: [{ required: true, message: '请输入分润比例', trigger: 'blur' }],
partnerProfitPer: [{ required: true, message: '请输入分润比例', trigger: 'blur' }]
......@@ -287,8 +327,6 @@ export default {
mounted() {
this.proInfo = _.cloneDeep(this.originProInfo) || _.cloneDeep(this.proInfo)
// console.log(this.proInfo)
// console.log(this.proList)
},
methods: {
......@@ -298,10 +336,8 @@ export default {
this.proInfo.goodsCode = targetItem.goodsCode
this.proInfo.thumbUrl = targetItem.thumbUrl
this.proInfo.goodsTypeName = targetItem.goodsTypeName
// console.log(value)
},
handleRelateProConfirm() {
console.log(this.proInfo)
this.$refs.proRuleForm1.validate(valid1 => {
this.$refs.proRuleForm2.validate(valid2 => {
this.$refs.proRuleForm3.validate(valid3 => {
......@@ -338,6 +374,14 @@ export default {
handleExtraCost(newVal) {
this.proInfo.extraCost = limitPrice(newVal, this.oldVal.extraCost, 8, 2)
this.oldVal.extraCost = this.proInfo.extraCost
},
handleRetailPrice(newVal) {
this.proInfo.retailPrice = limitPrice(newVal, this.oldVal.retailPrice, 6, 2)
this.oldVal.retailPrice = this.proInfo.retailPrice
},
handleIncentiveCost(newVal) {
this.proInfo.incentiveCost = limitPrice(newVal, this.oldVal.incentiveCost, 6, 2)
this.oldVal.incentiveCost = this.proInfo.incentiveCost
}
}
}
......@@ -363,7 +407,8 @@ export default {
}
.relatePro .btn-txt {
display: inline-block;
margin-right: 154px;
font-size: 14px;
margin-right: 209px;
color: #606266;
}
.relatePro .input-suffix {
......
......@@ -27,9 +27,6 @@
align="center"
:selectable="selectable"
></el-table-column>
<!-- <el-table-column>
<template slot-scope="scope">{{scope.row.beServed}}</template>
</el-table-column> -->
<el-table-column
prop="merchantName"
label="门店名称"
......@@ -95,11 +92,6 @@ export default {
type: Object,
default: () => { }
}
// 限制个数
// maxLength: {
// type: String,
// default: '-1'
// }
},
mounted() {
......@@ -123,7 +115,6 @@ export default {
currentPage: this.currentPage,
pageSize: this.pageSize
}).then(res => {
console.log(res)
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
......@@ -133,39 +124,11 @@ export default {
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId)
// var item = selection.find(item => item.merchantId === row.merchantId)
// if (addOrDelete) {
// if (this.maxLength !== '-1' && this.selectedData.length > this.maxLength - 1) {
// this.$message.error(`只能选择${this.maxLength}个门店`)
// this.$refs.seletingTable.toggleRowSelection(item, false)
// return true
// }
// this.selectedData.push(row)
// return true
// }
// this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
},
handleAll(selection) {
// if (this.selectingData[0].hasOwnProperty('beServed') && ((selection.map(i => i.beServed === true).length + this.selectedData.length) > (this.maxLength - 1)) && selection.length) {
// this.$message.error(`只能选择${this.maxLength}个门店`)
// this.selectingData.forEach(item => {
// this.$refs.seletingTable.toggleRowSelection(item, false)
// })
// console.log(this.selectedData)
// return true
// }
// this.selectingData.forEach(item => {
// var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
// var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
// if (selection.length && (isExit === -1) && !isServed) {
// this.selectedData.push(item)
// } else if (!selection.length && (isExit !== -1) && !isServed) {
// this.selectedData.splice(isExit, 1)
// }
// })
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
......
<!-- 搜索 -->
<template>
<div class="d2-search">
<!-- <el-col
v-if="hasTitle"
class="d2-search-title"
>搜索条件</el-col> -->
<el-form
:inline="true"
v-model="searchForm"
......@@ -92,9 +88,7 @@ export default {
}
},
mounted() {
// console.log(this.formData)
},
mounted() { },
methods: {
// 选择框-添加其他属性
......@@ -109,20 +103,9 @@ export default {
.d2-search {
min-width: 922px;
}
/* .d2-search .d2-search-title {
font-size: 18px;
font-weight: bold;
color: #0947c6;
height: 48px;
line-height: 48px;
padding: 0 20px;
border-bottom: 1px solid #e7eaec;
margin-bottom: 30px !important;
} */
.d2-search .d2-search-block {
padding: 16px 40px 0;
}
/* .d2-search .d2-search-block */
.d2-search .el-form-item {
width: 65%;
}
......
......@@ -255,11 +255,9 @@ export default {
optionLabel: 'merchantName',
optionsName: 'storeIdList',
changeAttr: (value, targetItem) => {
// console.log(value)
this.searchForm.baseGoodsId = ''
if (value) {
getGoods({ 'merchantId': value }).then(res => {
// console.log(res)
this.baseData.goodList = res || []
this.baseData.goodList.forEach(item => {
item.goodsName = item.goodsInfo.goodsName
......@@ -350,11 +348,8 @@ export default {
},
mounted() {
// yqMerchantId
// console.log(this.userInfo)
if (this.userInfo.beSuper) {
getParkStore({}).then(res => {
// console.log(res)
this.baseData.parkServiceList = res
this.getOptionsList()
})
......@@ -375,7 +370,6 @@ export default {
keyword: this.searchForm.keyword,
upgradeFinishFlag: this.searchForm.upgradeFinishFlag
}
// console.log(this.searchForm)
this.searchForm.baseGoodsId && (params.baseGoodsCodeList = [this.searchForm.baseGoodsId])
this.searchForm.customerStatus && (params.statusList = this.customerStatusObj[this.searchForm.customerStatus])
this.searchForm.source && (params.sourceList = this.sourceStatusObj[this.searchForm.source])
......@@ -391,7 +385,6 @@ export default {
},
getOrderCount() {
orderCount({}).then(res => {
// console.log(res)
this.count = res
})
},
......@@ -401,9 +394,7 @@ export default {
...this.page,
...params
}
// console.log(params)
getList(params).then(res => {
// console.log(res)
this.tableData = res.list
this.merchantMaxLen = Math.max(...this.tableData.map(item => item.merchantName.length))
this.page.pageNum = res.pageNum
......@@ -480,12 +471,8 @@ export default {
width: 100%;
height: 10px;
text-align: center;
/* border-bottom: 1px solid #dcdfe6; */
cursor: pointer;
}
.customer-list .hide-search {
/* margin-top: 20px; */
}
.customer-list .custom-input {
display: inline-block;
width: 220px;
......
......@@ -452,7 +452,6 @@ export default {
computed: {},
mounted() {
// console.log(this.userInfo)
this.addOrEdit = this.$route.params.addOrEdit
this.getAllVehicleBrand()
this.getBaseData()
......@@ -462,10 +461,8 @@ export default {
if (!this.userInfo.beSuper && this.addOrEdit === 'add') {
this.getServiceStore(this.userInfo.detail.merchantId)
}
// this.getServiceStore()
if (this.addOrEdit === 'edit') {
this.form = _.cloneDeep(this.$route.params.form)
// console.log(this.form)
this.isDisabled = (this.form.operStatus !== 1)
this.form.customerSex = this.form.customerSex ? (this.form.customerSex + '') : ''
this.userInfo.beSuper && (this.form.sellerMerchantId = this.form.yqMerchantId)
......@@ -540,7 +537,6 @@ export default {
/** 根据门店商户号获取基础商品列表 */
const paramsForGood = { 'merchantId': merchantId }
getGoods(paramsForGood).then(res => {
// console.log(res)
this.goodList = res || []
this.hasProError = !res.length
fn()
......@@ -624,14 +620,12 @@ export default {
},
changeCarType(id) {
// this.key = new Date()
const o = this.carTypeOptions.find(k => k.id == id)
this.form.carTypeName = o.name
},
searchGoods() {
/** 根据门店商户号获取基础商品列表 */
// let paramsForGood = {'merchantId': this.form.merchantId,'goodsType':this.searchForm.goodsType}
const paramsForGood = { 'merchantId': this.form.merchantId }
getGoods(paramsForGood).then(res => {
this.goodList = res || []
......@@ -674,16 +668,11 @@ export default {
}
}
}
// if (!valid) {
// return false
// }
const params = {}
const customer = {
...this.form
}
// const goods = []
/** 判断是否选择销售顾问 */
// console.log(this.form.userId)
if (this.form.userId) {
this.showChooseCusError = false
} else {
......@@ -691,7 +680,6 @@ export default {
this.showChooseCusError = true
return false
}
// console.log(this.baseGoodsIds)
/** 判断是否选择商品 */
if (this.baseGoodsIds.length > 0) {
......
......@@ -205,7 +205,6 @@ export default {
optionLabel: 'merchantName',
optionsName: 'storeIdList',
changeAttr: (value, targetItem) => {
// console.log(value)
this.searchForm.userId = ''
this.searchForm.baseGoodsId = ''
if (value) {
......@@ -215,10 +214,8 @@ export default {
this.getOptionsList()
})
getGoods({ 'merchantId': value }).then(res => {
// console.log(res)
this.baseData.goodList = res || []
this.baseData.goodList.forEach(item => {
// item.goodsTypeName = item.goodsInfo.goodsTypeName
item.goodsName = item.goodsInfo.goodsName
})
this.getOptionsList()
......@@ -323,9 +320,7 @@ export default {
getOrderTotal(params).then(res => {
this.total = res
})
// console.log(this.userInfo.detail.merchantId)
getParkStore({}).then(res => {
// console.log(res)
this.baseData.parkServiceList = res
this.getOptionsList()
})
......@@ -463,11 +458,9 @@ export default {
})
},
handleEdit(data) {
// console.log(data)
getOrderDetail({
orderCode: data.orderCode
}).then(res => {
// console.log(res)
this.close({ tagName: '/editCustomer' })
this.$router.push({
name: 'editCustomer',
......
......@@ -68,20 +68,6 @@
slot-scope="scope"
:data="scope.scope"
></auth-button>
<!-- <auth-button
v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
></auth-button>
<el-button
v-else
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
type="text"
@click="handleUpOrDown"
>{{scope.scope.state ? '上架' : '下架'}}</el-button> -->
</d2-table>
</div>
<d2-dialog
......@@ -254,7 +240,6 @@ export default {
},
beforeSearchFn() {
return new Promise(resolve => {
// console.log('搜索前操作--')
if (this.searchForm.createTime) {
this.searchForm.startDate = new Date(this.searchForm.createTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
this.searchForm.endDate = new Date(this.searchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
......@@ -285,7 +270,6 @@ export default {
const tHeader = ['序号', '商品ID', '商品名称', '分类', '品牌商', '属性', '商品状态', '创建时间', '绑定商品数(件)', '分配门店数(家)']
const fieldVal = ['index', 'goodsCode', 'goodsName', 'goodsTypeName', 'brandMerchantName', 'attribute', 'status', 'createdDate', 'upgradeGoodsNum', 'merchantNum']
exportBaseList(this.searchForm).then(res => {
// console.log(res)
require.ensure([], () => {
const data = this.formatJson(fieldVal, res)
exportJsonToExcel(tHeader, data, '基础商品列表')
......@@ -306,16 +290,6 @@ export default {
})
},
handleUpOrDown(row) {
// 判断-商品异常(1、基础商品异常;2、升级商品异常)
// var upgradeError = row.upgradeGoodsList ? !row.upgradeGoodsList.map(item => item.goodsInfo.goodsName).every(i => !!i) : false
// if (!row.goodsInfo.goodsName || upgradeError) {
// this.$confirm('商品异常,请编辑后重试!', '提示', {
// confirmButtonText: '确定',
// showCancelButton: false,
// type: 'warning'
// }).then(() => { })
// return true
// }
!row.status
? baseGoodsUpOrDown({ baseGoodsId: row.id, shelfStatus: 1 }).then(res => {
this.notice.okTips()
......
......@@ -50,152 +50,96 @@ export default {
rules: {
yqMerchantId: [{ required: true, message: '请选择园区店', trigger: 'change' }],
goodsCode: [{ required: true, message: '请选择产品名称', trigger: 'change' }],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }],
shopPrice: [
{ required: true, message: '请输入到店价', trigger: 'blur' },
{ trigger: 'blur',
validator: (rule, value, callback) => {
(+value > +this.markOldVal.retailPrice) ? callback(new Error('到店价需小于建议升级价')) : callback()
}
}
],
linkMerchantIds: [{ required: true, message: '请选择关联门店', trigger: 'change' }]
},
// headImg: {
// isHas: true,
// attr: 'thumbUrl'
// },
comFormRef: 'com',
editForm: [
// {
// title: '',
// formBlock: [{
// name: 'yqMerchantId',
// label: '园区店',
// isRequired: true,
// type: 'select',
// isHide: true,
// // tips: '选择基础商品',
// isClear: false,
// optionList: [],
// isDisabled: true,
// optionId: 'merchantId',
// optionLabel: 'merchantName'
// }]
// },
{
title: '基础商品信息',
width: '50%',
headImg: {
attr: 'thumbUrl'
},
formBlock: [{
name: 'goodsCode',
label: '产品名称',
isRequired: true,
type: 'select',
// tips: '选择基础商品',
isClear: false,
optionList: [],
isDisabled: true,
optionId: 'goodsCode',
optionLabel: 'goodsName'
}, {
name: 'goodsTypeName',
label: '分类',
type: 'input',
isDisabled: true
}, {
name: '',
label: '',
type: 'span'
}, {
name: 'sapCode',
label: '编号',
type: 'input',
isDisabled: true
}, {
name: 'shopPrice',
label: '到店价格',
type: 'input',
unit: '元',
// tips: '(商品最终交易价格)',
handleInput: (newVal) => {
this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
}
}, {
name: 'retailPrice',
label: '零售价格',
type: 'input',
unit: '元',
// tips: '(前端展示给车主)',
handleInput: (newVal) => {
this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
}
}]
editForm: [{
title: '基础商品信息',
width: '50%',
headImg: {
attr: 'thumbUrl'
},
// {
// title: '价格信息',
// formBlock: [{
// name: 'retailPrice',
// label: '商品零售价',
// type: 'input',
// unit: '元',
// tips: '(前端展示给车主)',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
// this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
// }
// }, {
// name: 'shopPrice',
// label: '到店价',
// type: 'input',
// unit: '元',
// tips: '(商品最终交易价格)',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
// this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
// }
// }, {
// name: 'maxRetailDiscount',
// label: '到店零售折扣',
// type: 'input',
// unit: '折',
// handleInput: (newVal) => {
// this.$refs.d2Form.formData.maxRetailDiscount = limitPrice(newVal, this.markOldVal.maxRetailDiscount, 1, 1, 1)
// this.markOldVal.maxRetailDiscount = this.$refs.d2Form.formData.maxRetailDiscount
// }
// }]
// },
{
title: '绑定升级商品',
formBlock: [{
name: 'upgradeGoods',
label: '',
type: 'relatePro',
optionValue: 'goodsCode',
relateAttr: 'goodsCode'
}]
formBlock: [{
name: 'goodsCode',
label: '产品名称',
isRequired: true,
type: 'select',
isClear: false,
optionList: [],
isDisabled: true,
optionId: 'goodsCode',
optionLabel: 'goodsName'
}, {
name: 'goodsTypeName',
label: '分类',
type: 'input',
isDisabled: true
}, {
name: '',
label: '',
type: 'span'
}, {
title: '分配可见门店',
formBlock: [{
name: 'linkMerchantIds',
label: '',
btnTxt: '添加绑定',
type: 'button',
handleName: 'relateStore',
optionValue: 'merchantId'
}]
name: 'sapCode',
label: '编号',
type: 'input',
isDisabled: true
}, {
name: 'shopPrice',
label: '到店价格',
type: 'input',
unit: '元',
handleInput: (newVal) => {
this.$refs.d2Form.formData.shopPrice = limitPrice(newVal, this.markOldVal.shopPrice, 6, 2)
this.markOldVal.shopPrice = this.$refs.d2Form.formData.shopPrice
}
}, {
name: 'retailPrice',
label: '零售价格',
type: 'input',
unit: '元',
handleInput: (newVal) => {
this.$refs.d2Form.formData.retailPrice = limitPrice(newVal, this.markOldVal.retailPrice, 6, 2)
this.markOldVal.retailPrice = this.$refs.d2Form.formData.retailPrice
}
}]
}, {
title: '绑定升级商品',
formBlock: [{
name: 'upgradeGoods',
label: '',
type: 'relatePro',
optionValue: 'goodsCode',
relateAttr: 'goodsCode'
}]
}, {
title: '分配可见门店',
formBlock: [{
name: 'linkMerchantIds',
label: '',
btnTxt: '添加绑定',
type: 'button',
handleName: 'relateStore',
optionValue: 'merchantId'
}]
}]
}
},
mounted() {
this.show = false
// this.$route.params.row && (this.editData = _.cloneDeep(this.$route.params.row))
// console.log(this.editData)
// add - 新增;edit - 编辑
this.addOrEdit = this.$route.params.addOrEdit
// !this.userInfo.beSuper && (this.editForm.splice(0, 1)) && this.getGoodsList(this.userInfo.detail.merchantId)
!this.userInfo.beSuper && this.getGoodsList(this.userInfo.detail.merchantId)
console.log(this.editForm)
if (this.addOrEdit === 'edit') {
getGoodsInfoById({ id: this.$route.params.row.id }).then(res => {
// console.log(res)
this.userInfo.beSuper && this.getGoodsList(res.yqMerchantId)
var tempIndex = this.editForm.findIndex(i => i.title === '基础商品信息')
this.editForm[tempIndex].formBlock[0].isDisabled = true
......@@ -220,14 +164,13 @@ export default {
}),
linkMerchantIds: res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : []
}
console.log(this.editData)
this.markOldVal.retailPrice = res.retailPrice
this.$nextTick(() => {
this.show = true
})
})
} else {
this.editForm[0].formBlock[0].isDisabled = false
// this.editData.yqMerchantId = this.userInfo.beSuper ? '' : this.userInfo.detail.merchantId
this.$nextTick(() => {
this.show = true
})
......@@ -236,11 +179,8 @@ export default {
methods: {
...mapActions({ close: 'd2admin/page/close' }),
// ...mapActions('d2admin/page', ['close']),
getGoodsList(merchantId) {
// var params = this.addOrEdit === 'edit' ? {} : { exceptBase: true }
getGoodsList({ yqMerchantId: merchantId }).then(res => {
// console.log(res)
this.editForm[0].formBlock[0].optionList = res
})
},
......@@ -250,8 +190,7 @@ export default {
this.close({ tagName: '/editCommodity' })
},
handleAddConfirm(data) {
// console.log(data)
var upgradeGoodsAttr = ['goodsCode', 'shopPrice', 'maxUpgradeDiscount', 'upgradePrice', 'profitType', 'profitValue', 'extraCost', 'partnerProfitPer']
var upgradeGoodsAttr = ['goodsCode', 'shopPrice', 'maxUpgradeDiscount', 'retailPrice', 'upgradePrice', 'profitType', 'profitValue', 'extraCost', 'incentiveCost', 'partnerProfitPer']
var params = {
yqMerchantId: this.userInfo.beSuper ? data.yqMerchantId : this.userInfo.detail.merchantId,
goodsCode: data.goodsCode,
......@@ -269,17 +208,14 @@ export default {
}) : [],
linkMerchantIds: data.linkMerchantIds ? data.linkMerchantIds.map(item => String(item.merchantId)) : []
}
// console.log(_.cloneDeep(params))
if (this.addOrEdit === 'edit') {
params.id = data.id
baseGoodsUpdate(params).then(res => {
// console.log(res)
this.notice.okTips()
this.handleAddClose()
})
} else {
baseGoodsAdd(params).then(res => {
// console.log(res)
this.notice.okTips()
this.handleAddClose(true)
})
......
......@@ -139,7 +139,6 @@ export default {
content: ''
}]
this.editData.thumbUrlList[0].content = this.editData.thumbUrl
console.log(this.editData)
this.$nextTick(() => {
this.show = true
})
......@@ -160,7 +159,6 @@ export default {
const temp = await this.get(BaseData.productType)
this.baseData.productType = temp
this.editForm[0].formBlock[1].optionList = temp
console.log(this.baseData.productType)
},
handleAddClose(isRefresh = false) {
this.close({ tagName: '/product' })
......@@ -168,11 +166,9 @@ export default {
this.close({ tagName: '/editProduct' })
},
handleAddConfirm(data) {
// console.log(data)
data.goodsDescList = data.goodsDescList.filter(item => item.content)
data.goodsTypeName = this.baseData.productType.find(item => item.goodsType === data.goodsType).goodsTypeName
data.thumbUrl = data.thumbUrlList[0].content
console.log(data)
data.brandMerchantCode && (data.brandMerchantName = brandMerchantList.find(item => item.confId === data.brandMerchantCode).confValue)
if (this.addOrEdit === 'edit') {
var params = {
......@@ -197,7 +193,6 @@ export default {
delete i.updatedDate
})
editGoods(params).then(res => {
console.log(res)
this.notice.okTips()
this.handleAddClose(true)
})
......
......@@ -183,12 +183,6 @@ export default {
},
methods: {
// getProductType(){
// let prarms = {}
// getType(prarms).then(res => {
// this.baseData.productTypeList = res || []
// });
// },
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
......@@ -208,7 +202,6 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
console.log('搜索前操作--')
if (this.searchForm.createTime) {
this.searchForm.startDate = new Date(this.searchForm.createTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
this.searchForm.endDate = new Date(this.searchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
......@@ -221,14 +214,12 @@ export default {
},
handleReset() {
this.searchForm = {
// goodsName: '',
goodsType: '',
brandMerchantCode: '',
status: ''
}
},
handleAdd(form) {
// console.log(form)
this.close({ tagName: '/editProduct' })
this.$router.push({
name: 'editProduct',
......@@ -242,7 +233,6 @@ export default {
const tHeader = ['序号', '素材名称', '产品ID', '分类', '品牌商', '创建时间', '状态']
const fieldVal = ['index', 'goodsName', 'id', 'goodsTypeName', 'brandMerchantName', 'createdDateStr', 'statusStr']
exportGoodsList(this.searchForm).then(res => {
// console.log(res)
require.ensure([], () => {
const data = this.formatJson(fieldVal, res)
exportJsonToExcel(tHeader, data, '素材列表')
......@@ -253,7 +243,6 @@ export default {
return jsonData.map(v => filterVal.map(j => v[j]))
},
handleEdit(row) {
// console.log(row)
this.close({ tagName: '/editProduct' })
this.$router.push({
name: 'editProduct',
......@@ -264,9 +253,7 @@ export default {
})
},
handleUpOrDown(row) {
// console.log(row)
checkDeleteGoods({ goodsCode: row.goodsCode }).then(res => {
// console.log(res)
if (!res) {
this.$confirm('该素材已配置为上架商品,需下架该商品后才可删除!', '提示', {
confirmButtonText: '确定',
......
......@@ -3,26 +3,6 @@
<div class="storeDetail">
<div class="title">可见车店</div>
<div class="detail-rows">
<!-- <el-scrollbar>
<div
v-for="(item, index) in detailArr"
:key="index"
class="flex"
>
<img
class="img"
:src="item.shopPhoto"
/>
<block>
<p><span class="txt-order">{{index + 1}}</span>{{item.merchantName}}</p>
<p>
<span class="txt-num">商户号{{item.merchantId}}</span>
<span>{{item.phone}}</span>
</p>
<p>{{item.provinceName || ''}}{{item.cityName || ''}}{{item.address}}</p>
</block>
</div>
</el-scrollbar> -->
<el-scrollbar>
<el-table
:data="detailArr"
......@@ -87,7 +67,6 @@ export default {
},
mounted() {
console.log(this.detailData)
this.getMerchantList()
},
......@@ -97,7 +76,6 @@ export default {
getMerchantList({
baseGoodsId: this.detailData.id
}).then(res => {
// console.log(res)
res.forEach(item => {
this.detailArr.push(item.merchantInfo)
})
......@@ -119,7 +97,6 @@ export default {
}
.storeDetail .detail-rows {
width: 100%;
/* height: 540px; */
}
.storeDetail .txt-order {
display: inline-block;
......
<!-- 邀约详情 -->
<template>
<div class="appoint-table">
<table
cellpadding='0'
cellspacing='0'
>
<tr>
<td>邀约时间</td>
<td>邀约详情</td>
<td>服务状态</td>
</tr>
<tr
v-for="(item, index) in detailData"
:key="index"
>
<td>{{item.time}}</td>
<td class="flex">
<img
class="detail-header"
:src="item.info.sex === 1 ? './header-man.jpg' : './header-woman.jpg'"
/>
<block class="detail-info">
<p>{{item.info.name}}</p>
<p>{{item.info.project}}</p>
</block>
<block class="detail-phone">
<p
class="secret-phone"
v-show="!item.info.phone"
>
<span class="one-tip">手机号码已加密</span>
<span
class="two-tip"
@click="handleGetPhone(item, index)"
>获取虚拟手机号</span>
</p>
<p v-show="item.info.phone">{{item.info.phone}}</p>
</block>
</td>
<td>
{{item.status === 1 ? '完成服务' : '未到店'}}
</td>
</tr>
</table>
</div>
</template>
<script>
export default {
name: 'AppointTable',
data() {
return {
hoursList: [
{ 'hour': '9:00' }, { 'hour': '10:00' },
{ 'hour': '11:00' }, { 'hour': '12:00' },
{ 'hour': '13:00' }, { 'hour': '14:00' },
{ 'hour': '15:00' }, { 'hour': '16:00' },
{ 'hour': '17:00' }, { 'hour': '18:00' }],
detailData: [{
time: '9:00',
info: {
header: '',
name: '张三',
// 1 - 男; 2 - 女
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}, {
time: '9:00',
info: {
header: '',
name: '张兰',
sex: 2,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 1
}, {
time: '10:00',
info: {
header: '',
name: '张一二',
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}]
}
},
mounted() { },
methods: {
handleGetPhone(targetItem, targetIndex) {
this.$confirm('客户手机号码已加密,是否获取虚拟号码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.detailData[targetIndex].info.phone = '13088889999'
}).catch(err => {
console.log(err)
})
}
}
}
</script>
<style lang="scss" scoped>
.appoint-table {
width: 50%;
min-width: 536px;
.flex {
display: flex;
}
table {
width: 98%;
color: #333;
border: 1px solid #cfd3d5;
border-width: 1px 0 0 1px;
td {
padding: 0px 10px;
border: 1px solid #cfd3d5;
border-width: 0px 1px 1px 0px;
border-spacing: 0;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.detail-header {
height: 70px;
width: 70px;
border-radius: 50%;
margin: 6px 10px;
}
.detail-info {
width: calc(100% - 250px);
}
.detail-phone {
position: relative;
width: 180px;
height: 70px;
line-height: 70px;
overflow: hidden;
p {
margin: 0 0;
}
}
.secret-phone {
position: absolute;
left: 0;
transition: left 1s;
cursor: pointer;
span {
display: inline-block;
width: 180px;
height: 100%;
}
.two-tip {
background-color: #cccccc;
}
}
.secret-phone:hover {
left: -180px;
}
}
}
}
</style>
<!-- 日期时间 - 选择器 -->
<template>
<div class="time-selector">
<el-button icon="el-icon-d-arrow-left" type="text" :disabled="currentWeek === 1" @click="handleWeek(false)"></el-button>
<div class="date-picker">
<div
class="wrapper"
v-for="(item, index) in dateList.slice(currentWeek * 7 - 7, currentWeek * 7)"
:key="index"
>
<span>
<p
v-for="(info, infoIndex) in appointData[index].infoList"
:key="infoIndex"
>
<el-popover
placement="bottom-start"
title=""
width="200"
open-delay="600"
trigger="hover"
:disabled="info.status !== 1"
>
<div>
<p>1、客户姓名,时间,项目</p>
<p>2、客户姓名,时间,项目</p>
<p>余位数:8</p>
</div>
<el-button
class="col-width hour-block"
slot="reference"
:disabled="((item.date == new Date().toLocaleDateString()) && (+hoursList[infoIndex].hour.split(':')[0] <= new Date().getHours())) || (info.status === 2)"
@click="handleAppoint(item, infoIndex)"
>{{appointStatusList[info.status]}}</el-button>
</el-popover>
</p>
</span>
<el-button
type="text"
:class="{'date-btn': true, 'col-width': true, 'active': item.active}"
@click="handleSelectDate(index)"
>
<p>{{item.date.split('/')[1] + '.' + item.date.split('/')[2]}}</p>
<p>{{weekList[item.week]}}</p>
</el-button>
</div>
</div>
<el-button icon="el-icon-d-arrow-right" type="text" :disabled="currentWeek === 5" @click="handleWeek(true)"></el-button>
</div>
</template>
<script>
import { appointDays } from '@/common/constants'
export default {
name: 'TimeDate',
data() {
return {
// 7天为一个周期,预约时间为35天,一共5个周期,当前周期
currentWeek: 1,
// 日期
dateIndex: 0,
weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
dateList: new Array(appointDays).fill(null).map((item, index) => {
var date = new Date(new Date().setDate(new Date().getDate() + index))
return {
date: date.toLocaleDateString(),
week: date.getDay(),
active: !index
}
}),
// 时间
appointStatusList: ['空', '余', '满']
}
},
props: {
appointData: {
type: Array,
default: () => []
},
hoursList: {
type: Array,
default: () => []
}
},
mounted() { },
methods: {
// 日期选择
handleSelectDate(currentIndex) {
this.dateList[this.dateIndex].active = false
this.dateIndex = currentIndex
this.dateList[currentIndex].active = true
},
handleAppoint(date, hourIndex) {
this.$emit('handleAppoint', { date: date.date, hour: this.hoursList[hourIndex].hour })
},
handleWeek(isAdd) {
isAdd ? this.currentWeek++ : this.currentWeek--
}
}
}
</script>
<style lang="scss" scoped>
@import './css/timeDateStyle.scss';
</style>
.time-selector {
width: 50%;
height: 100%;
display: flex;
align-items: center;
p {
margin: 0 0;
}
.col-width {
width: 80px;
}
.date-picker {
display: flex;
width: 100%;
overflow-x: scroll;
margin: 0 8px;
.wrapper {
width: 100%;
.hour-block {
text-align: center;
}
.date-btn {
position: relative;
color: #333;
// &.active {
// color: #68c9d0;
// &:after {
// position: absolute;
// bottom: 0;
// left: 9%;
// content: '';
// width: 82%;
// display: block;
// height: 2px;
// background: #68c9d0;
// }
// }
}
}
}
}
<!-- 邀约 -->
<template>
<d2-container class="invitation">
<div
class="header"
slot="header"
>
<appoint-table></appoint-table>
<time-date
:appointData="appointData"
:hoursList="hoursList"
@handleAppoint="handleAppoint"
></time-date>
</div>
<d2-dialog
title="正在为客户预约"
:isVisible="appointDialogVisible"
@closeDialog="handleAppointClose"
@confirmDialog="handleAppointConfirm"
>
<el-form
:model="appointForm"
label-width="120px"
>
<el-form-item
label="客户姓名:"
prop="name"
>
<el-input
v-model="appointForm.name"
placeholder="请输入客户姓名"
></el-input>
</el-form-item>
<el-form-item
label="车架号后6位:"
prop="carNo"
>
<el-input
v-model="appointForm.carNo"
placeholder="请输入车架号后6位"
></el-input>
</el-form-item>
<el-form-item label="具体时间:">
<el-col :span="10">
<el-date-picker
v-model="appointForm.date"
type="date"
placeholder="选择日期"
:picker-options="afterTodayOptions"
@change="handleChangeDate(1)"
>
</el-date-picker>
</el-col>
<el-col :span="10">
<el-select
v-model="appointForm.hour"
placeholder="选择时间"
>
<el-option
v-for="(item, index) in hoursList"
:key="index"
:label="item.hour"
:value="item.hour"
:disabled="((appointForm.date == new Date().toLocaleDateString()) && (+item.hour.split(':')[0] <= new Date().getHours()) || fullList[index])"
></el-option>
</el-select>
</el-col>
</el-form-item>
<el-form-item
label="预约项目:"
prop="project"
>
<el-select
v-model="appointForm.project"
placeholder="请输入预约项目"
></el-select>
</el-form-item>
</el-form>
</d2-dialog>
</d2-container>
</template>
<script>
import { afterTodayOptions, appointDays } from '@/common/constants'
import TimeDate from './invitation-component/TimeDate'
import AppointTable from './invitation-component/AppointTable'
// import TimeDateTemp from './invitation-component/TimeDateTemp'
export default {
name: 'invitation',
data() {
return {
// 邀约弹窗
afterTodayOptions: afterTodayOptions,
appointDialogVisible: false,
appointForm: {},
fullList: new Array(10).fill(false),
appointData: new Array(appointDays).fill(null).map((item, index) => {
return {
date: new Date(new Date().setDate(new Date().getDate() + index)).toLocaleDateString(),
infoList: new Array(10).fill(null).map(subItem => {
return {
status: parseInt(Math.random() * 3),
appointInfo: [{
name: 'zhangsan',
time: 'time',
project: 'project'
}]
}
})
}
}),
hoursList: [
{ 'hour': '9:00' }, { 'hour': '10:00' },
{ 'hour': '11:00' }, { 'hour': '12:00' },
{ 'hour': '13:00' }, { 'hour': '14:00' },
{ 'hour': '15:00' }, { 'hour': '16:00' },
{ 'hour': '17:00' }, { 'hour': '18:00' }]
}
},
components: {
TimeDate,
AppointTable
},
mounted() { },
methods: {
handleAppoint(obj) {
// console.log(obj)
this.appointForm = {
name: '',
carNo: '',
...obj
}
this.fullList = this.appointData.find(item => item.date == this.appointForm.date).infoList.map(subItem => subItem.status === 2)
this.appointDialogVisible = true
},
handleAppointClose() {
this.appointDialogVisible = false
},
handleAppointConfirm() {
this.handleAppointClose()
},
handleChangeDate(index) {
this.appointForm.date = this.appointForm.date.toLocaleDateString()
this.appointForm.hour = ''
this.fullList = this.appointData.find(item => item.date == this.appointForm.date).infoList.map(subItem => subItem.status === 2)
}
}
}
</script>
<style lang="scss">
.invitation {
.header {
display: flex;
padding: 20px 20px;
}
}
</style>
......@@ -222,7 +222,6 @@ export default {
...mapActions('d2admin/base', ['get']),
beforeSearchFn() {
return new Promise(resolve => {
console.log('搜索前操作--')
resolve()
})
},
......@@ -236,7 +235,6 @@ export default {
}
},
handleAdd() {
// console.log(form)
this.relateStoreVisible = true
},
relateCloseReset() {
......@@ -248,9 +246,7 @@ export default {
this.storeSelected = []
},
handleRelateStoreConfirm(selectedData) {
// console.log(selectedData)
this.$refs.relate.validate(valid => {
console.log(valid)
if (valid) {
if (!selectedData.length) {
// this.notice.warningTips('请选择关联门店')
......@@ -286,12 +282,7 @@ export default {
handleSearchStore() {
this.$refs.relateStore.getSelectingList()
},
// handleMerchantChange(value) {
// this.storeSearchForm.yqMerchantId = value
// this.$refs.relateStore.getSelectingList()
// },
handleDelete(row) {
// console.log(row)
this.$confirm('是否要进行删除操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!