许宏杰 1 year ago
parent ec5b188ca3
commit c4566552cb

@ -6,8 +6,8 @@ ENV = 'development'
# 苏州园区志愿服务活动区块链平台/开发环境
# VUE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api'
VUE_APP_BASE_API = 'http://39.101.188.84:9034'
# VUE_APP_BASE_API = 'http:///192.168.0.121:9034'
# VUE_APP_BASE_API = 'http://39.101.188.84:9034'
VUE_APP_BASE_API = 'http:///192.168.0.120:9034'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -297,7 +297,6 @@ export default {
},
//
participation(row) {
// this.$refs.participation.open();
this.$confirm("是否确定报名活动?", "确认信息", {
distinguishCancelAndClose: true,
confirmButtonText: "确定",

@ -311,17 +311,7 @@ export default {
this.e = e;
activityGet(e).then((res) => {
this.detailData = res.data;
for (let key1 in this.personParams) {
for (let key2 in this.detailData) {
if (key1 == key2) {
this.personParams[key1] = this.detailData[key2];
}
}
}
this.detailDatalist = this.labelgenerate(this.detailData);
if (this.personParams.sexRange == "") {
this.personParams.sexRange = "男,女";
}
this.participationParams.activityId = this.detailData.id;
this.getPersonData();
this.getParticipationData();
@ -329,17 +319,22 @@ export default {
});
},
//
labelgenerate(data = {}) {
let arrlist = [];
for (let key3 of this.arr) {
for (let key4 in data) {
if (key3 == key4) {
let a = data[key3];
arrlist.push(a);
labelgenerate(data) {
let result = [];
this.arr.forEach((item) => {
for (let itemB in data) {
if (item == itemB) {
// =string
if (data[itemB]) {
data[itemB] = data[itemB].split(",");
} else {
data[itemB] = [];
}
result = [...result, ...data[itemB]];
}
}
}
return arrlist;
});
return result;
},
//
closeDetail() {
@ -358,18 +353,6 @@ export default {
});
}
this.load1 = false;
// peopleList(this.personParams).then((res) => {
// this.personList = res.rows;
// if (this.personList.length > 0) {
// this.personList.forEach((item) => {
// item.arrlist = this.labelgenerate(item);
// });
// }
// this.personTotal = res.total;
// this.load1 = false;
// });
},
getParticipationData() {
this.load2 = true;
@ -382,17 +365,6 @@ export default {
});
}
this.load2 = false;
// canyuList(this.participationParams).then((res) => {
// this.participationList = res.rows;
// if (this.participationList.length > 0) {
// this.participationList.forEach((item) => {
// item.arrlist = this.labelgenerate(item);
// });
// }
// this.participationTotal = res.total;
// this.load2 = false;
// });
},
//
changePersonSize(e) {

@ -175,7 +175,7 @@
<el-select
v-model="ruleForm1.housingRange"
placeholder="请选择小区"
multiples
multiple
>
<el-option
v-for="dict in dict.type.xioaqu_type"
@ -190,7 +190,7 @@
<el-select
v-model="ruleForm1.educationRange"
placeholder="请选择文化程度"
multiples
multiple
>
<el-option
v-for="dict in dict.type.education_range"
@ -207,7 +207,7 @@
<el-select
v-model="ruleForm1.interestRange"
placeholder="请选择兴趣爱好"
multiples
multiple
>
<el-option
v-for="dict in dict.type.hobby_type"
@ -222,7 +222,7 @@
<el-select
v-model="ruleForm1.politicalRange"
placeholder="请选择政治面貌"
multiples
multiple
>
<el-option
v-for="dict in dict.type.political_range"
@ -236,11 +236,7 @@
</div>
<div class="inputBox">
<el-form-item label="性别:" prop="sexRange">
<el-select
v-model="ruleForm1.sexRange"
multiples
placeholder="请选择性别"
>
<el-select v-model="ruleForm1.sexRange" placeholder="请选择性别">
<el-option
v-for="dict in dict.type.sex_range"
:key="dict.value"
@ -253,7 +249,7 @@
<el-form-item label="年龄:" prop="ageRange">
<el-select
v-model="ruleForm1.ageRange"
multiples
multiple
placeholder="请选择年龄"
>
<el-option
@ -270,7 +266,7 @@
<el-form-item label="专业类型:" prop="professionalRange">
<el-select
v-model="ruleForm1.professionalRange"
multiples
multiple
placeholder="请选择专业类型"
>
<el-option
@ -285,7 +281,7 @@
<el-form-item label="行业类型:" prop="industryRange">
<el-select
v-model="ruleForm1.industryRange"
multiples
multiple
placeholder="请选择行业类型"
>
<el-option
@ -303,7 +299,7 @@
<el-form-item label="院校:" prop="schoolRange">
<el-select
v-model="ruleForm1.schoolRange"
multiples
multiple
placeholder="请选择院校"
>
<el-option
@ -318,7 +314,7 @@
<el-form-item label="国籍:" prop="nationalityRange">
<el-select
v-model="ruleForm1.nationalityRange"
multiples
multiple
placeholder="请选择国籍"
>
<el-option
@ -491,6 +487,29 @@ export default {
this.reset();
this.titleText = "编辑信息";
activityGet(e.id).then((res) => {
let arr = [
"ageRange",
"politicalRange",
"educationRange",
"housingRange",
"industryRange",
"interestRange",
"professionalRange",
"schoolRange",
"nationalityRange",
];
arr.forEach((item) => {
for (let itemB in res.data) {
if (item == itemB) {
// =string
if (res.data[itemB]) {
res.data[itemB] = res.data[itemB].split(",");
} else {
res.data[itemB] = [];
}
}
}
});
this.ruleForm1 = res.data;
this.addShow = true;
});
@ -537,10 +556,11 @@ export default {
if (this.ruleForm1[itemB] != "") {
i++;
}
// =string
this.ruleForm1[itemB] = this.ruleForm1[itemB].toString();
}
}
});
console.log(i);
if (i < 3) {
this.$message.error("人员信息要求最低选择三条");
}

@ -34,7 +34,7 @@
color: scope.row.issuanceStatus ? '#67C23A' : '#F56C6C',
}"
>
{{ scope.row.issuanceStatus ? "已发放" : "未发放" }}
{{ filterIissuanceStatus(scope.row) }}
</span>
</template>
</el-table-column>
@ -47,13 +47,13 @@
<el-button size="mini" type="text" @click="handleInfo(scope.row)"
>查看</el-button
>
<!-- <el-button
<el-button
v-if="scope.row.issuanceStatus == false && scope.row.type == null"
size="mini"
type="text"
@click="handleFabu(scope.row)"
v-if="scope.row.issuanceStatus == false"
>发放</el-button
> -->
@click="handleApplyfor(scope.row)"
>申请</el-button
>
</template>
</el-table-column>
</el-table>
@ -64,88 +64,6 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 发布对话框 -->
<el-dialog :visible.sync="open" width="500px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
{{ title }}
</div>
<div class="info-box">
<div>
<div class="info-form-title">
<span></span>
证书信息
</div>
<div class="info-item">
<div class="item-lable">活动名称:</div>
<div class="item-value">{{ form.name }}</div>
</div>
<div class="info-item">
<div class="item-lable">志愿者:</div>
<div class="item-value">{{ form.userName }}</div>
</div>
<div class="info-item">
<div class="item-lable">活动参与时间:</div>
<div class="item-value">{{ form.activityTime }}</div>
</div>
<div class="info-item">
<div class="item-lable">状态:</div>
<div class="item-value">
{{ form.issuanceStatus ? "已发放" : "未发放" }}
</div>
</div>
<div class="info-form-title">
<span></span>
收货信息
</div>
<div class="info-item">
<div class="item-lable">姓名:</div>
<div class="item-value">{{ form.userName }}</div>
</div>
<div class="info-item">
<div class="item-lable">手机号:</div>
<div class="item-value">{{ form.phonenumber }}</div>
</div>
<div class="info-item">
<div class="item-lable">详细地址:</div>
<div class="item-value">{{ form.mailmailAddress }}</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="warning" @click="submitPaper()"
>发放纸制证书</el-button
>
<el-button type="primary" @click="submitElectron()"
>发放电子证书</el-button
>
</div>
</el-dialog>
<!-- 纸制证书 -->
<el-dialog :visible.sync="infoOpen" width="500px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
邮政信息
</div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="快递公司" prop="courierCompanies">
<el-input
v-model="form.courierCompanies"
placeholder="请输入快递公司"
/>
</el-form-item>
<el-form-item label="快递单号" prop="trackingNumber">
<el-input
v-model="form.trackingNumber"
placeholder="请输入快递公司"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog :visible.sync="infoShow" width="600px" append-to-body>
<div slot="title" class="dialog-title">
@ -181,7 +99,10 @@
</div>
</div>
</div>
<div class="logisticsInfo" v-show="form.type == 2">
<div
class="logisticsInfo"
v-show="form.type == 2 && form.issuanceStatus == true"
>
<div class="title">
<img src="@/assets/images/huodong.png" alt="" />
<span>纸制证书</span>
@ -199,7 +120,10 @@
</div>
</div>
</div>
<div class="logisticsInfo" v-show="form.type == 1">
<div
class="logisticsInfo"
v-show="form.type == 1 && form.issuanceStatus == true"
>
<div class="title">
<img src="@/assets/images/huodong.png" alt="" />
<span>电子证书</span>
@ -239,10 +163,29 @@
</div>
</div>
</el-dialog>
<!-- 申请 -->
<el-dialog :visible.sync="applyShow" width="350px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
申请操作
</div>
<el-radio-group v-model="radio">
<el-radio-button :label="1">电子证书</el-radio-button>
<el-radio-button :label="2">纸质证书</el-radio-button>
</el-radio-group>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitElectron"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
// false null
// true 1
// false 2
// true 2
import {
dsbrecordsList,
dsbrecordsInfo,
@ -254,6 +197,9 @@ import html2canvas from "html2canvas";
export default {
data() {
return {
currentRow: {},
radio: 1,
applyShow: false,
infoShow: false,
infoOpen: false,
form: {},
@ -290,6 +236,43 @@ export default {
});
},
methods: {
/**电子 */
submitElectron() {
let _this = this;
let title = "";
if (this.radio == 1) {
title = `您确定要申请“${this.currentRow.name}”电子证书吗?`;
} else {
title = `您确定要申请“${this.currentRow.name}”纸质证书吗?`;
}
this.$modal.confirm(title).then(function () {
let data = {
issuanceStatus: _this.radio == 1 ? true : false,
id: _this.currentRow.id,
type: _this.radio, // 1: 2:
};
_this.subIssue(data);
});
this.applyShow = false;
},
//
subIssue(data) {
ycIssue(data).then((res) => {
this.applyShow = false;
this.getList();
if (data.type == 1) {
this.$modal.msgSuccess("发放成功");
} else {
this.$modal.msgSuccess("申请成功");
}
});
},
/**申请操作 */
handleApplyfor(row) {
this.currentRow = row;
this.applyShow = true;
},
/**下载电子证书 */
downloadContentAsImage() {
const content = this.$refs.zs; // <div>DOM
@ -328,69 +311,6 @@ export default {
let res = await getYcInfo(id);
return res;
},
//
async handleFabu(row) {
this.reset();
let res = await this.getInfo(row.id);
this.form = res.data;
this.title = "发放查看";
this.open = true;
},
//
isComplete() {
if (
!this.form.userName ||
!this.form.mailmailAddress ||
!this.form.phonenumber
) {
this.$modal.msgError("请前往地址管理中添加详细地址!");
return false;
} else {
return true;
}
},
/**纸制 */
submitPaper() {
let isTrue = this.isComplete();
if (isTrue) {
this.infoOpen = true;
}
},
/**纸制提交 */
submitForm() {
this.$refs["form"].validate((valid) => {
let data = {
courierCompanies: this.form.courierCompanies,
id: this.form.id,
trackingNumber: this.form.trackingNumber,
type: 2, // 1: 2:
};
this.subIssue(data);
});
},
//
subIssue(data) {
ycIssue(data).then((res) => {
this.infoOpen = false;
this.open = false;
this.getList();
this.$modal.msgSuccess("发放成功");
});
},
/**电子 */
submitElectron() {
let _this = this;
this.$modal
.confirm(`您确定要发放“${this.form.name}”证书吗?`)
.then(function () {
let data = {
id: _this.form.id,
type: 1, // 1: 2:
};
_this.subIssue(data);
});
},
/**关闭 */
cancel() {
this.open = false;

@ -0,0 +1,453 @@
<template>
<div class="app-container" ref="main">
<div ref="search">
<MyInput v-model="queryParams.name" @clickSearch="handleSearch" />
</div>
<el-table
v-loading="loading"
:data="tableData"
:height="tableHeigth + 'px'"
>
<el-table-column
label="序号"
align="center"
type="index"
prop="id"
width="55"
/>
<el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="志愿者" align="center" prop="userName" />
<el-table-column
label="活动参与时间"
align="center"
prop="activityTime"
/>
<el-table-column label="活动时长" align="center" prop="points">
<template slot-scope="scope"> {{ scope.row.points }} 小时 </template>
</el-table-column>
<el-table-column label="活动积分" align="center" prop="points" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<span
:style="{
color: scope.row.issuanceStatus ? '#67C23A' : '#F56C6C',
}"
>
{{ scope.row.issuanceStatus ? "已发放" : "未发放" }}
</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleInfo(scope.row)"
>查看</el-button
>
<!-- <el-button
size="mini"
type="text"
@click="handleFabu(scope.row)"
v-if="scope.row.issuanceStatus == false"
>发放</el-button
> -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 发布对话框 -->
<el-dialog :visible.sync="open" width="500px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
{{ title }}
</div>
<div class="info-box">
<div>
<div class="info-form-title">
<span></span>
证书信息
</div>
<div class="info-item">
<div class="item-lable">活动名称:</div>
<div class="item-value">{{ form.name }}</div>
</div>
<div class="info-item">
<div class="item-lable">志愿者:</div>
<div class="item-value">{{ form.userName }}</div>
</div>
<div class="info-item">
<div class="item-lable">活动参与时间:</div>
<div class="item-value">{{ form.activityTime }}</div>
</div>
<div class="info-item">
<div class="item-lable">状态:</div>
<div class="item-value">
{{ form.issuanceStatus ? "已发放" : "未发放" }}
</div>
</div>
<div class="info-form-title">
<span></span>
收货信息
</div>
<div class="info-item">
<div class="item-lable">姓名:</div>
<div class="item-value">{{ form.userName }}</div>
</div>
<div class="info-item">
<div class="item-lable">手机号:</div>
<div class="item-value">{{ form.phonenumber }}</div>
</div>
<div class="info-item">
<div class="item-lable">详细地址:</div>
<div class="item-value">{{ form.mailAddress }}</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="warning" @click="submitPaper()"
>发放纸制证书</el-button
>
<el-button type="primary" @click="submitElectron()"
>发放电子证书</el-button
>
</div>
</el-dialog>
<!-- 纸制证书 -->
<el-dialog :visible.sync="infoOpen" width="500px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
邮政信息
</div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="快递公司" prop="courierCompanies">
<el-input
v-model="form.courierCompanies"
placeholder="请输入快递公司"
/>
</el-form-item>
<el-form-item label="快递单号" prop="trackingNumber">
<el-input
v-model="form.trackingNumber"
placeholder="请输入快递公司"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog :visible.sync="infoShow" width="600px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
查看
</div>
<div class="conversionInfo">
<div class="basicInfo">
<div class="title">
<img src="@/assets/images/huodong.png" alt="" />
<span>活动详情</span>
</div>
<div class="info">
<div class="lists">
<div class="list-left">
<div>活动名称</div>
<div>{{ form.name }}</div>
</div>
<div class="list-right">
<div>志愿者</div>
<div>{{ form.userName }}</div>
</div>
</div>
<div class="lists">
<div class="list-left">
<div>活动参与时间</div>
<div>{{ form.activityTime }}</div>
</div>
<div class="list-left">
<div>状态</div>
<div>{{ form.issuanceStatus ? "已发放" : "未发放" }}</div>
</div>
</div>
</div>
</div>
<div class="logisticsInfo" v-show="form.type == 2">
<div class="title">
<img src="@/assets/images/huodong.png" alt="" />
<span>纸制证书</span>
</div>
<div class="info">
<div class="lists">
<div class="list-left">
<div>快递公司</div>
<div>{{ form.courierCompanies }}</div>
</div>
<div class="list-right">
<div>快递单号</div>
<div>{{ form.trackingNumber }}</div>
</div>
</div>
</div>
</div>
<div class="logisticsInfo" v-show="form.type == 1">
<div class="title">
<img src="@/assets/images/huodong.png" alt="" />
<span>电子证书</span>
</div>
<div class="info zs-box" ref="zs">
<div class="top-text">
<span>{{ form.userName }}</span> 先生/女士
<p>
您在苏州工业园区累计志愿服务0小时感谢您的无私奉献特发此证以兹鼓励
</p>
</div>
<div class="bottom-text">
<div class="lable-value">
<div class="lable">签发单位</div>
<div class="value">苏州工业园区宣传和统战部</div>
</div>
<div class="lable-value">
<div class="lable"></div>
<div class="value">苏州工业园区新时代文明实践中心</div>
</div>
<div class="lable-value">
<div class="lable"></div>
<div class="value">
{{ $moment().format("YYYY年MM月DD日") }}
</div>
</div>
</div>
<div class="zs-z"></div>
</div>
<el-button
type="primary"
size="small"
style="margin-top: 10px"
@click="downloadContentAsImage()"
>下载电子证书</el-button
>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import {
dsbrecordsList,
dsbrecordsInfo,
getYcInfo,
ycIssue,
getYcList,
} from "@/api/volunteer/gxhzs/hdzsff/index.js";
import html2canvas from "html2canvas";
export default {
data() {
return {
infoShow: false,
infoOpen: false,
form: {},
rules: {
courierCompanies: [
{ required: true, message: "请输入快递公司", trigger: "blur" },
],
trackingNumber: [
{ required: true, message: "请输入快递公司", trigger: "blur" },
],
},
open: false,
title: "",
tableHeigth: 0,
loading: false,
tableData: [],
total: 1,
queryParams: {
name: undefined,
UId: undefined,
issuanceStatus: true,
pageNum: 1,
pageSize: 20,
},
};
},
created() {
this.queryParams.UId = this.$store.getters.userId;
// //
this.$nextTick(() => {
this.tableHeigth =
this.$refs.main.offsetHeight - 40 - this.$refs.search.offsetHeight - 73;
this.getList();
});
},
methods: {
/**下载电子证书 */
downloadContentAsImage() {
const content = this.$refs.zs; // <div>DOM
// Canvas<div>
const canvas = document.createElement("canvas");
canvas.width = content.offsetWidth;
canvas.height = content.offsetHeight;
const context = canvas.getContext("2d");
// 使Canvas<div>
html2canvas(content).then((canvas) => {
// CanvasDataURL
const dataURL = canvas.toDataURL("image/png");
// 使FileSaver.jsDataURL
saveAs(dataURL, "download.png");
});
},
/**搜索 */
handleSearch(keyWord) {
this.queryParams = {
issuanceStatus: true,
name: keyWord,
UId: this.$store.getters.userId,
// creType: 1, //1:,2
pageNum: 1,
pageSize: 10,
};
this.getList();
},
/**查详情 */
async handleInfo(row) {
let res = await this.getInfo(row.id);
this.form = res.data;
this.infoShow = true;
// console.log("", res);
},
async getInfo(id) {
let res = await getYcInfo(id);
return res;
},
//
async handleFabu(row) {
this.reset();
let res = await this.getInfo(row.id);
this.form = res.data;
this.title = "发放查看";
this.open = true;
},
//
isComplete() {
if (
!this.form.userName ||
!this.form.mailAddress ||
!this.form.phonenumber
) {
this.$modal.msgError("请前往地址管理中添加详细地址!");
return false;
} else {
return true;
}
},
/**纸制 */
submitPaper() {
let isTrue = this.isComplete();
if (isTrue) {
this.infoOpen = true;
}
},
/**纸制提交 */
submitForm() {
this.$refs["form"].validate((valid) => {
let data = {
courierCompanies: this.form.courierCompanies,
id: this.form.id,
trackingNumber: this.form.trackingNumber,
type: 2, // 1: 2:
};
this.subIssue(data);
});
},
//
subIssue(data) {
ycIssue(data).then((res) => {
this.infoOpen = false;
this.open = false;
this.getList();
this.$modal.msgSuccess("发放成功");
});
},
/**电子 */
submitElectron() {
let _this = this;
this.$modal
.confirm(`您确定要发放“${this.form.name}”证书吗?`)
.then(function () {
let data = {
id: _this.form.id,
type: 1, // 1: 2:
};
_this.subIssue(data);
});
},
/**关闭 */
cancel() {
this.open = false;
this.reset();
},
/**重置 */
reset() {
this.form = {
id: null,
activityId: null,
certificateId: null,
uId: null,
content: null,
createId: null,
createBy: null,
activityTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
userId: null,
deptId: null,
type: null,
};
},
/** 查询发放记录列表 */
getList() {
this.loading = true;
getYcList(this.queryParams).then((response) => {
this.tableData = response.rows;
this.total = response.total;
this.loading = false;
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/myTable.scss";
.info-form-title {
display: flex;
align-items: center;
margin-bottom: 20px;
font-size: 17px;
font-family: "Alibaba-PuHuiTi-Regular";
font-weight: 500;
color: #333;
font-weight: bold;
span {
width: 5px;
height: 17px;
margin-right: 6px;
background: #f8414d;
}
}
</style>

@ -24,10 +24,9 @@
prop="activityTime"
/>
<el-table-column label="活动时长" align="center" prop="points">
<template slot-scope="scope"> {{ scope.row.points }} 小时 </template>
<template slot-scope="scope"> {{ scope.row.points }}小时 </template>
</el-table-column>
<el-table-column label="活动积分" align="center" prop="points" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<span
@ -48,13 +47,13 @@
<el-button size="mini" type="text" @click="handleInfo(scope.row)"
>查看</el-button
>
<!-- <el-button
<el-button
v-if="scope.row.issuanceStatus == false"
size="mini"
type="text"
@click="handleFabu(scope.row)"
v-if="scope.row.issuanceStatus == false"
>发放</el-button
> -->
@click="handleApplyfor(scope.row)"
>申请</el-button
>
</template>
</el-table-column>
</el-table>
@ -65,89 +64,6 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 发布对话框 -->
<el-dialog :visible.sync="open" width="500px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
{{ title }}
</div>
<div class="info-box">
<div>
<div class="info-form-title">
<span></span>
证书信息
</div>
<div class="info-item">
<div class="item-lable">活动名称:</div>
<div class="item-value">{{ form.name }}</div>
</div>
<div class="info-item">
<div class="item-lable">志愿者:</div>
<div class="item-value">{{ form.userName }}</div>
</div>
<div class="info-item">
<div class="item-lable">活动参与时间:</div>
<div class="item-value">{{ form.activityTime }}</div>
</div>
<div class="info-item">
<div class="item-lable">状态:</div>
<div class="item-value">
{{ form.issuanceStatus ? "已发放" : "未发放" }}
</div>
</div>
<div class="info-form-title">
<span></span>
收货信息
</div>
<div class="info-item">
<div class="item-lable">姓名:</div>
<div class="item-value">{{ form.userName }}</div>
</div>
<div class="info-item">
<div class="item-lable">手机号:</div>
<div class="item-value">{{ form.phonenumber }}</div>
</div>
<div class="info-item">
<div class="item-lable">详细地址:</div>
<div class="item-value">{{ form.mailAddress }}</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="warning" @click="submitPaper()"
>发放纸制证书</el-button
>
<el-button type="primary" @click="submitElectron()"
>发放电子证书</el-button
>
</div>
</el-dialog>
<!-- 纸制证书 -->
<el-dialog :visible.sync="infoOpen" width="500px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
邮政信息
</div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="快递公司" prop="courierCompanies">
<el-input
v-model="form.courierCompanies"
placeholder="请输入快递公司"
/>
</el-form-item>
<el-form-item label="快递单号" prop="trackingNumber">
<el-input
v-model="form.trackingNumber"
placeholder="请输入快递公司"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog :visible.sync="infoShow" width="600px" append-to-body>
<div slot="title" class="dialog-title">
@ -241,6 +157,21 @@
</div>
</div>
</el-dialog>
<!-- 申请 -->
<el-dialog :visible.sync="applyShow" width="350px" append-to-body>
<div slot="title" class="dialog-title">
<span class="title-line"></span>
申请操作
</div>
<el-radio-group v-model="radio">
<el-radio-button :label="1">电子证书</el-radio-button>
<el-radio-button :label="2">纸质证书</el-radio-button>
</el-radio-group>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitElectron"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -256,6 +187,9 @@ import html2canvas from "html2canvas";
export default {
data() {
return {
currentRow: {},
radio: 1,
applyShow: false,
infoShow: false,
infoOpen: false,
form: {},
@ -274,10 +208,9 @@ export default {
tableData: [],
total: 1,
queryParams: {
UId: null,
name: undefined,
UId: undefined,
issuanceStatus: true,
// creType: 1, //1:,2
pageNum: 1,
pageSize: 20,
},
@ -293,6 +226,37 @@ export default {
});
},
methods: {
/**电子 */
submitElectron() {
let _this = this;
if (this.radio == 1) {
this.$modal
.confirm(`您确定要申请“${this.currentRow.name}”电子证书吗?`)
.then(function () {
let data = {
id: _this.currentRow.id,
type: _this.radio, // 1: 2:
};
_this.subIssue(data);
});
} else {
this.applyShow = false;
}
},
//
subIssue(data) {
ycIssue(data).then((res) => {
this.applyShow = false;
this.getList();
this.$modal.msgSuccess("发放成功");
});
},
/**申请操作 */
handleApplyfor(row) {
this.currentRow = row;
this.applyShow = true;
},
/**下载电子证书 */
downloadContentAsImage() {
const content = this.$refs.zs; // <div>DOM
@ -313,9 +277,7 @@ export default {
/**搜索 */
handleSearch(keyWord) {
this.queryParams = {
issuanceStatus: true,
name: keyWord,
UId: this.$store.getters.userId,
// creType: 1, //1:,2
pageNum: 1,
pageSize: 10,
@ -333,69 +295,6 @@ export default {
let res = await getYcInfo(id);
return res;
},
//
async handleFabu(row) {
this.reset();
let res = await this.getInfo(row.id);
this.form = res.data;
this.title = "发放查看";
this.open = true;
},
//
isComplete() {
if (
!this.form.userName ||
!this.form.mailAddress ||
!this.form.phonenumber
) {
this.$modal.msgError("请前往地址管理中添加详细地址!");
return false;
} else {
return true;
}
},
/**纸制 */
submitPaper() {
let isTrue = this.isComplete();
if (isTrue) {
this.infoOpen = true;
}
},
/**纸制提交 */
submitForm() {
this.$refs["form"].validate((valid) => {
let data = {
courierCompanies: this.form.courierCompanies,
id: this.form.id,
trackingNumber: this.form.trackingNumber,
type: 2, // 1: 2:
};
this.subIssue(data);
});
},
//
subIssue(data) {
ycIssue(data).then((res) => {
this.infoOpen = false;
this.open = false;
this.getList();
this.$modal.msgSuccess("发放成功");
});
},
/**电子 */
submitElectron() {
let _this = this;
this.$modal
.confirm(`您确定要发放“${this.form.name}”证书吗?`)
.then(function () {
let data = {
id: _this.form.id,
type: 1, // 1: 2:
};
_this.subIssue(data);
});
},
/**关闭 */
cancel() {
this.open = false;

@ -30,7 +30,7 @@
color: scope.row.issuanceStatus ? '#67C23A' : '#F56C6C',
}"
>
{{ scope.row.issuanceStatus ? "已发放" : "未发放" }}
{{ scope.row.issuanceStatus | filerIssuanceStatus }}
</span>
</template>
</el-table-column>
@ -114,9 +114,9 @@
<el-button type="warning" @click="submitPaper()"
>发放纸制证书</el-button
>
<el-button type="primary" @click="submitElectron()"
<!-- <el-button type="primary" @click="submitElectron()"
>发放电子证书</el-button
>
> -->
</div>
</el-dialog>
<!-- 纸制证书 -->
@ -276,6 +276,7 @@ export default {
},
};
},
created() {
// //
this.$nextTick(() => {
@ -285,6 +286,19 @@ export default {
});
},
methods: {
/**状态过滤 */
filterIissuanceStatus(row) {
if (row.issuanceStatus == false && row.type == null) {
return "未发放";
} else if (
(row.issuanceStatus == true && row.type == 1) ||
(row.issuanceStatus == true && row.type == 2)
) {
return "已发放";
} else if (row.issuanceStatus == false && row.type == 2) {
return "已申请";
}
},
/**下载电子证书 */
downloadContentAsImage() {
const content = this.$refs.zs; // <div>DOM

Loading…
Cancel
Save