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