From de0bddb2a4019e3502c3086b46cde39ff3b7928c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Thu, 4 May 2023 14:14:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/OperateGoodsInfo/indexjs.js | 21 +- src/views/system/goodsCategory/index.vue | 189 +++++++----------- .../system/goodsCategoryAcatar/index.vue | 67 ++----- src/views/system/goodsInfo/indexjs.js | 72 +++---- src/views/system/goodsOrder/indexjs.js | 16 +- src/views/system/order/indexjs.js | 4 +- src/views/system/person/indexjs.js | 20 +- src/views/system/poser/index.vue | 8 +- src/views/system/stationAvatar/index.vue | 17 +- src/views/system/trainingAvatar/index.vue | 15 +- src/views/system/trainingOrder/index.vue | 4 +- 11 files changed, 176 insertions(+), 257 deletions(-) diff --git a/src/views/system/OperateGoodsInfo/indexjs.js b/src/views/system/OperateGoodsInfo/indexjs.js index 7e68b10..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 { @@ -455,10 +454,10 @@ export default { updatePicture(obj).then((res) => {}); } if (response.code == 200) { - this.$modal.msgSuccess("修改成功"); - ++this.isResouceShow - this.open = false; - this.getList(); + this.$modal.msgSuccess("修改成功"); + ++this.isResouceShow + this.open = false; + this.getList(); } }); } else { @@ -468,11 +467,11 @@ export default { // this.nurseStationId=this.form.nurseStationId addGoodsInfo(this.form).then((response) => { if (response.code == 200) { - this.$modal.msgSuccess("新增成功"); - this.StationName = "请选择所属护理站"; - ++this.isResouceShow - this.open = false; - this.getList(); + this.$modal.msgSuccess("新增成功"); + this.StationName = "请选择所属护理站"; + ++this.isResouceShow + this.open = false; + this.getList(); } }); } @@ -542,4 +541,4 @@ export default { }); }, }, -}; +}; \ No newline at end of file diff --git a/src/views/system/goodsCategory/index.vue b/src/views/system/goodsCategory/index.vue index c8ca5fd..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,33 +518,33 @@ 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) => { + addGoodsCategory(this.form).then(response => { 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(); } }); } @@ -593,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(); @@ -613,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; - }, - }, + } + } };