This commit is contained in:
曹辉 2023-05-04 14:45:41 +08:00
parent 297c4ee1fa
commit 9589551b14
13 changed files with 578 additions and 524 deletions

View File

@ -1,3 +0,0 @@
var baseurl = "http://192.168.16.30:8080";
export default baseurl

View File

@ -14,7 +14,6 @@ import {
} from "@/api/system/goodsCategory"; } from "@/api/system/goodsCategory";
import editor from "@/components/Editor"; import editor from "@/components/Editor";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl.js";
let id = 0; let id = 0;
export default { export default {
@ -415,9 +414,9 @@ export default {
updatePicture(obj).then((res) => {}); updatePicture(obj).then((res) => {});
} }
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
} }
}); });
} else { } else {
@ -427,10 +426,10 @@ export default {
// this.nurseStationId=this.form.nurseStationId // this.nurseStationId=this.form.nurseStationId
addGoodsInfo(this.form).then((response) => { addGoodsInfo(this.form).then((response) => {
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.StationName = "请选择所属护理站"; this.StationName = "请选择所属护理站";
this.open = false; this.open = false;
this.getList(); this.getList();
} }
}); });
} }

View File

@ -234,7 +234,6 @@ import {
getStationCategoryList getStationCategoryList
} from "@/api/system/goodsCategory"; } from "@/api/system/goodsCategory";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl";
let id = 0; let id = 0;
export default { export default {
name: "GoodsCategory", name: "GoodsCategory",
@ -266,7 +265,7 @@ export default {
} }
}, },
imgone: "", imgone: "",
baseurl: "", baseurl: process.env.VUE_APP_BASE_API,
// //
loading: true, loading: true,
// //
@ -328,7 +327,6 @@ export default {
watch: {}, watch: {},
created() { created() {
this.baseurl = baseurl;
this.getList(); this.getList();
this.info(); this.info();
}, },

View File

@ -106,7 +106,6 @@
<script> <script>
import { VueCropper } from "vue-cropper"; import { VueCropper } from "vue-cropper";
import baseurl from "@/api/baseurl.js";
import { updateNurseStationHeads, posts } from "@/api/system/stationAvatar.js"; import { updateNurseStationHeads, posts } from "@/api/system/stationAvatar.js";
export default { export default {
@ -149,7 +148,7 @@ export default {
} else if (this.img == "") { } else if (this.img == "") {
this.options.img = null; this.options.img = null;
} else { } else {
this.options.img = baseurl + this.img; this.options.img = process.env.VUE_APP_BASE_API + this.img;
} }
}, },
watch: { watch: {
@ -160,7 +159,7 @@ export default {
} else if (this.img == "") { } else if (this.img == "") {
this.options.img = null; this.options.img = null;
} else { } else {
this.options.img = baseurl + this.img; this.options.img = process.env.VUE_APP_BASE_API + this.img;
} }
}, },
}, },
@ -215,7 +214,7 @@ export default {
formData.append("file", data); formData.append("file", data);
formData.append("type", this.types); formData.append("type", this.types);
updateNurseStationHeads(formData).then((response) => { updateNurseStationHeads(formData).then((response) => {
this.options.img = baseurl + response.imgUrl; this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl); this.$emit("imgUrl", response.imgUrl);
this.openimg = false; this.openimg = false;
}); });

View File

