Browse Source

批量打印

XMLWAN 4 years ago
parent
commit
00e0c28efb
1 changed files with 15 additions and 7 deletions
  1. 15 7
      src/xt_pages/dialysis/components/consumables.vue

+ 15 - 7
src/xt_pages/dialysis/components/consumables.vue View File

@@ -138,6 +138,7 @@
138 138
         new_list:[],
139 139
 
140 140
         good_types: [],
141
+        arrKey:[],
141 142
 
142 143
       }
143 144
     },
@@ -178,18 +179,19 @@
178 179
 
179 180
       },
180 181
       getGoodUserInfo(good_type_id,good_user,last_good_user) {
182
+        var arrlist =[] 
181 183
         if (good_user != null && good_user.length > 0) {
182 184
           let desc = ""
183 185
           for (let b = 0; b < good_user.length; b++){
184 186
             if(good_type_id == good_user[b].good_type_id)
185 187
               desc = desc + "\n" + good_user[b].info.specification_name +"*" +good_user[b].count
186 188
           }
187
-
188
-
189
+          arrlist.push(desc)
189 190
           return desc
190 191
         }
192
+       console.log("arrlist---------",arrlist)
191 193
         return ""
192
-
194
+       
193 195
         // else if (good_user != null && good_user.length <= 0) {
194 196
         //   if (last_good_user != null && last_good_user.length > 0) {
195 197
         //     let desc = ""
@@ -219,12 +221,18 @@
219 221
             var res = response.data
220 222
             this.total = res.data.total
221 223
             this.good_types.push("姓名")
222
-           
224
+            var arr = []
225
+            arr.push("name")
223 226
             for (let a = 0; a <  res.data.good_type.length; a++){
227
+              Object.keys(res.data.good_type[a]).map(item => {
228
+                if(item == 'type_name'){
229
+                  arr.push(item)
230
+                }
231
+              })
224 232
               this.good_types.push(res.data.good_type[a].type_name)
225
-              
226 233
             }
227
-            console.log("姓名",this.good_types)
234
+            this.arrKey.push(...arr)
235
+          
228 236
             this.allGoodInfo = res.data.dialysis_goods
229 237
            
230 238
             for(let i = 0; i < res.data.dialysis_goods.length; i++){
@@ -326,7 +334,7 @@
326 334
        exportList(){
327 335
          import('@/vendor/Export2Excel').then(excel => {
328 336
          const tHeader = this.good_types
329
-         const filterVal = ['name','']
337
+         const filterVal = this.arrKey
330 338
         
331 339
          const data = this.formatJson(filterVal, this.list)
332 340
          excel.export_json_to_excel({