Commit 2e3b4bb8 authored by 华国豪's avatar 华国豪 🙄

还原工作台代码

parent 0f4c5b48
<style> <style>
@import url('../../assets/css/financia/accountingWork.css'); @import url('../../assets/css/financia/accountingWork.css');
</style> </style>
<template> <template>
<div class="page_accountingWork"> <div class="page_accountingWork">
...@@ -15,20 +15,20 @@ ...@@ -15,20 +15,20 @@
</li> </li>
</ul> </ul>
</div> </div>
<div v-loading="loading"> <div>
<p class="_cashierWorl_tit">注:指定银行卡收支方向的单据会自动分发到各个窗口,管理员在设定时应注意以下窗口是否涵盖了所有的业务,如果没有请及时设定,以免造成单据混乱</p> <p class="_cashierWorl_tit">注:指定银行卡收支方向的单据会自动分发到各个窗口,管理员在设定时应注意以下窗口是否涵盖了所有的业务,如果没有请及时设定,以免造成单据混乱</p>
<div class="cm_content _scrollbar" :class="addShow==true?'_edHeight':''"> <div class="cm_content _scrollbar" :class="addShow==true?'_edHeight':''">
<table class="po_content singeRowTable" style="border:1px solid #E6E6E6;" cellspacing="0" cellpadding="0" v-if="transitionShow2"> <table class="po_content singeRowTable" style="border:1px solid #E6E6E6;" cellspacing="0" cellpadding="0" v-loading="loading" v-if="transitionShow2">
<tr> <tr>
<th>窗口名称</th> <th>窗口名称</th>
<th>会计关联费用类型</th> <th>所属公司</th>
<th>业务人员</th> <th>业务人员</th>
<th>负责方向</th> <th>负责方向</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
<tr v-for="(item,index) in dataList" :key="index"> <tr v-for="(item,index) in dataList" :key="index">
<td>{{item.Name}}</td> <td>{{item.Name}}</td>
<td width="800">{{item.CostName}}</td> <td>{{item.BName}}</td>
<td> <td>
<span v-for="(i,ix) in item.emList">{{i.emName}} <span v-if="ix!=item.emList.length-1">,</span> </span> <span v-for="(i,ix) in item.emList">{{i.emName}} <span v-if="ix!=item.emList.length-1">,</span> </span>
</td> </td>
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
<div v-if="transitionShow" class="clearfix"> <div v-if="transitionShow" class="clearfix">
<div class="po_content_list_item" v-for="(item,index) in dataList" :key="index"> <div class="po_content_list_item" v-for="(item,index) in dataList" :key="index">
<div class="po_content_list_item_top"> <div class="po_content_list_item_top">
<span class="_item_top_name">{{item.Name}}</span> <span class="_item_top_name">{{item.Name}}</span>
<span class="_item_top_icon"> <span class="_item_top_icon">
<i class="iconfont icon-rizhi1" @click="goUrlDetail('CashierWorkDetail',1,item.Name,item.ID,item.BranchId)"></i> <i class="iconfont icon-rizhi1" @click="goUrlDetail('CashierWorkDetail',1,item.Name,item.ID,item.BranchId)"></i>
<i class="iconfont icon-bianji-smal" @click="editCurency(item.ID),text='修改'"></i> <i class="iconfont icon-bianji-smal" @click="editCurency(item.ID),text='修改'"></i>
<i class="iconfont icon-img_delete_small" @click="financeinfoRemove(item.ID)"></i> <i class="iconfont icon-img_delete_small" @click="financeinfoRemove(item.ID)"></i>
...@@ -70,9 +70,9 @@ ...@@ -70,9 +70,9 @@
{{item.emList[0].emName}} {{item.emList[0].emName}}
</span> </span>
<div v-else> <div v-else>
<el-popover <el-popover
placement="bottom" placement="bottom"
popper-class="CashierWork_tripDetails" popper-class="CashierWork_tripDetails"
trigger="click"> trigger="click">
<div class=""> <div class="">
<span class="_all_name" v-for="(i,io) in item.emList">{{i.emName}}</span> <span class="_all_name" v-for="(i,io) in item.emList">{{i.emName}}</span>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<template v-else> <template v-else>
<span></span> <span></span>
</template> </template>
</p> </p>
</div> </div>
</div> </div>
...@@ -93,12 +93,12 @@ ...@@ -93,12 +93,12 @@
{{$t('system.content_noData')}} {{$t('system.content_noData')}}
</div> </div>
<div> <div>
<el-pagination <el-pagination
background background
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="currentPage" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" layout="total,prev, pager, next, jumper"
:page-size=msg.pageSize :page-size=msg.pageSize
:total=total> :total=total>
</el-pagination> </el-pagination>
</div> </div>
...@@ -120,20 +120,20 @@ ...@@ -120,20 +120,20 @@
<el-input v-model="addMsg.Name"></el-input> <el-input v-model="addMsg.Name"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="4">
<el-form-item label="费用类型:" prop="TypelistArr"> <el-form-item label="所属公司:" prop="BranchId">
<treeselect <el-select filterable v-model='addMsg.BranchId'>
class="w230" </el-option>
v-model="addMsg.TypelistArr" <el-option v-for='item in CompanyList'
value-consists-of="LEAF_PRIORITY" :label='item.BName'
placeholder="请选择" :value='item.Id'
:multiple="true" :key='item.Id'
:options="CostTypeList" :disabled="item.disabled">
noChildrenText='' </el-option>
:normalizer="normalizer"/> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="10">
<el-form-item label="业务人员:" prop="listArr"> <el-form-item label="业务人员:" prop="listArr">
<el-select <el-select
v-model="addMsg.listArr" v-model="addMsg.listArr"
...@@ -157,20 +157,30 @@ ...@@ -157,20 +157,30 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="负责方向" prop="Direct">
<el-radio v-model="addMsg.Direct" :label="1"></el-radio>
<el-radio v-model="addMsg.Direct" :label="2"></el-radio>
<el-radio v-model="addMsg.Direct" :label="3">收支</el-radio>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="适用费用" class="_treeselect">
<treeselect
class=""
v-model="CostIdS"
value-consists-of="LEAF_PRIORITY"
placeholder="请选择"
:multiple="true"
:options="CostTypeList"
noChildrenText=''
:normalizer="normalizer"/>
</el-form-item>
</el-col> -->
</el-row> </el-row>
</el-form>
<el-row>
<el-col :span="6">
<el-form-item label="负责方向" prop="Direct">
<el-radio v-model="addMsg.Direct" :label="1"></el-radio>
<el-radio v-model="addMsg.Direct" :label="2"></el-radio>
<el-radio v-model="addMsg.Direct" :label="3">收支</el-radio>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
...@@ -179,77 +189,73 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css' ...@@ -179,77 +189,73 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
components: { Treeselect }, components: { Treeselect },
data(){ data(){
return{ return{
msg:{ msg:{
pageIndex:1, pageIndex:1,
pageSize:15 pageSize:15
}, },
addMsg:{ addMsg:{
ID:0, ID:0,
Name:'', Name:'',
accountant_list:[], accountant_list:[],
emList:[], emList:[],
listArr:[], listArr:[],
TypelistArr:[], BranchId:'',
BranchId:'', Direct:'',
Direct:'', },
}, type:-1,
type:-1, addShow:false,
addShow:false, loading:false,
loading:false, loading2:false,
loading2:false, noData:false,
noData:false, zhiChe:false,
zhiChe:false, shouChe:false,
shouChe:false, total:0,
total:0, currentPage: 1,
currentPage: 1, text:'',
text:'', dataList:[],
dataList:[], searchList:[],
searchList:[], AccList:[],
AccList:[], CompanyList:[],
CompanyList:[], rules: {//表单必填验证
rules: {//表单必填验证 Name: [
Name: [ { required: true, message: '请填写窗口名称', trigger: 'blur' }
{ required: true, message: '请填写窗口名称', trigger: 'blur' } ],
], listArr: [
listArr: [ {type: 'array', required: true, editCurencymessage: '请选择业务员', trigger: 'blur' }
{type: 'array', required: true, editCurencymessage: '请选择业务员', trigger: 'blur' } ],BranchId:[
],BranchId:[ { required: true, message: '请选择公司', trigger: 'change' }
{ required: true, message: '请选择公司', trigger: 'change' } ],Direct:[
],Direct:[ { required: true, message: '请选择使用方向', trigger: 'change' }
{ required: true, message: '请选择使用方向', trigger: 'change' } ]
], },
TypelistArr:[ AccListProps: {
{type: 'array', required: true, editCurencymessage: '费用类型', trigger: 'change' } value:'Num',
] label:'Name',
}, children: 'children'
AccListProps: { },
value:'Num', selectVal:[],
label:'Name', transitionShow:false,
children: 'children' transitionShow2:true,
}, contenWidth:0,
selectVal:[], contenHeight:0,
transitionShow: false, tableSize:0,
transitionShow2: true, shouList:[],
contenWidth:0, shouListLoading:false,
contenHeight:0, CostTypeList:[],
tableSize:0, normalizer(node) {
shouList:[], return {
shouListLoading: false, id: node.ID,
CostTypeList:[], label: node.Name,
normalizer(node) { children: node.ChildList,
return { }
id: node.ID, },
label: node.Name, CostIdS:[],
children: node.ChildList, getCompanyMsg:{
} RB_Group_Id:'0',
}, Status:'0',
CostIdS:[], },
getCompanyMsg:{ }
RB_Group_Id:'0',
Status:'0',
},
}
},created(){ },created(){
let userInfo = this.getLocalStorage(); let userInfo = this.getLocalStorage();
let allH,allW,cH,cW; let allH,allW,cH,cW;
...@@ -264,215 +270,187 @@ export default { ...@@ -264,215 +270,187 @@ export default {
this.getCompanyMsg.RB_Group_Id = userInfo.RB_Group_id; //集团ID this.getCompanyMsg.RB_Group_Id = userInfo.RB_Group_id; //集团ID
},methods:{ },methods:{
switchMethod(t){ switchMethod(t){
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
if(t===1){ if(t===1){
this.transitionShow = false; this.transitionShow = false;
this.transitionShow2 = true; this.transitionShow2 = true;
this.msg.pageSize = this.tableSize; this.msg.pageSize = this.tableSize;
this.getList(); this.getList();
}else if(t===2){ }else if(t===2){
this.transitionShow = true; this.transitionShow = true;
this.transitionShow2 = false; this.transitionShow2 = false;
// 宽 235 高 206 // 宽 235 高 206
let cont = parseInt(this.contenWidth/235) * parseInt(this.contenHeight/120); let cont = parseInt(this.contenWidth/235) * parseInt(this.contenHeight/120);
this.msg.pageSize = cont; this.msg.pageSize = cont;
this.getList(); this.getList();
} }
}, },
getCostTypeList(){ // 获取费用类型 getCostTypeList(){ // 获取费用类型
this.apipost('Financial_post_GetTreeList',{Type:3},res=>{ this.apipost('Financial_post_GetTreeList',{Type:3},res=>{
if(res.data.resultCode==1){ if(res.data.resultCode==1){
this.CostTypeList=res.data.data; this.CostTypeList=res.data.data;
}else{} }else{}
},err=>{}) },err=>{})
}, },
goUrlDetail(path,type,name,id,bid){ goUrlDetail(path,type,name,id,bid){
this.$router.push({name:path,query:{WindowType:type,name:name,id:id,bid:bid,blank:'y',tab:'会计窗口单据信息'}}) this.$router.push({name:path,query:{WindowType:type,name:name,id:id,bid:bid,blank:'y',tab:'会计窗口单据信息'}})
}, },
removeTag(id){ removeTag(id){
this.addMsg.emList.forEach((x,index)=>{ this.addMsg.emList.forEach((x,index)=>{
if(x.EmId === id){ if(x.EmId === id){
this.addMsg.emList.splice(index,1) this.addMsg.emList.splice(index,1)
} }
})
},
mergeArray(list3, list1, type){
if (type === 1) {
let newList = [...list1,...list3]
let HTobj = {};
newList = newList.reduce(function(item, next) { //数组对象去重
HTobj[next.EmId] ? '' : HTobj[next.EmId] = true && item.push(next);
return item;
}, []);
list3.forEach((x, index)=>{ // 根据MD5Sign过滤删除数据
newList.filter((val, vIndex)=>{
if(x.EmId === val.EmId)
newList.splice(vIndex,1)
})
})
} else {
let newList = [...list1,...list3]
let HTobj = {};
newList = newList.reduce(function(item, next) { //数组对象去重
HTobj[next.CostTypeId] ? '' : HTobj[next.CostTypeId] = true && item.push(next);
return item;
}, []);
list3.forEach((x, index)=>{ // 根据MD5Sign过滤删除数据
newList.filter((val, vIndex)=>{
if(x.CostTypeId === val.CostTypeId)
newList.splice(vIndex,1)
})
}) })
}
console.log(list3)
return list3;
}, },
addCashierWork(){ // 提交保存 mergeArray(list3, list1){
let emList = this.addMsg.listArr; for (var i = 0 ; i < list3.length ; i ++ ){
let arr = []; for(var j = 0 ; j < list1.length ; j ++ ){
emList.forEach(x=>{ if (list3[i].EmId === list1[j].EmId){
let obj = { list3.splice(i,1);
'EmId':x, }
'ID':0, }
'WindowId':0
} }
arr.push(obj); for(var i = 0; i <list1.length; i++){
}) list3.push(list1[i]);
let accountant_list = []
this.addMsg.TypelistArr.forEach(x=>{
let obj = {
ID: 0,
CostTypeId: x
} }
accountant_list.push(obj) return list3;
})
let list4 = this.mergeArray(arr,this.addMsg.emList,1);
this.addMsg.accountant_list = this.mergeArray(accountant_list, this.addMsg.accountant_list,2);
this.addMsg.emList = list4;
this.apipost('Window_post_SetAccountant',this.addMsg,r=>{
if(r.data.resultCode==1){
this.$message.success(r.data.message);
this.getList();
this.addShow = false;
this.cancelEdit();
// this.CostIdS = [];
}else{
this.$message.error(r.data.message);
}
},null)
}, },
submitForm(addMsg) {//提交创建、修改表单 addCashierWork(){ // 提交保存
this.$refs[addMsg].validate((valid) => { let emList = this.addMsg.listArr;
if (valid) { let arr = [];
this.addCashierWork(); emList.forEach(x=>{
} else { let obj = {
console.log('error submit!!'); 'EmId':x,
return false; 'ID':0,
} 'WindowId':0
}); }
arr.push(obj);
})
let list4 = this.mergeArray(arr,this.addMsg.emList);
this.addMsg.emList = list4;
this.apipost('Window_post_SetAccountant',this.addMsg,r=>{
if(r.data.resultCode==1){
this.$message.success(r.data.message);
this.getList();
this.addShow = false;
this.cancelEdit();
// this.CostIdS = [];
}else{
this.$message.error(r.data.message);
}
},null)
}, },
financeinfoRemove(id){ // 删除 submitForm(addMsg) {//提交创建、修改表单
this.$confirm('确定删除窗口?', '提示', { this.$refs[addMsg].validate((valid) => {
confirmButtonText: '确定', if (valid) {
cancelButtonText: '取消', this.addCashierWork();
type: 'warning' } else {
}).then(() => { console.log('error submit!!');
this.apipost('Window_post_RemoveAccountant',{ID:id}, res => { return false;
if(res.data.resultCode == 1) { }
this.getList()
this.$message.success(res.data.message);
} else {
this.$message.error(res.data.message);
}
}, err => {})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
}); });
}); },
financeinfoRemove(id){ // 删除
this.$confirm('确定删除窗口?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.apipost('Window_post_RemoveAccountant',{ID:id}, res => {
if(res.data.resultCode == 1) {
this.getList()
this.$message.success(res.data.message);
} else {
this.$message.error(res.data.message);
}
}, err => {})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}, },
remoteMethod(query) { remoteMethod(query) {
if (query !== ''||this.addShow) { if (query !== ''||this.addShow) {
this.loading2 = true; this.loading2 = true;
this.apipost("admin_Get_Chat_All_SelectEmpName",{ EmName:query },res => { this.apipost("admin_Get_Chat_All_SelectEmpName",{ EmName:query },res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.searchList = res.data.data; this.searchList = res.data.data;
this.loading2 = false; this.loading2 = false;
} }
},err => {}); },err => {});
} else {
this.searchList = [];
this.loading2 = false;
}
},
getList(){
this.loading = true;
this.apipost('Window_post_GetAccountantPageList',this.msg, res => {
if(res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
if(this.total>0){
this.noData =false;
}else{
this.noData =true;
}
} else { } else {
this.$message.error(res.data.message); this.searchList = [];
this.loading2 = false;
} }
this.loading = false; },
}, err => {this.loading = false;}) getList(){
this.loading = true;
this.apipost('Window_post_GetAccountantPageList',this.msg, res => {
if(res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
if(this.total>0){
this.noData =false;
}else{
this.noData =true;
}
} else {
this.$message.error(res.data.message);
}
this.loading = false;
}, err => {this.loading = false;})
}, },
editCurency(id){ // 修改 根据id 获取信息 editCurency(id){ // 修改 根据id 获取信息
this.apipost('Window_post_GetAccountant',{ID:id}, res => { this.apipost('Window_post_GetAccountant',{ID:id}, res => {
if(res.data.resultCode == 1) { if(res.data.resultCode == 1) {
let data = res.data.data; let data = res.data.data;
this.addMsg = data; // data.CostList.forEach(x=>{
this.addMsg.TypelistArr = []; // this.CostIdS.push(x.CostTypeId);
data.accountant_list.forEach(x=>{ // })
this.addMsg.TypelistArr.push(x.CostTypeId); this.addMsg = data;
}) this.addMsg.listArr = [];
this.addMsg.listArr = []; if(data.emList&&data.emList.length>0){
if(data.emList&&data.emList.length>0){ data.emList.forEach(x=>{
data.emList.forEach(x=>{ this.remoteMethod(x.emName);
this.remoteMethod(x.emName); this.addMsg.listArr.push(x.EmId)
this.addMsg.listArr.push(x.EmId) })
}) }
} this.addMsg.accountant_list = [];
this.addShow = true; this.addShow = true;
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message);
} }
}, err => {}) }, err => {})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getList(); this.getList();
}, },
cancelEdit(){ // 取消修改、新增 cancelEdit(){ // 取消修改、新增
this.addMsg = { this.addMsg = {
ID:0, ID:0,
Name:'', Name:'',
accountant_list:[], accountant_list:[],
emList:[], emList:[],
listArr:[], listArr:[],
BranchId:'', BranchId:'',
Direct:'', Direct:''
TypelistArr:[], }
} this.CostIdS = [];
this.CostIdS = []; this.searchList = [];
this.searchList = [];
}, },
resetForm(formName) {//弹出框取消 初始化谈框内表单 resetForm(formName) {//弹出框取消 初始化谈框内表单
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
}, },
getCompanyList(){ //获取公司列表 getCompanyList(){ //获取公司列表
this.apipost('admin_get_BranchGetList',this.getCompanyMsg,res=>{ this.apipost('admin_get_BranchGetList',this.getCompanyMsg,res=>{
if(res.data.resultCode==1){ if(res.data.resultCode==1){
let data = res.data.data let data = res.data.data
this.CompanyList=res.data.data; this.CompanyList=res.data.data;
}else{} }else{}
},err=>{}) },err=>{})
}, },
},mounted(){ },mounted(){
this.getList(); this.getList();
......
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