yangfeng
2023-10-21 508f805bae4f74c9432d82c045d895a62ea1f099
Merge branch 'zwf/style' into dev
1个文件已添加
4个文件已修改
882 ■■■■ 已修改文件
src/assets/style/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/SimpleSearchInput.vue 556 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/scrap/AddScrapDialog.vue 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/overview/index.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/style/index.scss
@@ -132,6 +132,9 @@
.yes-cursor {
  cursor: pointer;
}
.background_color_eee {
  background: #eee;
}
.Badge {
  background: #d3d3d3;
src/components/makepager/CommonFormTableView.vue
@@ -59,25 +59,14 @@
                :prop="'tableData.' + scope.$index + '.' + item.prop"
              >
                <div class="custom-name">
                  <el-select
                    v-model="scope.row[item.prop]"
                    placeholder="请选择"
                    size="mini"
                    style="width: 80%"
                    @change="
                      (val) => {
                        selProductNameClick(val)
                      }
                    "
                  <SimpleSearchInput
                    :echoValue="scope.row[item.prop]"
                    :echoName="scope.row[item.prop]"
                    checkedNum="1"
                    :clearable="true"
                    @select-user="selProductNameClick"
                  >
                    <el-option
                      v-for="item in productNameOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="{ value: item.id, label: item.name, amount: item.amount, unit: item.unit }"
                    >
                    </el-option>
                  </el-select>
                  </SimpleSearchInput>
                </div>
              </el-form-item>
              <el-form-item
@@ -260,10 +249,11 @@
import { getLocationList } from "@/api/warehouseManage/warehouse"
import { getCompanyList } from "@/api/common/other"
import { getRuleList } from "@/api/operate/inventoryAdjustment"
import SimpleSearchInput from "@/components/makepager/SimpleSearchInput"
// import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
export default {
  name: "CommmonFormTableView",
  components: {},
  components: { SimpleSearchInput },
  props: {
    detailEnter: {
      type: Boolean,
@@ -387,13 +377,15 @@
      })
    },
    selProductNameClick(item) {
      console.log(item)
      this.tableList.tableData.map((ite) => {
        if (ite.productName.label === item.label) {
          ite.productId = item.value
          ite.productName = item.label
          ite.amount = item.amount
          ite.unit = item.unit
        }
        console.log(ite)
        // if (ite.productName === item.name) {
        ite.productId = item.id
        ite.productName = item.name
        ite.amount = item.amount
        ite.unit = item.unit
        // }
      })
      console.log(this.tableList.tableData)
    },
@@ -537,6 +529,9 @@
    // 单选行相关
    tableRowClassName({ row, rowIndex }) {
      row.index = rowIndex
    },
    setFormItem(val) {
      console.log(val)
    }
  }
}
src/components/makepager/SimpleSearchInput.vue
New file
@@ -0,0 +1,556 @@
<template>
  <el-select
    v-model="selectValue"
    ref="search-select"
    popper-class="user-simple-search-input-popper"
    :popper-append-to-body="true"
    :disabled="disabled"
    :placeholder="placeholder"
    style="width: 100%"
    class="user-simple-search-input"
    @visible-change="changeSelectStatus"
    :clearable="clearable"
    filterable
    size="mini"
    @clear="selectClear"
  >
    <el-option :label="selectLabel" :value="selectValue">
      <div class="container" @click="endSelect">
        <div class="search">
          <el-input
            placeholder="搜索产品名称"
            v-model.trim="keyword"
            maxlength="20"
            @keyup.enter.native="updateSearchList(true)"
          >
            <i slot="suffix" class="el-input__icon el-icon-search" @click="updateSearchList(true)"></i>
          </el-input>
        </div>
        <div v-if="checkedNum > 1">
          <div class="selected-text">
            已选({{ selectedUser.length }}):
            <span class="user-text" v-for="(user, index) in selectedUser" :key="index">
              {{ user[obj.name] }}
              <span class="iconfont ico-delete-user" @click="deleteUser(user.id)">&#xe68f;</span>
              {{ selectedUser.length > index + 1 ? "," : "" }}
            </span>
          </div>
          <p class="fs12-tip" v-show="selectedUser.length == checkedNum">提示:最多选择{{ checkedNum }}人!</p>
        </div>
        <!-- <div class="bar">
          <span class="desc">请选择产品({{ listData.length }})</span>
        </div> -->
        <div class="list" v-loading="loading" element-loading-text="拼命加载中">
          <ul class="infinite-list" @scroll="loadList">
            <div class="background_color_eee">
              <el-row :gutter="0">
                <el-col :span="8">
                  <div class="grid-content bg-purple">
                    <span class="name">产品名称</span>
                  </div>
                </el-col>
                <el-col :span="8">
                  <div class="grid-content bg-purple">内部编码</div>
                </el-col>
                <el-col :span="5">
                  <div class="grid-content bg-purple">在库数量</div>
                </el-col>
                <el-col :span="3">
                  <div class="grid-content bg-purple">计量单位</div>
                </el-col>
              </el-row>
            </div>
            <li class="empty" v-if="listData.length === 0">暂无数据</li>
            <template v-else>
              <li
                v-for="(user, index) in listData"
                :key="index"
                @click="selectUser(user)"
                :class="selectValue == user.id ? 'highlight-color' : ''"
              >
                <el-row :gutter="0">
                  <el-col :span="8">
                    <div class="grid-content bg-purple" :title="user[obj.name]">
                      {{ user[obj.name] || "--" }}
                    </div>
                  </el-col>
                  <el-col :span="6">
                    <div class="grid-content bg-purple" :title="user.internalReference">
                      <span class="name">{{ user.internalReference || "--" }}</span>
                    </div>
                  </el-col>
                  <el-col :span="6">
                    <div class="grid-content bg-purple" :title="user.amount">
                      {{ user.amount || "--" }}
                    </div>
                  </el-col>
                  <el-col :span="4">
                    <div class="grid-content bg-purple" :title="user.unit">
                      {{ user.unit || "--" }}
                    </div>
                  </el-col>
                </el-row>
              </li>
              <li class="loading">{{ loading ? "加载中" : "已经到底" }}</li>
            </template>
          </ul>
        </div>
      </div>
    </el-option>
    <!-- <DataSet ref="dataSet" moduleName="物料管理"></DataSet> -->
  </el-select>
