{
    template: '${tmpl}',
    data: function () {
        var validMethod = (rule, value, callback) => {
            return this.validfileds(rule, value, callback);
        };

        return {
            showEdit: false,
            submitLoading: false,
            search: {
                list: [],
                currentPage: 1,
                pageSize: 20,
                total : 0,
                month: '',
                id_name: '',
                id_no: '',
            },
            tax: {
                month: "",
            },
            rules: {
                month: [
                    { required: true, message: '请输入月份', trigger: 'blur' },
                ],
                a : [],
            },
            sourceTypes: [{
                value: 1,
                label: '开封'
              }, {
                value: 2,
                label: '云如薪'
              }
            ],
      
        }
    },
    mounted: function () {
        this.resetSearch();
    },
    created: function () {
    },
    methods: {
        getEmptySearch() {
            return {
                list: [],
                currentPage: 1,
                pageSize: 20,
                total : 0,
                month: '',
                id_name: '',
                id_no: '',
            }
        },
        resetSearch() {
            this.search = this.getEmptySearch();
            this.getList();
        },
        tableHeaderColor({ row, column, rowIndex, columnIndex }) {
            if (rowIndex === 0) {
                return 'background-color: #F5F5F5;color: #2F2F2F;font-size: 14px;font-weight:400;'
            }
        },
        opSearch() {
            this.getList();
        },
        getList() {
            var self = this;
            this.$root.postReq("/web/esettleofflineCtl/allList", {
                search: this.getParams()
            }).then(function (d) {
                if (d.status == 0) {
                    self.search.list = d.data.rows || [];
                    self.search.total = d.data.count || 0;
                } else {
                }
            });
        },
        getParams() {
            var params = {};
            for(var f in this.search) {
                if(f == "list") {
                    continue;
                }
                params[f] = this.search[f];
            }
            return params;
        },
        onColFormater(row, column, cellValue, index) {
            return cellValue || "0";
        },

        handleSizeChange(val) {
            this.search.pageSize = val;
            this.resetSearch();
        },
        handleCurrentChange(val) {
            this.search.currentPage = val;
            this.getList();
        },
        openDetail(row) {
        },
       
        openEdit(id) {
            var self = this;
            self.showEdit = true;
        },
       
        save() {
            /* 
            var self = this;
            self.$refs.settle.validate((valid) => {
                if (valid) {
                    const loading = self.$loading({
                        lock: true,
                        text: '正在努力保存',
                        spinner: 'el-icon-loading',
                        background: 'rgba(0, 0, 0, 0.7)'
                    });

                    self.$root.postReq("/web/esettleofflineCtl/save", self.settle).then(function (d) {
                        loading.close();
                        if (d.status == 0) {
                            self.$message.success(`保存成功`);
                            self.showEdit = false;
                            self.getList();
                        } else {
                            self.$alert(d.msg || '保存失败', '提示', {
                                confirmButtonText: '确定',
                                callback: action => {}
                            });
                        }
                    });
                } else {
                    return false;
                }
            });
            */
        },
        
        f2y(f) {
            return parseFloat(((f || 0) / 100).toFixed(2));
        },
    },
    vname: "gsb-esettleofflinetax"
}