Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
05a177e5
Commit
05a177e5
authored
Sep 01, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源物料ok
parent
c4b7b181
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
654 additions
and
540 deletions
+654
-540
materiel.vue
components/page/materiel.vue
+11
-2
add.vue
pages/material/add.vue
+10
-8
index.vue
pages/material/index.vue
+19
-4
index.vue
pages/materiel/masterData/index.vue
+1
-0
masterData.vue
pages/materiel/masterData/masterData.vue
+1
-1
submit.vue
pages/materiel/masterData/submit.vue
+3
-2
add.vue
pages/resource/resource/add.vue
+14
-8
index.vue
pages/resource/resource/index.vue
+583
-515
add.vue
pages/store/add.vue
+6
-0
edit.vue
pages/store/edit.vue
+6
-0
No files found.
components/page/materiel.vue
View file @
05a177e5
...
...
@@ -51,7 +51,6 @@
:multiple=
"multiple"
:departmentId=
"departmentId"
:disabled=
"disabled"
clearable
filterable
>
<Option
...
...
@@ -143,6 +142,11 @@ export default {
type
:
String
,
default
:
""
,
},
codeRuleType
:
{
// 库房类型
type
:
Number
,
default
:
""
,
},
},
methods
:
{
change
(
val
)
{
...
...
@@ -167,9 +171,14 @@ export default {
conditions
=
[
{
conditionalType
:
"In"
,
fieldName
:
"
c
ategoryId"
,
fieldName
:
"
rootC
ategoryId"
,
fieldValue
:
this
.
materialType
,
},
{
fieldName
:
"codeRuleType"
,
fieldValue
:
this
.
codeRuleType
+
""
,
conditionalType
:
"In"
,
},
];
}
else
{
conditions
=
[];
...
...
pages/material/add.vue
View file @
05a177e5
...
...
@@ -12,7 +12,7 @@
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('name')"
prop=
"materialId"
>
<Materiel
v-model=
"entity.materialId"
@
on-change=
"change"
:materialType=
"materialType"
></Materiel>
<Materiel
v-model=
"entity.materialId"
@
on-change=
"change"
:materialType=
"materialType"
:codeRuleType=
'codeRuleType'
></Materiel>
</FormItem>
</Col>
...
...
@@ -123,13 +123,15 @@ export default {
},
};
},
props
:
{
// v: Object,
eid
:
Number
,
rootName
:
String
,
storeTitle
:
String
,
materialType
:
String
,
},
props
:
[
"eid"
,
"rootName"
,
"storeTitle"
,
"materialType"
,
"codeRuleType"
],
// props: {
// eid: Number,
// rootName: String,
// storeTitle: String,
// materialType: String,
// codeRuleType:String,
// },
mounted
()
{},
methods
:
{
handleSubmit
()
{
...
...
pages/material/index.vue
View file @
05a177e5
...
...
@@ -31,6 +31,7 @@
:rootName=
"rootName"
:storeTitle=
"storeTitle"
:materialType=
"materialType"
:codeRuleType=
"codeRuleType"
:storeId=
"storeId"
:mcode=
"mCode"
@
on-close=
"cancel"
...
...
@@ -60,6 +61,7 @@ export default {
easySearch
:
{
keys
:
{
op
:
"name,storeTitle,materialCode"
,
value
:
null
},
},
codeRuleType
:
null
,
fscreeen
:
false
,
modal
:
false
,
title
:
"新增"
,
...
...
@@ -211,10 +213,14 @@ export default {
},
add
()
{
if
(
this
.
curId
)
{
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
if
(
this
.
codeRuleType
==
1
)
{
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请先选择正确的库房类型"
);
}
}
else
{
this
.
$Message
.
error
(
"请先选择库房库位"
);
}
...
...
@@ -262,7 +268,16 @@ export default {
},
productSearch
(
item
,
ids
,
rootName
)
{
console
.
log
(
item
);
let
type
=
[];
this
.
curId
=
item
.
id
;
type
=
item
.
codeRuleType
.
split
(
","
);
if
(
type
)
{
type
.
forEach
((
e
)
=>
{
if
(
e
==
1
)
{
this
.
codeRuleType
=
1
;
}
});
}
this
.
storeTitle
=
item
.
title
;
this
.
rootName
=
rootName
.
join
(
" / "
);
this
.
materialType
=
item
.
materialType
;
...
...
pages/materiel/masterData/index.vue
View file @
05a177e5
...
...
@@ -102,6 +102,7 @@ export default {
},
methods
:
{
clickItem
(
val
)
{
console
.
log
(
val
);
this
.
nodeInfo
.
codeRuleId
=
val
;
this
.
model8
=
val
;
this
.
cityList
.
forEach
((
e
)
=>
{
...
...
pages/materiel/masterData/masterData.vue
View file @
05a177e5
...
...
@@ -258,7 +258,7 @@ export default {
this
.
addCol
=
items
;
this
.
cols
=
this
.
$u
.
clone
(
this
.
columns
);
let
extra
=
items
.
map
(
u
=>
{
console
.
log
(
u
);
//
console.log(u);
var
col
=
{
key
:
u
.
field
,
title
:
u
.
title
...
...
pages/materiel/masterData/submit.vue
View file @
05a177e5
...
...
@@ -90,6 +90,7 @@ export default {
return
{
action
:
Api
.
index
,
rowId
:
""
,
fileds
:[],
entity
:
{},
metCodesStrTxt
:
""
,
results
:
{},
...
...
@@ -313,9 +314,9 @@ export default {
let
codeList
=
[];
let
idList
=
[];
if
(
this
.
eid
!==
0
)
{
if
(
this
.
entity
.
code
)
{
if
(
this
.
entity
.
code
!=
0
)
{
codeList
.
push
(
this
.
entity
.
code
);
}
else
{
}
else
{
codeList
.
push
(
this
.
eid
);
}
idList
.
push
(
this
.
eid
);
...
...
pages/resource/resource/add.vue
View file @
05a177e5
...
...
@@ -12,7 +12,12 @@
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('name')"
prop=
"resourceId"
>
<Materiel
v-model=
"entity.resourceId"
@
on-change=
"change"
:materialType=
"materialType"
></Materiel>
<Materiel
v-model=
"entity.resourceId"
@
on-change=
"change"
:materialType=
"materialType"
:codeRuleType=
"codeRuleType"
></Materiel>
</FormItem>
</Col>
...
...
@@ -125,13 +130,14 @@ export default {
},
};
},
props
:
{
// v: Object,
eid
:
Number
,
rootName
:
String
,
storeTitle
:
String
,
materialType
:
String
,
},
props
:
[
"eid"
,
"rootName"
,
"storeTitle"
,
"materialType"
,
"codeRuleType"
],
// props: {
// // v: Object,
// eid: Number,
// rootName: String,
// storeTitle: String,
// materialType: String,
// },
mounted
()
{},
methods
:
{
handleSubmit
()
{
...
...
pages/resource/resource/index.vue
View file @
05a177e5
<
template
>
<Layout
class=
"full"
>
<Layout
class=
"full"
>
<Sider
hide-trigger
v-if=
"showMenu"
class=
"menu_side"
width=
"300"
>
<StoreTree
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
<StoreTree
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
</Sider>
<div
v-if=
"!showMenu"
class=
"show_menu"
>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
</div>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:batch=
"true"
:format=
"checkData"
@
all-change=
"allchange"
@
on-selection-change=
"onSelect"
exportTitle=
"制造资源"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
clearable
placeholder=
"请输入资源名称/资源编码/编码"
v-model
.
trim=
"easySearch.keys.value"
v-width=
"260"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
<FormItem>
<a
href=
"#"
@
click=
"lendingRecord"
class=
"ml20"
>
借出记录
</a>
</FormItem>
</Form>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
入库
</Button>
<!--
<Button
type=
"primary"
@
click=
"returnModel=true"
>
归还
</Button>
-->
<Badge
:count=
"this.$store.state.count"
overflow-count=
"99"
style=
"margin-right:5px;"
>
<Button
icon=
"md-cart"
@
click=
"showCart"
>
借出车
</Button>
</Badge>
<Button
@
click=
"openModalIm"
>
导入
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"addCart"
>
加入借出车
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
:fullscreen=
"fscreeen"
>
<component
:is=
"detail"
:eid=
"curId"
:rootName=
"rootName"
:storeTitle=
"storeTitle"
:materialType=
"materialType"
:storeId=
"storeId"
:mcode=
"mCode"
:cartList=
"this.$u.clone(this.$store.state.cart)"
@
on-close=
"cancel"
@
on-ok=
"ok"
@
substr=
"substr"
/>
</Modal>
<ImportExcel
ref=
"importExcel"
@
on-get-data=
"getData"
:columns=
"columns"
:open=
"ModalIm"
@
on-cancel=
"ModalImCancel"
@
on-ok=
"ok"
/>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:batch=
"true"
:format=
"checkData"
@
all-change=
"allchange"
@
on-selection-change=
"onSelect"
exportTitle=
"制造资源"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
clearable
placeholder=
"请输入资源名称/资源编码/编码"
v-model
.
trim=
"easySearch.keys.value"
v-width=
"260"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
<FormItem>
<a
href=
"#"
@
click=
"lendingRecord"
class=
"ml20"
>
借出记录
</a>
</FormItem>
</Form>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
入库
</Button>
<!--
<Button
type=
"primary"
@
click=
"returnModel=true"
>
归还
</Button>
-->
<Badge
:count=
"this.$store.state.count"
overflow-count=
"99"
style=
"margin-right:5px;"
>
<Button
icon=
"md-cart"
@
click=
"showCart"
>
借出车
</Button>
</Badge>
<Button
@
click=
"openModalIm"
>
导入
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"addCart"
>
加入借出车
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
:fullscreen=
"fscreeen"
>
<component
:is=
"detail"
:eid=
"curId"
:rootName=
"rootName"
:storeTitle=
"storeTitle"
:materialType=
"materialType"
:codeRuleType=
"codeRuleType"
:storeId=
"storeId"
:mcode=
"mCode"
:cartList=
"this.$u.clone(this.$store.state.cart)"
@
on-close=
"cancel"
@
on-ok=
"ok"
@
substr=
"substr"
/>
</Modal>
<ImportExcel
ref=
"importExcel"
@
on-get-data=
"getData"
:columns=
"columns"
:open=
"ModalIm"
@
on-cancel=
"ModalImCancel"
@
on-ok=
"ok"
/>
</Content>
</Layout>
</Layout>
</template>
<
script
>
import
Api
from
"./api"
;
import
Search
from
"./search"
;
export
default
{
name
:
"list"
,
components
:
{
Search
,
},
// head: {
// title: "库存表",
// author: "henq",
// description: "stock 7/13/2020 11:48:09 AM",
// },
data
()
{
return
{
action
:
Api
.
index
,
showMenu
:
true
,
easySearch
:
{
keys
:
{
op
:
"nameOfResource,code,resourceCode"
,
value
:
null
},
},
fscreeen
:
false
,
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
storeId
:
null
,
rootName
:
""
,
storeTitle
:
""
,
materialType
:
""
,
mCode
:
""
,
columns
:
[{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
,
},
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
,
sortable
:
true
,
},
{
key
:
"ico"
,
title
:
" "
,
align
:
"center"
,
easy
:
true
,
high
:
true
,
width
:
60
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
params
.
row
.
numberAvailable
>
0
?
"op"
:
""
,
{
attrs
:
{
icon
:
"ios-cart-outline"
,
type
:
"icon"
,
},
on
:
{
click
:
()
=>
this
.
addCart
(
params
.
row
)
},
}),
]);
},
},
{
key
:
"resourceCode"
,
title
:
this
.
l
(
"resourceId"
),
align
:
"left"
,
easy
:
true
,
},
{
key
:
"nameOfResource"
,
title
:
this
.
l
(
"nameOfResource"
),
align
:
"left"
,
easy
:
true
,
tooltip
:
true
,
},
{
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
,
},
// {
// key: "creationTime",
// title: this.l("creationTime"),
// sortable: true,
// hide: true,
// align: "left",
// },
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
hide
:
false
,
type
:
"user"
,
align
:
"left"
,
},
{
key
:
"lastModificationTime"
,
title
:
this
.
l
(
"lastModificationTime"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"lastModifierUserId"
,
title
:
this
.
l
(
"lastModifierUserId"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"isDeleted"
,
title
:
this
.
l
(
"isDeleted"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"deletionTime"
,
title
:
this
.
l
(
"deletionTime"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"deleterUserId"
,
title
:
this
.
l
(
"deleterUserId"
),
hide
:
true
,
align
:
"left"
,
},
// {
// key: "specifications",
// title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
{
key
:
"totalNum"
,
title
:
this
.
l
(
"totalNum"
),
align
:
"right"
,
easy
:
true
,
},
{
key
:
"numberAvailable"
,
title
:
this
.
l
(
"numberAvailable"
),
align
:
"right"
,
easy
:
true
,
},
{
key
:
"measuringUnit"
,
title
:
this
.
l
(
"measuringUnit"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"qualityCharacteristics"
,
title
:
this
.
l
(
"qualityCharacteristics"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"batchNo"
,
title
:
this
.
l
(
"batchNo"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"storeId"
,
title
:
this
.
l
(
"storeId"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
{
key
:
"storeTitle"
,
title
:
this
.
l
(
"storeTitle"
),
align
:
"left"
,
},
{
key
:
"state"
,
title
:
this
.
l
(
"state"
),
align
:
"center"
,
code
:
"mes_xingchi_resource.resource.state"
,
},
// {
// key: "resourceType",
// title: this.l("resourceType"),
// align: "left",
// high: true,
// code: "mes_xingchi_resource.resource.resource_type",
// },
{
title
:
"操作"
,
width
:
190
,
align
:
"center"
,
key
:
"action"
,
hide
:
false
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
,
title
:
"删除"
,
},
class
:
params
.
row
.
totalNum
===
params
.
row
.
numberAvailable
?
"remove"
:
"disable"
,
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
)
},
},
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
"查看日志"
,
},
on
:
{
click
:
()
=>
this
.
logDetail
(
params
.
row
.
id
)
},
},
"查看日志"
),
]);
},
},
],
treeData
:
[],
ocolumn
:
[],
treeHeight
:
""
,
ids
:
[],
list
:
[],
cartList
:
[],
cartListCount
:
0
,
selectRows
:
[],
//导入
ModalIm
:
false
,
};
},
created
()
{
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
treeHeight
=
window
.
screenHeight
-
150
;
})();
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
computed
:
{},
methods
:
{
checkData
(
items
)
{
// console.warn("items", items);
return
items
.
map
((
u
)
=>
{
u
.
_disabled
=
u
.
numberAvailable
<=
0
;
u
.
_checked
=
false
;
return
u
;
});
name
:
"list"
,
components
:
{
Search
,
},
// head: {
// title: "库存表",
// author: "henq",
// description: "stock 7/13/2020 11:48:09 AM",
// },
data
()
{
return
{
action
:
Api
.
index
,
showMenu
:
true
,
easySearch
:
{
keys
:
{
op
:
"nameOfResource,code,resourceCode"
,
value
:
null
,
},
allchange
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
fscreeen
:
false
,
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
storeId
:
null
,
rootName
:
""
,
storeTitle
:
""
,
materialType
:
""
,
mCode
:
""
,
columns
:
[
{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
,
},
onSelect
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
,
sortable
:
true
,
},
//加入借出车
addCart
(
arr
)
{
this
.
cartListCount
=
this
.
$store
.
state
.
count
;
this
.
cartList
=
this
.
$store
.
state
.
cart
;
// console.log(this.cartListCount);
// console.log(this.cartList);
// console.log(this.selectRows);
if
(
arr
.
id
)
{
let
id
=
arr
.
id
;
if
(
arr
.
numberAvailable
>
0
)
{
const
index
=
this
.
$store
.
state
.
cart
.
findIndex
(
function
(
item
)
{
return
item
.
id
===
id
;
});
// console.log(index);
if
(
index
==
-
1
)
{
arr
.
numberAvailable1
=
arr
.
numberAvailable
;
//用于最大借出数量
this
.
cartList
.
push
(
arr
);
this
.
cartListCount
+=
1
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$Message
.
success
(
"加入借出车成功"
);
}
else
{
this
.
$Message
.
error
(
"已加入借出车"
);
}
}
else
{
this
.
$Message
.
error
(
"资源无库存"
);
}
}
else
{
// this.$Message.success("已加入借出车,请在借出车查看");
let
arr
=
this
.
selectRows
.
concat
(
this
.
cartList
);
//两个数组对象合并
let
newArr
=
[];
//盛放去重后数据的新数组
arr
.
forEach
(
function
(
item
)
{
let
hasPush
=
false
;
newArr
.
forEach
((
item2
,
index
,
thisArr
)
=>
{
if
(
item
.
id
==
item2
.
id
)
{
hasPush
=
true
;
thisArr
[
index
]
=
{
...
item
,
...
item2
};
return
;
}
});
!
hasPush
&&
newArr
.
push
(
item
);
});
this
.
cartList
=
newArr
;
this
.
cartListCount
=
newArr
.
length
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$refs
.
grid
.
load
();
this
.
$refs
.
grid
.
footerToolbar
=
false
;
}
{
key
:
"ico"
,
title
:
" "
,
align
:
"center"
,
easy
:
true
,
high
:
true
,
width
:
60
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
params
.
row
.
numberAvailable
>
0
?
"op"
:
""
,
{
attrs
:
{
icon
:
"ios-cart-outline"
,
type
:
"icon"
,
},
on
:
{
click
:
()
=>
this
.
addCart
(
params
.
row
),
},
}),
]
);
},
},
//移除借出车
substr
(
value
,
index
)
{
// console.log(value);
// console.log(index);
if
(
index
>
-
1
)
{
this
.
cartListCount
-=
value
;
this
.
cartList
.
splice
(
index
,
1
);
if
(
value
==
0
||
this
.
cartList
.
length
==
0
)
{
this
.
cartListCount
=
0
;
}
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
else
{
this
.
cartListCount
=
0
;
this
.
cartList
=
[];
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
// console.log(this.$store.state.count);
// console.log(this.$store.state.cart);
{
key
:
"resourceCode"
,
title
:
this
.
l
(
"resourceId"
),
align
:
"left"
,
easy
:
true
,
},
showCart
()
{
if
(
this
.
$store
.
state
.
count
>
0
)
{
this
.
title
=
"借出车"
;
this
.
detail
=
()
=>
import
(
"./cart"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请将资源加入借出车"
);
}
{
key
:
"nameOfResource"
,
title
:
this
.
l
(
"nameOfResource"
),
align
:
"left"
,
easy
:
true
,
tooltip
:
true
,
},
lendingRecord
()
{
// window.open("/resource/resource/record", "_blank");
this
.
$router
.
push
(
"/resource/resource/record"
);
{
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
,
},
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
fscreeen
=
false
;
this
.
cartList
=
[];
// this.curId = 0;
// {
// key: "creationTime",
// title: this.l("creationTime"),
// sortable: true,
// hide: true,
// align: "left",
// },
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
hide
:
false
,
type
:
"user"
,
align
:
"left"
,
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
{
key
:
"lastModificationTime"
,
title
:
this
.
l
(
"lastModificationTime"
),
hide
:
true
,
align
:
"left"
,
},
add
()
{
if
(
this
.
curId
)
{
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请先选择库房库位"
);
}
{
key
:
"lastModifierUserId"
,
title
:
this
.
l
(
"lastModifierUserId"
),
hide
:
true
,
align
:
"left"
,
},
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
{
key
:
"isDeleted"
,
title
:
this
.
l
(
"isDeleted"
),
hide
:
true
,
align
:
"left"
,
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
{
key
:
"deletionTime"
,
title
:
this
.
l
(
"deletionTime"
),
hide
:
true
,
align
:
"left"
,
},
logDetail
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看日志"
;
this
.
detail
=
()
=>
import
(
"./log"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
{
key
:
"deleterUserId"
,
title
:
this
.
l
(
"deleterUserId"
),
hide
:
true
,
align
:
"left"
,
},
// {
// key: "specifications",
// title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
{
key
:
"totalNum"
,
title
:
this
.
l
(
"totalNum"
),
align
:
"right"
,
easy
:
true
,
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
{
key
:
"numberAvailable"
,
title
:
this
.
l
(
"numberAvailable"
),
align
:
"right"
,
easy
:
true
,
},
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
{
key
:
"measuringUnit"
,
title
:
this
.
l
(
"measuringUnit"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
{
key
:
"qualityCharacteristics"
,
title
:
this
.
l
(
"qualityCharacteristics"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
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
}
};
this
.
$refs
.
grid
.
reload
(
where
);
{
key
:
"batchNo"
,
title
:
this
.
l
(
"batchNo"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
setNum
(
row
)
{
this
.
curId
=
row
.
id
;
this
.
title
=
"预警"
;
// this.detail = () => import("./setNum");
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
{
key
:
"storeId"
,
title
:
this
.
l
(
"storeId"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
//批量导入start
//导入功能
openModalIm
()
{
this
.
ModalIm
=
true
{
key
:
"storeTitle"
,
title
:
this
.
l
(
"storeTitle"
),
align
:
"left"
,
},
ModalImCancel
()
{
this
.
ModalIm
=
false
{
key
:
"state"
,
title
:
this
.
l
(
"state"
),
align
:
"center"
,
code
:
"mes_xingchi_resource.resource.state"
,
},
getData
(
val
)
{
let
url
=
`
${
resourceUrl
}
/resourceimportservice/import`
;
this
.
$refs
.
importExcel
.
deelData
(
url
,
this
.
columns
,
this
.
formatMethod
(
val
))
// {
// key: "resourceType",
// title: this.l("resourceType"),
// align: "left",
// high: true,
// code: "mes_xingchi_resource.resource.resource_type",
// },
{
title
:
"操作"
,
width
:
190
,
align
:
"center"
,
key
:
"action"
,
hide
:
false
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
,
title
:
"删除"
,
},
class
:
params
.
row
.
totalNum
===
params
.
row
.
numberAvailable
?
"remove"
:
"disable"
,
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
),
},
},
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
"查看日志"
,
},
on
:
{
click
:
()
=>
this
.
logDetail
(
params
.
row
.
id
),
},
},
"查看日志"
),
]
);
},
},
//根据页面二次处理数据
formatMethod
(
val
)
{
let
tempData
=
this
.
$u
.
clone
(
val
);
let
tempList
=
[];
tempData
.
forEach
((
ele
)
=>
{
let
obj
=
{
nameOfResource
:
ele
.
nameOfResource
?
ele
.
nameOfResource
:
''
,
resourceCode
:
ele
.
resourceCode
?
ele
.
resourceCode
:
''
,
code
:
ele
.
code
?
ele
.
code
:
''
,
totalNum
:
ele
.
totalNum
?
ele
.
nameOfResource
:
0
,
storeTitle
:
ele
.
storeTitle
?
ele
.
storeTitle
:
''
,
storeId
:
ele
.
storeId
?
ele
.
nameOfResource
:
null
,
state
:
1
,
numberAvailable
:
ele
.
numberAvailable
?
ele
.
nameOfResource
:
0
,
json
:
{}
};
if
(
ele
.
nameOfResource
&&
ele
.
nameOfResource
!=
''
&&
ele
.
code
&&
ele
.
code
!=
''
&&
ele
.
resourceCode
&&
ele
.
resourceCode
!=
''
)
{
obj
.
ico
=
false
}
else
{
obj
.
ico
=
true
}
tempList
.
push
(
obj
);
],
treeData
:
[],
ocolumn
:
[],
treeHeight
:
""
,
ids
:
[],
list
:
[],
cartList
:
[],
cartListCount
:
0
,
selectRows
:
[],
//导入
ModalIm
:
false
,
codeRuleType
:
null
,
};
},
created
()
{
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
treeHeight
=
window
.
screenHeight
-
150
;
})();
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
computed
:
{},
methods
:
{
checkData
(
items
)
{
// console.warn("items", items);
return
items
.
map
((
u
)
=>
{
u
.
_disabled
=
u
.
numberAvailable
<=
0
;
u
.
_checked
=
false
;
return
u
;
});
},
});
return
tempList
allchange
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
onSelect
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
//加入借出车
addCart
(
arr
)
{
this
.
cartListCount
=
this
.
$store
.
state
.
count
;
this
.
cartList
=
this
.
$store
.
state
.
cart
;
// console.log(this.cartListCount);
// console.log(this.cartList);
// console.log(this.selectRows);
if
(
arr
.
id
)
{
let
id
=
arr
.
id
;
if
(
arr
.
numberAvailable
>
0
)
{
const
index
=
this
.
$store
.
state
.
cart
.
findIndex
(
function
(
item
)
{
return
item
.
id
===
id
;
});
// console.log(index);
if
(
index
==
-
1
)
{
arr
.
numberAvailable1
=
arr
.
numberAvailable
;
//用于最大借出数量
this
.
cartList
.
push
(
arr
);
this
.
cartListCount
+=
1
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$Message
.
success
(
"加入借出车成功"
);
}
else
{
this
.
$Message
.
error
(
"已加入借出车"
);
}
}
else
{
this
.
$Message
.
error
(
"资源无库存"
);
}
}
else
{
// this.$Message.success("已加入借出车,请在借出车查看");
let
arr
=
this
.
selectRows
.
concat
(
this
.
cartList
);
//两个数组对象合并
let
newArr
=
[];
//盛放去重后数据的新数组
arr
.
forEach
(
function
(
item
)
{
let
hasPush
=
false
;
newArr
.
forEach
((
item2
,
index
,
thisArr
)
=>
{
if
(
item
.
id
==
item2
.
id
)
{
hasPush
=
true
;
thisArr
[
index
]
=
{
...
item
,
...
item2
,
};
return
;
}
});
!
hasPush
&&
newArr
.
push
(
item
);
});
this
.
cartList
=
newArr
;
this
.
cartListCount
=
newArr
.
length
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$refs
.
grid
.
load
();
this
.
$refs
.
grid
.
footerToolbar
=
false
;
}
},
//移除借出车
substr
(
value
,
index
)
{
// console.log(value);
// console.log(index);
if
(
index
>
-
1
)
{
this
.
cartListCount
-=
value
;
this
.
cartList
.
splice
(
index
,
1
);
if
(
value
==
0
||
this
.
cartList
.
length
==
0
)
{
this
.
cartListCount
=
0
;
}
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
else
{
this
.
cartListCount
=
0
;
this
.
cartList
=
[];
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
// console.log(this.$store.state.count);
// console.log(this.$store.state.cart);
},
showCart
()
{
if
(
this
.
$store
.
state
.
count
>
0
)
{
this
.
title
=
"借出车"
;
this
.
detail
=
()
=>
import
(
"./cart"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请将资源加入借出车"
);
}
},
lendingRecord
()
{
// window.open("/resource/resource/record", "_blank");
this
.
$router
.
push
(
"/resource/resource/record"
);
},
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
fscreeen
=
false
;
this
.
cartList
=
[];
// this.curId = 0;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
add
()
{
if
(
this
.
curId
)
{
if
(
this
.
codeRuleType
==
3
)
{
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请先选择正确的库房类型"
);
}
}
else
{
this
.
$Message
.
error
(
"请先选择库房库位"
);
}
},
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
logDetail
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看日志"
;
this
.
detail
=
()
=>
import
(
"./log"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
},
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
},
productSearch
(
item
,
ids
,
rootName
)
{
// console.log(item);
this
.
curId
=
item
.
id
;
let
type
=
[];
type
=
item
.
codeRuleType
.
split
(
","
);
if
(
type
)
{
type
.
forEach
((
e
)
=>
{
if
(
e
==
3
)
{
this
.
codeRuleType
=
3
;
}
});
}
this
.
storeTitle
=
item
.
title
;
this
.
rootName
=
rootName
.
join
(
" / "
);
this
.
materialType
=
item
.
materialType
;
let
where
=
{
storeId
:
{
op
:
"In"
,
value
:
ids
,
},
//批量导入end
l
(
key
)
{
let
vkey
=
"resource"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
};
this
.
$refs
.
grid
.
reload
(
where
);
},
setNum
(
row
)
{
this
.
curId
=
row
.
id
;
this
.
title
=
"预警"
;
// this.detail = () => import("./setNum");
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
//批量导入start
//导入功能
openModalIm
()
{
this
.
ModalIm
=
true
;
},
ModalImCancel
()
{
this
.
ModalIm
=
false
;
},
getData
(
val
)
{
let
url
=
`
${
resourceUrl
}
/resourceimportservice/import`
;
this
.
$refs
.
importExcel
.
deelData
(
url
,
this
.
columns
,
this
.
formatMethod
(
val
)
);
},
//根据页面二次处理数据
formatMethod
(
val
)
{
let
tempData
=
this
.
$u
.
clone
(
val
);
let
tempList
=
[];
tempData
.
forEach
((
ele
)
=>
{
let
obj
=
{
nameOfResource
:
ele
.
nameOfResource
?
ele
.
nameOfResource
:
""
,
resourceCode
:
ele
.
resourceCode
?
ele
.
resourceCode
:
""
,
code
:
ele
.
code
?
ele
.
code
:
""
,
totalNum
:
ele
.
totalNum
?
ele
.
nameOfResource
:
0
,
storeTitle
:
ele
.
storeTitle
?
ele
.
storeTitle
:
""
,
storeId
:
ele
.
storeId
?
ele
.
nameOfResource
:
null
,
state
:
1
,
numberAvailable
:
ele
.
numberAvailable
?
ele
.
nameOfResource
:
0
,
json
:
{},
};
if
(
ele
.
nameOfResource
&&
ele
.
nameOfResource
!=
""
&&
ele
.
code
&&
ele
.
code
!=
""
&&
ele
.
resourceCode
&&
ele
.
resourceCode
!=
""
)
{
obj
.
ico
=
false
;
}
else
{
obj
.
ico
=
true
;
}
tempList
.
push
(
obj
);
});
return
tempList
;
},
//批量导入end
l
(
key
)
{
let
vkey
=
"resource"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
};
</
script
>
<
style
lang=
"less"
>
.full {
margin-top: 0;
margin-top: 0;
.content {
margin-top: 10px;
padding-top: 10px;
.content {
margin-top: 10px;
padding-top: 10px;
.ivu-icon-ios-add:before {
content: "\f341";
}
.ivu-icon-ios-add:before {
content: "\f341";
}
.ivu-icon-ios-remove:before {
content: "\f33d";
}
.ivu-icon-ios-remove:before {
content: "\f33d";
}
}
}
</
style
>
pages/store/add.vue
View file @
05a177e5
...
...
@@ -68,6 +68,7 @@ export default {
level
:
this
.
level
,
userName
:
""
,
userIds
:
""
,
codeRuleType
:
""
,
},
rules
:
{
title
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
...
...
@@ -105,15 +106,19 @@ export default {
},
changeVal
(
val
)
{
let
code
=
[];
let
type
=
[];
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
);
type
.
push
(
obj
.
codeRuleType
);
}
}
}
this
.
entity
.
materialTypeName
=
code
.
join
(
","
);
this
.
entity
.
codeRuleType
=
type
.
join
(
","
);
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
...
...
@@ -137,6 +142,7 @@ export default {
userIds
:
userId
,
//库管员id
materialType
:
materialType
,
//物料类型
materialTypeName
:
this
.
entity
.
materialTypeName
,
//物料编码
codeRuleType
:
this
.
entity
.
codeRuleType
};
Api
.
create
(
paramsdata
)
...
...
pages/store/edit.vue
View file @
05a177e5
...
...
@@ -51,6 +51,7 @@ export default {
roleTitle
:
"库管"
,
entity
:
{
materialType
:
[],
codeRuleType
:
""
,
},
materialType
:
[],
rules
:
{
...
...
@@ -91,15 +92,19 @@ export default {
},
changeVal
(
val
)
{
let
code
=
[];
let
type
=
[];
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
);
type
.
push
(
obj
.
codeRuleType
);
}
}
}
alert
(
type
)
this
.
entity
.
materialTypeName
=
code
.
join
(
","
);
this
.
entity
.
codeRuleType
=
type
.
join
(
","
);
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
((
r
)
=>
{
...
...
@@ -138,6 +143,7 @@ export default {
creatorUserId
:
this
.
entity
.
creatorUserId
,
materialType
:
materialType
,
//物料类型
materialTypeName
:
this
.
entity
.
materialTypeName
,
//物料编码
codeRuleType
:
this
.
entity
.
codeRuleType
,
};
Api
.
update
(
paramsdata
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment