| | |
| | | <div class="main_div"> |
| | | <div class="top_div"> |
| | | <span>样品名称:</span> |
| | | <el-select |
| | | v-model="params.material" |
| | | size="small" |
| | | placeholder="请选择样品名称" |
| | | > |
| | | <el-option |
| | | v-for="item in productModelSelectmater" |
| | | :value="item" |
| | | :key="item.index" |
| | | :label="item" |
| | | ></el-option> |
| | | <el-select v-model="params.material" size="small" placeholder="请选择样品名称"> |
| | | <el-option v-for="item in productModelSelectmater" :value="item" :key="item.index" :label="item"></el-option> |
| | | </el-select> |
| | | <span class="top_div_span">项目分组:</span> |
| | | <el-input |
| | | v-model="params.father" |
| | | placeholder="请输入项目分组" |
| | | style="width: 10%" |
| | | size="small " |
| | | ></el-input> |
| | | <el-input v-model="params.father" placeholder="请输入项目分组" style="width: 10%" size="small "></el-input> |
| | | <span class="top_div_span">项目名称:</span> |
| | | <el-input |
| | | v-model="params.name" |
| | | placeholder="请输入项目名称" |
| | | style="width: 10%" |
| | | size="small " |
| | | ></el-input> |
| | | <el-button |
| | | type="primary" |
| | | class="top_div_button" |
| | | size="small" |
| | | @click="selectProductModelTable" |
| | | >查询</el-button |
| | | > |
| | | <el-button class="top_div_button" size="small" @click="params = {}" |
| | | >重置</el-button |
| | | > |
| | | <el-input v-model="params.name" placeholder="请输入项目名称" style="width: 10%" size="small "></el-input> |
| | | <el-button type="primary" class="top_div_button" size="small" @click="selectProductModelTable">查询</el-button> |
| | | <el-button class="top_div_button" size="small" @click="params = {}">重置</el-button> |
| | | <div style="float: right"> |
| | | <el-button |
| | | class="top_div_button" |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-folder-add" |
| | | @click="centerDialogVisible = true" |
| | | >新增</el-button |
| | | > |
| | | <el-dialog |
| | | :visible.sync="centerDialogVisible" |
| | | width="30%" |
| | | right |
| | | :before-close="handleClose" |
| | | :title="isUpdate ? '更新' : '新增'" |
| | | > |
| | | <el-button class="top_div_button" type="primary" size="small" icon="el-icon-folder-add" |
| | | @click="centerDialogVisible = true">新增</el-button> |
| | | <el-dialog :visible.sync="centerDialogVisible" width="30%" right :before-close="handleClose" |
| | | :title="isUpdate ? '更新' : '新增'" :hide-required-asterisk="false"> |
| | | <el-form :model="form" :rules="rules" ref="ruleForm" class="addForm"> |
| | | <el-form-item prop="material" required> |
| | | <span>样品名称:</span> |
| | | <el-select |
| | | v-model="form.material" |
| | | style="width: 85%" |
| | | placeholder="请选择样品名称" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) in productModelSelectmater" |
| | | :key="index" |
| | | :value="item" |
| | | :label="item" |
| | | ></el-option> |
| | | </el-select> |
| | | <el-autocomplete class="inline-input" v-model="form.material" :fetch-suggestions="querySearch" |
| | | placeholder="请输入样品名称"></el-autocomplete> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <span>项目分组:</span> |
| | | <el-select |
| | | v-model="form.father" |
| | | style="width: 85%" |
| | | placeholder="请选择项目分组" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) in projectGroupingOptions" |
| | | :key="index" |
| | | :value="item" |
| | | :label="item" |
| | | ></el-option> |
| | | </el-select> |
| | | <el-input v-model="form.father" style="width: 85%" placeholder="请输入样品分组"></el-input> |
| | | </el-form-item> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12" |
| | | ><el-form-item prop="name" required |
| | | ><span>项目名称:</span> |
| | | <el-input |
| | | style="width: 70%" |
| | | v-model="form.name" |
| | | placeholder="请输入项目名称" |
| | | ></el-input></el-form-item |
| | | ></el-col> |
| | | <el-col :span="12"><el-form-item prop="name" required><span>项目名称:</span> |
| | | <el-input style="width: 70%" v-model="form.name" |
| | | placeholder="请输入项目名称"></el-input></el-form-item></el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="unit"> |
| | | <span |
| | | v-html="'单 位:'" |
| | | ></span> |
| | | <el-input |
| | | style="width: 70%" |
| | | v-model="form.unit" |
| | | placeholder="请输入单位" |
| | | ></el-input></el-form-item |
| | | ></el-col> |
| | | <span v-html="'单 位:'"></span> |
| | | <el-input style="width: 70%" v-model="form.unit" |
| | | placeholder="请输入单位"></el-input></el-form-item></el-col> |
| | | </el-row> |
| | | </el-form> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="centerDialogVisible = false" size="small " |
| | | >取 消</el-button |
| | | > |
| | | <el-button @click="centerDialogVisible = false" size="small ">取 消</el-button> |
| | | <el-button type="primary" @click="submitAdd" size="small ">{{ |
| | | isUpdate ? "更 新" : "保 存" |
| | | }}</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-button |
| | | class="top_div_button" |
| | | icon="el-icon-delete-solid" |
| | | size="small" |
| | | style="color: #00a5ff" |
| | | @click="deleteListClick" |
| | | >删除</el-button |
| | | > |
| | | <el-button class="top_div_button" icon="el-icon-delete-solid" size="small" style="color: #00a5ff" |
| | | @click="deleteListClick">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_div"> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%; margin-bottom: 20px" |
| | | row-key="id" |
| | | border |
| | | height="calc(100vh - 250px)" |
| | | default-expand-all |
| | | ref="multipleTable" |
| | | @select="selectTr" |
| | | @select-all="selectAll" |
| | | @selection-change="handleSelectionChange" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | > |
| | | <el-table :data="tableData" style="width: 100%; margin-bottom: 20px" row-key="id" border |
| | | height="calc(100vh - 250px)" default-expand-all ref="multipleTable" @select="selectTr" @select-all="selectAll" |
| | | @selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> |
| | | <el-table-column type="selection" label="序号"> </el-table-column> |
| | | <el-table-column |
| | | type="index" |
| | | width="50px" |
| | | label="序号" |
| | | ></el-table-column> |
| | | <el-table-column type="index" width="50px" label="序号"></el-table-column> |
| | | <el-table-column label="项目名称" sortable> |
| | | <template scope="scope"> |
| | | <el-tag |
| | | ><div |
| | | class="firstDiv" |
| | | :style="`color: ${ |
| | | <el-tag> |
| | | <div class="firstDiv" :style="`color: ${ |
| | | scope.row.code == '[1]' ? '#16a7ff' : '#58c173' |
| | | }`" |
| | | > |
| | | }`"> |
| | | {{ scope.row.code == "[1]" ? "01" : "02" }} |
| | | </div> |
| | | <span style="color: black">{{ scope.row.name }}</span></el-tag |
| | | > |
| | | <span style="color: black">{{ scope.row.name }}</span> |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unit" label="单位" sortable></el-table-column> |
| | | <el-table-column label="操作"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.code == '[2]' || scope.row.edit == true"> |
| | | <el-button type="text" size="mini" @click="childrenClick(scope)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | type="text" |
| | | size="mini" |
| | | @click="deleteTreeChildren(scope)" |
| | | >删除</el-button |
| | | > |
| | | <el-button type="text" size="mini" @click="childrenClick(scope)">编辑</el-button> |
| | | <el-button type="text" size="mini" @click="deleteTreeChildren(scope)">删除</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | name: "", |
| | | }, |
| | | rules: { |
| | | material: [ |
| | | { required: true, message: "请选择样品名称", trigger: "change" }, |
| | | ], |
| | | name: [ |
| | | { required: true, message: "请输入项目名称", trigger: "blur" }, |
| | | material: [{ |
| | | required: true, |
| | | message: "请输入样品名称", |
| | | trigger: "blur" |
| | | }], |
| | | name: [{ |
| | | required: true, |
| | | message: "请输入项目名称", |
| | | trigger: "blur" |
| | | }, |
| | | { |
| | | min: 2, |
| | | max: 25, |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | unit: [ |
| | | { required: true, message: "请输入单位", trigger: "blur" }, |
| | | unit: [{ |
| | | required: true, |
| | | message: "请输入单位", |
| | | trigger: "blur" |
| | | }, |
| | | { |
| | | min: 1, |
| | | max: 25, |
| | |
| | | this.selectProductModelTable(); |
| | | }); |
| | | }, |
| | | querySearch(queryString, cb) { |
| | | var restaurants = this.restaurants; |
| | | var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; |
| | | // 调用 callback 返回建议列表的数据 |
| | | cb(results); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.selectProductMaster().then((res) => { |
| | |
| | | border-color: transparent; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .el-tag.el-tag:hover { |
| | | border-color: transparent; |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .firstDiv { |
| | | float: left; |
| | | width: 20px; |
| | |
| | | align-items: center; |
| | | margin-right: 8px; |
| | | } |
| | | |
| | | .main_div { |
| | | width: 100%; |
| | | position: relative; |
| | | padding: 0 10px 10px 10px; |
| | | } |
| | | |
| | | .el-dialog__close { |
| | | padding: 8px 0; |
| | | color: #ffffff !important; |
| | | } |
| | | |
| | | .addForm { |
| | | padding: 20px 20px 0 20px; |
| | | } |
| | | |
| | | .addForm .el-form-item__error { |
| | | left: 66px; |
| | | } |
| | | |
| | | .el-dialog { |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | .el-dialog__body { |
| | | padding: 30px 20px 0 20px; |
| | | } |
| | | |
| | | .table_div { |
| | | margin-top: 10px; |
| | | width: 100%; |
| | |
| | | padding: 30px 40px; |
| | | background-color: #ffffff; |
| | | } |
| | | |
| | | .top_div_span { |
| | | margin-left: 50px; |
| | | } |
| | | |
| | | .top_div_button { |
| | | margin-left: 20px; |
| | | } |