[update] 收入合同、文件上传限制、文件预览
This commit is contained in:
@@ -53,6 +53,7 @@ export default {
|
|||||||
fileList: [],
|
fileList: [],
|
||||||
newFileList: [],
|
newFileList: [],
|
||||||
uploadGoOn: true,
|
uploadGoOn: true,
|
||||||
|
fileTypes: this.fileType
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -256,15 +257,37 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeUpload(file) {
|
beforeUpload(file) {
|
||||||
this.uploadGoOn = true
|
this.uploadGoOn = true
|
||||||
let fileType = file.type
|
file.uploadGoOn = true
|
||||||
if (this.fileType === FILE_TYPE_IMG) {
|
const fileSize = file.size // 上传的文件大小
|
||||||
if (fileType.indexOf('image') < 0) {
|
const fileType = file.type // 上传的文件类型
|
||||||
this.$message.warning('请上传图片')
|
if (fileSize > 1024 * 1024 * 50) {
|
||||||
|
this.$message.warning('文件大小限制为50M')
|
||||||
|
this.uploadGoOn = false
|
||||||
|
file.uploadGoOn = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 不等于全部类型可以上传的时候,对上传的文件进行判断
|
||||||
|
if (this.fileType !== FILE_TYPE_ALL) {
|
||||||
|
// filter(tt => fileType.indexOf(tt) > -1) 判断用户传的文件类型,和要求传的文件类型是否一致
|
||||||
|
// 当上传的图片格式为jpg时,在此组件中,会返回类型为 image/jpeg ElememntUI设计如此 所以需要把用户传下来的jpg强制改成jpeg
|
||||||
|
this.fileTypes = this.fileTypes.replace('jpg', 'jpeg')
|
||||||
|
const arr = this.fileTypes.split(',').filter(tt => fileType.indexOf(tt) > -1)
|
||||||
|
if (arr.length === 0) {
|
||||||
|
this.$message.warning(this.fileTypeErrorMessage || `请上传${this.fileTypes}文件`)
|
||||||
this.uploadGoOn = false
|
this.uploadGoOn = false
|
||||||
|
file.uploadGoOn = false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO 扩展功能验证文件大小
|
if (this.fileTypes === FILE_TYPE_IMG) {
|
||||||
|
if (fileType.indexOf('image') < 0) {
|
||||||
|
this.$message.warning('请上传图片')
|
||||||
|
this.uploadGoOn = false
|
||||||
|
file.uploadGoOn = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// TODO 扩展功能验证文件大小
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
handleChange(info) {
|
handleChange(info) {
|
||||||
@@ -322,6 +345,7 @@ export default {
|
|||||||
console.log(file)
|
console.log(file)
|
||||||
},
|
},
|
||||||
handlePreview(file) {
|
handlePreview(file) {
|
||||||
|
console.log(file)
|
||||||
if (file && file.url) {
|
if (file && file.url) {
|
||||||
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
|
||||||
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||||
|
|||||||
@@ -167,12 +167,12 @@ export default {
|
|||||||
}, {
|
}, {
|
||||||
title: '签订单位',
|
title: '签订单位',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'signedCompany',
|
dataIndex: 'signedCompanyTemporaryName',
|
||||||
width: 250
|
width: 250
|
||||||
}, {
|
}, {
|
||||||
title: '签订联系人',
|
title: '签订联系人',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'signedContactsName',
|
dataIndex: 'signedContactsTemporaryName',
|
||||||
width: 250
|
width: 250
|
||||||
}, {
|
}, {
|
||||||
title: '合同总金额',
|
title: '合同总金额',
|
||||||
@@ -182,7 +182,7 @@ export default {
|
|||||||
}, {
|
}, {
|
||||||
title: '状态',
|
title: '状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status_dictText',
|
||||||
width: 250
|
width: 250
|
||||||
}, {
|
}, {
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ export default {
|
|||||||
fieldName: 'amountReceived',
|
fieldName: 'amountReceived',
|
||||||
title: '未收金额'
|
title: '未收金额'
|
||||||
}, {
|
}, {
|
||||||
fieldName: 'accountStatus',
|
fieldName: 'accountStatus_dictText',
|
||||||
title: '赊账状态'
|
title: '赊账状态'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<j-dict-select-tag v-decorator="['opening']"
|
<j-dict-select-tag v-decorator="['opening']"
|
||||||
:triggerChange="true"
|
:triggerChange="true"
|
||||||
placeholder="请选择是否开口"
|
placeholder="请选择是否开口"
|
||||||
dictCode="revenue_contract_open"/>
|
dictCode="yn"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xxl="6" :xl="8" :sm="12">
|
<a-col :xxl="6" :xl="8" :sm="12">
|
||||||
|
|||||||
@@ -6,15 +6,16 @@
|
|||||||
<div class="part-title-text">工作组信息</div>
|
<div class="part-title-text">工作组信息</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 工作组信息区域-->
|
<!-- 工作组信息区域-->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="spinning">
|
||||||
<div class="work-group-detail">
|
<div class="work-group-detail">
|
||||||
<div class="work-group-detail-item work-group-detail-item-small"
|
<div class="work-group-detail-item work-group-detail-item-small"
|
||||||
v-for="(item, index) in detailTitleList"
|
v-for="(item, index) in detailTitleList"
|
||||||
:key="index">
|
:key="index">
|
||||||
<div class="work-group-detail-item-title">{{ item.title }}:</div>
|
<div class="work-group-detail-item-title">{{ item.title }}:</div>
|
||||||
<div class="work-group-detail-item-content"
|
<div class="work-group-detail-item-content work-group-detail-item-filename"
|
||||||
v-if="item.fieldName === 'chargeNoticeAId' || item.fieldName === 'chargeNoticeBId'">
|
v-if="(item.fieldName === 'chargeNoticeA' || item.fieldName === 'chargeNoticeB') && workingGroupDetail[item.fieldName]"
|
||||||
{{ workingGroupDetail[item.fieldName] }}
|
@click="previewFile(workingGroupDetail[item.fieldName])">
|
||||||
|
{{ workingGroupDetail[item.fieldName].fileName }}
|
||||||
</div>
|
</div>
|
||||||
<div class="work-group-detail-item-content" v-else>{{ workingGroupDetail[item.fieldName] }}</div>
|
<div class="work-group-detail-item-content" v-else>{{ workingGroupDetail[item.fieldName] }}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -61,7 +62,8 @@
|
|||||||
<!-- 操作按钮区域-->
|
<!-- 操作按钮区域-->
|
||||||
<div class="table-operator">
|
<div class="table-operator">
|
||||||
<a-button type="primary" icon="plus" @click="handleAdd">添加成员</a-button>
|
<a-button type="primary" icon="plus" @click="handleAdd">添加成员</a-button>
|
||||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :data="importParam" :action="importExcelUrl" @change="handleImportExcel">
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :data="importParam"
|
||||||
|
:action="importExcelUrl" @change="handleImportExcel">
|
||||||
<a-button type="primary" icon="import">导入</a-button>
|
<a-button type="primary" icon="import">导入</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
<a-button type="primary" icon="export" @click="handleExportXls('工作组成员')">导出</a-button>
|
<a-button type="primary" icon="export" @click="handleExportXls('工作组成员')">导出</a-button>
|
||||||
@@ -74,18 +76,18 @@
|
|||||||
<!-- table表格区域-->
|
<!-- table表格区域-->
|
||||||
<div>
|
<div>
|
||||||
<a-table
|
<a-table
|
||||||
ref="table"
|
ref="table"
|
||||||
size="middle"
|
size="middle"
|
||||||
bordered
|
bordered
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:scroll="{x: 1500}"
|
:scroll="{x: 1500}"
|
||||||
:dataSource="dataSource"
|
:dataSource="dataSource"
|
||||||
:pagination="ipagination"
|
:pagination="ipagination"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
@change="handleTableChange"
|
@change="handleTableChange"
|
||||||
class="j-table-force-nowrap">
|
class="j-table-force-nowrap">
|
||||||
|
|
||||||
<!-- 工作组名称-->
|
<!-- 工作组名称-->
|
||||||
<template slot="projectName" slot-scope="text, record">
|
<template slot="projectName" slot-scope="text, record">
|
||||||
@@ -115,7 +117,8 @@
|
|||||||
|
|
||||||
<project-detail-modal ref="projectDetail"></project-detail-modal>
|
<project-detail-modal ref="projectDetail"></project-detail-modal>
|
||||||
<working-group-member-unit-module ref="modalForm" @ok="modalFormOk"></working-group-member-unit-module>
|
<working-group-member-unit-module ref="modalForm" @ok="modalFormOk"></working-group-member-unit-module>
|
||||||
<working-group-member-set-charge-notice ref="setChargeNotic" @ok="modalFormOk"></working-group-member-set-charge-notice>
|
<working-group-member-set-charge-notice ref="setChargeNotic"
|
||||||
|
@ok="modalFormOk"></working-group-member-set-charge-notice>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -128,6 +131,10 @@ import StatusSlot from '../../components/tools/StatusSlot'
|
|||||||
import ProjectDetailModal from '../../components/ProjectDetailModal'
|
import ProjectDetailModal from '../../components/ProjectDetailModal'
|
||||||
import WorkingGroupMemberUnitModule from './modules/WorkingGroupMemberUnitModule'
|
import WorkingGroupMemberUnitModule from './modules/WorkingGroupMemberUnitModule'
|
||||||
import WorkingGroupMemberSetChargeNotice from './modules/WorkingGroupMemberSetChargeNotice'
|
import WorkingGroupMemberSetChargeNotice from './modules/WorkingGroupMemberSetChargeNotice'
|
||||||
|
import { getFileInfo } from '../../api/api'
|
||||||
|
import Vue from 'vue'
|
||||||
|
import { ACCESS_TOKEN } from '../../store/mutation-types'
|
||||||
|
const Base64 = require('js-base64').Base64
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WorkingGroupMemberUnitMaintenance',
|
name: 'WorkingGroupMemberUnitMaintenance',
|
||||||
@@ -150,6 +157,7 @@ export default {
|
|||||||
disableMixinCreated: true,
|
disableMixinCreated: true,
|
||||||
workingGroupProject: '',
|
workingGroupProject: '',
|
||||||
workingGroupProjectId: '',
|
workingGroupProjectId: '',
|
||||||
|
spinning: false,
|
||||||
detailTitleList: [
|
detailTitleList: [
|
||||||
{
|
{
|
||||||
title: '工作组项目名称',
|
title: '工作组项目名称',
|
||||||
@@ -174,7 +182,7 @@ export default {
|
|||||||
fieldName: 'chargeNoticeNoA'
|
fieldName: 'chargeNoticeNoA'
|
||||||
}, {
|
}, {
|
||||||
title: '收费通知A',
|
title: '收费通知A',
|
||||||
fieldName: 'chargeNoticeAId'
|
fieldName: 'chargeNoticeA'
|
||||||
}, {
|
}, {
|
||||||
title: '本年应收款B',
|
title: '本年应收款B',
|
||||||
fieldName: 'yearChargeB'
|
fieldName: 'yearChargeB'
|
||||||
@@ -183,7 +191,7 @@ export default {
|
|||||||
fieldName: 'chargeNoticeNoB'
|
fieldName: 'chargeNoticeNoB'
|
||||||
}, {
|
}, {
|
||||||
title: '收费通知B',
|
title: '收费通知B',
|
||||||
fieldName: 'chargeNoticeBId'
|
fieldName: 'chargeNoticeB'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
labelCol: {
|
labelCol: {
|
||||||
@@ -285,6 +293,7 @@ export default {
|
|||||||
* 初始化工作组信息
|
* 初始化工作组信息
|
||||||
*/
|
*/
|
||||||
initWorkGruopData() {
|
initWorkGruopData() {
|
||||||
|
this.spinning = true
|
||||||
this.workingGroupProject = this.$route.query.workingGroupProject
|
this.workingGroupProject = this.$route.query.workingGroupProject
|
||||||
this.workingGroupProjectId = this.$route.query.workingGroupProjectId
|
this.workingGroupProjectId = this.$route.query.workingGroupProjectId
|
||||||
this.filters.workingGroupId = this.workingGroupProjectId
|
this.filters.workingGroupId = this.workingGroupProjectId
|
||||||
@@ -295,6 +304,21 @@ export default {
|
|||||||
}
|
}
|
||||||
getWorkingGroupById(param).then(res => {
|
getWorkingGroupById(param).then(res => {
|
||||||
this.workingGroupDetail = res.result
|
this.workingGroupDetail = res.result
|
||||||
|
// this.workingGroupDetail.chargeNoticeA = {}
|
||||||
|
// this.workingGroupDetail.chargeNoticeB = {}
|
||||||
|
this.getFile()
|
||||||
|
}).finally(() => {
|
||||||
|
this.spinning = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getFile() {
|
||||||
|
await getFileInfo({ id: this.workingGroupDetail.chargeNoticeAId }).then(res => {
|
||||||
|
this.workingGroupDetail.chargeNoticeA = res.result
|
||||||
|
this.$forceUpdate()
|
||||||
|
})
|
||||||
|
await getFileInfo({ id: this.workingGroupDetail.chargeNoticeBId }).then(res => {
|
||||||
|
this.workingGroupDetail.chargeNoticeB = res.result
|
||||||
|
this.$forceUpdate()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleAdd: function () {
|
handleAdd: function () {
|
||||||
@@ -368,6 +392,19 @@ export default {
|
|||||||
this.$message.warn(res.message)
|
this.$message.warn(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 文件预览
|
||||||
|
* @param file
|
||||||
|
*/
|
||||||
|
previewFile(file) {
|
||||||
|
console.log(file)
|
||||||
|
if (file && file.url) {
|
||||||
|
const fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
|
||||||
|
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||||
|
// let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(fileFullUrl)}`
|
||||||
|
window.open(url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,6 +444,10 @@ export default {
|
|||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
color: #2F3133;
|
color: #2F3133;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-filename {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
:multiple="false"
|
:multiple="false"
|
||||||
:return-id="true"
|
:return-id="true"
|
||||||
bizPath="payment"
|
bizPath="payment"
|
||||||
|
:number="1"
|
||||||
v-decorator="['chargeNoticeAId']"
|
v-decorator="['chargeNoticeAId']"
|
||||||
:trigger-change="true"></j-upload>
|
:trigger-change="true"></j-upload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -132,6 +133,7 @@
|
|||||||
:multiple="false"
|
:multiple="false"
|
||||||
:return-id="true"
|
:return-id="true"
|
||||||
bizPath="payment"
|
bizPath="payment"
|
||||||
|
:number="1"
|
||||||
v-decorator="['chargeNoticeBId']"
|
v-decorator="['chargeNoticeBId']"
|
||||||
:trigger-change="true"></j-upload>
|
:trigger-change="true"></j-upload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user