| | |
| | | <el-button size="mini" type="text" @click="showChangeMaterial(data)">编辑</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button size="mini" type="text">删除</el-button> |
| | | <el-button size="mini" type="text" @click="delmaterialFormVisible=true">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <el-button |
| | |
| | | <el-button size="mini" type="text" @click="showChangeProject(data)">编辑</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button size="mini" type="text">删除</el-button> |
| | | <el-button size="mini" type="text" @click="delProductFormVisible = true">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <el-button |
| | |
| | | <span /> |
| | | <div>测试标准</div> |
| | | </div> |
| | | <!-- <div class="tips-btn"> |
| | | <span><i class="el-icon-edit" />操作:</span> |
| | | <el-button type="text">编辑</el-button> |
| | | </div> --> |
| | | </div> |
| | | <div class="message"> |
| | | <div class="message-item"> |
| | | <el-tag type="primary"><i class="el-icon-info" :style="{marginRight:'4px', color:'#409EFF'}"/>单位:欧姆</el-tag> |
| | | <el-tag type="primary"><i class="el-icon-info" :style="{marginRight:'4px', color:'#409EFF'}" />单位:欧姆</el-tag> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span><i class="el-icon-edit" />招标人员要求:{{ detailInfo.required }}</span> |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 添加以及修改的模态框 --> |
| | | <el-dialog title="添加物料" :visible.sync="materialFormVisible"> |
| | | <el-dialog title="添加物料" :visible.sync="materialFormVisible" width="35%"> |
| | | <el-form :model="addMaterialForm"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | |
| | | <el-button @click="dialogFormVisible = false">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog title="添加子项目" :visible.sync="projectFormVisible"> |
| | | <el-dialog title="添加子项目" :visible.sync="projectFormVisible" width="35%"> |
| | | <el-form :model="addProjectForm"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | |
| | | <el-button @click="projectFormVisible = false">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog title="修改物料" :visible.sync="changeMaterialFormVisible"> |
| | | <el-dialog title="修改物料" :visible.sync="changeMaterialFormVisible" width="35%"> |
| | | <el-form :model="changeMaterialForm"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | |
| | | <el-button @click="changeMaterialFormVisible = false">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog title="修改子项目" :visible.sync="changeProjectFormVisible"> |
| | | <el-dialog title="修改子项目" :visible.sync="changeProjectFormVisible" width="35%"> |
| | | <el-form :model="changeProjectForm"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | |
| | | <el-button @click="projectFormVisible = false">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="提示" |
| | | :visible.sync="delmaterialFormVisible" |
| | | width="30%" |
| | | > |
| | | <span>确认删除该物料吗?</span> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="deleteMaterial">确 定</el-button> |
| | | <el-button @click="delmaterialFormVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="提示" |
| | | :visible.sync="delProductFormVisible" |
| | | width="30%" |
| | | > |
| | | <span>确认删除该子项目吗?</span> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="deleleProduct">确 定</el-button> |
| | | <el-button @click="delProductFormVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getMaterialList, getProductList, getProductProductId, addMaterial, addProduct, getMaterialDetail, updateMaterial, updateProduct } from '@/api/standardLibrary' |
| | | import { getMaterialList, getProductList, getProductProductId, addMaterial, addProduct, getMaterialDetail, updateMaterial, updateProduct, deleteMaterial, deleteProduct } from '@/api/standardLibrary' |
| | | export default { |
| | | name: 'SpecificationDetail', |
| | | data() { |
| | |
| | | materialTreeDefault: [], |
| | | projectTreeDefault: [], |
| | | materialFormVisible: false, |
| | | delmaterialFormVisible: false, |
| | | changeMaterialFormVisible: false, |
| | | projectFormVisible: false, |
| | | changeProjectFormVisible: false, |
| | | delProductFormVisible: false, |
| | | addMaterialForm: {}, |
| | | changeMaterialForm: {}, |
| | | addProjectForm: {}, |
| | | changeProjectForm: {}, |
| | | fatherOpetions: [] |
| | | fatherOpetions: [], |
| | | materialId: '', |
| | | productId: '' |
| | | } |
| | | }, |
| | | // 为了选中第一层级下的第一个节点 |
| | |
| | | }, |
| | | // 获取项目tree |
| | | async getProjectTreeData(data) { |
| | | // |
| | | const { data: projectArr } = await getProductList({ materialId: data.id }) |
| | | // console.log(projectArr) |
| | | projectArr.map((item, index) => { |
| | |
| | | materialTreeClick(data, node, element) { |
| | | // 点击物料节点,查询对应的项目tree数据 |
| | | console.log(data) |
| | | // 得到物料Id |
| | | this.materialId = data.id |
| | | this.getProjectTreeData(data) |
| | | }, |
| | | // 项目库的节点点击 |
| | |
| | | // 先判断点击的是父节点还是子节点 |
| | | if (('children' in data)) return |
| | | console.log('子项目节点', data) |
| | | this.productId = data.id |
| | | // |
| | | const { data: detailInfo } = await getProductProductId({ productId: data.id }) |
| | | // console.log('详情信息', detailInfo) |
| | |
| | | this.changeProjectForm.name = data.name |
| | | // console.log('修改后', this.changeMaterialForm) |
| | | this.changeProjectFormVisible = true |
| | | }, |
| | | async deleteMaterial() { |
| | | await deleteMaterial({ materialId: this.materialId }) |
| | | this.delmaterialFormVisible = false |
| | | }, |
| | | async deleleProduct() { |
| | | // console.log('productId', this.productId) |
| | | await deleteProduct({ productId: this.productId }) |
| | | this.delProductFormVisible = false |
| | | } |
| | | } |
| | | } |