Commit cb2a6dfa by 前端

Merge branch 'master' into 'develop'

Master

See merge request !24
2 parents 5f57c40d e0f3954a
......@@ -49,7 +49,14 @@
<el-checkbox-group v-model="curSelectPro" :disabled="disabled">
<div v-for="(item, index) in productList" :key="index" class="product_wrapper">
<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>
<!-- 属性 -->
......@@ -482,7 +489,8 @@ export default {
crash: {},
stolen: {},
tire: {},
vip: {}
vip: {},
glass: {}
},
// 其他信息
editRuleOther: {
......@@ -685,13 +693,17 @@ export default {
pickerOptions: {},
pickerOptions2: {},
hotline: '',
compensationNameDisable: false
compensationNameDisable: false,
errGlassName: ''
}
},
watch: {
'editForm.vehicle.invoicePrice'(newValue, oldValue) {
this.editForm.vehicle.invoicePrice = limitPrice(newValue, oldValue, 7, 2, 0, 2000000)
if (this.currentVaildItem) {
this.vailGlassPackage(this.currentVaildItem, this.currentVaildIndex)
}
},
'editForm.actualSalesPrice'(newValue, oldValue) {
this.editForm.actualSalesPrice = limitPrice(newValue, oldValue, 7, 2)
......@@ -782,8 +794,8 @@ export default {
// item.optionList.push({ value: '5', label: '5年' })
// }
let optionObj = {
'4': { value: '4', label: '4年' },
'5': { value: '5', label: '5年' }
4: { value: '4', label: '4年' },
5: { value: '5', label: '5年' }
}
if (res.servicePeriod == '4' || res.servicePeriod == '5') {
const Target = item.optionList.find(item => {
......@@ -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) {
this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode)
......@@ -1061,7 +1120,7 @@ export default {
})
},
// 获取产品的数据
toTestProductData(arr) {
toGetProductData(arr) {
arr.forEach(item => {
if (item.packageName.includes('整车全损')) {
item.idName = 'car'
......@@ -1080,6 +1139,12 @@ export default {
item.idName = 'vip'
} else if (item.packageName.includes('优享版')) {
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.serviceItems = item.serviceItemsList.length ? item.serviceItemsList.map(k => k.serviceName).join(',') : ''
......@@ -1102,17 +1167,29 @@ export default {
} else if (e.attributeDesc == '购车类型') {
e.optionList = this.baseData.buyCarTypeList
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') {
e.optionList = this.baseData.servicePeriodList
} else {
e.optionList = this.baseData.servicePeriodList2
}
this.productModal[item.idName][e.attributeName] = '1'
// this.productModal[item.idName][e.attributeName] = '1'
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 == '生效日期') {
let nextDay = new Date().getTime() + 24 * 60 * 60 * 1000
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 }
})
......@@ -1222,7 +1299,7 @@ export default {
getPackageList() {
let contractNo = this.routeInfo.contractNo == -1 ? '' : this.routeInfo.contractNo
this.$apis.beforeSale.getPackageListApi({ contractNo }).then(res => {
this.toTestProductData(res)
this.toGetProductData(res)
})
},
// 改建议价,实际销售价
......@@ -1576,6 +1653,7 @@ export default {
},
// 草稿
handleDraft() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
if (this.submit) {
return true
......@@ -1646,6 +1724,7 @@ export default {
}
},
handleConfirm() {
this.vaildGlassParams()
const vaidObj = this.equityRadio == 1 ? this.formatProduct : this.autoFormatProduct
const isEmptyObj = JSON.stringify(vaidObj) == '{}'
if (isEmptyObj) {
......@@ -1745,7 +1824,8 @@ export default {
crash: {},
stolen: {},
tire: {},
vip: {}
vip: {},
glass: {}
}
this.customProductList = []
this.productList = []
......
......@@ -235,19 +235,19 @@ export default {
}
},
{
label: '批准金额',
label: '批准金额/元',
prop: 'approvalAmount',
width: 100,
width: 150,
align: 'right',
formatter: cellValue => {
return cellValue.approvalAmount || '-'
}
},
{
label: '支付金额',
label: '支付金额/元',
prop: 'paymentAmount',
align: 'right',
width: 100,
width: 150,
formatter: cellValue => {
return cellValue.paymentAmount || '-'
}
......
......@@ -85,7 +85,10 @@ export default {
return total / 100
}
},
mounted() {},
mounted() {
console.log('更新')
},
methods: {
changeObjectType(newVal) {
if (newVal === 1) {
......@@ -116,11 +119,11 @@ export default {
for (let key in this.accountForm) {
this.accountForm[key] = res[key]
}
if (this.accountForm.accountType !== 1) {
if (this.accountForm.objectType !== 1) {
this.accountForm.accountType = 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
// 以下是文件数据
res.files.forEach(item => {
......
......@@ -90,6 +90,9 @@
<el-form-item>
<el-checkbox v-model="carefree">优享版</el-checkbox>
</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>
</el-form>
<!-- 弹窗 -->
......@@ -123,6 +126,7 @@ const theftOptions = ['盗抢卡输入']
const vehicleOptions = ['全损卡输入']
const tyreOptions = ['轮胎卡输入']
const collisionOptions = ['碰撞卡输入']
let oldPackageList = ['PC0005','PC0006','PC0007','PC0008','PC0009','PC0010','PC0011']
export default {
name: '',
data() {
......@@ -179,7 +183,8 @@ export default {
collisions: collisionOptions,
collisionTerminate: false,
costPrice: false, //选择门店成本
showGh:false
showGh:false,
newPackageList: []
}
},
......@@ -197,6 +202,15 @@ export default {
this.getConfig(merchantId)
this.configTitle = '修改'
} 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.add = true
this.theftAll = true
......@@ -295,46 +309,52 @@ export default {
para.channel = 2
}
this.$apis.openconfig.getConfig(para).then(res => {
res = res || {}
this.costPrice = res.openCostPrice == 1
this.storeSelParams = res
this.id = res.id
this.checkPosition = res.checkPosition == 0
let arrs = []
arrs = res.packageConfigs
let 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++) {
if (arrs[i].packageCode == 'PC0005') {
this.theftAll = true
this.theftAll = !!arrs[i]?.isChecked
if (arrs[i].cardName == 'card') {
this.againstTheft = ['盗抢卡输入']
}
if(arrs[i].servicePeriod.indexOf('4')>-1){
if(arrs[i].servicePeriod?.indexOf('4')>-1){
this.robberyServerList.push('4')
}
if(arrs[i].servicePeriod.indexOf('5')>-1){
if(arrs[i].servicePeriod?.indexOf('5')>-1){
this.robberyServerList.push('5')
}
}
if (arrs[i].packageCode == 'PC0007') {
this.vehicleAll = true
this.vehicleAll = !!arrs[i]?.isChecked
if (arrs[i].cardName == 'card') {
this.againstVehicle = ['全损卡输入']
}
this.vehicleRadio = arrs[i].templateFlag + ''
if(arrs[i].servicePeriod.indexOf('4')>-1){
this.vehicleRadio = arrs[i]?.templateFlag ? arrs[i]?.templateFlag + '' : ''
if(arrs[i].servicePeriod?.indexOf('4')>-1){
this.vehicleServerList.push('4')
}
if(arrs[i].servicePeriod.indexOf('5')>-1){
if(arrs[i].servicePeriod?.indexOf('5')>-1){
this.vehicleServerList.push('5')
}
}
if (arrs[i].packageCode == 'PC0006') {
this.tyreAll = true
this.tyreAll = !!arrs[i]?.isChecked
if (arrs[i].cardName == 'card') {
this.againstTyre = ['轮胎卡输入']
}
}
if (arrs[i].packageCode == 'PC0008') {
this.collisionAll = true
this.collisionAll = !!arrs[i]?.isChecked
if (arrs[i].cardName == 'card') {
this.againstCollision = ['碰撞卡输入']
}
......@@ -342,13 +362,13 @@ export default {
console.log(arrs[i].templateFlag, 'collisionRadio1')
}
if (arrs[i].packageCode == 'PC0011') {
this.carefree = true
this.carefree = !!arrs[i]?.isChecked
}
if (arrs[i].packageCode == 'PC0009') {
this.honorable = true
this.honorable = !!arrs[i]?.isChecked
}
if (arrs[i].packageCode == 'PC0010') {
this.first = true
this.first = !!arrs[i]?.isChecked
}
}
})
......@@ -415,6 +435,12 @@ export default {
firstObj.servicePeriod = '1'
params.push(firstObj)
}
this.newPackageList.forEach(item=>{
if(item.isChecked){
let {packageCode, packageServicePeriod} = item
params.push({packageCode, servicePeriod: packageServicePeriod })
}
})
let targetParams = {
openCostPrice : this.costPrice ? 1 : 0,
createDetailRequests: params
......@@ -425,9 +451,17 @@ export default {
delete targetParams.openCostPrice
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) {
targetParams.merchantIds = this.merchantIds
this.$apis.openconfig.addConfig(targetParams).then(res => {
loading.close()
if (res.code == '32') {
this.$message.error('请选择商户')
} else if (res.code == '0') {
......@@ -437,6 +471,7 @@ export default {
} else {
targetParams.id = this.id
this.$apis.openconfig.modifyConfig(targetParams).then(res => {
loading.close()
if (res.code == '32') {
this.$message.error('请正确勾选信息')
} else if (res.code == '0') {
......
......@@ -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`]
}
module.exports = {
outputDir: `../dist/${packageName}`,
outputDir: `dist`,
publicPath,
assetsDir: 'static',
productionSourceMap: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!