haoxuan
2024-04-09 4bf10a1ba42ddaeab565c105b376c5732b0f3dab
Merge branch 'master' of http://192.168.5.5:10010/r/silk/silk-web
9个文件已修改
7个文件已添加
2543 ■■■■■ 已修改文件
src/api/systemSetting/dataDictionary.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/systemSetting/workshopManage.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/TableCommonView.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/dataDictionary/components/silkTableList.vue 402 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/dataDictionary/index.vue 307 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/encodeManage/components/addWorkshop.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/encodeManage/components/silkTableList.vue 402 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/encodeManage/index.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/silkPriceStandard/components/silkTableList.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/silkPriceStandard/index.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/workshopManage/components/addDialog.vue 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/workshopManage/components/addWorkshop.vue 382 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/workshopManage/components/silkTableList.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/workshopManage/index.vue 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/systemSetting/dataDictionary.js
New file
@@ -0,0 +1,19 @@
import request from "@/common/untils/request.js"
// 字典列表
export function getDict(data) {
  return request({
    url: "/api-jl/v1/system/dict?dictType="+data.dictType,
    method: "get",
    data
  })
}
// 添加字典
export function addDict(data) {
  return request({
    url: "/api-jl/v1/system/dict",
    method: "post",
    data
  })
}
src/api/systemSetting/workshopManage.js
New file
@@ -0,0 +1,35 @@
import request from "@/common/untils/request.js"
// 车间列表
export function getWorkshopManageList(data) {
  return request({
    url: "/api-jl/v1/system/getWorkshopManageList"+'?keyWord='+data.keyWord,
    method: "get",
    data
  })
}
// 字典列表
export function getDict(data) {
  return request({
    url: "/api-jl/v1/system/dict?dictType="+data.dictType,
    method: "get",
    data
  })
}
// 保存车间列表
export function saveWorkshopManage(data) {
  return request({
    url: "/api-jl/v1/system/saveWorkshopManage",
    method: "post",
    data
  })
}
// 删除车间
export function deleteWorkshopManage(data) {
  return request({
    url: "/api-jl/v1/system/deleteWorkshopManage/"+data.id,
    method: "delete",
    data
  })
}
src/components/makepager/TableCommonView.vue
@@ -39,6 +39,17 @@
        :fixed="item.fixed"
        v-if="item.isShowColumn"
      >
      <template slot="header">
          {{ item.label }}
          <span v-if="item.iconRight">
            <i
              :class="item.iconRight"
              style="font-size: 16px; margin-left: 5px; cursor: pointer"
              @click="handleShow(item)"
            ></i>
          </span>
        </template>
        <template slot-scope="scope">
          <span v-if="item.price">{{ "¥" + number_format(scope.row[item.prop], 2, ".", ",") }}</span>
          <div v-else-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div>
@@ -412,7 +423,11 @@
      } else {
        return false
      }
    }
    },
    // 自定义表头点击事件
    handleShow(item) {
      this.$emit("handleShow", item);
    },
  }
}
</script>
src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue
New file
@@ -0,0 +1,147 @@
<template>
  <div class="add_wordshop">
    <el-dialog
      :title="editConfig.dialogTitle+editConfig.dialogTitleType"
      :visible.sync="editConfig.visible"
      width="30%"
      :before-close="handleClose">
      <el-form :inline="true" label-width="20%" style="width: 100%;" :model="form" >
        <template v-if="editConfig.infomitton.TabsIndex===0||editConfig.infomitton.TabsIndex===1">
          <el-form-item label="编码" style="width: 100%;" >
            <el-input   v-model="form.number" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="名称" style="width: 100%;" >
            <el-input   v-model="form.name" placeholder="请输入字母或数字,不允许有空格、中文"></el-input>
          </el-form-item>
        </template>
        <template v-if="editConfig.infomitton.TabsIndex===2">
          <el-form-item label="带号颜色" style="width: 100%;" >
            <el-input  v-model="form.name" placeholder="请输入字母或数字,不允许有空格、中文"></el-input>
          </el-form-item>
        </template>
        <template v-if="editConfig.infomitton.TabsIndex===3">
          <el-form-item label="规格" style="width: 100%;" >
            <el-input  v-model="form.number" placeholder="请输入字母或数字,不允许有空格、中文"></el-input>
          </el-form-item>
        </template>
        <el-form-item label="描述" style="width: 100%;" >
          <el-input
            v-model="form.remark"
            type="textarea"
            :rows="4"
            style="resize: none !important;"
            placeholder="请输入"
            >
          </el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="editConfig.visible = false">取 消</el-button>
        <el-button type="primary" @click="commitForm">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {addDict} from "@/api/systemSetting/dataDictionary"
export default {
  props: {
    editDiaConfig:{
      type: Object,
      default: () => {
        return {
          visible: false,
          dialogTitle:"添加",
          infomitton: {
          }
        }
      }
    }
  },
  data() {
    return {
      editConfig:this.editDiaConfig,
      form: {
        name: '',
        number: '',
        remark:""
      }
    };
  },
  computed: {
  },
  created() {
  },
  mounted() {
  },
  watch: {
  },
  methods: {
    handleClose(done) {
      done();
    },
    saveParams(type){
      let params={}
      if(type===0||type===1){
        params={
          dictType:this.editConfig.infomitton.TabsIndex,
          name: this.form.name,
          number: this.form.number,
          remark:this.form.remark,
        }
      }else if(type===2){
        params={
          dictType:this.editConfig.infomitton.TabsIndex,
          name: this.form.name,
          number: this.form.number,
          remark:this.form.remark,
        }
      }else if(type===3){
        params={
          dictType:this.editConfig.infomitton.TabsIndex,
          name: this.form.name,
          number: this.form.number,
          remark:this.form.remark,
        }
      }
      return params
    },
    commitForm(){
      let params=this.saveParams(this.editConfig.infomitton.TabsIndex)
      if(this.editConfig.dialogTitle==="新增"){
        addDict(params).then((res)=>{
          if(res&&res.code===200){
            this.editConfig.visible=false
            this.$parent.getData()
            this.$message({
              message: `新增${this.editConfig.dialogTitleType}成功!`,
              type: 'success'
            });
          }
          console.log(res,"res")
        })
      }else if(this.editConfig.dialogTitle==="修改"){
        console.log("修改")
      }
    }
  },
  components: {
  },
};
</script>
<style scoped lang="scss">
::v-deep .el-form-item__content{
  width: 70% !important;
}
</style>
src/views/systemSetting/dataDictionary/components/silkTableList.vue
New file
@@ -0,0 +1,402 @@
<template>
  <div class="page-view">
    <div class="top-box">
      <div class="table-box" :style="{ width: detailEnter ? '95%' : '100%' }">
        <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
          <el-table
            ref="fromTable"
            :data="tableList.tableData"
            style="width: 100%"
            @selection-change="handleSelectionChange"
            :row-key="(row) => row.productId"
            :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '14px' }"
            border
          >
            <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center">
            </el-table-column>
            <el-table-column
              v-if="tableList.isReturn"
              type="index"
              label="#"
              width="50"
              align="center"
            ></el-table-column>
            <el-table-column
              v-for="(item, i) in tableList.tableColumn"
              :key="i"
              :prop="item.prop"
              :label="item.label"
              :width="item.width"
              :min-width="item.min"
              align="center"
            >
              <!-- 表头样式 -->
              <template slot="header">
                <span v-if="item.isRequird" style="color: #f56c6c">*</span>
                <div v-else-if="item.addColumn" class="add-column-box">
                  <el-input
                    placeholder="请输入"
                    v-model="item.label"
                    size="mini"
                    clearable
                    @change="
                      (val) => {
                        addColumnInputChange(val, item.prop)
                      }
                    "
                  ></el-input>
                  <div class="common-select-btn" @click="clearupColumn(item.prop)">
                    <i class="el-icon-remove" title="删除"></i>
                  </div>
                </div>
                <span v-else>{{ item.label }}</span>
              </template>
              <!-- column样式 -->
              <template slot-scope="scope">
                <template v-if="detailEnter">
                  <el-form-item
                    v-if="item.input"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                    :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                  >
                    <el-input
                      v-model.trim="scope.row[item.prop]"
                      maxlength="50"
                      size="mini"
                      :disabled="!isOperate"
                      @change="
                        (val) => {
                          commonInputChange(val, item.prop, scope.row, scope)
                        }
                      "
                    ></el-input>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.projectName"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                  >
                    <div class="custom-name">
                      <el-select v-model="scope.row[item.prop]" clearable size="mini" placeholder="请选择">
                        <el-option
                          v-for="(item, index) in projectOptions"
                          :key="index"
                          :label="item.value"
                          :value="item.value"
                        >
                        </el-option>
                      </el-select>
                      <div class="common-select-btn" @click="clearupClient(scope)">
                        <i class="el-icon-remove" title="删除"></i>
                      </div>
                    </div>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.inputNumber"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                    :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                  >
                    <el-input-number
                      v-model="scope.row[item.prop]"
                      placeholder=""
                      :min="0"
                      :controls="false"
                      :disabled="!isOperate"
                      size="mini"
                      style="width: 100%; margin-right: 5px"
                      @change="
                        (val) => {
                          commonInputChange(val, item.prop, scope.row, scope)
                        }
                      "
                    ></el-input-number>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.inputFloat"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                    :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                  >
                    <el-input-number
                      v-model="scope.row[item.prop]"
                      placeholder=""
                      :min="0"
                      :precision="4"
                      :disabled="!isOperate"
                      :controls="false"
                      size="mini"
                      style="width: 100%; margin-right: 5px"
                      @change="
                        (val) => {
                          commonInputChange(val, item.prop, scope.row, scope)
                        }
                      "
                    ></el-input-number>
                  </el-form-item>
                  <span v-else>
                    <template>
                      {{ scope.row[item.prop] }}
                    </template>
                  </span>
                </template>
                <el-form-item
                  v-else-if="item.inputNumber && selectBox"
                  label=" "
                  :prop="'tableData.' + scope.$index + '.' + item.prop"
                  :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                >
                  <el-input-number
                    v-model="scope.row[item.prop]"
                    placeholder=""
                    :min="0"
                    :controls="false"
                    :disabled="!isOperate"
                    size="mini"
                    style="width: 100%; margin-right: 5px"
                    @change="
                      (val) => {
                        commonInputChange(val, item.prop, scope.row, scope)
                      }
                    "
                  ></el-input-number>
                </el-form-item>
                <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span>
              </template>
            </el-table-column>
            <el-table-column label="操作" width="80" v-if="!detailEnter" align="center">
              <template slot-scope="scope">
                <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">删除</el-button>
              </template>
            </el-table-column>
            <slot name="tableButton" />
            <div slot="empty">
              <el-empty description="暂无数据"></el-empty>
            </div>
          </el-table>
        </el-form>
      </div>
      <div
        v-if="detailEnter"
        class="add-column-box"
        @click="addColumnClick"
        :style="{ width: detailEnter ? '40px' : '0px' }"
      >
        <i class="el-icon-circle-plus"></i>
      </div>
    </div>
    <div v-if="detailEnter" style="margin: 10px">
      <div class="add-btn-box" @click="addRowClick">
        <i class="el-icon-circle-plus"></i>
      </div>
      <!-- <el-button size="small" type="primary" :disabled="!isOperate" @click="add">新增</el-button> -->
      <!-- <el-button size="small" type="primary" disabled>导入明细</el-button> -->
    </div>
  </div>
</template>
<script>
// import { getProductList } from "@/api/common/other"
export default {
  name: "CommmonFormTableView",
  components: {},
  props: {
    detailEnter: {
      type: Boolean,
      default: false
    },
    selectBox: {
      type: Boolean,
      default: false
    },
    // 那个页面 用来判断计算方式
    pageName: {
      type: String,
      default: ""
    },
    // 列表新增是否多选
    addTypeIdMultiple: {
      type: Boolean,
      default: false
    },
    // 根据报价单查询产品
    quotationNumber: {
      type: [String, Number],
      default: ""
    },
    // 是否可以操作 添加等
    isOperate: {
      type: Boolean,
      default: true
    },
    silkTableList: {
      type: Object,
      default: () => {
        return {
          tableData: [], // 接口返回数据
          isReturn: false,
          tableColumn: [
            // table表单
            { label: "", prop: "", min: 200, tooltip: true }
          ]
        }
      }
    }
  },
  data() {
    return {
      total: 0,
      productList: [],
      tableList: [],
      projectIndex: 0,
      projectOptions: [
        { id: 1, value: "纤度偏差" },
        { id: 2, value: "二次变化" },
        { id: 3, value: "清洁分" },
        { id: 4, value: "洁净分" },
        { id: 5, value: "最大偏差" }
      ]
    }
  },
  created() {
    // if (!this.selectBox) {
    //   this.getProductList()
    // }
    this.getTableInfo()
  },
  watch: {
    silkTableList: {
      handler() {
        this.getTableInfo()
      },
      immediate: true
    }
  },
  computed: {},
  methods: {
    getTableInfo() {
      this.tableList = this.silkTableList
      if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
        this.isRecalculate = false
      } else {
        this.isRecalculate = true
      }
    },
    // 多选
    handleSelectionChange(val) {
      this.$emit("getSelectArray", val)
    },
    // 新增
    addRowClick() {
      if (this.addTypeIdMultiple) {
        this.projectIndex = this.tableList.tableData.length
        this.editSelCommonConfig.title = "产品名称"
        this.editSelCommonConfig.isSelectBox = true
        this.editSelCommonConfig.editVisible = true
      } else {
        this.$emit("addProjectClick")
      }
    },
    commonInputChange(val, prop, row, scope) {
      this.$emit("inputContent", val, prop, row, scope)
    },
    // 删除
    deleteClick(scope) {
      this.$emit("clearupProject", this.tableList.tableData, scope.$index)
    },
    // 删除
    clearupClient(scope) {
      this.$emit("clearupProject", this.tableList.tableData, scope.$index)
    },
    // 添加列按钮
    addColumnClick() {
      this.$emit("addColumnClick")
    },
    // 添加列头部标题输入
    addColumnInputChange(val, prop) {
      console.log(val, prop, "添加列头部标题输入")
    },
    // 删除列
    clearupColumn(prop) {
      console.log(prop)
      this.$emit("clearupColumn", prop)
    }
  },
  //解决表格抖动问题
  beforeUpdate() {
    this.$nextTick(() => {
      this.$refs["fromTable"].doLayout()
    })
  },
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.page-view {
  .top-box {
    display: flex;
    .table-box {
      flex: 1;
      .el-form-item {
        margin-bottom: 0;
        .custom-name {
          display: flex;
          .common-select-btn {
            margin-left: 5px;
            font-size: 18px;
            cursor: pointer;
            color: #ff0000;
          }
        }
      }
    }
    .add-column-box {
      // width: 40px;
      margin-top: 10px;
      font-size: 26px;
      color: #5582f3;
      margin-left: 20px;
      cursor: pointer;
    }
  }
  .add-btn-box {
    font-size: 26px;
    color: #5582f3;
    margin-left: 50px;
    cursor: pointer;
  }
  .add-column-box {
    display: flex;
    .common-select-btn {
      margin-left: 5px;
      font-size: 18px;
      cursor: pointer;
      color: #ff0000;
    }
  }
}
::v-deep {
  .el-form-item__label {
    display: none;
  }
  .el-table__footer-wrapper tbody td.el-table__cell {
    background-color: #fff;
    // text-align: right;
    font-weight: bold;
  }
  .el-input--suffix .el-input__inner {
    padding-right: 0px;
  }
  .el-table .cell,
  .el-table th.el-table__cell > .cell {
    padding: 0 5px;
  }
  .el-input__inner {
    // text-align: left;
    text-align: center !important;
  }
}
</style>
src/views/systemSetting/dataDictionary/index.vue
@@ -1,21 +1,316 @@
<template>
  <div class="container"></div>
  <div class="silkStandardSetting-container">
    <div class="filter-card">
      <CommonSearch :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch">
        <template slot="leftButton">
          <el-button size="small" type="primary" @click="addBtnClick">新增</el-button>
          <el-button size="small" type="primary" @click="refreshClick">刷新</el-button>
        </template>
      </CommonSearch>
    </div>
    <div class="body-card">
      <div>
        <div class="bottom-tabs" >
          <div class="tab-pane" @click="getTab(0)" :style="{
            background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8',
            color: TabsIndex == 0 ? '#fff' : '#666'
          }">
            庄口管理
          </div>
          <div class="tab-pane" @click="getTab(1)" :style="{
            background: TabsIndex == 1 ? '#2a78fb' : '#F1F3F8',
            color: TabsIndex == 1 ? '#fff' : '#666'
          }">
            车间管理
          </div>
          <div class="tab-pane" @click="getTab(2)" :style="{
            background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8',
            color: TabsIndex == 2 ? '#fff' : '#666'
          }">
            带号颜色
          </div>
          <div class="tab-pane" @click="getTab(3)" :style="{
            background: TabsIndex == 3 ? '#2a78fb' : '#F1F3F8',
            color: TabsIndex == 3 ? '#fff' : '#666'
          }">
            规格
          </div>
        </div>
        <div class="list-view">
          <TableCommonView :loading="loading" :table-list="productTableList" @selTableCol="selBottomTableCol">
            <template slot="tableButton">
              <el-table-column label="操作" width="160" fixed="right">
                <template slot-scope="scope">
                  <!-- <el-button>{{ scope.row }}</el-button> -->
                  <el-button @click="rowClick(scope.row,'查看')" type="text" size="small">查看</el-button>
                  <el-button @click="rowClick(scope.row,'修改')" type="text" size="small">修改</el-button>
                  <el-button @click="rowClick(scope.row,'删除')" type="text" size="small">删除</el-button>
                </template>
              </el-table-column>
            </template>
          </TableCommonView>
        </div>
      </div>
    </div>
    <AddDataDictionaries
      :editDiaConfig="editConfig"
    />
  </div>
