| | |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> |
| | | <el-table-column type="selection" width="55"> |
| | | </el-table-column> |
| | | <el-table-column type="index" width="60" label="序号"> |
| | | <el-table-column type="index" width="60" label="序号" :resizable="false"> |
| | | </el-table-column> |
| | | <el-table-column prop="father" label="工序" sortable width="200px"> |
| | | <el-table-column prop="father" label="工序" :resizable="false"> |
| | | <template slot-scope="scope"> |
| | | <el-tag v-if="scope.row.children" type="primary">01</el-tag> |
| | | <el-tag class="tag" v-if="scope.row.children" type="primary">01</el-tag> |
| | | <span style="color: black"> |
| | | {{ scope.row.father }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column sortable label="工艺名称"> |
| | | <el-table-column sortable label="工艺名称" :resizable="false"> |
| | | <template slot-scope="scope"> |
| | | <el-tag type="success" v-if="!scope.row.children">02</el-tag> |
| | | <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="设备组"> |
| | | <el-table-column prop="dg" label="设备组" :resizable="false"> |
| | | <template slot-scope="scope"> |
| | | <div class="showDiv"> |
| | | <span>{{scope.row.dg}}</span> |
| | |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="pq" label="生产定额(个/天)"> |
| | | <el-table-column prop="pq" label="生产定额(个/天)" :resizable="false"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.pq" |
| | | v-if="scope.row.dg != null" |
| | | v-if="scope.row.dg != null" size="small" |
| | | @blur="updatePq(scope.row)" |
| | | ></el-input> |
| | | </template> |
| | |
| | | methods: { |
| | | // 表格树全部选中配置 |
| | | // 全选/取消选操作 |
| | | selectAll(val) { |
| | | this.isAllSelect = !this.isAllSelect; |
| | | let data = this.tableData; |
| | | this.toggleSelect(data, this.isAllSelect, "all"); |
| | | }, |
| | | //选择某行 |
| | | selectTr(selection, row) { |
| | | this.$set(row, "isChecked", !row.isChecked); |
| | |
| | | } |
| | | } |
| | | }, |
| | | //改变选中 |
| | | toggleSelection(row, flag) { |
| | | this.$set(row, "isChecked", flag); |
| | | this.$nextTick(() => { |
| | | if (flag) { |
| | | this.$refs.multipleTable.toggleRowSelection(row, flag); |
| | | } else { |
| | | this.$refs.multipleTable.clearSelection(); |
| | | } |
| | | }); |
| | | }, |
| | | selectAll(val) { |
| | | this.isAllSelect = !this.isAllSelect; |
| | | let data = this.tableData; |
| | | this.toggleSelect(data, this.isAllSelect, "all"); |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.deleteList = []; |
| | | val.forEach((v) => { |
| | | if (v.id !== undefined) { |
| | | this.deleteList.push(v.id); |
| | | } |
| | | this.searchIdFun(v); |
| | | }); |
| | | this.$emit("childData",this.deleteList); |
| | | }, |
| | | //递归查找选中数据id |
| | | searchIdFun(data){ |
| | | let obj = data; |
| | | if(obj.children != undefined){ |
| | | this.searchIdFun(obj.children); |
| | | }else{ |
| | | this.deleteList.push(obj.id); |
| | | } |
| | | }, |
| | | // 表格树全部选中配置 结束 |
| | | showDialog(){ |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | .tag{ |
| | | line-height:24px; |
| | | text-align:center; |
| | | width:36px; |
| | | height:24px; |
| | | |
| | | border-radius:12px; |
| | | } |
| | | .tag:nth-child(1){ |
| | | margin-left:20px; |
| | | } |
| | | .standard .showDiv{ |
| | | cursor: pointer; |
| | | } |