Commit dbe0e802 authored by renjintao's avatar renjintao

store生成

parent 8aa126e7
......@@ -1527,13 +1527,13 @@ export default {
handonUserName: '接收人名称',
},
store_room_location: {
creationTime: '',
creatorUserId: '',
lastModificationTime: '',
lastModifierUserId: '',
isDeleted: '',
deleterUserId: '',
deletionTime: '',
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '修改时间',
lastModifierUserId: '修改人',
isDeleted: '是否删除',
deleterUserId: '删除人',
deletionTime: '删除时间',
upId: '父ID',
materialType: '物料类型',
title: '库位名称',
......@@ -1541,7 +1541,7 @@ export default {
status: '状态',
description: '位置',
level: '层级',
userName: '',
userIds: '',
userName: '管理员',
userIds: '管理员Id',
}
}
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<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">
<FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input>
......@@ -57,28 +12,13 @@
</FormItem>
</Col>
<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">
<Input v-model="entity.description" type="textarea" :rows="5"></Input>
<Input v-model="entity.description" ></Input>
</FormItem>
</Col>
<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">
<Input v-model="entity.userName" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('userIds')" prop="userIds">
<Input v-model="entity.userIds" type="textarea" :rows="5"></Input>
<Input v-model="entity.userName"></Input>
</FormItem>
</Col>
</Row>
......@@ -103,13 +43,13 @@ export default {
isDeleted: null,
deleterUserId: null,
deletionTime: null,
upId: null,
upId: this.upId,
materialType: "",
title: "",
code: "",
status: null,
description: "",
level: null,
level: this.level,
userName: "",
userIds: ""
},
......@@ -120,7 +60,9 @@ export default {
},
props: {
v: Object,
eid: Number
eid: Number,
level:Number,
upId:Number,
},
mounted() {
if (this.eid > 0) {
......
import Api from '@/plugins/request'
export default {
index: `${technologyUrl}storeroomlocation/paged`,
index: `${resourceUrl}/storeroomlocation/paged`,
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) {
return Api.get(`${technologyUrl}storeroomlocation/get`, params);
return Api.get(`${resourceUrl}/storeroomlocation/get`, params);
},
create(params) {
return Api.post(`${technologyUrl}storeroomlocation/create`, params);
return Api.post(`${resourceUrl}/storeroomlocation/create`, params);
},
update(params) {
return Api.post(`${technologyUrl}storeroomlocation/update`, params);
return Api.post(`${resourceUrl}/storeroomlocation/update`, params);
},
delete(id) {
return Api.delete(`${technologyUrl}storeroomlocation/delete`, {
return Api.delete(`${resourceUrl}/storeroomlocation/delete`, {
params: {
id: id
}
});
},
deletes(params) {
return Api.post(`${technologyUrl}storeroomlocation/batchdelete`, params);
return Api.post(`${resourceUrl}/storeroomlocation/batchdelete`, params);
}
}
<template>
<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>
<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 class="mb10 pt5">
<Input v-model="searchValue" placeholder="请输入库位名称" clearable style="width: 240px" />
<Button type="primary" class @click="searchData">查询</Button>
<div class="fr">
<Button type="primary" @click="add()">新增库位</Button>
</div>
</div>
<TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<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>
</div>
</template>
<script>
import Api from './api'
import Search from './search'
import Api from "./api";
import Search from "./search";
export default {
name: 'list',
components:{
name: "list",
components: {
Search
},
head: {
title: "库房库位",
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() {
return {
action: Api.index,
easySearch: {
keys:{op:"title,code,userName",value:null}
},
keys: { op: "title,code,userName", value: null }
},
searchValue: "", //搜索库位名称
keys: "",
modal: false,
title:"新增",
detail:null,
title: "新增",
detail: null,
curId: 0,
level: null,
upId: null,
treeData: [],
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: 'action',
key: "title",
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,
align: 'center',
align: "center",
render: (h, params) => {
return h('div', { class: "action" }, [
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.view(params.row.id) } }, '查看'),
return h("div", { class: "action" }, [
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: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h('op', { attrs: { oprate: 'delete' }, on: { click: () => this.remove(params.row.id) } }, '删除')
])
h(
"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(){
console.log(this);
mounted() {
this.laodaction(this.keys)
},
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() {
this.$refs.grid.load()
this.modal = false
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch)
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail =()=> import('./add')
this.level = 1;
(this.upId = 0), (this.title = "新增");
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () =>import('./add')
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () =>import('./detail')
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import('./edit')
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
Api.delete(id).then(r => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success('删除成功')
this.$Message.success("删除成功");
}
})
});
},
cancel() {
this.curId = 0;
this.modal = false
this.modal = false;
},
l(key) {
let vkey = "store_room_location" + "." + key;
return this.$t(vkey)||key
return this.$t(vkey) || key;
}
}
}
};
</script>
<style lang="less">
</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