Commit e0f3954a by 前端

Merge branch 'feat_v3.2.0' into 'master'

Feat v3.2.0

See merge request !23
2 parents d0d4a7a0 c863d181
...@@ -49,7 +49,14 @@ ...@@ -49,7 +49,14 @@
<el-checkbox-group v-model="curSelectPro" :disabled="disabled"> <el-checkbox-group v-model="curSelectPro" :disabled="disabled">
<div v-for="(item, index) in productList" :key="index" class="product_wrapper"> <div v-for="(item, index) in productList" :key="index" class="product_wrapper">
<div style="padding-left: 73px"> <div style="padding-left: 73px">
<el-checkbox @change="changeCheckBox($event, item)" :disabled="item.disabled" :label="item.packageName"></el-checkbox> <!-- <el-checkbox @change="changeCheckBox($event, item)" :disabled="item.disabled" :label="item.packageName"></el-checkbox> -->
<el-checkbox @change="changeCheckBox($event, item, index)" :label="item.packageName" :disabled="item.disabled">
<div v-if="errGlassName && item.idName == 'glass'">
{{ item.packageName }}
<span style="color: red; font-weight: normal">({{ errGlassName }})</span>
</div>
<div v-else>{{ item.packageName }}</div>
</el-checkbox>
</div> </div>
<!-- 属性 --> <!-- 属性 -->
...@@ -482,7 +489,8 @@ export default { ...@@ -482,7 +489,8 @@ export default {
crash: {}, crash: {},
stolen: {}, stolen: {},
tire: {}, tire: {},
vip: {} vip: {},
glass: {}
}, },
// 其他信息 // 其他信息
editRuleOther: { editRuleOther: {
...@@ -685,13 +693,17 @@ export default { ...@@ -685,13 +693,17 @@ export default {
pickerOptions: {}, pickerOptions: {},
pickerOptions2: {}, pickerOptions2: {},
hotline: '', hotline: '',
compensationNameDisable: false compensationNameDisable: false,
errGlassName: ''
} }
}, },
watch: { watch: {
'editForm.vehicle.invoicePrice'(newValue, oldValue) { 'editForm.vehicle.invoicePrice'(newValue, oldValue) {
this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000) this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000)
if (this.currentVaildItem) {
this.vailGlassPackage(this.currentVaildItem, this.currentVaildIndex)
}
}, },
'editForm.actualSalesPrice'(newValue, oldValue) { 'editForm.actualSalesPrice'(newValue, oldValue) {
this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2) this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2)
...@@ -782,8 +794,8 @@ export default { ...@@ -782,8 +794,8 @@ export default {
// item.optionList.push({ value: '5', label: '5年' }) // item.optionList.push({ value: '5', label: '5年' })
// } // }
let optionObj = { let optionObj = {
'4': { value: '4', label: '4年' }, 4: { value: '4', label: '4年' },
'5': { value: '5', label: '5年' } 5: { value: '5', label: '5年' }
} }
if (res.servicePeriod == '4' || res.servicePeriod == '5') { if (res.servicePeriod == '4' || res.servicePeriod == '5') {
const Target = item.optionList.find(item => { const Target = item.optionList.find(item => {
...@@ -818,8 +830,55 @@ export default { ...@@ -818,8 +830,55 @@ export default {
} }
}) })
}, },
// 轮胎玻璃验证车辆价格不能大于50w
vailGlassPackage(item, index) {
this.currentVaildItem = item
this.currentVaildIndex = index
let glassNameFlag = this.curSelectPro.includes(this.vailGlassName)
if (item.idName == 'glass') this.vailIndex = index
if (glassNameFlag) {
let vaild = this.editForm.vehicle.invoicePrice && Number(this.editForm.vehicle.invoicePrice) > 500000
if (vaild) {
this.productList[this.vailIndex].groupAttributeList.forEach((el, i) => {
if (el.groupName == 'actual_sales_price') this.vail_sale_price_index = i
})
this.$set(this.productList[this.vailIndex], 'disabled', true)
this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', true)
this.errGlassName = '车辆价格超过50万,无法购买'
this.vaildGlassParams()
} else {
this.errGlassName = ''
if (this.vailIndex !=undefined) this.$set(this.productList[this.vailIndex], 'disabled', false)
if (this.vail_sale_price_index) this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', false)
}
} else {
if (this.vailIndex) this.$set(this.productList[this.vailIndex], 'disabled', false)
if (this.vail_sale_price_index) this.$set(this.productList[this.vailIndex].groupAttributeList[this.vail_sale_price_index], 'disabled', false)
}
},
// 轮胎玻璃提单参数处理
vaildGlassParams(){
if(this.equityRadio == 1&&this.tempAttributeList.length&&this.packageCodeList.length&&this.errGlassName){
if( this.packageCodeList.indexOf(this.vailGlassCode)!=-1){
let arr1 = []
let arr2 = []
this.tempAttributeList.forEach(ele=>{
if(ele.packageCode!=this.vailGlassCode){
arr1.push(ele)
}
})
this.packageCodeList.forEach(ele=>{
if(ele!=this.vailGlassCode){
arr2.push(ele)
}
})
this.handleProductArrParam(arr1, arr2)
}
}
},
// 切换套餐---赋默认值 // 切换套餐---赋默认值
changeCheckBox(e, item) { changeCheckBox(e, item, index) {
this.vailGlassPackage(item, index)
if (e) { if (e) {
this.checkCodeList.push(item.packageCode) this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode) this.packageCodeList.push(item.packageCode)
...@@ -1061,7 +1120,7 @@ export default { ...@@ -1061,7 +1120,7 @@ export default {
}) })
}, },
// 获取产品的数据 // 获取产品的数据
toTestProductData(arr) { toGetProductData(arr) {
arr.forEach(item => { arr.forEach(item => {
if (item.packageName.includes('整车全损')) { if (item.packageName.includes('整车全损')) {
item.idName = 'car' item.idName = 'car'
...@@ -1080,6 +1139,12 @@ export default { ...@@ -1080,6 +1139,12 @@ export default {
item.idName = 'vip' item.idName = 'vip'
} else if (item.packageName.includes('优享版')) { } else if (item.packageName.includes('优享版')) {
item.idName = 'vip' item.idName = 'vip'
} else if (item.packageType == 1) {
item.idName = 'vip'
} else if (item.packageName.includes('玻璃')) {
this.vailGlassName = item.packageName // 备用
this.vailGlassCode = item.packageCode
item.idName = 'glass'
} }
item.disabled = false item.disabled = false
item.serviceItems = item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : '' item.serviceItems = item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : ''
...@@ -1102,17 +1167,29 @@ export default { ...@@ -1102,17 +1167,29 @@ export default {
} else if (e.attributeDesc == '购车类型') { } else if (e.attributeDesc == '购车类型') {
e.optionList = this.baseData.buyCarTypeList e.optionList = this.baseData.buyCarTypeList
this.productModal[item.idName][e.attributeName] = '0' this.productModal[item.idName][e.attributeName] = '0'
} else if ((item.idName == 'tire' || item.idName == 'crash' || item.idName == 'vip') && e.attributeDesc == '服务期限') { } else if ((item.idName == 'tire' || item.idName == 'crash' || item.idName == 'vip' || item.idName == 'glass') && e.attributeDesc == '服务期限') {
if (item.idName == 'tire' || item.idName == 'crash') { if (item.idName == 'tire' || item.idName == 'crash') {
e.optionList = this.baseData.servicePeriodList e.optionList = this.baseData.servicePeriodList
} else { } else {
e.optionList = this.baseData.servicePeriodList2 e.optionList = this.baseData.servicePeriodList2
} }
this.productModal[item.idName][e.attributeName] = '1' // this.productModal[item.idName][e.attributeName] = '1'
e.disabled = true e.disabled = true
// v3.1.2--新版的定制权益-服务期限--改为1,2,3年---旧版的依然是一年
let isOld = item.packageName.includes('尊享版') || item.packageName.includes('舒享版') || item.packageName.includes('优享版')
if(item.idName == 'vip' && !isOld){
e.disabled = false
e.optionList = this.baseData.servicePeriodList
}
this.productModal[item.idName][e.attributeName] = '1'
} else if (e.attributeDesc == '生效日期') { } else if (e.attributeDesc == '生效日期') {
let nextDay = new Date().getTime() + 24 * 60 * 60 * 1000 let nextDay = new Date().getTime() + 24 * 60 * 60 * 1000
this.productModal[item.idName][e.attributeName] = utils.dateFormat(nextDay) this.productModal[item.idName][e.attributeName] = utils.dateFormat(nextDay)
if (item.idName == 'glass') {
let tAdd2 = new Date().getTime() + 24 * 60 * 60 * 1000 * 2
this.productModal[item.idName][e.attributeName] = utils.dateFormat(tAdd2)
e.disabled = true
}
} }
ele.tempobj = { ...e } ele.tempobj = { ...e }
}) })
...@@ -1222,7 +1299,7 @@ export default { ...@@ -1222,7 +1299,7 @@ export default {
getPackageList() { getPackageList() {
let contractNo = this.routeInfo.contractNo == -1 ? '' : this.routeInfo.contractNo let contractNo = this.routeInfo.contractNo == -1 ? '' : this.routeInfo.contractNo
this.$apis.beforeSale.getPackageListApi({ contractNo }).then(res => { this.$apis.beforeSale.getPackageListApi({ contractNo }).then(res => {
this.toTestProductData(res) this.toGetProductData(res)
}) })
}, },
// 改建议价,实际销售价 // 改建议价,实际销售价
...@@ -1576,6 +1653,7 @@ export default { ...@@ -1576,6 +1653,7 @@ export default {
}, },
// 草稿 // 草稿
handleDraft() { handleDraft() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
if (this.submit) { if (this.submit) {
return true return true
...@@ -1646,6 +1724,7 @@ export default { ...@@ -1646,6 +1724,7 @@ export default {
} }
}, },
handleConfirm() { handleConfirm() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
const isEmptyObj = JSON.stringify(vaidObj) == '{}' const isEmptyObj = JSON.stringify(vaidObj) == '{}'
if (isEmptyObj) { if (isEmptyObj) {
...@@ -1745,7 +1824,8 @@ export default { ...@@ -1745,7 +1824,8 @@ export default {
crash: {}, crash: {},
stolen: {}, stolen: {},
tire: {}, tire: {},
vip: {} vip: {},
glass: {}
} }
this.customProductList = [] this.customProductList = []
this.productList = [] this.productList = []
......
...@@ -235,19 +235,19 @@ export default { ...@@ -235,19 +235,19 @@ export default {
} }
}, },
{ {
label: '批准金额', label: '批准金额/元',
prop: 'approvalAmount', prop: 'approvalAmount',
width: 100, width: 150,
align: 'right', align: 'right',
formatter: cellValue => { formatter: cellValue => {
return cellValue.approvalAmount || '-' return cellValue.approvalAmount || '-'
} }
}, },
{ {
label: '支付金额', label: '支付金额/元',
prop: 'paymentAmount', prop: 'paymentAmount',
align: 'right', align: 'right',
width: 100, width: 150,
formatter: cellValue => { formatter: cellValue => {
return cellValue.paymentAmount || '-' return cellValue.paymentAmount || '-'
} }
......
...@@ -85,7 +85,10 @@ export default { ...@@ -85,7 +85,10 @@ export default {
return total / 100 return total / 100
} }
}, },
mounted() {}, mounted() {
console.log('更新')
},
methods: { methods: {
changeObjectType(newVal) { changeObjectType(newVal) {
if (newVal === 1) { if (newVal === 1) {
...@@ -116,11 +119,11 @@ export default { ...@@ -116,11 +119,11 @@ export default {
for (let key in this.accountForm) { for (let key in this.accountForm) {
this.accountForm[key] = res[key] this.accountForm[key] = res[key]
} }
if (this.accountForm.accountType !== 1) { if (this.accountForm.objectType !== 1) {
this.accountForm.accountType = 0 this.accountForm.accountType = 0
this.accountForm.objectType = 0 this.accountForm.objectType = 0
} }
if (this.accountForm.objectType !== 1) this.accountForm.accountType = 0 if (this.accountForm.accountType !== 1) this.accountForm.accountType = 0
this.serviceItemsList = serviceItemsList this.serviceItemsList = serviceItemsList
// 以下是文件数据 // 以下是文件数据
res.files.forEach(item => { res.files.forEach(item => {
......
...@@ -90,6 +90,9 @@ ...@@ -90,6 +90,9 @@
<el-form-item> <el-form-item>
<el-checkbox v-model="carefree">优享版</el-checkbox> <el-checkbox v-model="carefree">优享版</el-checkbox>
</el-form-item> </el-form-item>
<el-form-item v-for="item in newPackageList" :key="item.packageCode">
<el-checkbox v-model="item.isChecked">{{item.packageName}}</el-checkbox>
</el-form-item>
</template> </template>
</el-form> </el-form>
<!-- 弹窗 --> <!-- 弹窗 -->
...@@ -123,6 +126,7 @@ const theftOptions = ['盗抢卡输入'] ...@@ -123,6 +126,7 @@ const theftOptions = ['盗抢卡输入']
const vehicleOptions = ['全损卡输入'] const vehicleOptions = ['全损卡输入']
const tyreOptions = ['轮胎卡输入'] const tyreOptions = ['轮胎卡输入']
const collisionOptions = ['碰撞卡输入'] const collisionOptions = ['碰撞卡输入']
let oldPackageList = ['PC0005','PC0006','PC0007','PC0008','PC0009','PC0010','PC0011']
export default { export default {
name: '', name: '',
data() { data() {
...@@ -179,7 +183,8 @@ export default { ...@@ -179,7 +183,8 @@ export default {
collisions: collisionOptions, collisions: collisionOptions,
collisionTerminate: false, collisionTerminate: false,
costPrice: false, //选择门店成本 costPrice: false, //选择门店成本
showGh:false showGh:false,
newPackageList: []
} }
}, },
...@@ -197,6 +202,15 @@ export default { ...@@ -197,6 +202,15 @@ export default {
this.getConfig(merchantId) this.getConfig(merchantId)
this.configTitle = '修改' this.configTitle = '修改'
} else { } else {
this.$apis.openconfig.getConfig({}).then(res => {
let arrs = res?.packageConfigs || []
this.newPackageList = arrs.filter(item => {
if(!oldPackageList.includes(item.packageCode)){
item.isChecked = !!item.isChecked
return item
}
})
})
this.configTitle = '开通' this.configTitle = '开通'
this.add = true this.add = true
this.theftAll = true this.theftAll = true
...@@ -292,49 +306,55 @@ export default { ...@@ -292,49 +306,55 @@ export default {
merchantId merchantId
} }
if(this.showGh){ if(this.showGh){
para.channel = 2 para.channel = 2
} }
this.$apis.openconfig.getConfig(para).then(res => { this.$apis.openconfig.getConfig(para).then(res => {
res = res || {}
this.costPrice = res.openCostPrice == 1 this.costPrice = res.openCostPrice == 1
this.storeSelParams = res this.storeSelParams = res
this.id = res.id this.id = res.id
this.checkPosition = res.checkPosition == 0 this.checkPosition = res.checkPosition == 0
let arrs = [] let arrs = res.packageConfigs || []
arrs = res.packageConfigs this.newPackageList = arrs.filter(item => {
if(!oldPackageList.includes(item.packageCode)){
item.isChecked = !!item.isChecked
return item
}
})
for (var i = 0; i < arrs.length; i++) { for (var i = 0; i < arrs.length; i++) {
if (arrs[i].packageCode == 'PC0005') { if (arrs[i].packageCode == 'PC0005') {
this.theftAll = true this.theftAll = !!arrs[i]?.isChecked
if (arrs[i].cardName == 'card') { if (arrs[i].cardName == 'card') {
this.againstTheft = ['盗抢卡输入'] this.againstTheft = ['盗抢卡输入']
} }
if(arrs[i].servicePeriod.indexOf('4')>-1){ if(arrs[i].servicePeriod?.indexOf('4')>-1){
this.robberyServerList.push('4') this.robberyServerList.push('4')
} }
if(arrs[i].servicePeriod.indexOf('5')>-1){ if(arrs[i].servicePeriod?.indexOf('5')>-1){
this.robberyServerList.push('5') this.robberyServerList.push('5')
} }
} }
if (arrs[i].packageCode == 'PC0007') { if (arrs[i].packageCode == 'PC0007') {
this.vehicleAll = true this.vehicleAll = !!arrs[i]?.isChecked
if (arrs[i].cardName == 'card') { if (arrs[i].cardName == 'card') {
this.againstVehicle = ['全损卡输入'] this.againstVehicle = ['全损卡输入']
} }
this.vehicleRadio = arrs[i].templateFlag + '' this.vehicleRadio = arrs[i]?.templateFlag ? arrs[i]?.templateFlag + '' : ''
if(arrs[i].servicePeriod.indexOf('4')>-1){ if(arrs[i].servicePeriod?.indexOf('4')>-1){
this.vehicleServerList.push('4') this.vehicleServerList.push('4')
} }
if(arrs[i].servicePeriod.indexOf('5')>-1){ if(arrs[i].servicePeriod?.indexOf('5')>-1){
this.vehicleServerList.push('5') this.vehicleServerList.push('5')
} }
} }
if (arrs[i].packageCode == 'PC0006') { if (arrs[i].packageCode == 'PC0006') {
this.tyreAll = true this.tyreAll = !!arrs[i]?.isChecked
if (arrs[i].cardName == 'card') { if (arrs[i].cardName == 'card') {
this.againstTyre = ['轮胎卡输入'] this.againstTyre = ['轮胎卡输入']
} }
} }
if (arrs[i].packageCode == 'PC0008') { if (arrs[i].packageCode == 'PC0008') {
this.collisionAll = true this.collisionAll = !!arrs[i]?.isChecked
if (arrs[i].cardName == 'card') { if (arrs[i].cardName == 'card') {
this.againstCollision = ['碰撞卡输入'] this.againstCollision = ['碰撞卡输入']
} }
...@@ -342,13 +362,13 @@ export default { ...@@ -342,13 +362,13 @@ export default {
console.log(arrs[i].templateFlag, 'collisionRadio1') console.log(arrs[i].templateFlag, 'collisionRadio1')
} }
if (arrs[i].packageCode == 'PC0011') { if (arrs[i].packageCode == 'PC0011') {
this.carefree = true this.carefree = !!arrs[i]?.isChecked
} }
if (arrs[i].packageCode == 'PC0009') { if (arrs[i].packageCode == 'PC0009') {
this.honorable = true this.honorable = !!arrs[i]?.isChecked
} }
if (arrs[i].packageCode == 'PC0010') { if (arrs[i].packageCode == 'PC0010') {
this.first = true this.first = !!arrs[i]?.isChecked
} }
} }
}) })
...@@ -415,6 +435,12 @@ export default { ...@@ -415,6 +435,12 @@ export default {
firstObj.servicePeriod = '1' firstObj.servicePeriod = '1'
params.push(firstObj) params.push(firstObj)
} }
this.newPackageList.forEach(item=>{
if(item.isChecked){
let {packageCode, packageServicePeriod} = item
params.push({packageCode, servicePeriod: packageServicePeriod })
}
})
let targetParams = { let targetParams = {
openCostPrice : this.costPrice ? 1 : 0, openCostPrice : this.costPrice ? 1 : 0,
createDetailRequests: params createDetailRequests: params
...@@ -425,9 +451,17 @@ export default { ...@@ -425,9 +451,17 @@ export default {
delete targetParams.openCostPrice delete targetParams.openCostPrice
targetParams.checkPosition = this.checkPosition ? 0 : 1 targetParams.checkPosition = this.checkPosition ? 0 : 1
} }
const loading = this.$loading({
lock: true,
text: 'loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
customClass: 'loadingClass'
})
if (this.add == true) { if (this.add == true) {
targetParams.merchantIds = this.merchantIds targetParams.merchantIds = this.merchantIds
this.$apis.openconfig.addConfig(targetParams).then(res => { this.$apis.openconfig.addConfig(targetParams).then(res => {
loading.close()
if (res.code == '32') { if (res.code == '32') {
this.$message.error('请选择商户') this.$message.error('请选择商户')
} else if (res.code == '0') { } else if (res.code == '0') {
...@@ -437,6 +471,7 @@ export default { ...@@ -437,6 +471,7 @@ export default {
} else { } else {
targetParams.id = this.id targetParams.id = this.id
this.$apis.openconfig.modifyConfig(targetParams).then(res => { this.$apis.openconfig.modifyConfig(targetParams).then(res => {
loading.close()
if (res.code == '32') { if (res.code == '32') {
this.$message.error('请正确勾选信息') this.$message.error('请正确勾选信息')
} else if (res.code == '0') { } else if (res.code == '0') {
......
...@@ -11,7 +11,7 @@ const cdn = { ...@@ -11,7 +11,7 @@ const cdn = {
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`] js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
} }
module.exports = { module.exports = {
outputDir: `../dist/${packageName}`, outputDir: `dist`,
publicPath, publicPath,
assetsDir: 'static', assetsDir: 'static',
productionSourceMap: false, productionSourceMap: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!