| | |
| | | <pane size="12"> |
| | | <el-col> |
| | | <div class="head-container addButton"> |
| | | <el-input v-model="search" clearable placeholder="输入关键字进行搜索" size="small" style="margin-bottom: 5px" |
| | | <el-input v-model="search" clearable placeholder="输入关键字进行搜索" size="small" |
| | | style="margin-bottom: 5px; flex: 1; min-width: 0" |
| | | suffix-icon="el-icon-search" @keydown.enter.native="searchFilter" @blur="searchFilter" @clear="searchFilter"></el-input> |
| | | <el-button circle icon="el-icon-plus" size="mini" type="primary" @click="openAddDia"></el-button> |
| | | <el-button icon="el-icon-refresh" size="small" title="刷新" |
| | | style="margin-bottom: 5px; margin-left: 8px" |
| | | @click="selectStandardTreeList"></el-button> |
| | | </div> |
| | | <div class="head-container"> |
| | | <el-tree ref="tree" v-loading="treeLoad" :data="list" |
| | | :default-expanded-keys="expandedKeys" :filter-node-method="filterNode" |
| | | :props="{ children: 'children', label: 'label' }" highlight-current node-key="label" |
| | | :props="{ children: 'children', label: 'label' }" highlight-current node-key="id" |
| | | style=" |
| | | height: calc(100vh - 173px); |
| | | overflow-y: scroll; |
| | |
| | | {{ data.label }} |
| | | </span> |
| | | </el-col> |
| | | <el-col v-if=" |
| | | checkPermi(['standard:standardLibrary:delStandardTree']) && |
| | | isLeaf(node.data) |
| | | " :span="2" style="text-align: right"> |
| | | <el-button size="mini" type="text" @click.stop="editTreeName(node)"> |
| | | <i class="el-icon-edit"></i> |
| | | </el-button> |
| | | </el-col> |
| | | <el-col v-if=" |
| | | checkPermi(['standard:standardLibrary:delStandardTree']) && |
| | | isLeaf(node.data) |
| | | " :span="2" style="text-align: right"> |
| | | <el-button size="mini" type="text" @click.stop="remove(node, data)"> |
| | | <i class="el-icon-delete"></i> |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-tree> |
| | |
| | | </pane> |
| | | <!--用户数据--> |
| | | <pane size="88"> |
| | | <el-card v-if="selected.isLeaf" shadow="never" class="template-binding-card"> |
| | | <div slot="header"><span>原始记录模板</span><el-button v-if="checkPermi(['standard:standardLibrary:upStandardProduct'])" type="primary" size="mini" style="float:right" @click="saveBindings">保存绑定</el-button></div> |
| | | <p v-if="!templateBindings.length" class="binding-tip">请为当前标准绑定原始记录模板。</p> |
| | | <el-table :data="templateBindings" border size="small"> |
| | | <el-table-column type="index" label="顺序" width="70" /><el-table-column label="模板编号" prop="number" width="180" /><el-table-column label="模板名称" prop="name" /><el-table-column label="检测依据(模板备注)" prop="remark" /> |
| | | <el-table-column v-if="checkPermi(['standard:standardLibrary:upStandardProduct'])" label="操作" width="150"><template slot-scope="scope"><el-button type="text" :disabled="scope.$index === 0" @click="moveBinding(scope.$index, -1)">上移</el-button><el-button type="text" :disabled="scope.$index === templateBindings.length - 1" @click="moveBinding(scope.$index, 1)">下移</el-button><el-button type="text" @click="removeBinding(scope.$index)">移除</el-button></template></el-table-column> |
| | | </el-table> |
| | | <el-select v-if="checkPermi(['standard:standardLibrary:upStandardProduct'])" v-model="templateToBind" filterable placeholder="选择原始记录模板" size="small" style="width:320px;margin-top:16px" @change="addBinding"><el-option v-for="template in templateList.filter(item => !templateBindings.some(binding => binding.templateId === item.id))" :key="template.id" :label="template.number ? template.number + ' - ' + template.name : template.name" :value="template.id" /></el-select> |
| | | </el-card> |
| | | <el-empty v-else description="请选择二级标准,维护其原始记录模板" /> |
| | | <div v-if="false"> |
| | | <div class="search_form"> |
| | | <div style="height:37px"> |
| | | <p style="font-size: 14px; color: #999;margin-left: 10px">{{ selectTree }}</p> |
| | |
| | | <p style="text-align: right;margin-right: 20px;color: #333;">共{{ total }}条</p> |
| | | </el-row> |
| | | </el-col> |
| | | </div> |
| | | </pane> |
| | | </splitpanes> |
| | | </el-row> |
| | |
| | | selectStandardProductListByMethodId, |
| | | updateSection, |
| | | getStandardTemplate, |
| | | selectTemplateBindings, |
| | | saveTemplateBindings, |
| | | } from "@/api/standard/standardLibrary"; |
| | | import bindSupplierDensityDialogAsk from "./components/bindSupplierDensityDialogAsk.vue"; |
| | | import BatchCopy from "./components/BatchCopy.vue"; |
| | |
| | | sectionRow: null, |
| | | sectionList: [], |
| | | templateList: [], |
| | | templateBindings: [], |
| | | templateToBind: null, |
| | | total: 0, |
| | | currentPage: 1, |
| | | standardId: 0, |
| | |
| | | this.currentPage = 1; |
| | | this.selectTree = buildSelectTree(node, "null"); |
| | | this.selected = { |
| | | id: val.id, |
| | | label: val.label, |
| | | tree: this.selectTree, |
| | | isLeaf: leaf, |
| | |
| | | this.standardList = []; |
| | | this.productList = []; |
| | | if (leaf) { |
| | | this.selectsStandardMethodByFLSSM(); |
| | | this.loadTemplateBindings(val.id); |
| | | } else { |
| | | this.standardId = 0; |
| | | this.syncSortable(); |
| | | this.templateBindings = []; |
| | | } |
| | | }, |
| | | remove(node, data) { |
| | |
| | | selectStandardTreeList() { |
| | | this.treeLoad = true; |
| | | selectStandardTreeList().then((res) => { |
| | | this.list = res.data; |
| | | this.list = (res.data || []).map(industry => ({ |
| | | ...industry, |
| | | children: (industry.children || []).map(standard => ({ |
| | | ...standard, |
| | | // 二级节点只展示标准编号;兼容尚未重启的旧后端返回格式。 |
| | | label: standard.standardCode || String(standard.label || '').split(' - ')[0], |
| | | })), |
| | | })); |
| | | this.expandedKeys = []; |
| | | this.list.forEach((a) => { |
| | | this.expandedKeys.push(a.label); |
| | |
| | | this.templateList = res.data; |
| | | }); |
| | | }, |
| | | loadTemplateBindings(standardTreeId) { |
| | | selectTemplateBindings({ standardTreeId }).then((res) => { |
| | | this.templateBindings = res.data || []; |
| | | this.templateToBind = null; |
| | | }); |
| | | }, |
| | | addBinding(templateId) { |
| | | const template = this.templateList.find((item) => item.id === templateId); |
| | | if (template && !this.templateBindings.some((item) => item.templateId === templateId)) { |
| | | this.templateBindings.push({ ...template, templateId, sort: this.templateBindings.length }); |
| | | } |
| | | this.templateToBind = null; |
| | | }, |
| | | removeBinding(index) { |
| | | this.templateBindings.splice(index, 1); |
| | | }, |
| | | moveBinding(index, offset) { |
| | | const target = index + offset; |
| | | const item = this.templateBindings.splice(index, 1)[0]; |
| | | this.templateBindings.splice(target, 0, item); |
| | | }, |
| | | saveBindings() { |
| | | saveTemplateBindings({ standardTreeId: this.selected.id, |
| | | templates: this.templateBindings.map((item, index) => ({ templateId: item.templateId, sort: index })) |
| | | }).then(() => { |
| | | this.$message.success("模板绑定已保存"); |
| | | this.loadTemplateBindings(this.selected.id); |
| | | }); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.currentPage = val; |
| | | this.tableLoad2 = true; |