</template>
<script>
import { getProductList } from "@/api/product/product"
// import DataSet from "@/views/ShopFloorControl/facilty/components/DataSet";
export default {
  name: "UserSimpleSearchInput",
  components: {
    // DataSet,
  },
  props: {
    placeholder: {
      type: [String],
      default: "请选择"
    },
    disabled: {
      type: [Boolean],
      default: false
    },
    // 回显值code
    echoName: {
      type: [String],
      default: ""
    },
    // 回显名称name
    echoValue: {
      type: [String],
      default: ""
    },
    // 可选数量
    checkedNum: {
      type: [String, Number],
      default: 1
    },
    //可否清空
    clearable: {
      type: [Boolean],
      default: false
    },
    // 请求接口的参数
    // types: {
    //   type: [Array],
    //   default: () => ["半成品", "成品"]
    // },
    request: {
      type: [String, Number],
      defalut: ""
    },
    size: {
      type: [String],
      defalut: "medium"
    }
  },
  data() {
    return {
      // e-select组件model绑定变量,占位使用
      selectValue: this.echoValue ? this.echoValue : this.echoName ? this.echoName : "",
      selectLabel: "",
      // 搜索框搜索词
      keyword: "",
      // 查询页
      page: 1,
      // 每页展示数量
      pageSize: 10,
      // 数据总量
      count: 0,
      // 搜索用户结果数组
      listData: [],
      // 是否结束选择
      isEndSelect: false,
      selectedUser: [],
      loading: true,
      num: 0,
      obj: {
        name: "name",
        id: "id"
      }
    }
  },
  computed: {},
  watch: {
    echoName(val) {
      console.log(val)
      this.selectValue = this.echoValue ? this.echoValue : this.echoName ? this.echoName : ""
      this.checkMoreInit()
    },
    request(val) {
      this.getName(val)
    }
  },
  beforeMount() {
    this.checkMoreInit()
    this.getName(this.request)
    this.num = 0
  },
  methods: {
    getName(val) {
      if (val == 1) {
        // 其他搜索配置这里
        this.obj = {
          name: "gaugeName",
          id: "id"
        }
      }
    },
    // 更新搜索列表
    updateSearchList(needInit = false, param = {}) {
      let listParams
      // 初始化用户信息列表入参
      if (needInit) {
        this.page = 1
        this.count = 0
        this.listData = []
      }
      console.log(this.keyword)
      listParams = {
        keyWord: this.keyword,
        page: this.page,
        pageSize: this.pageSize,
        ...param
      }
      this.loading = true
      if (this.request) {
        // 其他
      } else {
        // 产品
        getProductList(listParams).then((res) => {
          if (res && res.code === 200 && res.data) {
            this.loading = false
            this.page = this.page + 1
            this.count = res.total
            if (res.data && Array.isArray(res.data)) {
              let arr = JSON.parse(JSON.stringify(res.data))
              this.listData = this.listData.concat(arr)
            }
            // if (this.num == 0 && this.listData.length == 0) {
            //   this.$refs.dataSet.materialVisible = true
            // }
            this.num += 1
          }
        })
      }
      setTimeout(() => {
        this.loading = false
      }, 10000)
    },
    // 动态加载列表
    loadList(event) {
      const { clientHeight, scrollTop, scrollHeight } = event.currentTarget
      // 当滚动top距离大于一屏的距离,加载下一页数据
      if (scrollTop > scrollHeight - clientHeight * 2) {
        // 当loading动画未结束时、或者列表数据条数大于接口返回总条数时不再请求数据
        if (!this.loading && this.listData.length <= this.count) {
          this.updateSearchList()
        }
      }
    },
    // 选择用户
    selectUser(user) {
      if (this.checkedNum > 1) {
        if (this.selectedUser.length < this.checkedNum) {
          if (this.selectValue.indexOf(user.id) == -1) {
            this.selectedUser.push(user)
            this.selectValue = this.selectedUser
              .map((item) => {
                return item.id
              })
              .join(",")
            this.selectLabel = this.selectedUser
              .map((item) => {
                return item[this.obj.name]
              })
              .join(",")
          }
        }
        this.$emit("select-user", this.selectValue, this.selectLabel, this.selectedUser)
      } else {
        // 变更选择开关
        this.isEndSelect = false
        // 赋值el-select组件值
        this.selectValue = user.id
        this.selectLabel = user[this.obj.name]
        // 告知父组件所选用户数据
        this.selectedUser = user
        this.$emit("select-user", user)
      }
    },
    deleteUser(id) {
      for (let i = 0; i < this.selectedUser.length; i++) {
        if (this.selectedUser[i].id == id) {
          this.selectedUser.splice(i, 1)
        }
      }
      this.selectValue = this.selectedUser
        .map((item) => {
          return item.id
        })
        .join(",")
      this.selectLabel = this.selectedUser
        .map((item) => {
          return item[this.obj.name]
        })
        .join(",")
      this.$emit("select-user", this.selectValue, this.selectLabel, this.selectedUser)
    },
    // 多选时候
    checkMoreInit() {
      if (this.checkedNum > 1 && this.echoName) {
        this.selectedUser = []
        this.selectLabel = this.echoName
        let arr = this.echoName.split(",")
        let arr2 = this.echoValue.split(",")
        for (let i = 0; i < arr.length; i++) {
          let item = { id: arr2[i] }
          item[this.obj.name] = arr[i]
          this.selectedUser.push(item)
        }
      } else {
        if (this.echoName) {
          this.selectedUser = []
          this.selectLabel = this.echoName ? this.echoName : ""
          let item = { id: this.echoValue }
          item[this.obj.name] = this.echoName
          this.selectedUser.push(item)
          this.selectValue = this.echoValue ? this.echoValue : this.echoName ? this.echoName : ""
        } else {
          this.selectedUser = []
          this.selectLabel = ""
          this.selectValue = ""
        }
      }
    },
    // 结束选择、关闭弹窗
    endSelect(event) {
      this.isEndSelect && event.stopPropagation()
    },
    // 变更选择状态
    changeSelectStatus(status, value) {
      this.isEndSelect = status
      // 当status为true时,dialog打开,初始化page
      if (status) {
        this.keyword = ""
        if (value != "clear") {
          this.updateSearchList(true)
        }
      }
    },
    selectClear() {
      if (this.checkedNum > 1) {
        this.selectValue = []
        this.selectLabel = []
        this.selectedUser = []
        this.$emit("select-user", this.selectValue)
      } else {
        this.isEndSelect = true
        // 赋值el-select组件值
        this.selectValue = ""
        this.selectLabel = ""
        // 告知父组件所选用户数据
        this.selectedUser = ""
        this.$emit("select-user", this.selectedUser)
      }
      this.changeSelectStatus(true, "clear")
    }
  }
}
</script>
<style lang="scss">
.user-simple-search-input-popper {
  max-width: 630px;
  .el-select-dropdown__wrap {
    min-width: 509px;
    width: 100%;
    min-height: 370px;
    .el-select-dropdown__list {
      width: 100%;
      height: 350px;
      padding: 0;
      & > .el-select-dropdown__item {
        width: 100%;
        height: 350px;
        background-color: rgba(255, 255, 255, 1);
        padding: 0;
        & > .container {
          width: 96%;
          height: 100%;
          padding: 2%;
          .search {
            margin-bottom: 5px;
            & > .el-input {
              & > input {
                width: 100%;
                height: 40px;
                background: rgba(255, 255, 255, 1);
                border-radius: 4px;
                font-size: 14px;
                font-weight: 400;
                color: rgba(175, 179, 190, 1);
              }
              & > .el-input__suffix {
                & > .el-input__suffix-inner {
                  font-size: 19px;
                }
                & > .el-icon-circle-close {
                  display: none;
                }
                & > i.el-input__icon.el-input__validateIcon.el-icon-circle-check {
                  display: none;
                }
              }
            }
          }
          .bar {
            width: 100%;
            height: 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            & > .desc {
              font-size: 14px;
              font-weight: 400;
              color: rgba(102, 102, 102, 1);
            }
          }
          .list {
            width: 100%;
            height: calc(100% - 40px);
            background: rgba(250, 250, 252, 1);
            border: 1px solid rgba(250, 250, 252, 1);
            & > ul {
              width: 100%;
              overflow-y: auto;
              overflow-x: hidden;
              height: 100%;
              div {
                height: 40px;
                font-size: 14px;
                line-height: 40px;
                font-weight: 600;
                color: rgba(51, 51, 51, 1);
                padding: 0 4px;
                // background:#eee;
              }
              .highlight-color {
                background: #eee;
              }
            }
            & > ul > li {
              width: 100%;
              height: 40px;
              font-size: 14px;
              line-height: 40px;
              font-weight: 400;
              color: rgba(51, 51, 51, 1);
              padding: 0 4px;
              display: inline-block;
              float: left;
              &:hover {
                background: rgba(255, 255, 255, 1);
              }
              &.empty {
                width: 100%;
                height: calc(100% - 80px);
                display: flex;
                justify-content: center;
                align-items: center;
                &:hover {
                  background-color: transparent;
                }
              }
              &.loading {
                width: 100%;
                display: flex;
                justify-content: center;
                align-items: center;
              }
              & > .el-row > .el-col {
                & > .grid-content {
                  line-height: 48px;
                  padding: 0 7px;
                  text-overflow: ellipsis;
                  overflow: hidden;
                  white-space: nowrap;
                }
                &:nth-of-type(1) > .grid-content {
                  display: flex;
                  align-items: center;
                  justify-content: flex-start;
                  & > span.name {
                    width: calc(100% - 26px - 10px);
                    margin-left: 10px;
                    text-overflow: ellipsis;
                    overflow: hidden;
                    white-space: nowrap;
                  }
                }
              }
            }
          }
          .user-text {
            display: inline-block;
            line-height: 24px;
          }
          .ico-delete-user {
            color: #aaa;
            font-weight: normal;
            font-size: 16px;
            display: none;
            line-height: 24px;
            padding: 0 4px 0 2px;
            vertical-align: middle;
            margin-top: -2px;
          }
          .user-text:hover .ico-delete-user {
            display: inline-block;
          }
          .fs12-tip {
            font-size: 12px;
            font-weight: normal;
            line-height: 16px;
          }
          .selected-text {
            white-space: normal;
            line-height: 24px;
          }
        }
      }
    }
  }
}
</style>
src/views/operate/scrap/AddScrapDialog.vue
@@ -18,14 +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" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button>
        </div>
      </div>
      <!-- 内容 -->
