diff --git a/.env.development b/.env.development index 60641d3..7f08aee 100644 --- a/.env.development +++ b/.env.development @@ -8,5 +8,6 @@ ENV = 'development' # VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = 'https://quanyidaojia.xinelu.cn' + # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/api/baseurl.js b/src/api/baseurl.js index 8cc8962..e69de29 100644 --- a/src/api/baseurl.js +++ b/src/api/baseurl.js @@ -1,3 +0,0 @@ -var baseurl = "https://quanyidaojia.xinelu.cn"; - -export default baseurl diff --git a/src/api/system/order.js b/src/api/system/order.js index 1e9dd32..c208195 100644 --- a/src/api/system/order.js +++ b/src/api/system/order.js @@ -28,7 +28,6 @@ export function appointmentOrderDetails(id) { // 确定按钮 export function xylWeChatRefundNotify(data) { return request({ - url: '/nurseApp/weChatPayment/weChatRefundOrderApply', method: 'post', data: data @@ -77,4 +76,4 @@ export function getPersonInfo(nurseStationPersonId) { url: `/system/appointmentOrder/getPersonInfo?nurseStationPersonId=${nurseStationPersonId}`, method: 'get' }) -} \ No newline at end of file +} diff --git a/src/api/system/stationAvatar.js b/src/api/system/stationAvatar.js index b2eba7f..5bac56b 100644 --- a/src/api/system/stationAvatar.js +++ b/src/api/system/stationAvatar.js @@ -17,6 +17,28 @@ export function updatePoserHeads(data) { data: data }) } +export function uploadVideoUrl(data) { + return request({ + url: '/system/trainingItem/uploadVideoUrl', + method: 'post', + data: data + }) +} + +export function uploadUrl(data) { + return request({ + url: '/system/trainingItem/uploadUrl', + method: 'post', + data: data + }) +} +export function uploadTrainingCategoryPicture(data) { + return request({ + url: '/system/trainingCategory/uploadTrainingCategoryPicture', + method: 'post', + data: data + }) +} export function posts(data) { return request({ diff --git a/src/api/system/trainingCategory.js b/src/api/system/trainingCategory.js new file mode 100644 index 0000000..c2a7fb9 --- /dev/null +++ b/src/api/system/trainingCategory.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询学习培训分类列表 +export function listTrainingCategory(query) { + return request({ + url: '/system/trainingCategory/list', + method: 'get', + params: query + }) +} + +// 查询学习培训分类详细 +export function getTrainingCategory(id) { + return request({ + url: '/system/trainingCategory/' + id, + method: 'get' + }) +} + +// 新增学习培训分类 +export function addTrainingCategory(data) { + return request({ + url: '/system/trainingCategory/add', + method: 'post', + data: data + }) +} + +// 修改学习培训分类 +export function updateTrainingCategory(data) { + return request({ + url: '/system/trainingCategory/edit', + method: 'post', + data: data + }) +} + +// 删除学习培训分类 +export function delTrainingCategory(id) { + return request({ + url: '/system/trainingCategory/' + id, + method: 'delete' + }) +} diff --git a/src/api/system/trainingItem.js b/src/api/system/trainingItem.js new file mode 100644 index 0000000..137ea15 --- /dev/null +++ b/src/api/system/trainingItem.js @@ -0,0 +1,68 @@ +import request from '@/utils/request' + +// 查询学习培训项目信息列表 +export function listTrainingItem(query) { + return request({ + url: '/system/trainingItem/list', + method: 'get', + params: query + }) +} +export function listTrainingCategory(query) { + return request({ + url: '/system/trainingCategory/list', + method: 'get', + params: query + }) +} +// 父级项目组 +export function selectTrainingParent(query) { + return request({ + url: '/system/trainingItem/selectTrainingParent', + method: 'get', + params: query + }) +} +// 修改上下架 +export function updateTrainingShelfFlag(data) { + return request({ + url: '/system/trainingItem/updateTrainingShelfFlag', + method: 'post', + data: data + + }) +} + +// 查询学习培训项目信息详细 +export function getTrainingItem(id) { + return request({ + url: '/system/trainingItem/' + id, + method: 'get' + }) +} + +// 新增学习培训项目信息 +export function addTrainingItem(data) { + return request({ + url: '/system/trainingItem/add', + method: 'post', + data: data + }) +} + +// 修改学习培训项目信息 +export function updateTrainingItem(data) { + return request({ + url: '/system/trainingItem/edit', + method: 'post', + data: data + }) +} + +// 删除学习培训项目信息 +export function delTrainingItem(id) { + return request({ + url: '/system/trainingItem/' + id, + method: 'delete' + }) +} diff --git a/src/api/system/trainingOrder.js b/src/api/system/trainingOrder.js new file mode 100644 index 0000000..0954095 --- /dev/null +++ b/src/api/system/trainingOrder.js @@ -0,0 +1,68 @@ +import request from '@/utils/request' + +// 查询学习培训订单主列表 +export function listTrainingOrder(query) { + return request({ + url: '/system/trainingOrder/list', + method: 'get', + params: query + }) +} +// 查看视频 +export function orderItemDirectory(id) { + return request({ + url: `/system/trainingOrder/orderItemDirectory?trainingOrderDetailsId=${id}`, + method: 'get', + + }) +} + +// 查询学习培训订单主详细 +export function getTrainingOrder(id) { + return request({ + url: '/system/trainingOrder/' + id, + method: 'get' + }) +} +// 确定按钮 +export function xylWeChatRefundNotify(data) { + return request({ + url: '/nurseApp/weChatPayment/weChatRefundOrderApply', + method: 'post', + data: data + }) +} +// 退款 +export function refundInformation(id) { + return request({ + url: `/system/trainingOrder/refundInformation` + `?id=${id}`, + method: 'get', + }) +} + + +// 新增学习培训订单主 +export function addTrainingOrder(data) { + return request({ + url: '/system/trainingOrder/add', + method: 'post', + data: data + }) +} + +// 修改学习培训订单主 +export function updateTrainingOrder(data) { + return request({ + url: '/system/trainingOrder/edit', + method: 'post', + data: data + }) +} + +// 删除学习培训订单主 +export function delTrainingOrder(id) { + return request({ + url: '/system/trainingOrder/' + id, + method: 'delete' + }) +} diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 32c29b4..616fa47 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -9,6 +9,7 @@ :show-file-list="false" :headers="headers" style="display: none" + :data="filetype" ref="upload" v-if="this.type == 'url'" > @@ -29,39 +30,47 @@ export default { /* 编辑器的内容 */ value: { type: String, - default: "" + default: "", }, /* 高度 */ height: { type: Number, - default: null + default: null, }, /* 最小高度 */ minHeight: { type: Number, - default: null + default: null, }, /* 只读 */ readOnly: { type: Boolean, - default: false + default: false, }, // 上传文件大小限制(MB) fileSize: { type: Number, - default: 5 + default: 5, }, /* 类型(base64格式、url格式) */ type: { type: String, - default: "url" - } + default: "url", + }, + url: { + type: String, + default: "/common/richTextPictureUrl", + }, + // filetypes: { + // type: String, + // default: "", + // }, }, data() { return { - uploadUrl: process.env.VUE_APP_BASE_API + "/common/richTextPictureUrl", // 上传的图片服务器地址 + uploadUrl: process.env.VUE_APP_BASE_API, // 上传的图片服务器地址 headers: { - Authorization: "Bearer " + getToken() + Authorization: "Bearer " + getToken(), }, Quill: null, currentValue: "", @@ -81,14 +90,22 @@ export default { [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 [{ align: [] }], // 对齐方式 ["clean"], // 清除文本格式 - ["link", "image"] // 链接、图片、视频 - ] + ["link", "image"], // 链接、图片、视频 + ], }, placeholder: "请输入内容", - readOnly: this.readOnly - } + readOnly: this.readOnly, + }, + filetype: { + type: "", + }, }; }, + created() { + this.uploadUrl = process.env.VUE_APP_BASE_API + this.url; + // console.log(this.url) + // this.filetype.type = this.filetypes; + }, computed: { styles() { let style = {}; @@ -99,7 +116,7 @@ export default { style.height = `${this.height}px`; } return style; - } + }, }, watch: { value: { @@ -111,8 +128,8 @@ export default { } } }, - immediate: true - } + immediate: true, + }, }, mounted() { this.init(); @@ -127,7 +144,7 @@ export default { // 如果设置了上传地址则自定义图片上传事件 if (this.type == "url") { let toolbar = this.Quill.getModule("toolbar"); - toolbar.addHandler("image", value => { + toolbar.addHandler("image", (value) => { this.uploadType = "image"; if (value) { this.$refs.upload.$children[0].$refs.input.click(); @@ -180,6 +197,7 @@ export default { "image", process.env.VUE_APP_BASE_API + res.fileName ); + console.log(res); this.$emit("imgs", res.fileName); // 调整光标到最后 quill.setSelection(length + 1); @@ -189,8 +207,8 @@ export default { }, handleUploadError() { this.$message.error("图片插入失败"); - } - } + }, + }, }; diff --git a/src/utils/request.js b/src/utils/request.js index 303a7eb..6431e83 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -12,7 +12,7 @@ let downloadLoadingInstance; export let isRelogin = { show: false }; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' - // 创建axios实例 +// 创建axios实例 const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: process.env.VUE_APP_BASE_API, @@ -24,7 +24,7 @@ const service = axios.create({ service.interceptors.request.use(config => { // 是否需要设置 token const isToken = (config.headers || {}).isToken === false - // 是否需要防止数据重复提交 + // 是否需要防止数据重复提交 const isRepeatSubmit = (config.headers || {}).repeatSubmit === false if (getToken() && !isToken) { config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 @@ -67,48 +67,48 @@ service.interceptors.request.use(config => { // 响应拦截器 service.interceptors.response.use(res => { - // 未设置状态码则默认成功状态 - const code = res.data.code || 200; - // 获取错误信息 - const msg = errorCode[code] || res.data.msg || errorCode['default'] - // 二进制数据则直接返回 - if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { - return res.data + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true; + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + isRelogin.show = false; + store.dispatch('LogOut').then(() => { + location.href = '/index'; + }) + }).catch(() => { + isRelogin.show = false; + }); } - if (code === 401) { - if (!isRelogin.show) { - isRelogin.show = true; - MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { - confirmButtonText: '重新登录', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - isRelogin.show = false; - store.dispatch('LogOut').then(() => { - location.href = '/index'; - }) - }).catch(() => { - isRelogin.show = false; - }); - } - return Promise.reject('无效的会话,或者会话已过期,请重新登录。') - } else if (code === 500) { - Message({ - message: msg, - type: 'error' - }) - return Promise.reject(new Error(msg)) - } else if (code === 600) { - return Promise.reject(new Error(msg)) - } else if (code !== 200) { - Notification.error({ - title: msg - }) - return Promise.reject('error') - } else { - return res.data - } - }, + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ + message: msg, + type: 'error' + }) + return res.data & Promise.reject(new Error(msg)) + } else if (code === 600) { + return Promise.reject(new Error(msg)) + } else if (code !== 200) { + Notification.error({ + title: msg + }) + return Promise.reject('error') + } else { + return res.data + } +}, error => { console.log('err' + error) let { message } = error; @@ -135,7 +135,7 @@ export function download(url, params, filename) { transformRequest: [(params) => { return tansParams(params) }], headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, responseType: 'blob' - }).then(async(data) => { + }).then(async (data) => { const isLogin = await blobValidate(data); if (isLogin) { const blob = new Blob([data]) diff --git a/src/views/system/InformationCategory/index.vue b/src/views/system/InformationCategory/index.vue index 1f6cf0c..09c87bc 100644 --- a/src/views/system/InformationCategory/index.vue +++ b/src/views/system/InformationCategory/index.vue @@ -189,7 +189,7 @@ :prop="`informationCategoryList.${index}.informationCategoryName`" > { if (valid) { - if (this.form.id != null) { updateInformationCategory(this.form).then((response) => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); + if (response.code == 200) { + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + } }); } else { - addInformationCategory(this.form).then((response) => { - this.$modal.msgSuccess("新增成功"); - this.addopen = false; - this.getList(); + if (response.code == 200) { + this.$modal.msgSuccess("新增成功"); + this.addopen = false; + this.getList(); + } }); } } diff --git a/src/views/system/OperateGoodsInfo/indexjs.js b/src/views/system/OperateGoodsInfo/indexjs.js index 3c9f5a5..eb2592d 100644 --- a/src/views/system/OperateGoodsInfo/indexjs.js +++ b/src/views/system/OperateGoodsInfo/indexjs.js @@ -14,7 +14,6 @@ import { } from "@/api/system/goodsCategory"; import editor from "@/components/Editor"; import stationAcatar from "../stationAvatar/index.vue"; -import baseurl from "@/api/baseurl.js"; let id = 0; export default { @@ -187,6 +186,7 @@ export default { whetherShelf: 1, }; } + console.log(obj) editGoodsWhetherShelf(obj).then((res) => { if (obj.whetherShelf == 0) { this.$modal.msgSuccess("已修改上架状态为未上架"); @@ -453,10 +453,12 @@ export default { if (obj.pictureUrlList.length > 0) { updatePicture(obj).then((res) => {}); } - this.$modal.msgSuccess("修改成功"); - ++this.isResouceShow - this.open = false; - this.getList(); + if (response.code == 200) { + this.$modal.msgSuccess("修改成功"); + ++this.isResouceShow + this.open = false; + this.getList(); + } }); } else { this.form.goodDetailsLists.forEach(e => { @@ -464,11 +466,13 @@ export default { }) // this.nurseStationId=this.form.nurseStationId addGoodsInfo(this.form).then((response) => { - this.$modal.msgSuccess("新增成功"); - this.StationName = "请选择所属护理站"; - ++this.isResouceShow - this.open = false; - this.getList(); + if (response.code == 200) { + this.$modal.msgSuccess("新增成功"); + this.StationName = "请选择所属护理站"; + ++this.isResouceShow + this.open = false; + this.getList(); + } }); } } diff --git a/src/views/system/StationDepartment/indexjs.js b/src/views/system/StationDepartment/indexjs.js index 7d0320c..96496cb 100644 --- a/src/views/system/StationDepartment/indexjs.js +++ b/src/views/system/StationDepartment/indexjs.js @@ -283,15 +283,19 @@ export default { if (valid) { if (this.form.id != null) { updateStationDepartment(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + } }); } else { addStationDepartment(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.addopen = false; this.getList(); + } }); } } diff --git a/src/views/system/appFileInfo/index.vue b/src/views/system/appFileInfo/index.vue index 35ba00c..d869f0a 100644 --- a/src/views/system/appFileInfo/index.vue +++ b/src/views/system/appFileInfo/index.vue @@ -337,15 +337,19 @@ export default { if (valid) { if (this.form.id != null) { updateAppFileInfo(this.form).then(response => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + } }); } else { addAppFileInfo(this.form).then(response => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); + } }); } } diff --git a/src/views/system/area/index.vue b/src/views/system/area/index.vue index b77cc00..42752b9 100644 --- a/src/views/system/area/index.vue +++ b/src/views/system/area/index.vue @@ -564,17 +564,21 @@ export default { if (valid) { if (this.form.id != null) { updateArea(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + } }); } else { addArea(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open = false; this.queryParams.parentCode = this.form.parentCode; this.queryParams.areaLevel = null; this.getList(); + } }); } } diff --git a/src/views/system/certificate/index.vue b/src/views/system/certificate/index.vue index 1932821..c0c8ec5 100644 --- a/src/views/system/certificate/index.vue +++ b/src/views/system/certificate/index.vue @@ -596,15 +596,19 @@ export default { if (valid) { if (this.form.id != null) { updateCertificate(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + } }); } else { addCertificate(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); + } }); } } diff --git a/src/views/system/classifyItem/index.vue b/src/views/system/classifyItem/index.vue index 2a569d6..4305abd 100644 --- a/src/views/system/classifyItem/index.vue +++ b/src/views/system/classifyItem/index.vue @@ -481,6 +481,7 @@ export default { if (valid) { if (this.form.id != null) { updateInfo(this.form).then(response => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); if (this.form.classifyPictureUrl != this.imgone) { var obj = { pictureUrlList: [] }; @@ -489,13 +490,16 @@ export default { } this.editopen = false; this.getList(); + } }); } else { addInfo(this.form).then(response => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); + } }); } } diff --git a/src/views/system/communityInfo/index.vue b/src/views/system/communityInfo/index.vue index 4b67520..d9a26b1 100644 --- a/src/views/system/communityInfo/index.vue +++ b/src/views/system/communityInfo/index.vue @@ -938,18 +938,22 @@ export default { if (this.form.id != null) { updateCommunityInfo(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open2 = false; this.open = false; this.getList(); + } }); } else { addCommunityInfo(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open = false; this.open2 = false; this.getList(); + } }); } } diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index f580b98..d8291a3 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -302,15 +302,19 @@ export default { if (valid) { if (this.form.configId != undefined) { updateConfig(this.form).then(response => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + } }); } else { addConfig(this.form).then(response => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); + } }); } } diff --git a/src/views/system/coupon/index.vue b/src/views/system/coupon/index.vue index 840ecf0..37f2dad 100644 --- a/src/views/system/coupon/index.vue +++ b/src/views/system/coupon/index.vue @@ -593,15 +593,19 @@ export default { if (valid) { if (this.form.id != null) { updateCoupon(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + } }); } else { addCoupon(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); + } }); } } diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 5b898a2..4be35d9 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -308,15 +308,19 @@ export default { if (valid) { if (this.form.deptId != undefined) { updateDept(this.form).then(response => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + } }); } else { addDept(this.form).then(response => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); + } }); } } diff --git a/src/views/system/diseaseInfo/index.vue b/src/views/system/diseaseInfo/index.vue index 77899dd..28d81de 100644 --- a/src/views/system/diseaseInfo/index.vue +++ b/src/views/system/diseaseInfo/index.vue @@ -419,15 +419,19 @@ export default { if (valid) { if (this.form.id != null) { updateDiseaseInfo(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); + } }); } else { addDiseaseInfo(this.form).then((response) => { + if (response.code == 200) { this.$modal.msgSuccess("新增成功"); this.open2 = false; this.getList(); + } }); } } diff --git a/src/views/system/goodsCategory/index.vue b/src/views/system/goodsCategory/index.vue index 70d6174..00955f9 100644 --- a/src/views/system/goodsCategory/index.vue +++ b/src/views/system/goodsCategory/index.vue @@ -12,7 +12,7 @@ prefix-icon="el-icon-search" style="margin-bottom: 20px" /> - --> + -->
- --> + --> - 搜索 - 重置 + 搜索 + 重置 @@ -81,8 +73,7 @@ size="mini" @click="handleAdd" v-hasPermi="['system:goodsCategory:add']" - >新增 + >新增 修改 + >修改 删除 + >删除 - + --> + - + - + @@ -204,21 +180,16 @@ ref="cascader" :placeholder="form.parentName ? form.parentName : '商品主分类'" :key="isResouceShow" - > - + > + />--> - + + --> --> - + { if (id == 9999999) { - getStationCategoryList(0).then((res) => { + getStationCategoryList(0).then(res => { // 接口请求 - res.data.forEach((e) => { + res.data.forEach(e => { e.value = e.id; e.label = e.goodsCategoryName; }); resolve( - res.data.map((item) => { + res.data.map(item => { return { - ...item, + ...item }; }) ); @@ -304,37 +270,37 @@ export default { { label: "商品主分类", children: [], - id: 9999999, - }, + id: 9999999 + } ]; resolve( - data.map((item) => { + data.map(item => { return { - ...item, + ...item }; }) ); } else { - getStationCategoryList(id).then((res) => { + getStationCategoryList(id).then(res => { // 接口请求 - res.data.forEach((e) => { + res.data.forEach(e => { e.value = e.id; e.label = e.goodsCategoryName; }); resolve( - res.data.map((item) => { + res.data.map(item => { return { - ...item, + ...item }; }) ); }); } }, 300); - }, + } }, imgone: "", - baseurl: "", + baseurl: process.env.VUE_APP_BASE_API, // 遮罩层 loading: true, // 选中数组 @@ -363,47 +329,44 @@ export default { categoryRemark: null, sort: null, parentId: "", - parentName: "", + parentName: "" }, // 表单参数 form: { goodsCategoryName: null, goodsCategoryPicture: null, categoryRemark: null, - sort: null, + sort: null }, // 表单校验 rules: { goodsCategoryName: [ - { required: true, message: "商品分类名称不能为空", trigger: "blur" }, + { required: true, message: "商品分类名称不能为空", trigger: "blur" } ], goodsCategoryCode: [ - { required: true, message: "商品分类编码不能为空", trigger: "blur" }, + { required: true, message: "商品分类编码不能为空", trigger: "blur" } ], goodsCategoryPicture: [ - { required: true, message: "商品分类图片不能为空", trigger: "blur" }, + { required: true, message: "商品分类图片不能为空", trigger: "blur" } ], categoryRemark: [ - { required: true, message: "分类概述不能为空", trigger: "blur" }, - ], - sort: [ - { required: true, message: "显示顺序不能为空", trigger: "blur" }, + { required: true, message: "分类概述不能为空", trigger: "blur" } ], + sort: [{ required: true, message: "显示顺序不能为空", trigger: "blur" }] }, // 树选项 deptOptions: undefined, categoryLevel: null, defaultProps: { children: "children", - label: "goodsCategoryName", - }, + label: "goodsCategoryName" + } }; }, watch: {}, created() { - this.baseurl = baseurl; this.getList(); this.info(); }, @@ -426,12 +389,12 @@ export default { // this.categoryLevel = data.categoryLevel; this.queryParams.pageNum = 1; this.getList(); - getStationCategoryList(data.id).then((res) => { - res.data.forEach((e) => { + getStationCategoryList(data.id).then(res => { + res.data.forEach(e => { e.children = [ { - goodsCategoryName: "", - }, + goodsCategoryName: "" + } ]; }); this.loading = false; @@ -441,20 +404,20 @@ export default { /** 查询商品分类信息列表 */ info() { this.loading = true; - getStationCategoryList(0).then((res) => { - res.data.forEach((e) => { + getStationCategoryList(0).then(res => { + res.data.forEach(e => { e.children = [ { - goodsCategoryName: "", - }, + goodsCategoryName: "" + } ]; }); var obj = [ { goodsCategoryName: "商品主分类", children: res.data, - id: 0, - }, + id: 0 + } ]; this.deptOptions = obj; this.loading = false; @@ -462,7 +425,7 @@ export default { }, getList() { this.loading = true; - listGoodsCategory(this.queryParams).then((response) => { + listGoodsCategory(this.queryParams).then(response => { this.goodsCategoryList = response.rows; this.total = response.total; this.loading = false; @@ -478,7 +441,7 @@ export default { } } if (obj.pictureUrlList.length > 0) { - updatePicture(obj).then((res) => {}); + updatePicture(obj).then(res => {}); } this.open = false; this.reset(); @@ -522,14 +485,14 @@ export default { resetQuery() { this.queryParams = { pageNum: 1, - pageSize: 10, + pageSize: 10 }; this.resetForm("queryForm"); this.handleQuery(); }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map((item) => item.id); + this.ids = selection.map(item => item.id); this.single = selection.length !== 1; this.multiple = !selection.length; }, @@ -546,7 +509,7 @@ export default { handleUpdate(row) { this.reset(); const id = row.id || this.ids; - getGoodsCategory(id).then((response) => { + getGoodsCategory(id).then(response => { this.form = response.data; this.imgone = this.form.goodsCategoryPicture; this.open = true; @@ -555,30 +518,34 @@ export default { }, /** 提交按钮 */ submitForm() { - this.$refs["form"].validate((valid) => { + this.$refs["form"].validate(valid => { if (valid) { if (this.form.id != null) { - updateGoodsCategory(this.form).then((response) => { + updateGoodsCategory(this.form).then(response => { var obj = { pictureUrlList: [] }; if (this.imgone != this.form.goodsCategoryPicture) { obj.pictureUrlList.push(this.imgone); } if (obj.pictureUrlList.length > 0) { - updatePicture(obj).then((res) => {}); + updatePicture(obj).then(res => {}); + } + if (response.code == 200) { + this.$modal.msgSuccess("修改成功"); + ++this.isResouceShow; + this.open = false; + this.getList(); + this.info(); } - this.$modal.msgSuccess("修改成功"); - ++this.isResouceShow; - this.open = false; - this.getList(); - this.info(); }); } else { - addGoodsCategory(this.form).then((response) => { - this.$modal.msgSuccess("新增成功"); - ++this.isResouceShow; - this.open = false; - this.getList(); - this.info(); + addGoodsCategory(this.form).then(response => { + if (response.code == 200) { + this.$modal.msgSuccess("新增成功"); + ++this.isResouceShow; + this.open = false; + this.getList(); + this.info(); + } }); } } @@ -589,14 +556,14 @@ export default { const ids = row.id || this.ids; this.$modal .confirm("是否确认删除?") - .then(function () { + .then(function() { return delGoodsCategory(ids); }) .then(() => { var obj = { pictureUrlList: [] }; obj.pictureUrlList.push(row.goodsCategoryPicture); if (obj.pictureUrlList.length > 0) { - updatePicture(obj).then((res) => {}); + updatePicture(obj).then(res => {}); } this.getList(); this.info(); @@ -609,15 +576,15 @@ export default { this.download( "system/goodsCategory/export", { - ...this.queryParams, + ...this.queryParams }, `goodsCategory_${new Date().getTime()}.xlsx` ); }, imgUrl(imgUrl) { this.form.goodsCategoryPicture = imgUrl; - }, - }, + } + } }; diff --git a/src/views/system/trainingCategory/index.vue b/src/views/system/trainingCategory/index.vue new file mode 100644 index 0000000..815bdd0 --- /dev/null +++ b/src/views/system/trainingCategory/index.vue @@ -0,0 +1,442 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/trainingItem/index.vue b/src/views/system/trainingItem/index.vue new file mode 100644 index 0000000..77c4289 --- /dev/null +++ b/src/views/system/trainingItem/index.vue @@ -0,0 +1,1398 @@ + + + + diff --git a/src/views/system/trainingOrder/index.vue b/src/views/system/trainingOrder/index.vue new file mode 100644 index 0000000..6dd52d4 --- /dev/null +++ b/src/views/system/trainingOrder/index.vue @@ -0,0 +1,943 @@ + + +