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"
v-if="StationName == '请选择所属护理站'"
style="
width: 210px;
text-align: left;
height: 36px;
@ -344,7 +345,44 @@
></el-input>
</template>
</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">
<stationAcatar
@imgUrl="attributePitureUrl"

View File

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

View File

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