kun 19111 17:29

This commit is contained in:
沈学坤
2019-11-01 17:28:16 +08:00
parent 611df5b7e0
commit 149270088a
3 changed files with 306 additions and 100 deletions

View File

@@ -97,6 +97,19 @@
</template> </template>
</table> </table>
</div> </div>
<!-- 分页按钮 -->
<div class="page">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pageSize"
:pager-count="5"
background
layout="prev, pager, next"
:total="totalCount"
></el-pagination>
</div>
</div> </div>
<footer-nav class="footer"></footer-nav> <footer-nav class="footer"></footer-nav>
</div> </div>
@@ -133,7 +146,10 @@ export default {
bgData: [], bgData: [],
arr1: [], arr1: [],
arr0: [], arr0: [],
conversion: [] conversion: [],
pageSize: 1,
currentPage: 1,
totalCount: 1,
}; };
}, },
computed: {}, computed: {},
@@ -143,6 +159,7 @@ export default {
methods: { methods: {
/** 筛选函数 */ /** 筛选函数 */
scree() { scree() {
this.currentPage = 1;
if (this.sub == 0) { if (this.sub == 0) {
this.sub = '' this.sub = ''
} else if (this.sub == 1) { } else if (this.sub == 1) {
@@ -150,7 +167,7 @@ export default {
} else { } else {
this.sub = 1 this.sub = 1
} }
this.getData(this.type_value, this.years[this.year_value], this.year_status, this.sub); this.getData(this.type_value, this.years[this.year_value], this.year_status, this.sub, this.currentPage);
if (this.sub == '') { if (this.sub == '') {
this.sub = 0 this.sub = 0
} else if (this.sub == 0) { } else if (this.sub == 0) {
@@ -173,7 +190,7 @@ export default {
let s = this.sub; let s = this.sub;
s = index; s = index;
this.sub = s; this.sub = s;
this.currentPage = 1;
switch (this.sub) { switch (this.sub) {
case 0: case 0:
this.getData(this.type_value, this.years[this.year_value], this.year_status); this.getData(this.type_value, this.years[this.year_value], this.year_status);
@@ -186,19 +203,24 @@ export default {
} }
}, },
/** 获取后台数据 */ /** 获取后台数据 */
getData(type = '', year = '', yearStatus = '', status = '') { getData(type = this.type_value, year = this.years[this.year_value], yearStatus = this.year_status, status = '', page = this.currentPage) {
if (type == "组织类型") { if (type == "组织类型") {
type = '' type = ''
// this.type_value = ''
} }
if (year == '年检时间') { if (year == '年检时间') {
year = '' year = ''
// this.years[this.year_value] = ''
} }
if (yearStatus == '年检结果') { if (yearStatus == '年检结果') {
yearStatus = '' yearStatus = ''
// this.year_status = ''
} }
let _this = this let _this = this
console.log(type);
this.$http({ this.$http({
method: 'post', method: 'post',
url: 'v1/society/society', url: 'v1/society/society',
@@ -206,21 +228,31 @@ export default {
type: type, type: type,
year: year, year: year,
yearStatus: yearStatus, yearStatus: yearStatus,
status: status status: status,
page: page
} }
}).then(res => { }).then(res => {
if (res.data.data.code !== 200) { if (res.data.data.code !== 200) {
return; return;
} }
_this.bgData = res.data.data.data.info // if (this.page == 1) {
_this.conversion = _this.bgData if (res.data.data.data.info.length == 0) {
alert('您所查询的数据暂时没有!')
return;
} else {
_this.conversion = res.data.data.data.info
_this.totalCount = res.data.data.data.allPage
// console.log(_this.conversion);
}
_this.page++
}) })
// eslint-disable-next-line handle-callback-err // eslint-disable-next-line handle-callback-err
.catch(err => { .catch(err => {
console.log(err) console.log(err)
}) })
// console.log(this.type_value);
if (this.type_value === '') { if (this.type_value === '') {
this.type_value = '组织类型' this.type_value = '组织类型'
} }
@@ -272,13 +304,22 @@ export default {
this.$message('您搜索的内容暂无~') this.$message('您搜索的内容暂无~')
} }
}, },
handleSizeChange(val) {
this.pageSize = val;
this.getPackData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData()
this.getPackData();
},
getPackData() { }
}, },
created() { created() {
this.getData()
this.getDataG() this.getDataG()
this.getData()
}, },
mounted() { mounted() { }
}
}; };
</script> </script>
@@ -295,6 +336,51 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 35px 30px 86px; padding: 35px 30px 86px;
.page {
margin-top: 60px;
height: 36px;
display: flex;
justify-content: flex-end;
align-items: center;
/deep/ .el-pagination.is-background .el-pager li {
color: #333 !important;
}
/deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: #e60012;
color: #fff !important;
}
/deep/ .el-icon.el-icon-arrow-left::before {
content: '上一页';
font-family: 'MicrosoftYaHei';
font-size: 12px;
font-weight: normal;
font-stretch: normal;
letter-spacing: 1px;
color: #666;
}
/deep/ .el-pagination .btn-prev {
width: 80px;
}
/deep/ .el-pagination .btn-next {
width: 80px;
}
/deep/ .el-icon.el-icon-arrow-right::before {
content: '下一页';
font-family: 'MicrosoftYaHei';
font-size: 12px;
font-weight: normal;
font-stretch: normal;
letter-spacing: 1px;
color: #666;
}
}
.box-table { .box-table {
width: 100%; width: 100%;
margin-top: -25px; margin-top: -25px;
@@ -309,7 +395,7 @@ export default {
counter-increment: items 1; /* 1 同样可以省略 */ counter-increment: items 1; /* 1 同样可以省略 */
&:before { &:before {
content: counter(items); content: counter(items);
font-family: "MicrosoftYaHei"; font-family: 'MicrosoftYaHei';
font-size: 16px; font-size: 16px;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;
@@ -328,7 +414,7 @@ export default {
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
height: 40px; height: 40px;
font-family: "MicrosoftYaHei"; font-family: 'MicrosoftYaHei';
font-size: 16px; font-size: 16px;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;
@@ -342,27 +428,27 @@ export default {
} }
&:nth-of-type(2) { &:nth-of-type(2) {
width: 160px; width: 160px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(3) { &:nth-of-type(3) {
width: 240px; width: 240px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(4) { &:nth-of-type(4) {
width: 160px; width: 160px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(5) { &:nth-of-type(5) {
width: 160px; width: 160px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(6) { &:nth-of-type(6) {
width: 160px; width: 160px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(7) { &:nth-of-type(7) {
width: 140px; width: 140px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
} }
@@ -374,11 +460,11 @@ export default {
} }
td { td {
border:none!important; border: none !important;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
height: 40px; height: 40px;
font-family: "MicrosoftYaHei"; font-family: 'MicrosoftYaHei';
font-size: 16px; font-size: 16px;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;
@@ -388,27 +474,27 @@ export default {
&:nth-of-type(1) { &:nth-of-type(1) {
width: 160px; width: 160px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(2) { &:nth-of-type(2) {
width: 240px; width: 240px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(3) { &:nth-of-type(3) {
width: 160px; width: 160px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(4) { &:nth-of-type(4) {
width: 160px; width: 160px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(5) { &:nth-of-type(5) {
width: 160px; width: 160px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
&:nth-of-type(6) { &:nth-of-type(6) {
width: 140px; width: 140px;
border-left: 1px solid #dcebf6!important; border-left: 1px solid #dcebf6 !important;
} }
/* /*
&:nth-of-type(7) { &:nth-of-type(7) {
@@ -431,7 +517,7 @@ export default {
display: inline-block; display: inline-block;
height: 38px; height: 38px;
text-align: center; text-align: center;
font-family: "MicrosoftYaHei"; font-family: 'MicrosoftYaHei';
font-size: 20px; font-size: 20px;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;
@@ -455,7 +541,7 @@ export default {
position: relative; position: relative;
&::after { &::after {
content: ""; content: '';
width: 100%; width: 100%;
height: 2px; height: 2px;
background-image: linear-gradient(#e60012, #e60012), background-image: linear-gradient(#e60012, #e60012),
@@ -479,7 +565,7 @@ export default {
border-radius: 4px; border-radius: 4px;
border: solid 1px #c7c7c7; border: solid 1px #c7c7c7;
padding: 10px 24px; padding: 10px 24px;
font-family: "MicrosoftYaHei"; font-family: 'MicrosoftYaHei';
font-size: 18px; font-size: 18px;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;
@@ -506,9 +592,10 @@ export default {
-moz-appearance: none; -moz-appearance: none;
-webkit-appearance: none; -webkit-appearance: none;
/* 右侧添加小箭头的背景图 */ /* 右侧添加小箭头的背景图 */
background: url("../../static/img/xa.png") 126px center no-repeat; background: url('../../static/img/xa.png') 90% center no-repeat;
background-size: 14px 8px; background-size: 14px 8px;
width: 170px; // width: 170px;
padding: 0 30px;
height: 38px; height: 38px;
background-color: #f9f8f8; background-color: #f9f8f8;
border-radius: 4px; border-radius: 4px;
@@ -519,7 +606,7 @@ export default {
-moz-appearance: none; -moz-appearance: none;
-webkit-appearance: none; -webkit-appearance: none;
/* 右侧添加小箭头的背景图 */ /* 右侧添加小箭头的背景图 */
background: url("../../static/img/xa.png") 126px center no-repeat; background: url('../../static/img/xa.png') 126px center no-repeat;
background-size: 14px 8px; background-size: 14px 8px;
width: 170px; width: 170px;
height: 38px; height: 38px;
@@ -544,7 +631,7 @@ export default {
margin-bottom: 30px; margin-bottom: 30px;
input { input {
font-family: "MicrosoftYaHei"; font-family: 'MicrosoftYaHei';
font-size: 18px; font-size: 18px;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;
@@ -562,7 +649,7 @@ export default {
width: 96px; width: 96px;
height: 50px; height: 50px;
background-color: #e60012; background-color: #e60012;
font-family: "MicrosoftYaHei"; font-family: 'MicrosoftYaHei';
font-size: 18px; font-size: 18px;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;

View File

@@ -53,7 +53,12 @@
<aside> <aside>
<div> <div>
<label>一级项目方向:</label> <label>一级项目方向:</label>
<input type="text" name="first_level" v-model="first_level" value required /> <select name="rid" v-model="first_level">
<template v-for="(list,index) in first_levels">
<option :key="index" :value="index">{{list}}</option>
</template>
</select>
<!-- <input type="text" name="first_level" v-model="first_level" value required /> -->
</div> </div>
<div> <div>
<label>二级项目方向:</label> <label>二级项目方向:</label>
@@ -108,7 +113,7 @@
<!-- start --> <!-- start -->
<aside> <aside>
<div> <div>
<label>电子:</label> <label>电子:</label>
<input type="text" name="pmail" v-model="pmail" value required /> <input type="text" name="pmail" v-model="pmail" value required />
</div> </div>
<div> <div>
@@ -195,7 +200,7 @@
<!-- start --> <!-- start -->
<aside> <aside>
<div> <div>
<label>电子:</label> <label>电子:</label>
<input type="text" name="respomail" v-model="respomail" value required /> <input type="text" name="respomail" v-model="respomail" value required />
</div> </div>
<div> <div>
@@ -341,24 +346,39 @@
<div class="xxx"> <div class="xxx">
<h5>项目主责单位意见</h5> <h5>项目主责单位意见</h5>
<div class="xxxx"> <div class="xxxx">
<div class="btnn"> <template>
<!-- @change="getFile($event)" --> <el-upload
class="upload-demo"
action="http://cyteam.org.cn/api/v1/file/files"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-success="successUpload"
:before-remove="beforeRemove"
multiple
:on-exceed="handleExceed"
>
<el-button size="small" type="primary">上传文件</el-button>
<div slot="tip" class="el-upload__tip">可上传同意申报说明扫描版PDF文件或图片压缩包</div>
</el-upload>
</template>
<!-- <div class="btnn">
<label> <label>
上传文件 上传文件
<input type="file" @change="getFile($event)" v-show="false" name="file" /> <input type="file" @change="getFile($event)" v-show="false" name="file" />
</label> </label>
</div> </div>
<span for>只能上传一张不同的图片</span> <span for>只能上传一张不同的图片</span>-->
</div> </div>
</div> </div>
</div> </div>
<template v-if="file"> <!-- <template v-if="file">
<img class="img-img" :src="file" alt /> <img class="img-img" :src="file" alt />-->
<!-- <iframe class="img-img" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" :src="src"></iframe> --> <!-- <iframe class="img-img" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" :src="src"></iframe> -->
</template> <!-- </template> -->
<div class="ll"> <div class="ll">
<button type="button" @click="btn(0)">上一页</button> <button type="button" @click="btn(0)">上一页</button>
<button v-if="0" type="button" @click="submit(0)">保存</button> <button type="button" @click="submit(0)">保存</button>
<button type="submit" @click="submit(1)">提交</button> <button type="submit" @click="submit(1)">提交</button>
</div> </div>
</div> </div>
@@ -404,8 +424,10 @@ export default {
bg1: require("../../../static/img/bg1.png"), bg1: require("../../../static/img/bg1.png"),
xa: require("../../../static/img/xa.png") xa: require("../../../static/img/xa.png")
}, },
fileLists: [],
popupStatus: false, popupStatus: false,
thff: false, thff: false,
first_levels: [],
types: [], types: [],
area: [], area: [],
name: '', name: '',
@@ -477,6 +499,27 @@ export default {
} }
}, },
methods: { methods: {
successUpload(response, file, fileList) {
let arr = []
fileList.forEach((list, index) => {
arr.push(list.response.data.url);
});
let arrVal = this.fileLists
arrVal = arr
this.fileLists = arrVal
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(`The limit is 5, you selected ${files.length} files this time, add up to ${files.length + fileList.length} totally`);
},
beforeRemove(file, fileList) {
return this.$confirm(`Cancel the transfert of ${file.name} ?`);
},
/** 获取富文本内容 */ /** 获取富文本内容 */
getContent(data) { getContent(data) {
this.funds = data this.funds = data
@@ -508,6 +551,8 @@ export default {
// alert('yes') // alert('yes')
// } // }
// console.log(this.first_level);
if (s == 1) { if (s == 1) {
if (this.name == '' || this.company == '' || this.tid == '' || if (this.name == '' || this.company == '' || this.tid == '' ||
@@ -534,58 +579,62 @@ export default {
this.sub = s this.sub = s
} }
} }
}, },
/** 上传文件 */ /** 上传文件 */
/*
getFile(event) { getFile(event) {
let filetypes = [".jpg", ".png", ".jpeg"] // let filetypes = [".jpg", ".png", ".jpeg"]
let filepath = event.target.value // let filepath = event.target.value
if (filepath) { // if (filepath) {
var isnext = false; // var isnext = false;
var fileend = filepath.substring(filepath.lastIndexOf(".")); // var fileend = filepath.substring(filepath.lastIndexOf("."));
if (filetypes && filetypes.length > 0) { // if (filetypes && filetypes.length > 0) {
for (var i = 0; i < filetypes.length; i++) { // for (var i = 0; i < filetypes.length; i++) {
if (filetypes[i] == fileend) { // if (filetypes[i] == fileend) {
isnext = true; // isnext = true;
break; // break;
} // }
} // }
} // }
if (!isnext) { // if (!isnext) {
alert("不接受此文件类型!"); // alert("不接受此文件类型!");
return false; // return false;
} // }
} // }
let filemaxsize = 1024;//1M // let filemaxsize = 1024;//1M
let fileSize = event.target.files[0].size / 1024; // let fileSize = event.target.files[0].size / 1024;
if (fileSize > filemaxsize) { // if (fileSize > filemaxsize) {
alert("附件大小不能大于" + filemaxsize / 1024 + "M"); // alert("附件大小不能大于" + filemaxsize / 1024 + "M");
return false; // return false;
} // }
let _this = this
let file = event.target.files[0];
/* // let _this = this
let reader = new FileReader() // let file = event.target.files[0];
reader.readAsDataURL(file) // 这里是最关键的一步,转换就在这里
reader.onloadend = function () { // console.log(file)
_this.src = this.result
}
*/ // let reader = new FileReader()
let param = new FormData(); //创建form对象 // reader.readAsDataURL(file) // 这里是最关键的一步,转换就在这里
param.append('file', file);//通过append向form对象添加数据 // reader.onloadend = function () {
// console.log(param.get('file')); //FormData私有类对象访问不到可以通过get判断值是否传进去 // _this.src = this.result
let config = { // }
headers: { 'Content-Type': 'multipart/form-data' }
}; //添加请求头 // let param = new FormData(); //创建form对象
this.$http.post('v1/file/files', param, config) // param.append('file', file);//通过append向form对象添加数据
.then(response => { // // console.log(param.get('file')); //FormData私有类对象访问不到可以通过get判断值是否传进去
let url = response.data.data.url // let config = {
this.file = url // headers: { 'Content-Type': 'multipart/form-data' }
}) // }; //添加请求头
// this.$http.post('v1/file/files', param, config)
// .then(response => {
// let url = response.data.data.url
// this.file = url
// })
}, },
*/
/** 保存和提交 */ /** 保存和提交 */
submit(index) { submit(index) {
let regd = /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/ let regd = /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
@@ -612,7 +661,7 @@ export default {
} else if (this.thff == false) { } else if (this.thff == false) {
alert('请同意:申报单位承诺') alert('请同意:申报单位承诺')
return return
} else if (this.file == '') { } else if (this.fileLists.length == 0) {
alert('未上传文件!') alert('未上传文件!')
return return
} }
@@ -624,12 +673,15 @@ export default {
let s = this.subStatus; let s = this.subStatus;
s = index; s = index;
this.subStatus = s this.subStatus = s
this.proimages = this.file let val = this.proimages
if (this.proimages === '') { val = this.fileLists
this.proimages = val
if (this.proimages.length == 0) {
alert('文件还未上传!') alert('文件还未上传!')
return return
} }
// console.log(this.proimages);
this.popupStatus = true this.popupStatus = true
}, },
/** 申报项目 */ /** 申报项目 */
@@ -717,6 +769,7 @@ export default {
if (res.data.code === 200) { if (res.data.code === 200) {
_this.types = res.data.data.type _this.types = res.data.data.type
_this.area = res.data.data.area _this.area = res.data.data.area
_this.first_levels = res.data.data.first_level
} else { } else {
_this.$message.error('请求数据有问题!') _this.$message.error('请求数据有问题!')
} }
@@ -885,7 +938,7 @@ export default {
.xxx { .xxx {
margin-top: 60px; margin-top: 60px;
width: 100%; width: 100%;
height: 72px; // height: 72px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
@@ -931,6 +984,63 @@ export default {
letter-spacing: 0px; letter-spacing: 0px;
color: #000; color: #000;
} }
/deep/ .upload-demo {
margin-bottom: 10%;
}
/deep/ .el-button--primary {
margin-top: 32px;
border: none;
cursor: pointer;
width: 96px;
height: 32px;
border-radius: 4px;
background-image: linear-gradient(
69deg,
#cc263f 0%,
#f42b47 100%,
#ed162d 100%,
#e60012 100%
),
linear-gradient(#e60012, #e60012);
font-family: 'MicrosoftYaHei';
font-size: 16px;
font-weight: normal;
font-stretch: normal;
letter-spacing: 0px;
color: #ffffff;
}
/deep/ .el-upload-list.el-upload-list--text {
max-height: 100px;
overflow-y: scroll;
&::-webkit-scrollbar {
width: 3px;
// height: 5px;
}
&::-webkit-scrollbar-track-piece {
background-color: rgba(0, 0, 0, 0.2);
-webkit-border-radius: 6px;
border-radius: 6px;
}
&::-webkit-scrollbar-thumb:vertical {
height: 5px;
background-color: rgba(125, 125, 125, 0.7);
-webkit-border-radius: 6px;
border-radius: 6px;
}
&::-webkit-scrollbar-thumb:horizontal {
width: 5px;
background-color: rgba(125, 125, 125, 0.7);
-webkit-border-radius: 6px;
border-radius: 6px;
}
}
} }
.btnn { .btnn {
@@ -1114,7 +1224,7 @@ export default {
height: 43px; height: 43px;
background-color: #ffffff; background-color: #ffffff;
border: solid 1px #c7c7c7; border: solid 1px #c7c7c7;
padding-left: 83px; // padding-left: 83px;
box-sizing: border-box; box-sizing: border-box;
outline: none; outline: none;
margin-left: 20px; margin-left: 20px;

View File

@@ -198,8 +198,10 @@
</div> </div>
<section id="preview" v-if="popupStatus"> <section id="preview" v-if="popupStatus">
<div class="tc" @click="preview()"></div> <div class="tc" @click="preview()"></div>
<!-- <section class="tc-text">{{zData.proimages}}</section> --> <section class="tc-text">
<img class="tc-text" :src="zData.proimages" /> <a :href="zData.proimages" target="_blank">{{zData.proimages}}</a>
</section>
<!-- <img class="tc-text" :src="zData.proimages" /> -->
</section> </section>
</div> </div>
<footer-nav class="footer" :class="popupStatus == true ? 'fliter' : ''"></footer-nav> <footer-nav class="footer" :class="popupStatus == true ? 'fliter' : ''"></footer-nav>
@@ -359,13 +361,20 @@ export default {
} }
.tc-text { .tc-text {
width: 350px; // width: 350px;
// width:100%;
padding: 32px;
box-sizing: border-box;
height: auto; height: auto;
background-color: #fff; background-color: #fff;
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%);
a{
cursor: pointer;
}
} }
} }