Calculate.vue 2.21 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
<template>
  <div>
    <CommonInfo :purchaseData="purchaseData"/>
    <div style="margin: 11px 30px;color: #1890ff;">部门长审核</div>
    <el-form label-width="100px">
      <el-form-item label="审核人">{{ purchaseData.purchaseDeptManagerName }}</el-form-item>
    </el-form>
    <el-divider></el-divider>
    <div style="margin: 11px 30px;color: #1890ff;">核算部审批</div>
    <el-row style="margin-left:97px">
      <el-col :span="10">
        <el-row>
          <el-col :span="6">
            <el-radio v-model="radio" label="1">通过</el-radio>
          </el-col>
          <el-col :span="6">
            <el-radio v-model="radio" label="2">不通过</el-radio>
          </el-col>
        </el-row>
      </el-col>
      <el-col :span="10">
        <el-row>
          <el-col :span="5">审核人</el-col>
          <el-col :span="16"><el-input :value="$store.state.user.nickName" style="width: 90px" disabled/></el-col>
        </el-row>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import CommonInfo from "./CommonInfo";
  export default {
    name: "calculate",
    props: {
      purchaseData:{
        type: Object
      }
    },
    components:{
      CommonInfo
    },
    watch:{
      radio(newVal,oldVal){
        if(newVal== "1"){
          this.purchaseStatus = "2";

        }
        if(newVal== "2"){
          this.purchaseStatus = "3";
        }
      }
    },
    data(){
      return{
        radio: "1",
        purchaseStatus: "2"
      }
    },
    methods:{
      resetSuggestion(){
        this.radio = "1";
      },
      checkParam(){
        return false;
      },
      submitSuggestion(){
        let param = {...this.purchaseData};
        param.purchaseStatus = this.purchaseStatus;
        param.approvedUserId = this.$store.state.user.userId;
71
        param.approvedTime =this.getNowTime();
耿迪迪's avatar
耿迪迪 committed
72
        return param;
73 74 75 76 77 78 79
      },
      getNowTime(){
        var date = new Date();
        var seperator = "-";
        var currentdate =date.getFullYear()+seperator+date.getMonth()+seperator+date.getDate() +" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
        console.log(currentdate,"currentdate")
        return currentdate;
耿迪迪's avatar
耿迪迪 committed
80 81 82 83 84 85 86 87
      }
    }
  }
</script>

<style scoped>

</style>