修改
This commit is contained in:
parent
162b05b65e
commit
51ee630c8a
44
src/api/system/classifyItem.js
Normal file
44
src/api/system/classifyItem.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询护理机构和护理项目分类信息列表
|
||||
export function listInfo(query) {
|
||||
return request({
|
||||
url: '/classifyItem/info/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询护理机构和护理项目分类信息详细
|
||||
export function getInfo(id) {
|
||||
return request({
|
||||
url: '/classifyItem/info/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增护理机构和护理项目分类信息
|
||||
export function addInfo(data) {
|
||||
return request({
|
||||
url: '/classifyItem/info/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改护理机构和护理项目分类信息
|
||||
export function updateInfo(data) {
|
||||
return request({
|
||||
url: '/classifyItem/info/edit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除护理机构和护理项目分类信息
|
||||
export function delInfo(id) {
|
||||
return request({
|
||||
url: '/classifyItem/info/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -73,7 +73,8 @@ export default {
|
||||
],
|
||||
// goodAttributeDetailsLists:[],
|
||||
goodDetailsLists: [],
|
||||
ids: 9999999,
|
||||
idd: 9999999,
|
||||
ids: [],
|
||||
// 查询参数
|
||||
shangjia: {
|
||||
id: null,
|
||||
@ -201,28 +202,28 @@ export default {
|
||||
// if (this.goodDetailsLists.length == 5) {
|
||||
// this.$message.error("最多只能5条");
|
||||
// } else {
|
||||
this.ids++;
|
||||
this.idd++;
|
||||
var obj = {
|
||||
attributePitureUrl: "",
|
||||
goodsPrice: "",
|
||||
goodsStock: "",
|
||||
attributeDetailsSort: null,
|
||||
ids: this.ids,
|
||||
idd: this.idd,
|
||||
};
|
||||
this.goodDetailsLists.push(obj);
|
||||
// }
|
||||
},
|
||||
// 删除
|
||||
delgoodAttributeDetail(item) {
|
||||
if (item.ids && !item.attributeDetailsId) {
|
||||
if (item.idd && !item.attributeDetailsId) {
|
||||
if (this.goodDetailsLists.length == 1) {
|
||||
this.$message.error("最后一条不可删除");
|
||||
} else {
|
||||
this.goodDetailsLists = this.goodDetailsLists.filter(
|
||||
(e) => e.ids != item.ids
|
||||
(e) => e.idd != item.idd
|
||||
);
|
||||
}
|
||||
} else if (!item.ids && item.attributeDetailsId) {
|
||||
} else if (!item.idd && item.attributeDetailsId) {
|
||||
if (this.goodDetailsLists.length == 1) {
|
||||
this.$message.error("最后一条不可删除");
|
||||
} else {
|
||||
@ -321,7 +322,7 @@ export default {
|
||||
goodsPrice: "",
|
||||
goodsStock: "",
|
||||
attributeDetailsSort: null,
|
||||
ids: 9999999,
|
||||
idd: 9999999,
|
||||
}, ];
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -362,7 +363,7 @@ export default {
|
||||
goodsPrice: "",
|
||||
goodsStock: "",
|
||||
sort: null,
|
||||
ids: 9999999,
|
||||
idd: 9999999,
|
||||
}, ];
|
||||
this.open = true;
|
||||
},
|
||||
@ -461,13 +462,13 @@ export default {
|
||||
},
|
||||
attributePitureitem(item) {
|
||||
let items = JSON.parse(item);
|
||||
if (items.ids && !items.id) {
|
||||
if (items.idd && !items.id) {
|
||||
this.goodDetailsLists.forEach((e) => {
|
||||
if (e.ids == items.ids) {
|
||||
if (e.idd == items.idd) {
|
||||
e.attributePitureUrl = items.attributePitureUrl;
|
||||
}
|
||||
});
|
||||
} else if (!items.ids && items.attributeDetailsId) {
|
||||
} else if (!items.idd && items.attributeDetailsId) {
|
||||
this.goodDetailsLists.forEach((e) => {
|
||||
if (e.attributeDetailsId == items.attributeDetailsId) {
|
||||
e.attributePitureUrl = items.attributePitureUrl;
|
||||
|
||||
578
src/views/system/classifyItem/index.vue
Normal file
578
src/views/system/classifyItem/index.vue
Normal file
@ -0,0 +1,578 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="分类编码" prop="classifyCode">
|
||||
<el-input
|
||||
v-model="queryParams.classifyCode"
|
||||
placeholder="请输入分类编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类名称" prop="classifyName">
|
||||
<el-input
|
||||
v-model="queryParams.classifyName"
|
||||
placeholder="请输入分类名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="分类类型" prop="classifyType">
|
||||
<el-select v-model="queryParams.classifyType" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="分类排序" prop="classifySort">
|
||||
<el-input
|
||||
v-model="queryParams.classifySort"
|
||||
placeholder="请输入分类排序"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
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>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['classify:info:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['classify:info:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['classify:info:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['classify:info:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="infoList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="分类编码" align="center" prop="classifyCode" />
|
||||
<el-table-column label="分类名称" align="center" prop="classifyName" />
|
||||
<!-- <el-table-column label="分类类型" align="center" prop="classifyType">
|
||||
<template slot-scope="scope"
|
||||
>{{ scope.row.classifyType == "NURSE_AGNECY" ? "护理机构分类" : "" }}
|
||||
{{ scope.row.classifyType == "NURSE_ITEM" ? "护理项目分类" : "" }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="分类排序" align="center" prop="classifySort" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['classify:info:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['classify:info:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加护理项目分类信息对话框 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
width="1000px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="80px"
|
||||
:inline="true"
|
||||
:before-close="cancel"
|
||||
>
|
||||
<div
|
||||
v-for="(item, index) in form.nurseClassifyInfoList"
|
||||
:key="index"
|
||||
style="margin-bottom: 30px"
|
||||
>
|
||||
<el-form-item
|
||||
label="分类名称"
|
||||
:rules="rules.nurseClassifyInfoList.classifyName"
|
||||
:prop="`nurseClassifyInfoList.${index}.classifyName`"
|
||||
>
|
||||
<el-input
|
||||
style="width: 200px"
|
||||
v-model="item.classifyName"
|
||||
placeholder="请输入分类名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="分类排序"
|
||||
:rules="rules.nurseClassifyInfoList.classifySort"
|
||||
:prop="`nurseClassifyInfoList.${index}.classifySort`"
|
||||
>
|
||||
<el-input
|
||||
style="width: 200px"
|
||||
v-model="item.classifySort"
|
||||
placeholder="请输入分类排序"
|
||||
oninput="value=value.replace(/[^\d]/g,'')"
|
||||
maxLength="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="分类图标"
|
||||
:rules="rules.nurseClassifyInfoList.classifyPictureUrl"
|
||||
:prop="`nurseClassifyInfoList.${index}.classifyPictureUrl`"
|
||||
>
|
||||
<stationAcatar
|
||||
style="margin-top: -25px"
|
||||
@imgUrl="imgclassifyPictureUrl"
|
||||
@item="imgclassifyPictureitem"
|
||||
:img="item.classifyPictureUrl"
|
||||
:type="'nurseItemClassifyUrl'"
|
||||
:item="item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-circle-plus-outline"
|
||||
style="margin-top: 2px; margin-left: 50px"
|
||||
v-if="index == 0"
|
||||
@click="addnurseClassifyitem"
|
||||
></el-button>
|
||||
<!-- circle -->
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
plain
|
||||
style="margin-top: 2px; margin-left: 50px"
|
||||
v-if="index != 0"
|
||||
@click="delnurseClassifyitem(index)"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 修改护理项目分类信息对话框 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="editopen"
|
||||
width="500px"
|
||||
append-to-body
|
||||
:before-close="cancel"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="分类名称" prop="classifyName">
|
||||
<el-input v-model="form.classifyName" placeholder="请输入分类名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分类图标" prop="classifyPictureUrl">
|
||||
<stationAcatar
|
||||
@imgUrl="imgclassifyPictureUrl"
|
||||
@item="imgclassifyPictureitem"
|
||||
:img="form.classifyPictureUrl"
|
||||
:type="'nurseItemClassifyUrl'"
|
||||
:item="form"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类排序" prop="classifySort">
|
||||
<el-input
|
||||
v-model="form.classifySort"
|
||||
placeholder="请输入分类排序"
|
||||
oninput="value=value.replace(/[^\d]/g,'')"
|
||||
maxLength="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import stationAcatar from "../stationAvatar/index.vue";
|
||||
import {
|
||||
listInfo,
|
||||
getInfo,
|
||||
delInfo,
|
||||
addInfo,
|
||||
updateInfo,
|
||||
} from "@/api/system/classifyItem.js";
|
||||
import { updatePicture } from "@/api/system/station";
|
||||
export default {
|
||||
name: "classify",
|
||||
components: { stationAcatar },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 护理机构和护理项目分类信息表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
editopen: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
parentId: null,
|
||||
classifyCode: null,
|
||||
classifyName: null,
|
||||
classifyLevel: null,
|
||||
classifyType: null,
|
||||
classifyPictureUrl: null,
|
||||
classifySort: null,
|
||||
},
|
||||
//分类所属类型
|
||||
options: [
|
||||
{
|
||||
value: "NURSE_AGNECY",
|
||||
label: "护理机构分类",
|
||||
},
|
||||
{
|
||||
value: "NURSE_ITEM",
|
||||
label: "护理项目分类",
|
||||
},
|
||||
],
|
||||
// 表单参数
|
||||
form: {
|
||||
nurseClassifyInfoList: [],
|
||||
},
|
||||
idd: 0,
|
||||
classifyPictureUrl: null,
|
||||
// 表单校验
|
||||
rules: {
|
||||
nurseClassifyInfoList: {
|
||||
classifyName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入分类名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
classifyPictureUrl: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择分类图标",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
classifySort: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入分类排序",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
classifyName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入分类名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
classifyPictureUrl: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择分类图标",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
classifySort: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入分类排序",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//添加时删除item
|
||||
delnurseClassifyitem(index) {
|
||||
this.form.nurseClassifyInfoList.splice(index, 1);
|
||||
},
|
||||
//添加时新增item
|
||||
addnurseClassifyitem() {
|
||||
this.idd++;
|
||||
var obj = {
|
||||
classifyName: "",
|
||||
classifyPictureUrl: "",
|
||||
classifySort: "",
|
||||
idd: this.idd,
|
||||
};
|
||||
if (this.form.nurseClassifyInfoList.length == 5) {
|
||||
this.$message.error("最多批量添加5条");
|
||||
} else {
|
||||
this.form.nurseClassifyInfoList.push(obj);
|
||||
}
|
||||
},
|
||||
//接收图片
|
||||
imgclassifyPictureUrl(e) {},
|
||||
//接收图片所属的item
|
||||
imgclassifyPictureitem(item) {
|
||||
let items = JSON.parse(item);
|
||||
if (items.idd && !items.id) {
|
||||
this.form.nurseClassifyInfoList.forEach((e) => {
|
||||
if (e.idd == items.idd) {
|
||||
e.classifyPictureUrl = items.classifyPictureUrl;
|
||||
}
|
||||
});
|
||||
} else if (!items.idd && items.id) {
|
||||
this.form.classifyPictureUrl = items.classifyPictureUrl;
|
||||
}
|
||||
},
|
||||
/** 查询护理机构和护理项目分类信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listInfo(this.queryParams).then((response) => {
|
||||
this.infoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
if (this.editopen) {
|
||||
var obj = { pictureUrlList: [] };
|
||||
if (this.form.classifyPictureUrl != this.classifyPictureUrl) {
|
||||
obj.pictureUrlList.push(this.classifyPictureUrl);
|
||||
}
|
||||
updatePicture(obj).then((res) => {
|
||||
this.editopen = false;
|
||||
});
|
||||
}
|
||||
if (this.open) {
|
||||
var obj = { pictureUrlList: [] };
|
||||
if (this.form.nurseClassifyInfoList) {
|
||||
this.form.nurseClassifyInfoList.forEach((e) => {
|
||||
obj.pictureUrlList.push(e.classifyPictureUrl);
|
||||
});
|
||||
}
|
||||
updatePicture(obj).then((res) => {
|
||||
this.open = false;
|
||||
});
|
||||
}
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
parentId: null,
|
||||
classifyCode: null,
|
||||
classifyName: null,
|
||||
classifyLevel: null,
|
||||
classifyType: null,
|
||||
classifyPictureUrl: null,
|
||||
classifySort: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.form = {
|
||||
nurseClassifyInfoList: [
|
||||
{
|
||||
classifyName: "",
|
||||
classifyPictureUrl: "",
|
||||
classifySort: "",
|
||||
idd: this.idd,
|
||||
},
|
||||
],
|
||||
};
|
||||
this.open = true;
|
||||
this.title = "添加护理项目分类信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getInfo(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.classifyPictureUrl = response.data.classifyPictureUrl;
|
||||
this.editopen = true;
|
||||
this.title = "修改护理项目分类信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
console.log(this.form);
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
if (this.form.classifyPictureUrl != this.classifyPictureUrl) {
|
||||
var obj = { pictureUrlList: [] };
|
||||
obj.pictureUrlList.push(this.classifyPictureUrl);
|
||||
updatePicture(obj).then((res) => {});
|
||||
}
|
||||
this.editopen = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInfo(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
console.log(row);
|
||||
this.$modal
|
||||
.confirm("是否确认删除?")
|
||||
.then(function () {
|
||||
return delInfo(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"classify/info/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`info_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -75,7 +75,8 @@ export default {
|
||||
],
|
||||
// goodAttributeDetailsLists:[],
|
||||
goodDetailsLists: [],
|
||||
ids: 9999999,
|
||||
ids: [],
|
||||
idd: 9999999,
|
||||
// 查询参数
|
||||
shangjia: {
|
||||
id: null,
|
||||
@ -210,29 +211,28 @@ export default {
|
||||
if (this.goodDetailsLists.length == 5) {
|
||||
this.$message.error("最多只能5条");
|
||||
} else {
|
||||
this.ids++;
|
||||
this.idd++;
|
||||
var obj = {
|
||||
attributePitureUrl: "",
|
||||
goodsPrice: "",
|
||||
goodsStock: "",
|
||||
sort: null,
|
||||
ids: this.ids,
|
||||
idd: this.idd,
|
||||
};
|
||||
this.goodDetailsLists.push(obj);
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
delgoodAttributeDetail(item) {
|
||||
console.log(item);
|
||||
if (item.ids && !item.attributeDetailsId) {
|
||||
if (item.idd && !item.attributeDetailsId) {
|
||||
if (this.goodDetailsLists.length == 1) {
|
||||
this.$message.error("最后一条不可删除");
|
||||
} else {
|
||||
this.goodDetailsLists = this.goodDetailsLists.filter(
|
||||
(e) => e.ids != item.ids
|
||||
(e) => e.idd != item.idd
|
||||
);
|
||||
}
|
||||
} else if (!item.ids && item.attributeDetailsId) {
|
||||
} else if (!item.idd && item.attributeDetailsId) {
|
||||
if (this.goodDetailsLists.length == 1) {
|
||||
this.$message.error("最后一条不可删除");
|
||||
} else {
|
||||
@ -318,7 +318,7 @@ export default {
|
||||
goodsPrice: "",
|
||||
goodsStock: "",
|
||||
sort: null,
|
||||
ids: 9999999,
|
||||
idd: 9999999,
|
||||
}, ];
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -361,7 +361,7 @@ export default {
|
||||
goodsPrice: "",
|
||||
goodsStock: "",
|
||||
sort: null,
|
||||
ids: 9999999,
|
||||
idd: 9999999,
|
||||
}, ];
|
||||
this.open = true;
|
||||
},
|
||||
@ -482,13 +482,13 @@ export default {
|
||||
},
|
||||
attributePitureitem(item) {
|
||||
let items = JSON.parse(item);
|
||||
if (items.ids && !items.id) {
|
||||
if (items.idd && !items.id) {
|
||||
this.goodDetailsLists.forEach((e) => {
|
||||
if (e.ids == items.ids) {
|
||||
if (e.idd == items.idd) {
|
||||
e.attributePitureUrl = items.attributePitureUrl;
|
||||
}
|
||||
});
|
||||
} else if (!items.ids && items.attributeDetailsId) {
|
||||
} else if (!items.idd && items.attributeDetailsId) {
|
||||
this.goodDetailsLists.forEach((e) => {
|
||||
if (e.attributeDetailsId == items.attributeDetailsId) {
|
||||
e.attributePitureUrl = items.attributePitureUrl;
|
||||
|
||||
@ -514,7 +514,7 @@ export default {
|
||||
{
|
||||
labelDescription: "",
|
||||
sort: "",
|
||||
ids: 1,
|
||||
idd: 1,
|
||||
},
|
||||
],
|
||||
// 护理站信息表格数据
|
||||
@ -544,7 +544,7 @@ export default {
|
||||
// 查询参数
|
||||
// 表单参数
|
||||
form: {},
|
||||
ids: 1,
|
||||
idd: 1,
|
||||
provincelist: [],
|
||||
arealist: [],
|
||||
citylist: [],
|
||||
@ -624,7 +624,7 @@ export default {
|
||||
{
|
||||
labelDescription: "",
|
||||
sort: "",
|
||||
ids: 1,
|
||||
idd: 1,
|
||||
},
|
||||
];
|
||||
} else {
|
||||
@ -637,11 +637,11 @@ export default {
|
||||
if (this.looknurseStationLabel.length == 5) {
|
||||
this.$message.error("最多只能5条");
|
||||
} else {
|
||||
this.ids++;
|
||||
this.idd++;
|
||||
var obj = {
|
||||
labelDescription: "",
|
||||
sort: "",
|
||||
ids: this.ids,
|
||||
idd: this.idd,
|
||||
};
|
||||
this.looknurseStationLabel.push(obj);
|
||||
}
|
||||
@ -782,7 +782,7 @@ export default {
|
||||
{
|
||||
labelDescription: "",
|
||||
sort: "",
|
||||
ids: 1,
|
||||
idd: 1,
|
||||
},
|
||||
];
|
||||
this.title = "添加护理站信息";
|
||||
|
||||
@ -707,6 +707,7 @@ export default {
|
||||
nurseStationshow: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
idd: 99999999,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
@ -765,7 +766,7 @@ export default {
|
||||
nurseStationName: "请选择所属护理站",
|
||||
},
|
||||
},
|
||||
ids: 1,
|
||||
idd: 1,
|
||||
// 表单校验
|
||||
rules: {
|
||||
"nurseStationItem.nurseItemName": [
|
||||
@ -958,25 +959,25 @@ export default {
|
||||
if (this.form.nurseStationItemPrices.length == 5) {
|
||||
this.$message.error("最多只能5条");
|
||||
} else {
|
||||
this.ids++;
|
||||
this.idd++;
|
||||
var obj = {
|
||||
serveDurationUnit: "",
|
||||
price: "",
|
||||
description: "",
|
||||
ids: this.ids,
|
||||
idd: this.idd,
|
||||
};
|
||||
this.form.nurseStationItemPrices.push(obj);
|
||||
}
|
||||
},
|
||||
delnurseStationItemPrices(item) {
|
||||
if (item.ids && !item.nurseItemPriceId) {
|
||||
if (item.idd && !item.nurseItemPriceId) {
|
||||
if (this.form.nurseStationItemPrices.length == 1) {
|
||||
this.$message.error("最后一条不可删除");
|
||||
} else {
|
||||
this.form.nurseStationItemPrices =
|
||||
this.form.nurseStationItemPrices.filter((e) => e.ids != item.ids);
|
||||
this.form.nurseStationItemPrices.filter((e) => e.idd != item.idd);
|
||||
}
|
||||
} else if (!item.ids && item.nurseItemPriceId) {
|
||||
} else if (!item.idd && item.nurseItemPriceId) {
|
||||
if (this.form.nurseStationItemPrices.length == 1) {
|
||||
this.$message.error("最后一条不可删除");
|
||||
} else {
|
||||
@ -1013,7 +1014,7 @@ export default {
|
||||
serveDurationUnit: null,
|
||||
price: null,
|
||||
description: null,
|
||||
ids: this.ids,
|
||||
idd: this.idd,
|
||||
},
|
||||
],
|
||||
};
|
||||
@ -1069,7 +1070,7 @@ export default {
|
||||
serveDurationUnit: "",
|
||||
price: "",
|
||||
description: "",
|
||||
ids: this.ids,
|
||||
idd: this.idd,
|
||||
};
|
||||
this.form.nurseStationItemPrices.push(obj);
|
||||
} else if (this.form.nurseStationItemPrices.length == 0) {
|
||||
@ -1077,7 +1078,7 @@ export default {
|
||||
serveDurationUnit: "",
|
||||
price: "",
|
||||
description: "",
|
||||
ids: this.ids,
|
||||
idd: this.idd,
|
||||
};
|
||||
this.form.nurseStationItemPrices.push(obj);
|
||||
} else if (this.form.nurseStationItemPrices == null) {
|
||||
@ -1085,7 +1086,7 @@ export default {
|
||||
serveDurationUnit: "",
|
||||
price: "",
|
||||
description: "",
|
||||
ids: this.ids,
|
||||
idd: this.idd,
|
||||
};
|
||||
this.form.nurseStationItemPrices.push(obj);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user