Commit dbe0e802 authored by renjintao's avatar renjintao

store生成

parent 8aa126e7
...@@ -1527,13 +1527,13 @@ export default { ...@@ -1527,13 +1527,13 @@ export default {
handonUserName: '接收人名称', handonUserName: '接收人名称',
}, },
store_room_location: { store_room_location: {
creationTime: '', creationTime: '创建时间',
creatorUserId: '', creatorUserId: '创建人',
lastModificationTime: '', lastModificationTime: '修改时间',
lastModifierUserId: '', lastModifierUserId: '修改人',
isDeleted: '', isDeleted: '是否删除',
deleterUserId: '', deleterUserId: '删除人',
deletionTime: '', deletionTime: '删除时间',
upId: '父ID', upId: '父ID',
materialType: '物料类型', materialType: '物料类型',
title: '库位名称', title: '库位名称',
...@@ -1541,7 +1541,7 @@ export default { ...@@ -1541,7 +1541,7 @@ export default {
status: '状态', status: '状态',
description: '位置', description: '位置',
level: '层级', level: '层级',
userName: '', userName: '管理员',
userIds: '', userIds: '管理员Id',
} }
} }
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row> <Row>
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Input v-model="entity.isDeleted"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('materialType')" prop="materialType">
<Input v-model="entity.materialType"></Input>
</FormItem>
</Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('title')" prop="title"> <FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input> <Input v-model="entity.title"></Input>
...@@ -57,28 +12,13 @@ ...@@ -57,28 +12,13 @@
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status">
<InputNumber v-model="entity.status"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('description')" prop="description"> <FormItem :label="l('description')" prop="description">
<Input v-model="entity.description" type="textarea" :rows="5"></Input> <Input v-model="entity.description" ></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('level')" prop="level">
<InputNumber v-model="entity.level"></InputNumber>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('userName')" prop="userName"> <FormItem :label="l('userName')" prop="userName">
<Input v-model="entity.userName" type="textarea" :rows="5"></Input> <Input v-model="entity.userName"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('userIds')" prop="userIds">
<Input v-model="entity.userIds" type="textarea" :rows="5"></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -103,13 +43,13 @@ export default { ...@@ -103,13 +43,13 @@ export default {
isDeleted: null, isDeleted: null,
deleterUserId: null, deleterUserId: null,
deletionTime: null, deletionTime: null,
upId: null, upId: this.upId,
materialType: "", materialType: "",
title: "", title: "",
code: "", code: "",
status: null, status: null,
description: "", description: "",
level: null, level: this.level,
userName: "", userName: "",
userIds: "" userIds: ""
}, },
...@@ -120,7 +60,9 @@ export default { ...@@ -120,7 +60,9 @@ export default {
}, },
props: { props: {
v: Object, v: Object,
eid: Number eid: Number,
level:Number,
upId:Number,
}, },
mounted() { mounted() {
if (this.eid > 0) { if (this.eid > 0) {
......
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
index: `${technologyUrl}storeroomlocation/paged`, index: `${resourceUrl}/storeroomlocation/paged`,
paged(params) { paged(params) {
return Api.post(`${technologyUrl}storeroomlocation/paged`, params); return Api.post(`${resourceUrl}/storeroomlocation/paged`, params);
},
getList(params) {
return Api.post(`${resourceUrl}/storeroomlocation/list`, params);
}, },
get(params) { get(params) {
return Api.get(`${technologyUrl}storeroomlocation/get`, params); return Api.get(`${resourceUrl}/storeroomlocation/get`, params);
}, },
create(params) { create(params) {
return Api.post(`${technologyUrl}storeroomlocation/create`, params); return Api.post(`${resourceUrl}/storeroomlocation/create`, params);
}, },
update(params) { update(params) {
return Api.post(`${technologyUrl}storeroomlocation/update`, params); return Api.post(`${resourceUrl}/storeroomlocation/update`, params);
}, },
delete(id) { delete(id) {
return Api.delete(`${technologyUrl}storeroomlocation/delete`, { return Api.delete(`${resourceUrl}/storeroomlocation/delete`, {
params: { params: {
id: id id: id
} }
}); });
}, },
deletes(params) { deletes(params) {
return Api.post(`${technologyUrl}storeroomlocation/batchdelete`, params); return Api.post(`${resourceUrl}/storeroomlocation/batchdelete`, params);
} }
} }
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"><template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入关键字库位名称/库位编号/" v-model="easySearch.keys.value" /> </FormItem> <div class="mb10 pt5">
<FormItem><Button type="primary" @click="search">查询</Button></FormItem> <Input v-model="searchValue" placeholder="请输入库位名称" clearable style="width: 240px" />
</Form></template> <Button type="primary" class @click="searchData">查询</Button>
<template slot="searchForm"> <div class="fr">
<Search /> <Button type="primary" @click="add()">新增库位</Button>
</template> </div>
<template slot="buttons"> </div>
<Button type="primary" @click="add">新增</Button> <TreeGrid :columns="columns" :items="treeData"></TreeGrid>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component
:is="detail"
:eid="curId"
:level="level"
:upId="upId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import Search from './search' import Search from "./search";
export default { export default {
name: 'list', name: "list",
components:{ components: {
Search Search
}, },
head: { head: {
title: "库房库位", title: "库房库位",
author: "henq", author: "henq",
description: "store_room_location 7/10/2020 8:57:03 AM", description: "store_room_location 7/10/2020 8:57:03 AM"
}, },
data() { data() {
return { return {
action: Api.index,
easySearch: { easySearch: {
keys:{op:"title,code,userName",value:null} keys: { op: "title,code,userName", value: null }
}, },
searchValue: "", //搜索库位名称
keys: "",
modal: false, modal: false,
title:"新增", title: "新增",
detail:null, detail: null,
curId: 0, curId: 0,
level: null,
upId: null,
treeData: [],
columns: [ columns: [
{ key:"id",title:this.$t("id") ,hide:true ,align:"left" ,high:true },
{ key:"creationTime",title:this.l("creationTime") ,align:"left" ,high:true },
{ key:"creatorUserId",title:this.l("creatorUserId") ,align:"left" ,high:true },
{ key:"lastModificationTime",title:this.l("lastModificationTime") ,align:"left" ,high:true },
{ key:"lastModifierUserId",title:this.l("lastModifierUserId") ,align:"left" ,high:true },
{ key:"isDeleted",title:this.l("isDeleted") ,align:"left" ,high:true },
{ key:"deleterUserId",title:this.l("deleterUserId") ,align:"left" ,high:true },
{ key:"deletionTime",title:this.l("deletionTime") ,align:"left" ,high:true },
{ key:"upId",title:this.l("upId") ,align:"left" ,high:true },
{ key:"materialType",title:this.l("materialType") ,align:"left" ,high:true },
{ key:"title",title:this.l("title") ,align:"left" ,easy:true ,high:true },
{ key:"code",title:this.l("code") ,align:"left" ,easy:true ,high:true },
{ key:"status",title:this.l("status") ,align:"left" ,high:true },
{ key:"description",title:this.l("description") ,align:"left" ,high:true },
{ key:"level",title:this.l("level") ,align:"left" ,high:true },
{ {
title: '操作', key: "title",
key: 'action', title: this.l("title"),
align: "left",
},
{
key: "code",
title: this.l("code"),
align: "left",
},
{
key: "description",
title: this.l("description"),
align: "left",
},
{
key: "level",
title: this.l("level"),
align: "left",
code:'store.level'
},
{
key: "userName",
title: this.l("userName"),
align: "left",
},
{
title: "操作",
key: "action",
width: 140, width: 140,
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h('div', { class: "action" }, [ return h("div", { class: "action" }, [
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.view(params.row.id) } }, '查看'), h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) }
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'), //h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'), h(
h('op', { attrs: { oprate: 'delete' }, on: { click: () => this.remove(params.row.id) } }, '删除') "op",
]) {
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) }
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
},
"删除"
)
]);
} }
}, },
{
title: '操作',
key: 'id',
align: 'left',
render: (h, params) => {
let actions = [
h(
'op',
{
attrs: { oprate: 'add' },
on: { click: () => this.addrow(params.row) }
},
'新增'
),
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.edit(params.row.id,params.row.up_id) }
},
'编辑'
)
] ]
if (params.row.children.length == 0) {
actions.push(
h(
'op',
{
attrs: { oprate: 'delete' },
on: { click: () => this.remove(params.row.id) }
},
'删除'
)
)
} }
return h('div', { class: 'action' }, actions)
}
}
]
};
}, },
mounted(){ mounted() {
console.log(this); this.laodaction(this.keys)
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
laodaction(name) {
let params = { title: name };
Api.getList(params).then(r => {
this.treeData = r.result;
this.treeData.forEach(data=>{
data.children=[]
})
alert(JSON.stringify(this.treeData))
});
},
//查询
searchData() {
var name = this.searchValue;
this.laodaction(name);
},
addOk() {
this.laodaction();
this.addModal = false;
this.editModal = false;
this.addrowModal = false;
// this.curId = 0
}, },
methods:{
ok() { ok() {
this.$refs.grid.load() this.$refs.grid.load();
this.modal = false this.modal = false;
this.curId = 0; this.curId = 0;
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch);
}, },
add() { add() {
this.curId = 0; this.curId = 0;
this.title = "新增"; this.level = 1;
this.detail =()=> import('./add') (this.upId = 0), (this.title = "新增");
this.detail = () => import("./add");
this.modal = true; this.modal = true;
}, },
copy(id) { copy(id) {
this.curId = id; this.curId = id;
this.title = "克隆"; this.title = "克隆";
this.detail = () =>import('./add') this.detail = () => import("./add");
this.modal = true; this.modal = true;
}, },
view(id) { view(id) {
this.curId = id; this.curId = id;
this.title = "详情"; this.title = "详情";
this.detail = () =>import('./detail') this.detail = () => import("./detail");
this.modal = true; this.modal = true;
}, },
edit(id) { edit(id) {
this.curId = id; this.curId = id;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import('./edit') this.detail = () => import("./edit");
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
Api.delete(id).then((r) => { Api.delete(id).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.$Message.success('删除成功') this.$Message.success("删除成功");
} }
}) });
}, },
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false this.modal = false;
}, },
l(key) { l(key) {
let vkey = "store_room_location" + "." + key; let vkey = "store_room_location" + "." + key;
return this.$t(vkey)||key return this.$t(vkey) || key;
} }
} }
} };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ 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