This commit is contained in:
闫晓茹 2023-02-28 16:29:10 +08:00
parent 728ad279f9
commit b2019314b0
3 changed files with 175 additions and 81 deletions

View File

@ -213,6 +213,7 @@
@click="clickinnerVisible" @click="clickinnerVisible"
v-if="StationName == '请选择所属护理站'" v-if="StationName == '请选择所属护理站'"
style=" style="
width: 210px; width: 210px;
text-align: left; text-align: left;
height: 36px; height: 36px;
@ -344,7 +345,44 @@
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品属性图片" align="center" width="300"> <el-table-column label="积分兑换标识" align="center">
<template slot-scope="scope">
<el-select
v-model.number="scope.row.integralExchangeFlag"
placeholder="请选择积分兑换标识"
clearable
>
<el-option
v-for="item in integraloption"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="积分兑换门槛值" align="center">
<template slot-scope="scope">
<el-input
v-model.number="scope.row.integralExchangeSill"
oninput="value=value.replace(/[^\d]/g,'')"
placeholder="积分兑换门槛值"
maxLength="10"
></el-input>
</template>
</el-table-column>
<el-table-column label="积分兑换商品数量" align="center">
<template slot-scope="scope">
<el-input
v-model.number="scope.row.integralExchangeCount"
oninput="value=value.replace(/[^\d]/g,'')"
placeholder="积分兑换商品数量"
maxLength="10"
></el-input>
</template>
</el-table-column>
<el-table-column label="商品属性图片" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<stationAcatar <stationAcatar
@imgUrl="attributePitureUrl" @imgUrl="attributePitureUrl"

View File

