Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
shidongli 2022-10-31 16:46:35 +08:00
commit 3a3bc7c6b8
6 changed files with 250 additions and 247 deletions

View File

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

View File

@ -20,7 +20,7 @@ export function goodsInfoList(query) {
// 查询商品基本信息详细
export function getGoodsInfo(id) {
return request({
url: `/system/goodsInfo/goodsDetails?`+`goodsInfoId=${id}`,
url: `/system/goodsInfo/goodsDetails?` + `goodsInfoId=${id}`,
// url: '/system/goodsInfo/goodsDetails/' + goodsInfoId,
method: 'get'
})
@ -55,7 +55,7 @@ export function goodsCategory(query) {
export function updateGoodsInfo(data) {
return request({
url: '/system/goodsInfo/edit',
method: 'put',
method: 'POST',
data: data
})
}
@ -75,4 +75,4 @@ export function delGoodsInfo(id) {
url: '/system/goodsInfo/' + id,
method: 'delete'
})
}
}

View File

@ -141,7 +141,6 @@
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -178,7 +177,7 @@
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
@ -188,13 +187,12 @@
v-hasPermi="['system:goodsInfo:export']"
>导出</el-button
>
</el-col>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="goodsInfoList"
@ -240,7 +238,12 @@
align="center"
prop="shelfTime"
width="180"
/>
>
<template slot-scope="scope">
<div v-if="scope.row.whetherShelf">{{ scope.row.shelfTime }}</div>
<div v-else></div>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
@ -266,7 +269,6 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
@ -274,9 +276,13 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改商品基本信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-dialog
:title="title"
:visible.sync="open"
width="1200px"
append-to-body
>
<el-form
ref="form"
:model="form"
@ -351,7 +357,7 @@
/>
</el-form-item>
<el-form-item label="商品图片" prop="goodsPictureUrl">
<goodsCategoryAcatar
<stationAcatar
@imgUrl="imgUrl"
:img="form.goodsPictureUrl"
:type="'goodsPictureUrl'"
@ -364,15 +370,7 @@
label-width="50px"
style="margin-top: 20px"
>
<el-table-column label="显示顺序" width="100" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.goodAttributeDetailsLists[0].sort"
maxlength="40"
></el-input>
</template>
</el-table-column>
<el-table-column label="商品属性名称" width="100" align="center">
<el-table-column label="商品属性名称" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.attributeName"
@ -380,33 +378,42 @@
></el-input>
</template>
</el-table-column>
<el-table-column label="商品单价" width="100" align="center">
<el-table-column label="商品单价" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.goodAttributeDetailsLists[0].goodsPrice"
v-model="scope.row.goodsPrice"
maxlength="40"
></el-input>
</template>
</el-table-column>
<el-table-column label="库存" width="100" align="center">
<el-table-column label="库存" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.goodAttributeDetailsLists[0].goodsStock"
v-model="scope.row.goodsStock"
maxlength="40"
></el-input>
</template>
</el-table-column>
<el-table-column label="商品属性图片" width="100" align="center">
<el-table-column label="显示顺序" align="center">
<template slot-scope="scope">
<el-input
v-model="
scope.row.goodAttributeDetailsLists[0].attributePitureUrl
"
v-model="scope.row.attributeDetailsSort"
maxlength="40"
></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<el-table-column label="商品属性图片" align="center">
<template slot-scope="scope">
<stationAcatar
@imgUrl="attributePitureUrl"
@item="attributePitureitem"
:img="scope.row.attributePitureUrl"
:type="'attributePitureUrl'"
:item="scope.row"
/>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="addgoodAttributeDetail"
>新增</el-button
@ -442,7 +449,7 @@
<el-dialog
:title="title"
:visible.sync="open2"
width="700px"
width="1000px"
append-to-body
>
<el-form
@ -525,11 +532,10 @@
/>
</el-form-item>
<el-form-item label="商品图片" prop="goodsPictureUrl">
<goodsCategoryAcatar
@imgUrl="imgUrl"
:img="form.goodsPictureUrl"
:type="'goodsPictureUrl'"
:disabled="true"
<img
:src="form.goodsPictureUrl"
alt=""
style="width: 150px; height: 150px"
/>
</el-form-item>
@ -539,64 +545,29 @@
label-width="50px"
style="margin-top: 20px"
>
<el-table-column label="显示顺序" width="100" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.goodAttributeDetailsLists[0].sort"
maxlength="40"
:disabled="true"
></el-input>
</template>
<el-table-column
label="商品属性名称"
align="center"
prop="attributeName"
>
</el-table-column>
<el-table-column label="商品属性名称" width="100" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.attributeName"
maxlength="40"
:disabled="true"
></el-input>
</template>
<el-table-column label="商品单价" align="center" prop="goodsPrice">
</el-table-column>
<el-table-column label="商品单价" width="100" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.goodAttributeDetailsLists[0].goodsPrice"
maxlength="40"
:disabled="true"
></el-input>
</template>
<el-table-column label="库存" align="center" prop="goodsStock">
</el-table-column>
<el-table-column label="库存" width="100" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.goodAttributeDetailsLists[0].goodsStock"
maxlength="40"
:disabled="true"
></el-input>
</template>
<el-table-column
label="显示顺序"
align="center"
prop="attributeDetailsSort"
>
</el-table-column>
<el-table-column label="商品属性图片" width="100" align="center">
<el-table-column label="商品属性图片" align="center">
<template slot-scope="scope">
<el-input
v-model="
scope.row.goodAttributeDetailsLists[0].attributePitureUrl
"
maxlength="40"
:disabled="true"
></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="addgoodAttributeDetail"
>新增</el-button
>
<el-button
size="mini"
type="text"
@click="delgoodAttributeDetail(scope.row)"
>删除</el-button
>
<img
:src="scope.row.attributePitureUrl"
alt=""
style="width: 100px; height: 100px"
/>
</template>
</el-table-column>
</el-table>
@ -605,34 +576,53 @@
prop="goodsRemark"
style="margin-top: 20px"
>
<editor
<textarea
style="margin-left: 30px"
v-model="form.goodsRemark"
name=""
id=""
cols="130"
rows="10"
:disabled="true"
></textarea>
<!-- <editor
:min-height="100"
style="width: 90%; margin: 0 auto"
v-model="form.goodsRemark"
:disabled="true"
></editor>
></editor> -->
</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>
<el-button @click="open2 = false">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listGoodsInfo, getGoodsInfo, delGoodsInfo, addGoodsInfo, updateGoodsInfo, goodsInfoList, listStation, goodsCategory, editGoodsWhetherShelf } from "@/api/system/goodsInfo";
import goodsCategoryAcatar from "../goodsCategoryAcatar/index.vue";
import {
listGoodsInfo,
getGoodsInfo,
delGoodsInfo,
addGoodsInfo,
updateGoodsInfo,
goodsInfoList,
listStation,
goodsCategory,
editGoodsWhetherShelf,
} from "@/api/system/goodsInfo";
import editor from "@/components/Editor";
import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl.js";
export default {
components: { goodsCategoryAcatar, editor },
components: { stationAcatar, editor },
name: "GoodsInfo",
data() {
return {
value: '',
imageUrl: "", //
value: "",
datas: null,
//
loading: true,
@ -659,47 +649,35 @@ export default {
open2: false,
goods: [
{
value: 'BUSINESS',
label: '买卖'
value: "BUSINESS",
label: "买卖",
},
{
value: 'LEASE',
label: '租赁'
}
value: "LEASE",
label: "租赁",
},
],
options: [
{
value: 0,
label: '否'
label: "否",
},
{
value: 1,
label: '是'
}
label: "是",
},
],
// goodAttributeDetailsLists:[],
goodDetailsLists: [
{
attributeName: "",
goodAttributeDetailsLists: [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 1,
}],
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 9999,
},
],
// goodAttributeDetailsLists: [{
// attributeName: "",
// attributePitureUrl: "",
// goodsPrice: "",
// goodsStock: "",
// sort: "",
// ids: 1,
// }],
ids: 1,
ids: 9999,
//
shangjia: {
id: null,
@ -725,8 +703,7 @@ export default {
//
form: {},
//
rules: {
}
rules: {},
};
},
created() {
@ -735,85 +712,72 @@ export default {
},
methods: {
upwhetherShelf(row) {
console.log(row)
console.log(row);
if (row.whetherShelf == false) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 0
}
whetherShelf: 0,
};
} else if (row.whetherShelf == true) {
var obj = {
id: row.goodsInfoId,
whetherShelf: 1
}
whetherShelf: 1,
};
}
editGoodsWhetherShelf(obj).then((res => {
console.log(res)
}))
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 => {
goodsInfoList(this.queryParams).then((response) => {
response.rows.forEach((e) => {
if (e.whetherShelf == 1) {
e.whetherShelf = true
e.whetherShelf = true;
} else if (e.whetherShelf == 0) {
e.whetherShelf = false
e.whetherShelf = false;
}
})
});
this.goodsInfoList = response.rows;
console.log(this.goodsInfoList)
console.log(this.goodsInfoList);
this.total = response.total;
this.loading = false;
});
},
list() {
listStation().then((res) => {
console.log(res)
console.log(res);
this.nurseStationlist = res.data;
});
goodsCategory().then((res) => {
console.log(this.form)
console.log(this.form);
this.goodsCategorylist = res.rows;
})
},
imgUrl(imgUrl) {
console.log(imgUrl);
this.form.goodsPictureUrl = imgUrl;
},
//
Putshelves(row) {
console.log(row)
this.shangjia = {
id: row.goodsInfoId,
whetherShelf: row.whetherShelf,
},
editGoodsWhetherShelf(this.shangjia).then((res => {
console.log(res)
}))
});
},
//
addgoodAttributeDetail() {
console.log(this.goodDetailsLists);
if (this.goodDetailsLists.length == 5) {
this.$message.error("最多只能5条");
} else {
this.ids++;
var obj = {
attributeName: "",
goodAttributeDetailsLists: [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: this.ids,
}],
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: this.ids,
};
this.goodDetailsLists.push(obj);
}
console.log(this.goodDetailsLists);
},
//
delgoodAttributeDetail(item) {
@ -837,7 +801,6 @@ export default {
}
console.log(this.goodDetailsLists);
},
//
cancel() {
this.open = false;
@ -846,15 +809,16 @@ export default {
this.goodDetailsLists = [
{
attributeName: "",
goodAttributeDetailsLists: [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
}],
goodAttributeDetailsLists: [
{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
},
],
},
]
];
// this.goodDetailsLists = [{
// attributeName: "",
@ -884,7 +848,7 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
this.resetForm("form");
},
@ -900,9 +864,10 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
console.log(selection);
this.ids = selection.map((item) => item.goodsInfoId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -911,68 +876,57 @@ export default {
this.title = "商品基本信息";
this.goodDetailsLists = [
{
attributeName: "",
goodAttributeDetailsLists: [{
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
}],
attributePitureUrl: "",
goodsPrice: "",
goodsStock: "",
sort: "",
ids: 99999999999999999999,
},
]
];
},
/** 修改按钮操作 */
handleUpdate(row) {
// console.log(row)
this.reset();
const goodsInfoId = row.goodsInfoId || this.ids
getGoodsInfo(goodsInfoId).then(response => {
const id = row.goodsInfoId || this.ids;
getGoodsInfo(id).then((response) => {
this.form = response.data[0];
this.form.goodDetailsLists = response.data[0].goodDetailsLists[0].goodAttributeDetailsLists[0];
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
this.open = true;
this.title = "修改商品基本信息";
console.log(response.data[0].goodDetailsLists)
// console.log(response.data[0].goodDetailsLists[0].goodAttributeDetailsLists[0])
});
},
reference(row) {
const goodsInfoId = row.goodsInfoId || this.ids
getGoodsInfo(goodsInfoId).then(response => {
getGoodsInfo(row.goodsInfoId).then((response) => {
response.data[0].goodsPictureUrl =
baseurl + response.data[0].goodsPictureUrl;
this.form = response.data[0];
this.form.goodDetailsLists = response.data[0].goodDetailsLists[0].goodAttributeDetailsLists[0];
// this.open = true;
console.log(response.data[0].goodDetailsLists)
// console.log(response.data[0].goodDetailsLists[0].goodAttributeDetailsLists[0])
});
this.open2 = true;
updateGoodsInfo(this.form).then(response => {
this.getList();
response.data[0].goodAttributeDetailsLists.forEach((e) => {
e.attributePitureUrl = baseurl + e.attributePitureUrl;
});
this.goodDetailsLists = response.data[0].goodAttributeDetailsLists;
this.open2 = true;
});
},
/** 提交按钮 */
submitForm() {
console.log(this.form)
this.$refs["form"].validate(valid => {
this.form.goodDetailsLists = this.goodDetailsLists;
console.log(this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
this.form.goodDetailsLists = this.goodDetailsLists;
updateGoodsInfo(this.form).then(response => {
if (this.form.goodsInfoId != null) {
this.form.id = this.form.goodsInfoId;
updateGoodsInfo(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form = this.goodDetailsLists;
addGoodsInfo(this.form).then(response => {
console.log(this.form)
addGoodsInfo(this.form).then((response) => {
console.log(this.form);
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
@ -981,19 +935,54 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除商品基本信息编号为"' + ids + '"的数据项?').then(function () {
return delGoodsInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
this.$modal
.confirm("是否确认删除?")
.then(function () {
return delGoodsInfo(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/goodsInfo/export', {
...this.queryParams
}, `goodsInfo_${new Date().getTime()}.xlsx`)
}
}
// /** */
// handleExport() {
// this.download(
// "system/goodsInfo/export",
// {
// ...this.queryParams,
// },
// `goodsInfo_${new Date().getTime()}.xlsx`
// );
// },
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.id) {
this.goodDetailsLists.forEach((e) => {
if (e.id == items.id) {
e.attributePitureUrl = items.attributePitureUrl;
}
});
}
},
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -675,7 +675,7 @@ export default {
value3: "",
value2: "",
value1: "",
value: "360000000000",
value: "",
//
loading: true,
//

View File

@ -112,16 +112,7 @@ import { updateNurseStationHeads, posts } from "@/api/system/stationAvatar.js";
export default {
components: { VueCropper },
props: {
img: {
inputName: String,
required: true,
},
type: {
inputName: String,
required: true,
},
},
props: ["img", "type", "item"],
data() {
return {
imageUrl: "",
@ -140,10 +131,13 @@ export default {
fixedBox: true, //
},
previews: {},
rows: {},
};
},
created() {
this.types = this.type;
this.rows = this.item;
if (this.img == null) {
this.options.img = null;
} else if (this.img == "") {
@ -151,8 +145,21 @@ export default {
} else {
this.options.img = baseurl + this.img;
}
console.log(this.item);
},
watch: {
item: {
handler(newimg, oldimg) {
console.log(newimg,oldimg)
if (this.item == null) {
this.rows = null;
} else if (this.img == "") {
this.rows = null;
} else {
this.rows = this.item;
}
},
},
img: {
handler(newimg, oldimg) {
if (this.img == null) {
@ -218,6 +225,11 @@ export default {
updateNurseStationHeads(formData).then((response) => {
this.options.img = baseurl + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
console.log(this.rows);
if (this.types == "attributePitureUrl") {
this.rows.attributePitureUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.rows));
}
this.openimg = false;
});
});

View File

@ -364,7 +364,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="护理站">
<el-form-item label="护理站" prop="nurseStationIds">
<el-select
v-model="form.nurseStationIds"
multiple
@ -612,6 +612,9 @@ export default {
trigger: "blur",
},
],
nurseStationIds: [
{ required: true, message: "护理站不能为空", trigger: "blur" },
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
],
@ -843,7 +846,6 @@ export default {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.nurseStationIds = this.form.nurseStationIds.join(",");
if (this.form.userId != undefined) {
updateUser(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");