factory-invoice.vue 12.4 KB
<template>
    <section>

        <div class="container resource close-left-menu contaNEW">

            <div class="pop-banner clearfix">
                <div class="operate-btns">
                    <a class="fbtn fb-create " v-link="{path : 'factoryInvoiceMake'}">新登记厂商发票</a>
                </div>
                <h3 class="current-module">生产厂商发票列表</h3>
            </div>
            <div class="pd-form fast-search-form">
                <div class="group-row">
                    <div class="form-group">
                        <div class="control">
                            <input type="text" v-model="search.manufacturer" placeholder="生产厂商" title="生产厂商" maxlength="20" v-rule></div>
                    </div>
                    <div class="form-group">
                        <!-- <label for="cn1" class="label">采购单号</label> -->
                        <div class="control">
                            <input type="text" v-model="search.invoiceno" title='发票号' placeholder='发票号' maxlength="26" v-rule></div>
                    </div>
                </div>
                <div class="group-row">
                    <div class="form-group">
                        <label for="cn3" class="label">
                        </label>
                        <div class="control control-date" style="height:34px;overflow: inherit;">
                            <div style="width:44%;float:left;">
                                <datepicker :target.sync="search.startdate" :readonly="readonlyFlag" title='发票开始日期'
                                            placeholder='发票开始日期'
                                            styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;"></datepicker>
                            </div>
                            <span class="text-and">-</span>
                            <div style="width:48%;float:left;">
                                <datepicker :target.sync="search.enddate" :readonly="readonlyFlag" title='发票结束日期'
                                            placeholder='发票结束日期'
                                            styleobj="width:100% !important;border-radius:0px 8px 8px 0px !important;"></datepicker>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="cn1" class="label">业务状态</label>

                        <div class="control control-filtering control-filtering-green fl w350">
                            <a class="option" href="javascript:;" :class="{'all active':search.mirstate==''}"
                               v-on:click="search.mirstate=''">全部</a>
                            <a class="option" href="javascript:;" :class="{'all active':search.mirstate=='MS01'}"
                               v-on:click="search.mirstate='MS01'">新增</a>
                            <a class="option" href="javascript:;" :class="{'all active':search.mirstate=='MS02'}"
                               v-on:click="search.mirstate='MS02'">核销中</a>
                            <a class="option" href="javascript:;" :class="{'all active':search.mirstate=='MS03'}"
                               v-on:click="search.mirstate='MS03'">已核销</a>
                        </div>
                    </div>
                </div>
                <div class="group-row t-right">
                    <button v-on:click="getData()"
                            class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle">查 询
                    </button>
                </div>
            </div>

            <table class="itable itable-thead-13px">
                <thead id="t_header">
                <tr>
                    <th class="w50">序号</th>
                    <th class="w120">生产厂商</th>
                    <th class="w100">发票号</th>
                    <th class="w70">发票图片</th>
                    <th class="w80">发票日期</th>
                    <th class="w70">经手人</th>
                    <th class="w50">品规数</th>
                    <th class="w80">状态</th>
                    <th class="w80">总金额(元)</th>
                    <th class="w120">操作</th>
                </tr>
                </thead>
                <tbody class="txt_v">
                <tr>
                    <td colspan="10" v-if="mxList.length==0">
                        暂无符合条件的记录
                    </td>
                </tr>
                <tr v-for="trdo in mxList">
                    <td>{{$index+1}}</td>
                    <td class="t-left pr10">
                        <div class="p-lr-10">{{trdo.manufacturer}}</div>
                    </td>
                    <td>{{trdo.invoiceno}}</td>
                    <td>
                        <div  class="toggle-image pro-pic">
                            <imagebox v-bind:imgarr="trdo.invoicepic | original">
                                <img style="width: 100%" :src="trdo.invoicepic|thumbnail">
                                <span class="pic-max blue-search"></span>

                            </imagebox>
                        </div>
                        <!--<img class="pro-pic pro-pic-lg" :src="trdo.invoicepic|picSrc">-->
                    </td>
                    <td>{{trdo.invoicedate| getYMD}}</td>
                    <td>{{trdo.operatorname}}</td>
                    <td>{{trdo.countsum}}</td>
                    <td v-if="trdo.mirstate=='MS01'">{{trdo.mirstate|mirstate}}</td>
                    <td v-if="trdo.mirstate=='MS02'" style="color: #ee7a2f;">{{trdo.mirstate|mirstate}}</td>
                    <td style="color: #dc322e;"v-if="trdo.mirstate=='MS03'">{{trdo.mirstate|mirstate}}</td>


                    <td class="text-right pr10">{{trdo.invoicemoney| numDigit 2}}</td>
                    <td>
                        <div class="from-button" v-if="trdo.mirstate=='MS01'">
                            <a href="javascript:;" class="green-button p-lr-10"
                               v-link="{ path: '/factoryInvoiceDetail/' + trdo.guid+'/'+trdo.mirstate}">明细
                                <i>|</i>
                            </a>
                            <a href="javascript:;" class="red-button p-lr-10" v-on:click="dele(trdo.guid)">删除</a>
                        </div>
                        <div class="from-button" v-else>
                            <a href="javascript:;" class="green-button p-lr-10"
                               v-link="{ path: '/factoryInvoiceDetail/' + trdo.guid+'/'+trdo.mirstate}">明细
                                <i>|</i>
                            </a>
                            <a href="javascript:;" class="red-button p-lr-10 text-color-custom readonly-gray">删除</a>
                        </div>
                        <!-- <a v-else class="btn button-green" v-link="{ path: '/factoryInvoiceDetail/' + trdo.guid+'/'+trdo.mirstate}">明细</a> -->

                    </td>
                </tr>
                </tbody>
            </table>
            <div class="pagination m-20-0">
                <pagination @page-change="getData" :page-no.sync="search.page" :total-pages.sync="search.totalPages">
                </pagination>
            </div>
        </div>
    </section>