@ -54,15 +54,29 @@ export default {
nursetotal: 0, nursetotal: 0,
nurseStationId: null, nurseStationId: null,
goods: [{ goods: [{
value: "BUSINESS", value: "BUSINESS",
label: "买卖", label: "买卖",
}, },
{ {
value: "LEASE", value: "LEASE",
label: "租赁", label: "租赁",
}, },
], ],
options: [{ options: [{
value: 0,
label: "否",
},
{
value: 1,
label: "是",
},
],
// goodAttributeDetailsLists:[],
goodDetailsLists: [],
idd: 9999999,
ids: [],
integraloption: [
{
value: 0, value: 0,
label: "否", label: "否",
}, },
@ -71,10 +85,6 @@ export default {
label: "是", label: "是",
}, },
], ],
// goodAttributeDetailsLists:[],
goodDetailsLists: [],
idd: 9999999,
ids: [],
// 查询参数 // 查询参数
shangjia: { shangjia: {
id: null, id: null,
@ -207,6 +217,9 @@ export default {
attributePitureUrl: "", attributePitureUrl: "",
goodsPrice: "", goodsPrice: "",
goodsStock: "", goodsStock: "",
integralExchangeCount:null,
integralExchangeFlag:null,
integralExchangeSill:null,
attributeDetailsSort: null, attributeDetailsSort: null,
idd: this.idd, idd: this.idd,
}; };
@ -240,10 +253,10 @@ export default {
obj.pictureUrlList.push(this.form.goodsPictureUrl); obj.pictureUrlList.push(this.form.goodsPictureUrl);
} }
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {}); updatePicture(obj).then((res) => { });
} }
if (this.imgsurl.pictureUrlList.length > 0) { if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {}); updatePicture(this.imgsurl).then((res) => { });
} }
this.imgsurl = { pictureUrlList: [] }; this.imgsurl = { pictureUrlList: [] };
this.open = false; this.open = false;
@ -251,13 +264,16 @@ export default {
this.StationName = "请选择所属护理站"; this.StationName = "请选择所属护理站";
this.goodDetailsLists = [{ this.goodDetailsLists = [{
attributeName: "", attributeName: "",
integralExchangeCount:null,
integralExchangeFlag:null,
integralExchangeSill:null,
goodAttributeDetailsLists: [{ goodAttributeDetailsLists: [{
attributePitureUrl: "", attributePitureUrl: "",
goodsPrice: "", goodsPrice: "",
goodsStock: "", goodsStock: "",
attributeDetailsSort: null, attributeDetailsSort: null,
}, ], },],
}, ]; },];
++this.isResouceShow ++this.isResouceShow
}, },
//页面所属护理站 //页面所属护理站
@ -323,8 +339,11 @@ export default {
goodsPrice: "", goodsPrice: "",
goodsStock: "", goodsStock: "",
attributeDetailsSort: null, attributeDetailsSort: null,
integralExchangeCount:null,
integralExchangeFlag:null,
integralExchangeSill:null,
idd: 9999999, idd: 9999999,
}, ]; },];
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -363,9 +382,12 @@ export default {
attributePitureUrl: "", attributePitureUrl: "",
goodsPrice: "", goodsPrice: "",
goodsStock: "", goodsStock: "",
integralExchangeCount:null,
integralExchangeFlag:null,
integralExchangeSill:null,
sort: null, sort: null,
idd: 9999999, idd: 9999999,
}, ]; },];
this.open = true; this.open = true;
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
@ -396,6 +418,18 @@ export default {
submitForm() { submitForm() {
this.form.goodAttributeDetailsLists = []; this.form.goodAttributeDetailsLists = [];
this.form.goodDetailsLists = this.goodDetailsLists; this.form.goodDetailsLists = this.goodDetailsLists;
console.log(this.form.goodDetailsLists)
if (!this.form.goodDetailsLists.integralExchangeFlag) {
this.form.goodDetailsLists.integralExchangeFlag = null
}
if (this.form.goodDetailsLists.integralExchangeSill=="") {
this.form.goodDetailsLists.integralExchangeSill = null
}
if (this.form.goodDetailsLists.integralExchangeCount == "") {
this.form.goodDetailsLists.integralExchangeCount = null
}
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.goodsInfoId != null) { if (this.form.goodsInfoId != null) {
@ -414,7 +448,7 @@ export default {
} }
this.imgsurl = { pictureUrlList: [] }; this.imgsurl = { pictureUrlList: [] };
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {}); updatePicture(obj).then((res) => { });
} }
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
++this.isResouceShow ++this.isResouceShow
@ -423,9 +457,9 @@ export default {
}); });
} else { } else {
this.form.goodDetailsLists.forEach(e => { this.form.goodDetailsLists.forEach(e => {
e.goodsPrice = Number(e.goodsPrice) e.goodsPrice = Number(e.goodsPrice)
}) })
// this.nurseStationId=this.form.nurseStationId // this.nurseStationId=this.form.nurseStationId
addGoodsInfo(this.form).then((response) => { addGoodsInfo(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.StationName = "请选择所属护理站"; this.StationName = "请选择所属护理站";
@ -440,22 +474,22 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$confirm("是否确认删除订单信息的数据项?", "提示", { this.$confirm("是否确认删除订单信息的数据项?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
delGoodsInfo(row.goodsInfoId).then((res) => { delGoodsInfo(row.goodsInfoId).then((res) => {
var obj = { pictureUrlList: [] }; var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.goodsPictureUrl); obj.pictureUrlList.push(row.goodsPictureUrl);
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {}); updatePicture(obj).then((res) => { });
} }
this.$message.success("删除成功"); this.$message.success("删除成功");
this.getList(); this.getList();
}); });
}) })
.catch(() => {}); .catch(() => { });
}, },
imgUrl(imgUrl) { imgUrl(imgUrl) {
this.form.goodsPictureUrl = imgUrl; this.form.goodsPictureUrl = imgUrl;

View File

@ -162,7 +162,12 @@
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键id" align="center" prop="id" /> --> <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column label="优惠券名称" align="center" prop="couponTitle" show-overflow-tooltip /> <el-table-column
label="优惠券名称"
align="center"
prop="couponTitle"
show-overflow-tooltip
/>
<el-table-column label="优惠券编码" align="center" prop="couponCode" /> <el-table-column label="优惠券编码" align="center" prop="couponCode" />
<el-table-column label="优惠券类型" align="center" prop="couponType"> <el-table-column label="优惠券类型" align="center" prop="couponType">
<template slot-scope="scope"> <template slot-scope="scope">
@ -184,7 +189,6 @@
align="center" align="center"
prop="couponConsumePrice" prop="couponConsumePrice"
/> />
<!-- <el-table-column label="优惠券概述" align="center" prop="couponDescription" /> -->
<el-table-column label="领取方式" align="center" prop="receiveType"> <el-table-column label="领取方式" align="center" prop="receiveType">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.receiveType == "NEW_PEOPLE_WELFARE" ? "新人福利" : "" }} {{ scope.row.receiveType == "NEW_PEOPLE_WELFARE" ? "新人福利" : "" }}
@ -247,7 +251,7 @@
label-width="130px" label-width="130px"
:inline="true" :inline="true"
> >
<el-form-item label="优惠券名称" prop="couponTitle" > <el-form-item label="优惠券名称" prop="couponTitle">
<el-input <el-input
v-model="form.couponTitle" v-model="form.couponTitle"
maxlength="100" maxlength="100"
@ -255,20 +259,20 @@
style="width: 220px" style="width: 220px"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="优惠券编码" prop="couponCode">
<el-input v-model="form.couponCode" placeholder="请输入优惠券编码" />
</el-form-item> -->
<el-form-item label="优惠券有效期(天)" prop="couponReductionDays"> <el-form-item label="优惠券有效期(天)" prop="couponReductionDays">
<el-input <el-input
maxlength="5" maxlength="5"
v-model.number="form.couponReductionDays"
v-model="form.couponReductionDays"
placeholder="请输入优惠券有效期,单位:天" placeholder="请输入优惠券有效期,单位:天"
style="width: 220px" style="width: 220px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="优惠券面额" prop="couponPrice"> <el-form-item label="优惠券面额" prop="couponPrice">
<el-input <el-input
v-model.number="form.couponPrice" @input.native="changeInput($event)"
v-model="form.couponPrice"
maxlength="8" maxlength="8"
placeholder="请输入优惠券面额,单位:元" placeholder="请输入优惠券面额,单位:元"
style="width: 220px" style="width: 220px"
@ -276,8 +280,9 @@
</el-form-item> </el-form-item>
<el-form-item label="优惠券适用门槛" prop="couponConsumePrice"> <el-form-item label="优惠券适用门槛" prop="couponConsumePrice">
<el-input <el-input
maxlength="8" @input.native="changeInput($event)"
v-model.number="form.couponConsumePrice" maxlength="8"
v-model="form.couponConsumePrice"
placeholder="请输入优惠券适用门槛" placeholder="请输入优惠券适用门槛"
style="width: 220px" style="width: 220px"
/> />
@ -376,6 +381,8 @@ import {
export default { export default {
name: "Coupon", name: "Coupon",
data() { data() {
return { return {
// //
loading: true, loading: true,
@ -445,7 +452,7 @@ export default {
couponTitle: null, couponTitle: null,
couponCode: null, couponCode: null,
couponType: null, couponType: null,
couponReductionDays:null, couponReductionDays: null,
couponPrice: null, couponPrice: null,
couponConsumePrice: null, couponConsumePrice: null,
couponDescription: null, couponDescription: null,
@ -459,54 +466,55 @@ export default {
form: {}, form: {},
// //
rules: { rules: {
couponTitle:[ couponTitle: [
{ {
required: true, required: true,
message: "请输入优惠券名称", message: "请输入优惠券名称",
trigger: "blur" trigger: "blur",
} },
], ],
couponType: [ couponType: [
{ {
required: true, required: true,
message: "请选择优惠券类型", message: "请选择优惠券类型",
trigger: "blur" trigger: "blur",
} },
], ],
couponReductionDays: [ couponReductionDays: [
{ {
required: true, required: true,
message: "请输入优惠券有效期", message: "请输入优惠券有效期",
trigger: "blur" trigger: "blur",
} },
], ],
couponPrice: [ couponPrice: [
{ {
required: true, required: true,
message: "请输入优惠券面额", message: "请输入优惠券面额",
trigger: "blur" trigger: "blur",
} },
], ],
couponConsumePrice: [ couponConsumePrice: [
{ {
required: true, required: true,
message: "请输入优惠券面额", message: "请输入优惠券面额",
trigger: "blur" trigger: "blur",
}
},
], ],
couponDescription: [ couponDescription: [
{ {
required: true, required: true,
message: "请输入优惠券概述", message: "请输入优惠券概述",
trigger: "blur" trigger: "blur",
} },
], ],
receiveType: [ receiveType: [
{ {
required: true, required: true,
message: "请选择领取方式", message: "请选择领取方式",
trigger: "blur" trigger: "blur",
} },
], ],
// useScope: [ // useScope: [
// { // {
@ -516,11 +524,11 @@ export default {
// } // }
// ], // ],
showSort: [ showSort: [
{ {
required: true, required: true,
message: "请输入显示顺序", message: "请输入显示顺序",
trigger: "blur" trigger: "blur",
} },
], ],
}, },
}; };
@ -529,6 +537,7 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询优惠券信息列表 */ /** 查询优惠券信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -538,6 +547,12 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
changeInput(e) {
if (e.target.value.indexOf('.') >= 0) {
e.target.value = e.target.value.substring(0, e.target.value.indexOf('.') + 3);
}
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -600,6 +615,13 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
if(this.form.couponPrice){
this.form.couponPrice = Number(this.form.couponPrice )
}
if(this.form.couponConsumePrice){
this.form.couponConsumePrice = Number(this.form.couponConsumePrice )
}
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {