zx 1 rok temu
rodzic
commit
4a07ffaf18

+ 28 - 3
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/groupView/groupView.vue

@@ -3,7 +3,7 @@
     <van-nav-bar title="班组成员" left-text="返回"  @click-left="back" fixed left-arrow/>
     <div style="margin-top: 44px;">
       <van-list  :finished="true" >
-      <van-cell v-for="item in list" :key="item" :title="item" />
+      <van-cell v-for="item in list" :key="item.id" :id="item.id" :title="item.name" @click="onClick"/>
       </van-list>
     </div>
     
@@ -16,17 +16,42 @@ export default {
   components: {},
   data() {
     return {
-        list:['张三','李四','王五']
+        list:[]
     };
   },
   computed: {},
   watch: {},
   created() {},
-  mounted() {},
+  mounted() {
+    this.getMyGroupList();
+  },
   methods: {
     back() {
       this.$router.go(-1);
     },
+    getMyGroupList(){
+      this.$axios.post('/department/getMyGroups',{})
+      .then(res=>{
+        if (res.code == "ok") {
+          this.list=res.data.map(item=>{
+            return {
+              name: item.name,
+              id: item.id
+            }
+          })
+
+        } else {
+            this.$toast.clear();
+            this.$toast.fail(res.msg);
+          }
+        }).catch(err => { this.$toast.clear(); 
+      })
+    },
+    onClick(e){
+      console.log(e)
+      console.log(e.currentTarget.id)
+      console.log(e.currentTarget.innerText)
+    }
 
   },
 };

+ 0 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/groupView/info.vue


+ 38 - 5
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/product/list.vue

@@ -18,7 +18,7 @@
                 </el-form-item>
                 <!--操作按钮-->
                 <el-form-item style="float:right;">
-                    <el-link type="primary" :underline="false"  :disabled="productSelections.length==0" @click="importProduct()">导出产品</el-link>
+                    <el-link type="primary" :underline="false"  :disabled="productSelections.length==0" @click="exportProduct()">导出产品</el-link>
                 </el-form-item>
                 <el-form-item style="float:right;">
                     <el-upload class="filter-item" name="file" action :on-error="uploadFalse" :on-success="uploadSuccess"
@@ -752,7 +752,7 @@ export default {
             listLoading: false,
             total: 0,
             page: 1,
-            size: localStorage.getItem("projectPageSize") == null ? 20 : parseInt(localStorage.getItem("projectPageSize")),
+            size: localStorage.getItem("projectPageSize") == null ? 10 : parseInt(localStorage.getItem("projectPageSize")),
             list: [
                 {
                     tableProdProcedure: {
@@ -972,9 +972,42 @@ export default {
 
 
         },
-        importProduct() {
+        exportProduct() {
+
             let productSelectionString = JSON.stringify(this.productSelections);
-            this.http.post("/product/exportData", {
+            
+            this.exportDisabled = true
+            this.exportNotification = this.$notify({
+                title: '导出产品',
+                message: '产品导出中、请稍后...',
+                duration: 0,
+                showClose: false
+            });
+            //导出产品
+            this.http.post('/product/exportData', {date: productSelectionString,productType: this.category},
+                res => {
+                    this.exportDisabled = false
+                    this.exportNotification.close()
+                    if (res.code == "ok") {
+                        this.productSelections=[]
+                        var filePath = res.data;
+                        const a = document.createElement('a'); // 创建a标签
+                        a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
+                        a.setAttribute('href', filePath);// href链接
+                        a.click(); //自执行点击事件
+                        a.remove();
+                    }
+                },
+                error => {
+                    this.exportNotification.close()
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                }
+            );
+            
+          /*   this.http.post("/product/exportData", {
                 date: productSelectionString,
                 productType: this.category
             },
@@ -986,7 +1019,7 @@ export default {
                             type: 'success'
                         });
                     }
-                })
+                }) */
         },
         handleSelectionChange(val) {
             this.productSelections = []