Commit 80ca1482 by 张权

自测bug修改

1 parent 15bdcba4
......@@ -61,6 +61,7 @@ const uploadFileApi = (params, callback) => {
data: params,
sign: true,
noSignAttr: ['file'],
returnAll: true,
onUploadProgress: res => {
callback(res)
}
......
......@@ -97,21 +97,23 @@ export default {
},
methods: {
beforeAvatarUpload(e, fieldName) {
console.log(e)
let AllImgExt = '.png|.jpg|.jpeg'
if (fieldName === 'otherInfo') {
AllImgExt = '.zip|.jpeg|.rar|.png|.jpg|.pdf|.doc|.docx'
}
let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = e.size / 1024 / 1024
if (size > 9) {
this.$message.error('上传文件不可超过9M')
return false
}
return new Promise((resolve, reject) => {
let AllImgExt = '.png|.jpg|.jpeg'
if (fieldName === 'otherInfo') {
AllImgExt = '.zip|.jpeg|.rar|.png|.jpg|.pdf|.doc|.docx'
}
let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return reject(false)
}
const size = e.size / 1024 / 1024
if (size > 9) {
this.$message.error('上传文件不可超过9M')
return reject(false)
}
return resolve(true)
})
},
getFileType(type) {
if (!type) return 'zip'
......@@ -146,26 +148,25 @@ export default {
this.$set(this.materialForm[fieldName][id], 'progress', ((res.loaded / res.total) * 100).toFixed(2))
})
.then(res => {
if (res) {
this.$set(this.materialForm[fieldName][id], 'url', res[0])
if (res.code == '0') {
this.$set(this.materialForm[fieldName][id], 'url', res.data[0])
} else {
this.handleRemove(e, fieldName, 1)
// this.materialForm[fieldName] = this.materialForm[fieldName].filter(item => item.url)
// console.log(this.materialForm[fieldName])
this.materialForm[fieldName].splice(id, 1)
}
})
}
},
handleRemove(e, fieldName, isDel) {
if (isDel) {
let id = this.$refs[fieldName + 'Ref'][0].uploadFiles.findIndex(item => item.uid === e.uid)
this.$refs[fieldName + 'Ref'][0].uploadFiles.splice(id, 1)
} else {
const index = this.materialForm[fieldName].findIndex(item => item.url == e)
setTimeout(() => {
this.materialForm[fieldName].splice(index, 1)
})
//加定时是因为去除element删除有一个闪动
}
handleRemove(e, fieldName) {
if (e.status == 'ready') return
// let id = this.$refs[fieldName + 'Ref'][0].uploadFiles.findIndex(item => item.uid === e.uid)
// this.$refs[fieldName + 'Ref'][0].uploadFiles.splice(id, 1)
const index = this.materialForm[fieldName].findIndex(item => item.url == e)
setTimeout(() => {
this.materialForm[fieldName].splice(index, 1)
})
//加定时是因为去除element删除有一个闪动
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
......
......@@ -34,7 +34,7 @@
</div>
<div class="collecter">
<label class="require" for="">收款对象:</label>
<el-radio-group :disabled="pageType == 2" v-model="accountForm.objectType">
<el-radio-group @change="changeObjectType" :disabled="pageType == 2" v-model="accountForm.objectType">
<el-radio :label="0">店面</el-radio>
<el-radio :label="1">其他</el-radio>
</el-radio-group>
......@@ -67,6 +67,8 @@ export default {
},
data() {
return {
saveObj:{},
otherSaveObj:{},
accountData:[
{
label: '账户类型',
......@@ -196,25 +198,59 @@ export default {
},
created(){
this.getBankList()
this.initSaveObj()
},
mounted() {
},
watch:{
'accountForm.objectType':{
handler(newVal,oldVal){
const item = this.accountData.find(item => {
return item.name == 'accountType'
})
item.isHide = newVal==0
if(newVal==0){
this.accountForm.accountType = 0
}
},
immediate:true
}
},
// watch:{
// 'accountForm.objectType':{
// handler(newVal,oldVal){
// const item = this.accountData.find(item => {
// return item.name == 'accountType'
// })
// // item.isHide = newVal==0
// if(newVal==0){
// this.accountForm.accountType = 0
// }
// },
// immediate:true
// }
// },
methods:{
initSaveObj(){
const obj = {
accountType: 0,
branchBankCode: '',
accountName: '',
accountNo: '',
bankCity: '',
payeeIDCardType: '',
payeeIDCardNo: '',
payeePhone: ''
}
this.saveObj = {...obj}
this.otherSaveObj = {...obj}
},
changeObjectType(newVal){
const item = this.accountData.find(item => {
return item.name == 'accountType'
})
item.isHide = newVal==0
const obj = {}
for(let key in this.saveObj){
obj[key] = this.accountForm[key]
}
if(newVal==0){
this.accountForm.accountType = 0
this.saveObj = {...obj}
this.accountForm = {...this.accountForm,...this.otherSaveObj}
}else{
this.otherSaveObj = {...obj}
this.accountForm = {...this.accountForm,...this.saveObj}
}
},
getBankList() {
this.$apis.claims.getBankList({}).then(res => {
const branchBankList = this.accountData.find(item => item.name ==='branchBankCode')
......@@ -242,6 +278,10 @@ export default {
if(lastStr==='.'){
this.$set(this.serviceItemsList[id], 'approveAmount' , e.target.value.substr(0 ,len-1))
}
const minPrice = 1
if(parseInt(e.target.value)<minPrice){
this.$set(this.serviceItemsList[id], 'approveAmount' , 1)
}
const maxPrice = 2000000
if(parseInt(e.target.value)>maxPrice){
this.$set(this.serviceItemsList[id], 'approveAmount' , maxPrice)
......
......@@ -13,7 +13,7 @@
单校验不通过退回处理,为保障客户权益,请尽快处理哦!
</div>
<div class="search_container">
<glsx-combi-form ref="showSearch" labelWidth="112px" defaultWidth="200px" :formObj="searchForm" :formData="searchFormData">
<glsx-combi-form ref="showSearch" labelWidth="112px" defaultWidth="218px" :formObj="searchForm" :formData="searchFormData">
<div slot="footer" class="footer-btns" style="float:right;">
<el-button size="small" @click="handleRestFn()">重置</el-button>
<el-button size="small" type="primary" @click="handleOkFn">查询</el-button>
......@@ -119,10 +119,10 @@ export default {
},
{
label: '客户名称',
prop: 'merchantName',
prop: 'reporterName',
width: '200',
formatter: cellValue => {
return cellValue.merchantName || '-'
return cellValue.reporterName || '-'
}
},
{
......
......@@ -163,6 +163,9 @@ export default {
// this.accountForm[key] = result[key] || this.accountForm[key]
// }
this.accountForm = { ...this.accountForm, ...result }
if (this.accountForm.accountType == 1 && this.accountForm.objectType == 0) {
this.accountForm.objectType == 1
}
})
},
// 根据页面跳转参数处理表单信息-自动填入
......@@ -188,15 +191,29 @@ export default {
}
})
})
let tipObj = {
isTip: false,
tipMsg: ''
}
this.serviceItemsList.forEach(item => {
if (item.approveAmount <= 0) {
this.$message({
message: `请输入${item.serviceItemName}的金额,必须大于0`,
type: 'error'
})
valid = false
if (item.approveAmount <= 0 && !tipObj.isTip) {
tipObj.isTip = true
tipObj.tipMsg = `请输入大于等于1的${item.serviceItemName}价格`
}
})
for (let key in this.materialForm) {
if (this.materialForm[key].length < 1 && !tipObj.isTip) {
tipObj.isTip = true
tipObj.tipMsg = `请补全资料`
}
}
if (tipObj.isTip) {
this.$message({
message: tipObj.tipMsg,
type: 'error'
})
return false
}
return valid
},
// 提交核赔
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!