费用推送
This commit is contained in:
		
							parent
							
								
									15d7e404b2
								
							
						
					
					
						commit
						50eec81888
					
				| 
						 | 
				
			
			@ -182,3 +182,21 @@ export function submitPushCosts(params){
 | 
			
		|||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 安全工机具租赁费用推送审核提交
 | 
			
		||||
export function submitPushSafetyCosts(params){
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/material/iws_cost_push/safetyMaterialCostPush',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: params
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 安全工机具消耗性费用推送审核提交
 | 
			
		||||
export function submitPushSafetyConsumeCosts(params){
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/material/iws_cost_push/safetyConsumeMaterialCostPush',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: params
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,7 +60,7 @@
 | 
			
		|||
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出数据</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="primary" size="mini" :disabled="selectionList.length == 0" @click="submit">提 交</el-button>
 | 
			
		||||
        <el-button type="primary" size="mini"  @click="submit">提 交</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
			
		||||
    </el-row>
 | 
			
		||||
| 
						 | 
				
			
			@ -70,13 +70,15 @@
 | 
			
		|||
      fit
 | 
			
		||||
      highlight-current-row
 | 
			
		||||
      show-summary
 | 
			
		||||
      :summary-method="getSummaries"
 | 
			
		||||
      ref="multipleTable"
 | 
			
		||||
      row-key="id"
 | 
			
		||||
      :summary-method="ge---tSummaries"
 | 
			
		||||
      style="width: 100%"
 | 
			
		||||
      :max-height="650"
 | 
			
		||||
      @selection-change="selectionChange"
 | 
			
		||||
    >
 | 
			
		||||
      <!-- 多选 -->
 | 
			
		||||
      <el-table-column type="selection" width="65" align="center" :selectable="row => row.pushStatus == 0" />
 | 
			
		||||
      <el-table-column type="selection" width="65" align="center" :selectable="row => row.pushStatus != 1" />
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        type="index"
 | 
			
		||||
        width="55"
 | 
			
		||||
| 
						 | 
				
			
			@ -155,7 +157,7 @@
 | 
			
		|||
 | 
			
		||||
<script>
 | 
			
		||||
import { getProjectList, getUnitList, getAgreementInfoById } from '@/api/back/index.js'
 | 
			
		||||
import { getConsumPushCheckList, getConsumPushCheckListCount, consumeCheckData } from '@/api/costPush/costPush'
 | 
			
		||||
import { getConsumPushCheckList, getConsumPushCheckListCount, submitPushSafetyConsumeCosts } from '@/api/costPush/costPush'
 | 
			
		||||
import TreeSelect from '@riophae/vue-treeselect'
 | 
			
		||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -164,6 +166,13 @@ export default {
 | 
			
		|||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      showSearch: true,
 | 
			
		||||
      // 非单个禁用
 | 
			
		||||
      single: true,
 | 
			
		||||
      // 非多个禁用
 | 
			
		||||
      multiple: true,
 | 
			
		||||
      // 多选框选中数据
 | 
			
		||||
      ids: [],
 | 
			
		||||
      taskId:[],
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNum: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
| 
						 | 
				
			
			@ -265,9 +274,12 @@ export default {
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 多选
 | 
			
		||||
    selectionChange(val) {
 | 
			
		||||
      console.log('selectionChange', val)
 | 
			
		||||
      this.selectionList = val
 | 
			
		||||
    selectionChange(selection) {
 | 
			
		||||
      console.log("xxxxxxxxxxxxx",selection)
 | 
			
		||||
        this.taskId = selection.map((item) => item.taskId).filter(id => id != null)
 | 
			
		||||
        this.ids = selection.map((item) => item.agreementId).filter(id => id != null)
 | 
			
		||||
        this.single = selection.length != 1
 | 
			
		||||
        this.multiple = !selection.length
 | 
			
		||||
    },
 | 
			
		||||
    // 合计
 | 
			
		||||
    getSummaries() {
 | 
			
		||||
| 
						 | 
				
			
			@ -360,6 +372,15 @@ export default {
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    submit() {
 | 
			
		||||
      this.ids = this.ids.filter(id => id != null)
 | 
			
		||||
        console.log("xxxxxxxxxxxxxxx",this.ids)
 | 
			
		||||
        if (this.ids.length == 0) {
 | 
			
		||||
              this.$message({
 | 
			
		||||
                type: 'warning',
 | 
			
		||||
                message: '请选择数据',
 | 
			
		||||
              })
 | 
			
		||||
            return;
 | 
			
		||||
      }
 | 
			
		||||
      // 弹框确认
 | 
			
		||||
      this.$confirm('是否确认提交?', '提示', {
 | 
			
		||||
        confirmButtonText: '确定',
 | 
			
		||||
| 
						 | 
				
			
			@ -368,8 +389,11 @@ export default {
 | 
			
		|||
      })
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          try {
 | 
			
		||||
            const cheks = JSON.stringify(this.selectionList)
 | 
			
		||||
            consumeCheckData(cheks).then(res => {
 | 
			
		||||
            let params = {
 | 
			
		||||
              agreementIds: this.ids.filter(id => id != null),
 | 
			
		||||
              taskId: this.taskId.filter(id => id!= null)[0]
 | 
			
		||||
            }
 | 
			
		||||
            submitPushSafetyConsumeCosts(params).then(res => {
 | 
			
		||||
              // 确定
 | 
			
		||||
              this.$message({
 | 
			
		||||
                type: 'success',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,7 +61,7 @@
 | 
			
		|||
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出数据</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="1.5">
 | 
			
		||||
        <el-button type="primary" size="mini" :disabled="selectionList.length == 0" @click="submit">提 交</el-button>
 | 
			
		||||
        <el-button type="primary" size="mini"  @click="submit">提 交</el-button>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 | 
			
		||||
    </el-row>
 | 
			
		||||
| 
						 | 
				
			
			@ -71,13 +71,15 @@
 | 
			
		|||
      fit
 | 
			
		||||
      highlight-current-row
 | 
			
		||||
      show-summary
 | 
			
		||||
      ref="multipleTable"
 | 
			
		||||
      row-key="id"
 | 
			
		||||
      :summary-method="getSummaries"
 | 
			
		||||
      style="width: 100%"
 | 
			
		||||
      :max-height="650"
 | 
			
		||||
      @selection-change="selectionChange"
 | 
			
		||||
    >
 | 
			
		||||
      <!-- 多选 -->
 | 
			
		||||
      <el-table-column type="selection" width="65" align="center" :selectable="row => row.pushStatus == 0" />
 | 
			
		||||
      <el-table-column type="selection" width="65" align="center" :selectable="row => row.pushStatus != 1" />
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        type="index"
 | 
			
		||||
        width="55"
 | 
			
		||||
| 
						 | 
				
			
			@ -114,13 +116,13 @@
 | 
			
		|||
    </el-table>
 | 
			
		||||
 | 
			
		||||
    <!-- 分页 -->
 | 
			
		||||
    <pagination
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
      v-show="total > 0"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      :page.sync="queryParams.pageNum"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    /> -->
 | 
			
		||||
 | 
			
		||||
    <!-- 弹框 -->
 | 
			
		||||
    <el-dialog title="查看" :visible.sync="dialogVisible" width="70%">
 | 
			
		||||
| 
						 | 
				
			
			@ -176,7 +178,7 @@
 | 
			
		|||
 | 
			
		||||
<script>
 | 
			
		||||
import { getProjectList, getUnitList, getAgreementInfoById } from '@/api/back/index.js'
 | 
			
		||||
import { getCostPushCheckList, getCostPushCheckListCount, checkData,getCostPushLeaseListApi } from '@/api/costPush/costPush'
 | 
			
		||||
import { getCostPushCheckList, getCostPushCheckListCount, submitPushSafetyCosts,getCostPushLeaseListApi } from '@/api/costPush/costPush'
 | 
			
		||||
import TreeSelect from '@riophae/vue-treeselect'
 | 
			
		||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -185,6 +187,13 @@ export default {
 | 
			
		|||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      showSearch: true,
 | 
			
		||||
      // 非单个禁用
 | 
			
		||||
      single: true,
 | 
			
		||||
      // 非多个禁用
 | 
			
		||||
      multiple: true,
 | 
			
		||||
      // 多选框选中数据
 | 
			
		||||
      ids: [],
 | 
			
		||||
      taskId:[],
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNum: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
| 
						 | 
				
			
			@ -318,9 +327,12 @@ export default {
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 多选
 | 
			
		||||
    selectionChange(val) {
 | 
			
		||||
      console.log('selectionChange', val)
 | 
			
		||||
      this.selectionList = val
 | 
			
		||||
    selectionChange(selection) {
 | 
			
		||||
      console.log("xxxxxxxxxxxxx",selection)
 | 
			
		||||
        this.taskId = selection.map((item) => item.taskId).filter(id => id != null)
 | 
			
		||||
        this.ids = selection.map((item) => item.agreementId).filter(id => id != null)
 | 
			
		||||
        this.single = selection.length != 1
 | 
			
		||||
        this.multiple = !selection.length
 | 
			
		||||
    },
 | 
			
		||||
    selectable(row) {
 | 
			
		||||
      console.log('🚀 ~ selectable ~ row:', row)
 | 
			
		||||
| 
						 | 
				
			
			@ -424,6 +436,15 @@ export default {
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    submit() {
 | 
			
		||||
      this.ids = this.ids.filter(id => id != null)
 | 
			
		||||
        console.log("xxxxxxxxxxxxxxx",this.ids)
 | 
			
		||||
        if (this.ids.length == 0) {
 | 
			
		||||
              this.$message({
 | 
			
		||||
                type: 'warning',
 | 
			
		||||
                message: '请选择数据',
 | 
			
		||||
              })
 | 
			
		||||
            return;
 | 
			
		||||
      }
 | 
			
		||||
      // 弹框确认
 | 
			
		||||
      this.$confirm('是否确认提交?', '提示', {
 | 
			
		||||
        confirmButtonText: '确定',
 | 
			
		||||
| 
						 | 
				
			
			@ -432,13 +453,22 @@ export default {
 | 
			
		|||
      })
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          try {
 | 
			
		||||
            const cheks = JSON.stringify(this.selectionList)
 | 
			
		||||
            checkData(cheks).then(res => {
 | 
			
		||||
            let params = {
 | 
			
		||||
              agreementIds: this.ids.filter(id => id != null),
 | 
			
		||||
              taskId: this.taskId.filter(id => id!= null)[0]
 | 
			
		||||
            }
 | 
			
		||||
            submitPushSafetyCosts(params).then(res => {
 | 
			
		||||
              // 确定
 | 
			
		||||
              this.$message({
 | 
			
		||||
                type: 'success',
 | 
			
		||||
                message: '操作成功!'
 | 
			
		||||
              })
 | 
			
		||||
              // 清空勾选框选择状态
 | 
			
		||||
              if (this.$refs.multipleTable) {
 | 
			
		||||
                this.$refs.multipleTable.clearSelection()
 | 
			
		||||
              }
 | 
			
		||||
              // 清空ids数组
 | 
			
		||||
              this.ids = []
 | 
			
		||||
              this.getList()
 | 
			
		||||
            })
 | 
			
		||||
          } catch (error) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -508,6 +508,8 @@ export default {
 | 
			
		|||
      // 多选框选中数据
 | 
			
		||||
      ids: [],
 | 
			
		||||
 | 
			
		||||
      taskId:[],
 | 
			
		||||
 | 
			
		||||
      //租赁费用弹窗
 | 
			
		||||
      showLease: false,
 | 
			
		||||
      dialogLeaseList: [], //租赁费用列表
 | 
			
		||||
| 
						 | 
				
			
			@ -580,10 +582,10 @@ export default {
 | 
			
		|||
        }
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      //多选框选中数据
 | 
			
		||||
      handleSelectionChange(val) {
 | 
			
		||||
        this.ids = val.map(item => item.agreementId);
 | 
			
		||||
      },
 | 
			
		||||
      // //多选框选中数据
 | 
			
		||||
      // handleSelectionChange(val) {
 | 
			
		||||
      //   this.ids = val.map(item => item.agreementId);
 | 
			
		||||
      // },
 | 
			
		||||
 | 
			
		||||
      /** 转换菜单数据结构 */
 | 
			
		||||
      normalizer(node) {
 | 
			
		||||
| 
						 | 
				
			
			@ -721,7 +723,8 @@ export default {
 | 
			
		|||
 | 
			
		||||
      // 多选框选中数据
 | 
			
		||||
      handleSelectionChange(selection) {
 | 
			
		||||
        this.ids = selection.map((item) => item.agreementId)
 | 
			
		||||
        this.taskId = selection.map((item) => item.taskId).filter(id => id != null)
 | 
			
		||||
        this.ids = selection.map((item) => item.agreementId).filter(id => id != null)
 | 
			
		||||
        this.single = selection.length != 1
 | 
			
		||||
        this.multiple = !selection.length
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			@ -895,6 +898,8 @@ export default {
 | 
			
		|||
 | 
			
		||||
      /** 提交 */
 | 
			
		||||
      handleSubmit() {
 | 
			
		||||
        this.ids = this.ids.filter(id => id != null)
 | 
			
		||||
        console.log("xxxxxxxxxxxxxxx",this.ids)
 | 
			
		||||
        if (this.ids.length == 0) {
 | 
			
		||||
              this.$message({
 | 
			
		||||
                type: 'warning',
 | 
			
		||||
| 
						 | 
				
			
			@ -905,23 +910,24 @@ export default {
 | 
			
		|||
        this.$modal
 | 
			
		||||
              .confirm('是否确认提交?')
 | 
			
		||||
          .then(() => {
 | 
			
		||||
                  // let params = {
 | 
			
		||||
                  //   agreementIds:this.ids
 | 
			
		||||
                  // }
 | 
			
		||||
                  // console.log("xxxxxxxxxxxx",params)
 | 
			
		||||
                  // submitPushCosts(params).then((response) => {
 | 
			
		||||
                  //     this.$message({
 | 
			
		||||
                  //         type: 'success',
 | 
			
		||||
                  //         message: '提交成功',
 | 
			
		||||
                  //     })
 | 
			
		||||
                  //     // 清空勾选框选择状态
 | 
			
		||||
                  //     if (this.$refs.multipleTable) {
 | 
			
		||||
                  //       this.$refs.multipleTable.clearSelection()
 | 
			
		||||
                  //     }
 | 
			
		||||
                  //     // 清空ids数组
 | 
			
		||||
                  //     this.ids = []
 | 
			
		||||
                  //     this.getList()
 | 
			
		||||
                  // })
 | 
			
		||||
                  let params = {
 | 
			
		||||
                    agreementIds: this.ids.filter(id => id != null),
 | 
			
		||||
                    taskId: this.taskId.filter(id => id!= null)[0]
 | 
			
		||||
                  }
 | 
			
		||||
                  console.log("xxxxxxxxxxxx",params)
 | 
			
		||||
                  submitPushCosts(params).then((response) => {
 | 
			
		||||
                      this.$message({
 | 
			
		||||
                          type: 'success',
 | 
			
		||||
                          message: '提交成功',
 | 
			
		||||
                      })
 | 
			
		||||
                      // 清空勾选框选择状态
 | 
			
		||||
                      if (this.$refs.multipleTable) {
 | 
			
		||||
                        this.$refs.multipleTable.clearSelection()
 | 
			
		||||
                      }
 | 
			
		||||
                      // 清空ids数组
 | 
			
		||||
                      this.ids = []
 | 
			
		||||
                      this.getList()
 | 
			
		||||
                  })
 | 
			
		||||
              })
 | 
			
		||||
              .catch(() => {})
 | 
			
		||||
     },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -139,7 +139,13 @@
 | 
			
		|||
        :show-overflow-tooltip="column.showOverflowTooltip"
 | 
			
		||||
        align="center"
 | 
			
		||||
        :width="column.width"
 | 
			
		||||
      ></el-table-column>
 | 
			
		||||
      >
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span :style="{ color: column.prop === 'code' && scope.row.isUpdate == 1 ? 'red' : '' }">
 | 
			
		||||
            {{ scope.row[column.prop] }}
 | 
			
		||||
          </span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <!-- 操作 -->
 | 
			
		||||
      <el-table-column label="操作" align="center" width="220">
 | 
			
		||||
        <template slot-scope="{ row }">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue