Commit a348f8de by 前端

Merge branch 'kuangyq_v2.8.0' into 'v2.8.0'

Kuangyq v2.8.0

See merge request !24
2 parents 68041259 9fe65b58
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<div></div> <div></div>
<el-form-item label="主营品牌" prop="brand"> <el-form-item label="主营品牌" prop="brand">
<el-input <el-input
class="limitLen"
v-model="ruleForm.brand" v-model="ruleForm.brand"
placeholder="请输入商户主营品牌" placeholder="请输入商户主营品牌"
maxlength="50" maxlength="50"
...@@ -44,6 +45,7 @@ ...@@ -44,6 +45,7 @@
</el-form-item> </el-form-item>
<el-form-item label="商户地址" prop="address"> <el-form-item label="商户地址" prop="address">
<el-input <el-input
class="limitLen"
v-model="ruleForm.address" v-model="ruleForm.address"
placeholder="请输入商户地址" placeholder="请输入商户地址"
maxlength="100" maxlength="100"
...@@ -52,6 +54,7 @@ ...@@ -52,6 +54,7 @@
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input <el-input
class="limitLen"
type="textarea" type="textarea"
v-model="ruleForm.remarks" v-model="ruleForm.remarks"
placeholder="请输入备注内容" placeholder="请输入备注内容"
...@@ -110,7 +113,7 @@ ...@@ -110,7 +113,7 @@
</span> </span>
</template> </template>
<template v-if="uploadStatus == 'fail'"> <template v-if="uploadStatus == 'fail'">
<span>数据导入失败,{{uploadErrorMsg}},请重试!</span> <span>数据导入失败,{{ uploadErrorMsg }},请重试!</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button plain type="primary" @click="dialogVisible = false" <el-button plain type="primary" @click="dialogVisible = false"
>取消</el-button >取消</el-button
...@@ -121,7 +124,6 @@ ...@@ -121,7 +124,6 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { addNamelistApi } from '@/api/addNamelist' import { addNamelistApi } from '@/api/addNamelist'
import { customerApi } from '@/api/customer' import { customerApi } from '@/api/customer'
...@@ -129,7 +131,6 @@ import { uploadApi } from '@/api/upload' ...@@ -129,7 +131,6 @@ import { uploadApi } from '@/api/upload'
export default { export default {
data() { data() {
return { return {
fullscreenLoading: false,
uploadSuccessMsg: '', uploadSuccessMsg: '',
uploadErrorMsg: '', uploadErrorMsg: '',
marchantNameCopy: '', //存放搜索的商户名 marchantNameCopy: '', //存放搜索的商户名
...@@ -157,12 +158,14 @@ export default { ...@@ -157,12 +158,14 @@ export default {
remarks: '' remarks: ''
}, },
rules: { rules: {
merchant: [{ required: true, message: '请选择商户', trigger: 'blur' }], merchant: [
{ required: true, message: '请选择商户', trigger: 'change' }
],
brand: [ brand: [
{ required: true, message: '请输入商户主营品牌', trigger: 'blur' } { required: true, message: '请输入商户主营品牌', trigger: 'change' }
], ],
address: [ address: [
{ required: true, message: '请输入商户地址', trigger: 'blur' } { required: true, message: '请输入商户地址', trigger: 'change' }
], ],
remarks: [{ required: false, trigger: 'blur' }] remarks: [{ required: false, trigger: 'blur' }]
} }
...@@ -270,21 +273,26 @@ export default { ...@@ -270,21 +273,26 @@ export default {
return el.merchantName == label return el.merchantName == label
}) })
this.merchantId = obj[0] && obj[0].merchantId this.merchantId = obj[0] && obj[0].merchantId
// this.merchantId = 44209941
await addNamelistApi await addNamelistApi
.findMerchantDetailByMerchantNo({ merchantId: this.merchantId }) .findMerchantDetailByMerchantNo({ merchantId: this.merchantId })
.then(res => { .then(res => {
console.log(res)
let brandTreeList = res.data.data && res.data.data.brandTreeList let brandTreeList = res.data.data && res.data.data.brandTreeList
let brandTreeListName = let brandTreeListName =
brandTreeList && brandTreeList.map(item => item.name) brandTreeList && brandTreeList.map(item => item.name)
this.$set( let brandNamStr = brandTreeListName && brandTreeListName.toString()
this.ruleForm, if (brandNamStr && brandNamStr.length > 50) {
'brand', this.$set(this.ruleForm, 'brand', brandNamStr.slice(0, 50))
brandTreeListName && brandTreeListName.toString() } else {
) this.$set(this.ruleForm, 'brand', brandNamStr)
}
}) })
this.$set(this.ruleForm, 'address', obj[0] && obj[0].merchantAddress) // 地址设置
let merchantAddressStr = obj[0] && obj[0].merchantAddress
if (merchantAddressStr && merchantAddressStr.length > 100) {
this.$set(this.ruleForm, 'address', merchantAddressStr.slice(0, 100))
} else {
this.$set(this.ruleForm, 'address', merchantAddressStr)
}
} }
}, },
submitForm() { submitForm() {
...@@ -307,8 +315,9 @@ export default { ...@@ -307,8 +315,9 @@ export default {
merchantId: this.merchantId, merchantId: this.merchantId,
file: this.fileBaseUrl file: this.fileBaseUrl
} }
customerApi.addCustomerList(params).then(res => { customerApi.addCustomerList(params).then(
const loading = this.$loading({ res => {
let loading = this.$loading({
lock: true, lock: true,
text: 'Loading', text: 'Loading',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
...@@ -325,7 +334,20 @@ export default { ...@@ -325,7 +334,20 @@ export default {
this.uploadStatus = 'fail' this.uploadStatus = 'fail'
this.uploadErrorMsg = res.message this.uploadErrorMsg = res.message
} }
},
err => {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
}) })
loading.close()
this.dialogVisible = true
this.uploadStatus = 'fail'
this.uploadErrorMsg = err
}
)
} else { } else {
return false return false
} }
...@@ -334,6 +356,7 @@ export default { ...@@ -334,6 +356,7 @@ export default {
uploadFile(e) { uploadFile(e) {
const file = e.srcElement.files[0] const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx' let AllImgExt = '.xls|.xlsx'
if (file) {
let extName = file.name let extName = file.name
.substring(file.name.lastIndexOf('.')) .substring(file.name.lastIndexOf('.'))
.toLowerCase() .toLowerCase()
...@@ -357,15 +380,27 @@ export default { ...@@ -357,15 +380,27 @@ export default {
const splitStr = file.name.split('.') const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1] const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
let fileList = [{ file: fileUrl, fileType: 'doc' }] let fileList = [{ file: fileUrl, fileType: 'doc' }]
uploadApi.multipleUpload({ fileList }).then(res => { uploadApi.multipleUpload({ fileList }).then(
res => {
if (res) { if (res) {
this.fileBaseUrl = res.data.data[0] if (res.code == '0') {
this.fileBaseUrl = res.data[0]
} else {
this.fileName = ''
this.$message.error('文件上传失败')
}
}
},
err => {
this.fileName = ''
this.$message.error('文件上传失败')
}
)
} }
})
} }
}, },
back() { back() {
this.$root.to(['UBI续保', '续保', '保险渠道管理', '客户名单管理']) window.history.go(-1)
this.dialogVisible = false this.dialogVisible = false
if (this.uploadStatus == 'success') { if (this.uploadStatus == 'success') {
this.ruleForm = {} this.ruleForm = {}
...@@ -375,7 +410,6 @@ export default { ...@@ -375,7 +410,6 @@ export default {
} }
} }
</script> </script>
<style scoped> <style scoped>
.biasicInfo { .biasicInfo {
width: 500px; width: 500px;
...@@ -442,4 +476,7 @@ export default { ...@@ -442,4 +476,7 @@ export default {
.el-form-item { .el-form-item {
margin-bottom: 20px; margin-bottom: 20px;
} }
.limitLen {
padding-right: 60px;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!