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

home,库房库位

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