Commit 61a9b4cb authored by kangzhenfei's avatar kangzhenfei

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

parents ec97899b 54642881
...@@ -1489,6 +1489,7 @@ export default { ...@@ -1489,6 +1489,7 @@ export default {
description:'描述', description:'描述',
levelNum:'编码分类层数', levelNum:'编码分类层数',
codeLength:'编码分类位数', codeLength:'编码分类位数',
materialCodeLength:'物料编码位数'
}, },
//转续列表 //转续列表
order_execute_handon:{ order_execute_handon:{
......
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
index:`${systemUrl}/category/paged`,
paged(params){
return Api.post(`${systemUrl}/category/paged`,params);
},
listTable(params){ listTable(params){
return Api.post(`${systemUrl}/custompropertydefinition/list`,params); return Api.post(`${systemUrl}/custompropertydefinition/list`,params);
}, },
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</a> </a>
</div> </div>
<Content :class="!showMenu?'con_bord':''"> <Content :class="!showMenu?'con_bord':''">
<MasterData ref="dataTable" @on-edit="editRow" /> <MasterData ref="dataTable" @on-edit="editRow" :root="root" @on-ok="ok"/>
</Content> </Content>
</Layout> </Layout>
<Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false"> <Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false">
...@@ -79,6 +79,10 @@ export default { ...@@ -79,6 +79,10 @@ export default {
name: "classification", name: "classification",
data() { data() {
return { return {
root: {
id: 0,
ids: []
},
keys: "", keys: "",
expand: false, expand: false,
list: [], list: [],
...@@ -106,13 +110,13 @@ export default { ...@@ -106,13 +110,13 @@ export default {
this.loadTree(); this.loadTree();
this.modal = false; this.modal = false;
this.curId = 0; this.curId = 0;
if (row) { // if (row) {
this.dataList.map((e, index) => { // this.dataList.map((e, index) => {
if (e.id == row.id) { // if (e.id == row.id) {
this.$set(this.$refs.dataTable.dataColumns, index, row); // this.$set(this.$refs.dataTable.dataColumns, index, row);
} // }
}); // });
} // }
}, },
addNew() { addNew() {
this.curId = 0; this.curId = 0;
...@@ -186,34 +190,40 @@ export default { ...@@ -186,34 +190,40 @@ export default {
} }
} }
}, },
data.title data.title +
"(" +
(
data.totalMaterialCount == undefined
? "0"
: data.totalMaterialCount) +
")"
); );
}, },
handleSelect(data) { handleSelect(data) {
let tableData = []; // let tableData = [];
let obj = {}; // let obj = {};
let children = 0; // let children = 0;
if (data.upId == 0 && data.children.length > 0) { // if (data.upId == 0 && data.children.length > 0) {
data.children.forEach(e => { // data.children.forEach(e => {
if (e.children.length > 0) { // if (e.children.length > 0) {
children = 1; // children = 1;
} else { // } else {
children = 0; // children = 0;
} // }
obj = { // obj = {
id: e.id, // id: e.id,
name: e.name, // name: e.name,
code: e.code, // code: e.code,
status: e.status, // status: e.status,
children: children, // children: children,
upId: e.upId, // upId: e.upId,
description: e.description // description: e.description
}; // };
tableData.push(obj); // tableData.push(obj);
}); // });
this.dataList = tableData; // this.dataList = tableData;
this.$refs.dataTable.dataColumns = tableData; // this.$refs.dataTable.dataColumns = tableData;
} // }
}, },
loadTree() { loadTree() {
let conditions = []; let conditions = [];
...@@ -238,19 +248,20 @@ export default { ...@@ -238,19 +248,20 @@ export default {
// console.log(v); // console.log(v);
// console.log(b); // console.log(b);
let ids = []; let ids = [];
ids.push(b.value); ids.push(b.id);
if (b.children) { if (b.children) {
addId(b.children); addId(b.children);
function addId(data) { function addId(data) {
data.map(u => { data.map(u => {
ids.push(u.value); ids.push(u.id);
if (u.children) { if (u.children) {
addId(u.children); addId(u.children);
} }
}); });
} }
} }
// this.$emit("on-select", b.value, b, ids); this.root.ids = ids;
this.root.id = b.id;
}, },
hide() { hide() {
this.showMenu = false; this.showMenu = false;
......
<template> <template>
<div class="master-data"> <div class="master-data">
<Table border :columns="columns" :data="dataColumns" :height="tableHeight"></Table>
<!-- <Table border :columns="columns" :data="dataColumns" :height="tableHeight"></Table> -->
<DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="750">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
placeholder="请输入编码/名称"
v-width="200"
v-model="easySearch.keys.value"
clearable
/>
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<!-- <template slot="searchForm">
<Search />
</template>-->
<!-- <template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>-->
</DataGrid>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
name: "masterData", name: "masterData",
props: ["root"],
data() { data() {
return { return {
action: Api.index,
tableHeight: "", tableHeight: "",
dataColumns: [], dataColumns: [],
easySearch: {
keys: { op: "code,name", value: null },
id: { op: "In", value: this.root.ids }
},
columns: [ columns: [
// { // {
// key: "index", // key: "index",
...@@ -32,21 +62,18 @@ export default { ...@@ -32,21 +62,18 @@ export default {
key: "status", key: "status",
title: "状态", title: "状态",
align: "left", align: "left",
render: (h, params) => { code: "materail.category.status"
return h("state", { // render: (h, params) => {
props: { // return h("state", {
code: "materail.category.status", // props: {
type: "text", // code: "materail.category.status",
value: params.row.status + "" // type: "text",
} // value: params.row.status + ""
}); // }
} // });
}, // }
{
key: "banben",
title: "版本",
align: "left"
}, },
{ {
key: "description", key: "description",
title: "描述", title: "描述",
...@@ -74,7 +101,7 @@ export default { ...@@ -74,7 +101,7 @@ export default {
attrs: { oprate: "delete" }, attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) } on: { click: () => this.remove(params.row.id) }
}, },
params.row.children == 0 ? "删除" : "" "删除"
) )
]); ]);
} }
...@@ -98,26 +125,43 @@ export default { ...@@ -98,26 +125,43 @@ export default {
}; };
}, },
methods: { methods: {
search() {
this.$refs.grid.reload(this.easySearch);
},
edit(row) { edit(row) {
this.$emit("on-edit", row); this.$emit("on-edit", row);
}, },
remove(id) { remove(id) {
this.$Modal.confirm({ Api.delete(id).then(r => {
title: "删除", if (r.success) {
content: "<p>您确定要删除吗?</p>", this.$emit("on-ok");
onOk: () => { this.$refs.grid.reload(this.easySearch);
Api.delete(id).then(r => { this.$Message.success("删除成功");
if (r.success) {
this.loadTree();
this.$Message.success("删除成功");
}
});
},
onCancel: () => {
this.$Message.success("取消删除");
} }
}); });
} }
// this.$Modal.confirm({
// title: "删除",
// content: "<p>您确定要删除吗?</p>",
// onOk: () => {
// onCancel: () => {
// this.$Message.success("取消删除");
// }
// });
// }
},
watch: {
root: {
handler(newName, oldName) {
this.easySearch.id.value = newName.ids;
if (newName.id) {
this.$refs.grid.reload(this.easySearch);
}
},
immediate: true,
deep: true
}
} }
}; };
</script> </script>
......
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
<InputNumber v-model="entity.codeLength" :max="5" :min="1"></InputNumber> <InputNumber v-model="entity.codeLength" :max="5" :min="1"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12">
<FormItem :label="l('materialCodeLength')" prop="materialCodeLength">
<InputNumber v-model="entity.materialCodeLength" :max="10" :min="1"></InputNumber>
</FormItem>
</Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
...@@ -64,7 +69,8 @@ export default { ...@@ -64,7 +69,8 @@ export default {
status: null, status: null,
description: "", description: "",
levelNum: null, levelNum: null,
codeLength: null codeLength: null,
materialCodeLength:null
}, },
// formValidate:{ // formValidate:{
// name:'',type:'',status:'',levelNum:'',codeLength:'' // name:'',type:'',status:'',levelNum:'',codeLength:''
...@@ -74,7 +80,8 @@ export default { ...@@ -74,7 +80,8 @@ export default {
type: [{ required: true, message: "必填"}], type: [{ required: true, message: "必填"}],
status: [{ required: true, message: "必填"}], status: [{ required: true, message: "必填"}],
levelNum: [{ required: true, message: "必填"}], levelNum: [{ required: true, message: "必填"}],
codeLength: [{ required: true, message: "必填"}] codeLength: [{ required: true, message: "必填"}],
materialCodeLength: [{ required: true, message: "必填"}]
} }
}; };
}, },
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<Filed :span="24" :name="l('description')">{{entity.description}}</Filed> <Filed :span="24" :name="l('description')">{{entity.description}}</Filed>
<Filed :span="12" :name="l('levelNum')">{{entity.levelNum}}</Filed> <Filed :span="12" :name="l('levelNum')">{{entity.levelNum}}</Filed>
<Filed :span="12" :name="l('codeLength')">{{entity.codeLength}}</Filed> <Filed :span="12" :name="l('codeLength')">{{entity.codeLength}}</Filed>
<Filed :span="12" :name="l('materialCodeLength')">{{entity.materialCodeLength}}</Filed>
</Row> </Row>
</div> </div>
......
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
<InputNumber v-model="entity.codeLength" disabled :max="5" :min="1"></InputNumber> <InputNumber v-model="entity.codeLength" disabled :max="5" :min="1"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12">
<FormItem :label="l('materialCodeLength')" prop="materialCodeLength">
<InputNumber v-model="entity.materialCodeLength" disabled :max="10" :min="1"></InputNumber>
</FormItem>
</Col>
</Row> </Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
...@@ -56,7 +61,8 @@ export default { ...@@ -56,7 +61,8 @@ export default {
type: [{ required: true, message: "必填" }], type: [{ required: true, message: "必填" }],
status: [{ required: true, message: "必填" }], status: [{ required: true, message: "必填" }],
levelNum: [{ required: true, message: "必填" }], levelNum: [{ required: true, message: "必填" }],
codeLength: [{ required: true, message: "必填" }] codeLength: [{ required: true, message: "必填" }],
materialCodeLength: [{ required: true, message: "必填" }]
} }
}; };
}, },
......
...@@ -54,6 +54,7 @@ keys:{op:"code,name",value:null} ...@@ -54,6 +54,7 @@ keys:{op:"code,name",value:null}
{ key:"description",title:this.l("description") ,align:"center" ,high:true }, { key:"description",title:this.l("description") ,align:"center" ,high:true },
{ key:"levelNum",title:this.l("levelNum") ,align:"center" ,high:true ,hide:true , }, { key:"levelNum",title:this.l("levelNum") ,align:"center" ,high:true ,hide:true , },
{ key:"codeLength",title:this.l("codeLength") ,align:"center" ,high:true,hide:true , }, { key:"codeLength",title:this.l("codeLength") ,align:"center" ,high:true,hide:true , },
{ key:"materialCodeLength",title:this.l("materialCodeLength") ,align:"center" ,high:true,hide:true , },
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
......
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
index:`${systemUrl}/material/paged`, index:`${systemUrl}/material/paged`,
lists:`${systemUrl}/category/list`,
paged(params){ paged(params){
return Api.post(`${systemUrl}/material/paged`,params); return Api.post(`${systemUrl}/material/paged`,params);
}, },
...@@ -19,5 +20,7 @@ export default { ...@@ -19,5 +20,7 @@ export default {
delete(id) { delete(id) {
return Api.delete(`${systemUrl}/material/delete`,{params:{id:id}}); return Api.delete(`${systemUrl}/material/delete`,{params:{id:id}});
}, },
categoryList(params){
return Api.post(`${systemUrl}/category/list`,params);
},
} }
\ No newline at end of file
...@@ -16,18 +16,20 @@ ...@@ -16,18 +16,20 @@
</div> </div>
</Sider> </Sider>
<Content class="right-detail"> <Content class="right-detail">
<div class="btn"> <div class="btn" v-show="showFrom">
<Button type="primary">编辑</Button> <!-- <Button type="primary">编辑</Button> -->
<div class="new-detail"> <div class="new-detail">
<Row> <Row>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed> <Filed :span="8" name="编码:">{{entity.code}}</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed> <Filed :span="8" name="名称:">{{entity.name}}</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed> <Filed :span="8" name="状态:">
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed> <State code="materail.category.status" :value="parseInt(entity.status)" />
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed> </Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
<Filed :span="8" name="版本:">{{entity.version}}</Filed>
<Filed :span="8" name="描述::">{{entity.description}}</Filed>
</Row> </Row>
<Divider /> <!-- <Divider />
<div class="title-h4">engineering</div> <div class="title-h4">engineering</div>
<Row> <Row>
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed> <Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课</Filed>
...@@ -46,37 +48,62 @@ ...@@ -46,37 +48,62 @@
<Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed> <Filed :span="8" :name="l('routingHeaderName')+':'">HHJK就开始上课uioiweiwuuu你和环境</Filed>
<Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed> <Filed :span="8" :name="l('routingDetailName')+':'">HHJK就开始上课</Filed>
<Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed> <Filed :span="8" :name="l('standard')+':'">HHJK就开始上课</Filed>
</Row> </Row>-->
</div> </div>
</div> </div>
<div v-show="showTable">
<!-- <DataGrid :columns="columns" ref="grid" :action="action" :high="false" :height="750"></DataGrid> -->
<Table border :columns="columns" :data="data1" :height="800"></Table>
</div>
</Content> </Content>
</Layout> </Layout>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api";
export default { export default {
data() { data() {
return { return {
data1: [],
action: Api.lists,
isactive: null, isactive: null,
showFrom: false,
showTable: false,
rowId: "",
entity: {},
easySearch: {
keys: { op: "title", value: "" },
table: { op: "Equal", value: "material" },
tId: {
op: "Equal",
value: this.$route.query.id
}
},
listData: [ listData: [
{ {
lable: "属性" lable: "属性"
}, },
{ {
lable: "图像" lable: "历史记录"
}, }
{ ],
lable: "图像" columns: [
},
{ {
lable: "图像" key: "name",
title: "名称",
align: "left"
}, },
{ {
lable: "图像" key: "creationTime",
title: "名称",
align: "left"
} }
] ]
}; };
}, },
created() {
this.rowId = this.$route.query.id;
},
methods: { methods: {
back() { back() {
this.$router.push({ this.$router.push({
...@@ -85,6 +112,38 @@ export default { ...@@ -85,6 +112,38 @@ export default {
}, },
everyItem(li, i) { everyItem(li, i) {
this.isactive = i; this.isactive = i;
if (li.lable == "属性") {
this.showFrom = true;
this.showTable = false;
Api.get({ id: this.rowId }).then(r => {
if (r.result) {
this.entity = r.result;
}
});
} else {
this.showFrom = false;
this.showTable = true;
this.easySearch = {
conditions: [
{
fieldName: "table",
fieldValue: "material",
conditionalType: "Equal"
},
{
fieldName: "tId",
fieldValue: this.rowId,
conditionalType: "Equal"
}
]
};
Api.categoryList(this.easySearch).then(r => {
if (r.result) {
this.data1 = r.result;
}
});
}
}, },
l(key) { l(key) {
key = "routing_qc_card" + "." + key; key = "routing_qc_card" + "." + key;
......
...@@ -46,12 +46,12 @@ ...@@ -46,12 +46,12 @@
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
props: ["nodeInfo"], props: ["nodeInfo",'eid'],
data() { data() {
return { return {
arr: [], arr: [],
entity: { entity: {
id: this.nodeInfo.id, id: this.eid,
code: 0, code: 0,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {}, customProperties: {},
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
}, },
methods: { methods: {
get() { get() {
Api.get({ id: this.nodeInfo.id }).then(r => { Api.get({ id: this.eid }).then(r => {
if (r.result) { if (r.result) {
this.entity = r.result; this.entity = r.result;
} }
...@@ -79,15 +79,16 @@ export default { ...@@ -79,15 +79,16 @@ export default {
}, },
remove(index, row) { remove(index, row) {
if (row.add == 0) {
//新增的删除,直接删 // if (row.add == 0) {
this.checkList.splice(index, 1); // //新增的删除,直接删
} else { // this.checkList.splice(index, 1);
row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台 // } else {
this.$set(this.checkList, index, row); // row.action = 2; //返回的默认删除,删除后保存在arr数组中,添加标识action = 2,然后点击保存的时候,一起传给后台
this.arr.push(row); // this.$set(this.checkList, index, row);
this.checkList.splice(index, 1); // this.arr.push(row);
} // this.checkList.splice(index, 1);
// }
}, },
setRow(row, index) { setRow(row, index) {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</a> </a>
</div> </div>
<Content :class="!showMenu?'con_bord':''"> <Content :class="!showMenu?'con_bord':''">
<MasterData ref="dataTable" :nodeInfo="nodeInfo" /> <MasterData ref="dataTable" :nodeInfo="nodeInfo" @on-ok="ok" />
</Content> </Content>
</Layout> </Layout>
</div> </div>
...@@ -55,7 +55,8 @@ export default { ...@@ -55,7 +55,8 @@ export default {
list: [], list: [],
nodeInfo: { nodeInfo: {
categoryId: 0, categoryId: 0,
rootCategoryId: 0 rootCategoryId: 0,
ids: []
}, },
modal: false, modal: false,
title: "新增", title: "新增",
...@@ -78,15 +79,15 @@ export default { ...@@ -78,15 +79,15 @@ export default {
}, },
ok(row) { ok(row) {
this.loadTree(); this.loadTree();
this.modal = false; // this.modal = false;
this.curId = 0; // this.curId = 0;
if (row) { // if (row) {
this.dataList.map((e, index) => { // this.dataList.map((e, index) => {
if (e.id == row.id) { // if (e.id == row.id) {
this.$set(this.$refs.dataTable.dataColumns, index, row); // this.$set(this.$refs.dataTable.dataColumns, index, row);
} // }
}); // });
} // }
}, },
cancel() { cancel() {
this.curId = 0; this.curId = 0;
...@@ -102,12 +103,15 @@ export default { ...@@ -102,12 +103,15 @@ export default {
} }
} }
}, },
data.title data.title +
"(" +
(data.totalMaterialCount == undefined
? "0"
: data.totalMaterialCount) +
")"
); );
}, },
handleSelect(root, data) { handleSelect(root, data) {
// console.log(root);
let pid = null; //定义最顶级id let pid = null; //定义最顶级id
let upId = data.upId; let upId = data.upId;
let roots = root; let roots = root;
...@@ -124,7 +128,6 @@ export default { ...@@ -124,7 +128,6 @@ export default {
}); });
} }
addId(roots, upId); addId(roots, upId);
this.nodeInfo.categoryId = data.id; this.nodeInfo.categoryId = data.id;
if (pid == null) { if (pid == null) {
this.nodeInfo.rootCategoryId = data.id; this.nodeInfo.rootCategoryId = data.id;
...@@ -151,7 +154,22 @@ export default { ...@@ -151,7 +154,22 @@ export default {
toggle() { toggle() {
this.expand = !this.expand; this.expand = !this.expand;
}, },
change(v, b) {}, change(v, b) {
let ids = [];
ids.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map(u => {
ids.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
}
this.nodeInfo.ids = ids;
},
hide() { hide() {
this.showMenu = false; this.showMenu = false;
} }
......
<template> <template>
<div class="master-data"> <div class="master-data">
<DataGrid :columns="columns" ref="grid" :action="action" :initsearch="sets" :high="false"> <DataGrid
:columns="columns"
ref="grid"
:action="action"
:initsearch="sets"
:high="false"
:height="750"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
...@@ -47,6 +54,7 @@ export default { ...@@ -47,6 +54,7 @@ export default {
data() { data() {
return { return {
action: Api.index, action: Api.index,
modal: false, modal: false,
title: "新增", title: "新增",
curId: 0, curId: 0,
...@@ -56,15 +64,11 @@ export default { ...@@ -56,15 +64,11 @@ export default {
v.rootCategoryId = this.nodeInfo.rootCategoryId; v.rootCategoryId = this.nodeInfo.rootCategoryId;
}, },
easySearch: { easySearch: {
keys: { op: "Code,Name", value: null } keys: { op: "code,name", value: null },
// categoryId: { categoryId: {
// op: "In", op: "In",
// value: this.nodeInfo.categoryId value: this.nodeInfo.ids
// }, }
// rootCategoryId: {
// op: "In",
// value: this.nodeInfo.rootCategoryId
// }
}, },
columns: [ columns: [
// { // {
...@@ -74,7 +78,7 @@ export default { ...@@ -74,7 +78,7 @@ export default {
// width: 60 // width: 60
// }, // },
{ {
key: "Code", key: "code",
title: "编码", title: "编码",
align: "left", align: "left",
render: (h, params) => { render: (h, params) => {
...@@ -83,20 +87,20 @@ export default { ...@@ -83,20 +87,20 @@ export default {
{ {
props: {}, props: {},
on: { on: {
click: () => this.details(params.row) click: () => this.details(params.row.id)
} }
}, },
params.row.Code params.row.code
); );
} }
}, },
{ {
key: "Name", key: "name",
title: "名称", title: "名称",
align: "left" align: "left"
}, },
{ {
key: "Status", key: "status",
title: "状态", title: "状态",
align: "left", align: "left",
render: (h, params) => { render: (h, params) => {
...@@ -104,18 +108,18 @@ export default { ...@@ -104,18 +108,18 @@ export default {
props: { props: {
code: "materail.category.status", code: "materail.category.status",
type: "text", type: "text",
value: params.row.Status + "" value: params.row.status + ""
} }
}); });
} }
}, },
{ {
key: "Version", key: "version",
title: "版本", title: "版本",
align: "left" align: "left"
}, },
{ {
key: "Description", key: "description",
title: "描述", title: "描述",
align: "left" align: "left"
}, },
...@@ -140,7 +144,7 @@ export default { ...@@ -140,7 +144,7 @@ export default {
attrs: { oprate: "delete" }, attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) } on: { click: () => this.remove(params.row.id) }
}, },
params.row.children == 0 ? "删除" : "" "删除"
) )
]); ]);
} }
...@@ -151,7 +155,10 @@ export default { ...@@ -151,7 +155,10 @@ export default {
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() {}, created() {
// this.$refs.grid.reload(this.easySearch);
},
methods: { methods: {
search() { search() {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
...@@ -163,31 +170,45 @@ export default { ...@@ -163,31 +170,45 @@ export default {
this.modal = true; this.modal = true;
}, },
edit(row) { edit(row) {
this.nodeInfo.id = row.Id; console.log(row);
this.curId = row.id;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import("./edit"); this.detail = () => import("./edit");
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
this.$Modal.confirm({ alert(id);
title: "删除", Api.delete(id).then(r => {
content: "<p>您确定要删除吗?</p>", if (r.success) {
onOk: () => { this.$emit("on-ok");
Api.delete(id).then(r => { this.$refs.grid.reload(this.easySearch);
if (r.success) { this.$Message.success("删除成功");
this.loadTree();
this.$Message.success("删除成功");
}
});
},
onCancel: () => {
this.$Message.success("取消删除");
} }
}); });
// this.$Modal.confirm({
// title: "删除",
// content: "<p>您确定要删除吗?</p>",
// onOk: () => {
// alert(1);
// Api.delete({ id: this.eid }).then(r => {
// if (r.success) {
// this.$emit("on-ok");
// this.$Message.success("删除成功");
// }
// });
// },
// onCancel: () => {
// this.$Message.success("取消删除");
// }
// });
}, },
details() { details(id) {
alert(id)
this.$router.push({ this.$router.push({
path: "/materiel/masterData/details" path: "/materiel/masterData/details",
query: {
id: id
}
}); });
}, },
ok() { ok() {
...@@ -201,10 +222,15 @@ export default { ...@@ -201,10 +222,15 @@ export default {
} }
}, },
watch: { watch: {
"nodeInfo.categoryId"(v) { nodeInfo: {
if (v) { handler(newName, oldName) {
this.$refs.grid.reload(this.easySearch); this.easySearch.categoryId.value = newName.ids;
} if (newName.categoryId) {
this.$refs.grid.reload(this.easySearch);
}
},
immediate: true,
deep: true
} }
} }
}; };
......
...@@ -6,23 +6,26 @@ ...@@ -6,23 +6,26 @@
ref="grid" ref="grid"
:batch="false" :batch="false"
:type="typeInfo" :type="typeInfo"
:high="false"
:span="6" :span="6"
:lazy="true" :lazy="true"
:conditions="easySearch" :conditions="easySearch"
:action="action" :action="action"
:gutter="40" :gutter="40"
:high="false"
> >
<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="260" /> <Input placeholder="请输入订单编号/产品名称/图号" v-model="easySearch.keys.value" v-width="260" clearable/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons"> <template slot="buttons">
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button> <Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
</template> </template>
...@@ -32,8 +35,12 @@ ...@@ -32,8 +35,12 @@
@click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId,row.routingDetailId,row.quantity,row.status)" @click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId,row.routingDetailId,row.quantity,row.status)"
> >
<Row class="title-i"> <Row class="title-i">
<Col :span="10" class="order-code"><Ellipsis :text="row.productName" :lines="1" tooltip transfer /></Col> <Col :span="10" class="order-code">
<Col :span="10" class="order-code"><Ellipsis :text="row.mesCode" :lines="1" tooltip transfer /></Col> <Ellipsis :text="row.productName" :lines="1" tooltip transfer />
</Col>
<Col :span="10" class="order-code">
<Ellipsis :text="row.mesCode" :lines="1" tooltip transfer />
</Col>
<Col :span="4"> <Col :span="4">
<div class="sanjiao" :style="tdStyle(row.status)"></div> <div class="sanjiao" :style="tdStyle(row.status)"></div>
<div class="box"> <div class="box">
...@@ -107,14 +114,18 @@ ...@@ -107,14 +114,18 @@
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search";
export default { export default {
name: "starOrder", name: "starOrder",
components: {
Search,
},
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { keys: {
op: "mesCode,productName", op: "mesCode,productName,drawnNumber",
value: null value: null
} }
}, },
...@@ -366,7 +377,7 @@ export default { ...@@ -366,7 +377,7 @@ export default {
width: 0; width: 0;
border-left: solid 50px transparent; border-left: solid 50px transparent;
float: right; float: right;
margin-right:-1px; margin-right: -1px;
} }
.box { .box {
color: white; color: white;
......
<template>
<Form ref="form" :model="condition" :label-width="100">
<Row>
<Col :span="12" v-if="condition.id.show">
<FormItem :label="l('id')" prop="id">
<Input v-model="condition.id.value"></Input>
</FormItem>
</Col>
<Col :span="12" v-if="condition.mesCode.show">
<FormItem :label="l('mesCode')" prop="mesCode">
<Input v-model="condition.mesCode.value"></Input>
</FormItem>
</Col>
<Col :span="12" v-if="condition.productName.show">
<FormItem :label="l('productName')" prop="productName">
<Input v-model="condition.productName.value"></Input>
</FormItem>
</Col>
<Col :span="12" v-if="condition.drawnNumber.show">
<FormItem :label="l('drawnNumber')" prop="drawnNumber">
<Input v-model="condition.drawnNumber.value"></Input>
</FormItem>
</Col>
<Col :span="12" v-if="condition.quantity.show">
<FormItem :label="l('quantity')" prop="quantity">
<Input v-model="condition.quantity.value"></Input>
</FormItem>
</Col>
<Col :span="12" v-if="condition.status.show">
<FormItem :label="l('status')" prop="status">
<Dictionary code="taskList.status" v-model="condition.status.value"></Dictionary>
</FormItem>
</Col>
<Col :span="12" v-if="condition.beginTime.show">
<FormItem :label="l('beginTime')" prop="beginTime">
<DatePicker type="daterange" v-model="condition.beginTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" v-if="condition.endTime.show">
<FormItem :label="l('endTime')" prop="endTime">
<DatePicker type="endTime" v-model="condition.endTime.value"></DatePicker>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Search",
data() {
return {
condition: {
id: { op: "Equal", value: null, show: false },
executeId: { op: "Equal", value: null, show: false },
drawnNumber: { op: "Equal", value: null, show: true },
mesCode: { op: "Equal", value: null, show: true },
orderId: { op: "Equal", value: null, show: false },
productId: { op: "Equal", value: null, show: false },
productName: { op: "Equal", value: null, show: true },
quantity: { op: "Equal", value: null, show: false },
routingHeaderId: { op: "Equal", value: null, show: false },
routingDetailId: { op: "Equal", value: null, show: false },
status: { op: "Equal", value: null, show: true },
beginTime: { op: "Range", value: null, show: false },
endTime: { op: "Range", value: null, show: false },
}
};
},
methods: {
handleClose() {
this.$emit("on-close");
},
l(key) {
let vkey = "order_list" + "." + key;
return this.$t(vkey) || key;
}
}
};
</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