Commit 23752e78 authored by 仇晓婷's avatar 仇晓婷

home,库房库位

parent 57f90fa6
......@@ -7,7 +7,7 @@
<Icon type="ios-keypad" />
<div class="top_menu_box">
<table class="t_table_box">
<tr>
<!-- <tr>
<td class="t_title" :class="{addclass:isStatic}">
<div class="title">
<Icon type="ios-home" />
......@@ -24,7 +24,7 @@
</li>
</ul>
</td>
</tr>
</tr>-->
<tr v-for="(item,i) in filterSider" :key="i">
<td class="t_title" :class="isClass == item.id ? 'addclass' : '' ">
<div class="title">
......@@ -469,7 +469,7 @@ export default {
}
}
.top_menu_box {
padding: 13px 15px 19px 0;
padding: 12px 15px 20px 0;
display: none;
border-radius: 5px;
position: absolute;
......@@ -500,12 +500,12 @@ export default {
}
tr {
td {
padding: 8px 10px 0px 10px;
padding: 10px 10px 0px 10px;
.table_row_ul {
list-style: none;
border-bottom: 1px solid #172c5d;
text-align: left;
padding-bottom: 3px;
li {
list-style: none;
display: inline-block;
......
......@@ -350,7 +350,10 @@ export default {
background-color: none !important;
}
.home {
padding: 10px 0;
padding: 10px 5px;
width: 100%;
height: 100%;
overflow-x: hidden;
.card-user {
padding: 25px 0 0 15px;
height: 120px;
......
......@@ -5,7 +5,7 @@
</template>
<script>
import iview from "./crm/statistical/index.vue";
import iview from "./home/index.vue";
export default {
components: {
iview
......
......@@ -109,7 +109,7 @@ export default {
upId: 0,
code: 0,
status: 0,
codeRuleId: this.nodeInfo.codeRuleId
codeRuleId: this.nodeInfo.codeRuleId,
},
disabled: false,
codeList: [],
......@@ -118,58 +118,58 @@ export default {
title: "序号",
type: "index",
width: 80,
align: "center"
align: "center",
},
{
title: "属性名称",
key: "title",
slot: "title"
slot: "title",
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 200
width: 200,
},
{
title: "设置",
key: "note",
align: "center",
slot: "note"
slot: "note",
},
{
title: "单位",
key: "unitName",
align: "center",
slot: "unitName",
width: "150"
width: "150",
},
{
title: "必填",
key: "required",
align: "center",
slot: "required",
width: 80
width: 80,
},
{
title: "唯一",
key: "isUnique",
align: "center",
slot: "isUnique",
width: 80
width: 80,
},
{
width: 80,
title: "操作",
slot: "action",
align: "center"
}
align: "center",
},
],
checkList: [],
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
async fetch({ store, params }) {
......@@ -184,30 +184,34 @@ export default {
{
conditionalType: "In",
fieldName: "fieldType",
fieldValue: "1,2"
fieldValue: "1,2",
},
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: "0"
}
},
{
conditionalType: "Equal",
fieldName: "codeRuleId",
fieldValue: this.nodeInfo.codeRuleId,
},
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
isDesc: false,
}).then((r) => {
if (r.result) {
var arr = r.result;
this.checkList = arr.filter(function(item) {
this.checkList = arr.filter(function (item) {
item.mid = item.id;
delete item["id"]; //删除属性id
return item.fieldType > 1;
});
}
});
Api.getChildren({ id: 582 }).then(r => {
Api.getChildren({ id: 582 }).then((r) => {
if (r.result) {
this.codeList = r.result;
}
......@@ -229,7 +233,7 @@ export default {
},
addNew() {
let maxId = 0;
this.checkList.map(u => {
this.checkList.map((u) => {
if (u.mid > maxId) {
maxId = u.mid;
}
......@@ -245,17 +249,17 @@ export default {
fieldType: 3,
categoryId: 0,
action: 1,
add: 0 //新增标识
add: 0, //新增标识
};
this.checkList.push(obj);
},
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
let categoryDto = this.entity;
let pro = this.checkList.concat(this.arr);
Api.create({ categoryDto: categoryDto, pro: pro })
.then(r => {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
......@@ -263,7 +267,7 @@ export default {
this.$Message.error(r.error.message);
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message);
});
......@@ -272,7 +276,7 @@ export default {
},
handleClose() {
this.$emit("on-close");
}
}
},
},
};
</script>
......@@ -47,7 +47,6 @@
v-model="row.note"
clearable
transfer
@on-change="setRow(row,index)"
>
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
......@@ -108,7 +107,7 @@ export default {
entity: {
upId: 0,
code: 0,
codeRuleId: this.nodeInfo.codeRuleId
codeRuleId: this.nodeInfo.codeRuleId,
},
arr: [],
disabled: false,
......@@ -117,56 +116,56 @@ export default {
title: "序号",
type: "index",
width: 80,
align: "center"
align: "center",
},
{
title: "属性名称",
key: "title",
slot: "title"
slot: "title",
},
{
title: "属性类型",
key: "dataType",
align: "center",
slot: "dataType",
width: 150
width: 150,
},
{
title: "备注",
key: "note",
slot: "note"
slot: "note",
},
{
title: "单位",
key: "unitName",
align: "center",
slot: "unitName"
slot: "unitName",
},
{
title: "必填",
key: "required",
align: "center",
slot: "required",
width: 80
width: 80,
},
{
title: "唯一",
key: "isUnique",
align: "center",
slot: "isUnique",
width: 80
width: 80,
},
{
title: "操作",
slot: "action",
width: 80,
align: "center"
}
align: "center",
},
],
checkList: [],
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
......@@ -178,7 +177,7 @@ export default {
},
methods: {
get() {
Api.get({ id: this.nodeInfo.id }).then(r => {
Api.get({ id: this.nodeInfo.id }).then((r) => {
if (r.result) {
this.entity = r.result;
this.tableData();
......@@ -190,23 +189,28 @@ export default {
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.id
}
fieldValue: this.nodeInfo.id,
},
{
conditionalType: "Equal",
fieldName: "codeRuleId",
fieldValue: this.nodeInfo.codeRuleId,
},
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
isDesc: false,
}).then((r) => {
if (r.result) {
console.log(r);
r.result.map(u => {
r.result.map((u) => {
u.mid = u.id;
});
this.checkList = r.result;
}
});
Api.getChildren({ id: 582 }).then(r => {
Api.getChildren({ id: 582 }).then((r) => {
if (r.result) {
this.codeList = r.result;
}
......@@ -227,7 +231,7 @@ export default {
},
addNew() {
let maxId = 0;
this.checkList.map(u => {
this.checkList.map((u) => {
if (u.mid > maxId) {
maxId = u.mid;
}
......@@ -243,17 +247,17 @@ export default {
fieldType: 3,
categoryId: 0,
action: 1,
add: 0 //新增标识
add: 0, //新增标识
};
this.checkList.push(obj);
},
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
let categoryDto = this.entity;
let pro = this.checkList.concat(this.arr);
Api.update({ categoryDto: categoryDto, pro: pro })
.then(r => {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
......@@ -261,7 +265,7 @@ export default {
this.$Message.error(r.error.message);
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message);
});
......@@ -270,7 +274,7 @@ export default {
},
handleClose() {
this.$emit("on-close");
}
}
},
},
};
</script>
......@@ -27,6 +27,13 @@
/>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="物料类型" prop="materialType">
<Select v-model="entity.materialType" multiple @on-change="changeVal">
<Option v-for="item in list" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -40,6 +47,7 @@ export default {
name: "Add",
data() {
return {
list: [],
disabled: false,
roleTitle: "库管员",
entity: {
......@@ -52,17 +60,18 @@ export default {
deletionTime: null,
upId: this.upId,
materialType: "",
materialTypeName: "",
title: "",
code: "",
status: null,
description: "",
level: this.level,
userName: "",
userIds: ""
userIds: "",
},
rules: {
title: [{ required: true, message: "必填", trigger: "blur" }]
}
title: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
......@@ -72,13 +81,42 @@ export default {
upId: Number,
user: {
type: Boolean,
default: true
}
default: true,
},
},
mounted() {
this.getList();
},
mounted() {},
methods: {
getList() {
let data = {
conditions: [
{
fieldName: "upId",
fieldValue: 0,
conditionalType: "Equal",
},
],
};
Api.list(data).then((r) => {
this.list = r.result;
// console.log(this.list);
});
},
changeVal(val) {
let code = [];
for (let i = 0; i < this.list.length; i++) {
let obj = this.list[i];
for (let j = 0; j < val.length; j++) {
if (obj.id == val[j]) {
code.push(obj.code);
}
}
}
this.entity.materialTypeName = code.join(",");
},
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
let userNam = "";
......@@ -87,6 +125,7 @@ export default {
userId = this.entity.userIds.join(",");
userNam = this.$refs.userSelected.getSelectNames().join(",");
}
let materialType = this.entity.materialType.join(",");
let paramsdata = {
id: this.entity.id,
upId: this.entity.upId,
......@@ -95,11 +134,13 @@ export default {
description: this.entity.description, //位置
level: this.entity.level,
userName: userNam, //库管员
userIds: userId //库管员id
userIds: userId, //库管员id
materialType: materialType, //物料类型
materialTypeName: this.entity.materialTypeName, //物料编码
};
Api.create(paramsdata)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
......@@ -108,7 +149,7 @@ export default {
this.$Message.error("保存失败");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
......@@ -120,7 +161,7 @@ export default {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
......@@ -129,7 +170,7 @@ export default {
l(key) {
key = "store_room_location" + "." + key;
return this.$t(key);
}
},
},
watch: {
v() {
......@@ -137,7 +178,7 @@ export default {
},
user(v) {
this.user = v;
}
}
},
},
};
</script>
......@@ -25,5 +25,8 @@ export default {
},
deletes(params) {
return Api.post(`${resourceUrl}/storeroomlocation/batchdelete`, params);
}
},
list(params) {
return Api.post(`${material}/category/list`, params);//物料类型列表
},
}
......@@ -4,12 +4,19 @@
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('code')">{{entity.code}}</Filed>
<Filed :span="12" :name="l('description')">{{entity.description}}</Filed>
<Filed :span="12" :name="l('level')"><state code="store.level" :value="entity.level+''" type="text"></state> </Filed>
<Filed :span="24" :name="l('userName')">{{entity.userName}}</Filed>
<Filed :span="12" :name="l('creatorUserId')"><User :value="entity.creatorUserId" /></Filed>
<Filed :span="12" :name="l('level')">
<state code="store.level" :value="entity.level+''" type="text"></state>
</Filed>
<Filed :span="12" :name="l('creatorUserId')">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')"> <User :value="entity.lastModifierUserId" /></Filed>
<Filed :span="12" :name="l('lastModifierUserId')">
<User :value="entity.lastModifierUserId" />
</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="24" name="物料编号">{{entity.materialTypeName}}</Filed>
<Filed :span="24" :name="l('userName')">{{entity.userName}}</Filed>
</Row>
</div>
</template>
......@@ -22,12 +29,12 @@ export default {
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }]
}
code: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: Number
eid: Number,
},
mounted() {
if (this.eid > 0) {
......@@ -36,7 +43,7 @@ export default {
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.$emit("on-load");
});
......@@ -47,14 +54,14 @@ export default {
l(key) {
key = "store_room_location" + "." + key;
return this.$t(key);
}
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
},
},
};
</script>
......@@ -26,6 +26,13 @@
/>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="物料类型" prop="materialType">
<Select v-model="materialType" multiple @on-change="changeVal">
<Option v-for="item in list" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -39,12 +46,16 @@ export default {
name: "Edit",
data() {
return {
list: [],
disabled: false,
roleTitle: "库管",
entity: {},
entity: {
materialType: [],
},
materialType: [],
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
......@@ -54,26 +65,60 @@ export default {
upId: Number,
user: {
type: Boolean,
default: true
}
default: true,
},
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
this.getList();
},
methods: {
getList() {
let data = {
conditions: [
{
fieldName: "upId",
fieldValue: 0,
conditionalType: "Equal",
},
],
};
Api.list(data).then((r) => {
this.list = r.result;
});
},
changeVal(val) {
let code = [];
for (let i = 0; i < this.list.length; i++) {
let obj = this.list[i];
for (let j = 0; j < val.length; j++) {
if (obj.id == val[j]) {
code.push(obj.code);
}
}
}
this.entity.materialTypeName = code.join(",");
},
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
r.result.userIds = this.$u.toIntArray(r.result.userIds);
this.entity = r.result;
var uids = [];
let ids = [];
ids = r.result.materialType.split(",");
ids.map((u) => {
uids.push(parseInt(u));
});
this.materialType = uids;
});
},
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
let materialType = this.materialType.join(",");
let userNam = "";
let userId = "";
if (this.user) {
......@@ -90,11 +135,13 @@ export default {
userName: userNam, //库管员
userIds: userId, //库管员id
creationTime: this.entity.creationTime,
creatorUserId: this.entity.creatorUserId
creatorUserId: this.entity.creatorUserId,
materialType: materialType, //物料类型
materialTypeName: this.entity.materialTypeName, //物料编码
};
Api.update(paramsdata)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
......@@ -103,7 +150,7 @@ export default {
this.$Message.error("保存失败");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
......@@ -117,7 +164,7 @@ export default {
l(key) {
key = "store_room_location" + "." + key;
return this.$t(key);
}
},
},
watch: {
eid(v) {
......@@ -127,7 +174,7 @@ export default {
},
user(v) {
this.user = v;
}
}
},
},
};
</script>
......@@ -27,17 +27,17 @@ import Search from "./search";
export default {
name: "list",
components: {
Search
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 {
easySearch: {
keys: { op: "title,code,userName", value: null }
keys: { op: "title,code,userName", value: null },
},
searchValue: "", //搜索库位名称
keys: "",
......@@ -54,28 +54,34 @@ export default {
{
key: "title",
title: this.l("title"),
align: "left"
align: "left",
},
{
key: "code",
title: this.l("code"),
align: "left"
align: "left",
},
{
key: "description",
title: this.l("description"),
align: "left"
align: "left",
},
{
key: "level",
title: this.l("level"),
align: "left",
code: "store.level"
code: "store.level",
},
{
key: "materialTypeName",
title: "物料编号",
align: "left",
},
{
key: "userName",
title: this.l("userName"),
align: "left"
align: "left",
},
{
title: "操作",
......@@ -88,7 +94,7 @@ export default {
"op",
{
attrs: { oprate: "add" },
on: { click: () => this.addrow(params.row) }
on: { click: () => this.addrow(params.row) },
},
"新增"
),
......@@ -96,7 +102,7 @@ export default {
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) }
on: { click: () => this.view(params.row.id) },
},
"查看"
),
......@@ -105,7 +111,7 @@ export default {
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }
on: { click: () => this.edit(params.row) },
},
"编辑"
),
......@@ -113,14 +119,14 @@ export default {
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row) }
on: { click: () => this.remove(params.row) },
},
"删除"
)
),
]);
}
}
]
},
},
],
};
},
mounted() {
......@@ -136,16 +142,16 @@ export default {
{
fieldName: "title",
fieldValue: name,
conditionalType: "Like"
}
]
conditionalType: "Like",
},
],
};
Api.paged(params).then(r => {
Api.paged(params).then((r) => {
let res = r.result.items;
var data = this.$u.toTree(
res,
0,
u => {
(u) => {
u.expand = true;
u.selected = false;
u.checked = false;
......@@ -195,12 +201,12 @@ export default {
if (node.children.length === 0) {
removeArr.push(index);
}
}
}
} else {
//叶子节点,直接进行匹配
if (node.title.indexOf(value) === -1) {
removeArr.push(index);
}
}
}
},
addOk() {
......@@ -254,20 +260,17 @@ export default {
this.modal = true;
},
remove(row) {
if(row.children&&row.children.length==0)
{
Api.delete(row.id).then(r => {
if (r.success) {
this.$Message.success("删除成功");
var name = this.searchValue;
this.laodaction(name);
}
});
}
else
{
if (row.children && row.children.length == 0) {
Api.delete(row.id).then((r) => {
if (r.success) {
this.$Message.success("删除成功");
var name = this.searchValue;
this.laodaction(name);
}
});
} else {
this.$Message.error("此节点有子节点,不能删除!");
return false
return false;
}
},
cancel() {
......@@ -277,8 +280,8 @@ export default {
l(key) {
let vkey = "store_room_location" + "." + key;
return this.$t(vkey) || key;
}
}
},
},
};
</script>
<style lang="less">
......
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