Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tianjin
Project
Project
Details
Activity
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
徐来柯
tianjin
Commits
b0547fec
Commit
b0547fec
authored
Jan 12, 2021
by
徐来柯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
62b1ec91
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
544 additions
and
137 deletions
+544
-137
MaterialWarehousingMoudle.vue
src/views/education/MaterialWarehousingMoudle.vue
+1
-6
ProductDelivery.vue
src/views/education/ProductDelivery.vue
+188
-35
ProductHouseshow.vue
src/views/education/ProductHouseshow.vue
+66
-33
ProductStorage.vue
src/views/education/ProductStorage.vue
+188
-19
SearchForm.vue
src/views/education/component/SearchForm.vue
+0
-7
StoreDialog.vue
src/views/education/component/StoreDialog.vue
+37
-4
materialinventory.vue
src/views/education/materialinventory.vue
+64
-33
No files found.
src/views/education/MaterialWarehousingMoudle.vue
View file @
b0547fec
...
@@ -297,12 +297,7 @@ export default {
...
@@ -297,12 +297,7 @@ export default {
$this
.
popShow
=
false
$this
.
popShow
=
false
}
}
$this
.
deletetext
=
res
.
data
.
msg
$this
.
deletetext
=
res
.
data
.
msg
var
postData
=
{
var
postData
=
$this
.
resetData
()
argKeyWord
:
this
.
formData
.
argKeyWord
,
argWhere
:
this
.
formData
.
argWhere
,
Stime
:
$this
.
$refs
.
dateValue
?
$this
.
$moment
(
this
.
dateValue
[
0
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
,
Etime
:
$this
.
$refs
.
dateValue
?
$this
.
$moment
(
this
.
dateValue
[
1
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
}
$this
.
searchData
(
postData
)
$this
.
searchData
(
postData
)
}).
catch
(
function
(
err
){
}).
catch
(
function
(
err
){
console
.
log
(
'err'
,
err
)
console
.
log
(
'err'
,
err
)
...
...
src/views/education/ProductDelivery.vue
View file @
b0547fec
<
template
>
<
template
>
<div
class=
"box-container"
>
<div
class=
"box-container"
>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<search-form
:formList=
"[1,2,3]"
:btnList=
"[1,2]"
@
openDialog=
"openDialog"
@
delData=
"delData"
/>
<search-form
:formList=
"[1,2,3]"
:btnList=
"[1,2]"
:formData=
"formData"
@
searchData=
"searchData"
@
openDialog=
"openDialog"
@
delData=
"delData"
/>
<el-table
<el-table
border
border
height=
"675"
height=
"675"
...
@@ -24,11 +24,11 @@
...
@@ -24,11 +24,11 @@
<el-table-column
<el-table-column
label=
"出库编号"
label=
"出库编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
SID
"
prop=
"
MHSort
"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
prop=
"
ProductName
"
prop=
"
xtid
"
label=
"线体编号"
label=
"线体编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
width=
"180"
>
width=
"180"
>
...
@@ -36,67 +36,51 @@
...
@@ -36,67 +36,51 @@
<el-table-column
<el-table-column
label=
"线体名称"
label=
"线体名称"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
ProductTyp
e"
prop=
"
linnam
e"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"产品编号"
label=
"产品编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanType
"
prop=
"
MHSort
"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"产品名称"
label=
"产品名称"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanTyp
e"
prop=
"
wlnam
e"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"产品描述"
label=
"产品描述"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanType
"
prop=
"
wlDesc
"
width=
"210"
>
width=
"210"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"单位"
label=
"单位"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
LineName
"
prop=
"
Company
"
width=
"140"
>
width=
"140"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"出库数量"
label=
"出库数量"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
UserName
"
prop=
"
MHNuber
"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"出库时间"
label=
"出库时间"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
StartDt
"
prop=
"
UpdateTime
"
>
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!--
<div
class=
"page_bottom"
>
<Pagination
ref=
"page"
:totalCount=
"totalCount"
:totalPage=
"totalPage"
@
pageFun=
"pageFun"
/>
<div
class=
"bottom_text"
>
<span>
共
{{
totalCount
}}
条记录 当前第
{{
pageIndex
}}
页 共
{{
totalPage
}}
页 每页
{{
pageSize
}}
条记录
</span>
</div>
<div
class=
"bottom_btns"
>
<div
class=
"bottom_firest"
@
click=
"first"
>
首页
</div>
<div
ref=
"last"
:class=
"num
<
=
1
?
'
bottom_disabled
'
:
'
bottom_next
'"
@
click=
"last"
>
上一页
</div>
<div
ref=
"next"
:class=
"num === totalPage || num
<
=
0
?
'
bottom_disabled
'
:
'
bottom_next
'"
@
click=
"next"
>
下一页
</div>
<div
class=
"bottom_end"
@
click=
"end"
>
末页
</div>
<span>
第
</span>
<input
v-model=
"num"
class=
"text"
@
input=
"handleBlur"
type=
"text"
/>
<span>
页
</span>
<div
@
click=
"jump"
class=
"bottom_jump"
>
跳转
</div>
</div>
</div>
-->
<Pagination
@
pageFun=
"pageFun"
/>
</div>
</div>
<store-dialog
:titleText=
"'产品出库单'"
:type=
"'out'"
v-if=
"popShow"
@
closeDialog=
"closeDialog"
@
conserve=
"conserve"
/>
<store-dialog
:titleText=
"'产品出库单'"
:t
itleType=
"'pro'"
:t
ype=
"'out'"
v-if=
"popShow"
@
closeDialog=
"closeDialog"
@
conserve=
"conserve"
/>
<delete-pop
ref=
"delete"
:deletetext=
"deletetext"
:type=
"typeV"
v-if=
"deleteShow"
></delete-pop>
<delete-pop
ref=
"delete"
:deletetext=
"deletetext"
:type=
"typeV"
v-if=
"deleteShow"
></delete-pop>
</div>
</div>
</
template
>
</
template
>
...
@@ -118,24 +102,176 @@ export default {
...
@@ -118,24 +102,176 @@ export default {
deletetext
:
''
,
deletetext
:
''
,
deleteShow
:
false
,
deleteShow
:
false
,
typeV
:
''
,
typeV
:
''
,
cloneData
:
[],
formData
:
{
argKeyWord
:
''
,
argWhere
:
''
,
dateValue
:
[
this
.
$moment
().
format
(
'YYYY-MM-DD 00:00:00'
),
this
.
$moment
().
format
(
'YYYY-MM-DD 23:59:59'
)],
scanValue
:
''
,
},
// 分页数据
totalCount
:
0
,
// pageIndex: 1,
totalPage
:
1
}
}
},
},
created
()
{
this
.
searchData
()
this
.
scanGunCode
()
},
methods
:
{
methods
:
{
searchData
()
{
var
$this
=
this
var
postData
=
this
.
resetData
()
this
.
$axios
({
method
:
"post"
,
url
:
`/api/ProductDelivery/ProductDelivery_Query?argKeyWord=
${
postData
.
argKeyWord
}
&argWhere=
${
postData
.
argWhere
}
&Stime=
${
postData
.
Stime
}
&Etime=
${
postData
.
Etime
}
`
,
}).
then
((
res
)
=>
{
if
(
res
.
data
.
data
.
length
!=
0
){
this
.
AllTableData
=
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
UpdateTime
:
this
.
$moment
(
item
.
UpdateTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}))
// 克隆一份tableData数据
this
.
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllTableData
))
if
(
this
.
AllTableData
.
length
>
this
.
$refs
.
page
.
pageSize
){
this
.
tableData
=
this
.
AllTableData
.
slice
(
0
,
this
.
$refs
.
page
.
pageSize
)
}
else
{
this
.
tableData
=
this
.
AllTableData
}
this
.
totalCount
=
this
.
AllTableData
.
length
// this.pageIndex = 1
this
.
totalPage
=
Math
.
ceil
(
this
.
AllTableData
.
length
/
this
.
$refs
.
page
.
pageSize
)
}
else
{
this
.
tableData
=
[]
this
.
totalCount
=
0
// this.pageIndex = 1
this
.
totalPage
=
1
}
this
.
pageFun
(
1
)
}).
catch
(
function
(
err
){
console
.
log
(
'err'
,
err
)
})
},
handleSelectionChange
(
val
)
{
handleSelectionChange
(
val
)
{
this
.
checkList
=
val
this
.
checkList
=
val
},
},
// 分页方法
// 分页方法
pageFun
(
num
){
pageFun
(
num
){
if
(
num
==
1
){
if
(
num
==
1
){
this
.
tableData
=
this
.
AllTableData
.
slice
(
0
,
50
)
this
.
tableData
=
this
.
cloneData
.
slice
(
0
,
this
.
$refs
.
page
.
pageSize
)
}
else
{
}
else
{
this
.
tableData
=
this
.
AllTableData
.
slice
((
num
-
1
)
*
this
.
pageSize
+
1
,
this
.
pageSize
*
num
)
this
.
tableData
=
this
.
cloneData
.
slice
((
num
-
1
)
*
this
.
$refs
.
page
.
pageSize
,
this
.
$refs
.
page
.
pageSize
*
num
)
}
}
},
},
// 扫码枪扫码
scanGunCode
()
{
let
barCode
=
''
let
lastTime
,
nextTime
let
lastCode
,
nextCode
window
.
document
.
onkeypress
=
e
=>
{
// if (this.loading) {
// // 防止高频率扫码,只能扫一次
// return
// }
if
(
window
.
event
)
{
// IE
nextCode
=
e
.
keyCode
}
else
if
(
e
.
which
)
{
// Netscape/Firefox/Opera
nextCode
=
e
.
which
}
if
(
e
.
which
===
13
)
{
if
(
barCode
.
length
<
3
)
return
// 手动输入的时间不会让code的长度大于2,所以这里只会对扫码枪有
console
.
log
(
barCode
)
console
.
log
(
'扫码结束'
)
// this.loading = true
const
cacheCode
=
barCode
this
.
$axios
({
method
:
"post"
,
url
:
`/api/MaterialWarehousing/MaterialDelivery_ScanCodeAdd`
,
data
:
{
ScanCode
:
cacheCode
}
}).
then
((
res
)
=>
{
var
postData
=
{
argKeyWord
:
this
.
formData
.
argKeyWord
,
argWhere
:
this
.
formData
.
argWhere
,
Stime
:
this
.
formData
.
dateValue
?
this
.
$moment
(
this
.
formData
.
dateValue
[
0
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
,
Etime
:
this
.
formData
.
dateValue
?
this
.
$moment
(
this
.
formData
.
dateValue
[
1
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
}
this
.
searchData
(
this
.
postData
)
})
// request({
// url: `/api/MaterialWarehousing/MaterialDelivery_ScanCodeAdd`,
// method: 'put',
// data: {
// ScanCode: cacheCode
// }
// })
// .then(res => {
// // this.loading = false
// var postData = {
// argKeyWord: this.formData.argKeyWord,
// argWhere: this.formData.argWhere,
// Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
// Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
// }
// $this.searchData(this.postData)
// })
// .catch(() => {
// // this.loading = false
// })
barCode
=
''
lastCode
=
''
lastTime
=
''
return
}
nextTime
=
new
Date
().
getTime
()
if
(
!
lastTime
&&
!
lastCode
)
{
console
.
log
(
'扫码开始。。。'
)
barCode
+=
e
.
key
}
if
(
lastCode
&&
lastTime
&&
nextTime
-
lastTime
>
500
)
{
// 当扫码前有keypress事件时,防止首字缺失
console
.
log
(
'防止首字缺失。。。'
)
barCode
=
e
.
key
}
else
if
(
lastCode
&&
lastTime
)
{
console
.
log
(
'扫码中。。。'
)
barCode
+=
e
.
key
}
lastCode
=
nextCode
lastTime
=
nextTime
console
.
log
(
lastCode
)
}
},
resetData
()
{
return
{
argKeyWord
:
this
.
formData
.
argKeyWord
,
argWhere
:
this
.
formData
.
argWhere
,
Stime
:
this
.
formData
.
dateValue
?
this
.
$moment
(
this
.
formData
.
dateValue
[
0
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
,
Etime
:
this
.
formData
.
dateValue
?
this
.
$moment
(
this
.
formData
.
dateValue
[
1
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
}
},
delData
()
{
delData
()
{
if
(
this
.
checkList
.
length
===
0
)
{
var
$this
=
this
this
.
deleteShow
=
true
if
(
$this
.
checkList
.
length
===
0
)
{
this
.
typeV
=
2
$this
.
deleteShow
=
true
$this
.
typeV
=
2
}
else
{
var
list
=
[]
$this
.
checkList
.
forEach
((
item
)
=>
{
list
.
push
(
item
.
ID
)
})
$this
.
$axios
({
method
:
"post"
,
url
:
`/api/ProductDelivery/ProductDelivery_Delete`
,
data
:
list
}).
then
((
res
)
=>
{
var
postData
=
$this
.
resetData
()
$this
.
searchData
(
postData
)
})
}
}
},
},
//关闭提示弹窗
//关闭提示弹窗
...
@@ -149,8 +285,25 @@ export default {
...
@@ -149,8 +285,25 @@ export default {
this
.
popShow
=
false
this
.
popShow
=
false
},
},
conserve
(
data
)
{
conserve
(
data
)
{
console
.
log
(
data
)
var
$this
=
this
this
.
popShow
=
false
this
.
$axios
({
method
:
"post"
,
url
:
`/api/ProductDelivery/ProductDelivery_WindowAddSave`
,
data
:
data
}).
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
0
){
$this
.
typeV
=
'5'
$this
.
deleteShow
=
true
}
else
{
$this
.
typeV
=
'6'
$this
.
popShow
=
false
}
$this
.
deletetext
=
res
.
data
.
msg
var
postData
=
$this
.
resetData
()
$this
.
searchData
(
postData
)
}).
catch
(
function
(
err
){
console
.
log
(
'err'
,
err
)
})
}
}
}
}
}
}
...
...
src/views/education/ProductHouseshow.vue
View file @
b0547fec
<
template
>
<
template
>
<div
class=
"box-container"
>
<div
class=
"box-container"
>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<search-form
:formList=
"[1]"
/>
<search-form
:formList=
"[1]"
:formData=
"formData"
@
searchData=
"searchData"
/>
<el-table
<el-table
border
border
height=
"675"
height=
"675"
...
@@ -10,11 +10,11 @@
...
@@ -10,11 +10,11 @@
class=
"table-style"
class=
"table-style"
tooltip-effect=
"dark"
tooltip-effect=
"dark"
style=
"width: 100%"
style=
"width: 100%"
@
selection-change=
"handleSelectionChange"
>
>
<el-table-column
<
!--
<
el-table-column
type=
"selection"
type=
"selection"
width=
"60"
>
width=
"60"
>
</el-table-column>
</el-table-column>
-->
<el-table-column
<el-table-column
label=
"序号"
label=
"序号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
...
@@ -24,11 +24,11 @@
...
@@ -24,11 +24,11 @@
<el-table-column
<el-table-column
label=
"线体编号"
label=
"线体编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
SID
"
prop=
"
xtid
"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
prop=
"
ProductN
ame"
prop=
"
linn
ame"
label=
"线体名称"
label=
"线体名称"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
>
>
...
@@ -36,52 +36,36 @@
...
@@ -36,52 +36,36 @@
<el-table-column
<el-table-column
label=
"产品编号"
label=
"产品编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
ProductType
"
prop=
"
wlid
"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"产品名称"
label=
"产品名称"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanTyp
e"
prop=
"
wlnam
e"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"产品描述"
label=
"产品描述"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanType
"
prop=
"
wlDesc
"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"单位"
label=
"单位"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
LineName
"
prop=
"
Company
"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"库存数量"
label=
"库存数量"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
UserName
"
prop=
"
MHNuber
"
>
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!--
<div
class=
"page_bottom"
>
<Pagination
ref=
"page"
:totalCount=
"totalCount"
:totalPage=
"totalPage"
@
pageFun=
"pageFun"
/>
<div
class=
"bottom_text"
>
<span>
共
{{
totalCount
}}
条记录 当前第
{{
pageIndex
}}
页 共
{{
totalPage
}}
页 每页
{{
pageSize
}}
条记录
</span>
</div>
<div
class=
"bottom_btns"
>
<div
class=
"bottom_firest"
@
click=
"first"
>
首页
</div>
<div
ref=
"last"
:class=
"num
<
=
1
?
'
bottom_disabled
'
:
'
bottom_next
'"
@
click=
"last"
>
上一页
</div>
<div
ref=
"next"
:class=
"num === totalPage || num
<
=
0
?
'
bottom_disabled
'
:
'
bottom_next
'"
@
click=
"next"
>
下一页
</div>
<div
class=
"bottom_end"
@
click=
"end"
>
末页
</div>
<span>
第
</span>
<input
v-model=
"num"
class=
"text"
@
input=
"handleBlur"
type=
"text"
/>
<span>
页
</span>
<div
@
click=
"jump"
class=
"bottom_jump"
>
跳转
</div>
</div>
</div>
-->
<Pagination
@
pageFun=
"pageFun"
/>
</div>
</div>
<delete-pop
ref=
"delete"
:deletetext=
"deletetext"
:type=
"typeV"
v-if=
"deleteShow"
></delete-pop>
<delete-pop
ref=
"delete"
:deletetext=
"deletetext"
:type=
"typeV"
v-if=
"deleteShow"
></delete-pop>
...
@@ -103,20 +87,68 @@ export default {
...
@@ -103,20 +87,68 @@ export default {
deletetext
:
''
,
deletetext
:
''
,
deleteShow
:
false
,
deleteShow
:
false
,
typeV
:
''
,
typeV
:
''
,
cloneData
:
[],
formData
:
{
argKeyWord
:
''
,
argWhere
:
''
,
},
// 分页数据
totalCount
:
0
,
// pageIndex: 1,
totalPage
:
1
}
}
},
},
created
()
{
this
.
searchData
()
},
methods
:
{
methods
:
{
handleSelectionChange
(
val
)
{
searchData
()
{
this
.
checkList
=
val
var
$this
=
this
var
postData
=
this
.
resetData
()
this
.
$axios
({
method
:
"post"
,
url
:
`/api/PHouseshow/PHouseshow_Query?argKeyWord=
${
postData
.
argKeyWord
}
&argWhere=
${
postData
.
argWhere
}
`
,
}).
then
((
res
)
=>
{
if
(
res
.
data
.
data
.
length
!=
0
){
this
.
AllTableData
=
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
UpdateTime
:
this
.
$moment
(
item
.
UpdateTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}))
// 克隆一份tableData数据
this
.
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllTableData
))
if
(
this
.
AllTableData
.
length
>
this
.
$refs
.
page
.
pageSize
){
this
.
tableData
=
this
.
AllTableData
.
slice
(
0
,
this
.
$refs
.
page
.
pageSize
)
}
else
{
this
.
tableData
=
this
.
AllTableData
}
this
.
totalCount
=
this
.
AllTableData
.
length
// this.pageIndex = 1
this
.
totalPage
=
Math
.
ceil
(
this
.
AllTableData
.
length
/
this
.
$refs
.
page
.
pageSize
)
}
else
{
this
.
tableData
=
[]
this
.
totalCount
=
0
// this.pageIndex = 1
this
.
totalPage
=
1
}
this
.
pageFun
(
1
)
}).
catch
(
function
(
err
){
console
.
log
(
'err'
,
err
)
})
},
resetData
()
{
return
{
argKeyWord
:
this
.
formData
.
argKeyWord
,
argWhere
:
this
.
formData
.
argWhere
,
}
},
},
// 分页方法
// 分页方法
pageFun
(
num
){
pageFun
(
num
){
if
(
num
==
1
){
if
(
num
==
1
){
this
.
tableData
=
this
.
AllTableData
.
slice
(
0
,
50
)
this
.
tableData
=
this
.
cloneData
.
slice
(
0
,
this
.
$refs
.
page
.
pageSize
)
}
else
{
}
else
{
this
.
tableData
=
this
.
AllTableData
.
slice
((
num
-
1
)
*
this
.
pageSize
+
1
,
this
.
pageSize
*
num
)
this
.
tableData
=
this
.
cloneData
.
slice
((
num
-
1
)
*
this
.
$refs
.
page
.
pageSize
,
this
.
$refs
.
page
.
pageSize
*
num
)
}
}
}
}
,
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
src/views/education/ProductStorage.vue
View file @
b0547fec
<
template
>
<
template
>
<div
class=
"box-container"
>
<div
class=
"box-container"
>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<search-form
:formList=
"[1,2,3]"
:btnList=
"[1,2]"
@
openDialog=
"openDialog"
@
delData=
"delData"
/>
<search-form
:formList=
"[1,2,3]"
:btnList=
"[1,2]"
:formData=
"formData"
@
searchData=
"searchData"
@
openDialog=
"openDialog"
@
delData=
"delData"
/>
<el-table
<el-table
border
border
height=
"675"
height=
"675"
...
@@ -24,11 +24,11 @@
...
@@ -24,11 +24,11 @@
<el-table-column
<el-table-column
label=
"入库编号"
label=
"入库编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
SID
"
prop=
"
MHSort
"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
prop=
"
ProductName
"
prop=
"
xtid
"
label=
"线体编号"
label=
"线体编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
width=
"180"
>
width=
"180"
>
...
@@ -36,51 +36,51 @@
...
@@ -36,51 +36,51 @@
<el-table-column
<el-table-column
label=
"线体名称"
label=
"线体名称"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
ProductTyp
e"
prop=
"
linnam
e"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"产品编号"
label=
"产品编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanType
"
prop=
"
wlid
"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"产品名称"
label=
"产品名称"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanTyp
e"
prop=
"
wlnam
e"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"产品描述"
label=
"产品描述"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanType
"
prop=
"
wlDesc
"
width=
"210"
>
width=
"210"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"单位"
label=
"单位"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
LineName
"
prop=
"
Company
"
width=
"140"
>
width=
"140"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"入库数量"
label=
"入库数量"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
UserName
"
prop=
"
MHNuber
"
width=
"180"
>
width=
"180"
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"入库时间"
label=
"入库时间"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
StartDt
"
prop=
"
UpdateTime
"
>
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<Pagination
@
pageFun=
"pageFun"
/>
<Pagination
ref=
"page"
:totalCount=
"totalCount"
:totalPage=
"totalPage"
@
pageFun=
"pageFun"
/>
</div>
</div>
<store-dialog
:titleText=
"'产品入库单'"
v-if=
"popShow"
@
closeDialog=
"closeDialog"
@
conserve=
"conserve"
/>
<store-dialog
:titleText=
"'产品入库单'"
:titleType=
"'pro'"
v-if=
"popShow"
@
closeDialog=
"closeDialog"
@
conserve=
"conserve"
/>
<delete-pop
ref=
"delete"
:deletetext=
"deletetext"
:type=
"typeV"
v-if=
"deleteShow"
></delete-pop>
<delete-pop
ref=
"delete"
:deletetext=
"deletetext"
:type=
"typeV"
v-if=
"deleteShow"
></delete-pop>
</div>
</div>
</
template
>
</
template
>
...
@@ -97,29 +97,181 @@ export default {
...
@@ -97,29 +97,181 @@ export default {
return
{
return
{
tableData
:
[],
tableData
:
[],
AllTableData
:
[],
AllTableData
:
[],
cloneData
:
[],
popShow
:
false
,
popShow
:
false
,
checkList
:
[],
checkList
:
[],
deletetext
:
''
,
deletetext
:
''
,
deleteShow
:
false
,
deleteShow
:
false
,
typeV
:
''
,
typeV
:
''
,
formData
:
{
argKeyWord
:
''
,
argWhere
:
''
,
dateValue
:
[
this
.
$moment
().
format
(
'YYYY-MM-DD 00:00:00'
),
this
.
$moment
().
format
(
'YYYY-MM-DD 23:59:59'
)],
scanValue
:
''
,
},
// 分页数据
totalCount
:
0
,
// pageIndex: 1,
totalPage
:
1
}
}
},
created
()
{
this
.
searchData
()
this
.
scanGunCode
()
},
},
methods
:
{
methods
:
{
searchData
()
{
var
$this
=
this
var
postData
=
this
.
resetData
()
this
.
$axios
({
method
:
"post"
,
url
:
`/api/ProductStorage/ProductStorage_Query?argKeyWord=
${
postData
.
argKeyWord
}
&argWhere=
${
postData
.
argWhere
}
&Stime=
${
postData
.
Stime
}
&Etime=
${
postData
.
Etime
}
`
,
}).
then
((
res
)
=>
{
if
(
res
.
data
.
data
.
length
!=
0
){
this
.
AllTableData
=
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
UpdateTime
:
this
.
$moment
(
item
.
UpdateTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}))
// 克隆一份tableData数据
this
.
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllTableData
))
if
(
this
.
AllTableData
.
length
>
this
.
$refs
.
page
.
pageSize
){
this
.
tableData
=
this
.
AllTableData
.
slice
(
0
,
this
.
$refs
.
page
.
pageSize
)
}
else
{
this
.
tableData
=
this
.
AllTableData
}
this
.
totalCount
=
this
.
AllTableData
.
length
// this.pageIndex = 1
this
.
totalPage
=
Math
.
ceil
(
this
.
AllTableData
.
length
/
this
.
$refs
.
page
.
pageSize
)
}
else
{
this
.
tableData
=
[]
this
.
totalCount
=
0
// this.pageIndex = 1
this
.
totalPage
=
1
}
this
.
pageFun
(
1
)
}).
catch
(
function
(
err
){
console
.
log
(
'err'
,
err
)
})
},
handleSelectionChange
(
val
)
{
handleSelectionChange
(
val
)
{
this
.
checkList
=
val
this
.
checkList
=
val
},
},
// 分页方法
// 分页方法
pageFun
(
num
){
pageFun
(
num
){
if
(
num
==
1
){
if
(
num
==
1
){
this
.
tableData
=
this
.
AllTableData
.
slice
(
0
,
50
)
this
.
tableData
=
this
.
cloneData
.
slice
(
0
,
this
.
$refs
.
page
.
pageSize
)
}
else
{
}
else
{
this
.
tableData
=
this
.
AllTableData
.
slice
((
num
-
1
)
*
this
.
pageSize
+
1
,
this
.
pageSize
*
num
)
this
.
tableData
=
this
.
cloneData
.
slice
((
num
-
1
)
*
this
.
$refs
.
page
.
pageSize
,
this
.
$refs
.
page
.
pageSize
*
num
)
}
},
// 扫码枪扫码
scanGunCode
()
{
let
barCode
=
''
let
lastTime
,
nextTime
let
lastCode
,
nextCode
window
.
document
.
onkeypress
=
e
=>
{
// if (this.loading) {
// // 防止高频率扫码,只能扫一次
// return
// }
if
(
window
.
event
)
{
// IE
nextCode
=
e
.
keyCode
}
else
if
(
e
.
which
)
{
// Netscape/Firefox/Opera
nextCode
=
e
.
which
}
if
(
e
.
which
===
13
)
{
if
(
barCode
.
length
<
3
)
return
// 手动输入的时间不会让code的长度大于2,所以这里只会对扫码枪有
console
.
log
(
barCode
)
console
.
log
(
'扫码结束'
)
// this.loading = true
const
cacheCode
=
barCode
this
.
$axios
({
method
:
"post"
,
url
:
`/api/MaterialWarehousing/MaterialDelivery_ScanCodeAdd`
,
data
:
{
ScanCode
:
cacheCode
}
}).
then
((
res
)
=>
{
var
postData
=
{
argKeyWord
:
this
.
formData
.
argKeyWord
,
argWhere
:
this
.
formData
.
argWhere
,
Stime
:
this
.
formData
.
dateValue
?
this
.
$moment
(
this
.
formData
.
dateValue
[
0
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
,
Etime
:
this
.
formData
.
dateValue
?
this
.
$moment
(
this
.
formData
.
dateValue
[
1
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
}
this
.
searchData
(
this
.
postData
)
})
// request({
// url: `/api/MaterialWarehousing/MaterialDelivery_ScanCodeAdd`,
// method: 'put',
// data: {
// ScanCode: cacheCode
// }
// })
// .then(res => {
// // this.loading = false
// var postData = {
// argKeyWord: this.formData.argKeyWord,
// argWhere: this.formData.argWhere,
// Stime: this.formData.dateValue ? this.$moment(this.formData.dateValue[0]).format('YYYY-MM-DD HH:mm:ss') : '',
// Etime: this.formData.dateValue ? this.$moment(this.formData.dateValue[1]).format('YYYY-MM-DD HH:mm:ss') : ''
// }
// $this.searchData(this.postData)
// })
// .catch(() => {
// // this.loading = false
// })
barCode
=
''
lastCode
=
''
lastTime
=
''
return
}
nextTime
=
new
Date
().
getTime
()
if
(
!
lastTime
&&
!
lastCode
)
{
console
.
log
(
'扫码开始。。。'
)
barCode
+=
e
.
key
}
}
if
(
lastCode
&&
lastTime
&&
nextTime
-
lastTime
>
500
)
{
// 当扫码前有keypress事件时,防止首字缺失
console
.
log
(
'防止首字缺失。。。'
)
barCode
=
e
.
key
}
else
if
(
lastCode
&&
lastTime
)
{
console
.
log
(
'扫码中。。。'
)
barCode
+=
e
.
key
}
lastCode
=
nextCode
lastTime
=
nextTime
console
.
log
(
lastCode
)
}
},
resetData
()
{
return
{
argKeyWord
:
this
.
formData
.
argKeyWord
,
argWhere
:
this
.
formData
.
argWhere
,
Stime
:
this
.
formData
.
dateValue
?
this
.
$moment
(
this
.
formData
.
dateValue
[
0
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
,
Etime
:
this
.
formData
.
dateValue
?
this
.
$moment
(
this
.
formData
.
dateValue
[
1
]).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
}
},
},
delData
()
{
delData
()
{
if
(
this
.
checkList
.
length
===
0
)
{
var
$this
=
this
this
.
deleteShow
=
true
if
(
$this
.
checkList
.
length
===
0
)
{
this
.
typeV
=
2
$this
.
deleteShow
=
true
$this
.
typeV
=
2
}
else
{
var
list
=
[]
$this
.
checkList
.
forEach
((
item
)
=>
{
list
.
push
(
item
.
ID
)
})
$this
.
$axios
({
method
:
"post"
,
url
:
`/api/ProductStorage/ProductStorage_Delete`
,
data
:
list
}).
then
((
res
)
=>
{
var
postData
=
$this
.
resetData
()
$this
.
searchData
(
postData
)
})
}
}
},
},
//关闭提示弹窗
//关闭提示弹窗
...
@@ -133,8 +285,25 @@ export default {
...
@@ -133,8 +285,25 @@ export default {
this
.
popShow
=
false
this
.
popShow
=
false
},
},
conserve
(
data
)
{
conserve
(
data
)
{
console
.
log
(
data
)
var
$this
=
this
this
.
popShow
=
false
this
.
$axios
({
method
:
"post"
,
url
:
`/api/ProductStorage/ProductStorage_WindowAddSave`
,
data
:
data
}).
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
0
){
$this
.
typeV
=
'5'
$this
.
deleteShow
=
true
}
else
{
$this
.
typeV
=
'6'
$this
.
popShow
=
false
}
$this
.
deletetext
=
res
.
data
.
msg
var
postData
=
$this
.
resetData
()
$this
.
searchData
(
postData
)
}).
catch
(
function
(
err
){
console
.
log
(
'err'
,
err
)
})
}
}
}
}
}
}
...
...
src/views/education/component/SearchForm.vue
View file @
b0547fec
...
@@ -85,10 +85,6 @@ export default {
...
@@ -85,10 +85,6 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
// selectValue: '',
// inputValue: '',
// scanValue: '',
// dateValue: [moment().format('YYYY-MM-DD 00:00:00'), moment().format('YYYY-MM-DD 23:59:59')],
searchList
:
[
searchList
:
[
{
{
id
:
'不限'
,
id
:
'不限'
,
...
@@ -125,9 +121,6 @@ export default {
...
@@ -125,9 +121,6 @@ export default {
]
]
}
}
},
},
created
()
{
// this.queryProduct
},
methods
:
{
methods
:
{
searchData
()
{
searchData
()
{
this
.
$emit
(
'searchData'
)
this
.
$emit
(
'searchData'
)
...
...
src/views/education/component/StoreDialog.vue
View file @
b0547fec
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</el-select>
</el-select>
</div>
</div>
</div>
</div>
<div
class=
"centen_row"
style=
"margin-top:10px"
>
<div
class=
"centen_row"
v-if=
"titleType === 'mater'"
style=
"margin-top:10px"
>
<span
class=
"centen_row_text"
>
物料编号:
</span>
<span
class=
"centen_row_text"
>
物料编号:
</span>
<div
class=
"centen_row_select"
>
<div
class=
"centen_row_select"
>
<el-select
v-model=
"MID"
placeholder=
"请选择"
>
<el-select
v-model=
"MID"
placeholder=
"请选择"
>
...
@@ -33,6 +33,20 @@
...
@@ -33,6 +33,20 @@
</el-select>
</el-select>
</div>
</div>
</div>
</div>
<div
class=
"centen_row"
v-if=
"titleType === 'pro'"
style=
"margin-top:10px"
>
<span
class=
"centen_row_text"
>
产品编号:
</span>
<div
class=
"centen_row_select"
>
<el-select
v-model=
"PID"
placeholder=
"请选择"
>
<el-option
v-for=
"item in proList"
:key=
"item.Name"
:label=
"item.Name"
:value=
"item.ID"
>
</el-option>
</el-select>
</div>
</div>
<div
class=
"centen_row"
style=
"margin-top:10px"
>
<div
class=
"centen_row"
style=
"margin-top:10px"
>
<span
class=
"centen_row_text"
v-if=
"type === 'in'"
>
入库数量:
</span>
<span
class=
"centen_row_text"
v-if=
"type === 'in'"
>
入库数量:
</span>
...
@@ -55,6 +69,10 @@
...
@@ -55,6 +69,10 @@
<
script
>
<
script
>
export
default
{
export
default
{
props
:
{
props
:
{
titleType
:
{
type
:
String
,
default
:
'mater'
//mater 物料 pro 产品
},
titleText
:
{
titleText
:
{
type
:
String
,
type
:
String
,
default
:
''
default
:
''
...
@@ -68,9 +86,11 @@ export default {
...
@@ -68,9 +86,11 @@ export default {
return
{
return
{
MID
:
''
,
MID
:
''
,
LID
:
''
,
LID
:
''
,
PID
:
''
,
quantity
:
''
,
quantity
:
''
,
lineList
:
[],
lineList
:
[],
materList
:
[]
materList
:
[],
proList
:
[]
}
}
},
},
directives
:
{
directives
:
{
...
@@ -99,6 +119,7 @@ export default {
...
@@ -99,6 +119,7 @@ export default {
created
()
{
created
()
{
this
.
getLines
()
this
.
getLines
()
this
.
getMaters
()
this
.
getMaters
()
this
.
getPros
()
},
},
methods
:{
methods
:{
// guid() {
// guid() {
...
@@ -121,10 +142,14 @@ export default {
...
@@ -121,10 +142,14 @@ export default {
}
}
},
},
conserve
()
{
conserve
()
{
var
postData
=
{
var
postData
=
this
.
titleType
===
'mater'
?
{
MID
:
this
.
MID
,
MID
:
this
.
MID
,
LID
:
this
.
LID
,
LID
:
this
.
LID
,
Quantity
:
this
.
quantity
,
Quantity
:
this
.
quantity
,
}
:
{
LID
:
this
.
LID
,
PID
:
this
.
PID
,
Quantity
:
this
.
quantity
,
}
}
this
.
$emit
(
'conserve'
,
postData
)
this
.
$emit
(
'conserve'
,
postData
)
},
},
...
@@ -143,7 +168,15 @@ export default {
...
@@ -143,7 +168,15 @@ export default {
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
this
.
materList
=
res
.
data
.
data
this
.
materList
=
res
.
data
.
data
})
})
}
},
getPros
()
{
this
.
$axios
({
method
:
"post"
,
url
:
`/api/ProductDelivery/ProductDelivery_Data`
,
}).
then
((
res
)
=>
{
this
.
proList
=
res
.
data
.
data
})
},
}
}
}
}
</
script
>
</
script
>
...
...
src/views/education/materialinventory.vue
View file @
b0547fec
<
template
>
<
template
>
<div
class=
"box-container"
>
<div
class=
"box-container"
>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<search-form
:formList=
"[1]"
/>
<search-form
:formList=
"[1]"
:formData=
"formData"
@
searchData=
"searchData"
/>
<el-table
<el-table
border
border
height=
"675"
height=
"675"
...
@@ -9,12 +9,11 @@
...
@@ -9,12 +9,11 @@
:data=
"tableData"
:data=
"tableData"
class=
"table-style"
class=
"table-style"
tooltip-effect=
"dark"
tooltip-effect=
"dark"
style=
"width: 100%"
style=
"width: 100%"
>
@
selection-change=
"handleSelectionChange"
>
<!--
<el-table-column
<el-table-column
type=
"selection"
type=
"selection"
width=
"60"
>
width=
"60"
>
</el-table-column>
</el-table-column>
-->
<el-table-column
<el-table-column
label=
"序号"
label=
"序号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
...
@@ -24,11 +23,11 @@
...
@@ -24,11 +23,11 @@
<el-table-column
<el-table-column
label=
"线体编号"
label=
"线体编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
SID
"
prop=
"
xtid
"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
prop=
"
ProductN
ame"
prop=
"
linn
ame"
label=
"线体名称"
label=
"线体名称"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
>
>
...
@@ -36,52 +35,36 @@
...
@@ -36,52 +35,36 @@
<el-table-column
<el-table-column
label=
"物料编号"
label=
"物料编号"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
ProductType
"
prop=
"
wlid
"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"物料名称"
label=
"物料名称"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanTyp
e"
prop=
"
wlnam
e"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"物料描述"
label=
"物料描述"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
PlanType
"
prop=
"
wlDesc
"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"单位"
label=
"单位"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
LineName
"
prop=
"
Company
"
>
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"库存数量"
label=
"库存数量"
:show-overflow-tooltip=
"true"
:show-overflow-tooltip=
"true"
prop=
"
UserName
"
prop=
"
MHNuber
"
>
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!--
<div
class=
"page_bottom"
>
<Pagination
ref=
"page"
:totalCount=
"totalCount"
:totalPage=
"totalPage"
@
pageFun=
"pageFun"
/>
<div
class=
"bottom_text"
>
<span>
共
{{
totalCount
}}
条记录 当前第
{{
pageIndex
}}
页 共
{{
totalPage
}}
页 每页
{{
pageSize
}}
条记录
</span>
</div>
<div
class=
"bottom_btns"
>
<div
class=
"bottom_firest"
@
click=
"first"
>
首页
</div>
<div
ref=
"last"
:class=
"num
<
=
1
?
'
bottom_disabled
'
:
'
bottom_next
'"
@
click=
"last"
>
上一页
</div>
<div
ref=
"next"
:class=
"num === totalPage || num
<
=
0
?
'
bottom_disabled
'
:
'
bottom_next
'"
@
click=
"next"
>
下一页
</div>
<div
class=
"bottom_end"
@
click=
"end"
>
末页
</div>
<span>
第
</span>
<input
v-model=
"num"
class=
"text"
@
input=
"handleBlur"
type=
"text"
/>
<span>
页
</span>
<div
@
click=
"jump"
class=
"bottom_jump"
>
跳转
</div>
</div>
</div>
-->
<Pagination
@
pageFun=
"pageFun"
/>
</div>
</div>
<delete-pop
ref=
"delete"
:deletetext=
"deletetext"
:type=
"typeV"
v-if=
"deleteShow"
></delete-pop>
<delete-pop
ref=
"delete"
:deletetext=
"deletetext"
:type=
"typeV"
v-if=
"deleteShow"
></delete-pop>
...
@@ -98,23 +81,71 @@ export default {
...
@@ -98,23 +81,71 @@ export default {
data
()
{
data
()
{
return
{
return
{
tableData
:
[],
tableData
:
[],
cloneData
:
[],
AllTableData
:
[],
AllTableData
:
[],
checkList
:
[],
checkList
:
[],
deletetext
:
''
,
deletetext
:
''
,
deleteShow
:
false
,
deleteShow
:
false
,
typeV
:
''
,
typeV
:
''
,
formData
:
{
argKeyWord
:
''
,
argWhere
:
''
,
},
// 分页数据
totalCount
:
0
,
// pageIndex: 1,
totalPage
:
1
}
}
},
},
created
()
{
this
.
searchData
()
},
methods
:
{
methods
:
{
handleSelectionChange
(
val
)
{
searchData
()
{
this
.
checkList
=
val
var
$this
=
this
var
postData
=
this
.
resetData
()
this
.
$axios
({
method
:
"post"
,
url
:
`/api/Materialinventory/Materialinventory_Query?argKeyWord=
${
postData
.
argKeyWord
}
&argWhere=
${
postData
.
argWhere
}
`
,
}).
then
((
res
)
=>
{
if
(
res
.
data
.
data
.
length
!=
0
){
this
.
AllTableData
=
res
.
data
.
data
.
map
(
item
=>
({
...
item
,
UpdateTime
:
this
.
$moment
(
item
.
UpdateTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}))
// 克隆一份tableData数据
this
.
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllTableData
))
if
(
this
.
AllTableData
.
length
>
this
.
$refs
.
page
.
pageSize
){
this
.
tableData
=
this
.
AllTableData
.
slice
(
0
,
this
.
$refs
.
page
.
pageSize
)
}
else
{
this
.
tableData
=
this
.
AllTableData
}
this
.
totalCount
=
this
.
AllTableData
.
length
// this.pageIndex = 1
this
.
totalPage
=
Math
.
ceil
(
this
.
AllTableData
.
length
/
this
.
$refs
.
page
.
pageSize
)
}
else
{
this
.
tableData
=
[]
this
.
totalCount
=
0
// this.pageIndex = 1
this
.
totalPage
=
1
}
this
.
pageFun
(
1
)
}).
catch
(
function
(
err
){
console
.
log
(
'err'
,
err
)
})
},
resetData
()
{
return
{
argKeyWord
:
this
.
formData
.
argKeyWord
,
argWhere
:
this
.
formData
.
argWhere
}
},
},
// 分页方法
// 分页方法
pageFun
(
num
){
pageFun
(
num
){
if
(
num
==
1
){
if
(
num
==
1
){
this
.
tableData
=
this
.
AllTableData
.
slice
(
0
,
50
)
this
.
tableData
=
this
.
cloneData
.
slice
(
0
,
this
.
$refs
.
page
.
pageSize
)
}
else
{
}
else
{
this
.
tableData
=
this
.
AllTableData
.
slice
((
num
-
1
)
*
this
.
pageSize
+
1
,
this
.
pageSize
*
num
)
this
.
tableData
=
this
.
cloneData
.
slice
((
num
-
1
)
*
this
.
$refs
.
page
.
pageSize
,
this
.
$refs
.
page
.
pageSize
*
num
)
}
}
},
},
}
}
...
...
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