Commit 06c5b256 by cwq0219

bug修复

1 parent 2decde1d
......@@ -4,7 +4,7 @@
<el-form
:model="formData"
:rules="rules"
ref="d2FormRuleForm"
:ref="formRef + 'd2FormRuleForm'"
>
<div
v-for="(i, idx) in formList"
......@@ -356,6 +356,10 @@ export default {
type: Object,
default: () => { }
},
formRef: {
type: String,
default: ''
},
originData: {
type: Object,
default: () => {
......@@ -527,24 +531,37 @@ export default {
},
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
this.$emit('handleAddConfirm', this.formData)
}
}
if (flag) {
this.$refs.d2FormRuleForm.validate(valid => {
if (valid) {
this.$emit('handleAddConfirm', this.formData)
}
})
}
})
// }
}
}
}
......
......@@ -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,6 +10,7 @@
:addOrEdit="addOrEdit"
:originData="editData"
:formList="editForm"
:formRef="comFormRef"
:headImg="headImg"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"
......@@ -40,7 +41,7 @@ export default {
},
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 +49,7 @@ export default {
isHas: true,
attr: 'thumbUrl'
},
comFormRef: 'com',
editForm: [{
title: '商品基本信息',
formBlock: [{
......@@ -142,6 +144,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
}),
......
......@@ -9,6 +9,7 @@
addOrEdit="add"
:originData="editData"
:formList="editForm"
:formRef="proFormRef"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"
></d2-form>
......@@ -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>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!