工单,数据中心用户查看数据的权限,合同考核每日,以及导出每日和按月
4个文件已修改
90 ■■■■ 已修改文件
src/api/platform/calculate-report.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/platform/work-order.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/contract/report/index.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/work-order/index.vue 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/platform/calculate-report.js
@@ -18,9 +18,9 @@
}
// 通过id获取核算报告
export const getCalculateReportById = (contractId,whichYear) => {
export const getCalculateReportById = (contractId,whichYear,whichMoth) => {
    return axios({
        url: "/calculate-report/" + contractId+"/"+whichYear,
        url: "/calculate-report/" + contractId+"/"+whichYear+"/"+whichMoth,
        method: "GET"
    })
}
src/api/platform/work-order.js
@@ -97,6 +97,17 @@
  })
}
export function ywConditionList(data){
  return request({
    url: '/work-order/yw-condition-list',
    method: 'put',
    data: data
  })
}
// 获取工单运维情况
export function getYwCondition(data) {
  return request({
@@ -163,6 +174,4 @@
    method: 'get',
  })
}
src/views/system/contract/report/index.vue
@@ -25,17 +25,17 @@
      >
      <el-card class="box-card" >
        <div slot="header" class="clearfix">
          <span>{{ item.unitName +item.whichYear+"年核算报告" }}</span>
          <span>{{ item.unitName +item.whichYear+"年"+item.whichMonth+"月核算报告" }}</span>
          <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">核算</el-button>
        </div>
        <div class="text item">合同<span class="time">{{ item.contractName }}</span></div>
        <div class="text item">最近扣减金额<span class="time">{{ item.latestDeductMoney ?  item.latestDeductMoney:0 }}</span></div>
        <div class="text item">累计扣减金额<span class="time">{{ item.deductMoney ? item.deductMoney:0}}</span></div>
        <div class="text item">最近核算月份
          <span v-if="item.latestMonth" class="time">{{ item.whichYear }}年{{ item.latestMonth }}月</span>
          <span v-if="item.latestMonth" class="time">{{ item.whichYear }}年{{ item.latestMonth }}月{{item.latestDay}}日</span>
          <span v-else class="time">暂无</span>
        </div>
        <el-button size="small" type="primary" round style="float: right;margin-left: 18px;" @click="handleExport(item.whichYear,null,item.contractId,item.contractName)" v-hasPermi="['system:calculate:report:export']">导出</el-button>
        <el-button size="small" type="primary" round style="float: right;margin-left: 18px;" @click="handleExport(item.whichYear,item.whichMonth,null,item.contractId,item.contractName)" v-hasPermi="['system:calculate:report:export']">导出</el-button>
        <el-button size="small" round style="float: right;margin-bottom: 18px;" @click="handlePublish(item)"  v-hasPermi="['system:calculate:report:status']">确认发布</el-button>
      </el-card>
      </el-col>
@@ -89,7 +89,7 @@
            label="核算月份"
            width="180">
          <template slot-scope="scope">
            <span> {{ scope.row.whichYear +'年'+ scope.row.whichMonth+ '月'}}</span>
            <span> {{ scope.row.whichYear +'年'+ scope.row.whichMonth+ '月' + scope.row.whichDay+ '日'}}</span>
          </template>
          </el-table-column>
          <el-table-column
@@ -141,7 +141,7 @@
              <el-button
                size="small"
                type="text"
                @click="handleExport(scope.row.whichYear,scope.row.whichMonth,detail.contractId,detail.contractName)"
                @click="handleExport(scope.row.whichYear,scope.row.whichMonth,scope.row.whichDay,detail.contractId,detail.contractName)"
              >
                导出
              </el-button>
@@ -287,7 +287,7 @@
      // })
    },
    handleDetail(row) {
      getCalculateReportById(row.contractId,row.whichYear).then(res => {
      getCalculateReportById(row.contractId,row.whichYear,row.whichMonth).then(res => {
        this.detail = res.data
        this.detailTitle = row.unitName + '考核结果'
        this.detailOpen = true
@@ -343,10 +343,11 @@
    },
    /** 导出按钮操作 */
    handleExport(whichYear,whichMonth,contractId,contractName) {
      const name = contractName+whichYear+'年'+(whichMonth==null? '': whichMonth+'月')+'运维核算.xlsx'
    handleExport(whichYear,whichMonth,whichDay,contractId,contractName) {
      const name = contractName+whichYear+'年'+(whichMonth==null? '': whichMonth+'月')+(whichDay==null? '': whichDay+'日')+'运维核算.xlsx'
      this.download('calculate-report/export', {
        ...{ 'whichYear': whichYear,'whichMonth': whichMonth, 'contractId': contractId},
        ...{ 'whichYear': whichYear,'whichMonth': whichMonth,'whichDay':whichDay, 'contractId': contractId},
      }, `${name}`)
    },
    /** 合计行 */
src/views/system/work-order/index.vue
@@ -6,7 +6,7 @@
          <el-menu-item index="0" @click="changeUnit(null, '全部')">
            全部单位({{ totalWorkOrders }})
          </el-menu-item>
          <el-menu-item :index="index + 1" v-for="(item, index) in unitList" :key="index" @click="changeUnit(item.id, item.value)">
          <el-menu-item :index="index + 1 +''" v-for="(item, index) in unitList" :key="index" @click="changeUnit(item.id, item.value)">
            {{ item.unitName }}({{ item.workOrderCount }})
          </el-menu-item>
        </el-menu>
@@ -99,6 +99,7 @@
          v-hasPermi="['work:order:delete']"
        >删除
        </el-button>
        <el-button size="mini" plain type="info" @click="selectedDistribute" class="op">批量上报</el-button>
      </el-col>
    </el-row>
@@ -113,7 +114,7 @@
              <el-row style="display: flex;">
              <el-checkbox  v-if="$store.state.user.roles.includes('admin')"
                            v-model="isItemSelected[item.workOrderNo]"
                            @change="toggleSelection(item.workOrderNo)"
                            @change="toggleSelection(item)"
                            style="margin-right: 10px; "></el-checkbox>
               <el-tooltip
                effect="dark"
@@ -348,10 +349,10 @@
    <el-dialog title="运维情况记录" :visible.sync="ywConditionOpen" width="500px" append-to-body>
      <el-form ref="ywConditionForm" :model="form" :rules="ywConditionRules" label-width="80px">
        <el-form-item label="工单号" prop="workOrderNo">
        <el-form-item label="工单号" prop="workOrderNo" v-if="!isConditionList">
          <el-input v-model="ywConditionForm.workOrderNo" disabled/>
        </el-form-item>
        <el-form-item label="运维单位" prop="unitName">
        <el-form-item label="运维单位" prop="unitName"  v-if="!isConditionList">
          <el-input v-model="ywConditionForm.unitName" disabled/>
        </el-form-item>
        <el-form-item label="现场情况" prop="ywCondition">
@@ -561,6 +562,7 @@
</style>
<script>
import {
  ywConditionList,
  listWorkOrder,
  getWorkOrder,
  delWorkOrder,
@@ -585,6 +587,7 @@
  components: {WorkOrderAuditing},
  data() {
    return {
      isConditionList:false,
      isSelectAll: false, // 全选按钮
      activeIndex: '0',
      drawer: false,
@@ -721,7 +724,8 @@
      ywData: {
        content: '',
        fileList: 'process.env.VUE_APP_BASE_API'
      }
      },
    }
  },
  created() {
@@ -733,6 +737,17 @@
    this.getList()
  },
  methods: {
    selectedDistribute(){
      this.form = {}
      if (this.workOrderNumbers.length < 1) {
        this.$message.warning("请先选择要下发的工单")
        return
      }
      this.form.workOrderNumbers = this.workOrderNumbers;
      this.ywConditionOpen = true
      this.isConditionList = true
    },
    //全选按钮
    toggleSelectAll() {
      this.isSelectAll = !this.isSelectAll;
@@ -833,6 +848,7 @@
      this.form = {}
      this.ywConditionForm = row
      this.ywConditionOpen = true
      this.isConditionList = false
      this.form.id = row.id
    },
    // 运维结果按钮
@@ -905,17 +921,27 @@
    submitYwCondition() {
      this.$refs['ywConditionForm'].validate(valid => {
        if (valid) {
          ywCondition(this.form).then(res => {
            this.ywConditionOpen = false
            this.$modal.msgSuccess('操作成功')
            this.getList()
          })
          if(this.isConditionList){
            ywConditionList(this.form).then(res => {
              this.ywConditionOpen = false
              this.$modal.msgSuccess('操作成功')
              this.getList()
            })
          }else {
            ywCondition(this.form).then(res => {
              this.ywConditionOpen = false
              this.$modal.msgSuccess('操作成功')
              this.getList()
            })
          }
        }
      })
    },
    cancelYwCondition() {
      this.ywConditionForm = {}
      this.ywConditionOpen = false
      this.isConditionList = false
    },
    // 提交运维结果
    submitYwResult() {
@@ -1027,12 +1053,14 @@
      this.multiple = !selection.length
    },
    // 多选框选中数据
    toggleSelection(workOrderNo) {
      const index = this.workOrderNumbers.indexOf(workOrderNo);
    toggleSelection(item) {
      console.log(item.workOrderNo)
      console.log(this.workOrderNumbers)
      const index = this.workOrderNumbers.indexOf(item.workOrderNo);
      if (index > -1) {
        this.workOrderNumbers.splice(index, 1); // 移除选中项
      } else {
        this.workOrderNumbers.push(workOrderNo); // 添加选中项
        this.workOrderNumbers.push(item.workOrderNo); // 添加选中项
      }
    },
    /** 新增按钮操作 */