Commit 2cf858d8 authored by 佟礼's avatar 佟礼

工艺规程语言包

parents 54aabd35 354e6256
...@@ -2,7 +2,7 @@ import request from '@/plugins/request'; ...@@ -2,7 +2,7 @@ import request from '@/plugins/request';
export function AccountLogin (data) { export function AccountLogin (data) {
return request({ return request({
url: '/api/login', url: `${authUrl}/api/services/app/auth/login`,
method: 'post', method: 'post',
data data
}); });
......
...@@ -500,6 +500,10 @@ export default { ...@@ -500,6 +500,10 @@ export default {
watch:{ watch:{
"data.length"(){ "data.length"(){
this.list=this.data; this.list=this.data;
},
"height"()
{
this.tableHeight=this.height;
} }
} }
} }
......
<template>
<Table :border="tbPro.isBorder" stripe :columns="tbPro.columns" :stripe="tbPro.stripe"
:data="tbPro.data" :highlight-row="tbPro.highlight" :loading="tbPro.loading" :height="tbPro.height" :content="tbPro.cur" @on-row-click="rowclick" class="tableCommon"></Table>
</template>
<script>
export default {
name:'tb',
props:[
//'columns1','data1','isBorder'
'tbPro'
],
methods:{
rowclick(rowdata,index){
this.$emit('rowclick',rowdata,index)
}
}
}
</script>
\ No newline at end of file
...@@ -1051,6 +1051,14 @@ export default { ...@@ -1051,6 +1051,14 @@ export default {
routing_header_id: '', routing_header_id: '',
comb_param: '', comb_param: '',
rule_qty: '', rule_qty: '',
taskSeq: '工序号',
efficiencyValue: '效率系数',
calId: '连班策略',
overTime: '六日加班',
isDiscrete: '是否离散',
multipleEquip: "是否多台安排设备",// 否 是
multipleEquipIds: "设备id", //用英文逗号分隔
discrete: '离散值',
}, },
routing_header:{ routing_header:{
id:'', id:'',
...@@ -1174,30 +1182,30 @@ export default { ...@@ -1174,30 +1182,30 @@ export default {
stepContent: '工步内容', stepContent: '工步内容',
extend: '扩展字段', extend: '扩展字段',
}, },
routing_qc_card:{ routing_qc_card: {
id:'', id: '',
creationTime:'创建时间', creationTime: '创建时间',
creatorUserId:'创建人', creatorUserId: '创建人',
lastModificationTime:'修改时间', lastModificationTime: '修改时间',
lastModifierUserId:'修改人', lastModifierUserId: '修改人',
isDeleted:'是否删除', isDeleted: '是否删除',
deleterUserId:'删除人', deleterUserId: '删除人',
deletionTime:'删除时间', deletionTime: '删除时间',
routingHeaderId:'工艺', routingHeaderId: '工艺',
routingDetailId:'工序', routingDetailId: '工序',
routingStepId:'工步', routingStepId: '工步',
checkContent:'检验内容', checkContent: '检验内容',
checkType:'检验标记', checkType: '检验标记',
checkParams:'参数名称', checkParams: '参数名称',
measurementUnit:'单位', measurementUnit: '单位',
fillintype:'汇报类型', fillintype: '汇报类型',
qualityTemplate:'模板', qualityTemplate: '模板',
isphotograph:'是否拍照', isphotograph: '是否拍照',
status:'状态', status: '状态',
extend:'扩展字段', extend: '扩展字段',
remark:'备注', remark: '备注',
productionRequirement:'生产要求', productionRequirement: '生产要求',
standard:'标准指标', standard: '标准指标',
qualityTemplateName:'模板文件名称', qualityTemplateName: '模板文件名称',
} }
} }
\ No newline at end of file
<template>
<Layout class="product-layout">
<Header>
<span class="menu">
<a class="home">
<Icon type="ios-keypad" />
<ul class="top-menu">
<li v-for="(item,i) in filterSider">
<ul>
<li class="title">{{item.title}}</li>
<li v-for="(li,j) in item.children">
<a>{{li.title}}</a>
</li>
</ul>
</li>
</ul>
</a>
</span>
<i-header-breadcrumb v-if="showBreadcrumb && !headerMenu && !isMobile" ref="breadcrumb" />
<i-header-search v-if="showSearch && !headerMenu && !isMobile && !showBreadcrumb" />
<div class="header-right">
<i-header-search
v-if="(showSearch && isMobile) || (showSearch && (headerMenu || showBreadcrumb))"
/>
<i-menu-head v-if="headerMenu && isMobile" />
<i-header-log v-if="isDesktop && showLog" />
<i-header-bug />
<i-header-fullscreen v-if="isDesktop && showFullscreen" />
<i-header-notice v-if="showNotice" />
<i-header-user />
<i-header-i18n v-if="showI18n" />
<i-header-setting v-if="enableSetting && !isMobile" />
</div>
</Header>
<Content class="i-layout-content">
<keep-alive :include="keepAlive">
<nuxt v-if="loadRouter" />
</keep-alive>
</Content>
</Layout>
</template>
<script>
import iMenuHead from "./menu-head";
import iMenuSide from "./menu-side";
import iHeaderLogo from "./header-logo";
import iHeaderCollapse from "./header-collapse";
import iHeaderReload from "./header-reload";
import iHeaderBreadcrumb from "./header-breadcrumb";
import iHeaderSearch from "./header-search";
import iHeaderLog from "./header-log";
import iHeaderBug from "./header-bug";
import iHeaderFullscreen from "./header-fullscreen";
import iHeaderNotice from "./header-notice";
import iHeaderUser from "./header-user";
import iHeaderI18n from "./header-i18n";
import iHeaderSetting from "./header-setting";
import iTabs from "./tabs";
import iCopyright from "@/components/copyright";
import { mapState, mapGetters, mapMutations } from "vuex";
import Setting from "@/setting";
import { requestAnimation } from "@/libs/util";
export default {
name: "ProductLayout",
components: {
iMenuHead,
iMenuSide,
iCopyright,
iHeaderLogo,
iHeaderCollapse,
iHeaderReload,
iHeaderBreadcrumb,
iHeaderSearch,
iHeaderUser,
iHeaderI18n,
iHeaderLog,
iHeaderFullscreen,
iHeaderSetting,
iHeaderNotice,
iTabs,
iHeaderBug
},
data() {
return {
showDrawer: false,
ticking: false,
headerVisible: true,
oldScrollTop: 0,
isDelayHideSider: false, // hack,当从隐藏侧边栏的 header 切换到正常 header 时,防止 Logo 抖动
loadRouter: true
};
},
computed: {
...mapState("admin/layout", [
"siderTheme",
"headerTheme",
"headerStick",
"tabs",
"tabsFix",
"siderFix",
"headerFix",
"headerHide",
"headerMenu",
"isMobile",
"isTablet",
"isDesktop",
"menuCollapse",
"showMobileLogo",
"showSearch",
"showNotice",
"showFullscreen",
"showSiderCollapse",
"showBreadcrumb",
"showLog",
"showI18n",
"showReload",
"enableSetting"
]),
...mapState("admin/page", ["keepAlive"]),
...mapGetters("admin/menu", ["hideSider", "filterSider"]),
// 如果开启 headerMenu,且当前 header 的 hideSider 为 true,则将顶部按 headerStick 处理
// 这时,即使没有开启 headerStick,仍然按开启处理
isHeaderStick() {
let state = this.headerStick;
if (this.hideSider) state = true;
return state;
},
showHeader() {
let visible = true;
if (this.headerFix && this.headerHide && !this.headerVisible)
visible = false;
return visible;
},
headerClasses() {
return [
`i-layout-header-color-${this.headerTheme}`,
{
"i-layout-header-fix": this.headerFix,
"i-layout-header-fix-collapse": this.headerFix && this.menuCollapse,
"i-layout-header-mobile": this.isMobile,
"i-layout-header-stick": this.isHeaderStick && !this.isMobile,
"i-layout-header-with-menu": this.headerMenu,
"i-layout-header-with-hide-sider":
this.hideSider || this.isDelayHideSider
}
];
},
headerStyle() {
const menuWidth = this.isHeaderStick
? 0
: this.menuCollapse
? 80
: Setting.menuSideWidth;
return this.isMobile || !this.headerFix
? {}
: {
width: `calc(100% - ${menuWidth}px)`
};
},
siderClasses() {
return {
"i-layout-sider-fix": this.siderFix,
"i-layout-sider-dark": this.siderTheme === "dark"
};
},
contentClasses() {
return {
"i-layout-content-fix-with-header": this.headerFix,
"i-layout-content-with-tabs": this.tabs,
"i-layout-content-with-tabs-fix": this.tabs && this.tabsFix
};
},
insideClasses() {
return {
"i-layout-inside-fix-with-sider": this.siderFix,
"i-layout-inside-fix-with-sider-collapse":
this.siderFix && this.menuCollapse,
"i-layout-inside-with-hide-sider": this.hideSider,
"i-layout-inside-mobile": this.isMobile
};
},
drawerClasses() {
let className = "i-layout-drawer";
if (this.siderTheme === "dark") className += " i-layout-drawer-dark";
return className;
},
menuSideWidth() {
return this.menuCollapse ? 80 : Setting.menuSideWidth;
}
},
watch: {
hideSider() {
this.isDelayHideSider = true;
setTimeout(() => {
this.isDelayHideSider = false;
}, 0);
},
$route(to, from) {
if (to.name === from.name) {
// 相同路由,不同参数,跳转时,重载页面
if (Setting.sameRouteForceUpdate) {
this.handleReload();
}
}
}
},
methods: {
...mapMutations("admin/layout", ["updateMenuCollapse"]),
...mapMutations("admin/page", ["keepAlivePush", "keepAliveRemove"]),
handleToggleDrawer(state) {
if (typeof state === "boolean") {
this.showDrawer = state;
} else {
this.showDrawer = !this.showDrawer;
}
},
handleScroll() {
if (!this.headerHide) return;
const scrollTop =
document.body.scrollTop + document.documentElement.scrollTop;
if (!this.ticking) {
this.ticking = true;
requestAnimation(() => {
if (this.oldScrollTop > scrollTop) {
this.headerVisible = true;
} else if (scrollTop > 300 && this.headerVisible) {
this.headerVisible = false;
} else if (scrollTop < 300 && !this.headerVisible) {
this.headerVisible = true;
}
this.oldScrollTop = scrollTop;
this.ticking = false;
});
}
},
handleHeaderWidthChange() {
const $breadcrumb = this.$refs.breadcrumb;
if ($breadcrumb) {
$breadcrumb.handleGetWidth();
$breadcrumb.handleCheckWidth();
}
const $menuHead = this.$refs.menuHead;
if ($menuHead) {
// todo $menuHead.handleGetMenuHeight();
}
},
handleReload() {
// 针对缓存的页面也生效
const isCurrentPageCache = this.keepAlive.indexOf(this.$route.name) > -1;
const pageName = this.$route.name;
if (isCurrentPageCache) {
this.keepAliveRemove(pageName);
}
this.loadRouter = false;
this.$nextTick(() => {
this.loadRouter = true;
if (isCurrentPageCache) {
this.keepAlivePush(pageName);
}
});
}
},
mounted() {
document.addEventListener("scroll", this.handleScroll, { passive: true });
},
beforeDestroy() {
document.removeEventListener("scroll", this.handleScroll);
},
created() {
if (this.isTablet && this.showSiderCollapse) this.updateMenuCollapse(true);
}
};
</script>
<style lang="less">
.product-layout {
.ivu-layout-header {
height: 50px;
line-height: 50px;
padding: 0;
.menu {
margin: 0 10px;
.home {
position: relative;
height: 30px;
width: 30px;
display: inline-block;
border-radius: 50%;
background: #2680eb;
color: white;
line-height: 30px;
text-align: center;
}
.top-menu {
display: none;
position: absolute;
z-index: 99999;
left: 70%;
top: 70%;
background: #f5f6fa;
border-radius: 4px;
min-width: 1800px;
min-height: 300px;
color: #2680eb;
list-style: none;
text-align: left;
li {
width: 100%;
display: block;
float: left;
ul {
width: 100%;
list-style: none;
li {
display: inline-block;
list-style: none;
margin-right: 10px;
width: 150px;
a{
display: inline-block;
padding: 0 10px;
height: 30px;
}
a:hover{
background: #2680EB;
color: white;
border-radius: 4px;
}
}
.title {
display: inline-block;
background: #515a6e;
width: 104px;
color: white;
text-align: center;
font-weight: bold;
height: 47px;
}
.title:hover{
color: #ddd;
}
}
}
}
.home:hover .top-menu {
display: block;
}
}
.ivu-breadcrumb {
height: 50px;
line-height: 50px;
}
}
.header-right {
float: right;
height: 50px;
color: white;
margin: 0;
.i-layout-header-trigger {
color: white;
height: 50px;
line-height: 50px;
}
.ivu-tooltip {
color: white;
height: 50px;
line-height: 50px;
}
}
}
</style>
\ No newline at end of file
...@@ -33,7 +33,6 @@ export default { ...@@ -33,7 +33,6 @@ export default {
}, },
mounted() { mounted() {
this.getMenu(); this.getMenu();
this.initUserInfo();
}, },
watch: { watch: {
// 监听路由 控制侧边栏显示 标记当前顶栏菜单(如需要) // 监听路由 控制侧边栏显示 标记当前顶栏菜单(如需要)
...@@ -66,29 +65,7 @@ export default { ...@@ -66,29 +65,7 @@ export default {
} }
}, },
methods: { methods: {
//获取用户基本信息
initUserInfo() {
let userInfo = this.$store.state.admin.user.info;
let parma = {
Id: userInfo.userId
};
this.$http.sysUser.getuserinfo(parma).then(res => {
if (res.result) {
if (
res.result.avatarUrl &&
res.result.avatarUrl != "" &&
res.result.avatarUrl != null
) {
res.result.avatarUrl = fileUrlDown + res.result.avatarUrl;
}
this.$store.commit("admin/user/setUserAvatar", res.result);
} else {
this.$Message.error("用户信息查询失败!");
}
});
},
//用户中心结束
//menu
getMenu() { getMenu() {
this.$http.sysUser.getusermenu().then(res => { this.$http.sysUser.getusermenu().then(res => {
if (res.result) { if (res.result) {
......
<template>
<Layout class="i-layout">
<Header>
<i-header-breadcrumb v-if="showBreadcrumb && !headerMenu && !isMobile" ref="breadcrumb" />
<div class="i-layout-header-right">
<i-header-search v-if="(showSearch && isMobile) || (showSearch && (headerMenu || showBreadcrumb))" />
<i-header-log v-if="isDesktop && showLog" />
<i-header-bug />
<i-header-fullscreen v-if="isDesktop && showFullscreen" />
<i-header-notice v-if="showNotice" />
<i-header-user />
<i-header-i18n v-if="showI18n" />
<i-header-setting v-if="enableSetting && !isMobile" />
</div>
</Header>
<Content> <nuxt v-if="loadRouter"/></Content>
</Layout>
</template>
\ No newline at end of file
<template> <template>
<div class="account"> <div class="account">
<Carousel v-model="value1" autoplay autoplay-speed="5000" loop class="zmd"> <Carousel v-model="value1" autoplay :autoplay-speed="5000" loop class="zmd">
<CarouselItem> <CarouselItem>
<div class="bg bg0">1</div> <div class="bg bg0">1</div>
</CarouselItem> </CarouselItem>
...@@ -29,17 +29,16 @@ ...@@ -29,17 +29,16 @@
<!-- <div class="page-account-top-desc tc">SaaS MES 制造执行系统</div> --> <!-- <div class="page-account-top-desc tc">SaaS MES 制造执行系统</div> -->
</div> </div>
<h3 class="mb20">用户登陆</h3> <h3 class="mb20">用户登陆</h3>
<Login @on-submit="oidc"> <Login @on-submit="handleSubmit">
<UserName name="username" value="admin" /> <UserName name="username" value="13211111111" />
<Password name="password" value="admin" enter-to-submit /> <Password name="password" value="1" enter-to-submit />
<div class="page-account-auto-login mb20"> <div class="page-account-auto-login mb20">
<Checkbox v-model="autoLogin" >{{ $t('page.login.remember') }}</Checkbox> <Checkbox v-model="autoLogin">{{ $t('page.login.remember') }}</Checkbox>
<a href>{{ $t('page.login.forgot') }}</a> <a href>{{ $t('page.login.forgot') }}</a>
</div> </div>
<div class="mt20"> <div class="mt20">
<Submit class="shadown">{{ $t('page.login.submit') }}</Submit> <Submit class="shadown">{{ $t('page.login.submit') }}</Submit>
</div> </div>
</Login> </Login>
</div> </div>
</div> </div>
...@@ -58,6 +57,7 @@ export default { ...@@ -58,6 +57,7 @@ export default {
components: { iCopyright }, components: { iCopyright },
data() { data() {
return { return {
value1: 0,
autoLogin: true autoLogin: true
}; };
}, },
...@@ -66,34 +66,6 @@ export default { ...@@ -66,34 +66,6 @@ export default {
}, },
methods: { methods: {
...mapActions("admin/account", ["login"]), ...mapActions("admin/account", ["login"]),
oidc() {
let that = this;
mgr.getUser().then(function(user) {
if (user) {
console.info("user",user)
that.msg = "该用户已经登录";
const userInfos = {
token: user.access_token,
login_id: user.profile.name,
userId:
user.profile[
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"
],
accountId: user.profile.sub,
tanantCode: user.profile.TanantCode,
name: "Aresn",
avatar:
"https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar",
access: ["admin"]
};
// that.$store.commit('setUserInfo',userInfos);
that.oidcLogin(userInfos);
window.location = "/";
} else {
mgr.signinRedirect();
}
});
},
/** /**
* @description 登录 * @description 登录
* 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档 * 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档
...@@ -104,26 +76,50 @@ export default { ...@@ -104,26 +76,50 @@ export default {
this.login({ this.login({
username, username,
password password
}).then(() => { }).then(r => {
// 重定向对象不存在则返回顶层路径 if (r > 0) {
this.$router.replace(this.$route.query.redirect || "/"); this.$Message.success("登陆成功!");
this.initUserInfo(r);
} else {
this.$Message.error("登陆失败!");
}
}); });
} }
}, },
oidcLogin(user) { initUserInfo(id) {
util.cookies.set("uuid", user.userId); let parma = {
util.cookies.set("token", user.token); Id: id
// 设置 vuex 用户信息 };
this.$store.dispatch("admin/user/set", user, { root: true }); this.$http.sysUser.getuserinfo(parma).then(res => {
// 用户登录后从持久化数据加载一系列的设置 if (res.result) {
this.$store.dispatch("load"); if (
this.$store.commit("setUserInfo", user); res.result.avatarUrl &&
res.result.avatarUrl != "" &&
res.result.avatarUrl != null
) {
res.result.avatarUrl = fileUrlDown + res.result.avatarUrl;
}
let info = res.result;
info.auth = ["admin"];
info.avatar = info.avatarUrl;
info.userId=info.id;
info.name=info.userName;
this.$store.dispatch("admin/user/set", info, {
root: true
});
// setUserInfo
this.$store.commit("setUserInfo",info)
this.$router.replace(this.$route.query.redirect || "/");
} else {
this.$Message.error("用户信息22查询失败!");
}
});
} }
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
@jianju:40px; @jianju: 40px;
.account { .account {
position: fixed; position: fixed;
width: 100%; width: 100%;
...@@ -160,30 +156,31 @@ export default { ...@@ -160,30 +156,31 @@ export default {
left: @jianju; left: @jianju;
right: @jianju; right: @jianju;
bottom: @jianju; bottom: @jianju;
background: rgba(38,128,235, 0.3); background: rgba(38, 128, 235, 0.3);
display: flex; display: flex;
.ad{ .ad {
flex: 1; flex: 1;
text-align: center; text-align: center;
img{margin-top: 400px;} img {
margin-top: 400px;
}
} }
.login { .login {
background-color: white; background-color: white;
width: 600px; width: 600px;
padding: 150px 90px; padding: 150px 90px;
// background-image: url("../../../assets/images/login/33.png"); // background-image: url("../../../assets/images/login/33.png");
// background-repeat: no-repeat; // background-repeat: no-repeat;
// background-position-y: 525px; // background-position-y: 525px;
.ivu-input-wrapper { .ivu-input-wrapper {
margin-bottom: 5px; margin-bottom: 5px;
} }
.mt20{ .mt20 {
margin-top: 50px; margin-top: 50px;
.shadown{ .shadown {
box-shadow: 1px 5px 15px #2680EB; box-shadow: 1px 5px 15px #2680eb;
} }
.ivu-btn-large{ .ivu-btn-large {
height: 50px !important; height: 50px !important;
} }
} }
......
...@@ -11,33 +11,36 @@ ...@@ -11,33 +11,36 @@
<span slot="close">Off</span> <span slot="close">Off</span>
</i-switch> </i-switch>
</FormItem> </FormItem>
<FormItem :label="l('cal_id')" prop="cal_id"> <FormItem :label="l('calId')" prop="calId">
<Select v-model="entity.cal_id" style="width:150px"> <Select v-model="entity.calId" style="width:150px">
<Option value="beijing">策略1</Option> <Option
<Option value="shanghai">策略2</Option> v-for="(item,index) in listCal"
<Option value="shenzhen">策略3</Option> :key="index"
:value="item.calid"
:label="item.calname"
></Option>
</Select> </Select>
</FormItem> </FormItem>
<FormItem :label="l('over_time')" prop="over_time"> <FormItem :label="l('overTime')" prop="overTime">
<i-switch v-model="entity.over_time" size="large"> <i-switch v-model="entity.overTime" size="large">
<span slot="open">On</span> <span slot="open">On</span>
<span slot="close">Off</span> <span slot="close">Off</span>
</i-switch> </i-switch>
</FormItem> </FormItem>
<FormItem :label="l('efficiency_value')" prop="efficiency_value"> <FormItem :label="l('efficiencyValue')" prop="efficiencyValue">
<Input v-model="entity.efficiency_value" style="width:150px"></Input> <Input v-model="entity.efficiencyValue" style="width:150px"></Input>
</FormItem> </FormItem>
<FormItem :label="l('run_time')" prop="run_time"> <FormItem :label="l('run_time')" prop="run_time">
<InputNumber v-model="entity.run_time"></InputNumber> <InputNumber v-model="entity.run_time"></InputNumber>
</FormItem> </FormItem>
<FormItem :label="l('isdiscrete')" prop="isdiscrete"> <FormItem :label="l('isDiscrete')" prop="isDiscrete">
<i-switch v-model="entity.isdiscrete" size="large"> <i-switch v-model="entity.isDiscrete" size="large">
<span slot="open">On</span> <span slot="open">On</span>
<span slot="close">Off</span> <span slot="close">Off</span>
</i-switch> </i-switch>
</FormItem> </FormItem>
<FormItem :label="l('discrete_value')" prop="discrete_value"> <FormItem :label="l('discrete')" prop="discrete">
<InputNumber v-model="entity.discrete_value"></InputNumber> <InputNumber v-model="entity.discrete"></InputNumber>
</FormItem> </FormItem>
<FormItem :label="l('discrete_percent')" prop="discrete_percent"> <FormItem :label="l('discrete_percent')" prop="discrete_percent">
<InputNumber v-model="entity.discrete_percent"></InputNumber> <InputNumber v-model="entity.discrete_percent"></InputNumber>
...@@ -83,7 +86,7 @@ ...@@ -83,7 +86,7 @@
</Dropdown> </Dropdown>
</div> </div>
<div class="slider"> <div class="slider">
<Slider v-model="entity.value1" :step="25" show-stops></Slider> <Slider v-model="entity.level" :step="20" show-stops></Slider>
<div class="slow"></div> <div class="slow"></div>
<div class="fast"></div> <div class="fast"></div>
</div> </div>
...@@ -109,11 +112,15 @@ ...@@ -109,11 +112,15 @@
</Col> </Col>
</Row> </Row>
<FormItem label="班组结构"> <FormItem label="班组结构">
<Select v-model="entity.select6" style="width:150px"> <Select v-model="entity.shopId" placeholder="请选择" style="width:150px" prop="shopId">
<Option value="beijing">结构1</Option> <Option
<Option value="shanghai">结构2</Option> v-for="(item,index) in list"
<Option value="shenzhen">结构3</Option> :key="index"
<Option value="shenzhen">结构4</Option> :value="item.value"
:label="item.title"
style="display:none"
></Option>
<Tree key="mytree" :data="data1" ref="mytree" :render="renderContent"></Tree>
</Select> </Select>
</FormItem> </FormItem>
<div class="check-box"> <div class="check-box">
...@@ -150,40 +157,119 @@ ...@@ -150,40 +157,119 @@
</div> </div>
</template> </template>
<script> <script>
import Api from "./api";
export default { export default {
data() { data() {
return { return {
entity: { entity: {
value1:100, flog: 0, //参数应用
value2:100, planMethod: "转序规则", // 平行 重叠
shopId: null,
level: 100,
value2: 100,
fruit: [] fruit: []
}, },
list: [],
data1: [],
listCal: [],
visible: false, visible: false,
rules: { rules: {
businessName: [{ required: true, message: '必填', trigger: 'blur' }], businessName: [{ required: true, message: "必填", trigger: "blur" }],
businessCode: [{ required: true, message: '必填', trigger: 'blur' }] businessCode: [{ required: true, message: "必填", trigger: "blur" }]
} }
} };
},
mounted() {
this.getCal(); //获取连班策略
this.apsGet(); //获取参数级别和转序等的关系
this.initTree(); //获取当前登录人所在车间下的所有部门
}, },
methods: { methods: {
handleSubmit() {}, getCal() {
Api.getallcal().then(res => {
if (res.success) {
this.listCal = res.result;
}
});
},
apsGet() {
Api.apsGetall().then(res => {
// if (res.success) {
// }
});
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
Api.apsschedulupdateparameter(this.entity).then(res => {
if (res.success) {
}
});
} else {
this.$Message.error("Fail!");
}
});
},
initTree() {
var sumData = [];
Api.userdepartmentsofworkshop()
.then(r => {
if (r.result) {
this.data1 = r.result;
} else {
this.$Message.error("加载部门失败!");
}
})
.catch(err => {});
},
renderContent(h, { root, node, data }) {
//渲染树的样式
return h(
"span",
{
style: {
cursor: "pointer"
},
on: {
click: () => {
this.handleSelect(data); //手动选择树节点
}
}
},
data.title
);
},
handleSelect(data) {
let obj = {
label: data.title,
value: data.value
};
this.list = [];
this.list.push(obj);
alert(this.list[0].value)
this.entity.shopId = this.list[0].value;
},
handleClose() { handleClose() {
this.$emit("on-close") this.$emit("on-close");
}, },
handleOpen() { handleOpen() {
this.visible = true this.visible = true;
}, },
handle() { handle() {
this.visible = false this.visible = false;
}, },
handleOk() {}, handleOk() {},
l(key) { l(key) {
let vkey = 'mes_op_task_plan_simulate' + '.' + key let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.parameter { .parameter {
...@@ -262,7 +348,7 @@ export default { ...@@ -262,7 +348,7 @@ export default {
color: #2680eb; color: #2680eb;
} }
.check-box { .check-box {
height: 300px; height: 348px;
border-top: 1px solid #e0e0e0; border-top: 1px solid #e0e0e0;
padding: 15px; padding: 15px;
padding-left: 0; padding-left: 0;
...@@ -271,7 +357,7 @@ export default { ...@@ -271,7 +357,7 @@ export default {
} }
} }
.right-down { .right-down {
height: 100px; height: 92px;
} }
.click-btn { .click-btn {
text-align: right; text-align: right;
......
...@@ -53,7 +53,35 @@ export default { ...@@ -53,7 +53,35 @@ export default {
return Api.post(`${apsUrl}/apspoolappservices/processschemedispatch`, params); return Api.post(`${apsUrl}/apspoolappservices/processschemedispatch`, params);
}, },
//APS排产前数据合法性校验 //APS排产前数据合法性校验
recoveryoptasksimluate(params) { apsdatachecked(params) {
return Api.post(`${apsUrl}/apspoolappservices/apsdatachecked`, params); return Api.post(`${apsUrl}/apspoolappservices/apsdatachecked`, params);
}, },
//获取连班策略
getallcal(params) {
return Api.get(`${apsUrl}/mes_daily_work_sched/getallcal`, params);
},
//工序参数调整
apsschedulupdateparameter(params) {
return Api.post(`${apsUrl}/ser/apsschedulupdateparameter`, params);
},
//获取参数级别和转序等的关系
apsGetall(params) {
return Api.get(`${apsUrl}/apsparaconfig/getall`, params);
},
//获取所在班组的设备或根据设备类型过滤
getequiplist(params) {
return Api.get(`${apsUrl}/mes_equip_info/getequiplist`, params);
},
//获取当前登录人所在车间下的所有部门
userdepartmentsofworkshop(params) {
return Api.get(`${systemUrl}/user/userdepartmentsofworkshop`, params);
},
//获取班组 /mes_equip_info/getequiptypelist
getUserDepart(params) {
return Api.get(`${systemUrl}/user/userdepartmentsofworkshop`, params);
},
//获取设备
getEquiptypeList(params) {
return Api.get(`${apsUrl}/mes_equip_info/getequiptypelist`, params);
},
} }
...@@ -11,37 +11,50 @@ ...@@ -11,37 +11,50 @@
<Input></Input> <Input></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('sHOPID')" prop="sHOPID"> <FormItem label="班组" prop="sHOPID">
<!-- v-model="orderSearchForm.orderCat" --> <!-- v-model="orderSearchForm.orderCat" -->
<Select > <Select v-model="entity.department_id">
<Option value="" class="option-text">请选择</Option> <Option
<Option v-for="item in orderCatList" :value="item" :key="item">{{ item }}</Option> v-for="(item,index) in list"
:key="index"
:value="item.value"
style="display:none"
:label="item.label"
></Option>
<Tree key="mytree" :data="orderCatList" ref="mytree" :render="renderContent"></Tree>
<!-- <Option v-for="(item,index) in orderCatList" :value="item.title" :key="index">{{ item.title }}</Option> -->
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('eQUIPID')" prop="eQUIPID"> <FormItem label="首选设备" prop="eQUIPID">
<Select > <Select placeholder="编号 / 名称">
<Option value="" class="option-text">请选择</Option> <Option value="" class="option-text">编号 / 名称</Option>
<Option v-for="item in orderCatList" :value="item" :key="item">{{ item }}</Option> <Option v-for="(item,index) in equiptypeList" :value="item.id" :key="index">{{ item.equipTypeName }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <!-- <Col :span="12">
<FormItem label="关重资源名称" prop="rUNTIME"> <FormItem label="资源名称" prop="rUNTIME">
<Select > <Select >
<Option value="" class="option-text">请选择</Option> <Option value="" class="option-text">请选择</Option>
<Option v-for="item in orderCatList" :value="item" :key="item">{{ item }}</Option> <Option v-for="item in orderCatList" :value="item" :key="item">{{ item }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col> -->
<Col :span="12"> <Col :span="12">
<FormItem :label="l('rUNTIME')" prop="rUNTIME"> <FormItem :label="l('rUNTIME')" prop="rUNTIME">
<!-- v-model="value1" --> <!-- v-model="value1" -->
<InputNumber :max="100" :min="1"></InputNumber> <InputNumber :max="100" :min="1"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12">
<FormItem>
<!-- v-model="single" -->
<Checkbox> 是否同步到原始工艺</Checkbox>
</FormItem>
</Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
...@@ -56,20 +69,26 @@ export default { ...@@ -56,20 +69,26 @@ export default {
data() { data() {
return { return {
disabled: false, disabled: false,
entity: {}, entity: {
orderCatList:[ department_id: null, //班组
},
], list:[],
selectdata: [],
orderCatList:[],//班组
equiptypeList:[],//设备
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: '必填', trigger: 'blur' }]
} }
} }
}, },
props: { props: {
eid: Number eid: Number,
},
created() {
// this.getUserDepart()
}, },
methods: { methods: {
load(v) { load() {
// Api.get({ id: v }).then((r) => { // Api.get({ id: v }).then((r) => {
// this.entity = r.result // this.entity = r.result
// this.$emit('on-load') // this.$emit('on-load')
...@@ -97,6 +116,41 @@ export default { ...@@ -97,6 +116,41 @@ export default {
} }
}) })
}, },
renderContent(h, { root, node, data }) {
//渲染树的样式
return h(
"span",
{
style: {
// color: data.isProduct != "1" ? "#249E91" : "#333", //根据选中状态设置样式
cursor: "pointer"
},
on: {
click: () => {
let arrTree = [];
arrTree.push(data);
this.handleSelect(arrTree); //手动选择树节点
}
}
},
data.title
);
},
handleSelect(data) {
if (data.length > 0) {
this.selectdata = [];
this.selectdata = data;
this.list = [];
this.list.push({ label: data[0].title, value: data[0].id });
// if (data[0].isProduct == "1") {
// this.orderSearchForm.productName = data[0].title;
// this.orderSearchForm.productId = data[0].productId;
// this.orderSearchForm.drawnNumber = data[0].drawingNo;
// } else {
// this.$Message.error("此节点不是产品,请选择产品节点!");
// }
}
},
handleClose() { handleClose() {
this.$emit('on-close') this.$emit('on-close')
}, },
......
...@@ -10,13 +10,11 @@ ...@@ -10,13 +10,11 @@
:border="false" :border="false"
:data="data1" :data="data1"
:page="false" :page="false"
:height="gridHeight"
></DataGrid> ></DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800"> <Modal v-model="editModal" title="编辑" footer-hide width="800">
<Edit :eid="curId" @on-close="cancel" /> <Edit ref="editPart" :eid="curId" @on-close="cancel" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal> </Modal>
<Modal v-model="insertlModal" title="插单" @on-ok="insertOk" @on-cancel="cancel"> <Modal v-model="insertlModal" title="插单" @on-ok="insertOk" @on-cancel="cancel">
<p>确定进行 {{insertTItle}} 操作?</p> <p>确定进行 {{insertTItle}} 操作?</p>
...@@ -51,10 +49,10 @@ export default { ...@@ -51,10 +49,10 @@ export default {
setParsModal: false, setParsModal: false,
editModal: false, editModal: false,
detailModal: false, detailModal: false,
deletelModal: false,
insertlModal: false, insertlModal: false,
rowIndex: null, rowIndex: null,
curId: 0, curId: 0,
gridHeight: 50,
columns: [ columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{ title: " ", width: 130 }, { title: " ", width: 130 },
...@@ -301,6 +299,7 @@ export default { ...@@ -301,6 +299,7 @@ export default {
attrs: { attrs: {
icon: "md-options", icon: "md-options",
type: "icon", type: "icon",
oprate: "detail",
title: "工序参数设置" title: "工序参数设置"
}, },
on: { click: () => this.openParms(params.row.id) } on: { click: () => this.openParms(params.row.id) }
...@@ -323,14 +322,15 @@ export default { ...@@ -323,14 +322,15 @@ export default {
oprate: "delete", oprate: "delete",
msg: "确认要刪除工序吗?" msg: "确认要刪除工序吗?"
}, },
on: { click: () => this.remove(params.row.id, params.index) } on: { click: () => this.remove(params.row, params.index) }
}) })
]); ]);
} }
} }
], ],
data1: [], data1: [],
insertTItle: "插单" insertTItle: "插单",
selectRoutingDetail: {} //需那种工序
}; };
}, },
mounted() { mounted() {
...@@ -344,9 +344,11 @@ export default { ...@@ -344,9 +344,11 @@ export default {
loadData(expendId) { loadData(expendId) {
let params = { let params = {
id: expendId id: expendId
} };
Api.getbyorderid(params).then((res) => { Api.getbyorderid(params).then(res => {
if (res.success) { if (res.success) {
this.gridHeight = 50;
this.gridHeight = (res.result.length +1) * 48;
this.data1 = res.result; this.data1 = res.result;
} }
}); });
...@@ -388,29 +390,42 @@ export default { ...@@ -388,29 +390,42 @@ export default {
edit(id) { edit(id) {
this.editModal = true; this.editModal = true;
this.curId = Number(id); this.curId = Number(id);
this.getUserDepart()
this.getEquiptypeList()
},
// 获取班组
getUserDepart(){
Api.getUserDepart().then(res=>{
console.log(res.result)
this.$refs.editPart.orderCatList = res.result
})
},
// 获取设备
getEquiptypeList(){
Api.getEquiptypeList().then(res=>{
console.log("设备",res.result)
this.$refs.editPart.equiptypeList = res.result
})
}, },
//编辑工序end---- //编辑工序end----
//删除工序事件start----- //删除工序事件start-----
remove(id, index) { remove(row, index) {
this.deletelModal = true; //this.curId = Number(id);
this.curId = Number(id);
this.rowIndex = index; this.rowIndex = index;
this.selectRoutingDetail = row;
let params = {
partPk: this.selectRoutingDetail.part_task_pk,
detailIdstr: this.selectRoutingDetail.routing_detail_id
};
Api.removeoptasksimluate(params).then(r => {
if (r.success) {
this.$Message.success("删除成功");
this.data1.splice(this.rowIndex, 1);
}
});
}, },
removeOk() {
alert(this.rowIndex);
this.data1.splice(this.rowIndex, 1);
// Api.delete({ id: this.curId }).then((r) => {
// if (r.success) {
// this.$refs.grid.load()
// this.deletelModal = false
// this.$Message.success('删除成功')
// }
// })
},
removeCancel() {
this.deletelModal = false;
},
//删除工序时间end----- //删除工序时间end-----
cancel() { cancel() {
this.curId = 0; this.curId = 0;
......
...@@ -8,16 +8,22 @@ ...@@ -8,16 +8,22 @@
:high="false" :high="false"
@on-drag-drop="onDragDrop" @on-drag-drop="onDragDrop"
:page="false" :page="false"
@on-select="onSelect" @on-selection-change="onSelect"
:batch="true" :batch="true"
:border="false" :border="false"
:easy="false" :easy="false"
> >
<template slot="easySearch"></template> <template slot="easySearch"></template>
<template slot="searchBack"> <template slot="searchBack">
<Select placeholder="选择历史方案" style="width: 150px"></Select> <Select placeholder="选择历史方案" style="width: 150px;"></Select>
<DatePicker type="date" placeholder="设置基准日期" style="width: 150px"></DatePicker> <DatePicker
<a style="font-weight:bold" @click="addModal=true"> type="date"
placeholder="设置基准日期"
style="width: 150px"
v-model="entity.setTime"
@on-change="getTime"
></DatePicker>
<a style="font-weight:bold;" @click="addModal=true">
<Icon type="ios-options" size="14" />&nbsp;工序参数调整 <Icon type="ios-options" size="14" />&nbsp;工序参数调整
</a> </a>
</template> </template>
...@@ -28,13 +34,13 @@ ...@@ -28,13 +34,13 @@
<Button type="primary" @click="apsModal=true">APS排产</Button> <Button type="primary" @click="apsModal=true">APS排产</Button>
</template> </template>
<template slot="batch"> <template slot="batch">
<Button type="primary" class="mr10 ml10">移出排产</Button> <Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000"> <Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
<Add @on-close="cancel" @on-ok="addOk" /> <Add @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="apsModal" title="确定APS排产" @on-ok="removeOk" @on-cancel="cancel"> <Modal v-model="apsModal" title="确定APS排产" @on-ok="apsOk" @on-cancel="cancel">
<p>确定进行APS排产?</p> <p>确定进行APS排产?</p>
</Modal> </Modal>
</div> </div>
...@@ -55,6 +61,9 @@ export default { ...@@ -55,6 +61,9 @@ export default {
easySearch: { easySearch: {
keys: { op: "notes", value: null } keys: { op: "notes", value: null }
}, },
entity: {
setTime: ""
},
addModal: false, addModal: false,
editModal: false, editModal: false,
detailModal: false, detailModal: false,
...@@ -123,7 +132,10 @@ export default { ...@@ -123,7 +132,10 @@ export default {
key: "priority", key: "priority",
title: this.l("priority"), title: this.l("priority"),
align: "left", align: "left",
high: true high: true,
render: (h, params) => {
return h("span", {}, params.index + 1);
}
}, },
{ {
key: "plan_qty", key: "plan_qty",
...@@ -209,7 +221,7 @@ export default { ...@@ -209,7 +221,7 @@ export default {
oprate: "delete", oprate: "delete",
msg: "确认要移出排产吗?" msg: "确认要移出排产吗?"
}, },
on: { click: () => this.remove(params.row.id) } on: { click: () => this.remove(params.row.part_task_pk) }
}), }),
h("op", { h("op", {
attrs: { attrs: {
...@@ -219,12 +231,13 @@ export default { ...@@ -219,12 +231,13 @@ export default {
oprate: "delete", oprate: "delete",
msg: "确认要恢复工序吗?" msg: "确认要恢复工序吗?"
}, },
on: { click: () => this.remove(params.row.id) } on: { click: () => this.refresh(params.row.part_task_pk) }
}) })
]); ]);
} }
} }
] ],
arrPartPkId: []
}; };
}, },
mounted() { mounted() {
...@@ -240,7 +253,8 @@ export default { ...@@ -240,7 +253,8 @@ export default {
if (res.success) { if (res.success) {
this.list = res.result; this.list = res.result;
} }
}); });
}, },
addOk() { addOk() {
this.$refs.grid.load(); this.$refs.grid.load();
...@@ -257,21 +271,49 @@ export default { ...@@ -257,21 +271,49 @@ export default {
this.editModal = true; this.editModal = true;
this.curId = id; this.curId = id;
}, },
refresh(partPkId) {
remove(id) { //恢复工序
this.deletelModal = true; let params = {
this.curId = id; id: partPkId
};
Api.recoveryoptasksimluate(params).then(r => {
if (r.success) {
this.$Message.success("恢复成功");
this.list = [];
this.loadList();
}
});
}, },
onSelect(a, b) {}, remove(partPkId) {
removeOk() { //移出排产池
Api.delete({ id: this.curId }).then(r => { let paramsArry = [];
if (partPkId.constructor == Array) {
paramsArry = partPkId;
} else {
paramsArry.push(partPkId);
}
let params = {
partPks: paramsArry
};
Api.shiftoutapspool(params).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$Message.success("移出排产池操作成功");
this.deletelModal = false; this.loadList();
this.$Message.success("删除成功");
} }
}); });
}, },
onSelect(a, b) {
//批量选择
let selectRows = a;
this.arrPartPkId = [];
selectRows.forEach(e => {
this.arrPartPkId.push(e.part_task_pk);
});
},
removeOk() {
//批量选择移出排产池
this.remove(this.arrPartPkId);
},
removeCancel() { removeCancel() {
this.deletelModal = false; this.deletelModal = false;
}, },
...@@ -289,9 +331,58 @@ export default { ...@@ -289,9 +331,58 @@ export default {
openParms(id) { openParms(id) {
this.addModal = true; this.addModal = true;
}, },
getUserDepart(){
alert("5656565")
// Api.getUserDepart().then(res=>{
// console.log("11111",res)
// return res
// })
},
l(key) { l(key) {
let vkey = "mes_part_task_plan_simulate" + "." + key; let vkey = "mes_part_task_plan_simulate" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
},
getTime(value) {
this.entity.getTime = value;
},
//a确定aps排产
apsOk() {
//APS排产前订单优先级功能
let parmsOrderpriority = { alls: [] };
let arryIds = [];
this.list.forEach((e, index) => {
let objIds = {};
objIds.orderId = e.part_task_pk;
objIds.priority = index + 1;
arryIds.push(objIds);
});
parmsOrderpriority.alls = arryIds;
// alert(JSON.stringify(parmsOrderpriority));
Api.orderpriority(parmsOrderpriority).then(res => {
if (res.success) {
if (res.result) {
this.$Message.success("排序成功");
//apsp排产前检查
Api.apsdatachecked().then(res1 => {
if (res1.success) {
if (res1.result.res) {
this.$Message.success("数据校验成功");
} else {
this.$Message.success("数据校验失败");
}
} else {
this.$Message.error("操作失败:数据校验");
}
});
} else {
this.$Message.error("排序失败,请重新APS排产操作");
}
} else {
this.$Message.error("操作失败:排序");
}
});
//APS排产前数据合法性校验
} }
} }
}; };
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
} }
.dispatch_part{ .dispatch_part{
border: 1px solid #ccc; border: 1px solid #ccc;
height: 100%;
.dispatch_part_top{ .dispatch_part_top{
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
......
...@@ -433,6 +433,7 @@ export default { ...@@ -433,6 +433,7 @@ export default {
.then(r => { .then(r => {
if (r.success) { if (r.success) {
this.$Message.success("移入排产成功"); this.$Message.success("移入排产成功");
this.$refs.grid.reload(this.easySearch);
} else { } else {
this.$Message.error("移入排产失败"); this.$Message.error("移入排产失败");
} }
......
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
// index: `${apsResult}/scheduletotal/getall`, // index: `${apsUrl}/scheduletotal/getall`,
paged(params) { paged(params) {
return Api.get(`${apsResult}/scheduletotal/getall`, params); return Api.get(`${apsUrl}/scheduletotal/getall`, params);
}, },
getall(params) { getall(params) {
return Api.get(`${apsResult}/schema/getall`, params); return Api.get(`${apsUrl}/schema/getall`, params);
}, },
clearall(params) { clearall(params) {
return Api.post(`${apsResult}/schema/clearall`, params); return Api.post(`${apsUrl}/schema/clearall`, params);
}, },
getdetail(params) { getdetail(params) {
return Api.get(`${apsResult}/scheduletotal/getdetail`, params); return Api.get(`${apsUrl}/scheduletotal/getdetail`, params);
}, },
} }
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<Input <Input
v-model="formValidate.parameters" v-model="formValidate.parameters"
type="textarea" type="textarea"
rows="3" :rows="3"
style="width:634px;" style="width:634px;"
></Input> ></Input>
</FormItem> </FormItem>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<Input <Input
v-model="formValidate.exception" v-model="formValidate.exception"
type="textarea" type="textarea"
rows="3" :rows="3"
style="width:634px;" style="width:634px;"
></Input> ></Input>
</FormItem> </FormItem>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
ref="grid" ref="grid"
:action="action" :action="action"
:conditions="easySearch" :conditions="easySearch"
placeholder="请输入姓名或者员工编号进行搜索" placeholder="请输入姓名/员工编号"
:high="true" :high="true"
:height="tdHeight" :height="tdHeight"
> >
...@@ -126,6 +126,7 @@ import Edit from "./edit"; ...@@ -126,6 +126,7 @@ import Edit from "./edit";
import Detail from "./detail"; import Detail from "./detail";
import Search from "./search"; import Search from "./search";
import service from "@/plugins/request"; import service from "@/plugins/request";
import util from '@/libs/util';
export default { export default {
name: "list", name: "list",
components: { components: {
...@@ -451,7 +452,7 @@ export default { ...@@ -451,7 +452,7 @@ export default {
let parms = { let parms = {
userId: this.curId, userId: this.curId,
accountId: this.selectRow.accountId, accountId: this.selectRow.accountId,
tanantCode: this.$store.state.userInfo.tanantCode, tanantCode: util.cookies.get('tanantCode'),
isDeleted: true isDeleted: true
}; };
Api.authAccount(parms).then(res => { Api.authAccount(parms).then(res => {
...@@ -604,7 +605,7 @@ export default { ...@@ -604,7 +605,7 @@ export default {
userId: this.selectRow.id, userId: this.selectRow.id,
loginName: this.selectRow.phone, loginName: this.selectRow.phone,
status: this.selectRow.status, status: this.selectRow.status,
tanantCode: this.$store.state.userInfo.tanantCode tanantCode:util.cookies.get('tanantCode'),
}; };
if (this.selectRow.phone && this.selectRow.phone != "") { if (this.selectRow.phone && this.selectRow.phone != "") {
Api.authAccount(parms).then(res => { Api.authAccount(parms).then(res => {
......
<template> <template>
<div> <div>
<Card style="width:350px;float:left"> <Card class="img_top01">
<p slot="title">个人头像</p> <p slot="title">个人头像</p>
<div style="height:415px;"> <div style="height:415px;">
<p style="text-align:center;padding-top:100px;"> <p style="text-align:center;padding-top:100px;">
...@@ -267,8 +267,17 @@ export default { ...@@ -267,8 +267,17 @@ export default {
}; };
</script> </script>
<style lang="less" > <style lang="less" >
.ivu-card-body { .img_top01{
padding: 0px; width:350px;
float:left;
.ivu-card-body {
padding: 0px;
}
}
.user_info_right{
.ivu-card-body {
padding: 0px;
}
} }
.ivu-tabs-nav-scroll { .ivu-tabs-nav-scroll {
background: #f5f6fa; background: #f5f6fa;
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
padding : 8px 15px; padding : 8px 15px;
border-bottom: 1px solid #e4e6ed; border-bottom: 1px solid #e4e6ed;
position : relative; position : relative;
height: 46px;
} }
.state { .state {
......
...@@ -169,8 +169,8 @@ export default { ...@@ -169,8 +169,8 @@ export default {
}, },
formcontextdata: { formcontextdata: {
measures:'', measures:'',
triaLevel:'', triaLevel:[],
conclusion:'', conclusion:[],
causeAnalysis:'', causeAnalysis:'',
}, },
formcontextclosedata: formcontextclosedata:
......
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"><template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字数据源名称/服务器地址/用户名" v-model="easySearch.keys.value" /> </FormItem> <DataGrid :columns="columns" ref="grid" :action="action"><template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入数据源/服务器/用户" class="w200" v-model="easySearch.keys.value" /> </FormItem>
<FormItem><Button type="primary" @click="search">查询</Button></FormItem> <FormItem><Button type="primary" @click="search">查询</Button></FormItem>
</Form></template> </Form></template>
<template slot="searchForm"> <template slot="searchForm">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入关键字公司名称/公司编码" v-model="easySearch.keys.value" /> <Input placeholder="请输入公司名称/公司编码" v-model="easySearch.keys.value" class="w200"/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
......
...@@ -94,7 +94,7 @@ Vue.component("DTSpan", DTSpan) ...@@ -94,7 +94,7 @@ Vue.component("DTSpan", DTSpan)
Vue.component("DTSearch", DTSearch) Vue.component("DTSearch", DTSearch)
//注入mock //注入mock
require("../mock") // require("../mock")
Vue.prototype.$api=request; Vue.prototype.$api=request;
Vue.prototype.$http=Api; Vue.prototype.$http=Api;
Vue.prototype.$u = Henq; Vue.prototype.$u = Henq;
......
...@@ -13,6 +13,14 @@ function errorCreate (msg) { ...@@ -13,6 +13,14 @@ function errorCreate (msg) {
// 记录和显示错误 // 记录和显示错误
function errorLog (err) { function errorLog (err) {
if(err&&err.response&&err.response.status==500){
console.log(err.response)
Message.error({
content: err.response.data.error.message,
duration: 5
})
return;
}
// 添加到日志 // 添加到日志
$nuxt.$store.dispatch('admin/log/push', { $nuxt.$store.dispatch('admin/log/push', {
message: '数据请求异常', message: '数据请求异常',
...@@ -28,18 +36,18 @@ function errorLog (err) { ...@@ -28,18 +36,18 @@ function errorLog (err) {
console.log(err); console.log(err);
} }
// 显示提示,可配置使用 iView 的 $Message 还是 $Notice 组件来显示 // 显示提示,可配置使用 iView 的 $Message 还是 $Notice 组件来显示
if (Setting.errorModalType === 'Message') { // if (Setting.errorModalType === 'Message') {
Message.error({ // Message.error({
content: err.message, // content: err.message,
duration: Setting.modalDuration // duration: Setting.modalDuration
}); // });
} else if (Setting.errorModalType === 'Notice') { // } else if (Setting.errorModalType === 'Notice') {
Notice.error({ // Notice.error({
title: '提示', // title: '提示',
desc: err.message, // desc: err.message,
duration: Setting.modalDuration // duration: Setting.modalDuration
}); // });
} // }
} }
// 创建一个 axios 实例 // 创建一个 axios 实例
...@@ -83,7 +91,7 @@ service.interceptors.request.use( ...@@ -83,7 +91,7 @@ service.interceptors.request.use(
}, },
error => { error => {
// 发送失败 // 发送失败
console.log(error); // console.log(error);
Promise.reject(error); Promise.reject(error);
} }
); );
...@@ -132,7 +140,7 @@ service.interceptors.response.use( ...@@ -132,7 +140,7 @@ service.interceptors.response.use(
case 505: error.message = 'HTTP版本不受支持'; break; case 505: error.message = 'HTTP版本不受支持'; break;
default: break; default: break;
} }
} }
errorLog(error); errorLog(error);
// console.warn("Erro:",error) // console.warn("Erro:",error)
return Promise.reject(error); return Promise.reject(error);
......
...@@ -3,138 +3,165 @@ ...@@ -3,138 +3,165 @@
* */ * */
import util from '@/libs/util'; import util from '@/libs/util';
// import router from '@/router'; // import router from '@/router';
import { AccountLogin, AccountRegister } from '@/api/account'; import {
import Oidc from 'oidc-client' AccountLogin,
import { Modal } from 'view-design'; AccountRegister
export const actions={ } from '@/api/account';
/** import {
* @description 登录 Modal
* @param {Object} param context } from 'view-design';
* @param {Object} param username {String} 用户账号 export const actions = {
* @param {Object} param password {String} 密码 /**
* @param {Object} param route {Object} 登录成功后定向的路由对象 任何 vue-router 支持的格式 * @description 登录
*/ * @param {Object} param context
login ({ dispatch }, { * @param {Object} param username {String} 用户账号
username = '', * @param {Object} param password {String} 密码
password = '' * @param {Object} param route {Object} 登录成功后定向的路由对象 任何 vue-router 支持的格式
} = {}) { */
return new Promise((resolve, reject) => { login({
// 开始请求登录接口 dispatch
AccountLogin({ }, {
username, username = '',
password password = ''
}) } = {}) {
.then(async res => { return new Promise((resolve, reject) => {
// 设置 cookie 一定要存 uuid 和 token 两个 cookie // 开始请求登录接口
// 整个系统依赖这两个数据进行校验和存储 AccountLogin({
// uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复 username,
// token 代表用户当前登录状态 建议在网络请求中携带 token password
// 如有必要 token 需要定时更新,默认保存一天,可在 setting.js 中修改 })
// 如果你的 token 不是通过 cookie 携带,而是普通字段,也可视情况存储在 localStorage .then(async res => {
console.warn(res); // 设置 cookie 一定要存 uuid 和 token 两个 cookie
util.cookies.set('uuid', res.uuid); // 整个系统依赖这两个数据进行校验和存储
util.cookies.set('token', res.token); // uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复
// 设置 vuex 用户信息 // token 代表用户当前登录状态 建议在网络请求中携带 token
await dispatch('admin/user/set', res.info, { root: true }); // 如有必要 token 需要定时更新,默认保存一天,可在 setting.js 中修改
// 用户登录后从持久化数据加载一系列的设置 // 如果你的 token 不是通过 cookie 携带,而是普通字段,也可视情况存储在 localStorage
await dispatch('load'); console.warn(res);
// 结束 if (res.result) {
resolve();
})
.catch(err => {
// console.log('err: ', err);
reject(err);
})
})
},
/**
* @description 退出登录
* */
logout ({ commit, dispatch }, { confirm = false, vm } = {}) {
var mgr = new Oidc.UserManager(window.authConfig)
async function logout () {
// 删除cookie
util.cookies.remove('token');
util.cookies.remove('uuid');
// 清空 vuex 用户信息
await dispatch('admin/user/set', {}, { root: true });
// 跳转路由
// alert(123)
window.frames[0].sessionStorage.clear()
sessionStorage.clear()
mgr.events.addUserSignedOut(function() {
log('User signed out of OP')
mgr.removeUser()
})
$nuxt.$router.push("/account/login");
}
if (confirm) { util.cookies.set('uuid', res.result.userId);
Modal.confirm({ util.cookies.set('tanantCode', res.result.tanantCode);
title: vm.$t('basicLayout.logout.confirmTitle'), util.cookies.set('token', res.result.accessToken);
content: vm.$t('basicLayout.logout.confirmContent'), sessionStorage.setItem('token', res.result.accessToken)
onOk () { // // 设置 vuex 用户信息
logout(); // await dispatch('admin/user/set', res.info, {
} // root: true
}); // });
} else { // // 用户登录后从持久化数据加载一系列的设置
logout(); // await dispatch('load');
} // 结束
}, resolve(res.result.userId);
/** } else {
* @description 注册 resolve();
* @param {Object} param context }
* @param {Object} param mail {String} 邮箱
* @param {Object} param password {String} 密码 })
* @param {Object} param mobile {String} 手机号码 .catch(err => {
* @param {Object} param captcha {String} 验证码 // console.log('err: ', err);
*/ reject(err);
register ({ dispatch }, { })
mail = '', })
password = '', },
mobile = '', /**
captcha = '' * @description 退出登录
} = {}) { * */
return new Promise((resolve, reject) => { logout({
// 开始请求登录接口 commit,
AccountRegister({ dispatch
mail, }, {
password, confirm = false,
mobile, vm
captcha } = {}) {
}) async function logout() {
.then(async res => { // 删除cookie
// 注册成功后,完成与登录一致的操作 util.cookies.remove('token');
// 注册也可视情况不返还 uuid、token 等数据,在注册完成后,由前端自动执行一次登录逻辑 util.cookies.remove('uuid');
util.cookies.set('uuid', res.uuid); // 清空 vuex 用户信息
util.cookies.set('token', res.token); await dispatch('admin/user/set', {}, {
// 设置 vuex 用户信息 root: true
await dispatch('admin/user/set', res.info, { root: true }); });
// 用户登录后从持久化数据加载一系列的设置 sessionStorage.clear();
await dispatch('load'); localStorage.clear();
// 结束 $nuxt.$router.push("/account/login");
resolve(); }
})
.catch(err => { if (confirm) {
// console.log('err: ', err); Modal.confirm({
reject(err); title: vm.$t('basicLayout.logout.confirmTitle'),
}) content: vm.$t('basicLayout.logout.confirmContent'),
}) onOk() {
}, logout();
/**
* @description 用户登录后从持久化数据加载一系列的设置
* @param {Object} state vuex state
* @param {Object} dispatch vuex dispatch
*/
load ({ state, dispatch }) {
return new Promise(async resolve => {
// 加载用户登录信息
await dispatch('admin/user/load', null, { root: true });
// 持久化数据加载上次退出时的多页列表
await dispatch('admin/page/openedLoad', null, { root: true });
// end
resolve();
})
} }
} });
\ No newline at end of file } else {
logout();
}
},
/**
* @description 注册
* @param {Object} param context
* @param {Object} param mail {String} 邮箱
* @param {Object} param password {String} 密码
* @param {Object} param mobile {String} 手机号码
* @param {Object} param captcha {String} 验证码
*/
register({
dispatch
}, {
mail = '',
password = '',
mobile = '',
captcha = ''
} = {}) {
return new Promise((resolve, reject) => {
// 开始请求登录接口
AccountRegister({
mail,
password,
mobile,
captcha
})
.then(async res => {
// 注册成功后,完成与登录一致的操作
// 注册也可视情况不返还 uuid、token 等数据,在注册完成后,由前端自动执行一次登录逻辑
util.cookies.set('uuid', res.uuid);
util.cookies.set('token', res.token);
// 设置 vuex 用户信息
await dispatch('admin/user/set', res.info, {
root: true
});
// 用户登录后从持久化数据加载一系列的设置
await dispatch('load');
// 结束
resolve();
})
.catch(err => {
// console.log('err: ', err);
reject(err);
})
})
},
/**
* @description 用户登录后从持久化数据加载一系列的设置
* @param {Object} state vuex state
* @param {Object} dispatch vuex dispatch
*/
load({
state,
dispatch
}) {
return new Promise(async resolve => {
// 加载用户登录信息
await dispatch('admin/user/load', null, {
root: true
});
// 持久化数据加载上次退出时的多页列表
await dispatch('admin/page/openedLoad', null, {
root: true
});
// end
resolve();
})
}
}
...@@ -41,8 +41,8 @@ export const mutations={ ...@@ -41,8 +41,8 @@ export const mutations={
}, },
setUserInfo(state, userInfo) { setUserInfo(state, userInfo) {
state.userInfo = userInfo; state.userInfo = userInfo;
sessionStorage.setItem("userInfo", JSON.stringify(userInfo)); // sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
sessionStorage.setItem("token", userInfo.token); // sessionStorage.setItem("token", userInfo.token);
}, },
addUser(state,user){ addUser(state,user){
state.userMap.push(user); state.userMap.push(user);
......
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