Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
df6a80c3
Commit
df6a80c3
authored
Nov 02, 2021
by
季圣华
Browse files
给商品增加期初库存批量设置的功能
parent
7912dcbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/views/material/modules/BatchSetStockModal.vue
0 → 100644
View file @
df6a80c3
<
template
>
<a-modal
:title=
"title"
:width=
"500"
:visible=
"visible"
:confirm-loading=
"confirmLoading"
@
ok=
"handleOk"
@
cancel=
"handleCancel"
cancelText=
"关闭"
wrapClassName=
"ant-modal-cust-warp"
style=
"top:35%;height: 30%;overflow-y: hidden"
>
<template
slot=
"footer"
>
<a-button
key=
"back"
v-if=
"isReadOnly"
@
click=
"handleCancel"
>
关闭
</a-button>
</
template
>
<a-spin
:spinning=
"confirmLoading"
>
<a-form
:form=
"form"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"请输入数量"
>
<a-input
placeholder=
"请输入数量"
v-decorator.trim=
"[ 'number', validatorRules.number]"
/>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<
script
>
export
default
{
name
:
'
BatchSetStockModal
'
,
data
()
{
return
{
title
:
"
批量设置
"
,
visible
:
false
,
isReadOnly
:
false
,
batchType
:
''
,
model
:
{},
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
16
},
},
confirmLoading
:
false
,
form
:
this
.
$form
.
createForm
(
this
),
validatorRules
:{
number
:{
rules
:
[
{
required
:
true
,
message
:
'
请输入数量!
'
}
]}
}
}
},
created
()
{
},
methods
:
{
add
(
type
)
{
this
.
batchType
=
type
if
(
type
===
'
initStock
'
)
{
this
.
title
=
'
期初库存-批量设置
'
}
else
if
(
type
===
'
lowSafeStock
'
)
{
this
.
title
=
'
最低安全库存-批量设置
'
}
else
if
(
type
===
'
highSafeStock
'
)
{
this
.
title
=
'
最高安全库存-批量设置
'
}
this
.
edit
({});
},
edit
(
record
)
{
this
.
form
.
resetFields
();
this
.
model
=
Object
.
assign
({},
record
);
this
.
visible
=
true
;
},
close
()
{
this
.
$emit
(
'
close
'
);
this
.
visible
=
false
;
},
handleOk
()
{
let
number
=
this
.
form
.
getFieldValue
(
'
number
'
)
this
.
$emit
(
'
ok
'
,
number
,
this
.
batchType
);
this
.
visible
=
false
},
handleCancel
()
{
this
.
close
()
}
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
jshERP-web/src/views/material/modules/MaterialModal.vue
View file @
df6a80c3
...
...
@@ -180,14 +180,14 @@
:actionButton=
"true"
@
added=
"onAdded"
>
<
template
#buttonAfter
>
<a-button
@
click=
"batchSet('purchase')"
>
采购价-批量
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"batchSet('commodity')"
>
零售价-批量
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"batchSet('wholesale')"
>
销售价-批量
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"batchSet('low')"
>
最低售价-批量
</a-button>
<a-button
@
click=
"batchSet
Price
('purchase')"
>
采购价-批量
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"batchSet
Price
('commodity')"
>
零售价-批量
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"batchSet
Price
('wholesale')"
>
销售价-批量
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"batchSet
Price
('low')"
>
最低售价-批量
</a-button>
</
template
>
</j-editable-table>
<!-- 表单区域 -->
<batch-set-price-modal
ref=
"
m
odalForm"
@
ok=
"batchSetPrice
m
odalFormOk"
></batch-set-price-modal>
<batch-set-price-modal
ref=
"
priceM
odalForm"
@
ok=
"batchSetPrice
M
odalFormOk"
></batch-set-price-modal>
</div>
<a-row
class=
"form-row"
:gutter=
"24"
>
<a-col
:lg=
"24"
:md=
"24"
:sm=
"24"
>
...
...
@@ -237,7 +237,15 @@
:maxHeight=
"300"
:rowNumber=
"true"
:rowSelection=
"false"
:actionButton=
"false"
/>
:actionButton=
"false"
>
<
template
#buttonAfter
>
<a-button
style=
"margin: 0px 0px 8px 0px"
@
click=
"batchSetStock('initStock')"
>
期初库存-批量
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"batchSetStock('lowSafeStock')"
>
最低安全库存-批量
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"batchSetStock('highSafeStock')"
>
最高安全库存-批量
</a-button>
</
template
>
</j-editable-table>
<!-- 表单区域 -->
<batch-set-stock-modal
ref=
"stockModalForm"
@
ok=
"batchSetStockModalFormOk"
></batch-set-stock-modal>
</a-tab-pane>
<a-tab-pane
key=
"4"
tab=
"图片信息"
forceRender
>
<a-row
class=
"form-row"
:gutter=
"24"
>
...
...
@@ -258,6 +266,7 @@
<
script
>
import
pick
from
'
lodash.pick
'
import
BatchSetPriceModal
from
'
./BatchSetPriceModal
'
import
BatchSetStockModal
from
'
./BatchSetStockModal
'
import
UnitModal
from
'
../../system/modules/UnitModal
'
import
JEditableTable
from
'
@/components/jeecg/JEditableTable
'
import
{
FormTypes
,
VALIDATE_NO_PASSED
,
getRefPromise
,
validateFormAndTables
}
from
'
@/utils/JEditableTableUtil
'
...
...
@@ -271,6 +280,7 @@
name
:
"
MaterialModal
"
,
components
:
{
BatchSetPriceModal
,
BatchSetStockModal
,
UnitModal
,
JImageUpload
,
JDate
,
...
...
@@ -778,15 +788,19 @@
this
.
maxBarCodeInfo
=
this
.
maxBarCodeInfo
+
1
target
.
setValues
([{
rowKey
:
row
.
id
,
values
:
{
barCode
:
this
.
maxBarCodeInfo
,
commodityUnit
:
unit
?
unit
:
''
}}])
},
batchSet
(
type
)
{
batchSet
Price
(
type
)
{
if
(
this
.
skuSwitch
||
this
.
model
.
id
){
this
.
$refs
.
m
odalForm
.
add
(
type
);
this
.
$refs
.
m
odalForm
.
disableSubmit
=
false
;
this
.
$refs
.
priceM
odalForm
.
add
(
type
);
this
.
$refs
.
priceM
odalForm
.
disableSubmit
=
false
;
}
else
{
this
.
$message
.
warning
(
'
抱歉,只有开启多属性才能进行批量操作!
'
);
}
},
batchSetPricemodalFormOk
(
price
,
batchType
)
{
batchSetStock
(
type
)
{
this
.
$refs
.
stockModalForm
.
add
(
type
);
this
.
$refs
.
stockModalForm
.
disableSubmit
=
false
;
},
batchSetPriceModalFormOk
(
price
,
batchType
)
{
let
arr
=
this
.
meTable
.
dataSource
if
(
arr
.
length
===
0
)
{
this
.
$message
.
warning
(
'
请先录入条码、单位等信息!
'
);
...
...
@@ -813,6 +827,26 @@
this
.
meTable
.
dataSource
=
meTableData
}
},
batchSetStockModalFormOk
(
stock
,
batchType
)
{
let
arr
=
this
.
depotTable
.
dataSource
let
depotTableData
=
[]
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
let
depotInfo
=
{
name
:
arr
[
i
].
name
,
initStock
:
arr
[
i
].
initStock
,
lowSafeStock
:
arr
[
i
].
lowSafeStock
,
highSafeStock
:
arr
[
i
].
highSafeStock
}
if
(
batchType
===
'
initStock
'
)
{
depotInfo
.
initStock
=
stock
-
0
}
else
if
(
batchType
===
'
lowSafeStock
'
)
{
depotInfo
.
lowSafeStock
=
stock
-
0
}
else
if
(
batchType
===
'
highSafeStock
'
)
{
depotInfo
.
highSafeStock
=
stock
-
0
}
if
(
arr
[
i
].
id
)
{
depotInfo
.
id
=
arr
[
i
].
id
}
depotTableData
.
push
(
depotInfo
)
}
this
.
depotTable
.
dataSource
=
depotTableData
},
initMaterialAttribute
()
{
getAllMaterialAttribute
({}).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
)
{
...
...
Write
Preview
Supports
Markdown
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