Commit 5203530c authored by youjie's avatar youjie

no message

parent c13ff57d
<template>
<div class="domesticCommissionRule">
<div class="query-box">
<ul>
<li>
<input type="button" class="normalBtn" value="新增" @click="addNew">
</li>
</ul>
</div>
<div class="commonContent">
<table v-loading="loading" class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th>名称</th>
<th>公司</th>
<th width="400px">付款对象</th>
<th>类型</th>
<th>金额</th>
<th>费用类型</th>
<th>总部制单流程</th>
<th>分公司制单流程</th>
<th>币种</th>
<th>操作人</th>
<th>操作</th>
</tr>
</thead>
<template v-for="(subItem,subIndex) in DataList">
<tr v-for="(childItem,childIndex) in subItem.DetailList">
<td v-if="childIndex==0" :rowspan="subItem.DetailList.length">{{subItem.Name}}</td>
<td v-if="childIndex==0" :rowspan="subItem.DetailList.length">
{{subItem.BranchName}}
</td>
<td v-if="childIndex==0" :rowspan="subItem.DetailList.length">
{{subItem.ClientName}}
<el-popover style="max-width: 900px;" trigger="click" popper-class="pro_tripDetails">
<el-tag v-for="(ds, din) in Details" :key="ds" size="small">{{ds.ClientName}}</el-tag>
<span slot="reference" @click="getDetails(subIndex,1)" style="color: #409EFF;cursor: pointer;">历史付款对象</span>
</el-popover>
</td>
<td><span v-if="childItem.Type==1"></span>
<span v-if="childItem.Type==2"></span>
<span v-if="childItem.Type==3"></span>
<span v-if="childItem.Type==4">门票</span></td>
<td>{{childItem.Unit_Price}}</td>
<td>{{childItem.CostTypeName}}</td>
<td>{{childItem.FlowZName}}</td>
<td>{{childItem.FlowFName}}</td>
<td>{{subItem.CurrencyName}}</td>
<td>
<p>{{subItem.UpdateByName}}</p>
<p>{{subItem.UpdateDate}}</p>
</td>
<td>
<el-button-group size='mini'>
<el-tooltip class="item" effect="dark" content="编辑手配费" placement="top-start">
<el-button type="primary" icon="el-icon-edit"
@click="isShowDIv = true,divTitle='编辑手配费',getEdit(subItem)">
</el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start">
<el-button type="danger" icon="el-icon-delete" @click="DeleteRules(subItem.Id)">
</el-button>
</el-tooltip>
</el-button-group>
</td>
</tr>
</template>
<tr v-if="DataList.length==0">
<td colspan="11" align="center">暂无数据</td>
</tr>
</table>
</div>
<el-dialog title="手配费" :visible.sync="showVisible" width="1020px">
<el-form ref="addMsg" :model="addMsg" :rules="rules" label-width="90px">
<el-row>
<el-col :span="6">
<el-form-item label="名称" prop="Name">
<el-input type="text" v-model="addMsg.Name"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="付款对象" prop="">
<el-select filterable v-model="addMsg.ClientID" placeholder="选择付款对象" style="width: 100%;">
<el-option v-for="item in ClientAccountList"
:label="item.AccountAlias" :value="item.ID" :key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="适配公司" prop="BranchId">
<el-select v-model="addMsg.BranchId" placeholder="选择适配公司" style="width: 100%;">
<el-option v-for="item in companyList" :label='item.BName' :value='item.Id' :key='item.Id'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="币种" prop="CurrencyId">
<el-select placeholder="选择币种"
v-model="addMsg.CurrencyId" style="width: 100%;" @change="getCurrent(addMsg.CurrencyId)">
<el-option v-for="item in allCurrencyList" :key="item.ID" :label="item.Name" :value="item.ID">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item style="margin-left: -90px;">
<div style="width: 100%;border-bottom: 1px solid #e2e2e2;padding-bottom: 10px;margin-top: 10px;"
v-for="(x,y) in addMsg.DetailList" :key='y'>
<div style="display: flex;align-items: center;margin-bottom: 10px;">
<el-form-item :prop="'DetailList.'+ y +'.Type'"
:rules="productGroup.Type" label="类型">
<el-select style="width: 100px;" v-model="x.Type" @change="gettdName(x.Id,y,1)"
clearable>
<el-option v-for="item in TypeListArr" :key="item.Id" :label="item.Name" :disabled="item.disabled"
:value="item.Id"></el-option>
</el-select>
</el-form-item>
<el-form-item :prop="'DetailList.'+ y +'.Unit_Price'" :rules="productGroup.Unit_Price"
label="金额">
<el-input style="width: 100px;" type="Number" v-model="x.Unit_Price"
@keyup.native="checkPrice(x,'Unit_Price',true)">
</el-input>
</el-form-item>
<el-form-item :prop="'DetailList.'+ y +'.CostTypeId'"
:rules="productGroup.CostTypeId" label="费用类型">
<el-select v-model="x.CostTypeId" style="width: 100px;" @change="gettdName(x.Id,y,2)"
clearable>
<el-option v-for="item in costType" :key="item.ID" :label="item.Name"
:value="item.ID"></el-option>
</el-select>
</el-form-item>
<el-form-item :prop="'DetailList.'+ y +'.FlowZId'"
:rules="productGroup.FlowZId" label="总部流程">
<el-select v-model="x.FlowZId" style="width: 100px;" @change="gettdName(x.Id,y,3)"
clearable>
<el-option v-for="item in TemplateGetList" :key="item.Id" :label="item.Name"
:value="item.Id"></el-option>
</el-select>
</el-form-item>
<el-form-item :prop="'DetailList.'+ y +'.FlowFId'"
:rules="productGroup.FlowFId" label="分部流程">
<el-select v-model="x.FlowFId" style="width: 100px;" @change="gettdName(x.Id,y,4)"
clearable>
<el-option v-for="item in TemplateGetList" :key="item.Id" :label="item.Name"
:value="item.Id"></el-option>
</el-select>
</el-form-item>
<div>
<el-button style="margin-left: 15px;padding: 6px;" type="danger" size="mini" class="el-icon-delete" circle
v-if="addMsg.DetailList.length>1" @click="addMsg.DetailList.splice(y,1)">
</el-button>
</div>
</div>
</div>
<el-button size="mini" type="primary"
class="el-icon-circle-plus-outline" circle @click="addDetailList"></el-button>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="showVisible = false">取 消</el-button>
<el-button size="small" type="danger" @click="submit('addMsg')">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Vue from "vue";
const addobj = {
Id: 0,
Name: '',
ClientID: null,
ClientIds:'',
DetailList: [{
Type: '',
Unit_Price: null,
CostTypeId: null,
FlowZId: null,
FlowFId: null
}],
}
export default {
data() {
return {
costType: [],
TemplateGetList:[],
Details:[],
S_CheckAllOrder: false,
CurrentNmae: '',
//所有币种
allCurrencyList: [],
companyList: [],
getCompanyMsg: {
RB_Group_Id: '0',
Status: '0',
},
msg: {
BranchId: -1,
},
loading: false, //加载层
DataList: [],
total: 0,
TypeListArr: [
{Name:'房',Id:1,disabled:false},
{Name:'餐',Id:2,disabled:false},
{Name:'车',Id:3,disabled:false},
{Name:'门票',Id:4,disabled:false},
], //团队类型
ClientAccountList: [], //付款对象
showVisible: false, //弹窗的显示
addMsg: Object.assign({}, addobj),
rules: {
Name: [{
required: true,
message: '请输入名称',
trigger: 'blur'
}],
ClientID: [{
required: true,
message: '请选择付款对象',
trigger: 'change'
}],
BranchId: [{
required: true,
message: '请选择适配公司',
trigger: 'change'
}],
CurrencyId: [{
required: true,
message: '请选择币种',
trigger: 'change'
}],
},
productGroupRules2:{
Id: [{
required: true,
message: '请选择人员',
trigger: 'change'
}],
},
productGroup: {
Type: [{
required: true,
message: '请选择类型',
trigger: 'change'
}],
Unit_Price: [{
required: true,
message: '金额不能为空',
trigger: 'blur'
}],
CostTypeId: [{
required: true,
message: '请选择费用类型',
trigger: 'change'
}],
FlowZId: [{
required: true,
message: '请选择总公司流程',
trigger: 'change'
}],
FlowFId: [{
required: true,
message: '请选择分公司流程',
trigger: 'change'
}],
}
};
},
created() {
let userInfo = this.getLocalStorage();
this.getCompanyMsg.RB_Group_Id = userInfo.RB_Group_id; //集团
this.getList()
this.getFKList()
this.getCompany()
this.getAllCurrency()
this.FinancialFlowTemplate_post_GetList()
this.getTemplateCostTypeList()
},
methods: {
getTemplateCostTypeList(){
this.apipost('financeinfo_post_GetCostTypeList',{Type:2},res=>{
if(res.data.resultCode==1){
this.costType=res.data.data;
}else{
}
},err=>{})
},
FinancialFlowTemplate_post_GetList() {
// 单据类型
this.apipost(
"Financial_post_GetList",
{},
res => {
if (res.data.resultCode == 1) {
this.TemplateGetList = res.data.data;
} else {
}
},
err => {}
);
},
//获取详情
getDetails(index,type) {
this.Details = type==1?this.DataList[index].HistoryClientList:this.DataList[index].DetailList;
},
//获取当前下拉选中币种
getCurrent(currencyId) {
this.allCurrencyList.forEach(x => {
if (x.ID == currencyId) {
this.CurrentNmae = x.Name;
}
});
},
//获取所有币种
getAllCurrency() {
this.apipost(
"financeinfo_post_GetList",
{},
res => {
if (res.data.resultCode == 1) {
this.allCurrencyList = res.data.data;
}
},
err => { }
);
},
//获取公司
getCompany() {
this.apipost('admin_get_BranchGetList', this.getCompanyMsg, res => {
if (res.data.resultCode == 1) {
this.companyList = res.data.data;
} else {}
}, err => {})
},
handleCurrentChange(val) {
//翻页功能按钮
this.msg.pageIndex = val;
this.getList();
},
getList() {
this.loading = true;
this.apipost(
"handfee_post_GetHandFeeList",
this.msg,
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.DataList = res.data.data;
// this.total = res.data.data.count;
}
},
err => {}
);
},
gettdName(id, index,type) { //获取团队类型名称
if(type==1){
this.TypeListArr.map(x => {
if (x.Id == id) {
this.addMsg.DetailList[index].Name = x.Name;
return false
}
})
}
},
//获取付款列表
getFKList() {
let msg = {
ID:0,
Type:0,
ObjID:0,
CardNum:''
}
this.apipost(
"financeinfo_post_GetClientAccountList", msg,
res => {
if (res.data.resultCode == 1) {
this.ClientAccountList = res.data.data;
}
}
);
},
getEdit(row) { //修改
let data = JSON.parse(JSON.stringify(row))
this.addMsg = data
this.addMsg.DetailList.forEach(item=>{
item.Unit_Price = Number(item.Unit_Price)
})
this.showVisible = true;
},
DeleteRules(ID) { //删除
this.$confirm("是否删除? ", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.apipost('handfee_post_DelHandFee', {
Id: ID
}, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message)
this.getList()
} else {
this.Error(res.data.message)
}
})
})
.catch(() => {});
},
addNew() { //新增
this.addMsg = {
Id: 0,
Name: '',
ClientID: null,
ClientIds:'',
DetailList: [{
Type: '',
Unit_Price: null,
CostTypeId: null,
FlowZId: null,
FlowFId: null
}],
}
this.showVisible = true;
},
addDetailList() { //新增类型
let isdisabled = false
let isdisabledXHS = false
for(let i = 0;i<this.addMsg.DetailList.length;i++){
let x = this.addMsg.DetailList[i]
}
let obj = {
Type: '',
Unit_Price: null,
CostTypeId: null,
FlowZId: null,
FlowFId: null
}
this.addMsg.DetailList.push(obj)
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.addMsg.HistoryClientList,'---')
let ClientIds
if(this.addMsg.HistoryClientList){
ClientIds = this.addMsg.HistoryClientList.map(item=>{ return item.ClientId})
}
this.addMsg.ClientIds = ClientIds?ClientIds.join(','):''
this.apipost(
'handfee_post_SetHandFeeInfo', this.addMsg,
res => {
if (res.data.resultCode == 1) {
this.getList();
this.showVisible = false;
this.Success(res.data.message)
} else {
this.Error(res.data.message)
}
},
err => {}
)
}
});
},
},
mounted() {
let userInfo = this.getLocalStorage();
let ActionMenuCode = userInfo.ActionMenuCode;
if (ActionMenuCode.indexOf('S_CheckAllOrder') != -1 ){
this.S_CheckAllOrder = true
}
if(!this.S_CheckAllOrder){
this.msg.BranchId = userInfo.RB_Group_id
}
}
};
</script>
<style scoped>
@import "../../../assets/css/cssReset.css";
/* .rule-box .el-select__tags{
top: 100%;
} */
.domesticCommissionRule .query-box input {
height: 34px !important;
}
.p-5{
padding: 5px 0;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment