
<template>
  <div class="table_box">
    <el-row id="printTest" class="text">
      <el-col>
        <p class="textcenter">芦笋产业农合联交易凭证</p>
      </el-col>
      <el-col>
        <p>{{customerName}}</p>
      </el-col>
      <el-col :span="6">
        <p>今日交易价</p>
      </el-col>
      <el-col :span="6">
        <p>大笋：{{bigBamboo}}元/斤</p>
      </el-col>
      <el-col :span="6">
        <p>中笋：{{mediumBamboo}}元/斤</p>
      </el-col>
      <el-col :span="6">
        <p>小笋：{{smallBamboo}}元/斤</p>
      </el-col>
      <el-col :span="6">
        <p>重量:</p>
      </el-col>
      <el-col :span="6">
        <p>&emsp;&emsp;&ensp;&ensp;{{bigWeight}}斤</p>
      </el-col>
      <el-col :span="6">
        <p>&emsp;&emsp;&ensp;&ensp;{{mediumWeight}}斤</p>
      </el-col>
      <el-col :span="6">
        <p>&emsp;&emsp;&ensp;&ensp;{{smallweight}}斤</p>
      </el-col>
      <el-col :span="6">
        <p>金额:</p>
      </el-col>
      <el-col :span="6">
        <p>&emsp;&emsp;&ensp;&ensp;{{bigAmount}}元</p>
      </el-col>
      <el-col :span="6">
        <p>&emsp;&emsp;&ensp;&ensp;{{mediumAmount}}元</p>
      </el-col>
      <el-col :span="6">
        <p>&emsp;&emsp;&ensp;&ensp;{{smallAmount}}元</p>
      </el-col>

      <el-col>
        <p>总金额：{{totalAmounted}}元</p>
      </el-col>
      <el-col>
        <p>{{dayTime}}</p>
      </el-col>
      <el-col>
        <p>签字确认：</p>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import { printing } from "../../apis/modules/tradingSide.js";
import { login } from "../../apis/modules/asparagus.js";
export default {
  name: "storagePrint",
  data() {
    return {
      customerName: "",
      bigBamboo: "",
      mediumBamboo: "",
      smallBamboo: "",
      bigWeight: "",
      mediumWeight: "",
      smallweight: "",
      bigAmount: "",
      mediumAmount: "",
      smallAmount: "",
      totalAmounted: "",
      dayTime: ""
    };
  },

  mounted() {
    this.getList();
  },
  methods: {
    getList() {
      login({
        username: localStorage.getItem("userId"), // "7f6b359a68bb497f937d35982203f1c3",
        password: "",
        Terminal: "PC"
      }).then(res => {
        const { status, data } = res;
        if (status === 0) {
          localStorage.setItem("token", data.token);
          this.onDelTable();
        }
      });
    },

    onDelTable() {
      window.android.getMemberTime(memberIds, timer, state);
      const parms = {
        memberId: memberIds,
        time: timer,
        state: state
      };
      printing(parms).then(res => {
        const { status, data } = res;
        if (status === 0) {
          this.customerName = data.name;
          this.bigBamboo = data.bigAsparagusPrice;
          this.mediumBamboo = data.middleAsparagusPrice;
          this.smallBamboo = data.smallAsparagusPrice;
          this.bigWeight = data.bigWeight;
          this.mediumWeight = data.middleWeight;
          this.smallweight = data.smallWeight;
          this.bigAmount = data.bigAmount;
          this.mediumAmount = data.middleAmount;
          this.smallAmount = data.smallAmount;
          this.totalAmounted = data.sumAmount;
          this.dayTime = data.time;
        }
      });
    }
  }
};
</script>
<style scoped lang="scss">
.table_box {
  margin: 30px;
}
</style>