</template>
<script>
    module.exports = {
        data: function () {
            return {
                // 明细数据
                mxList: '',
                // 查询条件
                search: {
                    pageSize: 50,
                    page: 1,
                    totalPages: 0,
                    manufacturer: '', // 生产厂商
                    invoiceno: '', //  发票号
                    startdate: '', //  开始日期
                    enddate: '', // 结束日期
                    mirstate: '',
                },
                // 日期控件
                readonlyFlag: false,
            };
        },
        methods: {
            getTime: function () {
                var self = this;
                // 结束日期
                var nowdate = new Date();
                var y = nowdate.getFullYear();
                var m = nowdate.getMonth() + 1;
                m = m >= 10 ? m : '0' + m;
                var d = nowdate.getDate();
                d = d >= 10 ? d : '0' + d;
                self.search.enddate = y + '-' + m + '-' + d;

                // 开始日期
                nowdate.setMonth(nowdate.getMonth() - 1);
                var yn = nowdate.getFullYear();
                var mn = nowdate.getMonth() + 1;
                mn = mn >= 10 ? mn : '0' + mn;
                var dn = nowdate.getDate();
                dn = dn >= 10 ? dn : '0' + dn;
                self.search.startdate = yn + '-' + mn + '-' + dn;
            },
            // 获取数据
            getData: function () {
                var self = this;
                Ajax.post('/supplierReport/findmirBysupplier', this.search)
                    .then(function (response) {
                        var data = response.data.data;
                        self.$set('mxList', data.list);
                        //						self.search.pageno = data.pageno;
                        //						self.search.totalPages = data.totalPages;
                        //						self.search.total = data.total;
                    })
            },
            // 删除
            delmirByguid: function (guid) {
                var self = this;
                Ajax.post('/supplierReport/delmirByguid', {
                    'guid': guid
                })
                    .then(function (response) {
                        if (response.data.errorCode == 0) {
                            
                            self.MessageBox({
                                title: '提示',
                                message: '删除成功',
                                type: 'alert'
                            }, function (action) {
                                self.getData();
                            });
                        } else {
                            self.MessageBox({
                                title: '警告',
                                message: response.data.message,
                                type: 'alert'
                            }, function (action) {
                            });
                        }
                    })
            },
            dele: function (guid) {
                var self = this;
                self.MessageBox({
                    title: '提示',
                    message: '确定删除',
                    type: 'alert',
                    showCancelButton: true
                }, function (action) {
                    if (action == "confirm") {
                        self.delmirByguid(guid);
                    }
                })
            },
            // 跳转到订单受理详情页面
            goTRDoDetail: function (guid) {
                var self = this;
                // 根据执行状态跳转不同的页面 立继武
                if (billstate == self.ctns.dobillstated03 || billstate == self.ctns.dobillstated02) {
                    //已提交 已完结 跳转已完结、已提交页面 立继武
                    self.$route.router.go('/trdo/orderOutall2/' + trdo_billno);
                } else { // 未提交

                    // 未提交    billtype==self.ctns.billtype02 暂时注释   判断单据类型为高值
                    if (billtype == '02' && (trpo_billno != null || trpo_billno != '') || billtype == '03' && (trpo_billno != null || trpo_billno != '')) {
                        //进入高值页面 未提交页面
                        self.$route.router.go('/trdo/orderOutall2-3/' + ((trpo_billno || '') + "@" + (trdo_billno || '')));
                    } else {
                        //进入非高值页面 未提交页面
                        self.$route.router.go('/trdo/orderOutall2-2/' + ((trpo_billno || '') + "@" + (trdo_billno || '')));
                    }
                }
            },

        },
        watch: {
            'search.mirstate': function (val) {
                this.getData();
            }
        },
        route: {
            data: function (transition) {
                this.search.invoiceno = window.sessionStorage.getItem('value');
                window.sessionStorage.removeItem('value');
                this.getData();

            }
        },

    };
</script>