Commit 345b354b by 张权

上传增加下载

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