Browse Source

09091513qd

liuhj 7 months ago
parent
commit
3232a0d861
2 changed files with 143 additions and 4 deletions
  1. 96 1
      src/components/OP/OPgroup.vue
  2. 47 3
      src/components/OP/SuppliesInventory.vue

+ 96 - 1
src/components/OP/OPgroup.vue

@@ -1,5 +1,22 @@
 <template>
     <div v-loading="fullscreenLoading">
+        <el-dialog top="35vh" width="400px" title="团组清单下载" :visible.sync="groupVisible">
+            <el-date-picker
+            style="width:100%;"
+            v-model="downloadtime"
+            type="daterange"
+            align="right"
+            unlink-panels
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :picker-options="pickerOptions">
+            </el-date-picker>
+            <div class="group-dialog-btn">
+                <el-button @click="groupVisible=false">取消</el-button>
+                <el-button @click="GroupListFile" type="primary">下载</el-button>
+            </div>
+        </el-dialog>
         <div class="group-list">
             <div class="group-box">
                 <div>
@@ -20,6 +37,7 @@
                     <el-button @click="Inquireclick()" type="primary">查 询</el-button>
                 </div>
                 <div>
+                    <el-button @click="evocationdownload" type="primary">团组清单下载</el-button>
                     <el-button @click="addgroup()" type="primary">新增团组</el-button>
                 </div>
             </div>
@@ -184,7 +202,37 @@ export default {
             token:'',
             fullscreenLoading:false,
             userid:'',
-            pageId:''
+            pageId:'',
+            groupVisible:false,
+            //下载团组清单时间
+            downloadtime:'',
+            pickerOptions: {
+                shortcuts: [{
+                    text: '最近一周',
+                    onClick(picker) {
+                    const end = new Date();
+                    const start = new Date();
+                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+                    picker.$emit('pick', [start, end]);
+                    }
+                }, {
+                    text: '最近一个月',
+                    onClick(picker) {
+                    const end = new Date();
+                    const start = new Date();
+                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+                    picker.$emit('pick', [start, end]);
+                    }
+                }, {
+                    text: '最近三个月',
+                    onClick(picker) {
+                    const end = new Date();
+                    const start = new Date();
+                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+                    picker.$emit('pick', [start, end]);
+                    }
+                }]
+            },
         }
     },
     
@@ -197,6 +245,17 @@ export default {
         this.$route.meta.isBack=false
     },
     methods:{
+        //处理时间
+        disposeTime(val){
+            var date = new Date(val);
+            var y = date.getFullYear();
+            var m = date.getMonth() + 1;
+            m = m < 10 ? ('0' + m) : m;
+            var d = date.getDate();
+            d = d < 10 ? ('0' + d) : d;
+            let time = y + '-' + m + '-' + d;
+            return time
+        },
         //分页api
         PostGroupPageList(){
             var url = "/api/Groups/PostGroupPageList"
@@ -240,6 +299,38 @@ export default {
             this.currentPage=1;
             this.PostGroupPageList()
         },
+        //唤起团组清单下载
+        evocationdownload(){
+            this.downloadtime="";
+            this.groupVisible=true;
+        },
+        //团组清单下载
+        GroupListFile(){
+            if (this.downloadtime==null||this.downloadtime=="") {
+                this.$message.error("请选择时间!");
+                return
+            }
+            var url = "/api/Groups/GroupListFile?beginDt="+this.disposeTime(this.downloadtime[0])+"&endDt="+this.disposeTime(this.downloadtime[1])
+            var that = this
+            this.$axios({
+                method: 'get',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                        that.$message({
+                            message:res.data.msg ,
+                            type: 'success',
+                        });
+                    window.open(res.data.data);
+                    that.groupVisible=false;
+                }else{
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
         addgroup(){
             this.$router.push({path: '/home/Groupedit'});
         },
@@ -400,4 +491,8 @@ export default {
     .group-box>.el-input{
         margin-left: 10px;
     }
+    .group-dialog-btn{
+        text-align: right;
+        margin-top: 30px;
+    }
 </style>

+ 47 - 3
src/components/OP/SuppliesInventory.vue

@@ -32,6 +32,46 @@
                 <el-button @click="GoodsList" type="primary">查 询</el-button>
             </div>
         </div>
+        <div class="SuppliesInventory-table">
+            <el-table
+                :data="tableData"
+                border
+                style="width: 100%">
+                <el-table-column
+                prop="name"
+                label="物品名称"
+                width="180">
+                </el-table-column>
+                <el-table-column
+                prop="typeName"
+                label="物品类型"
+                width="180">
+                </el-table-column>
+                <el-table-column
+                prop="stockQuantity"
+                label="物品数量"
+                width="100">
+                </el-table-column>
+                <el-table-column
+                prop="lastUpdateUserName"
+                label="录入人"
+                width="100">
+                </el-table-column>
+                <el-table-column
+                prop="lastUpdateTime"
+                label="录入时间"
+                width="180">
+                </el-table-column>
+                <el-table-column
+                prop="remark"
+                label="备注">
+                </el-table-column>
+                <el-table-column
+                label="操作"
+                width="180">
+                </el-table-column>
+            </el-table>
+        </div>
     </div>
 </template>
 <script>
@@ -44,6 +84,7 @@ export default {
             MaterialinfoTypes:'',
             MaterialinfoTypearr:[],
             Materialname:'',
+            tableData:[],
         }
     },
     methods:{
@@ -55,7 +96,7 @@ export default {
                 method: 'get',
                 url: url,
                 headers: {
-                    Authorization: 'Bearer ' + this.token
+                    Authorization: 'Bearer '
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
@@ -96,7 +137,7 @@ export default {
                 method: 'post',
                 url: url,
                 headers: {
-                    Authorization: 'Bearer ' + this.token
+                    Authorization: 'Bearer ' 
                 },
                 data: {
                     portType: 1,
@@ -107,7 +148,7 @@ export default {
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                  
+                    that.tableData=res.data.data;
                 }
             }).catch(function (error) {
                 that.$message.error("获取团组失败");
@@ -138,4 +179,7 @@ export default {
     font-size: 14px;
     color: #555;
 }
+.SuppliesInventory-table{
+    margin-top: 15px;
+}
 </style>