proPoiCalc.vue 2.8 KB
Newer Older
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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
<template>
  <!-- 附加页面 -->
  <div>
    <!-- 页面左半部分 -->
    <el-form
      :model="model"
      ref="modelForm"
      label-position="left"
      label-width="150px"
      size="small"
      :rules="rules"
    >
      <el-col :span="12">
        <el-col :span="22">
          <el-form-item label="成本" prop="cost">
            <c-input-number v-model="model.cost"   :precision="4" placeholder="请输入"></c-input-number>%
          </el-form-item>
        </el-col>
      </el-col>
      <el-col :span="12">
        <el-col :span="22">
          <el-form-item label="报价" prop="offer">
            <c-input-number v-model="model.offer" :precision="4" placeholder="请输入"></c-input-number>%
          </el-form-item>
        </el-col>
      </el-col>
      <el-col :span="12">
        <el-col :span="22">
          <el-form-item label="税率" prop="tax">
            <div>
            <c-input-number v-model="model.tax" :precision="4" placeholder="请输入"></c-input-number>%</div>
          </el-form-item>
        </el-col>
      </el-col>
      <el-col :span="12">
        <el-col :span="22">
          <el-form-item label="税后报价" prop="taxBehindOffer">
            <c-input-number v-model="model.taxBehindOffer" :precision="4" disabled></c-input-number>%
          </el-form-item>
        </el-col>
      </el-col>
      <el-col :span="12">
        <el-col :span="22">
          <el-form-item label="税后收益" prop="taxBehindProfit">
            <c-input-number v-model="model.taxBehindProfit" :precision="4" disabled></c-input-number>%
          </el-form-item>
        </el-col>
      </el-col>
    </el-form>
  </div>
</template>

<script>
import moment from "moment";
import Api from "~/service/Api";
import Calculator from "./Calculator";

export default {
  data() {
    return {
      zczyDate: {
        // 最迟装运/服务提供日  大于等于有效日期 且 小于等于 信用证的到期日
        disabledDate: time => {
          return (
            time.getTime() < moment(this.model.bgnIntDay) ||
            time.getTime() > moment(this.model.dueDate)
          );
        }
      },
      model: new Calculator().data,
      rules: {}
    };
  },
  props: ["model", "codes"],
  methods: {},
  computed: {
    //税后报价=成本*(1+税率)
    taxBehindOffer() {
      return this.model.cost *(1 + (this.model.tax/100));
    },
    //税后收益=报价-税后报价
    taxBehindProfit() {
      // let profit1=this.model.offer / (1 + this.model.tax/100) - this.model.cost;
      let profit1 =this.model.offer - this.taxBehindOffer;
      console.log(profit1)
      return profit1
    }
  },
  watch: {
    taxBehindOffer() {
      this.model.taxBehindOffer = this.taxBehindOffer;
    },
    taxBehindProfit() {
      this.model.taxBehindProfit = this.taxBehindProfit;
    }
  }
};
</script>