Commit 255c1e60 by wangql
2 parents a48d6900 e594ef08
......@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq
* @Last Modified time: 2020-11-15 11:24:23
* @Last Modified time: 2020-11-18 15:19:52
*/
// import { LOGIN_URL, REG_URL, ROLE_LIST_URL } from '@/api/sys.account'
......@@ -106,3 +106,30 @@ export const brandMerchantList = [{
confId: '10',
confValue: '嘀嘀虎'
}]
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
var reg = {
priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\d*$/
}
regRule = regRule || 'priceReg'
if (newValue && (minValue && (newValue < minValue)) || (maxValue && (newValue > maxValue))) {
return oldValue || ''
}
if (newValue && reg[regRule].test(newValue + '')) {
if ((/\./).test(newValue)) {
newValue = newValue + ''
var interger = newValue.split('.')[0]
var point = newValue.split('.')[1]
var intergerNum = interger.length > intergerDigit ? oldValue.split('.')[0] : interger
var pointNum = point.length > pointDigit ? point.slice(0, pointDigit) : point
newValue = pointDigit ? intergerNum + '.' + pointNum : newValue.split('.')[0]
} else {
newValue = newValue.length > intergerDigit ? oldValue.slice(0, intergerDigit) : newValue
}
return newValue
} else {
return newValue ? oldValue : ''
}
}
......@@ -4,7 +4,8 @@
<el-form
:model="formData"
:rules="rules"
ref="d2FormRuleForm"
:ref="formRef + 'd2FormRuleForm'"
v-loading="$store.state.d2admin.loading.value"
>
<div
v-for="(i, idx) in formList"
......@@ -21,6 +22,7 @@
<el-form-item
:prop="item.name"
:label="item.label"
:id="item.name"
label-width="130px"
class="dis-in-block"
:style="{'margin-bottom': !item.type ? '0px' : '22px'}"
......@@ -33,6 +35,7 @@
:style="{'width': item.width || formItemWidth}"
:disabled="item.isDisabled"
clearable
@input="item.handleInput"
></el-input>
<!-- 选择框 -->
<el-select
......@@ -53,7 +56,7 @@
</el-option>
</el-select>
<!-- 远程搜索 - 选择框 -->
<el-select
<!-- <el-select
v-else-if="item.type === 'selectRemote'"
v-model="formData[item.name]"
:placeholder="'请选择' + item.label"
......@@ -70,9 +73,9 @@
:value="subItem[item.optionId]"
>
</el-option>
</el-select>
</el-select> -->
<!-- 复选选择框 -->
<el-select
<!-- <el-select
v-else-if="item.type === 'mutiSelect'"
multiple
v-model="formData[item.name]"
......@@ -86,7 +89,7 @@
:label="subItem[item.optionLabel]"
:value="subItem"
></el-option>
</el-select>
</el-select> -->
<template v-else-if="item.type === 'button'">
<div v-if="item.name === 'linkMerchantIds'">
<div
......@@ -120,14 +123,18 @@
>×</span>
</p>
<p>
<img
src="./image/relateIcon.png"
alt="关联"
/>
配置分账规则&nbsp;订单最大可分配比例
<el-input
class="pro-item"
v-model="subItem.profitValue"
></el-input>%
<el-select
class="pro-item"
v-model="subItem.profitType"
size="small"
>
<el-option
v-for="x in separateOpt"
......@@ -155,37 +162,17 @@
{{formData.upgradeGoods[0].profitValue}}
</el-form-item> -->
</div>
<el-button @click="handleAddPro">新增关联商品</el-button>
<el-button @click="handleAddPro(item)">新增关联商品</el-button>
</template>
<template v-else-if="item.type === 'photo'">
<p class="photo-top-tips">{{item.topTips}}</p>
<div
v-if="formData[item.name].length < item.maxPhotoNum"
class="activity-img img-w-h"
:class="[disabled ? 'input-bg':'']"
>
<div
class="add"
v-show="formData[item.name].length < item.maxPhotoNum"
>+</div>
<!-- <span
class="number"
v-if="!formData[item.name] && item.maxPhotoNum === 1"
>0/{{item.maxPhotoNum}}</span> -->
<div class="add">+</div>
<span class="number">{{formData[item.name].length}}/{{item.maxPhotoNum}}</span>
<!-- <span
v-show="!formData[item.name]"
class="close"
@click='handleImgDelete(item)'
>
<i class="el-icon-delete"></i>
</span> -->
<!-- <template>
<img
v-if="!formData[item.name].content && item.maxPhotoNum === 1"
:src="formData[item.name].content"
alt=""
>
</template> -->
<input
type="file"
name='thumbUrl'
......@@ -201,49 +188,82 @@
<template>
<div v-if="formData[item.name].length">
<span
class="muti-imgs"
v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex"
class="muti-imgs img-w-h"
>
<img
class="img-w-h"
:src="subItem.content"
/>
<span
class="close"
@click='handleImgDelete(item, subIndex)'
>
<i class="el-icon-delete"></i>
<img :src="subItem.content" />
<span class="img-btns">
<span class="btn-item">
<i
@click='handleImgDelete(item, subIndex)'
class="el-icon-delete"
></i>
<i
@click="handleImgLook(subItem.content)"
class="el-icon-zoom-in"
></i>
</span>
</span>
</span>
</div>
</template>
</template>
<template v-else-if="item.type === 'descList'">
<el-row>
<el-button @click="handleAddDesc(2, item)">添加文字</el-button>
<el-button @click="handleAddDesc(1, item)">添加图片</el-button>
<el-row class="desc-btns">
<el-button
size="small"
@click="handleAddDesc(2, item)"
>添加文字</el-button>
<el-button
size="small"
@click="handleAddDesc(1, item)"
>添加图片</el-button>
</el-row>
<el-row
v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex"
>
<el-input
v-if="subItem.resType === 2"
type="textarea"
v-model="subItem.content"
:rows="4"
placeholder="请输入详情内容"
></el-input>
<template v-if="subItem.resType === 2">
<el-input
type="textarea"
v-model="subItem.content"
:rows="4"
placeholder="请输入详情内容"
></el-input>
<i
class="el-icon-delete"
@click='handleImgDelete(item, subIndex)'
></i>
</template>
<div
class="descList-img img-w-h"
class="activity-img muti-imgs img-w-h"
v-else-if="subItem.resType === 1"
>
<div
v-show="!subItem.content"
class="add"
>+</div>
<img
v-show="subItem.content"
class="img-w-h"
:src="subItem.content"
/>
<span
class="img-btns"
v-show="subItem.content"
>
<span class="btn-item">
<i
@click='handleImgDelete(item, subIndex)'
class="el-icon-delete"
></i>
<i
@click="handleImgLook(subItem.content)"
class="el-icon-zoom-in"
></i>
</span>
</span>
<input
type="file"
class="activity-Input img-w-h"
......@@ -253,10 +273,6 @@
style="opacity: 0;"
>
</div>
<i
class="el-icon-delete"
@click='handleImgDelete(item, subIndex)'
></i>
</el-row>
</template>
<span v-else>{{item.name ? formData[item.name] : item.value}}</span>
......@@ -281,6 +297,7 @@
<el-button
type="primary"
@click="handleUp"
:disabled="$store.state.d2admin.loading.value"
>上架</el-button>
</div>
<relate-pro-dialog
......@@ -299,6 +316,13 @@
@handleRelateStoreConfirm="handleRelateStoreConfirm"
@handleRelateStoreClose="handleRelateStoreClose"
></relate-store-dialog>
<el-dialog :visible.sync="lookImgVisible">
<img
width="100%"
:src="imageUrl"
alt="图片"
>
</el-dialog>
</d2-container>
</template>
......@@ -315,6 +339,8 @@ export default {
// 关联商品弹窗
relateProVisible: false,
relateStoreVisible: false,
lookImgVisible: false,
imageUrl: '',
storeSelected: [],
proIndex: -1,
proList: [],
......@@ -352,6 +378,10 @@ export default {
type: Object,
default: () => { }
},
formRef: {
type: String,
default: ''
},
originData: {
type: Object,
default: () => {
......@@ -396,16 +426,30 @@ export default {
// value && (this.formData[item.attrName] = item.optionList.find(i => i[item.optionId] === this.formData[item.name])[item.optionLabel])
// }
},
handleAddPro() {
handleAddPro(targetItem) {
if (!this.formData[targetItem.relateAttr]) {
// this.notice.warningTips('请选择基础商品')
this.$message({
message: '请选择基础商品',
type: 'warning',
showClose: true
})
this.jumpScroll(targetItem.relateAttr)
return true
}
this.markTarget = targetItem
console.log(this.markTarget)
var proSelectedIds = this.formData.upgradeGoods.map(item => item.goodsCode)
proSelectedIds.push(this.formData[targetItem.relateAttr])
this.proList.forEach(item => {
proSelectedIds.includes(item.goodsCode) && (item.disabled = true)
item.disabled = proSelectedIds.includes(item.goodsCode)
})
this.relateProVisible = true
},
handleProChange(targetItem, targetIndex) {
// console.log(targetItem)
var proSelectedIds = this.formData.upgradeGoods.map(item => item.goodsCode)
proSelectedIds.push(this.formData[targetItem.relateAttr])
this.proList.forEach(item => {
if (proSelectedIds.includes(item.goodsCode) && (item.goodsCode !== targetItem.goodsCode)) {
item.disabled = true
......@@ -417,16 +461,28 @@ export default {
this.originProInfo = targetItem
this.relateProVisible = true
},
judgeIsDisable() {
// console.log(this.markTarget)
if (this.addOrEdit === 'add') {
this.formList[0].formBlock[0].isDisabled = this.formData[this.markTarget.name].length
}
},
handleRelateProConfirm(proInfo) {
this.relateProVisible = false
proInfo.profitType = 1
this.originProInfo = {}
// this.relateProVisible = false
// this.originProInfo = {}
if (this.proIndex !== -1) {
this.formData.upgradeGoods[this.proIndex] = proInfo
} else {
proInfo = {
...proInfo,
profitType: 1
}
this.formData.upgradeGoods.push(proInfo)
console.log(this.formData.upgradeGoods[this.proIndex])
this.judgeIsDisable()
}
this.proIndex = -1
this.handleRelateProClose()
// this.proIndex = -1
},
handleRelateProClose() {
this.originProInfo = {}
......@@ -435,6 +491,15 @@ export default {
},
handleRelateStoreConfirm(selectedData) {
// console.log(selectedData)
if (!selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true
})
return true
}
this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate('linkMerchantIds')
this.relateStoreVisible = false
this.formData.linkMerchantIds = selectedData
},
......@@ -453,6 +518,9 @@ export default {
var formDataName = formItem.name
var filterArr = this.formData[formDataName].filter(i => i[formItem.optionValue] !== item[formItem.optionValue])
this.formData[formDataName] = filterArr
// console.log(this.formData)
// console.log(formDataName)
this.judgeIsDisable()
},
// 图片
handleAddClick(targetItem) {
......@@ -461,6 +529,7 @@ export default {
// document.getElementsByClassName(targetItem.name + 'file')[0].value = null
},
handleImgChange(e, targetItem, subIndex = 0) {
// console.log(this.$refs[this.formRef + 'd2FormRuleForm'].validate(targetItem.name))
var reader = new FileReader()
var fileInfo = e.srcElement.files[0]
reader.readAsDataURL(fileInfo)
......@@ -469,7 +538,8 @@ export default {
const base64 = fileInfo.name.split('.')[1] + '@' + imgFile.split(',')[1]
// console.log(base64)
uploadImg({ file: base64 }).then(res => {
console.log(res)
// console.log(res)
this.$refs[this.formRef + 'd2FormRuleForm'].clearValidate(targetItem.name)
if (targetItem.maxPhotoNum === 1) {
this.formData[targetItem.name] = [{
content: res
......@@ -481,7 +551,7 @@ export default {
} else {
this.formData[targetItem.name][subIndex].content = res
}
console.log(this.formData[targetItem.name])
// console.log(this.formData[targetItem.name])
})
}
},
......@@ -489,6 +559,11 @@ export default {
handleImgDelete(targetItem, subIndex = -1) {
Array.isArray(this.formData[targetItem.name]) ? this.formData[targetItem.name].splice(subIndex, 1) : (this.formData[targetItem.name] = '')
},
// 图片查看
handleImgLook(src) {
this.lookImgVisible = true
this.imageUrl = src
},
// 描述 1-图片;2-文字
handleAddDesc(resType, targetItem) {
// console.log(this.formData[targetItem.name])
......@@ -502,26 +577,61 @@ export default {
handleClose() {
this.$emit('handleClose')
},
jumpScroll(idName) {
document.getElementById(idName).scrollIntoView()
},
handleUp() {
// console.log(this.formData)
let flag = true
if (this.formData.hasOwnProperty('upgradeGoods')) {
this.formData.upgradeGoods.forEach(item => {
if (!item.profitValue) {
flag = false
// const flag = true
// if (this.formData.hasOwnProperty('upgradeGoods')) {
// this.formData.upgradeGoods.forEach(item => {
// if (!item.profitValue) {
// flag = false
// }
// })
// if (!this.formData.linkMerchantIds.length) {
// flag = false
// }
// }
// if (flag) {
this.$refs[this.formRef + 'd2FormRuleForm'].validate(valid => {
if (valid) {
// const flag = true
if (this.formData.hasOwnProperty('upgradeGoods')) {
this.formData.upgradeGoods.forEach(item => {
if (!item.profitValue) {
// flag = false
return true
}
})
if (!this.formData.linkMerchantIds.length) {
// flag = false
return true
}
}
})
if (!this.formData.linkMerchantIds.length) {
flag = false
}
}
if (flag) {
this.$refs.d2FormRuleForm.validate(valid => {
if (valid) {
this.$emit('handleAddConfirm', this.formData)
this.$emit('handleAddConfirm', this.formData)
} else {
var needRuleList = Object.keys(this.rules)
// console.log(needRuleList)
for (var i in needRuleList) {
// needRuleList.forEach(item => {
const item = needRuleList[i]
if (Array.isArray(this.formData[item])) {
if (!this.formData[item].length) {
this.jumpScroll(item)
return true
}
} else {
if (!this.formData[item]) {
this.jumpScroll(item)
return true
}
}
}
})
}
// })
}
})
// }
}
}
}
......@@ -562,8 +672,7 @@ export default {
width: 88px;
height: 74px;
}
.d2-form .activity-img,
.d2-form .descList-img {
.d2-form .activity-img {
position: relative;
/* width: 88px;
height: 74px; */
......@@ -580,6 +689,7 @@ export default {
}
.d2-form .muti-imgs {
display: inline-block;
position: relative;
}
......@@ -588,10 +698,10 @@ export default {
height: 74px;
} */
.activity-img img {
/* .activity-img img {
width: 100%;
height: 100%;
}
} */
.activity-img .add {
position: absolute;
......@@ -608,7 +718,7 @@ export default {
transform: translateX(-50%);
}
.activity-img .close {
.muti-imgs .img-btns {
display: none;
width: 100%;
height: 100%;
......@@ -616,26 +726,36 @@ export default {
left: 0;
top: 0;
z-index: 2;
color: #fff;
background: rgba(0, 0, 0, 0.5);
opacity: 1;
}
.d2-form .el-icon-delete {
.d2-form .el-icon-delete,
.d2-form .el-icon-zoom-in {
cursor: pointer;
}
.activity-img .close i {
width: 18px;
height: 18px;
.muti-imgs .img-btns .btn-item {
/* width: 18px;
height: 18px; */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.activity-img:hover .close {
.muti-imgs .img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.muti-imgs:hover .img-btns {
display: block;
}
.d2-form .input-bg {
background-color: #eee;
/* background-color: #eee; */
}
.d2-form .desc-btns {
margin-bottom: 6px;
}
.d2-form .pro-item.el-input--medium .el-input__inner,
.d2-form .pro-item .el-input--medium .el-input__inner {
......
......@@ -49,6 +49,7 @@
v-model="proInfo.upgradePrice"
placeholder="请输入建议升级价"
class="dis-in-block"
@input="handleUpgradePrice"
></el-input>
<span>元</span>
</el-form-item>
......@@ -60,6 +61,7 @@
v-model="proInfo.shopPrice"
placeholder="请输入建议到店价"
class="dis-in-block"
@input="handleShopPrice"
></el-input>
<span>元</span>
</el-form-item>
......@@ -69,6 +71,7 @@
placeholder="请输入升级最大折扣"
clearable
class="dis-in-block"
@input="handleMaxUpgradeDiscount"
></el-input>
<span>折</span>
</el-form-item>
......@@ -78,6 +81,8 @@
</template>
<script>
import _ from 'lodash'
import { limitPrice } from '@/common/constants'
export default {
name: 'relateProDialog',
data() {
......@@ -97,10 +102,27 @@ export default {
goodsCode: [{ required: true, message: '请选择关联升级商品', trigger: 'blur' }],
upgradePrice: [{ required: true, message: '请输入建议升级价', trigger: 'blur' }],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }]
},
oldVal: {
upgradePrice: '',
shopPrice: '',
maxUpgradeDiscount: ''
}
}
},
// watch: {
// 'proInfo.upgradePrice'(val, oldVal) {
// this.proInfo.upgradePrice = limitPrice(val, oldVal, 8, 2)
// },
// 'proInfo.shopPrice'(val, oldVal) {
// this.proInfo.shopPrice = limitPrice(val, oldVal, 6, 2)
// },
// 'proInfo.maxUpgradeDiscount'(val, oldVal) {
// this.proInfo.maxUpgradeDiscount = limitPrice(val, oldVal, 1, 1, 1)
// }
// },
props: {
relateProVisible: {
type: Boolean,
......@@ -117,9 +139,9 @@ export default {
},
mounted() {
this.proInfo = this.originProInfo || this.proInfo
console.log(this.proInfo)
console.log(this.proList)
this.proInfo = _.cloneDeep(this.originProInfo) || _.cloneDeep(this.proInfo)
// console.log(this.proInfo)
// console.log(this.proList)
},
methods: {
......@@ -140,6 +162,18 @@ export default {
},
handleRelateProClose() {
this.$emit('handleRelateProClose')
},
handleUpgradePrice(newVal) {
this.proInfo.upgradePrice = limitPrice(newVal, this.oldVal.upgradePrice, 8, 2)
this.oldVal.upgradePrice = this.proInfo.upgradePrice
},
handleShopPrice(newVal) {
this.proInfo.shopPrice = limitPrice(newVal, this.oldVal.shopPrice, 6, 2)
this.oldVal.shopPrice = this.proInfo.shopPrice
},
handleMaxUpgradeDiscount(newVal) {
this.proInfo.maxUpgradeDiscount = limitPrice(newVal, this.oldVal.maxUpgradeDiscount, 1, 1, 1)
this.oldVal.maxUpgradeDiscount = this.proInfo.maxUpgradeDiscount
}
}
}
......
......@@ -35,14 +35,14 @@ export default {
this.show = false
this.$event.$on('e-password-dialog', res => (this.passVisible = res))
this.getInfo()
this.$nextTick(() => {
this.show = true
})
},
methods: {
...mapActions('d2admin/user', ['load']),
async getInfo() {
this.info = await this.load()
this.$nextTick(() => {
this.show = true
})
}
}
}
......
......@@ -95,7 +95,8 @@
title="关联门店信息"
:className="storeDetail"
:isVisible.sync="detailVisible"
@closeDialog="handleDetailClose"
noCancel="true"
@confirmDialog="handleDetailClose"
>
<store-detail
v-if="detailVisible"
......@@ -133,6 +134,9 @@ export default {
listName: 'list',
tableOption: true,
tableColumns: [{
label: '序号',
prop: 'index'
}, {
label: '商品ID',
prop: 'goodsCode'
}, {
......
......@@ -10,16 +10,17 @@
:addOrEdit="addOrEdit"
:originData="editData"
:formList="editForm"
:formRef="comFormRef"
:headImg="headImg"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"
></d2-form>
</d2-container>
</template>
<script>
import { mapActions } from 'vuex'
import { limitPrice } from '@/common/constants'
import { commodityAddSeviceMerchant, getGoodsList, baseGoodsAdd, baseGoodsUpdate, getGoodsInfoById } from '@/api/commodity'
export default {
name: 'editCommodity',
......@@ -38,9 +39,14 @@ export default {
upgradeGoods: [],
linkMerchantIds: []
},
markOldVal: {
retailPrice: '',
shopPrice: '',
maxRetailDiscount: ''
},
formItemWidth: '200px',
rules: {
goodsCode: [{ required: true, message: '请选择商品名称', trigger: 'blur' }],
goodsCode: [{ required: true, message: '请选择商品名称', trigger: 'change' }],
shopPrice: [{ required: true, message: '请输入到店价', trigger: 'blur' }],
linkMerchantIds: [{ required: true, message: '请选择关联门店', trigger: 'change' }]
},
......@@ -48,6 +54,7 @@ export default {
isHas: true,
attr: 'thumbUrl'
},
comFormRef: 'com',
editForm: [{
title: '商品基本信息',
formBlock: [{
......@@ -84,18 +91,30 @@ export default {
label: '商品零售价',
type: 'input',
unit: '元',
tips: '(前端展示给车主)'
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: '(商品最终交易价格)'
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: '折'
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: '关联升级商品信息',
......@@ -103,7 +122,8 @@ export default {
name: 'upgradeGoods',
label: '关联升级商品',
type: 'relatePro',
optionValue: 'goodsCode'
optionValue: 'goodsCode',
relateAttr: 'goodsCode'
}]
}, {
title: '关联门店信息',
......@@ -125,6 +145,7 @@ export default {
// console.log(this.editData)
// add - 新增;edit - 编辑
this.addOrEdit = this.$route.params.addOrEdit
this.getGoodsList()
if (this.addOrEdit === 'edit') {
getGoodsInfoById({ id: this.$route.params.row.id }).then(res => {
// console.log(res)
......@@ -140,6 +161,7 @@ export default {
shopPrice: res.shopPrice,
maxRetailDiscount: res.maxRetailDiscount,
upgradeGoods: res.upgradeGoodsList.map(item => {
item['goodsName'] = item.goodsInfo.goodsName
item['thumbUrl'] = item.goodsInfo.thumbUrl
return item
}),
......@@ -152,7 +174,6 @@ export default {
})
} else {
this.editForm[0].formBlock[0].isDisabled = false
this.getGoodsListNoBase()
this.$nextTick(() => {
this.show = true
})
......@@ -162,10 +183,9 @@ export default {
methods: {
...mapActions({ close: 'd2admin/page/close' }),
// ...mapActions('d2admin/page', ['close']),
getGoodsListNoBase() {
getGoodsList({
exceptBase: true
}).then(res => {
getGoodsList() {
// var params = this.addOrEdit === 'edit' ? {} : { exceptBase: true }
getGoodsList({}).then(res => {
// console.log(res)
this.editForm[0].formBlock[0].optionList = res
})
......
......@@ -9,6 +9,7 @@
addOrEdit="add"
:originData="editData"
:formList="editForm"
:formRef="proFormRef"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"
></d2-form>
......@@ -27,8 +28,8 @@ export default {
show: false,
addOrEdit: 'add',
rules: {
goodsName: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
goodsType: [{ required: true, message: '请选择分类', trigger: 'blur' }],
goodsName: [{ required: true, message: '请输入产品名称', trigger: 'change' }],
goodsType: [{ required: true, message: '请选择分类', trigger: 'change' }],
// thumbUrl: [{ required: true, message: '请选择缩略图', trigger: 'change' }],
thumbUrlList: [{ required: true, message: '请选择缩略图', trigger: 'blur' }],
goodsImgList: [{ required: true, message: '请选择产品主图', trigger: 'blur' }]
......@@ -49,6 +50,7 @@ export default {
content: ''
}]
},
proFormRef: 'pro',
editForm: [{
title: '产品基本信息',
formBlock: [{
......
......@@ -10,6 +10,7 @@
<el-form-item label="产品名称">
<el-input
v-model="searchForm.goodsName"
placeholder="请输入产品名称"
clearable
></el-input>
</el-form-item>
......@@ -163,11 +164,12 @@ export default {
resolve()
})
},
handleSearch() {
console.log(this.searchForm)
},
handleReset() {
this.$refs.productTable.refreshTable()
this.searchForm = {
goodsName: '',
goodsType: '',
brandMerchantCode: ''
}
},
handleAdd(form) {
// console.log(form)
......
......@@ -50,7 +50,6 @@
v-model="formLogin.userName"
placeholder="用户名"
clearable
maxlength="10"
v-focus
>
<!-- <d2-el-icon
......@@ -65,7 +64,6 @@
v-model="formLogin.password"
v-on:keyup.native.13="submit"
clearable
maxlength="12"
placeholder="密码"
>
<!-- <d2-el-icon
......@@ -141,8 +139,7 @@ export default {
required: true,
message: '请输入密码',
trigger: 'submit'
}
]
}]
})
}
},
......
......@@ -57,7 +57,7 @@ export default {
label: '登录账户'
}, {
name: 'loginPhone',
label: '登陆手机号'
label: '登录手机号'
}, {
name: 'merchantId',
label: '商户号'
......
......@@ -7,9 +7,10 @@
label-width="85px"
slot="header"
>
<el-form-item label="商品名称">
<el-form-item label="商户名称">
<el-input
v-model="searchForm.merchantName"
placeholder="请输入商户名称"
clearable
></el-input>
</el-form-item>
......@@ -192,7 +193,12 @@ export default {
handleRelateStoreConfirm(selectedData) {
console.log(selectedData)
if (!selectedData.length) {
this.notice.warningTips('请选择关联门店')
// this.notice.warningTips('请选择关联门店')
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true
})
return true
}
addServiceMerchant({ list: selectedData }).then(res => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!