Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-pay
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 c50ab786
authored
Nov 12, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商品-编辑
1 parent
aaf20711
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
39 deletions
src/api/modules/proManage.js
src/views/productGroup/editProduct.vue
src/api/modules/proManage.js
View file @
c50ab78
...
...
@@ -65,4 +65,15 @@ const getProInfoApi = params => {
})
}
export
default
{
getListApi
,
getProShareApi
,
topProApi
,
updateStatusProApi
,
deleteTakeProApi
,
getProInfoApi
}
const
insertOrUpdateProApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
insertOrUpdate`
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
returnAll
:
true
})
}
export
default
{
getListApi
,
getProShareApi
,
topProApi
,
updateStatusProApi
,
deleteTakeProApi
,
getProInfoApi
,
insertOrUpdateProApi
}
src/views/productGroup/editProduct.vue
View file @
c50ab78
...
...
@@ -135,16 +135,21 @@
<td
:style=
"{ width: specsWidth }"
v-for=
"(n, idx) in subItem.specsValueList"
:key=
"idx"
>
{{ n }}
</td>
<td
:style=
"{ width: specsWidth }"
>
<div
v-if=
"routeInfo.groupOrStore == 1"
>
<el-input
:class=
"{ 'border-red': (
+editForm.supplyPrice > +subItem.retailPrice
) && submitted }"
placeholder=
"零售价"
v-model=
"subItem.retailPrice"
ng-blur=
"handleBlur()"
>
<el-tooltip
v-show=
"(+editForm.supplyPrice > +subItem.retailPrice) && submitted"
slot=
"suffix"
class=
"item"
effect=
"dark"
content=
"零售价要大于供货价"
placement=
"top
"
>
<i
class=
"el-icon-warning color-red
"
></i>
</el-
tooltip
>
<el-input
:class=
"{ 'border-red': (
!(subItem.retailPrice + '') || (+editForm.supplyPrice > +subItem.retailPrice)
) && submitted }"
placeholder=
"零售价"
v-model=
"subItem.retailPrice"
ng-blur=
"handleBlur()"
>
<el-popover
v-show=
"(!(subItem.retailPrice + '') || (+editForm.supplyPrice > +subItem.retailPrice)) && submitted"
slot=
"suffix"
placement=
"top"
title=
""
width=
"90"
trigger=
"hover"
:content=
"!(subItem.retailPrice + '') ? '零售价是必填项' :'零售价要大于供货价'
"
>
<i
class=
"el-icon-warning color-red"
slot=
"reference
"
></i>
</el-
popover
>
</el-input>
</div>
<el-input
v-else
placeholder=
"零售价"
v-model=
"subItem.retailPrice"
ng-blur=
"handleBlur()"
></el-input>
</td>
<td
:style=
"{ width: specsWidth }"
>
<el-input
placeholder=
"库存"
v-model=
"subItem.stock"
></el-input></td>
<el-input
placeholder=
"库存"
v-model=
"subItem.stock"
:class=
"{ 'border-red': !(subItem.stock + '') && submitted }"
>
<el-popover
v-show=
"!(subItem.stock + '') && submitted"
slot=
"suffix"
placement=
"top"
title=
""
width=
"90"
trigger=
"hover"
content=
"库存是必填项"
>
<i
class=
"el-icon-warning color-red"
slot=
"reference"
></i>
</el-popover>
</el-input>
</td>
</tr>
</tbody>
</table>
...
...
@@ -325,7 +330,7 @@ export default {
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadImgApi
({
file
:
base64
,
fileType
:
'image'
}).
then
(
res
=>
{
this
.
editForm
[
targetItem
.
name
]
=
res
this
.
$refs
.
editFormRef
.
$refs
.
editProRef0
.
validateField
(
targetItem
.
name
)
this
.
$refs
.
editFormRef
[
0
]
.
$refs
.
editProRef0
.
validateField
(
targetItem
.
name
)
})
}
},
...
...
@@ -345,7 +350,7 @@ export default {
resType
:
1
,
bizType
:
1
})
this
.
$refs
.
editFormRef
.
$refs
.
editProRef0
.
validateField
(
targetItem
.
name
)
this
.
$refs
.
editFormRef
[
0
]
.
$refs
.
editProRef0
.
validateField
(
targetItem
.
name
)
})
}
},
...
...
@@ -839,10 +844,6 @@ export default {
this
.
editForm
.
supplyMerchantList
.
length
&&
this
.
recoveryMerchantList
()
this
.
handleTypeChange
(
this
.
editForm
.
deliveryType
)
// console.log(this.editForm)
// this.editForm.supplyMerchantList = res.merchantRefList
// this.editForm.supplyMerchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
})
},
getOptionsList
(
idx
,
formName
,
hasAll
=
true
,
refreshSigle
)
{
...
...
@@ -929,26 +930,30 @@ export default {
return
true
}
this
.
$refs
.
editFormRef
[
i
].
$refs
[
'editProRef'
+
i
].
validate
((
valid
,
errorObj
)
=>
{
if
(
!
valid
)
{
// 规格值验证
if
(
i
==
1
)
{
for
(
var
j
=
0
;
j
<
this
.
nameToValSpecsList
.
length
;
j
++
)
{
var
item
=
this
.
nameToValSpecsList
[
j
]
if
(
!
item
.
retailPrice
||
!
item
.
stock
)
{
this
.
whereToGo
(
'specificationDetailList'
)
isJump
=
true
break
}
if
((
this
.
routeInfo
.
groupOrStore
==
1
)
&&
(
+
item
.
retailPrice
<
+
this
.
editForm
.
supplyPrice
))
{
this
.
whereToGo
(
'specificationDetailList'
)
isJump
=
true
break
}
}
}
if
(
!
isJump
&&
!
valid
)
{
isJump
=
true
this
.
whereToGo
(
Object
.
keys
(
errorObj
)[
0
])
}
})
}
// this.$refs.editFormRef[0].$refs.editProRef0.validate((valid0, errorObj0) => {
// if (!valid0) {
// this.whereToGo(Object.keys(errorObj0)[0])
// return true
// }
// this.$refs.editFormRef[1].$refs.editProRef1.validate((valid1, errorObj1) => {
// if (!valid0) {
// this.whereToGo(Object.keys(errorObj1)[0])
// return true
// }
// this.$refs.editFormRef[2].$refs.editProRef2.validate(valid2 => {
// if (valid0 && valid1 && valid2) {
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
var
deleteAttrList
=
[
'descImgList'
,
'describeTxt'
]
var
deleteAttrList
=
[
'descImgList'
,
'describeTxt'
,
'specificationList'
]
var
priceList
=
[
'retailPrice'
,
'originalPrice'
,
'supplyPrice'
,
'expressFee'
]
if
(
this
.
routeInfo
.
addOrEdit
==
2
)
{
params
.
id
=
this
.
routeInfo
.
id
...
...
@@ -1000,19 +1005,15 @@ export default {
delete
params
[
item
]
})
console
.
log
(
params
)
// this.$apis.zoneList.insertZoneApi(params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleCancel()
// }
// })
// }
// })
// })
// })
this
.
$apis
.
proManage
.
insertOrUpdateProApi
(
params
).
then
(
res
=>
{
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
'操作失败'
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
})
if
(
res
.
code
==
'0'
)
{
this
.
handleCancel
()
}
})
},
handleCancel
()
{
this
.
$router
.
push
({
...
...
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