Commit a10adea4 authored by renjintao's avatar renjintao

new

parents 18015f14 e226e14c
This diff is collapsed.
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
export default { export default {
model: { model: {
prop: "value", prop: "value",
event: "on-change" event: "on-change",
}, },
data() { data() {
return { return {
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
departId: "", departId: "",
group: [], group: [],
ids: [], ids: [],
bId:this.bomId, bId: this.bomId,
}; };
}, },
created() { created() {
...@@ -102,48 +102,53 @@ export default { ...@@ -102,48 +102,53 @@ export default {
value: [String, Number, Array], value: [String, Number, Array],
placeholder: { placeholder: {
type: String, type: String,
default: "请选择物料" default: "请选择物料",
}, },
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
theme: { theme: {
type: String, type: String,
default: "select" default: "select",
}, },
type: { type: {
type: Number, type: Number,
default: 0 default: 0,
}, },
departmentId: { departmentId: {
type: Number, type: Number,
default: 0 default: 0,
}, },
roleTitle: { roleTitle: {
type: String, type: String,
default: "" default: "",
}, },
datas: { datas: {
//自定义用户数据 //自定义用户数据
type: Array, type: Array,
default: null default: null,
}, },
//物料bomid //物料bomid
bomId: { bomId: {
type: Number, type: Number,
default: null default: null,
} },
materialType: {
//物料类型
type: String,
default: "",
},
}, },
methods: { methods: {
change(val) { change(val) {
console.log(val); console.log(val);
let entity = {}; let entity = {};
this.data.forEach(e => { this.data.forEach((e) => {
if (e.id == val) { if (e.id == val) {
entity.name = e.name; entity.name = e.name;
entity.mmcode = e.code; entity.mmcode = e.code;
...@@ -157,17 +162,25 @@ export default { ...@@ -157,17 +162,25 @@ export default {
// 加载物料 // 加载物料
materiallist() { materiallist() {
let url = `${material}/material/materiallist`; let url = `${material}/material/materiallist`;
let conditions = [];
if (this.materialType) {
conditions = [
{
conditionalType: "In",
fieldName: "categoryId",
fieldValue: this.materialType,
},
];
} else {
conditions = [];
}
this.$api this.$api
.post(url, { .post(url, {
// pageIndex: 1,
//departmentId: id,
type: this.type, type: this.type,
conditions: [] conditions: conditions,
// roleTitle: this.roleTitle
// pageSize: 0
}) })
.then(r => { .then((r) => {
this.data = r.result.filter(u => u.status == 3); this.data = r.result.filter((u) => u.status == 3);
if (this.theme == "list") { if (this.theme == "list") {
this.departmentGroup(); this.departmentGroup();
} }
...@@ -175,17 +188,16 @@ export default { ...@@ -175,17 +188,16 @@ export default {
let url1 = `${technologyUrl}productinfo/getmaterialids`; let url1 = `${technologyUrl}productinfo/getmaterialids`;
this.$api this.$api
.get(url1, { .get(url1, {
Id: this.bId Id: this.bId,
}) })
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.ids = res.result; this.ids = res.result;
let arr = [...this.data].filter(x => let arr = [...this.data].filter((x) =>
[...this.ids].some(y => y === x.id) [...this.ids].some((y) => y === x.id)
); );
this.data=arr this.data = arr;
} }
}); });
} }
}); });
...@@ -194,11 +206,11 @@ export default { ...@@ -194,11 +206,11 @@ export default {
var group = []; var group = [];
var users = this.$u.clone(this.data); var users = this.$u.clone(this.data);
if (this.name && this.name.length > 0) { if (this.name && this.name.length > 0) {
users.map(u => { users.map((u) => {
u.checked = this.name.indexOf(u.id) > -1; u.checked = this.name.indexOf(u.id) > -1;
}); });
} }
group = this.$u.group(users, u => { group = this.$u.group(users, (u) => {
return u.departmentId; return u.departmentId;
}); });
var deps = []; var deps = [];
...@@ -208,7 +220,7 @@ export default { ...@@ -208,7 +220,7 @@ export default {
departmentId: u[0].departmentId, departmentId: u[0].departmentId,
children: u, children: u,
opened: (i = 0), opened: (i = 0),
checked: false checked: false,
}); });
}); });
this.group = deps; this.group = deps;
...@@ -226,7 +238,7 @@ export default { ...@@ -226,7 +238,7 @@ export default {
removeItem(item) { removeItem(item) {
this.group.map((u, i) => { this.group.map((u, i) => {
if (u.departmentId == item.departmentId) { if (u.departmentId == item.departmentId) {
u.children.map(p => { u.children.map((p) => {
if (p.id == item.id) { if (p.id == item.id) {
p.checked = false; p.checked = false;
} }
...@@ -239,13 +251,13 @@ export default { ...@@ -239,13 +251,13 @@ export default {
//list 时,设置值。 //list 时,设置值。
listSetValue() { listSetValue() {
var ids = []; var ids = [];
this.checkedItems.map(u => { this.checkedItems.map((u) => {
ids.push(u.id); ids.push(u.id);
}); });
this.$emit("on-change", ids); this.$emit("on-change", ids);
}, },
checkAll(item, i) { checkAll(item, i) {
item.children.map(u => { item.children.map((u) => {
u.checked = item.checked; u.checked = item.checked;
}); });
this.$set(this.group, i, this.group[i]); this.$set(this.group, i, this.group[i]);
...@@ -255,19 +267,19 @@ export default { ...@@ -255,19 +267,19 @@ export default {
getSelectItems() { getSelectItems() {
var items = []; var items = [];
if (this.theme == "list") { if (this.theme == "list") {
this.checkedItems.map(u => { this.checkedItems.map((u) => {
items.push(u); items.push(u);
}); });
} else { } else {
if (!this.multiple) { if (!this.multiple) {
//单选时返回信息 //单选时返回信息
if (this.datas && this.datas.length > 0) { if (this.datas && this.datas.length > 0) {
var item2 = this.datas.filter(u => u.value == this.value); var item2 = this.datas.filter((u) => u.value == this.value);
if (item2 && item2[0]) { if (item2 && item2[0]) {
items.push(item2[0]); items.push(item2[0]);
} }
} else { } else {
var item1 = this.dic.filter(u => u.value == this.value); var item1 = this.dic.filter((u) => u.value == this.value);
if (item1 && item1[0]) { if (item1 && item1[0]) {
items.push(item1[0]); items.push(item1[0]);
} }
...@@ -275,15 +287,15 @@ export default { ...@@ -275,15 +287,15 @@ export default {
} else { } else {
//复选时返回 //复选时返回
if (this.datas && this.datas.length > 0) { if (this.datas && this.datas.length > 0) {
this.value.forEach(v => { this.value.forEach((v) => {
var item3 = this.dic.filter(u => u.value == v); var item3 = this.dic.filter((u) => u.value == v);
if (item3 && item3[0]) { if (item3 && item3[0]) {
items.push(item3[0]); items.push(item3[0]);
} }
}); });
} else { } else {
this.value.forEach(v => { this.value.forEach((v) => {
var item = this.dic.filter(u => u.value == v); var item = this.dic.filter((u) => u.value == v);
if (item && item[0]) { if (item && item[0]) {
items.push(item[0]); items.push(item[0]);
} }
...@@ -298,21 +310,21 @@ export default { ...@@ -298,21 +310,21 @@ export default {
getSelectNames() { getSelectNames() {
var names = []; var names = [];
if (this.theme == "list") { if (this.theme == "list") {
this.checkedItems.map(u => { this.checkedItems.map((u) => {
items.push(u.name); items.push(u.name);
}); });
} else { } else {
this.getSelectItems().forEach(v => { this.getSelectItems().forEach((v) => {
names.push(v.label); names.push(v.label);
}); });
} }
return names; return names;
} },
}, },
computed: { computed: {
dic() { dic() {
let result = []; let result = [];
this.data.forEach(u => { this.data.forEach((u) => {
// result.push({ // result.push({
// value: u.id, // value: u.id,
// label: u.userName // label: u.userName
...@@ -324,43 +336,43 @@ export default { ...@@ -324,43 +336,43 @@ export default {
}, },
checkedItems() { checkedItems() {
var items = []; var items = [];
this.group.map(u => { this.group.map((u) => {
u.children.map(l => { u.children.map((l) => {
if (l.checked) { if (l.checked) {
items.push(l); items.push(l);
} }
}); });
}); });
return items; return items;
} },
}, },
filters: { filters: {
vvv: lis => { vvv: (lis) => {
return 3; return 3;
// return lis.filter(u=>{ // return lis.filter(u=>{
// return u.checked==true // return u.checked==true
// }).lenght; // }).lenght;
} },
}, },
watch: { watch: {
value: { value: {
handler(v, o) { handler(v, o) {
this.name = v; this.name = v;
}, },
deep: true deep: true,
}, },
departmentId: { departmentId: {
handler(v, o) { handler(v, o) {
this.getselectuser(v); this.getselectuser(v);
}, },
deep: true deep: true,
}, },
datas(v) { datas(v) {
if (v) { if (v) {
//alert(JSON.stringify(v)) //alert(JSON.stringify(v))
} }
} },
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -32,7 +32,7 @@ export default { ...@@ -32,7 +32,7 @@ export default {
return { return {
keys: "", keys: "",
expand: false, expand: false,
list: [] list: [],
}; };
}, },
created() { created() {
...@@ -45,19 +45,19 @@ export default { ...@@ -45,19 +45,19 @@ export default {
{ {
fieldName: "title", fieldName: "title",
fieldValue: name, fieldValue: name,
conditionalType: "Like" conditionalType: "Like",
} },
] ],
}; };
this.$api this.$api
.post(`${resourceUrl}/storeroomlocation/paged`, params) .post(`${resourceUrl}/storeroomlocation/paged`, params)
.then(r => { .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.value=u.id u.value = u.id;
u.expand = true; u.expand = true;
u.selected = false; u.selected = false;
u.checked = false; u.checked = false;
...@@ -85,36 +85,39 @@ export default { ...@@ -85,36 +85,39 @@ export default {
"span", "span",
{ {
style: { style: {
color: "#000" color: "#000",
} },
}, },
data.title data.title
) ),
]); ]);
}, },
change(v, b) { change(v, b) {
// console.log(b); // console.log(b);
let ids = []; let ids = [];
let productIds = []; let rootName = [];
ids.push(b.id); ids.push(b.id);
productIds.push(b.value);
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.id); ids.push(u.id);
productIds.push(u.value);
if (u.children) { if (u.children) {
addId(u.children); addId(u.children);
} }
}); });
} }
} }
this.$emit("on-select", b.bomId, b, productIds, ids); var roots = this.$u.findRoots(this.list, b.id).reverse();
rootName = roots.map((u) => {
return u.title;
});
this.$emit("on-select", b, ids, rootName);
}, },
hide() { hide() {
this.$emit("on-hide"); this.$emit("on-hide");
} },
}, },
computed: { computed: {
data() { data() {
...@@ -123,7 +126,7 @@ export default { ...@@ -123,7 +126,7 @@ export default {
let result = []; let result = [];
search(this.keys, items); search(this.keys, items);
function search(keys, data) { function search(keys, data) {
data.map(u => { data.map((u) => {
if (keys.length < 2) { if (keys.length < 2) {
u.expand = expand; u.expand = expand;
result.push(u); result.push(u);
...@@ -138,8 +141,8 @@ export default { ...@@ -138,8 +141,8 @@ export default {
}); });
} }
return result; return result;
} },
} },
}; };
</script> </script>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<div class="fg"> <div class="fg">
<dl> <dl>
<dd v-for="(li,i) in checkedItems"> <dd v-for="(li,i) in checkedItems" :key="i">
<div class="flex"> <div class="flex">
<span class="fg">{{li.userName}}</span> <span class="fg">{{li.userName}}</span>
<a @click="removeItem(li)"> <a @click="removeItem(li)">
...@@ -73,14 +73,14 @@ ...@@ -73,14 +73,14 @@
export default { export default {
model: { model: {
prop: "value", prop: "value",
event: "on-change" event: "on-change",
}, },
data() { data() {
return { return {
name: this.value, name: this.value,
data: [], data: [],
departId: "", departId: "",
group: [] group: [],
}; };
}, },
created() { created() {
...@@ -94,38 +94,43 @@ export default { ...@@ -94,38 +94,43 @@ export default {
value: [String, Number, Array], value: [String, Number, Array],
placeholder: { placeholder: {
type: String, type: String,
default: "请选择人员" default: "请选择人员",
}, },
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
theme: { theme: {
type: String, type: String,
default: "select" default: "select",
}, },
type: { type: {
type: Number, type: Number,
default: 0 default: 0,
}, },
departmentId: { departmentId: {
type: Number, type: Number,
default: 0 default: 0,
}, },
roleTitle: { roleTitle: {
type: String, type: String,
default: "" default: "",
}, },
datas: { datas: {
//自定义用户数据 //自定义用户数据
type: Array, type: Array,
default: null default: null,
} },
}, },
methods: { methods: {
change(event) { change(event) {
// console.log(event) let name = "";
this.$emit("on-change", event); this.data.forEach((e) => {
if (e.id == event) {
name = e.label;
}
});
this.$emit("on-change", event, name);
}, },
// 加载人员 // 加载人员
getselectuser(id) { getselectuser(id) {
...@@ -135,10 +140,10 @@ export default { ...@@ -135,10 +140,10 @@ export default {
// pageIndex: 1, // pageIndex: 1,
departmentId: id, departmentId: id,
type: this.type, type: this.type,
roleTitle: this.roleTitle roleTitle: this.roleTitle,
// pageSize: 0 // pageSize: 0
}) })
.then(r => { .then((r) => {
this.data = r.result; this.data = r.result;
if (this.theme == "list") { if (this.theme == "list") {
this.departmentGroup(); this.departmentGroup();
...@@ -149,11 +154,11 @@ export default { ...@@ -149,11 +154,11 @@ export default {
var group = []; var group = [];
var users = this.$u.clone(this.data); var users = this.$u.clone(this.data);
if (this.name && this.name.length > 0) { if (this.name && this.name.length > 0) {
users.map(u => { users.map((u) => {
u.checked = this.name.indexOf(u.id) > -1; u.checked = this.name.indexOf(u.id) > -1;
}); });
} }
group = this.$u.group(users, u => { group = this.$u.group(users, (u) => {
return u.departmentId; return u.departmentId;
}); });
var deps = []; var deps = [];
...@@ -163,7 +168,7 @@ export default { ...@@ -163,7 +168,7 @@ export default {
departmentId: u[0].departmentId, departmentId: u[0].departmentId,
children: u, children: u,
opened: (i = 0), opened: (i = 0),
checked: false checked: false,
}); });
}); });
this.group = deps; this.group = deps;
...@@ -181,7 +186,7 @@ export default { ...@@ -181,7 +186,7 @@ export default {
removeItem(item) { removeItem(item) {
this.group.map((u, i) => { this.group.map((u, i) => {
if (u.departmentId == item.departmentId) { if (u.departmentId == item.departmentId) {
u.children.map(p => { u.children.map((p) => {
if (p.id == item.id) { if (p.id == item.id) {
p.checked = false; p.checked = false;
} }
...@@ -194,13 +199,13 @@ export default { ...@@ -194,13 +199,13 @@ export default {
//list 时,设置值。 //list 时,设置值。
listSetValue() { listSetValue() {
var ids = []; var ids = [];
this.checkedItems.map(u => { this.checkedItems.map((u) => {
ids.push(u.id); ids.push(u.id);
}); });
this.$emit("on-change", ids); this.$emit("on-change", ids);
}, },
checkAll(item, i) { checkAll(item, i) {
item.children.map(u => { item.children.map((u) => {
u.checked = item.checked; u.checked = item.checked;
}); });
this.$set(this.group, i, this.group[i]); this.$set(this.group, i, this.group[i]);
...@@ -210,19 +215,19 @@ export default { ...@@ -210,19 +215,19 @@ export default {
getSelectItems() { getSelectItems() {
var items = []; var items = [];
if (this.theme == "list") { if (this.theme == "list") {
this.checkedItems.map(u => { this.checkedItems.map((u) => {
items.push(u); items.push(u);
}); });
} else { } else {
if (!this.multiple) { if (!this.multiple) {
//单选时返回信息 //单选时返回信息
if (this.datas && this.datas.length > 0) { if (this.datas && this.datas.length > 0) {
var item2 = this.datas.filter(u => u.value == this.value); var item2 = this.datas.filter((u) => u.value == this.value);
if (item2 && item2[0]) { if (item2 && item2[0]) {
items.push(item2[0]); items.push(item2[0]);
} }
} else { } else {
var item1 = this.dic.filter(u => u.value == this.value); var item1 = this.dic.filter((u) => u.value == this.value);
if (item1 && item1[0]) { if (item1 && item1[0]) {
items.push(item1[0]); items.push(item1[0]);
} }
...@@ -230,15 +235,15 @@ export default { ...@@ -230,15 +235,15 @@ export default {
} else { } else {
//复选时返回 //复选时返回
if (this.datas && this.datas.length > 0) { if (this.datas && this.datas.length > 0) {
this.value.forEach(v => { this.value.forEach((v) => {
var item3 = this.dic.filter(u => u.value == v); var item3 = this.dic.filter((u) => u.value == v);
if (item3 && item3[0]) { if (item3 && item3[0]) {
items.push(item3[0]); items.push(item3[0]);
} }
}); });
} else { } else {
this.value.forEach(v => { this.value.forEach((v) => {
var item = this.dic.filter(u => u.value == v); var item = this.dic.filter((u) => u.value == v);
if (item && item[0]) { if (item && item[0]) {
items.push(item[0]); items.push(item[0]);
} }
...@@ -253,21 +258,21 @@ export default { ...@@ -253,21 +258,21 @@ export default {
getSelectNames() { getSelectNames() {
var names = []; var names = [];
if (this.theme == "list") { if (this.theme == "list") {
this.checkedItems.map(u => { this.checkedItems.map((u) => {
items.push(u.userName); items.push(u.userName);
}); });
} else { } else {
this.getSelectItems().forEach(v => { this.getSelectItems().forEach((v) => {
names.push(v.label); names.push(v.label);
}); });
} }
return names; return names;
} },
}, },
computed: { computed: {
dic() { dic() {
let result = []; let result = [];
this.data.forEach(u => { this.data.forEach((u) => {
// result.push({ // result.push({
// value: u.id, // value: u.id,
// label: u.userName // label: u.userName
...@@ -279,43 +284,43 @@ export default { ...@@ -279,43 +284,43 @@ export default {
}, },
checkedItems() { checkedItems() {
var items = []; var items = [];
this.group.map(u => { this.group.map((u) => {
u.children.map(l => { u.children.map((l) => {
if (l.checked) { if (l.checked) {
items.push(l); items.push(l);
} }
}); });
}); });
return items; return items;
} },
}, },
filters: { filters: {
vvv: lis => { vvv: (lis) => {
return 3; return 3;
// return lis.filter(u=>{ // return lis.filter(u=>{
// return u.checked==true // return u.checked==true
// }).lenght; // }).lenght;
} },
}, },
watch: { watch: {
value: { value: {
handler(v, o) { handler(v, o) {
this.name = v; this.name = v;
}, },
deep: true deep: true,
}, },
departmentId: { departmentId: {
handler(v, o) { handler(v, o) {
this.getselectuser(v); this.getselectuser(v);
}, },
deep: true deep: true,
}, },
datas(v) { datas(v) {
if (v) { if (v) {
//alert(JSON.stringify(v)) //alert(JSON.stringify(v))
} }
} },
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -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;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:high="false" :high="false"
@on-drag-drop="onDragDrop" @on-drag-drop="onDragDrop"
:page="false" :page="false"
@on-selection-change="onSelect" @on-change="onSelect"
:batch="true" :batch="true"
:border="true" :border="true"
:easy="true" :easy="true"
......
...@@ -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
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('name')" prop="materialId"> <FormItem :label="l('storeTitle')+':'">
<Materiel v-model="entity.materialId" @on-change="change"></Materiel> <div style="color:#515a6e">{{rootName}}</div>
</FormItem> <!-- <StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect> -->
</Col>
<Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeId">
<StoreSelect v-model="entity.storeId" @on-change="storeChange"></StoreSelect>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('inputTotal')" prop="total"> <FormItem :label="l('creator')+':'">{{entity.creator}}</FormItem>
<InputNumber v-model="entity.total"></InputNumber>
</FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('unitPrice')" prop="unitPrice"> <FormItem :label="l('name')" prop="materialId">
<InputNumber v-model="entity.unitPrice"></InputNumber> <Materiel v-model="entity.materialId" @on-change="change" :materialType="materialType"></Materiel>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('batch')" prop="batch">
<Input v-model="entity.batch"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('certificateOfApproval')" prop="certificateOfApproval">
<Input v-model="entity.certificateOfApproval"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('originalManufacturer')" prop="originalManufacturer">
<Input v-model="entity.originalManufacturer"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('creator')" prop="creator"> <FormItem :label="l('inputTotal')" prop="total">
{{entity.creator}} <InputNumber v-model="entity.total" style="width:280px"></InputNumber>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('remark')" prop="remark"> <FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input> <Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Divider orientation="left">物料属性</Divider>
<Col :span="12" v-if="entity.materialId">
<FormItem label="名称:">
<span>{{entity.name}}</span>
</FormItem>
</Col>
<Col :span="12" v-if="entity.materialId">
<FormItem label="编码:">
<span>{{entity.materialCode}}</span>
</FormItem>
</Col>
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name" v-if="li.field!='name'&&li.field!='code'">
<Input v-if="li.dataType==0" v-model="entity.json[li.field]"></Input>
<InputNumber
v-if="li.dataType==1||li.dataType==2"
v-model="entity.json[li.field]"
class="w100"
></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity.json[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==5" type="textarea" v-model="entity.json[li.filed]"></Input>
<DatePicker
v-if="li.dataType==4"
v-model="entity.json[li.field]"
type="date"
:placeholder="'选择'+li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity.json[li.field]"></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity.json[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity.json[li.field]"></Input>
<state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</FormItem>
</Col>
</Row>
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
...@@ -55,11 +78,13 @@ ...@@ -55,11 +78,13 @@
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
name: "Add", name: "add",
data() { data() {
return { return {
disabled: false, disabled: false,
fileds: [], //扩展属性
entity: { entity: {
name: "", name: "",
materialId: "", materialId: "",
...@@ -75,7 +100,8 @@ export default { ...@@ -75,7 +100,8 @@ export default {
creator: this.$store.state.userInfo.userName, creator: this.$store.state.userInfo.userName,
unitPrice: null, unitPrice: null,
originalManufacturer: "", originalManufacturer: "",
remark: "" remark: "",
json: {},
}, },
rules: { rules: {
materialId: [ materialId: [
...@@ -83,44 +109,37 @@ export default { ...@@ -83,44 +109,37 @@ export default {
required: true, required: true,
message: "请选择物料", message: "请选择物料",
type: "string", type: "string",
trigger: "change" trigger: "change",
} },
],
storeId: [
{
required: true,
message: "请选择库位",
type: "number",
trigger: "change"
}
], ],
total: [ total: [
{ {
required: true, required: true,
message: "请输入入库数量", message: "请输入入库数量",
type: "number", type: "number",
trigger: "change" trigger: "change",
} },
] ],
} },
}; };
}, },
props: { props: {
v: Object, // v: Object,
eid: Number eid: Number,
}, rootName: String,
mounted() { storeTitle: String,
if (this.eid > 0) { materialType: String,
this.load(this.eid);
}
}, },
mounted() {},
methods: { methods: {
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate((v) => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
this.entity.storeId = this.eid;
this.entity.storeTitle = this.storeTitle;
Api.create(this.entity) Api.create(this.entity)
.then(r => { .then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
...@@ -129,10 +148,10 @@ export default { ...@@ -129,10 +148,10 @@ 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);
}); });
} }
}); });
...@@ -140,35 +159,42 @@ export default { ...@@ -140,35 +159,42 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.entity.id = 0;
});
},
change(e) { change(e) {
this.entity.name = e.name; this.entity.name = e.name;
this.entity.materialId = e.materialId; this.entity.materialId = e.materialId;
this.entity.materialCode = e.mmcode; this.entity.materialCode = e.mmcode;
this.entity.json.name = e.name;
this.entity.json.materialCode = e.mmcode;
Api.getmaterialdefinitionproperty({ materialId: e.materialId }).then(
(r) => {
if (r.result) {
this.fileds = r.result.filter(function (item) {
item.span = 12;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
// return item.fieldType != 1;
return item.fieldType;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// this.$set(this.entity.customProperties,u.filed,v)
this.$set(this.entity, u.filed, v);
});
}
}
);
}, },
storeChange(v, item) {
this.entity.storeId = item.id;
this.entity.storeTitle = item.title;
},
l(key) { l(key) {
key = "stock" + "." + key; key = "stock" + "." + key;
return this.$t(key); return this.$t(key);
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
}, },
eid(v) { },
if (v > 0) { watch: {},
this.load(v);
}
}
}
}; };
</script> </script>
...@@ -30,4 +30,11 @@ export default { ...@@ -30,4 +30,11 @@ export default {
pagedStockitem(params) { pagedStockitem(params) {
return Api.post(`${resourceUrl}/stockitem/paged`, params); return Api.post(`${resourceUrl}/stockitem/paged`, params);
}, },
getmaterialdefinitionproperty(params){
return Api.get(`${material}/custompropertydefinition/getmaterialdefinitionproperty`,params);
},
list(params){
return Api.post(`${resourceUrl}/stockdetail/list`,params); //物料动态属性展示
},
} }
<template> <template>
<div class="detail"> <div>
<Row> <span class="mr20">物料名称:{{materialName}}</span>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed> <span class="mr20">物料编码:{{mcode}}</span>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed> <span>库位:{{storeTitle}}</span>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed> <DataGrid
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed> :columns="columns"
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed> ref="grid"
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed> :action="action"
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> :conditions="easySearch"
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed> :tool="false"
<Filed :span="12" :name="l('materialId')">{{entity.materialId}}</Filed> :height="treeHeight"
<Filed :span="12" :name="l('materialType')">{{entity.materialType}}</Filed> ></DataGrid>
<Filed :span="12" :name="l('total')">{{entity.total}}</Filed> <Modal v-model="modal1" title="查看物料属性" @on-ok="ok" @on-cancel="cancel">
<Filed :span="12" :name="l('storeId')">{{entity.storeId}}</Filed> <Form ref="form" :label-width="100">
<Filed :span="12" :name="l('storeTitle')">{{entity.storeTitle}}</Filed> <Row>
<Filed :span="12" :name="l('minNum')">{{entity.minNum}}</Filed> <Col v-for="li in fileds" :key="li.field" :span="li.span">
<Filed :span="12" :name="l('brand')">{{entity.brand}}</Filed> <FormItem :label="li.title">
<Filed :span="12" :name="l('specifications')">{{entity.specifications}}</Filed> <span>{{li.value}}</span>
<Filed :span="12" :name="l('batch')">{{entity.batch}}</Filed> <div v-if="li.dataType==5" v-html="li.value"></div>
<Filed :span="12" :name="l('certificateOfApproval')">{{entity.certificateOfApproval}}</Filed> <InputFile v-if="li.dataType==6" v-model="li.value"></InputFile>
<Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed> <InputFile v-if="li.dataType==7" v-model="li.value"></InputFile>
<Filed :span="12" :name="l('unitPrice')">{{entity.unitPrice}}</Filed> <state
<Filed :span="12" :name="l('originalManufacturer')">{{entity.originalManufacturer}}</Filed> v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed> :value="li.unitName"
</Row> code="material.main.unitName"
type="tag"
></state>
<Dictionary v-if="li.dataType==3" v-model="li.value" :code="li.note"></Dictionary>
</FormItem>
</Col>
</Row>
</Form>
</Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
name: "Add", name: "list",
head: {
title: "入库明细",
author: "henq",
description: "stock_item 7/13/2020 6:04:18 PM",
},
data() { data() {
return { return {
entity: {}, action: Api.indexStockitem,
rules: { easySearch: {
name: [{ required: true, message: "必填", trigger: "blur" }], materialCode: { op: "Equal", value: this.mcode },
code: [{ required: true, message: "必填", trigger: "blur" }] storeId: { op: "In", value: this.storeId },
} },
data: [],
modal1: false,
treeHeight: 300,
curId: 0,
fileds: [],
columns: [
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true,
},
{ key: "total", title: this.l("total"), high: true },
{
key: "nowTotal",
title: this.l("nowTotal"),
high: true,
},
{ key: "batch", title: this.l("batch"), align: "left", high: true },
{
key: "certificateOfApproval",
title: this.l("certificateOfApproval"),
align: "left",
high: true,
},
{
key: "unitPrice",
title: this.l("unitPrice"),
high: true,
},
{
key: "originalManufacturer",
title: this.l("originalManufacturer"),
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "center",
high: true,
},
{
key: "creator",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "remark",
title: this.l("remark"),
align: "left",
high: true,
tooltip: true,
},
{
title: "操作",
key: "action",
width: 150,
align: "left",
render: (h, params) => {
return h("div", [
h(
"op",
{
attrs: {
oprate: "detail",
},
on: { click: () => this.detail(params.row) },
},
"查看"
),
]);
},
},
],
cols: [], //
materialName: "",
storeTitle: "",
newData: [],
}; };
}, },
props: { props: {
eid: Number eid: Number,
storeId: Number,
mcode: String,
},
created() {
this.treeHeight = window.innerHeight - 150;
}, },
mounted() { mounted() {
if (this.eid > 0) { this.load();
this.load(this.eid); window.onresize = () => {
} ///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
})();
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
load(v) { detail(row) {
Api.get({ id: v }).then(r => { this.modal1 = true;
this.entity = r.result; Api.getmaterialdefinitionproperty({ materialId: row.materialId }).then(
this.$emit("on-load"); (r) => {
if (r.result) {
let fileds = r.result.map(function (item) {
item.span = 12;
item.value = null;
return item;
});
let conditions = [
{
conditionalType: "Equal",
fieldName: "code",
fieldValue: row.code,
},
];
Api.list({
conditions: conditions,
}).then((r) => {
if (r.result) {
let customProperties = r.result[0].customProperties;
for (var f in customProperties) {
fileds.forEach((u, i) => {
if (u.field == f) {
fileds[i].value = customProperties[f];
}
});
}
this.fileds = fileds;
}
});
// console.log(this.fileds);
}
}
);
},
load() {
Api.get({ id: this.eid }).then((r) => {
this.materialName = r.result.name;
this.storeTitle = r.result.storeTitle;
}); });
}, },
handleClose() { ok() {
this.$emit("on-close"); this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
cancel() {
this.curId = 0;
this.modal = false;
}, },
l(key) { l(key) {
key = "stock" + "." + key; let vkey = "stock_item" + "." + key;
return this.$t(key); return this.$t(vkey) || key;
} },
}, },
watch: { watch: {},
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
}; };
</script> </script>
<style lang="less">
</style>
\ No newline at end of file
...@@ -24,8 +24,18 @@ ...@@ -24,8 +24,18 @@
<Button type="primary" @click="add">入库</Button> <Button type="primary" @click="add">入库</Button>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="fscreeen"> <Modal v-model="modal" :title="title" width="800" footer-hide :fullscreen="fscreeen">
<component :is="detail" :eid="curId" :storeId="storeId" :mcode="mCode" @on-close="cancel" @on-ok="ok" /> <component
:is="detail"
:eid="curId"
:rootName="rootName"
:storeTitle="storeTitle"
:materialType="materialType"
:storeId="storeId"
:mcode="mCode"
@on-close="cancel"
@on-ok="ok"
/>
</Modal> </Modal>
</Content> </Content>
</Layout> </Layout>
...@@ -36,26 +46,29 @@ import Search from "./search"; ...@@ -36,26 +46,29 @@ 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: "stock 7/13/2020 11:48:09 AM" description: "stock 7/13/2020 11:48:09 AM",
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
showMenu: true, showMenu: true,
easySearch: { easySearch: {
keys: { op: "name,storeTitle,materialCode", value: null } keys: { op: "name,storeTitle,materialCode", value: null },
}, },
fscreeen: false, fscreeen: false,
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
storeId:null, storeId: null,
rootName: "",
storeTitle: "",
materialType: "",
mCode: "", mCode: "",
columns: [ columns: [
{ {
...@@ -63,19 +76,18 @@ export default { ...@@ -63,19 +76,18 @@ export default {
title: this.l("name"), title: this.l("name"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "materialCode", key: "materialCode",
title: this.l("materialCode"), title: this.l("materialCode"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "total", key: "total",
title: this.l("total"), title: this.l("total"),
align: "right",
high: true, high: true,
render: (h, params) => { render: (h, params) => {
let minNum = 0; let minNum = 0;
...@@ -88,29 +100,34 @@ export default { ...@@ -88,29 +100,34 @@ export default {
props: { props: {
content: "库存不足,总数小于" + minNum, content: "库存不足,总数小于" + minNum,
placement: "top", placement: "top",
disabled: params.row.total > minNum ? true : false disabled: params.row.total > minNum ? true : false,
}, },
class: params.row.total > minNum ? "" : "red" class: params.row.total > minNum ? "" : "red",
}, },
params.row.total params.row.total
); );
} },
}, },
{ {
key: "minNum", key: "minNum",
title: this.l("minNum"), title: this.l("minNum"),
align: "right",
high: true, high: true,
render: (h, params) => { render: (h, params) => {
return h("div", {}, params.row.minNum ? params.row.minNum : "0"); return h("div", {}, params.row.minNum ? params.row.minNum : "0");
} },
}, },
// {
// key: "unitPrice",
// title: this.l("unitPrice"),
// easy: true,
// high: true,
// },
{ {
key: "storeTitle", key: "storeTitle",
title: this.l("storeTitle"), title: this.l("storeTitle"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -125,18 +142,18 @@ export default { ...@@ -125,18 +142,18 @@ export default {
attrs: { attrs: {
oprate: "detail", oprate: "detail",
}, },
on: { click: () => this.setNum(params.row) } on: { click: () => this.setNum(params.row) },
}, },
"设置最低库存" "预警"
), ),
h( h(
"op", "op",
{ {
attrs: { oprate: "detail" }, attrs: { oprate: "detail" },
on: { click: () => this.view(params.row) } on: { click: () => this.view(params.row) },
}, },
"查看" "查看"
) ),
//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( // h(
// "op", // "op",
...@@ -155,14 +172,14 @@ export default { ...@@ -155,14 +172,14 @@ export default {
// "删除" // "删除"
// ) // )
]); ]);
} },
} },
], ],
treeData: [], treeData: [],
ocolumn: [], ocolumn: [],
treeHeight: "", treeHeight: "",
ids: [], ids: [],
list: [] list: [],
}; };
}, },
created() { created() {
...@@ -187,17 +204,20 @@ export default { ...@@ -187,17 +204,20 @@ export default {
this.$refs.grid.load(); this.$refs.grid.load();
this.modal = false; this.modal = false;
this.fscreeen = false; this.fscreeen = 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; if (this.curId) {
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.fscreeen = false; this.fscreeen = false;
this.modal = true; this.modal = true;
} else {
this.$Message.error("请先选择库房库位");
}
}, },
copy(id) { copy(id) {
this.curId = id; this.curId = id;
...@@ -207,27 +227,27 @@ export default { ...@@ -207,27 +227,27 @@ export default {
}, },
view(row) { view(row) {
this.curId = row.id; this.curId = row.id;
this.storeId=row.storeId; this.storeId = row.storeId;
this.mCode = row.materialCode; this.mCode = row.materialCode;
this.title = "详情"; this.title = "详情";
this.detail = () => import("./itemIndex"); this.detail = () => import("./detail");
this.fscreeen = true; this.fscreeen = true;
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;
...@@ -240,13 +260,18 @@ export default { ...@@ -240,13 +260,18 @@ export default {
//this.$Message.info("展开左侧树") //this.$Message.info("展开左侧树")
this.showMenu = true; this.showMenu = true;
}, },
productSearch(id, item, productIds, ids) { productSearch(item, ids, rootName) {
console.log(item);
this.curId = item.id;
this.storeTitle = item.title;
this.rootName = rootName.join(" / ");
this.materialType = item.materialType;
let where = { storeId: { op: "In", value: ids } }; let where = { storeId: { op: "In", value: ids } };
this.$refs.grid.reload(where); this.$refs.grid.reload(where);
}, },
setNum(row) { setNum(row) {
this.curId = row.id; this.curId = row.id;
this.title = "设置最低库存"; this.title = "预警";
this.detail = () => import("./setNum"); this.detail = () => import("./setNum");
this.fscreeen = false; this.fscreeen = false;
this.modal = true; this.modal = true;
...@@ -258,7 +283,7 @@ export default { ...@@ -258,7 +283,7 @@ export default {
//new tree start //new tree start
initTree() { initTree() {
var sumData = []; var sumData = [];
this.$http.order.getallselecttree().then(res => { this.$http.order.getallselecttree().then((res) => {
//alert(JSON.stringify(res)) //alert(JSON.stringify(res))
if (res.result) { if (res.result) {
for (var i = 0; i < res.result.length; i++) { for (var i = 0; i < res.result.length; i++) {
...@@ -269,8 +294,8 @@ export default { ...@@ -269,8 +294,8 @@ export default {
this.$Message.error("加载产品树失败!"); this.$Message.error("加载产品树失败!");
} }
}); });
} },
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
......
<template>
<div>
<span class="mr20">物料名称:{{materialName}}</span>
<span class="mr20">物料编码:{{mcode}}</span>
<span>库位:{{storeTitle}}</span>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
:tool="false"
:height="treeHeight"
></DataGrid>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "list",
head: {
title: "入库明细",
author: "henq",
description: "stock_item 7/13/2020 6:04:18 PM"
},
data() {
return {
action: Api.indexStockitem,
easySearch: {
materialCode: { op: "Equal", value: this.mcode },
storeId: { op: "In", value: this.storeId }
},
data: [],
treeHeight: 300,
curId: 0,
columns: [
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true
},
{ key: "total", title: this.l("total"), align: "right", high: true },
{
key: "nowTotal",
title: this.l("nowTotal"),
align: "right",
high: true
},
{ key: "batch", title: this.l("batch"), align: "left", high: true },
{
key: "certificateOfApproval",
title: this.l("certificateOfApproval"),
align: "left",
high: true
},
{
key: "unitPrice",
title: this.l("unitPrice"),
align: "right",
high: true
},
{
key: "originalManufacturer",
title: this.l("originalManufacturer"),
align: "left",
high: true
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "center",
high: true
},
{
key: "creator",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "remark",
title: this.l("remark"),
align: "left",
high: true,
tooltip: true
}
],
materialName: "",
storeTitle: ""
};
},
props: {
eid: Number,
storeId: Number,
mcode: String
},
created() {
this.treeHeight = window.innerHeight - 150;
},
mounted() {
this.load();
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
})();
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
load() {
Api.get({ id: this.eid }).then(r => {
this.materialName = r.result.name;
this.storeTitle = r.result.storeTitle;
});
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
let vkey = "stock_item" + "." + key;
return this.$t(vkey) || key;
}
},
watch: {
eid(v) {
if (v != 0) {
// this.load(v);
}
}
}
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<div>
<div>
<Divider orientation="left">物料属性</Divider>
</div>
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name">
<Input v-if="li.dataType==0" v-model="entity[li.field]"></Input>
<InputNumber
v-if="li.dataType==1||li.dataType==2"
v-model="entity[li.field]"
class="w100"
></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input>
<DatePicker
v-if="li.dataType==4"
v-model="entity[li.field]"
type="date"
:placeholder="'选择'+li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</FormItem>
</Col>
<!-- <Col :span="24">
<div v-html="entity"></div>
</Col>-->
<!-- <Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>-->
</Row>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "",
data() {
return {
fileds: [], //扩展属性
};
},
props: {
materialId: Number,
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {},
methods: {
initFiled(v) {
Api.getmaterialdefinitionproperty({ materialId: v }).then((r) => {
if (r.result) {
this.fileds = r.result.filter(function (item) {
item.span = 12;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
return item.fieldType != 1;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
// this.$set(this.entity.customProperties,u.filed,v)
this.$set(this.entity, u.filed, v);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "stock" + "." + key;
return this.$t(key);
},
},
watch: {
materialId(v) {
if (v) {
this.initFiled(v);
}
},
},
};
</script>
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('name')" prop="name"> <FormItem :label="l('name')" prop="name">
<Input v-model="entity.name" disabled></Input> <div style="color:#515a6e">{{entity.name}}</div>
<!-- <Input v-model="entity.name" disabled></Input> -->
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeTitle"> <FormItem :label="l('storeTitle')" prop="storeTitle">
<Input v-model="entity.storeTitle" disabled></Input> <div style="color:#515a6e">{{entity.storeTitle}}</div>
<!-- <Input v-model="entity.storeTitle" disabled></Input> -->
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
...@@ -37,14 +39,14 @@ export default { ...@@ -37,14 +39,14 @@ export default {
materialCode: "", materialCode: "",
storeId: null, storeId: null,
storeTitle: "", storeTitle: "",
minNum: null minNum: null,
}, },
rules: {} rules: {},
}; };
}, },
props: { props: {
v: Object, v: Object,
eid: Number eid: Number,
}, },
mounted() { mounted() {
if (this.eid > 0) { if (this.eid > 0) {
...@@ -53,18 +55,17 @@ export default { ...@@ -53,18 +55,17 @@ export default {
}, },
methods: { methods: {
handleSubmit() { handleSubmit() {
if(this.entity.minNum==0) if (this.entity.minNum == 0) {
{
this.$Message.error("设置最低库存不能小于1"); this.$Message.error("设置最低库存不能小于1");
return return;
} }
let params = { let params = {
id: this.entity.id, id: this.entity.id,
minNum: this.entity.minNum minNum: this.entity.minNum,
}; };
this.disabled = true; this.disabled = true;
Api.setminnum(params) Api.setminnum(params)
.then(r => { .then((r) => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
this.$Message.success("设置成功"); this.$Message.success("设置成功");
...@@ -73,7 +74,7 @@ export default { ...@@ -73,7 +74,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);
...@@ -83,7 +84,7 @@ export default { ...@@ -83,7 +84,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;
if (!r.result.minNum) { if (!r.result.minNum) {
this.entity.minNum = 0; this.entity.minNum = 0;
...@@ -93,7 +94,7 @@ export default { ...@@ -93,7 +94,7 @@ export default {
l(key) { l(key) {
key = "stock" + "." + key; key = "stock" + "." + key;
return this.$t(key); return this.$t(key);
} },
}, },
watch: { watch: {
v() { v() {
...@@ -103,7 +104,7 @@ export default { ...@@ -103,7 +104,7 @@ export default {
if (v > 0) { if (v > 0) {
this.load(v); this.load(v);
} }
} },
} },
}; };
</script> </script>
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a> <a @click="remove(index,row)" style="color:#FF7A8B" v-if="row.fieldType>1">删除</a>
</template> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> <Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
...@@ -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,35 @@ export default { ...@@ -184,30 +184,35 @@ 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;
return true;
}); });
} }
}); });
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 +234,7 @@ export default { ...@@ -229,7 +234,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 +250,17 @@ export default { ...@@ -245,17 +250,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 +268,7 @@ export default { ...@@ -263,7 +268,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 +277,7 @@ export default { ...@@ -272,7 +277,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>
...@@ -84,7 +83,7 @@ ...@@ -84,7 +83,7 @@
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B">删除</a> <a @click="remove(index,row)" style="color:#FF7A8B" v-if="row.fieldType>1">删除</a>
</template> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> <Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
...@@ -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>
<template>
<div class="addform">
<Form ref="form" :model="entity" :rules="rules" :label-width="100">
<Row class="rowTitle100">
<Col :span="12">
<FormItem :label="l('nameOfResource')" prop="nameOfResource">
<Input v-model="entity.nameOfResource"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('specifications')" >
<Input v-model="entity.specifications"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('totalNum')" prop="totalNum">
<InputNumber v-model="entity.totalNum" :min="1"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('measuringUnit')" >
<Input v-model="entity.measuringUnit"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('qualityCharacteristics')" >
<Input v-model="entity.qualityCharacteristics"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('batchNo')" >
<Input v-model="entity.batchNo"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeTitle">
<Input v-model="entity.storeTitle" readonly clearable @on-clear="clear" placeholder="请选择..." style="width:274px">
<Button slot="append" @click="selectStoreHouse">选择</Button>
<label slot="append" v-if="false">{{entity.storeId}}</label>
</Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('resourceType')" >
<Dictionary
code="mes_xingchi_resource.resource.resource_type"
v-model="entity.resourceType"
style="width:274px"
></Dictionary>
</FormItem>
</Col>
</Row>
<Row>
<Col span="18">&nbsp;</Col>
<Col span="6">
<Button @click="handleClose" class="ml20">取消</Button>
<Button type="primary" @click="handleSubmit">保存</Button>
</Col>
</Row>
</Form>
<StoreHouse
:show.sync="showStoreHouseTree"
:value.sync="entity.storeId"
:text.sync="entity.storeTitle"
:type='4'
/>
</div>
</template>
<script>
import Api from './api'
import StoreHouse from '@/components/modalTree/storeHouse.vue'
export default {
name: 'Add',
components: {
StoreHouse
},
data() {
return {
entity: {
totalNum:1,
},
rules: {
nameOfResource: [{ required: true, message: '必填', trigger: 'blur' }],
specifications: [{ required: true, message: '必填', trigger: 'blur' }],
totalNum: [{required: true, message: '必填', trigger: 'blur',type: "number" }],
measuringUnit: [{ required: true, message: '必填', trigger: 'blur' }],
qualityCharacteristics: [{ required: true, message: '必填', trigger: 'blur' }],
batchNo: [{ required: true, message: '必填', trigger: 'blur' }],
storeTitle: [{ required: true, message: '必填', trigger: 'blur'}],
resourceType: [{ required: true, message: '必填', trigger: 'blur' }],
},
showStoreHouseTree: false
}
},
props: {
v: Object
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.entity.state="1"
Api.create(this.entity).then((r) => {
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
}
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'resource' + '.' + key
return this.$t(key)
},
//清空库房库位控件信息
clear()
{
this.entity.storeId=null
this.entity.storeTitle=''
},
selectStoreHouse() {
this.showStoreHouseTree = true
}
},
watch: {
v() {
this.entity = this.$clone(this.v)
}
}
}
</script>
import Api from '@/plugins/request'
export default {
// index: `${resourceUrl}/resource/paged`,
index: `${resourceUrl}/resource/pagelist`,
paged(params) {
return Api.post(`${resourceUrl}/resource/paged`, params);
},
get(params) {
return Api.get(`${resourceUrl}/resource/get`, params);
},
create(params) {
return Api.post(`${resourceUrl}/resource/create`, params);
},
update(params) {
return Api.post(`${resourceUrl}/resource/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${resourceUrl}/resource/delete`, {
params: params
});
},
getTree(params) {
let url = `${systemUrl}/storeroomlocation/getlocationfilterperson`;
return Api.get(url,params)
},
//借出
cartCreate(params) {
return Api.post(`${resourceUrl}/trolley/create`, params);
},
//归还列表
cartGetList(params) {
return Api.post(`${resourceUrl}/trolleyitem/paged`, params);
},
//归还
cartGiveBack(params) {
return Api.post(`${resourceUrl}/trolley/giveback`, params);
},
//历史操作
getHistory(params) {
return Api.get(`${resourceUrl}/resourcehistory/gethistory`, params);
},
}
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index:`${resourceUrl}/resource/paged`,
paged(params){
return Api.post(`${resourceUrl}/resource/paged`,params);
},
get(params){
return Api.get(`${resourceUrl}/resource/get`,params);
},
create(params){
return Api.post(`${resourceUrl}/resource/create`,params);
},
update(params){
return Api.post(`${resourceUrl}/resource/update`,params);
},
//删除:
delete(params) {
return Api.delete(`${resourceUrl}/resource/delete`,params);
},
}
\ No newline at end of file
<template>
<div>
<Table border :columns="columns" :data="cartList" class="tableCommon" height="300">
<template slot-scope="{ row, index }" slot="numberAvailable">
<InputNumber
:max="row.numberAvailable1"
:min="1"
v-model="row.numberAvailable"
@on-change="inputOrderCat(row,index)"
></InputNumber>
</template>
</Table>
<Form :model="resource" :label-width="110" class="mt20 mb20" :rules="rules" ref="form">
<Row>
<Col span="9">&nbsp;</Col>
<Col span="8">
<FormItem label="库管员">
<Input v-model="resource.libraryTube" disabled></Input>
</FormItem>
</Col>
<Col span="7">
<FormItem label="领料人" style="width:100%" prop="customerId">
<UserSelect ref="userSelected" v-model="resource.customerId" :type="0" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="20">&nbsp;</Col>
<Col span="4">
<Button @click="handleClose" class="ml20">取消</Button>
<Button type="primary" @click="handleSubmit">借出</Button>
</Col>
</Row>
</Form>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
let userInfo=this.$store.state.admin.user.info;
return {
columns: [
{
key: 'resourceId',
title: this.l('resourceId'),
width: 180
},
{
title: this.l('nameOfResource'),
key: 'nameOfResource'
},
{
title: this.l('specifications'),
key: 'specifications',
width: 100
},
{
title: this.l('measuringUnit'),
key: 'measuringUnit',
width: 100
},
{
title: this.l('qualityCharacteristics'),
key: 'qualityCharacteristics',
width: 100
},
{
title: this.l('batchNo'),
key: 'batchNo',
width: 100
},
{
title: this.l('storeTitle'),
key: 'storeTitle',
width: 100
},
{
title: this.l('numberAvailable'),
key: 'numberAvailable',
width: 120,
slot: 'numberAvailable'
},
{
title: this.l('action'),
key: 'action',
width: 100,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'a',
{
class: 'remove',
on: { click: () => this.remove(params.row.id) }
},
'删除'
)
])
}
}
],
resource: {
libraryTube: userInfo.userName, //库管员
libraryTubeId: userInfo.userId, //库管员ID
customer: '', //领料人
customerId: null, //领料人ID
category: 0, //类别
state: 2, //状态
item: []
},
rules: {
customerId: [
{ required: true, message: '请选择', trigger: 'blur', type: 'number' }
]
}
}
},
props: {
cartList: {
type: [Array],
default: ()=>{
return []
}
}
},
methods: {
handleSubmit() {
var items = []
let count = 0
this.cartList.forEach((data) => {
let objList = Object.assign({}, this.resource)
delete objList.item
objList.resourceId = data.id
objList.count = data.numberAvailable
items.push(objList)
count += 1
})
this.resource.item = items
if (this.resource.customerId == 0) {
}
this.$refs.form.validate((v) => {
if (v) {
Api.cartCreate(this.resource).then((r) => {
if (r.success) {
this.$Message.success('保存成功')
this.$emit('substr', count, -1)
this.$emit('on-ok')
}
})
}
})
},
handleClose() {
this.$emit('on-close')
},
remove(id) {
const index = this.cartList.findIndex(function(item) {
return item.id === id
})
this.cartList.splice(index, 1)
this.$emit('substr', 1, index)
},
l(key) {
let vkey = 'resource' + '.' + key
return this.$t(vkey) || key
},
changeCustom(val) {
this.resource.customerId = val + ''
//this.resource.customer = this.arry2Name(this.userList1, val)
},
arry2Name(arryList, values) {
//类别转换
var codes = arryList
var name = ''
for (let i in codes) {
if (values == codes[i].value) {
name = codes[i].name
}
}
return name
},
inputOrderCat(row, index) {
this.cartList[index].numberAvailable = row.numberAvailable
}
},
watch: {}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('resourceId')">{{entity.resourceId}}</Filed>
<Filed :span="12" :name="l('nameOfResource')">{{entity.nameOfResource}}</Filed>
<Filed :span="12" :name="l('specifications')">{{entity.specifications}}</Filed>
<Filed :span="12" :name="l('measuringUnit')">{{entity.measuringUnit}}</Filed>
<Filed :span="12" :name="l('qualityCharacteristics')">{{entity.qualityCharacteristics}}</Filed>
<Filed :span="12" :name="l('batchNo')">{{entity.batchNo}}</Filed>
<Filed :span="12" :name="l('storeTitle')">{{entity.storeTitle}}</Filed>
<Filed :span="12" :name="l('resourceType')">
<state
code="mes_xingchi_resource.resource.resource_type"
:value="entity.resourceType"
type="text"
></state>
</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {
resourceType:''
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.entity.resourceType = r.result.resourceType + ''
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'resource' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
This diff is collapsed.
<template>
<div>
<Table border :columns="columns" :data="data" class="tableCommon" height="300"></Table>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'log',
data() {
return {
data: [],
columns: [
{
title: this.l('action'),
key: 'action',
width: 120,
align:"center",
render: (h, params) => {
return h('state', {
props: {
code: 'mes_xingchi_resource.resource.life_state',
type: 'text',
value: params.row.action + ''
}
})
}
},
{
title: this.l('count'),
key: 'count',
width: 120,
align: 'right'
},
{
title: this.l('numberAvailable'),
key: 'numberAvailable',
width: 120,
align: 'right'
},
{
title: this.l('creationTime'),
key: 'creationTime',
width: 200,
align:"center"
},
{
title: this.l('libraryTube'),
key: 'libraryTube',
align:"center",
}
]
}
},
props: { eid: Number },
methods: {
//数据初始化
load(v) {
Api.getHistory({ id: v }).then((r) => {
if (r.success) {
this.data = r.result
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
let vkey = 'resource' + '.' + key
return this.$t(vkey) || key
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<Input
search
enter-button
placeholder="请输入借出人/名称/编码"
@on-search="easySearch"
v-model="search.name"
style="width:240px"
/>&nbsp;
<Table
border
:columns="columns"
:data="dataList"
class="tableCommon"
@on-selection-change="selectInfo"
height="300"
>
<template slot-scope="{ row, index }" slot="count">
<InputNumber
:max="row.count1"
:min="1"
v-model="row.count"
@on-change="inputOrderCat(row,index)"
></InputNumber>
</template>
</Table>
<Form :label-width="110" class="mt20 mb20">
<Row>
<Col span="15">&nbsp;</Col>
<Col span="9">
<FormItem label="库管员">
<Input v-model="libraryTube" disabled></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="16">&nbsp;</Col>
<Col span="8">
<FormItem>
<Button @click="handleClose" class="ml20">取消</Button>
<Button type="primary" @click="handleSubmit">归还</Button>
</FormItem>
</Col>
</Row>
</Form>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
dataList: [],
columns: [
{
type: 'selection',
width: 70,
align: 'center'
},
{
key: 'resourceCode',
title: this.l('resourceCode'),
width: 180
},
{
title: this.l('nameOfResource'),
key: 'nameOfResource'
},
{
title: this.l('specifications'),
key: 'specifications',
width: 100
},
{
title: this.l('measuringUnit'),
key: 'measuringUnit',
width: 100
},
{
title: this.l('qualityCharacteristics'),
key: 'qualityCharacteristics',
width: 100
},
{
title: this.l('batchNo'),
key: 'batchNo',
width: 100
},
{
title: this.l('storeTitle'),
key: 'storeTitle',
width: 100
},
{
title: this.l('count'),
key: 'count',
width: 120,
slot: 'count'
}
],
search: {
name: '',
pageSize: 0,
pageIndex: 0
},
resource: [],
selectList: [],
libraryTube: this.$store.state.userInfo.userName //库管员
}
},
props: {},
methods: {
handleSubmit() {
if (JSON.stringify(this.selectList) != '[]') {
this.resource = this.selectList
Api.cartGiveBack(this.resource).then((r) => {
if (r.success) {
this.$Message.success('归还成功')
this.$emit('on-ok')
}
})
} else {
this.$Message.error('请选择归还的资源')
}
},
handleClose() {
this.$emit('on-close')
},
selectInfo(value) {
this.selectList = []
this.selectList = value
},
l(key) {
let vkey = 'resource' + '.' + key
return this.$t(vkey) || key
},
easySearch() {
this.dataList = []
Api.cartGetList(this.search).then((r) => {
if (r.success) {
let items = []
let dataList1 = []
dataList1 = r.result.items
dataList1.forEach((data) => {
let objList = data
objList.count1 = parseFloat(data.count)
objList.count = parseFloat(data.count)
objList.state = '3'
items.push(objList)
})
this.dataList = items
}
})
},
inputOrderCat(row, index) {
this.dataList[index].count = row.count
}
},
watch: {}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<Form ref="form" :model="condition" :label-width="100">
<Row class="rowTitle100">
<Col :span="12">
<FormItem :label="l('resourceId')" prop="resourceId">
<Input v-model="condition.resourceId.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('nameOfResource')" prop="nameOfResource">
<Input v-model="condition.nameOfResource.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('specifications')" prop="specifications">
<Input v-model="condition.specifications.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('measuringUnit')" prop="measuringUnit">
<Input v-model="condition.measuringUnit.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('qualityCharacteristics')" prop="qualityCharacteristics">
<Input v-model="condition.qualityCharacteristics.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('batchNo')" prop="batchNo">
<Input v-model="condition.batchNo.value"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('storeTitle')" prop="storeTitle">
<Input
v-model="condition.storeTitle.value"
readonly
placeholder="请选择..."
style="width:274px"
>
<Button slot="append" @click="selectStoreHouse">选择</Button>
<label slot="append" v-if="false">{{condition.storeId.value}}</label>
</Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('state')" prop="state">
<Dictionary
code="mes_xingchi_resource.resource.state"
v-model="condition.state.value"
style="width:274px"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('resourceType')" prop="resourceType">
<Dictionary
code="mes_xingchi_resource.resource.resource_type"
v-model="condition.resourceType.value"
:multiple="true"
style="width:274px"
></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('CreationTime')" prop="CreationTime">
<DatePicker
type="daterange"
v-model="condition.CreationTime.value"
placement="bottom-end"
></DatePicker>
</FormItem>
</Col> -->
</Row>
</Form>
<StoreHouse
:show.sync="showStoreHouseTree"
:value.sync="condition.storeId.value"
:text.sync="condition.storeTitle.value"
style="z-index:999999;position: absolute;"
/>
</div>
</template>
<script>
import Api from './api'
import StoreHouse from '@/components/modalTree/storeHouse.vue'
export default {
name: 'Search',
components: {
StoreHouse
},
data() {
return {
condition: {
resourceId: { op: 'Like', value: null },
nameOfResource: { op: 'Equal', value: null },
specifications: { op: 'Equal', value: null },
measuringUnit: { op: 'Equal', value: null },
qualityCharacteristics: { op: 'Equal', value: null },
batchNo: { op: 'Equal', value: null },
storeId: { op: 'Equal', value: null },
storeTitle: { op: 'Equal', value: null },
state: { op: 'Equal', value: null },
resourceType: { op: 'In', value: null },
CreationTime: { op: 'Range', value: null }
},
showStoreHouseTree: false
}
},
props: {
v: Object
},
methods: {
search() {
alert('未实现')
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'resource' + '.' + key
return this.$t(key)
},
selectStoreHouse() {
this.showStoreHouseTree = true
}
},
watch: {
v() {
this.condition = this.$clone(this.v)
}
}
}
</script>
This diff is collapsed.
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
// index: `${resourceUrl}/resource/paged`, // index: `${resourceUrl}/resource/paged`,
index: `${resourceUrl}/resource/pagelist`, index: `${resourceUrl}/resourcenew/paged`,
paged(params) { index1: `${resourceUrl}/trolley/paged`, //借出记录
return Api.post(`${resourceUrl}/resource/paged`, params); paged(params) { //借出记录查询明细
}, return Api.post(`${resourceUrl}/trolleyitem/paged`, params);
},
get(params) { get(params) {
return Api.get(`${resourceUrl}/resource/get`, params); return Api.get(`${resourceUrl}/resourcenew/get`, params);
}, },
create(params) { create(params) {
return Api.post(`${resourceUrl}/resource/create`, params); return Api.post(`${resourceUrl}/resourcenew/create`, params);
},
update(params) {
return Api.post(`${resourceUrl}/resource/update`, params);
}, },
// update(params) {
// return Api.post(`${resourceUrl}/resourcenew/update`, params);
// },
//删除: //删除:
delete(params) { delete(params) {
return Api.delete(`${resourceUrl}/resource/delete`, { return Api.delete(`${resourceUrl}/resourcenew/delete`, {
params: params params: params
}); });
}, },
...@@ -40,5 +41,8 @@ export default { ...@@ -40,5 +41,8 @@ export default {
getHistory(params) { getHistory(params) {
return Api.get(`${resourceUrl}/resourcehistory/gethistory`, params); return Api.get(`${resourceUrl}/resourcehistory/gethistory`, params);
}, },
getmaterialdefinitionproperty(params){
return Api.get(`${material}/custompropertydefinition/getmaterialdefinitionproperty`,params);
},
} }
\ No newline at end of file
<template> <template>
<div> <div>
<Table border :columns="columns" :data="cartList" class="tableCommon" height="300"> <Table border :columns="columns" :data="cartList" class="tableCommon" height="300">
<template slot-scope="{ row, index }" slot="numberAvailable"> <template slot-scope="{ row, index }" slot="count">
<InputNumber <InputNumber
:max="row.numberAvailable1" :max="row.numberAvailable"
:min="1" :min="1"
v-model="row.numberAvailable" v-model="row.count"
@on-change="inputOrderCat(row,index)" @on-change="inputOrderCat(row,index)"
></InputNumber> ></InputNumber>
</template> </template>
...@@ -20,7 +20,12 @@ ...@@ -20,7 +20,12 @@
</Col> </Col>
<Col span="7"> <Col span="7">
<FormItem label="领料人" style="width:100%" prop="customerId"> <FormItem label="领料人" style="width:100%" prop="customerId">
<UserSelect ref="userSelected" v-model="resource.customerId" :type="0" /> <UserSelect
ref="userSelected"
v-model="resource.customerId"
:type="0"
@on-change="change"
/>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -35,159 +40,215 @@ ...@@ -35,159 +40,215 @@
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
let userInfo=this.$store.state.admin.user.info; let userInfo = this.$store.state.admin.user.info;
return { return {
columns: [ columns: [
{ {
key: 'resourceId', key: "resourceCode",
title: this.l('resourceId'), title: this.l("resourceId"),
width: 180 align: "left",
easy: true,
render: (h, params) => {
return h(
"a",
{
props: {},
style: {},
on: { click: () => this.detail(params.row.id) },
},
params.row.resourceCode
);
},
}, },
{ {
title: this.l('nameOfResource'), key: "nameOfResource",
key: 'nameOfResource' title: this.l("nameOfResource"),
align: "left",
easy: true,
tooltip: true,
}, },
{ {
title: this.l('specifications'), key: "code",
key: 'specifications', title: "编码",
width: 100 align: "left",
width: 150,
}, },
// {
// key: "creatorUserId",
// title: this.l("creatorUserId"),
// hide: false,
// type: "user",
// align: "left",
// },
{ {
title: this.l('measuringUnit'), key: "totalNum",
key: 'measuringUnit', title: this.l("totalNum"),
width: 100 align: "left",
easy: true,
}, },
{ {
title: this.l('qualityCharacteristics'), key: "numberAvailable",
key: 'qualityCharacteristics', title: this.l("numberAvailable"),
width: 100 align: "left",
easy: true,
}, },
// {
// key: "storeId",
// title: this.l("storeId"),
// align: "left",
// high: true,
// hide: true,
// },
{ {
title: this.l('batchNo'), key: "storeTitle",
key: 'batchNo', title: this.l("storeTitle"),
width: 100 align: "left",
}, },
{ {
title: this.l('storeTitle'), key: "state",
key: 'storeTitle', title: this.l("state"),
width: 100 align: "left",
render: (h, params) => {
return h("state", {
props: {
code: "mes_xingchi_resource.resource.state",
type: "text",
value: params.row.state + "",
},
});
},
}, },
{ {
title: this.l('numberAvailable'), title: this.l("count"),
key: 'numberAvailable', key: "count",
width: 120, width: 100,
slot: 'numberAvailable' slot: "count",
}, },
{ {
title: this.l('action'), title: this.l("action"),
key: 'action', key: "action",
width: 100, width: 100,
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h('div', { class: 'action' }, [ return h("div", { class: "action" }, [
h( h(
'a', "a",
{ {
class: 'remove', class: "remove",
on: { click: () => this.remove(params.row.id) } on: { click: () => this.remove(params.row.id) },
}, },
'删除' "删除"
) ),
]) ]);
} },
} },
], ],
resource: { resource: {
libraryTube: userInfo.userName, //库管员 libraryTube: userInfo.userName, //库管员
libraryTubeId: userInfo.userId, //库管员ID libraryTubeId: userInfo.userId, //库管员ID
customer: '', //领料人 customer: "", //领料人
customerId: null, //领料人ID customerId: null, //领料人ID
category: 0, //类别 category: 0, //类别
state: 2, //状态 state: 2, //状态
item: [] item: [],
}, },
rules: { rules: {
customerId: [ customerId: [
{ required: true, message: '请选择', trigger: 'blur', type: 'number' } {
] required: true,
} message: "请选择",
} trigger: "blur",
type: "number",
},
],
},
};
}, },
props: { props: {
cartList: { cartList: {
type: [Array], type: [Array],
default: ()=>{ default: () => {
return [] return [];
} },
} },
}, },
methods: { methods: {
change(val, name) {
this.resource.customer = name;
},
handleSubmit() { handleSubmit() {
var items = [] if (this.cartList.length > 0) {
let count = 0 var items = [];
this.cartList.forEach((data) => { let count = 0;
let objList = Object.assign({}, this.resource) this.cartList.forEach((data) => {
delete objList.item let objList = Object.assign({}, this.resource);
objList.resourceId = data.id delete objList.item;
objList.count = data.numberAvailable console.log(data);
items.push(objList) objList.resourceId = data.resourceId;
count += 1 objList.resourceCode = data.resourceCode;
}) objList.resourceMainId = data.id;
objList.count = data.count;
this.resource.item = items items.push(objList);
if (this.resource.customerId == 0) { count += 1;
} });
this.$refs.form.validate((v) => { this.resource.item = items;
if (v) { if (this.resource.customerId == 0) {
Api.cartCreate(this.resource).then((r) => {
if (r.success) {
this.$Message.success('保存成功')
this.$emit('substr', count, -1)
this.$emit('on-ok')
}
})
} }
}) this.$refs.form.validate((v) => {
if (v) {
Api.cartCreate(this.resource).then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("substr", count, -1);
this.$emit("on-ok");
}
});
}
});
} else {
this.$Message.error("借出车不能为空");
}
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
remove(id) { remove(id) {
const index = this.cartList.findIndex(function(item) { const index = this.cartList.findIndex(function (item) {
return item.id === id return item.id === id;
}) });
this.cartList.splice(index, 1) this.cartList.splice(index, 1);
this.$emit('substr', 1, index) this.$emit("substr", 1, index);
}, },
l(key) { l(key) {
let vkey = 'resource' + '.' + key let vkey = "resource" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
}, },
changeCustom(val) { changeCustom(val) {
this.resource.customerId = val + '' this.resource.customerId = val + "";
//this.resource.customer = this.arry2Name(this.userList1, val) //this.resource.customer = this.arry2Name(this.userList1, val)
}, },
arry2Name(arryList, values) { arry2Name(arryList, values) {
//类别转换 //类别转换
var codes = arryList var codes = arryList;
var name = '' var name = "";
for (let i in codes) { for (let i in codes) {
if (values == codes[i].value) { if (values == codes[i].value) {
name = codes[i].name name = codes[i].name;
} }
} }
return name return name;
}, },
inputOrderCat(row, index) { inputOrderCat(row, index) {
this.cartList[index].numberAvailable = row.numberAvailable this.cartList[index].numberAvailable = row.numberAvailable;
} this.cartList[index].count = row.count;
},
}, },
watch: {} watch: {},
} };
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
This diff is collapsed.
<template> <template>
<div> <div>
<Table border :columns="columns" :data="data" class="tableCommon" height="300"></Table> <Table border :columns="columns" :data="data" class="tableCommon" height="300"></Table>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'log', name: "log",
data() { data() {
return { return {
data: [], data: [],
columns: [ columns: [
{ {
title: this.l('action'), title: this.l("action"),
key: 'action', key: "action",
width: 120, width: 120,
align:"center", align: "center",
render: (h, params) => { render: (h, params) => {
return h('state', { return h("state", {
props: { props: {
code: 'mes_xingchi_resource.resource.life_state', code: "mes_xingchi_resource.resource.life_state",
type: 'text', type: "text",
value: params.row.action + '' value: params.row.action + "",
} },
}) });
} },
}, },
{ {
title: this.l('count'), title: this.l("creatorUserId"),
key: 'count', key: "customer",
width: 120,
align: 'right'
}, },
{ {
title: this.l('numberAvailable'), title: "编号",
key: 'numberAvailable', key: "code",
width: 120,
align: 'right'
}, },
{ {
title: this.l('creationTime'), title: this.l("count"),
key: 'creationTime', key: "count",
width: 200,
align:"center"
}, },
{ {
title: this.l('libraryTube'), title: this.l("numberAvailable"),
key: 'libraryTube', key: "numberAvailable",
align:"center", },
} {
] title: this.l("creationTime"),
} key: "creationTime",
align: "center",
},
{
title: this.l("libraryTube"),
key: "libraryTube",
align: "center",
},
],
};
}, },
props: { eid: Number }, props: { eid: Number },
methods: { methods: {
//数据初始化 //数据初始化
load(v) { load() {
Api.getHistory({ id: v }).then((r) => { Api.getHistory({ id: this.eid }).then((r) => {
if (r.success) { if (r.success) {
this.data = r.result this.data = r.result;
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
let vkey = 'resource' + '.' + key let vkey = "resource" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
} },
},
mounted() {
this.load();
}, },
watch: { };
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入领料人名称/记录编号" v-model="easySearch.keys.value" v-width="260" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component
:is="detail"
:eid="curId"
:cartList="this.$u.clone(this.$store.state.cart)"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
action: Api.index1,
easySearch: {
keys: { op: "serialNumber,customer", value: null },
},
detail: null,
dataList: [],
curId: 0,
modal: false,
title: "归还",
columns: [
{
type: "index",
width: 70,
align: "center",
},
{
title: "借出记录编号",
key: "serialNumber",
},
{
key: "creationTime",
title: "借出时间",
},
{
title: this.l("libraryTube"),
key: "libraryTube",
},
{
title: "领料人",
key: "customer",
},
{
title: "状态",
key: "status",
code: "resource.record.status",
},
{
title: this.l("action"),
key: "action",
width: 150,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"a",
{
class: "details",
on: { click: () => this.details(params.row.id) },
},
params.row.status == 0 ? "归还" : ""
),
]);
},
},
],
name: "",
resource: [],
selectList: [],
libraryTube: this.$store.state.userInfo.userName, //库管员
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
props: {},
mounted() {},
methods: {
details(id) {
this.curId = id;
this.detail = () => import("./return");
this.modal = true;
},
handleClose() {
this.$emit("on-close");
},
selectInfo(value) {
this.selectList = [];
this.selectList = value;
},
l(key) {
let vkey = "resource" + "." + key;
return this.$t(vkey) || key;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
cancel() {
this.curId = 0;
this.modal = false;
},
},
watch: {},
};
</script>
<style>
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -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);//物料类型列表
},
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -203,6 +203,7 @@ export default { ...@@ -203,6 +203,7 @@ export default {
}, },
proChange(id, data, listName, roots) { proChange(id, data, listName, roots) {
console.log(listName)
this.entity.levelId = id; this.entity.levelId = id;
this.entity.levelTitle = listName.join(" / "); this.entity.levelTitle = listName.join(" / ");
}, },
......
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