From 7ad3d376d3ccb029bb8077725aa70747b0ebb2ad Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期四, 14 三月 2024 16:15:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
company/src/views/business/shop.vue | 155 +++++
server/service/src/main/java/com/doumee/service/system/impl/SystemPermissionServiceImpl.java | 7
company/src/components/system/permission/OperaPermissionWindow.vue | 15
server/platform/src/main/java/com/doumee/api/system/SystemPermissionController.java | 4
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java | 33 +
server/company/src/main/java/com/doumee/api/system/SystemPermissionController.java | 46 -
company/src/views/business/company.vue | 3
company/src/components/business/OperaShopDescWindow.vue | 437 +++++++++++++++
server/platform/src/main/java/com/doumee/api/business/ApplyChagneDetailController.java | 1
company/src/views/system/permission.vue | 17
company/src/components/business/OperaCompanyWindow.vue | 10
company/src/components/system/menu/OperaMenuComWindow.vue | 129 ++--
company/src/views/system/menuShop.vue | 231 ++++++++
server/service/src/main/java/com/doumee/service/business/CompanyService.java | 1
server/service/src/main/resources/mappers/SystemPermissionMapper.xml | 9
company/src/components/business/OperaCompanyDescWindow.vue | 37
server/service/src/main/java/com/doumee/config/shiro/ShiroToken.java | 2
server/company/src/main/java/com/doumee/api/system/SystemMenuController.java | 66 --
server/platform/src/main/java/com/doumee/api/business/CompanyController.java | 29
company/src/api/system/menu.js | 5
company/src/components/common/MenuSelect.vue | 4
server/service/src/main/java/com/doumee/dao/system/model/SystemPermission.java | 8
company/src/views/system/menuCom.vue | 2
server/service/src/main/java/com/doumee/dao/business/model/ApplyChange.java | 2
company/src/components/business/OperaShopWindow.vue | 303 ++++++++++
server/shop/src/main/java/com/doumee/api/system/SystemPermissionController.java | 47 -
server/shop/src/main/java/com/doumee/api/system/SystemMenuController.java | 62 --
company/.env.development | 2
28 files changed, 1,348 insertions(+), 319 deletions(-)
diff --git a/company/.env.development b/company/.env.development
index c0dfade..33ca5df 100644
--- a/company/.env.development
+++ b/company/.env.development
@@ -15,4 +15,4 @@
# 骞冲彴绔�-钀嶅
# VUE_APP_API = 'http://192.168.0.105:10023/'
- VUE_APP_API = 'http://localhost:10030/'
+VUE_APP_API = 'http://localhost:10030/'
diff --git a/company/src/api/system/menu.js b/company/src/api/system/menu.js
index 170973f..dde6d0f 100644
--- a/company/src/api/system/menu.js
+++ b/company/src/api/system/menu.js
@@ -6,8 +6,9 @@
}
// 鏌ヨ----浼佷笟鑿滃崟
-export function fetchTree1 () {
- return request.post(`/system/menu/treeList/1`)
+export function fetchTree1 (type) {
+ type = type || 1;
+ return request.post(`/system/menu/treeList/${type}`)
}
// 鏂板缓
diff --git a/company/src/components/business/OperaCompanyDescWindow.vue b/company/src/components/business/OperaCompanyDescWindow.vue
index c17dd6d..a0632f9 100644
--- a/company/src/components/business/OperaCompanyDescWindow.vue
+++ b/company/src/components/business/OperaCompanyDescWindow.vue
@@ -94,9 +94,9 @@
<div class="info_list_item">
<div class="info_list_item_label" style="width: 100px;">钀ヤ笟鎵х収锛�</div>
<div class="info_list_item_val">
- <div class="image" v-if="form.businessImg.fileurlFull">
+ <div class="image" v-if="form.businessImg && form.businessImg.fileurlFull">
<el-image
- v-if="form.businessImg.fileurlFull!=null"
+ v-if="form.businessImg!=null&&form.businessImg.fileurlFull!=null"
style="width: 90px; height: 90px"
:src="form.businessImg.fileurlFull"
:preview-src-list="[form.businessImg.fileurlFull]">
@@ -107,7 +107,7 @@
<div class="info_list_item">
<div class="info_list_item_label" style="width: 100px;">娉曚汉韬唤璇侊細</div>
<div class="info_list_item_val">
- <div class="image" v-if="form.idcardImgList[0].fileurlFull">
+ <div class="image" v-if="form.idcardImgList && form.idcardImgList .length>1 && form.idcardImgList[0].fileurlFull">
<el-image
append-to-body
v-if="form.idcardImgList[0].fileurlFull"
@@ -116,7 +116,7 @@
:preview-src-list="[form.idcardImgList[0].fileurlFull]">
</el-image>
</div>
- <div class="image" v-if="form.idcardImgList[1].fileurlFull">
+ <div class="image" v-if="form.idcardImgList && form.idcardImgList .length>2 && form.idcardImgList[1].fileurlFull">
<el-image
append-to-body
v-if="form.idcardImgList[1].fileurlFull"
@@ -130,7 +130,7 @@
<div class="info_list_item">
<div class="info_list_item_label" style="width: 100px;">浼佷笟绛剧珷锛�</div>
<div class="info_list_item_val">
- <div class="image" v-if="form.signImg.fileurlFull">
+ <div class="image" v-if="form.signImg && form.signImg.fileurlFull">
<el-image
v-if="form.signImg.fileurlFull!=null"
style="width: 90px; height: 90px"
@@ -277,7 +277,7 @@
this.getDetail()
},
getDetail () {
- var that =this
+ var that = this
getById(this.dataId)
.then(res => {
this.form = res
@@ -299,15 +299,22 @@
imgurl: '',
imgurlfull: ''
}
-
- this.form.file.imgurl = res.businessImg.fileurl
- this.form.file.imgurlfull = res.businessImg.fileurlFull
- this.form.file1.imgurl = res.idcardImgList[0].fileurl
- this.form.file1.imgurlfull = res.idcardImgList[0].fileurlFull
- this.form.file2.imgurl = res.idcardImgList[1].fileurl
- this.form.file2.imgurlfull = res.idcardImgList[1].fileurlFull
- this.form.file3.imgurl = res.signImg.fileurl
- this.form.file3.imgurlfull = res.signImg.fileurlFull
+ if(res.businessImg){
+ this.form.file.imgurl = res.businessImg.fileurl
+ this.form.file.imgurlfull = res.businessImg.fileurlFull
+ }
+ if (res.idcardImgList&& res.idcardImgList.length>1) {
+ this.form.file1.imgurl = res.idcardImgList[0].fileurl
+ this.form.file1.imgurlfull = res.idcardImgList[0].fileurlFull
+ }
+ if (res.idcardImgList && res.idcardImgList.length>2) {
+ this.form.file2.imgurl = res.idcardImgList[1].fileurl
+ this.form.file2.imgurlfull = res.idcardImgList[1].fileurlFull
+ }
+ if (res.signImg) {
+ this.form.file3.imgurl = res.signImg.fileurl
+ this.form.file3.imgurlfull = res.signImg.fileurlFull
+ }
listForCompany({ companyId: this.dataId })
.then(resa => {
diff --git a/company/src/components/business/OperaCompanyWindow.vue b/company/src/components/business/OperaCompanyWindow.vue
index dc1baad..37f7315 100644
--- a/company/src/components/business/OperaCompanyWindow.vue
+++ b/company/src/components/business/OperaCompanyWindow.vue
@@ -23,10 +23,10 @@
<el-button type="primary" style="flex-shrink: 0; margin-left: 15px;" v-else>{{num}}s</el-button>
</div>
</el-form-item>
- <el-form-item label="楠岃瘉鐮�" prop="captche" v-if="form.type !== 1">
+ <el-form-item label="楠岃瘉鐮�" prop="captche" v-if="!form.id">
<el-input v-model="form.captche" placeholder="璇疯緭鍏�" v-trim/>
</el-form-item>
- <el-form-item label="鍏徃璐﹀彿" prop="username" v-if="form.type !== 1">
+ <el-form-item label="鍏徃璐﹀彿" prop="username" v-if="!form.id">
<el-input v-model="form.username" placeholder="璇疯緭鍏�" v-trim/>
</el-form-item>
<el-form-item label="璁よ瘉閭" prop="email" >
@@ -68,9 +68,9 @@
<!-- </div>-->
<!-- </el-form-item>-->
</el-form>
- <el-button type="primary" style="margin-bottom: 15px;" @click="add" v-if="form.type !== 1">娣诲姞</el-button>
+ <el-button type="primary" style="margin-bottom: 15px;" @click="add" v-if="!form.id">娣诲姞</el-button>
<el-table
- v-if="form.type !== 1"
+ v-if="!form.id"
:data="form.solutionList"
border
style="width: 100%">
@@ -161,6 +161,7 @@
}
],
type: '0',
+ actionType: '0',
file: {
imgurl: '',
imgurlfull: ''
@@ -217,7 +218,6 @@
{ required: true, message: '璇疯緭鍏ュ叕鍙歌处鍙�' }
]
},
-
programme: []
}
},
diff --git a/company/src/components/business/OperaShopDescWindow.vue b/company/src/components/business/OperaShopDescWindow.vue
new file mode 100644
index 0000000..a0632f9
--- /dev/null
+++ b/company/src/components/business/OperaShopDescWindow.vue
@@ -0,0 +1,437 @@
+<template>
+ <GlobalWindow
+ :title="title"
+ width="100%"
+ :withFooter="false"
+ :visible.sync="visible"
+ :confirm-working="isWorking"
+ @confirm="confirm"
+ >
+ <div class="info">
+ <div class="info_label">
+ <span>浼佷笟璇︽儏</span>
+ <div>
+ <el-button type="primary" @click="$refs.modification.open('淇敼淇濋櫓鏂规', form)">鏇存敼淇濋櫓鏂规</el-button>
+ <el-button type="primary" @click="$refs.operaCompanyWindow.open('缂栬緫浼佷笟淇℃伅', form)">淇敼浼佷笟淇℃伅</el-button>
+ </div>
+ </div>
+ <div class="info_list">
+ <div class="info_list_item">
+ <div class="info_list_item_label">浼佷笟鍚嶇О锛�</div>
+ <div class="info_list_item_val">{{form.name || '-'}}</div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label">缁熶竴淇$敤浠g爜锛�</div>
+ <div class="info_list_item_val">{{form.code || '-'}}</div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label">鍏徃璐﹀彿锛�</div>
+ <div class="info_list_item_val">{{form.username || '-'}}</div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label">缁戝畾鎵嬫満鍙凤細</div>
+ <div class="info_list_item_val">
+ {{form.phone || '-'}}
+ <el-button type="primary" size="mini" style="margin-left: 10px;" @click="visiblePhone = true">鏇存敼缁戝畾</el-button>
+ </div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label">璁よ瘉閭锛�</div>
+ <div class="info_list_item_val">{{form.email || '-'}}</div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label">绾崇◣浜鸿瘑鍒彿锛�</div>
+ <div class="info_list_item_val">{{form.taxCode || '-'}}</div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label">寮�鎴疯锛�</div>
+ <div class="info_list_item_val">{{form.taxBank || '-'}}</div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label">閾惰璐﹀彿锛�</div>
+ <div class="info_list_item_val">{{form.taxAccount || '-'}}</div>
+ </div>
+ <div class="info_list_item" style="width: 100%;">
+ <div class="info_list_item_label">鍦板潃銆佺數璇濓細</div>
+ <div class="info_list_item_val">{{form.taxAddr || '-'}}</div>
+ </div>
+ <div class="info_list_item" style="width: 100%;">
+ <div class="info_list_item_label">鐢靛瓙鍙戠エ鎺ユ敹鍦板潃锛�</div>
+ <div class="info_list_item_val">{{form.invoiceEmail || '-'}}</div>
+ </div>
+ <div class="info_list_item" style="width: 100%;">
+ <div class="info_list_item_label">绾歌川鍙戠エ鎺ユ敹鍦板潃锛�</div>
+ <div class="info_list_item_val">{{form.invoiceAddr || '-'}}</div>
+ </div>
+ </div>
+ <el-table
+ :data="form.solutionListName"
+ border
+ style="width: 100%; margin-bottom: 20px;">
+ <el-table-column
+ label="搴忓彿"
+ align="center"
+ width="80">
+ <template slot-scope="scope">
+ <span>{{scope.$index + 1}}</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="solutionName"
+ align="center"
+ label="淇濋櫓鏂规">
+ </el-table-column>
+ <el-table-column
+ align="center"
+ label="鍔犲噺淇濆姛鑳�">
+ <template slot-scope="{row}">
+ <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canAdd">鍔犱繚</el-checkbox>
+ <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canReduce">鍑忎繚</el-checkbox>
+ </template>
+ </el-table-column>
+ </el-table>
+ <div class="info_list" v-if="JSON.stringify(form) !== '{}'">
+ <div class="info_list_item">
+ <div class="info_list_item_label" style="width: 100px;">钀ヤ笟鎵х収锛�</div>
+ <div class="info_list_item_val">
+ <div class="image" v-if="form.businessImg && form.businessImg.fileurlFull">
+ <el-image
+ v-if="form.businessImg!=null&&form.businessImg.fileurlFull!=null"
+ style="width: 90px; height: 90px"
+ :src="form.businessImg.fileurlFull"
+ :preview-src-list="[form.businessImg.fileurlFull]">
+ </el-image>
+ </div>
+ </div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label" style="width: 100px;">娉曚汉韬唤璇侊細</div>
+ <div class="info_list_item_val">
+ <div class="image" v-if="form.idcardImgList && form.idcardImgList .length>1 && form.idcardImgList[0].fileurlFull">
+ <el-image
+ append-to-body
+ v-if="form.idcardImgList[0].fileurlFull"
+ style="width: 90px; height: 90px"
+ :src="form.idcardImgList[0].fileurlFull"
+ :preview-src-list="[form.idcardImgList[0].fileurlFull]">
+ </el-image>
+ </div>
+ <div class="image" v-if="form.idcardImgList && form.idcardImgList .length>2 && form.idcardImgList[1].fileurlFull">
+ <el-image
+ append-to-body
+ v-if="form.idcardImgList[1].fileurlFull"
+ style="width: 90px; height: 90px"
+ :src="form.idcardImgList[1].fileurlFull"
+ :preview-src-list="[form.idcardImgList[1].fileurlFull]">
+ </el-image>
+ </div>
+ </div>
+ </div>
+ <div class="info_list_item">
+ <div class="info_list_item_label" style="width: 100px;">浼佷笟绛剧珷锛�</div>
+ <div class="info_list_item_val">
+ <div class="image" v-if="form.signImg && form.signImg.fileurlFull">
+ <el-image
+ v-if="form.signImg.fileurlFull!=null"
+ style="width: 90px; height: 90px"
+ :src="form.signImg.fileurlFull"
+ :preview-src-list="[form.signImg.fileurlFull]">
+ </el-image>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- 鏂板缓/淇敼 -->
+ <OperaCompanyWindow ref="operaCompanyWindow" @success="callback"/>
+ <!-- 淇敼淇濋櫓鏂规 -->
+ <modification ref="modification" @success="callback"/>
+ <!-- 淇敼鎵嬫満鍙� -->
+ <el-dialog
+ title="鏇存敼缁戝畾鎵嬫満鍙�"
+ :visible.sync="visiblePhone"
+ width="500px"
+ :modal="false"
+ :show-close="false"
+ :close-on-click-modal="false"
+ center>
+ <div class="form">
+ <div class="form_item">
+ <div class="form_item_label">缁戝畾鎵嬫満鍙凤細</div>
+ <div class="form_item_val">
+ <el-input v-model="phone" placeholder="璇疯緭鍏�"></el-input>
+ </div>
+ </div>
+ <div class="form_item">
+ <div class="form_item_label">楠岃瘉鐮侊細</div>
+ <div class="form_item_val">
+ <el-input v-model="code" placeholder="璇疯緭鍏�"></el-input>
+ <el-button type="primary" style="margin-left: 20px;" @click="send" v-if="num === 0">鍙戦�侀獙璇佺爜</el-button>
+ <el-button type="primary" style="flex-shrink: 0; margin-left: 15px;" v-else>{{num}}s</el-button>
+ </div>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="close">鍙� 娑�</el-button>
+ <el-button type="primary" @click="updatePhoneEvent">鎻� 浜�</el-button>
+ </span>
+ </el-dialog>
+ </GlobalWindow>
+</template>
+
+<script>
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import OperaCompanyWindow from '@/components/business/OperaCompanyWindow'
+import modification from '@/components/business/modification'
+import { getById, updatePhone } from '@/api/business/company'
+import { listForCompany } from '@/api/business/solutions'
+import { sendSms } from '@/api/business/smsEmail'
+export default {
+ name: 'OperaCompanyDescWindow',
+ extends: BaseOpera,
+ components: { GlobalWindow, OperaCompanyWindow, modification },
+ data () {
+ return {
+ ruleForm: {
+ phone: '',
+ code: ''
+ },
+ dataId: null,
+ num: 0,
+ timer: null,
+ // 琛ㄥ崟鏁版嵁
+ form: {},
+ phone: '',
+ code: '',
+ visiblePhone: false,
+ options: [],
+ tableData: []
+ }
+ },
+ created () {
+ this.config({
+ api: '/business/company',
+ 'field.id': 'id'
+ })
+ },
+ methods: {
+ close () {
+ this.visiblePhone = false
+ this.phone = ''
+ this.code = ''
+ clearInterval(this.timer)
+ this.num = 0
+ },
+ updatePhoneEvent () {
+ if (!this.phone) {
+ this.$message.warning('璇疯緭鍏ユ墜鏈哄彿')
+ return
+ }
+ if (!this.code) {
+ this.$message.warning('璇疯緭鍏ラ獙璇佺爜')
+ return
+ }
+ updatePhone({
+ id: this.form.id,
+ captche: this.code,
+ phone: this.phone
+ }).then(res => {
+ this.form.phone = JSON.parse(JSON.stringify(this.phone))
+ this.$message.success('鎿嶄綔鎴愬姛')
+ this.visiblePhone = false
+ this.phone = ''
+ this.code = ''
+ clearInterval(this.timer)
+ this.num = 0
+ })
+ },
+ send () {
+ if (!this.phone) {
+ this.$message.warning('璇疯緭鍏ユ墜鏈哄彿')
+ return
+ }
+ sendSms({ phone: this.phone })
+ .then(res => {
+ this.num = 60
+ this.setTime()
+ })
+ },
+ setTime () {
+ this.timer = setInterval(() => {
+ this.num -= 1
+ if (this.num === 0) {
+ clearInterval(this.timer)
+ this.num = 0
+ }
+ }, 1000)
+ },
+ open (title, target) {
+ const that = this
+ this.title = title
+ this.dataId = target.id
+ this.phone = ''
+ this.code = ''
+ clearInterval(this.timer)
+ this.num = 0
+ this.getDetail()
+ },
+ getDetail () {
+ var that = this
+ getById(this.dataId)
+ .then(res => {
+ this.form = res
+ this.form.type = 1
+
+ this.form.file = {
+ imgurl: '',
+ imgurlfull: ''
+ }
+ this.form.file1 = {
+ imgurl: '',
+ imgurlfull: ''
+ }
+ this.form.file2 = {
+ imgurl: '',
+ imgurlfull: ''
+ }
+ this.form.file3 = {
+ imgurl: '',
+ imgurlfull: ''
+ }
+ if(res.businessImg){
+ this.form.file.imgurl = res.businessImg.fileurl
+ this.form.file.imgurlfull = res.businessImg.fileurlFull
+ }
+ if (res.idcardImgList&& res.idcardImgList.length>1) {
+ this.form.file1.imgurl = res.idcardImgList[0].fileurl
+ this.form.file1.imgurlfull = res.idcardImgList[0].fileurlFull
+ }
+ if (res.idcardImgList && res.idcardImgList.length>2) {
+ this.form.file2.imgurl = res.idcardImgList[1].fileurl
+ this.form.file2.imgurlfull = res.idcardImgList[1].fileurlFull
+ }
+ if (res.signImg) {
+ this.form.file3.imgurl = res.signImg.fileurl
+ this.form.file3.imgurlfull = res.signImg.fileurlFull
+ }
+
+ listForCompany({ companyId: this.dataId })
+ .then(resa => {
+ that.form.solutionList = resa.map(item => {
+ return {
+ solutionBaseId: item.solutionBaseId,
+ canAdd: item.canAdd,
+ canReduce: item.canReduce
+ }
+ })
+ that.form.solutionListName = resa.map(item => {
+ return {
+ solutionName: item.solutionName,
+ canAdd: item.canAdd,
+ canReduce: item.canReduce
+ }
+ })
+ console.log(that.form)
+ that.visible = true
+ })
+ })
+ },
+ callback () {
+ this.getDetail()
+ this.$emit('success')
+ // this.visible = false
+ }
+ }
+}
+</script>
+
+<style lang="scss" scoped>
+ .form {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ .form_item {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ margin-bottom: 20px;
+ &:last-child {
+ margin-bottom: 0 !important;
+ }
+ .form_item_label {
+ width: 100px;
+ flex-shrink: 0;
+ font-size: 14px;
+ color: black;
+ }
+ .form_item_val {
+ flex: 1;
+ height: 35px;
+ display: flex;
+ align-items: center;
+ input {
+ width: 100%;
+ height: 100%;
+ font-size: 14px;
+ color: black;
+ padding: 5px 10px;
+ outline: none;
+ box-sizing: border-box;
+ border: 1px solid #ececec;
+ }
+ }
+ }
+ }
+ .info {
+ width: 100%;
+ .info_label {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 20px;
+ span {
+ font-size: 18px;
+ font-weight: 500;
+ color: #000000;
+ }
+ }
+ .info_list {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ .info_list_item {
+ width: 33.3%;
+ display: flex;
+ align-items: start;
+ margin-bottom: 20px;
+ .info_list_item_label {
+ /*width: 150px;*/
+ flex-shrink: 0;
+ }
+ .info_list_item_val {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ .image {
+ width: 100px;
+ height: 100px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ overflow: hidden;
+ margin-right: 10px;
+ &:last-child {
+ margin: 0 !important;
+ }
+ img {
+ width: 100%;
+ }
+ }
+ }
+ }
+ }
+ }
+</style>
diff --git a/company/src/components/business/OperaShopWindow.vue b/company/src/components/business/OperaShopWindow.vue
new file mode 100644
index 0000000..ced1965
--- /dev/null
+++ b/company/src/components/business/OperaShopWindow.vue
@@ -0,0 +1,303 @@
+<template>
+ <GlobalWindow
+ :title="title"
+ width="60%"
+ :visible.sync="visible"
+ :confirm-working="isWorking"
+ @confirm="confirm"
+ >
+ <el-form :model="form" ref="form" :rules="rules" style="width: 50%;">
+ <el-form-item label="鍟嗘埛鍚嶇О" prop="name">
+ <el-input v-model="form.name" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="缁熶竴淇$敤浠g爜" prop="code">
+ <el-input v-model="form.code" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="娉曚汉濮撳悕" prop="legalName">
+ <el-input v-model="form.legalName" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="缁戝畾鎵嬫満鍙�" prop="phone" v-if="!form.id">
+ <div style="width: 100%; display: flex; align-items: center;">
+ <el-input v-model="form.phone" maxlength="11" type="number" style="flex: 1;" placeholder="璇疯緭鍏�" v-trim/>
+ <el-button type="primary" style="flex-shrink: 0; margin-left: 15px;" @click="send" v-if="num === 0">鍙戦�侀獙璇佺爜</el-button>
+ <el-button type="primary" style="flex-shrink: 0; margin-left: 15px;" v-else>{{num}}s</el-button>
+ </div>
+ </el-form-item>
+ <el-form-item label="楠岃瘉鐮�" prop="captche" v-if="!form.id">
+ <el-input v-model="form.captche" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="鍏徃璐﹀彿" prop="username" v-if="!form.id">
+ <el-input v-model="form.username" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="璁よ瘉閭" prop="email" >
+ <el-input v-model="form.email" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="绾崇◣浜鸿瘑鍒彿" prop="taxCode">
+ <el-input v-model="form.taxCode" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="閾惰璐﹀彿" prop="taxAccount">
+ <el-input v-model="form.taxAccount" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="寮�鎴疯" prop="taxBank">
+ <el-input v-model="form.taxBank" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="鍦板潃銆佺數璇�" prop="taxAddr">
+ <el-input v-model="form.taxAddr" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="鐢靛瓙鍙戠エ鎺ユ敹鍦板潃" prop="invoiceEmail">
+ <el-input v-model="form.invoiceEmail" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="绾歌川鍙戠エ鎺ユ敹鍦板潃" prop="invoiceAddr">
+ <el-input v-model="form.invoiceAddr" placeholder="璇疯緭鍏�" v-trim/>
+ </el-form-item>
+ <el-form-item label="钀ヤ笟鎵х収" prop="businessImg">
+ <div style="width: 100%; height: 100px; display: flex; align-items: center;">
+ <UploadAvatarImage :uploadData="{ folder: 'company' }" :file="form.file" @uploadSuccess="result" />
+ </div>
+ </el-form-item>
+ <el-form-item label="娉曚汉韬唤璇�" prop="idcardImgList" style="height: 120px">
+ <div style="width: 100%; display: flex; align-items: center;">
+ <UploadAvatarImage :uploadData="{ folder: 'company' }" :file="form.file1" @uploadSuccess="result1" />
+ <div style="width: 15px;height: 100%;"></div>
+ <UploadAvatarImage :uploadData="{ folder: 'company' }" :file="form.file2" @uploadSuccess="result2" />
+ </div>
+ </el-form-item>
+<!-- <el-form-item label="鐢靛瓙绛剧珷" prop="signImg">-->
+<!-- <div style="width: 100%; height: 100px; display: flex; align-items: center;">-->
+<!-- <UploadAvatarImage :uploadData="{ folder: 'company' }" :file="form.file3" @uploadSuccess="result3" />-->
+<!-- </div>-->
+<!-- </el-form-item>-->
+ </el-form>
+
+ </GlobalWindow>
+</template>
+
+<script>
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import UploadAvatarImage from '@/components/common/UploadAvatarImage'
+import { all } from '@/api/business/solutions'
+import { sendSms } from '@/api/business/smsEmail'
+export default {
+ name: 'OperaCompanyWindow',
+ extends: BaseOpera,
+ components: { GlobalWindow, UploadAvatarImage },
+ data () {
+ return {
+ // 琛ㄥ崟鏁版嵁
+ initParam:{
+ id: null,
+ name: '',
+ code: '',
+ legalName: '',
+ taxCode: '',
+ taxAccount: '',
+ username: '',
+ taxBank: '',
+ taxAddr: '',
+ invoiceEmail: '',
+ invoiceAddr: '',
+ phone: '',
+ email: '',
+ type: 1,
+ actionType: 0,
+ captche: '',
+ businessImg: {
+ fileurl: '',
+ name: ''
+ },
+ idcardImgList: [],
+ signImg: {
+ fileurl: '',
+ name: ''
+ },
+ solutionList: [
+ {
+ solution: null,
+ canAdd: 0,
+ canReduce: 0
+ }
+ ],
+ file: {
+ imgurl: '',
+ imgurlfull: ''
+ },
+ file1: {
+ imgurl: '',
+ imgurlfull: ''
+ },
+ file2: {
+ imgurl: '',
+ imgurlfull: ''
+ },
+ file3: {
+ imgurl: '',
+ imgurlfull: ''
+ },
+ },
+ form: {},
+ timer: null,
+ num: 0,
+ // 楠岃瘉瑙勫垯
+ rules: {
+ name: [
+ { required: true, message: '璇疯緭鍏ュ叕鍙稿悕绉�' }
+ ],
+ code: [
+ { required: true, message: '璇疯緭鍏ョ粺涓�淇$敤浠g爜' }
+ ],
+ captche: [
+ { required: true, message: '璇疯緭鍏ラ獙璇佺爜' }
+ ],
+ legalName: [
+ { required: true, message: '璇疯緭鍏ユ硶浜哄鍚�' }
+ ],
+ phone: [
+ { required: true, message: '璇疯緭鍏ユ墜鏈哄彿' }
+ ],
+ // taxAccount: [
+ // { required: true, message: '璇疯緭鍏ラ摱琛屽崱' }
+ // ],
+ email: [
+ { required: true, message: '璇疯緭鍏ヨ璇侀偖绠�' }
+ ],
+ businessImg: [
+ { required: true, message: '璇蜂笂浼犺惀涓氭墽鐓�' }
+ ],
+ idcardImgList: [
+ { required: true, message: '璇蜂笂浼犳硶浜鸿韩浠借瘉' }
+ ],
+ signImg: [
+ { required: true, message: '璇蜂笂浼犵數瀛愮绔�' }
+ ],
+ username: [
+ { required: true, message: '璇疯緭鍏ュ叕鍙歌处鍙�' }
+ ]
+ },
+
+ programme: []
+ }
+ },
+ created () {
+ this.config({
+ api: '/business/company',
+ 'field.id': 'id'
+ })
+ },
+ watch: {
+ visible: {
+ handler (news) {
+ if (news) {
+ clearInterval(this.timer)
+ this.num = 0
+ }
+ }
+ }
+ },
+ methods: {
+ changeSolution(row,index){
+ this.form.solutionList[index].solution=row
+ // console.log(this.form.solutionList)
+ },
+ send () {
+ if (!this.form.phone) {
+ this.$message.warning('璇疯緭鍏ユ墜鏈哄彿')
+ return
+ }
+ sendSms({ phone: this.form.phone })
+ .then(res => {
+ this.num = 60
+ this.setTime()
+ })
+ },
+ setTime () {
+ this.timer = setInterval(() => {
+ this.num -= 1
+ if (this.num === 0) {
+ clearInterval(this.timer)
+ this.num = 0
+ }
+ }, 1000)
+ },
+ open (title, target,type) {
+ this.title = title
+ this.visible = true
+ this.form = this.initParam
+ this.getAll()
+ // 鏂板缓
+ if (target == null) {
+ this.$nextTick(() => {
+ this.$refs.form.resetFields()
+ this.form[this.configData['field.id']] = null
+ })
+ return
+ }
+ // 缂栬緫
+ this.$nextTick(() => {
+ for (const key in this.form) {
+ this.form[key] = target[key]
+ }
+ })
+ },
+ // 鑾峰彇鍏ㄩ儴鏂规
+ getAll () {
+ all({})
+ .then(res => {
+ this.programme = res
+ })
+ },
+ dele (index) {
+ if (this.form.solutionList.length === 1) {
+ this.$message.warning('鑷冲皯淇濈暀涓�椤�')
+ return
+ }
+ this.form.solutionList.splice(index, 1)
+ },
+ add () {
+ this.form.solutionList.push({
+ solutionId:null,
+ solution: {},
+ canAdd: '',
+ canReduce: ''
+ })
+ },
+ handleRemove (file, fileList) {
+ console.log(file, fileList)
+ },
+ // 鎺ユ敹钀ヤ笟鎵х収鏁版嵁
+ result (data) {
+ this.form.businessImg = {
+ fileurl: '',
+ name: ''
+ }
+ this.form.businessImg.fileurl = data.imgurl
+ this.form.businessImg.name = data.name
+ },
+ // 韬唤璇佺収鐗�1
+ result1 (data) {
+ this.form.idcardImgList[0] = {
+ fileurl: '',
+ name: ''
+ }
+ this.form.idcardImgList[0] = { fileurl: data.imgurl, name: data.name }
+ },
+ // 韬唤璇佺収鐗�2
+ result2 (data) {
+ this.form.idcardImgList[1] = {
+ fileurl: '',
+ name: ''
+ }
+ this.form.idcardImgList[1] = { fileurl: data.imgurl, name: data.name }
+ },
+ // 鐢靛瓙绛剧珷
+ result3 (data) {
+ this.form.signImg = {
+ fileurl: '',
+ name: ''
+ }
+ this.form.signImg.fileurl = data.imgurl
+ this.form.signImg.name = data.name
+ }
+ }
+}
+</script>
diff --git a/company/src/components/common/MenuSelect.vue b/company/src/components/common/MenuSelect.vue
index 3471617..5cfa78e 100644
--- a/company/src/components/common/MenuSelect.vue
+++ b/company/src/components/common/MenuSelect.vue
@@ -50,8 +50,8 @@
methods: {
// 鑾峰彇鎵�鏈夎彍鍗�
fetchData () {
- if (this.type === '1') {
- fetchTree1()
+ if (this.type == '1' || this.type == '2') {
+ fetchTree1(this.type)
.then(records => {
this.data = []
this.__fillData(this.data, records)
diff --git a/company/src/components/system/menu/OperaMenuComWindow.vue b/company/src/components/system/menu/OperaMenuComWindow.vue
index efafc84..5744730 100644
--- a/company/src/components/system/menu/OperaMenuComWindow.vue
+++ b/company/src/components/system/menu/OperaMenuComWindow.vue
@@ -9,7 +9,7 @@
<p class="tip" v-if="form.parent != null && form.id == null">涓� <em>{{parentName}}</em> 鏂板缓瀛愯彍鍗�</p>
<el-form :model="form" ref="form" :rules="rules">
<el-form-item label="涓婄骇鑿滃崟" prop="parentId">
- <MenuSelect v-if="visible" type="1" v-model="form.parentId" placeholder="璇烽�夋嫨涓婄骇鑿滃崟" :exclude-id="excludeMenuId" clearable :inline="false"/>
+ <MenuSelect v-if="visible" :type="form.type" v-model="form.parentId" placeholder="璇烽�夋嫨涓婄骇鑿滃崟" :exclude-id="excludeMenuId" clearable :inline="false"/>
</el-form-item>
<el-form-item label="鑿滃崟鍚嶇О" prop="name" required>
<el-input v-model="form.name" placeholder="璇疯緭鍏ヨ彍鍗曞悕绉�" v-trim maxlength="50"/>
@@ -32,75 +32,76 @@
</template>
<script>
- import BaseOpera from '@/components/base/BaseOpera'
- import GlobalWindow from '@/components/common/GlobalWindow'
- import MenuSelect from '@/components/common/MenuSelect'
- import icons from '@/utils/icons'
- export default {
- name: 'OperaMenuWindow',
- extends: BaseOpera,
- components: { MenuSelect, GlobalWindow },
- data () {
- return {
- icons,
- // 涓婄骇鑿滃崟鍚嶇О
- parentName: '',
- // 闇�鎺掗櫎閫夋嫨鐨勮彍鍗旾D
- excludeMenuId: null,
- // 琛ㄥ崟鏁版嵁
- form: {
- id: null,
- parentId: null,
- name: '',
- path: '',
- icon: '',
- remark: '',
- type: '1'
- },
- // 楠岃瘉瑙勫垯
- rules: {
- name: [
- { required: true, message: '璇疯緭鍏ヨ彍鍗曞悕绉�' }
- ]
- }
- }
- },
- methods: {
- /**
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+import MenuSelect from '@/components/common/MenuSelect'
+import icons from '@/utils/icons'
+export default {
+ name: 'OperaMenuWindow',
+ extends: BaseOpera,
+ components: { MenuSelect, GlobalWindow },
+ data () {
+ return {
+ icons,
+ // 涓婄骇鑿滃崟鍚嶇О
+ parentName: '',
+ // 闇�鎺掗櫎閫夋嫨鐨勮彍鍗旾D
+ excludeMenuId: null,
+ // 琛ㄥ崟鏁版嵁
+ form: {
+ id: null,
+ parentId: null,
+ name: '',
+ path: '',
+ icon: '',
+ remark: '',
+ type: '1'
+ },
+ // 楠岃瘉瑙勫垯
+ rules: {
+ name: [
+ { required: true, message: '璇疯緭鍏ヨ彍鍗曞悕绉�' }
+ ]
+ }
+ }
+ },
+ methods: {
+ /**
* @title: 绐楀彛鏍囬
* @target: 缂栬緫鐨勮彍鍗曞璞�
* @parent: 鏂板缓鏃剁殑涓婄骇鑿滃崟
*/
- open (title, target, parent) {
- this.title = title
- this.visible = true
- // 鏂板缓锛宮enu涓虹┖鏃惰〃绀烘柊寤鸿彍鍗�
- if (target == null) {
- this.excludeMenuId = null
- this.$nextTick(() => {
- this.$refs.form.resetFields()
- this.form.id = null
- this.form.type = parent.type
- this.form.parentId = parent == null ? null : parent.id
- this.parentName = parent == null ? null : parent.name
- })
- return
- }
- // 缂栬緫
- this.$nextTick(() => {
- this.excludeMenuId = target.id
- for (const key in this.form) {
- this.form[key] = target[key]
- }
- })
- }
- },
- created () {
- this.config({
- api: '/system/menu'
- })
+ open (title, target, parent, type) {
+ this.title = title
+ this.visible = true
+ this.form.type = type || 1
+ // 鏂板缓锛宮enu涓虹┖鏃惰〃绀烘柊寤鸿彍鍗�
+ if (target == null) {
+ this.excludeMenuId = null
+ this.$nextTick(() => {
+ this.$refs.form.resetFields()
+ this.form.id = null
+ this.form.type = parent != null ? parent.type : (type || 1)
+ this.form.parentId = parent == null ? null : parent.id
+ this.parentName = parent == null ? null : parent.name
+ })
+ return
+ }
+ // 缂栬緫
+ this.$nextTick(() => {
+ this.excludeMenuId = target.id
+ for (const key in this.form) {
+ this.form[key] = target[key]
}
+ })
}
+ },
+ created () {
+ this.config({
+ api: '/system/menu'
+ })
+ }
+}
</script>
<style scoped lang="scss">
diff --git a/company/src/components/system/permission/OperaPermissionWindow.vue b/company/src/components/system/permission/OperaPermissionWindow.vue
index 12054f2..c117ec3 100644
--- a/company/src/components/system/permission/OperaPermissionWindow.vue
+++ b/company/src/components/system/permission/OperaPermissionWindow.vue
@@ -12,6 +12,14 @@
<el-form-item label="鏉冮檺鍚嶇О" prop="name" required>
<el-input v-model="form.name" placeholder="璇疯緭鍏ユ潈闄愬悕绉�" v-trim maxlength="50"/>
</el-form-item>
+ <el-form-item label="骞冲彴绫诲瀷" prop="type" required>
+ <el-select v-model="form.type" placeholder="璇烽�夋嫨骞冲彴绫诲瀷" >
+ <el-option label="閫氱敤" value="0"></el-option>
+ <el-option label="骞冲彴绔�" value="1"></el-option>
+ <el-option label="浼佷笟绔�" value="2"></el-option>
+ <el-option label="鍟嗘埛绔�" value="3"></el-option>
+ </el-select>
+ </el-form-item>
<el-form-item label="鏉冮檺澶囨敞" prop="remark">
<el-input v-model="form.remark" placeholder="璇疯緭鍏ユ潈闄愬娉�" type="textarea" :rows="3" v-trim maxlength="500"/>
</el-form-item>
@@ -35,12 +43,16 @@
id: null,
code: '',
name: '',
- remark: ''
+ remark: '',
+ type: '0'
},
// 楠岃瘉瑙勫垯
rules: {
code: [
{ required: true, message: '璇疯緭鍏ユ潈闄愮紪鐮�' }
+ ],
+ type: [
+ { required: true, message: '璇烽�夋嫨骞冲彴绫诲瀷' }
],
name: [
{ required: true, message: '璇疯緭鍏ユ潈闄愬悕绉�' }
@@ -65,6 +77,7 @@
this.originPermissionCode = target.code
for (const key in this.form) {
this.form[key] = target[key]
+ this.form.type=this.form.type+''
}
})
},
diff --git a/company/src/views/business/company.vue b/company/src/views/business/company.vue
index 5cdb32a..9e85ac0 100644
--- a/company/src/views/business/company.vue
+++ b/company/src/views/business/company.vue
@@ -92,7 +92,8 @@
// 鎼滅储
searchForm: {
name: '',
- username: ''
+ username: '',
+ type:0
}
}
},
diff --git a/company/src/views/business/shop.vue b/company/src/views/business/shop.vue
new file mode 100644
index 0000000..8840c68
--- /dev/null
+++ b/company/src/views/business/shop.vue
@@ -0,0 +1,155 @@
+<template>
+ <TableLayout :permissions="['business:company:queryShop']">
+ <!-- 鎼滅储琛ㄥ崟 -->
+ <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
+ <el-form-item label="鍟嗘埛鍚嶇О" prop="name">
+ <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ュ晢鎴峰悕绉�" @keypress.enter.native="search"></el-input>
+ </el-form-item>
+ <section>
+ <el-button type="primary" @click="search">鎼滅储</el-button>
+ <el-button @click="reset">閲嶇疆</el-button>
+ </section>
+ </el-form>
+ <!-- 琛ㄦ牸鍜屽垎椤� -->
+ <template v-slot:table-wrap>
+ <ul class="toolbar" v-permissions="['business:company:createShop']">
+ <li><el-button type="primary" @click="$refs.operaShopWindow.open('鏂板缓鍟嗘埛')" v-permissions="['business:company:createShop']">鏂板缓鍟嗘埛</el-button></li>
+ </ul>
+ <el-table
+ v-loading="isWorking.search"
+ :data="tableData.list"
+ stripe
+ >
+ <el-table-column prop="name" label="鍟嗘埛鍚嶇О" min-width="100px"></el-table-column>
+ <el-table-column prop="code" label="缁熶竴淇$敤浠g爜" min-width="100px"></el-table-column>
+ <el-table-column prop="createDate" label="娣诲姞鏃堕棿" min-width="100px"></el-table-column>
+ <el-table-column prop="phone" label="缁戝畾鎵嬫満鍙�" min-width="100px"></el-table-column>
+ <el-table-column label="鍚敤鐘舵��" min-width="100px">
+ <template slot-scope="{row}">
+ <el-switch
+ @change="changeStatus($event, row)"
+ v-model="row.status"
+ active-color="#13ce66"
+ inactive-color="#ff4949"
+ :active-value="0"
+ :inactive-value="1">
+ </el-switch>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐢靛瓙绛捐璇佺姸鎬�" min-width="100px">
+ <template slot-scope="{row}">
+ <span v-if="row.signStatus === 0">寰呰璇�</span>
+ <span v-if="row.signStatus === 1">璁よ瘉涓�</span>
+ <span v-if="row.signStatus === 2">璁よ瘉澶辫触</span>
+ <span v-if="row.signStatus === 3">璁よ瘉閫氳繃</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ v-if="containPermissions(['business:company:updateShop', 'business:company:deleteShop'])"
+ label="鎿嶄綔"
+ min-width="120"
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <el-button type="text" @click="$refs.operaShopDescWindow.open('鍟嗘埛璇︽儏', row)" v-permissions="['business:company:updateShop']">鏌ョ湅璇︽儏</el-button>
+ <el-button type="text" @click="edit(row)" v-permissions="['business:company:updateShop']">淇敼</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination
+ @size-change="handleSizeChange"
+ @current-change="handlePageChange"
+ :pagination="tableData.pagination"
+ >
+ </pagination>
+ </template>
+ <!-- 鏂板缓/淇敼 -->
+ <OperaShopWindow ref="operaShopWindow" @success="handlePageChange" />
+ <!-- 璇︽儏 -->
+ <OperaShopDescWindow ref="operaShopDescWindow" @success="handlePageChange" />
+ </TableLayout>
+</template>
+
+<script>
+import BaseTable from '@/components/base/BaseTable'
+import TableLayout from '@/layouts/TableLayout'
+import Pagination from '@/components/common/Pagination'
+import OperaShopWindow from '@/components/business/OperaShopWindow'
+import OperaShopDescWindow from '@/components/business/OperaShopDescWindow'
+import { updateStatus, getById } from '@/api/business/company'
+export default {
+ name: 'Company',
+ extends: BaseTable,
+ components: { TableLayout, Pagination, OperaShopWindow, OperaShopDescWindow },
+ data () {
+ return {
+ // 鎼滅储
+ searchForm: {
+ name: '',
+ username: '',
+ type: 1
+ }
+ }
+ },
+ created () {
+ this.config({
+ module: '鍟嗘埛淇℃伅琛�',
+ api: '/business/company',
+ 'field.id': 'id',
+ 'field.main': 'id'
+ })
+ this.search()
+ },
+ methods: {
+ edit (row) {
+ getById(row.id)
+ .then(res => {
+ const form = res
+ form.type = 1
+ form.file = {
+ imgurl: '',
+ imgurlfull: ''
+ }
+ form.file1 = {
+ imgurl: '',
+ imgurlfull: ''
+ }
+ form.file2 = {
+ imgurl: '',
+ imgurlfull: ''
+ }
+ form.file3 = {
+ imgurl: '',
+ imgurlfull: ''
+ }
+ form.file.imgurl = res.businessImg.fileurl
+ form.file.imgurlfull = res.businessImg.fileurlFull
+ if (res.idcardImgList == null) {
+ res.idcardImgList = new Array()
+ }
+ if (res.idcardImgList && res.idcardImgList.length > 0) {
+ form.file1.imgurl = res.idcardImgList[0].fileurl
+ form.file1.imgurlfull = res.idcardImgList[0].fileurlFull
+ }
+ if (res.idcardImgList && res.idcardImgList.length > 1) {
+ form.file2.imgurl = res.idcardImgList[1].fileurl
+ form.file2.imgurlfull = res.idcardImgList[1].fileurlFull
+ }
+ form.file3.imgurl = res.signImg.fileurl
+ form.file3.imgurlfull = res.signImg.fileurlFull
+ this.$refs.operaShopWindow.open('缂栬緫鍟嗘埛', form)
+ })
+ },
+ // 淇敼鐘舵��
+ changeStatus (status, row) {
+ updateStatus({ id: row.id, status })
+ .then(res => {
+ this.search()
+ })
+ .catch(err => {
+ row.status = row.status === 0 ? 1 : 0
+ })
+ }
+ }
+}
+</script>
diff --git a/company/src/views/system/menuCom.vue b/company/src/views/system/menuCom.vue
index 6dd790e..824ec83 100644
--- a/company/src/views/system/menuCom.vue
+++ b/company/src/views/system/menuCom.vue
@@ -3,7 +3,7 @@
<!-- 琛ㄦ牸鍜屽垎椤� -->
<template v-slot:table-wrap>
<ul class="toolbar" v-permissions="['system:menu:create', 'system:menu:delete', 'system:menu:sort']">
- <li><el-button type="primary" @click="$refs.OperaMenuComWindow.open('鏂板缓涓�绾ц彍鍗�')" icon="el-icon-plus" v-permissions="['system:menu:create']">鏂板缓</el-button></li>
+ <li><el-button type="primary" @click="$refs.OperaMenuComWindow.open('鏂板缓涓�绾ц彍鍗�',null,null,1)" icon="el-icon-plus" v-permissions="['system:menu:create']">鏂板缓</el-button></li>
<li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['system:menu:delete']">鍒犻櫎</el-button></li>
<li><el-button @click="sort('top')" :loading="isWorking.sort" icon="el-icon-sort-up" v-permissions="['system:menu:sort']">涓婄Щ</el-button></li>
<li><el-button @click="sort('bottom')" :loading="isWorking.sort" icon="el-icon-sort-down" v-permissions="['system:menu:sort']">涓嬬Щ</el-button></li>
diff --git a/company/src/views/system/menuShop.vue b/company/src/views/system/menuShop.vue
new file mode 100644
index 0000000..9432a36
--- /dev/null
+++ b/company/src/views/system/menuShop.vue
@@ -0,0 +1,231 @@
+<template>
+ <TableLayout class="menu-layout" :permissions="['system:menu:query']">
+ <!-- 琛ㄦ牸鍜屽垎椤� -->
+ <template v-slot:table-wrap>
+ <ul class="toolbar" v-permissions="['system:menu:create', 'system:menu:delete', 'system:menu:sort']">
+ <li><el-button type="primary" @click="$refs.OperaMenuComWindow.open('鏂板缓鍟嗘埛涓�绾ц彍鍗�',null,null,2)" icon="el-icon-plus" v-permissions="['system:menu:create']">鏂板缓</el-button></li>
+ <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['system:menu:delete']">鍒犻櫎</el-button></li>
+ <li><el-button @click="sort('top')" :loading="isWorking.sort" icon="el-icon-sort-up" v-permissions="['system:menu:sort']">涓婄Щ</el-button></li>
+ <li><el-button @click="sort('bottom')" :loading="isWorking.sort" icon="el-icon-sort-down" v-permissions="['system:menu:sort']">涓嬬Щ</el-button></li>
+ </ul>
+ <el-table
+ ref="table"
+ v-loading="isWorking.search"
+ :data="tableData.list"
+ :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+ row-key="id"
+ stripe
+ :default-expand-all="false"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55" fixed="left"></el-table-column>
+ <el-table-column prop="name" label="鑿滃崟鍚嶇О" fixed="left" min-width="160px"></el-table-column>
+ <el-table-column prop="icon" label="鍥炬爣" min-width="80px" class-name="table-column-icon">
+ <template slot-scope="{row}">
+ <i v-if="row.icon != null && row.icon !== ''" :class="{[row.icon]: true}"></i>
+ <template v-else>鏈缃�</template>
+ </template>
+ </el-table-column>
+ <el-table-column prop="path" label="璁块棶璺緞" min-width="140px"></el-table-column>
+ <el-table-column prop="remark" label="澶囨敞" min-width="120px"></el-table-column>
+ <el-table-column prop="createUser" label="鍒涘缓浜�" min-width="100px">
+ <template slot-scope="{row}">{{row.createUserInfo == null ? '' : row.createUserInfo.username}}</template>
+ </el-table-column>
+ <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" min-width="140px"></el-table-column>
+ <el-table-column prop="updateUser" label="鏇存柊浜�" min-width="100px">
+ <template slot-scope="{row}">{{row.updateUserInfo == null ? '' : row.updateUserInfo.username}}</template>
+ </el-table-column>
+ <el-table-column prop="updateTime" label="鏇存柊鏃堕棿" min-width="140px"></el-table-column>
+ <el-table-column prop="disabled" label="鏄惁鍚敤" min-width="80px">
+ <template slot-scope="{row}">
+ <el-switch v-model="row.disabled" :active-value="false" :inactive-value="true" @change="switchDisabled(row)"/>
+ </template>
+ </el-table-column>
+ <el-table-column
+ v-if="containPermissions(['system:menu:update', 'system:menu:create', 'system:menu:delete'])"
+ label="鎿嶄綔"
+ min-width="220"
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <el-button type="text" icon="el-icon-edit" @click="$refs.OperaMenuComWindow.open('缂栬緫鍟嗘埛鑿滃崟', {...row, type: 2})" v-permissions="['system:menu:update']">缂栬緫</el-button>
+ <el-button type="text" icon="el-icon-plus" @click="$refs.OperaMenuComWindow.open('鏂板缓鍟嗘埛瀛愯彍鍗�', null, {...row, type: 2},2)" v-permissions="['system:menu:create']">鏂板缓瀛愯彍鍗�</el-button>
+ <el-button v-if="!row.fixed" type="text" icon="el-icon-delete" @click="deleteById(row)" v-permissions="['system:menu:delete']">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </template>
+ <!-- 鏂板缓/淇敼 -->
+ <OperaMenuComWindow ref="OperaMenuComWindow" @success="handlePageChange(tableData.pagination.pageIndex)"/>
+ </TableLayout>
+</template>
+
+<script>
+ import TableLayout from '@/layouts/TableLayout'
+ import BaseTable from '@/components/base/BaseTable'
+ import OperaMenuComWindow from '@/components/system/menu/OperaMenuComWindow'
+ import { fetchTree1, updateStatus, sort } from '@/api/system/menu'
+ export default {
+ name: 'SystemMenu',
+ extends: BaseTable,
+ components: { OperaMenuComWindow, TableLayout },
+ data () {
+ return {
+ // 鏄惁姝e湪澶勭悊涓�
+ isWorking: {
+ sort: false
+ }
+ }
+ },
+ methods: {
+ // 鏌ヨ鏁版嵁
+ handlePageChange () {
+ this.isWorking.search = true
+ fetchTree1(2)
+ .then(records => {
+ this.tableData.list = records
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking.search = false
+ })
+ },
+ // 鎺掑簭
+ sort (direction) {
+ if (this.isWorking.sort) {
+ return
+ }
+ if (this.tableData.selectedRows.length === 0) {
+ this.$tip.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
+ return
+ }
+ if (this.tableData.selectedRows.length > 1) {
+ this.$tip.warning('鎺掑簭鏃朵粎鍏佽閫夋嫨涓�鏉℃暟鎹�')
+ return
+ }
+ const menuId = this.tableData.selectedRows[0].id
+ // 鎵惧埌鑿滃崟鑼冨洿
+ let menuPool
+ for (const rootMenu of this.tableData.list) {
+ const parent = this.__findParent(menuId, rootMenu)
+ if (parent != null) {
+ menuPool = parent.children
+ }
+ }
+ menuPool = menuPool || this.tableData.list
+ const menuIndex = menuPool.findIndex(menu => menu.id === menuId)
+ // 涓婄Щ鏍¢獙
+ if (direction === 'top' && menuIndex === 0) {
+ this.$tip.warning('鑿滃崟宸插埌椤堕儴')
+ return
+ }
+ // 涓嬬Щ鏍¢獙
+ if (direction === 'bottom' && menuIndex === menuPool.length - 1) {
+ this.$tip.warning('鑿滃崟宸插埌搴曢儴')
+ return
+ }
+ this.isWorking.sort = true
+ sort({
+ id: this.tableData.selectedRows[0].id,
+ direction
+ })
+ .then(() => {
+ if (direction === 'top') {
+ menuPool.splice(menuIndex, 0, menuPool.splice(menuIndex - 1, 1)[0])
+ } else {
+ menuPool.splice(menuIndex, 0, menuPool.splice(menuIndex + 1, 1)[0])
+ }
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking.sort = false
+ })
+ },
+ // 鍚敤/绂佺敤鑿滃崟
+ switchDisabled (row) {
+ if (!row.disabled) {
+ this.__updateMenuStatus(row)
+ return
+ }
+ this.$dialog.disableConfirm(`纭绂佺敤 ${row.name} 鑿滃崟鍚楋紵`)
+ .then(() => {
+ this.__updateMenuStatus(row)
+ }).catch(() => {
+ row.disabled = !row.disabled
+ })
+ },
+ // 鏌ヨ鐖惰妭鐐�
+ __findParent (id, parent) {
+ if (parent.children === 0) {
+ return
+ }
+ for (const menu of parent.children) {
+ if (menu.id === id) {
+ return parent
+ }
+ if (menu.children.length > 0) {
+ const m = this.__findParent(id, menu)
+ if (m != null) {
+ return m
+ }
+ }
+ }
+ return null
+ },
+ // 淇敼鑿滃崟鐘舵��
+ __updateMenuStatus (row) {
+ updateStatus({
+ id: row.id,
+ parentId: row.parentId,
+ disabled: row.disabled
+ })
+ .then(() => {
+ this.$tip.apiSuccess('淇敼鎴愬姛')
+ })
+ .catch(e => {
+ row.disabled = !row.disabled
+ this.$tip.apiFailed(e)
+ })
+ }
+ },
+ created () {
+ this.config({
+ module: '鑿滃崟',
+ api: '/system/menu'
+ })
+ this.search()
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ @import "@/assets/style/variables.scss";
+ .menu-layout {
+ /deep/ .table-content {
+ margin-top: 0;
+ }
+ }
+ // 鍥炬爣鍒�
+ .table-column-icon {
+ // element-ui鍥炬爣
+ i {
+ background-color: $primary-color;
+ opacity: 0.72;
+ font-size: 20px;
+ color: #fff;
+ padding: 4px;
+ border-radius: 50%;
+ }
+ // 鑷畾涔夊浘鏍�
+ [class^="eva-icon-"] {
+ width: 20px;
+ height: 20px;
+ background-size: 16px;
+ vertical-align: middle;
+ }
+ }
+</style>
diff --git a/company/src/views/system/permission.vue b/company/src/views/system/permission.vue
index 76f35b3..30d455c 100644
--- a/company/src/views/system/permission.vue
+++ b/company/src/views/system/permission.vue
@@ -8,6 +8,14 @@
<el-form-item label="鏉冮檺鍚嶇О" prop="name">
<el-input v-model="searchForm.name" v-trim placeholder="璇疯緭鍏ユ潈闄愬悕绉�" @keypress.enter.native="search"/>
</el-form-item>
+ <el-form-item label="骞冲彴绫诲瀷" prop="type">
+ <el-select v-model="searchForm.type" placeholder="璇烽�夋嫨" @change="search">
+ <el-option label="閫氱敤" value="0"></el-option>
+ <el-option label="骞冲彴绔�" value="1"></el-option>
+ <el-option label="浼佷笟绔�" value="2"></el-option>
+ <el-option label="鍟嗘埛绔�" value="3"></el-option>
+ </el-select>
+ </el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
<el-button @click="reset">閲嶇疆</el-button>
@@ -30,6 +38,14 @@
<el-table-column type="selection" fixed="left" width="55"></el-table-column>
<el-table-column prop="code" label="鏉冮檺缂栫爜" fixed="left" min-width="200px"></el-table-column>
<el-table-column prop="name" label="鏉冮檺鍚嶇О" fixed="left" min-width="120px"></el-table-column>
+ <el-table-column prop="name" label="骞冲彴绫诲瀷" fixed="left" min-width="120px">
+ <template slot-scope="{row}">
+ <span v-if="row.type == null || row.type ===0">閫氱敤</span>
+ <span v-if="row.type === 1">骞冲彴绔�</span>
+ <span v-if="row.type === 2">浼佷笟绔�</span>
+ <span v-if="row.type === 3">鍟嗘埛绔�</span>
+ </template>
+ </el-table-column>
<el-table-column prop="remark" label="鏉冮檺澶囨敞" min-width="120px"></el-table-column>
<el-table-column prop="createUser" label="鍒涘缓浜�" min-width="100px">
<template slot-scope="{row}">{{row.createUserInfo == null ? '' : row.createUserInfo.username}}</template>
@@ -77,6 +93,7 @@
searchForm: {
code: '',
name: '',
+ type: '',
remark: ''
}
}
diff --git a/server/company/src/main/java/com/doumee/api/system/SystemMenuController.java b/server/company/src/main/java/com/doumee/api/system/SystemMenuController.java
index 797483a..3067e64 100644
--- a/server/company/src/main/java/com/doumee/api/system/SystemMenuController.java
+++ b/server/company/src/main/java/com/doumee/api/system/SystemMenuController.java
@@ -6,6 +6,7 @@
import com.doumee.core.constants.OperaType;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.utils.Constants;
import com.doumee.dao.system.dto.UpdateSystemMenuSortDTO;
import com.doumee.dao.system.model.SystemMenu;
import com.doumee.dao.system.vo.SystemMenuListVO;
@@ -32,80 +33,19 @@
@Autowired
private SystemMenuBiz systemMenuBiz;
- @ApiOperation("鑿滃崟鎺掑簭")
- @PostMapping("/updateSort")
- @RequiresPermissions("system:menu:sort")
- public ApiResponse updateSort (@Validated @RequestBody UpdateSystemMenuSortDTO dto) {
- systemMenuBiz.updateSort(dto);
- return ApiResponse.success(null);
- }
-
@ApiOperation("鏌ヨ鑿滃崟鏍�")
@GetMapping("/treeNodes")
public ApiResponse<List<SystemMenuNodeVO>> getTreeMenu () {
LoginUserInfo loginUserInfo = this.getLoginUser();
- return ApiResponse.success(systemMenuBiz.findTree(loginUserInfo.getId(),loginUserInfo.getType()));
+ return ApiResponse.success(systemMenuBiz.findTree(loginUserInfo.getId(), Constants.ONE));
}
-
-// @ApiOperation("鏌ヨ鍒楄〃鏍�")
-// @PostMapping("/treeList")
-// @RequiresPermissions("system:menu:query")
-// public ApiResponse<List<SystemMenuListVO>> findTree () {
-// LoginUserInfo loginUserInfo = this.getLoginUser();
-// return ApiResponse.success(systemMenuBiz.findTreeByType(loginUserInfo.getType()));
-// }
-
@ApiOperation("鏌ヨ鍒楄〃鏍�")
@PostMapping("/treeList/{type}")
@RequiresPermissions("system:menu:query")
public ApiResponse<List<SystemMenuListVO>> treeList (@PathVariable Integer type) {
- return ApiResponse.success(systemMenuBiz.findTreeByType(type));
+ return ApiResponse.success(systemMenuBiz.findTreeByType(Constants.ONE));
}
- @PreventRepeat
- @ApiOperation("鏂板缓")
- @PostMapping("/create")
- @RequiresPermissions("system:menu:create")
- public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemMenu systemMenu) {
- return ApiResponse.success(systemMenuBiz.create(systemMenu));
- }
-
- @ApiOperation("鍒犻櫎")
- @GetMapping("/delete/{id}")
- @RequiresPermissions("system:menu:delete")
- public ApiResponse deleteById(@PathVariable Integer id) {
- systemMenuBiz.deleteById(id);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("鎵归噺鍒犻櫎")
- @GetMapping("/delete/batch")
- @RequiresPermissions("system:menu:delete")
- public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
- String [] idArray = ids.split(",");
- List<Integer> idList = new ArrayList<>();
- for (String id : idArray) {
- idList.add(Integer.valueOf(id));
- }
- systemMenuBiz.deleteByIdInBatch(idList);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("淇敼")
- @PostMapping("/updateById")
- @RequiresPermissions("system:menu:update")
- public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemMenu systemMenu) {
- systemMenuBiz.updateById(systemMenu);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("淇敼鑿滃崟鐘舵��")
- @PostMapping("/updateStatus")
- @RequiresPermissions("system:menu:update")
- public ApiResponse updateStatus(@Validated(OperaType.UpdateStatus.class) @RequestBody SystemMenu systemMenu) {
- systemMenuBiz.updateById(systemMenu);
- return ApiResponse.success(null);
- }
}
diff --git a/server/company/src/main/java/com/doumee/api/system/SystemPermissionController.java b/server/company/src/main/java/com/doumee/api/system/SystemPermissionController.java
index 327e24a..1fc17af 100644
--- a/server/company/src/main/java/com/doumee/api/system/SystemPermissionController.java
+++ b/server/company/src/main/java/com/doumee/api/system/SystemPermissionController.java
@@ -7,6 +7,7 @@
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
import com.doumee.dao.system.dto.QuerySystemPermissionDTO;
import com.doumee.dao.system.model.SystemPermission;
import com.doumee.dao.system.vo.SystemPermissionListVO;
@@ -19,6 +20,7 @@
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/**
@@ -36,55 +38,13 @@
@Autowired
private SystemPermissionBiz systemPermissionBiz;
- @PreventRepeat
- @ApiOperation("鏂板缓")
- @PostMapping("/create")
- @RequiresPermissions("system:permission:create")
- public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemPermission systemPermission) {
- return ApiResponse.success(systemPermissionBiz.create(systemPermission));
- }
-
- @ApiOperation("鍒犻櫎")
- @GetMapping("/delete/{id}")
- @RequiresPermissions("system:permission:delete")
- public ApiResponse deleteById(@PathVariable Integer id) {
- systemPermissionBiz.deleteById(id);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("鎵归噺鍒犻櫎")
- @GetMapping("/delete/batch")
- @RequiresPermissions("system:permission:delete")
- public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
- String [] idArray = ids.split(",");
- List<Integer> idList = new ArrayList<>();
- for (String id : idArray) {
- idList.add(Integer.valueOf(id));
- }
- systemPermissionBiz.deleteByIdInBatch(idList);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("淇敼")
- @PostMapping("/updateById")
- @RequiresPermissions("system:permission:update")
- public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemPermission systemPermission) {
- systemPermissionBiz.updateById(systemPermission);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("鍒嗛〉鏌ヨ")
- @PostMapping("/page")
- @RequiresPermissions("system:permission:query")
- public ApiResponse<PageData<SystemPermissionListVO>> findPage (@RequestBody PageWrap<QuerySystemPermissionDTO> pageWrap) {
- return ApiResponse.success(systemPermissionService.findPage(pageWrap));
- }
@ApiOperation("鏌ヨ鎵�鏈�")
@GetMapping("/all")
@RequiresPermissions("system:permission:query")
public ApiResponse<List<SystemPermission>> findAll () {
SystemPermission systemPermission = new SystemPermission();
+ systemPermission.setTypeList(Arrays.asList(new Integer[]{Constants.ZERO,Constants.TWO}));
systemPermission.setDeleted(Boolean.FALSE);
return ApiResponse.success(systemPermissionService.findList(systemPermission));
}
diff --git a/server/platform/src/main/java/com/doumee/api/business/ApplyChagneDetailController.java b/server/platform/src/main/java/com/doumee/api/business/ApplyChagneDetailController.java
index d931609..e2a8eb0 100644
--- a/server/platform/src/main/java/com/doumee/api/business/ApplyChagneDetailController.java
+++ b/server/platform/src/main/java/com/doumee/api/business/ApplyChagneDetailController.java
@@ -67,7 +67,6 @@
applyChagneDetailService.updateById(applyChagneDetail);
return ApiResponse.success(null);
}
- //
@ApiOperation("鍒嗛〉鏌ヨ")
@PostMapping("/page")
@RequiresPermissions("business:applychagnedetail:query")
diff --git a/server/platform/src/main/java/com/doumee/api/business/CompanyController.java b/server/platform/src/main/java/com/doumee/api/business/CompanyController.java
index 6362cc3..72cac19 100644
--- a/server/platform/src/main/java/com/doumee/api/business/CompanyController.java
+++ b/server/platform/src/main/java/com/doumee/api/business/CompanyController.java
@@ -13,6 +13,7 @@
import com.doumee.service.business.CompanyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -42,10 +43,19 @@
companyService.startSignAuth(company.getId());
return ApiResponse.success(null);
}
+ @PreventRepeat
+ @ApiOperation("鏂板缓鍟嗘埛")
+ @PostMapping("/createShop")
+ @RequiresPermissions("business:company:createShop")
+ public ApiResponse createShop(@RequestBody Company company) {
+ companyService.createShop(company);
+ companyService.startSignAuth(company.getId());
+ return ApiResponse.success(null);
+ }
@ApiOperation("鏍规嵁ID鍒犻櫎")
@GetMapping("/delete/{id}")
- @RequiresPermissions("business:company:delete")
+ @RequiresPermissions(value = {"business:company:delete", "business:company:deleteShop"}, logical = Logical.OR)
public ApiResponse deleteById(@PathVariable Integer id) {
companyService.deleteById(id);
return ApiResponse.success(null);
@@ -53,7 +63,7 @@
@ApiOperation("鎵归噺鍒犻櫎")
@GetMapping("/delete/batch")
- @RequiresPermissions("business:company:delete")
+ @RequiresPermissions(value = {"business:company:delete", "business:company:deleteShop"}, logical = Logical.OR)
public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
String [] idArray = ids.split(",");
List<Integer> idList = new ArrayList<>();
@@ -66,7 +76,7 @@
@ApiOperation("鏍规嵁ID淇敼")
@PostMapping("/updateById")
- @RequiresPermissions("business:company:update")
+ @RequiresPermissions(value = {"business:company:update", "business:company:updateShop"}, logical = Logical.OR)
public ApiResponse updateById(@RequestBody Company company) {
companyService.updateById(company);
companyService.startSignAuth(company.getId());
@@ -75,21 +85,21 @@
@ApiOperation("鏍规嵁ID绂佺敤鍚敤")
@PostMapping("/updateStatus")
- @RequiresPermissions("business:company:update")
+ @RequiresPermissions(value = {"business:company:update", "business:company:updateShop"}, logical = Logical.OR)
public ApiResponse updateStatus(@RequestBody Company company) {
companyService.updateStatus(company);
return ApiResponse.success(null);
}
@ApiOperation("淇敼淇濋櫓鏂规")
@PostMapping("/updateSolutions")
- @RequiresPermissions("business:company:update")
+ @RequiresPermissions(value = {"business:company:update", "business:company:updateShop"}, logical = Logical.OR)
public ApiResponse updateSolutions(@RequestBody Company company) {
companyService.updateSolutions(company);
return ApiResponse.success(null);
}
@ApiOperation("浼佷笟鏇存崲鎵嬫満鍙�")
@PostMapping("/updatePhone")
- @RequiresPermissions("business:company:update")
+ @RequiresPermissions(value = {"business:company:update", "business:company:updateShop"}, logical = Logical.OR)
public ApiResponse updatePhone(@RequestBody Company company) {
companyService.updatePhone(company);
return ApiResponse.success(null);
@@ -104,7 +114,7 @@
@ApiOperation("鍒嗛〉鏌ヨ")
@PostMapping("/page")
- @RequiresPermissions("business:company:query")
+ @RequiresPermissions(value = {"business:company:query", "business:company:queryShop"}, logical = Logical.OR)
public ApiResponse<PageData<Company>> findPage (@RequestBody PageWrap<Company> pageWrap) {
//鏉冮檺鑼冨洿鍐�
return ApiResponse.success(companyService.findPage(pageWrap));
@@ -118,12 +128,11 @@
}
@ApiOperation("鏌ヨ鍏ㄩ儴鏁版嵁")
@PostMapping("/list")
- @RequiresPermissions("business:company:query")
+ @RequiresPermissions(value = {"business:company:query", "business:company:queryShop"}, logical = Logical.OR)
public ApiResponse<List<Company>> findList (@RequestBody Company pageWrap) {
pageWrap.setQueryFlag(Constants.ZERO);//鏌ヨ鍏ㄩ儴鏉冮檺鑼冨洿鍐�
return ApiResponse.success(companyService.findList(pageWrap));
}
-
@ApiOperation("瀵煎嚭Excel")
@PostMapping("/exportExcel")
@RequiresPermissions("business:company:exportExcel")
@@ -133,7 +142,7 @@
@ApiOperation("鏍规嵁ID鏌ヨ")
@GetMapping("/{id}")
- @RequiresPermissions("business:company:query")
+ @RequiresPermissions(value = {"business:company:query", "business:company:queryShop"}, logical = Logical.OR)
public ApiResponse<Company> findById(@PathVariable Integer id) {
return ApiResponse.success(companyService.findById(id));
diff --git a/server/platform/src/main/java/com/doumee/api/system/SystemPermissionController.java b/server/platform/src/main/java/com/doumee/api/system/SystemPermissionController.java
index b4133a3..80b6aec 100644
--- a/server/platform/src/main/java/com/doumee/api/system/SystemPermissionController.java
+++ b/server/platform/src/main/java/com/doumee/api/system/SystemPermissionController.java
@@ -20,6 +20,7 @@
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/**
@@ -86,6 +87,7 @@
@RequiresPermissions("system:permission:query")
public ApiResponse<List<SystemPermission>> findAll () {
SystemPermission systemPermission = new SystemPermission();
+ systemPermission.setTypeList(Arrays.asList(new Integer[]{Constants.ZERO,Constants.ONE}));
systemPermission.setDeleted(Boolean.FALSE);
return ApiResponse.success(systemPermissionService.findList(systemPermission));
}
@@ -95,7 +97,7 @@
@RequiresPermissions("system:permission:query")
public ApiResponse<List<SystemPermission>> findAllCom () {
SystemPermission systemPermission = new SystemPermission();
- systemPermission.setType(Constants.ONE);
+ systemPermission.setTypeList(Arrays.asList(new Integer[]{Constants.ZERO,Constants.TWO}));
systemPermission.setDeleted(Boolean.FALSE);
return ApiResponse.success(systemPermissionService.findList(systemPermission));
}
diff --git a/server/service/src/main/java/com/doumee/config/shiro/ShiroToken.java b/server/service/src/main/java/com/doumee/config/shiro/ShiroToken.java
index c58c505..121e1fc 100644
--- a/server/service/src/main/java/com/doumee/config/shiro/ShiroToken.java
+++ b/server/service/src/main/java/com/doumee/config/shiro/ShiroToken.java
@@ -18,7 +18,7 @@
public ShiroToken() {
}
- public ShiroToken( String username, String password, boolean needPassword,int userType) {
+ public ShiroToken( String username, String password, boolean needPassword,int userType) {
super(username, password, false, (String)null);
this.needPassword = needPassword;
this.userType = userType;
diff --git a/server/service/src/main/java/com/doumee/dao/business/model/ApplyChange.java b/server/service/src/main/java/com/doumee/dao/business/model/ApplyChange.java
index 61deb0b..f9a1963 100644
--- a/server/service/src/main/java/com/doumee/dao/business/model/ApplyChange.java
+++ b/server/service/src/main/java/com/doumee/dao/business/model/ApplyChange.java
@@ -91,7 +91,7 @@
private Integer status;
@ApiModelProperty(value = "鍚堝苟鍗曠紪鐮侊紙鍏宠仈union_change)", example = "1")
@ExcelColumn(name="鍚堝苟鍗曠紪鐮侊紙鍏宠仈union_change)")
- private Integer unionChange;
+ private Integer unionChangeId;
@ApiModelProperty(value = "鍦ㄧ嚎绛剧珷鍚堝悓鍙�")
private String signApplyNo;
@ApiModelProperty(value = "鏈熸湜淇濋櫓鐢熸晥璧锋湡")
diff --git a/server/service/src/main/java/com/doumee/dao/system/model/SystemPermission.java b/server/service/src/main/java/com/doumee/dao/system/model/SystemPermission.java
index 1710692..2101dc4 100644
--- a/server/service/src/main/java/com/doumee/dao/system/model/SystemPermission.java
+++ b/server/service/src/main/java/com/doumee/dao/system/model/SystemPermission.java
@@ -1,16 +1,19 @@
package com.doumee.dao.system.model;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.constants.OperaType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.models.auth.In;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
+import java.util.List;
/**
* 绯荤粺鏉冮檺
@@ -54,7 +57,10 @@
@ApiModelProperty(value = "鏄惁宸插垹闄�", hidden = true)
private Boolean deleted;
- @ApiModelProperty(value = "绫诲瀷 0骞冲彴鐢ㄦ埛 1浼佷笟鐢ㄦ埛")
+ @ApiModelProperty(value = "绫诲瀷 0骞冲彴鐢ㄦ埛 1浼佷笟鐢ㄦ埛 2鍟嗘埛鐢ㄦ埛")
private Integer type;
+ @ApiModelProperty(value = "绫诲瀷闆嗗悎")
+ @TableField(exist = false)
+ private List<Integer> typeList;
}
diff --git a/server/service/src/main/java/com/doumee/service/business/CompanyService.java b/server/service/src/main/java/com/doumee/service/business/CompanyService.java
index b1e4b2c..4fa9346 100644
--- a/server/service/src/main/java/com/doumee/service/business/CompanyService.java
+++ b/server/service/src/main/java/com/doumee/service/business/CompanyService.java
@@ -21,6 +21,7 @@
* @return Integer
*/
Company create(Company company);
+ Company createShop(Company company);
void updateStatus(Company company);
void updatePhone(Company company);
/**
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
index 2ef45bc..6bf7765 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -88,6 +88,7 @@
company.setStatus(Constants.ZERO);
company.setType(Constants.ZERO);
company.setSignStatus(Constants.ZERO);
+ company.setType(Constants.ZERO);
company.setSignIdStatus(Constants.ZERO);
companyMapper.insert(company);
company.setEditDate(company.getCreateDate());
@@ -98,6 +99,36 @@
dealFileData(company);
//澶勭悊鍏宠仈鏂规
dealSolutionsData(company);
+ return company;
+ }
+ @Override
+ @Transactional
+ public Company createShop(Company company) {
+ isValidCreateParam(company);
+ if(companyMapper.selectCount(new QueryWrapper<Company>().lambda()
+ .eq(Company::getCode,company.getCode())
+ .or().eq(Company::getPhone,company.getPhone())
+ .or().eq(Company::getEmail,company.getEmail())
+ .or().eq(Company::getUsername,company.getUsername())
+ .or().eq(Company::getName,company.getName()))>0){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇ヤ紒涓氥�愬悕绉般�戙�愮粺涓�淇$敤浠g爜銆戙�愰偖绠便�戞垨鑰呫�愭墜鏈哄彿銆戝凡瀛樺湪锛岃纭鍚庨噸鏂版彁浜わ紒");
+ }
+ LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+ company.setCreator(user.getId());
+ company.setCreateDate(new Date());
+ company.setType(Constants.ONE);
+ company.setIsdeleted(Constants.ZERO);
+ company.setStatus(Constants.ZERO);
+ company.setType(Constants.ZERO);
+ company.setSignStatus(Constants.ZERO);
+ company.setSignIdStatus(Constants.ZERO);
+ companyMapper.insert(company);
+ company.setEditDate(company.getCreateDate());
+ company.setEditor(user.getId());
+ //澶勭悊鐧婚檰璐﹀彿淇℃伅
+ dealSystemUserData(company);
+ //澶勭悊闄勪欢淇℃伅
+ dealFileData(company);
return company;
}
@Override
@@ -339,7 +370,7 @@
if(company.getSignImg()!=null && StringUtils.isNotBlank(company.getSignImg().getFileurl())){
multifileList.add(initMultiFileByCompay(company,company.getSignImg(),Constants.MultiFile.COM_SING_IMG.getKey()));
}else {
- throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"璇蜂笂浼犵數瀛愮绔狅紒");
+ // throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"璇蜂笂浼犵數瀛愮绔狅紒");
}
if(company.getIdcardImgList()!=null && company.getIdcardImgList()!=null&& company.getIdcardImgList().size()>0){
for(Multifile f : company.getIdcardImgList()){
diff --git a/server/service/src/main/java/com/doumee/service/system/impl/SystemPermissionServiceImpl.java b/server/service/src/main/java/com/doumee/service/system/impl/SystemPermissionServiceImpl.java
index 3972947..ccce6ae 100644
--- a/server/service/src/main/java/com/doumee/service/system/impl/SystemPermissionServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/system/impl/SystemPermissionServiceImpl.java
@@ -89,7 +89,12 @@
@Override
public List<SystemPermission> findList(SystemPermission systemPermission) {
- Wrapper<SystemPermission> wrapper = new QueryWrapper<>(systemPermission);
+ QueryWrapper<SystemPermission> wrapper = new QueryWrapper<>(systemPermission);
+ if(systemPermission.getTypeList()!=null){
+ wrapper.lambda().and(w->{w.isNull(SystemPermission::getType).or()
+ .in(SystemPermission::getType,systemPermission.getTypeList());
+ });
+ }
return systemPermissionMapper.selectList(wrapper);
}
diff --git a/server/service/src/main/resources/mappers/SystemPermissionMapper.xml b/server/service/src/main/resources/mappers/SystemPermissionMapper.xml
index 9568ef5..ba0de90 100644
--- a/server/service/src/main/resources/mappers/SystemPermissionMapper.xml
+++ b/server/service/src/main/resources/mappers/SystemPermissionMapper.xml
@@ -16,7 +16,7 @@
</resultMap>
<select id="selectManageList" resultMap="SystemPermissionListVO">
SELECT
- perm.`ID`, perm.`CODE`, perm.`NAME`, perm.`REMARK`, perm.`FIXED`, perm.`CREATE_TIME`, perm.`UPDATE_TIME`, perm.`CREATE_USER`, perm.`UPDATE_USER`, perm.`DELETED`,
+ perm.`ID`, perm.`type`, perm.`CODE`, perm.`NAME`, perm.`REMARK`, perm.`FIXED`, perm.`CREATE_TIME`, perm.`UPDATE_TIME`, perm.`CREATE_USER`, perm.`UPDATE_USER`, perm.`DELETED`,
create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME
FROM SYSTEM_PERMISSION perm
@@ -24,10 +24,13 @@
LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = perm.UPDATE_USER
<where>
perm.DELETED = 0
- <if test="dto.code != null">
+ <if test="dto.code != null and dto.code!=''">
AND perm.CODE LIKE CONCAT('%', #{dto.code}, '%')
</if>
- <if test="dto.name != null">
+ <if test="dto.type != null">
+ AND ifnull(perm.type,0) in(0, ${dto.type})
+ </if>
+ <if test="dto.name != null and dto.name!=''">
AND perm.`NAME` LIKE CONCAT('%', #{dto.name}, '%')
</if>
</where>
diff --git a/server/shop/src/main/java/com/doumee/api/system/SystemMenuController.java b/server/shop/src/main/java/com/doumee/api/system/SystemMenuController.java
index 402e765..0c06a81 100644
--- a/server/shop/src/main/java/com/doumee/api/system/SystemMenuController.java
+++ b/server/shop/src/main/java/com/doumee/api/system/SystemMenuController.java
@@ -6,6 +6,7 @@
import com.doumee.core.constants.OperaType;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.utils.Constants;
import com.doumee.dao.system.dto.UpdateSystemMenuSortDTO;
import com.doumee.dao.system.model.SystemMenu;
import com.doumee.dao.system.vo.SystemMenuListVO;
@@ -32,71 +33,18 @@
@Autowired
private SystemMenuBiz systemMenuBiz;
- @ApiOperation("鑿滃崟鎺掑簭")
- @PostMapping("/updateSort")
- @RequiresPermissions("system:menu:sort")
- public ApiResponse updateSort (@Validated @RequestBody UpdateSystemMenuSortDTO dto) {
- systemMenuBiz.updateSort(dto);
- return ApiResponse.success(null);
- }
-
@ApiOperation("鏌ヨ鑿滃崟鏍�")
@GetMapping("/treeNodes")
- public ApiResponse<List<SystemMenuNodeVO>> getTreeMenu () {
+ public ApiResponse<List<SystemMenuNodeVO>> getTreeMenu() {
LoginUserInfo loginUserInfo = this.getLoginUser();
- return ApiResponse.success(systemMenuBiz.findTree(loginUserInfo.getId(),loginUserInfo.getType()));
+ return ApiResponse.success(systemMenuBiz.findTree(loginUserInfo.getId(), Constants.TWO));
}
@ApiOperation("鏌ヨ鍒楄〃鏍�")
@PostMapping("/treeList/{type}")
@RequiresPermissions("system:menu:query")
- public ApiResponse<List<SystemMenuListVO>> treeList (@PathVariable Integer type) {
+ public ApiResponse<List<SystemMenuListVO>> treeList(@PathVariable Integer type) {
+ type = Constants.TWO;//鍟嗘埛鑿滃崟
return ApiResponse.success(systemMenuBiz.findTreeByType(type));
}
-
- @PreventRepeat
- @ApiOperation("鏂板缓")
- @PostMapping("/create")
- @RequiresPermissions("system:menu:create")
- public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemMenu systemMenu) {
- return ApiResponse.success(systemMenuBiz.create(systemMenu));
- }
-
- @ApiOperation("鍒犻櫎")
- @GetMapping("/delete/{id}")
- @RequiresPermissions("system:menu:delete")
- public ApiResponse deleteById(@PathVariable Integer id) {
- systemMenuBiz.deleteById(id);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("鎵归噺鍒犻櫎")
- @GetMapping("/delete/batch")
- @RequiresPermissions("system:menu:delete")
- public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
- String [] idArray = ids.split(",");
- List<Integer> idList = new ArrayList<>();
- for (String id : idArray) {
- idList.add(Integer.valueOf(id));
- }
- systemMenuBiz.deleteByIdInBatch(idList);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("淇敼")
- @PostMapping("/updateById")
- @RequiresPermissions("system:menu:update")
- public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemMenu systemMenu) {
- systemMenuBiz.updateById(systemMenu);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("淇敼鑿滃崟鐘舵��")
- @PostMapping("/updateStatus")
- @RequiresPermissions("system:menu:update")
- public ApiResponse updateStatus(@Validated(OperaType.UpdateStatus.class) @RequestBody SystemMenu systemMenu) {
- systemMenuBiz.updateById(systemMenu);
- return ApiResponse.success(null);
- }
-
}
diff --git a/server/shop/src/main/java/com/doumee/api/system/SystemPermissionController.java b/server/shop/src/main/java/com/doumee/api/system/SystemPermissionController.java
index 327e24a..5bb1a43 100644
--- a/server/shop/src/main/java/com/doumee/api/system/SystemPermissionController.java
+++ b/server/shop/src/main/java/com/doumee/api/system/SystemPermissionController.java
@@ -7,6 +7,7 @@
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
import com.doumee.dao.system.dto.QuerySystemPermissionDTO;
import com.doumee.dao.system.model.SystemPermission;
import com.doumee.dao.system.vo.SystemPermissionListVO;
@@ -19,6 +20,7 @@
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/**
@@ -36,55 +38,12 @@
@Autowired
private SystemPermissionBiz systemPermissionBiz;
- @PreventRepeat
- @ApiOperation("鏂板缓")
- @PostMapping("/create")
- @RequiresPermissions("system:permission:create")
- public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemPermission systemPermission) {
- return ApiResponse.success(systemPermissionBiz.create(systemPermission));
- }
-
- @ApiOperation("鍒犻櫎")
- @GetMapping("/delete/{id}")
- @RequiresPermissions("system:permission:delete")
- public ApiResponse deleteById(@PathVariable Integer id) {
- systemPermissionBiz.deleteById(id);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("鎵归噺鍒犻櫎")
- @GetMapping("/delete/batch")
- @RequiresPermissions("system:permission:delete")
- public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
- String [] idArray = ids.split(",");
- List<Integer> idList = new ArrayList<>();
- for (String id : idArray) {
- idList.add(Integer.valueOf(id));
- }
- systemPermissionBiz.deleteByIdInBatch(idList);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("淇敼")
- @PostMapping("/updateById")
- @RequiresPermissions("system:permission:update")
- public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemPermission systemPermission) {
- systemPermissionBiz.updateById(systemPermission);
- return ApiResponse.success(null);
- }
-
- @ApiOperation("鍒嗛〉鏌ヨ")
- @PostMapping("/page")
- @RequiresPermissions("system:permission:query")
- public ApiResponse<PageData<SystemPermissionListVO>> findPage (@RequestBody PageWrap<QuerySystemPermissionDTO> pageWrap) {
- return ApiResponse.success(systemPermissionService.findPage(pageWrap));
- }
-
@ApiOperation("鏌ヨ鎵�鏈�")
@GetMapping("/all")
@RequiresPermissions("system:permission:query")
public ApiResponse<List<SystemPermission>> findAll () {
SystemPermission systemPermission = new SystemPermission();
+ systemPermission.setTypeList(Arrays.asList(new Integer[]{Constants.ZERO,Constants.THREE}));
systemPermission.setDeleted(Boolean.FALSE);
return ApiResponse.success(systemPermissionService.findList(systemPermission));
}
--
Gitblit v1.9.3