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
a00ea462
Commit
a00ea462
authored
May 15, 2022
by
季圣华
Browse files
给商品模块增加批量修改的功能
parent
46eca9c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/api/api.js
View file @
a00ea462
...
...
@@ -56,6 +56,7 @@ const getSerialMaterialBySelect = (params)=>getAction("/material/getMaterialEnab
const
getMaterialByBarCode
=
(
params
)
=>
getAction
(
"
/material/getMaterialByBarCode
"
,
params
);
const
getMaxBarCode
=
(
params
)
=>
getAction
(
"
/material/getMaxBarCode
"
,
params
);
const
checkMaterialBarCode
=
(
params
)
=>
getAction
(
"
/materialsExtend/checkIsBarCodeExist
"
,
params
);
const
batchUpdateMaterial
=
(
params
)
=>
postAction
(
"
/material/batchUpdate
"
,
params
);
//序列号
const
addSerialNumber
=
(
params
)
=>
postAction
(
"
/serialNumber/add
"
,
params
);
const
editSerialNumber
=
(
params
)
=>
putAction
(
"
/serialNumber/update
"
,
params
);
...
...
@@ -149,6 +150,7 @@ export {
getMaterialByBarCode
,
getMaxBarCode
,
checkMaterialBarCode
,
batchUpdateMaterial
,
addSerialNumber
,
editSerialNumber
,
checkSerialNumber
,
...
...
jshERP-web/src/views/material/MaterialList.vue
View file @
a00ea462
...
...
@@ -97,7 +97,8 @@
<a-menu-item
key=
"1"
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"batchDel"
><a-icon
type=
"delete"
/>
删除
</a-menu-item>
<a-menu-item
key=
"2"
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"batchSetStatus(true)"
><a-icon
type=
"check-square"
/>
启用
</a-menu-item>
<a-menu-item
key=
"3"
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"batchSetStatus(false)"
><a-icon
type=
"close-square"
/>
禁用
</a-menu-item>
<a-menu-item
key=
"4"
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"batchSetMaterialCurrentStock()"
><a-icon
type=
"stock"
/>
修正库存
</a-menu-item>
<a-menu-item
key=
"4"
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"batchEdit()"
><a-icon
type=
"edit"
/>
批量编辑
</a-menu-item>
<a-menu-item
key=
"5"
v-if=
"btnEnableList.indexOf(1)>-1"
@
click=
"batchSetMaterialCurrentStock()"
><a-icon
type=
"stock"
/>
修正库存
</a-menu-item>
</a-menu>
<a-button>
批量操作
<a-icon
type=
"down"
/>
...
...
@@ -160,12 +161,14 @@
<!-- table区域-end -->
<!-- 表单区域 -->
<material-modal
ref=
"modalForm"
@
ok=
"modalFormOk"
></material-modal>
<batch-set-info-modal
ref=
"batchSetInfoModalForm"
@
ok=
"modalFormOk"
></batch-set-info-modal>
</a-card>
</a-col>
</a-row>
</template>
<
script
>
import
MaterialModal
from
'
./modules/MaterialModal
'
import
BatchSetInfoModal
from
'
./modules/BatchSetInfoModal
'
import
{
queryMaterialCategoryTreeList
}
from
'
@/api/api
'
import
{
postAction
}
from
'
@/api/manage
'
import
{
getMpListShort
}
from
'
@/utils/util
'
...
...
@@ -179,6 +182,7 @@
mixins
:[
JeecgListMixin
],
components
:
{
MaterialModal
,
BatchSetInfoModal
,
JEllipsis
,
JDate
},
...
...
@@ -321,7 +325,7 @@
}
})
},
batchSetMaterialCurrentStock
:
function
()
{
batchSetMaterialCurrentStock
()
{
if
(
this
.
selectedRowKeys
.
length
<=
0
)
{
this
.
$message
.
warning
(
'
请选择一条记录!
'
);
}
else
{
...
...
@@ -350,6 +354,18 @@
});
}
},
batchEdit
()
{
if
(
this
.
selectedRowKeys
.
length
<=
0
)
{
this
.
$message
.
warning
(
'
请选择一条记录!
'
);
}
else
{
let
ids
=
""
;
for
(
let
a
=
0
;
a
<
this
.
selectedRowKeys
.
length
;
a
++
)
{
ids
+=
this
.
selectedRowKeys
[
a
]
+
"
,
"
;
}
this
.
$refs
.
batchSetInfoModalForm
.
edit
(
ids
);
this
.
$refs
.
batchSetInfoModalForm
.
title
=
"
批量编辑
"
;
}
},
handleEdit
:
function
(
record
)
{
this
.
$refs
.
modalForm
.
edit
(
record
);
this
.
$refs
.
modalForm
.
title
=
"
编辑
"
;
...
...
jshERP-web/src/views/material/modules/BatchSetInfoModal.vue
0 → 100644
View file @
a00ea462
<
template
>
<a-modal
:title=
"title"
:width=
"1000"
:visible=
"visible"
:confirm-loading=
"confirmLoading"
@
ok=
"handleOk"
@
cancel=
"handleCancel"
wrapClassName=
"ant-modal-cust-warp"
style=
"top:25%;height: 45%;overflow-y: hidden"
>
<a-spin
:spinning=
"confirmLoading"
>
<a-form
:form=
"form"
>
<a-row
class=
"form-row"
:gutter=
"24"
>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"颜色"
>
<a-input
placeholder=
"请输入颜色"
v-decorator.trim=
"[ 'color' ]"
/>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"基础重量"
>
<a-input-number
style=
"width: 100%"
placeholder=
"请输入基础重量(kg)"
v-decorator.trim=
"[ 'weight' ]"
/>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"保质期"
>
<a-input-number
style=
"width: 100%"
placeholder=
"请输入保质期(天)"
v-decorator.trim=
"[ 'expiryNum' ]"
/>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"类别"
>
<a-tree-select
style=
"width:100%"
:dropdownStyle=
"
{maxHeight:'200px',overflow:'auto'}" allow-clear
:treeData="categoryTree" v-decorator="[ 'categoryId' ]" placeholder="请选择类别">
</a-tree-select>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"序列号"
>
<a-select
placeholder=
"有无序列号"
v-decorator=
"[ 'enableSerialNumber' ]"
>
<a-select-option
value=
"1"
>
有
</a-select-option>
<a-select-option
value=
"0"
>
无
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"批号"
>
<a-select
placeholder=
"有无批号"
v-decorator=
"[ 'enableBatchNumber' ]"
>
<a-select-option
value=
"1"
>
有
</a-select-option>
<a-select-option
value=
"0"
>
无
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"备注"
>
<a-textarea
:rows=
"1"
placeholder=
"请输入备注"
v-decorator=
"[ 'remark' ]"
style=
"margin-top:8px;"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</
template
>
<
script
>
import
{
queryMaterialCategoryTreeList
,
batchUpdateMaterial
}
from
'
@/api/api
'
export
default
{
name
:
'
BatchSetInfoModal
'
,
data
()
{
return
{
title
:
"
批量编辑
"
,
visible
:
false
,
categoryTree
:
[],
materialIds
:
''
,
model
:
{},
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
16
},
},
confirmLoading
:
false
,
form
:
this
.
$form
.
createForm
(
this
),
}
},
created
()
{
},
methods
:
{
loadTreeData
(){
let
that
=
this
let
params
=
{}
params
.
id
=
''
queryMaterialCategoryTreeList
(
params
).
then
((
res
)
=>
{
if
(
res
){
that
.
categoryTree
=
[];
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
let
temp
=
res
[
i
];
that
.
categoryTree
.
push
(
temp
)
}
}
})
},
edit
(
ids
)
{
this
.
materialIds
=
ids
this
.
form
.
resetFields
()
this
.
model
=
Object
.
assign
({},
''
)
this
.
loadTreeData
()
this
.
visible
=
true
},
close
()
{
this
.
$emit
(
'
close
'
);
this
.
visible
=
false
;
},
handleOk
()
{
const
that
=
this
// 触发表单验证
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
that
.
confirmLoading
=
true
let
formData
=
Object
.
assign
(
this
.
model
,
values
)
if
(
JSON
.
stringify
(
formData
)
===
'
{}
'
)
{
that
.
$message
.
warning
(
'
抱歉,请输入要批量编辑的内容!
'
)
that
.
confirmLoading
=
false
return
}
if
(
formData
.
enableSerialNumber
===
'
1
'
&&
formData
.
enableBatchNumber
===
'
1
'
)
{
that
.
$message
.
warning
(
'
抱歉,序列号和批号只能选择一项!
'
)
that
.
confirmLoading
=
false
return
}
let
paramObj
=
{
ids
:
this
.
materialIds
,
material
:
JSON
.
stringify
(
formData
)
}
batchUpdateMaterial
(
paramObj
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
){
that
.
$emit
(
'
ok
'
)
}
else
{
that
.
$message
.
warning
(
res
.
data
.
message
)
}
}).
finally
(()
=>
{
that
.
confirmLoading
=
false
that
.
close
()
})
}
})
},
handleCancel
()
{
this
.
close
()
}
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
jshERP-web/src/views/material/modules/MaterialModal.vue
View file @
a00ea462
...
...
@@ -68,25 +68,26 @@
</a-row>
<a-row
class=
"form-row"
:gutter=
"24"
>
<a-col
:md=
"6"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"颜色"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"颜色"
data-step=
"5"
data-title=
"颜色"
data-intro=
"请填写商品的颜色,如果是多属性商品可以不填(下面有多属性开关)"
>
<a-input
placeholder=
"请输入颜色"
v-decorator.trim=
"[ 'color' ]"
/>
</a-form-item>
</a-col>
<a-col
:md=
"6"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"基础重量"
data-step=
"
5
"
data-title=
"基础重量"
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"基础重量"
data-step=
"
6
"
data-title=
"基础重量"
data-intro=
"请填写基本单位对应的重量,用于计算按重量分摊费用时单据中各行商品分摊的费用成本"
>
<a-input-number
style=
"width: 100%"
placeholder=
"请输入基础重量(kg)"
v-decorator.trim=
"[ 'weight' ]"
/>
</a-form-item>
</a-col>
<a-col
:md=
"6"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"保质期"
data-step=
"
6
"
data-title=
"保质期"
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"保质期"
data-step=
"
7
"
data-title=
"保质期"
data-intro=
"保质期指的是商品的保质期(天),主要针对带生产日期的,此类商品一般有批号"
>
<a-input-number
style=
"width: 100%"
placeholder=
"请输入保质期(天)"
v-decorator.trim=
"[ 'expiryNum' ]"
/>
</a-form-item>
</a-col>
<a-col
:md=
"6"
:sm=
"24"
>
<a-form-item
:labelCol=
"{xs: { span: 24 },sm: { span: 4 }}"
:wrapperCol=
"{xs: { span: 24 },sm: { span: 20 }}"
label=
"类别"
data-step=
"
7
"
data-title=
"类别"
data-intro=
"类别需要在【商品类别】页面进行录入,录入之后在此处进行调用"
>
data-step=
"
8
"
data-title=
"类别"
data-intro=
"类别需要在【商品类别】页面进行录入,录入之后在此处进行调用"
>
<a-tree-select
style=
"width:100%"
:dropdownStyle=
"{maxHeight:'200px',overflow:'auto'}"
allow-clear
:treeData=
"categoryTree"
v-decorator=
"[ 'categoryId' ]"
placeholder=
"请选择类别"
>
</a-tree-select>
...
...
@@ -95,7 +96,7 @@
</a-row>
<a-row
class=
"form-row"
:gutter=
"24"
>
<a-col
:md=
"6"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"序列号"
data-step=
"
8
"
data-title=
"序列号"
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"序列号"
data-step=
"
9
"
data-title=
"序列号"
data-intro=
"此处是商品的序列号开关,如果选择了有,则在采购入库单据需要录入该商品的序列号,在销售出库单据需要选择该商品的序列号进行出库"
>
<a-select
placeholder=
"有无序列号"
v-decorator=
"[ 'enableSerialNumber' ]"
>
<a-select-option
value=
"1"
>
有
</a-select-option>
...
...
@@ -104,7 +105,7 @@
</a-form-item>
</a-col>
<a-col
:md=
"6"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"批号"
data-step=
"
9
"
data-title=
"批号"
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"批号"
data-step=
"
10
"
data-title=
"批号"
data-intro=
"此处是商品的批号开关,如果选择了有,则在采购入库单据需要录入该商品的批号和生产日期,在销售出库单据需要选择该商品的批号进行出库"
>
<a-select
placeholder=
"有无批号"
v-decorator=
"[ 'enableBatchNumber' ]"
>
<a-select-option
value=
"1"
>
有
</a-select-option>
...
...
@@ -113,7 +114,7 @@
</a-form-item>
</a-col>
<a-col
:md=
"6"
:sm=
"24"
>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"多属性"
data-step=
"1
0
"
data-title=
"多属性"
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"多属性"
data-step=
"1
1
"
data-title=
"多属性"
data-intro=
"多属性是针对的sku商品(比如服装、鞋帽行业),此处开关如果启用就可以在下方进行多sku的配置,配置具体的颜色、尺码之类的组合"
>
<a-switch
checked-children=
"启用"
un-checked-children=
"关闭"
v-model=
"skuSwitch"
:disabled=
"switchDisabled"
@
change=
"onSkuChange"
></a-switch>
</a-form-item>
...
...
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