Commit 5aacd85a by cen

fix: 修改编辑工单类型值

1 parent 873855b1
...@@ -236,7 +236,7 @@ export default { ...@@ -236,7 +236,7 @@ export default {
? this.showSelectType({ ? this.showSelectType({
item item
}) })
: this.$emit('jump', name, { paramsData: this.orderCardDetail, type: name == 'CreateOrder' ? 'createWithPay' : '' }) : this.$emit('jump', name, { paramsData: this.orderCardDetail, type: 'createWithPay' })
} else { } else {
utils.showNoAccess() utils.showNoAccess()
} }
......
...@@ -386,7 +386,7 @@ export default { ...@@ -386,7 +386,7 @@ export default {
} }
// 商品是否包含太阳膜 // 商品是否包含太阳膜
data.isFilmOrder = data.subOrderList?.findIndex(subE => subE?.upgradeGoodsType == 1) > -1 data.isFilmOrder = data.subOrderList?.findIndex(subE => subE?.upgradeGoodsType == 1) > -1
this.$emit('jump', 'CreateOrder', { paramsData: data, type: 'editWithPay' }) this.$emit('jump', 'CreateOrder', { paramsData: data, type: 'createWithPay' })
}, },
confirmDate(date) { confirmDate(date) {
const { chooseContent } = date const { chooseContent } = date
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<Product :key="slotName" v-if="orderObj[slotName] && orderObj[slotName].length" @changeTotalPrice="changeTotalPrice" :list="orderObj[slotName]" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product> <Product :key="slotName" v-if="orderObj[slotName] && orderObj[slotName].length" @changeTotalPrice="changeTotalPrice" :list="orderObj[slotName]" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></Product>
</template> </template>
<template slot="package"> <template slot="package">
<Package v-if="orderObj.package" :list="orderObj.package" :positionTypeList="positionTypeList"></Package> <Package v-if="orderObj.package" @changeTotalPrice="changeTotalPrice" :list="orderObj.package" :positionTypeList="positionTypeList"></Package>
</template> </template>
<template slot="skuGoods"> <template slot="skuGoods">
<SkuGoods v-if="orderObj.skuGoods" :list="orderObj.skuGoods" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></SkuGoods> <SkuGoods v-if="orderObj.skuGoods" :list="orderObj.skuGoods" @changeTotalPrice="changeTotalPrice" :positionTypeList="positionTypeList" :baseConfigData="baseConfigData"></SkuGoods>
<view class="total" v-if="totalPrice > 0"> <view class="total" v-if="totalPrice > 0">
<view class="total-left">总价</view> <view class="total-left">总价</view>
<view class="total-right">¥{{ totalPrice }}</view> <view class="total-right">¥{{ totalPrice }}</view>
...@@ -68,8 +68,71 @@ export default { ...@@ -68,8 +68,71 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
console.log('接收到的交易数据:', newVal) console.log('接收到的交易数据:', newVal)
// this.orderObj.customer = newVal.customer // 处理交易数据
this.$set(this.orderObj, 'customer', newVal.customer) const handleTransactionData = newVal => {
this.orderCreateType = newVal.type
// 新增订单处理
const {
paramsData: { customer, customerCoupon, ...rest }
} = newVal
// 基础字段映射
const baseFields = ['id', 'orderCode', 'userId', 'employeeName', 'deliveryEmployeeName', 'deliveryUserId', 'subShopMerchantName', 'subShopMerchantId', 'sellerName', 'sellerUserId', 'sellerMerchantName', 'sellerMerchantId', 'merchantId', 'merchantName', 'customerCouponId', 'selectPayType']
Object.assign(this.orderObj, Object.fromEntries(baseFields.map(field => [field, rest[field]])))
// 设置支付类型
this.orderObj.payeeType = rest.selectPayType === '2' ? '1' : '0'
// 客户信息映射
const customerFields = ['customerName', 'customerSex', 'customerPhone', 'salesType', 'standNo', 'plateNumber', 'experienceFlag']
Object.assign(this.orderObj, Object.fromEntries(customerFields.map(field => [field, customer[field]])))
// 优惠券信息
const { couponName, customerCouponCode } = customerCoupon
Object.assign(this.orderObj, {
couponName,
customerCouponCode,
couponInfo: couponName + customerCouponCode
})
// 车辆信息
this.orderObj.customer = {
carBrand: customer.carBrand,
carBrandId: customer.carBrandId,
carChildsBrandId: customer.carChildsBrandId,
carChildsBrandName: customer.carChildsBrandName,
carSeriesId: customer.carSeriesId,
carSeriesName: customer.carSeriesName,
customerPhone: customer.customerPhone,
standNo: customer.standNo,
plateNumber: customer.plateNumber,
customerSex: customer.customerSex,
experienceFlag: customer.experienceFlag,
salesType: customer.salesType,
customerName: customer.customerName
}
this.orderObj.carBrand = `${customer.carBrand}-${customer.carChildsBrandName}-${customer.carSeriesName}`
// 更新表单状态
const updateFormCell = (formIndex, fieldName, value) => {
const cell = this.formList[formIndex].find(item => item.value === fieldName)
if (cell) cell.current = value
}
const formUpdates = [
[1, 'salesType', customer.salesType],
[1, 'customerSex', customer.customerSex],
[1, 'experienceFlag', customer.experienceFlag],
[2, 'selectPayType', this.orderObj.selectPayType],
[2, 'payeeType', this.orderObj.payeeType]
]
formUpdates.forEach(([index, field, value]) => updateFormCell(index, field, value))
this.goodsList = rest.subOrderList
}
handleTransactionData(newVal)
} }
}, },
immediate: true immediate: true
...@@ -88,11 +151,13 @@ export default { ...@@ -88,11 +151,13 @@ export default {
experienceFlag: 'Y', experienceFlag: 'Y',
payeeType: 1, payeeType: 1,
salesType: '0', salesType: '0',
frontGear: null, frontGear: null, // 1 ,回显upgradeGoodsPosition == 1
frontWindow: null, frontWindow: null, // 2
rearWindow: null, rearWindow: null, // 3
rearGear: null, rearGear: null, // 4
sunRoof: null sunRoof: null, // 5, 6,7
package: null,
skuGoods: null // upgradeGoodsPosition 为空,则是其他精品单商品
}, // 弹窗传入的数据}, }, // 弹窗传入的数据},
popupType: 0, popupType: 0,
popupTypeEnum, popupTypeEnum,
...@@ -131,6 +196,12 @@ export default { ...@@ -131,6 +196,12 @@ export default {
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 const { userInfo } = this
this.initData()
},
methods: {
initData() {
const { userInfo } = this
if (!this.orderObj.id) {
// 在原有的 orderObj 对象上新增这些属性 // 在原有的 orderObj 对象上新增这些属性
Object.assign(this.orderObj, { Object.assign(this.orderObj, {
sellerMerchantName: userInfo.merchantName, sellerMerchantName: userInfo.merchantName,
...@@ -140,14 +211,11 @@ export default { ...@@ -140,14 +211,11 @@ export default {
merchantId: userInfo.shopMerchantId, merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName merchantName: userInfo.shopMerchantName
}) })
this.initData() }
},
methods: {
initData() {
const { userInfo } = this
this.getShopMerchantPointConfig(userInfo.shopMerchantId) this.getShopMerchantPointConfig(userInfo.shopMerchantId)
this.getSubShopMerchantList(userInfo.shopMerchantId) this.getSubShopMerchantList(userInfo.shopMerchantId)
this.getSetting() this.getSetting()
this.getConfig() this.getConfig()
this.getConfigList() this.getConfigList()
// this.getEmployeeList() // this.getEmployeeList()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!