Merge branch 'master' of https://e.coding.net/g-cphe0354/cashier/cashier-web into ymf
This commit is contained in:
@@ -107,6 +107,14 @@
|
||||
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||
</template>
|
||||
</page-content>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <el-table :data="selectData" border style="width: 100%">
|
||||
<el-table-column prop="date" align="center" label="Date" />
|
||||
<el-table-column prop="address" align="center" label="Address" />
|
||||
</el-table> -->
|
||||
</myDialog>
|
||||
<!-- 新增 -->
|
||||
<myDialog :title="title" width="30%" ref="myDialogRefAdd" @Confirm="addConfirm()">
|
||||
@@ -212,8 +220,10 @@ let forms = reactive({
|
||||
|
||||
// 添加商品
|
||||
function addgoods() {
|
||||
// console.log(selectData.value, '编辑时候有的数据')
|
||||
switchref.value = true
|
||||
myDialogRef.value.open()
|
||||
|
||||
}
|
||||
const rules = reactive<FormRules<RuleForm>>({
|
||||
name: [
|
||||
@@ -273,7 +283,12 @@ function subitgood() {
|
||||
|
||||
if (title.value == "编辑分组") {
|
||||
let arr = selectData.value
|
||||
arr.push(...contentRefs.value.getselectTable())
|
||||
contentRefs.value.getselectTable().forEach((item: any) => {
|
||||
let selectdata = selectData.value.find(ele => ele.id == item.id)
|
||||
if (!selectdata) {
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
selectData.value = arr
|
||||
} else {
|
||||
selectData.value = contentRefs.value.getselectTable()
|
||||
|
||||
@@ -13,14 +13,17 @@ const contentConfig: IContentConfig = {
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 30, 50],
|
||||
},
|
||||
indexAction: function (params) {
|
||||
return UserAPI.getPage(params);
|
||||
indexAction: async function (params) {
|
||||
let res = await UserAPI.getPage(params);
|
||||
console.log("indexAction:", res);
|
||||
return res;
|
||||
// return UserAPI.getPage(params);
|
||||
},
|
||||
modifyAction(data) {
|
||||
// 模拟发起网络请求修改字段
|
||||
// console.log("modifyAction:", data);
|
||||
ElMessage.success(JSON.stringify(data));
|
||||
return Promise.resolve(null);
|
||||
// ElMessage.success(JSON.stringify(data));
|
||||
// return Promise.resolve(null);
|
||||
},
|
||||
|
||||
cols: [
|
||||
|
||||
@@ -26,9 +26,11 @@
|
||||
@click="handleSwitchChange(scope.row)"></el-switch>
|
||||
</template>
|
||||
<template #kucunedit="scope">
|
||||
{{ scope.row.stockNumber }} <el-icon @click="kucunedit(scope.row)" style="cursor: pointer;color: #4080ff;">
|
||||
<EditPen />
|
||||
</el-icon>
|
||||
<template v-if="scope.row.type != null">
|
||||
{{ scope.row.stockNumber }} <el-icon @click="kucunedit(scope.row)" style="cursor: pointer;color: #4080ff;">
|
||||
<EditPen />
|
||||
</el-icon>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template #tuikuantuihui="scope">
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
<div style="display: block;width: 100%;">
|
||||
<div class="head-container">
|
||||
<el-radio-group v-model="ruleForm.groupType" @change="typeChange">
|
||||
<el-radio-button :label="0">固定套餐</el-radio-button>
|
||||
<el-radio-button :label="1">可选套餐</el-radio-button>
|
||||
<el-radio-button label="0">固定套餐</el-radio-button>
|
||||
<el-radio-button label="1">可选套餐</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div v-if="ruleForm.groupType == '0'">
|
||||
@@ -733,6 +733,13 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
ruleForm.coverImg = ruleForm.images[0]
|
||||
// 规格id修改
|
||||
// ruleForm.specId = specIdFunction(ruleForm.type)
|
||||
let selectTitle = false
|
||||
ruleForm.proGroupVo.forEach((item: any) => {
|
||||
})
|
||||
if (selectTitle) {
|
||||
ElMessage.error('请填写标题和几选几')
|
||||
return
|
||||
}
|
||||
// 修改时间
|
||||
ruleForm.startTime = ruleForm.useTime[0]
|
||||
ruleForm.endTime = ruleForm.useTime[1]
|
||||
@@ -748,18 +755,33 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
} else if (ruleForm.type == 'package') {
|
||||
// console.log(ruleForm, '套餐')
|
||||
}
|
||||
setTimeout(() => {
|
||||
ruleForm.days = ruleForm.days.split(',')
|
||||
}, 200);
|
||||
// 标题和几选几是否填写
|
||||
if (ruleForm.type == "package") {
|
||||
if (ruleForm.groupType == '1') {
|
||||
let selectTitle = false
|
||||
ruleForm.proGroupVo.forEach((item: any) => {
|
||||
if (item.number == '' || item.title == '') {
|
||||
selectTitle = true
|
||||
}
|
||||
})
|
||||
if (selectTitle) {
|
||||
ElMessage.error('请填写标题和几选几')
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ruleForm.id) {
|
||||
setTimeout(() => {
|
||||
ruleForm.days = ruleForm.days.split(',')
|
||||
}, 600);
|
||||
let res = await UserAPI3.update(ruleForm)
|
||||
if (res.code == 200) {
|
||||
ElMessage.success("修改成功");
|
||||
}
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
ruleForm.days = ruleForm.days.split(',')
|
||||
}, 600);
|
||||
|
||||
let res = await UserAPI3.addunit(ruleForm)
|
||||
if (res.code == 200) {
|
||||
ElMessage.success("添加成功");
|
||||
|
||||
Reference in New Issue
Block a user