chenrui пре 3 година
родитељ
комит
397e1dd49c

+ 9 - 0
src/api/purchaseDetail.js

@@ -71,3 +71,12 @@ export const purchaseDetailCancelSave = (params) => {
     method: 'post'
   })
 }
+// 采购  导出错误项
+export const purchaseDetailDownloadFail = params => {
+  return axios.request({
+    url: `/purchaseDetail/downloadFailExcel`,
+    method: 'post',
+    data: params,
+    responseType: 'blob'
+  })
+}

+ 22 - 0
src/views/purchasingManagement/purchaseOrder/chooseImportModal.vue

@@ -56,6 +56,13 @@
             class="button-cancel"
             @click="isShow=false"
             style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+          <a-button
+            type="primary"
+            id="chooseImport-error"
+            size="large"
+            class="button-error"
+            @click="handleError"
+            style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
         </div>
       </div>
     </a-spin>
@@ -64,7 +71,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdPrint } from '@/libs/JGPrint'
 import { purchaseDetailParseProducts, purchaseDetailBatchInsert } from '@/api/purchase'
+import { purchaseDetailDownloadFail } from '@/api/purchaseDetail'
 export default {
   name: 'ChooseImportModal',
   mixins: [commonMixin],
@@ -140,6 +149,19 @@ export default {
           }
         })
       }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      // 导出
+      hdPrint('', 'export', purchaseDetailDownloadFail, _this.unLoadData, '产品导入错误项', function () {
+        _this.spinning = false
+      })
     }
   },
   watch: {