Commit 729f9796 by 前端

Merge branch 'xuyl_dev_v2.10.0' into 'v2.10.0'

修复上传头像校验,tab切换,访问量为0跳转问题

See merge request !21
2 parents 5f7d6af5 ae7c5c21
...@@ -35,6 +35,7 @@ export default { ...@@ -35,6 +35,7 @@ export default {
if (res) { if (res) {
if (!this.addCodeForm.headerSrc) { if (!this.addCodeForm.headerSrc) {
this.addCodeForm.image = res this.addCodeForm.image = res
this.hasImage = true
} else { } else {
this.addCodeForm.headerSrc = res this.addCodeForm.headerSrc = res
} }
......
...@@ -41,8 +41,11 @@ ...@@ -41,8 +41,11 @@
<div class="upload-text">上传头像</div> <div class="upload-text">上传头像</div>
<input type="file" style="opacity: 0" ref="avatar" accept="*" @change="uploadAvatar" /> <input type="file" style="opacity: 0" ref="avatar" accept="*" @change="uploadAvatar" />
</div> </div>
<div class="el-form-item__error" v-if="!hasImage">请上传头像</div>
</div> </div>
</div> </div>
<!-- <el-form-item label="联系电话:" prop="agentPhone">--> <!-- <el-form-item label="联系电话:" prop="agentPhone">-->
<!-- <el-input size="small" v-model.trim="addCodeForm.agentPhone" placeholder="请输入联系电话" maxlength="30"></el-input>--> <!-- <el-input size="small" v-model.trim="addCodeForm.agentPhone" placeholder="请输入联系电话" maxlength="30"></el-input>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
...@@ -113,6 +116,7 @@ export default { ...@@ -113,6 +116,7 @@ export default {
components: { selectEmpRadio, selectTag }, components: { selectEmpRadio, selectTag },
data() { data() {
return { return {
hasImage:true,
dialogSrc:'', dialogSrc:'',
dialogVisibleImg:false, dialogVisibleImg:false,
dialogVisible: false, dialogVisible: false,
...@@ -132,7 +136,7 @@ export default { ...@@ -132,7 +136,7 @@ export default {
previewListStart: [], previewListStart: [],
codeRules: { codeRules: {
cardName: [{ required: true, message: '请输入渠道名称', trigger: 'blur' }], cardName: [{ required: true, message: '请输入渠道名称', trigger: 'blur' }],
// agentPhone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }], image: [{ required: true, message: '请上传头像', trigger: 'change' }],
operation: [{ required: true, message: '请输入对外职务', trigger: 'blur' }] operation: [{ required: true, message: '请输入对外职务', trigger: 'blur' }]
} }
} }
...@@ -222,6 +226,10 @@ export default { ...@@ -222,6 +226,10 @@ export default {
this.staffStatus = true this.staffStatus = true
return return
} }
if (this.addCodeForm && !this.addCodeForm.image) {
this.hasImage = false
return
}
this.$refs['codeForm'].validate(valid => { this.$refs['codeForm'].validate(valid => {
if (valid) { if (valid) {
let param = Object.assign({ id: this.codeId }, this.addCodeForm) let param = Object.assign({ id: this.codeId }, this.addCodeForm)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div> </div>
<div slot="visitCont" slot-scope="scope"> <div slot="visitCont" slot-scope="scope">
<div class="visitCont" @click="visitCisitCont(scope.scope.cardName)">{{ scope.scope.visitCont || '--' }}</div> <div class="visitCont" @click="visitCisitCont(scope.scope)">{{ scope.scope.visitCont || '--' }}</div>
</div> </div>
<div slot="qrCode" slot-scope="scope"> <div slot="qrCode" slot-scope="scope">
<el-popover placement="bottom" width="400" trigger="hover"> <el-popover placement="bottom" width="400" trigger="hover">
...@@ -179,7 +179,9 @@ export default { ...@@ -179,7 +179,9 @@ export default {
}, },
methods: { methods: {
// 跳转访问量 // 跳转访问量
visitCisitCont(cardName) { visitCisitCont(scope) {
const { cardName, visitCont } = scope
if (!visitCont) return
this.$parent.query = { cardName } this.$parent.query = { cardName }
this.$parent.activeName = '2' this.$parent.activeName = '2'
}, },
......
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
} }
}, },
mounted() { mounted() {
if (this.$parent.query) { if (this.$parent.query && this.$parent.query.cardName) {
let { cardName } = this.$parent.query let { cardName } = this.$parent.query
this.timeRadio = this.dateInterval = 4 this.timeRadio = this.dateInterval = 4
this.$set(this.tableSearchForm, 'cardName', cardName) this.$set(this.tableSearchForm, 'cardName', cardName)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!