Commit 425265c0 by 胡悦

fix(CreateOrder): 修复订单创建逻辑并添加拦截混入

refactor(sprite): 优化图标样式文件结构并移除无用图标
1 parent 0f5a5a93

2.61 MB | W: | H:

2.61 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -46,8 +46,10 @@ import Product from './Product.vue' ...@@ -46,8 +46,10 @@ import Product from './Product.vue'
import Package from './Package.vue' import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue' import SkuGoods from './SkuGoods.vue'
import { FORM_LIST, popupTypeEnum, payTypeList } from '../contant' import { FORM_LIST, popupTypeEnum, payTypeList } from '../contant'
import { interceptionMixin } from '@/mixin/index'
export default { export default {
name: 'CreateOrder', name: 'CreateOrder',
mixins: [interceptionMixin],
components: { components: {
GlCell, GlCell,
OrderPopup, OrderPopup,
...@@ -82,7 +84,7 @@ export default { ...@@ -82,7 +84,7 @@ export default {
}) })
return return
} }
// 编辑和修改订单进入这里
// 新增订单处理 // 新增订单处理
const { paramsData: { customer, customerCoupon, ...rest } } = newVal const { paramsData: { customer, customerCoupon, ...rest } } = newVal
...@@ -94,7 +96,7 @@ export default { ...@@ -94,7 +96,7 @@ export default {
Object.assign(this.orderObj, Object.fromEntries(baseFields.map(field => [field, rest[field]]))) Object.assign(this.orderObj, Object.fromEntries(baseFields.map(field => [field, rest[field]])))
// 设置支付类型 // 设置支付类型
this.orderObj.payeeType = rest.selectPayType === '2' ? '1' : '0' this.orderObj.payeeType = rest.selectPayType == '2' ? '1' : '0'
// 客户信息映射 // 客户信息映射
const customerFields = ['customerName', 'customerSex', 'customerPhone', 'salesType', const customerFields = ['customerName', 'customerSex', 'customerPhone', 'salesType',
...@@ -143,10 +145,10 @@ export default { ...@@ -143,10 +145,10 @@ export default {
] ]
formUpdates.forEach(([index, field, value]) => updateFormCell(index, field, value)) formUpdates.forEach(([index, field, value]) => updateFormCell(index, field, value))
// 商品回显,在获取商品列表之后
this.goodsList = rest.subOrderList this.goodsList = rest.subOrderList
} }
console.log(this.orderObj, 'orderObj')
handleTransactionData(newVal) handleTransactionData(newVal)
} }
}, },
...@@ -155,7 +157,7 @@ export default { ...@@ -155,7 +157,7 @@ export default {
}, },
data() { data() {
return { return {
orderCreateType: 'createWithPay', // supplementOrder(补录订单) createWithPay(新增) editWithPay(编辑、修改) orderCreateType: 'createWithPay', // supplementOrder(补录订单) createWithPay(新增)
formList: utils.deepClone(FORM_LIST), formList: utils.deepClone(FORM_LIST),
userInfo: {}, userInfo: {},
baseConfigData: {}, baseConfigData: {},
...@@ -208,8 +210,6 @@ export default { ...@@ -208,8 +210,6 @@ export default {
console.log('mounted', this.orderCreateType) console.log('mounted', this.orderCreateType)
this.userInfo = uni.$storage.get('userInfo') || {} this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {} this.baseConfigData = uni.$storage.get('mock_data') || {}
const { userInfo } = this
this.initData() this.initData()
}, },
methods: { methods: {
...@@ -412,6 +412,7 @@ export default { ...@@ -412,6 +412,7 @@ export default {
async submit() { async submit() {
console.log(this.orderObj) console.log(this.orderObj)
if (!this.checkRequired()) return if (!this.checkRequired()) return
if (!await this.checkDailyReport()) {
const { orderCreateType } = this const { orderCreateType } = this
const obj = utils.deepClone(this.orderObj) const obj = utils.deepClone(this.orderObj)
const otherCustomer = ['standNo', 'plateNumber', 'customerSex', 'experienceFlag', 'salesType'] const otherCustomer = ['standNo', 'plateNumber', 'customerSex', 'experienceFlag', 'salesType']
...@@ -488,6 +489,7 @@ export default { ...@@ -488,6 +489,7 @@ export default {
}) })
this.$emit('jump', orderCreateType == 'supplementOrder' ? 'OrderDetail' : 'ConfirmOrder', res) this.$emit('jump', orderCreateType == 'supplementOrder' ? 'OrderDetail' : 'ConfirmOrder', res)
} }
}
}, },
// 计算所有产品的总价 // 计算所有产品的总价
changeTotalPrice() { changeTotalPrice() {
...@@ -500,6 +502,7 @@ export default { ...@@ -500,6 +502,7 @@ export default {
// 计算每个产品的价格 * 数量,并累加到总价 // 计算每个产品的价格 * 数量,并累加到总价
productList.forEach(item => { productList.forEach(item => {
if (item.goods && item.goods.sellPrice && item.goods.number) { if (item.goods && item.goods.sellPrice && item.goods.number) {
console.log(item.goods, '---单商品')
total += parseFloat(item.goods.sellPrice) * parseInt(item.goods.number) total += parseFloat(item.goods.sellPrice) * parseInt(item.goods.number)
} else if (item.packageGoods && item.packageGoods.upgradePrice && item.packageGoods.number) { } else if (item.packageGoods && item.packageGoods.upgradePrice && item.packageGoods.number) {
console.log(item.packageGoods, '套餐') console.log(item.packageGoods, '套餐')
...@@ -511,8 +514,9 @@ export default { ...@@ -511,8 +514,9 @@ export default {
item.packageGoods.goodsList.forEach(i => { item.packageGoods.goodsList.forEach(i => {
total += parseFloat(i.sellPrice) * parseInt(item.packageGoods.number) total += parseFloat(i.sellPrice) * parseInt(item.packageGoods.number)
}) })
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice && item.multipleSpecificationsGoods.number) { } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) {
total += parseFloat(item.multipleSpecificationsGoods.goods.sellPrice) * parseInt(item.multipleSpecificationsGoods.number) console.log(item.multipleSpecificationsGoods, '多规格')
total += parseFloat(item.multipleSpecificationsGoods.goods.sellPrice) * parseInt(item.multipleSpecificationsGoods.number||1)
} }
}) })
} }
...@@ -527,9 +531,14 @@ export default { ...@@ -527,9 +531,14 @@ export default {
const res = await uni.$api.boutiqueApi.getLastUserOrderInfo({ const res = await uni.$api.boutiqueApi.getLastUserOrderInfo({
sellerUserId: this.userInfo.subLoginUser.uuid sellerUserId: this.userInfo.subLoginUser.uuid
}) })
console.log(this.orderObj.merchantId)
if (this.orderObj.merchantId == res.merchantId) {
this.$set(this.orderObj, 'employeeName', res.employeeName) this.$set(this.orderObj, 'employeeName', res.employeeName)
this.orderObj.userId = res.userId this.orderObj.userId = res.userId
console.log(res, '上一个订单的销售顾问信息') console.log(res, '上一个订单的销售顾问信息')
} else {
this.getEmployeeList()
}
}, },
async getShopMerchantPointConfig(merchantId) { async getShopMerchantPointConfig(merchantId) {
const res = await uni.$api.boutiqueApi.getShopMerchantPointConfig({ merchantId }) const res = await uni.$api.boutiqueApi.getShopMerchantPointConfig({ merchantId })
...@@ -631,8 +640,8 @@ export default { ...@@ -631,8 +640,8 @@ export default {
}) })
if (data && data.length) { if (data && data.length) {
this.employeeList = data this.employeeList = data
// this.$set(this.orderObj, 'employeeName', data[0].staffName) this.$set(this.orderObj, 'employeeName', data[0].staffName)
// this.orderObj.userId = data[0].uuid this.orderObj.userId = data[0].uuid
} }
}, },
async getPositionList() { async getPositionList() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!