|
@@ -5,10 +5,10 @@
|
|
|
<span class="textSpan">通道名称:</span>
|
|
|
<el-input v-model="body.channelName" style="width:200px" placeholder="通道名称" size="small" clearable />
|
|
|
</div>
|
|
|
- <div class="w_input">
|
|
|
+ <!-- <div class="w_input">
|
|
|
<span class="textSpan"> 通道ID:</span>
|
|
|
<el-input v-model="body.channelId" style="width:200px" placeholder="通道ID" size="small" clearable />
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
|
|
|
</div>
|
|
|
<div class="flexend">
|
|
@@ -63,8 +63,8 @@
|
|
|
|
|
|
<!-- <el-button v-if="scope.row.isValid==0" size="small" icon="el-icon-circle-check" type="success" @click="ModifyState(scope.row)">有效</el-button>
|
|
|
<el-button v-if="scope.row.isValid==1" size="small" icon="el-icon-circle-close" type="info" @click="ModifyState(scope.row)">无效</el-button> -->
|
|
|
- <el-button size="small" icon="el-icon-edit" type="warning" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
- <el-button size="small" icon="el-icon-delete" type="danger" @click="ModifyDelete(scope.row)">删除</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-edit" type="warning" plain @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-delete" type="danger" plain @click="ModifyDelete(scope.row,$event)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -93,14 +93,10 @@
|
|
|
<el-input v-model="dataForm.channelName" placeholder="请输入供应商ID" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
|
- <el-form-item label="供应商名称" prop="supplierName" :label-width="formLabelWidth" >
|
|
|
- <el-input v-model="dataForm.supplierName" placeholder="请输入供应商名称" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
|
- <el-form-item label="运营商" :label-width="formLabelWidth">
|
|
|
- <el-select size="small" v-model="dataForm.operator" clearable placeholder="请选择运营商" style="width: 100%" >
|
|
|
+ <el-form-item label="运营商" prop="operator" :label-width="formLabelWidth">
|
|
|
+ <el-select size="small" :disabled="!operation" v-model="dataForm.operator" clearable placeholder="请选择运营商" style="width: 100%" >
|
|
|
<el-option
|
|
|
v-for="item in mobileOperator"
|
|
|
:key="item.id"
|
|
@@ -110,10 +106,8 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="20">
|
|
|
<el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
|
- <el-form-item label="是否有效" :label-width="formLabelWidth" prop="isValid" >
|
|
|
+ <el-form-item label="是否有效" :label-width="formLabelWidth" prop="isValid" >
|
|
|
<el-select size="small" v-model="dataForm.isValid" placeholder="请选择是否有效" style="width: 100%" >
|
|
|
<el-option
|
|
|
v-for="item in status"
|
|
@@ -124,9 +118,14 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
|
+
|
|
|
+ </el-col>
|
|
|
<el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
|
<el-form-item label="折扣(%)" :label-width="formLabelWidth" >
|
|
|
- <el-input v-model="dataForm.discount" placeholder="请输入折扣" />
|
|
|
+ <el-input v-model="dataForm.discount" placeholder="请输入折扣" @change="clicklong(dataForm.discount)" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6" :xs="24" :sm="12" :md="12" :lg="8">
|
|
@@ -140,17 +139,21 @@
|
|
|
<el-card shadow="hover" v-if="!operation">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span class="topClass">通道产品信息</span>
|
|
|
- <el-button style="float: right;" type="primary" plain @click="addprice">添加通道产品</el-button>
|
|
|
- <el-button style="marginRight:20px;float: right;" type="success" plain @click="addprice">结算价格批量定价</el-button>
|
|
|
+ <el-button style="float: right;" type="primary" plain @click="addprice(dataForm.operator)">添加通道产品</el-button>
|
|
|
+ <el-button style="marginRight:20px;float: right;" type="success" plain @click="editpricing">结算价格批量定价</el-button>
|
|
|
</div>
|
|
|
<div>
|
|
|
<!-- 添加 -->
|
|
|
- <el-table :data="dataForm.channelProductInfos" >
|
|
|
+ <el-table ref="multipleTable" :data="dataForm.channelProductInfos" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <el-table-column label="产品Id" align="center" show-overflow-tooltip>
|
|
|
+ <el-table-column label="产品Id" align="center" width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope" >
|
|
|
- <el-input v-model="scope.row.packageId"></el-input>
|
|
|
- <!-- <span v-else>{{ scope.row.cardNo }}</span> -->
|
|
|
+ <!-- <el-input v-model="scope.row.packageId"></el-input> -->
|
|
|
+ <span>{{ scope.row.packageId }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!--
|
|
@@ -162,14 +165,20 @@
|
|
|
|
|
|
<el-table-column label="通道产品名称" align="center" show-overflow-tooltip>
|
|
|
<template slot-scope="scope" >
|
|
|
- <el-input v-model="scope.row.channelProductName"></el-input>
|
|
|
- <!-- <span >{{ scope.row.account }}</span> -->
|
|
|
+ <!-- <el-input v-model="scope.row.channelProductName"></el-input> -->
|
|
|
+ <span >{{ scope.row.productName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
+ <el-table-column label="面额" width="100" align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ <!-- <el-input v-model="scope.row.price"></el-input> -->
|
|
|
+ <span >{{ scope.row.standardPrice }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="结算价格" align="center" show-overflow-tooltip>
|
|
|
<template slot-scope="scope" >
|
|
|
- <el-input v-model="scope.row.price"></el-input>
|
|
|
+ <el-input v-model="scope.row.price "></el-input>
|
|
|
<!-- <span >{{ scope.row.account }}</span> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -190,7 +199,7 @@
|
|
|
|
|
|
<el-table-column label="操作" width="165" min-width="150" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="danger" plain icon="el-icon-delete" @click="priceDelete(scope.row,scope.$index)">删除</el-button>
|
|
|
+ <el-button type="danger" plain icon="el-icon-delete" @click="priceDelete(scope.row,scope.$index,$event)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -204,11 +213,32 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 结算价格批量定价 -->
|
|
|
+ <el-dialog
|
|
|
+ title="结算价格批量定价"
|
|
|
+ :visible.sync="pricingVisible"
|
|
|
+ width="40%"
|
|
|
+ modal
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <div style="text-align:center;">
|
|
|
+ <el-input v-model="morePricing" @keyup.enter.native="pricingClike" style="width:200px"></el-input>
|
|
|
+ <span>
|
|
|
+ %
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <!-- <el-button @click="">取 消</el-button> -->
|
|
|
+ <el-button type="primary" @click="pricingClike">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 产品选择 -->
|
|
|
<el-dialog
|
|
|
title="添加产品"
|
|
|
:visible.sync="dialogVisible"
|
|
|
- width="60%"
|
|
|
+ width="58%"
|
|
|
>
|
|
|
<div class="edit_dev">
|
|
|
|
|
@@ -216,8 +246,8 @@
|
|
|
v-model="value"
|
|
|
filterable
|
|
|
:props="{
|
|
|
- key: 'packageName',
|
|
|
- label: 'packageName'
|
|
|
+ key: 'productId',
|
|
|
+ label: 'productName'
|
|
|
}"
|
|
|
:format="{
|
|
|
noChecked: '${total}',
|
|
@@ -229,7 +259,7 @@
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="clickeAddprice">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -248,6 +278,7 @@
|
|
|
|
|
|
<script>
|
|
|
import api from '@/api/channel.js'
|
|
|
+import Vue from 'vue'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -257,7 +288,7 @@ export default {
|
|
|
current:1,
|
|
|
channelName:""
|
|
|
},
|
|
|
- data:[{id:1,creator:"wangdz",createTime:"2020-12-11 22:21:32",updator:"",updateTime:null,packageId:"DXHF1",packageName:"全国电信话费卡_1元",operatorCode:"DX",oprPackageId:"DXHF",activePeriod:6,flowAmount:1.0,zone:"00",zoneDesc:"全国",comboPackageStr:"",isCombo:"2"},{id:2,creator:"wangdz",createTime:"2020-12-11 22:21:32",updator:"",updateTime:null,packageId:"DXHF1",packageName:"全国电信话费卡_12元",operatorCode:"DX",oprPackageId:"DXHF",activePeriod:20,flowAmount:1.0,zone:"00",zoneDesc:"全国",comboPackageStr:"",isCombo:"2"},{id:3,creator:"wangdz",createTime:"2020-12-11 22:21:32",updator:"",updateTime:null,packageId:"DXHF1",packageName:"全国电信话费卡_13元",operatorCode:"DX",oprPackageId:"DXHF",activePeriod:3,flowAmount:1.0,zone:"00",zoneDesc:"全国",comboPackageStr:"",isCombo:"2"},{id:4,creator:"wangdz",createTime:"2020-12-11 22:21:32",updator:"",updateTime:null,packageId:"DXHF1",packageName:"全国电信话费卡_14元",operatorCode:"DX",oprPackageId:"DXHF",activePeriod:5,flowAmount:1.0,zone:"00",zoneDesc:"全国",comboPackageStr:"",isCombo:"2"},{id:5,creator:"wangdz",createTime:"2020-12-11 22:21:32",updator:"",updateTime:null,packageId:"DXHF1",packageName:"全国电信话费卡_15元",operatorCode:"DX",oprPackageId:"DXHF",activePeriod:6,flowAmount:1.0,zone:"00",zoneDesc:"全国",comboPackageStr:"",isCombo:"2"},{id:6,creator:"wangdz",createTime:"2020-12-11 22:21:32",updator:"",updateTime:null,packageId:"DXHF1",packageName:"全国电信话费卡_16元",operatorCode:"DX",oprPackageId:"DXHF",activePeriod:5,flowAmount:1.0,zone:"00",zoneDesc:"全国",comboPackageStr:"",isCombo:"2"}],
|
|
|
+ data:[],
|
|
|
value: [],
|
|
|
tableData:[],
|
|
|
total:0,
|
|
@@ -265,6 +296,7 @@ export default {
|
|
|
dialogVisible:false, //新增产品
|
|
|
dialogFormVisible: false, // 控制弹出框
|
|
|
dialogFormLook:false, //查看弹出框
|
|
|
+ pricingVisible:false, //结算价格批量定价弹出框
|
|
|
formLabelWidth: '100px', //新增宽度
|
|
|
loading:false,
|
|
|
dataForm:{
|
|
@@ -279,6 +311,7 @@ export default {
|
|
|
supplierName: [{ required: true, message: '请输入供应商名称', trigger: 'blur' }],
|
|
|
channelName: [{ required: true, message: '请输入通道名称', trigger: 'blur' }],
|
|
|
isValid: [{ required: true, message: '请选择是否有效', trigger: 'blur' }],
|
|
|
+ operator: [{ required: true, message: '请选择运营商', trigger: 'blur' }],
|
|
|
},
|
|
|
status:[{
|
|
|
id:1,
|
|
@@ -287,6 +320,8 @@ export default {
|
|
|
id:0,
|
|
|
name:"无效"
|
|
|
}],
|
|
|
+ morePricing:"", //结算价格批量定价
|
|
|
+ batch:[] //批量所选的数据
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
@@ -298,7 +333,17 @@ export default {
|
|
|
this.loading = true
|
|
|
api.channel(this.body).then((res) => {
|
|
|
this.loading = false
|
|
|
- this.tableData = res.data.data.records
|
|
|
+ let list = res.data.data.records
|
|
|
+ list.map((res)=>{
|
|
|
+ // console.log(res)
|
|
|
+ res.channelProductInfos.map((res=>{
|
|
|
+ res.price = (res.price / 10000).toFixed(4)
|
|
|
+ return res
|
|
|
+ }))
|
|
|
+ return res
|
|
|
+ })
|
|
|
+ // console.log(data)
|
|
|
+ this.tableData = list
|
|
|
this.total = res.data.data.total
|
|
|
})
|
|
|
},
|
|
@@ -314,11 +359,61 @@ export default {
|
|
|
this.operation = false // true:新增, false:编辑
|
|
|
this.dialogFormVisible = true // 控制弹出框
|
|
|
this.dataForm = JSON.parse(JSON.stringify(row))
|
|
|
+ this.batch == []
|
|
|
+ this.morePricing = ""
|
|
|
this.$refs['dataForm'].resetFields();
|
|
|
},
|
|
|
+ //文本框折扣编辑
|
|
|
+ clicklong(row){
|
|
|
+ let code = this.dataForm.channelProductInfos
|
|
|
+ let info = []
|
|
|
+ let arry= code.forEach((res)=>{
|
|
|
+ //结算价格 * 折扣(%) * 0.01
|
|
|
+ res.price=(res.standardPrice * row * 0.01).toFixed(4)
|
|
|
+ info.push(res)
|
|
|
+ })
|
|
|
+ this.dataForm.channelProductInfos = info
|
|
|
+ console.log(info)
|
|
|
+ // console.log(number)
|
|
|
+ },
|
|
|
+ //折扣批量
|
|
|
+ pricingClike(){
|
|
|
+ // console.log(this.batch)
|
|
|
+ let morePricing = this.morePricing
|
|
|
+ let code = this.batch
|
|
|
+ if(!morePricing){
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: "请输入结算价格批量定价"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ let info = []
|
|
|
+ let data = this.dataForm.channelProductInfos
|
|
|
+ let arry= code.forEach((res)=>{
|
|
|
+ //结算价格 * 折扣(%) * 0.01
|
|
|
+ res.price=(res.standardPrice * morePricing * 0.01).toFixed(4)
|
|
|
+ // info.push(res)
|
|
|
+ return res
|
|
|
+ // let iscode = data.forEach(item=>{
|
|
|
+ // if(res.productId == item.productId){
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+
|
|
|
+ })
|
|
|
+ this.pricingVisible = false
|
|
|
+
|
|
|
+ }
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
|
+ },
|
|
|
//删除API
|
|
|
- ModifyDelete(row){
|
|
|
+ ModifyDelete(row,e){
|
|
|
const that = this
|
|
|
+ let target=e.target;
|
|
|
+ if(target.nodeName == 'SPAN' || target.nodeName == 'I'){
|
|
|
+ target = e.target.parentNode;
|
|
|
+ }
|
|
|
+ target.blur();
|
|
|
that.$confirm('此操作将删除通道:' + row.channelName, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -326,7 +421,7 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
api.channelDelete(row.channelId).then((res)=>{
|
|
|
- if (response.status === 200) {
|
|
|
+ if (response.data.status === 200) {
|
|
|
that.$message({
|
|
|
type: 'success',
|
|
|
message: '删除成功'
|
|
@@ -351,28 +446,48 @@ export default {
|
|
|
let newObj=JSON.parse(JSON.stringify(row))
|
|
|
this.dataForm = newObj
|
|
|
},
|
|
|
+ //通道产品删除
|
|
|
+ priceDelete(row,index,e){
|
|
|
+ console.log(e)
|
|
|
+ let target=e.target;
|
|
|
+ if(target.nodeName == 'SPAN' || target.nodeName == 'I'){
|
|
|
+ target = e.target.parentNode;
|
|
|
+ }
|
|
|
+ target.blur();
|
|
|
+ this.dataForm.channelProductInfos.splice(index,1)
|
|
|
+ console.log(this.dataForm.channelProductInfos)
|
|
|
+ },
|
|
|
//新增和修改API
|
|
|
submitForm(){
|
|
|
+
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (!this.operation) {
|
|
|
- console.log(this.dataForm)
|
|
|
+ let dataForm = this.dataForm
|
|
|
+ let data=dataForm.channelProductInfos.map((res)=>{
|
|
|
+ if(res.price > 10000){
|
|
|
+ return res
|
|
|
+ }else{
|
|
|
+ res.price = res.price * 10000
|
|
|
+ return res
|
|
|
+ }
|
|
|
+ })
|
|
|
// 编辑
|
|
|
- // api.channelEdit(this.dataForm).then(response => {
|
|
|
- // if (response.status === 200) {
|
|
|
- // this.$message({
|
|
|
- // type: 'success',
|
|
|
- // message: '操作成功'
|
|
|
- // })
|
|
|
- // this.dialogFormVisible = false
|
|
|
- // this.reLoad()
|
|
|
- // } else {
|
|
|
- // this.$message({
|
|
|
- // type: 'error',
|
|
|
- // message: response.data.msg
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
+ api.update(dataForm).then(response => {
|
|
|
+ if (response.status === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功'
|
|
|
+ })
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.reLoad()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: response.data.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
console.log(this.dataForm)
|
|
|
// // 添加
|
|
@@ -395,14 +510,64 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ //结算价格批量定价
|
|
|
+ editpricing(){
|
|
|
+ console.log(this.batch)
|
|
|
+ if(this.batch.length == 0){
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: "请至少选择一项"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.pricingVisible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
//新增产品
|
|
|
- addprice(){
|
|
|
+ addprice(row){
|
|
|
if(this.dataForm.operator == null || this.dataForm.operator == ""){
|
|
|
console.log("weikong")
|
|
|
}else{
|
|
|
- this.dialogVisible = true
|
|
|
+ api.productAdd(row).then(res=>{
|
|
|
+ let dataForm=this.dataForm.channelProductInfos
|
|
|
+ let code = res.data.data
|
|
|
+ if(dataForm.length == 0){
|
|
|
+ this.data=code
|
|
|
+ }else{
|
|
|
+ // 去重产品
|
|
|
+ var set=dataForm.map(item=>item.productName)
|
|
|
+ var resArr=code.filter(item=>!set.includes(item.productName))
|
|
|
+ this.data=resArr
|
|
|
+ console.log(resArr)
|
|
|
+ }
|
|
|
+ // console.log(code)
|
|
|
+ this.dialogVisible = true
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
+ //确认产品
|
|
|
+ clickeAddprice(){
|
|
|
+ let value = this.value;
|
|
|
+ let data =this.data;
|
|
|
+ let code= value.map(item1=>{
|
|
|
+ let arry= data.map(item2=>{
|
|
|
+ console.log(item1)
|
|
|
+ if(item1 == item2.productId){
|
|
|
+ let form = {
|
|
|
+ price : item2.productPrice,
|
|
|
+ standardPrice : item2.productPrice,
|
|
|
+ productName:item2.productName,
|
|
|
+ packageId:item2.packageId,
|
|
|
+ isValid:1,
|
|
|
+ }
|
|
|
+ // console.log(form)
|
|
|
+ this.dataForm.channelProductInfos.push(form)
|
|
|
+ }
|
|
|
+ // return info
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.value = []
|
|
|
+ },
|
|
|
// 搜索
|
|
|
Search(){
|
|
|
this.body.current = 1
|
|
@@ -412,9 +577,12 @@ export default {
|
|
|
ModifyState(operator){
|
|
|
operator.isValid ^= 1
|
|
|
},
|
|
|
+ //多选
|
|
|
+ handleSelectionChange(rows){
|
|
|
+ this.batch = rows
|
|
|
+ },
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ ///分页
|
|
|
handleSizeChange: function(val) {
|
|
|
this.body.size = val
|
|
|
this.reLoad()
|