zouyu
2024-03-06 6ac64fea29fa0df01f9d0e70372e086de9725aa1
src/views/plan/customerorder/index.vue
@@ -384,7 +384,8 @@
  exportCustomerOrderSplit,
  syncOrder,
  dropByContractNo,
  downloadWordFile,
  downloadProduct,
  downloadWordFile
} from '../../../api/plan/customerorder'
import DocumentTable from '@/views/common/document.vue'
import { remote } from '@/api/admin/dict'
@@ -1036,11 +1037,18 @@
      })
    }
    this.table.toolbar.push({
      text: '下载Word',
      disabled: false,
      type: 'primary',
      fun: this.downloadWord,
      permitArr: ['03plan', '04planed'],
        text: '下载工艺文件',
        disabled: false,
        type: 'primary',
        fun: this.downloadWord,
        permitArr: ['03plan','04planed'],
    })
    this.table.toolbar.push({
        text: '下载排产单',
        disabled: false,
        type: 'primary',
        permitArr: [],
        fun: this.downloadProductionScheduling,
    })
    this.table.toolbar.push({
      text: '关联订单',
@@ -1115,16 +1123,29 @@
      this.interrelatedOrderId = currentOrder.id
      this.showInterrelatedOrderDialog = true
    },
    //下载word
    downloadWord() {
      let ids = this.multipleSelection.map((ele) => ele.id)
      if (ids.length < 1) {
        this.$message.error('请选择一条数据')
        return
      }
      downloadWordFile(ids)
        .then((response) => {
    //下载排产通知单
    downloadProductionScheduling(){
        let ids = this.multipleSelection.map(obj => obj.id)
        if(ids.length<1){
            this.$message.error("请选择一条数据")
            return
        }
        downloadProduct({ids: ids}).then(res=>{
            if(res.status===200){
                transform(res)
            }
        }).catch(error=>{
            console.error(error)
        })
    },
    //下载工艺文件
    downloadWord(){
        let ids = this.multipleSelection.map(ele=>ele.id)
        if(ids.length<1){
            this.$message.error("请选择一条数据")
            return
        }
        downloadWordFile(ids).then(response=>{
          // 处理返回的文件流
          const blob = response.data
          const link = document.createElement('a')