Commit 9b3d931c by chenwq

feat(商品订单): 添加门店列表筛选功能并完善表单验证

在商品订单页面添加门店列表下拉筛选功能,替换原有的输入框形式
新增获取门店列表的API接口并在页面加载时调用
同时完善商城配置页面的表单验证逻辑,增加必填项校验和错误提示
1 parent 63ac1305
...@@ -95,6 +95,15 @@ const goodsUpdatePoinnt = params => { ...@@ -95,6 +95,15 @@ const goodsUpdatePoinnt = params => {
returnAll: true returnAll: true
}) })
} }
// 门店列表
const getCurMerList = params => {
params.method = `scrm.api.shopmall.points.order.merchant.lis`
return http({
url,
data: params,
sign: true
})
}
// 订单列表 // 订单列表
const getOrderList = params => { const getOrderList = params => {
...@@ -314,6 +323,7 @@ export default { ...@@ -314,6 +323,7 @@ export default {
goodsDetailApi, goodsDetailApi,
modifyPriceApi, modifyPriceApi,
goodsUpdatePoinnt, goodsUpdatePoinnt,
getCurMerList,
getOrderList, getOrderList,
getOrderDetail, getOrderDetail,
subOrderExpress, subOrderExpress,
......
...@@ -133,9 +133,11 @@ export default { ...@@ -133,9 +133,11 @@ export default {
}, },
{ {
label: '门店字段', label: '门店字段',
name: 'merchantName', name: 'merchantId',
type: 'input', type: 'select',
isClear: true optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName'
}, },
{ {
label: '下单时间', label: '下单时间',
...@@ -281,7 +283,9 @@ export default { ...@@ -281,7 +283,9 @@ export default {
SelectDialog SelectDialog
}, },
mounted() { }, mounted() {
this.getCurMerList()
},
methods: { methods: {
transfStatus: util.transfStatus, transfStatus: util.transfStatus,
...@@ -293,6 +297,17 @@ export default { ...@@ -293,6 +297,17 @@ export default {
this.orderFormObj.requestType = id this.orderFormObj.requestType = id
this.handleSearch() this.handleSearch()
}, },
getCurMerList() {
this.$apis.platformGoods.getCurMerList({ pageSize: 9999, currentPage: 1 }).then(res => {
console.log(res)
this.orderFormData[3].optionList = res.list
this.orderFormData[3].optionList.unshift({
merchantId: '',
merchantName: '全部'
})
})
},
handleReset() { handleReset() {
this.orderFormObj = { this.orderFormObj = {
customerInfo: '', customerInfo: '',
......
...@@ -196,7 +196,7 @@ export default { ...@@ -196,7 +196,7 @@ export default {
linkValue: '', linkValue: '',
sortOrder: this.editForm[targetItem.name].length + 1 sortOrder: this.editForm[targetItem.name].length + 1
}) })
this.$refs.editFormRef[1].$refs.editProRef1.validateField(targetItem.name) // this.$refs.editFormRef[1].$refs.editProRef1.validateField(targetItem.name)
}) })
} }
} }
...@@ -213,6 +213,11 @@ export default { ...@@ -213,6 +213,11 @@ export default {
] ]
} }
], ],
eventEditRule: {
entryImage: [{ required: true, message: '请选择专场入口图', trigger: 'change' }],
bannerImage: [{ required: true, message: '请选择专场Banner图', trigger: 'change' }],
goodsIdList: [{ required: true, message: '请选择商品', trigger: 'change' }]
},
eventEditFormData: [ eventEditFormData: [
{ {
label: '专场入口图:', label: '专场入口图:',
...@@ -227,7 +232,7 @@ export default { ...@@ -227,7 +232,7 @@ export default {
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => { this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm.specialEvents[this.bannerIdx][targetItem.name] = res this.editForm.specialEvents[this.bannerIdx][targetItem.name] = res
// this.$refs.editFormRef[2].$refs.editProRef2.validateField(targetItem.name) // this.$refs.eventEditFormRef.$refs.eventEditChildRef.validateField(targetItem.name)
}) })
} }
}, },
...@@ -406,13 +411,43 @@ export default { ...@@ -406,13 +411,43 @@ export default {
// 商品选择-end // 商品选择-end
handleConfirm() { handleConfirm() {
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
if (!params.mallBannerList.length) {
this.$message.error('请选择商城banner图')
return true
}
let flag = false
let eventNameList = []
params.specialEvents.forEach((item, idx) => { params.specialEvents.forEach((item, idx) => {
if (!item.entryImage) {
if (!eventNameList.includes(item.eventName)) {
eventNameList.push(item.eventName)
}
flag = true
}
if (!item.bannerImage) {
if (!eventNameList.includes(item.eventName)) {
eventNameList.push(item.eventName)
}
flag = true
}
if (item.specialEventGoodsList.length == 0) {
if (!eventNameList.includes(item.eventName)) {
eventNameList.push(item.eventName)
}
flag = true
}
params.specialEvents[idx].sortOrder = idx params.specialEvents[idx].sortOrder = idx
params.specialEvents[idx].specialEventGoodsList.forEach((subItme, subIdx) => { params.specialEvents[idx].specialEventGoodsList.forEach((subItme, subIdx) => {
params.specialEvents[idx].specialEventGoodsList[subIdx].sortOrder = subIdx params.specialEvents[idx].specialEventGoodsList[subIdx].sortOrder = subIdx
}) })
}) })
console.log(params) console.log(params)
if (eventNameList.length) {
this.$message.error("专区" + eventNameList.join('、') + "信息有缺失")
return true
}
this.$apis.mallConfig.insertOrUpdateMallmini(params).then(res => { this.$apis.mallConfig.insertOrUpdateMallmini(params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!