Commit 5489baee by 吕明尚

管理员区分电控和门控

parent 5d42e8dd
......@@ -119,4 +119,20 @@ export function poi(query) {
})
}
export function query(row) {
return request({
url: '/system/store/consumer/query',
method: 'get',
params: row
})
}
export function update(row) {
return request({
url: '/system/store/consumer/update',
method: 'put',
data: row
})
}
......@@ -232,6 +232,11 @@
label="套餐券"
value="5"
/>
<el-option
key="6"
label="金额券"
value="6"
/>
</el-select>
</el-form-item>
<el-form-item label="优惠券原始金额" prop="originalPrice">
......
......@@ -184,9 +184,12 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="门店名称" prop="name" >
<el-input v-model="form.name" placeholder="请输入门店名称"/>
</el-form-item>
<el-form-item label="门店名称" prop="name">
<el-input v-model="form.name" placeholder="请输入门店名称"/>
</el-form-item>
<el-form-item label="所在城市" prop="cityname">
<el-input v-model="form.cityname" placeholder="请输入所在城市"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
......@@ -629,6 +632,7 @@ export default {
this.form.openShopUuid = openShopUuid;
this.form.address = cityname + shopaddress;
this.form.name = branchname;
this.form.cityname = cityname;
this.onSearchMapAddress();
},
selectPoiId(tiktokPoiId) {
......
......@@ -95,10 +95,54 @@
v-hasPermi="['system:store:remove']"
>取消分配
</el-button>
<el-button v-if="scope.row.position ==2"
v-hasPermi="['system:store:edit']"
icon="el-icon-edit"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>修改
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改房间对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="20%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="账号" prop="account">
<el-input v-model="form.account" disabled/>
</el-form-item>
<el-form-item label="用户昵称" prop="nickName">
<el-input v-model="form.nickName" disabled/>
</el-form-item>
<el-form-item label="是否控电" prop="controller">
<el-radio-group v-model="form.controller">
<el-radio
v-for="dict in dict.type.store_is_use_coupon"
:key="dict.value"
:label="parseInt(dict.value)"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否控门" prop="gating">
<el-radio-group v-model="form.gating">
<el-radio
v-for="dict in dict.type.store_is_use_coupon"
:key="dict.value"
:label="parseInt(dict.value)"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</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>
</div>
</el-dialog>
<pagination
v-show="total>0"
:total="total"
......@@ -113,10 +157,12 @@
<script>
import {allocatedUserList, authUserCancel, authUserCancelAll} from "@/api/system/store";
import selectConsumer from "./selectConsumer";
import {query} from "@/api/system/store";
import {update} from "../../../api/system/store";
export default {
name: "CleanConsumer",
dicts: ['sys_user_sex', 'wechat_role_type'],
dicts: ['sys_user_sex', 'wechat_role_type', 'store_is_use_coupon'],
components: {selectConsumer},
data() {
return {
......@@ -130,6 +176,11 @@ export default {
showSearch: true,
// 总条数
total: 0,
title: '',
open: false,
form: {},
query: {},
rules: {},
// 用户表格数据
consumerList: [],
// 查询参数
......@@ -167,6 +218,38 @@ export default {
const obj = {path: "/share/store"};
this.$tab.closeOpenPage(obj);
},
// 取消按钮
cancel() {
this.open = false;
},
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.$confirm('确认提交吗?').then(() => {
this.query.consumerId = this.form.id;
this.query.position = 2;
this.query.controller = this.form.controller;
this.query.gating = this.form.gating;
update(this.query).then(() => {
this.open = false;
this.getList();
this.$modal.msgSuccess("操作成功");
});
});
}
});
},
handleUpdate(row) {
const storeId = this.$route.params && this.$route.params.storeId;
this.query.storeId = storeId;
this.query.consumerId = row.id;
this.query.position = 2;
query(this.query).then(response => {
this.form = response.data;
this.open = true
this.title = '修改权限'
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
......
......@@ -8,6 +8,7 @@
<el-table-column label="店铺名称" align="center" prop="shopname" width="120px"/>
<el-table-column label="分店名称" align="center" prop="branchname" width="120px"/>
<el-table-column label="店铺地址" align="center" prop="shopaddress" />
<el-table-column align="center" label="所在城市" prop="cityname"/>
</el-table>
</el-row>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment