Fixiaobai
2023-09-24 d0dff667f07725027bcdeb28fdf3540a507c9702
src/components/view/sale.vue
@@ -157,7 +157,7 @@
            </el-table-column>
            <el-table-column label="订单类型" width="100">
               <template slot-scope="scope">
                  <el-tag effect="dark" size="mini" style="font-size: 8px;">{{scope.row.order_type}}</el-tag>
                  <el-tag effect="dark" size="mini" style="font-size: 8px;">{{ scope.row.order_type }}</el-tag>
               </template>
            </el-table-column>
            <el-table-column prop="code" label="合同编号" width="220">
@@ -174,12 +174,13 @@
               <template slot-scope="scope">
                  <span style="color: #34BD66;" v-if="scope.row.type == 1">通过</span>
                  <span style="color: #E84738;" v-else-if="scope.row.type == 0">不通过</span>
                  <span v-else>{{null}}</span>
                  <span v-else>{{ null }}</span>
               </template>
            </el-table-column>
            <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);
               });
         })
      },
      closeDialog() {
         this.addData = {
            orderNumber: null,
@@ -485,7 +514,7 @@
               message: '同步假成功(◕ᴗ◕)!',
               type: 'success'
            });
            this.isSync=false
            this.isSync = false
         }, 2000);
         return
         //调用同步接口