zouyu
2023-09-14 7c86df822b4b8d06ee89388ea75ad5f47a89373e
src/components/view/standard-table/technology.vue
@@ -10,7 +10,7 @@
            </el-table-column>
            <el-table-column type="index" width="60" label="序号" :resizable="false">
            </el-table-column>
            <el-table-column prop="father" label="工序" :resizable="false">
            <el-table-column prop="father" label="工序" width="200" :resizable="false">
              <template slot-scope="scope">
                    <el-tag class="tag" v-if="scope.row.children" type="primary">01</el-tag>
                    <span style="color: black">
@@ -18,17 +18,17 @@
                    </span>
            </template>
            </el-table-column>
            <el-table-column sortable label="工艺名称" :resizable="false">
            <el-table-column label="工艺名称" width="200" :resizable="false">
              <template slot-scope="scope">
                <el-tag class="tag" type="success" v-if="!scope.row.children">02</el-tag>
                <span style="color: black">{{ scope.row.name  }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="dg" label="设备组" :resizable="false">
            <el-table-column prop="dg" label="设备组" width="200" :resizable="false">
              <template slot-scope="scope">
                <div class="showDiv">
                  <span>{{scope.row.dg}}</span>
                  <div @click="showDialog">选择</div>
                  <div @click="showDialog(scope.row)">选择</div>
                </div>
              </template>
            </el-table-column>
@@ -46,9 +46,18 @@
          title="选择设备组"
          :visible.sync="deviceGroupDialog"
          width="30%">
          <span>这是一段信息</span>
          <el-form :model="formData">
            <el-form-item prop="deviceGroup" label="设备组:"
            :rules="{required:true,message:'设备组不能为空',trigger:'change'}">
                <el-select placeholder="请选择设备组" size="small"
                v-model="formData.deviceGroup">
                <el-option :value="item.father"
                v-for="(item,index) in deviceList" :key="index" :label="item.father"></el-option>
                </el-select>
            </el-form-item>
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="deviceGroupDialog = false">确 定</el-button>
            <el-button type="primary" @click="confirmUpdate()">确 定</el-button>
            <el-button @click="deviceGroupDialog = false">取 消</el-button>
          </span>
        </el-dialog>
@@ -60,7 +69,12 @@
    data() {
      return {
        deviceGroupDialog:false,
        formData:{
          deviceGroup:''
        },
        row:{},
        selects: [],
        deviceList:[],
        isAllSelect:false,
      }
    },
@@ -69,6 +83,32 @@
    mounted() {
    },
    methods: {
      //工艺路线--获取设备组列表
      getDeviceList(){
        this.$axios.get(this.$api.url.chooseDevice).then(res=>{
          this.deviceList = res.data;
        }).catch(error=>{
          this.$message.error(error.message);
        })
      },
      showDialog(row){
          this.getDeviceList();
          this.formData.deviceGroup = row.dg;
          this.row = row;
          this.deviceGroupDialog = true
      },
      confirmUpdate(){
        this.$axios.post(this.$api.url.writeDevice,{
          id : this.row.id,
          deviceGroup : this.formData.deviceGroup
        }).then(res=>{
          this.$emit("updateDevice",true);
          this.$message.success(res.message);
          this.deviceGroupDialog = false
        }).catch(error=>{
        })
      },
      // 表格树全部选中配置
      // 全选/取消选操作
      //选择某行
@@ -133,9 +173,6 @@
        }
      },
      // 表格树全部选中配置  结束
      showDialog(){
          this.deviceGroupDialog = true
      },
      updatePq(row){
        this.$axios.post(this.$api.url.technologyWrite,{
            id : row.id,