懒羊羊
2024-01-09 24a64475ee9582f0f09f899b7800a4f7101eaa30
jcdm-ui/src/views/main/em/equipmentArchives/index.vue
@@ -18,6 +18,16 @@
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="状态" prop="status">
            <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
              <el-option
                v-for="dict in dict.type.sys_normal_disable"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item style="float: right">
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -76,6 +86,12 @@
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="设备编码" align="center" prop="equipmentCode"/>
          <el-table-column label="设备名称" align="center" prop="equipmentName"/>
          <el-table-column label="状态" align="center" prop="status" width="80">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
            </template>
          </el-table-column>
          <el-table-column label="工序编号" align="center" prop="processesCode"/>
          <el-table-column label="品牌" align="center" prop="equipmentBrand"/>
          <el-table-column label="规格型号" align="center" prop="equipmentSpec"/>
          <el-table-column label="车间编码" align="center" prop="workshopCode"/>
@@ -128,6 +144,25 @@
        <el-form-item label="设备名称" prop="equipmentName">
          <el-input v-model="form.equipmentName" placeholder="请输入设备名称" />
        </el-form-item>
        <el-form-item label="状态" prop="status">
          <el-radio-group v-model="form.status">
            <el-radio
              v-for="dict in dict.type.sys_normal_disable"
              :key="dict.value"
              :label="dict.value"
            >{{dict.label}}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="工序编号" prop="processesCode">
          <el-select style="width: 100%" @change="handleSelectChangeprocessesCode(form.processesCode)" v-model="form.processesCode" placeholder="请选择工序编号">
            <el-option
              v-for="item in processesCodeoptions"
              :key="item.index"
              :label="item.processesCode"
              :value="item.processesCode">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="品牌" prop="equipmentBrand">
          <el-input v-model="form.equipmentBrand" placeholder="请输入品牌" />
        </el-form-item>
@@ -157,19 +192,6 @@
            </el-option>
          </el-select>
        </el-form-item>
<!--        <el-form-item label="产线编码" prop="lineCode">-->
<!--          <el-input v-model="form.lineCode" placeholder="请输入产线编码" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="产线编码" prop="lineCode">-->
<!--          <el-select style="width: 100%" @change="handleSelectChangelineCode(form.processesCode)" v-model="form.lineCode" placeholder="请输入产线编码">-->
<!--            <el-option-->
<!--              v-for="item in options"-->
<!--              :key="item.lineCode"-->
<!--              :label="item.lineCode"-->
<!--              :value="item.lineCode">-->
<!--            </el-option>-->
<!--          </el-select>-->
<!--        </el-form-item>-->
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
@@ -188,9 +210,11 @@
import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo";
import ItemSelect  from "@/components/itemSelect/single.vue";
import {listProductionOrde} from "@/api/main/om/productionOrde/productionOrde";
import {listProcesses} from "@/api/main/bs/processes/processes";
export default {
  name: "EquipmentArchives",
  dicts: ['sys_normal_disable'],
  components: {
    ItemSelect ,
  },
@@ -198,6 +222,7 @@
    return {
      // 遮罩层
      lineOptions: [],
      processesCodeoptions:[],
      options: [],
      loading: true,
      titleName: "",
@@ -230,7 +255,7 @@
        equipmentTypeName: null,
        workshopCode: null,
        lineCode: null,
        processes: null,
        processesCode: null,
        status: null,
        createUser: null,
        updateUser: null,
@@ -238,6 +263,11 @@
        spareField2: null,
        spareField3: null,
        spareField4: null
      },
      processesCodeQueryParams:{
        pageNum: 1,
        pageSize: 10,
        processesCodes: null,
      },
      // 表单参数
      form: {},
@@ -261,24 +291,39 @@
  created() {
    this.getList();
    this.initWorkshop();
    this.initProcesses();
  },
  methods: {
    /** 查询设备档案列表 */
    initWorkshop(){
      listWorkshop(this.queryParams).then(response => {
      listWorkshop().then(response => {
        this.options = response.rows;
      });
    },
    // 在这里编写处理选中事件的逻辑
    handleSelectChange(selectedOption) {
      this.form.lineCode = null;
      this.queryParams.workshopCode = selectedOption;
      listLineInfo(this.queryParams).then(response => {
      let param = {
        workshopCode : selectedOption
      }
      listLineInfo(param).then(response => {
        this.lineOptions = response.rows;
      });
    },
    handleSelectChangeprocessesCode(selectedOption) {
      this.processesCodeQueryParams.processesCodes = selectedOption;
      listProcesses(this.queryParams).then(response => {
        this.form.processesName = response.rows[0].processesName;
      });
    },
    initProcesses(){
      listProcesses(this.queryParams).then(response => {
        this.processesCodeoptions = response.rows;
      });
    },
    getList() {
      console.log(this.queryParams)
      this.loading = true;
      listEquipmentArchives(this.queryParams).then(response => {
        this.equipmentArchivesList = response.rows;
@@ -304,8 +349,8 @@
        equipmentTypeName: null,
        workshopCode: null,
        lineCode: null,
        processes: null,
        status: null,
        processesCode: null,
        status: "0",
        remark: null,
        createUser: null,
        createTime: null,