zouyu
2023-09-24 c9af6bb994e96776d796480dd21ff0a95e1212cd
src/components/view/sale.vue
@@ -180,6 +180,7 @@
            <el-table-column label="操作" width="220">
               <template slot-scope="scope">
                  <span class="table_do" @click="changeShowDetail(scope.row)">&nbsp;查看详情&nbsp;</span>
                  <span class="table_do" @click="downloadFile(scope.row)">&nbsp;下载附件&nbsp;</span>
                  <span class="table_do" v-if="scope.row.type == 2" @click="saleCheck(scope)">&nbsp;审核&nbsp;</span>
                  <span class="table_do" v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                  <span class="table_do" v-if="scope.row.type == 2"
@@ -450,6 +451,34 @@
      this.selectRawInspectsList()
   },
   methods: {
      downloadFile(row) {
         let baseIp = "http://192.168.18.16:9999"
         this.axios.post(this.$api.url.saleDownload, {
            id: row.id
         }).then(res => {
            const fileUrls = []; // 文件的urls
            res.data.forEach(item=>{
               let url=baseIp+item
               fileUrls.push(url)
            })
            const downloadFile = (url, fileName) => {
                  const link = document.createElement('a');
                  link.href = url;
                  link.download = fileName;
                  // link.style.display = 'none';
                  document.body.appendChild(link);
                  link.click();
                  document.body.removeChild(link);
               };
               console.log(fileUrls);
               fileUrls.forEach((url, index) => {
                  let s=url.split(".")
                  const fileName = row.name+`附件(${index + 1}).`+s[s.length-1];
                  downloadFile(url, fileName);
               });
         })
      },
      //销售订单导出
      exportSale(){
         this.$axios.post(this.$api.url.exportSale,{