费用推送审核修改
This commit is contained in:
		
							parent
							
								
									5305aa1169
								
							
						
					
					
						commit
						1116b9a9a5
					
				| 
						 | 
				
			
			@ -30,7 +30,7 @@ export function submitFee(params){
 | 
			
		|||
// 查询费用推送审核租赁列表
 | 
			
		||||
export function getLeaseList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/material/iws_cost_push/getLeaseCostsByAgreementIdAndMonth',
 | 
			
		||||
    url: '/material/slt_agreement_info/leasePeriodCostDetails',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -111,13 +111,19 @@
 | 
			
		|||
          </span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="费用所属" align="center" prop="settlementType" width="100" >
 | 
			
		||||
        <template slot-scope="scope" >
 | 
			
		||||
          <el-tag v-if="scope.row.settlementType == 1" type="primary" size="small">工器具</el-tag>
 | 
			
		||||
          <el-tag v-if="scope.row.settlementType == 2" type="warning" size="small">安全用品</el-tag>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="租赁费用" align="center" prop="leaseMoney" >
 | 
			
		||||
        <template slot-scope="scope" >
 | 
			
		||||
          <span class="clickText" v-if="scope.row.leaseMoney!=null && scope.$index!=pushReviewList.length-1"  @click="openLease(scope.row)">
 | 
			
		||||
            {{scope.row.leaseMoney}}
 | 
			
		||||
          </span>
 | 
			
		||||
          <span  v-if="scope.row.leaseMoney!=null && scope.$index==pushReviewList.length-1"  >
 | 
			
		||||
            {{scope.row.leaseMoney}}
 | 
			
		||||
            {{Number(scope.row.leaseMoney).toFixed(3)}}
 | 
			
		||||
          </span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
| 
						 | 
				
			
			@ -127,7 +133,7 @@
 | 
			
		|||
            {{scope.row.repairMoney}}
 | 
			
		||||
          </span>
 | 
			
		||||
          <span v-if="scope.row.repairMoney!=null && scope.$index==pushReviewList.length-1"  >
 | 
			
		||||
            {{scope.row.repairMoney}}
 | 
			
		||||
            {{Number(scope.row.repairMoney).toFixed(3)}}
 | 
			
		||||
          </span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
| 
						 | 
				
			
			@ -137,7 +143,7 @@
 | 
			
		|||
            {{scope.row.scrapMoney}}
 | 
			
		||||
          </span>
 | 
			
		||||
          <span v-if="scope.row.scrapMoney!=null && scope.$index==pushReviewList.length-1"  >
 | 
			
		||||
            {{scope.row.scrapMoney}}
 | 
			
		||||
            {{Number(scope.row.scrapMoney).toFixed(3)}}
 | 
			
		||||
          </span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
| 
						 | 
				
			
			@ -147,13 +153,16 @@
 | 
			
		|||
            {{scope.row.lostMoney}}
 | 
			
		||||
          </span>
 | 
			
		||||
          <span v-if="scope.row.lostMoney!=null && scope.$index==pushReviewList.length-1"  >
 | 
			
		||||
            {{scope.row.lostMoney}}
 | 
			
		||||
            {{Number(scope.row.lostMoney).toFixed(3)}}
 | 
			
		||||
          </span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="合计费用" align="center" prop="money"  show-overflow-tooltip >
 | 
			
		||||
        <template slot-scope="scope" >
 | 
			
		||||
          <span  v-if="scope.row.money!=null"  >
 | 
			
		||||
          <span  v-if="scope.row.money!=null && scope.$index==pushReviewList.length-1"  >
 | 
			
		||||
            {{Number(scope.row.money).toFixed(3)}}
 | 
			
		||||
          </span>
 | 
			
		||||
          <span  v-if="scope.row.money!=null && scope.$index!=pushReviewList.length-1"  >
 | 
			
		||||
            {{scope.row.money}}
 | 
			
		||||
          </span>
 | 
			
		||||
        </template>
 | 
			
		||||
| 
						 | 
				
			
			@ -184,7 +193,7 @@
 | 
			
		|||
    </div> -->
 | 
			
		||||
 | 
			
		||||
      <!-- 租赁费用弹窗-->
 | 
			
		||||
      <el-dialog :title="title" :visible.sync="showLease" width="1200px"  append-to-body>
 | 
			
		||||
      <el-dialog :title="title" :visible.sync="showLease" width="1300px"  append-to-body>
 | 
			
		||||
        <el-form :model="dialogLease" ref="dialogLease" size="small" :inline="true" label-width="80px">
 | 
			
		||||
          <el-form-item label="物资名称" prop="typeName">
 | 
			
		||||
          <el-input
 | 
			
		||||
| 
						 | 
				
			
			@ -220,15 +229,22 @@
 | 
			
		|||
          <el-table-column label="序号" align="center" width="80" type="index" />
 | 
			
		||||
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="计量单位" align="center" prop="mtUnitName" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="租赁单价" align="center" prop="leasePrice" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="租赁数量" align="center" prop="leaseNum" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="租赁日期" align="center" prop="leaseDate"  width="170px"/>
 | 
			
		||||
          <el-table-column label="归还日期" align="center" prop="backDate"  width="170px"/>
 | 
			
		||||
          <el-table-column label="租赁天数" align="center" prop="leaseDays" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="租赁费用" align="center" width="126px" prop="leaseMoney" :show-overflow-tooltip="true">
 | 
			
		||||
          <el-table-column label="租赁数量" align="center" prop="num" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="计算开始时间" align="center" prop="calcStartTime"  width="120px"/>
 | 
			
		||||
          <el-table-column label="计算结束时间" align="center" prop="calcEndTime"  width="120px"/>
 | 
			
		||||
          <el-table-column label="实际开始时间" align="center" prop="startTime"  width="120px"/>
 | 
			
		||||
          <el-table-column label="实际结束时间" align="center" prop="endTime"  width="120px">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
                {{ scope.row.leaseMoney.toFixed(2) }}
 | 
			
		||||
              <span v-if="scope.row.endTime">{{ scope.row.endTime }}</span>
 | 
			
		||||
              <span v-else style="color: #909399;">未归还</span>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column label="租赁天数" align="center" prop="leaseDays" :show-overflow-tooltip="true"/>
 | 
			
		||||
          <el-table-column label="租赁费用" align="center" width="126px" prop="leaseCost" :show-overflow-tooltip="true">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
                {{ scope.row.leaseCost.toFixed(2) }}
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>            
 | 
			
		||||
        </el-table>
 | 
			
		||||
| 
						 | 
				
			
			@ -492,6 +508,7 @@ export default {
 | 
			
		|||
      },
 | 
			
		||||
      dialogLeaseTotal: 0,
 | 
			
		||||
      leaseAllMoney: 0,
 | 
			
		||||
      currentLeaseRow: null, // 当前租赁费用行数据
 | 
			
		||||
 | 
			
		||||
      //维修费用弹窗
 | 
			
		||||
      showRepair: false,
 | 
			
		||||
| 
						 | 
				
			
			@ -630,6 +647,13 @@ export default {
 | 
			
		|||
      /** 查询列表 */
 | 
			
		||||
      getList() {
 | 
			
		||||
        this.loading = true;
 | 
			
		||||
        // 重置合计变量,避免重复累加
 | 
			
		||||
        this.leaseAll = 0;
 | 
			
		||||
        this.repairAll = 0;
 | 
			
		||||
        this.scrapAll = 0;
 | 
			
		||||
        this.loseAll = 0;
 | 
			
		||||
        this.moneyAll = 0;
 | 
			
		||||
        
 | 
			
		||||
        console.log(this.queryParams.month)
 | 
			
		||||
        getPushReviewList(this.queryParams).then((response) => {
 | 
			
		||||
          this.pushReviewList = response.rows;
 | 
			
		||||
| 
						 | 
				
			
			@ -653,12 +677,17 @@ export default {
 | 
			
		|||
          this.pushReviewList.push(obj)
 | 
			
		||||
          this.loading = false;
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        this.loading = false;
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      /** 重置按钮操作 */
 | 
			
		||||
      resetQuery() {
 | 
			
		||||
        // 重置合计变量
 | 
			
		||||
        this.leaseAll = 0;
 | 
			
		||||
        this.repairAll = 0;
 | 
			
		||||
        this.scrapAll = 0;
 | 
			
		||||
        this.loseAll = 0;
 | 
			
		||||
        this.moneyAll = 0;
 | 
			
		||||
        
 | 
			
		||||
        this.queryParams = {
 | 
			
		||||
          pageNum: 1,
 | 
			
		||||
          pageSize: 10,
 | 
			
		||||
| 
						 | 
				
			
			@ -702,13 +731,26 @@ export default {
 | 
			
		|||
        this.dialogLease.typeName = ""
 | 
			
		||||
        this.dialogLease.modelName = ""
 | 
			
		||||
        this.dialogLease.id = row.id;
 | 
			
		||||
        this.currentLeaseRow = row; // 保存当前行数据
 | 
			
		||||
        this.getLeaseList(row)
 | 
			
		||||
      },
 | 
			
		||||
      //查询租赁费用
 | 
			
		||||
      getLeaseList(row) {
 | 
			
		||||
        this.loading = true;
 | 
			
		||||
        
 | 
			
		||||
        // 根据选择的月份计算开始日期和结束日期
 | 
			
		||||
        const selectedMonth = this.queryParams.month; // 格式: "2024-08"
 | 
			
		||||
        const startDate = selectedMonth + '-01'; // 月份第一天
 | 
			
		||||
        
 | 
			
		||||
        // 计算月份最后一天
 | 
			
		||||
        const year = parseInt(selectedMonth.split('-')[0]);
 | 
			
		||||
        const month = parseInt(selectedMonth.split('-')[1]);
 | 
			
		||||
        const endDate = new Date(year, month, 0).toISOString().split('T')[0]; // 当月最后一天
 | 
			
		||||
        
 | 
			
		||||
        let params = {
 | 
			
		||||
          month: this.queryParams.month,
 | 
			
		||||
          startDate: startDate,
 | 
			
		||||
          endDate: endDate,
 | 
			
		||||
          agreementId: row.agreementId,
 | 
			
		||||
          typeName: this.dialogLease.typeName,
 | 
			
		||||
          modelName: this.dialogLease.modelName,
 | 
			
		||||
| 
						 | 
				
			
			@ -717,14 +759,14 @@ export default {
 | 
			
		|||
          this.dialogLeaseList = response.rows;
 | 
			
		||||
          this.leaseAllMoney = 0;
 | 
			
		||||
          this.dialogLeaseList.forEach(item => {
 | 
			
		||||
            this.leaseAllMoney += Number(item.leaseMoney);
 | 
			
		||||
            this.leaseAllMoney += Number(item.leaseCost);
 | 
			
		||||
          })
 | 
			
		||||
          this.dialogLeaseTotal = response.total;
 | 
			
		||||
          this.loading = false;
 | 
			
		||||
        });
 | 
			
		||||
      },
 | 
			
		||||
      handleQueryLease() {
 | 
			
		||||
        this.getLeaseList()
 | 
			
		||||
        this.getLeaseList(this.currentLeaseRow)
 | 
			
		||||
      },
 | 
			
		||||
      //导出租赁费用
 | 
			
		||||
      handleExportLease() {
 | 
			
		||||
| 
						 | 
				
			
			@ -875,13 +917,13 @@ export default {
 | 
			
		|||
      objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
        if (rowIndex === this.pushReviewList.length-1 && columnIndex == 1) {
 | 
			
		||||
          let rowspan = 2
 | 
			
		||||
          let colspan = 6
 | 
			
		||||
          let colspan = 7  // 增加了结算类型列,所以从6改为7
 | 
			
		||||
          return { rowspan, colspan }
 | 
			
		||||
        }
 | 
			
		||||
        // 解决偏移的重要代码
 | 
			
		||||
        // 重点在 else if 判断必须加因为合并单元格数据会出现偏移、
 | 
			
		||||
        // 否则如果是 第二行 的 第二列 那么隐藏原有第二行 的 第二列的数据使他隐藏
 | 
			
		||||
        else if (rowIndex === this.pushReviewList.length-1 && columnIndex < 6) {
 | 
			
		||||
        else if (rowIndex === this.pushReviewList.length-1 && columnIndex < 7) {  // 从6改为7
 | 
			
		||||
          return {
 | 
			
		||||
            rowspan: 0,
 | 
			
		||||
            colspan: 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue