xiaodai2022 2 anni fa
parent
commit
fa4f4eef0e

+ 1 - 0
src/views/purchaseIn/purchaseOrder/components/tolerance.vue

@@ -1,5 +1,6 @@
 <template>
   <span>
+    {{ isshow + "" }}--{{ showBtn + "" }}--{{ order_type + "" }}
     <el-button
       v-show="isshow && showBtn && order_type && order_type !== '1'"
       type="primary"

+ 23 - 16
src/views/purchaseIn/purchaseOrder/detail.vue

@@ -6,10 +6,15 @@
     >
       <div
         class="detail-page-title"
-        :showBtn="status === '1' && powers.some((item) => item == '082')"
+        v-if="status === '1' && powers.some((item) => item == '082')"
       >
         <span>采购单编号:</span><span>{{ queryId }} </span>
-        <tolerance :newTime="newTime" v-if="newTime !== ''" :sitem="sitem" />
+        <tolerance
+          :newTime="newTime"
+          v-if="newTime !== ''"
+          :sitem="sitem"
+          :showBtn="status === '1' && powers.some((item) => item == '082')"
+        />
 
         <!-- 暂时注释,下版需要导出 -->
         <!-- <el-button type="primary" style="margin-left:30px;" @click="download">
@@ -237,13 +242,11 @@ export default {
   },
   methods: {
     //导出文件 (需要修改)
-    download(){
+    download() {
       if (!this.loading) {
         this.loading = true;
         // let httpType = `aplication/zip`;
-        let model = {
-          
-        };
+        let model = {};
         axios({
           method: "post",
           url: this.fileUrl + "admin/checkexport",
@@ -254,16 +257,20 @@ export default {
           // },
         })
           .then((res) => {
-            if (res && res.status == 200 && res.data) {   
-              let url = window.URL.createObjectURL(new Blob([res.data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}))
-              let link = document.createElement('a')
-              link.style.display = 'none'
-              link.href = url
-              let excelName = '测试.xlsx'
-              link.setAttribute('download', excelName)
-              document.body.appendChild(link)
-              link.click()
-              link.remove()
+            if (res && res.status == 200 && res.data) {
+              let url = window.URL.createObjectURL(
+                new Blob([res.data], {
+                  type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
+                })
+              );
+              let link = document.createElement("a");
+              link.style.display = "none";
+              link.href = url;
+              let excelName = "测试.xlsx";
+              link.setAttribute("download", excelName);
+              document.body.appendChild(link);
+              link.click();
+              link.remove();
               window.URL.revokeObjectURL(url); //释放掉blob对象
               this.$message.success(`${message}导出成功!`);
               setTimeout(() => {