haoxuan
2024-02-07 d68b036a3b3c67273b8effa3c9925ef3869a91ba
src/views/operate/allot/index.vue
@@ -11,19 +11,34 @@
    </div>
    <div class="list-view">
      <div class="table">
        <TableCommonView
          ref="tableListRef"
          :table-list="tableList"
          @selTableCol="selTableCol"
          @tableRowClick="tableRowClick"
        ></TableCommonView>
        <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol">
          <template slot="tableButton">
            <el-table-column label="操作" width="100">
              <template slot-scope="scope">
                <el-button @click="tableRowClick(scope.row, '查看')" type="text" size="small">查看</el-button>
                <el-button
                  v-if="scope.row.status !== 4"
                  @click="tableRowClick(scope.row, '编辑')"
                  type="text"
                  size="small"
                  >编辑</el-button
                >
              </template>
            </el-table-column>
          </template>
        </TableCommonView>
      </div>
      <div class="btn-pager">
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
    <!-- 新建/编辑 -->
    <AddOverviewDialog v-if="editConfig.visible" :work-type="3" :edit-common-config="editConfig" />
    <AddOverviewDialog
      v-if="editConfig.visible"
      :show-operation-type="true"
      :work-type="3"
      :edit-common-config="editConfig"
    />
  </div>
</template>
@@ -42,13 +57,8 @@
  data() {
    return {
      tableList: {},
      showcol: ["从", "至", "联系人", "日期", "来源单据", "公司", "状态"],
      showcol: ["调出位置", "调入位置", "联系人", "日期", "来源单据", "公司", "状态"],
      searchOptions: [],
      commonDetail: {
        visible: false,
        title: "新建",
        infomation: {}
      },
      editConfig: {
        visible: false,
        title: "新建",
@@ -65,7 +75,8 @@
    setTable() {
      this.tableList = {
        tableInfomation: [],
        selectBox: true,
        selectBox: false,
        selectIndex: true,
        showcol: this.showcol,
        allcol: [],
        tableColumn: this.setTableColumn(this.showcol)
@@ -88,15 +99,15 @@
          default: true
        },
        {
          label: "从",
          label: "调出位置",
          prop: "from",
          isShowColumn: showcol.includes("从"),
          isShowColumn: showcol.includes("调出位置"),
          default: false
        },
        {
          label: "至",
          label: "调入位置",
          prop: "to",
          isShowColumn: showcol.includes("至"),
          isShowColumn: showcol.includes("调入位置"),
          default: false
        },
        {
@@ -213,14 +224,13 @@
      await getAllList({
        number: this.keyword,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize,
        sourceNumber: this.keyword
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        if (res.code === 200) {
          const list = res.data.map((item) => {
            return {
              ...item,
              from: item.fromLocation.name,
              from: item.location.jointName,
              to: item.toLocation.name
            }
          })
@@ -236,11 +246,25 @@
      this.pagerOptions.currPage = 1
      this.getData()
    },
    // 行点击
    tableRowClick(row) {
      console.log(row)
    // 查看 编辑
    tableRowClick(row, val) {
      console.log(row,"查看")
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.title = val
      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
      this.editConfig.infomation = { ...row }
    },
    // 新建
@@ -250,7 +274,7 @@
    },
    // 状态
    getStatus(val) {
      return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成"
      return val === 1 ? "草稿" : val === 3 ? "就绪" :val===4? "完成": "取消"
    }
  }
}