Merge remote-tracking branch 'origin/dev'
This commit is contained in:
commit
cccc7f330d
@ -49,4 +49,13 @@ export function delGoodsCategory(id) {
|
|||||||
url: '/system/goodsCategory/' + id,
|
url: '/system/goodsCategory/' + id,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//不分页
|
||||||
|
export function getStationCategoryList(parentId) {
|
||||||
|
return request({
|
||||||
|
url: `/system/goodsCategory/getStationCategoryList?parentId=${parentId}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@ -9,18 +9,9 @@
|
|||||||
label-width="100px"
|
label-width="100px"
|
||||||
>
|
>
|
||||||
<el-form-item label="所属护理站" prop="nurseStationName">
|
<el-form-item label="所属护理站" prop="nurseStationName">
|
||||||
<el-select
|
<el-button type="" class="stationbtn" @click="ParamsStation(true)">{{
|
||||||
v-model="queryParams.nurseStationId"
|
queryParams.nurseStationName
|
||||||
placeholder="请选择护理站"
|
}}</el-button>
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in handstationlist"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.nurseStationName"
|
|
||||||
:value="item.id"
|
|
||||||
>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品名称" prop="goodsName">
|
<el-form-item label="商品名称" prop="goodsName">
|
||||||
<el-input
|
<el-input
|
||||||
@ -65,7 +56,6 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -132,7 +122,6 @@
|
|||||||
align="center"
|
align="center"
|
||||||
prop="goodsCategoryName"
|
prop="goodsCategoryName"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<el-table-column label="商品用途" align="center" prop="goodsPurpose">
|
<el-table-column label="商品用途" align="center" prop="goodsPurpose">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.goodsPurpose == "BUSINESS" ? "买卖" : "" }}
|
{{ scope.row.goodsPurpose == "BUSINESS" ? "买卖" : "" }}
|
||||||
@ -161,7 +150,6 @@
|
|||||||
<div v-else></div>
|
<div v-else></div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -202,6 +190,7 @@
|
|||||||
:visible.sync="open"
|
:visible.sync="open"
|
||||||
width="1200px"
|
width="1200px"
|
||||||
append-to-body
|
append-to-body
|
||||||
|
:before-close="cancel"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
ref="form"
|
ref="form"
|
||||||
@ -224,7 +213,7 @@
|
|||||||
@click="clickinnerVisible"
|
@click="clickinnerVisible"
|
||||||
v-if="StationName == '请选择所属护理站'"
|
v-if="StationName == '请选择所属护理站'"
|
||||||
style="
|
style="
|
||||||
width: 200px;
|
width: 210px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
color: #c0c4cc;
|
color: #c0c4cc;
|
||||||
@ -237,17 +226,27 @@
|
|||||||
@click="clickinnerVisible"
|
@click="clickinnerVisible"
|
||||||
v-else
|
v-else
|
||||||
style="
|
style="
|
||||||
width: 200px;
|
width: 210px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
padding-left: -10px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
"
|
"
|
||||||
>{{ StationName }}</el-button
|
>{{ StationName }}</el-button
|
||||||
>
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品分类名称" prop="goodsCategoryId">
|
<el-form-item label="商品分类名称" prop="goodsCategoryId">
|
||||||
<el-select
|
<!-- v-model="form.parentIdList" -->
|
||||||
|
<el-cascader
|
||||||
|
:props="treeOption"
|
||||||
|
@change="change"
|
||||||
|
style="width: 210px"
|
||||||
|
:show-all-levels="false"
|
||||||
|
:clearable="true"
|
||||||
|
ref="cascader"
|
||||||
|
:placeholder="form.goodsCategoryName ? form.goodsCategoryName : ''"
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
<!-- <el-select
|
||||||
style="width: 210px"
|
style="width: 210px"
|
||||||
v-model="form.goodsCategoryId"
|
v-model="form.goodsCategoryId"
|
||||||
clearable
|
clearable
|
||||||
@ -260,7 +259,7 @@
|
|||||||
:value="item.id"
|
:value="item.id"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品用途" prop="goodsPurpose">
|
<el-form-item label="商品用途" prop="goodsPurpose">
|
||||||
<el-select
|
<el-select
|
||||||
@ -279,11 +278,20 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品度量单位" prop="goodsUnit">
|
<el-form-item label="商品度量单位" prop="goodsUnit">
|
||||||
<el-input
|
<el-input
|
||||||
|
max="8"
|
||||||
v-model="form.goodsUnit"
|
v-model="form.goodsUnit"
|
||||||
placeholder="请输入商品度量单位"
|
placeholder="请输入商品度量单位"
|
||||||
style="width: 210px"
|
style="width: 210px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="商品顺序" prop="sort">
|
||||||
|
<el-input
|
||||||
|
max="8"
|
||||||
|
v-model.number="form.sort"
|
||||||
|
placeholder="值越大排名越靠前"
|
||||||
|
style="width: 210px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="商品图片" prop="goodsPictureUrl">
|
<el-form-item label="商品图片" prop="goodsPictureUrl">
|
||||||
<stationAcatar
|
<stationAcatar
|
||||||
@imgUrl="imgUrl"
|
@imgUrl="imgUrl"
|
||||||
@ -291,7 +299,6 @@
|
|||||||
:type="'goodsPictureUrl'"
|
:type="'goodsPictureUrl'"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
ref="goodDetailsLists"
|
ref="goodDetailsLists"
|
||||||
:data="goodDetailsLists"
|
:data="goodDetailsLists"
|
||||||
@ -310,9 +317,9 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.goodsPrice"
|
v-model="scope.row.goodsPrice"
|
||||||
|
type="number"
|
||||||
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>7){value=value.slice(0,7)}"
|
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+3)} if(value.length>7){value=value.slice(0,7)}"
|
||||||
min="0"
|
min="0"
|
||||||
type="number"
|
|
||||||
placeholder="小数点后两位(元)"
|
placeholder="小数点后两位(元)"
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
@ -321,17 +328,18 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.goodsStock"
|
v-model="scope.row.goodsStock"
|
||||||
maxlength="9"
|
|
||||||
oninput="value=value.replace(/[^\d]/g,'')"
|
oninput="value=value.replace(/[^\d]/g,'')"
|
||||||
|
maxLength="9"
|
||||||
></el-input>
|
></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.attributeDetailsSort"
|
v-model.number="scope.row.attributeDetailsSort"
|
||||||
maxlength="9"
|
|
||||||
oninput="value=value.replace(/[^\d]/g,'')"
|
oninput="value=value.replace(/[^\d]/g,'')"
|
||||||
|
placeholder="值越大排名越靠前"
|
||||||
|
maxLength="9"
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -366,14 +374,13 @@
|
|||||||
style="margin-top: 20px"
|
style="margin-top: 20px"
|
||||||
>
|
>
|
||||||
<editor
|
<editor
|
||||||
@imgs="imgs"
|
@imgs="imgs"
|
||||||
:min-height="100"
|
:min-height="100"
|
||||||
style="width: 90%; margin: 0 auto"
|
style="width: 90%; margin: 0 auto"
|
||||||
v-model="form.goodsRemark"
|
v-model="form.goodsRemark"
|
||||||
></editor>
|
></editor>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
@ -381,7 +388,7 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 新增护理站名称弹框 -->
|
<!-- 新增护理站名称弹框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:title="title"
|
title="选择护理站"
|
||||||
:visible.sync="innerVisible"
|
:visible.sync="innerVisible"
|
||||||
width="1000px"
|
width="1000px"
|
||||||
append-to-body
|
append-to-body
|
||||||
@ -429,11 +436,7 @@
|
|||||||
>
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table
|
<el-table :data="nurseStationlist" @cell-dblclick="nurseclick">
|
||||||
:data="nurseStationlist"
|
|
||||||
@cell-dblclick="nurseclick"
|
|
||||||
v-loading="loading2"
|
|
||||||
>
|
|
||||||
<el-table-column label="请选择" width="100" align="center">
|
<el-table-column label="请选择" width="100" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@ -487,502 +490,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import indexjs from "./indexjs.js";
|
||||||
getGoodsInfo,
|
export default indexjs;
|
||||||
delGoodsInfo,
|
|
||||||
addGoodsInfo,
|
|
||||||
updateGoodsInfo,
|
|
||||||
updatePicture,
|
|
||||||
goodsInfoList,
|
|
||||||
goodsCategory,
|
|
||||||
editGoodsWhetherShelf,
|
|
||||||
stationList,
|
|
||||||
} from "@/api/system/OperateGoodsInfo";
|
|
||||||
import editor from "@/components/Editor";
|
|
||||||
import stationAcatar from "../stationAvatar/index.vue";
|
|
||||||
import baseurl from "@/api/baseurl.js";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { stationAcatar, editor },
|
|
||||||
name: "OperateGoodsInfo",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
imgsurl: { pictureUrlList: [] },
|
|
||||||
imgone: "",
|
|
||||||
imageUrl: "", //商品图片
|
|
||||||
value: "",
|
|
||||||
datas: null,
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
loading2: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
total2: 0,
|
|
||||||
|
|
||||||
// 商品基本信息表格数据
|
|
||||||
goodsInfoList: [],
|
|
||||||
// 护理站列表
|
|
||||||
nurseStationlist: [],
|
|
||||||
// 查询商品分类列表
|
|
||||||
goodsCategorylist: [],
|
|
||||||
handstationlist: [], //页面搜索list
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// open2: false,
|
|
||||||
innerVisible: false,
|
|
||||||
StationName: "请选择所属护理站",
|
|
||||||
nursetotal: 0,
|
|
||||||
nurseStationId: null,
|
|
||||||
goods: [
|
|
||||||
{
|
|
||||||
value: "BUSINESS",
|
|
||||||
label: "买卖",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "LEASE",
|
|
||||||
label: "租赁",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
label: "否",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
label: "是",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// goodAttributeDetailsLists:[],
|
|
||||||
goodDetailsLists: [],
|
|
||||||
ids: 9999999,
|
|
||||||
// 查询参数
|
|
||||||
shangjia: {
|
|
||||||
id: null,
|
|
||||||
whetherShelf: null,
|
|
||||||
},
|
|
||||||
getListByUserquery: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
queryParams: {
|
|
||||||
id: null,
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
storeInfoId: null,
|
|
||||||
nurseStationId: null,
|
|
||||||
goodsCategoryId: null,
|
|
||||||
goodsName: null,
|
|
||||||
// goodsCode: null,
|
|
||||||
whetherShelf: null,
|
|
||||||
shelfTime: null,
|
|
||||||
goodsPictureUrl: null,
|
|
||||||
goodsRemark: null,
|
|
||||||
goodsUnit: null,
|
|
||||||
goodsPurpose: null,
|
|
||||||
sort: null,
|
|
||||||
},
|
|
||||||
//权限查询
|
|
||||||
getListByUserquery: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {
|
|
||||||
nurseStationId: null,
|
|
||||||
},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
goodsName: [
|
|
||||||
{ required: true, message: "请输入商品名称", trigger: "blur" },
|
|
||||||
],
|
|
||||||
goodsCategoryId: [
|
|
||||||
{ required: true, message: "请选择商品分类名称", trigger: "blur" },
|
|
||||||
],
|
|
||||||
|
|
||||||
goodsPurpose: [
|
|
||||||
{ required: true, message: "请选择商品用途", trigger: "blur" },
|
|
||||||
],
|
|
||||||
goodsUnit: [
|
|
||||||
{ required: true, message: "请输入商品度量单位", trigger: "blur" },
|
|
||||||
],
|
|
||||||
goodsPictureUrl: [
|
|
||||||
{ required: true, message: "请输入选择图片", trigger: "blur" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
this.info();
|
|
||||||
this.infos();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
imgs(item) {
|
|
||||||
this.imgsurl.pictureUrlList.push(item);
|
|
||||||
},
|
|
||||||
upwhetherShelf(row) {
|
|
||||||
console.log(row);
|
|
||||||
if (row.whetherShelf == false) {
|
|
||||||
var obj = {
|
|
||||||
id: row.goodsInfoId,
|
|
||||||
whetherShelf: 0,
|
|
||||||
};
|
|
||||||
} else if (row.whetherShelf == true) {
|
|
||||||
var obj = {
|
|
||||||
id: row.goodsInfoId,
|
|
||||||
whetherShelf: 1,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
editGoodsWhetherShelf(obj).then((res) => {
|
|
||||||
console.log(obj);
|
|
||||||
if (obj.whetherShelf == 0) {
|
|
||||||
this.$modal.msgSuccess("已修改上架状态为未上架");
|
|
||||||
} else {
|
|
||||||
this.$modal.msgSuccess("已修改上架状态为上架");
|
|
||||||
}
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 查询商品基本信息列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
goodsInfoList(this.queryParams).then((response) => {
|
|
||||||
response.rows.forEach((e) => {
|
|
||||||
if (e.whetherShelf == 1) {
|
|
||||||
e.whetherShelf = true;
|
|
||||||
} else if (e.whetherShelf == 0) {
|
|
||||||
e.whetherShelf = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.goodsInfoList = response.rows;
|
|
||||||
console.log(this.goodsInfoList);
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 添加
|
|
||||||
addgoodAttributeDetail() {
|
|
||||||
console.log(this.goodDetailsLists);
|
|
||||||
if (this.goodDetailsLists.length == 5) {
|
|
||||||
this.$message.error("最多只能5条");
|
|
||||||
} else {
|
|
||||||
this.ids++;
|
|
||||||
var obj = {
|
|
||||||
attributePitureUrl: "",
|
|
||||||
goodsPrice: "",
|
|
||||||
goodsStock: "",
|
|
||||||
sort: "",
|
|
||||||
ids: this.ids,
|
|
||||||
};
|
|
||||||
this.goodDetailsLists.push(obj);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 删除
|
|
||||||
delgoodAttributeDetail(item) {
|
|
||||||
console.log(item);
|
|
||||||
if (item.ids && !item.attributeDetailsId) {
|
|
||||||
if (this.goodDetailsLists.length == 1) {
|
|
||||||
this.$message.error("最后一条不可删除");
|
|
||||||
} else {
|
|
||||||
this.goodDetailsLists = this.goodDetailsLists.filter(
|
|
||||||
(e) => e.ids != item.ids
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else if (!item.ids && item.attributeDetailsId) {
|
|
||||||
if (this.goodDetailsLists.length == 1) {
|
|
||||||
this.$message.error("最后一条不可删除");
|
|
||||||
} else {
|
|
||||||
this.goodDetailsLists = this.goodDetailsLists.filter(
|
|
||||||
(e) => e.attributeDetailsId != item.attributeDetailsId
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log(this.goodDetailsLists);
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
console.log(this.form);
|
|
||||||
var obj = { pictureUrlList: [] };
|
|
||||||
if (this.imgone != this.form.goodsPictureUrl) {
|
|
||||||
obj.pictureUrlList.push(this.form.goodsPictureUrl);
|
|
||||||
}
|
|
||||||
if (obj.pictureUrlList.length > 0) {
|
|
||||||
updatePicture(obj).then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (this.imgsurl.pictureUrlList.length > 0) {
|
|
||||||
updatePicture(this.imgsurl).then((res) => {});
|
|
||||||
}
|
|
||||||
this.imgsurl = { pictureUrlList: [] };
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
this.StationName = "请选择所属护理站";
|
|
||||||
this.goodDetailsLists = [
|
|
||||||
{
|
|
||||||
attributeName: "",
|
|
||||||
goodAttributeDetailsLists: [
|
|
||||||
{
|
|
||||||
attributePitureUrl: "",
|
|
||||||
goodsPrice: "",
|
|
||||||
goodsStock: "",
|
|
||||||
sort: "",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
clickinnerVisible() {
|
|
||||||
this.innerVisible = true;
|
|
||||||
},
|
|
||||||
nurseclick(row) {
|
|
||||||
// console.log(this.form);
|
|
||||||
console.log(row);
|
|
||||||
this.form.nurseStationId = row.id;
|
|
||||||
this.StationName = row.nurseStationName;
|
|
||||||
this.innerVisible = false;
|
|
||||||
},
|
|
||||||
handleQuery2() {
|
|
||||||
// this.getListByUserquery.pageNum = 1;
|
|
||||||
this.info();
|
|
||||||
},
|
|
||||||
resetQuery2() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
(this.getListByUserquery = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
}),
|
|
||||||
this.handleQuery2();
|
|
||||||
},
|
|
||||||
addcancel() {
|
|
||||||
this.innerVisible = false;
|
|
||||||
this.resetQuery2();
|
|
||||||
},
|
|
||||||
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
storeInfoId: null,
|
|
||||||
nurseStationId: null,
|
|
||||||
goodsCategoryId: null,
|
|
||||||
goodsName: null,
|
|
||||||
// goodsCode: null,
|
|
||||||
whetherShelf: null,
|
|
||||||
shelfTime: null,
|
|
||||||
goodsPictureUrl: null,
|
|
||||||
goodsRemark: null,
|
|
||||||
goodsUnit: null,
|
|
||||||
goodsPurpose: null,
|
|
||||||
sort: null,
|
|
||||||
createBy: null,
|
|
||||||
createTime: null,
|
|
||||||
updateBy: null,
|
|
||||||
updateTime: null,
|
|
||||||
};
|
|
||||||
this.goodDetailsLists = [
|
|
||||||
{
|
|
||||||
attributePitureUrl: "",
|
|
||||||
goodsPrice: "",
|
|
||||||
goodsStock: "",
|
|
||||||
sort: "",
|
|
||||||
ids: 9999999,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.queryParams = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
goodsName: null,
|
|
||||||
goodsCategoryName: null,
|
|
||||||
goodsPurpose: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
console.log(selection);
|
|
||||||
this.ids = selection.map((item) => item.goodsInfoId);
|
|
||||||
this.single = selection.length !== 1;
|
|
||||||
this.multiple = !selection.length;
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.nurseStationId = "";
|
|
||||||
this.title = "商品基本信息";
|
|
||||||
// this.nurseName = "请选择护理员";
|
|
||||||
this.StationName = "请选择所属护理站";
|
|
||||||
this.goodDetailsLists = [
|
|
||||||
{
|
|
||||||
attributePitureUrl: "",
|
|
||||||
goodsPrice: "",
|
|
||||||
goodsStock: "",
|
|
||||||
sort: "",
|
|
||||||
ids: 9999999,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.open = true;
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.goodsInfoId || this.ids;
|
|
||||||
this.StationName = row.nurseStationName;
|
|
||||||
if (this.StationName == null) {
|
|
||||||
this.StationName = "请选择所属护理站";
|
|
||||||
}
|
|
||||||
console.log(this.StationName);
|
|
||||||
getGoodsInfo(id).then((response) => {
|
|
||||||
this.form = response.data[0];
|
|
||||||
this.imgone = this.form.goodsPictureUrl;
|
|
||||||
if (response.data[0].goodAttributeDetailsLists) {
|
|
||||||
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
|
|
||||||
}
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改商品基本信息";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
console.log(this.form);
|
|
||||||
console.log(this.goodDetailsLists);
|
|
||||||
this.form.goodAttributeDetailsLists = [];
|
|
||||||
this.form.goodDetailsLists = this.goodDetailsLists;
|
|
||||||
console.log(this.form);
|
|
||||||
this.$refs["form"].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.goodsInfoId != null) {
|
|
||||||
this.form.id = this.form.goodsInfoId;
|
|
||||||
this.form.goodDetailsLists.forEach((e) => {
|
|
||||||
e.goodsPrice = Number(e.goodsPrice);
|
|
||||||
});
|
|
||||||
updateGoodsInfo(this.form).then((response) => {
|
|
||||||
var obj = { pictureUrlList: [] };
|
|
||||||
if (this.imgone != this.form.goodsPictureUrl) {
|
|
||||||
obj.pictureUrlList.push(this.imgone);
|
|
||||||
}
|
|
||||||
if (obj.pictureUrlList.length > 0) {
|
|
||||||
updatePicture(obj).then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.imgsurl = { pictureUrlList: [] };
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.form.goodDetailsLists.forEach((e) => {
|
|
||||||
e.goodsPrice = Number(e.goodsPrice);
|
|
||||||
});
|
|
||||||
addGoodsInfo(this.form).then((response) => {
|
|
||||||
console.log(this.form);
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.StationName = "请选择所属护理站";
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
console.log("row :>> ", row);
|
|
||||||
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning",
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
delGoodsInfo(row.goodsInfoId).then((res) => {
|
|
||||||
var obj = { pictureUrlList: [] };
|
|
||||||
obj.pictureUrlList.push(row.goodsPictureUrl);
|
|
||||||
if (obj.pictureUrlList.length > 0) {
|
|
||||||
updatePicture(obj).then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.$message.success("删除成功");
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
imgUrl(imgUrl) {
|
|
||||||
console.log(imgUrl);
|
|
||||||
this.form.goodsPictureUrl = imgUrl;
|
|
||||||
},
|
|
||||||
attributePitureUrl(imgUrl) {
|
|
||||||
console.log(imgUrl);
|
|
||||||
// this.form.attributePitureUrl = imgUrl;
|
|
||||||
},
|
|
||||||
attributePitureitem(item) {
|
|
||||||
let items = JSON.parse(item);
|
|
||||||
if (items.ids && !items.id) {
|
|
||||||
this.goodDetailsLists.forEach((e) => {
|
|
||||||
if (e.ids == items.ids) {
|
|
||||||
e.attributePitureUrl = items.attributePitureUrl;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (!items.ids && items.attributeDetailsId) {
|
|
||||||
this.goodDetailsLists.forEach((e) => {
|
|
||||||
if (e.attributeDetailsId == items.attributeDetailsId) {
|
|
||||||
e.attributePitureUrl = items.attributePitureUrl;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//权限列表
|
|
||||||
info() {
|
|
||||||
goodsCategory().then((res) => {
|
|
||||||
console.log(this.form);
|
|
||||||
this.goodsCategorylist = res.rows;
|
|
||||||
});
|
|
||||||
this.loading2 = true;
|
|
||||||
stationList(this.getListByUserquery).then((res) => {
|
|
||||||
this.nurseStationlist = res.rows;
|
|
||||||
this.total2 = res.total;
|
|
||||||
this.loading2 = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
infos() {
|
|
||||||
var queryFor = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 9999,
|
|
||||||
};
|
|
||||||
stationList(queryFor).then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
this.handstationlist = res.rows;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.stationbtn {
|
||||||
|
width: 208px;
|
||||||
|
text-align: left;
|
||||||
|
height: 32px;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
::v-deep .el-cascader .el-input input::-webkit-input-placeholder {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
499
src/views/system/OperateGoodsInfo/indexjs.js
Normal file
499
src/views/system/OperateGoodsInfo/indexjs.js
Normal file
@ -0,0 +1,499 @@
|
|||||||
|
import {
|
||||||
|
getGoodsInfo,
|
||||||
|
delGoodsInfo,
|
||||||
|
addGoodsInfo,
|
||||||
|
updateGoodsInfo,
|
||||||
|
updatePicture,
|
||||||
|
goodsInfoList,
|
||||||
|
goodsCategory,
|
||||||
|
editGoodsWhetherShelf,
|
||||||
|
stationList,
|
||||||
|
} from "@/api/system/OperateGoodsInfo";
|
||||||
|
import {
|
||||||
|
getStationCategoryList,
|
||||||
|
} 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 {
|
||||||
|
components: { stationAcatar, editor },
|
||||||
|
name: "OperateGoodsInfo",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
imgsurl: { pictureUrlList: [] },
|
||||||
|
imgone: "",
|
||||||
|
imageUrl: "", //商品图片
|
||||||
|
value: "",
|
||||||
|
datas: null,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
total2: 0,
|
||||||
|
// 商品基本信息表格数据
|
||||||
|
goodsInfoList: [],
|
||||||
|
// 护理站列表
|
||||||
|
nurseStationlist: [],
|
||||||
|
// 查询商品分类列表
|
||||||
|
goodsCategorylist: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// open2: false,
|
||||||
|
innerVisible: false,
|
||||||
|
StationName: "请选择所属护理站",
|
||||||
|
nursetotal: 0,
|
||||||
|
nurseStationId: null,
|
||||||
|
goods: [{
|
||||||
|
value: "BUSINESS",
|
||||||
|
label: "买卖",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "LEASE",
|
||||||
|
label: "租赁",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
options: [{
|
||||||
|
value: 0,
|
||||||
|
label: "否",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: "是",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// goodAttributeDetailsLists:[],
|
||||||
|
goodDetailsLists: [],
|
||||||
|
ids: 9999999,
|
||||||
|
// 查询参数
|
||||||
|
shangjia: {
|
||||||
|
id: null,
|
||||||
|
whetherShelf: null,
|
||||||
|
},
|
||||||
|
queryParams: {
|
||||||
|
id: null,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
storeInfoId: null,
|
||||||
|
nurseStationId: null,
|
||||||
|
goodsCategoryId: null,
|
||||||
|
goodsName: null,
|
||||||
|
// goodsCode: null,
|
||||||
|
whetherShelf: null,
|
||||||
|
shelfTime: null,
|
||||||
|
goodsPictureUrl: null,
|
||||||
|
goodsRemark: null,
|
||||||
|
goodsUnit: null,
|
||||||
|
goodsPurpose: null,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
|
//权限查询
|
||||||
|
getListByUserquery: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {
|
||||||
|
nurseStationId: null,
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
goodsName: [
|
||||||
|
{ required: true, message: "请输入商品名称", trigger: "blur" },
|
||||||
|
],
|
||||||
|
goodsCategoryId: [
|
||||||
|
{ required: true, message: "请选择商品分类名称", trigger: "blur" },
|
||||||
|
],
|
||||||
|
goodsPurpose: [
|
||||||
|
{ required: true, message: "请选择商品用途", trigger: "blur" },
|
||||||
|
],
|
||||||
|
goodsUnit: [
|
||||||
|
{ required: true, message: "请输入商品度量单位", trigger: "blur" },
|
||||||
|
],
|
||||||
|
goodsPictureUrl: [
|
||||||
|
{ required: true, message: "请选择图片", trigger: "blur" },
|
||||||
|
],
|
||||||
|
sort: [
|
||||||
|
{ required: true, message: "请输入商品顺序", trigger: "blur" },
|
||||||
|
|
||||||
|
],
|
||||||
|
},
|
||||||
|
homestation: null,
|
||||||
|
treeOption: {
|
||||||
|
lazy: true,
|
||||||
|
checkStrictly: true, // 是否可选择任意一级
|
||||||
|
lazyLoad(node, resolve) {
|
||||||
|
const id = (node.level === 0) ? 0 : node.data.id;
|
||||||
|
setTimeout(() => {
|
||||||
|
getStationCategoryList(id).then(res => { // 接口请求
|
||||||
|
res.data.forEach(e => {
|
||||||
|
e.value = e.id
|
||||||
|
e.label = e.goodsCategoryName
|
||||||
|
})
|
||||||
|
resolve(res.data.map(item => {
|
||||||
|
return {
|
||||||
|
...item
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ruleForm: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
// this.goodsCategoryinfo();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
imgs(item) {
|
||||||
|
this.imgsurl.pictureUrlList.push(item);
|
||||||
|
},
|
||||||
|
upwhetherShelf(row) {
|
||||||
|
if (row.whetherShelf == false) {
|
||||||
|
var obj = {
|
||||||
|
id: row.goodsInfoId,
|
||||||
|
whetherShelf: 0,
|
||||||
|
};
|
||||||
|
} else if (row.whetherShelf == true) {
|
||||||
|
var obj = {
|
||||||
|
id: row.goodsInfoId,
|
||||||
|
whetherShelf: 1,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
editGoodsWhetherShelf(obj).then((res) => {
|
||||||
|
if (obj.whetherShelf == 0) {
|
||||||
|
this.$modal.msgSuccess("已修改上架状态为未上架");
|
||||||
|
} else {
|
||||||
|
this.$modal.msgSuccess("已修改上架状态为上架");
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 查询商品基本信息列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
goodsInfoList(this.queryParams).then((response) => {
|
||||||
|
response.rows.forEach((e) => {
|
||||||
|
if (e.whetherShelf == 1) {
|
||||||
|
e.whetherShelf = true;
|
||||||
|
} else if (e.whetherShelf == 0) {
|
||||||
|
e.whetherShelf = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.goodsInfoList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 添加
|
||||||
|
addgoodAttributeDetail() {
|
||||||
|
// if (this.goodDetailsLists.length == 5) {
|
||||||
|
// this.$message.error("最多只能5条");
|
||||||
|
// } else {
|
||||||
|
this.ids++;
|
||||||
|
var obj = {
|
||||||
|
attributePitureUrl: "",
|
||||||
|
goodsPrice: "",
|
||||||
|
goodsStock: "",
|
||||||
|
attributeDetailsSort: null,
|
||||||
|
ids: this.ids,
|
||||||
|
};
|
||||||
|
this.goodDetailsLists.push(obj);
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
delgoodAttributeDetail(item) {
|
||||||
|
if (item.ids && !item.attributeDetailsId) {
|
||||||
|
if (this.goodDetailsLists.length == 1) {
|
||||||
|
this.$message.error("最后一条不可删除");
|
||||||
|
} else {
|
||||||
|
this.goodDetailsLists = this.goodDetailsLists.filter(
|
||||||
|
(e) => e.ids != item.ids
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else if (!item.ids && item.attributeDetailsId) {
|
||||||
|
if (this.goodDetailsLists.length == 1) {
|
||||||
|
this.$message.error("最后一条不可删除");
|
||||||
|
} else {
|
||||||
|
this.goodDetailsLists = this.goodDetailsLists.filter(
|
||||||
|
(e) => e.attributeDetailsId != item.attributeDetailsId
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
var obj = { pictureUrlList: [] };
|
||||||
|
if (this.imgone != this.form.goodsPictureUrl) {
|
||||||
|
obj.pictureUrlList.push(this.form.goodsPictureUrl);
|
||||||
|
}
|
||||||
|
if (obj.pictureUrlList.length > 0) {
|
||||||
|
updatePicture(obj).then((res) => {});
|
||||||
|
}
|
||||||
|
if (this.imgsurl.pictureUrlList.length > 0) {
|
||||||
|
updatePicture(this.imgsurl).then((res) => {});
|
||||||
|
}
|
||||||
|
this.imgsurl = { pictureUrlList: [] };
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
this.StationName = "请选择所属护理站";
|
||||||
|
this.goodDetailsLists = [{
|
||||||
|
attributeName: "",
|
||||||
|
goodAttributeDetailsLists: [{
|
||||||
|
attributePitureUrl: "",
|
||||||
|
goodsPrice: "",
|
||||||
|
goodsStock: "",
|
||||||
|
attributeDetailsSort: null,
|
||||||
|
}, ],
|
||||||
|
}, ];
|
||||||
|
},
|
||||||
|
//页面所属护理站
|
||||||
|
ParamsStation(item) {
|
||||||
|
this.info();
|
||||||
|
this.homestation = item
|
||||||
|
this.innerVisible = true
|
||||||
|
this.form.nurseStationId = this.queryParams.nurseStationId
|
||||||
|
},
|
||||||
|
//选择护理站
|
||||||
|
clickinnerVisible() {
|
||||||
|
this.info();
|
||||||
|
this.innerVisible = true;
|
||||||
|
},
|
||||||
|
nurseclick(row) {
|
||||||
|
if (this.homestation) {
|
||||||
|
this.queryParams.nurseStationName = row.nurseStationName;
|
||||||
|
this.queryParams.nurseStationId = row.id;
|
||||||
|
} else {
|
||||||
|
this.form.nurseStationId = row.id;
|
||||||
|
this.StationName = row.nurseStationName;
|
||||||
|
}
|
||||||
|
this.innerVisible = false;
|
||||||
|
},
|
||||||
|
handleQuery2() {
|
||||||
|
this.info();
|
||||||
|
},
|
||||||
|
resetQuery2() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.getListByUserquery = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
}
|
||||||
|
this.handleQuery2();
|
||||||
|
},
|
||||||
|
addcancel() {
|
||||||
|
this.innerVisible = false;
|
||||||
|
this.resetQuery2();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
storeInfoId: null,
|
||||||
|
nurseStationId: null,
|
||||||
|
goodsCategoryId: null,
|
||||||
|
goodsName: null,
|
||||||
|
// goodsCode: null,
|
||||||
|
whetherShelf: null,
|
||||||
|
shelfTime: null,
|
||||||
|
goodsPictureUrl: null,
|
||||||
|
goodsRemark: null,
|
||||||
|
goodsUnit: null,
|
||||||
|
goodsPurpose: null,
|
||||||
|
sort: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
};
|
||||||
|
this.goodDetailsLists = [{
|
||||||
|
attributePitureUrl: "",
|
||||||
|
goodsPrice: "",
|
||||||
|
goodsStock: "",
|
||||||
|
attributeDetailsSort: null,
|
||||||
|
ids: 9999999,
|
||||||
|
}, ];
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.queryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
goodsName: null,
|
||||||
|
goodsCategoryName: null,
|
||||||
|
goodsPurpose: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map((item) => item.goodsInfoId);
|
||||||
|
this.single = selection.length !== 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.homestation = null;
|
||||||
|
this.nurseStationId = "";
|
||||||
|
this.title = "商品基本信息";
|
||||||
|
// this.nurseName = "请选择护理员";
|
||||||
|
this.StationName = "请选择所属护理站";
|
||||||
|
this.goodDetailsLists = [{
|
||||||
|
attributePitureUrl: "",
|
||||||
|
goodsPrice: "",
|
||||||
|
goodsStock: "",
|
||||||
|
sort: null,
|
||||||
|
ids: 9999999,
|
||||||
|
}, ];
|
||||||
|
this.open = true;
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
this.homestation = null;
|
||||||
|
const id = row.goodsInfoId || this.ids;
|
||||||
|
this.StationName = row.nurseStationName;
|
||||||
|
if (this.StationName == null) {
|
||||||
|
this.StationName = "请选择所属护理站";
|
||||||
|
}
|
||||||
|
getGoodsInfo(id).then((response) => {
|
||||||
|
// response.data.parentIdList = response.data.parentIdList.split(',')
|
||||||
|
this.form = response.data;
|
||||||
|
this.imgone = this.form.goodsPictureUrl;
|
||||||
|
if (response.data.goodAttributeDetailsLists) {
|
||||||
|
this.goodDetailsLists = response.data.goodAttributeDetailsLists;
|
||||||
|
}
|
||||||
|
// console.log(this.form.parentIdList)
|
||||||
|
// this.form.goodsCategoryId = this.form.goodsCategoryName
|
||||||
|
// this.form.value = this.form.goodsCategoryId
|
||||||
|
// this.form.label = this.form.goodsCategoryName
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改商品基本信息";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.form.goodAttributeDetailsLists = [];
|
||||||
|
this.form.goodDetailsLists = this.goodDetailsLists;
|
||||||
|
this.$refs["form"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.goodsInfoId != null) {
|
||||||
|
this.form.id = this.form.goodsInfoId;
|
||||||
|
this.form.goodDetailsLists.forEach(e => {
|
||||||
|
e.goodsPrice = Number(e.goodsPrice)
|
||||||
|
if (e.attributeDetailsSort == '') {
|
||||||
|
e.attributeDetailsSort = null
|
||||||
|
}
|
||||||
|
// e.sort = e.attributeDetailsSort
|
||||||
|
})
|
||||||
|
updateGoodsInfo(this.form).then((response) => {
|
||||||
|
var obj = { pictureUrlList: [] };
|
||||||
|
if (this.imgone != this.form.goodsPictureUrl) {
|
||||||
|
obj.pictureUrlList.push(this.imgone);
|
||||||
|
}
|
||||||
|
this.imgsurl = { pictureUrlList: [] };
|
||||||
|
if (obj.pictureUrlList.length > 0) {
|
||||||
|
updatePicture(obj).then((res) => {});
|
||||||
|
}
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.form.goodDetailsLists.forEach(e => {
|
||||||
|
e.goodsPrice = Number(e.goodsPrice)
|
||||||
|
})
|
||||||
|
// this.nurseStationId=this.form.nurseStationId
|
||||||
|
addGoodsInfo(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.StationName = "请选择所属护理站";
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
this.$confirm("是否确认删除订单信息的数据项?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delGoodsInfo(row.goodsInfoId).then((res) => {
|
||||||
|
var obj = { pictureUrlList: [] };
|
||||||
|
obj.pictureUrlList.push(row.goodsPictureUrl);
|
||||||
|
if (obj.pictureUrlList.length > 0) {
|
||||||
|
updatePicture(obj).then((res) => {});
|
||||||
|
}
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
imgUrl(imgUrl) {
|
||||||
|
this.form.goodsPictureUrl = imgUrl;
|
||||||
|
},
|
||||||
|
attributePitureUrl(imgUrl) {
|
||||||
|
// this.form.attributePitureUrl = imgUrl;
|
||||||
|
},
|
||||||
|
attributePitureitem(item) {
|
||||||
|
let items = JSON.parse(item);
|
||||||
|
if (items.ids && !items.id) {
|
||||||
|
this.goodDetailsLists.forEach((e) => {
|
||||||
|
if (e.ids == items.ids) {
|
||||||
|
e.attributePitureUrl = items.attributePitureUrl;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (!items.ids && items.attributeDetailsId) {
|
||||||
|
this.goodDetailsLists.forEach((e) => {
|
||||||
|
if (e.attributeDetailsId == items.attributeDetailsId) {
|
||||||
|
e.attributePitureUrl = items.attributePitureUrl;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//商品分类
|
||||||
|
goodsCategoryinfo() {
|
||||||
|
getStationCategoryList(0).then((res) => {
|
||||||
|
res.data.forEach(e => {
|
||||||
|
e.value = e.id
|
||||||
|
e.label = e.goodsCategoryName
|
||||||
|
})
|
||||||
|
this.goodsCategorylist = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
change(e) {
|
||||||
|
this.form.goodsCategoryId = e[e.length - 1]
|
||||||
|
},
|
||||||
|
//护理站
|
||||||
|
info() {
|
||||||
|
stationList(this.getListByUserquery).then((res) => {
|
||||||
|
this.nurseStationlist = res.rows;
|
||||||
|
this.total2 = res.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
@ -1,88 +1,111 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form
|
<el-row :gutter="20">
|
||||||
:model="queryParams"
|
<!--部门数据-->
|
||||||
ref="queryForm"
|
<el-col :span="4" :xs="24">
|
||||||
size="small"
|
<!-- <div class="head-container">
|
||||||
:inline="true"
|
<el-input
|
||||||
v-show="showSearch"
|
v-model="goodsCategoryName"
|
||||||
label-width="100px"
|
placeholder="请输入区域名称"
|
||||||
>
|
clearable
|
||||||
<el-form-item label="商品分类名称" prop="goodsCategoryName">
|
size="small"
|
||||||
<el-input
|
prefix-icon="el-icon-search"
|
||||||
v-model="queryParams.goodsCategoryName"
|
style="margin-bottom: 20px"
|
||||||
placeholder="请输入商品分类名称"
|
/>
|
||||||
clearable
|
</div> -->
|
||||||
@keyup.enter.native="handleQuery"
|
<div class="head-container" style="height: 580px; overflow-y: auto">
|
||||||
/>
|
<el-tree
|
||||||
</el-form-item>
|
:data="deptOptions"
|
||||||
<el-form-item label="商品分类编码" prop="goodsCategoryCode">
|
:props="defaultProps"
|
||||||
<el-input
|
@node-click="handleNodeClick"
|
||||||
v-model="queryParams.goodsCategoryCode"
|
@node-expand="handleNodeClick"
|
||||||
placeholder="请输入商品分类编码"
|
></el-tree>
|
||||||
clearable
|
</div>
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="显示顺序" prop="sort">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.sort"
|
|
||||||
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="['system:goodsCategory:add']"
|
|
||||||
>新增</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!--用户数据-->
|
||||||
<el-button
|
<el-col :span="20" :xs="24">
|
||||||
type="success"
|
<el-form
|
||||||
plain
|
:model="queryParams"
|
||||||
icon="el-icon-edit"
|
ref="queryForm"
|
||||||
size="mini"
|
size="small"
|
||||||
:disabled="single"
|
:inline="true"
|
||||||
@click="handleUpdate"
|
v-show="showSearch"
|
||||||
v-hasPermi="['system:goodsCategory:edit']"
|
label-width="100px"
|
||||||
>修改</el-button
|
|
||||||
>
|
>
|
||||||
</el-col>
|
<el-form-item label="商品分类名称" prop="goodsCategoryName">
|
||||||
<el-col :span="1.5">
|
<el-input
|
||||||
<el-button
|
v-model="queryParams.goodsCategoryName"
|
||||||
type="danger"
|
placeholder="请输入商品分类名称"
|
||||||
plain
|
clearable
|
||||||
icon="el-icon-delete"
|
@keyup.enter.native="handleQuery"
|
||||||
size="mini"
|
/>
|
||||||
:disabled="multiple"
|
</el-form-item>
|
||||||
@click="handleDelete"
|
<el-form-item label="商品分类编码" prop="goodsCategoryCode">
|
||||||
v-hasPermi="['system:goodsCategory:remove']"
|
<el-input
|
||||||
>删除</el-button
|
v-model="queryParams.goodsCategoryCode"
|
||||||
>
|
placeholder="请输入商品分类编码"
|
||||||
</el-col>
|
clearable
|
||||||
<!-- <el-col :span="1.5">
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="显示顺序" prop="sort">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.sort"
|
||||||
|
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="['system:goodsCategory: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="['system:goodsCategory: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="['system:goodsCategory:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@ -93,74 +116,105 @@
|
|||||||
>导出</el-button
|
>导出</el-button
|
||||||
>
|
>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
:showSearch.sync="showSearch"
|
:showSearch.sync="showSearch"
|
||||||
@queryTable="getList"
|
@queryTable="getList"
|
||||||
></right-toolbar>
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="goodsCategoryList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
label="商品分类名称"
|
||||||
|
align="center"
|
||||||
|
prop="goodsCategoryName"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="商品分类编码"
|
||||||
|
align="center"
|
||||||
|
prop="goodsCategoryCode"
|
||||||
|
/>
|
||||||
|
<!-- <el-table-column label="商品分类图片地址" align="center" prop="goodsCategoryPicture" /> -->
|
||||||
|
<el-table-column
|
||||||
|
label="分类概述"
|
||||||
|
align="center"
|
||||||
|
prop="categoryRemark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column label="显示顺序" align="center" prop="sort" />
|
||||||
|
<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="['system:goodsCategory:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:goodsCategory: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-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
|
||||||
v-loading="loading"
|
|
||||||
:data="goodsCategoryList"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
label="商品分类名称"
|
|
||||||
align="center"
|
|
||||||
prop="goodsCategoryName"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="商品分类编码"
|
|
||||||
align="center"
|
|
||||||
prop="goodsCategoryCode"
|
|
||||||
/>
|
|
||||||
<!-- <el-table-column label="商品分类图片地址" align="center" prop="goodsCategoryPicture" /> -->
|
|
||||||
<el-table-column
|
|
||||||
label="分类概述"
|
|
||||||
align="center"
|
|
||||||
prop="categoryRemark"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column label="显示顺序" align="center" prop="sort" />
|
|
||||||
<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="['system:goodsCategory:edit']"
|
|
||||||
>修改</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['system:goodsCategory: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="500px" append-to-body>
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="open"
|
||||||
|
width="500px"
|
||||||
|
append-to-body
|
||||||
|
:before-close="cancel"
|
||||||
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
|
<el-form-item
|
||||||
|
label="父级分类名称"
|
||||||
|
prop="parentName"
|
||||||
|
:required="true"
|
||||||
|
v-if="form.parentId"
|
||||||
|
>
|
||||||
|
<el-cascader
|
||||||
|
:props="treeOption"
|
||||||
|
@change="change"
|
||||||
|
style="width: 340px"
|
||||||
|
:show-all-levels="false"
|
||||||
|
ref="cascader"
|
||||||
|
:key="isResouceShow"
|
||||||
|
:placeholder="form.parentName ? form.parentName : ''"
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
<!-- <el-input
|
||||||
|
v-model="form.parentName"
|
||||||
|
placeholder="请输入父级分类名称"
|
||||||
|
maxlength="10"
|
||||||
|
disabled
|
||||||
|
/> -->
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="商品分类名称" prop="goodsCategoryName">
|
<el-form-item label="商品分类名称" prop="goodsCategoryName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.goodsCategoryName"
|
v-model="form.goodsCategoryName"
|
||||||
@ -215,14 +269,40 @@ import {
|
|||||||
updatePicture,
|
updatePicture,
|
||||||
addGoodsCategory,
|
addGoodsCategory,
|
||||||
updateGoodsCategory,
|
updateGoodsCategory,
|
||||||
|
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";
|
import baseurl from "@/api/baseurl";
|
||||||
|
let id = 0;
|
||||||
export default {
|
export default {
|
||||||
name: "GoodsCategory",
|
name: "GoodsCategory",
|
||||||
components: { stationAcatar },
|
components: { stationAcatar },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isResouceShow: 1,
|
||||||
|
treeOption: {
|
||||||
|
lazy: true,
|
||||||
|
checkStrictly: true, // 是否可选择任意一级
|
||||||
|
lazyLoad(node, resolve) {
|
||||||
|
const id = node.level === 0 ? 0 : node.data.id;
|
||||||
|
setTimeout(() => {
|
||||||
|
getStationCategoryList(id).then((res) => {
|
||||||
|
// 接口请求
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
e.value = e.id;
|
||||||
|
e.label = e.goodsCategoryName;
|
||||||
|
});
|
||||||
|
resolve(
|
||||||
|
res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
|
},
|
||||||
imgone: "",
|
imgone: "",
|
||||||
baseurl: "",
|
baseurl: "",
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@ -252,6 +332,8 @@ export default {
|
|||||||
goodsCategoryPicture: null,
|
goodsCategoryPicture: null,
|
||||||
categoryRemark: null,
|
categoryRemark: null,
|
||||||
sort: null,
|
sort: null,
|
||||||
|
parentId: 0,
|
||||||
|
parentName: "",
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
@ -273,14 +355,68 @@ export default {
|
|||||||
{ required: true, message: "显示顺序不能为空", trigger: "blur" },
|
{ required: true, message: "显示顺序不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
// 树选项
|
||||||
|
deptOptions: undefined,
|
||||||
|
categoryLevel: null,
|
||||||
|
defaultProps: {
|
||||||
|
children: "children",
|
||||||
|
label: "goodsCategoryName",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.baseurl = baseurl;
|
this.baseurl = baseurl;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.info();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
change(e) {
|
||||||
|
this.form.parentId = e[e.length - 1];
|
||||||
|
},
|
||||||
|
// 节点单击事件
|
||||||
|
handleNodeClick(data) {
|
||||||
|
this.loading = true;
|
||||||
|
this.queryParams.parentId = data.id;
|
||||||
|
this.queryParams.parentName = data.goodsCategoryName;
|
||||||
|
// this.categoryLevel = data.categoryLevel;
|
||||||
|
this.handleQuery();
|
||||||
|
getStationCategoryList(data.id).then((res) => {
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
e.children = [
|
||||||
|
{
|
||||||
|
goodsCategoryName: "",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
data.children = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 查询商品分类信息列表 */
|
/** 查询商品分类信息列表 */
|
||||||
|
info() {
|
||||||
|
this.loading = true;
|
||||||
|
getStationCategoryList(0).then((res) => {
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
e.children = [
|
||||||
|
{
|
||||||
|
goodsCategoryName: "",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
|
var obj = [
|
||||||
|
{
|
||||||
|
goodsCategoryName: "商品分类名称",
|
||||||
|
children: res.data,
|
||||||
|
id: 0,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
this.deptOptions = obj;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listGoodsCategory(this.queryParams).then((response) => {
|
listGoodsCategory(this.queryParams).then((response) => {
|
||||||
@ -291,15 +427,13 @@ export default {
|
|||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
console.log(this.form);
|
++this.isResouceShow;
|
||||||
var obj = { pictureUrlList: [] };
|
var obj = { pictureUrlList: [] };
|
||||||
if (this.imgone != this.form.goodsCategoryPicture) {
|
if (this.imgone != this.form.goodsCategoryPicture) {
|
||||||
obj.pictureUrlList.push(this.form.goodsCategoryPicture);
|
obj.pictureUrlList.push(this.form.goodsCategoryPicture);
|
||||||
}
|
}
|
||||||
if (obj.pictureUrlList.length > 0) {
|
if (obj.pictureUrlList.length > 0) {
|
||||||
updatePicture(obj).then((res) => {
|
updatePicture(obj).then((res) => {});
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.reset();
|
this.reset();
|
||||||
@ -317,6 +451,8 @@ export default {
|
|||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
|
parentId: null,
|
||||||
|
parentName: null,
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
@ -327,6 +463,11 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
|
this.queryParams = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
parentId: 0,
|
||||||
|
};
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
@ -341,6 +482,12 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加商品分类信息";
|
this.title = "添加商品分类信息";
|
||||||
|
console.log(this.queryParams);
|
||||||
|
// if (this.queryParams.parentId != 0) {
|
||||||
|
this.form.parentId = this.queryParams.parentId;
|
||||||
|
// }
|
||||||
|
this.form.parentName = this.queryParams.parentName;
|
||||||
|
// this.form.categoryLevel = this.categoryLevel;
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
@ -356,8 +503,6 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
console.log(this.form);
|
|
||||||
|
|
||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
@ -367,19 +512,21 @@ export default {
|
|||||||
obj.pictureUrlList.push(this.imgone);
|
obj.pictureUrlList.push(this.imgone);
|
||||||
}
|
}
|
||||||
if (obj.pictureUrlList.length > 0) {
|
if (obj.pictureUrlList.length > 0) {
|
||||||
updatePicture(obj).then((res) => {
|
updatePicture(obj).then((res) => {});
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
++this.isResouceShow;
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.info();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addGoodsCategory(this.form).then((response) => {
|
addGoodsCategory(this.form).then((response) => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
++this.isResouceShow;
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.info();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -387,9 +534,10 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
console.log(row);
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认删除商品分类信息编号为"' + ids + '"的数据项?')
|
.confirm("是否确认删除?")
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return delGoodsCategory(ids);
|
return delGoodsCategory(ids);
|
||||||
})
|
})
|
||||||
@ -422,3 +570,9 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-cascader .el-input input::-webkit-input-placeholder {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,9 @@ import {
|
|||||||
editGoodsWhetherShelf,
|
editGoodsWhetherShelf,
|
||||||
} from "@/api/system/goodsInfo";
|
} from "@/api/system/goodsInfo";
|
||||||
import editor from "@/components/Editor";
|
import editor from "@/components/Editor";
|
||||||
|
import {
|
||||||
|
getStationCategoryList,
|
||||||
|
} 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";
|
import baseurl from "@/api/baseurl.js";
|
||||||
@ -26,7 +29,6 @@ export default {
|
|||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
single: true,
|
single: true,
|
||||||
// 非多个禁用
|
// 非多个禁用
|
||||||
@ -79,10 +81,6 @@ export default {
|
|||||||
id: null,
|
id: null,
|
||||||
whetherShelf: null,
|
whetherShelf: null,
|
||||||
},
|
},
|
||||||
getListByUserquery: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
queryParams: {
|
queryParams: {
|
||||||
id: null,
|
id: null,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -135,6 +133,27 @@ export default {
|
|||||||
{ required: true, message: "请输入商品顺序", trigger: "blur" },
|
{ required: true, message: "请输入商品顺序", trigger: "blur" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
isResouceShow: 1,
|
||||||
|
treeOption: {
|
||||||
|
lazy: true,
|
||||||
|
checkStrictly: true, // 是否可选择任意一级
|
||||||
|
lazyLoad(node, resolve) {
|
||||||
|
const id = (node.level === 0) ? 0 : node.data.id;
|
||||||
|
setTimeout(() => {
|
||||||
|
getStationCategoryList(id).then(res => { // 接口请求
|
||||||
|
res.data.forEach(e => {
|
||||||
|
e.value = e.id
|
||||||
|
e.label = e.goodsCategoryName
|
||||||
|
})
|
||||||
|
resolve(res.data.map(item => {
|
||||||
|
return {
|
||||||
|
...item
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -222,11 +241,10 @@ export default {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(this.goodDetailsLists);
|
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
console.log(this.form);
|
++this.isResouceShow;
|
||||||
var obj = { pictureUrlList: [] };
|
var obj = { pictureUrlList: [] };
|
||||||
if (this.imgone != this.form.goodsPictureUrl) {
|
if (this.imgone != this.form.goodsPictureUrl) {
|
||||||
obj.pictureUrlList.push(this.form.goodsPictureUrl);
|
obj.pictureUrlList.push(this.form.goodsPictureUrl);
|
||||||
@ -253,7 +271,6 @@ export default {
|
|||||||
}, ],
|
}, ],
|
||||||
}, ];
|
}, ];
|
||||||
},
|
},
|
||||||
|
|
||||||
handleQuery2() {
|
handleQuery2() {
|
||||||
// this.getListByUserquery.pageNum = 1;
|
// this.getListByUserquery.pageNum = 1;
|
||||||
this.getList2();
|
this.getList2();
|
||||||
@ -275,7 +292,6 @@ export default {
|
|||||||
addcancel() {
|
addcancel() {
|
||||||
this.resetQuery2();
|
this.resetQuery2();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
@ -351,22 +367,20 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
console.log(row);
|
|
||||||
// this.reset();
|
// this.reset();
|
||||||
const id = row.goodsInfoId || this.ids;
|
const id = row.goodsInfoId || this.ids;
|
||||||
getGoodsInfo(id).then((response) => {
|
getGoodsInfo(id).then((response) => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
this.form = response.data[0];
|
this.form = response.data;
|
||||||
this.form.nurseStationName = row.nurseStationName;
|
this.form.nurseStationName = row.nurseStationName;
|
||||||
this.imgone = this.form.goodsPictureUrl;
|
this.imgone = this.form.goodsPictureUrl;
|
||||||
if (response.data[0].goodAttributeDetailsLists) {
|
if (response.data.goodAttributeDetailsLists) {
|
||||||
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
|
this.goodDetailsLists = response.data.goodAttributeDetailsLists;
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改商品基本信息";
|
this.title = "修改商品基本信息";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
console.log(this.form);
|
console.log(this.form);
|
||||||
@ -392,6 +406,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.imgsurl = { pictureUrlList: [] };
|
this.imgsurl = { pictureUrlList: [] };
|
||||||
|
++this.isResouceShow;
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -401,9 +416,8 @@ export default {
|
|||||||
e.goodsPrice = Number(e.goodsPrice);
|
e.goodsPrice = Number(e.goodsPrice);
|
||||||
});
|
});
|
||||||
addGoodsInfo(this.form).then((response) => {
|
addGoodsInfo(this.form).then((response) => {
|
||||||
console.log(this.form);
|
++this.isResouceShow;
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
|
||||||
// this.StationName = "请选择所属护理站";
|
// this.StationName = "请选择所属护理站";
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@ -499,6 +513,9 @@ export default {
|
|||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
change(e) {
|
||||||
|
this.form.goodsCategoryId = e[e.length - 1]
|
||||||
|
},
|
||||||
infos() {
|
infos() {
|
||||||
var queryFor = {
|
var queryFor = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -510,4 +527,4 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -203,6 +203,7 @@
|
|||||||
:visible.sync="open"
|
:visible.sync="open"
|
||||||
width="1200px"
|
width="1200px"
|
||||||
append-to-body
|
append-to-body
|
||||||
|
:before-close="cancel"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
ref="form"
|
ref="form"
|
||||||
@ -220,7 +221,6 @@
|
|||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="商品名称" prop="goodsName">
|
<el-form-item label="商品名称" prop="goodsName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.goodsName"
|
v-model="form.goodsName"
|
||||||
@ -230,7 +230,18 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品分类名称" prop="goodsCategoryId">
|
<el-form-item label="商品分类名称" prop="goodsCategoryId">
|
||||||
<el-select
|
<el-cascader
|
||||||
|
:props="treeOption"
|
||||||
|
@change="change"
|
||||||
|
style="width: 210px"
|
||||||
|
:show-all-levels="false"
|
||||||
|
:clearable="true"
|
||||||
|
:key="isResouceShow"
|
||||||
|
ref="cascader"
|
||||||
|
:placeholder="form.goodsCategoryName ? form.goodsCategoryName : ''"
|
||||||
|
>
|
||||||
|
</el-cascader>
|
||||||
|
<!-- <el-select
|
||||||
style="width: 210px"
|
style="width: 210px"
|
||||||
v-model="form.goodsCategoryId"
|
v-model="form.goodsCategoryId"
|
||||||
clearable
|
clearable
|
||||||
@ -243,7 +254,7 @@
|
|||||||
:value="item.id"
|
:value="item.id"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品用途" prop="goodsPurpose">
|
<el-form-item label="商品用途" prop="goodsPurpose">
|
||||||
<el-select
|
<el-select
|
||||||
@ -478,5 +489,9 @@ import goodsInfojs from "./goodsInfojs";
|
|||||||
export default goodsInfojs;
|
export default goodsInfojs;
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-cascader .el-input input::-webkit-input-placeholder {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -908,10 +908,10 @@ export default {
|
|||||||
sort: null,
|
sort: null,
|
||||||
nurseStationConsumables: [
|
nurseStationConsumables: [
|
||||||
{
|
{
|
||||||
nurseStationId: "",
|
nurseStationId: null,
|
||||||
consumableUnit: null,
|
consumableUnit: null,
|
||||||
sort: "",
|
sort: null,
|
||||||
consumablePrice: "",
|
consumablePrice: null,
|
||||||
consumableDetail: null,
|
consumableDetail: null,
|
||||||
nurseStationName: "请选择所属护理站",
|
nurseStationName: "请选择所属护理站",
|
||||||
},
|
},
|
||||||
|
|||||||
@ -289,7 +289,6 @@
|
|||||||
:min-height="82"
|
:min-height="82"
|
||||||
style="width: 90%"
|
style="width: 90%"
|
||||||
maxlength="300"
|
maxlength="300"
|
||||||
|
|
||||||
v-model="form.nurseStationItem.nurseItemContent"
|
v-model="form.nurseStationItem.nurseItemContent"
|
||||||
></editor>
|
></editor>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -804,7 +803,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
imgs(item) {
|
imgs(item) {
|
||||||
console.log(item)
|
|
||||||
this.imgsurl.pictureUrlList.push(item);
|
this.imgsurl.pictureUrlList.push(item);
|
||||||
},
|
},
|
||||||
imgUrl(imgUrl) {
|
imgUrl(imgUrl) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user