zouyu
2023-09-13 4d8049330f1378c87115a7fcb66265f815b49801
	modified:   src/assets/api/controller.js
modified: src/components/view/standard-table/material.vue
modified: src/components/view/standard-table/product.vue
modified: src/components/view/standard-table/target.vue
modified: src/components/view/standard-table/technology.vue
modified: src/components/view/standard.vue
已修改6个文件
222 ■■■■ 文件已修改
src/assets/api/controller.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/material.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/product.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/target.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/technology.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard.vue 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -24,7 +24,11 @@
    addTechniqueByStandard:"/technique/add",//右上角新增-->生产工艺
    chooseProByProduct:"/technique/choosePro",//右上角新增-->生产工艺-->选择项目(父子),单位
    chooseDevByProduct:"/technique/chooseDev",//右上角新增-->生产工艺-->选择设备
    addVersion:"/material/addVersion",//添加同一个型号工艺路线,技术指标,物料清单,生产工艺的版本
    delAllByTechnology:"/technology/delAllTech",//工艺路线-批量删除
    delAllByTarget:"/product/delAllPro",//技术指标-批量删除
    delAllByMBom:"/mbom/delAllMbom",//物料清单-批量删除
    delAllByProduct:"/technique/delAllTeq",//生产工艺-批量删除
    // 技术管理-技术文件
    selectAllOrder: "/orders/selectAllOrder", //查询所有订单列表
    selectOrderById: "/orders/selectOrderById", //根据订单id查询订单详情
src/components/view/standard-table/material.vue
@@ -56,7 +56,9 @@
      data() {
        return {
          hasChildren:true,
          selects: []
          selects: [],
          isAllSelect:false,
          deleteList:[],
        }
      },
      props:['tableData','tableType'],
@@ -109,14 +111,33 @@
            }
          }
        },
        handleSelectionChange(val) {
          this.deleteList = [];
          val.forEach((v) => {
            if (v.id !== undefined) {
              this.deleteList.push(v.id);
        //改变选中
        toggleSelection(row, flag) {
          this.$set(row, "isChecked", flag);
          this.$nextTick(() => {
            if (flag) {
              this.$refs.multipleTable.toggleRowSelection(row, flag);
            } else {
              this.$refs.multipleTable.clearSelection();
            }
          });
        },
        handleSelectionChange(val) {
        this.deleteList = [];
        val.forEach((v) => {
          this.searchIdFun(v);
        });
        this.$emit("childData",this.deleteList);
      },
      //递归查找选中数据id
      searchIdFun(data){
        let obj = data;
        if(obj.children != undefined){
          this.searchIdFun(obj.children);
        }else{
          this.deleteList.push(obj.id);
        }
      },
        // 表格树全部选中配置  结束
      }
    }
src/components/view/standard-table/product.vue
@@ -91,6 +91,7 @@
        deviceGroupDialog:false,
        selects: [],
        isAllSelect:false,
        deleteList:[],
      }
    },
    props:['tableData','tableType'],
@@ -134,13 +135,32 @@
          }
        }
      },
      //改变选中
      toggleSelection(row, flag) {
        this.$set(row, "isChecked", flag);
        this.$nextTick(() => {
          if (flag) {
            this.$refs.multipleTable.toggleRowSelection(row, flag);
          } else {
            this.$refs.multipleTable.clearSelection();
          }
        });
      },
      handleSelectionChange(val) {
        this.deleteList = [];
        val.forEach((v) => {
          if (v.id !== undefined) {
            this.deleteList.push(v.id);
          }
          this.searchIdFun(v);
        });
        this.$emit("childData",this.deleteList);
      },
      //递归查找选中数据id
      searchIdFun(data){
        let obj = data;
        if(obj.children != undefined){
          this.searchIdFun(obj.children);
        }else{
          this.deleteList.push(obj.tqid);
        }
      },
      // 表格树全部选中配置  结束
    }
src/components/view/standard-table/target.vue
@@ -57,6 +57,8 @@
      data() {
        return {
          selects: [],
          deleteList:[],
          isAllSelect:false,
        }
      },
      props:['tableData','tableType'],
@@ -99,13 +101,32 @@
          }
        }
      },
      //改变选中
      toggleSelection(row, flag) {
        this.$set(row, "isChecked", flag);
        this.$nextTick(() => {
          if (flag) {
            this.$refs.multipleTable.toggleRowSelection(row, flag);
          } else {
            this.$refs.multipleTable.clearSelection();
          }
        });
      },
      handleSelectionChange(val) {
        this.deleteList = [];
        val.forEach((v) => {
          if (v.id !== undefined) {
            this.deleteList.push(v.id);
          }
          this.searchIdFun(v);
        });
        this.$emit("childData",this.deleteList);
      },
      //递归查找选中数据id
      searchIdFun(data){
        let obj = data;
        if(obj.children != undefined){
          this.searchIdFun(obj.children);
        }else{
          this.deleteList.push(obj.pid);
        }
      },
      // 表格树全部选中配置  结束
        updateVal(row){
@@ -118,9 +139,6 @@
          }).catch(error=>{
            this.$message.error(error.message);
          })
        },
        handleSelectionChange(val) {
          this.selects = val;
        },
      }
    }
src/components/view/standard-table/technology.vue
@@ -72,11 +72,6 @@
    methods: {
      // 表格树全部选中配置
      // 全选/取消选操作
      selectAll(val) {
        this.isAllSelect = !this.isAllSelect;
        let data = this.tableData;
        this.toggleSelect(data, this.isAllSelect, "all");
      },
      //选择某行
          selectTr(selection, row) {
        this.$set(row, "isChecked", !row.isChecked);
@@ -106,13 +101,37 @@
          }
        }
      },
      //改变选中
      toggleSelection(row, flag) {
        this.$set(row, "isChecked", flag);
        this.$nextTick(() => {
          if (flag) {
            this.$refs.multipleTable.toggleRowSelection(row, flag);
          } else {
            this.$refs.multipleTable.clearSelection();
          }
        });
      },
      selectAll(val) {
        this.isAllSelect = !this.isAllSelect;
        let data = this.tableData;
        this.toggleSelect(data, this.isAllSelect, "all");
      },
      handleSelectionChange(val) {
        this.deleteList = [];
        val.forEach((v) => {
          if (v.id !== undefined) {
            this.deleteList.push(v.id);
          }
          this.searchIdFun(v);
        });
        this.$emit("childData",this.deleteList);
      },
      //递归查找选中数据id
      searchIdFun(data){
        let obj = data;
        if(obj.children != undefined){
          this.searchIdFun(obj.children);
        }else{
          this.deleteList.push(obj.id);
        }
      },
      // 表格树全部选中配置  结束
      showDialog(){
src/components/view/standard.vue
@@ -5,9 +5,9 @@
        <el-col :span="12" style="line-height: 32px;">标准BOM</el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;"
            @click="bomAddModelVisible = true">新增</el-button>
          <el-button icon="el-icon-plus">新增版本</el-button>
          <el-button @click="bomRightDl=true" icon="el-icon-delete">删除</el-button>
            @click="showBomAddModel">新增</el-button>
          <el-button icon="el-icon-plus" @click="addVersionBtn">新增版本</el-button>
          <el-button @click="deleteDataBtn" icon="el-icon-delete">删除</el-button>
        </el-col>
      </el-row>
    </div>
@@ -56,16 +56,17 @@
        </div>
        <div class="contentTable" v-if="this.typeselect == 0">
          <technology  :tableType="tableType" :tableData="tableData"></technology>
          <technology @childData="getChildData"  :tableType="tableType" :tableData="tableData"></technology>
        </div>
        <div v-if="this.typeselect == 1">
          <target :tableType="tableType" :tableData="tableData"></target>
          <target @childData="getChildData" :tableType="tableType" :tableData="tableData"></target>
        </div>
        <div v-if="this.typeselect == 2">
          <bom  :tableType="tableType" :tableData="tableData"></bom>
          <material @childData="getChildData" :tableType="tableType" :tableData="tableData"></material>
        </div>
        <div v-if="this.typeselect == 3">生产工艺</div>
        <div v-if="this.typeselect == 3">
          <product @childData="getChildData" :tableType="tableType" :tableData="tableData"></product>
        </div>
      </div>
    </div>
@@ -332,10 +333,11 @@
<script>
import technology from "./standard-table/technology.vue"
import material from "./standard-table/material.vue"
// import bom from "./standard-table/bom.vue"
import target from "./standard-table/target.vue"
import product from "./standard-table/product.vue"
import bomClickAdd from '@/components/view/standard-box/bomClickAdd'
export default {
  components: { technology,material,bomClickAdd },
  components: { technology,material,target,product,bomClickAdd },
  data() {
    var checkPq = (rule,value,callback)=>{
@@ -352,6 +354,8 @@
      callback();
    };
    return {
      //子组件传的id列表
      childIds:[],
      //工序列表
      technologyIdList:[],
      fatherList:[],
@@ -429,7 +433,7 @@
      // BOM树数据结构
      list: [],
      search: null,
      tableType: 1, // 表格类型 1:技术指标,0:工艺路线
      tableType: 0, // 表格类型 1:技术指标,0:工艺路线
      searchName: "",// 查询条件-名称
      checkTreeNode: {},// 点击选中树节点
      tableData: [],
@@ -439,9 +443,7 @@
      bomRightDl: false,
      formTypeOptions: null,
      typeselect: 0,
      returntree: {
        id:28,
      },
      returntree: {id:28},
      version: {},
      leftAdd:{
        type: [],
@@ -574,6 +576,68 @@
    leftAddBom(){
      
    },
    //获取子组件数据
    getChildData(data){
      this.childIds = data;
    },
    //删除按钮
    deleteDataBtn(){
      let ids;
      let url;
      ids = this.childIds.filter(item=>{
        return item != undefined;
      });
      if(ids.length < 1){
        this.$message.error("请先选择数据!");
        return;
      }
      switch(this.typeselect){
        case 0:
          url = this.$api.url.delAllByTechnology;
          break;
        case 1:
          url = this.$api.url.delAllByTarget;
          break;
        case 2:
          url = this.$api.url.delAllByMBom;
          break;
        case 3:
          url = this.$api.url.delAllByProduct;
          break;
      }
      this.$confirm('确认删除已选中的数据吗', '删除', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$axios.post(url,{
            ids : ids.join(",")
          }).then(res=>{
            this.selectAll();
            this.$message.success(res.message);
          }).catch(error=>{
            this.$message.error(error.message);
          })
        }).catch(() => {});
    },
    //新增版本
    addVersionBtn(){
        this.$confirm('确认新增版本吗', '新增版本', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'info'
        }).then(() => {
          this.$axios.post(this.$api.url.addVersion,{
            specificationsId : this.returntree.id,
            version : this.version2.substring(1,2),
          }).then(res=>{
            this.selectVersion();
            this.$message.success(res.message);
          }).catch(error=>{
            this.$message.error(error.message);
          })
        }).catch(() => {});
    },
    //右侧bom,确认新增
    confirmAdd(formName){
      this.$refs[formName].validate(valid=>{