Commit a30877b4 by 前端

Merge branch 'SAAS+V4.49.2-0225' into 'master'

上线合并

See merge request !24
2 parents 6c2efa41 841e22a5
......@@ -142,4 +142,9 @@ const getMerchantList = params => {
sign: true
})
}
export { getRulesData, getRulesListData, guestComTotal, isOpenUpgrade, isOpenInsurance, orderTotal, couponsTotal, couponsTotalByDay, moneyTotal, findCoupons, findupGradeOrder, newFindupGradeOrder, checkCoupons, mydivision, exportMydivision, exportUpgrade, exportInsurance, exportCoupons, getEmployName, checkDetail, orderTotalOfJT, orderTotalNumOfJT, myAccountTotalNumOfJT, get4SList, introConpute, getMerchantList }
// 获取店面配置数据
const getMerchantSetting = () => {
let method = `dj.api.smartcarlife.serviceMerchant.getSubAndShopSetting`
return method
}
export { getRulesData, getRulesListData, guestComTotal, isOpenUpgrade, isOpenInsurance, orderTotal, couponsTotal, couponsTotalByDay, moneyTotal, findCoupons, findupGradeOrder, newFindupGradeOrder, checkCoupons, mydivision, exportMydivision, exportUpgrade, exportInsurance, exportCoupons, getEmployName, checkDetail, orderTotalOfJT, orderTotalNumOfJT, myAccountTotalNumOfJT, get4SList, introConpute, getMerchantList, getMerchantSetting }
......@@ -16,6 +16,31 @@ import '@/filter'
import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.directive('preventReClick', {
bind: (el, binding) => {
let time = binding.value // 防抖时间
if (!time) {
// 用户若不设置防抖时间,则默认1s
time = 1000
}
let fun
el.addEventListener(
'click',
event => {
if (!fun) {
// 第一次执行
fun = setTimeout(() => {
fun = null
}, time)
} else {
// 直接取消当前事件
event && event.stopImmediatePropagation()
}
},
true
)
}
})
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
......
......@@ -251,7 +251,7 @@
<!-- 改装件信息 -->
<div v-if="(refitFormObj.customFlag && equityRadio == '2') || (refitFormObj.autoFlag && equityRadio == '1') || refitFormObj.showFlag" class="container m-t-10">
<p class="edit-title">改装件信息</p>
<div style="padding: 20px 20px 1px;"><glsx-combi-form ref="refitRef" :isEdit="true" :isInline="false" defaultWidth="320px" :formObj="refitFormObj" :formData="refitFormData" :formRules="refitRules"></glsx-combi-form></div>
<div style="padding: 20px 20px 1px"><glsx-combi-form ref="refitRef" :isEdit="true" :isInline="false" defaultWidth="320px" :formObj="refitFormObj" :formData="refitFormData" :formRules="refitRules"></glsx-combi-form></div>
</div>
<!-- 其他信息 -->
......@@ -273,7 +273,7 @@
<div class="mar-10"></div>
<el-button plain v-if="![3, 5].includes(routeInfo.addOrEdit)" @click="handleDraft">草稿</el-button>
<div class="mar-10"></div>
<el-button v-if="routeInfo.addOrEdit != '5'" type="primary" @click="checkRefitInfo()">{{ routeInfo.addOrEdit != '3' ? '提单' : '确定' }}</el-button>
<el-button v-if="routeInfo.addOrEdit != '5'" type="primary" @click="checkRefitInfo()" v-preventReClick>{{ routeInfo.addOrEdit != '3' ? '提单' : '确定' }}</el-button>
<div class="mar-10"></div>
</div>
</div>
......@@ -286,8 +286,8 @@
<el-tab-pane v-for="item in tabsList" :key="item.name" :label="item.label" :name="item.name"></el-tab-pane>
</el-tabs>
</div>
<secondDialog v-if="secondVisible" :secondVisible="secondVisible" :formRules="editRuleCar" :editForm="editForm" @handleSecondClose="handleSecondClose" @handleSecondOk="handleSecondOk"></secondDialog>
<secondDialog v-if="secondVisible" :secondVisible="secondVisible" :formRules="editRuleCar" :editForm="editForm" @handleSecondClose="handleSecondClose" @handleSecondOk="handleSecondOk"></secondDialog>
</div>
</template>
......@@ -337,7 +337,7 @@ export default {
size: 'small',
submit: false,
isBlock: true,
secondVisible: false,
secondVisible: false,
curDom: 'cardInfo',
tabsList: [
{ label: '车辆信息', name: 'cardInfo' },
......@@ -994,7 +994,7 @@ export default {
qrCode,
uploadInfo,
FormatInput,
secondDialog
secondDialog
},
async created() {
......@@ -1870,7 +1870,7 @@ export default {
if (res?.vehicle?.invoicePrice && this.editForm.orderStatus != 2) {
// 调用详情后先过滤一边定制权益商品
let autoList = this.packageToPrice(res.vehicle.invoicePrice, true) || []
productArrData = autoList.concat(this.productList)
productArrData = autoList.concat(this.productList)
}
this.editForm.packageCode && this.packageAttr(true, productArrData, res)
const spaItem = this.baseData.agreeList.find(item => item.id == this.editForm.specialAppointId)
......@@ -1956,21 +1956,63 @@ export default {
}
}
})
this.customProductList = _list
console.log(_list, '_list')
let list2 = []
if (this.editForm.vehicle.vehicleSeriesId) {
let cartype = this.editForm.vehicle.vehicleSeriesId
// let _price = this.editForm.vehicle.invoicePrice
_list.forEach(item => {
// 套餐商品不做过滤 没有这个字段也给全部默认显示
if (item.parentId || !item.vehicleSeriesConfigs || (item.vehicleSeriesConfigs && item.vehicleSeriesConfigs.some(ele => ele.vehicleSeriesId == cartype))) {
list2.push(item)
} else {
if (this.autoPackageCodeList.includes(item.packageCode)) {
this.changeRaido(false, item, true)
}
}
})
} else {
list2 = _list
}
console.log(list2, '_list')
this.customProductList = list2
if (formDetail) return _list
}
// var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode)
// this.editForm.suggestedSellingPrice = ''
// if (this.editForm.vehicle.invoicePrice) {
// var invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(2)
// targetItem &&
// targetItem.servicePackagePrices.forEach(item => {
// if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) {
// this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2)
// this.editForm.actualSalesPrice = (item.retailPrice / 100).toFixed(2)
// }
// })
// }
},
packageToCarType() {
let cartype = this.editForm.vehicle.vehicleSeriesId
let _price = this.editForm.vehicle.invoicePrice
if ((cartype || _price) && this.editForm.orderStatus != 2) {
let _list = []
this.copyCustomProductList.forEach(item => {
// 套餐商品不做过滤 没有这个字段也给全部默认显示
if (item.parentId || !item.vehicleSeriesConfigs || (item.vehicleSeriesConfigs && item.vehicleSeriesConfigs.some(ele => ele.vehicleSeriesId == cartype))) {
_list.push(item)
} else {
if (this.autoPackageCodeList.includes(item.packageCode)) {
this.changeRaido(false, item, true)
}
}
})
console.log(_list, '_list')
let list2 = []
if (this.editForm.vehicle.invoicePrice) {
// let _price = this.editForm.vehicle.invoicePrice
_list.forEach(item => {
// 套餐商品不做过滤
if (item.parentId || !item.carHighestPrice || (item.carHighestPrice && _price <= NP.divide(item.carHighestPrice || 0, 100) && _price >= NP.divide(item.carLowestPrice || 0, 100))) {
list2.push(item)
} else {
if (this.autoPackageCodeList.includes(item.packageCode)) {
this.changeRaido(false, item, true)
}
}
})
} else {
list2 = _list
}
this.customProductList = list2
}
},
packageAttr(recovery = false, productArrData, detailInfo) {
// 2023 7月底版本 改版
......@@ -1978,7 +2020,7 @@ export default {
packCode = []
detailInfo.attributes.forEach(item => {
let targetItem = productArrData.find(k => k.packageCode == item.packageCode)
if(targetItem){
if (targetItem) {
if (targetItem && item.parentId) {
targetItem.parentId = item.parentId
targetItem.parentName = item.parentName
......@@ -2105,7 +2147,6 @@ export default {
this.showUploadInfo = true
}
}
packCode.push(item.packageCode)
const _curProdTarget = this.allProdList.find(el => el.packageCode == item.packageCode)
......@@ -2304,6 +2345,7 @@ export default {
this.$apis.beforeSale.getCarTypeListApi(params).then(res => {
this.baseData.carTypeOptions = res || []
})
this.packageToCarType(this.editForm.vehicle.vehicleSeriesId)
},
// 跳转
whereToGo(id) {
......@@ -2506,20 +2548,20 @@ export default {
}
return isEmpty
},
secondChange() {
this.secondVisible = !this.secondVisible
},
handleSecondClose() {
this.secondChange()
this.submit = false
this.params = {}
},
handleSecondOk(val) {
this.secondChange()
this.editForm.vehicle.vin = val
this.params.vehicle.vin = val
this.api()
},
secondChange() {
this.secondVisible = !this.secondVisible
},
handleSecondClose() {
this.secondChange()
this.submit = false
this.params = {}
},
handleSecondOk(val) {
this.secondChange()
this.editForm.vehicle.vin = val
this.params.vehicle.vin = val
this.api()
},
checkRefitInfo() {
if (this.$refs?.refitRef?.$refs?.formRef) {
this.$refs?.refitRef?.$refs.formRef.validate(valid => {
......@@ -2531,26 +2573,26 @@ export default {
this.handleConfirm()
}
},
api() {
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') {
this.updateEquity(this.params)
} else {
this.submit = false
this.$confirm(res.message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.submit = true
this.updateEquity(this.params)
}
api() {
this.$apis.beforeSale.checkOrderApi({ vin: this.editForm.vehicle.vin, contractNo: this.routeInfo.contractNo || '' }).then(res => {
if (res.code == '0') {
this.updateEquity(this.params)
} else {
this.submit = false
this.$confirm(res.message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.submit = true
this.updateEquity(this.params)
}
})
}
})
},
}
})
}
})
},
handleConfirm() {
try {
this.vaildGlassParams()
......@@ -2613,8 +2655,8 @@ export default {
params.attachmentList = this.attachmentList || []
}
params.attachmentList = params.attachmentList || []
this.params = this.$common.utils.deepClone(params)
this.secondChange()
this.params = this.$common.utils.deepClone(params)
this.secondChange()
} catch (error) {
console.log(error)
this.submit = false
......
......@@ -197,7 +197,7 @@
</template>
<script>
import { findupGradeOrder, newFindupGradeOrder, exportUpgrade, exportInsurance, checkDetail, orderTotalNumOfJT, getMerchantList } from '../../api/modules/rules'
import { findupGradeOrder, newFindupGradeOrder, exportUpgrade, exportInsurance, checkDetail, orderTotalNumOfJT, getMerchantList, getMerchantSetting } from '../../api/modules/rules'
import { converterApi } from '../../api/modules/converter'
import utils from '../../util/util'
const logTypeList = ['预录用户', '用户下单', '用户付款', '完成服务']
......@@ -459,6 +459,30 @@ export default {
width: '200',
disabled: false
},
{
label: '车架号',
value: 'standNo',
level: 1,
enumId: 'standNo',
width: '200',
disabled: false
},
{
label: '车牌号',
value: 'plateNumber',
level: 1,
enumId: 'plateNumber',
width: '120',
disabled: false
},
{
label: '车型',
value: 'carTypeName',
level: 1,
enumId: 'carTypeName',
width: '120',
disabled: false
},
// {
// value: 'customerPhone',
// label: '客户手机号',
......@@ -759,17 +783,26 @@ export default {
this.handlerNewTableCoulum(newvalue)
}
},
created() {
async created() {
const { session } = this.$globalState
this.accountLevel = session.accountLevel
this.merchantId = session.merchantId
this.isAdmin = session.admin
let temp = JSON.parse(localStorage.getItem(`${this.pageName == 'insurance' ? 'in' : ''}menuList${session.merchantId}`))
if (temp) {
this.tableCoulumList = temp
} else {
this.tableCoulumList = this.fieldList
let res = await converterApi({
routerMethod: getMerchantSetting(),
// merchantId: this.merchantId,
// sceneType: this.pageName == 'insurance' ? 0 : 1
})
// 商品成本设置不可见
if (res?.costPrivacyShowFlag != 'Y') {
this.fieldList?.splice(this.fieldList?.findIndex(item => item.value == 'goodsCost'), 1)
}
// if (temp) {
// // this.tableCoulumList = temp // 有动态值,不取缓存内容
// } else {
this.tableCoulumList = this.fieldList
// }
// 1.工厂 2省代 3市代 4门店
if (session.accountLevel < 4) {
this.getMerchanListData(session.accountLevel)
......@@ -813,7 +846,7 @@ export default {
methods: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// column没有prop,只能用label判断
const mergeColNameList = ['序号', '主订单编号', '交易参考号', '客户姓名', '转化员姓名', '销售顾问', '支付方式', '支付时间', '分账对象', '二级流量方', '整单规则', `流量费/元`, '分账类型', '操作']
const mergeColNameList = ['序号', '主订单编号', '交易参考号', '客户姓名', '车架号', '车牌号', '车型', '转化员姓名', '销售顾问', '支付方式', '支付时间', '分账对象', '二级流量方', '整单规则', `流量费/元`, '分账类型', '操作']
return {
rowspan: mergeColNameList.includes(column.label) ? row.rowspan : column.label == '套餐规则' ? row.setMealRowspan : 1,
colspan: 1
......@@ -911,7 +944,7 @@ export default {
}
},
setClass({ row, column, rowIndex, columnIndex }) {
const mergeColNameList = ['主订单编号', '交易参考号', '客户姓名', '转化员姓名', '销售顾问', '支付方式', '支付时间', '分账对象', '二级流量方', '整单规则', `流量费/元`, '分账类型']
const mergeColNameList = ['主订单编号', '交易参考号', '客户姓名', '车架号', '车牌号', '车型', '转化员姓名', '销售顾问', '支付方式', '支付时间', '分账对象', '二级流量方', '整单规则', `流量费/元`, '分账类型']
if (columnIndex == 1) return 'add-right-border'
return (mergeColNameList.includes(column.label) && row.rowspan > 1) || (column.label == '套餐规则' && row.setMealRowspan > 1) ? 'add-border' : ''
},
......@@ -1138,6 +1171,7 @@ export default {
routerMethod: method,
pageNum: this.$refs.subTable.page.pageNum,
pageSize: this.$refs.subTable.page.pageSize,
merchantIdsStr: this.merchantId,
...this.newHttpParam
}
converterApi(para).then(res => {
......@@ -1161,7 +1195,8 @@ export default {
if ((thirdPartyCost || djCost) && this.pageName == 'insurance') {
_goodsCost = (thirdPartyCost || 0) + (djCost || 0)
}
const types = [item.carBrand, item.carChildsBrandName, item.carSeriesName]
const result = types.filter(type => type).join('-')
const _obj = {
...item,
tableNum: _idx + (para.pageNum - 1) * para.pageSize + 1,
......@@ -1182,7 +1217,8 @@ export default {
setMealRule: `${setMealRuleType}${!setMealRuleObj.shopTrafficMoneyCalculateType ? '' : setMealRuleObj.shopTrafficMoneyCalculateValue}${!setMealRuleObj.shopTrafficMoneyCalculateType ? '' : setMealRuleObj.shopTrafficMoneyCalculateType == 3 ? '元' : '%'}`,
divisionTypeName: item.divisionType == 1 ? '线下对账' : '线上分账',
payTypeName: PAYTYPEOBJ[item.payType],
paySuccessDate: utils.dateFormat(item.paySuccessDate, 'YYYY-MM-DD HH:mm:ss')
paySuccessDate: utils.dateFormat(item.paySuccessDate, 'YYYY-MM-DD HH:mm:ss'),
carTypeName: result // 车型使用主品牌-子品牌-车系
}
// 按固定金额*购买数量特殊处理
if (shopTrafficMoneyCalculateType == 10) {
......@@ -1261,7 +1297,8 @@ export default {
let para = {
routerMethod: method,
...this.httpParam,
sceneType: this.pageName == 'insurance' ? 0 : 1
sceneType: this.pageName == 'insurance' ? 0 : 1,
merchantIdsStr: this.merchantId
}
if (this.pageName == 'insurance') {
para.hiddenColumnList = hiddenColumnList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!