Commit 1be1155f by Tang

feat: merge

parents 9c7bf7ec 1d7bdd35
VUE_APP_CURRENTMODE = "development" VUE_APP_CURRENTMODE = "development"
VUE_APP_HOST_URL = "http://81.68.189.225:9091" VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_API_URL = "/"
VUE_APP_GDS_URL = "/gds"
VUE_APP_LOG = true VUE_APP_LOG = true
\ No newline at end of file
VUE_APP_CURRENTMODE = "production" VUE_APP_CURRENTMODE = "production"
VUE_APP_HOST_URL = "http://192.168.0.47:8090" VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_API_URL = "http://81.68.189.225:9091"
VUE_APP_GDS_URL = "http://data-studio.gds.org.cn"
VUE_APP_LOG = false VUE_APP_LOG = false
\ No newline at end of file
<template> <template>
<div id="app"> <div id="app">
<router-view></router-view> <router-view></router-view>
</div> </div>
</template> </template>
<script> <script>
export default {
created() {
console.log(process.env, 'process.env');
},
};
</script> </script>
<style> <style>
.container-fluid{ .container-fluid {
padding: 0 !important; padding: 0 !important;
} }
</style> </style>
import { // import {
GET // GET
} from "./fetch.js" // } from "./fetch.js"
import Vue from "vue";
import VueResource from 'vue-resource'
Vue.use(VueResource);
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : ''; const Prefix2 = process.env.NODE_ENV === 'development' ? '/gs1' : process.env.VUE_APP_API_URL;
/* 公共接口 */ /* 公共接口 */
// 首页大轮播图 // 首页大轮播图
const getCaptcha = (query = {}) => { const getCaptcha = (query = {}) => {
return GET(`${Prefix}/office/captcha.jpg`, query) return Vue.http.get(`${Prefix2}/office/captcha.jpg?uuid=${query.uuid}`, {
responseType: "blob",
})
} }
import home from "./module/home.js" import home from "./module/home.js"
import business from "./module/business.js" import business from "./module/business.js"
import search from "./module/search.js"
const api = { const api = {
home, home,
business, business,
search,
getCaptcha, getCaptcha,
} }
......
...@@ -18,7 +18,9 @@ import { ...@@ -18,7 +18,9 @@ import {
getToken getToken
} from "@/utils/cookie.js" } from "@/utils/cookie.js"
const baseUrl = process.env.BASE_URL const baseUrl = process.env.VUE_APP_API_URL;
console.log(process.env, baseUrl, 'baseUrl');
function fetch(options) { function fetch(options) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const instance = axios.create({ const instance = axios.create({
......
import {
POST
} from "../fetch.js"
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
// 条码查询—GLN查询/境外码查询
const searchGln = (params = {}) => {
return POST(`${Prefix}/office/codeSearch/api/gln`, params)
}
// 条码查询—缩短码查询
const searchGetList = (params = {}) => {
return POST(`${Prefix}/office/shortcode/api/getList`, params)
}
export default {
searchGln,
searchGetList,
}
import Vue from "vue" import Vue from "vue"
import { BlockRoleType } from "@/config/constant"
import store from "@/vuex/store";
Vue.directive("preventReClick",{ Vue.directive("preventReClick",{
inserted(el,binding){ inserted(el,binding){
...@@ -15,43 +11,6 @@ Vue.directive("preventReClick",{ ...@@ -15,43 +11,6 @@ Vue.directive("preventReClick",{
} }
}) })
Vue.directive("permission", {
bind(el, { value }) {
let isHas = false
const roleId = store.getters["user/userRole"];
// 设置业委会委员、会计、物业 需要管理员权限
if (value === 'block_set_comMember'
|| value === 'block_set_accountant'
|| value === 'block_set_servant') {
isHas = roleId === BlockRoleType.admin
}
// 会计有添加账号权限
if (value === 'account_add_balance') {
isHas = roleId === BlockRoleType.accountant
}
// 事项
if (value === 'matter_create_rectification' || value === 'matter_create_letter') {
isHas = roleId === BlockRoleType.comMember
}
if (value === 'matter_create'
|| value === 'matter_create_vote'
|| value === 'matter_create_vote-result'
|| value === 'matter_create_announce') {
isHas = roleId === BlockRoleType.comMember || roleId === BlockRoleType.temporal
}
setTimeout(() => {
if (!isHas) {
try {
el.parentNode.removeChild(el)
} catch (err) {
// console.log(err)
}
}
}, 200)
}
})
// 节流 // 节流
export function throttle(fn, interval) { export function throttle(fn, interval) {
let delay = interval || 1500 let delay = interval || 1500
let previous = 0 let previous = 0
return function() { return function () {
let now = Date.now() let now = Date.now()
let that = this let that = this
let args = arguments let args = arguments
if (now - previous > delay) { if (now - previous > delay) {
fn.apply(that, args) fn.apply(that, args)
previous = now previous = now
}
} }
}
} }
// 防抖 // 防抖
export function debounce(fn, interval) { export function debounce(fn, interval) {
let delay = interval || 1500 let delay = interval || 1500
let timer = null let timer = null
return function() { return function () {
let that = this let that = this
let args = arguments let args = arguments
timer && clearTimeout(timer) timer && clearTimeout(timer)
timer = setTimeout(function() { timer = setTimeout(function () {
fn.apply(that, args) fn.apply(that, args)
}, delay) }, delay)
} }
} }
var unique = 0; var unique = 0;
export function uuid(prefix) { export function uuid(prefix) {
const time = Date.now(); const time = Date.now();
const random = Math.floor(Math.random() * 1000000000); const random = Math.floor(Math.random() * 1000000000);
unique++; unique++;
return prefix + '_' + random + unique + String(time); return prefix + '_' + random + unique + String(time);
} }
// 一维数组转换成二维数组 // 一维数组转换成二维数组
export const groupList = (list, length) => { export const groupList = (list, length) => {
const pages = []; const pages = [];
list.forEach((item, index) => { list.forEach((item, index) => {
const page = Math.floor(index / length); const page = Math.floor(index / length);
if (!pages[page]) { if (!pages[page]) {
pages[page] = []; pages[page] = [];
} }
pages[page].push(item); pages[page].push(item);
}); });
return pages; return pages;
}; };
/** /**
* 获取uuid * 获取uuid
*/ */
export const getUUID = () => { export const getUUID = () => {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16) return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
}) })
} }
\ No newline at end of file \ No newline at end of file
...@@ -1009,7 +1009,8 @@ export default { ...@@ -1009,7 +1009,8 @@ export default {
}, },
// 商品全球身份证 // 商品全球身份证
async homeNewGtin() { async homeNewGtin() {
this.$http.get("/gds/Data/NewGtin").then((res) => { console.log(process.env, 'process.env');
this.$http.get(`${process.env.VUE_APP_GDS_URL}/Data/NewGtin`).then((res) => {
res.body.murl = `http://data-studio.gds.org.cn/${res.body.murl}`; res.body.murl = `http://data-studio.gds.org.cn/${res.body.murl}`;
res.body.surl = `http://data-studio.gds.org.cn/${res.body.surl}`; res.body.surl = `http://data-studio.gds.org.cn/${res.body.surl}`;
this.spqqsfz = res.body; this.spqqsfz = res.body;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-form-item label="验证码:"> <el-form-item label="验证码:">
<div class="y-center"> <div class="y-center">
<el-input <el-input
v-model="search.validate" v-model="search.captcha"
placeholder="请输入验证码" placeholder="请输入验证码"
class="w160" class="w160"
></el-input> ></el-input>
...@@ -121,8 +121,7 @@ export default { ...@@ -121,8 +121,7 @@ export default {
data() { data() {
return { return {
captchaPath: "", captchaPath: "",
uuid: "", search: { code: "", captcha: "", uuid: "" },
search: { code: "", validate: "" },
searchCodeShow: "", searchCodeShow: "",
showResult: false, showResult: false,
result: null, result: null,
...@@ -164,14 +163,14 @@ export default { ...@@ -164,14 +163,14 @@ export default {
methods: { methods: {
// 获取验证码 // 获取验证码
getCaptcha() { getCaptcha() {
this.uuid = getUUID(); this.search.uuid = getUUID();
this.$http const query = {
.get(`/gs1/office/captcha.jpg?uuid=${this.uuid}`, { uuid: this.search.uuid,
responseType: "blob", };
}) this.$api.getCaptcha(query).then((res) => {
.then((res) => { console.log(res, 'res');
this.captchaPath = window.URL.createObjectURL(res.body); this.captchaPath = window.URL.createObjectURL(res.body);
}); });
}, },
handleSearch() { handleSearch() {
this.searchCodeShow = this.search.code; this.searchCodeShow = this.search.code;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div class="search-content"> <div class="search-content">
<div class="title">GLN查询</div> <div class="title">GLN查询</div>
<div class="body"> <div class="body">
<div style="padding-top:20px"> <div style="padding-top: 20px">
<el-form label-position="left" label-width="180px" :model="search"> <el-form label-position="left" label-width="200px" :model="search">
<el-form-item label="参与方位置编码(GLN)查询:"> <el-form-item label="参与方位置编码(GLN)查询:">
<el-input <el-input
v-model="search.code" v-model="search.code"
...@@ -15,17 +15,17 @@ ...@@ -15,17 +15,17 @@
<el-form-item label="验证码:"> <el-form-item label="验证码:">
<div class="y-center"> <div class="y-center">
<el-input <el-input
v-model="search.validate" v-model="search.captcha"
placeholder="请输入验证码" placeholder="请输入验证码"
class="w160" class="w160"
></el-input> ></el-input>
<div class="validate-code"> <div class="validate-code">
<img src="../../assets/image/validate.jpg" alt="" /> <img :src="captchaPath" @click="getCaptcha()" alt="" />
</div> </div>
<el-button <el-button
style="margin-left:40px" style="margin-left: 40px"
type="primary" type="primary"
@click="handleSearch" @click="handleSearch"
>查询</el-button >查询</el-button
...@@ -53,20 +53,15 @@ ...@@ -53,20 +53,15 @@
<div class="content-wrapper"> <div class="content-wrapper">
<img src="./img/query-external-barcode.png" align="right" alt="" /> <img src="./img/query-external-barcode.png" align="right" alt="" />
<p> <p>
1、参与方位置编码(Global Location Number)是对参与供应链等活动的法律实体、功能实体和物理实体进行唯一标识的代码,用13位数字表示,主要应用于条码符号自动识别与数据采集和电子数据交换 1、参与方位置编码(Global Location
Number)是对参与供应链等活动的法律实体、功能实体和物理实体进行唯一标识的代码,用13位数字表示,主要应用于条码符号自动识别与数据采集和电子数据交换
</p> </p>
<p> <p>
2、当用条码符号表示参与方位置编码时,应与参与方位置编码应用标识符一起使用,如左图中的"410"代表"交货地"。 2、当用条码符号表示参与方位置编码时,应与参与方位置编码应用标识符一起使用,如左图中的"410"代表"交货地"。
</p> </p>
<p> <p>注:</p>
注: <p>3、法律实体是指合法存在的机构,如:供应商、客户、银行、承运商等。</p>
</p> <p>4、功能实体是指法律实体内的具体的部门,如:某公司的财务部。</p>
<p>
3、法律实体是指合法存在的机构,如:供应商、客户、银行、承运商等。
</p>
<p>
4、功能实体是指法律实体内的具体的部门,如:某公司的财务部。
</p>
<p> <p>
5、物理实体是指具体的位置,如:建筑物的某个房间、仓库或仓库的某个门、交货地等。 5、物理实体是指具体的位置,如:建筑物的某个房间、仓库或仓库的某个门、交货地等。
</p> </p>
...@@ -76,21 +71,45 @@ ...@@ -76,21 +71,45 @@
</template> </template>
<script> <script>
import { getUUID } from "@/utils/utils";
export default { export default {
data() { data() {
return { return {
search: { code: "", validate: "" }, captchaPath: '',
search: { code: "", captcha: "", type: "GLN", requestedLanguage: "en", uuid: ''},
searchCodeShow: "", searchCodeShow: "",
showResult: false, showResult: false,
result: null, result: null,
}; };
}, },
created() {
this.getCaptcha();
},
methods: { methods: {
handleSearch() { // 获取验证码
getCaptcha() {
this.search.uuid = getUUID();
const query = {
uuid: this.search.uuid,
};
this.$api.getCaptcha(query).then((res) => {
console.log(res, 'res');
this.captchaPath = window.URL.createObjectURL(res.body);
});
},
async handleSearch() {
this.searchCodeShow = this.search.code; this.searchCodeShow = this.search.code;
this.showResult = true; this.showResult = true;
if (this.search.code === "1") { const params = {...this.search};
this.result = {}; const searchGlnRes =
await this.$api.search.searchGln(params);
const { returnCode, data } = searchGlnRes;
console.log(searchGlnRes, 'searchGlnRes');
if (returnCode === "0") {
this.result = data;
} else {
this.result = null;
} }
}, },
}, },
......
import {
BlockRoleType,
BlockRoleNameFromType,
MatterType,
MatterStatusOwnerCode
} from "@/config/constant.js"
const getters = { const getters = {
// 用户id // 用户id
userId: state => { userId: state => {
...@@ -34,109 +27,6 @@ const getters = { ...@@ -34,109 +27,6 @@ const getters = {
const { userInfo } = state const { userInfo } = state
return Number(userInfo.roleId) return Number(userInfo.roleId)
}, },
userRoleName: state => {
const { userInfo } = state
return BlockRoleNameFromType(Number(userInfo.roleId))
},
isLoggedAdmin: state => {
const { userInfo } = state
return Number(userInfo.roleId) === BlockRoleType.admin
},
isCurrentBlockOnlyTemporal: state => {
const { userInfo } = state
return userInfo.blockName === '旭日爱上城6区'
},
isElementPermission: state => (value, data = null) => {
const { userInfo } = state
const roleId = Number(userInfo.roleId)
// const roleId = BlockRoleType.comMember
// 设置网格管理员
if (value === 'block_set_grid_manager') {
return roleId === BlockRoleType.admin
}
// 设置业委会委员、临管人员、会计、物业 需要管理员权限
if (value === 'block_set_comMember'
|| value === 'block_set_community'
|| value === 'block_set_management'
|| value === 'block_set_temporal'
|| value === 'block_set_accountant'
|| value === 'block_set_servant') {
if (roleId !== BlockRoleType.admin) {
return false
}
// 仅旭日爱上城6区需要设置临管人员
const { name } = data || {}
const block_xrasc6 = '旭日爱上城6区'
if (value === 'block_set_temporal') {
return name === block_xrasc6
}
if (value === 'block_set_comMember') {
return name !== block_xrasc6
}
return true
}
// 会计有添加账号权限
if (value === 'account_add_balance') {
return roleId === BlockRoleType.accountant
}
// 事项
if (value === 'matter_create') {
return (
roleId === BlockRoleType.comMember ||
roleId === BlockRoleType.temporal
)
}
if (value === 'matter_create_rectification' || value === 'matter_create_letter') {
return (
roleId === BlockRoleType.comMember ||
roleId === BlockRoleType.temporal
)
}
if (value === 'matter_create_vote'
|| value === 'matter_create_vote-result'
|| value === 'matter_create_announce') {
return (
roleId === BlockRoleType.comMember ||
roleId === BlockRoleType.temporal
)
}
if (value === 'matter_action_audit_approve' || value === 'matter_action_audit_reject') {
// 审核仅社区和物管办
const { status } = data || {}
const myStatus = Number(status)
return (roleId === BlockRoleType.community && myStatus === MatterStatusOwnerCode.communityInProgress) ||
(roleId === BlockRoleType.management && myStatus === MatterStatusOwnerCode.managementInProgress)
}
if (value === 'matter_action_reply_letter') {
// 已发布的公函,业委会需要进行回函
const { matterType, status, isLetters } = data || {}
const myMatterType = String(matterType)
const myStatus = Number(status)
return (
myMatterType === MatterType.letter &&
myStatus === MatterStatusOwnerCode.end &&
!isLetters &&
(roleId === BlockRoleType.comMember || roleId === BlockRoleType.temporal)
)
}
if (value === 'matter_action_accept_rectification') {
// 已发布的整改单,物业需要进行接收整改
const { matterType, status, isAccept } = data || {}
const myMatterType = String(matterType)
const myStatus = Number(status)
return (
myMatterType === MatterType.rectification &&
myStatus === MatterStatusOwnerCode.end &&
!isAccept &&
roleId === BlockRoleType.servant
)
}
if (value === 'matter_action_edit_tags') {
return false
}
return false
}
} }
export default getters export default getters
\ No newline at end of file
...@@ -10,10 +10,6 @@ const state = { ...@@ -10,10 +10,6 @@ const state = {
userInfo: storage.get("userInfo") || {}, userInfo: storage.get("userInfo") || {},
// 登录用户菜单列表 // 登录用户菜单列表
userMenus: storage.get("userMenus") || [], userMenus: storage.get("userMenus") || [],
// 账号交易类型列表
financeTypeList: storage.get("financeTypeList") || [],
// 当前所有小区的列表数据
allBlockList: storage.get("allBlockList") || [],
} }
export default state export default state
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment