operate.vue 3.74 KB
Newer Older
godwithdh's avatar
godwithdh committed
1 2 3 4 5 6 7 8 9 10
<style lang="less">
    .operate{
        >table{
            background:#E6F0FE;
            width:calc(100% - 20px);
            margin:10px;
            border-radius: 7px;
            text-align: center;
            tr:first-child{
                font-size: 13px;
godwithdh's avatar
godwithdh committed
11 12 13
                >td{
                    height:30px;
                }
godwithdh's avatar
godwithdh committed
14 15 16
            }
            tr:not(:first-child){
                >td{
godwithdh's avatar
godwithdh committed
17
                    padding-bottom:18px;
godwithdh's avatar
godwithdh committed
18
                    >div{
godwithdh's avatar
godwithdh committed
19 20 21 22 23 24
                        height: 45px;
                        background: #fff;
                        padding: 6px 0;
                        display: flex;
                        justify-content: center;
                        align-items: center;
godwithdh's avatar
godwithdh committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38
                    }
                    &:first-child{
                        >div{
                            border-left: 3px solid #8D90FF;
                            color:#5E9AFE;
                        }
                    }
                    &:last-child{
                        >div{
                            color:#42A071;
                        }
                    }
                }
            }
godwithdh's avatar
godwithdh committed
39
            tr:last-child>td{ padding-bottom:30px; }
godwithdh's avatar
godwithdh committed
40 41 42 43
        }
    }
</style>
<template>
godwithdh's avatar
godwithdh committed
44 45
    <div class="operate" :style="list.length==0&&'background:#fff;height:100%;'">
        <table cellspacing="0" v-if="list.length>0">
godwithdh's avatar
godwithdh committed
46 47 48
            <tr>
                <td></td>
                <td>米数</td>
godwithdh's avatar
godwithdh committed
49
                <td>匹数</td>
godwithdh's avatar
godwithdh committed
50 51
                <td>金额</td>
            </tr>
godwithdh's avatar
godwithdh committed
52
            <tr v-for="(v,i) in list" :key="i">
godwithdh's avatar
godwithdh committed
53
                <td>
张锡奇's avatar
张锡奇 committed
54
                    <div @click="routerToOperateDetail(v)" style="text-decoration:underline;">{{v.sType}}</div>
godwithdh's avatar
godwithdh committed
55 56
                </td>
                <td>
godwithdh's avatar
godwithdh committed
57
                    <div>{{Number(v.nQty||0).toLocaleString()}}</div>
godwithdh's avatar
godwithdh committed
58 59
                </td>
                <td>
godwithdh's avatar
godwithdh committed
60
                    <div>{{Number(v.nPieces||0).toLocaleString()}}</div>
godwithdh's avatar
godwithdh committed
61 62
                </td>
                <td>
张锡奇's avatar
张锡奇 committed
63
                    <div>{{ v.sType == '收货' || v.sType == '检验' || v.sType == '成品入库' ? '' : Number(v.nAmount||0).toLocaleString()}}</div>
godwithdh's avatar
godwithdh committed
64 65 66
                </td>
            </tr>
        </table>
godwithdh's avatar
godwithdh committed
67
        <img src="@/assets/noData.jpg" style="width:100%;" v-else/>
godwithdh's avatar
godwithdh committed
68 69 70 71 72 73 74 75 76 77 78 79
    </div>
</template>
<script>
import util from "@/libs/util.js"
export default {
    name:"operate",
    props:{
        start:Date,
        end:Date,
    },
    data(){
        return{
godwithdh's avatar
godwithdh committed
80
            list:[],
godwithdh's avatar
godwithdh committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
        }
    },
    watch:{
        start(n){
            this.search()
        },
        end(n){
            this.search()
        },
    },
    created(){
        this.$nextTick(()=>{
            this.search()
        })
    },
    methods:{
        async search(){
            var value= await this.request('getBoss',{
张锡奇's avatar
张锡奇 committed
99 100 101 102 103 104
                data:[
                    {key:"url",value:"Operation gai"},
                    {key:"begin_date",value:util.dateFormat(this.start,"yyyy-MM-dd")},
                    {key:"end_date",value:(this.end?util.dateFormat(this.end,"yyyy-MM-dd"):util.dateFormat(new Date,"yyyy-MM-dd"))+' 23:59'}
                ],
                params:{},
godwithdh's avatar
godwithdh committed
105
            },true,{})
godwithdh's avatar
godwithdh committed
106 107 108
            if(typeof value=='object'&&value.length>0){
                this.list=value
            }else{
godwithdh's avatar
godwithdh committed
109
                this.list=[]
godwithdh's avatar
godwithdh committed
110
            }
godwithdh's avatar
godwithdh committed
111
        },
张锡奇's avatar
张锡奇 committed
112
        routerToOperateDetail(row){
张锡奇's avatar
张锡奇 committed
113 114 115 116 117 118
            let data = util.deepClone(row);
            data.begin_date = util.dateFormat(this.start,"yyyy-MM-dd");
            data.end_date = (this.end?util.dateFormat(this.end,"yyyy-MM-dd"):util.dateFormat(new Date,"yyyy-MM-dd"))+' 23:59';
            this.$store.dispatch('saveKanbanHdr',data);
            this.$store.dispatch('saveRefresh',true);
            this.$router.push({name:'tiipOperateDetail',type:row.sType})
张锡奇's avatar
张锡奇 committed
119
        }
godwithdh's avatar
godwithdh committed
120 121 122
    },
}
</script>