zouyu
2024-03-06 aa8684dfcf2ddbbadbd045770ff540e64c26bbee
src/views/plan/customerorder/index.vue
@@ -299,6 +299,7 @@
  exportCustomerOrderSplit,
  syncOrder,
  dropByContractNo,
  downloadProduct,
  downloadWordFile
} from '../../../api/plan/customerorder'
import DocumentTable from '@/views/common/document.vue'
@@ -920,11 +921,18 @@
      })
    }
    this.table.toolbar.push({
        text: '下载Word',
        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: '关联订单',
@@ -949,7 +957,7 @@
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
            checkHanderOrder(val.id).then(res=>{
            checkHanderOrder(val).then(res=>{
            if(res.status===200){
                this.$message.success("审核通过")
                this.getData()
@@ -993,8 +1001,22 @@
        this.interrelatedOrderId = currentOrder.id
        this.showInterrelatedOrderDialog = true
    },
    //下载word
    //下载排产通知单
    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){
@@ -1106,16 +1128,23 @@
    },
    // 新增 / 修改
    addOrUpdateHandle(row) {
      this.addOrUpdateVisible = true
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(row ? row.id : row)
      })
      if(row.isPass){
        this.addOrUpdateVisible = true
        this.$nextTick(() => {
            this.$refs.addOrUpdate.init(row ? row.id : row)
        })
      }else{
        this.addSampleVisible = true
        this.$nextTick(() => {
            this.$refs.addSampleForm.init(row ? row.contractNo : null)
        })
      }
    },
    // 新增样品订单
    addSampleCustomerOrder() {
      this.addSampleVisible = true
      this.$nextTick(() => {
        this.$refs.addSampleForm.init(0)
        this.$refs.addSampleForm.init(null)
      })
    },
    // 打开日期选择框