| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <template>
- <el-dialog
- :visible.sync="showDialog"
- :title="title"
- :modal-append-to-body="false"
- style="text-align: left"
- @close="closeDialog"
- :close-on-click-modal="false"
- width="1000px"
- >
- <div class="user-panel" v-loading="loading">
- <el-descriptions class="margin-top" :column="3" border>
- <el-descriptions-item>
- <template slot="label">
- 流水号
- </template>
- {{formModel.wishInfoUserRecord.num}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 爱心人士
- </template>
- {{formModel.wishInfoUserRecord.regUserName}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 是否现场互换心愿
- </template>
- <span v-if="formModel.wishInfoUserRecord.isSpot">是</span>
- <span v-else>否</span>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 学生心愿
- </template>
- 篮球
- </el-descriptions-item>
- <el-descriptions-item span="2">
- <template slot="label">
- 作品图片
- </template>
- <el-link :href="formModel.wishInfo.image" target="blank_" :underline="false">
- <el-image
- style="width: 100px; height: 100px"
- :src="formModel.wishInfo.image">
- </el-image>
- </el-link>
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 学生姓名
- </template>
- {{formModel.wishInfo.studentName}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 学生类型
- </template>
- {{formModel.wishInfo.studentType}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 互换状态
- </template>
- {{formModel.wishInfoUserRecord.statusN}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 收件人
- </template>
- {{formModel.wishInfoUserRecord.recipients}}
- </el-descriptions-item>
- <el-descriptions-item span="2">
- <template slot="label">
- 收件人电话
- </template>
- {{formModel.wishInfoUserRecord.recipientsPhone}}
- </el-descriptions-item>
- <el-descriptions-item span="3">
- <template slot="label">
- 收件人地址
- </template>
- {{formModel.wishInfoUserRecord.recipientsAddress}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 寄件人
- </template>
- {{formModel.wishInfoUserRecord.sender}}
- </el-descriptions-item>
- <el-descriptions-item span="2">
- <template slot="label">
- 寄件人电话
- </template>
- {{formModel.wishInfoUserRecord.senderPhone}}
- </el-descriptions-item>
- <el-descriptions-item>
- <template slot="label">
- 寄件人地址
- </template>
- {{formModel.wishInfoUserRecord.senderAddress}}
- </el-descriptions-item>
- </el-descriptions>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeDialog">取 消</el-button>
- </span>
- </el-dialog>
- </template>
- <script>
- import Constant from "@/constant";
- import { getToken } from "@/utils/auth"; // get token from cookie
- import wishInfoUserRecordApi from "@/api/base/wishInfoUserRecord";
- import dataDictionaryApi from "@/api/sys/dataDictionary";
-
- export default {
- props: ["businessKey", "title"],
- data() {
- return {
- showPwd: true,
- ruleValidate: {
- category: [
- { required: true, message: "类型不能为空", trigger: "blur" },
- ],
- title: [
- { required: true, message: "标题不能为空", trigger: "blur" },
- ],
- amount: [
- { required: true, message: "数量不能为空", trigger: "blur" },
- ],
- studentName: [
- { required: true, message: "学生姓名不能为空", trigger: "blur" },
- ],
- studentType: [
- { required: true, message: "学生类型不能为空", trigger: "blur" },
- ],
- },
- roleList: [],
- formModel: {
- wishInfoUserRecord:[],
- wishInfo:[]
- },
- showDialog: true,
- loading: false,
- submitting: false,
- categoryList:[],
- //上传地址
- uploadUrl: Constant.serverUrl + "/uploadPicture",
- uploadData: {
- subFolder: "love-donation",
- },
- fileUrl: "",
- fileUrl1: "",
- headers: {
- Authorization: getToken(),
- },
- uploadUrl1: Constant.serverUrl + "/tinymce/upload?token=" + getToken(),
- };
- },
- created() {
- dataDictionaryApi.findByCatalogName({catalogName: "心愿类型",})
- .then((response) => {
- var jsonData = response.data;
- this.categoryList = jsonData.data;
- });
- },
- methods: {
- closeDialog() {
- this.$emit("close", false);
- },
- handleSubmit() {
- var self = this;
-
- this.$refs["form"].validate((valid) => {
- if (valid) {
- (function () {
- var id = self.formModel.id;
-
- if (id == null || id.length == 0) {
- return wishInfoUserRecordApi.add(self.formModel);
- } else {
- self.formModel.password = null;
- return wishInfoUserRecordApi.update(self.formModel);
- }
- })().then(function (response) {
- var jsonData = response.data;
-
- if (jsonData.result) {
- self.$message({
- message: "保存成功!",
- type: "success",
- });
-
- self.$emit("close", true);
- } else {
- self.$message({
- message: jsonData.message + "",
- type: "warning",
- });
-
- self.$emit("close", false);
- }
- });
- }
- });
- },
- handleAvatarSuccess(res, file) {
- var self = this;
- self.formModel.image = res.data;
-
- self.fileUrl =
- res.data + "?x-oss-process=image/resize,m_lfit,h_300,w_300";
- },
- },
- async mounted() {
- var self = this;
- self.loading = true;
-
- (function () {
- if (self.businessKey != null && self.businessKey.length > 0) {
- return wishInfoUserRecordApi.edit(self.businessKey);
- } else {
- return wishInfoUserRecordApi.create();
- }
- })()
- .then((response) => {
- var jsonData = response.data;
-
- if (jsonData.result) {
- self.formModel = jsonData.data;
- //alert(JSON.stringify(self.formModel))
- self.showModal = true;
-
- let image = self.formModel.image;
- if (image != null) {
- self.fileUrl = image
- }
-
- if (self.formModel.introduction != null) {
- self.$refs.editor.setContent(self.formModel.introduction);
- }
-
- } else {
- self.$message.error(jsonData.message + "");
- }
-
- self.loading = false;
- })
- .catch((error) => {
- self.$message.error(error + "");
- self.loading = false;
- });
- },
- components: {
- },
- };
- </script>
- <style scoped>
- .user-panel {
- margin: 10px auto;
- }
- .avatar-uploader .el-upload {
- border: 1px dashed #d9d9d9;
- border-radius: 6px;
- cursor: pointer;
- position: relative;
- overflow: hidden;
- }
- .avatar-uploader .el-upload:hover {
- border-color: #409EFF;
- }
- .avatar-uploader-icon {
- font-size: 28px;
- color: #8c939d;
- width: 178px;
- height: 178px;
- line-height: 178px;
- text-align: center;
- }
- .avatar {
- width: 178px;
- height: 178px;
- display: block;
- }
- </style>
|