面板的 plc配置修改 接口方式 修改为 select
| | |
| | | <el-form-item label="配置方式" prop="isRequired"> |
| | | <el-radio-group v-model="form.isRequired"> |
| | | <!-- <el-radio :label="true">自动匹配</el-radio> --> |
| | | <el-radio :label="false">手动配置</el-radio> |
| | | <el-radio label="false">手动配置</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | > |
| | | </el-form-item> |
| | | </div> |
| | | <div style="height:100%;" v-if="active == 3"> |
| | | <div style="height: 100%" v-if="active == 3"> |
| | | <div |
| | | style=" |
| | | overflow: auto; |
| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="接口方式" prop="method" class="form-item2"> |
| | | <el-input v-model="form.method" placeholder="请输入"></el-input> |
| | | <!-- <el-input v-model="form.method" placeholder="请输入"></el-input> --> |
| | | <el-select |
| | | v-model="form.method" |
| | | placeholder="请选择" |
| | | filterable |
| | | clearable |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="modbusTCP" value="modbusTCP"></el-option> |
| | | <el-option label="serial" value="serial"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="PCL地址" |
| | | label="波特率" |
| | | prop="baudRate" |
| | | v-if="form.method == 'serial'" |
| | | class="form-item2 float_right margin_left_10px" |
| | | > |
| | | <el-input |
| | | v-model="form.baudRate" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="串口名称" |
| | | prop="serialName" |
| | | v-if="form.method == 'serial'" |
| | | class="form-item2 float_right margin_left_10px" |
| | | > |
| | | <el-input |
| | | v-model="form.serialName" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="PLC地址" |
| | | v-if="form.method == 'modbusTCP'" |
| | | prop="address" |
| | | class="form-item2 float_right margin_left_10px" |
| | | > |
| | |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="端口名称" prop="portName" class="form-item2"> |
| | | <!-- <el-form-item label="端口名称" prop="portName" class="form-item2"> |
| | | <el-select |
| | | v-model="form.portName" |
| | | placeholder="全部" |
| | |
| | | :key="item.id" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item |
| | | label="端口号" |
| | | prop="port" |
| | | class="form-item2 float_right margin_left_10px" |
| | | v-if="form.method == 'modbusTCP'" |
| | | class="form-item2 float_right" |
| | | > |
| | | <el-input |
| | | v-model.number="form.port" |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="fieldName" label="对应系统字段"> |
| | | <template slot-scope="scope"> |
| | | |
| | | <el-select |
| | | v-if="scope.row.edit" |
| | | v-model="scope.row.fieldName" |
| | | placeholder="请选择" |
| | | filterable |
| | | > |
| | | <el-option |
| | | label="完成量" |
| | | :value="1" |
| | | ></el-option> |
| | | <el-option |
| | | label="总量" |
| | | :value="2" |
| | | ></el-option> |
| | | <el-option label="完成量" :value="1"></el-option> |
| | | <el-option label="总量" :value="2"></el-option> |
| | | </el-select> |
| | | <span v-else>{{ scope.row.fieldName }}</span> |
| | | </template> |
| | |
| | | active: 1, |
| | | form: { |
| | | isRequired: false, |
| | | dns:'', |
| | | gateway:'', |
| | | id:'', |
| | | ip:'', |
| | | mask:'', |
| | | networkCard:'', |
| | | dns: "", |
| | | gateway: "", |
| | | id: "", |
| | | ip: "", |
| | | mask: "", |
| | | networkCard: "", |
| | | status:2, |
| | | |
| | | brand:'', |
| | | method:'', |
| | | portName:'', |
| | | port:'', |
| | | address:'', |
| | | |
| | | brand: "", |
| | | method: "modbusTCP", |
| | | portName: "", |
| | | port: "", |
| | | address: "", |
| | | baudRate:'', |
| | | serialName:'', |
| | | }, |
| | | |
| | | rules: { |
| | |
| | | }else{ |
| | | callback(); |
| | | } |
| | | |
| | | }, |
| | | getnetworkCardList() { |
| | | NetworkCard().then((res) => { |
| | | if (res.code == 200) { |
| | | this.networkCardList = res.data; |
| | | for(let i in this.networkCardList){ |
| | | this.networkCardList[i].status=this.networkCardList[i].status==1?true:false |
| | | this.networkCardList[i].status = |
| | | this.networkCardList[i].status == 1 ? true : false; |
| | | } |
| | | } |
| | | }); |
| | |
| | | return true; |
| | | } |
| | | this.form=JSON.parse(JSON.stringify(item)); |
| | | this.saveOne() |
| | | this.saveOne(); |
| | | }, |
| | | HomeClick() { |
| | | this.$router.push({ |
| | |
| | | buttonClick(val) { |
| | | this.active = val; |
| | | if (this.active == 1) { |
| | | this.isSetNet=false, |
| | | this.getnetworkCardList(); |
| | | (this.isSetNet = false), this.getnetworkCardList(); |
| | | } else if (this.active == 3) { |
| | | this.handleGetBomKindDictList(); |
| | | this.getPlcInfo() |
| | | this.getPlcInfo(); |
| | | } |
| | | }, |
| | | getPlcInfo(){ |
| | | getPlc().then(res=>{ |
| | | getPlc().then((res) => { |
| | | if(res.code==200){ |
| | | this.form=JSON.parse(JSON.stringify(res.data)); |
| | | this.pclList=res.data.details?JSON.parse(JSON.stringify(res.data.details)):[]; |
| | | this.pclList = res.data.details |
| | | ? JSON.parse(JSON.stringify(res.data.details)) |
| | | : []; |
| | | } |
| | | }) |
| | | }); |
| | | }, |
| | | // PLC配置设置 |
| | | handleShow() { |
| | |
| | | getMiniDictList().then((res) => { |
| | | this.plcBrandList = res.data.data; |
| | | this.plcBrandList=[ |
| | | |
| | | { |
| | | id:1, |
| | | name:'三菱', |
| | | name: "三菱", |
| | | }, |
| | | { |
| | | id:2, |
| | | name:'欧姆龙', |
| | | name: "欧姆龙", |
| | | }, |
| | | { |
| | | id:3, |
| | | name:'西门子', |
| | | name: "西门子", |
| | | }, |
| | | { |
| | | id:4, |
| | | name:'台达', |
| | | name: "台达", |
| | | }, |
| | | { |
| | | id:5, |
| | | name:'和利时', |
| | | name: "和利时", |
| | | }, |
| | | { |
| | | id:6, |
| | | name:'信捷', |
| | | name: "信捷", |
| | | }, |
| | | { |
| | | id:7, |
| | | name:'南大傲拓', |
| | | name: "南大傲拓", |
| | | }, |
| | | { |
| | | id:8, |
| | | name:'汇川', |
| | | name: "汇川", |
| | | }, |
| | | { |
| | | id:9, |
| | | name:'永宏', |
| | | name: "永宏", |
| | | }, |
| | | { |
| | | id:10, |
| | | name:'罗克韦尔', |
| | | name: "罗克韦尔", |
| | | }, |
| | | { |
| | | id:11, |
| | | name:'施耐德', |
| | | name: "施耐德", |
| | | }, |
| | | { |
| | | id:12, |
| | | name:'丰炜', |
| | | name: "丰炜", |
| | | }, |
| | | { |
| | | id:13, |
| | | name:'黄石科威', |
| | | name: "黄石科威", |
| | | }, |
| | | { |
| | | id:14, |
| | | name:'霍尼韦尔', |
| | | name: "霍尼韦尔", |
| | | }, |
| | | { |
| | | id:15, |
| | | name:'艾默生', |
| | | name: "艾默生", |
| | | }, |
| | | { |
| | | id:16, |
| | | name:'英威腾', |
| | | name: "英威腾", |
| | | }, |
| | | { |
| | | id:17, |
| | | name:'基恩士', |
| | | name: "基恩士", |
| | | }, |
| | | { |
| | | id:18, |
| | | name:'中控', |
| | | name: "中控", |
| | | }, |
| | | { |
| | | id:19, |
| | | name:'倍福', |
| | | name: "倍福", |
| | | }, |
| | | { |
| | | id:20, |
| | | name:'贝加莱', |
| | | } |
| | | ] |
| | | name: "贝加莱", |
| | | }, |
| | | ]; |
| | | if (val) { |
| | | for (let i in this.plcBrandList) { |
| | | if (this.plcBrandList[i].isDefault) { |
| | |
| | | }, |
| | | saveOne() { |
| | | let params = JSON.parse(JSON.stringify(this.form)); |
| | | params.status=params.status==1?1:2 |
| | | params.status = params.status == 1 ? 1 : 2; |
| | | setworkCard(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("网络配置成功!"); |
| | | this.getnetworkCardList() |
| | | this.getnetworkCardList(); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | if (this.active == 1) { |
| | | this.saveOne(); |
| | | }else if(this.active == 3){ |
| | | this.saveThree() |
| | | this.saveThree(); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | saveThree() { |
| | | let params = JSON.parse(JSON.stringify(this.form)); |
| | | params.details=this.pclList |
| | | params.details = this.pclList; |
| | | setPlc(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("PLC配置成功!"); |
| | | this.getPlcInfo() |
| | | this.getPlcInfo(); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | margin-top: 100px; |
| | | } |
| | | .form-box { |
| | | background: #12234A; |
| | | background: #12234a; |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow-y: hidden; |