@@ -52,26 +45,16 @@
            <el-row>
              <el-col :span="12">
                <el-form-item label="产品" prop="productName">
                  <el-select
                    v-model="editConfig.infomation.productName"
                    placeholder="请选择"
                    size="mini"
                    style="width: 90%"
                  <SimpleSearchInput
                    :echoValue="editConfig.infomation.productName"
                    :echoName="editConfig.infomation.productName"
                    checkedNum="1"
                    :clearable="true"
                    @select-user="selProductChange"
                    :disabled="!showFooter"
                    @change="selProductChange"
                    style="width: 90%"
                  >
                    <el-option
                      v-for="item in productOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="{
                        value: item.id,
                        label: item.name,
                        unit: item.unit,
                      }"
                    >
                    </el-option>
                  </el-select>
                  </SimpleSearchInput>
                </el-form-item>
              </el-col>
              <el-col :span="12">
@@ -83,12 +66,7 @@
                    style="width: 90%"
                    :disabled="!showFooter"
                  >
                    <el-option
                      v-for="item in toLocationOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    >
                    <el-option v-for="item in toLocationOptions" :key="item.id" :label="item.name" :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
@@ -101,7 +79,7 @@
                    :min="0"
                    :precision="2"
                    :controls="false"
                    style="width: 85%"
                    style="width: 90%"
                    :disabled="!showFooter"
                  ></el-input-number>
                  <span>{{ " " + unit }}</span>