</template>
<script>
import AddDataDictionaries from "@/views/systemSetting/dataDictionary/components/addDataDictionaries.vue"
import {getDict} from "@/api/systemSetting/dataDictionary"
export default {
  name: "dataDictionary",
  props: {},
  components: {},
  components: {AddDataDictionaries},
  mixins: [],
  computed: {},
  data() {
    return {}
    return {
      TabsIndex:0,
      loading: false,
      productTableList: {},
      editConfig:{
        visible:false,
        dialogTitleType:"庄口",
        infomitton:{
          TabsIndex:0,
        }
      },
      tableColumn: [
        { label: "序号", prop: "number",},
        { label: "庄口名称", prop: "name",},
        { label: "描述", prop: "remark" },
      ],
      showCol: ["序号","庄口名称", "描述",],
      workshopTableColumn:[
        { label: "编码", prop: "number" },
        { label: "车间名称", prop: "name" },
        { label: "描述", prop: "remark" },
      ],
      showWorkshopCol: ["编码","车间名称", "描述",],
      colorTableColumn:[
        { label: "带号颜色", prop: "member_name" },
        { label: "描述", prop: "remark" },
      ],
      showColorCol: ["带号颜色", "描述",],
      specsTableColumn:[
        { label: "规格", prop: "member_name" },
        { label: "描述", prop: "remark" },
      ],
      showSpecsCol: ["规格", "描述",],
      getDataParams:{
        page: 1,
        pageSize:10,
        dictType:0,
      },
    }
  },
  created() {},
  methods: {}
  created() {
    this.getProductOrderInfo()
    // this.setTable()
    this.getData()
  },
  methods: {
    // 搜索
    onFilterSearch(searchText) {
      console.log(searchText)
    },
    // 新增
    addBtnClick() {
      this.editConfig.dialogTitle="新增"
      this.editConfig.visible=true
    },
    // 刷新
    refreshClick() {
      console.log("a")
     },
    // 打印
    printClick() {
      console.log("a")},
    //tabs切换
    getTab(tab) {
      this.TabsIndex = tab
      this.editConfig.infomitton.TabsIndex=tab
      // if (this.TabsIndex == 1) {
      //   this.isRequest = true;
      // } else {
      //   this.isRequest = false;
      // }
      this.getProductOrderInfo()
    },
    // setTable() {
    //   this.tableBottomColumn = this.tableColumn
    //   this.showBottomCol = this.showCol
    //   this.setBottomList()
    // },
    selTableCol(val) {
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
    },
    async getProductOrderInfo() {
        this.getData()
        if (this.TabsIndex == 0) {
          // 庄口管理
          this.editConfig.dialogTitleType="庄口"
          this.tableBottomColumn = this.tableColumn // 表头
          this.showBottomCol = this.showCol  // 动态表头
          this.setBottomList()
        }else if (this.TabsIndex == 1) {
          // 车间管理
          this.editConfig.dialogTitleType="车间"
          this.tableBottomColumn = this.workshopTableColumn
          this.showBottomCol = this.showWorkshopCol
          this.setBottomList()
        } else if (this.TabsIndex == 2) {
          // 带号颜色
          this.editConfig.dialogTitleType="带号颜色"
          this.tableBottomColumn = this.colorTableColumn
          this.showBottomCol = this.showColorCol
          this.setBottomList()
        } else if (this.TabsIndex == 3) {
          // 规格
          this.editConfig.dialogTitleType="规格"
          this.tableBottomColumn = this.specsTableColumn
          this.showBottomCol = this.showSpecsCol
          this.setBottomList()
        }
        this.loading = true
        // this.getProductInventoryInfo(number)
        // await getProductOrderInfo(number)
        //   .then((res) => {
        //     this.productDataBottom = res;
        //     this.getListValue(this.productDataBottom)
        //   })
        //   .catch(() => {
        //     this.productTableList.tableInfomation = []
        //   })
        this.loading = false
    },
    setBottomList() {
      this.productTableList = {
        selectIndex: true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showBottomCol,
        tableColumn: this.setColumnVisible(this.showBottomCol, this.tableBottomColumn)
      }
      this.setTableList(this.productTableList)
    },
    selBottomTableCol(val) {
      this.showcol = val
      this.productTableList.tableColumn = this.setColumnVisible(val, this.tableBottomColumn)
    },
    setTableList(tableList) {
      tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
      this.searchOptions = []
      for (let i = 0; i < tableList.tableColumn.length; i++) {
        const label = tableList.tableColumn[i].label
        const value = tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    setColumnVisible(showCol, tableColumn) {
      return tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn: showCol.includes(ele.label)
        }
      })
    },
    getData(){
      getDict({
        dictType:this.TabsIndex,
        page:this.getDataParams.page,
        pageSize:this.getDataParams.pageSize,
      }).then((res)=>{
        console.log(res,"res")
        this.productTableList.tableInfomation=res.data
      })
    },
    rowClick(row,type){
      if(type==="查看"){
        this.editConfig.dialogTitle="查看"
        this.editConfig.visible=true
      }else if(type==="修改"){
        this.editConfig.dialogTitle="修改"
        this.editConfig.visible=true
      }else if(type==="删除"){
        console.log("删除")
      }
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.silkStandardSetting-container {
  height: 100%;
  .filter-card {
    margin: 20px 30px;
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px 0 20px;
    border-radius: 4px;
    background-color: #fff;
  }
  .body-card {
    margin: 0 30px;
    background-color: #fff;
    padding: 10px 15px;
    height: calc(100% - 180px);
    border-radius: 4px;
    .edit-save {
      display: flex;
      align-items: center;
      margin-bottom: 10px;
      .edit-save-icon {
        font-size: 24px;
        color: #5582f3;
        cursor: pointer;
      }
      .edit-sace-label {
        margin-left: 10px;
        font-size: 14px;
        color: #000000d8;
      }
    }
  }
}
.bottom-tabs {
  height: 40px;
  line-height: 40px;
  // background: #e6ecf2;
  display: flex;
  .tab-pane {
    width: 100px;
    margin-right: 20px;
    font-size: 14px !important;
    text-align: center;
    cursor: pointer;
    background: #2a78fb;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
  }
}
.bgcGrey {
  background: #fff;
}
.bgcWhite {
  background: #fff !important;
}</style>
src/views/systemSetting/encodeManage/components/addWorkshop.vue
New file
@@ -0,0 +1,62 @@
<template>
  <div class="add_wordshop">
    <el-dialog
      title="提示"
      :visible.sync="editConfig.visible"
      width="30%"
      :before-close="handleClose">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="editConfig.visible = false">取 消</el-button>
        <el-button type="primary" @click="editConfig.visible = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: {
    editDiaConfig:{
      type: Object,
      default: () => {
        return {
          visible: false,
          infomitton: {
          }
        }
      }
    }
  },
  data() {
    return {
      editConfig:this.editDiaConfig
    };
  },
  computed: {
  },
  created() {
  },
  mounted() {
  },
  watch: {
  },
  methods: {
    handleClose(done) {
      done();
    }
  },
  components: {
  },
};
</script>
<style scoped lang="scss">
</style>
src/views/systemSetting/encodeManage/components/silkTableList.vue
New file
@@ -0,0 +1,402 @@
<template>
  <div class="page-view">
    <div class="top-box">
      <div class="table-box" :style="{ width: detailEnter ? '95%' : '100%' }">
        <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
          <el-table
            ref="fromTable"
            :data="tableList.tableData"
            style="width: 100%"
            @selection-change="handleSelectionChange"
            :row-key="(row) => row.productId"
            :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '14px' }"
            border
          >
            <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center">
            </el-table-column>
            <el-table-column
              v-if="tableList.isReturn"
              type="index"
              label="#"
              width="50"
              align="center"
            ></el-table-column>
            <el-table-column
              v-for="(item, i) in tableList.tableColumn"
              :key="i"
              :prop="item.prop"
              :label="item.label"
              :width="item.width"
              :min-width="item.min"
              align="center"
            >
              <!-- 表头样式 -->
              <template slot="header">
                <span v-if="item.isRequird" style="color: #f56c6c">*</span>
                <div v-else-if="item.addColumn" class="add-column-box">
                  <el-input
                    placeholder="请输入"
                    v-model="item.label"
                    size="mini"
                    clearable
                    @change="
                      (val) => {
                        addColumnInputChange(val, item.prop)
                      }
                    "
                  ></el-input>
                  <div class="common-select-btn" @click="clearupColumn(item.prop)">
                    <i class="el-icon-remove" title="删除"></i>
                  </div>
                </div>
                <span v-else>{{ item.label }}</span>
              </template>
              <!-- column样式 -->
              <template slot-scope="scope">
                <template v-if="detailEnter">
                  <el-form-item
                    v-if="item.input"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                    :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                  >
                    <el-input
                      v-model.trim="scope.row[item.prop]"
                      maxlength="50"
                      size="mini"
                      :disabled="!isOperate"
                      @change="
                        (val) => {
                          commonInputChange(val, item.prop, scope.row, scope)
                        }
                      "
                    ></el-input>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.projectName"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                  >
                    <div class="custom-name">
                      <el-select v-model="scope.row[item.prop]" clearable size="mini" placeholder="请选择">
                        <el-option
                          v-for="(item, index) in projectOptions"
                          :key="index"
                          :label="item.value"
                          :value="item.value"
                        >
                        </el-option>
                      </el-select>
                      <div class="common-select-btn" @click="clearupClient(scope)">
                        <i class="el-icon-remove" title="删除"></i>
                      </div>
                    </div>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.inputNumber"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                    :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                  >
                    <el-input-number
                      v-model="scope.row[item.prop]"
                      placeholder=""
                      :min="0"
                      :controls="false"
                      :disabled="!isOperate"
                      size="mini"
                      style="width: 100%; margin-right: 5px"
                      @change="
                        (val) => {
                          commonInputChange(val, item.prop, scope.row, scope)
                        }
                      "
                    ></el-input-number>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.inputFloat"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                    :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                  >
                    <el-input-number
                      v-model="scope.row[item.prop]"
                      placeholder=""
                      :min="0"
                      :precision="4"
                      :disabled="!isOperate"
                      :controls="false"
                      size="mini"
                      style="width: 100%; margin-right: 5px"
                      @change="
                        (val) => {
                          commonInputChange(val, item.prop, scope.row, scope)
                        }
                      "
                    ></el-input-number>
                  </el-form-item>
                  <span v-else>
                    <template>
                      {{ scope.row[item.prop] }}
                    </template>
                  </span>
                </template>
                <el-form-item
                  v-else-if="item.inputNumber && selectBox"
                  label=" "
                  :prop="'tableData.' + scope.$index + '.' + item.prop"
                  :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                >
                  <el-input-number
                    v-model="scope.row[item.prop]"
                    placeholder=""
                    :min="0"
                    :controls="false"
                    :disabled="!isOperate"
                    size="mini"
                    style="width: 100%; margin-right: 5px"
                    @change="
                      (val) => {
                        commonInputChange(val, item.prop, scope.row, scope)
                      }
                    "
                  ></el-input-number>
                </el-form-item>
                <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span>
              </template>
            </el-table-column>
            <el-table-column label="操作" width="80" v-if="!detailEnter" align="center">
              <template slot-scope="scope">
                <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">删除</el-button>
              </template>
            </el-table-column>
            <slot name="tableButton" />
            <div slot="empty">
              <el-empty description="暂无数据"></el-empty>
            </div>
          </el-table>
        </el-form>
      </div>
      <div
        v-if="detailEnter"
        class="add-column-box"
        @click="addColumnClick"
        :style="{ width: detailEnter ? '40px' : '0px' }"
      >
        <i class="el-icon-circle-plus"></i>
      </div>
    </div>
    <div v-if="detailEnter" style="margin: 10px">
      <div class="add-btn-box" @click="addRowClick">
        <i class="el-icon-circle-plus"></i>
      </div>
      <!-- <el-button size="small" type="primary" :disabled="!isOperate" @click="add">新增</el-button> -->
      <!-- <el-button size="small" type="primary" disabled>导入明细</el-button> -->
    </div>
  </div>
