<template>
  <div class="app-container">

      <el-form ref="form" :model="form" :rules="rules" :disabled="isView" label-width="160px">
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="费用日期" prop="date">
              <el-date-picker
                ref="date"
                style="width: 100%;"
                v-model="form.date"
                value-format="yyyy-MM-dd"
                placeholder="请选择费用日期"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="单头头副返利" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入单头头副返利" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="其他业务收入" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入其他业务收入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="其他业务成本" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入其他业务成本" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="税金及附加" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入税金及附加" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="资产减值损失" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入资产减值损失" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="营业外收入" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入营业外收入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="营业外支出" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入营业外支出" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="所得税费用" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入所得税费用" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item label="其中销售费用-运费白条" prop="price">
              <decimal-input v-model="form.price" :min="0" :max="999999" :precision="2" placeholder="请输入其中销售费用-运费白条" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :offset="8" :span="8">
            <el-form-item>
              <el-button type="success" style="margin-right: 40px" @click="prev">上一天</el-button>
              <el-button type="primary"  style="margin-right: 40px">保存</el-button>
              <el-button type="success" @click="next">下一天</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
  </div>
</template>
<script>
import { formatMoney, formatDateYMS } from "../../../utils";
export default {
  name: "fill",
  data() {
    return {
      isView:false,
      // 是否显示弹出层
      open: false,
      // 表单参数
      form: {
        date: formatDateYMS(new Date().getTime())
      },
      rules: {},
    }
  },

  created() {
  },
  methods: {
    prev() {
      let timestamp = new Date(this.form.date).getTime()
      let prevTime = timestamp - 60 * 1000 * 60 * 24
      this.form.date = formatDateYMS(prevTime)
    },
    next() {
      let timestamp = new Date(this.form.date).getTime()
      let nextTime = timestamp + 60 * 1000 * 60 * 24
      this.form.date = formatDateYMS(nextTime)
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {

            // 新增
            // (this.form).then(response => {
            //   this.$modal.msgSuccess("新增成功");
            //   this.open = false;
            //   this.getList();
            // });

        }
      })
    },
  }
}
</script>

<style scoped lang="scss">

</style>
