Commit 5c9f906e authored by renjintao's avatar renjintao

excute

parent 83a1b691
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
/> />
</slot> </slot>
</div>&nbsp; </div>&nbsp;
<Button v-if="high" @click="modalSearch=true" type="text"><Icon type="md-search" />高级</Button> <Button v-if="high" @click="modalSearch=true" type="text">
<Icon type="md-search" />高级
</Button>
<div class="searchBack"> <div class="searchBack">
<slot name="searchBack"></slot> <slot name="searchBack"></slot>
</div> </div>
...@@ -39,6 +41,7 @@ ...@@ -39,6 +41,7 @@
:data="list" :data="list"
:height="tableHeight" :height="tableHeight"
:draggable="draggable" :draggable="draggable"
:size="size"
ref="table" ref="table"
class="tableCommon" class="tableCommon"
@on-expand="expand" @on-expand="expand"
...@@ -113,10 +116,10 @@ ...@@ -113,10 +116,10 @@
<script> <script>
export default { export default {
name: 'DataGrid', name: "DataGrid",
data() { data() {
return { return {
keys: '', keys: "",
selectItems: [], selectItems: [],
footerToolbar: false, footerToolbar: false,
modalSearch: false, modalSearch: false,
...@@ -135,7 +138,7 @@ export default { ...@@ -135,7 +138,7 @@ export default {
userConfig: null, //用户页面配置信息。, userConfig: null, //用户页面配置信息。,
// userId: 1 // userId: 1
userId: this.$store.state.userInfo.userId userId: this.$store.state.userInfo.userId
} };
}, },
props: { props: {
border: { border: {
...@@ -155,7 +158,11 @@ export default { ...@@ -155,7 +158,11 @@ export default {
}, },
placeholder: { placeholder: {
type: String, type: String,
default: '请输入关键字' default: "请输入关键字"
},
size: {
type: String,
default: "default "
}, },
height: { height: {
type: Number, type: Number,
...@@ -195,7 +202,7 @@ export default { ...@@ -195,7 +202,7 @@ export default {
// 当作table使用,直接显示数据 // 当作table使用,直接显示数据
type: Array, type: Array,
default: function() { default: function() {
return [] return [];
} }
}, },
columns: { columns: {
...@@ -206,23 +213,23 @@ export default { ...@@ -206,23 +213,23 @@ export default {
action: { action: {
//接口地址 //接口地址
type: String, type: String,
default: '' default: ""
}, },
conditions: { conditions: {
//查询条件 //查询条件
type: Object, type: Object,
default: function() { default: function() {
return { return {
keys: { op: 'name', value: '', default: true } keys: { op: "name", value: "", default: true }
} };
} }
}, },
type: { type: {
type: String, type: String,
default: 'table', default: "table",
validator: function(value) { validator: function(value) {
// 这个值必须匹配下列字符串中的一个 // 这个值必须匹配下列字符串中的一个
return ['table', 'card', 'list'].indexOf(value) !== -1 return ["table", "card", "list"].indexOf(value) !== -1;
} }
}, },
span: { span: {
...@@ -231,71 +238,71 @@ export default { ...@@ -231,71 +238,71 @@ export default {
} }
}, },
created() { created() {
this.columns.forEach((u) => { this.columns.forEach(u => {
if (!u.hide) { if (!u.hide) {
u.hide = false u.hide = false;
} }
}) });
this.columnsCur = this.$u.clone(this.columns) this.columnsCur = this.$u.clone(this.columns);
}, },
mounted() { mounted() {
if (this.data&&this.data.length>0) { if (this.data && this.data.length > 0) {
this.list = this.data this.list = this.data;
return return;
} }
this.keys = '' this.keys = "";
this.intY() this.intY();
if (this.lazy==true) { if (this.lazy == true) {
return; return;
} }
this.loadUserConfig() this.loadUserConfig();
if (this.height === 0) { if (this.height === 0) {
window.onresize = () => { window.onresize = () => {
///浏览器窗口大小变化 ///浏览器窗口大小变化
return (() => { return (() => {
window.screenHeight = window.innerHeight window.screenHeight = window.innerHeight;
this.tableHeight = window.screenHeight - this.firstY - 60 this.tableHeight = window.screenHeight - this.firstY - 60;
})() })();
} };
} else { } else {
this.tableHeight = this.height this.tableHeight = this.height;
} }
//注册拖拽事件。 //注册拖拽事件。
this.$dragging.$on('dragend', (e) => { this.$dragging.$on("dragend", e => {
// console.log("dragend",e); // console.log("dragend",e);
this.saveUserconfig() this.saveUserconfig();
}) });
}, },
methods: { methods: {
//数据加载 //数据加载
load() { load() {
if (this.height == 0) { if (this.height == 0) {
this.tableHeight = window.innerHeight - this.firstY - 60 this.tableHeight = window.innerHeight - this.firstY - 60;
} }
if (this.action) { if (this.action) {
this.$api.post(this.action, this.search).then((r) => { this.$api.post(this.action, this.search).then(r => {
this.list = r.result.items this.list = r.result.items;
this.search.total = r.result.totalCount this.search.total = r.result.totalCount;
}) });
} }
}, },
columnInit() { columnInit() {
if (this.userConfig) { if (this.userConfig) {
var curColumns = [] var curColumns = [];
var config = JSON.parse(this.userConfig.content) var config = JSON.parse(this.userConfig.content);
// console.warn("2:列比对",config) // console.warn("2:列比对",config)
if (config.length == this.columnsCur.length) { if (config.length == this.columnsCur.length) {
config.map((u) => { config.map(u => {
var item = this.columnsCur.filter((c) => { var item = this.columnsCur.filter(c => {
return c.key == u.key return c.key == u.key;
}) });
if (item[0]) { if (item[0]) {
item[0].hide = u.hide item[0].hide = u.hide;
curColumns.push(item[0]) curColumns.push(item[0]);
} }
}) });
// console.warn("3:初始化列") // console.warn("3:初始化列")
this.columnsCur = curColumns this.columnsCur = curColumns;
} }
} }
}, },
...@@ -303,210 +310,209 @@ export default { ...@@ -303,210 +310,209 @@ export default {
var query = { var query = {
conditions: [ conditions: [
{ {
fieldName: 'creatorUserId', fieldName: "creatorUserId",
fieldValue: this.userId, fieldValue: this.userId,
conditionalType: 'Equal' conditionalType: "Equal"
}, },
{ {
fieldName: 'component', fieldName: "component",
fieldValue: 'Grid', fieldValue: "Grid",
conditionalType: 'Equal' conditionalType: "Equal"
}, },
{ {
fieldName: 'page', fieldName: "page",
fieldValue: window.location.pathname, fieldValue: window.location.pathname,
conditionalType: 'Equal' conditionalType: "Equal"
} }
], ],
pageSize: 1 pageSize: 1
} };
this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => { this.$api.post(`${window.systemUrl}/config/list`, query).then(r => {
if (r.success) { if (r.success) {
if (r.result.length == 1) { if (r.result.length == 1) {
this.userConfig = r.result[0] this.userConfig = r.result[0];
// console.warn("1:加载用户配置") // console.warn("1:加载用户配置")
this.columnInit() this.columnInit();
} }
if (!this.configLoad) { if (!this.configLoad) {
this.easySearch() this.easySearch();
} }
this.configLoad = true this.configLoad = true;
} }
}) });
}, },
saveUserconfig() { saveUserconfig() {
let url = `${window.systemUrl}/config/update` let url = `${window.systemUrl}/config/update`;
var content = [] var content = [];
this.columnsCur.map((u) => { this.columnsCur.map(u => {
content.push({ content.push({
key: u.key, key: u.key,
hide: u.hide hide: u.hide
}) });
}) });
if (!this.userConfig) { if (!this.userConfig) {
url = `${window.systemUrl}/config/create` url = `${window.systemUrl}/config/create`;
var data = { var data = {
page: window.location.pathname, page: window.location.pathname,
component: 'Grid', component: "Grid",
key: this.$u.guid(), key: this.$u.guid(),
content: JSON.stringify(content) content: JSON.stringify(content)
} };
this.$api.post(url, data).then((r) => { this.$api.post(url, data).then(r => {
this.loadUserConfig() this.loadUserConfig();
}) });
} else { } else {
this.userConfig.content = JSON.stringify(content) this.userConfig.content = JSON.stringify(content);
this.$api.post(url, this.userConfig) this.$api.post(url, this.userConfig);
} }
}, },
//展开 //展开
expand(row, status) { expand(row, status) {
this.$emit('on-expand', row, status) this.$emit("on-expand", row, status);
}, },
//拖拽 //拖拽
onDragDrop(a, b) { onDragDrop(a, b) {
this.$emit('on-drag-drop', a, b) this.$emit("on-drag-drop", a, b);
}, },
easySearch() { easySearch() {
if (this.conditions && this.conditions.keys.default) { if (this.conditions && this.conditions.keys.default) {
//判断没有传入条件的用默认的查询 //判断没有传入条件的用默认的查询
this.conditions.keys.value = this.keys this.conditions.keys.value = this.keys;
} }
this.reload(this.conditions) this.reload(this.conditions);
}, },
undoConfig() { undoConfig() {
//列设置恢复初始化 //列设置恢复初始化
this.columnsCur = this.$u.clone(this.columns) this.columnsCur = this.$u.clone(this.columns);
this.saveUserconfig() this.saveUserconfig();
}, },
complexSearch() { complexSearch() {
var search = this.$refs.search.$children.filter((u) => { var search = this.$refs.search.$children.filter(u => {
return u.condition return u.condition;
}) });
if (search) { if (search) {
var conditions = search[0].condition var conditions = search[0].condition;
this.reload(conditions) this.reload(conditions);
} }
}, },
reload(conditions) { reload(conditions) {
var where = [] var where = [];
if (conditions) { if (conditions) {
Object.keys(conditions).forEach((u) => { Object.keys(conditions).forEach(u => {
let v = conditions[u].value let v = conditions[u].value;
let op = conditions[u].op let op = conditions[u].op;
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
if (op == 'Range') { if (op == "Range") {
let times = [] let times = [];
v.map((u) => { v.map(u => {
if (!this.$u.isNull(u)) { if (!this.$u.isNull(u)) {
times.push(this.$u.toTime(u)) times.push(this.$u.toTime(u));
} }
}) });
v = times.join(',') v = times.join(",");
} else if (op.indexOf('In') > -1) { } else if (op.indexOf("In") > -1) {
v = v.join(',') v = v.join(",");
} }
if (!this.$u.isNull(v)) { if (!this.$u.isNull(v)) {
where.push({ where.push({
fieldName: u, fieldName: u,
fieldValue: v, fieldValue: v,
conditionalType: op conditionalType: op
}) });
} }
} }
}) });
} }
this.search.pageIndex = 1 this.search.pageIndex = 1;
this.search.conditions = where this.search.conditions = where;
this.load() this.load();
}, },
pageChange(page) { pageChange(page) {
this.search.page = page this.search.page = page;
this.search.pageIndex = page this.search.pageIndex = page;
this.load() this.load();
}, },
pageSizeChange(size) { pageSizeChange(size) {
this.search.pageSize = size this.search.pageSize = size;
this.search.pageIndex = 1 this.search.pageIndex = 1;
this.load() this.load();
}, },
columnChange(item, i) { columnChange(item, i) {
item.hide = !item.hide item.hide = !item.hide;
this.$set(this.columnsCur, item, i) this.$set(this.columnsCur, item, i);
this.saveUserconfig() this.saveUserconfig();
}, },
selectionChange(items) { selectionChange(items) {
this.$emit('on-selection-change', items) this.$emit("on-selection-change", items);
this.selectItems = items this.selectItems = items;
this.footerToolbar = items.length > 0 this.footerToolbar = items.length > 0;
}, },
onSelect(rows, row) { onSelect(rows, row) {
this.$emit('on-selection-change', rows, row) this.$emit("on-selection-change", rows, row);
}, },
intY() { intY() {
if (this.$refs.table != undefined) { if (this.$refs.table != undefined) {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
} }
}, },
selectAll(status) { selectAll(status) {
this.$refs.table.selectAll(status) this.$refs.table.selectAll(status);
}, }
}, },
computed: { computed: {
columnsNow() { columnsNow() {
var cols = this.columnsCur.filter((u) => { var cols = this.columnsCur.filter(u => {
if (u.code) { if (u.code) {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key let values = u.key;
let type = 'text' let type = "text";
if (u.category) { if (u.category) {
type = u.category type = u.category;
} }
return h('state', { return h("state", {
props: { props: {
code: u.code, code: u.code,
type: type, type: type,
value: params.row[values] + '' value: params.row[values] + ""
}
})
} }
});
};
} }
if (u.type == 'user') { if (u.type == "user") {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key let values = u.key;
return h('User', { return h("User", {
props: { props: {
value: params.row[values] value: params.row[values]
} }
}) });
};
} }
} if (u.type == "date" || u.type == "dateTime") {
if (u.type == 'date' || u.type == 'dateTime') {
u.render = (h, params) => { u.render = (h, params) => {
let values = u.key let values = u.key;
return h('DTSpan', { return h("DTSpan", {
props: { props: {
type: u.type, type: u.type,
value: params.row[values] value: params.row[values]
} }
}) });
} };
} }
return !u.hide return !u.hide;
}) });
return cols return cols;
} }
}, },
watch:{ watch: {
"data.length"(){ "data.length"() {
this.list=this.data; this.list = this.data;
}, },
"height"() height() {
{ this.tableHeight = this.height;
this.tableHeight=this.height;
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -515,7 +521,6 @@ export default { ...@@ -515,7 +521,6 @@ export default {
// height: 100%; // height: 100%;
.tableCommon { .tableCommon {
width: 100%; width: 100%;
} }
.tip { .tip {
display: inline; display: inline;
...@@ -602,4 +607,5 @@ export default { ...@@ -602,4 +607,5 @@ export default {
color: #249e91; color: #249e91;
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div style="padding: 0;"> <div style="padding: 0;" class="excute">
<DataGrid <DataGrid
style="margin-top: -25px; margin-bottom: -25px;" style="margin-top: -25px; margin-bottom: -25px;"
:columns="columns" :columns="columns"
...@@ -11,16 +11,12 @@ ...@@ -11,16 +11,12 @@
:data="data1" :data="data1"
:page="false" :page="false"
:height="gridHeight" :height="gridHeight"
:size="size"
></DataGrid> ></DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800"> <Modal v-model="editModal" title="编辑" footer-hide width="800">
<Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" /> <Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" />
</Modal> </Modal>
<Modal <Modal v-model="insertlModal" :title="insertTItle" @on-ok="insertOk" @on-cancel="cancel">
v-model="insertlModal"
:title="insertTItle"
@on-ok="insertOk"
@on-cancel="cancel"
>
<p>确定进行 {{ insertTItle }} 操作?</p> <p>确定进行 {{ insertTItle }} 操作?</p>
</Modal> </Modal>
<Modal v-model="setParsModal" title="工序参数设置" footer-hide width="1000"> <Modal v-model="setParsModal" title="工序参数设置" footer-hide width="1000">
...@@ -43,10 +39,10 @@ export default { ...@@ -43,10 +39,10 @@ export default {
name: "list", name: "list",
components: { components: {
Edit, Edit,
Add, Add
}, },
props: { props: {
rowId: { type: Number }, rowId: { type: Number }
}, },
data() { data() {
return { return {
...@@ -54,8 +50,8 @@ export default { ...@@ -54,8 +50,8 @@ export default {
easySearch: { easySearch: {
keys: { keys: {
op: "task_seq", op: "task_seq",
value: null, value: null
}, }
}, },
setParsModal: false, setParsModal: false,
editModal: false, editModal: false,
...@@ -64,6 +60,7 @@ export default { ...@@ -64,6 +60,7 @@ export default {
rowIndex: null, rowIndex: null,
curId: 0, curId: 0,
gridHeight: 50, gridHeight: 50,
size: "small",
columns: [ columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{ title: " ", width: 130 }, { title: " ", width: 130 },
...@@ -80,9 +77,9 @@ export default { ...@@ -80,9 +77,9 @@ export default {
props: { props: {
content: content:
params.row.important_flag == 1 ? "取消插单" : "进行插单", params.row.important_flag == 1 ? "取消插单" : "进行插单",
placement: "top", placement: "top"
}, },
class: "ico", class: "ico"
}, },
[ [
h("Icon", { h("Icon", {
...@@ -92,43 +89,43 @@ export default { ...@@ -92,43 +89,43 @@ export default {
? "ios-flag" ? "ios-flag"
: "ios-flag-outline", : "ios-flag-outline",
size: 20, size: 20,
color: params.row.important_flag == 1 ? "#2680EB" : "#aaa", color: params.row.important_flag == 1 ? "#2680EB" : "#aaa"
}, },
on: { on: {
click: () => this.changeFlag(params.row.id, params.index), click: () => this.changeFlag(params.row.id, params.index)
}, }
}), })
] ]
); );
}, }
}, },
{ {
key: "task_seq", key: "task_seq",
title: this.l("task_seq"), title: this.l("task_seq"),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true
}, },
{ {
key: "op_task_pk", key: "op_task_pk",
title: this.l("op_task_pk"), title: this.l("op_task_pk"),
align: "left", align: "left",
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "task_name", key: "task_name",
title: this.l("task_name"), title: this.l("task_name"),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true
}, },
{ {
key: "part_task_pk", key: "part_task_pk",
title: this.l("part_task_pk"), title: this.l("part_task_pk"),
align: "left", align: "left",
high: true, high: true,
hide: true, hide: true
}, },
{ {
...@@ -136,7 +133,7 @@ export default { ...@@ -136,7 +133,7 @@ export default {
title: this.l("put_into_qty"), title: this.l("put_into_qty"),
align: "left", align: "left",
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "plan_start", key: "plan_start",
...@@ -144,7 +141,7 @@ export default { ...@@ -144,7 +141,7 @@ export default {
align: "center", align: "center",
high: true, high: true,
width: 140, width: 140,
hide: true, hide: true
}, },
{ {
key: "plan_finish", key: "plan_finish",
...@@ -152,52 +149,52 @@ export default { ...@@ -152,52 +149,52 @@ export default {
align: "center", align: "center",
high: true, high: true,
width: 140, width: 140,
hide: true, hide: true
}, },
{ {
key: "first_equip", key: "first_equip",
title: this.l("first_equip"), title: this.l("first_equip"),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true
}, },
{ {
key: "setup_time", key: "setup_time",
title: this.l("setup_time"), title: this.l("setup_time"),
align: "right", align: "right",
high: true, high: true
}, },
{ {
key: "run_time", key: "run_time",
title: this.l("run_time"), title: this.l("run_time"),
align: "right", align: "right",
high: true, high: true
}, },
{ {
key: "outside_time", key: "outside_time",
title: this.l("outside_time"), title: this.l("outside_time"),
align: "right", align: "right",
high: true, high: true
}, },
{ {
key: "transport_time", key: "transport_time",
title: this.l("transport_time"), title: this.l("transport_time"),
align: "right", align: "right",
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "check_time", key: "check_time",
title: this.l("check_time"), title: this.l("check_time"),
align: "right", align: "right",
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "efficiency_value", key: "efficiency_value",
title: this.l("efficiency_value"), title: this.l("efficiency_value"),
align: "right", align: "right",
high: true, high: true
}, },
{ {
key: "machine_rule", key: "machine_rule",
...@@ -205,14 +202,14 @@ export default { ...@@ -205,14 +202,14 @@ export default {
align: "center", align: "center",
easy: true, easy: true,
high: true, high: true,
width: 140, width: 140
}, },
{ {
key: "singleout", key: "singleout",
title: this.l("singleout"), title: this.l("singleout"),
align: "left", align: "left",
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "equip_type", key: "equip_type",
...@@ -220,7 +217,7 @@ export default { ...@@ -220,7 +217,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "first_equip", key: "first_equip",
...@@ -228,48 +225,48 @@ export default { ...@@ -228,48 +225,48 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "cal_id", key: "cal_id",
title: this.l("cal_id"), title: this.l("cal_id"),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true
}, },
{ {
key: "plan_method", key: "plan_method",
title: this.l("plan_method"), title: this.l("plan_method"),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true
}, },
{ {
key: "over_time", key: "over_time",
title: this.l("over_time"), title: this.l("over_time"),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true
}, },
{ {
key: "isdiscrete", key: "isdiscrete",
title: this.l("isdiscrete"), title: this.l("isdiscrete"),
align: "center", align: "center",
easy: true, easy: true,
high: true, high: true
}, },
{ {
key: "discrete_value", key: "discrete_value",
title: this.l("discrete_value"), title: this.l("discrete_value"),
align: "right", align: "right",
high: true, high: true
}, },
{ {
key: "multi_machine", key: "multi_machine",
title: this.l("multi_machine"), title: this.l("multi_machine"),
align: "center", align: "center",
easy: true, easy: true,
high: true, high: true
}, },
{ {
key: "notes", key: "notes",
...@@ -277,7 +274,7 @@ export default { ...@@ -277,7 +274,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true, hide: true
}, },
{ {
...@@ -286,7 +283,7 @@ export default { ...@@ -286,7 +283,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "workshopcode", key: "workshopcode",
...@@ -294,21 +291,21 @@ export default { ...@@ -294,21 +291,21 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "routing_detail_id", key: "routing_detail_id",
title: this.l("routing_detail_id"), title: this.l("routing_detail_id"),
align: "left", align: "left",
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "routing_header_id", key: "routing_header_id",
title: this.l("routing_header_id"), title: this.l("routing_header_id"),
align: "left", align: "left",
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "comb_param", key: "comb_param",
...@@ -316,14 +313,14 @@ export default { ...@@ -316,14 +313,14 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true, hide: true
}, },
{ {
key: "rule_qty", key: "rule_qty",
title: this.l("rule_qty"), title: this.l("rule_qty"),
align: "left", align: "left",
high: true, high: true,
hide: true, hide: true
}, },
{ {
title: "操作", title: "操作",
...@@ -337,32 +334,32 @@ export default { ...@@ -337,32 +334,32 @@ export default {
icon: "md-options", icon: "md-options",
type: "icon", type: "icon",
oprate: "detail", oprate: "detail",
title: "工序参数设置", title: "工序参数设置"
}, },
on: { click: () => this.openParms(params.row) }, on: { click: () => this.openParms(params.row) }
}), }),
h("op", { h("op", {
attrs: { attrs: {
icon: "ios-create", icon: "ios-create",
type: "icon", type: "icon",
title: "編輯工序", title: "編輯工序",
oprate: "edit", oprate: "edit"
}, },
on: { click: () => this.edit(params.row) }, on: { click: () => this.edit(params.row) }
}), }),
h("op", { h("op", {
attrs: { attrs: {
icon: "ios-trash", icon: "ios-trash",
type: "icon", type: "icon",
title: "删除工序", title: "删除工序",
oprate: "delete", oprate: "edit",
msg: "确认要刪除工序吗?", msg: "确认要刪除工序吗?"
}, },
on: { click: () => this.remove(params.row, params.index) }, on: { click: () => this.remove(params.row, params.index) }
}), })
]); ]);
}, }
}, }
], ],
data1: [], data1: [],
insertTItle: "插单", insertTItle: "插单",
...@@ -372,10 +369,10 @@ export default { ...@@ -372,10 +369,10 @@ export default {
opTaskPk: 0, //工单ID opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号 taskSeq: "", //工序编号
count: 0,//生产计划数量 count: 0 //生产计划数量
}, },
//设置参数结束 //设置参数结束
rowData:{},//编辑时传入行数据 rowData: {} //编辑时传入行数据
}; };
}, },
mounted() { mounted() {
...@@ -388,12 +385,12 @@ export default { ...@@ -388,12 +385,12 @@ export default {
//根据点击副组件传过来id进行加载数据 //根据点击副组件传过来id进行加载数据
loadData(expendId) { loadData(expendId) {
let params = { let params = {
id: expendId, id: expendId
}; };
Api.getbyorderid(params).then((res) => { Api.getbyorderid(params).then(res => {
if (res.success) { if (res.success) {
this.gridHeight = 50; this.gridHeight = 50;
this.gridHeight = (res.result.length + 1) * 51; this.gridHeight = (res.result.length + 1) * 43;
this.data1 = res.result; this.data1 = res.result;
} }
}); });
...@@ -430,7 +427,7 @@ export default { ...@@ -430,7 +427,7 @@ export default {
opTaskPk: row.op_task_pk, opTaskPk: row.op_task_pk,
partTaskPk: row.part_task_pk, partTaskPk: row.part_task_pk,
taskSeq: row.task_seq, taskSeq: row.task_seq,
count: row.put_into_qty, count: row.put_into_qty
}; };
this.setParsModal = true; this.setParsModal = true;
}, },
...@@ -450,9 +447,9 @@ export default { ...@@ -450,9 +447,9 @@ export default {
this.selectRoutingDetail = row; this.selectRoutingDetail = row;
let params = { let params = {
partPk: this.selectRoutingDetail.part_task_pk, partPk: this.selectRoutingDetail.part_task_pk,
detailIdstr: this.selectRoutingDetail.routing_detail_id, detailIdstr: this.selectRoutingDetail.routing_detail_id
}; };
Api.removeoptasksimluate(params).then((r) => { Api.removeoptasksimluate(params).then(r => {
if (r.success) { if (r.success) {
this.$Message.success("删除成功"); this.$Message.success("删除成功");
this.data1.splice(this.rowIndex, 1); this.data1.splice(this.rowIndex, 1);
...@@ -477,8 +474,12 @@ export default { ...@@ -477,8 +474,12 @@ export default {
l(key) { l(key) {
let vkey = "mes_op_task_plan_simulate" + "." + key; let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
}, }
}, }
}; };
</script> </script>
<style lang="less"></style> <style lang="less">
.excute table tr th span,.excute table tr td {
font-size: 10px;
}
</style>
...@@ -234,7 +234,8 @@ export default { ...@@ -234,7 +234,8 @@ export default {
attrs: { attrs: {
icon: "md-options", icon: "md-options",
type: "icon", type: "icon",
title: "工序参数设置" title: "工序参数设置",
oprate: "edit",
}, },
on: { click: () => this.openAddModel(2, params.row) } on: { click: () => this.openAddModel(2, params.row) }
}), }),
...@@ -243,7 +244,7 @@ export default { ...@@ -243,7 +244,7 @@ export default {
icon: "md-return-left", icon: "md-return-left",
type: "icon", type: "icon",
title: "移出排产池", title: "移出排产池",
oprate: "delete", oprate: "edit",
msg: "确认要移出排产吗?" msg: "确认要移出排产吗?"
}, },
on: { click: () => this.remove(params.row.part_task_pk) } on: { click: () => this.remove(params.row.part_task_pk) }
...@@ -253,7 +254,7 @@ export default { ...@@ -253,7 +254,7 @@ export default {
icon: "md-refresh", icon: "md-refresh",
type: "icon", type: "icon",
title: "恢复工序", title: "恢复工序",
oprate: "delete", oprate: "edit",
msg: "确认要恢复工序吗?" msg: "确认要恢复工序吗?"
}, },
on: { click: () => this.refresh(params.row.part_task_pk) } on: { click: () => this.refresh(params.row.part_task_pk) }
......
...@@ -235,15 +235,102 @@ export default { ...@@ -235,15 +235,102 @@ export default {
]); ]);
} }
} }
] ],
treeData: [],
treeInputSearch: "",
ocolumn: [],
treeHeight: "",
tableHeight: "",
ids: [],
orderSearchForm: {
productId: "", //产品id
productName: "", //产品名称
taskType: "", //任务类型
stage: "", //阶段
materialId: "", //材料
quantity: null, //数量
guestName: "", //甲方客户
printSupply: "", //3D打印承制单位
functionaryOffice: "", //厂内责任机关
mainDepartmentId: "", //厂内责任主体部门ID
taskRequire: "", //任务接点要求
putintDocmentCode: "", //甲方投产输入文件编号
technologyDocmentCode: "", //甲方技术输入文件编号
outerDrawnNumber: "", //外部图号/模型号
modelVersion: "", //模型版本
taskCode: "", //甲方任务号
designer: "", //甲方设计人员
officeFunctionary: "", //厂内机关负责人
mainRoutingPeople: "", //厂内主工艺人员
routing_Method: "", //工艺方法
outer_Envelope_Size: "", //包装尺寸
demandStartDate: "", //开始时间
demandFinishDate: "", //完成时间
remark: "", //备注
projectNumber: "", //项目号
batchNumber: "", //批次号
urgencyLevel: null //紧急程度
},
list: [],
data1: [],
selectdata: [],
//以下为手写死数据集:
orderCatList: [], //订单类型下拉
outerCodeList: [], //型号外部代码下拉
missionCodeList: [], //任务号下拉
stageList: [], //阶段下拉
materailList: [], //材料下拉
routingAccessList: [], //工艺方法下拉
drawNumberList: [], //图号下拉
docNameList: [], //文档名称下拉
ownerGustList: [], //甲方客户下拉
mainDeptList: [], //厂内主体部门下拉
taskTypeList: [], //任务类型
statusList: [] //状态类型
}; };
}, },
created() {
this.treeHeight = window.innerHeight - 150;
},
mounted() { mounted() {
console.log(this); this.initTree();
this.tableHeight = window.innerHeight - 220;
this.$refs.CustomTable.getTableHeight(this.tableHeight);
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
this.tableHeight = window.screenHeight - 220;
this.$refs.CustomTable.getTableHeight(this.tableHeight);
})();
};
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
computed: {
searchList() {
let nodeList = this.treeData;
var text = this.treeInputSearch;
var newNodeList = [];
function searchTree(nodeLists, value) {
for (let i = 0; i < nodeLists.length; i++) {
if (nodeLists[i].title.indexOf(value) != -1) {
newNodeList.push(nodeLists[i]);
} else if (nodeLists[i].children.length > 0) {
searchTree(nodeLists[i].children, value);
}
}
}
if (text != "") {
searchTree(nodeList, text);
} else {
return nodeList;
}
return newNodeList;
}
},
methods: { methods: {
addOk() { addOk() {
this.$refs.grid.load(); this.$refs.grid.load();
...@@ -290,7 +377,83 @@ export default { ...@@ -290,7 +377,83 @@ export default {
l(key) { l(key) {
let vkey = "mes_plan" + "." + key; let vkey = "mes_plan" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
},
//new start
initTree() {
var sumData = [];
this.$http.order.getallselecttree().then(res => {
alert(JSON.stringify(res))
if (res.result) {
for (var i = 0; i < res.result.length; i++) {
sumData = sumData.concat(res.result[i]);
}
this.treeData = sumData;
this.data1 = JSON.parse(JSON.stringify(sumData));
} else {
this.$Message.error("加载产品树失败!");
}
});
},
selectTreeNode(value) {
if (value.length > 0) {
this.ids = [];
this.getAllIds(value);
if (this.ids.length > 0) {
this.orderSearchForm.productId = this.ids.join(",");
} else {
this.orderSearchForm.productId = "-1";
this.orderSearchForm.productName = "";
}
this.$refs.CustomTable.easySearch(this.orderSearchForm);
} }
},
//得到此树节点下所有是产品的productId
getAllIds(trees) {
trees.forEach((data, index) => {
var that = this;
if (data.isProduct) {
this.ids.push(data.productId);
}
if (data.children.length > 0) {
this.getAllIds(data.children);
}
});
},
handleSelect(data) {
if (data.length > 0) {
this.selectdata = [];
this.selectdata = data;
this.list = [];
this.list.push({ label: data[0].title, value: data[0].id });
//this.formValidate.classType=data[0].id;
if (data[0].isProduct == "1") {
this.orderSearchForm.productName = data[0].id;
this.orderSearchForm.productId = data[0].productId;
} else {
this.$Message.error("此节点不是产品,请选择产品节点!");
}
}
},
renderContent(h, { root, node, data }) {
//渲染树的样式
return h(
"span",
{
style: {
color: data.isProduct != "1" ? "#249E91" : "#333", //根据选中状态设置样式
cursor: "pointer"
},
on: {
click: () => {
let arrTree = [];
arrTree.push(data);
this.handleSelect(arrTree); //手动选择树节点
}
}
},
data.title
);
},
} }
}; };
</script> </script>
......
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