haoxuan
2024-02-07 d68b036a3b3c67273b8effa3c9925ef3869a91ba
src/views/overview/OverviewListView.vue
@@ -1,8 +1,8 @@
<template>
  <div class="rightContent">
    <div class="label-fixed-element">
    <!-- <div class="label-fixed-element">
      <span>{{ params.name }}</span>
    </div>
    </div> -->
    <div class="top">
      <SearchCommonView
        :add-title="'新建'"
@@ -22,7 +22,7 @@
              <template slot-scope="scope">
                <el-button @click="tableRowClick(scope.row, '查看')" type="text" size="small">查看</el-button>
                <el-button
                  v-if="scope.row.status !== 4"
                  v-if="scope.row.status !== 4 && scope.row.status !== 5"
                  @click="tableRowClick(scope.row, '编辑')"
                  type="text"
                  size="small"
@@ -40,7 +40,7 @@
    <!-- 新建/编辑 -->
    <AddOverviewDialog
      v-if="editConfig.visible"
      :work-type="workType"
      :workType="workType"
      :edit-common-config="editConfig"
      :add-name="addName"
      :display-edit="displayEdit"
@@ -82,11 +82,11 @@
      formLabel: "",
      toLabel: "",
      addName: "",
      searchTaskMap: []
      searchTaskMap: [],
      numberLabel: "单号"
    }
  },
  created() {
    console.log(this.workType)
    this.setFormToLabel()
    this.setTable()
    var paramsData = sessionStorage.getItem("paramsData")
@@ -112,12 +112,15 @@
      if (this.workType === 1) {
        this.formLabel = "供应商位置"
        this.toLabel = "仓库位置"
        this.numberLabel = "入库单号"
      } else if (this.workType === 2) {
        this.formLabel = "仓库位置"
        this.toLabel = "客户位置"
        this.numberLabel = "出库单号"
      } else {
        this.formLabel = "调出位置"
        this.toLabel = "调入位置"
        this.numberLabel = "调拨单号"
      }
    },
    setTable() {
@@ -141,7 +144,7 @@
    setTableColumn(showcol) {
      let tableColumn = [
        {
          label: "单号",
          label: this.numberLabel,
          prop: "number",
          isShowColumn: true,
          default: true
@@ -234,7 +237,7 @@
    async getData() {
      await getOperation({
        number: this.keyword,
        operationTypeId: this.params.id,
        operationTypeId: this.$route.params.id ? this.$route.params.id : this.params.id,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize,
        status: this.params.status
@@ -244,8 +247,8 @@
          const list = res.data.map((item) => {
            return {
              ...item,
              from: item.fromLocation.name,
              to: item.toLocation.name
              from: item.location.jointName,
              to: item.location.jointName
            }
          })
          this.tableList.tableInfomation = list || []
@@ -262,25 +265,42 @@
    },
    // 查看 编辑
    tableRowClick(row, val) {
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = val
      this.editConfig.operationTypeId = this.params.id
      this.editConfig.code = this.params.code
      row.details.map((item)=>{
        item.fromLocationId=item.fromLocation.jointName
        item.toLocationId=item.toLocation.jointName
      })
      row.location={
        value:row.location.id||row.location.value,
        label:row.location.jointName||row.location.label
      }
      row.toLocation={
        value:row.toLocation.id||row.toLocation.value,
        label:row.toLocation.jointName||row.toLocation.label
      }
      row.locationID=row.location.jointName
      row.locationId=row.location.value
      // row.tolocationId=row.tolocation.value
      this.editConfig.infomation = { ...row }
    },
    // 新建
    addBtnClick() {
      this.editConfig.title = "新建"
      this.addName = this.params.name
      console.log(this.params, "ss刷新")
      this.editConfig.operationTypeId = this.params.id
      this.editConfig.code = this.params.code
      this.editConfig.infomation = {}
      this.editConfig.infomation = {
        // location:{jointName:""}
      }
      this.editConfig.visible = true
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "草稿" : val === 3 ? "就绪" : val === 4 ? "完成" : ""
      return val === 1 ? "草稿" : val === 3 ? "就绪" : val === 4 ? "完成" : val === 5 ? "取消" : ""
    },
    // 删除搜索状态
    delSelectClick() {