@ -14,7 +14,6 @@ import {
} from "@/api/system/goodsCategory"; } from "@/api/system/goodsCategory";
import { getListByUser } from "@/api/system/userlist.js"; import { getListByUser } from "@/api/system/userlist.js";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl.js";
export default { export default {
components: { stationAcatar, editor }, components: { stationAcatar, editor },
@ -430,10 +429,10 @@ export default {
this.imgsurl = { pictureUrlList: [] }; this.imgsurl = { pictureUrlList: [] };
++this.isResouceShow; ++this.isResouceShow;
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
} }
}); });
} else { } else {
this.form.goodDetailsLists.forEach((e) => { this.form.goodDetailsLists.forEach((e) => {
@ -442,10 +441,10 @@ export default {
addGoodsInfo(this.form).then((response) => { addGoodsInfo(this.form).then((response) => {
++this.isResouceShow; ++this.isResouceShow;
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
// this.StationName = "请选择所属护理站"; // this.StationName = "请选择所属护理站";
this.open = false; this.open = false;
this.getList(); this.getList();
} }
}); });
} }

View File

@ -489,13 +489,12 @@ import {
selectOrderEvaluate selectOrderEvaluate
} from "@/api/system/goodsOrder"; } from "@/api/system/goodsOrder";
import { getListByUser } from "@/api/system/userlist.js"; import { getListByUser } from "@/api/system/userlist.js";
import baseurl from "@/api/baseurl.js";
export default { export default {
name: "GoodsOrder", name: "GoodsOrder",
data() { data() {
return { return {
baseurl: null, baseurl: process.env.VUE_APP_BASE_API,
// //
innerorder: false, innerorder: false,
// //
@ -615,7 +614,6 @@ export default {
}; };
}, },
created() { created() {
this.baseurl = baseurl;
this.info(); this.info();
this.infos(); this.infos();
}, },

View File

@ -387,14 +387,13 @@ import {
getPersonInfo getPersonInfo
} from "@/api/system/order"; } from "@/api/system/order";
import { getListByUser } from "@/api/system/userlist.js"; import { getListByUser } from "@/api/system/userlist.js";
import baseurl from "@/api/baseurl.js";
export default { export default {
name: "order", name: "order",
data() { data() {
return { return {
map: null, map: null,
baseurl: null, baseurl: process.env.VUE_APP_BASE_API,
orderStatuslist: [ orderStatuslist: [
{ {
value: "WAIT_PAY", value: "WAIT_PAY",
@ -501,7 +500,6 @@ export default {
}; };
}, },
created() { created() {
this.baseurl = baseurl;
this.info(); this.info();
this.infos(); this.infos();
}, },

View File

@ -12,7 +12,6 @@ import {
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { getListByUser } from "@/api/system/userlist.js"; import { getListByUser } from "@/api/system/userlist.js";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import baseurl from '@/api/baseurl'
export default { export default {
components: { stationAcatar }, components: { stationAcatar },
name: "Person", name: "Person",
@ -38,7 +37,7 @@ export default {
cb(new Error("请输入正确的联系电话")); cb(new Error("请输入正确的联系电话"));
}; };
return { return {
baseurl: null, baseurl: process.env.VUE_APP_BASE_API,
//男女选择 //男女选择
positionalTitleLevellist: [{ positionalTitleLevellist: [{
label: "初级", label: "初级",
@ -58,22 +57,22 @@ export default {
value: "NOT_CHECK", value: "NOT_CHECK",
}], }],
sexs: [{ sexs: [{
label: "男", label: "男",
value: "MALE", value: "MALE",
}, },
{ {
label: "女", label: "女",
value: "FEMALE", value: "FEMALE",
}, },
], ],
nursePersonTypes: [{ nursePersonTypes: [{
label: "护士", label: "护士",
value: "NURSE", value: "NURSE",
}, },
{ {
label: "护理师", label: "护理师",
value: "NURSE_TEACHER", value: "NURSE_TEACHER",
}, },
], ],
innerVisible: false, innerVisible: false,
innerVisible2: false, innerVisible2: false,
@ -202,7 +201,7 @@ export default {
validator: checkMobile2, validator: checkMobile2,
message: "", message: "",
trigger: "blur", trigger: "blur",
},], }, ],
address: [ address: [
{ required: true, message: "居住地址不能为空", trigger: "blur" }, { required: true, message: "居住地址不能为空", trigger: "blur" },
], ],
@ -210,7 +209,6 @@ export default {
}; };
}, },
created() { created() {
this.baseurl = baseurl
this.infos(); this.infos();
this.info(); this.info();
}, },
@ -238,7 +236,7 @@ export default {
this.form.nurseStationPersonCertificateList.push(obj); this.form.nurseStationPersonCertificateList.push(obj);
} }
}, },
imgUrl(imgUrl) { }, imgUrl(imgUrl) {},
//接收图片所属的item //接收图片所属的item
imgclassifyItem(item) { imgclassifyItem(item) {
let items = JSON.parse(item); let items = JSON.parse(item);
@ -554,14 +552,14 @@ export default {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal this.$modal
.confirm("是否确认删除护理站人员信息的数据项?") .confirm("是否确认删除护理站人员信息的数据项?")
.then(function () { .then(function() {
return delPerson(ids); return delPerson(ids);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}) })
.catch(() => { }); .catch(() => {});
}, },
/** 导入按钮操作 */ /** 导入按钮操作 */
handleImport() { handleImport() {
@ -603,8 +601,8 @@ export default {
handleExport() { handleExport() {
this.download( this.download(
"system/person/export", { "system/person/export", {
...this.queryParams, ...this.queryParams,
}, },
`person_${new Date().getTime()}.xlsx` `person_${new Date().getTime()}.xlsx`
); );
}, },

View File

@ -518,7 +518,6 @@
</template> </template>
<script> <script>
import baseurl from "@/api/baseurl.js";
import { import {
listPoser, listPoser,
getPoser, getPoser,
@ -681,7 +680,7 @@ export default {
}; };
}, },
created() { created() {
this.videourl = baseurl + "/system/station/updateNurseStationHeads"; this.videourl = process.env.VUE_APP_BASE_API + "/system/station/updateNurseStationHeads";
this.info(); this.info();
this.PosterImageJump(); this.PosterImageJump();
}, },
@ -867,7 +866,7 @@ export default {
this.objitem.push(imgUrlData.posterPictureUrl); this.objitem.push(imgUrlData.posterPictureUrl);
}, },
imgUrl2(imgUrl) { imgUrl2(imgUrl) {
this.videoForm.showVideoPath = baseurl + imgUrl; this.videoForm.showVideoPath = process.env.VUE_APP_BASE_API + imgUrl;
this.form.posterVideoUrl = imgUrl; this.form.posterVideoUrl = imgUrl;
}, },
/** 查询泉医到家系统海报模块信息(包含咨询简介信息)列表 */ /** 查询泉医到家系统海报模块信息(包含咨询简介信息)列表 */

View File

@ -123,7 +123,6 @@
<script> <script>
import { VueCropper } from "vue-cropper"; import { VueCropper } from "vue-cropper";
import baseurl from "@/api/baseurl.js";
import { import {
updateNurseStationHeads, updateNurseStationHeads,
posts, posts,
@ -173,14 +172,14 @@ export default {
} else if (this.tovideo == "") { } else if (this.tovideo == "") {
this.video.VideoPath = null; this.video.VideoPath = null;
} else { } else {
this.video.VideoPath = baseurl + this.tovideo; this.video.VideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
} }
if (this.img == null) { if (this.img == null) {
this.options.img = null; this.options.img = null;
} else if (this.img == "") { } else if (this.img == "") {
this.options.img = null; this.options.img = null;
} else { } else {
this.options.img = baseurl + this.img; this.options.img = process.env.VUE_APP_BASE_API + this.img;
} }
if (this.types == "posterVideoUrl" || this.types == "itemDirectoryUrl") { if (this.types == "posterVideoUrl" || this.types == "itemDirectoryUrl") {
this.title = "上传视频"; this.title = "上传视频";
@ -204,7 +203,7 @@ export default {
} else if (this.img == "") { } else if (this.img == "") {
this.options.img = null; this.options.img = null;
} else { } else {
this.options.img = baseurl + this.img; this.options.img = process.env.VUE_APP_BASE_API + this.img;
} }
} }
}, },
@ -277,7 +276,7 @@ export default {
this.uploadbtn = false; this.uploadbtn = false;
uploadVideoUrl(formData).then(response => { uploadVideoUrl(formData).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.video.VideoPath = baseurl + response.imgUrl; this.video.VideoPath = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl); this.$emit("imgUrl", response.imgUrl);
this.items.itemDirectoryUrl = response.imgUrl; this.items.itemDirectoryUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items)); this.$emit("item", JSON.stringify(this.items));
@ -296,7 +295,7 @@ export default {
) { ) {
uploadUrl(formData).then(response => { uploadUrl(formData).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.options.img = baseurl + response.imgUrl; this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl); this.$emit("imgUrl", response.imgUrl);
this.openimg = false; this.openimg = false;
} else { } else {
@ -308,7 +307,7 @@ export default {
} else if (this.types == "trainingCategoryPictureUrl") { } else if (this.types == "trainingCategoryPictureUrl") {
uploadTrainingCategoryPicture(formData).then(response => { uploadTrainingCategoryPicture(formData).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.options.img = baseurl + response.imgUrl; this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl); this.$emit("imgUrl", response.imgUrl);
this.openimg = false; this.openimg = false;
} else { } else {
@ -320,7 +319,7 @@ export default {
} else if (this.types == "posterVideoUrl") { } else if (this.types == "posterVideoUrl") {
updatePoserHeads(formData).then(response => { updatePoserHeads(formData).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.video.VideoPath = baseurl + response.imgUrl; this.video.VideoPath = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl); this.$emit("imgUrl", response.imgUrl);
this.openimg = false; this.openimg = false;
} else { } else {
@ -332,7 +331,7 @@ export default {
} else { } else {
updateNurseStationHeads(formData).then(response => { updateNurseStationHeads(formData).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.options.img = baseurl + response.imgUrl; this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl); this.$emit("imgUrl", response.imgUrl);
if (this.types == "attributePitureUrl") { if (this.types == "attributePitureUrl") {
this.items.attributePitureUrl = response.imgUrl; this.items.attributePitureUrl = response.imgUrl;

View File

@ -0,0 +1,305 @@
<template>
<div>
<div class="user-info-head" :class="video.VideoPath ? 'wihi' : ''" @click="editCropper()">
<video
style="width: 208px; height: 208px"
v-bind:src="video.VideoPath"
class="avatar video-avatar"
controls="controls"
>您的浏览器不支持视频播放</video>
<i
class="el-icon-plus avatar-uploader-icon"
style="
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
"
></i>
</div>
<el-dialog
:title="title"
:visible.sync="openimg"
width="950px"
append-to-body
@opened="modalOpened"
@close="closeDialog"
>
<el-row>
<el-col :xs="24" :md="24" :style="{ height: '350px' }">
<div class="avatar-upload-preview">
<video
v-if="openimg"
style="width: 100%; height: 100%"
v-bind:src="videoForm.showVideoPath"
class="avatar video-avatar"
controls="controls"
>您的浏览器不支持视频播放</video>
</div>
</el-col>
</el-row>
<br />
<el-progress
v-if="progressFlag"
:percentage="loadProgress"
style="height:30px;padding-bottom:20px"
></el-progress>
<el-row style="padding-bottom:0px">
<el-col :lg="3" :md="2">
<el-upload
:show-file-list="false"
class="upload-demo"
ref="upload"
:action="uploadurl"
:on-preview="handlePreview"
:auto-upload="false"
:on-change="loadJsonFromFile"
:data="filedata"
:headers="headers"
:on-progress="uploadVideoProcess"
:on-success="handleAvatarSuccess"
>
<el-button slot="trigger" size="small" type="primary" style="float:left">选取文件</el-button>
</el-upload>
</el-col>
<el-col :lg="{ span: 2, offset: 18 }" :md="2">
<el-button v-if="uploadbtn" type="primary" size="small" @click="submitUpload"> </el-button>
<el-button v-else :loading="!uploadbtn" type="primary" size="small">提交中...</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script>
import { VueCropper } from "vue-cropper";
import { uploadVideoUrl } from "@/api/system/stationAvatar.js";
import { getToken } from "@/utils/auth";
export default {
components: { VueCropper },
props: ["img", "type", "item", "tovideo"],
data() {
return {
fileList: [],
loadProgress: 0, //
progressFlag: false, //
uploadbtn: true, //
imageUrl: "",
//
openimg: false,
// cropper
visible: false,
//
title: "上传图片/视频",
filedata: {
type: ""
},
headers: {
Authorization: "Bearer " + getToken() // token
},
options: {
img: null, //
autoCrop: true, //
autoCropWidth: 300, //
autoCropHeight: 300, //
fixedBox: true //
},
previews: {},
items: {},
//
videoForm: {
showVideoPath: null //
},
video: {
VideoPath: null //
},
uploadurl: undefined
};
},
created() {
this.uploadurl =
process.env.VUE_APP_BASE_API + "/system/trainingItem/uploadVideoUrl";
this.uploadbtn = true;
this.filedata.type = this.type;
this.items = this.item;
this.videoForm.showVideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
this.video.VideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
this.title = "上传视频";
},
watch: {
tovideo: {
handler(newimg, oldimg) {
this.uploadbtn = true;
this.videoForm.showVideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
this.video.VideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
}
},
item: {
handler(newimg, oldimg) {
this.uploadbtn = true;
this.items = this.item;
}
},
type: {
handler(newimg, oldimg) {
this.filedata.type = this.type;
}
}
},
methods: {
uploadVideoProcess(event, file, fileList) {
this.progressFlag = true; //
this.loadProgress = parseInt(event.percent); //
if (this.loadProgress >= 100) {
this.loadProgress = 100;
setTimeout(() => {
this.progressFlag = false;
}, 1000); //
}
},
loadJsonFromFile(file, fileList) {
const reader = new FileReader();
this.previews.data = file.raw;
this.videoForm.showVideoPath = URL.createObjectURL(file.raw);
reader.readAsDataURL(file.raw);
reader.onload = () => {
// this.options.img = reader.result;
};
},
submitUpload() {
this.uploadbtn = false;
this.$refs.upload.submit();
},
handlePreview(file) {},
//
editCropper() {
this.openimg = true;
},
//
modalOpened() {
this.visible = true;
},
//
requestUpload() {},
//
rotateLeft() {
this.$refs.cropper.rotateLeft();
},
//
rotateRight() {
this.$refs.cropper.rotateRight();
},
//
changeScale(num) {
num = num || 1;
this.$refs.cropper.changeScale(num);
},
//
beforeUpload(file) {
const reader = new FileReader();
this.previews.data = file;
this.videoForm.showVideoPath = URL.createObjectURL(file);
reader.readAsDataURL(file);
reader.onload = () => {
// this.options.img = reader.result;
};
},
handleAvatarSuccess(res, file) {
this.video.VideoPath = process.env.VUE_APP_BASE_API + res.imgUrl;
this.items.itemDirectoryUrl = res.imgUrl;
this.$emit("item", JSON.stringify(this.items));
this.$modal.msgSuccess("上传视频成功");
this.openimg = false;
this.uploadbtn = true;
},
//
uploadImg() {
this.uploadbtn = true;
let formData = new FormData();
if (this.previews.data) {
formData.append("file", this.previews.data);
formData.append("type", this.filedata.type);
this.$modal.msgSuccess("上传视频中,请耐心等待");
this.uploadbtn = false;
uploadVideoUrl(formData).then(response => {
if (response.code == 200) {
this.video.VideoPath = process.env.VUE_APP_BASE_API + response.imgUrl;
this.items.itemDirectoryUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
this.uploadbtn = true;
});
} else {
this.openimg = false;
}
// this.videoForm.showVideoPath = null;
this.previews.data = null;
},
//
realTime(data) {
this.previews = data;
},
//
closeDialog() {
this.visible = false;
}
}
};
</script>
<style scoped lang="scss">
.title {
position: absolute;
bottom: 5%;
left: 50%;
transform: translate(-50%, 0%);
}
.avatar-upload-preview {
position: absolute;
top: 0%;
left: 50%;
transform: translate(-50%, 0%);
width: 300px;
height: 300px;
border-radius: 0%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
.user-info-head {
position: relative;
display: inline-block;
background: #fafafa;
width: 100px;
height: 100px;
}
.user-info-head:hover:after {
content: "";
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
color: #eee;
background: rgba(0, 0, 0, 0.5);
font-size: 24px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
cursor: pointer;
line-height: 110px;
border-radius: 50%;
}
.wihi {
background-color: #fff;
width: 100px;
height: 100px;
}
.wihi:hover:after {
transform: translate(50%, 50%);
}
</style>

View File

@ -40,16 +40,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -62,8 +54,7 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:trainingItem:add']" v-hasPermi="['system:trainingItem:add']"
>新增</el-button >新增</el-button>
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -74,8 +65,7 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:trainingItem:edit']" v-hasPermi="['system:trainingItem:edit']"
>修改</el-button >修改</el-button>
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -86,8 +76,7 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:trainingItem:remove']" v-hasPermi="['system:trainingItem:remove']"
>删除</el-button >删除</el-button>
>
</el-col> </el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
@ -99,11 +88,8 @@
v-hasPermi="['system:trainingItem:export']" v-hasPermi="['system:trainingItem:export']"
>导出</el-button >导出</el-button
> >
</el-col> --> </el-col>-->
<right-toolbar <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table <el-table
@ -112,45 +98,25 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column <el-table-column label="学习培训课程组名称" align="center" prop="trainingParentName" />
label="学习培训课程组名称" <el-table-column label="培训课程编号" align="center" prop="trainingItemCode" />
align="center" <el-table-column property="trainingItemTitle" label="培训课程名称" align="center" />
prop="trainingParentName"
/>
<el-table-column
label="培训课程编号"
align="center"
prop="trainingItemCode"
/>
<el-table-column
property="trainingItemTitle"
label="培训课程名称"
align="center"
/>
<el-table-column <el-table-column label="培训课程价格" align="center" prop="trainingItemPrice" />
label="培训课程价格" <el-table-column label="培训课程类型" align="center" prop="trainingItemType">
align="center"
prop="trainingItemPrice"
/>
<el-table-column
label="培训课程类型"
align="center"
prop="trainingItemType"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.trainingItemType == "VIDEO_LEARNING" ? "视频学习" : "" }} {{ scope.row.trainingItemType == "VIDEO_LEARNING" ? "视频学习" : "" }}
{{ {{
scope.row.trainingItemType == "GRAPHIC_LEARNING" ? "图文学习" : "" scope.row.trainingItemType == "GRAPHIC_LEARNING" ? "图文学习" : ""
}} }}
{{ scope.row.trainingItemType == "LIVE_COURSES" ? "直播课程" : "" }} {{ scope.row.trainingItemType == "LIVE_COURSES" ? "直播课程" : "" }}
{{ {{
scope.row.trainingItemType == "OFFLINE_TRAINING" ? "线下培训" : "" scope.row.trainingItemType == "OFFLINE_TRAINING" ? "线下培训" : ""
}} }}
{{ {{
scope.row.trainingItemType == "LEARNING_ITEM_GROUP" scope.row.trainingItemType == "LEARNING_ITEM_GROUP"
? "学习培训课程组" ? "学习培训课程组"
: "" : ""
}} }}
</template> </template>
</el-table-column> </el-table-column>
@ -162,8 +128,7 @@
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
@change="uptrainingShelfFlag(scope.row)" @change="uptrainingShelfFlag(scope.row)"
> ></el-switch>
</el-switch>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
@ -191,17 +156,9 @@
prop="trainingItemEndTime" prop="trainingItemEndTime"
width="180" width="180"
> >
</el-table-column> --> </el-table-column>-->
<el-table-column <el-table-column label="培训课程排序" align="center" prop="trainingItemSort" />
label="培训课程排序" <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
align="center"
prop="trainingItemSort"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -209,16 +166,14 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:trainingItem:edit']" v-hasPermi="['system:trainingItem:edit']"
>修改</el-button >修改</el-button>
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:trainingItem:remove']" v-hasPermi="['system:trainingItem:remove']"
>删除</el-button >删除</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -245,22 +200,14 @@
label-width="80px" label-width="80px"
:inline="true" :inline="true"
> >
<el-form-item <el-form-item label="分类编码" prop="trainingItemCode" label-width="120">
label="分类编码"
prop="trainingItemCode"
label-width="120"
>
<el-input <el-input
v-model="trainingParentqueryParams.trainingItemCode" v-model="trainingParentqueryParams.trainingItemCode"
placeholder="请输入分类编码" placeholder="请输入分类编码"
clearable clearable
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="培训课程组名称" prop="trainingParentName" label-width="120">
label="培训课程组名称"
prop="trainingParentName"
label-width="120"
>
<el-input <el-input
v-model="trainingParentqueryParams.trainingParentName" v-model="trainingParentqueryParams.trainingParentName"
placeholder="请输入培训课程组名称" placeholder="请输入培训课程组名称"
@ -268,16 +215,8 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="trainingParentinfo">搜索</el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuerylist">重置</el-button>
icon="el-icon-search"
size="mini"
@click="trainingParentinfo"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuerylist"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -308,20 +247,9 @@
label="培训课程组名称" label="培训课程组名称"
align="center" align="center"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> ></el-table-column>
</el-table-column> <el-table-column property="trainingItemCode" label="培训分类编码" align="center"></el-table-column>
<el-table-column <el-table-column property="trainingItemPrice" label="价格" align="center"></el-table-column>
property="trainingItemCode"
label="培训分类编码"
align="center"
>
</el-table-column>
<el-table-column
property="trainingItemPrice"
label="价格"
align="center"
>
</el-table-column>
<!-- <el-table-column <!-- <el-table-column
property="trainingItemType" property="trainingItemType"
@ -346,7 +274,7 @@
: "" : ""
}} }}
</template> </template>
</el-table-column> --> </el-table-column>-->
</el-table> </el-table>
<pagination <pagination
v-show="total3 > 0" v-show="total3 > 0"
@ -453,7 +381,7 @@
:limit.sync="trainingCategoryqueryParams.pageSize" :limit.sync="trainingCategoryqueryParams.pageSize"
@pagination="info" @pagination="info"
/> />
</el-dialog> --> </el-dialog>-->
<!-- 添加或修改学习培训课程信息对话框 --> <!-- 添加或修改学习培训课程信息对话框 -->
<el-dialog <el-dialog
:title="!isEditFlag ? '添加学习培训课程信息' : '修改学习培训课程信息'" :title="!isEditFlag ? '添加学习培训课程信息' : '修改学习培训课程信息'"
@ -461,13 +389,7 @@
width="1300px" width="1300px"
append-to-body append-to-body
> >
<el-form <el-form ref="form" :model="form" :rules="rules" label-width="140px" :inline="true">
ref="form"
:model="form"
:rules="rules"
label-width="140px"
:inline="true"
>
<el-form-item label="培训课程名称" prop="trainingItemTitle"> <el-form-item label="培训课程名称" prop="trainingItemTitle">
<el-input <el-input
style="width: 250px" style="width: 250px"
@ -501,7 +423,7 @@
" "
> >
<el-button <el-button
type="" type
v-if="form.trainingParentName == '请选择所属培训课程组'" v-if="form.trainingParentName == '请选择所属培训课程组'"
@click="trainingParentitem()" @click="trainingParentitem()"
style=" style="
@ -511,11 +433,10 @@
color: #c0c4cc; color: #c0c4cc;
overflow: hidden; overflow: hidden;
" "
>{{ form.trainingParentName }}</el-button >{{ form.trainingParentName }}</el-button>
>
<el-button <el-button
@click="trainingParentitem()" @click="trainingParentitem()"
type="" type
v-else v-else
style=" style="
width: 250px; width: 250px;
@ -524,8 +445,7 @@
padding-left: -10px; padding-left: -10px;
overflow: hidden; overflow: hidden;
" "
>{{ form.trainingParentName }}</el-button >{{ form.trainingParentName }}</el-button>
>
</el-form-item> </el-form-item>
<!-- <el-form-item <!-- <el-form-item
label="所属培训课程分类" label="所属培训课程分类"
@ -563,7 +483,7 @@
" "
>{{ form.trainingCategoryName }}</el-button >{{ form.trainingCategoryName }}</el-button
> >
</el-form-item> --> </el-form-item>-->
<el-form-item label="培训课程价格" prop="trainingItemPrice"> <el-form-item label="培训课程价格" prop="trainingItemPrice">
<el-input <el-input
@ -577,12 +497,7 @@
</el-form-item> </el-form-item>
<el-form-item label="是否可以购买" prop="buyFlag"> <el-form-item label="是否可以购买" prop="buyFlag">
<el-select <el-select v-model="form.buyFlag" placeholder="请选择" clearable style="width: 250px">
v-model="form.buyFlag"
placeholder="请选择"
clearable
style="width: 250px"
>
<el-option <el-option
v-for="item in option" v-for="item in option"
:key="item.value" :key="item.value"
@ -612,7 +527,7 @@
v-model="form.trainingItemCoverUrl" v-model="form.trainingItemCoverUrl"
type="textarea" type="textarea"
placeholder="请输入内容" placeholder="请输入内容"
/> --> />-->
</el-form-item> </el-form-item>
<el-form-item label="培训课程海报图片" prop="trainingItemPosterUrl"> <el-form-item label="培训课程海报图片" prop="trainingItemPosterUrl">
<stationAcatar <stationAcatar
@ -625,7 +540,7 @@
v-model="form.trainingItemPosterUrl" v-model="form.trainingItemPosterUrl"
type="textarea" type="textarea"
placeholder="请输入内容" placeholder="请输入内容"
/> --> />-->
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -649,7 +564,7 @@
style="width: 250px" style="width: 250px"
v-model="form.trainingItemDetails" v-model="form.trainingItemDetails"
placeholder="请输入培训课程详情" placeholder="请输入培训课程详情"
/> --> />-->
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -688,8 +603,7 @@
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择培训课程日期" placeholder="请选择培训课程日期"
> ></el-date-picker>
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="培训课程开始时间" label="培训课程开始时间"
@ -706,8 +620,7 @@
selectableRange: '00:00:00 - 23:59:59', selectableRange: '00:00:00 - 23:59:59',
}" }"
placeholder="任意时间点" placeholder="任意时间点"
> ></el-time-picker>
</el-time-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="培训课程结束时间" label="培训课程结束时间"
@ -725,29 +638,21 @@
selectableRange: '00:00:00 - 23:59:59', selectableRange: '00:00:00 - 23:59:59',
}" }"
placeholder="任意时间点" placeholder="任意时间点"
> ></el-time-picker>
</el-time-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="培训课程地址" label="培训课程地址"
prop="trainingItemAddress" prop="trainingItemAddress"
v-if="form.trainingItemType == 'OFFLINE_TRAINING'" v-if="form.trainingItemType == 'OFFLINE_TRAINING'"
> >
<el-input <el-input v-model="form.trainingItemAddress" placeholder="请输入培训课程地址" />
v-model="form.trainingItemAddress"
placeholder="请输入培训课程地址"
/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="报名须知" label="报名须知"
prop="trainingItemNotes" prop="trainingItemNotes"
v-if="form.trainingItemType == 'OFFLINE_TRAINING'" v-if="form.trainingItemType == 'OFFLINE_TRAINING'"
> >
<el-input <el-input style="width: 250px" v-model="form.trainingItemNotes" placeholder="请输入报名须知" />
style="width: 250px"
v-model="form.trainingItemNotes"
placeholder="请输入报名须知"
/>
</el-form-item> </el-form-item>
<el-table <el-table
v-if="form.trainingItemType == 'VIDEO_LEARNING'" v-if="form.trainingItemType == 'VIDEO_LEARNING'"
@ -771,8 +676,7 @@
}, },
]" ]"
> >
<stationAcatar <trainingAvatar
@imgUrl="imgUrl4"
@item="itemDirectoryUrl" @item="itemDirectoryUrl"
:tovideo="scope.row.itemDirectoryUrl" :tovideo="scope.row.itemDirectoryUrl"
:type="'itemDirectoryUrl'" :type="'itemDirectoryUrl'"
@ -868,15 +772,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="addPictureUrl" <el-button size="mini" type="text" @click="addPictureUrl">新增</el-button>
>新增</el-button <el-button size="mini" type="text" @click="delPictureUrl(scope.row)">删除</el-button>
>
<el-button
size="mini"
type="text"
@click="delPictureUrl(scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -898,15 +795,15 @@ import {
delTrainingItem, delTrainingItem,
addTrainingItem, addTrainingItem,
updateTrainingItem, updateTrainingItem,
updateTrainingShelfFlag, updateTrainingShelfFlag
} from "@/api/system/trainingItem"; } from "@/api/system/trainingItem";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import trainingAvatar from "../trainingAvatar/index.vue";
import editor from "@/components/Editor"; import editor from "@/components/Editor";
import baseurl from "@/api/baseurl.js";
import { updatePicture } from "@/api/system/station"; import { updatePicture } from "@/api/system/station";
export default { export default {
name: "TrainingItem", name: "TrainingItem",
components: { stationAcatar, editor }, components: { stationAcatar, editor, trainingAvatar },
data() { data() {
return { return {
@ -920,38 +817,38 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
trainingItemCode: "", trainingItemCode: "",
trainingParentName: "", trainingParentName: ""
}, },
trainingCategoryqueryParams: { trainingCategoryqueryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
trainingCategoryCode: "", trainingCategoryCode: "",
trainingCategoryName: "", trainingCategoryName: ""
}, },
option: [ option: [
{ {
value: 0, value: 0,
label: "是", label: "是"
}, },
{ {
value: 1, value: 1,
label: "否", label: "否"
}, }
], ],
value: "", value: "",
options: [ options: [
{ {
value: "GRAPHIC_LEARNING", value: "GRAPHIC_LEARNING",
label: "图文学习", label: "图文学习"
}, },
{ {
value: "LEARNING_ITEM_GROUP", value: "LEARNING_ITEM_GROUP",
label: "学习培训课程组", label: "学习培训课程组"
}, },
{ {
value: "VIDEO_LEARNING", value: "VIDEO_LEARNING",
label: "视频学习", label: "视频学习"
}, }
// { // {
// value: "LIVE_COURSES", // value: "LIVE_COURSES",
// label: "", // label: "",
@ -997,7 +894,7 @@ export default {
trainingItemEndTime: null, trainingItemEndTime: null,
trainingItemAddress: null, trainingItemAddress: null,
trainingItemNotes: null, trainingItemNotes: null,
trainingItemSort: null, trainingItemSort: null
}, },
// //
form: { form: {
@ -1007,9 +904,9 @@ export default {
itemDirectoryTitle: null, itemDirectoryTitle: null,
itemDirectoryUrl: null, itemDirectoryUrl: null,
itemDirectoryIntroduce: null, itemDirectoryIntroduce: null,
itemDirectorySort: null, itemDirectorySort: null
}, }
], ]
}, },
imgtwo: "", imgtwo: "",
imgone: "", imgone: "",
@ -1026,7 +923,7 @@ export default {
// { required: true, message: "", trigger: "blur" }, // { required: true, message: "", trigger: "blur" },
// ], // ],
trainingItemTitle: [ trainingItemTitle: [
{ required: true, message: "请输入培训课程名称", trigger: "blur" }, { required: true, message: "请输入培训课程名称", trigger: "blur" }
], ],
// trainingItemPrice: [ // trainingItemPrice: [
// { required: true, message: "", trigger: "blur" }, // { required: true, message: "", trigger: "blur" },
@ -1046,38 +943,38 @@ export default {
// }, // },
// ], // ],
trainingItemType: [ trainingItemType: [
{ required: true, message: "请选择培训课程类型", trigger: "blur" }, { required: true, message: "请选择培训课程类型", trigger: "blur" }
], ],
trainingItemDetails: [ trainingItemDetails: [
{ required: true, message: "请输入培训课程详情", trigger: "blur" }, { required: true, message: "请输入培训课程详情", trigger: "blur" }
], ],
trainingItemContent: [ trainingItemContent: [
{ required: true, message: "请输入培训课程内容", trigger: "blur" }, { required: true, message: "请输入培训课程内容", trigger: "blur" }
], ],
trainingItemDate: [ trainingItemDate: [
{ required: true, message: "请输入培训课程日期", trigger: "blur" }, { required: true, message: "请输入培训课程日期", trigger: "blur" }
], ],
trainingItemStartTime: [ trainingItemStartTime: [
{ {
required: true, required: true,
message: "请输入培训课程开始时间", message: "请输入培训课程开始时间",
trigger: "blur", trigger: "blur"
}, }
], ],
trainingItemEndTime: [ trainingItemEndTime: [
{ {
required: true, required: true,
message: "请输入培训课程结束时间", message: "请输入培训课程结束时间",
trigger: "blur", trigger: "blur"
}, }
], ],
trainingItemAddress: [ trainingItemAddress: [
{ required: true, message: "请输入培训课程地址", trigger: "blur" }, { required: true, message: "请输入培训课程地址", trigger: "blur" }
], ]
// trainingItemSort: [ // trainingItemSort: [
// { required: true, message: "", trigger: "blur" }, // { required: true, message: "", trigger: "blur" },
// ], // ],
}, }
}; };
}, },
created() { created() {
@ -1112,7 +1009,7 @@ export default {
itemDirectoryUrl: null, itemDirectoryUrl: null,
itemDirectoryIntroduce: null, itemDirectoryIntroduce: null,
itemDirectorySort: null, itemDirectorySort: null,
idd: this.idd, idd: this.idd
}; };
if (this.form.trainingItemDirectoryList.length >= 5) { if (this.form.trainingItemDirectoryList.length >= 5) {
this.$message.error("最多新增5条"); this.$message.error("最多新增5条");
@ -1127,19 +1024,17 @@ export default {
if (this.form.trainingItemDirectoryList.length == 1) { if (this.form.trainingItemDirectoryList.length == 1) {
this.$message.error("最后一条不可删除"); this.$message.error("最后一条不可删除");
} else { } else {
this.form.trainingItemDirectoryList = this.form.trainingItemDirectoryList = this.form.trainingItemDirectoryList.filter(
this.form.trainingItemDirectoryList.filter( e => e.idd != item.idd
(e) => e.idd != item.idd );
);
} }
} else if (!item.idd && item.trainingItemDirectoryId) { } else if (!item.idd && item.trainingItemDirectoryId) {
if (this.form.trainingItemDirectoryList.length == 1) { if (this.form.trainingItemDirectoryList.length == 1) {
this.$message.error("最后一条不可删除"); this.$message.error("最后一条不可删除");
} else { } else {
this.form.trainingItemDirectoryList = this.form.trainingItemDirectoryList = this.form.trainingItemDirectoryList.filter(
this.form.trainingItemDirectoryList.filter( e => e.trainingItemDirectoryId != item.trainingItemDirectoryId
(e) => e.trainingItemDirectoryId != item.trainingItemDirectoryId );
);
} }
} }
}, },
@ -1148,20 +1043,19 @@ export default {
itemDirectoryUrl(item) { itemDirectoryUrl(item) {
let items = JSON.parse(item); let items = JSON.parse(item);
if (items.idd && !items.trainingItemDirectoryId) { if (items.idd && !items.trainingItemDirectoryId) {
this.form.trainingItemDirectoryList.forEach((e) => { this.form.trainingItemDirectoryList.forEach(e => {
if (e.idd == items.idd) { if (e.idd == items.idd) {
e.itemDirectoryUrl = items.itemDirectoryUrl; e.itemDirectoryUrl = items.itemDirectoryUrl;
} }
}); });
} else if (!items.idd && items.attributeDetailsId) { } else if (!items.idd && items.attributeDetailsId) {
this.form.trainingItemDirectoryList.forEach((e) => { this.form.trainingItemDirectoryList.forEach(e => {
if (e.attributeDetailsId == items.attributeDetailsId) { if (e.attributeDetailsId == items.attributeDetailsId) {
e.itemDirectoryUrl = items.itemDirectoryUrl; e.itemDirectoryUrl = items.itemDirectoryUrl;
} }
}); });
} }
}, },
imgUrl4(imgUrl) {},
imgs(item) { imgs(item) {
console.log(item); console.log(item);
this.imgsurl.pictureUrlList.push(item); this.imgsurl.pictureUrlList.push(item);
@ -1182,7 +1076,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
trainingCategoryCode: "", trainingCategoryCode: "",
trainingParentName: "", trainingParentName: ""
}; };
this.trainingParentinfo(); this.trainingParentinfo();
}, },
@ -1226,7 +1120,7 @@ export default {
// //
trainingParentinfo() { trainingParentinfo() {
this.loading = true; this.loading = true;
selectTrainingParent(this.trainingParentqueryParams).then((response) => { selectTrainingParent(this.trainingParentqueryParams).then(response => {
console.log(response); console.log(response);
this.trainingParentlist = response.rows; this.trainingParentlist = response.rows;
this.total3 = response.total; this.total3 = response.total;
@ -1250,15 +1144,15 @@ export default {
if (row.trainingShelfFlag == false) { if (row.trainingShelfFlag == false) {
var obj = { var obj = {
id: row.id, id: row.id,
trainingShelfFlag: 1, trainingShelfFlag: 1
}; };
} else if (row.trainingShelfFlag == true) { } else if (row.trainingShelfFlag == true) {
var obj = { var obj = {
id: row.id, id: row.id,
trainingShelfFlag: 0, trainingShelfFlag: 0
}; };
} }
updateTrainingShelfFlag(obj).then((res) => { updateTrainingShelfFlag(obj).then(res => {
if (obj.trainingShelfFlag == 0) { if (obj.trainingShelfFlag == 0) {
this.$modal.msgSuccess("已修改上架状态为上架"); this.$modal.msgSuccess("已修改上架状态为上架");
} else { } else {
@ -1270,9 +1164,9 @@ export default {
/** 查询学习培训课程信息列表 */ /** 查询学习培训课程信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listTrainingItem(this.queryParams).then((response) => { listTrainingItem(this.queryParams).then(response => {
this.trainingItemList = response.rows; this.trainingItemList = response.rows;
response.rows.forEach((e) => { response.rows.forEach(e => {
if (e.trainingShelfFlag == 0) { if (e.trainingShelfFlag == 0) {
e.trainingShelfFlag = true; e.trainingShelfFlag = true;
} else if (e.trainingShelfFlag == 1) { } else if (e.trainingShelfFlag == 1) {
@ -1293,10 +1187,10 @@ export default {
obj.pictureUrlList.push(this.form.trainingItemPosterUrl); obj.pictureUrlList.push(this.form.trainingItemPosterUrl);
} }
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {}); updatePicture(obj).then(res => {});
} }
if (this.imgsurl.pictureUrlList.length > 0) { if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {}); updatePicture(this.imgsurl).then(res => {});
} }
this.imgsurl = { pictureUrlList: [] }; this.imgsurl = { pictureUrlList: [] };
@ -1313,8 +1207,8 @@ export default {
itemDirectoryUrl: null, itemDirectoryUrl: null,
itemDirectoryIntroduce: null, itemDirectoryIntroduce: null,
itemDirectorySort: null, itemDirectorySort: null,
idd: this.idd, idd: this.idd
}, }
], ],
trainingParentId: "", trainingParentId: "",
id: null, id: null,
@ -1340,7 +1234,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -1357,7 +1251,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id); this.ids = selection.map(item => item.id);
this.single = selection.length !== 1; this.single = selection.length !== 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -1371,9 +1265,9 @@ export default {
itemDirectoryTitle: null, itemDirectoryTitle: null,
itemDirectoryUrl: null, itemDirectoryUrl: null,
itemDirectoryIntroduce: null, itemDirectoryIntroduce: null,
itemDirectorySort: null, itemDirectorySort: null
}, }
], ]
}; };
this.reset(); this.reset();
this.open = true; this.open = true;
@ -1384,13 +1278,13 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
getTrainingItem(id).then((response) => { getTrainingItem(id).then(response => {
var obj = { var obj = {
itemDirectoryName: null, itemDirectoryName: null,
itemDirectoryTitle: null, itemDirectoryTitle: null,
itemDirectoryUrl: null, itemDirectoryUrl: null,
itemDirectoryIntroduce: null, itemDirectoryIntroduce: null,
itemDirectorySort: null, itemDirectorySort: null
}; };
if (response.data.trainingItemDirectoryList.length == 0) { if (response.data.trainingItemDirectoryList.length == 0) {
response.data.trainingItemDirectoryList.push(obj); response.data.trainingItemDirectoryList.push(obj);
@ -1413,11 +1307,10 @@ export default {
if (!this.form.trainingItemSort) { if (!this.form.trainingItemSort) {
this.form.trainingItemSort = null; this.form.trainingItemSort = null;
} }
this.$refs["form"].validate((valid) => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.trainingItemStartTime) { if (this.form.trainingItemStartTime) {
this.form.trainingItemStartTimeStr = this.form.trainingItemStartTimeStr = this.form.trainingItemStartTime;
this.form.trainingItemStartTime;
} else { } else {
this.form.trainingItemStartTimeStr = "00:00:00"; this.form.trainingItemStartTimeStr = "00:00:00";
} }
@ -1428,7 +1321,7 @@ export default {
this.form.trainingItemDirectoryList = []; this.form.trainingItemDirectoryList = [];
} }
if (this.form.trainingItemId != null) { if (this.form.trainingItemId != null) {
updateTrainingItem(this.form).then((response) => { updateTrainingItem(this.form).then(response => {
var obj = { pictureUrlList: [] }; var obj = { pictureUrlList: [] };
if (this.imgone != this.form.trainingItemCoverUrl) { if (this.imgone != this.form.trainingItemCoverUrl) {
obj.pictureUrlList.push(this.imgone); obj.pictureUrlList.push(this.imgone);
@ -1438,20 +1331,20 @@ export default {
} }
this.imgsurl = { pictureUrlList: [] }; this.imgsurl = { pictureUrlList: [] };
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {}); updatePicture(obj).then(res => {});
} }
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
} }
}); });
} else { } else {
addTrainingItem(this.form).then((response) => { addTrainingItem(this.form).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
} }
}); });
} }
@ -1468,7 +1361,7 @@ export default {
.confirm( .confirm(
'是否确认删除培训课程名称为"' + trainingItemTitles + '"的数据项?' '是否确认删除培训课程名称为"' + trainingItemTitles + '"的数据项?'
) )
.then(function () { .then(function() {
return delTrainingItem(ids); return delTrainingItem(ids);
}) })
.then(() => { .then(() => {
@ -1482,12 +1375,12 @@ export default {
this.download( this.download(
"system/trainingItem/export", "system/trainingItem/export",
{ {
...this.queryParams, ...this.queryParams
}, },
`trainingItem_${new Date().getTime()}.xlsx` `trainingItem_${new Date().getTime()}.xlsx`
); );
}, }
}, }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -9,11 +9,7 @@
label-width="100px" label-width="100px"
> >
<el-form-item label="所属护理站" prop="nurseStationName"> <el-form-item label="所属护理站" prop="nurseStationName">
<el-select <el-select v-model="queryParams.nurseStationId" placeholder="请选择护理站" @change="handleQuery">
v-model="queryParams.nurseStationId"
placeholder="请选择护理站"
@change="handleQuery"
>
<el-option <el-option
v-for="item in handstationlist" v-for="item in handstationlist"
:key="item.id" :key="item.id"
@ -45,13 +41,9 @@
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> --> </el-form-item>-->
<el-form-item label="订单状态" prop="trainingOrderStatus"> <el-form-item label="订单状态" prop="trainingOrderStatus">
<el-select <el-select v-model="queryParams.trainingOrderStatus" placeholder="请选择订单状态" clearable>
v-model="queryParams.trainingOrderStatus"
placeholder="请选择订单状态"
clearable
>
<el-option <el-option
v-for="item in trainingOrderStatusoptions" v-for="item in trainingOrderStatusoptions"
:key="item.value" :key="item.value"
@ -62,24 +54,13 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<right-toolbar <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table <el-table
@ -88,100 +69,47 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
] ]
<el-table-column <el-table-column label="所属护理站" align="center" prop="nurseStationName" />
label="所属护理站" <el-table-column label="护理员姓名" align="center" prop="nursePersonName" />
align="center"
prop="nurseStationName"
/>
<el-table-column
label="护理员姓名"
align="center"
prop="nursePersonName"
/>
<el-table-column label="订单编号" align="center" prop="trainingOrderNo" /> <el-table-column label="订单编号" align="center" prop="trainingOrderNo" />
<el-table-column <el-table-column property="trainingItemTitle" label="培训课程名称" align="center" />
property="trainingItemTitle" <el-table-column label="订单状态" align="center" prop="trainingOrderStatus">
label="培训课程名称"
align="center"
/>
<el-table-column
label="订单状态"
align="center"
prop="trainingOrderStatus"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.trainingOrderStatus == 'WAIT_PAY'" <el-button v-if="scope.row.trainingOrderStatus == 'WAIT_PAY'">待付款</el-button>
>待付款</el-button <el-button type="primary" v-if="scope.row.trainingOrderStatus == 'PAY'">已付款</el-button>
> <el-button type="warning" v-if="scope.row.trainingOrderStatus == 'WAIT_REFUND'">退款中</el-button>
<el-button
type="primary"
v-if="scope.row.trainingOrderStatus == 'PAY'"
>已付款</el-button
>
<el-button
type="warning"
v-if="scope.row.trainingOrderStatus == 'WAIT_REFUND'"
>退款中</el-button
>
<el-button <el-button type="danger" v-if="scope.row.trainingOrderStatus == 'CANCEL'">已取消</el-button>
type="danger" <el-button type="success" v-if="scope.row.trainingOrderStatus == 'REFUNDED'">已退款</el-button>
v-if="scope.row.trainingOrderStatus == 'CANCEL'"
>已取消</el-button
>
<el-button
type="success"
v-if="scope.row.trainingOrderStatus == 'REFUNDED'"
>已退款</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="订单金额" align="center" prop="trainingOrderAmount" />
label="订单金额" <el-table-column label="下单方式" align="center" prop="trainingOrderChannel">
align="center"
prop="trainingOrderAmount"
/>
<el-table-column
label="下单方式"
align="center"
prop="trainingOrderChannel"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.trainingOrderChannel == "MOBILE_APP" ? "手机App" : "" }} {{ scope.row.trainingOrderChannel == "MOBILE_APP" ? "手机App" : "" }}
{{ {{
scope.row.trainingOrderChannel == "WECHAT_APPLET" scope.row.trainingOrderChannel == "WECHAT_APPLET"
? "微信小程序" ? "微信小程序"
: "" : ""
}} }}
{{ {{
scope.row.trainingOrderChannel == "ALI_PAY_APPLET" scope.row.trainingOrderChannel == "ALI_PAY_APPLET"
? "支付宝小程序" ? "支付宝小程序"
: "" : ""
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="下单时间" align="center" prop="trainingOrderTime" width="180"></el-table-column>
label="下单时间"
align="center"
prop="trainingOrderTime"
width="180"
>
</el-table-column>
<!-- <el-table-column label="备注信息" align="center" prop="remark" /> --> <!-- <el-table-column label="备注信息" align="center" prop="remark" /> -->
<el-table-column <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-zoom-in" icon="el-icon-zoom-in"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>查看</el-button >查看</el-button>
>
<el-button <el-button
size="mini" size="mini"
@ -189,8 +117,7 @@
icon="el-icon-error" icon="el-icon-error"
@click="cencel(scope.row)" @click="cencel(scope.row)"
v-if="scope.row.trainingOrderStatus == 'PAY'" v-if="scope.row.trainingOrderStatus == 'PAY'"
>退款</el-button >退款</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -203,12 +130,7 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 退款弹框 --> <!-- 退款弹框 -->
<el-dialog <el-dialog title="退款" :visible.sync="innerrefund" append-to-body width="500px">
title="退款"
:visible.sync="innerrefund"
append-to-body
width="500px"
>
<el-form :inline="true" :rules="rules" label-width="120px"> <el-form :inline="true" :rules="rules" label-width="120px">
<el-form-item label="订单编号" prop="trainingOrderNo"> <el-form-item label="订单编号" prop="trainingOrderNo">
<el-input <el-input
@ -261,7 +183,7 @@
:rows="5" :rows="5"
disabled disabled
/> />
</el-form-item> --> </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cencelbtn"> </el-button> <el-button @click="cencelbtn"> </el-button>
@ -269,19 +191,8 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 查看学习培训订单主对话框 --> <!-- 查看学习培训订单主对话框 -->
<el-dialog <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
:title="title" <el-form ref="form" :model="form" :rules="rules" label-width="100px" :inline="true">
:visible.sync="open"
width="1200px"
append-to-body
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="100px"
:inline="true"
>
<el-form-item label="护理员姓名" prop="nursePersonName"> <el-form-item label="护理员姓名" prop="nursePersonName">
<div class="text">{{ form.nursePersonName }}</div> <div class="text">{{ form.nursePersonName }}</div>
</el-form-item> </el-form-item>
@ -304,71 +215,48 @@
v-loading="loading" v-loading="loading"
style="margin: 10px 0 20px 0; padding-bottom: 20px" style="margin: 10px 0 20px 0; padding-bottom: 20px"
> >
<el-table-column <el-table-column prop="trainingItemTitle" label="培训课程名称" align="center"></el-table-column>
prop="trainingItemTitle" <el-table-column prop="trainingItemType" label="课程类型" align="center">
label="培训课程名称"
align="center"
></el-table-column>
<el-table-column
prop="trainingItemType"
label="课程类型"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
scope.row.trainingItemType == "VIDEO_LEARNING" ? "视频学习" : "" scope.row.trainingItemType == "VIDEO_LEARNING" ? "视频学习" : ""
}} }}
{{ {{
scope.row.trainingItemType == "GRAPHIC_LEARNING" scope.row.trainingItemType == "GRAPHIC_LEARNING"
? "图文学习" ? "图文学习"
: "" : ""
}} }}
{{ {{
scope.row.trainingItemType == "LIVE_COURSES" ? "直播课程" : "" scope.row.trainingItemType == "LIVE_COURSES" ? "直播课程" : ""
}} }}
{{ {{
scope.row.trainingItemType == "OFFLINE_TRAINING" scope.row.trainingItemType == "OFFLINE_TRAINING"
? "线下培训" ? "线下培训"
: "" : ""
}} }}
{{ {{
scope.row.trainingItemType == "LEARNING_ITEM_GROUP" scope.row.trainingItemType == "LEARNING_ITEM_GROUP"
? "学习培训课程组" ? "学习培训课程组"
: "" : ""
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-zoom-in" icon="el-icon-zoom-in"
@click="handlelook(scope.row)" @click="handlelook(scope.row)"
>查看</el-button >查看</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form> </el-form>
</el-dialog> </el-dialog>
<!-- 查看图文 --> <!-- 查看图文 -->
<el-dialog <el-dialog title="查看图文" :visible.sync="innerrefundvideo" append-to-body width="1000px">
title="查看图文" <el-form :inline="true" :rules="rules" label-width="130px" :model="formlist">
:visible.sync="innerrefundvideo"
append-to-body
width="1000px"
>
<el-form
:inline="true"
:rules="rules"
label-width="130px"
:model="formlist"
>
<el-form-item <el-form-item
label="培训课程详情" label="培训课程详情"
prop="trainingItemDetails" prop="trainingItemDetails"
@ -405,11 +293,7 @@
<img class="img" :src="baseurl + formlist.trainingItemCoverUrl" alt /> <img class="img" :src="baseurl + formlist.trainingItemCoverUrl" alt />
</el-form-item> </el-form-item>
<el-form-item label="培训课程海报图片" prop="trainingItemPosterUrl"> <el-form-item label="培训课程海报图片" prop="trainingItemPosterUrl">
<img <img class="img" :src="baseurl + formlist.trainingItemPosterUrl" alt />
class="img"
:src="baseurl + formlist.trainingItemPosterUrl"
alt
/>
</el-form-item> </el-form-item>
<el-table <el-table
ref="list" ref="list"
@ -420,27 +304,17 @@
> >
<el-table-column label="章节视频" align="center" width="300"> <el-table-column label="章节视频" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<video <video class="img" :src="baseurl + scope.row.itemDirectoryUrl" controls="controls"></video>
class="img"
:src="baseurl + scope.row.itemDirectoryUrl"
controls="controls"
></video>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="章节名称" align="center"> <el-table-column label="章节名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input v-model="scope.row.itemDirectoryName" placeholder="请输入章节名称"></el-input>
v-model="scope.row.itemDirectoryName"
placeholder="请输入章节名称"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="章节标题" align="center"> <el-table-column label="章节标题" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input v-model="scope.row.itemDirectoryTitle" placeholder="请输入章节标题"></el-input>
v-model="scope.row.itemDirectoryTitle"
placeholder="请输入章节标题"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -458,9 +332,8 @@ import {
delTrainingOrder, delTrainingOrder,
xylWeChatRefundNotify, xylWeChatRefundNotify,
addTrainingOrder, addTrainingOrder,
updateTrainingOrder, updateTrainingOrder
} from "@/api/system/trainingOrder"; } from "@/api/system/trainingOrder";
import baseurl from "@/api/baseurl.js";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import editor from "@/components/Editor"; import editor from "@/components/Editor";
import { getListByUser } from "@/api/system/userlist.js"; import { getListByUser } from "@/api/system/userlist.js";
@ -469,28 +342,28 @@ export default {
components: { stationAcatar, editor }, components: { stationAcatar, editor },
data() { data() {
return { return {
baseurl: null, baseurl: process.env.VUE_APP_BASE_API,
trainingOrderStatusoptions: [ trainingOrderStatusoptions: [
{ {
value: "WAIT_PAY", value: "WAIT_PAY",
label: "待付款", label: "待付款"
}, },
{ {
value: "PAY", value: "PAY",
label: "已付款", label: "已付款"
}, },
{ {
value: "WAIT_REFUND", value: "WAIT_REFUND",
label: "退款中", label: "退款中"
}, },
{ {
value: "REFUNDED", value: "REFUNDED",
label: "已退款", label: "已退款"
}, },
{ {
value: "CANCEL", value: "CANCEL",
label: "已取消", label: "已取消"
}, }
], ],
nurseStationshow: false, nurseStationshow: false,
@ -503,46 +376,46 @@ export default {
trainingItemTypeoptions: [ trainingItemTypeoptions: [
{ {
value: "GRAPHIC_LEARNING", value: "GRAPHIC_LEARNING",
label: "图文学习", label: "图文学习"
}, },
{ {
value: "LEARNING_ITEM_GROUP", value: "LEARNING_ITEM_GROUP",
label: "学习培训项目组", label: "学习培训项目组"
}, },
{ {
value: "VIDEO_LEARNING", value: "VIDEO_LEARNING",
label: "视频学习", label: "视频学习"
}, }
], ],
// //
ids: [], ids: [],
optiondeflag: [ optiondeflag: [
{ {
value: 0, value: 0,
label: "否", label: "否"
}, },
{ {
value: 1, value: 1,
label: "是", label: "是"
}, }
], ],
options: [ options: [
{ {
value: "MOBILE_APP", value: "MOBILE_APP",
label: "手机App", label: "手机App"
}, },
{ {
value: "WECHAT_APPLET", value: "WECHAT_APPLET",
label: "微信小程序", label: "微信小程序"
}, },
{ {
value: "ALI_PAY_APPLET", value: "ALI_PAY_APPLET",
label: "支付宝小程序", label: "支付宝小程序"
}, }
], ],
getListByUserquery: { getListByUserquery: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10
}, },
handstationlist: [], //list handstationlist: [], //list
// //
@ -572,7 +445,7 @@ export default {
trainingOrderStatus: null, trainingOrderStatus: null,
trainingOrderAmount: null, trainingOrderAmount: null,
trainingOrderChannel: null, trainingOrderChannel: null,
trainingOrderTime: null, trainingOrderTime: null
}, },
// //
form: {}, form: {},
@ -580,14 +453,13 @@ export default {
nurseStationlist: [], nurseStationlist: [],
trainingOrderDetailsList: [], trainingOrderDetailsList: [],
// //
rules: {}, rules: {}
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.infos(); this.infos();
this.info(); this.info();
this.baseurl = baseurl;
}, },
methods: { methods: {
// //
@ -615,13 +487,13 @@ export default {
let items = JSON.parse(item); let items = JSON.parse(item);
console.log(items); console.log(items);
if (items.idd && !items.trainingItemDirectoryId) { if (items.idd && !items.trainingItemDirectoryId) {
this.form.trainingItemDirectoryList.forEach((e) => { this.form.trainingItemDirectoryList.forEach(e => {
if (e.idd == items.idd) { if (e.idd == items.idd) {
e.itemDirectoryUrl = items.itemDirectoryUrl; e.itemDirectoryUrl = items.itemDirectoryUrl;
} }
}); });
} else if (!items.idd && items.attributeDetailsId) { } else if (!items.idd && items.attributeDetailsId) {
this.form.trainingItemDirectoryList.forEach((e) => { this.form.trainingItemDirectoryList.forEach(e => {
if (e.attributeDetailsId == items.attributeDetailsId) { if (e.attributeDetailsId == items.attributeDetailsId) {
e.itemDirectoryUrl = items.itemDirectoryUrl; e.itemDirectoryUrl = items.itemDirectoryUrl;
} }
@ -636,7 +508,7 @@ export default {
// // 退 // // 退
cencel(row) { cencel(row) {
console.log(row); console.log(row);
refundInformation(row.id).then((response) => { refundInformation(row.id).then(response => {
this.query = response.data; this.query = response.data;
this.innerrefund = true; this.innerrefund = true;
}); });
@ -650,9 +522,9 @@ export default {
var obj = { var obj = {
orderNo: this.query.trainingOrderNo, orderNo: this.query.trainingOrderNo,
refundPrice: this.query.trainingOrderAmount, refundPrice: this.query.trainingOrderAmount,
trainingOrderFlag: "TRAINING", trainingOrderFlag: "TRAINING"
}; };
xylWeChatRefundNotify(obj).then((res) => { xylWeChatRefundNotify(obj).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.$modal.msgSuccess("退款有延迟,请耐心等待"); this.$modal.msgSuccess("退款有延迟,请耐心等待");
} }
@ -663,7 +535,7 @@ export default {
/** 查询学习培训订单主列表 */ /** 查询学习培训订单主列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listTrainingOrder(this.queryParams).then((response) => { listTrainingOrder(this.queryParams).then(response => {
this.trainingOrderList = response.rows; this.trainingOrderList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -684,7 +556,7 @@ export default {
this.formlist.trainingItemDetails = row.trainingItemDetails; this.formlist.trainingItemDetails = row.trainingItemDetails;
this.formlist.trainingItemContent = row.trainingItemContent; this.formlist.trainingItemContent = row.trainingItemContent;
this.formlist.trainingItemType = row.trainingItemType; this.formlist.trainingItemType = row.trainingItemType;
orderItemDirectory(row.trainingOrderDetailsId).then((response) => { orderItemDirectory(row.trainingOrderDetailsId).then(response => {
this.formlist.list = response.rows; this.formlist.list = response.rows;
this.loading = false; this.loading = false;
}); });
@ -707,11 +579,11 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -723,9 +595,9 @@ export default {
if (this.nurseStationlist[0]) { if (this.nurseStationlist[0]) {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.queryParams.pageSize = 10; this.queryParams.pageSize = 10;
this.queryParams.nursePersonName=null; this.queryParams.nursePersonName = null;
this.queryParams.trainingOrderNo=null; this.queryParams.trainingOrderNo = null;
this.queryParams.trainingOrderStatus=null; this.queryParams.trainingOrderStatus = null;
} }
// this.queryParams = { // this.queryParams = {
// pageNum: 1, // pageNum: 1,
@ -735,7 +607,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id); this.ids = selection.map(item => item.id);
this.single = selection.length !== 1; this.single = selection.length !== 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
@ -749,7 +621,7 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
getTrainingOrder(id).then((response) => { getTrainingOrder(id).then(response => {
console.log(response); console.log(response);
this.form = response.data; this.form = response.data;
this.form.trainingOrderDetailsList = this.form.trainingOrderDetailsList =
@ -770,22 +642,22 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateTrainingOrder(this.form).then((response) => { updateTrainingOrder(this.form).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
} }
}); });
} else { } else {
addTrainingOrder(this.form).then((response) => { addTrainingOrder(this.form).then(response => {
if (response.code == 200) { if (response.code == 200) {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
} }
}); });
} }
@ -797,7 +669,7 @@ export default {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal this.$modal
.confirm('是否确认删除学习培训订单主编号为"' + ids + '"的数据项?') .confirm('是否确认删除学习培训订单主编号为"' + ids + '"的数据项?')
.then(function () { .then(function() {
return delTrainingOrder(ids); return delTrainingOrder(ids);
}) })
.then(() => { .then(() => {
@ -811,12 +683,12 @@ export default {
this.download( this.download(
"system/trainingOrder/export", "system/trainingOrder/export",
{ {
...this.queryParams, ...this.queryParams
}, },
`trainingOrder_${new Date().getTime()}.xlsx` `trainingOrder_${new Date().getTime()}.xlsx`
); );
}, }
}, }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">