</template>
<script>
// import { getProductList } from "@/api/common/other"
export default {
  name: "CommmonFormTableView",
  components: {},
  props: {
    detailEnter: {
      type: Boolean,
      default: false
    },
    selectBox: {
      type: Boolean,
      default: false
    },
    // 那个页面 用来判断计算方式
    pageName: {
      type: String,
      default: ""
    },
    // 列表新增是否多选
    addTypeIdMultiple: {
      type: Boolean,
      default: false
    },
    // 根据报价单查询产品
    quotationNumber: {
      type: [String, Number],
      default: ""
    },
    // 是否可以操作 添加等
    isOperate: {
      type: Boolean,
      default: true
    },
    silkTableList: {
      type: Object,
      default: () => {
        return {
          tableData: [], // 接口返回数据
          isReturn: false,
          tableColumn: [
            // table表单
            { label: "", prop: "", min: 200, tooltip: true }
          ]
        }
      }
    }
  },
  data() {
    return {
      total: 0,
      productList: [],
      tableList: [],
      projectIndex: 0,
      projectOptions: [
        { id: 1, value: "纤度偏差" },
        { id: 2, value: "二次变化" },
        { id: 3, value: "清洁分" },
        { id: 4, value: "洁净分" },
        { id: 5, value: "最大偏差" }
      ]
    }
  },
  created() {
    // if (!this.selectBox) {
    //   this.getProductList()
    // }
    this.getTableInfo()
  },
  watch: {
    silkTableList: {
      handler() {
        this.getTableInfo()
      },
      immediate: true
    }
  },
  computed: {},
  methods: {
    getTableInfo() {
      this.tableList = this.silkTableList
      if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
        this.isRecalculate = false
      } else {
        this.isRecalculate = true
      }
    },
    // 多选
    handleSelectionChange(val) {
      this.$emit("getSelectArray", val)
    },
    // 新增
    addRowClick() {
      if (this.addTypeIdMultiple) {
        this.projectIndex = this.tableList.tableData.length
        this.editSelCommonConfig.title = "产品名称"
        this.editSelCommonConfig.isSelectBox = true
        this.editSelCommonConfig.editVisible = true
      } else {
        this.$emit("addProjectClick")
      }
    },
    commonInputChange(val, prop, row, scope) {
      this.$emit("inputContent", val, prop, row, scope)
    },
    // 删除
    deleteClick(scope) {
      this.$emit("clearupProject", this.tableList.tableData, scope.$index)
    },
    // 删除
    clearupClient(scope) {
      this.$emit("clearupProject", this.tableList.tableData, scope.$index)
    },
    // 添加列按钮
    addColumnClick() {
      this.$emit("addColumnClick")
    },
    // 添加列头部标题输入
    addColumnInputChange(val, prop) {
      console.log(val, prop, "添加列头部标题输入")
    },
    // 删除列
    clearupColumn(prop) {
      console.log(prop)
      this.$emit("clearupColumn", prop)
    }
  },
  //解决表格抖动问题
  beforeUpdate() {
    this.$nextTick(() => {
      this.$refs["fromTable"].doLayout()
    })
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.page-view {
  .top-box {
    display: flex;
    .table-box {
      flex: 1;
      .el-form-item {
        margin-bottom: 0;
        .custom-name {
          display: flex;
          .common-select-btn {
            margin-left: 5px;
            font-size: 18px;
            cursor: pointer;
            color: #ff0000;
          }
        }
      }
    }
    .add-column-box {
      // width: 40px;
      margin-top: 10px;
      font-size: 26px;
      color: #5582f3;
      margin-left: 20px;
      cursor: pointer;
    }
  }
  .add-btn-box {
    font-size: 26px;
    color: #5582f3;
    margin-left: 50px;
    cursor: pointer;
  }
  .add-column-box {
    display: flex;
    .common-select-btn {
      margin-left: 5px;
      font-size: 18px;
      cursor: pointer;
      color: #ff0000;
    }
  }
}
::v-deep {
  .el-form-item__label {
    display: none;
  }
  .el-table__footer-wrapper tbody td.el-table__cell {
    background-color: #fff;
    // text-align: right;
    font-weight: bold;
  }
  .el-input--suffix .el-input__inner {
    padding-right: 0px;
  }
  .el-table .cell,
  .el-table th.el-table__cell > .cell {
    padding: 0 5px;
  }
  .el-input__inner {
    // text-align: left;
    text-align: center !important;
  }
}
</style>
src/views/systemSetting/encodeManage/index.vue
@@ -1,21 +1,186 @@
<template>
  <div class="container"></div>
  <div class="silkStandardSetting-container">
    <div class="filter-card">
      <CommonSearch :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch">
        <template slot="leftButton">
          <el-button size="small" type="primary" @click="addBtnClick" >新增</el-button>
          <el-button size="small" type="primary" @click="delBtnClick" >删除</el-button>
          <el-button size="small" type="primary" @click="addBtnClick" >修改</el-button>
          <el-button size="small" type="primary" @click="refreshClick">刷新</el-button>
        </template>
      </CommonSearch>
    </div>
    <div class="body-card">
      <!-- <div class="edit-save">
        <div class="edit-save-icon" @click="editSaveClick">
          <i :class="isEdit ? 'el-icon-unlock' : 'el-icon-lock'"></i>
        </div>
        <div class="edit-sace-label">{{ isEdit ? "锁定保存" : "界面设计" }}</div>
      </div> -->
      <div>
        <SilkTableList
          :detail-enter="isEdit"
          :silk-table-list="silkTableList"
          @inputContent="inputContent"
          @addProjectClick="addBtnClick"
          @clearupProject="clearupProject"
          @deleteClick="clearupProject"
          @addColumnClick="addColumnClick"
          @clearupColumn="clearupColumn"
        >
        </SilkTableList>
      </div>
    </div>
  </div>
</template>
<script>
import SilkTableList from "@/views/systemSetting/workshopManage/components/silkTableList"
export default {
  name: "encodeManage",
  props: {},
  components: {},
  components: { SilkTableList },
  mixins: [],
  computed: {},
  data() {
    return {}
    return {
      isEdit: false,
      silkTableList: {},
      tableData: [],
      tableColumn: [
        { label: "编码名称", prop: "projectName", projectName: true },
        { label: "编码类型", prop: "start", inputFloat: true },
        { label: "描述", prop: "end", inputFloat: true },
      ],
      columnNum: 0,
      dataObj: {
        projectName: "",
        start: 0,
        end: 0,
        price1: 0,
        price2: 0,
        price3: 0
      }
    }
  },
  created() {},
  methods: {}
  created() {
    this.setTableForm()
  },
  methods: {
    setTableForm() {
      this.silkTableList = {
        tableData: this.tableData,
        isReturn: false,
        tableColumn: this.tableColumn
      }
    },
    // 搜索
    onFilterSearch(searchText) {
      console.log(searchText)
    },
    // 新增
    addBtnClick() {
      if(this.isEdit){
        this.$message.warning("请先保存当前编辑")
      }else{
        this.isEdit = true
        // array.splice(index, 0, item)
        this.tableData.splice(0,0,{
          projectName: "",
          start: 0,
          end: 0,
          price1: 0,
          price2: 0,
          price3: 0,
          isAdd:true,
        })
      }
    },
    // 保存
    saveBtnClick(){
      this.tableData.forEach((item)=>{
        item.isAdd=false
      })
      this.isEdit = false
    },
    // 刷新
    refreshClick() {},
    // 打印
    printClick() {},
    // 列表输入回调
    inputContent(val, prop, row) {
      console.log(val, prop, row,"列表打印回调")
    },
    // 删除
    clearupProject(data, index) {
      console.log(data)
      this.tableData.splice(index, 1)
    },
    // 保存编辑按钮切换
    editSaveClick() {
      this.isEdit = !this.isEdit
    },
    // 添加列
    addColumnClick() {
      let propStr = "trends" + this.columnNum
      this.tableColumn.splice(2, 0, { label: "", prop: propStr, inputFloat: true, addColumn: true })
      this.$set(this.dataObj, propStr, 0)
      console.log(this.tableColumn)
      this.silkTableList.tableColumn = this.tableColumn
      this.columnNum += 1
    },
    // 删除列
    clearupColumn(prop) {
      let currentIndex = 0
      this.tableColumn.map((item, index) => {
        if (item.prop == prop) {
          currentIndex = index
        }
      })
      this.tableColumn.splice(currentIndex, 1)
      this.silkTableList.tableColumn = this.tableColumn
      this.$delete(this.dataObj, prop)
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.silkStandardSetting-container {
  height: 100%;
  .filter-card {
    margin: 20px 30px;
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px 0 20px;
    border-radius: 4px;
    background-color: #fff;
  }
  .body-card {
    margin: 0 30px;
    background-color: #fff;
    padding: 10px 15px;
    height: calc(100% - 180px);
    border-radius: 4px;
    .edit-save {
      display: flex;
      align-items: center;
      margin-bottom: 10px;
      .edit-save-icon {
        font-size: 24px;
        color: #5582f3;
        cursor: pointer;
      }
      .edit-sace-label {
        margin-left: 10px;
        font-size: 14px;
        color: #000000d8;
      }
    }
  }
}
</style>
src/views/systemSetting/silkPriceStandard/components/silkTableList.vue
@@ -177,14 +177,14 @@
          </el-table>
        </el-form>
      </div>
      <div
      <!-- <div
        v-if="detailEnter"
        class="add-column-box"
        @click="addColumnClick"
        :style="{ width: detailEnter ? '40px' : '0px' }"
      >
        <i class="el-icon-circle-plus"></i>
      </div>
      </div> -->
    </div>
    <div v-if="detailEnter" style="margin: 10px">
      <div class="add-btn-box" @click="addRowClick">
src/views/systemSetting/silkPriceStandard/index.vue
@@ -4,22 +4,15 @@
      <CommonSearch :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch">
        <template slot="leftButton">
          <el-button size="small" type="primary" @click="addBtnClick" >新增</el-button>
          <!-- <el-button size="small" type="primary" @click="delBtnClick" >删除</el-button> -->
          <el-button size="small" type="primary" @click="delBtnClick" >删除</el-button>
          <el-button size="small" type="primary" @click="saveBtnClick" >保存</el-button>
          |
          <!-- <el-button size="small" type="primary" @click="addBtnClick" >修改</el-button> -->
          <el-button size="small" type="primary" @click="addBtnClick" >修改</el-button>
          <el-button size="small" type="primary" @click="refreshClick">刷新</el-button>
          <el-button size="small" type="primary" @click="printClick">打印</el-button>
        </template>
      </CommonSearch>
    </div>
    <div class="body-card">
      <!-- <div class="edit-save">
        <div class="edit-save-icon" @click="editSaveClick">
          <i :class="isEdit ? 'el-icon-unlock' : 'el-icon-lock'"></i>
        </div>
        <div class="edit-sace-label">{{ isEdit ? "锁定保存" : "界面设计" }}</div>
      </div> -->
      <div>
        <SilkTableList
          :detail-enter="isEdit"
@@ -147,7 +140,11 @@
      this.tableColumn.splice(currentIndex, 1)
      this.silkTableList.tableColumn = this.tableColumn
      this.$delete(this.dataObj, prop)
    }
    },
    // 删除
    delBtnClick(){
    },
  }
}
</script>
src/views/systemSetting/workshopManage/components/addDialog.vue
New file
@@ -0,0 +1,213 @@
<template>
  <div class="add_wordshop">
    <el-dialog
      :title="editConfig.dialogTitle+'车间管理'"
      :visible.sync="editConfig.visible"
      width="30%"
      :before-close="handleClose">
      <el-form :inline="true" label-width="20%" style="width: 100%;" :model="form" >
        <el-form-item  label="车间" style="width: 100%;" >
          <el-select
            :disabled="this.editConfig.dialogTitle==='查看'" v-model="editConfig.infomitton.workshopNumber" placeholder="请选择车间">
            <el-option
              v-for="item in workshopList"
              :key="item.ID"
              :label="item.name"
              :value="item.ID">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="组别" style="width: 100%;" >
          <!-- <el-input-number
            v-model="form.workshopNumber"
            placeholder="请输入组别"
            :controls="false"
            style="width: 100%; margin-right: 5px;text-align:left;"
          ></el-input-number> -->
          <el-input
            :disabled="this.editConfig.dialogTitle==='查看'"
            v-model="editConfig.infomitton.groupNumber"
            :rows="4"
            style="resize: none !important;"
            placeholder="请输入组别"
            >
          </el-input>
        </el-form-item>
        <el-form-item label="开始车号" style="width: 100%;" >
          <el-input
            :disabled="this.editConfig.dialogTitle==='查看'"
            v-model="editConfig.infomitton.startCarNumber"
            :rows="4"
            style="resize: none !important;"
            placeholder="请输入开始车号"
            >
          </el-input>
        </el-form-item>
        <el-form-item label="结束车号" style="width: 100%;" >
          <el-input
            :disabled="this.editConfig.dialogTitle==='查看'"
            v-model="editConfig.infomitton.endCarNumber"
            :rows="4"
            style="resize: none !important;"
            placeholder="请输入结束车号"
            >
          </el-input>
        </el-form-item>
        <el-form-item label="半车标志" style="width: 100%;" >
          <el-select
            :disabled="this.editConfig.dialogTitle==='查看'" v-model="editConfig.infomitton.carFlag" placeholder="请选择半车标志">
            <el-option
              v-for="item in carFlagList"
              :key="item.id"
              :label="item.name"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注" style="width: 100%;" >
          <el-input
            :disabled="this.editConfig.dialogTitle==='查看'"
            v-model="editConfig.infomitton.notes"
            type="textarea"
            :rows="4"
            style="resize: none !important;"
            placeholder=""
            >
          </el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="editConfig.visible = false">取 消</el-button>
        <el-button type="primary" @click="commitForm">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {getDict,saveWorkshopManage} from "@/api/systemSetting/workshopManage"
export default {
  props: {
    editDiaConfig:{
      type: Object,
      default: () => {
        return {
          visible: false,
          dialogTitle:"添加",
          isReadonly:true,
          infomitton: {
            workshopNumber:null,
            groupNumber:null,
            startCarNumber:null,
            endCarNumber:null,
            carFlag:null,
            notes:null
          },
        }
      }
    }
  },
  data() {
    return {
      editConfig:this.editDiaConfig,
      form: {
        workshopNumber:null,
        groupNumber:null,
        startCarNumber:null,
        endCarNumber:null,
        carFlag:null,
        notes:null
      },
      workshopList:[],
      carFlagList:[
        {id:1,name:"左半车"},
        {id:2,name:"右半车"},
        {id:3,name:"全车结束"},
      ]
    };
  },
  computed: {
  },
  created() {
    this.getDictData()
  },
  mounted() {
  },
  watch: {
  },
  methods: {
    handleClose(done) {
      done();
    },
    async getDictData(){
      await getDict({dictType:1}).then((res)=>{
        if(res&&res.code===200){
          this.workshopList=res.data
        }
      })
    },
    setParams(){
      let params={
        workshopNumber:this.editConfig.infomitton.workshopNumber+'',
        groupNumber:Number(this.editConfig.infomitton.groupNumber),
        startCarNumber:Number(this.editConfig.infomitton.startCarNumber),
        endCarNumber:Number(this.editConfig.infomitton.endCarNumber),
        carFlag:Number(this.editConfig.infomitton.carFlag),
        notes:this.editConfig.infomitton.notes,
        // id:Number(this.editConfig.infomitton.workshopId),
      }
      return params
    },
    async commitForm(){
      let params=this.setParams()
      if(this.editConfig.dialogTitle==="新增"){
        await saveWorkshopManage(params).then((res)=>{
          if(res&&res.code===200){
            this.editConfig.visible=false
            this.$message({
              message: "保存成功!",
              type: "success",
            });
            this.$parent.getData()
          }
        })
      }else if(this.editConfig.dialogTitle==="修改"){
        this.editConfig.infomitton.workshopNumber=this.editConfig.infomitton.workshopNumber+""
        await saveWorkshopManage(this.editConfig.infomitton).then((res)=>{
          if(res&&res.code===200){
            this.editConfig.visible=false
            this.$message({
              message: "保存成功!",
              type: "success",
            });
            this.$parent.getData()
          }
        })
      }
    }
  },
  components: {
  },
};
</script>
<style scoped lang="scss">
::v-deep .el-form-item__content{
  width: 70% !important;
}
::v-deep{
  .el-form{
    .el-input__inner {
      text-align: left;
    }
  }
  .el-select{
    width: 100%;
  }
}
</style>
src/views/systemSetting/workshopManage/components/addWorkshop.vue
@@ -1,62 +1,364 @@
<template>
  <div class="add_wordshop">
    <el-dialog
      title="提示"
      :visible.sync="editConfig.visible"
      width="30%"
      :before-close="handleClose">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="editConfig.visible = false">取 消</el-button>
        <el-button type="primary" @click="editConfig.visible = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
  <el-dialog
    :close-on-click-modal="false"
    :visible.sync="editDialogVisible"
    width="33rem"
    class="add-event-dialog"
    @close="shutdown"
    append-to-body
  >
    <div slot="title" class="tac drawerHeader">添加车间</div>
    <div class="drawerContent">
      <el-table
        v-if="isTableShow"
        :header-cell-style="{ background: '#f1f3f8', color: '#000009' }"
        ref="multipleTable"
        :data="BomTableData"
        tooltip-effect="dark"
        height="440"
      >
        <el-table-column prop="unit">
          <template slot="header" slot-scope="scope">
            <span style="color: #f56c6c">*</span>
            <span>{{ scope.row }}</span>
            名称
          </template>
          <template slot-scope="scope">
            <el-input v-model="scope.row.name"></el-input>
          </template>
        </el-table-column>
        <el-table-column prop="createdAt" label="设为默认">
          <template slot-scope="scope">
            <el-switch
              @change="switchChange(scope, scope.row.isDefault)"
              v-model="scope.row.isDefault"
            ></el-switch>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <i
              class="el-icon-delete"
              id="iconStyle"
              @click="handleDelete(scope.row.id)"
            ></i>
          </template>
        </el-table-column>
      </el-table>
      <el-button
        @click="handleAdd()"
        type="text"
        class="margin_top_15px margin_left_20px"
        >新增下拉框</el-button
      >
    </div>
    <div slot="footer" class="dialog-footer tac">
      <!-- <el-button
        @click="handleAdd()"
        style="margin-left: 16px; color: #fff; background-color: #ee790c"
        >新增</el-button
      > -->
      <el-button @click="shutdown">取消</el-button
      ><el-button
        type="primary"
        @click="handleConfirmSave()"
        style="margin-left: 16px; color: #fff; background-color: #2a78fb"
        >确定</el-button
      >
    </div>
  </el-dialog>
</template>
<script>
// import { addMaterial, updateMaterial } from "@/api/ProductiveTask/inventory";
// import { getCodeStandardList } from "@/api/basic/standard";
// import { postSaveBomKindDict } from "@/api/ProductiveTask/productBom";
export default {
  name: "addWorkshop",
  props: {
    editDiaConfig:{
    title: {
      type: String,
    },
    editRow: {
      type: Object,
      default: () => {
        return {
          visible: false,
          infomitton: {
          }
        }
      }
    }
        return {};
      },
    },
    workList: {
      type: Array,
    },
  },
  data() {
    return {
      editConfig:this.editDiaConfig
      editDialogVisible: false,
      isTableShow: true,
      form: {},
      BomTableData: [1],
      work: 1,
      flag: "add",
      obj: { name: "", page: 0, pageSize: 0, type: "物料编码" },
      inputValue: [],
      codenumer: 0, //每次输入的编码
      codenumberList: [], //整条编码
      sum: 0,
      explain: "",
      Tabs: "msg",
      tableData: [
        {
          date: "PEBU",
          name: "PE布",
          number: "21",
          unit: "吨",
        },
      ],
      rules: {
        id: [{ required: true, message: "请输入物料编码", trigger: "blur" }],
        name: [{ required: true, message: "请输入物料名称", trigger: "blur" }],
        specs: [{ required: true, message: "请输入物料规格", trigger: "blur" }],
        type: [{ required: true, message: "请输入物料型号", trigger: "blur" }],
        amount: [
          {
            required: true,
            message: "请输入数量",
            trigger: "blur",
          },
        ],
        unit: [
          {
            required: true,
            message: "请输入单位",
            trigger: "blur",
          },
        ],
        model: [
          { required: true, message: "请选择物料类型", trigger: "change" },
        ],
      },
    };
  },
  computed: {
  },
  created() {
  },
  mounted() {
  },
  watch: {
    editDialogVisible(newVal) {
      if (newVal) {
        this.BomTableData = this.workList;
      }
    },
    workList(newVal) {
      console.log(newVal)
      this.BomTableData = this.workList;
    },
  },
  mounted() {},
  methods: {
    handleClose(done) {
      done();
    }
  },
  components: {
    handleAdd() {
      this.BomTableData.push({ name: "", isDefault: false });
    },
    handleDelete(id) {
      this.BomTableData = this.BomTableData.filter((i) => {
        return i.id != id;
      });
    },
    // async getCodeStandardList() {
    //   const res = await getCodeStandardList(this.obj);
    //   this.codenumer = [];
    //   this.sum = 0;
    //   this.explain = "";
    //   const { rules = [] } = res.data[0];
    //   rules.forEach((item, index) => {
    //     this.codenumer.push(item.length);
    //     this.sum++;
    //     // index - 1
    //     //   ? (this.explain += item.name + "/")
    //     //   : (this.explain += item.name);
    //     this.explain += item.name + (index === rules.length - 1 ? "" : "/");
    //   });
    //   this.$forceUpdate();
    // },
    codeList(val) {
      console.log(val, "codeList");
      this.inputValue = val;
      this.codenumberList = val.toString();
      console.log(this.codenumberList.replace(/,/g, ""));
    },
    switchChange(scope, val) {
      let arr = [];
      for (let i in this.BomTableData) {
        if (this.BomTableData[i].isDefault) {
          arr.push(i);
        }
      }
      if (arr.length > 1) {
        this.$message({
          message: "只能设一个为默认",
          type: "warning",
        });
        scope.row.isDefault = !val;
      }
    },
    handleConfirmSave() {
      let arr = [];
      for (let i in this.BomTableData) {
        if (this.BomTableData[i].isDefault) {
          arr.push(i);
        }
      }
      if (arr.length > 1) {
        this.$message({
          message: "只能设一个为默认",
          type: "warning",
        });
      } else {
        this.$emit("handleConfirmSave", this.BomTableData);
      }
    },
    // async validate() {
    //   try {
    //     if (this.flag == "add")
    //       this.form.id = this.codenumberList.replace(/,/g, "");
    //     this.form.explain = this.explain;
    //     let fn = this.flag == "set" ? updateMaterial : addMaterial;
    //     const res = await fn(this.form);
    //     this.shutdown();
    //     this.$sucessSet("sucessSet");
    //     if (res.code == 200) {
    //       this.$message({
    //         message: this.flag == "set" ? "修改成功!" : "添加成功!",
    //         type: "success",
    //       });
    //     }
    //   } catch (err) {
    //     console.log(err);
    //     this.$message({
    //       message: err.message.data.data,
    //       type: "warning",
    //     });
    //   }
    // },
    shutdown() {
      this.editDialogVisible = false;
    },
  },
};
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
.drawer {
  z-index: 99;
  border: 2px solid #ccc;
  border-radius: 20px;
  background: #fff;
  width: 25vw !important;
  height: 600px;
  #iconStyle {
    font-size: 20px !important;
  }
  .drawerContent {
    position: relative;
    overflow-y: auto;
    padding: 12px 10px 0 10px;
    padding-top: 12px;
    margin: auto;
    width: 25vw;
    overflow-x: hidden;
    height: 480px;
    scrollbar-width: none; /* firefox */
    -ms-overflow-style: none; /* IE 10+ */
    ::v-deep .el-tabs__nav-scroll {
      padding-left: 25px;
    }
    .baseTitle {
      margin: 50px 0 20px;
      font-weight: bold;
    }
    .baseInfo {
      display: flex;
    }
  }
  .drawerContent::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }
}
.drawerFooter {
  margin-top: 16px;
  margin-right: 20px;
  text-align: right;
  .el-button {
    width: 80px;
    height: 38px;
    border-color: rgba(0, 0, 0, 0.1);
    font-family: PingFangSC-Medium, sans-serif;
    color: #000;
  }
}
::v-deep .el-form {
  width: 389px;
  .input-box .input-content input {
    margin: 0;
    margin-right: 3px;
  }
  .el-input__inner,
  .el-textarea__inner {
    line-height: 18px;
    font-family: PingFangSC;
  }
}
::v-deep .el-tabs__header {
  border: none;
  .el-tabs__nav {
    border: none;
  }
}
::v-deep .el-form-item__content {
  width: 263px;
  .input-box {
    width: 263px;
  }
}
::v-deep .el-form-item__label {
  font-size: 13px !important;
  color: #000;
  font-family: PingFangSC;
  text-align: center !important;
  width: 60px;
}
::v-deep .input-box .input-content input {
  width: 23px;
  height: 26px;
  border-color: rgba(0, 0, 0, 0.1);
  font-family: PingFangSC;
}
::v-deep .el-icon-minus {
  width: 13px !important;
  height: 26px !important;
  line-height: 38px !important;
  color: #e5e5e5;
  font-size: 13px;
}
::v-deep .el-input__inner {
  font-size: 13px !important;
  color: rgba(0, 0, 0, 0.9);
}
::v-deep .el-input__inner::placeholder {
  color: rgba(0, 0, 0, 0.4);
}
::v-deep .el-form-item__error {
  font-family: PingFangSC;
}
.self {
  ::v-deep .el-input__inner {
  }
}
::v-deep .el-select-dropdown {
  position: absolute !important;
  top: 36px !important;
  left: 0px !important;
}
::v-deep .el-select-dropdown__wrap {
  overflow: auto !important;
}
::v-deep .el-dialog__body{
  padding-bottom:10px!important;
}
</style>
src/views/systemSetting/workshopManage/components/silkTableList.vue
@@ -50,6 +50,13 @@
                  </div>
                </div>
                <span v-else>{{ item.label }}</span>
                <span v-if="item.iconRight">
                  <i
                    @click="settingClick(item)"
                    :class="item.iconRight"
                    style="font-size: 16px ;color:#5582F3; margin-left: 5px; cursor: pointer"
                  ></i>
                </span>
              </template>
              <!-- column样式 -->
              <template slot-scope="scope">
