Commit 87a7f9a0 by cwq0219

bug修复

1 parent d6ad3f8d
...@@ -12,12 +12,15 @@ ...@@ -12,12 +12,15 @@
<div slot="footer"> <div slot="footer">
<slot name="btn-start"></slot> <slot name="btn-start"></slot>
<el-button <el-button
v-if="!noCancel"
@click="handleClose"
>取消</el-button>
<el-button
type="primary" type="primary"
@click="handleConfirm" @click="handleConfirm"
:loading="$store.state.d2admin.loading.value" :loading="$store.state.d2admin.loading.value"
>{{btnOkLabel}}</el-button> >{{btnOkLabel}}</el-button>
<slot name="btn-middle"></slot> <slot name="btn-middle"></slot>
<el-button v-if="!noCancel" @click="handleClose">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
......
...@@ -91,9 +91,7 @@ ...@@ -91,9 +91,7 @@
></el-option> ></el-option>
</el-select> --> </el-select> -->
<template v-else-if="item.type === 'button'"> <template v-else-if="item.type === 'button'">
<div <div v-if="item.name === 'linkMerchantIds'">
v-if="item.name === 'linkMerchantIds'"
>
<!-- <div <!-- <div
v-for="subItem in formData[item.name]" v-for="subItem in formData[item.name]"
:key="subItem.merchantId" :key="subItem.merchantId"
...@@ -237,7 +235,10 @@ ...@@ -237,7 +235,10 @@
:key="subIndex" :key="subIndex"
class="muti-imgs img-w-h" class="muti-imgs img-w-h"
> >
<img class="img-w-h" :src="subItem.content" /> <img
class="img-w-h"
:src="subItem.content"
/>
<span class="img-btns"> <span class="img-btns">
<span class="btn-item"> <span class="btn-item">
<i <i
...@@ -269,19 +270,23 @@ ...@@ -269,19 +270,23 @@
v-for="(subItem, subIndex) in formData[item.name]" v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex" :key="subIndex"
> >
<template v-if="subItem.resType === 2"> <div
style="position: relative;"
v-if="subItem.resType === 2"
>
<el-input <el-input
class="desc-input"
type="textarea" type="textarea"
v-model="subItem.content" v-model="subItem.content"
:rows="4" :rows="4"
:maxlength="subItem.maxlength" maxlength="256"
placeholder="请输入详情内容" placeholder="请输入详情内容"
></el-input> ></el-input>
<i <i
class="el-icon-delete" class="el-icon-delete desc-txt-delete"
@click='handleImgDelete(item, subIndex)' @click='handleImgDelete(item, subIndex)'
></i> ></i>
</template> </div>
<div <div
class="activity-img muti-imgs img-w-h" class="activity-img muti-imgs img-w-h"
v-else-if="subItem.resType === 1" v-else-if="subItem.resType === 1"
...@@ -817,7 +822,16 @@ export default { ...@@ -817,7 +822,16 @@ export default {
/* background-color: #eee; */ /* background-color: #eee; */
} }
.d2-form .desc-btns { .d2-form .desc-btns {
margin-bottom: 6px; margin-bottom: 15px;
}
.d2-form .desc-input {
width: 155%;
margin-bottom: 15px;
}
.d2-form .desc-txt-delete {
position: absolute;
left: 160%;
bottom: 15px;
} }
.d2-form .pro-block { .d2-form .pro-block {
height: 35px; height: 35px;
......
...@@ -95,6 +95,11 @@ export default { ...@@ -95,6 +95,11 @@ export default {
type: Object, type: Object,
default: () => { } default: () => { }
} }
// 限制个数
// maxLength: {
// type: String,
// default: '-1'
// }
}, },
mounted() { mounted() {
...@@ -128,14 +133,43 @@ export default { ...@@ -128,14 +133,43 @@ export default {
}, },
handleChange(selection, row) { handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId) 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 addOrDelete
? this.selectedData.push(row) ? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId)) : (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
}, },
handleAll(selection) { 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 => { this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId) var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId)
if (selection.length && (isExit === -1)) { var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && (isExit === -1) && !isServed) {
this.selectedData.push(item) this.selectedData.push(item)
} else if (!selection.length && (isExit !== -1)) { } else if (!selection.length && (isExit !== -1)) {
this.selectedData.splice(isExit, 1) this.selectedData.splice(isExit, 1)
...@@ -162,7 +196,7 @@ export default { ...@@ -162,7 +196,7 @@ export default {
width: 98%; width: 98%;
} }
.relateStore .el-table .cell { .relateStore .el-table .cell {
line-height: 20px !important; line-height: 26px !important;
} }
.relateStore .el-table .cell { .relateStore .el-table .cell {
padding: 0 8px !important; padding: 0 8px !important;
......
...@@ -243,15 +243,16 @@ export default { ...@@ -243,15 +243,16 @@ export default {
// 发布事件,以期查询条件改变后,页面图表需要刷新 // 发布事件,以期查询条件改变后,页面图表需要刷新
refreshEmit() { refreshEmit() {
this.$emit('searchChange') this.$emit('searchChange')
this.refreshTable() this.refreshTable(true, true)
}, },
refreshTable(clearMuti = true) { refreshTable(clearMuti = true, resetCurrentPage = false) {
this.beforeSearchFn().then(res => { this.beforeSearchFn().then(res => {
// console.log(res) // console.log(res)
// 清空多选 // 清空多选
clearMuti && this.clearMutiSelect() clearMuti && this.clearMutiSelect()
this.loading = true this.loading = true
resetCurrentPage && (this.page.currentPage = 1)
var params = { var params = {
...this.page, ...this.page,
...this.searchForm ...this.searchForm
......
...@@ -81,7 +81,7 @@ export const resources = { ...@@ -81,7 +81,7 @@ export const resources = {
auth: [{ auth: [{
authId: '9030101', authId: '9030101',
parentId: '90301', parentId: '90301',
label: '新增商品', label: '新增产品',
category: 'Button', category: 'Button',
type: 'primary', type: 'primary',
handle: 'handleAdd' handle: 'handleAdd'
......
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
<el-checkbox-group v-model="selectList"> <el-checkbox-group v-model="selectList">
<div class="base-pro-block base-pro-block-wh" v-for="(item, index) in goodList" :key="index"> <div class="base-pro-block base-pro-block-wh" v-for="(item, index) in goodList" :key="index">
<img class="base-pro-block-wh" :src="item.goodsInfo.thumbUrl"/> <img class="base-pro-block-wh" :src="item.goodsInfo.thumbUrl"/>
<el-checkbox class="base-pro-block-wh" :label="item.id">{{item.goodsInfo.goodsName}}</el-checkbox> <el-checkbox :label="item.id"><span class="ellipsis" :title="item.goodsInfo.goodsName">{{item.goodsInfo.goodsName}}</span></el-checkbox>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
...@@ -255,10 +255,10 @@ export default { ...@@ -255,10 +255,10 @@ export default {
} }
function checkContacts(rule, value, callback) { function checkContacts(rule, value, callback) {
if (value) { if (value) {
if(value.length != 17){ if (value.length != 17) {
callback(new Error('车架号必须为17位数字或字符')) callback(new Error('车架号必须为17位数字或字符'))
return false return false
}else{ } else {
if (Util.validationInput(value)) { if (Util.validationInput(value)) {
callback(new Error('车架号必须为17位数字或字符')) callback(new Error('车架号必须为17位数字或字符'))
return false return false
...@@ -399,9 +399,9 @@ export default { ...@@ -399,9 +399,9 @@ export default {
const params = {} const params = {}
getServiceStore(params).then(res => { getServiceStore(params).then(res => {
this.storeIdList = res || [] this.storeIdList = res || []
if(this.storeIdList.length == 0){ if (this.storeIdList.length == 0) {
this.nostoreError = true this.nostoreError = true
}else{ } else {
this.nostoreError = false this.nostoreError = false
} }
}) })
...@@ -576,6 +576,12 @@ export default { ...@@ -576,6 +576,12 @@ export default {
this.$refs.editCusFrom.validate((valid, opt) => { this.$refs.editCusFrom.validate((valid, opt) => {
const validAttrList = ['storeId', 'cusName', 'mobile', 'contacts'] const validAttrList = ['storeId', 'cusName', 'mobile', 'contacts']
var hasError = Object.keys(opt) var hasError = Object.keys(opt)
if (!this.form.employee) {
this.showChooseCusError = true
}
if (this.selectList.length === 0) {
this.showChoosePrError = true
}
if (hasError.length) { if (hasError.length) {
for (var i in validAttrList) { for (var i in validAttrList) {
if (hasError.includes(validAttrList[i])) { if (hasError.includes(validAttrList[i])) {
...@@ -698,9 +704,9 @@ export default { ...@@ -698,9 +704,9 @@ export default {
} }
.warningFont { .warningFont {
font-size: 14px; color: #F56C6C;
color: #f00; font-size: 12px;
font-weight: normal; line-height: 1;
} }
.text-wrapper { .text-wrapper {
...@@ -716,12 +722,6 @@ export default { ...@@ -716,12 +722,6 @@ export default {
height: 80px; height: 80px;
} }
.warningFont{
font-size:14px;
color:#f00;
font-weight:normal;
}
.editCusFrom .title { .editCusFrom .title {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
...@@ -739,10 +739,13 @@ export default { ...@@ -739,10 +739,13 @@ export default {
.base-pro-block img { .base-pro-block img {
vertical-align: top; vertical-align: top;
} }
.base-pro-block .el-checkbox { .base-pro-block .ellipsis {
display: inline-block;
width: 100px;
height: auto; height: auto;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-emphasis: ellipsis; text-overflow: ellipsis;
vertical-align: bottom;
} }
</style> </style>
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
:className="storeDetail" :className="storeDetail"
:isVisible.sync="detailVisible" :isVisible.sync="detailVisible"
noCancel="true" noCancel="true"
@closeDialog="handleDetailClose"
@confirmDialog="handleDetailClose" @confirmDialog="handleDetailClose"
> >
<store-detail <store-detail
...@@ -195,16 +196,19 @@ export default { ...@@ -195,16 +196,19 @@ export default {
mounted() { mounted() {
this.getBaseData() this.getBaseData()
this.baseData.brandList = brandMerchantList this.baseData.brandList = _.cloneDeep(brandMerchantList)
// var allOpt = { confId: '', confKey: '全部' } var allOpt = { confId: '', confValue: '全部' }
// this.baseData.goodsType.unshift(allOpt) this.baseData.brandList.unshift(allOpt)
// this.baseData.brandList.unshift(allOpt)
}, },
methods: { methods: {
...mapActions('d2admin/base', ['get']), ...mapActions('d2admin/base', ['get']),
async getBaseData() { async getBaseData() {
this.baseData.goodsType = await this.get(BaseData.productType) this.baseData.goodsType = _.cloneDeep(await this.get(BaseData.productType))
this.baseData.goodsType.unshift({
goodsType: '',
goodsTypeName: '全部'
})
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
...@@ -228,8 +232,8 @@ export default { ...@@ -228,8 +232,8 @@ export default {
}) })
}, },
handleExport() { handleExport() {
const tHeader = ['商品ID', '商品名称', '分类', '品牌商', '属性', '关联商品数', '关联商户数', '产品状态', '创建时间'] const tHeader = ['序号', '商品ID', '商品名称', '分类', '品牌商', '属性', '关联商品数', '关联商户数', '产品状态', '创建时间']
const fieldVal = ['goodsCode', 'goodsName', 'goodsTypeName', 'brandMerchantName', 'attribute', 'upgradeGoodsNum', 'merchantNum', 'goodsStatus', 'createdDate'] const fieldVal = ['index', 'goodsCode', 'goodsName', 'goodsTypeName', 'brandMerchantName', 'attribute', 'upgradeGoodsNum', 'merchantNum', 'goodsStatus', 'createdDate']
exportBaseList(this.searchForm).then(res => { exportBaseList(this.searchForm).then(res => {
// console.log(res) // console.log(res)
require.ensure([], () => { require.ensure([], () => {
......
...@@ -143,7 +143,9 @@ export default { ...@@ -143,7 +143,9 @@ export default {
// var allOpt = { confId: '', confKey: '全部' } // var allOpt = { confId: '', confKey: '全部' }
// this.baseData.product.unshift(allOpt) // this.baseData.product.unshift(allOpt)
// this.baseData.brandList.unshift(allOpt) // this.baseData.brandList.unshift(allOpt)
this.baseData.brandList = brandMerchantList this.baseData.brandList = _.cloneDeep(brandMerchantList)
var allOpt = { confId: '', confValue: '全部' }
this.baseData.brandList.unshift(allOpt)
}, },
methods: { methods: {
...@@ -155,7 +157,11 @@ export default { ...@@ -155,7 +157,11 @@ export default {
// }, // },
...mapActions('d2admin/base', ['get']), ...mapActions('d2admin/base', ['get']),
async getBaseData() { async getBaseData() {
this.baseData.productTypeList = await this.get(BaseData.productType) this.baseData.productTypeList = _.cloneDeep(await this.get(BaseData.productType))
this.baseData.productTypeList.unshift({
goodsType: '',
goodsTypeName: '全部'
})
}, },
beforeSearchFn() { beforeSearchFn() {
......
...@@ -149,8 +149,8 @@ export default { ...@@ -149,8 +149,8 @@ export default {
if (this.formData.userType !== 1) { if (this.formData.userType !== 1) {
this.formData.addr = (this.formData.provinceName || '') + (this.formData.cityName || '') + (this.formData.areaName || '') + (this.formData.address || '') this.formData.addr = (this.formData.provinceName || '') + (this.formData.cityName || '') + (this.formData.areaName || '') + (this.formData.address || '')
this.formData.carBrandListNoRepeat = [...new Set(this.formData.carBrandList.map(item => item.brandName))] this.formData.carBrandListNoRepeat = [...new Set(this.formData.carBrandList.map(item => item.brandName))]
var typeList = this.formData.channelId === 2 ? ghUserType : userType // var typeList = this.formData.channelId === 2 ? ghUserType : userType
this.formData.userTypeName = typeList[this.formData.userType] this.formData.userTypeName = userType[this.formData.userType]
} else { } else {
this.formData.photoHead = [{ mediaUrl: this.formData.photo }] this.formData.photoHead = [{ mediaUrl: this.formData.photo }]
this.formData.userLabelListArr = this.formData.userLabelList.map(item => item.labelName) this.formData.userLabelListArr = this.formData.userLabelList.map(item => item.labelName)
......
...@@ -91,6 +91,7 @@ export default { ...@@ -91,6 +91,7 @@ export default {
searchForm: { searchForm: {
merchantName: '' merchantName: ''
}, },
maxLength: 10,
getListApi: getList, getListApi: getList,
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -99,36 +100,43 @@ export default { ...@@ -99,36 +100,43 @@ export default {
tableOption: true, tableOption: true,
tableColumns: [{ tableColumns: [{
label: '登录账户', label: '登录账户',
prop: 'accountName' prop: 'accountName',
width: '160'
}, { }, {
label: '商户号', label: '商户号',
prop: 'merchantId' prop: 'merchantId',
width: '200'
}, { }, {
label: '商户名称', label: '商户名称',
prop: 'merchantName' prop: 'merchantName',
width: '200'
}, { }, {
label: '商户简称', label: '商户简称',
prop: 'shortName' prop: 'shortName',
width: '200'
}, { }, {
label: '商户类型', label: '商户类型',
prop: 'userType', prop: 'userType',
width: '76',
formatter: (cellValue) => { formatter: (cellValue) => {
var typeList = cellValue.channelType === 2 ? ghUserType : userType // var typeList = cellValue.channelType === 2 ? ghUserType : userType
return typeList[cellValue.userType] return userType[cellValue.userType]
} }
}, { }, {
label: '联系人', label: '联系人',
prop: 'contactName' prop: 'contactName'
}, { }, {
label: '手机号', label: '手机号',
prop: 'phone' prop: 'phone',
width: '110'
}, { }, {
label: '商户地址', label: '商户地址',
prop: 'address', prop: 'fullAddress',
width: '200' width: '200'
}, { }, {
label: '更新时间', label: '更新时间',
prop: 'updatedDate', prop: 'updatedDate',
width: '160',
formatter: (cellValue) => { formatter: (cellValue) => {
return Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss') return Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss')
} }
...@@ -191,7 +199,7 @@ export default { ...@@ -191,7 +199,7 @@ export default {
this.storeSelected = [] this.storeSelected = []
}, },
handleRelateStoreConfirm(selectedData) { handleRelateStoreConfirm(selectedData) {
console.log(selectedData) // console.log(selectedData)
if (!selectedData.length) { if (!selectedData.length) {
// this.notice.warningTips('请选择关联门店') // this.notice.warningTips('请选择关联门店')
this.$message({ this.$message({
...@@ -201,6 +209,10 @@ export default { ...@@ -201,6 +209,10 @@ export default {
}) })
return true return true
} }
if (selectedData.length > this.maxLength) {
this.$message.error(`一次只能选择${this.maxLength}个门店`)
return true
}
addServiceMerchant({ list: selectedData }).then(res => { addServiceMerchant({ list: selectedData }).then(res => {
this.relateStoreVisible = false this.relateStoreVisible = false
this.$refs.serviceStoreTable.refreshTable() this.$refs.serviceStoreTable.refreshTable()
...@@ -238,4 +250,11 @@ export default { ...@@ -238,4 +250,11 @@ export default {
.service-store .service-search { .service-store .service-search {
margin-bottom: 10px; margin-bottom: 10px;
} }
.service-store .el-table--medium td {
padding: 6px 8px !important;
}
.service-store .el-checkbox__input.is-disabled .el-checkbox__inner {
background-color: #CECECE;
border-color: #CECECE;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!