zouyu
2023-09-13 0499c5ea96c30fbd58a01b21a1c9faa79f67c273
	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个文件
362 ■■■■ 文件已修改
src/assets/api/controller.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/material.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/product.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/target.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard-table/technology.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/standard.vue 313 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -17,6 +17,13 @@
    chooseTechByStandard:"/product/chooseTech",//右上角新增-->技术指标-->选择工序,工艺
    chooseFatherByStandard:"/product/chooseFather",//右上角新增-->技术指标-->选择项目父类
    addProductByStandard:"/product/add",//右上角新增-->技术指标
    addMBomByStandard:"/mbom/add",//右上角新增-->物料清单
    chooseTechByMBom:"/mbom/chooseTech",//右上角新增-->物料清单-->选择工序,工艺
    mBomWrite:"/mbom/write",//物料清单-->数量,移开保存
    chooseTechByProduct:"/technique/chooseTech",//右上角新增-->生产工艺-->选择工序,工艺
    addTechniqueByStandard:"/technique/add",//右上角新增-->生产工艺
    chooseProByProduct:"/technique/choosePro",//右上角新增-->生产工艺-->选择项目(父子),单位
    chooseDevByProduct:"/technique/chooseDev",//右上角新增-->生产工艺-->选择设备
    // 技术管理-技术文件
    selectAllOrder: "/orders/selectAllOrder", //查询所有订单列表
src/components/view/standard-table/material.vue
@@ -40,6 +40,11 @@
              <el-table-column prop="unit" label="单位">
              </el-table-column>
              <el-table-column prop="num" label="数量">
                <template slot-scope="scope">
                  <el-input v-model="scope.row.num"
                    v-if="scope.row.mname != null"
                    @blur="updateVal(scope.row)"></el-input>
                </template>
              </el-table-column>
            </el-table>
          </div>
@@ -58,6 +63,16 @@
      created() {},
      mounted() {},
      methods: {
        updateVal(row){
          this.$axios.post(this.$api.url.mBomWrite,{
            id : row.id,
            num : row.num
          }).then(res=>{
            this.$message.success(res.message);
          }).catch(error=>{
            this.$message.error(error.message);
          })
        },
        // 表格树全部选中配置
        // 全选/取消选操作
        selectAll(val) {
@@ -146,8 +161,8 @@
    .standard .el-table__body {
      height: 100%;
    }
    .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){
    /* .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){
      padding-left: 23px !important;
     }
     } */
  </style>
  
src/components/view/standard-table/product.vue
@@ -35,9 +35,9 @@
    /* .standard .el-table__body {
      height: 100%;
    } */
    .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){
    /* .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){
      padding-left: 23px !important;
     }
     } */
</style>
<template>
    <div class="standard">
@@ -69,12 +69,18 @@
        </el-table-column>
        <el-table-column prop="productFather" label="项目">
          <template slot-scope="scope">
                <el-tag type="info" v-if="scope.row.productFather != null">03</el-tag>
                <el-tag type="info" v-if="scope.row.productFather != null">04</el-tag>
                <span>{{scope.row.productFather}}</span>
            </template>
        </el-table-column>
        <el-table-column prop="productFather" hidden></el-table-column>
        <el-table-column prop="unit" label="单位"></el-table-column>
        <el-table-column prop="product" label="指标"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button type="text" @click="updateProduct(scope.row)">编辑</el-button>
          </template>
        </el-table-column>
        </el-table>
    </div>
</template>
@@ -89,6 +95,9 @@
    },
    props:['tableData','tableType'],
    methods:{
      updateProduct(row){
        console.log(row);
      },
        // 表格树全部选中配置
      // 全选/取消选操作
      selectAll(val) {
src/components/view/standard-table/target.vue
@@ -169,8 +169,8 @@
    /* .standard .el-table__body {
      height: 100%;
    } */
    .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){
    /* .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){
      padding-left: 23px !important;
     }
     } */
  </style>
  
src/components/view/standard-table/technology.vue
@@ -189,7 +189,7 @@
  /* .standard .el-table__body {
    height: 100%;
  } */
  .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){
  /* .standard .el-table .el-table__row:not([class*="el-table__row--level-"]) td:nth-child(3){
    padding-left: 23px !important;
   }
   } */
</style>
src/components/view/standard.vue
@@ -157,45 +157,82 @@
        <!-- 物料清单 -->
        <div v-if="typeselect == 2">
          <el-form :model="materialForm" label-position="right"
          :rules="materialRules" ref="materialForm" label-width="80px">
          <el-row>
          :rules="materialRules" ref="materialForm" label-width="90px">
          <el-row :gutter="100">
            <el-col :span="12">
              <el-form-item label="规格型号:" width="250">
                <el-input style="width:200px;" v-model="materialForm.pname" placeholder="请输入单位"/>
              </el-form-item>
              <el-form-item label="工序:" prop="mfather">
                <el-select placeholder="请选择工序" @change="changeMName"
                  style="width:100%;" v-model="materialForm.mfather">
                  <el-option v-for="(item,index) in materialFormList" :key="index"
                  :label="item.name" :value="item.name" ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12" style="text-align: right;">
              <el-form-item label="产品大类:" width="250">
                <el-select placeholder="请选择产品大类"
                style="width:240px;" v-model="materialForm.dg">
                <el-option value="1">1</el-option>
                  <el-option value="2">2</el-option>
                  <el-option value="3">3</el-option>
                  <el-option value="4">4</el-option>
              <el-col :span="12">
              <el-form-item label="工艺名称:" prop="mtechnologyId">
                <el-select placeholder="请选择工艺名称" style="width:100%;"
                v-model="materialForm.mtechnologyId">
                <el-option v-for="(item,index) in mIdList" :key="index"
                :value="item.id" :label="item.name"></el-option>
                </el-select>            
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="材料信息"></el-form-item>
              <el-form-item label="材料信息" style="font-weight: bold;"></el-form-item>
            </el-col>
            <el-col :span="12" style="text-align: right;">
              <el-button size="mini" style="text-align: right;">添加行</el-button>
              <el-button size="mini" @click="addRowByMaterial">添加行</el-button>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-table >
                <el-table-column label="材料名称"></el-table-column>
                <el-table-column label="规格型号"></el-table-column>
                <el-table-column label="单位"></el-table-column>
                <el-table-column label="数量"></el-table-column>
              <el-table :data="materialForm.tableList" border max-height="470"
              style="width:100%;text-align: left;margin: 0;padding: 0;"
              :cell-style="{height:'20px',textAlign:'left'}"
              :header-cell-style="{height:'20px'}">
                <el-table-column label="供应商名称">
                  <template slot-scope="scope">
                      <el-input size="mini" v-model="scope.row.supplier"
                      placeholder="请输入"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="质量追溯号">
                  <template slot-scope="scope">
                      <el-input size="mini" v-model="scope.row.qualityTraceability"
                      placeholder="请输入"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="原材料名称">
                  <template slot-scope="scope">
                      <el-input size="mini" v-model="scope.row.name"
                      placeholder="请输入"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="规格型号">
                  <template slot-scope="scope">
                      <el-input size="mini" v-model="scope.row.specifications"
                      placeholder="请输入"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="单位">
                  <template slot-scope="scope">
                      <el-input size="mini" v-model="scope.row.unit"
                      placeholder="请输入"></el-input>
                  </template>
                </el-table-column>
                <el-table-column label="数量">
                  <template slot-scope="scope">
                      <el-input size="mini" v-model="scope.row.num"
                      placeholder="请输入"></el-input>
                  </template>
                </el-table-column>
              </el-table>
            </el-col>
          </el-row>
          </el-form>
          <div style="width:100%;text-align: right;">
          <div style="width:100%;margin-top: 20px;margin-left:75%">
            <span slot="footer" class="dialog-footer" >
              <el-button type="primary" @click="confirmAdd('materialForm')">确 定</el-button>
              <el-button @click="bomAddModelVisible = false">取 消</el-button>
@@ -205,52 +242,49 @@
        <!-- 生产工艺 -->
        <div v-if="typeselect == 3">
          <el-form :model="productForm" :inline="true" label-position="right"
          label-width="80px">
            <el-form-item label="工序:" width="250">
              <el-select v-model="productForm.father"
              style="width:200px;"
              placeholder="请输入或选择生产定额">
                <el-option value="1">1</el-option>
                <el-option value="2">2</el-option>
                <el-option value="3">3</el-option>
                <el-option value="4">4</el-option>
          :rules="productRules" ref="productForm" label-width="90px">
            <el-form-item label="工序:" prop="profather">
              <el-select v-model="productForm.profather"
              style="width:200px;" @change="changeProduct"
              placeholder="请选择工序">
                <el-option v-for="(item,index) in productFormList" :key="index"
                :value="item.name" :label="item.name"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="工艺名称:" width="250">
              <el-select placeholder="请输入或选择工艺名称"
              style="width:200px;"
              v-model="productForm.name">
              <el-option value="1">1</el-option>
                <el-option value="2">2</el-option>
                <el-option value="3">3</el-option>
                <el-option value="4">4</el-option>
            <el-form-item label="工艺名称:" prop="protechnologyId">
              <el-select placeholder="请选择工艺名称"
              style="width:200px;" @change="getProductDeviceList"
              v-model="productForm.protechnologyId">
              <el-option v-for="(item,index) in proIdList" :key="index"
                :value="item.id" :label="item.name"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="设备:" width="250">
            <el-form-item label="设备:" prop="device">
              <el-select placeholder="请选择设备"
              style="width:200px;"
              v-model="productForm.dg">
              <el-option value="1">1</el-option>
                <el-option value="2">2</el-option>
                <el-option value="3">3</el-option>
                <el-option value="4">4</el-option>
              v-model="productForm.device">
              <el-option v-for="(item,index) in productDeviceList" :key="index"
                :value="item.device" :label="item.device"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="项目:" width="250">
            <el-form-item label="项目:" prop="productFather">
              <el-select placeholder="请选择项目"
              style="width:200px;"
              v-model="productForm.dg">
              <el-option value="1">1</el-option>
                <el-option value="2">2</el-option>
                <el-option value="3">3</el-option>
                <el-option value="4">4</el-option>
              style="width:200px;" @change="changeProductFather"
              v-model="productForm.productFather">
              <el-option v-for="(item,index) in productProjectList" :key="index"
                :value="item.name" :label="item.name"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="单位:" width="250">
              <el-input style="width:200px;" v-model="productForm.unit" placeholder="请输入单位"/>
            <el-form-item label="指标:" prop="product">
              <el-select placeholder="请选择指标"
                style="width:200px;" @change="changeProProduct"
                v-model="productForm.product">
                <el-option v-for="(item,index) in proProductList" :key="index"
                :value="item.name" :label="item.name"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="指标:" width="250">
              <el-input style="width:200px;" v-model="productForm.pq" placeholder="请输入指标" />
            <el-form-item label="单位:" prop="unit">
              <el-input style="width:200px;" disabled v-model="productForm.unit"/>
            </el-form-item>
          </el-form>
          <div style="width:100%;text-align: right;">
@@ -322,14 +356,9 @@
      callback();
    };
    return {
      //技术指标-新增-工序,工艺下拉框数据
      targetFormList:[],
      technologyIdList:[],
      //技术指标-新增-项目下拉框数据
      projectList:[],
      //工序列表
      technologyIdList:[],
      fatherList:[],
      //设备组列表
      deviceList:[],
      technologyForm:{
        tefather:'',
@@ -337,6 +366,15 @@
        deviceGroup:'',
        productionQuota:''
      },
      technologyRules:{
        tefather:{required:true,message:'工序不能为空',trigger:'change'},
        tename:{required:true,message:'工艺名称不能为空',trigger:'blur'},
        deviceGroup:{required:true,message:'设备组不能为空',trigger:'change'},
        productionQuota:{validator:checkPq,trigger:'change'}
      },
      //技术指标
      targetFormList:[],
      projectList:[],
      targetForm:{
        pfather:'',
        father: '',
@@ -345,14 +383,6 @@
        unit:'',
        internal:'',
        required: ''
      },
      materialForm:{},
      productForm:{},
      technologyRules:{
        tefather:{required:true,message:'工序不能为空',trigger:'change'},
        tename:{required:true,message:'工艺名称不能为空',trigger:'blur'},
        deviceGroup:{required:true,message:'设备组不能为空',trigger:'change'},
        productionQuota:{validator:checkPq,trigger:'change'}
      },
      targetRules:{
        pfather:{required:true,message:'工序不能为空',trigger:'change'},
@@ -363,12 +393,43 @@
        internal:{validator:checkVal,trigger:'change'},
        required:{validator:checkVal,trigger:'change'}
      },
      //物料清单
      materialForm:{
        mfather: '',
        mtechnologyId:'',
        tableList:[]
      },
      materialFormList:[],
      mIdList:[],
      materialRules:{
        mfather:{required:true,message:'工序不能为空',trigger:'change'},
        mtechnologyId:{required:true,message:'工艺名称不能为空',trigger:'change'},
      },
      //生产工艺
      productForm:{
        profather:'',
        protechnologyId:'',
        productFather:'',
        product:'',
        unit:'',
        device:''
      },
      //设备列表
      productDeviceList:[],
      //工艺名称列表
      proIdList:[],
      //项目列表
      productProjectList:[],
      //指标列表
      proProductList:[],
      productRules:{
        profather:{required:true,message:'工序不能为空',trigger:'change'},
        protechnologyId:{required:true,message:'工艺名称不能为空',trigger:'change'},
        productFather:{required:true,message:'项目不能为空',trigger:'change'},
        product:{required:true,message:'指标不能为空',trigger:'change'},
        device:{required:true,message:'设备不能为空',trigger:'change'}
      },
      productFormList:[],
      // BOM树数据结构
      list: [],
      search: null,
@@ -517,6 +578,7 @@
    leftAddBom(){
    
    },
    //右侧bom,确认新增
    confirmAdd(formName){
      this.$refs[formName].validate(valid=>{
        if(valid){
@@ -533,8 +595,25 @@
              this.submitBomAdd(this.$api.url.addTechnology,obj);
          }else if(type == 1){
            this.submitBomAdd(this.$api.url.addProductByStandard,this.targetForm);
          }else if(type == 2){
            obj = {
              mbomDto2List:this.materialForm.tableList,
              technologyId:this.materialForm.mtechnologyId
            }
            this.submitBomAdd(this.$api.url.addMBomByStandard,obj);
          }else if(type == 3){
                let form = this.productForm;
                obj = {
                    device: form.device,
                    product: form.product,
                    productFather: form.productFather,
                    technologyId: form.protechnologyId,
                    unit: form.unit
                }
                this.submitBomAdd(this.$api.url.addTechniqueByStandard,obj);
          }else{
            return
          }
        }
      })
    },
@@ -578,7 +657,35 @@
        this.technologyIdList = arr[0].children;
      }
    },
    //获取工序,工艺列表
    //物料清单--添加行
    addRowByMaterial(){
      let obj = {
        "name": "",
        "num": null,
        "qualityTraceability": "",
        "specifications": "",
        "supplier": "",
        "unit": ""
      }
      this.materialForm.tableList.push(obj);
    },
    //物料清单--获取工序,工艺列表
    getMaterialFormList(){
      this.$axios.get(this.$api.url.chooseTechByMBom,{
        params:{specificationsId : this.returntree.id}
      }).then(res=>{
        this.materialFormList = res.data;
      }).catch(error=>{
        this.$message.error(error.message);
      })
    },
    changeMName(val){
      let arr = this.materialFormList.filter(item=>{
        return item.name == val;
      })
      this.mIdList = arr[0].children;
    },
    //技术指标--获取工序,工艺列表
    getTargetFormList(){
      this.$axios.get(this.$api.url.chooseTechByStandard,{
        params:{specificationsId : this.returntree.id}
@@ -588,11 +695,59 @@
        this.$message.error(error.message);
      })
    },
    //获取项目列表
    getProjectFormList(){
    //1.生产工艺-->选择工序,工艺
    getProductFormList(){
      this.$axios.get(this.$api.url.chooseTechByProduct,{
        params:{specificationsId : this.returntree.id}
      }).then(res=>{
        this.productFormList = res.data;
      }).catch(error=>{
        this.$message.error(error.message);
      })
    },
    //获取工序列表
    //2.选择工序,获取工艺名称
    changeProduct(val){
      let arr = this.productFormList.filter(item=>{
        return item.name == val
      });
      this.proIdList = arr[0].children;
    },
    //3.生产工艺-->选择设备
    getProductDeviceList(val){
      this.$axios.get(this.$api.url.chooseDevByProduct,{
        params:{technologyId : val}
      }).then(res=>{
        this.productDeviceList = res.data;
        this.getProjectFormList(val);
      }).catch(error=>{
        this.$message.error(error.message);
      })
    },
    //4.生产工艺--获取项目列表
    getProjectFormList(val){
      this.$axios.get(this.$api.url.chooseProByProduct,{
        params:{technologyId : val}
      }).then(res=>{
        this.productProjectList = res.data;
      }).catch(error=>{
        this.$message.error(error.message);
      })
    },
    //5.选择项目列表,获取指标
    changeProductFather(val){
      let arr = this.productProjectList.filter(item=>{
        return item.name == val;
      })
      this.proProductList = arr[0].children;
    },
    //选择指标列表
    changeProProduct(val){
      let arr = this.proProductList.filter(item=>{
        return item.name == val;
      })
      this.productForm.unit = arr[0].unit;
    },
    //工艺路线--获取工序列表
    getFatherList(){
      this.$axios.get(this.$api.url.chooseFather,{
        params:{specificationsId : this.returntree.id}
@@ -602,7 +757,7 @@
        this.$message.error(error.message);
      })
    },
    //获取设备组列表
    //工艺路线--获取设备组列表
    getDeviceList(){
      this.$axios.get(this.$api.url.chooseDevice).then(res=>{
        this.deviceList = res.data;
@@ -614,6 +769,8 @@
      this.getFatherList();
      this.getDeviceList();
      this.getTargetFormList();
      this.getMaterialFormList();
      this.getProductFormList();
      this.bomAddModelVisible = true
    },
    startLeftAdd(){