Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 00cb0459
authored
Jul 13, 2024
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
发货仓库的增删改
1 parent
be6f7fa7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
222 additions
and
4 deletions
src/api/purchaseShopping.js
src/views/goods/productManage/components/productForm.vue
src/views/purchase/components/EditOrderDialog.vue
src/api/purchaseShopping.js
View file @
00cb045
...
@@ -240,3 +240,18 @@ export function getShipWarehousePage(data) {
...
@@ -240,3 +240,18 @@ export function getShipWarehousePage(data) {
data
.
method
=
`dj.api.smartcarlife.shipWarehouse.page`
data
.
method
=
`dj.api.smartcarlife.shipWarehouse.page`
return
request
(
data
,
'post'
)
return
request
(
data
,
'post'
)
}
}
/**
* 仓库/工厂发货-保存
* @param {*} data
*/
export
function
saveShipWarehouse
(
data
){
data
.
method
=
`dj.api.smartcarlife.shipWarehouse.save`
return
request
(
data
,
'post'
)
}
/**
* 删除发货仓库
*/
export
function
deleteShipWarehouse
(
data
){
data
.
method
=
`dj.api.smartcarlife.shipWarehouse.remove`
return
request
(
data
,
'post'
)
}
src/views/goods/productManage/components/productForm.vue
View file @
00cb045
This diff is collapsed.
Click to expand it.
src/views/purchase/components/EditOrderDialog.vue
View file @
00cb045
...
@@ -152,7 +152,7 @@
...
@@ -152,7 +152,7 @@
</el-form-item>
</el-form-item>
<template
v-if=
"page == 'purchase'"
>
<template
v-if=
"page == 'purchase'"
>
<el-form-item
label=
"发货仓库:"
prop=
"shippingWarehouseId"
>
<el-form-item
label=
"发货仓库:"
prop=
"shippingWarehouseId"
>
<el-select
<
!--
<
el-select
class=
"dis-in-block"
class=
"dis-in-block"
v-model=
"dialogData.shippingWarehouseId"
v-model=
"dialogData.shippingWarehouseId"
placeholder=
"请选择发货仓库"
placeholder=
"请选择发货仓库"
...
@@ -165,6 +165,102 @@
...
@@ -165,6 +165,102 @@
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
/>
/>
</el-select>
-->
<el-select
class=
"dis-in-block"
v-model=
"dialogData.shippingWarehouseId"
clearable
placeholder=
"请选择发货仓库"
@
change=
"selectChange($event)"
@
blur=
"selectBlur"
@
focus=
"selectFocus"
filterable
>
<el-option
v-for=
"(item, index) in shippingWarehouseList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
>
<!-- 发货仓库 -->
<div
class=
"flex-option"
>
<el-input
v-show=
"editOptionIndex == index"
:maxlength=
"10"
class=
"add-option-input"
:autofocus=
"true"
@
click
.
stop
.
native=
"editOptionFocus"
v-model
.
trim=
"editOptionValue"
size=
"small"
placeholder=
"请输入"
/>
<span
v-show=
"
editOptionIndex == -1 || editOptionIndex != index
"
class=
"add-option-input"
>
{{
item
.
name
}}
</span
>
<div>
<i
v-show=
"
shippingWarehouseList.length > 1 &&
editOptionIndex != index
"
class=
"el-icon-edit edit_icon"
@
click
.
stop=
"editOption(index, item.name)"
/>
<i
v-show=
"
shippingWarehouseList.length > 1 &&
editOptionIndex == index
"
class=
"el-icon-check option_icon add_icon"
@
click
.
stop=
"editOptionConfirm(item.id)"
/>
<i
v-if=
"shippingWarehouseList.length > 1"
class=
"el-icon-close del_icon"
@
click
.
stop=
"delOption(item.id)"
/>
</div>
</div>
</el-option>
<div
class=
"add-option"
>
<div
v-if=
"showOptionInput"
class=
"flex-option"
>
<el-input
class=
"add-option-input"
:maxlength=
"10"
v-model
.
trim=
"addOptionValue"
size=
"small"
placeholder=
"请输入"
/>
<div>
<i
v-if=
"addOptionValue"
class=
"el-icon-check option_icon add_icon"
@
click
.
stop=
"addOptionConfirm()"
/>
<i
class=
"el-icon-close option_icon del_icon"
@
click
.
stop=
"delOption(undefined)"
/>
</div>
</div>
<div
style=
"display: flex; align-items: center"
>
<i
class=
"el-icon-circle-plus-outline"
style=
"
color: #2a58ad;
font-size: 20px;
margin-right: 3px;
"
/>
<el-button
type=
"text"
@
click
.
stop=
"addOption"
>
新增一项
</el-button
>
</div>
</div>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
...
@@ -200,7 +296,9 @@ import {
...
@@ -200,7 +296,9 @@ import {
purchaseOrderDetail
,
purchaseOrderDetail
,
factoryOrderDetail
,
factoryOrderDetail
,
purchaseOrderDelivery
,
purchaseOrderDelivery
,
getShipWarehousePage
getShipWarehousePage
,
saveShipWarehouse
,
deleteShipWarehouse
}
from
"@/api/purchaseShopping.js"
}
from
"@/api/purchaseShopping.js"
import
{
baseConfig
}
from
"@/main"
import
{
baseConfig
}
from
"@/main"
import
{
limitPrice
}
from
"@/common/format"
import
{
limitPrice
}
from
"@/common/format"
...
@@ -246,6 +344,10 @@ export default {
...
@@ -246,6 +344,10 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
showOptionInput
:
false
,
addOptionValue
:
""
,
editOptionIndex
:
-
1
,
editOptionValue
:
""
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
dialogConfig
:
{
dialogConfig
:
{
setting
:
{
setting
:
{
...
@@ -354,7 +456,7 @@ export default {
...
@@ -354,7 +456,7 @@ export default {
{
required
:
true
,
message
:
"请选择发货时间"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"请选择发货时间"
,
trigger
:
"blur"
}
],
],
shippingWarehouseId
:
[
shippingWarehouseId
:
[
{
required
:
true
,
message
:
"请选择发货仓库"
,
trigger
:
"
change
"
}
{
required
:
true
,
message
:
"请选择发货仓库"
,
trigger
:
"
blur
"
}
]
]
},
},
detailInfo
:
{},
detailInfo
:
{},
...
@@ -370,6 +472,76 @@ export default {
...
@@ -370,6 +472,76 @@ export default {
this
.
getShippingWarehouseList
()
this
.
getShippingWarehouseList
()
},
},
methods
:
{
methods
:
{
selectChange
()
{
if
(
this
.
dialogData
.
shippingWarehouseId
)
{
this
.
$refs
[
"delivery-dialog-form"
].
clearValidate
(
"shippingWarehouseId"
)
}
},
selectBlur
()
{
if
(
this
.
dialogData
.
shippingWarehouseId
)
{
this
.
$refs
[
"delivery-dialog-form"
].
clearValidate
(
"shippingWarehouseId"
)
}
else
{
// this.$refs["delivery-dialog-form"].validateField("shippingWarehouseId")
}
this
.
editOptionIndex
=
-
1
this
.
showOptionInput
=
false
},
selectFocus
()
{
this
.
editOptionIndex
=
-
1
this
.
showOptionInput
=
false
},
addOption
()
{
this
.
showOptionInput
=
true
this
.
addOptionValue
=
""
},
addOptionConfirm
()
{
const
data
=
{
name
:
this
.
addOptionValue
}
this
.
handleSave
(
data
)
this
.
addOptionValue
=
""
this
.
showOptionInput
=
false
},
handleSave
(
data
)
{
saveShipWarehouse
(
data
).
then
((
res
)
=>
{
console
.
log
(
res
)
this
.
getShippingWarehouseList
()
})
},
handleDelete
(
data
)
{
deleteShipWarehouse
(
data
).
then
((
res
)
=>
{
console
.
log
(
res
)
this
.
getShippingWarehouseList
()
})
},
editOption
(
e
,
value
)
{
this
.
editOptionValue
=
value
this
.
editOptionIndex
=
e
},
editOptionFocus
(
event
)
{
event
.
stopPropagation
()
},
editOptionConfirm
(
e
)
{
const
data
=
{
name
:
this
.
editOptionValue
,
id
:
e
}
this
.
handleSave
(
data
)
this
.
editOptionIndex
=
-
1
this
.
editOptionValue
=
""
},
delOption
(
e
)
{
if
(
e
)
{
const
data
=
{
id
:
e
}
this
.
dialogData
.
shippingWarehouseId
=
""
this
.
handleDelete
(
data
)
}
else
{
this
.
showOptionInput
=
false
this
.
addOptionValue
=
""
}
},
getShippingWarehouseList
()
{
getShippingWarehouseList
()
{
getShipWarehousePage
({
currentPage
:
1
,
pageSize
:
999
})
getShipWarehousePage
({
currentPage
:
1
,
pageSize
:
999
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
...
@@ -481,7 +653,7 @@ export default {
...
@@ -481,7 +653,7 @@ export default {
"goodsType"
,
"goodsType"
,
"goodsTypeName"
"goodsTypeName"
]
]
if
(
this
.
page
==
'factory'
)
delete
params
.
shippingWarehouseId
;
if
(
this
.
page
==
"factory"
)
delete
params
.
shippingWarehouseId
for
(
let
idx
=
0
;
idx
<
this
.
detailInfo
.
tableData
.
length
;
idx
++
)
{
for
(
let
idx
=
0
;
idx
<
this
.
detailInfo
.
tableData
.
length
;
idx
++
)
{
const
item
=
this
.
detailInfo
.
tableData
[
idx
]
const
item
=
this
.
detailInfo
.
tableData
[
idx
]
if
(
this
.
nowPurNumList
[
idx
]
&&
this
.
nowPurNumList
[
idx
]
!=
0
)
{
if
(
this
.
nowPurNumList
[
idx
]
&&
this
.
nowPurNumList
[
idx
]
!=
0
)
{
...
@@ -585,4 +757,35 @@ export default {
...
@@ -585,4 +757,35 @@ export default {
.edit-order-dialog
.el-input--medium.border-red
.el-input__inner
{
.edit-order-dialog
.el-input--medium.border-red
.el-input__inner
{
border
:
1px
solid
#eb4e4e
;
border
:
1px
solid
#eb4e4e
;
}
}
.flex-option
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
width
:
100%
;
}
.add-option
{
padding
:
0
20px
;
display
:
flex
;
flex-flow
:
column
;
align-items
:
flex-start
;
}
.add-option-input
{
width
:
285px
!important
;
display
:
inline-block
;
}
.add-option-input
.el-input__inner
{
border
:
none
;
padding
:
0
;
}
.option_icon
{
font-size
:
14px
;
cursor
:
pointer
;
}
.del_icon
{
margin-left
:
15px
;
color
:
#eb4e4e
;
}
.add_icon
{
color
:
#3fcf77
;
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment