[update] 打包项目列表接口,到账开票接口,收入合同关联工作组项目加合同id,图片上传组件修改

This commit is contained in:
zhaoxiao
2021-09-10 19:00:54 +08:00
parent 9c23800c8e
commit 2d35ab113c
6 changed files with 53 additions and 24 deletions
+43 -10
View File
@@ -103,7 +103,8 @@
},
watch:{
value: {
handler(val) {
handler() {
let val = this.value
if (val instanceof Array) {
this.initFileList(val.join(','))
} else {
@@ -122,25 +123,57 @@
this.headers = {'X-Access-Token':token}
},
methods:{
initFileList(paths){
async initFileList(paths){
if(!paths || paths.length === 0){
this.fileList = []
return
}
this.picUrl = true
let arr = paths.split(',')
console.log(this.fileList)
let fileList = []
for(var a=0;a<arr.length;a++){
this.fileList.forEach((item)=>{
if(this.returnId){
item.url = this.getImgUrl(item.response.result.id,item.name)
}
if (item.url === arr[a]){
item.uid = uidGenerator()
item.response.status = 'history'
// 通过文件id获取文件信息
const fileObj = await this.getFileInfo(arr[a])
// 获取图片路径
const url = getFileAccessHttpUrl(fileObj.url)
fileList.push({
uid: uidGenerator(),
name: (fileObj || {}).fileName,
status: 'done',
url: url,
response: {
status: 'history',
message: arr[a],
result: fileObj
}
})
}
this.fileList = [...fileList]
this.fileList.forEach((item)=>{
if(this.returnId){
item.url = this.getImgUrl(item.response.result.id,item.name)
}
if (item.url === arr[a]){
item.uid = uidGenerator()
item.response.status = 'history'
}
})
},
/**
* 通过文件的id获取文件的相关信息
* @param id
*/
getFileInfo(id) {
return new Promise(resolve => {
let result = {}
getFileInfo({id: id}).then(res => {
if (res.success) {
result = res.result
}
}).finally(() => {
resolve(result)
})
})
},
beforeUpload: function(file){
var fileType = file.type
@@ -733,7 +733,9 @@ export default {
// 工作组项目
case 2:
this.$refs.selectWorkingGroupProjectModule.filters = {
companyId: this.selectedCompany.id
companyId: this.selectedCompany.id,
contractId: this.contractId
}
this.$refs.selectWorkingGroupProjectModule.open()
break
@@ -67,7 +67,7 @@ export default {
data() {
return {
title: '来款阶段',
width: 800,
width: 900,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
@@ -83,7 +83,7 @@ export default {
data() {
return {
title: '开票阶段',
width: 800,
width: 900,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
+3 -9
View File
@@ -146,16 +146,10 @@ export default {
scopedSlots: { customRender: 'action' }
}
],
dataSource: [
{
id: 1,
companyTemporaryName: '企业名称'
}
],
url: {
list: '',
delete: '',
deleteBatch: '',
list: '/pack/payPackCompany/list',
delete: '/pack/payPackCompany/delete',
deleteBatch: '/pack/payPackCompany/deleteBatch',
exportXlsUrl: ''
}
}
@@ -126,8 +126,8 @@ export default {
sm: { span: 20 }
},
url: {
add: '',
edit: ''
add: '/pack/payPackCompany/add',
edit: '/pack/payPackCompany/edit'
},
selectedCompany: null,
validatorRules: {