Commit 15a0c384 authored by 仇晓婷's avatar 仇晓婷

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

parents 51599112 96de0e7d
......@@ -21,7 +21,9 @@ ul,
li {
list-style: none;
}
.ivu-drawer-wrap{
z-index: 12000;
}
div::-webkit-scrollbar {
width: 10px;
height: 10px;
......
......@@ -18,7 +18,6 @@
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
.ivu-btn-primary {
color: #fff;
background-color: @primary-color;
......
<template>
<transition name="contextmenu-submenu-fade" v-if="show">
<transition name="contextmenu-submenu-fade">
<div ref="menu" :class="[commonClass.menu, 'menu', customClass]" :style="{left: style.left + 'px', top: style.top + 'px', minWidth: style.minWidth + 'px', zIndex: style.zIndex}" v-if="visible" @contextmenu="(e)=>e.preventDefault()">
<div class="menu_body">
<template v-for="(item,index) of items">
......@@ -10,7 +10,7 @@
item.divided?'menu_item__divided':null
]" :key="index" v-if="item.disabled">
<div class="menu_item_icon" v-if="hasIcon">
<i :class="item.icon" v-if="item.icon"></i>
<Icon v-if="item.icon" :type="item.icon" />
</div>
<span class="menu_item_label">{{item.label}}</span>
<div class="menu_item_expand_icon"></div>
......@@ -22,7 +22,7 @@
item.divided?'menu_item__divided':null
]" :key="index" @mouseenter="($event)=>enterItem($event,item,index)" v-else-if="item.children">
<div class="menu_item_icon" v-if="hasIcon">
<i :class="item.icon" v-if="item.icon"></i>
<Icon v-if="item.icon" :type="item.icon" />
</div>
<span class="menu_item_label">{{item.label}}</span>
<div class="menu_item_expand_icon"></div>
......@@ -33,7 +33,7 @@
item.divided?'menu_item__divided':null
]" :key="index" @mouseenter="($event)=>enterItem($event,item,index)" @click="itemClick(item)" v-else>
<div class="menu_item_icon" v-if="hasIcon">
<i :class="item.icon" v-if="item.icon"></i>
<Icon v-if="item.icon" :type="item.icon" />
</div>
<span class="menu_item_label">{{item.label}}</span>
<div class="menu_item_expand_icon"></div>
......@@ -54,6 +54,9 @@ import {
SUBMENU_OPEN_TREND_RIGHT,
COMPONENT_NAME
} from "../constant";
import {
getElementsByClassName
} from "../util";
export default {
name: "Submenu",
data() {
......@@ -78,13 +81,15 @@ export default {
style: {
left: 0,
top: 0,
zIndex: 2,
zIndex: 3,
minWidth: 150
},
customClass: null,
visible: false,
hasIcon: false,
openTrend: SUBMENU_OPEN_TREND_RIGHT
openTrend: SUBMENU_OPEN_TREND_RIGHT,
mouseListening: false,
mainMenuInstance: null,
};
},
props: {
......@@ -104,8 +109,12 @@ export default {
mounted() {
if (this.data != []) {
this.load(this.data)
this.addListener();
}
},
destroyed() {
this.removeListener();
},
methods: {
load(v) {
this.visible = true;
......@@ -194,13 +203,14 @@ export default {
};
this.activeSubmenu.instance.style.minWidth =
typeof item.minWidth === "number" ? item.minWidth : this.style.minWidth;
this.activeSubmenu.instance.style.zIndex = this.style.zIndex;
this.activeSubmenu.instance.style.zIndex = '9999';
this.activeSubmenu.instance.customClass =
typeof item.customClass === "string" ?
item.customClass :
this.customClass;
this.activeSubmenu.instance.$mount();
document.body.appendChild(this.activeSubmenu.instance.$el);
},
itemClick(item) {
if (!this.visible) {
......@@ -220,9 +230,34 @@ export default {
if (this.activeSubmenu.instance) {
this.activeSubmenu.instance.close();
}
this.$nextTick(() => {
this.$destroy();
});
this.$nextTick(() => {});
},
showBm() {
this.visible = true;
},
leaveBm() {
this.visible = false;
},
mouseClickListener(e) { //左键点击
this.close();
},
addListener() {
if (!this.mouseListening) {
document.addEventListener("click", this.mouseClickListener);
//document.addEventListener("mousedown", this.mouseDownListener);
//document.addEventListener("mousewheel", this.mousewheelListener);
this.mouseListening = true;
}
},
removeListener() {
if (this.mouseListening) {
document.removeEventListener("click", this.mouseClickListener);
//document.removeEventListener("mousedown", this.mouseDownListener);
//document.removeEventListener("mousewheel", this.mousewheelListener);
this.mouseListening = false;
}
}
},
watch: {
......@@ -232,6 +267,9 @@ export default {
this.load(this.data)
}
},
show(v) {
this.visible = v
}
},
};
</script>
......
......@@ -61,6 +61,7 @@
<script>
import XLSX from "xlsx";
import Api from '@/plugins/request'
import {
Switch
} from "view-design";
......@@ -82,6 +83,7 @@ export default {
formatList: ["xlsx"],
columnsImport: [],
departArr: [], //部门list
usersArr: [],
sheetNames: [], //excel的表明
workBook: {},
openDatas: [],
......@@ -129,9 +131,21 @@ export default {
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items;
});
this.$api.get(`${systemUrl}/user/getuserlist`)
.then((r) => {
if (r.success) {
this.usersArr = r.result
}
})
//导出对列表头进行预加载end
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
await store.dispatch("loadUsers"); // 加载数据字典
},
mounted() {
//if (this.eid > 0) {
// this.load(this.eid);
......@@ -144,6 +158,7 @@ export default {
this.tdHeightExcel = window.screenHeight - 180;
})();
};
},
methods: {
//重新处理colum
......@@ -198,6 +213,8 @@ export default {
temData = this.$u.clone(this.$refs.comExcel.excelData);
}
let arrTitleUse = []; ////使用数据字典的字段
let arrUseName = []; ////使用单个用户字段
let arrUseNames = []; ////使用多用户字段
temColPage.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({
......@@ -205,6 +222,18 @@ export default {
code: elCode.code,
});
}
if (elCode.type == "user") {
arrUseName.push({
key: elCode.key,
code: elCode.type,
});
}
if (elCode.type == "users") {
arrUseNames.push({
key: elCode.key,
code: elCode.type,
});
}
});
let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => {
......@@ -215,7 +244,7 @@ export default {
useData.push(objTm);
});
//对列表里的部门及数据字典项进行处理
//对列表里的部门及数据字典项、用户等进行处理
useData.forEach((eles) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if (
......@@ -247,7 +276,32 @@ export default {
}
});
}
//人员名称转换为userid,如果查不到此人员,则为空
arrUseName.forEach((euser) => {
if (eles[euser.key] && eles[euser.key] != "" && eles[euser.key] != null) {
this.usersArr.forEach(eluser => {
if (eles[euser.key] == eluser.name) {
eles[euser.key] = eluser.id
}
})
}
});
//多个名称转换为数组
arrUseNames.forEach((eusers) => {
if (eles[eusers.key] && eles[eusers.key] != "" && eles[eusers.key] != null) {
let arruserstemp = this.$u.clone(eles[eusers.key].split(',') || eles[eusers.key].split(','))
let tempUserIds = []
arruserstemp.forEach(eltempUsers => {
this.usersArr.forEach(elusers => {
if (eltempUsers == elusers.name) {
tempUserIds.push(elusers.id)
}
})
})
eles[eusers.key] = tempUserIds
}
});
arrTitleUse.forEach((elem) => {
if (
eles[elem.key] &&
......@@ -436,6 +490,7 @@ export default {
this.dataIm = formatList;
this.batchImportUrl = url;
},
l(key) {
key = "user" + "." + key;
return this.$t(key);
......
<template>
<div class="table-content1">
<div class="table-content1">
<div class="table-tools">
<div class="table-search">
<slot name="easySearch"></slot>
</div>
<div class="btns">
<slot name="buttons"></slot>
<!-- <Button @click="config=!config">
<Button @click="config = !config">
<Icon type="md-build" class="table-set" size="14" title="列设置" />
</Button>-->
</Button>
</div>
</div>
<div class="table-main" ref="main">
......@@ -16,60 +16,132 @@
<table class="table-head">
<thead>
<tr>
<th v-for="(column, index) in columns" :key="index" :style="tdStyle(column)">
<th
v-for="(column, index) in columns"
:key="index"
:style="tdStyle(column)"
>
<label v-if="column.type === 'selection'">
<Checkbox v-model="checkAll" @on-change="checked" :indeterminate="indeterminate"></Checkbox>
<Checkbox
v-model="checkAll"
@on-change="allChecked"
:indeterminate="indeterminate"
></Checkbox>
</label>
<label v-else>
{{ renderHeader(column, index) }}
<span class="ivu-table-sort" v-if="column.sortable">
<Icon type="arrow-up-b" :class="{ on: column._sortType === 'asc' }" @click.native="handleSort(index, 'asc')" />
<Icon type="arrow-down-b" :class="{ on: column._sortType === 'desc' }" @click.native="handleSort(index, 'desc')" />
<Icon
type="arrow-up-b"
:class="{ on: column._sortType === 'asc' }"
@click.native="handleSort(index, 'asc')"
/>
<Icon
type="arrow-down-b"
:class="{ on: column._sortType === 'desc' }"
@click.native="handleSort(index, 'desc')"
/>
</span>
</label>
</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in trs" :key="item.id" class="treetr" :id="'tr' + index" v-show="show(item)" :draggable="drag && !item._drag" @dragstart="dragstart($event, index, item)" @drop="dragdrop($event, index, item)" @dragenter="dragenter($event, index, item)" @dragover="dragover($event, index, item)" @dragleave="dragleave($event, index, item)">
<tr
v-for="(item, index) in trs"
:key="item.id"
class="treetr"
:id="'tr' + index"
v-show="show(item)"
:draggable="drag && !item._drag"
@dragstart="dragstart($event, index, item)"
@drop="dragdrop($event, index, item)"
@dragenter="dragenter($event, index, item)"
@dragover="dragover($event, index, item)"
@dragleave="dragleave($event, index, item)"
>
<!-- -->
<td v-for="(column, snum) in columns" :key="column.key" :style="tdStyle(column)">
<td
v-for="(column, snum) in columns"
:key="column.key"
:style="tdStyle(column)"
>
<!-- 多选 -->
<label v-if="column.type === 'selection'" @click="rowChecked(item, index, $event)">
<Checkbox v-model="item._checked" :indeterminate="item._indeterminate"></Checkbox>
<label
v-if="column.type === 'selection'"
@click="rowChecked(item, index, $event)"
>
<Checkbox
v-model="item._checked"
:indeterminate="item._indeterminate"
></Checkbox>
{{ item._checked }}
</label>
<Icon v-if="column.type === 'drag'" type="md-more" class="drag" />
<DTSpan v-if="column.type == 'date'" :value="item[column.key]" />
<Icon
v-if="column.type === 'drag'"
type="md-more"
class="drag"
/>
<DTSpan
v-if="column.type == 'date'"
:value="item[column.key]"
/>
<div v-if="column.type == 'user'">
<User :value="item[column.key]" />
</div>
<div v-if="
<div
v-if="
column.type == 'users' &&
item[column.key] &&
item[column.key].length > 0
">
<User v-for="li in item[column.key]" :value="li" :key="li" class="ml10" />
"
>
<User
v-for="li in item[column.key]"
:value="li"
:key="li"
class="ml10"
/>
</div>
<state v-if="column.code" :code="column.code" :value="item[column.key]" />
<state
v-if="column.code"
:code="column.code"
:value="item[column.key]"
/>
<!-- 树图标 -->
<span @click="toggle(index, item)" v-if="snum == treeColumn()">
<span class="ib" v-width="spaceWidth * item._level"></span>
<a v-if="item._count > 0" class="expand">
<Icon :type="!item._expanded ? 'ios-add' : 'ios-remove'" />
</a><i v-else class="ms-tree-space"></i>
<Icon
:type="!item._expanded ? 'ios-add' : 'ios-remove'"
/> </a
><i v-else class="ms-tree-space"></i>
</span>
<!-- 菜单名称、排序、请求地址 -->
<label v-if="
<label
v-if="
!column.type &&
!column.code &&
!column.render &&
!column.slot
">
"
>
{{ renderBody(item, column) }}
</label>
<table-expand v-if="column.render && !column.type && !column.solt" :row="item" :column="column" :index="snum" :render="column.render"></table-expand>
<column-slot v-if="column.slot" :row="item" :column="column" :index="snum"></column-slot>
<table-expand
v-if="column.render && !column.type && !column.solt"
:row="item"
:column="column"
:index="snum"
:render="column.render"
></table-expand>
<column-slot
v-if="column.slot"
:row="item"
:column="column"
:index="snum"
></column-slot>
</td>
</tr>
</tbody>
......@@ -79,16 +151,43 @@
<div class="table-footer">
<slot name="footer"></slot>
<Page v-if="page" :total="search.total" :current="search.page" class="fr" show-total size="small" show-elevator show-sizer :page-size="search.pageSize" :page-size-opts="pageSizeOpts" @on-change="pageChange" @on-page-size-change="pageSizeChange" />
<Page
v-if="page"
:total="search.total"
:current="search.page"
class="fr"
show-total
size="small"
show-elevator
show-sizer
:page-size="search.pageSize"
:page-size-opts="pageSizeOpts"
@on-change="pageChange"
@on-page-size-change="pageSizeChange"
/>
</div>
<Modal v-if="high" v-model="modalSearch" title="高级搜索" draggable width="800" ref="search">
<Modal
v-if="high"
v-model="modalSearch"
title="高级搜索"
draggable
width="800"
ref="search"
>
<slot name="searchForm"></slot>
<div slot="footer">
<Button @click="modalSearch = false" class="mr20">取消</Button>
<Button @click="complexSearch" type="primary" class="mr20">查询</Button>
</div>
</Modal>
<Drawer title="列设置" v-if="set" v-model="config" :scrollable="true" placement="left" :mask="false">
<Drawer
title="列设置"
v-if="set"
v-model="config"
:scrollable="true"
placement="left"
:mask="false"
>
<div slot="header">
列设置
<a @click="undoConfig" class="ml50">
......@@ -96,9 +195,17 @@
</a>
</div>
<ul class="table-columns">
<li v-for="(li, index) in columnsCur" :key="index" v-dragging="{ item: li, list: columnsCur, group: 'li' }">
<li
v-for="(li, index) in columnsCur"
:key="index"
v-dragging="{ item: li, list: columnsCur, group: 'li' }"
>
<label @click="columnChange(li, index)" :class="{ dis: li.hide }">
<Icon :type="li.hide ? 'md-eye-off' : 'md-eye'" size="16" class="mr10" />
<Icon
:type="li.hide ? 'md-eye-off' : 'md-eye'"
size="16"
class="mr10"
/>
<span>{{ li.title }}</span>
</label>
<Icon type="ios-move" class="move" size="18" />
......@@ -106,11 +213,11 @@
</ul>
</Drawer>
<FooterToolbar v-if="batch" v-show="footerToolbar" class="ftball">
<div class="tip">已选{{ selectItems.length }}</div>
<div class="ib">已选{{ selectItems.length }}</div>
<slot name="batch"></slot>
<Button @click="cancelBatch">取消</Button>
</FooterToolbar>
</div>
</div>
</template>
<script>
......@@ -120,7 +227,7 @@ export default {
name: "treeGrid",
components: {
TableExpand,
ColumnSlot
ColumnSlot,
},
props: {
mode: {
......@@ -199,14 +306,14 @@ export default {
items: {
//接收树形数据
type: Array,
default () {
default() {
return [];
},
},
data: {
//接收UpId型数据
type: Array,
default () {
default() {
return [];
},
},
......@@ -308,12 +415,6 @@ export default {
items() {
if (this.items) {
this.trs = this.treeToList(this.items);
this.checkGroup = this.renderCheck(this.items);
if (this.checkGroup.length == this.dataLength) {
this.checks = true;
} else {
this.checks = false;
}
}
},
data(v) {},
......@@ -323,24 +424,15 @@ export default {
},
deep: true,
},
checkGroup(data) {
this.checkAllGroupChange(data);
},
exportTitle(v) {
this.exportTitle = v
}
this.exportTitle = v;
},
},
mounted() {
this.getAllUser(); //获取所有用户
if (this.items && this.items.length > 0) {
this.trs = this.treeToList(this.items);
this.columnsCur = this.makeColumns();
this.checkGroup = this.renderCheck(this.items);
if (this.checkGroup.length == this.dataLength) {
this.checks = true;
} else {
this.checks = false;
}
}
},
methods: {
......@@ -470,7 +562,6 @@ export default {
}
});
}
console.warn(index, item._expanded, item);
},
show(item) {
if (item._level == 0) {
......@@ -520,7 +611,11 @@ export default {
},
// 点击check勾选框,判断是否有children节点 如果有就一并勾选
rowChecked(data, index, event) {
// this.$set(this.trs, index, data);
var boys = this.getChildrens(data);
if(boys.length){
}
this.trs.forEach((u, i) => {
var items = boys.filter((b) => {
return b[this.keyname] == u[this.keyname];
......@@ -534,12 +629,14 @@ export default {
this.trs.filter((u) => {
return !u._checked;
}).length;
this.$nextTick(() => {
this.selectionChange();
});
},
getChildrens(data) {
var childrens = [];
var that = this;
getChildren(data);
function getChildren(f) {
that.trs.forEach((u) => {
if (u[that.upname] == f[that.keyname]) {
......@@ -551,11 +648,22 @@ export default {
return childrens;
},
// checkbox 全选 选择事件
checked(v) {
allChecked(v) {
this.trs.forEach((u, i) => {
this.$set(this.trs[i], "_checked", v);
});
// this.$emit('on-selection-change', this.checkGroup)
this.$nextTick(() => {
this.selectionChange();
});
},
selectionChange() {
var items = this.trs.filter((u) => {
return u._checked === true;
});
this.selectItems = items;
this.$emit("on-selection-change", items, this.trs);
this.footerToolbar = items.length > 0;
console.log("footerToolbar", items, this.trs);
},
// 数组去重
getArray(a) {
......@@ -570,14 +678,6 @@ export default {
}
return result;
},
checkAllGroupChange(data) {
if (this.dataLength > 0 && data.length === this.dataLength) {
this.checks = true;
} else {
this.checks = false;
}
this.$emit("on-selection-change", this.checkGroup);
},
All(data) {
let arr = [];
data.forEach((item) => {
......@@ -626,19 +726,6 @@ export default {
renderBody(row, column, index) {
return row[column.key];
},
// 默认选中
renderCheck(data) {
let arr = [];
data.forEach((item) => {
if (item._checked) {
arr.push(item.id);
}
if (item.children && item.children.length > 0) {
arr = arr.concat(this.renderCheck(item.children));
}
});
return arr;
},
//分页选择
pageChange(page) {
this.search.page = page;
......@@ -655,11 +742,7 @@ export default {
this.$set(this.columnsCur, item, i);
this.saveUserconfig();
},
selectionChange(items) {
this.$emit("on-selection-change", items);
this.selectItems = items;
this.footerToolbar = items.length > 0;
},
onSelect(rows, row) {
this.$emit("on-change", rows, row);
},
......@@ -674,7 +757,7 @@ export default {
//批量取消
cancelBatch() {
this.footerToolbar = false;
this.$refs.table.selectAll(false);
// this.$refs.table.selectAll(false);
},
//导出excel
export2Excel() {
......@@ -727,8 +810,10 @@ export default {
});
list.forEach((e) => {
tempCol.forEach((elem) => {
if ((e[elem.key] && e[elem.key] != "" && e[elem.key] != null) || e[elem.key] == 0) {
if (
(e[elem.key] && e[elem.key] != "" && e[elem.key] != null) ||
e[elem.key] == 0
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = [];
let keyValue = e[elem.key];
......@@ -785,25 +870,30 @@ export default {
//导出username相关信息
tempColUser.forEach((eluser) => {
if (Array.isArray(e[eluser.key]) && e[eluser.key].length > 0) {
let temUsers = this.$u.clone(e[eluser.key])
let temUserName = ''
temUsers.forEach(u => {
let temUsers = this.$u.clone(e[eluser.key]);
let temUserName = "";
temUsers.forEach((u) => {
temUserName = temUserName + this.getUserName(u);
})
e[eluser.key] = temUserName
});
e[eluser.key] = temUserName;
}
if (e[eluser.key] && typeof (e[eluser.key]) == 'string' && e[eluser.key] != "" && e[eluser.key] != null) {
if (
e[eluser.key] &&
typeof e[eluser.key] == "string" &&
e[eluser.key] != "" &&
e[eluser.key] != null
) {
e[eluser.key] = this.getUserName(e[eluser.key]);
}
});
tempColUsers.forEach((elusers) => {
if (e[elusers.key].length > 0) {
let temUsers = this.$u.clone(e[elusers.key])
let temUserName = ''
temUsers.forEach(u => {
temUserName = temUserName + this.getUserName(u) + ',';
})
e[elusers.key] = temUserName.substr(0, temUserName.length - 1)
let temUsers = this.$u.clone(e[elusers.key]);
let temUserName = "";
temUsers.forEach((u) => {
temUserName = temUserName + this.getUserName(u) + ",";
});
e[elusers.key] = temUserName.substr(0, temUserName.length - 1);
}
});
});
......@@ -818,8 +908,7 @@ export default {
filterVal,
list
);
})
});
},
//获取所有用户信息
getAllUser() {
......@@ -858,11 +947,15 @@ export default {
<style lang="less">
@import "../../../assets/css/custom.less";
@table_theme: #2680eb;
@table_head: #e9f2fd;
@table_head: #f5f6fa;
@table_line_height: 50px;
@table_hover: #f2f8fe;
@table_border: #accef7;
@table_border: #e8e9eb;
// @table_theme: #2680eb;
// @table_head: #e9f2fd;
// @table_line_height: 50px;
// @table_hover: #f2f8fe;
// @table_border: #accef7;
.table-content1 {
position: relative;
height: 100%;
......@@ -912,10 +1005,8 @@ export default {
td,
th {
border-left: @table_border solid 1px;
border-right: @table_border solid 1px;
border-bottom: #e8e9eb solid 1px;
line-height: 50px;
border: @table_border solid 1px;
line-height: 40px;
padding: 0 5px;
.drag:hover {
......
......@@ -946,7 +946,7 @@ export default {
taskCode: '甲方任务号',
putintDocmentCode: '甲方投产输入文件(编号)',
technologyDocmentCode: '甲方技术输入文件(编号)',
productionType:'生产类型'
productionType: '生产类型'
},
mes_part_task_plan_simulate: {
id: '',
......@@ -1137,8 +1137,8 @@ export default {
multipleEquip: "是否多台安排设备", // 否 是
multipleEquipIds: "设备id", //用英文逗号分隔
discrete: '离散值',
routingHeaderCode:'工艺编号',
routingHeaderName:'工艺名称',
routingHeaderCode: '工艺编号',
routingHeaderName: '工艺名称',
},
routing_header: {
id: '',
......@@ -1489,9 +1489,9 @@ export default {
endTime: '结束时间',
planEndTime: '计划结束时间',
action: '操作',
subWorkHourStatus:'工时状态',
routingHeaderCode:'工艺编号',
routingHeaderName:'工艺名称'
subWorkHourStatus: '工时状态',
routingHeaderCode: '工艺编号',
routingHeaderName: '工艺名称'
},
product_level: {
name: '名称',
......@@ -1824,6 +1824,8 @@ export default {
type: '类型',
attachment: '附件',
executor: '执行人',
upTitle:'上级名称',
deliverable:"交付物",
},
project_main: {
creationTime: '创建时间',
......@@ -1922,10 +1924,9 @@ export default {
whour: '可用工日',
whourpd: '可用工时/天',
joindate: '加入日期'
}
,
//文档分类
document_category: {
},
//文档分类
document_category: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
......@@ -2017,10 +2018,11 @@ document_category: {
deletionTime: '删除时间',
deleterUserId: '删除人',
projectId: '项目id',
direction:"方向",
deliverable:"交付物",
direction: "方向",
deliverable: "交付物",
upId: '父级',
title: '标题',
upTitle:'上级名称',
status: '状态',
note: '描述',
startDate: '开始日期',
......@@ -2159,6 +2161,15 @@ document_category: {
template: '模板',
attachment: '附件',
type: '模版类型',
direction: '方向',
projectId: '项目id',
upId: '父级',
status: '状态',
startDate: '开始日期',
endDate: '结束日期',
executor: '执行人',
deliverable: '交付物'
},
workHour: {
userTitle: '员工姓名',
......
......@@ -133,6 +133,10 @@ henq.toTree = (list, rootId, format, parentFiledName) => {
function toTree(data, parentId, level) {
let parents = data.filter(u => {
if(u[upId]=='')
{
u[upId]=null
}
return u[upId] == parentId
})
......
......@@ -4938,7 +4938,7 @@
"dependencies": {
"commander": {
"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="
}
}
......@@ -5472,7 +5472,7 @@
},
"crc-32": {
"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=",
"requires": {
"exit-on-epipe": "~1.0.1",
......@@ -7369,7 +7369,7 @@
},
"exit-on-epipe": {
"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="
},
"expand-brackets": {
......@@ -8020,7 +8020,7 @@
},
"frac": {
"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="
},
"fragment-cache": {
......@@ -15092,7 +15092,7 @@
},
"printj": {
"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="
},
"private": {
......@@ -20545,7 +20545,7 @@
},
"script-loader": {
"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=",
"dev": true,
"requires": {
......@@ -21133,7 +21133,7 @@
},
"ssf": {
"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=",
"requires": {
"frac": "~1.1.2"
......@@ -23788,7 +23788,7 @@
},
"wmf": {
"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="
},
"word-wrap": {
......@@ -23943,7 +23943,7 @@
},
"xlsx": {
"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=",
"requires": {
"adler-32": "~1.2.0",
......@@ -23958,7 +23958,7 @@
"dependencies": {
"commander": {
"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="
}
}
......
<template>
<div>
<DataGrid
:columns="columns"
ref="grid"
:draggable="true"
:data="list"
:high="false"
@on-drag-drop="onDragDrop"
:page="false"
@on-change="onSelect"
:batch="true"
:border="true"
:easy="true"
>
<div>
<DataGrid :columns="columns" ref="grid" :draggable="true" :data="list" :high="false" @on-drag-drop="onDragDrop" :page="false" @on-selection-change="onSelect" :batch="true" :border="true" :easy="true">
<template slot="easySearch">
<div>
<Select
placeholder="选择排序优先级"
v-model="tempValue"
style="width: 150px;"
@on-change="tempValueChange"
clearable
>
<Option
v-for="(item,index) in listTemp"
:key="index"
:value="item.id"
:label="item.name"
></Option>
<Select placeholder="选择排序优先级" v-model="tempValue" style="width: 150px;" @on-change="tempValueChange" clearable>
<Option v-for="(item,index) in listTemp" :key="index" :value="item.id" :label="item.name"></Option>
</Select>
<a style="font-weight: bold;" @click="openaddModalTemp">
<Icon type="md-color-palette" size="14" />&nbsp;自定义排序模板
......@@ -43,21 +20,11 @@
<Search />
</template>
<template slot="buttons">
<DatePicker
type="date"
placeholder="设置基准日期"
style="width: 150px;"
v-model="entity.setTime"
@on-change="getTime"
></DatePicker>
<DatePicker type="date" placeholder="设置基准日期" style="width: 150px;" v-model="entity.setTime" @on-change="getTime"></DatePicker>
<a style="font-weight: bold;" @click="openAddModel(1)">
<Icon type="ios-options" size="14" />&nbsp;工序参数调整
</a>
<Button
type="primary"
@click="goResults"
style="background:#515A6E;border:solid 1px #515A6E"
>历史方案</Button>
<Button type="primary" @click="goResults" style="background:#515A6E;border:solid 1px #515A6E">历史方案</Button>
<Button type="primary" @click="openApsModal">APS排产</Button>
</template>
<template slot="batch">
......@@ -71,14 +38,7 @@
<Duration ref="durationRef"></Duration>
</Modal>
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
<Add
@on-close="cancel"
@on-parameter-ok="addOk"
:opTaskPk="setParams.opTaskPk"
:partTaskPk="setParams.partTaskPk"
:taskSeq="setParams.taskSeq"
:count="setParams.count"
/>
<Add @on-close="cancel" @on-parameter-ok="addOk" :opTaskPk="setParams.opTaskPk" :partTaskPk="setParams.partTaskPk" :taskSeq="setParams.taskSeq" :count="setParams.count" />
</Modal>
<Modal v-model="apsModal" title="确定APS排产" @on-ok="apsOk" @on-cancel="cancel">
<p>确定进行APS排产?</p>
......@@ -106,8 +66,9 @@
<Modal v-model="insertlModal1" :title="insertTItle1" @on-ok="insertOk1" @on-cancel="cancel">
<p>确定进行 {{ insertTItle1 }} 操作?</p>
</Modal>
</div>
</div>
</template>
<script>
var myDate = new Date();
var nowDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
......@@ -130,7 +91,10 @@ export default {
return {
action: Api.index,
easySearch: {
keys: { op: "notes", value: null }
keys: {
op: "notes",
value: null
}
},
result: {
res: true,
......@@ -138,7 +102,7 @@ export default {
},
resultModal: false,
entity: {
setTime:this.getFormatDate(nowDate)
setTime: this.getFormatDate(nowDate)
},
addModal: false,
editModal: false,
......@@ -154,8 +118,7 @@ export default {
rowIndex1: null,
list: [],
curId: 0,
columns: [
{
columns: [{
key: "move",
title: " ",
hide: false,
......@@ -204,11 +167,9 @@ export default {
high: true,
render: (h, params) => {
return h(
"Tooltip",
{
"Tooltip", {
props: {
content:
params.row.insert_flag == 1 ? "取消插单" : "进行插单",
content: params.row.insert_flag == 1 ? "取消插单" : "进行插单",
placement: "top"
},
class: "ico"
......@@ -216,10 +177,8 @@ export default {
[
h("Icon", {
attrs: {
type:
params.row.insert_flag == 1
? "ios-water"
: "ios-water-outline",
type: params.row.insert_flag == 1 ?
"ios-water" : "ios-water-outline",
size: 20,
color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa"
},
......@@ -354,7 +313,9 @@ export default {
align: "center",
// fixed:"right",
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h("op", {
attrs: {
icon: "md-options",
......@@ -362,7 +323,9 @@ export default {
title: "工序参数设置",
oprate: "edit"
},
on: { click: () => this.openAddModel(2, params.row) }
on: {
click: () => this.openAddModel(2, params.row)
}
}),
h("op", {
attrs: {
......@@ -372,7 +335,9 @@ export default {
oprate: "edit",
msg: "确认要恢复工序吗?"
},
on: { click: () => this.refresh(params.row.part_task_pk) }
on: {
click: () => this.refresh(params.row.part_task_pk)
}
}),
h("op", {
attrs: {
......@@ -382,7 +347,9 @@ export default {
oprate: "delete",
msg: "确认要移出排产吗?"
},
on: { click: () => this.remove(params.row.part_task_pk) }
on: {
click: () => this.remove(params.row.part_task_pk)
}
})
]);
}
......@@ -407,7 +374,10 @@ export default {
this.loadList();
this.loadTemp();
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -577,7 +547,9 @@ export default {
apsOk() {
this.circleModal = true;
//APS排产前订单优先级功能
let parmsOrderpriority = { alls: [] };
let parmsOrderpriority = {
alls: []
};
let arryIds = [];
this.list.forEach((e, index) => {
let objIds = {};
......@@ -601,12 +573,12 @@ export default {
} else {
// this.circleModal = false;
// this.$Message.error("操作失败:数据校验");
this.result=res1.result;
this.resultModal=true;
this.result = res1.result;
this.resultModal = true;
}
})
.catch(
function(err) {
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
......@@ -621,7 +593,7 @@ export default {
}
})
.catch(
function(err) {
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
......@@ -652,7 +624,7 @@ export default {
}
})
.catch(
function(err) {
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
......@@ -776,29 +748,36 @@ export default {
}
};
</script>
<style lang="less">
.drag {
cursor: move;
}
.demo-spin-icon-load {
animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
}
.demo-spin-col {
height: 100px;
position: relative;
border: 0px solid #eee;
}
.vertical-center-modal {
display: flex;
align-items: center;
......@@ -808,6 +787,7 @@ export default {
top: 0;
}
}
.tempModal {
.ivu-modal-body {
padding: 16px;
......@@ -816,6 +796,7 @@ export default {
padding-top: 2px;
padding-bottom: 0px;
}
.ivu-modal-footer {
border-top: none;
padding: 12px 18px 12px 18px;
......
<template>
<div class="h100">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
@on-selection-change="selectInfo"
:batch="false"
>
<div class="h100">
<DataGrid :columns="columns" ref="grid" :action="action" @on-selection-change="selectInfo" :batch="false">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
search
enter-button
placeholder="请输入关键字订单编号/项目名称"
v-model="easySearch.keys.value"
v-width="300"
@on-search="search"
/>
<Input search enter-button placeholder="请输入关键字订单编号/项目名称" v-model="easySearch.keys.value" v-width="300" @on-search="search" />
</FormItem>
</Form>
</template>
<template slot="searchBack">
<Badge
:count="this.$store.state.countAps"
overflow-count="99"
style="margin-right: 15px"
type="info"
v-if="showAps"
>
<Badge :count="this.$store.state.countAps" overflow-count="99" style="margin-right: 15px" type="info" v-if="showAps">
<a href="javascript:;" @click="goAps">APS排产&nbsp;&nbsp;&nbsp;</a>
</Badge>
<Badge
:count="this.$store.state.countAi"
overflow-count="99"
style="margin-right: 15px"
type="info"
v-if="showAi"
>
<Badge :count="this.$store.state.countAi" overflow-count="99" style="margin-right: 15px" type="info" v-if="showAi">
<a href="javascript:;" @click="goAi">智能排产&nbsp;&nbsp;&nbsp;</a>
</Badge>
<Badge
:count="this.$store.state.countAll"
overflow-count="99"
style="margin-right: 15px"
type="info"
v-if="showAll"
>
<Badge :count="this.$store.state.countAll" overflow-count="99" style="margin-right: 15px" type="info" v-if="showAll">
<a @click="goCemplate">整机排产&nbsp;&nbsp;&nbsp;</a>
</Badge>
<Badge
:count="this.$store.state.countRun"
overflow-count="99"
type="info"
v-if="showRun"
>
<Badge :count="this.$store.state.countRun" overflow-count="99" type="info" v-if="showRun">
<a @click="goStream">流水排产&nbsp;&nbsp;&nbsp;</a>
</Badge>
</template>
......@@ -65,15 +29,11 @@
</DataGrid>
<FooterToolbar extra v-if="footerBar" class="ftball">
<Row>
<Checkbox @on-change="handleSelectAll(single)" v-model="single"
>全选</Checkbox
>
<Checkbox @on-change="handleSelectAll(single)" v-model="single">全选</Checkbox>
<span class="footerSpan">已选 {{ selectCount }} 项</span>
&nbsp;&nbsp;&nbsp;&nbsp;
<Button type="primary" @click="modalDispatch">工艺派发</Button
>&nbsp;&nbsp;&nbsp;&nbsp;
<Button type="primary" @click="modalSchedule">移入排产</Button
>&nbsp;&nbsp;&nbsp;&nbsp;
<Button type="primary" @click="modalDispatch">工艺派发</Button>&nbsp;&nbsp;&nbsp;&nbsp;
<Button type="primary" @click="modalSchedule">移入排产</Button>&nbsp;&nbsp;&nbsp;&nbsp;
<Button @click="canselFooter">取消</Button>
</Row>
</FooterToolbar>
......@@ -86,12 +46,7 @@
<Modal v-model="detailModal" title="详情">
<Detail :eid="curId" />
</Modal>
<Modal
v-model="deletelModal"
title="删除"
@on-ok="removeOk"
@on-cancel="cancel"
>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
<Modal v-model="dispatchModal" title="工艺派发" footer-hide width="800">
......@@ -110,11 +65,7 @@
@on-change="onchangeScheduleType"
></Dictionary>
-->
<RadioGroup
v-model="scheduleType"
class="radioList"
@on-change="onchangeScheduleType"
>
<RadioGroup v-model="scheduleType" class="radioList" @on-change="onchangeScheduleType">
<Radio :label="1" border :disabled="this.$store.state.countAi > 0">
<span>Aps排产</span>
</Radio>
......@@ -131,8 +82,7 @@
<p class="pl30 pt10" v-show="scheduleType != null">
确定将订单
<span class="fwBold">{{ resultsOrderList }}</span> 移入
<span class="red fwBold">{{ scheduleTypeName }}</span
>
<span class="red fwBold">{{ scheduleTypeName }}</span>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
......@@ -141,28 +91,13 @@
<Button type="primary" @click="scheduleOk">确定</Button>
</div>
</Modal>
<Modal
v-model="orderSupportModal"
title="配套下发"
footer-hide
width="1300"
>
<Modal v-model="orderSupportModal" title="配套下发" footer-hide width="1300">
<orderSupport ref="orderSupport"></orderSupport>
</Modal>
<Modal v-model="modalAccessory" :title="title" fullscreen footer-hide>
<component
:is="details"
:eid="orderId"
:mesCode="mesCode"
:productName="productName"
:drawnNumber="drawnNumber"
:productingPreparationPeople="productingPreparationPeople"
:count="count"
@on-close="cancel"
@on-ok="addOk"
/>
<component :is="details" :eid="orderId" :mesCode="mesCode" :productName="productName" :drawnNumber="drawnNumber" :productingPreparationPeople="productingPreparationPeople" :count="count" @on-close="cancel" @on-ok="addOk" />
</Modal>
</div>
</div>
</template>
<script>
......@@ -201,8 +136,7 @@ export default {
scheduleModal: false,
orderSupportModal: false,
curId: 0,
statuList:
this.$store.getters.dictionaryByKey("aps.plan.supportingStatus") || [],
statuList: this.$store.getters.dictionaryByKey("aps.plan.supportingStatus") || [],
name: "",
items: null,
title: "",
......@@ -215,8 +149,7 @@ export default {
drawnNumber: "",
count: 0,
modalAccessory: false,
columns: [
{
columns: [{
key: "selection",
title: "多选",
type: "selection",
......@@ -258,8 +191,7 @@ export default {
align: "center",
render: (h, params) => {
return h(
"op",
{
"op", {
attrs: {
oprate: "detail",
},
......@@ -426,20 +358,17 @@ export default {
align: "center",
render: (h, params) => {
return h(
"div",
{
"div", {
class: "action",
},
[
h(
"op",
{
"op", {
attrs: {
oprate: "detail",
title:
params.row.mainRoutingSetStatus == 0
? "工艺派发"
: "移入排产",
title: params.row.mainRoutingSetStatus == 0 ?
"工艺派发" :
"移入排产",
},
style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
......@@ -447,46 +376,46 @@ export default {
on: {
click: () =>
params.row.mainRoutingSetStatus == 0 ||
params.row.mainRoutingSetStatus == 1
? this.goMethod(params.row)
: null,
params.row.mainRoutingSetStatus == 1 ?
this.goMethod(params.row) :
null,
},
},
params.row.mainRoutingSetStatus == 0 &&
params.row.isPreschedule == 0
? "工艺派发"
: params.row.mainRoutingSetStatus == 1 &&
params.row.isPreschedule == 0
? "移入排产"
: ""
),
h(
"op",
{
attrs: {
oprate: "detail",
title:
params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3
? "配套派发"
: "",
},
style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
},
on: {
click: () =>
params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3
? this.supportDis(params.row)
: null,
},
},
params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3
? "配套派发"
: ""
params.row.isPreschedule == 0 ?
"工艺派发" :
params.row.mainRoutingSetStatus == 1 &&
params.row.isPreschedule == 0 ?
"移入排产" :
""
),
// h(
// "op",
// {
// attrs: {
// oprate: "detail",
// title:
// params.row.isSupportingFinish == 2 ||
// params.row.isSupportingFinish == 3
// ? "配套派发"
// : "",
// },
// style: {
// color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
// },
// on: {
// click: () =>
// params.row.isSupportingFinish == 2 ||
// params.row.isSupportingFinish == 3
// ? this.supportDis(params.row)
// : null,
// },
// },
// params.row.isSupportingFinish == 2 ||
// params.row.isSupportingFinish == 3
// ? "配套派发"
// : ""
// ),
]
);
},
......@@ -516,7 +445,10 @@ export default {
mounted() {
this.loadInitCount();
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......
......@@ -533,9 +533,9 @@ export default {
},
//新增时取消
remove(row, index) {
if (!row.id || !row.groupId) {
this.list.pop();
}
// if (!row.id || !row.groupId) {
// this.list.pop();
// }
this.edit = -1;
},
//新增保存或修改保存
......
<template>
<div>
<EditGrid :columns="columns" ref="grid" :items="list"
>
</EditGrid>
<EditGrid :columns="columns" ref="grid" :items="list"> </EditGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide fullscreen>
<component
:is="detail"
:eid="curId"
:v="row"
/>
</Modal>
</div>
</template>
<script>
......@@ -16,8 +21,12 @@ export default {
},
data() {
return {
title:'',
modal: false,
curId: 0,
list:[],
row: null,
list: [],
detail: null,
columns: [
{
key: "id",
......@@ -32,7 +41,24 @@ export default {
align: "left",
easy: true,
high: true,
render: (h, params) => {
return h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row) },
},
params.row.title
);
},
},
// {
// key: "title",
// title: this.l("title"),
// align: "left",
// easy: true,
// high: true,
// },
{
key: "note",
title: this.l("note"),
......@@ -69,7 +95,7 @@ export default {
h(
"op",
{
attrs: { oprate: "remove",msg:"确定要导入模版吗?" },
attrs: { oprate: "remove", msg: "确定要导入模版吗?" },
on: { click: () => this.useTemplate(params.row.id) },
},
"导入"
......@@ -105,24 +131,30 @@ export default {
this.curId = "";
},
load() {
Api.templates({
}).then(r=>{
this.list=r.result;
})
Api.templates({}).then((r) => {
this.list = r.result;
});
},
useTemplate(id) {
Api.useTemplate({
id:id,
projectId:this.eid
}).then(r=>{
if(r.success){
id: id,
projectId: this.eid,
}).then((r) => {
if (r.success) {
this.$Message.success("导入成功");
this.$emit("on-load")
this.$emit("on-load");
}
})
});
},
view(row) {
console.log("111");
console.log(row);
this.title="查看";
this.modal = true;
this.row = row;
this.curId = row.id;
this.detail = () => import("../resources/templates/detail.vue");
},
l(key) {
let vkey = "project_template" + "." + key;
return this.$t(vkey) || key;
......
<template>
<div>
<Card>
<EditGrid :columns="columns" ref="grid" :items="list" :level="8" :drag="true" :exportTitle="exportTl">
<EditGrid :columns="columns" ref="grid" :batch="true" :items="list" :level="8" :drag="true" :exportTitle="exportTl">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"><Input placeholder="请输入关键字标题" v-model="easySearch.keys.value" />
......@@ -15,7 +15,8 @@
</template> -->
<template slot="buttons">
<Button type="primary" @click="add(null)">新增</Button>
<Dropdown @on-click="show">
<Button @mouseenter.native="showBm" ref="showBtn" shape="circle" icon="md-settings"></Button>
<Dropdown @on-click="show" v-if="false">
<Button shape="circle" icon="md-settings"></Button>
<DropdownMenu slot="list">
<DropdownItem name="saveTemplate">存为模版</DropdownItem>
......@@ -31,9 +32,11 @@
</template>
</EditGrid>
</Card>
<Submenus :show="showStatu" :data="tempItems" :params="params"></Submenus>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" />
</Modal>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div>
</template>
......@@ -77,7 +80,6 @@ export default {
},
modal: false,
title: "新增",
exportTl: '项目目录',
detail: null,
curId: null,
list: [],
......@@ -93,6 +95,12 @@ export default {
type: "selection",
align: 'center'
},
{
key: "upTitle",
title: this.l("upTitle"),
hide: true,
export: true,
},
{
key: "title",
title: this.l("title"),
......@@ -238,6 +246,14 @@ export default {
},
},
],
//setButon
showStatu: false, //控件是否显示
tempItems: [], //控件数据
params: {}, //控件坐标位置
//导出导入
exportTl: '项目目录',
ModalIm: false,
temTitle: "项目目录",
};
},
mounted() {
......@@ -376,13 +392,118 @@ export default {
that.modal = true;
},
}
//导出excel
if (name == 'down') {
this.exportTl = '项目目录-' + this.data.title;
this.$refs.grid.export2Excel()
}
if (name == 'importExcel') {
this.openModalIm()
}
m[name] && m[name](name);
},
saveTemplate() {
var that = this;
that.curId = that.eid;
that.row = that.data;
that.title = "保存模版";
that.detail = () => import("./saveTemplate");
that.modal = true;
},
useTemplate() {
var that = this;
that.curId = that.eid;
that.row = that.data;
that.title = "导入模版";
that.detail = () => import("./importTemplate");
that.modal = true;
},
down() {
this.exportTl = '项目目录-' + this.data.title;
this.$refs.grid.export2Excel()
},
importExcel() {
this.openModalIm()
},
showBm(event) {
let obj = event.target
let objSet = obj.getBoundingClientRect()
this.showStatu = true;
this.params = {
x: objSet.x,
y: objSet.bottom
};
console.log(event)
this.tempItems = [{
label: "存为模版",
onClick: () => {
this.saveTemplate()
},
}, {
label: "导入模版",
divided: true,
onClick: () => {
this.useTemplate()
},
},
{
label: "导出Excel",
icon: "md-cloud-download",
onClick: () => {
this.down()
},
},
{
label: "导入Excel",
icon: "md-cloud-upload",
onClick: () => {
this.importExcel()
},
}
];
},
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true
},
ModalImCancel() {
this.ModalIm = false
},
getData(val) {
let url = `${material}/projectplan/importplans`;
this.$refs.importExcel.deelData(url, this.columns, this.formatMethod(val))
},
//根据页面二次处理数据
formatMethod(val) {
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
projectId: this.eid,
upTitle: ele.upTitle ? ele.upTitle : null,
title: ele.title ? ele.title : '',
status: 0,
type: ele.type ? ele.type : 0, //?
startDate: ele.startDate ? ele.startDate : "", //?
endDate: ele.endDate ? ele.endDate : "", //?
direction: ele.direction ? ele.direction : 0,
executor: ele.executor ? ele.executor : [], //?
deliverable: ele.deliverable ? ele.deliverable : 0
};
if (ele.title && ele.title != '') {
obj.ico = false
} else {
obj.ico = true
}
tempList.push(obj);
});
return tempList
},
//批量导入end
l(key) {
let vkey = "project_plan" + "." + key;
return this.$t(vkey) || key;
......
......@@ -79,8 +79,7 @@
></Col>
<Col :span="12">
<FormItem label="开始结束时间" prop="date">
<DateRange v-model="entity" edit></DateRange>
</FormItem
<DateRange v-model="entity" edit></DateRange> </FormItem
></Col>
<Col :span="12"
......@@ -200,8 +199,23 @@ export default {
}
Api.create(this.entity)
.then((r) => {
debugger;
if (r.success) {
this.$Message.success("保存成功");
//添加当前登陆人为项目经理
var user = this.$store.state.userInfo;
var entity = {
userId: user.id,
role: 0,
status: 1,
joindate: "",
whour: 14,
whourpd: 7.0,
authority: 2,
projectId: r.result.id,
note: user.name,
};
Api.addMaster(entity);
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
......
......@@ -16,6 +16,10 @@ export default {
update(params){
return Api.post(`${material}/projectmain/update`,params);
},
addMaster(params) {
return Api.post(`${material}/projectgroupuser/create`, params);
},
delete(id) {
return Api.delete(`${material}/projectmain/delete`,{params:{id:id}});
},
......
......@@ -19,13 +19,21 @@
}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{
entity.deleterUserId
}}</Filed> -->
<Filed :span="12" :name="l('title')">{{ entity.title }}</Filed>
}}</Filed>
<Filed :span="12" :name="l('template')">{{ entity.template }}</Filed>
<Filed :span="12" :name="l('attachment')">{{ entity.attachment }}</Filed>
<Filed :span="12" :name="l('type')">{{ entity.type }}</Filed>
<Filed :span="12" :name="l('type')">{{ entity.type }}</Filed>-->
<Filed :span="8" :name="l('title')">{{ entity.title }}</Filed>
<Filed :span="8" :name="l('creationTime')">{{
entity.creationTime
}}</Filed>
<Filed :span="8" :name="l('creatorUserId')">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="24" :name="l('note')">{{ entity.note }}</Filed>
</Row>
<EditGrid :columns="columns" ref="grid" :items="list" :level="8" >
</EditGrid>
</div>
</template>
<script>
......@@ -39,20 +47,124 @@ export default {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
exportTl: "项目目录",
list: [],
columns: [
{
key: "title",
title: this.l("title"),
align: "left",
tree: true,
easy: true,
high: true,
export: true,
},
{
key: "type",
width: 90,
title: this.l("type"),
align: "center",
high: true,
code: "mes.project_plan.Type",
attr: {
type: "icon",
},
export: true,
},
{
key: "direction",
title: this.l("direction"),
align: "center",
// code: "mes.project_plan.direction",
width: 80,
easy: true,
high: true,
export: true,
},
{
key: "status",
title: this.l("status"),
align: "center",
width: 80,
high: true,
// code: "mes.project_plan.Status",
export: true,
},
{
key: "startDate",
title: "计划开始日期",
hide: true,
export: true,
},
{
key: "endDate",
title: "计划结束日期",
hide: true,
export: true,
},
{
key: "dateRange",
width: 250,
title: "计划日期",
align: "center",
render(h, param) {
return h("DateRange", {
attrs: {
value: param.row,
},
});
},
},
{
key: "executor",
title: this.l("executor"),
align: "left",
high: true,
type: "users",
export: true,
},
{
key: "deliverable",
title: this.l("deliverable"),
// code: "mes.project_plan.deliverable",
width: 80,
align: "center",
easy: true,
high: true,
export: true,
},
],
};
},
props: {
eid: String,
},
mounted() {
if (this.eid ) {
if (this.eid) {
this.load(this.eid);
}
},
async fetch({ store, params }) {
// await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
load(v) {
console.log(this.$store.state.dictionary)
Api.get({ id: v }).then((r) => {
this.entity = r.result;
console.log(JSON.parse(this.entity.template));
var data = this.$u.toTree(
JSON.parse(this.entity.template),
null,
(u) => {
// console.log(u);
// u.expanded = true;
// u.selected = false;
// u.checked = false;
},
"upId"
);
this.list = data;
this.$emit("on-load");
});
},
......@@ -66,7 +178,7 @@ export default {
},
watch: {
eid(v) {
if (v !="") {
if (v != "") {
this.load(v);
}
},
......@@ -74,7 +186,10 @@ export default {
};
</script>
<style lang="less" scoped>
.detail{
.detail {
width: 100%;
}
.detail .ivu-row{
height: auto;
}
</style>style>
\ No newline at end of file
......@@ -21,7 +21,7 @@
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen='fullscreen'>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
......@@ -41,6 +41,7 @@ export default {
},
data() {
return {
fullscreen:false,
action: Api.index,
easySearch: {
keys: { op: "title", value: null },
......@@ -180,6 +181,7 @@ export default {
},
mounted() {
console.log(this);
console.log("dictionary",this.$store.state.dictionary)
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -206,6 +208,7 @@ export default {
this.modal = true;
},
view(id) {
this.fullscreen=true;
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
......
......@@ -5,7 +5,7 @@
<div class="example_split"></div>
<div class="example-code" :style="styleH">
<div :style='opacity'>
<pre><code class="hljs"><span class="hljs-tag"><<span class="hljs-title">template</span>></span>
<pre><code class="hljs"><span class="hljs-tag"><span class="hljs-title">template</span>></span>
<span class="hljs-tag"><<span class="hljs-title">Table</span> <span class="hljs-attribute">:columns</span>=<span class="hljs-value">"columns1"</span> <span class="hljs-attribute">:data</span>=<span class="hljs-value">"data1"</span>></span><span class="hljs-tag"></<span class="hljs-title">Table</span>></span>
<span class="hljs-tag"></<span class="hljs-title">template</span>></span>
<span class="hljs-tag"><<span class="hljs-title">script</span>></span><span class="javascript">
......
......@@ -9,6 +9,14 @@
<h2>Bmenu</h2>
<div @contextmenu="onCon" class="tc" style="width:120px;height:40px;line-height:40px;background:#f5f5f5;border:#ccc solid 1px; border-radius: 5px;">{{message}}</div>
</div>
<div class="mt50 pl10">
<h2>mouseenter</h2>
<p>
<Button @mouseenter.native="showBm" ref="showBtn" shape="circle" icon="ios-settings"></Button>
<div @mouseover="showBm" v-if="false" ref="showB" class="tc" style="width:120px;height:40px;line-height:40px;background:#f5f5f5;border:#ccc solid 1px; border-radius: 5px;">mouseenter打开菜单</div>
</p>
</div>
</div>
</template>
......@@ -43,13 +51,13 @@ export default {
this.tempItems = [{
label: "返回(B)",
onClick: () => {
this.showStatu = false;
alert("tttt")
},
}, {
label: "前进(F)",
disabled: true,
onClick: () => {
this.showStatu = false;
alert("11")
},
},
{
......@@ -57,13 +65,13 @@ export default {
divided: true,
icon: "el-icon-refresh",
onClick: () => {
this.showStatu = false;
alert("222")
},
},
{
label: "另存为(A)...",
onClick: () => {
this.showStatu = false;
alert("333")
},
},
{
......@@ -223,6 +231,79 @@ export default {
});
event.preventDefault();
},
showBm(event) {
let obj = event.target
let objSet = obj.getBoundingClientRect()
this.showStatu = true;
this.params = {
x: objSet.x,
y: objSet.bottom
};
console.log(event)
this.tempItems = [{
label: "返回(B)",
onClick: () => {
alert("11")
},
}, {
label: "前进(F)",
disabled: true,
onClick: () => {
alert("222")
},
},
{
label: "重新加载(R)",
divided: true,
icon: "el-icon-refresh",
onClick: () => {
alert("33")
},
},
{
label: "另存为(A)...",
onClick: () => {
alert("44")
},
},
{
label: "打印(P)...",
icon: "el-icon-printer",
onClick: () => {
alert("55")
},
},
{
label: "投射(C)...",
divided: true,
onClick: () => {
alert("66")
},
},
{
label: "使用网页翻译(T)",
divided: true,
minWidth: 0,
children: [{
label: "翻译成简体中文",
onClick: () => {
alert("77")
},
},
{
label: "翻译成繁体中文",
onClick: () => {
alert("88")
},
},
],
},
];
event.preventDefault();
},
leaveBm(event) {
this.showStatu = false;
}
},
};
</script>
......
......@@ -7,7 +7,7 @@
:key="index"
@mouseenter="navClick(item,index)"
>
<Icon type="ios-stats" class="f16" />{{ item.name }}
<Icon :type="item.icons" class="f16" />{{ item.name }}
</li>
</ul>
......@@ -42,149 +42,7 @@ import viewerVue from "../test/viewer.vue";
export default {
data() {
return {
navMenus: false,
onetest: "0",
menus: [
{
name: "项目管理",
style:{
left:'260px',
top:"100px"
},
children: [
{
name: "项目管理",
type: 2,
code: "",
icon: "",
target: 0,
url: "/project/project",
status: 1,
description: "",
source: 0,
app: "mes_roter",
priority: 0,
id: 541,
title: "项目管理",
expand: true,
upId: 537,
lay: 2,
children: null,
data: null,
},
{
name: "任务中心",
type: 2,
code: "",
icon: "",
target: 0,
url: "/project/task",
status: 1,
description: "",
source: 0,
app: "mes_roter",
priority: 0,
id: 542,
title: "任务中心",
expand: true,
upId: 537,
lay: 2,
children: null,
data: null,
},
{
name: "项目资源",
type: 2,
code: "",
icon: "",
target: 0,
url: "/project/resources",
status: 1,
description: "",
source: 0,
app: "mes_roter",
priority: 0,
id: 543,
title: "项目资源",
expand: true,
upId: 537,
lay: 2,
children: null,
data: null,
},
],
},
{
name: "文档管理",
style:{
left:'260px',
top:"190px"
},
children: [
{
name: "文档分类",
type: 2,
code: "",
icon: "",
target: 0,
url: "/word/classification",
status: 1,
description: "",
source: 0,
app: "mes_roter",
priority: 0,
id: 544,
title: "文档分类",
expand: true,
upId: 539,
lay: 2,
children: null,
data: null,
},
{
name: "文档管理",
type: 2,
code: "",
icon: "",
target: 0,
url: "/word/document",
status: 1,
description: "",
source: 0,
app: "mes_roter",
priority: 0,
id: 545,
title: "文档管理",
expand: true,
upId: 539,
lay: 2,
children: null,
data: null,
},
{
name: "模板类型",
type: 2,
code: "",
icon: "",
target: 0,
url: "/word/template",
status: 1,
description: "",
source: 0,
app: "mes_roter",
priority: 0,
id: 546,
title: "模板类型",
expand: true,
upId: 539,
lay: 2,
children: null,
data: null,
},
],
},
{ name: "大屏展示" },
],
menus: [],
list: [],
arrList: [],
isIndex: -1,
......@@ -204,16 +62,25 @@ export default {
this.$api.get(`${systemUrl}/menu/getusermenu?id=mes_roter`).then((r) => {
if (r.result) {
let arr = r.result[0].children.map((l) => {
if (
!this.$u.isNull(l.description) &&
l.description.indexOf("{") > -1
) {
if ( !this.$u.isNull(l.description) && l.description.indexOf("{") > -1 ) {
l.style = eval("(" + l.description + ")");
}
return l;
});
console.log("arr", arr);
this.arrList = arr;
this.arrList.map(v=>{
if(v.name=='项目管理'){
this.menus[0]=v;
this.menus[0].icons='ios-list-box-outline';
}else if(v.name=='文档管理'){
this.menus[1]=v;
this.menus[1].icons='md-document';
}else if(v.name=='大屏展示'){
this.menus[2]=v;
this.menus[2].icons='ios-stats';
}
})
console.log(this.menus)
}
});
},
......@@ -238,7 +105,6 @@ export default {
}
},
navClick(v,index) {
if (v.children && v.children.length > 0) {
var { left, top } = v.style;
this.list = v.children;
......
......@@ -10,10 +10,10 @@ export const state = () => ({
userId: 0,
userName: ""
},
messages:[],
departments:{},//部门列表
messages: [],
departments: {}, //部门列表
cart: [],
collect:[],//用户收藏
collect: [], //用户收藏
count: 0,
countAps: 0, //aps排产
countAi: 0, //智能排产
......@@ -23,20 +23,23 @@ export const state = () => ({
export const getters = {
dictionaryByKey: (state) => (key) => {
let result = [];
if (state && state.dictionary) {
let items = state.dictionary.get(key);
if (items) {
// console.info("items",items)
return items;
}
}
return result;
},
dictionaryByCode: (state) => (key,code) => {
dictionaryByCode: (state) => (key, code) => {
let result = null;
let items = state.dictionary.get(key);
if (items) {
// console.info("items",items)
return items.filter(u=>{
return u.code==code
return items.filter(u => {
return u.code == code
})[0];
}
return result;
......@@ -94,21 +97,21 @@ export const mutations = {
setCountRun(state, count) { //设置流水排产数量
state.countRun = count;
},
setDepartments(state,departmentsMap)
{
setDepartments(state, departmentsMap) {
state.departmentsMap = departmentsMap;
},
setMessages(state,list){
state.messages=list;
setMessages(state, list) {
state.messages = list;
}
}
export const actions = {
async loadMessages({commit}){
async loadMessages({ commit }) {
let {
result
} = await Api.get(`${systemUrl}/usermessage/getusermesssage`, {
status: 0,userId:this.state.userInfo.userId
status: 0,
userId: this.state.userInfo.userId
});
// console.warn("getusermesssage---", result)
commit("setMessages", result);
......@@ -206,6 +209,6 @@ export const plugins = [
list: ["hyhmes.session"],
},
}),
]
//设置 strict 为不严格模式,即可在actions中修改state
]
//设置 strict 为不严格模式,即可在actions中修改state
export const strict = false;
\ No newline at end of file
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