Commit c4119f4e by zhangquan

联调完成

1 parent 9f6f035e
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span :style="{ width: item.selectWidth || defaultWidth, display: 'inline-block' }" v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span> <span :style="{ width: item.selectWidth || defaultWidth, display: 'inline-block' }" v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'"> <div v-else-if="item.type === 'input'">
<el-input @change="item.inputChange" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 3" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"> <el-input @change="item.inputChange" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 3" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur="e => handleInputBlur(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span> <span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span> <span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input> </el-input>
......
...@@ -296,6 +296,7 @@ import { fetchConfig } from '@/config' ...@@ -296,6 +296,7 @@ import { fetchConfig } from '@/config'
import utils from '../../util/util' import utils from '../../util/util'
import uploadInfo from './uploadInfo.vue' import uploadInfo from './uploadInfo.vue'
import FormatInput from '@/components/FormatInput' import FormatInput from '@/components/FormatInput'
import NP from 'number-precision'
export default { export default {
name: 'editEquity', name: 'editEquity',
data() { data() {
...@@ -409,8 +410,8 @@ export default { ...@@ -409,8 +410,8 @@ export default {
type: 'input', type: 'input',
append: '元', append: '元',
maxlength: 11, maxlength: 11,
inputBlur: () => { inputBlur: e => {
this.packageToPrice() this.packageToPrice(e)
} }
}, },
{ {
...@@ -1571,6 +1572,7 @@ export default { ...@@ -1571,6 +1572,7 @@ export default {
this.customProductList.push(item) this.customProductList.push(item)
} }
}) })
this.copyCustomProductList = this.$common.utils.deepClone(this.customProductList) //复制一份出来当做过滤源数据
this.autoGenerate(this.customProductList, this.productList) this.autoGenerate(this.customProductList, this.productList)
}, },
setDisabled(partDisabledList = []) { setDisabled(partDisabledList = []) {
...@@ -1723,20 +1725,33 @@ export default { ...@@ -1723,20 +1725,33 @@ export default {
this.toGetProductData(res) this.toGetProductData(res)
}) })
}, },
// 改建议价,实际销售价 packageToPrice(e) {
packageToPrice() { let _price = e?.target?.value || ''
var targetItem = this.packageList.find(item => item.packageCode == this.editForm.packageCode) if (_price) {
this.editForm.suggestedSellingPrice = '' let _list = []
if (this.editForm.vehicle.invoicePrice) { this.copyCustomProductList.forEach(item => {
var invoicePrice = (this.editForm.vehicle.invoicePrice * 100).toFixed(2) if (!item.carHighestPrice || (item.carHighestPrice && _price < NP.divide(item.carHighestPrice || 0, 100) && _price > NP.divide(item.carLowestPrice || 0, 100))) {
targetItem && _list.push(item)
targetItem.servicePackagePrices.forEach(item => { } else {
if (+invoicePrice >= +item.carButtomPrice && +invoicePrice < +item.carHighestPrice) { if (this.autoPackageCodeList.includes(item.packageCode)) {
this.editForm.suggestedSellingPrice = (item.retailPrice / 100).toFixed(2) this.changeRaido(false, item)
this.editForm.actualSalesPrice = (item.retailPrice / 100).toFixed(2) }
} }
}) })
this.customProductList = _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)
// }
// })
// }
}, },
packageAttr(recovery = false, productArrData, detailInfo) { packageAttr(recovery = false, productArrData, detailInfo) {
// 2023 7月底版本 改版 // 2023 7月底版本 改版
......
...@@ -5,6 +5,16 @@ ...@@ -5,6 +5,16 @@
<div class="global-title">基本信息</div> <div class="global-title">基本信息</div>
<div class="main-wrap"> <div class="main-wrap">
<glsx-combi-form ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="formData" :formRules="myRule"> <glsx-combi-form ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<div slot="guorenCodeSlot" class="codeSlot-class">
<el-autocomplete :popper-append-to-body="false" value-key="copyServiceName" popper-class="my-autocomplete" v-model.trim="formObj.copyServiceName" :fetch-suggestions="querySearch" placeholder="请输入或选择内容" @select="handleSelect" @change="handleChange">
<template slot-scope="{ item }">
<div>
<span class="code">{{ item.guorenCode || '--' }}</span>
<span class="name">{{ item.serviceName }}</span>
</div>
</template>
</el-autocomplete>
</div>
<div slot="timeLimitSlot"> <div slot="timeLimitSlot">
<el-checkbox-group :disabled="disabled" v-model="formObj.salePeriod"> <el-checkbox-group :disabled="disabled" v-model="formObj.salePeriod">
<el-checkbox v-for="item in salePeriodList" :label="item.key" :key="item.key">{{ item.label }}</el-checkbox> <el-checkbox v-for="item in salePeriodList" :label="item.key" :key="item.key">{{ item.label }}</el-checkbox>
...@@ -131,6 +141,7 @@ export default { ...@@ -131,6 +141,7 @@ export default {
id: '', id: '',
value: '' value: ''
}, },
servicesList: [],
conditionList: [], conditionList: [],
responsibilityList: [], responsibilityList: [],
salePeriodList: [ salePeriodList: [
...@@ -160,7 +171,7 @@ export default { ...@@ -160,7 +171,7 @@ export default {
myRule: { myRule: {
serviceName: [{ required: true, message: '请输入服务项目名称', trigger: 'change' }], serviceName: [{ required: true, message: '请输入服务项目名称', trigger: 'change' }],
serviceShortName: [{ required: true, message: '请输入服务项目简称', trigger: 'change' }], serviceShortName: [{ required: true, message: '请输入服务项目简称', trigger: 'change' }],
guorenCode: [{ required: true, message: '请输入国任理赔编码', trigger: 'change' }], // guorenCode: [{ required: true, message: '请输入国任理赔编码', trigger: 'change' }],
salePeriod: [{ required: true, message: '请选择销售年限', trigger: 'change' }], salePeriod: [{ required: true, message: '请选择销售年限', trigger: 'change' }],
mainPageFlag: [{ required: true, message: '请选择小程序端展示', trigger: 'change' }], mainPageFlag: [{ required: true, message: '请选择小程序端展示', trigger: 'change' }],
logoUrl: [ logoUrl: [
...@@ -188,7 +199,9 @@ export default { ...@@ -188,7 +199,9 @@ export default {
formObj: { formObj: {
serviceName: '', serviceName: '',
serviceShortName: '', serviceShortName: '',
copyServiceName: '',
guorenCode: '', guorenCode: '',
copyServiceCode: '',
mainPageFlag: 1, mainPageFlag: 1,
unactivatedLogo: '', unactivatedLogo: '',
activatedLogo: '', activatedLogo: '',
...@@ -219,6 +232,7 @@ export default { ...@@ -219,6 +232,7 @@ export default {
{ {
label: '国任理赔编码:', label: '国任理赔编码:',
name: 'guorenCode', name: 'guorenCode',
addHtml: 'guorenCodeSlot',
isDisabled: false, isDisabled: false,
placeholder: '请输入国任理赔编码', placeholder: '请输入国任理赔编码',
type: 'input', type: 'input',
...@@ -282,7 +296,8 @@ export default { ...@@ -282,7 +296,8 @@ export default {
addHtml: 'specConfigSlot' addHtml: 'specConfigSlot'
} }
], ],
gradeList: [] gradeList: [],
selectDisabled: false
} }
}, },
directives: { directives: {
...@@ -308,6 +323,7 @@ export default { ...@@ -308,6 +323,7 @@ export default {
this.getServiceDetail() this.getServiceDetail()
} }
this.getConfigList() this.getConfigList()
this.getServicesList()
}, },
mounted() {}, mounted() {},
...@@ -326,6 +342,38 @@ export default { ...@@ -326,6 +342,38 @@ export default {
.replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') .replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
: '' : ''
}, },
handleSelect(e) {
this.formObj.copyServiceCode = e.serviceCode
this.formObj.guorenCode = e.guorenCode
this.selectDisabled = true
},
handleChange(e) {
// 只有选择之后的第一次按了按键失焦才会触发,想要再次触发必须再选一次
if (!this.formObj.copyServiceCode) return
const _target = this.servicesList.find(item => item.serviceCode == this.formObj.copyServiceCode)
if (_target && _target.copyServiceName != this.formObj.copyServiceName.trim()) {
this.formObj.copyServiceCode = ''
this.formObj.guorenCode = this.formObj.copyServiceName
}
},
querySearch(queryString, cb) {
var restaurants = this.servicesList
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
// 调用 callback 返回建议列表的数据
cb(results)
},
createFilter(queryString) {
return restaurant => {
return restaurant.copyServiceName.toLowerCase().indexOf(queryString.toLowerCase()) > -1
}
},
getServicesList() {
this.$apis.serviceConfig.getServicesItemsList({ pageSize: 1000, pageNum: 1, serviceStatus: 1 }).then(res => {
if (res?.list) {
this.servicesList = res.list.map(item => ({ ...item, copyServiceName: `${item.guorenCode || '--'} ${item.serviceName}` }))
}
})
},
editConditionFn(row, key) { editConditionFn(row, key) {
this.curEditCondition = { this.curEditCondition = {
id: row.id, id: row.id,
...@@ -439,6 +487,11 @@ export default { ...@@ -439,6 +487,11 @@ export default {
this.formObj[key] = transKeyList.includes(key) && res[key].split ? res[key].split(',').map(item => parseInt(item)) : res[key] this.formObj[key] = transKeyList.includes(key) && res[key].split ? res[key].split(',').map(item => parseInt(item)) : res[key]
} }
this.gradeFormObj.monthlyInsuranceCost = NP.divide(res.monthlyInsuranceCost || 0, 100) this.gradeFormObj.monthlyInsuranceCost = NP.divide(res.monthlyInsuranceCost || 0, 100)
if (res.copyServiceCode) {
this.formObj.copyServiceName = `${res.guorenCode || '--'} ${res.serviceName}`
} else {
this.formObj.copyServiceName = res.guorenCode
}
} }
}) })
}, },
...@@ -455,7 +508,9 @@ export default { ...@@ -455,7 +508,9 @@ export default {
params.exclusionsResponsibility = params.exclusionsResponsibility.join(',') params.exclusionsResponsibility = params.exclusionsResponsibility.join(',')
params.buyConditions = params.buyConditions.join(',') params.buyConditions = params.buyConditions.join(',')
params.salePeriod = params.salePeriod.join(',') params.salePeriod = params.salePeriod.join(',')
params.guorenCode = params.copyServiceName
if (this.routeInfo.id) params.id = this.routeInfo.id if (this.routeInfo.id) params.id = this.routeInfo.id
delete params.copyServiceName
this.$apis.serviceConfig.addServicesProject(params).then(res => { this.$apis.serviceConfig.addServicesProject(params).then(res => {
if (res) { if (res) {
if (this.routeInfo.id) { if (this.routeInfo.id) {
...@@ -530,6 +585,22 @@ export default { ...@@ -530,6 +585,22 @@ export default {
.container { .container {
.main-wrap { .main-wrap {
padding: 32px 20px; padding: 32px 20px;
.codeSlot-class {
font-size: 14px;
/deep/ .my-autocomplete {
width: 432px;
}
/deep/ .el-input__inner {
width: 432px;
}
.code {
color: #333;
margin-right: 13px;
}
.name {
color: #999999;
}
}
.services-table { .services-table {
margin-top: 20px; margin-top: 20px;
&:first-child { &:first-child {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!