@@ -73,17 +80,37 @@
                    ></el-input>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.projectName"
                    v-else-if="item.workshop"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                  >
                    <div class="custom-name">
                      <el-select v-model="scope.row[item.prop]" clearable size="mini" placeholder="请选择">
                        <el-option
                          v-for="(item, index) in projectOptions"
                          v-for="(item, index) in workshopList"
                          :key="index"
                          :label="item.value"
                          :value="item.value"
                          :label="item.name"
                          :value="item.ID"
                        >
                        </el-option>
                      </el-select>
                      <div class="common-select-btn" @click="clearupClient(scope)">
                        <i class="el-icon-remove" title="删除"></i>
                      </div>
                    </div>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.carFlag"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                  >
                    <div class="custom-name">
                      <el-select v-model="scope.row[item.prop]" clearable size="mini" placeholder="请选择">
                        <el-option
                          v-for="(item, index) in carFlagList"
                          :key="index"
                          :label="item.name"
                          :value="item.id"
                        >
                        </el-option>
                      </el-select>
@@ -123,7 +150,6 @@
                      v-model="scope.row[item.prop]"
                      placeholder=""
                      :min="0"
                      :precision="4"
                      :disabled="!isOperate"
                      :controls="false"
                      size="mini"
@@ -135,6 +161,25 @@
                      "
                    ></el-input-number>
                  </el-form-item>
                  <el-form-item
                    v-else-if="item.showInput"
                    label=" "
                    :prop="'tableData.' + scope.$index + '.' + item.prop"
                    :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]"
                  >
                    <el-input
                      v-model="scope.row[item.prop]"
                      placeholder=""
                      size="mini"
                      style="width: 100%; margin-right: 5px"
                    ></el-input>
                  </el-form-item>
                  <!-- 调用方法显示文字 -->
                  <div v-else-if="item.isCallMethod">
                    <span :class="item.isClass ? item.getClassName(scope.row[item.prop], scope.row) : ''">{{
                      item.getCallMethod(scope.row[item.prop], scope.row)
                    }}</span>
                  </div>
                  <span v-else>
                    <template>
                      {{ scope.row[item.prop] }}
@@ -161,7 +206,14 @@
                      }
                    "
                  ></el-input-number>
                </el-form-item>
                <!-- 调用方法显示文字 -->
                <div v-else-if="item.isCallMethod">
                  <span :class="item.isClass ? item.getClassName(scope.row[item.prop], scope.row) : ''">{{
                    item.getCallMethod(scope.row[item.prop], scope.row)
                  }}</span>
                </div>
                <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span>
              </template>
            </el-table-column>
@@ -177,14 +229,14 @@
          </el-table>
        </el-form>
      </div>
      <div
      <!-- <div
        v-if="detailEnter"
        class="add-column-box"
        @click="addColumnClick"
        :style="{ width: detailEnter ? '40px' : '0px' }"
      >
        <i class="el-icon-circle-plus"></i>
      </div>
      </div> -->
    </div>
    <div v-if="detailEnter" style="margin: 10px">
      <div class="add-btn-box" @click="addRowClick">
@@ -198,6 +250,7 @@
<script>
// import { getProductList } from "@/api/common/other"
import {getDict } from "@/api/systemSetting/dataDictionary"
export default {
  name: "CommmonFormTableView",
  components: {},
@@ -256,7 +309,18 @@
        { id: 3, value: "清洁分" },
        { id: 4, value: "洁净分" },
        { id: 5, value: "最大偏差" }
      ]
      ],
      workshopList:[],// 车间列表
      carFlagList:[
        {name:"左半车",id:1},
        {name:"右半车",id:2},
        {name:"全车结束",id:3},
      ],//半车标志
      getDataParams:{
        page: 1,
        pageSize:10,
        dictType:1,
      },
    }
  },
  created() {
@@ -264,6 +328,7 @@
    //   this.getProductList()
    // }
    this.getTableInfo()
    this.getWorkshopList()
  },
  watch: {
    silkTableList: {
@@ -275,6 +340,10 @@
  },
  computed: {},
  methods: {
  // 自定义表头点击事件
    settingClick(item) {
      this.$emit("settingClick", item);
    },
    getTableInfo() {
      this.tableList = this.silkTableList
      if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
@@ -322,6 +391,16 @@
    clearupColumn(prop) {
      console.log(prop)
      this.$emit("clearupColumn", prop)
    },
    async getWorkshopList(){
      await getDict({
        dictType:this.getDataParams.dictType,
        page:this.getDataParams.page,
        pageSize:this.getDataParams.pageSize,
      }).then((res)=>{
        console.log(res,"res")
        this.workshopList=res.data
      })
    }
  },
  //解决表格抖动问题
@@ -329,7 +408,7 @@
    this.$nextTick(() => {
      this.$refs["fromTable"].doLayout()
    })
  }
  },
}
</script>
src/views/systemSetting/workshopManage/index.vue
@@ -4,150 +4,217 @@
      <CommonSearch :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch">
        <template slot="leftButton">
          <el-button size="small" type="primary" @click="addBtnClick" >新增</el-button>
          <!-- <el-button size="small" type="primary" @click="delBtnClick" >删除</el-button> -->
          <el-button size="small" type="primary" @click="saveBtnClick" >保存</el-button>
          |
          <!-- <el-button size="small" type="primary" @click="addBtnClick" >修改</el-button> -->
          <el-button size="small" type="primary" @click="refreshClick">刷新</el-button>
          <el-button size="small" type="primary" @click="printClick">打印</el-button>
        </template>
      </CommonSearch>
    </div>
    <div class="body-card">
      <!-- <div class="edit-save">
        <div class="edit-save-icon" @click="editSaveClick">
          <i :class="isEdit ? 'el-icon-unlock' : 'el-icon-lock'"></i>
        </div>
        <div class="edit-sace-label">{{ isEdit ? "锁定保存" : "界面设计" }}</div>
      </div> -->
      <div>
        <SilkTableList
          :detail-enter="isEdit"
          :silk-table-list="silkTableList"
          @inputContent="inputContent"
          @addProjectClick="addBtnClick"
          @clearupProject="clearupProject"
          @deleteClick="clearupProject"
          @addColumnClick="addColumnClick"
          @clearupColumn="clearupColumn"
        <TableCommonView
          :table-list="tableList"
          @selTableCol="selTableCol"
          @handleShow="handleShow"
          @tableRowClick="tableRowClick"
        >
        </SilkTableList>
          <template slot="tableButton">
            <el-table-column label="操作" width="180">
              <template slot-scope="scope">
                <el-button @click.stop="handleClick(scope.row, '查看')" type="text" size="small">查看</el-button>
                <el-button @click.stop="handleClick(scope.row, '修改')" type="text" size="small">修改</el-button>
                <el-button @click.stop="handleClick(scope.row, '删除')" type="text" size="small">删除</el-button>
              </template>
            </el-table-column>
          </template>
        </TableCommonView>
      </div>
    </div>
    <AddWorkshop
      ref="bomTypeDialog"
      @handleConfirmSave="handleConfirmSave"
      :workList="workList"
      title="添加节点类型"
    />
    <AddDataDictionaries
      :editDiaConfig="editConfig"
    />
  </div>
