zuozhengqing
2023-11-24 58ac82fceff96784dd9e16872d1e2316fa2cfdec
src/views/reportForm/outboundDetail/AddOutboundDetailDialog.vue
@@ -10,7 +10,7 @@
      <div slot="title" class="dialog-header">
        <span>{{ editCommonConfig.title === "查看" ? editCommonConfig.title : editCommonConfig.title + addName }}</span>
        <div class="header_btns">
          <span class="btn">
          <span class="btn" @click="btnPrint">
            <i class="el-icon-printer"></i>
            <span>打印</span>
          </span>
@@ -18,7 +18,7 @@
            <i class="el-icon-s-tools"></i>
            <span>动作</span>
          </span>
          <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button>
          <el-button v-if="showEdit" :disabled="this.editConfig.infomation.status===5" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button>
        </div>
      </div>
      <!-- 内容 -->
@@ -36,6 +36,7 @@
            :showButton="showButton"
            :isValidateClick="isValidateClick"
            :isDelClick="isDelClick"
            :isCancel="isCancel"
            :list="list"
            :showCancel="showCancel"
            @delClick="delClick"
@@ -314,7 +315,8 @@
  stateCancel,
  deleteOperation,
  getListTransfer,
  getLogisticCompanyList
  getLogisticCompanyList,
  printReceipts
} from "@/api/overview/overview"
import { getCompanyList } from "@/api/common/other"
export default {
@@ -360,13 +362,6 @@
      companyOptions: [], // 公司
      memberOptions: [{ id: 1, name: "管理员" }],
      toLocationOptions: [], //  源位置 仓库位置
      list: [
        { label: "草稿", status: "todo", value: 1 },
        { label: "正在等待", status: "todo", value: 2 },
        { label: "就绪", status: "todo", value: 3 },
        { label: "完成", status: "todo", value: 4 },
        { label: "已取消", status: "todo", value: 5 }
      ],
      showButton: true,
      activeName: "first",
      productTableList: {},
@@ -375,6 +370,7 @@
      isNoProduct: true, // 添加明细行时是否有产品未选择
      showEdit: false, // 是否显示编辑按钮
      isDelClick: false, // 删除按钮是否可点击
      isCancel:false, //验证按钮是否可点击
      showFooter: false, // 是否显示取消保存
      currentState: "todo", // 当前状态
      detailTableList: {},
@@ -394,9 +390,11 @@
        logisticWeight:0,
      },
      showCancel:false, // 取消是否可以显示
      list:[],
    }
  },
  created() {
    this.setStatusList()
    this.setTableForm()
    this.setBottonView()
    this.setDetailTableForm()
@@ -409,6 +407,25 @@
    this.getLogisticCompanyList()
  },
  methods: {
    setStatusList(){
      if(this.editConfig.infomation.status===5){
        this.list=[
          { label: "草稿", status: "todo", value: 1 },
          { label: "正在等待", status: "todo", value: 2 },
          { label: "就绪", status: "todo", value: 3 },
          { label: "完成", status: "todo", value: 4 },
          { label: "已取消", status: "todo", value: 5 }
        ]
      }else{
        console.log(this.editConfig.infomation.status,"藕片")
        this.list=[
          { label: "草稿", status: "todo", value: 1 },
          { label: "正在等待", status: "todo", value: 2 },
          { label: "就绪", status: "todo", value: 3 },
          { label: "完成", status: "todo", value: 4 }
        ]
      }
    },
    // 获取公司列表
    async getCompanyList() {
      await getCompanyList().then((res) => {
@@ -474,9 +491,11 @@
        }else if(this.editConfig.infomation.status === 3){
          this.isValidateClick = true
          this.showCancel=true
        }else if(this.editConfig.infomation.status===5){
          this.isCancel=true
          this.isValidateClick=true
        }else{
          this.isValidateClick = true
        }
      } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "完成") {
        this.showButton = true
@@ -485,6 +504,7 @@
        this.showFooter = false
        this.isValidateClick = false
      } else if (this.editConfig.infomation.status === 5) {
        this.isCancel=true
        this.showButton = true
        this.showEdit = false
        this.showFooter = false
@@ -788,6 +808,19 @@
        })
      }).catch(() => {         
      });
    },
    //打印
    async btnPrint(){
      await printReceipts(this.editCommonConfig.infomation.id).then((res) => {
        console.log(res)
        if (res.code === 200) {
          this.$message.success("打印成功")
          const link = document.createElement('a');
          link.href = res.data;
          link.download = '出库单.xlsx';
          link.click();
        }
      })
    }
  }
}
@@ -804,6 +837,9 @@
    margin-left: auto;
    margin-right: 60px;
    .btn {
      cursor: pointer;
    }
    .btn:nth-of-type(2){
      cursor: no-drop;
    }
  }