Commit 345b354b by 张权

上传增加下载

1 parent 53bc67a8
......@@ -28,7 +28,8 @@
"
:percentage="imgItem.progress"
></el-progress>
<i v-if="pageType != 2" @click="handleRemove(imgItem.url, item.name)" class="el-icon-delete del_img"></i>
<img v-if="imgItem.progress == 100" class="download" :src="download" alt="" @click="downloadFile(imgItem)" />
<i v-if="imgItem.progress == 100 && pageType != 2" @click="handleRemove(imgItem.url, item.name)" class="el-icon-delete del_img"></i>
</div>
</template>
</div>
......@@ -46,6 +47,7 @@ import glsxCombiForm from '@/components/glsx-combi-form'
import idCard from '@/assets/images/idCard.png'
import idCardBack from '@/assets/images/idCardBack.png'
import upload_img from '@/assets/images/upload.png'
import download from '@/assets/images/download.png'
export default {
name: '',
components: {
......@@ -65,6 +67,7 @@ export default {
idCard,
idCardBack,
upload_img,
download,
dialogVisible: false,
// materialForm: {
// idCard: [],
......@@ -96,6 +99,9 @@ export default {
}
},
methods: {
downloadFile(file) {
window.open(file.url)
},
beforeAvatarUpload(e, fieldName) {
console.log(e)
return new Promise((resolve, reject) => {
......@@ -321,7 +327,12 @@ export default {
width: 320px;
position: relative;
margin-bottom: 4px;
.del_img {
.download {
width: 20px;
height: 18px;
}
.del_img,
.download {
color: #c6c6c6;
position: absolute;
right: -25px;
......@@ -329,6 +340,9 @@ export default {
transform: translateY(-50%);
cursor: pointer;
}
.del_img {
right: -44px;
}
/deep/ .el-progress-bar__outer {
height: 26px !important;
border-radius: 4px;
......
......@@ -67,8 +67,6 @@ export default {
},
data() {
return {
saveObj:{},
otherSaveObj:{},
accountData:[
{
label: '账户类型',
......@@ -203,20 +201,17 @@ export default {
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
},
immediate:true
}
},
methods:{
initSaveObj(){
const obj = {
......@@ -233,23 +228,24 @@ export default {
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}
}
this.$emit('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}
// }
// console.log(this.accountForm)
},
getBankList() {
this.$apis.claims.getBankList({}).then(res => {
......
......@@ -288,7 +288,7 @@ export default {
},
exportList() {
const parmas = { ...this.getParams() }
this.$apis.claims.exportClaimsData(parmas).then(({ code, data, message }) => {
this.$apis.claims.exportClaimsData(parmas).then(data => {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', data)
......
......@@ -2,7 +2,7 @@
<template>
<div>
<report @toSearchOrderDetail="toSearchOrderDetail" ref="reportRef" :isGH="routeInfo.isGH" :pageType="pageType" :editForm.sync="editForm"></report>
<repair ref="repairRef" :isGH="routeInfo.isGH" :pageType="pageType" :serviceItemsList.sync="serviceItemsList" :totalPrice.sync="totalPrice" :accountForm.sync="accountForm"></repair>
<repair ref="repairRef" @changeObjectType="changeObjectType" :isGH="routeInfo.isGH" :pageType="pageType" :serviceItemsList.sync="serviceItemsList" :totalPrice.sync="totalPrice" :accountForm.sync="accountForm"></repair>
<material ref="materialRef" :pageType="pageType" :materialForm.sync="materialForm"></material>
<div class="footer operate-btn">
<template v-if="pageType != 2">
......@@ -60,6 +60,7 @@ export default {
handlerName: '',
handlerPhone: ''
},
saveObj: {},
materialForm: {
idCard: [],
idCardBack: [],
......@@ -70,6 +71,7 @@ export default {
}
},
created() {
this.initSaveObj()
const urlParam = this.$route.params
const urlQuery = JSON.parse(decodeURIComponent(urlParam.id))
this.pageType = urlQuery.editNo
......@@ -91,6 +93,16 @@ export default {
},
mounted() {},
methods: {
changeObjectType(newVal) {
let obj = {}
obj = { ...this.accountForm }
this.saveObj.objectType = newVal
this.accountForm = { ...this.saveObj }
this.saveObj = { ...obj }
},
initSaveObj() {
this.saveObj = { ...this.accountForm }
},
//详情
getDetailById() {
this.$apis.claims.getClaimsDetail({ id: this.routeInfo.orderId }).then(res => {
......@@ -106,6 +118,8 @@ export default {
for (let key in this.accountForm) {
this.accountForm[key] = res[key]
}
if (this.accountForm.accountType !== 1) this.accountForm.accountType = 0
if (this.accountForm.objectType !== 1) this.accountForm.accountType = 0
this.serviceItemsList = serviceItemsList
// 以下是文件数据
res.files.forEach(item => {
......@@ -135,14 +149,10 @@ export default {
}
targetAPI(param).then(res => {
this.permitDraft = true
const { serviceItemsList, contractNo } = res.data
const { serviceItemsList, contractNo } = res
for (let key in this.editForm) {
this.editForm[key] = res.data[key] || this.editForm[key]
this.editForm[key] = res[key] || this.editForm[key]
}
// if (this.routeInfo.isGH) {
// this.accountForm.handlerName = res.data.handlerName
// this.accountForm.handlerPhone = res.data.handlerPhone
// }
this.serviceItemsList = serviceItemsList
this.getAccountInfo(contractNo)
})
......@@ -156,9 +166,8 @@ 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
}
if (this.accountForm.accountType !== 1) this.accountForm.accountType = 0
if (this.accountForm.objectType !== 1) this.accountForm.accountType = 0
})
},
// 根据页面跳转参数处理表单信息-自动填入
......@@ -230,7 +239,7 @@ export default {
return
}
const params = { ...this.editForm, ...this.accountForm }
if (params.objectType !== 1) {
if (params.accountType !== 1) {
params.accountType = 0
}
params.operation = type
......
......@@ -288,7 +288,7 @@ export default {
},
exportList() {
const parmas = { ...this.getParams() }
this.$apis.claims.exportClaimsData(parmas).then(({ code, data, message }) => {
this.$apis.claims.exportClaimsData(parmas).then(data => {
var a = document.createElement('a')
a.setAttribute('id', 'exportToExport')
a.setAttribute('href', data)
......
......@@ -2,7 +2,7 @@
<template>
<div>
<report @toSearchOrderDetail="toSearchOrderDetail" ref="reportRef" :isGH="routeInfo.isGH" :pageType="pageType" :editForm.sync="editForm"></report>
<repair ref="repairRef" :isGH="routeInfo.isGH" :pageType="pageType" :serviceItemsList.sync="serviceItemsList" :totalPrice.sync="totalPrice" :accountForm.sync="accountForm"></repair>
<repair ref="repairRef" @changeObjectType="changeObjectType" :isGH="routeInfo.isGH" :pageType="pageType" :serviceItemsList.sync="serviceItemsList" :totalPrice.sync="totalPrice" :accountForm.sync="accountForm"></repair>
<material ref="materialRef" :pageType="pageType" :materialForm.sync="materialForm"></material>
<div class="footer operate-btn">
<template v-if="pageType != 2">
......@@ -60,6 +60,7 @@ export default {
handlerName: '',
handlerPhone: ''
},
saveObj: {},
materialForm: {
idCard: [],
idCardBack: [],
......@@ -70,6 +71,7 @@ export default {
}
},
created() {
this.initSaveObj()
const urlParam = this.$route.params
const urlQuery = JSON.parse(decodeURIComponent(urlParam.id))
this.pageType = urlQuery.editNo
......@@ -91,6 +93,16 @@ export default {
},
mounted() {},
methods: {
changeObjectType(newVal) {
let obj = {}
obj = { ...this.accountForm }
this.saveObj.objectType = newVal
this.accountForm = { ...this.saveObj }
this.saveObj = { ...obj }
},
initSaveObj() {
this.saveObj = { ...this.accountForm }
},
//详情
getDetailById() {
this.$apis.claims.getClaimsDetail({ id: this.routeInfo.orderId }).then(res => {
......@@ -106,6 +118,8 @@ export default {
for (let key in this.accountForm) {
this.accountForm[key] = res[key]
}
if (this.accountForm.accountType !== 1) this.accountForm.accountType = 0
if (this.accountForm.objectType !== 1) this.accountForm.accountType = 0
this.serviceItemsList = serviceItemsList
// 以下是文件数据
res.files.forEach(item => {
......@@ -135,14 +149,10 @@ export default {
}
targetAPI(param).then(res => {
this.permitDraft = true
const { serviceItemsList, contractNo } = res.data
const { serviceItemsList, contractNo } = res
for (let key in this.editForm) {
this.editForm[key] = res.data[key] || this.editForm[key]
this.editForm[key] = res[key] || this.editForm[key]
}
// if (this.routeInfo.isGH) {
// this.accountForm.handlerName = res.data.handlerName
// this.accountForm.handlerPhone = res.data.handlerPhone
// }
this.serviceItemsList = serviceItemsList
this.getAccountInfo(contractNo)
})
......@@ -156,9 +166,8 @@ 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
}
if (this.accountForm.accountType !== 1) this.accountForm.accountType = 0
if (this.accountForm.objectType !== 1) this.accountForm.accountType = 0
})
},
// 根据页面跳转参数处理表单信息-自动填入
......@@ -230,7 +239,7 @@ export default {
return
}
const params = { ...this.editForm, ...this.accountForm }
if (params.objectType !== 1) {
if (params.accountType !== 1) {
params.accountType = 0
}
params.operation = type
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!