Commit f15002c8 by zhangquan

v3.1.2版本开发

1 parent d0d4a7a0
...@@ -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') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!