Commit 87a7f9a0 by cwq0219

bug修复

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