Zory 1 mesiac pred
rodič
commit
43fdfeea4a

+ 33 - 0
src/api/model/combo.js

@@ -0,0 +1,33 @@
+import config from "@/config";
+import http from "@/utils/request";
+
+export default {
+    list: {
+        url: `${config.API_URL}/combo/list`,
+        name: "-",
+        get: async function (data = {}) {
+            return await http.get(this.url, data);
+        },
+    },
+    save: {
+        url: `${config.API_URL}/combo/save`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
+    batch: {
+        url: `${config.API_URL}/combo/batch`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
+    del: {
+        url: `${config.API_URL}/combo/del`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
+}

+ 7 - 0
src/api/model/shop.js

@@ -30,6 +30,13 @@ export default {
             return await http.post(this.url, data);
         },
     },
+    combo: {
+        url: `${config.API_URL}/shop/combo`,
+        name: "-",
+        post: async function (data = {}) {
+            return await http.post(this.url, data);
+        },
+    },
     del: {
         url: `${config.API_URL}/shop/del`,
         name: "-",

+ 47 - 0
src/api/model/user.js

@@ -0,0 +1,47 @@
+import config from "@/config";
+import http from "@/utils/request";
+
+export default {
+    list: {
+        url: `${config.API_URL}/user/list`,
+        name: "-",
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+    },
+    pwd: {
+        url: `${config.API_URL}/user/passwd`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
+    batch: {
+        url: `${config.API_URL}/user/batch`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
+    save: {
+        url: `${config.API_URL}/user/save`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
+    state: {
+        url: `${config.API_URL}/user/state`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
+    del: {
+        url: `${config.API_URL}/user/del`,
+        name: "-",
+        post: async function (params) {
+            return await http.post(this.url, params);
+        },
+    },
+}

+ 1 - 1
src/layout/index.vue

@@ -64,7 +64,7 @@
 			<div class="adminui-header-left">
 				<div class="logo-bar">
 					<img class="logo" :src="baseData.logo ? baseData.logo : 'img/logo.png'">
-					<span>{{ baseData.title ? baseData.title : $CONFIG.APP_NAME }}</span>
+					<!-- <span>{{ baseData.title ? baseData.title : $CONFIG.APP_NAME }}</span> -->
 					<div class="ml10">
 						<el-tag v-if="userInfo.type==1">管理后台</el-tag>
 						<el-tooltip class="box-item" effect="dark" :content="userInfo.vip_at==0?'到期时间:永久':'到期时间:'+$TOOL.getTime(userInfo.vip_at,'YYYY年MM月DD日')" placement="right" v-else>

+ 9 - 0
src/utils/tool.js

@@ -245,4 +245,13 @@ tool.crypto = {
 	}
 }
 
+tool.money = function (num) {
+	if (num == 0) return "¥0.00";
+	return Intl.NumberFormat("zh-CN", {
+		style: "currency",
+		currency: "CNY",
+		minimumFractionDigits: 2,
+		maximumFractionDigits: 2,
+	}).format(num / 100);
+};
 export default tool

+ 74 - 23
src/views/manage/components/agent.vue

@@ -32,55 +32,106 @@
                         <el-table-column width="50" fixed="left">
                             <div class="checkbox"></div>
                         </el-table-column>
-                        <el-table-column label="代理名称" width="150" fixed="left" prop="name"></el-table-column>
-                        <el-table-column label="代理ID" prop="agent_id" width="150"></el-table-column>
-                        <el-table-column label="联系人" prop="truename" width="150">
+                        <el-table-column label="店铺名称" width="200" fixed="left" prop="shop_name"></el-table-column>
+                        <el-table-column label="店铺编码" prop="agent_id" width="200"></el-table-column>
+                        <el-table-column label="营业时间" prop="agent" width="150">
                             <template #default="scope">
-                                <span v-if="scope.row.contact_name">{{ scope.row.contact_name }}</span>
+                                <span v-if="scope.row.start_at">{{ scope.row.start_at }}-{{ scope.row.end_at }}</span>
                                 <span class="status-danger" v-else>未设置</span>
                             </template>
                         </el-table-column>
-                        <el-table-column label="联系电话" prop="mobile" width="150">
+                        <el-table-column label="到期时间" prop="vip_end" width="180">
                             <template #default="scope">
-                                <span v-if="scope.row.contact_mobile">{{ scope.row.contact_mobile }}</span>
+                                <span v-if="scope.row.vip_end">{{ scope.row.vip_end }}</span>
+                                <span class="status-danger" v-else>未设置</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="收费规则" prop="rate_type" width="150">
+                            <template #default="scope">
+                                <div class="status-success" v-if="scope.row.rate_type==1"><sc-status-indicator type="success"></sc-status-indicator> 收取年费</div>
+                                <div class="status-danger" v-if="scope.row.rate_type==2"><sc-status-indicator type="danger"></sc-status-indicator> 订单金额抽佣</div>
+                                <div class="status-danger" v-if="scope.row.rate_type==0"><sc-status-indicator type="danger"></sc-status-indicator> 未设置</div>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="联系人" prop="shop_contact" width="150">
+                            <template #default="scope">
+                                <span v-if="scope.row.shop_contact">{{ scope.row.shop_contact }}</span>
+                                <span class="status-danger" v-else>未设置</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="联系电话" prop="shop_mobile" width="150">
+                            <template #default="scope">
+                                <span v-if="scope.row.shop_mobile">{{ scope.row.shop_mobile }}</span>
+                                <span class="status-danger" v-else>未设置</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="店铺地址" prop="shop_address" width="320">
+                            <template #default="scope">
+                                <span v-if="scope.row.shop_address">{{ scope.row.shop_address }}</span>
                                 <span class="status-danger" v-else>未设置</span>
                             </template>
                         </el-table-column>
-                        <el-table-column label="到期时间" prop="vip_end" width="220"></el-table-column>
-                        <el-table-column label="注册时间" prop="create_at" width="180"></el-table-column>
                         <el-table-column label="状态" prop="status" width="120" align="center">
                             <template #default="scope">
-                                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
-                                <div class="status-danger" v-else><sc-status-indicator type="danger"></sc-status-indicator> 禁用</div>
+                                <div class="status-success" v-if="scope.row.status==0"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
+                                <div class="status-danger" v-if="scope.row.status==1"><sc-status-indicator type="danger"></sc-status-indicator> 已到期</div>
+                                <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 禁用</div>
                             </template>
                         </el-table-column>
+                        <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
                     </scTable>
                 </div>
                 <div class="main-body-wrap" v-else>
                     <scTable ref="table" :apiObj="list.apiObj" :hideSetting="true" paginationLayout="total, prev, pager, next" :params="searchKey" @selectionChange="selectionChange" row-key="id" @sortChange="sortChange">
                         <el-table-column type="selection" width="50" fixed="left"></el-table-column>
-                        <el-table-column label="代理名称" width="150" fixed="left" prop="name"></el-table-column>
-                        <el-table-column label="代理ID" prop="agent_id" width="150"></el-table-column>
-                        <el-table-column label="联系人" prop="truename" width="150">
+                        
+                        <el-table-column label="店铺名称" width="200" fixed="left" prop="shop_name"></el-table-column>
+                        <el-table-column label="店铺编码" prop="agent_id" width="200"></el-table-column>
+                        <el-table-column label="营业时间" prop="agent" width="150">
+                            <template #default="scope">
+                                <span v-if="scope.row.start_at">{{ scope.row.start_at }}-{{ scope.row.end_at }}</span>
+                                <span class="status-danger" v-else>未设置</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="到期时间" prop="vip_end" width="180">
+                            <template #default="scope">
+                                <span v-if="scope.row.vip_end">{{ scope.row.vip_end }}</span>
+                                <span class="status-danger" v-else>未设置</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="收费规则" prop="rate_type" width="150">
+                            <template #default="scope">
+                                <div class="status-success" v-if="scope.row.rate_type==1"><sc-status-indicator type="success"></sc-status-indicator> 收取年费</div>
+                                <div class="status-danger" v-if="scope.row.rate_type==2"><sc-status-indicator type="danger"></sc-status-indicator> 订单金额抽佣</div>
+                                <div class="status-danger" v-if="scope.row.rate_type==0"><sc-status-indicator type="danger"></sc-status-indicator> 未设置</div>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="联系人" prop="shop_contact" width="150">
+                            <template #default="scope">
+                                <span v-if="scope.row.shop_contact">{{ scope.row.shop_contact }}</span>
+                                <span class="status-danger" v-else>未设置</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="联系电话" prop="shop_mobile" width="150">
                             <template #default="scope">
-                                <span v-if="scope.row.contact_name">{{ scope.row.contact_name }}</span>
+                                <span v-if="scope.row.shop_mobile">{{ scope.row.shop_mobile }}</span>
                                 <span class="status-danger" v-else>未设置</span>
                             </template>
                         </el-table-column>
-                        <el-table-column label="联系电话" prop="mobile" width="150">
+                        <el-table-column label="店铺地址" prop="shop_address" width="320">
                             <template #default="scope">
-                                <span v-if="scope.row.contact_mobile">{{ scope.row.contact_mobile }}</span>
+                                <span v-if="scope.row.shop_address">{{ scope.row.shop_address }}</span>
                                 <span class="status-danger" v-else>未设置</span>
                             </template>
                         </el-table-column>
-                        <el-table-column label="到期时间" prop="vip_end" width="220"></el-table-column>
-                        <el-table-column label="注册时间" prop="create_at" width="180"></el-table-column>
                         <el-table-column label="状态" prop="status" width="120" align="center">
                             <template #default="scope">
-                                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
-                                <div class="status-danger" v-else><sc-status-indicator type="danger"></sc-status-indicator> 禁用</div>
+                                <div class="status-success" v-if="scope.row.status==0"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
+                                <div class="status-danger" v-if="scope.row.status==1"><sc-status-indicator type="danger"></sc-status-indicator> 已到期</div>
+                                <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 禁用</div>
                             </template>
                         </el-table-column>
+                        <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
                     </scTable>
                 </div>
             </div>
@@ -103,11 +154,11 @@ export default{
             loading: false,
             mode:"add",
             titleMap:{
-                add:"选择代理",
-                edit:"选择代理"
+                add:"选择店铺",
+                edit:"选择店铺"
             },
             list: {
-                apiObj: this.$API.agent.list
+                apiObj: this.$API.shop.list
             },
             visible: false,
             isSaveing: false,

+ 124 - 0
src/views/manage/shop/card/components/form.vue

@@ -0,0 +1,124 @@
+<template>
+    <el-dialog :title="titleMap[mode]" v-model="visible" :width="600" :close-on-click-modal="false" destroy-on-close @closed="$emit('closed')">
+        <el-form ref="dialogForm" :model="formData" :rules="rules" label-width="100px" label-position="top">
+            <el-row :gutter="15">
+                <el-col :span="24">
+                    <el-form-item label="套餐名称" prop="name">
+                        <el-input v-model="formData.name" clearable placeholder="请输入"></el-input>
+                        <div class="el-form-item-msg"></div>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="时长类型" prop="unit">
+                        <el-radio-group v-model="formData.unit">
+                            <el-radio border :label="1">按天</el-radio>
+                            <el-radio border :label="2">按年</el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="套餐时长" prop="time">
+                        <el-input v-model="formData.time" clearable placeholder="请输入">
+                            <template #append>{{ formData.unit==1?'天':'年' }}</template>
+                        </el-input>
+                        <div class="el-form-item-msg"></div>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="套餐金额" prop="money">
+                        <el-input v-model="formData.money" clearable placeholder="请输入">
+                            <template #append>元</template>
+                        </el-input>
+                        <div class="el-form-item-msg">实际支付金额</div>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="套餐划线金额" prop="old_money">
+                        <el-input v-model="formData.old_money" clearable placeholder="请输入">
+                            <template #append>元</template>
+                        </el-input>
+                        <div class="el-form-item-msg"></div>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="排序" prop="sort">
+                        <el-input v-model="formData.sort" clearable placeholder="请输入"></el-input>
+                        <div class="el-form-item-msg"></div>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+		<template #footer>
+			<el-button @click="visible=false" >取 消</el-button>
+			<el-button type="primary" :loading="isSaveing" @click="submit()">保 存</el-button>
+		</template>
+    </el-dialog>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            loading: false,
+            isSaveing: false,
+            mode:"add",
+            titleMap:{
+                add:"新增套餐",
+                edit:"编辑套餐"
+            },
+            visible:false,
+            formData:{
+                unit:2,
+                sort:0
+            },
+            rules:{
+                name: [
+                    {required: true, message: '请输入'}
+                ],
+                money: [
+                    {required: true, message: '请输入'}
+                ],
+                time: [
+                    {required: true, message: '请输入'}
+                ],
+                old_money: [
+                    {required: true, message: '请输入'}
+                ],
+                unit: [
+                    {required: true, message: '请选择'}
+                ],
+            }
+        }
+    },
+    methods:{
+        open(mode = 'add'){
+            this.mode = mode;
+            this.visible = true;
+            return this
+        },
+        //表单注入数据
+        setData(data){
+            this.formData = JSON.parse(JSON.stringify(data));
+        },
+        async submit(){
+            var validate = await this.$refs.dialogForm.validate().catch(()=>{});
+            if(!validate){ return false }
+            this.isSaveing = true;
+            let submitData = JSON.parse(JSON.stringify(this.formData));
+            var resp = await this.$API.combo.save.post(submitData);
+            this.isSaveing = false;
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+            this.visible = false;
+            this.formData = {
+                unit:2,
+                sort:0
+            };
+            this.submitState = false;
+            this.$emit("success");
+        }
+    }
+}
+</script>

+ 55 - 0
src/views/manage/shop/card/components/option.vue

@@ -0,0 +1,55 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">按需操作</el-tag>
+        </legend>
+        <div class="op-header">
+            <div class="left-panel">
+                <el-button type="primary" icon="el-icon-plus" @click="table_add()">新增套餐</el-button>
+                <el-button icon="el-icon-document" @click="table_batch_status(1)" :disabled="dataSelect.length>0?false:true">启用</el-button>
+                <el-button icon="el-icon-lock" @click="table_batch_status(0)" :disabled="dataSelect.length>0?false:true">禁用</el-button>
+            </div>
+        </div>
+    </fieldset>
+    <formMain ref="formMain" @success="handleSuccess"></formMain>
+</template>
+
+<script>
+import formMain from './form';
+export default {
+    components: {
+        formMain
+    },
+    props: {
+        dataSelect: { type: Array, default: () => [] },
+        dataSelectFull: { type: Array, default: () => [] }
+    },
+    data(){
+        return {
+
+        }
+    },
+    methods: {
+        async table_batch_status(status){
+            if (this.dataSelect.length == 0) {
+                return this.$message.error("请选择修改数据")
+            }
+            let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
+            var resp = await this.$API.combo.batch.post(submitData);
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+            this.$emit("success");
+        },
+        handleSuccess(){
+            this.$emit("success");
+        },
+        table_add(){
+            this.$nextTick(() => {
+                this.$refs.formMain.open("add")
+            })
+        },
+    }
+}
+</script>

+ 49 - 0
src/views/manage/shop/card/components/search.vue

@@ -0,0 +1,49 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">条件筛选</el-tag>
+        </legend>
+        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
+            <div class="search-form">
+                <div class="form-left">
+                    <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-input v-model="searchKey.name" placeholder="套餐名称" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>套餐名称</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
+                                <el-option value="1" label="禁用"></el-option>
+                                <el-option value="2" label="正常"></el-option>
+                                <template #prefix>状态</template>
+                            </el-select>
+                        </el-col>
+                        <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
+                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="form-line"></div>
+                <div class="form-right">
+                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
+                </div>
+            </div>
+        </el-form>
+    </fieldset>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            searchKey:{}
+        }
+    },
+    methods: {
+        searchForm(){
+            this.$emit("success",this.searchKey);
+        }
+    }
+}
+</script>

+ 118 - 0
src/views/manage/shop/card/components/table.vue

@@ -0,0 +1,118 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        <el-table-column label="套餐名称" width="200" fixed="left" prop="name"></el-table-column>
+        <el-table-column label="套餐金额" prop="money" width="180">
+            <template #default="scope">
+                <span v-if="scope.row.money">¥{{ scope.row.money }}</span>
+                <span class="status-danger" v-else>未设置</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="划线金额" prop="old_money" width="180">
+            <template #default="scope">
+                <span v-if="scope.row.old_money">¥{{ scope.row.old_money }}</span>
+                <span class="status-danger" v-else>未设置</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="有效期" prop="time" width="150">
+            <template #default="scope">
+                <span v-if="scope.row.time">{{ scope.row.time }}{{ scope.row.unit==1?'天' :'年'}}</span>
+                <span class="status-danger" v-else>未设置</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="状态" prop="status" width="120" align="center">
+            <template #default="scope">
+                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
+                <div class="status-danger" v-if="scope.row.status==0"><sc-status-indicator type="danger"></sc-status-indicator> 禁用</div>
+            </template>
+        </el-table-column>
+        <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
+        <el-table-column label="操作" width="140" align="left" fixed="right">
+            <template #default="scope">
+                <el-button-group>
+                    <el-button size="small" @click="table_view(scope.row)">编辑</el-button>
+                    <el-button type="danger" size="small" @click="table_del(scope.row)">删除</el-button>
+                </el-button-group>
+            </template>
+        </el-table-column>
+    </scTable>
+    <formMain ref="formMain" @success="handleSuccess"></formMain>
+</template>
+
+<script>
+import formMain from './form';
+export default {
+    components: {
+        formMain
+    },
+    data(){
+        return {
+            list: {
+                apiObj: this.$API.combo.list
+            },
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{}
+        }
+    },
+    
+    methods: {
+        table_view(data){
+            this.$nextTick(() => {
+                this.$refs.formMain.open("edit").setData(data)
+            })
+        },
+        table_del(data){
+            this.$confirm(`确定要删除该套餐吗?`, '提示', {
+                type: 'warning'
+            }).then(async ()=>{
+                var resp = await this.$API.combo.del.post({"id":data.id});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$refs.table.refresh()
+            }).catch(()=>{})
+        },
+        refresh(){
+            this.$refs.table.refresh()
+        },
+        upData(data){
+            this.$refs.table.upData(data)
+        },
+        handleSuccess(){
+            this.$refs.table.refresh()
+        },
+        sortChange(event){
+            if (event.order) {
+                var data = {
+                    "field":event.prop,
+                    "order":event.order
+                }
+                this.$refs.table.upData(data)
+            } else {
+                this.$refs.table.reload(this.searchKey)
+            }
+            return ;
+        },
+        selectionChange(event){
+            this.dataSelect = [];
+            var arr = [];
+            var arrCompany = [];
+            event.forEach(function(val,index){
+                arr[index] = val.id;
+                arrCompany[index] = val;
+            });
+            this.dataSelectFull = arrCompany;
+            this.dataSelect = arr;
+            this.$emit("success",this.dataSelect);
+            this.$emit("successFull",this.dataSelectFull);
+        },
+        table_passwd(row){
+            this.$nextTick(() => {
+                this.$refs.userPasswd.open("edit").setData(row)
+            })
+        }
+    }
+}
+</script>

+ 45 - 1
src/views/manage/shop/card/index.vue

@@ -1,3 +1,47 @@
 <template>
+    <el-container class="flex-column">
+        <div class="table-search">
+            <search @success="handleSuccess"></search>
+            <optionBtn @success="handleSuccess" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull" type="3"></optionBtn>
+        </div>
+        <el-main class="nopadding">
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" type="3"></tablePage>
+            </div>
+        </el-main>
+    </el-container>  
+</template>
 
-</template>
+<script>
+import search from './components/search';
+import optionBtn from './components/option';
+import tablePage from './components/table';
+export default {
+    components: {
+        search,tablePage,optionBtn
+    },
+    data(){
+        return {
+            searchKey:{},
+            dataSelect:[],
+            dataSelectFull:[],
+        }
+    },
+    methods: {
+        tableHandle(data){
+            this.dataSelect = data;
+        },
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
+        }
+    }
+}
+</script>

+ 77 - 0
src/views/manage/shop/index/components/combo.vue

@@ -0,0 +1,77 @@
+<template>
+    <el-dialog :title="titleMap[mode]" v-model="visible" :width="600" :close-on-click-modal="false" destroy-on-close @closed="$emit('closed')">
+        <el-form ref="dialogForm" :model="submitData" :rules="rules" label-width="100px" label-position="top">
+            <el-form-item label="充值店铺">
+                <el-input v-model="formData.shop_name" clearable placeholder="请输入" readonly disabled></el-input>
+                <div class="el-form-item-msg"></div>
+            </el-form-item>
+            <el-form-item label="充值套餐" prop="combo">
+                <el-select v-model="submitData.combo" clearable placeholder="请选择充值套餐" :style="{width: '100%'}">
+                    <el-option :value="item.id" :label="item.name" v-for="(item,index) in comboData" :key="index"></el-option>
+                </el-select>
+                <div class="el-form-item-msg"></div>
+            </el-form-item>
+        </el-form>
+		<template #footer>
+			<el-button @click="visible=false" >取 消</el-button>
+			<el-button type="primary" :loading="isSaveing" @click="submit()">保 存</el-button>
+		</template>
+    </el-dialog>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            loading: false,
+            isSaveing: false,
+            mode:"add",
+            titleMap:{
+                add:"店铺套餐充值",
+                edit:"店铺套餐充值"
+            },
+            visible:false,
+            formData:{},
+            submitData:{},
+            comboData:[],
+            rules:{
+                combo: [
+                    {required: true, message: '请选择'}
+                ],
+            }
+        }
+    },
+    methods:{
+        open(mode = 'add'){
+            this.mode = mode;
+            this.visible = true;
+            this.getCombo()
+            return this
+        },
+        async getCombo(){
+            var resp = await this.$API.combo.list.get({"pageSize":100,"page":1});
+            this.comboData = resp.data.rows;
+        },
+        //表单注入数据
+        setData(data){
+            this.formData = JSON.parse(JSON.stringify(data));
+        },
+        async submit(){
+            var validate = await this.$refs.dialogForm.validate().catch(()=>{});
+            if(!validate){ return false }
+            this.isSaveing = true;
+            this.submitData.shop_id = this.formData.agent_id;
+            var resp = await this.$API.shop.combo.post(this.submitData);
+            this.isSaveing = false;
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+            this.visible = false;
+            this.formData = {};
+            this.submitState = false;
+            this.$emit("success");
+        }
+    }
+}
+</script>

+ 8 - 4
src/views/manage/shop/index/components/form.vue

@@ -38,13 +38,13 @@
                                 <el-form-item label="营业时间">
                                     <el-row :gutter="10">
                                         <el-col :span="11">
-                                            <el-time-select v-model="formData.start_at" start="00:30" step="00:15" end="23:30" placeholder="请选择"  style="width: 100%"/>
+                                            <el-time-select v-model="formData.start_at" :max-time="formData.end_at" start="00:00" step="00:01" end="23:59" placeholder="请选择"  style="width: 100%"/>
                                         </el-col>
                                         <el-col :span="2" class="text-center">
                                             <span class="text-gray-500">-</span>
                                         </el-col>
                                         <el-col :span="11">
-                                            <el-time-select v-model="formData.end_at" start="00:30" step="00:15" end="23:30" placeholder="请选择"  style="width: 100%"/>
+                                            <el-time-select v-model="formData.end_at" :min-time="formData.start_at" start="00:00" step="00:01" end="23:59" placeholder="请选择"  style="width: 100%"/>
                                         </el-col>
                                     </el-row>
                                     <div class="el-form-item-msg">营业时间为必选,否则小程序端无法下单</div>
@@ -100,7 +100,7 @@
                         <el-row :gutter="15">
                             <el-col :span="24">
                                 <el-form-item label="登录用户账号" prop="userame">
-                                    <el-input v-model="formData.userame" clearable placeholder="请输入"></el-input>
+                                    <el-input v-model="formData.username" clearable placeholder="请输入"></el-input>
                                     <div class="el-form-item-msg"></div>
                                 </el-form-item>
                             </el-col>
@@ -133,6 +133,7 @@ export default {
     data(){
         return {
             loading: false,
+            isSaveing: false,
             mode:"add",
             titleMap:{
                 add:"新增店铺",
@@ -141,6 +142,9 @@ export default {
             visible:false,
             formData:{},
             rules:{
+                shop_address: [
+                    {required: true, message: '请输入'}
+                ],
                 rate_money: [
                     {required: true, message: '请输入'}
                 ],
@@ -165,7 +169,7 @@ export default {
                 end_at: [
                     {required: true, message: '请选择'}
                 ],
-                userame: [
+                username: [
                     {required: true, message: '请输入'}
                 ],
                 cash_rate: [

+ 1 - 2
src/views/manage/shop/index/components/option.vue

@@ -7,7 +7,7 @@
             <div class="left-panel">
                 <el-button type="primary" icon="el-icon-plus" @click="table_add()">新增店铺</el-button>
                 <el-button icon="el-icon-document" @click="table_batch_status(0)" :disabled="dataSelect.length>0?false:true">启用</el-button>
-                <el-button icon="el-icon-lock" @click="table_batch_status(2)" :disabled="dataSelect.length>0?false:true">禁用</el-button>
+                <el-button icon="el-icon-lock" @click="table_batch_status(2)" :disabled="dataSelect.length>0?false:true">关店</el-button>
             </div>
         </div>
     </fieldset>
@@ -21,7 +21,6 @@ export default {
         formMain
     },
     props: {
-        type: { type: String, default: "1" },
         dataSelect: { type: Array, default: () => [] },
         dataSelectFull: { type: Array, default: () => [] }
     },

+ 12 - 6
src/views/manage/shop/index/components/table.vue

@@ -34,7 +34,7 @@
                 <span class="status-danger" v-else>未设置</span>
             </template>
         </el-table-column>
-        <el-table-column label="店铺地址" prop="shop_address">
+        <el-table-column label="店铺地址" prop="shop_address" width="320">
             <template #default="scope">
                 <span v-if="scope.row.shop_address">{{ scope.row.shop_address }}</span>
                 <span class="status-danger" v-else>未设置</span>
@@ -44,11 +44,11 @@
             <template #default="scope">
                 <div class="status-success" v-if="scope.row.status==0"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
                 <div class="status-danger" v-if="scope.row.status==1"><sc-status-indicator type="danger"></sc-status-indicator> 已到期</div>
-                <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 禁用</div>
+                <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 关店</div>
             </template>
         </el-table-column>
         <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
-        <el-table-column label="操作" width="180" align="left" fixed="right">
+        <el-table-column label="操作" width="140" align="left" fixed="right">
             <template #default="scope">
                 <el-button-group>
                     <el-button size="small" @click="table_auth(scope.row)">套餐</el-button>
@@ -56,20 +56,21 @@
                 </el-button-group>
                 <div class="line-5"></div>
                 <el-button-group>
-                    <el-button size="small" @click="table_view(scope.row)">关店</el-button>
                     <el-button type="danger" size="small" @click="table_del(scope.row)">删除</el-button>
                 </el-button-group>
             </template>
         </el-table-column>
     </scTable>
     <formMain ref="formMain" @success="handleSuccess"></formMain>
+    <comboMain ref="comboMain" @success="handleSuccess"></comboMain>
 </template>
 
 <script>
 import formMain from './form';
+import comboMain from './combo';
 export default {
     components: {
-        formMain
+        formMain,comboMain
     },
     data(){
         return {
@@ -83,6 +84,11 @@ export default {
     },
     
     methods: {
+        table_auth(data){
+            this.$nextTick(() => {
+                this.$refs.comboMain.open("edit").setData(data)
+            })
+        },
         table_view(data){
             this.$nextTick(() => {
                 this.$refs.formMain.open("edit").setData(data)
@@ -92,7 +98,7 @@ export default {
             this.$confirm(`删除店铺后,所有有关该店铺的门店、订单等信息都将删除,不可恢复,确定要执行删除吗`, '提示', {
                 type: 'warning'
             }).then(async ()=>{
-                var resp = await this.$API.agent.del.post({"id":data.id});
+                var resp = await this.$API.shop.del.post({"id":data.id});
                 if (resp.code == 0) {
                     return this.$message.error(resp.msg);
                 }

+ 149 - 0
src/views/manage/shop/user/components/form.vue

@@ -0,0 +1,149 @@
+<template>
+    <el-dialog :title="titleMap[mode]" v-model="visible" :width="600" :close-on-click-modal="false" destroy-on-close @closed="$emit('closed')">
+        <el-form ref="dialogForm" :model="formData" :rules="rules" label-width="100px" label-position="top">
+            <el-row :gutter="15">
+                <el-col :span="24">
+                    <el-form-item label="帐号类型" prop="type">
+                        <el-radio-group v-model="formData.type">
+                            <el-radio border :label="1">管理员</el-radio>
+                            <el-radio border :label="2">店铺帐号</el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24" v-if="formData.type==2">
+                    <el-form-item label="所属店铺" prop="agent_id">
+                        <el-input v-model="formData.agent_id" placeholder="所属店铺" clearable readonly :style="{ width: '100%' }" @click="selectUser">
+                            <template #append>
+                                <el-tooltip
+                                    effect="dark"
+                                    content="点这里,清除选择"
+                                    placement="top-start"
+                                >
+                                <div class="remove-a" @click="clearUser">清除</div>
+                                </el-tooltip>
+                            </template>
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="用户昵称" prop="truename">
+                        <el-input v-model="formData.truename" clearable placeholder="请输入"></el-input>
+                        <div class="el-form-item-msg"></div>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="登录用户账号" prop="username">
+                        <el-input v-model="formData.username" clearable placeholder="请输入"></el-input>
+                        <div class="el-form-item-msg"></div>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="新的登录密码" prop="password">
+                        <el-input v-model="formData.password" clearable placeholder="请输入"></el-input>
+                        <div class="el-form-item-msg"></div>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="重复登录密码" prop="password2">
+                        <el-input v-model="formData.password2" clearable placeholder="请输入"></el-input>
+                        <div class="el-form-item-msg"></div>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+		<template #footer>
+			<el-button @click="visible=false" >取 消</el-button>
+			<el-button type="primary" :loading="isSaveing" @click="submit()">保 存</el-button>
+		</template>
+    </el-dialog>
+    <agentData ref="agentData" :multiple="false" @success="handleSuccess"></agentData>
+</template>
+
+<script>
+import agentData from "@/views/manage/components/agent";
+export default {
+    components: {
+        agentData
+    },
+    data(){
+        return {
+            loading: false,
+            isSaveing: false,
+            mode:"add",
+            titleMap:{
+                add:"新增帐号",
+                edit:"编辑帐号"
+            },
+            visible:false,
+            formData:{
+                type:2
+            },
+            rules:{
+                type: [
+                    {required: true, message: '请选择'}
+                ],
+                username: [
+                    {required: true, message: '请输入'}
+                ],
+                password: [
+                    {required: true, message: '请输入登录密码'}
+                ],
+                password2: [
+                    {required: true, message: '请再次输入密码'},
+                    {validator: (rule, value, callback) => {
+                        if (value !== this.formData.password) {
+                            callback(new Error('两次输入密码不一致!'));
+                        }else{
+                            callback();
+                        }
+                    }}
+                ],
+                agent_id: [
+                    {required: true, message: '请选择'}
+                ],
+            }
+        }
+    },
+    methods:{
+        handleSuccess(data){
+            this.formData.agent_id = data.agent_id;
+        },
+        clearUser(){
+            this.formData.agent_id = "";
+        },
+        selectUser(){
+            this.$nextTick(() => {
+                this.$refs.agentData.open()
+            })
+        },
+        open(mode = 'add'){
+            this.mode = mode;
+            this.visible = true;
+            return this
+        },
+        //表单注入数据
+        setData(data){
+            this.formData = JSON.parse(JSON.stringify(data));
+        },
+        async submit(){
+            var validate = await this.$refs.dialogForm.validate().catch(()=>{});
+            if(!validate){ return false }
+            this.isSaveing = true;
+            let submitData = JSON.parse(JSON.stringify(this.formData));
+            submitData.password = this.$TOOL.crypto.MD5(this.formData.password);
+            submitData.password2 = this.$TOOL.crypto.MD5(this.formData.password2);
+            var resp = await this.$API.user.save.post(submitData);
+            this.isSaveing = false;
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+            this.visible = false;
+            this.formData = {
+                type:2
+            };
+            this.$emit("success");
+        }
+    }
+}
+</script>

+ 56 - 0
src/views/manage/shop/user/components/option.vue

@@ -0,0 +1,56 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">按需操作</el-tag>
+        </legend>
+        <div class="op-header">
+            <div class="left-panel">
+                <el-button type="primary" icon="el-icon-plus" @click="table_add()">新增帐号</el-button>
+                <el-button icon="el-icon-document" @click="table_batch_status(1)" :disabled="dataSelect.length>0?false:true">启用</el-button>
+                <el-button icon="el-icon-lock" @click="table_batch_status(0)" :disabled="dataSelect.length>0?false:true">禁用</el-button>
+            </div>
+        </div>
+    </fieldset>
+    <formMain ref="formMain" @success="handleSuccess"></formMain>
+</template>
+
+<script>
+import formMain from './form';
+export default {
+    components: {
+        formMain
+    },
+    props: {
+        type: { type: String, default: "1" },
+        dataSelect: { type: Array, default: () => [] },
+        dataSelectFull: { type: Array, default: () => [] }
+    },
+    data(){
+        return {
+
+        }
+    },
+    methods: {
+        async table_batch_status(status){
+            if (this.dataSelect.length == 0) {
+                return this.$message.error("请选择修改数据")
+            }
+            let submitData = {"id":this.dataSelect,"value":status,"field":"status","type":"batch"};
+            var resp = await this.$API.user.batch.post(submitData);
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg);
+            }
+            this.$message.success(resp.msg);
+            this.$emit("success");
+        },
+        handleSuccess(){
+            this.$emit("success");
+        },
+        table_add(){
+            this.$nextTick(() => {
+                this.$refs.formMain.open("add")
+            })
+        },
+    }
+}
+</script>

+ 54 - 0
src/views/manage/shop/user/components/search.vue

@@ -0,0 +1,54 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">条件筛选</el-tag>
+        </legend>
+        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
+            <div class="search-form">
+                <div class="form-left">
+                    <el-row :gutter="10">
+                        <el-col :span="this.$store.state.global.ismobile?12:4">
+                            <el-input v-model="searchKey.truename" placeholder="账户昵称" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>账户昵称</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :span="this.$store.state.global.ismobile?12:4">
+                            <el-input v-model="searchKey.username" placeholder="登录账号" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>登录账号</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :span="this.$store.state.global.ismobile?12:4">
+                            <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
+                                <el-option value="1" label="禁用"></el-option>
+                                <el-option value="2" label="正常"></el-option>
+                                <template #prefix>状态</template>
+                            </el-select>
+                        </el-col>
+                        <el-col :span="this.$store.state.global.ismobile?12:4">
+                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="form-line"></div>
+                <div class="form-right">
+                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
+                </div>
+            </div>
+        </el-form>
+    </fieldset>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            searchKey:{}
+        }
+    },
+    methods: {
+        searchForm(){
+            this.$emit("success",this.searchKey);
+        }
+    }
+}
+</script>

+ 148 - 0
src/views/manage/shop/user/components/table.vue

@@ -0,0 +1,148 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        <el-table-column label="账户昵称" width="150" fixed="left" prop="truename">
+            <template #default="scope">
+                <span v-if="scope.row.truename">{{ scope.row.truename }}</span>
+                <span class="status-danger" v-else>未设置</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="所属店铺" width="150" prop="user_id">
+            <template #default="scope">
+                <span v-if="scope.row.account">{{ scope.row.account.shop_name }}</span>
+                <span class="status-danger" v-else>-</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="登录账号" prop="username" width="150">
+            <template #default="scope">
+                <span v-if="scope.row.username">{{ scope.row.username }}</span>
+                <span class="status-danger" v-else>未设置</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="账户类型" prop="type" width="120" align="left">
+            <template #default="scope">
+                <div class="status-success" v-if="scope.row.type==1"><sc-status-indicator type="success"></sc-status-indicator> 系统管理员</div>
+                <div class="status-danger" v-if="scope.row.type==2"><sc-status-indicator type="danger"></sc-status-indicator> 店铺账号</div>
+                <div class="status-info" v-if="scope.row.type==3"><sc-status-indicator type="info"></sc-status-indicator> 店铺账号</div>
+            </template>
+        </el-table-column>
+        <el-table-column label="登录时间" prop="login_at" width="180">
+            <template #default="scope">
+                {{scope.row.login_at?scope.row.login_at:'-'}}
+            </template>
+        </el-table-column>
+        <el-table-column label="登录IP" prop="login_ip" width="180">
+            <template #default="scope">
+                {{scope.row.login_ip?scope.row.login_ip:'-'}}
+            </template>
+        </el-table-column>
+        <el-table-column label="登录次数" prop="login_num" width="180"></el-table-column>
+        <el-table-column label="注册时间" prop="create_at" width="180"></el-table-column>
+        <el-table-column label="注册IP" prop="create_ip" width="180"></el-table-column>
+        <el-table-column label="状态" prop="status" width="120" align="center">
+            <template #default="scope">
+                <el-popconfirm title="确定要启用或冻结该账号吗?" @confirm="table_state(scope.row)">
+                    <template #reference>
+                        <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
+                        <div class="status-danger" v-else><sc-status-indicator type="danger"></sc-status-indicator> 禁用</div>
+                    </template>
+                </el-popconfirm>
+            </template>
+        </el-table-column>
+        <el-table-column label="操作" width="160" align="right" fixed="right">
+            <template #default="scope">
+                <el-button-group>
+                    <el-button text type="warning" size="small" @click="table_passwd(scope.row)">修改密码</el-button>
+                    <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
+                        <template #reference>
+                            <el-button text type="danger" size="small">删除</el-button>
+                        </template>
+                    </el-popconfirm>                    
+                </el-button-group>
+            </template>
+        </el-table-column>
+    </scTable>
+    <passwd ref="userPasswd"></passwd>
+</template>
+
+<script>
+import passwd from "../password";
+export default {
+    components: {
+        passwd
+    },
+    props: {},
+    data(){
+        return {
+            list: {
+                apiObj: this.$API.user.list
+            },
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{}
+        }
+    },
+    methods: {
+        async table_del(data){
+            var resp = await this.$API.user.del.post({"id":data.id});
+            if (resp.code == 0) {
+                return this.$message.error(resp.msg)
+            }
+            this.$message.success(resp.msg)
+            this.$refs.table.refresh()
+        },
+        async table_state(data){
+            var status = 1;
+            if (data.status == 1) {
+                status = 0;
+            }
+            var resp = await this.$API.user.state.post({"id":data.id});
+            if (resp.code == 0) {
+                this.$message.warning(resp.msg)
+                return false;
+            }
+            this.$message.success(resp.msg)
+            this.$refs.table.refresh()
+        },
+        refresh(){
+            this.$refs.table.refresh()
+        },
+        upData(data){
+            this.$refs.table.upData(data)
+        },
+        handleSuccess(){
+            this.$refs.table.refresh()
+        },
+        sortChange(event){
+            if (event.order) {
+                var data = {
+                    "field":event.prop,
+                    "order":event.order
+                }
+                this.$refs.table.upData(data)
+            } else {
+                this.$refs.table.reload(this.searchKey)
+            }
+            return ;
+        },
+        selectionChange(event){
+            this.dataSelect = [];
+            var arr = [];
+            var arrCompany = [];
+            event.forEach(function(val,index){
+                arr[index] = val.id;
+                arrCompany[index] = val;
+            });
+            this.dataSelectFull = arrCompany;
+            this.dataSelect = arr;
+            this.$emit("success",this.dataSelect);
+            this.$emit("successFull",this.dataSelectFull);
+        },
+        table_passwd(row){
+            this.$nextTick(() => {
+                this.$refs.userPasswd.open("edit").setData(row)
+            })
+        },
+    }
+}
+</script>

+ 47 - 3
src/views/manage/shop/user/index.vue

@@ -1,3 +1,47 @@
-<template>
-
-</template>
+<template>
+    <el-container class="flex-column">
+        <div class="table-search">
+            <search @success="handleSuccess"></search>
+            <optionBtn @success="handleSuccess" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull"></optionBtn>
+        </div>
+        <el-main class="nopadding">
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" type="2"></tablePage>
+            </div>
+        </el-main>
+    </el-container>  
+</template>
+
+<script>
+import search from './components/search';
+import tablePage from './components/table';
+import optionBtn from './components/option';
+export default {
+    components: {
+        search,tablePage,optionBtn
+    },
+    data(){
+        return {
+            searchKey:{},
+            dataSelect:[],
+            dataSelectFull:[],
+        }
+    },
+    methods: {
+        tableHandle(data){
+            this.dataSelect = data;
+        },
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
+        }
+    }
+}
+</script>

+ 96 - 0
src/views/manage/shop/user/password.vue

@@ -0,0 +1,96 @@
+<template>
+    <el-dialog :title="titleMap[mode]" v-model="visible" :width="500" destroy-on-close @closed="$emit('closed')">
+        <el-form :model="formData" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-position="top" label-width="120px">
+            <el-form-item label="登录账号">
+				<el-input v-model="formData.username" disabled></el-input>
+			</el-form-item>
+            <el-form-item label="账号昵称">
+				<el-input v-model="formData.truename" disabled></el-input>
+			</el-form-item>
+            <el-form-item label="新密码" prop="password">
+                <el-input type="password" v-model="formData.password" clearable show-password></el-input>
+            </el-form-item>
+            <el-form-item label="确认新密码" prop="password2">
+                <el-input type="password" v-model="formData.password2" clearable show-password></el-input>
+            </el-form-item>
+        </el-form>
+		<template #footer>
+			<el-button @click="visible=false" >取 消</el-button>
+			<el-button v-if="mode!='show'" type="primary" :loading="isSaveing" @click="submit()">保 存</el-button>
+		</template>
+    </el-dialog>
+</template>
+
+<script>
+import scPasswordStrength from '@/components/scPasswordStrength'
+export default{
+    components: {
+        scPasswordStrength
+    },
+    data(){
+        return {
+            loading: false,
+            mode:"edit",
+            titleMap:{
+                edit:"修改密码"
+            },
+            visible: false,
+            isSaveing: false,
+            formData:{},
+            rules:{
+                password: [
+                    {required: true, message: '请输入登录密码'}
+                ],
+                password2: [
+                    {required: true, message: '请再次输入密码'},
+                    {validator: (rule, value, callback) => {
+                        if (value !== this.formData.password) {
+                            callback(new Error('两次输入密码不一致!'));
+                        }else{
+                            callback();
+                        }
+                    }}
+                ],
+            }
+        }
+    },
+    methods:{
+        open(mode = 'edit'){
+            this.mode = mode;
+            this.visible = true;
+            return this
+        },
+        //表单注入数据
+        setData(data){
+            data.password = "";
+            data.password2 = "";
+            this.formData = data;
+        },
+        submit(){
+            this.isSaveing = true;
+            this.$refs.dialogForm.validate(async (valid) => {
+                if (valid) {
+                    let password = this.$TOOL.crypto.MD5(this.formData.password);
+                    var result = await this.$API.user.pwd.post({password:password,id:this.formData.id});
+                    if(result.code !== 1){
+                        this.$message.warning(result.msg)
+                        this.isSaveing = false;
+                        return false;
+                    }
+                    this.$message.success(result.msg)
+                    this.isSaveing = false;
+                    this.visible = false;
+                    this.formData = {};
+                }else{
+                    this.isSaveing = false;
+                    return false;
+                }
+            });
+        }
+    }
+}
+</script>
+
+<style lang="less" scoped>
+
+</style>