bug修复
parent
3a84547ca0
commit
bbe690f5ed
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="dialogVisible" width="70%" append-to-body>
|
||||
<div class="flex justify-end padding-bottom-xs" v-if="!form.memberName">
|
||||
<el-input class="form-width-m " size="small" v-model="queryForm.projectNum" clearable placeholder="项目编码搜索"></el-input>
|
||||
<el-input class="form-width-m margin-left-xs" size="small" v-model="queryForm.projectName" clearable placeholder="项目名称搜索"></el-input>
|
||||
<el-button class="margin-left-xs" size="mini" type="primary" @click="getData">搜索</el-button>
|
||||
</div>
|
||||
<div v-if="!form.memberName">
|
||||
<el-table @row-dblclick="confirms" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}" :data="list" @row-click="rowClick" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText">
|
||||
<el-table-column label="选择" width="45">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row">
|
||||
{{ "" }}
|
||||
</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" prop="projectNum" label="项目编码" min-width="100"></el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" prop="projectName" label="项目名称" min-width="120"></el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" prop="minumumTimes" label="最低销售次数" min-width="60"></el-table-column>
|
||||
<el-table-column align="center" label="散客">
|
||||
<el-table-column align="center" min-width="75" prop="price" label="标价"></el-table-column>
|
||||
<el-table-column align="center" min-width="80" prop="topPrice" label="最高价"></el-table-column>
|
||||
<el-table-column align="center" min-width="80" prop="minumumPrice" label="最低价"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="会员">
|
||||
<el-table-column align="center" min-width="75" prop="priceMember" label="标价"></el-table-column>
|
||||
<el-table-column align="center" min-width="80" prop="topPriceMember" label="最高价"></el-table-column>
|
||||
<el-table-column align="center" min-width="80" prop="minumumPriceMember" label="最低价"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="isCardPay" label="允许卡付" min-width="80" v-if="queryForm.directConsumption==1">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.isCardPay == 0 ? "是" : scope.row.isCardPay == 1?'否':"未设"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="noDiscount" label="卡付打折" min-width="80" v-if="queryForm.directConsumption==1">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.noDiscount == 0 ? "是" : scope.row.noDiscount == 1?'否':"未设"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-table @row-dblclick="confirms" v-else :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}" :data="coureList" @row-click="rowClick" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText">
|
||||
<el-table-column label="选择" width="45">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row">
|
||||
{{ "" }}
|
||||
</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="100" align="left" prop="courseProjectNum" label="项目编码"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="120" align="left" prop="courseProjectName" label="项目名称"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="70" align="center" prop="price" label="项目单价"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="70" align="center" prop="courseRestCount" label="剩余次数"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="70" align="center" prop="courseRestPrice" label="剩余金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="70" align="center" prop="courseConsumeCount" label="可用次数"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="105" align="center" prop="endTime" label="到期日期"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="120" align="center" prop="storeName" label="所属门店"></el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<el-pagination v-if="!form.memberName" align="left" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryForm.pageNum" :page-sizes="[10,20,30,40,50]" :page-size="queryForm.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="confirms()">确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { propageNew,selectRatioInfo1 } from "@/api/storeManage.js";
|
||||
import { couAccountList } from "@/api/eashier.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radio: null, //单选值
|
||||
radioForm: {}, //单选对象
|
||||
list: [], //主数组
|
||||
coureList: [],
|
||||
dialogVisible: false, //弹窗开关
|
||||
listLoading: false, //list加载提示开启动画
|
||||
elementLoadingText: "数据加载中...", //list加载提示文字
|
||||
title: "选择门店项目", //弹窗标题
|
||||
total: 0, //分页总条数
|
||||
form: {}, //主对象
|
||||
queryForm: {
|
||||
//查询对象
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
state: 1,
|
||||
projectName: "",
|
||||
},
|
||||
courseProjectId: "", //选中的会员疗程卡包,
|
||||
isform:"",
|
||||
projectId:"",
|
||||
rows:[]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//组件传值
|
||||
show(form, id) {
|
||||
this.isform=form
|
||||
this.courseProjectId = id;
|
||||
this.coureList = [];
|
||||
this.list = [];
|
||||
this.form = {};
|
||||
if (form == 1 || form == 0 || form == 3) {
|
||||
if (form != 3) {
|
||||
this.queryForm.directConsumption = form;
|
||||
}
|
||||
} else {
|
||||
this.form = { ...form };
|
||||
}
|
||||
this.radio = null;
|
||||
this.radioForm = {};
|
||||
this.list = [];
|
||||
this.dialogVisible = true;
|
||||
this.getData();
|
||||
},
|
||||
//点击选中
|
||||
rowClick(row) {
|
||||
this.radio = row.id;
|
||||
this.radioForm = row;
|
||||
},
|
||||
//分页方法
|
||||
handleSizeChange(val) {
|
||||
// //console.log(`每页 ${val} 条`);
|
||||
this.queryForm.pageSize = val;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
// //console.log(`当前页: ${val}`);
|
||||
this.queryForm.pageNum = val;
|
||||
this.getData();
|
||||
},
|
||||
//获取数据
|
||||
async getData() {
|
||||
this.listLoading = true;
|
||||
if (this.form.memberName) {
|
||||
this.title = "选择会员卡包疗程";
|
||||
var memberIds = {
|
||||
memberId: this.form.id,
|
||||
storeId:this.form.storeId
|
||||
};
|
||||
if (this.courseProjectId) {
|
||||
memberIds.courseProjectId = this.courseProjectId;
|
||||
}
|
||||
//查询当前会员下的所有项目疗程 如果有相对应的项目 就给courseAccountId赋值 没有的话 就是卡付现付
|
||||
couAccountList(memberIds).then((res) => {
|
||||
this.listLoading = false;
|
||||
if (res.code == "000000") {
|
||||
res.rows.forEach((item) => {
|
||||
item.courseAccountId = item.id;
|
||||
});
|
||||
this.coureList = res.rows;
|
||||
} else {
|
||||
this.$alert(res.message, "查询会员疗程", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.title = "选择门店项目";
|
||||
propageNew(this.queryForm).then((res) => {
|
||||
this.listLoading = false;
|
||||
if (res.code == "000000") {
|
||||
this.total = res.pageInfo.total;
|
||||
this.list = res.pageInfo.list;
|
||||
} else {
|
||||
this.$alert(res.message, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
confirms() {
|
||||
console.log("🚀 ~ file: index.vue ~ line 186 ~ confirms ~ this.isform", this.isform)
|
||||
if (this.isform == 1 || this.isform == 0 || this.isform == 3) {
|
||||
this.$emit("projectData", this.radioForm);
|
||||
} else {
|
||||
let froms = {}
|
||||
froms.id=this.radio,
|
||||
|
||||
froms.storeId=this.form.storeId
|
||||
console.log("🚀 ~ file: index.vue ~ line 186 ~ confirms ~ froms", froms)
|
||||
selectRatioInfo1(froms).then((res)=>{
|
||||
if (res.code == "000000") {
|
||||
this.rows=res.rows
|
||||
// this.radioForm.rows=res.rows
|
||||
this.$emit("projectData", this.radioForm,this.rows);
|
||||
this.$message.success({ message: "操作成功" });
|
||||
}else{
|
||||
this.$alert(res.message, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Loading…
Reference in New Issue