Commit 6e7bc2a3 by 张权

合并代码

1 parent 86f2d00e
<template>
<div class="report-components">
<div class="title">上传资料</div>
<div class="material">
<div v-for="item in materialData" :key="item.name">
<div>{{ item.label }}</div>
<el-upload :class="[(item.imgList ? item.limit != item.imgList.length : true) ? '' : 'hidePlusBtn']" :limit="item.limit" action="#" :before-upload="beforeAvatarUpload" list-type="picture-card" :ref="item.name + 'Ref'" :on-preview="handlePictureCardPreview" :on-remove="e => handleRemove(e, item.name)" :http-request="e => httpRequest(e, item.name)">
<el-upload :file-list="item.imgList" :class="[(item.imgList ? item.limit != item.imgList.length : true) ? '' : 'hidePlusBtn']" :limit="item.limit" action="#" :before-upload="beforeAvatarUpload" list-type="picture-card" :ref="item.name + 'Ref'" :on-preview="handlePictureCardPreview" :on-remove="e => handleRemove(e, item.name)" :http-request="e => httpRequest(e, item.name)">
<i slot="default" class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
......@@ -11,6 +12,7 @@
</el-dialog>
</div>
</div>
</div>
</template>
<script>
......@@ -31,11 +33,6 @@ export default {
billInfo: '',
otherInfo: ''
},
fieldInfo: {
cardInfo: [],
billInfo: [],
otherInfo: []
},
materialData: [
{
label: '身份证',
......@@ -53,7 +50,7 @@ export default {
label: '其他',
name: 'otherInfo',
limit: 1,
imgList: []
imgList: [{ url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100' }]
}
]
}
......@@ -83,10 +80,9 @@ export default {
const targetNameList = e.name.split('.')
const fileInfo = targetNameList[targetNameList.length - 1] + '@' + arrBase64[1]
this.$apis.ghBeforeSale.uploadImgApi({ file: fileInfo }).then(res => {
console.log(res)
if (res) {
let targetItem = this.materialData.find(item => item.name === fieldName)
targetItem.imgList.push(res)
targetItem.imgList.push({ url: res })
this.fieldInfo[fieldName].push(e.uid)
} else {
this.handleRemove(e, fieldName, 1)
......@@ -95,13 +91,12 @@ export default {
}
},
handleRemove(e, fieldName, isDel) {
console.log(e, fieldName)
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 {
console.log(this.fieldInfo[fieldName], e.uid)
let targetId = this.fieldInfo[fieldName].findIndex(item => item === e.uid)
console.log(targetId)
console.log(e, fieldName)
}
},
handlePictureCardPreview(file) {
......@@ -117,8 +112,13 @@ export default {
display: none;
}
}
// 上传闪屏问题
/deep/.el-upload-list__item.is-ready {
display: none;
}
.report-components {
background: white;
margin-top: 20px;
.title {
padding: 0 20px;
font-size: 16px;
......
......@@ -4,17 +4,18 @@
<div class="title">报案信息(店面补充)</div>
<glsx-combi-form class="edit-form-container" ref="handlerRef" :formRules="accountRule" labelWidth="144px" defaultWidth="320px" :formObj="accountForm" :formData="handlerForm"></glsx-combi-form>
</div>
<div class="report-components">
<div class="report-components repair-wrap">
<div class="title">维修信息</div>
<div>
<div class="repair-body">
<div>
<label for="">批准金额:</label>
<div class="service-wrap">
<div class="service-item" v-for="item in equityList" :key="item.name">
<div class="service-item" v-for="(item, index) in equityList" :key="item.name">
<p>{{ item.name }}</p>
<div class="price">
<label for="">定损批准金额:</label>
<el-input placeholder="请选择定损批准金额" v-model="item.price"></el-input>
<el-input @input="validPrice($event, index)" placeholder="请选择定损批准金额" v-model="item.price"></el-input>
<!-- <el-input @input="validPrice($event, index)" placeholder="请选择定损批准金额" v-model="item.price"></el-input> -->
</div>
</div>
</div>
......@@ -29,11 +30,7 @@
<el-radio v-model="accountForm.collectOwner" label="other">其他</el-radio>
</div>
<div class="account-info">
<glsx-combi-form ref="accountRef" :formRules="accountRule" labelWidth="144px" defaultWidth="320px" :formObj="accountForm" :formData="accountData">
<!-- <template slot="collectCity">
<city-select @onChange="selectAddress"></city-select>
</template> -->
</glsx-combi-form>
<glsx-combi-form ref="accountRef" :formRules="accountRule" labelWidth="144px" defaultWidth="320px" :formObj="accountForm" :formData="accountData"></glsx-combi-form>
</div>
</div>
</div>
......@@ -46,7 +43,9 @@ const phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9
export default {
name: 'repair',
props: {
accountForm: Object
accountForm: Object,
equityList: Array,
totalPrice:Number
},
components: {
glsxCombiForm,
......@@ -89,7 +88,15 @@ export default {
{
label: '收款账号所在省市',
name: 'collectCity',
addHtml: 'collectCity'
type: 'cascader',
isClear: true,
handleChange: cellValue => {
if (!cellValue || !cellValue.length) {
return
}
let nodesInfo = this.$refs.accountRef.$refs.cascader[0].getCheckedNodes()[0].pathLabels
this.currentAddress = nodesInfo
}
},
{
label: '收款人证件类型',
......@@ -178,48 +185,32 @@ export default {
}
],
},
equityList:[
{
name:'huiyuan痊愈',
price: 100
},
{
name:'会员权益',
price: 92
},
{
name:'核赔申请',
price: 65
},
{
name:'定损定损',
price: 63
},
]
}
},
computed:{
totalPrice(){
return this.equityList.reduce(function (prev, cur) {
return prev + (+cur.price)
}, 0);
}
},
mounted() {
},
methods:{
selectAddress(e) {
this.accountForm.collectCity = e.label.join('')
},
getParams(){
return {equityList: this.equityList, totalPrice: this.totalPrice}
},
validPrice(e,id){
let checkPlan = '' + this.equityList[id].price
checkPlan = checkPlan.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace(/^\./g, '').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');
if (checkPlan.indexOf('.') < 0 && checkPlan !== '') {
// 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
checkPlan = parseFloat(checkPlan) + ''
} else if (checkPlan.indexOf('.') >= 0) {
checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, '$1$2.$3') // 只能输入两个小数
}
this.$set(this.equityList[id], 'price' , checkPlan)
}
}
}
</script>
<style lang="scss" scoped>
.repair-wrap {
.repair-body {
padding: 20px;
}
}
.report-components {
background: white;
margin-top: 20px;
......
<template>
<div class="report-components">
<div class="title">报案信息(客户提交)</div>
<glsxCombiForm class="edit-form-container " ref="editFormRefReport" labelWidth="144px" defaultWidth="320px" formRef="editRefReport" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsxCombiForm>
<glsxCombiForm class="edit-form-container " ref="editFormRefReport" labelWidth="144px" defaultWidth="320px" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsxCombiForm>
</div>
</template>
......
<!-- 权益订单 -->
<template>
<div class="app">
<report :pageType="pageType" :editForm.sync="editForm"></report>
<repair ref="repairRef" :accountForm.sync="accountForm"></repair>
<report ref="reportRef" :pageType="pageType" :editForm.sync="editForm"></report>
<repair ref="repairRef" :equityList.sync="equityList" :totalPrice.sync="totalPrice" :accountForm.sync="accountForm"></repair>
<material ref="materialRef" :materialForm.sync="materialForm"></material>
<el-button type="primary" size="small" @click="validAccountInfo">校验</el-button>
</div>
......@@ -43,15 +43,41 @@ export default {
handlerName: '',
handlerPhone: ''
},
materialForm: {}
materialForm: {},
equityList: [
{
name: 'huiyuan痊愈',
price: 100
},
{
name: '会员权益',
price: 92
},
{
name: '核赔申请',
price: 65
},
{
name: '定损定损',
price: 63
}
]
}
},
created() {
const urlParam = this.$route.params
const urlQuery = JSON.parse(decodeURIComponent(urlParam.id))
this.pageType = urlQuery.editNo
this.routeInfo = urlQuery
this.handleFormInfo(urlQuery.contractNo, urlQuery.isGH)
// const urlParam = this.$route.params
// const urlQuery = JSON.parse(decodeURIComponent(urlParam.id))
// this.pageType = urlQuery.editNo
// this.routeInfo = urlQuery
// this.handleFormInfo(urlQuery.contractNo, urlQuery.isGH)
},
computed: {
totalPrice() {
let total = this.equityList.reduce(function(prev, cur) {
return prev + parseInt(cur.price * 100)
}, 0)
return total / 100
}
},
mounted() {},
methods: {
......@@ -68,12 +94,14 @@ export default {
this.editForm.contractNo = contractNo
},
validAccountInfo() {
console.log(this.$refs.repairRef)
console.log(this.$refs.reportRef)
this.$refs.repairRef.$refs.accountRef.$refs.formRef.validate(valid => {
this.$refs.repairRef.$refs.handlerRef.$refs.formRef.validate(valid => {
this.$refs.reportRef.$refs.editFormRefReport.$refs.formRef.validate(valid => {
console.log(this.editForm, this.accountForm, this.$refs.repairRef.getParams())
})
})
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!