|
|
@@ -1,14 +1,6 @@
|
|
|
<template>
|
|
|
|
|
|
<div>
|
|
|
- <!-- <a-card :bordered="false">
|
|
|
- <h1>
|
|
|
- <span style="font-size: 14px;">资料管理 / 资料上传</span>
|
|
|
- </h1>
|
|
|
- <div>
|
|
|
- <a-button type="primary" @click="showList">返回</a-button>
|
|
|
- </div>
|
|
|
- </a-card>-->
|
|
|
|
|
|
<div style="background-color: #ececec; padding: 2px">
|
|
|
<a-row :gutter="16">
|
|
|
@@ -21,7 +13,7 @@
|
|
|
style="background-color: #FFFFFF;"
|
|
|
title="资料管理 / 资料上传"
|
|
|
sub-title=""
|
|
|
- @back="showList"
|
|
|
+ @back="goBack"
|
|
|
></a-page-header>
|
|
|
</div>
|
|
|
<div class="table-operator">
|
|
|
@@ -49,7 +41,6 @@
|
|
|
<a-radio-button style="display: flex" :value=fileType.businessContract>业务合同</a-radio-button>
|
|
|
</a-badge>
|
|
|
|
|
|
-
|
|
|
<a-badge class="badge-width-100" :count=fileTypeBadge[fileType.smsNumberCertificate].len
|
|
|
:show-zero=fileTypeBadge[fileType.smsNumberCertificate].showZero
|
|
|
:number-style=fileTypeBadge[fileType.smsNumberCertificate].numberStyle>
|
|
|
@@ -74,7 +65,6 @@
|
|
|
</a-radio-button>
|
|
|
</a-badge>
|
|
|
|
|
|
-
|
|
|
<a-badge class="badge-width-100" :count=fileTypeBadge[fileType.businessLicence].len
|
|
|
:show-zero=fileTypeBadge[fileType.businessLicence].showZero
|
|
|
:number-style=fileTypeBadge[fileType.businessLicence].numberStyle>
|
|
|
@@ -128,23 +118,13 @@
|
|
|
<a-list-item slot="renderItem" slot-scope="item, index">
|
|
|
|
|
|
<iframe
|
|
|
- frameborder="1"
|
|
|
:src=item.href
|
|
|
ref="ifr"
|
|
|
width="100%"
|
|
|
- height="560px"
|
|
|
- scrolling="auto">
|
|
|
+ height="560px">
|
|
|
</iframe>
|
|
|
- <a-list-item-meta
|
|
|
- :description=item.information
|
|
|
- >
|
|
|
- <a slot="title" :href=item.href>{{ item.title }}</a>
|
|
|
- <a-avatar
|
|
|
- slot="avatar"
|
|
|
- :src=item.url
|
|
|
- icon="file"
|
|
|
- />
|
|
|
- </a-list-item-meta>
|
|
|
+ <a-button type="danger" slot="actions" @click="removeFile(item)">移除</a-button>
|
|
|
+
|
|
|
</a-list-item>
|
|
|
</a-list>
|
|
|
</a-card>
|
|
|
@@ -152,45 +132,6 @@
|
|
|
</a-row>
|
|
|
</div>
|
|
|
|
|
|
- <a-card :bordered="true" style="margin-top: 12px;">
|
|
|
-
|
|
|
-
|
|
|
- <!-- 操作按钮区域 start -->
|
|
|
- <!-- <div class="table-operator">
|
|
|
- <a-upload name="file"
|
|
|
- :showUploadList="false"
|
|
|
- :multiple="false"
|
|
|
- :headers="tokenHeader"
|
|
|
- :action="url.importExcel"
|
|
|
- @change="uploadChange">
|
|
|
- <a-button type="primary" icon="upload">客户资料导入</a-button>
|
|
|
- </a-upload>
|
|
|
- <a-button type="primary" icon="import"
|
|
|
- @click="importInfo">确定导入</a-button>
|
|
|
- </div>-->
|
|
|
- <!-- 操作按钮区域 end -->
|
|
|
-
|
|
|
- <!-- table区域 begin -->
|
|
|
- <!-- <div>
|
|
|
- <a-table
|
|
|
- ref="table"
|
|
|
- size="middle"
|
|
|
- :scroll="{x:true}"
|
|
|
- bordered
|
|
|
-
|
|
|
- :columns="columns"
|
|
|
- :dataSource="dataSource"
|
|
|
- :pagination="false"
|
|
|
- :loading="loading"
|
|
|
- class="j-table-force-nowrap"
|
|
|
- @change="handleTableChange">
|
|
|
-
|
|
|
- </a-table>
|
|
|
- </div>-->
|
|
|
- <!-- table区域 end -->
|
|
|
-
|
|
|
- </a-card>
|
|
|
-
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
@@ -198,8 +139,7 @@
|
|
|
<script>
|
|
|
|
|
|
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
|
|
-import {httpAction} from '@api/manage'
|
|
|
-import pdf from 'vue-pdf';
|
|
|
+import {postAction} from '@api/manage'
|
|
|
|
|
|
let Base64 = require('js-base64').Base64
|
|
|
|
|
|
@@ -207,18 +147,7 @@ let Base64 = require('js-base64').Base64
|
|
|
export default {
|
|
|
name: 'TaskImport',
|
|
|
mixins: [JeecgListMixin],
|
|
|
- props: {
|
|
|
- infoId: {
|
|
|
- //type: string,
|
|
|
- require: true
|
|
|
- }
|
|
|
- },
|
|
|
- setup() {
|
|
|
-
|
|
|
- },
|
|
|
- components: {
|
|
|
- pdf
|
|
|
- },
|
|
|
+ inject:['closeCurrent'],
|
|
|
data() {
|
|
|
return {
|
|
|
|
|
|
@@ -313,25 +242,71 @@ export default {
|
|
|
importExcel: window._CONFIG['domainURL'] + "/smsCheck/task/importCustomerExcel",
|
|
|
importData: "/smsCheck/task/importCustomerData",
|
|
|
minioUpload: "/smsCheck/customerData/uploadMinio",
|
|
|
- editUrl: "/smsCheck/customerData/edit/info/id",
|
|
|
+ // editUrl: "/smsCheck/customerData/edit/info/id",
|
|
|
+ updateFile: "/smsCheck/customerData/updateFile",
|
|
|
list: "/smsCheck/customerData/list"
|
|
|
},
|
|
|
|
|
|
delList: [],
|
|
|
+ model: {},
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
created() {
|
|
|
//this.badgeCount()
|
|
|
+ this.model.id = this.$route.query.id;
|
|
|
+
|
|
|
this.customerDataList();
|
|
|
this.badgeCount()
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ importMinioUploadAction() {
|
|
|
+ return window._CONFIG['domianURL'] + this.url.minioUpload;
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ // 返回上一级
|
|
|
+ goBack() {
|
|
|
+ this.$router.go(-1);
|
|
|
+ this.closeCurrent();
|
|
|
+ },
|
|
|
+ // 返回上一级
|
|
|
+ removeFile(item) {
|
|
|
+
|
|
|
+ let result = [];
|
|
|
+ let removed = this.delList.filter(detail => {
|
|
|
+ if (detail.url !== item.url) {
|
|
|
+ result.push(detail.url)
|
|
|
+ }
|
|
|
+ return detail.url !== item.url
|
|
|
+ })
|
|
|
+ if (removed.length === this.delList.length) {
|
|
|
+ removed = null;
|
|
|
+ }
|
|
|
+ removed = result.join();
|
|
|
+
|
|
|
+ let value1 = this.value1;
|
|
|
+ let model = {
|
|
|
+ "infoId": this.model.id,
|
|
|
+ //value1:fileUrl
|
|
|
+ }
|
|
|
+ model[value1] = removed
|
|
|
+ postAction(this.url.updateFile, model)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.customerDataList();
|
|
|
+ this.badgeCount();
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
customerDataList() {
|
|
|
let model = {
|
|
|
- "infoId": this.infoId
|
|
|
+ "infoId": this.model.id
|
|
|
}
|
|
|
- httpAction(this.url.list, model, "post")
|
|
|
+ postAction(this.url.list, model)
|
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
|
let records = res.result.records;
|
|
|
@@ -340,18 +315,25 @@ export default {
|
|
|
let record = records[0];
|
|
|
let recordElement = record[this.value1];
|
|
|
if (recordElement != null || recordElement != undefined) {
|
|
|
- let splitList = recordElement.split(",");
|
|
|
+ this.delList = [];
|
|
|
+ let splitList = [];
|
|
|
+ if (recordElement) {
|
|
|
+ splitList = recordElement.split(",");
|
|
|
+ }
|
|
|
for (var i in splitList) {
|
|
|
let splitListElement = splitList[i];
|
|
|
- let split = splitListElement.split("/");
|
|
|
- let splitElement = split[split.length - 1];
|
|
|
- let del = {
|
|
|
- title: splitElement,
|
|
|
- href: window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(Base64.encode((splitListElement))),
|
|
|
- information: "",//"上传用户:" + record.createBy
|
|
|
- url: splitListElement
|
|
|
+ if (splitListElement) {
|
|
|
+ let split = splitListElement.split("/");
|
|
|
+ let splitElement = split[split.length - 1];
|
|
|
+ let del = {
|
|
|
+ title: splitElement,
|
|
|
+ href: window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(Base64.encode((splitListElement))),
|
|
|
+ information: "",//"上传用户:" + record.createBy
|
|
|
+ url: splitListElement
|
|
|
+ }
|
|
|
+ this.delList.push(del)
|
|
|
}
|
|
|
- this.delList.push(del)
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
this.delList = [];
|
|
|
@@ -371,10 +353,10 @@ export default {
|
|
|
badgeCount() {
|
|
|
//this.fileTypeBadge = []
|
|
|
let model = {
|
|
|
- "infoId": this.infoId
|
|
|
+ "infoId": this.model.id
|
|
|
}
|
|
|
let res = null;
|
|
|
- httpAction(this.url.list, model, "post")
|
|
|
+ postAction(this.url.list, model)
|
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
|
res = res.result.records
|
|
|
@@ -387,13 +369,20 @@ export default {
|
|
|
if (datum == null) {
|
|
|
|
|
|
} else {
|
|
|
- let length = datum.split(",").length;
|
|
|
+ let length = 0;
|
|
|
+ if (datum) {
|
|
|
+ length = datum.split(",").length;
|
|
|
+ }
|
|
|
let showZero = length > 0 ? false : true;
|
|
|
+ let color = "#52c41a";
|
|
|
+ if (showZero) {
|
|
|
+ color = "#fa073f";
|
|
|
+ }
|
|
|
badge = {
|
|
|
len: parseInt(length),
|
|
|
showZero: showZero,
|
|
|
numberStyle: {
|
|
|
- backgroundColor: "#52c41a"
|
|
|
+ backgroundColor: color
|
|
|
}
|
|
|
}
|
|
|
this.fileTypeBadge[fileTypeElement] = badge;
|
|
|
@@ -448,11 +437,15 @@ export default {
|
|
|
let fileUrl = info.file.response.message;
|
|
|
let value1 = this.value1;
|
|
|
let model = {
|
|
|
- "infoId": this.infoId,
|
|
|
- //value1:fileUrl
|
|
|
+ "infoId": this.model.id,
|
|
|
+ }
|
|
|
+ let pathStr = '';
|
|
|
+ for (let item in this.delList) {
|
|
|
+ pathStr+=this.delList[item].url + ","
|
|
|
}
|
|
|
- model[value1] = fileUrl
|
|
|
- httpAction(this.url.editUrl, model, "post")
|
|
|
+ pathStr += fileUrl;
|
|
|
+ model[value1] = pathStr
|
|
|
+ postAction(this.url.updateFile, model)
|
|
|
.then((res) => {
|
|
|
if (res.success) {
|
|
|
this.customerDataList();
|
|
|
@@ -494,13 +487,6 @@ export default {
|
|
|
<el-button size="mini" type="text" on-click={() => this.remove(node, data)}>Delete</el-button>
|
|
|
</span>
|
|
|
</span>);
|
|
|
- }
|
|
|
- ,
|
|
|
-
|
|
|
-
|
|
|
- // 显示列表页面
|
|
|
- showList() {
|
|
|
- this.$emit('goList', true);
|
|
|
},
|
|
|
/**
|
|
|
* 上传事件回调
|
|
|
@@ -534,13 +520,21 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
-
|
|
|
- },
|
|
|
- computed: {
|
|
|
- importMinioUploadAction() {
|
|
|
- return window._CONFIG['domianURL'] + this.url.minioUpload;
|
|
|
+ removeFile2(url) {
|
|
|
+ let result = [];
|
|
|
+ let removed = this.delList.filter(detail => {
|
|
|
+ if (detail.url !== url) {
|
|
|
+ result.push(detail.url)
|
|
|
+ }
|
|
|
+ return detail.url !== url
|
|
|
+ })
|
|
|
+ if (removed.length === this.delList.length) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return result.join();
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
</script>
|
|
|
|