Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-purchase
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cab9fdee
authored
Nov 08, 2023
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
膜卷号弹窗
1 parent
5b4aaab4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
258 additions
and
4 deletions
src/views/purchaseOrder/components/FilmDialog.vue
src/views/purchaseOrder/into.vue
src/views/purchaseOrder/components/FilmDialog.vue
0 → 100644
View file @
cab9fde
<
template
>
<GLDialog
v-if=
"dialogShow"
bigTitle=
"选择膜卷号"
mode=
"big"
:visible
.
sync=
"dialogShow"
:close-on-click-modal=
"false"
>
<div
class=
"detail-info"
>
<div>
已添加数量:
<span>
{{
filmRollList
.
length
}}
</span>
</div>
<div>
最大可添加数量:
<span>
{{
detailInfo
.
goodsNumber
}}
</span>
</div>
<div
class=
"add-btn"
@
click=
"addLineTable"
>
添加一行
</div>
</div>
<GLTable
:tableData=
"filmRollList"
:noDataImg=
"url"
:tableParams=
"tableParams"
:hasPage=
"false"
>
<template
slot=
"filmNum"
slot-scope=
"scope"
>
<el-form
:ref=
"'addForm' + scope.index"
:model=
"scope.scope"
size=
"small"
:rules=
"rules"
>
<el-form-item
style=
"margin-bottom: 0px"
prop=
"filmNum"
>
<el-input
v-model=
"scope.scope.filmNum"
placeholder=
"请输入"
maxlength=
"50"
@
input=
"e => handleInputFilmNum(e, scope.index)"
></el-input>
</el-form-item>
</el-form>
</
template
>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleDelete(scope.index)"
>
删除
</el-button>
</div>
</GLTable>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"small"
@
click=
"dialogShow = false"
>
关闭
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"handleSave"
>
保存入库
</el-button>
</span>
</GLDialog>
</template>
<
script
>
import
BigNumber
from
'bignumber.js'
import
*
as
dayjs
from
'dayjs'
export
default
{
name
:
'FilmDialog'
,
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
},
id
:
{
type
:
String
,
default
:
''
},
info
:
{
type
:
Object
,
default
:
()
=>
{
}
}
},
watch
:
{
visible
(
val
)
{
if
(
val
)
{
this
.
detailInfo
=
this
.
$common
.
utils
.
deepClone
(
this
.
info
||
{})
if
(
!
this
.
info
.
filmRollList
)
{
this
.
filmRollList
=
[{
filmNum
:
''
}]
return
true
}
this
.
info
?.
filmRollList
.
forEach
(
item
=>
{
this
.
filmRollList
.
push
({
filmNum
:
item
})
})
}
}
},
computed
:
{
dialogShow
:
{
get
()
{
return
this
.
visible
},
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
}
}
},
data
()
{
// var checkPrice = (rule, value, callback) => {
// if (isNaN(+value)) {
// callback(new Error('请输入数字值'))
// } else {
// if (value <= 0 || value > 999999) {
// callback(new Error('仅支持输入0~999999'))
// } else {
// callback()
// }
// }
// }
return
{
dayjs
:
dayjs
,
filmRollList
:
[],
tableParams
:
{
tableOption
:
true
,
tableColumns
:
[
{
label
:
'膜卷号'
,
prop
:
'filmNum'
,
addHtml
:
'filmNum'
}
]
},
rules
:
{
filmNum
:
[
{
required
:
true
,
message
:
'请输入膜卷号'
,
trigger
:
'blur'
}
// { validator: checkPrice, trigger: 'blur' }
]
},
detailInfo
:
{},
tableData
:
[]
}
},
created
()
{
},
methods
:
{
// lookNumber(data) {
// this.innerVisible = true
// this.tableData = data.map(item => {
// return { cardNum: item }
// })
// },
handleInputFilmNum
(
val
,
idx
)
{
const
reg
=
/^
[
0-9a-zA-Z
]
*$/
if
(
!
reg
.
test
(
val
))
{
this
.
filmRollList
[
idx
].
filmNum
=
val
.
slice
(
0
,
val
.
length
-
1
)
}
},
handleDetailClose
()
{
this
.
dialogShow
=
false
},
handleDelete
(
idx
)
{
if
(
this
.
filmRollList
.
length
>
1
)
{
this
.
filmRollList
.
splice
(
idx
,
1
)
}
},
addLineTable
()
{
if
(
this
.
filmRollList
.
length
==
this
.
detailInfo
.
goodsNumber
)
{
return
true
}
this
.
filmRollList
.
push
({
filmNum
:
''
})
},
validateForm
(
form
)
{
return
new
Promise
(
resolve
=>
{
form
.
validate
(
valid
=>
{
if
(
valid
)
{
resolve
()
}
})
})
},
handleSave
()
{
let
flag
=
true
for
(
let
i
=
0
;
i
<
this
.
filmRollList
.
length
;
i
++
)
{
this
.
$refs
[
'addForm'
+
i
].
validate
(
valid
=>
{
flag
=
valid
})
if
(
!
flag
)
{
return
true
}
}
let
list
=
this
.
filmRollList
.
map
(
item
=>
item
.
filmNum
)
this
.
$emit
(
'handleConfirm'
,
list
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.detail-info
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
color
:
#666666
ff
;
font-size
:
14px
;
margin-bottom
:
16px
;
span
{
color
:
#333333
ff
;
}
.add-btn
{
font-size
:
14px
;
color
:
#5850ff
;
cursor
:
pointer
;
border
:
1px
solid
#5850ff
;
border-radius
:
4px
;
padding
:
6px
16px
;
}
}
.table-wrap
{
box-sizing
:
border-box
;
margin-top
:
16px
;
/deep/
.el-form-item__error
{
padding-top
:
2px
;
z-index
:
9999999
;
position
:
static
;
}
/
deep
/
td
.el-table__cell
{
height
:
64px
;
}
}
//
.lookNumber
{
//
font-size
:
14px
;
//
color
:
#5850ff
!important
;
//
cursor
:
pointer
;
//
margin-left
:
8px
;
//
}
.look-card-wrap
{
/deep/.el-table
th.el-table__cell
>
.cell
{
padding
:
0
16px
;
text-align
:
center
;
}
/
deep
/
.el-table__body
td
.el-table__cell
{
text-align
:
center
;
}
}
</
style
>
src/views/purchaseOrder/into.vue
View file @
cab9fde
...
@@ -19,6 +19,16 @@
...
@@ -19,6 +19,16 @@
<el-input
v-model=
"scope.scope.goodsNumber"
placeholder=
"请输入"
@
blur=
"handleCalculate(scope.scope, 'goodsNumber')"
></el-input>
<el-input
v-model=
"scope.scope.goodsNumber"
placeholder=
"请输入"
@
blur=
"handleCalculate(scope.scope, 'goodsNumber')"
></el-input>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
<
template
slot=
"film"
slot-scope=
"scope"
>
<div
v-if=
"scope.scope.goodsName == '太阳膜'"
>
<el-button
v-if=
"!scope.scope.filmRollList"
type=
"text"
@
click=
"handleSelectFilm(scope.scope, scope.index)"
>
请选择
</el-button>
<div
v-else
>
{{
scope
.
scope
.
filmRollList
.
length
}}
<el-button
type=
"text"
@
click=
"handleSelectFilm(scope.scope, scope.index)"
>
重新选择
</el-button>
</div>
</div>
<div
v-else
>
--
</div>
</
template
>
<
template
slot=
"upgradePurchasePrice"
slot-scope=
"scope"
>
<
template
slot=
"upgradePurchasePrice"
slot-scope=
"scope"
>
<el-form-item
style=
"margin-bottom: 0px"
:prop=
"'tableData.' + scope.index + '.upgradePurchasePrice'"
:rules=
"rules.upgradePurchasePrice"
>
<el-form-item
style=
"margin-bottom: 0px"
:prop=
"'tableData.' + scope.index + '.upgradePurchasePrice'"
:rules=
"rules.upgradePurchasePrice"
>
<el-input
v-model=
"scope.scope.upgradePurchasePrice"
placeholder=
"请输入"
@
blur=
"handleCalculate(scope.scope, 'upgradePurchasePrice')"
></el-input>
<el-input
v-model=
"scope.scope.upgradePurchasePrice"
placeholder=
"请输入"
@
blur=
"handleCalculate(scope.scope, 'upgradePurchasePrice')"
></el-input>
...
@@ -56,10 +66,12 @@
...
@@ -56,10 +66,12 @@
<el-button
@
click=
"handleSave(1)"
type=
"primary"
plain
size=
"medium"
>
保存
</el-button>
<el-button
@
click=
"handleSave(1)"
type=
"primary"
plain
size=
"medium"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave(2)"
size=
"medium"
>
保存并入库
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave(2)"
size=
"medium"
>
保存并入库
</el-button>
</GLFooter>
</GLFooter>
<filmDialog
:visible
.
sync=
"filmVisible"
:info=
"info"
@
handleConfirm=
"handleFilmConfirm"
></filmDialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
BigNumber
from
'bignumber.js'
import
BigNumber
from
'bignumber.js'
import
filmDialog
from
'./components/FilmDialog'
export
default
{
export
default
{
data
()
{
data
()
{
var
checkPrice
=
(
rule
,
value
,
callback
)
=>
{
var
checkPrice
=
(
rule
,
value
,
callback
)
=>
{
...
@@ -94,7 +106,7 @@ export default {
...
@@ -94,7 +106,7 @@ export default {
putMerchantId
:
[{
required
:
true
,
message
:
'请选择入库门店'
,
trigger
:
'change'
}]
putMerchantId
:
[{
required
:
true
,
message
:
'请选择入库门店'
,
trigger
:
'change'
}]
},
},
formdata
:
{
formdata
:
{
tableData
:
[{
upgradeGoodsId
:
''
,
type
:
''
,
goodsName
:
''
,
goodsNumber
:
''
,
upgradePurchasePrice
:
''
,
goodsTotalPrice
:
''
,
putYqMerchantId
:
''
,
putYqMerchantName
:
''
,
putMerchantId
:
''
,
putMerchantName
:
''
,
refByYqShopList
:
[]
}]
tableData
:
[{
upgradeGoodsId
:
''
,
type
:
''
,
goodsName
:
''
,
goodsNumber
:
''
,
upgradePurchasePrice
:
''
,
goodsTotalPrice
:
''
,
putYqMerchantId
:
''
,
putYqMerchantName
:
''
,
putMerchantId
:
''
,
putMerchantName
:
''
,
refByYqShopList
:
[]
}]
},
},
tableParams
:
{
tableParams
:
{
tableOption
:
true
,
tableOption
:
true
,
...
@@ -118,12 +130,17 @@ export default {
...
@@ -118,12 +130,17 @@ export default {
addHtml
:
'goodsNumber'
addHtml
:
'goodsNumber'
},
},
{
{
label
:
'采购单价'
,
label
:
'膜卷号'
,
prop
:
'filmRollList'
,
addHtml
:
'film'
},
{
label
:
'采购单价/元'
,
prop
:
'upgradePurchasePrice'
,
prop
:
'upgradePurchasePrice'
,
addHtml
:
'upgradePurchasePrice'
addHtml
:
'upgradePurchasePrice'
},
},
{
{
label
:
'采购总
额
/元'
,
label
:
'采购总
价
/元'
,
prop
:
'goodsTotalPrice'
,
prop
:
'goodsTotalPrice'
,
addHtml
:
'goodsTotalPrice'
addHtml
:
'goodsTotalPrice'
},
},
...
@@ -141,9 +158,14 @@ export default {
...
@@ -141,9 +158,14 @@ export default {
},
},
goodsList
:
[],
goodsList
:
[],
storeUsageList
:
[],
storeUsageList
:
[],
refByYqShopList
:
[]
refByYqShopList
:
[],
filmVisible
:
false
,
info
:
{}
}
}
},
},
components
:
{
filmDialog
},
created
()
{
created
()
{
this
.
getfwsGoodsList
()
this
.
getfwsGoodsList
()
this
.
getMerchantList
()
this
.
getMerchantList
()
...
@@ -272,6 +294,22 @@ export default {
...
@@ -272,6 +294,22 @@ export default {
}
}
})
})
},
},
filmIsVisible
()
{
this
.
filmVisible
=
!
this
.
filmVisible
},
handleSelectFilm
(
row
,
idx
)
{
if
(
!
row
.
goodsNumber
)
{
this
.
$message
.
error
(
'请先完善采购数量'
)
return
}
this
.
filmIsVisible
()
this
.
filmIdx
=
idx
this
.
info
=
row
},
handleFilmConfirm
(
list
)
{
this
.
formdata
.
tableData
[
this
.
filmIdx
].
filmRollList
=
list
this
.
filmIsVisible
()
},
handleCalculate
(
data
,
key
)
{
handleCalculate
(
data
,
key
)
{
if
(
key
==
'goodsNumber'
)
{
if
(
key
==
'goodsNumber'
)
{
data
[
key
]
=
data
[
key
]
?
new
BigNumber
(
data
[
key
]).
dp
(
0
).
toNumber
()
:
''
data
[
key
]
=
data
[
key
]
?
new
BigNumber
(
data
[
key
]).
dp
(
0
).
toNumber
()
:
''
...
...
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