zuozhengqing
2023-11-06 e7ccd2a06e4cdf3709e699507e1e15379ded5b83
src/views/warehouseManage/position/index.vue
@@ -5,36 +5,24 @@
        :add-title="'新建'"
        :placeholder="'请输入单号'"
        :amount-view="false"
        :search-task-map="searchTaskMap"
        @addCommonClick="addBtnClick"
        @searchClick="getList"
        @delSelectClick="delSelectClick"
      />
    </div>
    <div class="list-view">
      <div class="table">
        <TableCommonView
          ref="tableListRef"
          :table-list="tableList"
          :show-checkcol="false"
        >
        <template slot="tableButton">
        <TableCommonView ref="tableListRef" :table-list="tableList" :show-checkcol="false">
          <template slot="tableButton">
            <el-table-column label="操作" width="120" fixed="right">
              <template slot-scope="scope">
                <el-button
                  @click="tableRowClick(scope.row,'edit')"
                  type="text"
                  size="small"
                  >编辑</el-button
                >
                <el-button
                  type="text"
                  size="small"
                  @click="tableRowClick(scope.row,'look')"
                  >查看</el-button
                >
                <el-button @click="tableRowClick(scope.row, 'edit')" type="text" size="small">编辑</el-button>
                <el-button type="text" size="small" @click="tableRowClick(scope.row, 'look')">查看</el-button>
              </template>
            </el-table-column>
          </template>
      </TableCommonView>
        </TableCommonView>
      </div>
      <div class="btn-pager">
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
@@ -70,11 +58,14 @@
        title: "新建",
        infomation: {}
      },
      positionTypeList: getDataByType("positionType")
      positionTypeList: getDataByType("positionType"),
      searchTaskMap: [],
      type: 3
    }
  },
  created() {
    this.setTable()
    this.searchTaskMap = [{ id: "3", title: "内部位置" }]
    this.getData()
  },
  methods: {
@@ -134,6 +125,7 @@
    // 请求数据
    async getData() {
      await getLocationList({
        type: this.type,
        keyword: this.keyword,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
@@ -156,10 +148,12 @@
      this.getData()
    },
    // 行点击
    tableRowClick(row,val) {
      this.editConfig.title =  val=='look'?'查看':"编辑"
    tableRowClick(row, val) {
      this.editConfig.title = val == "look" ? "查看" : "编辑"
      this.editConfig.infomation = { ...row }
      this.editConfig.infomation.parentId = this.editConfig.infomation.parentId?Number(this.editConfig.infomation.parentId):null
      this.editConfig.infomation.parentId = this.editConfig.infomation.parentId
        ? Number(this.editConfig.infomation.parentId)
        : null
      this.editConfig.visible = true
    },
    // 新建
@@ -178,6 +172,11 @@
      }
      this.editConfig.visible = true
      this.editConfig.title = "新建"
    },
    // 删除位置
    delSelectClick() {
      this.type = 0
      this.getData()
    }
  }
}