</template>
<script>
import SilkTableList from "@/views/systemSetting/workshopManage/components/silkTableList"
import AddDataDictionaries from "@/views/systemSetting/workshopManage/components/addDialog.vue"
import { getWorkshopManageList,deleteWorkshopManage } from "@/api/systemSetting/workshopManage"
import TableCommonView from '@/components/makepager/TableCommonView.vue'
import AddWorkshop from '@/views/systemSetting/workshopManage/components/addWorkshop.vue'
export default {
  name: "workshopManage",
  props: {},
  components: { SilkTableList },
  components: { TableCommonView,AddWorkshop,AddDataDictionaries },
  mixins: [],
  computed: {},
  data() {
    return {
      isEdit: false,
      silkTableList: {},
      tableData: [],
      tableList: {},
      showCol: ["车间", "组别", "开始车号", "结束车号", "半车标志", "备注"],
      tableColumn: [
        { label: "车间", prop: "projectName", projectName: true },
        { label: "组别", prop: "start", inputFloat: true },
        { label: "开始车号", prop: "end", inputFloat: true },
        { label: "结束车号", prop: "price1", inputFloat: true },
        { label: "半车标志", prop: "projectName", projectName: true },
        { label: "备注", prop: "price2", inputFloat: true },
        // { label: "车间", prop: "workshopNumber",iconRight:"el-icon-setting"},
        { label: "车间", prop: "workshopNumber",},
        { label: "组别", prop: "groupNumber", },
        { label: "开始车号", prop: "startCarNumber" },
        { label: "结束车号", prop: "endCarNumber" },
        { label: "半车标志", prop: "carFlag",isCallMethod: true, getCallMethod: this.getStatusCarFlag },
        { label: "备注", prop: "notes", },
      ],
      columnNum: 0,
      dataObj: {
        projectName: "",
        start: 0,
        end: 0,
        price1: 0,
        price2: 0,
        price3: 0
      }
      // 类型
      workList: [],
      getDataParams: {
        page: 1,
        pageSize: 10,
        keyWord: '',
      },
      editConfig:{
        visible:false,
        infomitton:{
          TabsIndex:0,
          workshopId:null,
        }
      },
    }
  },
  created() {
    this.setTableForm()
    this.setTable()
    this.getData()
  },
  methods: {
    setTableForm() {
      this.silkTableList = {
        tableData: this.tableData,
        isReturn: false,
        tableColumn: this.tableColumn
    setTable() {
      console.log(this.tableColumn,"看看")
      // top 明细单列表
      this.tableList = {
        selectIndex: true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
        tableColumn: this.setColumnVisible(this.showCol, this.tableColumn)
      }
      this.setTableList(this.tableList)
    },
    setColumnVisible(showCol, tableColumn) {
      return tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn: showCol.includes(ele.label)
        }
      })
    },
    setTableList(tableList) {
      tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
      this.searchOptions = []
      for (let i = 0; i < tableList.tableColumn.length; i++) {
        const label = tableList.tableColumn[i].label
        const value = tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    selTableCol(val) {
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
    },
    // 表格行点击
    tableRowClick(row){
      console.log(row,"row")
    },
    // 搜索
    onFilterSearch(searchText) {
      console.log(searchText)
      console.log(searchText,"是啥")
      this.getDataParams.keyWord=searchText,
      this.getData()
    },
    // 新增
    addBtnClick() {
      if(this.isEdit){
        this.$message.warning("请先保存当前编辑")
      }else{
        this.isEdit = true
        // array.splice(index, 0, item)
        this.tableData.splice(0,0,{
          projectName: "",
          start: 0,
          end: 0,
          price1: 0,
          price2: 0,
          price3: 0,
          isAdd:true,
        })
      }
      this.editConfig.infomitton=[]
      this.editConfig.dialogTitle="新增"
      this.editConfig.visible=true
    },
    // 保存
    saveBtnClick(){
      this.tableData.forEach((item)=>{
        item.isAdd=false
      })
      this.isEdit = false
    },
    // 刷新
    refreshClick() {},
    // 打印
    printClick() {},
    // 列表输入回调
    inputContent(val, prop, row) {
      console.log(val, prop, row,"列表打印回调")
    },
    // 删除
    clearupProject(data, index) {
      console.log(data)
      this.tableData.splice(index, 1)
    delBtnClick(){},
    // 组别
    handleShow(item){
      console.log(item,"item")
      this.$refs.bomTypeDialog.editDialogVisible = true;
    },
    // 保存编辑按钮切换
    editSaveClick() {
      this.isEdit = !this.isEdit
    handleGetBomKindDictList() {
      // postGetBomKindDictList().then((res) => {
      //   this.workList = res.data;
      // });
    },
    // 添加列
    addColumnClick() {
      let propStr = "trends" + this.columnNum
      this.tableColumn.splice(2, 0, { label: "", prop: propStr, inputFloat: true, addColumn: true })
      this.$set(this.dataObj, propStr, 0)
      console.log(this.tableColumn)
      this.silkTableList.tableColumn = this.tableColumn
      this.columnNum += 1
    handleConfirmSave(data) {
      console.log(data,"data")
      // postSaveBomKindDict({ data: data }).then((res) => {
      //   if (res.code == 200) {
      //     this.$message({
      //       message: "操作成功!",
      //       type: "success",
      //     });
      //     this.$refs.bomTypeDialog.editDialogVisible = false;
      //     this.handleGetBomKindDictList();
      //   }
      // });
    },
    // 删除列
    clearupColumn(prop) {
      let currentIndex = 0
      this.tableColumn.map((item, index) => {
        if (item.prop == prop) {
          currentIndex = index
        }
    // 车间列表
    async getData() {
      await getWorkshopManageList({
        keyWord: this.getDataParams.keyWord,
        page: this.getDataParams.page,
        pageSize: this.getDataParams.pageSize,
      }).then((res) => {
        this.tableList.tableInfomation = res.data
      })
      this.tableColumn.splice(currentIndex, 1)
      this.silkTableList.tableColumn = this.tableColumn
      this.$delete(this.dataObj, prop)
    },
    getStatusCarFlag(val) {
      if (val) {
        return val == 1 ? '左半车' : val == 2 ? '右半车' : val == 3 ? '全车结束' : '--'
      } else {
        return "--";
      }
    },
    handleClick(row,type){
      console.log(row,"row")
      if(type==="查看"){
        this.editConfig.infomitton=row
        this.editConfig.infomitton.workshopId=row.ID
        this.editConfig.dialogTitle=type
        this.editConfig.visible=true
      }else if(type==="修改"){
        this.editConfig.infomitton=row
        this.editConfig.infomitton.workshopId=row.ID
        this.editConfig.dialogTitle=type
        this.editConfig.visible=true
      }else if(type==="删除"){
        this.$confirm(`确认删除${row.name}吗?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteWorkshopManage({id:row.ID}).then((res)=>{
            if(res&&res.code===200){
              this.getData()
              this.$message({
                type: 'success',
                message: '删除成功!'
              });
            }
          })
        })
      }
    }
  }
}
@@ -190,3 +257,4 @@
  }
}
</style>
vue.config.js
@@ -13,7 +13,7 @@
  productionSourceMap: false, // 如果你不需要生产环境的source map, 可以将其设置为false 以加速生产环境构建
  devServer: {
    proxy: {
      "/api": {
      "/api-jl": {
        // target: "http://192.168.20.118:8889", // http://192.168.20.119:8002 http://fai365.com:30150/
        // target: "http://192.168.20.120:8008", 
        // target: "http://192.168.20.120:8004",