|
|
@@ -1,37 +1,71 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="flex-align-stretch">
|
|
|
-<!-- <div class="mt-10">
|
|
|
- <label class="search__label">状态:</label>
|
|
|
- <el-select class="inline-16" v-model="param.content.where.status" placeholder="请选择状态" @change="selectChange" size="small" clearable>
|
|
|
- <el-option label="新建" value="新建"></el-option>
|
|
|
- <el-option label="审核" value="审核"></el-option>
|
|
|
- </el-select>
|
|
|
- </div>-->
|
|
|
+ <div class="mt-10 inline-16">
|
|
|
+ <label class="search__label">部门:</label>
|
|
|
+ <el-cascader ref="selectdep" v-model="depment" :options="deplist" :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}"
|
|
|
+ clearable
|
|
|
+ size="small" @change="selectDep"></el-cascader>
|
|
|
+ </div>
|
|
|
<div class="mt-10 inline-16">
|
|
|
<el-input style="width:200px;" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
<div class="mt-10 inline-16">
|
|
|
- <addDetail :status="data.status" @onSuccess="listData"></addDetail>
|
|
|
+ <addDetail :status="data.status" @onSuccess="listData"></addDetail>
|
|
|
</div>
|
|
|
<div class="mt-10 inline-16">
|
|
|
- <exportFile :param="param" :columns="tablecols" fileName="收入列表"></exportFile>
|
|
|
+ <el-button @click="delDetail" :type="delData.length == 0 || data.status == '发放'?'':'primary'" size="small" :disabled="delData.length == 0 || data.status == '发放'">删 除</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="mt-10 inline-16">
|
|
|
+ <exportFile :param="param" :columns="tablecols" fileName="收入列表"></exportFile>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 376px)" :width="true" :custom="true" fixedName="operation">
|
|
|
+ <tableNewLayout :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 376px)" :width="true" :custom="true" fixedName="operation amount" :checkbox="true" @selectionChange="selectionChange">
|
|
|
<template v-slot:customcol="scope">
|
|
|
- <div v-if="scope.column.columnname === 'remarks'">
|
|
|
- {{scope.column.data.sourcenote !== '' && scope.column.data.remarks !== ''?'系统备注:' + scope.column.data.sourcenote + ';人工备注:' + scope.column.data.remarks :
|
|
|
- scope.column.data.sourcenote !== ''?'系统备注:' + scope.column.data.sourcenote : scope.column.data.remarks !== ''?'人工备注:' + scope.column.data.remarks:'--'}}
|
|
|
+ <div v-if="scope.column.columnname === 'orderrate'">
|
|
|
+ <div>
|
|
|
+ {{ scope.column.data.orderrate ? Math.round((scope.column.data.orderrate * 100) * 100) / 100 + '%' : scope.column.data[[scope.column.columnname]] == 0?'0%':'--' }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'rate'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?Math.round((scope.column.data[[scope.column.columnname]] * 100) * 100) / 100 + '%':scope.column.data[[scope.column.columnname]] == 0?'0%':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'allocation_rate'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?Math.round((scope.column.data[[scope.column.columnname]] * 100) * 100) / 100 + '%':scope.column.data[[scope.column.columnname]] == 0?'0%':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'orderprice'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'orderamount'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'price'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
</div>
|
|
|
- <div v-else-if="scope.column.columnname === 'relaamount'">
|
|
|
- {{tool.formatAmount(scope.column.data[[scope.column.columnname]],2)}}
|
|
|
+ <div v-else-if="scope.column.columnname === 'cashbilldetailamount'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
</div>
|
|
|
- <div v-else-if="scope.column.columnname === 'status'">
|
|
|
- <span :style="{color:scope.column.data.status == '新建'?'#333333':'#52c41a'}">
|
|
|
- {{scope.column.data[[scope.column.columnname]]}}
|
|
|
- </span>
|
|
|
+ <div v-else-if="scope.column.columnname === 'orderExpectedamount'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'rewardamount'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'payapplyamount'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'unpayapplyamount'">
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'amount'">
|
|
|
+ <div v-if="data.status != '发放' ">
|
|
|
+ <el-input v-model.number="scope.column.data.amount" placeholder="本次发放金额" @change="amountChange(scope.column.data.amount,scope.column.data)" size="small"></el-input>
|
|
|
+ <p style="color: red" v-if="isCheck && sa_hrcashbilldetailid == scope.column.data.sa_hrcashbilldetailid">不得大于未发放金额</p>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ {{scope.column.data[[scope.column.columnname]]?'¥ '+ tool.formatAmount(scope.column.data[[scope.column.columnname]],2):scope.column.data[[scope.column.columnname]] == 0?'¥ 0.00':'--'}}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
{{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
|
|
|
@@ -39,7 +73,6 @@
|
|
|
</template>
|
|
|
<template v-slot:opreation="scope">
|
|
|
<el-button type="text" size="mini" @click="goDetail(scope.data)">详 情</el-button>
|
|
|
- <el-button type="text" size="mini" @click="delDetail(scope.data)" :disabled="data.status == '发放'">删 除</el-button>
|
|
|
</template>
|
|
|
</tableNewLayout>
|
|
|
<div class="container normal-panel" style="text-align:right">
|
|
|
@@ -48,7 +81,7 @@
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page="currentPage"
|
|
|
- :page-sizes="[20, 20, 100, 200]"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
:page-size="20"
|
|
|
layout="total,sizes, prev, pager, next, jumper"
|
|
|
:total="total">
|
|
|
@@ -74,14 +107,26 @@ export default {
|
|
|
"pageSize": 20,
|
|
|
"where": {
|
|
|
"condition": "",
|
|
|
- "status":""
|
|
|
+ "departmentid":""
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
tablecols:[],
|
|
|
list:[],
|
|
|
total:0,
|
|
|
- currentPage:0
|
|
|
+ currentPage:0,
|
|
|
+ delData:[],
|
|
|
+ isCheck:false,
|
|
|
+ sa_hrcashbilldetailid:'',
|
|
|
+ depmentParam: {
|
|
|
+ classname: "webmanage.department.department",
|
|
|
+ method: "querydepartment",
|
|
|
+ content: {}
|
|
|
+ },
|
|
|
+ depment: '',
|
|
|
+ deplist: [],
|
|
|
+ pageTotal:0,
|
|
|
+ listqueryid:'',
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
@@ -91,6 +136,9 @@ export default {
|
|
|
this.list = res.data
|
|
|
this.total = res.total
|
|
|
this.currentPage = res.pageNumber
|
|
|
+ this.pageTotal = res.pageTotal
|
|
|
+ this.listqueryid = res.listqueryid
|
|
|
+ sessionStorage.setItem('total',res.total)
|
|
|
},
|
|
|
selectChange(){
|
|
|
this.listData()
|
|
|
@@ -106,7 +154,6 @@ export default {
|
|
|
this.listData()
|
|
|
},
|
|
|
goDetail(val){
|
|
|
- console.log(val)
|
|
|
this.$store.dispatch('changeDetailDrawer',false)
|
|
|
this.$nextTick(()=>{
|
|
|
let route = this.$route
|
|
|
@@ -114,17 +161,19 @@ export default {
|
|
|
this.oldRoute = {path:route.path,query:route.query}
|
|
|
this.$store.dispatch('setHistoryRouter',this.oldRoute)
|
|
|
}
|
|
|
-
|
|
|
+ sessionStorage.setItem('listqueryid',this.listqueryid)
|
|
|
+ sessionStorage.setItem('isGo','1')
|
|
|
this.$router.push({
|
|
|
path:'/salerIncomeDetail',
|
|
|
- query:{id:val.sa_hrcashbillid}
|
|
|
+ query:{id:val.sa_hrcashbillid,rowindex:val.rowindex,
|
|
|
+ listqueryid:this.listqueryid,fieldname:'sa_hrcashbillid'}
|
|
|
})
|
|
|
this.$store.dispatch('changeDetailDrawer',true)
|
|
|
})
|
|
|
},
|
|
|
/*删除*/
|
|
|
delDetail(val){
|
|
|
- this.$confirm('此操作将删除当前数据, 是否继续?', '提示', {
|
|
|
+ this.$confirm('删除所选明细,是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
@@ -133,11 +182,12 @@ export default {
|
|
|
"id": 20240117105904,
|
|
|
"content": {
|
|
|
"sa_hrpayapplyid": this.$route.query.id,
|
|
|
- "sa_hrpayapplydetails":[val.sa_hrpayapplydetailid]
|
|
|
+ "sa_hrpayapplydetails":this.delData
|
|
|
}
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
this.listData()
|
|
|
+ this.$emit('delSuccess')
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
|
@@ -146,10 +196,102 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ selectionChange(val){
|
|
|
+ this.delData = val.map(item=>item.sa_hrpayapplydetailid)
|
|
|
+ },
|
|
|
+ async amountChange(val,data){
|
|
|
+ if (val > data.unpayapplyamount){
|
|
|
+ this.isCheck = true
|
|
|
+ this.sa_hrcashbilldetailid = data.sa_hrcashbilldetailid
|
|
|
+ }else {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20240117105704",
|
|
|
+ "content": {
|
|
|
+ "sa_hrpayapplyid": this.$route.query.id,
|
|
|
+ "hrpayapplydetail": [
|
|
|
+ {
|
|
|
+ "sa_hrpayapplydetailid": data.sa_hrpayapplydetailid,
|
|
|
+ "amount": data.amount,
|
|
|
+ "sa_hrcashbillid": data.sa_hrcashbillid,
|
|
|
+ "sa_hrcashbilldetailid":data.sa_hrcashbilldetailid
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.isCheck = false
|
|
|
+ this.listData(this.param.content.pageNumner = 1)
|
|
|
+ this.$emit('delSuccess')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async departmentrtment() {
|
|
|
+ const res = await this.$api.requested(this.depmentParam);
|
|
|
+ this.deplist = this.createMenu(res.data)
|
|
|
+ },
|
|
|
+ createMenu(array) {
|
|
|
+ var that = this;
|
|
|
+ let arr = [];
|
|
|
+
|
|
|
+ function convertToElementTree(node) {
|
|
|
+ // 新节点
|
|
|
+ if (node.subdep.length === 0) {
|
|
|
+ var elNode = {
|
|
|
+ label: node["depname"],
|
|
|
+ parentid: node['parentid'],
|
|
|
+ parentname: node['parentname'],
|
|
|
+ departmentid: node["departmentid"],
|
|
|
+ value: node["departmentid"],
|
|
|
+ remarks: node["remarks"],
|
|
|
+ isused: node["isused"],
|
|
|
+ changedate: node['changedate'],
|
|
|
+ changeby: node['changeby'],
|
|
|
+ createdate: node['createdate'],
|
|
|
+ createby: node['createby'],
|
|
|
+ depno: node['depno'],
|
|
|
+ disabled: that.pageOnlyRead,
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var elNode = {
|
|
|
+ label: node["depname"],
|
|
|
+ parentid: node['parentid'],
|
|
|
+ parentname: node['parentname'],
|
|
|
+ departmentid: node["departmentid"],
|
|
|
+ value: node["departmentid"],
|
|
|
+ remarks: node["remarks"],
|
|
|
+ isused: node["isused"],
|
|
|
+ changedate: node['changedate'],
|
|
|
+ changeby: node['changeby'],
|
|
|
+ createdate: node['createdate'],
|
|
|
+ createby: node['createby'],
|
|
|
+ depno: node['depno'],
|
|
|
+ disabled: that.pageOnlyRead,
|
|
|
+ children: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (node.subdep && node.subdep.length > 0) {
|
|
|
+ // 如果存在子节点
|
|
|
+ for (var index = 0; index < node.subdep.length; index++) {
|
|
|
+ // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
|
|
|
+ elNode.children.push(convertToElementTree(node.subdep[index]));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return elNode;
|
|
|
+ }
|
|
|
+
|
|
|
+ array.forEach((element) => {
|
|
|
+ arr.push(convertToElementTree(element))
|
|
|
+ });
|
|
|
+ return arr
|
|
|
+ },
|
|
|
+ selectDep(val) {
|
|
|
+ this.person = '';
|
|
|
+ this.param.content.where.departmentid = val[val.length - 1];
|
|
|
+ this.listData(this.param.content.pageNumner = 1)
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.listData()
|
|
|
+ this.departmentrtment()
|
|
|
},
|
|
|
created() {
|
|
|
console.log(this.tool.tabelCol(this.$route.name).incomesTable.tablecols,'tablecols')
|