kun 191111 22:55

This commit is contained in:
沈学坤
2019-11-11 22:54:21 +08:00
parent ed51c4e5c2
commit 7d57570097
5 changed files with 239 additions and 122 deletions

View File

@@ -6,32 +6,43 @@
<script>
import E from 'wangeditor'
var phoneEditor, _this
export default {
components: {},
props: {},
data () {
return {
formData: ''
props: {
initialText: {
type: String,
required: false
}
},
data () {
return {}
},
created () { },
mounted () {
let _this = this
let phoneEditor = new E('websiteEditorElem')
_this = this
phoneEditor = new E('websiteEditorElem')
phoneEditor.onchange = function () {
_this.$emit('quillVal', this.$txt.html())
}
phoneEditor.create()
// phoneEditor.$txt.html(this.val)
},
methods: {},
computed: {},
watch: {}
watch: {
initialText (val) {
console.log(val)
phoneEditor.$txt.html(_this.initialText)
}
}
}
</script>
<style lang='scss' scoped>
#websiteEditorElem{
width:100%;
height:250px;
#websiteEditorElem {
width: 100%;
height: 250px;
}
</style>

View File

@@ -33,6 +33,12 @@ Vue.prototype.$jParams = function (url, parameters) {
params: parameters
})
}
Vue.prototype.$jP = function (url, queryters) {
this.$router.push({
name: url,
query: queryters
})
}
Vue.use(htmlToPdf)
Vue.use(mavonEditor)

View File

@@ -1,5 +1,5 @@
<template>
<div class="wrapper">
<div class="wrapper" v-if="types">
<header-nav :index_num="index_num"></header-nav>
<div id="box">
<h3>项目申报</h3>
@@ -210,7 +210,7 @@
</aside>
<!-- end -->
<!-- start -->
<aside>
<section>
<div>
<label>负责人姓名:</label>
<input class="i" type="text" name="respopname" v-model="respopname" value required />
@@ -241,9 +241,9 @@
value
/>
</div>
</aside>
</section>
<!-- end -->
<aside>
<section>
<div>
<label>联系人姓名:</label>
<input class="i" type="text" name="respocname" v-model="respocname" value required />
@@ -274,7 +274,7 @@
value
/>
</div>
</aside>
</section>
<!-- end -->
</div>
<div>
@@ -343,7 +343,7 @@
<h5>经费预算</h5>
<!-- <textarea name="funds" v-model="funds" required value></textarea> -->
<div id="rich">
<rich-text-one @quillVal="getContent"></rich-text-one>
<rich-text-one @quillVal="quillVal" :initialText="initialText"></rich-text-one>
</div>
</div>
<div class="xxx">
@@ -369,7 +369,9 @@
:on-success="successUpload"
:before-remove="beforeRemove"
multiple
:limit="10"
:on-exceed="handleExceed"
:file-list="fileLists"
>
<el-button size="small" type="primary">上传文件</el-button>
<div slot="tip" class="el-upload__tip">可上传同意申报说明扫描版PDF文件或图片压缩包</div>
@@ -433,6 +435,8 @@ export default {
return {
index_num: 2,
sub: 0,
bgData: null,
initialText: '',
imgUrl: {
bg0: require("../../../static/img/bg0.png"),
bg1: require("../../../static/img/bg1.png"),
@@ -446,8 +450,8 @@ export default {
area: [],
name: '',
company: '',
tid: Number,
rid: Number,
tid: '',
rid: '',
first_level: '',
secondary: '',
fieldeara: '',
@@ -495,7 +499,8 @@ export default {
file: '',
subStatus: 0,
src: '',
pictureHeight: ''
pictureHeight: '',
picture: []
};
},
computed: {},
@@ -514,13 +519,12 @@ export default {
},
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
this.picture.push(
{
name: file.name,
url: file.response.data.url
}
)
},
handleRemove(file, fileList) {
console.log(file, fileList);
@@ -529,14 +533,14 @@ export default {
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`);
this.$message.warning(`当前限制选择 10 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name} ?`);
},
/** 获取富文本内容 */
getContent(data) {
this.funds = data
quillVal(data) {
this.initialText = data
},
/** 申报单位承诺 */
thf() {
@@ -553,7 +557,7 @@ export default {
this.sub = s
}
this.sub = s
// this.sub = s
let aterm = new Date(this.aterm).getTime()
let fterm = new Date(this.fterm).getTime()
@@ -567,32 +571,31 @@ export default {
// console.log(this.first_level);
// if (s == 1) {
// if (this.name == '' || this.company == '' || this.tid == '' ||
// this.rid == '' || this.first_level == '' || this.secondary == '' ||
// this.fieldeara == '' || this.attribute == '' || this.aterm == '' ||
// this.fterm == '' || this.postaladdress == '' || this.postalcode == '' ||
// this.pmail == '' || this.plegal == '' || this.plcode == '' ||
// this.pname == '' || this.poster == '' || this.poffice_tel == '' ||
// this.aphone == '' || this.cname == '' || this.cpost == '' || this.coffice_tel == '' ||
// this.cphone == ''
// ) {
// alert('以上内容不可为空!')
// return
// } else if (this.aterm > this.fterm) {
// alert('截止日期应比申请日期晚')
// return
// } else if (!regd.test(this.poffice_tel) || !regd.test(this.coffice_tel)) {
// alert('请填写正确的电话号码!')
// return
// } if (!regs.test(this.aphone) || !regs.test(this.cphone)) {
// alert('请填写正确的手机号码!')
// return
// } else {
// this.sub = s
// }
// }
if (s == 1) {
if (this.name == '' || this.company == '' || this.tid == '' ||
this.rid == '' || this.first_level == '' || this.secondary == '' ||
this.fieldeara == '' || this.attribute == '' || this.aterm == '' ||
this.fterm == '' || this.postaladdress == '' || this.postalcode == '' ||
this.pmail == '' || this.plegal == '' || this.plcode == '' ||
this.pname == '' || this.poster == '' || this.poffice_tel == '' ||
this.aphone == '' || this.cname == '' || this.cpost == '' || this.coffice_tel == '' ||
this.cphone == ''
) {
alert('以上内容不可为空!')
return
} else if (this.aterm > this.fterm) {
alert('截止日期应比申请日期晚')
return
} else if (!regd.test(this.poffice_tel) || !regd.test(this.coffice_tel)) {
alert('请填写正确的电话号码!')
return
} if (!regs.test(this.aphone) || !regs.test(this.cphone)) {
alert('请填写正确的手机号码!')
return
} else {
this.sub = s
}
}
},
/** 上传文件 */
/*
@@ -654,38 +657,36 @@ export default {
let regd = /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
let regs = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/
// if (this.sub == 1) {
// if (this.prespo == '' || this.respoadd == '' || this.respopcode == '' ||
// this.respomail == '' || this.respopname == '' ||
// this.respopost == '' || this.respoophone == '' ||
// this.respocname == '' || this.respocpost == '' || this.respocophone == '' ||
// this.decldes == '' || this.prodes == '' ||
// this.prodemo == '' || this.prodemojc == '' || this.prodemotj == '' ||
// this.prodemojd == '' || this.prodemoxg == '' || this.prodemofg == '' ||
// this.prodemotwo == '' || this.funds == ''
// ) {
// alert('以上内容不可为空!')
// return
// } else if (!regd.test(this.respoophone) || !regd.test(this.respocophone)) {
// alert('请填写正确的电话号码!')
// return
// } else if (this.thff == false) {
// alert('请同意:申报单位承诺')
// return
// } else if (this.fileLists.length == 0) {
// alert('未上传文件!')
// return
// }
// } else {
// alert('数据出错!')
// return
// }
/**
* if (!regs.test(this.respoptel) || !regs.test(this.respoctel)) {
alert('请填写正确的手机号码!')
let text = this.funds
text = this.initialText
this.funds = text
if (this.sub == 1) {
if (this.prespo == '' || this.respoadd == '' || this.respopcode == '' ||
this.respomail == '' || this.respopname == '' ||
this.respopost == '' || this.respoophone == '' ||
this.respocname == '' || this.respocpost == '' || this.respocophone == '' ||
this.decldes == '' || this.prodes == '' ||
this.prodemo == '' || this.prodemojc == '' || this.prodemotj == '' ||
this.prodemojd == '' || this.prodemoxg == '' || this.prodemofg == '' ||
this.prodemotwo == '' || this.funds == ''
) {
alert('以上内容不可为空!')
return
}
*/
} else if (!regd.test(this.respoophone) || !regd.test(this.respocophone)) {
alert('请填写正确的电话号码!')
return
} else if (this.thff == false) {
alert('请同意:申报单位承诺')
return
} else if (this.picture.length == 0) {
alert('未上传文件!')
return
}
} else {
alert('数据出错!')
return
}
if (this.respoptel != '' && !regs.test(this.respoptel)) {
alert('请填写正确的手机号码!')
@@ -696,17 +697,17 @@ export default {
return false;
}
// console.log(this.funds, '提交时打印');
let s = this.subStatus;
s = index;
this.subStatus = s
let val = this.proimages
// val = JSON.stringify(this.fileLists)
val = this.fileLists.join(',')
val = JSON.stringify(this.picture)
this.proimages = val
console.log(this.proimages, 659);
return false;
// console.log(this.proimages);
// return false;
if (this.proimages.length == 0) {
alert('文件还未上传!')
@@ -774,12 +775,18 @@ export default {
proimages: _this.proimages
}
}).then(res => {
console.log(res);
if (res.data.code === 200) {
alert(res.data.data.msg)
_this.proimages = ''
_this.$router.push({
name: 'project'
})
if (res.data.data.code === 200) {
alert(res.data.data.msg)
_this.proimages = ''
_this.$router.push({
name: 'project'
})
} else {
alert(res.data.data.msg)
}
} else {
alert(res.data.message)
}
@@ -801,6 +808,10 @@ export default {
_this.types = res.data.data.type
_this.area = res.data.data.area
_this.first_levels = res.data.data.first_level
if (this.$route.query.id) {
let id = this.$route.query.id;
this.getDataDetails(id)
}
} else {
_this.$message.error('请求数据有问题!')
}
@@ -841,9 +852,96 @@ export default {
.catch(err => {
console.log(err)
})
},
assignment(data) {
this.name = data.name
this.company = data.company
for (var prop in this.types) {
if (data.tid == this.types[prop]) {
this.tid = prop
}
}
this.area.forEach((item, index) => {
if (data.rid == item) {
this.rid = parseInt(index)
}
})
for (var prop in this.first_levels) {
if (data.first_level == this.first_levels[prop]) {
this.first_level = prop
}
}
this.secondary = data.secondary
this.fieldeara = data.fieldeara
this.attribute = data.attribute
this.attribute = data.attribute
this.fterm = data.fterm
this.postaladdress = data.postaladdress
this.postalcode = data.postalcode
this.pmail = data.pmail
this.fax_tel = data.fax_tel
this.plegal = data.plegal
this.plcode = data.plcode
this.pname = data.pname
this.poster = data.poster
this.poffice_tel = data.poffice_tel
this.aphone = data.aphone
this.cname = data.cname
this.cpost = data.cpost
this.coffice_tel = data.coffice_tel
this.cphone = data.cphone
this.prespo = data.prespo
this.respoadd = data.respoadd
this.respopcode = data.respopcode
this.respomail = data.respomail
this.respophone = data.respophone
this.respopname = data.respopname
this.respopost = data.respopost
this.respoophone = data.respoophone
this.respoptel = data.respoptel
this.respocname = data.respocname
this.respocpost = data.respocpost
this.respocophone = data.respocophone
this.respoctel = data.respoctel
this.decldes = data.decldes
this.prodes = data.prodes
this.prodemo = data.prodemo
this.prodemojc = data.prodemojc
this.prodemotj = data.prodemotj
this.prodemojd = data.prodemojd
this.prodemoxg = data.prodemoxg
this.prodemofg = data.prodemofg
this.prodemotwo = data.prodemotwo
this.prodemojc = data.prodemojc
this.initialText = data.funds
// let index = _this.data.proimages.lastIndexOf("\/")
// let name = data.proimages.substring(index + 1, data.proimages.length)
// this.fileList = this.proimages
},
getDataDetails(id) {
this.$http({
method: 'post',
url: 'v1/project/details',
data: {
id: id
}
}).then(res => {
if (res.data.data.code === 200) {
this.bgData = res.data.data.data.ProjectDetails
this.assignment(this.bgData)
} else {
alert('请求失败!')
}
})
// eslint-disable-next-line handle-callback-err
.catch(err => {
console.log(err)
})
}
},
created() { },
created() {
},
mounted() {
this.status()
}

View File

@@ -101,7 +101,7 @@
class="list"
v-for="(item,index) in bgData.info"
:key="index"
@click="$jParams('schedule',{id:item.id})"
@click="item.tid == 1000 ? $jP('application',{id:item.id}) : $jParams('schedule',{id:item.id})"
>
<div class="div">
<div class="bb">
@@ -115,6 +115,7 @@
<img :src="imgUrl.tg" v-if="item.tid == 5" />
<img :src="imgUrl.btg" v-else-if="item.tid == 4 || item.tid == 9" />
<img :src="imgUrl.zxz" v-else-if="item.tid == 10" />
<img :src="imgUrl.wtj" v-else-if="item.tid == 1000" />
<img :src="imgUrl.shz" v-else />
</dt>
<dd>
@@ -181,7 +182,8 @@ export default {
tg: require("../../../static/img/tg.png"),
btg: require("../../../static/img/btg.png"),
shz: require("../../../static/img/shz.png"),
zxz: require("../../../static/img/zxz.png")
zxz: require("../../../static/img/zxz.png"),
wtj: require("../../../static/img/wtj.png")
},
// text: ["全部", "项目初筛", "项目立项"],
text: ["全部"],
@@ -353,8 +355,8 @@ export default {
}
/deep/ .el-icon.el-icon-arrow-left::before {
content: "上一页";
font-family: "MicrosoftYaHei";
content: '上一页';
font-family: 'MicrosoftYaHei';
font-size: 12px;
font-weight: normal;
font-stretch: normal;
@@ -371,8 +373,8 @@ export default {
}
/deep/ .el-icon.el-icon-arrow-right::before {
content: "下一页";
font-family: "MicrosoftYaHei";
content: '下一页';
font-family: 'MicrosoftYaHei';
font-size: 12px;
font-weight: normal;
font-stretch: normal;
@@ -386,7 +388,7 @@ export default {
// height: 773px;
.cc::after {
content: "";
content: '';
width: 367px;
display: block;
height: 0px;
@@ -428,7 +430,7 @@ export default {
margin-right: 16px;
}
span {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 14px;
font-weight: normal;
font-stretch: normal;
@@ -466,7 +468,7 @@ export default {
justify-content: space-between;
align-items: center;
time {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 14px;
font-weight: normal;
font-stretch: normal;
@@ -488,7 +490,7 @@ export default {
font-size: 12px;
}
h3 {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 16px;
font-weight: normal;
font-stretch: normal;
@@ -515,7 +517,7 @@ export default {
text-align: center;
margin-right: 78px;
width: 90px;
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 20px;
font-weight: normal;
font-stretch: normal;
@@ -527,7 +529,7 @@ export default {
color: #e60012;
position: relative;
&::after {
content: "";
content: '';
width: 91px;
height: 2px;
background-image: linear-gradient(#e60012, #e60012),
@@ -552,13 +554,13 @@ export default {
.block {
/deep/.el-range-editor.el-input__inner {
width: 325px;
background: url("../../../static/img/xa.png") 90% center no-repeat;
background: url('../../../static/img/xa.png') 90% center no-repeat;
background-color: #f9f8f8;
}
/deep/.el-date-editor .el-range-input {
background-color: #f9f8f8;
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 18px;
font-weight: normal;
font-stretch: normal;
@@ -572,7 +574,7 @@ export default {
}
/deep/.el-date-editor .el-range-separator {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 18px;
font-weight: normal;
font-stretch: normal;
@@ -594,7 +596,7 @@ export default {
-moz-appearance: none;
-webkit-appearance: none;
/* 右侧添加小箭头的背景图 */
background: url("../../../static/img/xa.png") 90% center no-repeat;
background: url('../../../static/img/xa.png') 90% center no-repeat;
background-size: 14px 8px;
// width: 325px;
padding: 0px 30px;
@@ -616,7 +618,7 @@ export default {
-moz-appearance: none;
-webkit-appearance: none;
/* 右侧添加小箭头的背景图 */
background: url("../../../static/img/xa.png") 90% center no-repeat;
background: url('../../../static/img/xa.png') 90% center no-repeat;
background-size: 14px 8px;
// width: 134px;
padding: 0px 30px;
@@ -638,7 +640,7 @@ export default {
-moz-appearance: none;
-webkit-appearance: none;
/* 右侧添加小箭头的背景图 */
background: url("../../../static/img/xa.png") 90px center no-repeat;
background: url('../../../static/img/xa.png') 90px center no-repeat;
background-size: 14px 8px;
width: 134px;
height: 38px;
@@ -666,7 +668,7 @@ export default {
linear-gradient(#e60012, #e60012);
background-blend-mode: normal, normal;
border-radius: 4px;
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 16px;
font-weight: normal;
font-stretch: normal;
@@ -705,7 +707,7 @@ export default {
align-items: center;
span:first-child {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 18px;
font-weight: normal;
font-stretch: normal;
@@ -714,7 +716,7 @@ export default {
}
span:last-child {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 24px;
font-weight: bold;
font-stretch: normal;
@@ -726,7 +728,7 @@ export default {
}
.top-p {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 18px;
font-weight: normal;
font-stretch: normal;
@@ -788,7 +790,7 @@ export default {
align-items: center;
span {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 20px;
font-weight: normal;
font-stretch: normal;
@@ -797,7 +799,7 @@ export default {
}
time {
font-family: "MicrosoftYaHei";
font-family: 'MicrosoftYaHei';
font-size: 20px;
font-weight: normal;
letter-spacing: 0px;

BIN
static/img/wtj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB