linwenxin 9 kuukautta sitten
vanhempi
commit
9cd95d4bc6

+ 56 - 4
src/views/setting/organizationManagement/tenantDetails/index.vue

@@ -164,13 +164,13 @@
               </el-form-item>
             </el-col>
 
-            <el-col :span="24">
+            <el-col :span="12">
               <div style="margin-bottom: 20px">
                 小程序底部菜单排序 <span style="color: #fb8c45; margin-left: 20px"> 数字越小越靠前</span>
               </div>
               <el-table
                 :data="step1Form.appModuleJson"
-                style="width: 50%"
+                style="width: 100%"
                 element-loading-text="Loading"
                 border
                 fit
@@ -206,6 +206,41 @@
                 </el-table-column>
               </el-table>
             </el-col>
+            <el-col :span="12">
+              <div style="margin-bottom: 20px">
+                小程序首页模块设置 <span style="color: #fb8c45; margin-left: 20px"> </span>
+              </div>
+              <el-table
+                :data="step1Form.sortModuleJson"
+                style="width: 100%"
+                element-loading-text="Loading"
+                border
+                fit
+                highlight-current-row
+                stripe
+              >
+                <el-table-column prop="name" align="center" label="模块名称"> </el-table-column>
+                <el-table-column prop="status" align="center" label="是否显示">
+                  <template slot-scope="scope">
+                    <el-form-item :prop="'sortModuleJson.' + scope.$index + '.status'" label-width="0">
+                      <el-switch v-model="scope.row.status" active-color="#13ce66" inactive-color="#ff4949">
+                      </el-switch>
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="" align="center" label="排序">
+                  <template slot-scope="scope">
+                    <el-form-item
+                      :prop="'sortModuleJson.' + scope.$index + '.sort'"
+                      :rules="[{ required: true, message: `请输入排序`, trigger: 'blur' }]"
+                      label-width="0"
+                    >
+                      <el-input type="number" v-model="scope.row.sort" placeholder="请输入"></el-input>
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-col>
           </el-row>
         </el-form>
       </el-card>
@@ -762,7 +797,8 @@ export default {
         companyType: 2,
         yjhxDkFlag: '',
         offlinePay: true,
-        appModuleJson: []
+        appModuleJson: [],
+        sortModuleJson: []
       },
 
       passwordType1: 'password',
@@ -791,6 +827,20 @@ export default {
         newPassword: [{ required: true, validator: validatePass, trigger: 'blur' }],
         confirmPassword: [{ required: true, validator: validatePass2, trigger: 'blur' }]
       },
+      // 模块
+      mokuai: [
+        { name: '商城', code: 'home-rinse', status: true, sort: 0 },
+        { name: '专业回收', code: 'professionalRecycling', status: true, sort: 0 },
+        { name: '工程维保', code: 'engineering', status: true, sort: 0 },
+        { name: '二手商城', code: 'Second-handMall', status: true, sort: 0 },
+        { name: '自助服务', code: 'selfService', status: true, sort: 0 },
+        { name: '增值服务', code: 'value-addedServices', status: true, sort: 0 },
+        { name: '分享收益', code: 'revenueSharing', status: true, sort: 0 },
+        { name: '工单管理', code: 'workorderManagement', status: true, sort: 0 },
+        { name: '辅配件', code: 'materials', status: true, sort: 0 },
+        { name: '扫码活动', code: 'activity', status: true, sort: 0 },
+        { name: '联系我们', code: 'contactUs', status: true, sort: 0 }
+      ],
 
       step3Form: {
         enterpriseId: '',
@@ -898,6 +948,7 @@ export default {
         this.step1Form.yjhxDkFlag = res.data.yjhxDkFlag
         this.step1Form.offlinePay = res.data.offlinePay
         this.step1Form.appModuleJson = JSON.parse(res.data.appModuleJson)
+        this.step1Form.sortModuleJson = JSON.parse(res.data.sortModuleJson)
 
         this.img1_url = res.data.minLogo1
         this.img2_url = res.data.minLogo2
@@ -1051,7 +1102,8 @@ export default {
             companyType: this.step1Form.companyType,
             yjhxDkFlag: this.step1Form.yjhxDkFlag,
             offlinePay: this.step1Form.offlinePay,
-            appModuleJson: JSON.stringify(this.step1Form.appModuleJson)
+            appModuleJson: JSON.stringify(this.step1Form.appModuleJson),
+            sortModuleJson: JSON.stringify(this.step1Form.sortModuleJson)
           }
           editAccount(params)
             .then(res => {

+ 120 - 53
src/views/setting/organizationManagement/tenantManagement/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <!-- 筛选条件 -->
-    <div class="screen-container"  v-if="!!~[2].indexOf(userType)">
+    <div class="screen-container" v-if="!!~[2].indexOf(userType)">
       <div class="top clearfix">
         <div class="title fl">条件筛选</div>
       </div>
@@ -31,11 +31,16 @@
             <el-form-item label="状态" prop="state">
               <el-select v-model="screenForm.status" placeholder="全部">
                 <el-option label="全部" value=""></el-option>
-                <el-option :label="item.label" :value="item.value" v-for="(item, index) in select_status" :key="index"></el-option>
+                <el-option
+                  :label="item.label"
+                  :value="item.value"
+                  v-for="(item, index) in select_status"
+                  :key="index"
+                ></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          
+
           <el-col :xs="24" :sm="12" :lg="18" class="tr">
             <el-form-item label="">
               <el-button size="small" @click="resetScreenForm">清空</el-button>
@@ -56,17 +61,35 @@
         </div>
       </div>
       <div class="table">
-        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+        >
           <el-table-column align="center" label="操作" width="230" fixed="right">
             <template slot-scope="scope">
               <el-button type="text" @click="toDetail(scope.row.adminUserId, 1)">详情</el-button>
               <el-button type="text" @click="toDetail(scope.row.adminUserId, 2)">商城配置</el-button>
               <template v-if="!!~[2].indexOf(userType)">
                 <el-button type="text" @click="toDetail(scope.row.adminUserId, 3)">微信配置</el-button>
-                <el-popconfirm v-if="scope.row.status" style="margin-left: 10px;" title="确定冻结吗?" @confirm="changeStatus(scope.row.adminUserId, 0)" >
+                <el-popconfirm
+                  v-if="scope.row.status"
+                  style="margin-left: 10px"
+                  title="确定冻结吗?"
+                  @confirm="changeStatus(scope.row.adminUserId, 0)"
+                >
                   <el-button slot="reference" type="text">冻结</el-button>
                 </el-popconfirm>
-                <el-popconfirm v-else style="margin-left: 10px;" title="确定恢复吗?" @confirm="changeStatus(scope.row.adminUserId, 1)" >
+                <el-popconfirm
+                  v-else
+                  style="margin-left: 10px"
+                  title="确定恢复吗?"
+                  @confirm="changeStatus(scope.row.adminUserId, 1)"
+                >
                   <el-button slot="reference" type="text">恢复</el-button>
                 </el-popconfirm>
               </template>
@@ -77,16 +100,58 @@
               <el-button type="text" @click="toAccountList(scope.row)">查看</el-button>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="商户昵称" prop="companyName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="负责人" prop="linkName" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="角色" prop="roleName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="联系电话" prop="linkPhone" min-width="160" show-overflow-tooltip></el-table-column>
-		      <el-table-column align="center" label="到期时间" prop="expireTime" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="电子邮箱" prop="email" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="地址" prop="address" min-width="200" show-overflow-tooltip></el-table-column>
+          <el-table-column
+            align="center"
+            label="商户昵称"
+            prop="companyName"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="负责人"
+            prop="linkName"
+            min-width="100"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="角色"
+            prop="roleName"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="联系电话"
+            prop="linkPhone"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="到期时间"
+            prop="expireTime"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="电子邮箱"
+            prop="email"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="地址"
+            prop="address"
+            min-width="200"
+            show-overflow-tooltip
+          ></el-table-column>
           <el-table-column align="center" label="状态" class-name="status-col">
             <template slot-scope="scope">
-              <el-tag :type="scope.row.status ? 'success':'danger'">{{ scope.row.status ? '正常':'冻结' }}</el-tag>
+              <el-tag :type="scope.row.status ? 'success' : 'danger'">{{ scope.row.status ? '正常' : '冻结' }}</el-tag>
             </template>
           </el-table-column>
         </el-table>
@@ -101,7 +166,8 @@
           :page-sizes="[10, 20, 30, 50]"
           :page-size="10"
           layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal">
+          :total="listTotal"
+        >
         </el-pagination>
       </div>
     </div>
@@ -110,8 +176,8 @@
 
 <script>
 import { COMMON_SELECT } from '@/utils/select_data'
-import {getList, changeAccountStatus} from "@/api/merchant";
-import {downloadFiles} from '@/utils/util'
+import { getList, changeAccountStatus } from '@/api/merchant'
+import { downloadFiles } from '@/utils/util'
 export default {
   data() {
     return {
@@ -121,86 +187,89 @@ export default {
       listTotal: 0, // 列表总数
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
-      screenForm: { // 筛选表单数据
+      screenForm: {
+        // 筛选表单数据
         account: '',
         nickname: '',
         phone: '',
         email: '',
-        status: '',
+        status: ''
       },
-      select_status: [ // 筛选字段 - 状态
+      select_status: [
+        // 筛选字段 - 状态
         { label: '正常', value: true },
         { label: '冻结', value: false }
-      ],
+      ]
     }
   },
   computed: {
     userType() {
       return JSON.parse(localStorage.getItem('greemall_user')).type
-    },
+    }
   },
   created() {
-    this.getListfun();
+    this.getListfun()
   },
   methods: {
     // 查询列表
     getListfun() {
-      this.listLoading = true;
+      this.listLoading = true
       getList({
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         ...this.screenForm
-      }).then((res) => {
-        this.dataList = res.data.records;
-        this.listTotal = res.data.total;
-        this.listLoading = false;
+      }).then(res => {
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
+        this.listLoading = false
       })
     },
     // 提交筛选表单
     submitScreenForm() {
-      this.currentPage = 1;
-      this.getListfun();
+      this.currentPage = 1
+      this.getListfun()
     },
     // 重置筛选表单
     resetScreenForm() {
-      this.$refs.screenForm.resetFields();
-      this.currentPage = 1;
-      this.getListfun();
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getListfun()
     },
     // 更改每页数量
     handleSizeChange(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-      this.getListfun();
+      this.pageSize = val
+      this.currentPage = 1
+      this.getListfun()
     },
     // 更改当前页
     handleCurrentChange(val) {
-      this.currentPage = val;
-      this.getListfun();
+      this.currentPage = val
+      this.getListfun()
     },
 
     // 去开通账号
     toCreate() {
       this.$router.push({
-        name:"settledManagement",
+        name: 'settledManagement',
         query: {}
       })
     },
 
     toAccountList(data) {
       this.$router.push({
-        name:"account",
+        name: 'account',
         query: {
-          companyWechatId:data.companyWechatId
+          companyWechatId: data.companyWechatId
         }
       })
     },
 
     toDetail(id, type) {
       this.$router.push({
-        name:"tenantDetails",
+        name: 'tenantDetails',
         query: {
-          id, type
+          id,
+          type
         }
       })
     },
@@ -208,9 +277,9 @@ export default {
     // 操作 - 更改状态(type: 禁用0,启用1)
     changeStatus(id, type) {
       type = type ? true : false
-      changeAccountStatus({adminUserId: id, status: type}).then(res => {
-        this.getListfun();
-        this.$successMsg();
+      changeAccountStatus({ adminUserId: id, status: type }).then(res => {
+        this.getListfun()
+        this.$successMsg()
       })
     },
 
@@ -221,14 +290,12 @@ export default {
         nickName: this.screenForm.nickName,
         linkPhone: this.screenForm.phone,
         email: this.screenForm.email,
-        status: this.screenForm.status,
-      };
-      downloadFiles('admin/user/mch/export', screenData);
-    },
+        status: this.screenForm.status
+      }
+      downloadFiles('admin/user/mch/export', screenData)
+    }
   }
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>