春风项目四线(合箱线、总装线)
jiang
2024-01-29 ebf004b96bf6066f0bb78cec13ad638ca9c35b2a
jcdm-ui/src/views/main/da/collectionParamConf/index.vue
@@ -160,14 +160,14 @@
          <el-table-column label="备注" align="center" width="160" prop="remarks">
          </el-table-column>
          <el-table-column label="创建用户" align="center" prop="createUser">
          </el-table-column>
          <el-table-column label="创建时间" align="center" width="160" prop="createTime">
          </el-table-column>
          <el-table-column label="更改用户" align="center" prop="updateUser">
          </el-table-column>
          <el-table-column label="更改时间" align="center" width="160" prop="updateTime">
          </el-table-column>
<!--          <el-table-column label="创建用户" align="center" prop="createUser">-->
<!--          </el-table-column>-->
<!--          <el-table-column label="创建时间" align="center" width="160" prop="createTime">-->
<!--          </el-table-column>-->
<!--          <el-table-column label="更改用户" align="center" prop="updateUser">-->
<!--          </el-table-column>-->
<!--          <el-table-column label="更改时间" align="center" width="160" prop="updateTime">-->
<!--          </el-table-column>-->
          <el-table-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
@@ -202,14 +202,21 @@
    />
    <!-- 添加或修改采集参数配置对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="700px" append-to-body>
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="800px" append-to-body>
      <span slot="title">
        <i class="el-icon-s-order"></i>
        {{titleName}}
      </span>
      <el-form ref="form" inline :model="form" :rules="rules" label-width="120px">
        <el-form-item label="工序编号" prop="processesCode">
          <el-input v-model="form.processesCode" placeholder="请输入工序编号" />
          <el-select style="width: 100%" @change="handleSelectChangeprocessesCode(form.processesCode)" v-model="form.processesCode" placeholder="请选择工序编号">
            <el-option
              v-for="item in options"
              :key="item.processesCode"
              :label="item.processesCode"
              :value="item.processesCode">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="参数集编码" prop="parameterSetCode">
          <el-input v-model="form.parameterSetCode" placeholder="请输入参数集编码" />
@@ -223,9 +230,18 @@
        <el-form-item label="采集参数名称" prop="collectParameterName">
          <el-input v-model="form.collectParameterName" placeholder="请输入采集参数名称" />
        </el-form-item>
        <el-form-item label="是否作为对比参数" prop="contrastParameterFlag">
          <el-input v-model="form.contrastParameterFlag" placeholder="请输入是否作为对比参数" />
        <el-form-item label="是否作为对比参数"  prop="contrastParameterFlag" label-width="120">
<!--          <el-select v-model="form.contrastParameterFlag" placeholder="请选择是否作为对比参数">-->
<!--            <el-option-->
<!--              v-for="dict in dict.type.sys_yes_no"-->
<!--              :key="dict.value"-->
<!--              :label="dict.label"-->
<!--              :value="dict.value"-->
<!--            ></el-option>-->
<!--          </el-select>-->
        </el-form-item>
<!--        <el-form-item label="采集参数类型" prop="collectParameterType">-->
<!--          <el-select v-model="form.collectParameterType" placeholder="请选择采集参数类型">-->
<!--            <el-option-->
@@ -274,11 +290,13 @@
<script>
import { listCollectionParamConf, getCollectionParamConf, delCollectionParamConf, addCollectionParamConf, updateCollectionParamConf } from "@/api/main/da/collectionParamConf/collectionParamConf";
import {listProcesses} from "@/api/main/bs/processes/processes";
export default {
  name: "CollectionParamConf",
  data() {
    return {
      options: [],
      // 遮罩层
      loading: true,
      titleName: "",
@@ -311,6 +329,22 @@
        collectParameterType: null,
        productCode: null,
      },
      processesCodeQueryParams:{
        pageNum: 1,
        pageSize: 10,
        processesCode: null,
        processesName: null,
        processesType: null,
        ipAddress: null,
        spareField1: null,
        spareField2: null,
        spareField3: null,
        spareField4: null,
        createUser: null,
        updateUser: null,
        remarks: null
      },
      // 表单参数
      form: {},
      // 表单校验
@@ -318,13 +352,51 @@
        id: [
          { required: true, message: "主键id不能为空", trigger: "blur" }
        ],
        processesCode: [
          { required: true, message: "工序编号不能为空", trigger: "blur" }
        ],
        parameterSetCode: [
          { required: true, message: "参数集编码不能为空", trigger: "blur" }
        ],
        parameterSetName: [
          { required: true, message: "参数集名称不能为空", trigger: "blur" }
        ],
        collectParameterId: [
          { required: true, message: "采集参数ID不能为空", trigger: "blur" }
        ],
        collectParameterName: [
          { required: true, message: "采集参数名称不能为空", trigger: "blur" }
        ],
        collectParameterUnit: [
          { required: true, message: "采集参数单位不能为空", trigger: "blur" }
        ],
        gatherAddress: [
          { required: true, message: "采集地址不能为空", trigger: "blur" }
        ],
        gatherSequence: [
          { required: true, message: "采集顺序不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
    this.initProcesses()
  },
  methods: {
    handleSelectChangeprocessesCode(selectedOption) {
      this.processesCodeQueryParams.processesCode = selectedOption;
      listProcesses(this.processesCodeQueryParams).then(response => {
        this.form.collectParameterName = response.rows[0].collectParameterName;
      });
    },
    initProcesses(){
      listProcesses(this.queryParams).then(response => {
        this.options = response.rows;
      });
    },
    /** 查询采集参数配置列表 */
    getList() {
      this.loading = true;