瀏覽代碼

装箱单面辅料附件下载

jbb 2 年之前
父節點
當前提交
4ff5a9970a

+ 1 - 1
src/components/NumberInfo/NumberInfo.vue

@@ -49,6 +49,6 @@
   }
 </script>
 
-<style lang="less" scoped>
+<style lang="less" >
   @import "index";
 </style>

+ 1 - 0
src/views/packing-list/fabric-list.vue

@@ -403,6 +403,7 @@ export default {
                  item.manualYarnFlag = '是'
                }
              })
+              this.$refs.detailsFabricDrawer.accessory = data.accessory.split(",")
               this.$refs.detailsFabricDrawer.addFabricData = data.syPackingListFabricItem
           }else{
               this.$message.error(res.message);

+ 33 - 1
src/views/packing-list/packinglist-fabrics/detailsFabricDrawer.vue

@@ -92,6 +92,16 @@
             </a-table>
           </a-form-model>
         </a-spin>
+        <a-col :span="12">
+            <a-form-model-item label="附件"  prop="accessory">
+              <ul v-for="(item, index) in accessory" :key="index" >
+                <li>
+                  <a @click="accessoryDownload(item)">{{item}}</a>
+                </li>
+                
+              </ul>
+            </a-form-model-item>
+          </a-col>
       </a-card>
       <!-- 页面底部提交取消 -->
       <div
@@ -118,7 +128,7 @@
 <script>
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
-
+import { downFile } from '@/api/manage'
 export default {
   name: 'AddFabricDrawer', //  新增 装箱单 -面料
   mixins: [JeecgListMixin],
@@ -357,6 +367,7 @@ export default {
           className: 'replacecolor'
         },
       ],
+      accessory:[],
       addFabricData: [],
       loading: false, // 表格加载
       addFabric: {},
@@ -403,6 +414,27 @@ export default {
         }
       })
     },
+    accessoryDownload(name){
+       downFile(`/sys/common/static/${name}`).then(data => {
+        if (!data) {
+          this.$message.warning('文件下载失败')
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', name + '.xls')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
+    },
 
      // 分页、排序、筛选变化时触发
     // handleTableChange(pagination, filters, sorter) {