| | |
| | | |
| | | #VUE_APP_API = 'https://dmtest.ahapp.net/yyb_web_api/' |
| | | |
| | | VUE_APP_API = 'http://192.168.0.138:10031/' |
| | | VUE_APP_API = 'http://192.168.0.134:10031/' |
| | | |
| | | # VUE_APP_API = 'https://www.yyb.red/yyb_web_api/' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | // æ¥è¯¢ |
| | | export function fetchList (data) { |
| | | return request.post('/business/companyDepartment/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | |
| | | // å建 |
| | | export function create (data) { |
| | | return request.post('/business/companyDepartment/create', data) |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | | return request.post('/business/companyDepartment/updateById', data) |
| | | } |
| | | |
| | | // å é¤ |
| | | export function deleteById (id) { |
| | | return request.get(`/business/companyDepartment/delete/${id}`) |
| | | } |
| | | |
| | | // ç»ç»æ æ¥è¯¢ |
| | | export function tree () { |
| | | return request.get(`/business/companyDepartment/tree`) |
| | | } |
| | | |
| | | // æåº |
| | | export function updateSort (data) { |
| | | return request.post('/business/companyDepartment/updateSort', data) |
| | | } |
| | | |
| | | // æ¹éå é¤ |
| | | export function deleteByIdInBatch (ids) { |
| | | return request.get('/business/companyDepartment/delete/batch', { |
| | | params: { |
| | | ids |
| | | } |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | // æ¥è¯¢ |
| | | export function fetchList (data) { |
| | | return request.post('/business/customerService/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | |
| | | // å建 |
| | | export function create (data) { |
| | | return request.post('/business/customerService/create', data) |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | | return request.post('/business/customerService/updateById', data) |
| | | } |
| | | |
| | | // å é¤ |
| | | export function deleteById (id) { |
| | | return request.get(`/business/customerService/delete/${id}`) |
| | | } |
| | | |
| | | // ææä¼ä¸ |
| | | export function auth (data) { |
| | | return request.post('/business/customerService/auth', data) |
| | | } |
| | | |
| | | // æ ¹æ®IDæ¥è¯¢ |
| | | export function getById (id) { |
| | | return request.get(`/business/customerService/${id}`) |
| | | } |
| | |
| | | export function createRoleMenu (data) { |
| | | return request.post('/system/role/createRoleMenu', data) |
| | | } |
| | | |
| | | // é
ç½®è§è²æ°æ®æé |
| | | export function createRoleDataPermission (data) { |
| | | return request.post('/system/role/createRoleDataPermission', data) |
| | | } |
| | |
| | | export function updUserStatus (params) { |
| | | return request.get('/system/user/updUserStatus', {params}) |
| | | } |
| | | |
| | | // 设置æåæ¶ä¸»ç®¡ |
| | | export function updateHead (data) { |
| | | return request.post('/system/user/updateHead', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules">{{form.type}} |
| | | <el-form-item label="ä¸çº§ç»ç»" prop="parentId"> |
| | | <el-cascader |
| | | :options="organization" |
| | | v-model="form.parentId" |
| | | :disabled="form.disabled" |
| | | placeholder="è¯·éæ©ä¸çº§ç»ç»" |
| | | :props="{ label: 'name', value: 'id', checkStrictly: true }" |
| | | clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»ç»åç§°" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åç§°" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { tree } from '@/api/business/companyDepartment' |
| | | import { mapState } from 'vuex' |
| | | export default { |
| | | name: 'OperaCompanyDepartmentWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | computed: { |
| | | ...mapState(['userInfo']) |
| | | }, |
| | | data () { |
| | | return { |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | id: null, |
| | | name: '', |
| | | parentId: [], |
| | | type: '', |
| | | disabled: false |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '请è¾å
¥ç»ç»åç§°' } |
| | | ] |
| | | }, |
| | | organization: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/business/companyDepartment', |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | methods: { |
| | | __confirmCreate () { |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | let obj = JSON.parse(JSON.stringify(this.form)) |
| | | obj.parentId = obj.parentId && obj.parentId.length > 0 ? obj.parentId[0] : '' |
| | | obj.type = this.userInfo.type |
| | | // è°ç¨æ°å»ºæ¥å£ |
| | | this.isWorking = true |
| | | this.api.create(obj) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('æ°å»ºæå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | }, |
| | | __confirmEdit () { |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | // è°ç¨æ°å»ºæ¥å£ |
| | | let obj = JSON.parse(JSON.stringify(this.form)) |
| | | obj.parentId = obj.parentId && obj.parentId.length > 0 ? obj.parentId[0] : '' |
| | | obj.type = this.userInfo.type |
| | | this.isWorking = true |
| | | this.api.updateById(obj) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('ä¿®æ¹æå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | }, |
| | | open (title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.getTree() |
| | | // æ°å»º |
| | | 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] |
| | | } |
| | | }) |
| | | }, |
| | | getTree() { |
| | | tree() |
| | | .then(records => { |
| | | this.organization = records |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canReduce">åä¿</el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="ç¾ç½²ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <template v-if="row.signStatus === 0">å¾
ç¾ç½²</template> |
| | | <template v-else-if="row.signStatus === 1">å·²ç¾ç½²</template> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="signDate" |
| | | align="center" |
| | | label="ç¾ç½²æ¶é´"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="signUserName" |
| | | align="center" |
| | | label="ç¾ç½²äºº"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" v-if="row.signStatus === 1" @click="openFile(row.fileSignUrl)">æ¥çç¾ç½²æ¹æ¡ä¹¦</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="info_list" v-if="JSON.stringify(form) !== '{}'"> |
| | | <div class="info_list_item"> |
| | |
| | | }) |
| | | }, |
| | | methods: { |
| | | openFile(url) { |
| | | window.open(url) |
| | | }, |
| | | close () { |
| | | this.visiblePhone = false |
| | | this.phone = '' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="客æå§å" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="ææºå·" prop="mobile"> |
| | | <el-input v-model="form.mobile" maxlength="11" show-word-limit placeholder="请è¾å
¥ææºå·" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å¤æ³¨" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | export default { |
| | | name: 'OperaCustomerServiceWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | const validatorMobile = (rule, value, callback) => { |
| | | if (value === '') { |
| | | callback(new Error('请è¾å
¥ææºå·')); |
| | | } else if (!/^1[3-9]\d{9}$/.test(value)) { |
| | | callback(new Error('ææºå·ä¸åæ³')); |
| | | } |
| | | callback() |
| | | }; |
| | | return { |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | id: null, |
| | | remark: '', |
| | | name: '', |
| | | mobile: '' |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '请è¾å
¥å®¢æå§å' } |
| | | ], |
| | | mobile: [ |
| | | { required: true, validator: validatorMobile } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/business/customerService', |
| | | 'field.id': 'id' |
| | | }) |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | class="menu-config-dialog" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | width="576px" |
| | | title="åé
æå¡ä¼ä¸" |
| | | @confirm="confirm" |
| | | > |
| | | <p class="tip">ä¸ºç¨æ· <em>{{form.name || ''}}</em> åé
ä¼ä¸</p> |
| | | <el-transfer |
| | | :titles="['æªåé
ä¼ä¸', 'å·²åé
ä¼ä¸']" |
| | | v-model="form.companyIds" |
| | | :data="enterprise" /> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { allForFp } from '@/api/business/company' |
| | | import { auth, getById } from '@/api/business/customerService' |
| | | import { mapState } from 'vuex' |
| | | export default { |
| | | name: 'allocateEnterprises', |
| | | components: { GlobalWindow }, |
| | | computed: { |
| | | ...mapState(['userInfo']) |
| | | }, |
| | | data () { |
| | | return { |
| | | visible: false, |
| | | isWorking: false, |
| | | form: { |
| | | id: null, |
| | | name: '', |
| | | companyIds: [] |
| | | }, |
| | | enterprise: [] |
| | | } |
| | | }, |
| | | methods: { |
| | | open (title, id) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.getCompany() |
| | | for (const key in this.form) { |
| | | this.form[key] = '' |
| | | } |
| | | getById(id) |
| | | .then(res => { |
| | | this.form.id = res.id |
| | | this.form.name = res.name |
| | | this.form.companyIds = res.customerCompanyList.map(item => item.companyId) |
| | | }) |
| | | }, |
| | | getCompany() { |
| | | allForFp({ type: this.userInfo.type }) |
| | | .then(res => { |
| | | this.enterprise = res.map(item => { |
| | | return { |
| | | key: item.id, |
| | | label: item.name |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | confirm() { |
| | | let obj = { |
| | | id: this.form.id, |
| | | customerCompanyList: [] |
| | | } |
| | | if (this.form.companyIds.length > 0) { |
| | | obj.customerCompanyList = this.form.companyIds.map(item => { |
| | | return { |
| | | companyId: item |
| | | } |
| | | }) |
| | | } |
| | | this.isWorking = true |
| | | auth(obj) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('æä½æå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "@/assets/style/variables.scss"; |
| | | .global-window { |
| | | .tip { |
| | | margin-bottom: 12px; |
| | | em { |
| | | font-style: normal; |
| | | color: $primary-color; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | label="ä¿é©æ¹æ¡"> |
| | | <template slot-scope="scope"> |
| | | <!-- :value="{ id:item.id, baseId: item.baseId }"--> |
| | | <el-select v-model="scope.row.solution.id" @change="changeSolution($event, scope.$index)" placeholder="è¯·éæ©"> |
| | | <el-select v-model="scope.row.solution.id" filterable @change="changeSolution($event, scope.$index)" placeholder="è¯·éæ©"> |
| | | <el-option |
| | | v-for="item in programme" |
| | | :key="item.id" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | label="ç¾ç½²ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <template v-if="row.signStatus === 0">å¾
ç¾ç« </template> |
| | | <template v-if="row.signStatus === 1">å·²ç¾ç« </template> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small" style="color: red;" @click="dele(scope.$index)">å é¤</el-button> |
| | | <el-button type="text" size="small" style="color: red;" @click="dele(scope.$index)" v-if="scope.row.signStatus === 0 || !scope.row.signStatus">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="æéç±»å" prop="type"> |
| | | <el-select v-model="form.type" @change="form.customData === []" placeholder="è¯·éæ©"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="èªå®ä¹é¨é¨" prop="customData" v-if="form.type === 4"> |
| | | <el-cascader |
| | | :options="organization" |
| | | v-model="form.customData" |
| | | placeholder="è¯·éæ©ä¸çº§ç»ç»" |
| | | :props="{ label: 'name', value: 'id', multiple: true, checkStrictly: true }" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { tree } from '@/api/business/companyDepartment' |
| | | import { createRoleDataPermission } from '@/api/system/role' |
| | | export default { |
| | | name: 'Permissions', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | roleId: null, |
| | | type: '', |
| | | customData: [] |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | | type: [ |
| | | { required: true, message: 'è¯·éæ©æéç±»å' } |
| | | ], |
| | | customData: [ |
| | | { required: true, message: 'è¯·éæ©é¨é¨' } |
| | | ] |
| | | }, |
| | | organization: [], |
| | | options: [ |
| | | { label: 'å
¨é¨', value: 0 }, |
| | | { label: 'æå±é¨é¨åä¸å±é¨é¨', value: 1 }, |
| | | { label: 'æå±é¨é¨åå
¶ååé¨é¨', value: 2 }, |
| | | { label: 'ä»
æå±é¨é¨', value: 3 }, |
| | | { label: 'èªå®ä¹é¨é¨', value: 4 }, |
| | | { label: 'ä»
èªå·±', value: -1 } |
| | | ] |
| | | } |
| | | }, |
| | | methods: { |
| | | confirm () { |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | this.isWorking = true |
| | | let obj = JSON.parse(JSON.stringify(this.form)) |
| | | if (obj.customData.length > 0) { |
| | | obj.customData = obj.customData.flat().join(',') |
| | | } |
| | | createRoleDataPermission(obj) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('æä½æå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | }, |
| | | getTree() { |
| | | tree() |
| | | .then(records => { |
| | | this.organization = records |
| | | }) |
| | | }, |
| | | open (title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.getTree() |
| | | // æ°å»º |
| | | 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] |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/system/role' |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <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="departmentId"> |
| | | <el-cascader |
| | | :options="organization" |
| | | v-model="form.departmentId" |
| | | placeholder="è¯·éæ©" |
| | | :props="{ label: 'name', value: 'id', checkStrictly: true }" |
| | | clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="æéæä»¶é®ç®±" prop="email"> |
| | | <el-input v-model="form.email" placeholder="请è¾å
¥" v-trim /> |
| | | </el-form-item> |
| | |
| | | import PositionSelect from '@/components/common/PositionSelect' |
| | | import { checkMobile, checkEmail } from '@/utils/form' |
| | | import { sendSms } from '@/api/business/smsEmail' |
| | | |
| | | import { tree } from '@/api/business/companyDepartment' |
| | | export default { |
| | | name: 'OperaUserWindow', |
| | | extends: BaseOpera, |
| | |
| | | realname: '', // å§å |
| | | mobile: '', // ææºå·ç |
| | | email: '', |
| | | captcha: '' |
| | | captcha: '', |
| | | departmentId: '' |
| | | }, |
| | | num: 0, |
| | | timer: null, |
| | | organization: [], |
| | | // éªè¯è§å |
| | | rules: { |
| | | username: [ |
| | |
| | | mobile: [ |
| | | { required: true, validator: checkMobile } |
| | | ], |
| | | departmentId: [ |
| | | { required: true, message: 'è¯·éæ©é¨é¨' } |
| | | ], |
| | | email: [ |
| | | { required: true, message: '请è¾å
¥é®ç®±' } |
| | | ] |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | __confirmCreate () { |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | let obj = JSON.parse(JSON.stringify(this.form)) |
| | | obj.departmentId = obj.departmentId[0] |
| | | // è°ç¨æ°å»ºæ¥å£ |
| | | this.isWorking = true |
| | | this.api.create(obj) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('æ°å»ºæå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | }, |
| | | __confirmEdit () { |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | let obj = JSON.parse(JSON.stringify(this.form)) |
| | | obj.departmentId = obj.departmentId[0] |
| | | // è°ç¨æ°å»ºæ¥å£ |
| | | this.isWorking = true |
| | | this.api.updateById(obj) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('ä¿®æ¹æå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | }, |
| | | send() { |
| | | if (!this.form.mobile) { |
| | | this.$message.warning('请è¾å
¥ææºå·') |
| | |
| | | .then(res => { |
| | | this.num = 60 |
| | | this.setTime() |
| | | }) |
| | | }, |
| | | getTree() { |
| | | tree() |
| | | .then(records => { |
| | | this.organization = records |
| | | }) |
| | | }, |
| | | setTime() { |
| | |
| | | open (title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.getTree() |
| | | clearInterval(this.timer) |
| | | this.num = 0 |
| | | // æ°å»º |
| | |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form.id = null |
| | | this.form.departmentId = null |
| | | this.form.positionIds = [] |
| | | // this.form.departmentId = null |
| | | // this.form.positionIds = [] |
| | | }) |
| | | return |
| | | } |
| | |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | this.form.departmentId = target.department == null ? null : target.department.id |
| | | this.form.positionIds = target.positions == null ? [] : target.positions.map(p => p.id) |
| | | // this.form.departmentId = target.department == null ? null : target.department.id |
| | | // this.form.positionIds = target.positions == null ? [] : target.positions.map(p => p.id) |
| | | }) |
| | | } |
| | | }, |
| | |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column prop="username" label="ç»å½è´¦å·" min-width="150px" fixed align="center"></el-table-column> |
| | | <el-table-column prop="name" label="ä¼ä¸åç§°" min-width="150px" fixed align="center"></el-table-column> |
| | | <el-table-column prop="code" label="ç»ä¸ä¿¡ç¨ä»£ç " min-width="150px" fixed align="center"></el-table-column> |
| | | <el-table-column prop="phone" label="ç»å®ææºå·" min-width="100px" fixed align="center"></el-table-column> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:companydepartment:query']"> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:companydepartment:create']"> |
| | | <li><el-button type="primary" @click="$refs.operaCompanyDepartmentWindow.open('æ°å»ºç»ç»', { disabled: false })" icon="el-icon-plus" v-permissions="['business:companydepartment: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: 'childList', 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="ç»ç»åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="ç»ç»ç±»å" min-width="100px"></el-table-column> |
| | | <el-table-column prop="editorName" label="æä½äºº" min-width="100px"></el-table-column> |
| | | <el-table-column prop="editDate" label="æä½æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:companydepartment:update', 'business:companydepartment:delete'])" |
| | | label="æä½" |
| | | min-width="140" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCompanyDepartmentWindow.open('ç¼è¾ç»ç»', {...row, parentId: [row.id], disabled: true})" icon="el-icon-edit" v-permissions="['business:companydepartment:update']">ç¼è¾</el-button> |
| | | <el-button type="text" icon="el-icon-plus" @click="$refs.operaCompanyDepartmentWindow.open('æ°å»ºåç»ç»', {...row, id: null, parentId: [row.id], disabled: true})">æ°å»ºåç»ç»</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:companydepartment:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaCompanyDepartmentWindow ref="operaCompanyDepartmentWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaCompanyDepartmentWindow from '@/components/business/OperaCompanyDepartmentWindow' |
| | | import { tree, updateSort } from '@/api/business/companyDepartment' |
| | | export default { |
| | | name: 'CompanyDepartment', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaCompanyDepartmentWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | }, |
| | | isWorking: { |
| | | sort: false |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'ä¼ä¸ä¿¡æ¯è¡¨', |
| | | api: '/business/companyDepartment', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | // æ¥è¯¢æ°æ® |
| | | handlePageChange () { |
| | | this.isWorking.search = true |
| | | tree() |
| | | .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 |
| | | updateSort({ |
| | | 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 |
| | | }) |
| | | }, |
| | | // æ¥è¯¢ç¶èç¹ |
| | | __findParent (id, parent) { |
| | | if (parent.childList === 0) { |
| | | return |
| | | } |
| | | for (const menu of parent.childList) { |
| | | if (menu.id === id) { |
| | | return parent |
| | | } |
| | | if (menu.childList.length > 0) { |
| | | const m = this.__findParent(id, menu) |
| | | if (m != null) { |
| | | return m |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:customerservice:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <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> |
| | | <el-form-item label="ææºå·" prop="mobile"> |
| | | <el-input v-model="searchForm.mobile" 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:customerservice:create']"> |
| | | <li><el-button type="primary" @click="$refs.operaCustomerServiceWindow.open('æ°å¢è´¦å·')" icon="el-icon-plus" v-permissions="['business:customerservice:create']">æ°å»º</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column label="åºå·" width="80px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{scope.$index + 1}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="客æå§å" min-width="100px"></el-table-column> |
| | | <el-table-column prop="mobile" label="ææºå·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="companyNum" label="æå¡ä¼ä¸æ°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="remark" label="夿³¨" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createDate" label="å建æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createUserName" label="å建人" min-width="100px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:customerservice:update', 'business:customerservice:delete'])" |
| | | label="æä½" |
| | | min-width="180" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCustomerServiceWindow.open('ç¼è¾è´¦å·', row)" icon="el-icon-edit" v-permissions="['business:customerservice:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="$refs.allocateEnterprises.open('åé
æå¡ä¼ä¸', row.id)" icon="el-icon-connection">ä¼ä¸ææ</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:customerservice:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaCustomerServiceWindow ref="operaCustomerServiceWindow" @success="handlePageChange"/> |
| | | <!-- åé
ä¼ä¸ --> |
| | | <allocateEnterprises ref="allocateEnterprises" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaCustomerServiceWindow from '@/components/business/OperaCustomerServiceWindow' |
| | | import allocateEnterprises from '@/components/business/allocateEnterprises' |
| | | export default { |
| | | name: 'CustomerService', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaCustomerServiceWindow, allocateEnterprises }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | name: '', |
| | | mobile: '' |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '客æä¿¡æ¯è¡¨', |
| | | api: '/business/customerService', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-table-column |
| | | v-if="containPermissions(['system:role:update', 'system:role:createRolePermission', 'system:role:createRoleMenu', 'system:role:delete'])" |
| | | label="æä½" |
| | | min-width="270" |
| | | min-width="330" |
| | | fixed="right" |
| | | > |
| | | <!-- v-if="isAdmin || (row.code !== adminCode && userInfo.roles.findIndex(code => code === row.code) === -1)"--> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaRoleWindow.open('ç¼è¾è§è²', row)" icon="el-icon-edit" v-permissions="['system:role:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="openRole(row.systemDataPermission)">æ°æ®æé</el-button> |
| | | <el-button type="text" @click="$refs.permissionConfigWindow.open(row)" v-permissions="['system:role:createRolePermission']">é
ç½®æé</el-button> |
| | | <el-button type="text" @click="$refs.menuConfigWindow.open(row)" icon="el-icon-menu" v-permissions="['system:role:createRoleMenu']">ææèå</el-button> |
| | | <el-button v-if="!row.fixed" type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['system:role:delete']">å é¤</el-button> |
| | |
| | | <PermissionConfigWindow ref="permissionConfigWindow" @success="handlePageChange(tableData.pagination.pageIndex)"/> |
| | | <!-- ææèå --> |
| | | <MenuConfigWindow ref="menuConfigWindow" @success="handlePageChange(tableData.pagination.pageIndex)"/> |
| | | <!-- æ°æ®æé --> |
| | | <Permissions ref="permissions" @success="handlePageChange(tableData.pagination.pageIndex)"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import OperaRoleWindow from '@/components/system/role/OperaRoleWindow' |
| | | import PermissionConfigWindow from '@/components/system/role/PermissionConfigWindow' |
| | | import MenuConfigWindow from '@/components/system/role/MenuConfigWindow' |
| | | import Permissions from '@/components/system/role/Permissions' |
| | | export default { |
| | | name: 'SystemRole', |
| | | extends: BaseTable, |
| | | components: { MenuConfigWindow, PermissionConfigWindow, OperaRoleWindow, TableLayout, Pagination }, |
| | | components: { MenuConfigWindow, PermissionConfigWindow, OperaRoleWindow, TableLayout, Pagination, Permissions }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | |
| | | }] |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | openRole(row) { |
| | | let customData = [] |
| | | row.customData.split(',').forEach(item => { |
| | | customData.push([item]) |
| | | }) |
| | | this.$refs.permissions.open('æ°æ®æé', { ...row, customData }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <TableLayout :permissions="['system:user:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="80px" inline> |
| | | <!-- <el-form-item label="ç¨æ·å" prop="username">--> |
| | | <!-- <el-input v-model="searchForm.username" v-trim placeholder="请è¾å
¥ç¨æ·å" @keypress.enter.native="search"/>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="å§å" prop="realname"> |
| | | <el-input v-model="searchForm.realname" v-trim placeholder="请è¾å
¥" @keypress.enter.native="search"/> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ææºå·ç " prop="mobile">--> |
| | | <!-- <el-input v-model="searchForm.mobile" v-trim placeholder="请è¾å
¥ææºå·ç " @keypress.enter.native="search"/>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="æå±é¨é¨" prop="rootDeptId">--> |
| | | <!-- <DepartmentSelect v-model="searchForm.rootDeptId" placeholder="è¯·éæ©æå±é¨é¨" clearable/>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="å²ä½" prop="positionId">--> |
| | | <!-- <PositionSelect v-model="searchForm.positionId" placeholder="è¯·éæ©å²ä½" clearable/>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="æå±é¨é¨" prop="companyDepartmentPathName"> |
| | | <el-input v-model="searchForm.companyDepartmentPathName" v-trim placeholder="请è¾å
¥" @keypress.enter.native="search"/> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" icon="el-icon-search" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | |
| | | <el-table-column prop="username" label="è´¦å·" min-width="120px"></el-table-column> |
| | | <el-table-column prop="realname" label="å§å" min-width="100px"></el-table-column> |
| | | <el-table-column prop="mobile" label="èç³»æ¹å¼" min-width="100px"></el-table-column> |
| | | <el-table-column label="主管" min-width="100px"> |
| | | <template slot-scope="{ row }"> |
| | | <el-switch |
| | | v-model="row.headStatus" |
| | | @change="setHeadStatus($event, row)" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | :active-value="1" |
| | | :inactive-value="0"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="companyDepartmentPathName" label="æå¨é¨é¨" min-width="100px"></el-table-column> |
| | | <el-table-column prop="roles" label="è§è²" min-width="160px" class-name="table-column-strings"> |
| | | <template slot-scope="{row}"> |
| | | <ul> |
| | |
| | | > |
| | | <!-- row.id !== userInfo.id &&--> |
| | | <template v-if="isAdmin || (row.roles.findIndex(r => r.code === adminCode) === -1)" slot-scope="{row}"> |
| | | <el-button type="text" icon="el-icon-edit" @click="$refs.operaUserWindow.open('ç¼è¾ç¨æ·', row)" v-permissions="['system:user:update']">ç¼è¾</el-button> |
| | | <el-button type="text" icon="el-icon-edit" @click="$refs.operaUserWindow.open('ç¼è¾ç¨æ·', {...row, departmentId: [row.departmentId]})" v-permissions="['system:user:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="$refs.allocationEnterprises.open('åé
ä¼ä¸', row)" v-if="userInfo.type !== 1">åé
ä¼ä¸</el-button> |
| | | <el-button type="text" icon="el-icon-s-custom" @click="$refs.roleConfigWindow.open(row)" v-permissions="['system:user:createUserRole']">é
ç½®è§è²</el-button> |
| | | <el-button type="text" @click="$refs.resetPwdWindow.open(row)" v-permissions="['system:user:resetPwd']">éç½®å¯ç </el-button> |
| | |
| | | import ResetPwdWindow from '@/components/system/user/ResetPwdWindow' |
| | | import DepartmentSelect from '@/components/common/DepartmentSelect' |
| | | import PositionSelect from '@/components/common/PositionSelect' |
| | | import { updUserStatus } from '@/api/system/user' |
| | | import { updUserStatus, updateHead } from '@/api/system/user' |
| | | |
| | | export default { |
| | | name: 'SystemUser', |
| | |
| | | realname: '', // å§å |
| | | rootDeptId: null, // é¨é¨ID |
| | | positionId: null, // å²ä½ID |
| | | mobile: '' // ææºå·ç |
| | | mobile: '', // ææºå·ç |
| | | companyDepartmentPathName: '' // é¨é¨åç§° |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | // è®¾ç½®åæ¶ä¸»ç®¡ |
| | | setHeadStatus(e, row) { |
| | | updateHead({ id: row.id, headStatus: row.headStatus }) |
| | | .then(res => { |
| | | this.search() |
| | | }) |
| | | }, |
| | | changeStatus(status, row) { |
| | | updUserStatus({ |
| | | id: row.id, |