@@ -116,12 +94,7 @@
                    style="width: 90%"
                    :disabled="!showFooter"
                  >
                    <el-option
                      v-for="item in toLocationOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    >
                    <el-option v-for="item in toLocationOptions" :key="item.id" :label="item.name" :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
@@ -142,25 +115,18 @@
      </el-form>
      <!-- 尾 -->
      <div slot="footer" class="dialog-footer">
        <el-button
          type="primary"
          size="small"
          @click="saveClick('form')"
          :disabled="!showFooter"
          >保存</el-button
        >
        <el-button size="small" @click="editConfig.visible = false"
          >取消</el-button
        >
        <el-button type="primary" size="small" @click="saveClick('form')" :disabled="!showFooter">保存</el-button>
        <el-button size="small" @click="editConfig.visible = false">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { getProductList } from "@/api/product/product";
import { getLocationList } from "@/api/overview/overview";
import { addDisuse, finishDisuse, updateScrap } from "@/api/operate/scrap";
import { getProductList } from "@/api/product/product"
import { getLocationList } from "@/api/overview/overview"
import { addDisuse, finishDisuse, updateScrap } from "@/api/operate/scrap"
import SimpleSearchInput from "@/components/makepager/SimpleSearchInput"
export default {
  name: "AddScrapDialog",
  props: {
@@ -170,12 +136,12 @@
        return {
          visible: false,
          title: "新建",
          infomation: {},
        };
      },
    },
          infomation: {}
        }
      }
    }
  },
  components: {},
  components: { SimpleSearchInput },
  computed: {},
  data() {
    return {
@@ -183,19 +149,11 @@
      editConfig: this.editCommonConfig,
      rules: {
        // 产品,数量必填
        productName: [
          { required: true, message: "请选择产品", trigger: "change" },
        ],
        productName: [{ required: true, validator: this.validatorProduct, trigger: "change" }],
        amount: [{ required: true, message: "请输入数量", trigger: "blur" }],
        fromLocationId: [
          { required: true, message: "请选择源位置", trigger: "change" },
        ],
        toLocationId: [
          { required: true, message: "请选择报废位置", trigger: "change" },
        ],
        sourceNumber: [
          { required: true, message: "请输入来源单据", trigger: "blur" },
        ],
        fromLocationId: [{ required: true, message: "请选择源位置", trigger: "change" }],
        toLocationId: [{ required: true, message: "请选择报废位置", trigger: "change" }],
        sourceNumber: [{ required: true, message: "请输入来源单据", trigger: "blur" }]
      },
      memberOptions: [],
      productOptions: [],
@@ -203,162 +161,167 @@
      list: [
        { label: "草稿", status: "todo", value: 1 },
        { label: "就绪", status: "todo", value: 3 },
        { label: "完成", status: "todo", value: 4 },
        { label: "完成", status: "todo", value: 4 }
      ],
      showEdit: false, // 是否显示编辑按钮
      showFooter: false, // 是否显示取消保存
      currentState: "todo", // 当前状态
      unit: "",
      showButton: true,
      isValidateClick: false, // 验证是否显示
    };
      isValidateClick: false // 验证是否显示
    }
  },
  created() {
    this.setBottonView();
    this.getProductList();
    this.getLocationList();
    this.unit = this.editConfig.infomation.unit || "";
    this.setBottonView()
    this.getProductList()
    this.getLocationList()
    this.unit = this.editConfig.infomation.unit || ""
  },
  methods: {
    // 产品
    async getProductList() {
      await getProductList({
        page: 1,
        pageSize: 100,
        pageSize: 100
      }).then((res) => {
        // console.log(res.data)
        if (res.code === 200) {
          if (res.data && res.data.length > 0) {
            this.productOptions = res.data;
            this.productOptions = res.data
          }
        }
      });
      })
    },
    // 获取仓库位置列表
    async getLocationList() {
      await getLocationList({
        keyWord: "",
        page: 0,
        pageSize: 0,
        pageSize: 0
      }).then((res) => {
        console.log(res);
        console.log(res)
        if (res.code === 200) {
          this.toLocationOptions = res.data;
          this.toLocationOptions = res.data
        }
      });
      })
    },
    // 设置删除/打印/编辑是否显示
    setBottonView() {
      if (
        this.editConfig.title === "新建" ||
        this.editConfig.title === "编辑"
      ) {
        this.showButton = false;
        this.showEdit = false;
        this.showFooter = true;
        this.isValidateClick = false;
      if (this.editConfig.title === "新建" || this.editConfig.title === "编辑") {
        this.showButton = false
        this.showEdit = false
        this.showFooter = true
        this.isValidateClick = false
      } else if (this.editConfig.infomation.status === 4) {
        this.showButton = false;
        this.showEdit = false;
        this.showFooter = false;
        this.isValidateClick = false;
        this.showButton = false
        this.showEdit = false
        this.showFooter = false
        this.isValidateClick = false
      } else {
        this.showButton = true;
        this.showEdit = false;
        this.showFooter = false;
        this.isValidateClick = true;
        this.showButton = true
        this.showEdit = false
        this.showFooter = false
        this.isValidateClick = true
      }
      if (this.editConfig.title === "新建") {
        this.list[0].status = "active";
        this.list[0].status = "active"
      } else {
        this.list.map((item) => {
          if (item.value === this.editConfig.infomation.status) {
            item.status = "active";
            item.status = "active"
          } else {
            item.status = "todo";
            item.status = "todo"
          }
        });
        })
      }
    },
    // 关闭
    handleClose() {
      this.editConfig.visible = false;
      this.editConfig.visible = false
    },
    // 编辑
    editClick() {
      this.showEdit = false;
      this.showFooter = true;
      this.showEdit = false
      this.showFooter = true
    },
    // 保存
    saveClick(formName) {
      if (this.editCommonConfig.title === "新建") {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.editConfig.infomation.productId = this.productId;
            this.editConfig.infomation.productName = this.productName;
            this.editConfig.infomation.unit = this.unit;
            this.editConfig.infomation.productId = this.productId
            this.editConfig.infomation.productName = this.productName
            this.editConfig.infomation.unit = this.unit
            addDisuse({
              ...this.editConfig.infomation,
              ...this.editConfig.infomation
            }).then((res) => {
              console.log(res);
              this.editConfig.visible = false;
              console.log(res)
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("添加成功");
                this.$parent.getData();
                this.$message.success("添加成功")
                this.$parent.getData()
              }
            });
            })
          }
        });
        })
      } else if (this.editCommonConfig.title === "编辑") {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.editConfig.infomation.productId = this.productId;
            this.editConfig.infomation.productName = this.productName;
            this.editConfig.infomation.unit = this.unit;
            this.editConfig.infomation.productId = this.productId
            this.editConfig.infomation.productName = this.productName
            this.editConfig.infomation.unit = this.unit
            updateScrap({
              amount:this.editConfig.infomation.amount, //数量
              amount: this.editConfig.infomation.amount, //数量
              baseOperationType: 1,
              fromLocationId: this.editConfig.infomation.fromLocationId,
              id: this.editConfig.infomation.id,
              number: this.editConfig.infomation.number,
              operationDate:this.editConfig.infomation.operationDate,
              operationDate: this.editConfig.infomation.operationDate,
              productId: this.editConfig.infomation.productId,
              sourceNumber: this.editConfig.infomation.sourceNumber,
              status: this.editConfig.infomation.status,
              toLocationId: this.editConfig.infomation.toLocationId,
              toLocationId: this.editConfig.infomation.toLocationId
            }).then((res) => {
              console.log(res);
              this.editConfig.visible = false;
              console.log(res)
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("修改成功");
                this.$parent.getData();
                this.$message.success("修改成功")
                this.$parent.getData()
              }
            });
            })
          }
          console.log(this.editConfig.infomation, "看看是啥");
        });
        })
      }
    },
    // 选择产品
    selProductChange(val) {
      this.unit = val.unit;
      this.productName = val.label;
      this.productId = val.value;
      this.unit = val.unit
      this.productName = val.name
      this.productId = val.id
      this.editConfig.infomation.productName = val.name
    },
    // 验证
    async validateClick() {
      console.log(this.editConfig.infomation.id, "xxx");
      console.log(this.editConfig.infomation.id, "xxx")
      await finishDisuse(this.editConfig.infomation.id).then((res) => {
        console.log(res);
        this.editConfig.visible = false;
        console.log(res)
        this.editConfig.visible = false
        if (res.code === 200) {
          this.$message.success("验证成功");
          this.$parent.getData();
          this.$message.success("验证成功")
          this.$parent.getData()
        }
      });
      })
    },
  },
};
    // 产品单独校验
    validatorProduct(rule, value, callback) {
      if (this.editConfig.infomation.productName && this.editConfig.infomation.productName.length > 0) {
        callback()
      } else {
        callback(new Error("请选择产品"))
      }
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
src/views/overview/index.vue
@@ -20,17 +20,24 @@
            <div class="label">
              <span style="cursor: pointer">{{ item.name }}</span>
            </div>
            <div class="set">...</div>
            <el-dropdown class="set" placement="bottom" trigger="click" @command="handleCommand">
              <div @click.stop="moreClick()">...</div>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item :command="{ command: '全部', item }">全部</el-dropdown-item>
                <el-dropdown-item :command="{ command: '就绪', item }">就绪</el-dropdown-item>
                <el-dropdown-item :command="{ command: '完成', item }">完成</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
          <div class="bottom">
            <div class="left">
              <div class="left_view">
              <div class="left_view" @click.stop="statusClick(item, '就绪')">
                <span>{{ item.readyCount }}</span>
                <span style="margin-left: 5px">就绪</span>
              </div>
            </div>
            <div class="right">
              <div class="right_status">
              <div class="right_status" @click.stop="statusClick(item, '完成')">
                <span style="cursor: pointer">{{ item.finishCount + " 完成" }}</span>
              </div>
              <!-- <div class="right_status" style="margin-top: 5px">
@@ -79,11 +86,11 @@
      this.keyword = val
      this.getData()
    },
    labelClick(item) {
    labelClick(item, status) {
      console.log(item)
      this.$router.push({
        name: "overviewList",
        params: { name: item.name, workType: item.baseOperationType, id: item.id }
        params: { name: item.name, workType: item.baseOperationType, id: item.id, status: status }
      })
    },
    async getData() {
@@ -103,6 +110,21 @@
          this.pagerOptions.totalCount = res.data.total
        }
      })
    },
    handleCommand(val) {
      console.log(val)
      if (val.command === "全部") {
        this.labelClick(val.item, "")
      } else {
        this.labelClick(val.item, val.command)
      }
    },
    // 更多
    moreClick() {},
    // 状态
    statusClick(item, status) {
      console.log(item)
      this.labelClick(item, status)
    }
  }
}
@@ -143,7 +165,7 @@
          margin-left: auto;
          margin-right: 20px;
          font-size: 20px;
          cursor: no-drop;
          // cursor: no-drop;
          color: #000;
          transform: rotate(-90deg);
          -moz-transform: rotate(-90deg);
@@ -153,6 +175,7 @@
      .bottom {
        display: flex;
        font-size: 13px;
        margin-top: 30px;
        .left {
          width: 50%;
          // background: #1d80e2;