Commit 50175133 authored by 骆瑛's avatar 骆瑛

Merge branch 'portal' of http://git.mes123.com/zhouyx/mes-ui into portal

parents 8940cc3a 255462d1
...@@ -285,6 +285,13 @@ html body { ...@@ -285,6 +285,13 @@ html body {
.pl20 { .pl20 {
padding-left: 20px padding-left: 20px
} }
.pr10 {
padding-right: 10px
}
.pr20 {
padding-right: 20px
}
.bnone { .bnone {
border: none; border: none;
...@@ -698,7 +705,18 @@ i.icon-gengxin { ...@@ -698,7 +705,18 @@ i.icon-gengxin {
.tc { .tc {
text-align: center; text-align: center;
} }
.lt30
{
line-height: 30px;
}
.lt40
{
line-height: 40px;
}
.lt50
{
line-height: 50px;
}
/*清除浮动*/ /*清除浮动*/
......
...@@ -102,6 +102,7 @@ export default { ...@@ -102,6 +102,7 @@ export default {
treeData: [], //物料数据 treeData: [], //物料数据
codeRuleData: [], //物料编码 codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程 routingHeaderData: [], //工艺规程
allUser: []
}; };
}, },
props: { props: {
...@@ -277,6 +278,7 @@ export default { ...@@ -277,6 +278,7 @@ export default {
//this.getTreeData(); //this.getTreeData();
//this.getcodeRuleData(); //this.getcodeRuleData();
//this.getRoutingHeaderData(); //this.getRoutingHeaderData();
this.getAllUser()
}, },
methods: { methods: {
//数据加载 //数据加载
...@@ -477,6 +479,36 @@ export default { ...@@ -477,6 +479,36 @@ export default {
this.footerToolbar = false; this.footerToolbar = false;
this.$refs.table.selectAll(false); this.$refs.table.selectAll(false);
}, },
//获取所有用户信息
getAllUser() {
this.$api.post(`${systemUrl}/user/paged`, {
conditions: [],
pageIndex: 1,
pageSize: 100000,
})
.then((r) => {
if (r.success) {
let tempUserInfo = r.result.items
tempUserInfo.forEach(ele => {
let temObj = {
userId: ele.id,
name: ele.userName
}
this.allUser.push(temObj)
})
}
})
},
getUserName(id) {
let name = ''
this.allUser.forEach(ele => {
if (id == ele.userId) {
name = ele.name
}
})
return name
},
//导出excel //导出excel
export2Excel() { export2Excel() {
...@@ -516,10 +548,13 @@ export default { ...@@ -516,10 +548,13 @@ export default {
}; };
this.$api.post(this.action, searchs).then((r) => { this.$api.post(this.action, searchs).then((r) => {
let list = []; let list = [];
list = r.result.items; if (r.success) {
list = r.result.items || [];
}
const tHeader = []; // 设置Excel的表格第一行的标题 const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性 const filterVal = []; //list里对象的属性
var tempCol = []; var tempCol = [];
var tempColUser = [];
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => { columnsCur.forEach((el) => {
if ( if (
...@@ -535,19 +570,64 @@ export default { ...@@ -535,19 +570,64 @@ export default {
code: el.code, code: el.code,
}); //临时存放code数据字典的字段及对应的数据字典code }); //临时存放code数据字典的字段及对应的数据字典code
} }
if (el.type && el.type == "user") {
tempColUser.push({
key: el.key,
code: el.type,
}); //临时存放user列
}
tHeader.push(el.title); tHeader.push(el.title);
filterVal.push(el.key); filterVal.push(el.key);
} }
}); });
list.forEach((e) => { list.forEach((e) => {
//给导出数据增加数据字典对应的name //给导出数据增加数据字典对应的name
tempCol.forEach((ele) => { // tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName( // e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code), // this.$store.getters.dictionaryByKey(ele.code),
e[ele.key] // e[ele.key]
// );
// });
tempCol.forEach((elem) => {
if (
e[elem.key] &&
e[elem.key] != "" &&
e[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = e[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
e[elem.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(elem.code),
e[elem.key]
); );
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirName(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
e[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
}); });
tempColUser.forEach(eluser => {
if (
e[eluser.key] &&
e[eluser.key] != "" &&
e[eluser.key] != null
) {
e[eluser.key] = this.getUserName(e[eluser.key])
}
})
}); });
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
...@@ -560,7 +640,6 @@ export default { ...@@ -560,7 +640,6 @@ export default {
); );
}); });
}, },
}, },
computed: { computed: {
columnsNow() { columnsNow() {
......
...@@ -251,12 +251,34 @@ export default { ...@@ -251,12 +251,34 @@ export default {
} }
arrTitleUse.forEach((elem) => { arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) { if (
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值 eles[elem.key] &&
eles[elem.key] != "" &&
eles[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = eles[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
eles[elem.key] = this.$u.dirCode( eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code), this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key] eles[elem.key]
); );
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirCode(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
eles[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
} }
}); });
......
This diff is collapsed.
...@@ -1177,6 +1177,8 @@ export default { ...@@ -1177,6 +1177,8 @@ export default {
requestUrl: '服务地址', requestUrl: '服务地址',
requestParam: '参数', requestParam: '参数',
exception: '异常详细信息', exception: '异常详细信息',
remark:'备注'
}, },
user_message_config: { user_message_config: {
creationTime: '创建时间', creationTime: '创建时间',
......
<template> <template>
<span class="i-layout-header-trigger i-layout-header-trigger-min"> <span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-i18n" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick"> <Dropdown transfer :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-i18n" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
<Icon type="md-globe" /> <Icon type="md-globe" />
<DropdownMenu slot="list"> <DropdownMenu slot="list">
<DropdownItem v-for="(item, key) in languages" :key="key" :name="key" :selected="locale === key"> <DropdownItem v-for="(item, key) in languages" :key="key" :name="key" :selected="locale === key">
...@@ -8,15 +8,19 @@ ...@@ -8,15 +8,19 @@
</DropdownItem> </DropdownItem>
</DropdownMenu> </DropdownMenu>
</Dropdown> </Dropdown>
</span> </span>
</template> </template>
<script> <script>
import Languages from '@/i18n/locale'; import Languages from '@/i18n/locale';
import { mapState, mapActions } from 'vuex'; import {
mapState,
mapActions
} from 'vuex';
export default { export default {
name: 'iHeaderI18n', name: 'iHeaderI18n',
data () { data() {
return { return {
languages: Languages languages: Languages
} }
...@@ -33,10 +37,13 @@ ...@@ -33,10 +37,13 @@
...mapActions('admin/i18n', [ ...mapActions('admin/i18n', [
'setLocale' 'setLocale'
]), ]),
handleClick (locale) { handleClick(locale) {
if (locale === this.locale) return; if (locale === this.locale) return;
this.setLocale({ locale, vm: this }); this.setLocale({
} locale,
vm: this
});
} }
} }
}
</script> </script>
<template> <template>
<span class="i-layout-header-trigger i-layout-header-trigger-min"> <span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown <Dropdown transfer :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-user" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
:trigger="isMobile ? 'click' : 'hover'"
class="i-layout-header-user"
:class="{ 'i-layout-header-user-mobile': isMobile }"
@on-click="handleClick"
>
<Avatar size="small" :src="info.avatar" v-if="info.avatar" /> <Avatar size="small" :src="info.avatar" v-if="info.avatar" />
<Avatar size="small" style="background-color: #87d068" icon="ios-person" v-else-if="!info.avatar" /> <Avatar size="small" style="background-color: #87d068" icon="ios-person" v-else-if="!info.avatar" />
<span class="i-layout-header-user-name" v-if="!isMobile">{{ info.name }}</span> <span class="i-layout-header-user-name" v-if="!isMobile">{{ info.name }}</span>
...@@ -28,10 +23,14 @@ ...@@ -28,10 +23,14 @@
</DropdownItem> </DropdownItem>
</DropdownMenu> </DropdownMenu>
</Dropdown> </Dropdown>
</span> </span>
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex"; import {
mapState,
mapActions
} from "vuex";
export default { export default {
name: "iHeaderUser", name: "iHeaderUser",
......
...@@ -4943,7 +4943,7 @@ ...@@ -4943,7 +4943,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.14.1", "version": "2.14.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.14.1.tgz", "resolved": "https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz",
"integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao=" "integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
} }
} }
...@@ -5472,7 +5472,7 @@ ...@@ -5472,7 +5472,7 @@
}, },
"crc-32": { "crc-32": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "http://r.cnpmjs.org/crc-32/download/crc-32-1.2.0.tgz", "resolved": "https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz",
"integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=", "integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
"requires": { "requires": {
"exit-on-epipe": "~1.0.1", "exit-on-epipe": "~1.0.1",
...@@ -7369,7 +7369,7 @@ ...@@ -7369,7 +7369,7 @@
}, },
"exit-on-epipe": { "exit-on-epipe": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "http://r.cnpmjs.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz", "resolved": "https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI=" "integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
}, },
"expand-brackets": { "expand-brackets": {
...@@ -8020,7 +8020,7 @@ ...@@ -8020,7 +8020,7 @@
}, },
"frac": { "frac": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "http://r.cnpmjs.org/frac/download/frac-1.1.2.tgz", "resolved": "https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz",
"integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs=" "integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
}, },
"fragment-cache": { "fragment-cache": {
...@@ -15097,7 +15097,7 @@ ...@@ -15097,7 +15097,7 @@
}, },
"printj": { "printj": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "http://r.cnpmjs.org/printj/download/printj-1.1.2.tgz", "resolved": "https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz",
"integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI=" "integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
}, },
"private": { "private": {
...@@ -20550,7 +20550,7 @@ ...@@ -20550,7 +20550,7 @@
}, },
"script-loader": { "script-loader": {
"version": "0.7.2", "version": "0.7.2",
"resolved": "http://r.cnpmjs.org/script-loader/download/script-loader-0.7.2.tgz", "resolved": "https://registry.npm.taobao.org/script-loader/download/script-loader-0.7.2.tgz",
"integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=", "integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -21138,7 +21138,7 @@ ...@@ -21138,7 +21138,7 @@
}, },
"ssf": { "ssf": {
"version": "0.10.3", "version": "0.10.3",
"resolved": "http://r.cnpmjs.org/ssf/download/ssf-0.10.3.tgz", "resolved": "https://registry.npm.taobao.org/ssf/download/ssf-0.10.3.tgz",
"integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=", "integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=",
"requires": { "requires": {
"frac": "~1.1.2" "frac": "~1.1.2"
...@@ -23805,7 +23805,7 @@ ...@@ -23805,7 +23805,7 @@
}, },
"wmf": { "wmf": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "http://r.cnpmjs.org/wmf/download/wmf-1.0.2.tgz", "resolved": "https://registry.npm.taobao.org/wmf/download/wmf-1.0.2.tgz",
"integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto=" "integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
}, },
"word-wrap": { "word-wrap": {
...@@ -23960,7 +23960,7 @@ ...@@ -23960,7 +23960,7 @@
}, },
"xlsx": { "xlsx": {
"version": "0.15.6", "version": "0.15.6",
"resolved": "http://r.cnpmjs.org/xlsx/download/xlsx-0.15.6.tgz", "resolved": "https://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1597272342311&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.15.6.tgz",
"integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=", "integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=",
"requires": { "requires": {
"adler-32": "~1.2.0", "adler-32": "~1.2.0",
...@@ -23975,7 +23975,7 @@ ...@@ -23975,7 +23975,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.17.1", "version": "2.17.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.17.1.tgz", "resolved": "https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz",
"integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78=" "integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
} }
} }
......
...@@ -85,14 +85,14 @@ export default { ...@@ -85,14 +85,14 @@ export default {
}).then(r => { }).then(r => {
if (r > 0) { if (r > 0) {
this.$Message.success("登陆成功!"); this.$Message.success("登陆成功!");
this.initUserInfo(r); this.initUserInfo(r, tenantcode);
} else { } else {
this.$Message.error("登陆失败!"); this.$Message.error("登陆失败!");
} }
}); });
} }
}, },
initUserInfo(id) { initUserInfo(id, tenantCode) {
let parma = { let parma = {
Id: id Id: id
}; };
...@@ -106,8 +106,7 @@ export default { ...@@ -106,8 +106,7 @@ export default {
res.result.avatarUrl = fileUrlDown + res.result.avatarUrl; res.result.avatarUrl = fileUrlDown + res.result.avatarUrl;
} }
let info = res.result; let info = res.result;
info.tenantCode = info.tenantCode = tenantCode;
info.auth = ["admin"];
info.avatar = info.avatarUrl; info.avatar = info.avatarUrl;
info.userId = info.id; info.userId = info.id;
info.name = info.userName; info.name = info.userName;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('departcode')"> <FormItem :label="l('departcode')" prop="departcode">
<Input v-model="entity.departcode" placeholder="请输入..."></Input> <Input v-model="entity.departcode" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
...@@ -20,10 +20,9 @@ ...@@ -20,10 +20,9 @@
</Col>--> </Col>-->
<Col :span="12"> <Col :span="12">
<FormItem :label="l('upMent')"> <FormItem :label="l('upMent')">
<b>{{entity.name}}</b> <b>{{ entity.name }}</b>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('cityName')"> <FormItem :label="l('cityName')">
<Cascader :data="citys" v-model="location"></Cascader> <Cascader :data="citys" v-model="location"></Cascader>
...@@ -44,7 +43,9 @@ ...@@ -44,7 +43,9 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
<!-- 组织类型 --> <!-- 组织类型 -->
...@@ -63,6 +64,18 @@ export default { ...@@ -63,6 +64,18 @@ export default {
name: "Add", name: "Add",
// components: { OrganizType }, // components: { OrganizType },
data() { data() {
const validateCode = (rule, value, callback) => {
if (!value) {
return callback(new Error("编号不能为空"));
}
Api.isExist(value).then((r) => {
if (r.result) {
return callback(new Error("编号已经存在"));
} else {
callback();
}
});
};
return { return {
// showTree: false, //组织类型 // showTree: false, //组织类型
disabled: false, disabled: false,
...@@ -73,33 +86,37 @@ export default { ...@@ -73,33 +86,37 @@ export default {
organization_Id: 0, organization_Id: 0,
organization_Type: "", organization_Type: "",
departcode: "", departcode: "",
name:'', name: "",
}, },
property: [], property: [],
location: [], location: [],
rules: { rules: {
title02: [ title02: [
{ required: true, message: "库位名不能为空", trigger: "blur" } { required: true, message: "库位名不能为空", trigger: "blur" },
], ],
organizationType: [ organizationType: [
{ {
required: true, required: true,
message: "组织类型不能为空", message: "组织类型不能为空",
trigger: "blur" trigger: "blur",
} },
] ],
} departcode: [
{ required: true, message: "编码不能为空", trigger: "blur" },
{ validator: validateCode, trigger: "blur" },
],
},
}; };
}, },
props: { props: {
val: Object val: Object,
}, },
created() { created() {
// this.entity = {}; // this.entity = {};
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs["form"].validate(value => { this.$refs["form"].validate((value) => {
if (value) { if (value) {
let isProduction = 0; let isProduction = 0;
let property = []; let property = [];
...@@ -120,18 +137,18 @@ export default { ...@@ -120,18 +137,18 @@ export default {
} }
let location = this.location; let location = this.location;
let paramsdata = { let paramsdata = {
parentTitle:this.entity.name, parentTitle: this.entity.name,
name: this.entity.title02, //部门名称 name: this.entity.title02, //部门名称
parent_Id: this.entity.id, //上级部门 [id] parent_Id: this.entity.id, //上级部门 [id]
code: this.entity.departcode, //部门编号 code: this.entity.departcode, //部门编号
// organization_Id: this.entity.organization_Id, //组织类型 [id] // organization_Id: this.entity.organization_Id, //组织类型 [id]
location: location.join(","), //省市县 location: location.join(","), //省市县
isProduction:isProduction, //是否生产班组:1是,0否 isProduction: isProduction, //是否生产班组:1是,0否
property: property.join(",") //属性 property: property.join(","), //属性
}; };
Api.create(paramsdata) Api.create(paramsdata)
.then(r => { .then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功!"); this.$Message.success("保存成功!");
...@@ -140,7 +157,7 @@ export default { ...@@ -140,7 +157,7 @@ export default {
this.$Message.error("保存失败,请联系管理员"); this.$Message.error("保存失败,请联系管理员");
} }
}) })
.catch(err => { .catch((err) => {
this.disabled = false; this.disabled = false;
this.$Message.error("保存失败,请联系管理员"); this.$Message.error("保存失败,请联系管理员");
}); });
...@@ -156,7 +173,7 @@ export default { ...@@ -156,7 +173,7 @@ export default {
l(key) { l(key) {
key = "DipartLocation" + "." + key; key = "DipartLocation" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
val(v) { val(v) {
...@@ -164,7 +181,7 @@ export default { ...@@ -164,7 +181,7 @@ export default {
this.entity = {}; this.entity = {};
this.entity.name = v.name; this.entity.name = v.name;
this.entity.id = v.id; this.entity.id = v.id;
} },
} },
}; };
</script> </script>
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('departcode')"> <FormItem :label="l('departcode')" prop="departcode">
<Input v-model="entity.departcode" placeholder="请输入..."></Input> <Input v-model="entity.departcode" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
</Col> </Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
<!-- 组织类型 --> <!-- 组织类型 -->
...@@ -58,6 +60,18 @@ export default { ...@@ -58,6 +60,18 @@ export default {
name: "Add", name: "Add",
// components: { OrganizType }, // components: { OrganizType },
data() { data() {
const validateCode = (rule, value, callback) => {
if (!value) {
return callback(new Error("编号不能为空"));
}
Api.isExist(value).then((r) => {
if (r.result) {
return callback(new Error("编号已经存在"));
} else {
callback();
}
});
};
return { return {
// showTree: false, //组织类型 // showTree: false, //组织类型
disabled: false, disabled: false,
...@@ -67,28 +81,31 @@ export default { ...@@ -67,28 +81,31 @@ export default {
// organizationType: "" // organizationType: ""
departcode: "", departcode: "",
title02: "", title02: "",
}, },
property: [], property: [],
location: [], location: [],
rules: { rules: {
title02: [ title02: [
{ required: true, message: "库位名不能为空", trigger: "blur" } { required: true, message: "名称不能为空", trigger: "blur" },
], ],
organizationType: [ organizationType: [
{ {
// type: 'array', // type: 'array',
required: true, required: true,
message: "组织类型不能为空", message: "组织类型不能为空",
trigger: "blur" trigger: "blur",
} },
] ],
} departcode: [
{ required: true, message: "编码不能为空", trigger: "blur" },
{ validator: validateCode, trigger: "blur" },
],
},
}; };
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs["form"].validate(value => { this.$refs["form"].validate((value) => {
if (value) { if (value) {
let isProduction = 0; let isProduction = 0;
let property = []; let property = [];
...@@ -109,17 +126,17 @@ export default { ...@@ -109,17 +126,17 @@ export default {
} }
let location = this.location; let location = this.location;
let paramsdata = { let paramsdata = {
parentTitle:'', parentTitle: "",
name: this.entity.title02, //部门名称 name: this.entity.title02, //部门名称
parent_Id: 0, //上级部门 [id] parent_Id: 0, //上级部门 [id]
code: this.entity.departcode, //部门编号 code: this.entity.departcode, //部门编号
organization_Id: this.entity.organization_Id, //组织类型 [id] organization_Id: this.entity.organization_Id, //组织类型 [id]
location: location.join(","), //省市县 location: location.join(","), //省市县
isProduction: isProduction, //是否生产班组:1是,0否 isProduction: isProduction, //是否生产班组:1是,0否
property: property.join(",") //属性 property: property.join(","), //属性
}; };
Api.create(paramsdata) Api.create(paramsdata)
.then(r => { .then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功!"); this.$Message.success("保存成功!");
...@@ -128,7 +145,7 @@ export default { ...@@ -128,7 +145,7 @@ export default {
this.$Message.error("保存失败,请联系管理员"); this.$Message.error("保存失败,请联系管理员");
} }
}) })
.catch(err => { .catch((err) => {
this.disabled = false; this.disabled = false;
this.$Message.error("保存失败,请联系管理员"); this.$Message.error("保存失败,请联系管理员");
}); });
...@@ -144,7 +161,7 @@ export default { ...@@ -144,7 +161,7 @@ export default {
l(key) { l(key) {
key = "DipartLocation" + "." + key; key = "DipartLocation" + "." + key;
return this.$t(key); return this.$t(key);
} },
} },
}; };
</script> </script>
\ No newline at end of file
...@@ -20,5 +20,8 @@ export default { ...@@ -20,5 +20,8 @@ export default {
departImport(params) { departImport(params) {
return Api.post(`${systemUrl}/departmentimport/import`, params); return Api.post(`${systemUrl}/departmentimport/import`, params);
}, },
// 编号是否存在
isExist(value) {
return Api.post(`${systemUrl}/Department/IsExist`, value);
},
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('departcode')"> <FormItem :label="l('departcode')" prop="code">
<Input v-model="entity.code" placeholder="请输入..."></Input> <Input v-model="entity.code" placeholder="请输入..."></Input>
</FormItem> </FormItem>
</Col> </Col>
...@@ -72,7 +72,8 @@ export default { ...@@ -72,7 +72,8 @@ export default {
id: -1 id: -1
}, },
rules: { rules: {
name: [{ required: true, message: "库位名不能为空", trigger: "blur" }], name: [{ required: true, message: "不能为空", trigger: "blur" }],
code: [{ required: true, message: "不能为空", trigger: "blur" }],
property: [ property: [
{ {
required: true, required: true,
......
...@@ -353,12 +353,38 @@ export default { ...@@ -353,12 +353,38 @@ export default {
}); });
list.forEach((e) => { list.forEach((e) => {
//给导出数据增加数据字典对应的name //给导出数据增加数据字典对应的name
tempCol.forEach((ele) => { tempCol.forEach((elem) => {
e[ele.key] = this.$u.dirName( if (
this.$store.getters.dictionaryByKey(ele.code), e[elem.key] &&
e[ele.key] e[elem.key] != "" &&
e[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = e[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
e[elem.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(elem.code),
e[elem.key]
); );
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirName(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
e[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
}); });
tempCol1.forEach((ele1) => { tempCol1.forEach((ele1) => {
e[ele1.key] = this.getCityName(e[ele1.key]); e[ele1.key] = this.getCityName(e[ele1.key]);
}); });
...@@ -399,7 +425,7 @@ export default { ...@@ -399,7 +425,7 @@ export default {
parent_Id: ele.parent_Id ? ele.parent_Id : '', //上级部门 [id] parent_Id: ele.parent_Id ? ele.parent_Id : '', //上级部门 [id]
code: ele.code ? ele.code : '', //部门编号 code: ele.code ? ele.code : '', //部门编号
location: ele.location ? this.getCityValue(ele.location) : '', //省市县 location: ele.location ? this.getCityValue(ele.location) : '', //省市县
isProduction: 0, //是否生产班组:1是,0否 isProduction: ele.property.indexOf('1') > -1 && ele.property.indexOf('2') > -1 && ele.property.indexOf('3') > -1 ? 1 : 0, //是否生产班组:1是,0否. 属性值为三个值同时选择,则是生产班组
property: ele.property ? ele.property : '' //属性 property: ele.property ? ele.property : '' //属性
}; };
if (ele.name && ele.name != '') { if (ele.name && ele.name != '') {
......
...@@ -72,6 +72,11 @@ ...@@ -72,6 +72,11 @@
<FormItem :label="l('property')"> <FormItem :label="l('property')">
<Checkbox v-model="entity.property">排产资源</Checkbox> <Checkbox v-model="entity.property">排产资源</Checkbox>
</FormItem> </FormItem>
</Col>
<Col :span="12">
<FormItem label="用户类型">
<Dictionary code="User.base.UserType" v-model="entity.userType"></Dictionary>
</FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('remark')" prop="remark"> <FormItem :label="l('remark')" prop="remark">
......
This diff is collapsed.
<template> <template>
<div class="detail"> <div class="detail">
<Row> <Row>
<!-- <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed> <!-- <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed> <Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed> <Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed> <Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed> <Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed> <Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> --> <Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> -->
<Filed :span="12" :name="l('timestamp')">{{entity.timestamp}}</Filed> <Filed :span="12" :name="l('timestamp')">{{ entity.timestamp }}</Filed>
<Filed :span="12" :name="l('level')">{{entity.level}}</Filed> <Filed :span="12" :name="l('level')">{{ entity.level }}</Filed>
<!-- <Filed :span="12" :name="l('messageTemplate')">{{entity.messageTemplate}}</Filed> --> <!-- <Filed :span="12" :name="l('messageTemplate')">{{entity.messageTemplate}}</Filed> -->
<Filed :span="12" :name="l('renderedMessage')">{{entity.renderedMessage}}</Filed> <Filed :span="12" :name="l('renderedMessage')">{{
<Filed :span="12" :name="l('clientIpAddress')">{{entity.clientIpAddress}}</Filed> entity.renderedMessage
<Filed :span="12" :name="l('loginName')">{{entity.loginName}}</Filed> }}</Filed>
<Filed :span="12" :name="l('tanentCode')">{{entity.tanentCode}}</Filed> <Filed :span="12" :name="l('clientIpAddress')">{{
<Filed :span="12" :name="l('host')">{{entity.host}}</Filed> entity.clientIpAddress
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed> }}</Filed>
<Filed :span="12" :name="l('requestUrl')">{{entity.requestUrl}}</Filed> <Filed :span="12" :name="l('loginName')">{{ entity.loginName }}</Filed>
<Filed :span="12" :name="l('requestParam')">{{entity.requestParam}}</Filed> <Filed :span="12" :name="l('tanentCode')">{{ entity.tanentCode }}</Filed>
<Filed :span="24" :name="l('exception')">{{entity.exception}}</Filed> <Filed :span="12" :name="l('host')">{{ entity.host }}</Filed>
<Filed :span="12" :name="l('status')">{{ entity.status }}</Filed>
<Filed :span="12" :name="l('requestUrl')">{{ entity.requestUrl }}</Filed>
<Filed :span="12" :name="l('requestParam')">{{
entity.requestParam
}}</Filed>
<Filed :span="24" :name="l('exception')">{{ entity.exception }}</Filed>
</Row> </Row>
<Form
class="form"
ref="form"
:model="entity"
:rules="rules"
:label-width="90"
>
<Row>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="error.status"
v-model="entity.status"
type="radio"
></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
entity: {}, entity: {
exception: "",
properties: {},
status: 0,
},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }], name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: '必填', trigger: 'blur' }] code: [{ required: true, message: "必填", trigger: "blur" }],
} },
} disabled: false,
};
}, },
props: { props: {
eid: Number eid: "",
}, },
mounted() { mounted() {
if (this.eid) { if (this.eid) {
...@@ -47,25 +89,50 @@ ...@@ -47,25 +89,50 @@
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then((r) => {
if (r.result.status == "" || r.result.status == null) {
r.result.status = 0;
}
this.entity = r.result; this.entity = r.result;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = "run_log" + "." + key; key = "run_log" + "." + key;
return this.$t(key) return this.$t(key);
},
handleSubmit() {
this.disabled = true;
Api.update({
id: this.entity.id,
status: this.entity.status,
remark: this.entity.remark,
})
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
} }
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
cosole.warn(err);
});
},
}, },
watch: { watch: {
eid(v) { eid(v) {
if (v > 0) { if (v > 0) {
this.load(v); this.load(v);
} }
} },
} },
} };
</script> </script>
\ No newline at end of file
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"> <DataGrid
:columns="columns"
ref="grid"
:action="action"
exportTitle="异常记录"
>
<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" v-width="300"/> <Input
placeholder="请输入关键字登录账号/租户编号"
v-model="easySearch.keys.value"
v-width="300"
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
...@@ -15,7 +24,12 @@ ...@@ -15,7 +24,12 @@
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
<DatePicker type="date" v-model="end" placeholder="选择终止日期" style="width: 150px"></DatePicker> <DatePicker
type="date"
v-model="end"
placeholder="选择终止日期"
style="width: 150px"
></DatePicker>
<Button type="error" @click="clear" :disabled="dis">清理</Button> <Button type="error" @click="clear" :disabled="dis">清理</Button>
</template> </template>
</DataGrid> </DataGrid>
...@@ -24,6 +38,7 @@ ...@@ -24,6 +38,7 @@
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search"; import Search from "./search";
...@@ -41,9 +56,12 @@ export default { ...@@ -41,9 +56,12 @@ export default {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: "loginName,tanentCode", value: null }, keys: {
op: "loginName,tanentCode",
value: null,
},
}, },
end:null, end: null,
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
...@@ -124,8 +142,16 @@ export default { ...@@ -124,8 +142,16 @@ export default {
hide: true, hide: true,
high: true, high: true,
}, },
// { key:"status",title:this.l("status") ,align:"left" ,high:true }, {
key: "status",
title: this.l("status"),
align: "left",
high: true,
render: (h, params) => {
return h("span", {}, params.row.status == 1 ? "已解决" : "未解决");
},
},
{ key: "remark", title: this.l("remark"), align: "left", high: true },
{ {
key: "requestParam", key: "requestParam",
title: this.l("requestParam"), title: this.l("requestParam"),
...@@ -140,12 +166,21 @@ export default { ...@@ -140,12 +166,21 @@ export default {
width: 140, width: 140,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h(
"div",
{
class: "action",
},
[
h( h(
"op", "op",
{ {
attrs: { oprate: "detail" }, attrs: {
on: { click: () => this.view(params.row.id) }, oprate: "detail",
},
on: {
click: () => this.view(params.row.id),
},
}, },
"查看" "查看"
), ),
...@@ -154,20 +189,25 @@ export default { ...@@ -154,20 +189,25 @@ export default {
h( h(
"op", "op",
{ {
attrs: { oprate: "delete" }, attrs: {
on: { click: () => this.remove(params.row.id) }, oprate: "delete",
},
on: {
click: () => this.remove(params.row.id),
},
}, },
"删除" "删除"
), ),
]); ]
);
}, },
}, },
], ],
}; };
}, },
created() { created() {
var date=new Date().getTime()-24*60*60*1000*5; var date = new Date().getTime() - 24 * 60 * 60 * 1000 * 5;
this.end=new Date(date); this.end = new Date(date);
console.log(this); console.log(this);
}, },
...@@ -215,21 +255,21 @@ export default { ...@@ -215,21 +255,21 @@ export default {
} }
}); });
}, },
clear(){ clear() {
this.$Modal.confirm({ this.$Modal.confirm({
title:"确认", title: "确认",
content:"确认要删除"+this.$u.toDate(this.end) +"以前的数据吗", content: "确认要删除" + this.$u.toDate(this.end) + "以前的数据吗",
onOk:()=>{ onOk: () => {
Api.deleteAll(this.end).then(r=>{ Api.deleteAll(this.end).then((r) => {
if(r.success){ if (r.success) {
this.$Message.success("删除成功") this.$Message.success("删除成功");
this.$refs.grid.load(); this.$refs.grid.load();
}else{ } else {
this.$Message.error("出现异常") this.$Message.error("出现异常");
} }
}) });
} },
}) });
}, },
cancel() { cancel() {
this.curId = 0; this.curId = 0;
...@@ -263,13 +303,15 @@ export default { ...@@ -263,13 +303,15 @@ export default {
return this.$t(vkey) || key; return this.$t(vkey) || key;
}, },
}, },
computed:{ computed: {
dis(){ dis() {
var num=(new Date().getTime()-this.end.getTime())/(1000*60*60*24); var num =
return num<1 (new Date().getTime() - this.end.getTime()) / (1000 * 60 * 60 * 24);
} return num < 1;
} },
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
...@@ -5,11 +5,3 @@ ...@@ -5,11 +5,3 @@
</div> </div>
</template> </template>
<script>
// import iview from './crm/statistical/index.vue'
export default {
// components: {
// iview
// }
}
</script>
\ No newline at end of file
<template> <template>
<div class="config flex"> <div class="config flex">
<div class="menu"> <div class="menu">
<Menu theme="light" active-name="site"> <Menu theme="light" active-name="site" @on-select="pageTo">
<MenuItem name="site" to="#site">站点设置</MenuItem> <MenuItem name="site">站点设置</MenuItem>
<MenuItem name="bus" to="#bus">业务设置</MenuItem> <MenuItem name="bus">业务设置</MenuItem>
</Menu> </Menu>
</div> </div>
<div class="main fg"> <div class="main fg" id="mainDiv">
<div class="tool tr"> <div class="tr lt40 fr divTop pr20">
<Button type="primary" size="small" @click="save">保存</Button> <Button type="primary" size="small" @click="save">保存</Button>
<Button type="text">恢复默认</Button> <Button type="text" size="small" @click="reset">恢复默认</Button>
</div> </div>
<Form ref="form" :model="config" :rules="rules" :label-width="120"> <Form ref="form" :model="config" :rules="rules" :label-width="120">
<div id="site"> <div id="site" class="mt50">
<h3>站点设置</h3> <h3>站点设置</h3>
<FormItem label="默认语言" prop="site.language"> <FormItem label="默认语言" prop="site.language">
<Input v-model="config.site.language"></Input> <Input v-model="config.site.language"></Input>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="密码安全校验"> <FormItem label="密码安全校验">
<i-switch v-model="config.site.loginEditPassword"/> <i-switch v-model="config.site.loginEditPassword" />
<span class="tip">开启后,用户密码安全级别低时,登陆后强制修改密码</span> <span class="tip">开启后,用户密码安全级别低时,登陆后强制修改密码</span>
</FormItem> </FormItem>
<FormItem label="验证码"> <FormItem label="验证码">
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<span class="tip">开启后用户登陆需要输入验证码</span> <span class="tip">开启后用户登陆需要输入验证码</span>
</FormItem> </FormItem>
<FormItem label="注册邀请码"> <FormItem label="注册邀请码">
<Input v-model="config.site.regCode" ></Input> <Input v-model="config.site.regCode"></Input>
<span class="tip">1.为空时:不对外开放注册;2.设置为“666”时用户免输入注册邀请码就可以进行注册;3.其它情况,注册时需要输入注册邀请码</span> <span class="tip">1.为空时:不对外开放注册;2.设置为“666”时用户免输入注册邀请码就可以进行注册;3.其它情况,注册时需要输入注册邀请码</span>
</FormItem> </FormItem>
<FormItem label="登陆有效期"> <FormItem label="登陆有效期">
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<span class="tip">开启后可以查看系统异常</span> <span class="tip">开启后可以查看系统异常</span>
</FormItem> </FormItem>
<FormItem label="异常消息"> <FormItem label="异常消息">
<Input v-model="config.site.exceptionMessage" ></Input> <Input v-model="config.site.exceptionMessage"></Input>
<span class="tip">设置后,接口发生异常,统一返回次内容。为空时返回系统异常</span> <span class="tip">设置后,接口发生异常,统一返回次内容。为空时返回系统异常</span>
</FormItem> </FormItem>
<FormItem label="列表显示方式"> <FormItem label="列表显示方式">
...@@ -83,19 +83,19 @@ ...@@ -83,19 +83,19 @@
<div id="bus"> <div id="bus">
<h3>业务设置</h3> <h3>业务设置</h3>
<FormItem label="订单开工预警"> <FormItem label="订单开工预警">
<InputNumber v-model="config.bus.orderStartWarning" :min="0" :max="2400"/> <InputNumber v-model="config.bus.orderStartWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem> </FormItem>
<FormItem label="订单完工预警"> <FormItem label="订单完工预警">
<InputNumber v-model="config.bus.orderFinishWarning" :min="0" :max="2400"/> <InputNumber v-model="config.bus.orderFinishWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem> </FormItem>
<FormItem label="工单开工预警"> <FormItem label="工单开工预警">
<InputNumber v-model="config.bus.excuteStartWarning" :min="0" :max="2400"/> <InputNumber v-model="config.bus.excuteStartWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem> </FormItem>
<FormItem label="工单完工预警"> <FormItem label="工单完工预警">
<InputNumber v-model="config.bus.excuteEndWarning" :min="0" :max="2400"/> <InputNumber v-model="config.bus.excuteEndWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem> </FormItem>
<FormItem label="库存预警"> <FormItem label="库存预警">
...@@ -110,11 +110,11 @@ ...@@ -110,11 +110,11 @@
<span class="tip">开启后,工单执行必须按照工序次序先后次序执行;关闭后,工单可以不按工序次序执行。</span> <span class="tip">开启后,工单执行必须按照工序次序先后次序执行;关闭后,工单可以不按工序次序执行。</span>
</FormItem> </FormItem>
<FormItem label="工艺设置预警"> <FormItem label="工艺设置预警">
<InputNumber v-model="config.bus.setHeaderWarning" :min="0" :max="2400"/> <InputNumber v-model="config.bus.setHeaderWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem> </FormItem>
<FormItem label="配套完成预警"> <FormItem label="配套完成预警">
<InputNumber v-model="config.bus.setHeaderWarning" :min="0" :max="2400"/> <InputNumber v-model="config.bus.setHeaderWarning" :min="0" :max="2400" />
<span class="tip">单位为小时,为0时不预警;大于0进行预警</span> <span class="tip">单位为小时,为0时不预警;大于0进行预警</span>
</FormItem> </FormItem>
<FormItem label="转序交接"> <FormItem label="转序交接">
...@@ -132,22 +132,49 @@ ...@@ -132,22 +132,49 @@
</div> </div>
</Form> </Form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import config from "~/libs/config"; //import config from "~/libs/config";
export default { export default {
name: "", name: "",
data() { data() {
return { return {
config: config, config: this.$store.state.siteConfig,
rules: {}, rules: {},
}; };
}, },
async fetch({
store,
params
}) {
await store.dispatch('loadSiteConfig') // 加载默认数据
},
mounted() {},
methods: { methods: {
save() {}, //保存设置
reset() {}, save() {
this.$store.dispatch('saveConfig', this.config)
},
//恢复默认
reset() {
this.config = this.$store.state.defaultConfig; //重置为默认设置信息
let configTemSite = this.$store.state.siteConfig; //获取组合设置信息
if (configTemSite.tenantCode != '') {
this.config.tenantCode = configTemSite.tenantCode
}
},
//menu切换
pageTo(val) {
var mainDiv = document.getElementById('mainDiv');
var site = document.getElementById('site');
if (val == 'site') {
mainDiv.scrollTop = 0;
} else {
mainDiv.scrollTop = site.scrollHeight;
}
}
}, },
}; };
</script> </script>
...@@ -155,28 +182,44 @@ export default { ...@@ -155,28 +182,44 @@ export default {
<style lang="less"> <style lang="less">
.config { .config {
height: 100%; height: 100%;
.menu { .menu {
width: 240px; width: 240px;
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
position: relative; position: relative;
.ivu-menu{
.ivu-menu {
z-index: 10; z-index: 10;
position: absolute; position: absolute;
width: 100%; width: 100%;
top:5px; top: 5px;
} }
} }
.main { .main {
margin: 0px -10px; margin: 0px -10px;
padding: 10px 20px; padding: 10px 20px;
h3 { h3 {
font-size: 16px; font-size: 16px;
} }
.tip{
.tip {
font-size: 13px; font-size: 13px;
color: #999; color: #999;
font-style: italic; font-style: italic;
} }
.divTop {
position: fixed;
background: #fff;
height: 40px;
width: calc(~'100% - 560px');
z-index: 100;
border-bottom: 1px #e4e6ed solid;
top: 105px
}
height: calc(100vh - 150px); height: calc(100vh - 150px);
overflow-y: auto; overflow-y: auto;
} }
......
...@@ -53,7 +53,7 @@ function errorLog (err) { ...@@ -53,7 +53,7 @@ function errorLog (err) {
// 创建一个 axios 实例 // 创建一个 axios 实例
const service = axios.create({ const service = axios.create({
baseURL: Setting.apiBaseURL, baseURL: Setting.apiBaseURL,
timeout: 5000, // 请求超时时间 timeout: 30000, // 请求超时时间
transformRequest:[(data)=>{ transformRequest:[(data)=>{
function dateFormat(date, fmt) { function dateFormat(date, fmt) {
if (null == date || undefined == date) return ''; if (null == date || undefined == date) return '';
......
...@@ -8,6 +8,46 @@ html body { ...@@ -8,6 +8,46 @@ html body {
#__layout { #__layout {
height: 100%; height: 100%;
} }
/*flex*/
.flex {
display: flex;
}
.fc-m {
justify-content: center;
}
.fa-m {
align-items: center;
}
.fc-e {
justify-content: flex-end;
}
.fc-b {
justify-content: space-between;
}
.fc-a {
justify-content: space-around;
}
.fc-ev {
justify-content: space-evenly;
}
.fd {
flex-direction: column;
}
.fg {
flex-grow: 1;
}
.fs {
flex-shrink: 0;
}
.fg2 {
flex-grow: 2;
}
.fos {
order: -1;
}
.foe {
order: 99;
}
/*字体*/ /*字体*/
.ib { .ib {
display: inline; display: inline;
...@@ -172,6 +212,12 @@ html body { ...@@ -172,6 +212,12 @@ html body {
.pl20 { .pl20 {
padding-left: 20px; padding-left: 20px;
} }
.pr10 {
padding-right: 10px;
}
.pr20 {
padding-right: 20px;
}
.bnone { .bnone {
border: none; border: none;
} }
...@@ -475,6 +521,15 @@ i.icon-gengxin { ...@@ -475,6 +521,15 @@ i.icon-gengxin {
.tc { .tc {
text-align: center; text-align: center;
} }
.lt30 {
line-height: 30px;
}
.lt40 {
line-height: 40px;
}
.lt50 {
line-height: 50px;
}
/*清除浮动*/ /*清除浮动*/
.clear { .clear {
clear: both; clear: both;
...@@ -523,6 +578,7 @@ textarea::-webkit-input-placeholder { ...@@ -523,6 +578,7 @@ textarea::-webkit-input-placeholder {
background: #fff; background: #fff;
padding: 0px 10px 20px 10px; padding: 0px 10px 20px 10px;
margin-top: 10px; margin-top: 10px;
overflow: auto;
} }
.zh-tree .zh-title { .zh-tree .zh-title {
font-size: 14px; font-size: 14px;
...@@ -646,7 +702,7 @@ html [type=button] { ...@@ -646,7 +702,7 @@ html [type=button] {
} }
.waitTask { .waitTask {
/*flex 布局*/ /*flex 布局*/
display: flex; display: flex!important;
align-items: center; align-items: center;
width: 200px; width: 200px;
height: 100px; height: 100px;
...@@ -892,7 +948,6 @@ html [type=button] { ...@@ -892,7 +948,6 @@ html [type=button] {
color: #249e91; color: #249e91;
} }
.full .menu .tree { .full .menu .tree {
height: calc(100% - 150px);
overflow: auto; overflow: auto;
} }
.full .content { .full .content {
...@@ -922,3 +977,7 @@ html [type=button] { ...@@ -922,3 +977,7 @@ html [type=button] {
.content { .content {
padding-left: 5px; padding-left: 5px;
} }
.row_border_bottom {
border-bottom: 1px solid #E0E0E0;
padding: 15px 20px;
}
...@@ -10,6 +10,7 @@ let address=systemApi.dev; ...@@ -10,6 +10,7 @@ let address=systemApi.dev;
//let address=systemApi.local; //let address=systemApi.local;
window.systemUrl = `http://${address}:10000/system`; //System-api 系统管理(基础数据) window.systemUrl = `http://${address}:10000/system`; //System-api 系统管理(基础数据)
// window.systemUrl = `http://localhost:10020/api/services/app`; //System-api 系统管理(基础数据)
window.authUrl = `http://${address}:10010`; //Authentication-api //统一登陆认证 window.authUrl = `http://${address}:10010`; //Authentication-api //统一登陆认证
window.UserUrl = `http://${address}:10130`; //Authentication-api //用户信息 密码修改。重置等 window.UserUrl = `http://${address}:10130`; //Authentication-api //用户信息 密码修改。重置等
window.designUrl = `http://${address}:10000/process`; // 工艺规程 window.designUrl = `http://${address}:10000/process`; // 工艺规程
......
import createVuexAlong from 'vuex-along' import createVuexAlong from 'vuex-along'
import Api from '@/plugins/request' import Api from '@/plugins/request'
import util from '@/libs/util';
export const state = () => ({ export const state = () => ({
counter: 0, counter: 0,
dictionary: new Map(), //所有字典项 dictionary: new Map(), //所有字典项
...@@ -11,6 +12,8 @@ export const state = () => ({ ...@@ -11,6 +12,8 @@ export const state = () => ({
}, },
siteConfig: {}, siteConfig: {},
defaultConfig: {}, defaultConfig: {},
configId:null,
configSaveStatu:0,
}) })
export const getters = { export const getters = {
dictionaryByKey: (state) => (key) => { dictionaryByKey: (state) => (key) => {
...@@ -56,10 +59,16 @@ export const mutations = { ...@@ -56,10 +59,16 @@ export const mutations = {
state.dictionary = dictionary; state.dictionary = dictionary;
}, },
setSiteConfig(state, config) { setSiteConfig(state, config) {
state.siteConfig = config; state.siteConfig = JSON.parse(config);
}, },
setDefaultConfig(state, config) { setDefaultConfig(state, config) {
state.defaultConfig = config; state.defaultConfig =JSON.parse(config);
},
setConfigId(state, id) {
state.configId =id;
},
setConfigSaveStatu(state, val) {
state.configSaveStatu =val;
} }
} }
...@@ -99,29 +108,57 @@ export const actions = { ...@@ -99,29 +108,57 @@ export const actions = {
}) { }) {
let params = { let params = {
pageSize: 2, pageSize: 2,
sortBy: "id",
conditions: [{ conditions: [{
"fieldName": "key", "fieldName": "component",
"fieldValue": "defaultConfig,tenant-" + state.userInfo.tenantCode, "fieldValue": "defaultConfig,tenantConfig_" + util.cookies.get('tenantCode'),
"conditionalType": "In", "conditionalType": "In",
}, ] }]
} }
let { let {
result result
} = await Api.post(`${systemUrl}/config/list`, params); } = await Api.post(`${systemUrl}/config/list`, params);
if (result[0]) { if (result[0]) {
commit("setDefaultConfig", result[0]) commit("setDefaultConfig", result[0].content)
} }
if (result[1]) { if (result[1]) {
commit("setSiteConfig", result[1]) commit("setSiteConfig", result[1].content)
}else{ commit("setConfigId",result[1].id)
if(result[0]){ } else {
commit("setSiteConfig", result[0]) if (result[0]) {
commit("setSiteConfig", result[0].content)
} }
} }
}, },
async saveConfig({commit},config){ async saveConfig({
state
}, config) {
if (config.tenantCode != '') {
let configStr=JSON.stringify(config);
let params = {
id: state.configId,
page: "config",
component: "tenantConfig_"+config.tenantCode,
key:config.tenantCode,
content: configStr,
note: "配置信息"
}
await Api.post(`${systemUrl}/config/update`, params);
} else {
config.tenantCode = util.cookies.get('tenantCode')
let configStr=JSON.stringify(config);
let params = {
page: "config",
component: "tenantConfig_"+config.tenantCode,
key:config.tenantCode,
content: configStr,
note: "配置信息"
}
await Api.post(`${systemUrl}/config/create`, params);
} }
}
} }
export const plugins = [ export const plugins = [
......
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