| | |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="text-align: left"> |
| | | <el-radio-group v-model="radio" size="medium" fill="#409EFF"> |
| | | <el-radio-group v-model="radio" size="medium" fill="#409EFF" @change="refreshTable"> |
| | | <el-radio-button :label="0">检验项目参数</el-radio-button> |
| | | <el-radio-button :label="1">检验对象</el-radio-button> |
| | | </el-radio-group> |
| | |
| | | <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- 检验项目参数表格--> |
| | | <div class="table" v-if="radio===0"> |
| | | <lims-table :tableData="tableData" :column="column" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <!-- 检验对象表格--> |
| | | <div class="table" v-if="radio===1"> |
| | | <lims-table :tableData="testObjectTableData" :column="testObjectColumn" |
| | | :page="testObjectPage" :tableLoading="tableLoading"></lims-table> |
| | |
| | | </span> |
| | | </el-dialog> |
| | | <!--产品维护编辑--> |
| | | <el-dialog title="编辑产品维护" :visible.sync="productEditDia" width="400px"> |
| | | <el-form :model="productEditForm" ref="productEditForm" :rules="productRules"> |
| | | <el-dialog title="操作产品维护" :visible.sync="productEditDia" width="400px"> |
| | | <el-form :model="productEditForm" ref="productEditForm" :rules="productRules" label-position="right" label-width="100px"> |
| | | <el-form-item label="产品名称" prop="name"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="productEditForm.name"></el-input> |
| | | </el-form-item> |
| | |
| | | </span> |
| | | </el-dialog> |
| | | <!--检验项目参数-编辑弹框--> |
| | | <EditForm ref="editForm" @refreshTable="refreshTable"></EditForm> |
| | | <testObjectEditForm ref="testObjectEditForm"></testObjectEditForm> |
| | | <EditForm ref="editForm" @refreshList="refreshList1"></EditForm> |
| | | <testObjectEditForm ref="testObjectEditForm" @refreshList="refreshList"></testObjectEditForm> |
| | | <BindPartDialog v-if="bindPartDialog" :bindPartDialog="bindPartDialog" |
| | | :currentRow="currentRow" |
| | | :type="type" |
| | |
| | | import BindPartDialog from "@/components/capability/bindPartDialog.vue" |
| | | import BindSupplierDensityDialog from "@/components/capability/bindSupplierDensityDialog.vue" |
| | | import { |
| | | addProduct, |
| | | delItemParameter, delProduct, delTestObject, selectItemParameterList, selectProductListByObjectId, |
| | | selectTestObjectList, |
| | | selectTestObjectList, upProduct, |
| | | } from "@/api/structural/capability"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import EditForm from "@/components/capability/EditForm.vue"; |
| | |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | | label: '操作', |
| | | width: '140px', |
| | | operation: [ |
| | | { |
| | | name: '编辑', |
| | | type: 'text', |
| | | icon: 'el-icon-edit', |
| | | clickFun: (row) => { |
| | | this.editForm(row); |
| | | }, |
| | |
| | | { |
| | | name: '删除', |
| | | type: 'text', |
| | | icon: 'el-icon-delete', |
| | | clickFun: (row) => { |
| | | this.delete(row); |
| | | }, |
| | |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | | label: '操作', |
| | | width: '240px', |
| | | operation: [ |
| | | { |
| | | name: '编辑', |
| | | type: 'text', |
| | | icon: 'el-icon-edit', |
| | | clickFun: (row) => { |
| | | this.editTestObjectForm(row); |
| | | }, |
| | |
| | | { |
| | | name: '删除', |
| | | type: 'text', |
| | | icon: 'el-icon-delete', |
| | | clickFun: (row) => { |
| | | this.deleteTest(row); |
| | | }, |
| | |
| | | { |
| | | name: '编辑', |
| | | type: 'text', |
| | | icon: 'el-icon-edit', |
| | | clickFun: (row) => { |
| | | this.editProduct('edit', row); |
| | | }, |
| | |
| | | { |
| | | name: '删除', |
| | | type: 'text', |
| | | icon: 'el-icon-delete', |
| | | clickFun: (row) => { |
| | | this.deleteProduct(row); |
| | | }, |
| | |
| | | }, |
| | | productableLoading: false, |
| | | productEditDia: false, |
| | | operationType: '', |
| | | productEditForm: { |
| | | objectId: '', |
| | | id: '', |
| | | name: '', |
| | | nameEn: '' |
| | | }, |
| | | objectId: '', |
| | | productRules: { |
| | | name: [{ required: true, message: '请填写产品名称', trigger: 'blur' }], |
| | | nameEn: [{ required: true, message: '请填写产品名称EN', trigger: 'blur' }] |
| | |
| | | type: null, // 零件绑定的类型--0:检验对象,1:产品维护 |
| | | } |
| | | }, |
| | | mounted() { |
| | | created() { |
| | | this.refreshTable() |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | methods: { |
| | | submitUpload() { |
| | | if (this.$refs.upload.uploadFiles.length == 0) { |
| | | if (this.$refs.upload.uploadFiles.length === 0) { |
| | | this.$message.error('未选择文件') |
| | | return |
| | | } |
| | |
| | | this.$refs.upload.clearFiles() |
| | | this.uploadDia = false |
| | | this.uploading = false |
| | | if (response.code == 201) { |
| | | if (response.code === 201) { |
| | | this.$message.error(response.message) |
| | | return |
| | | } |
| | |
| | | }, |
| | | handleSuccessUp (response, file, fileList) { |
| | | this.$refs.upload.clearFiles() |
| | | if (response.code == 201) { |
| | | if (response.code === 201) { |
| | | this.$message.error(response.message) |
| | | return |
| | | } |
| | | this.$message.success('上传成功') |
| | | this.refreshTable() |
| | | }, |
| | | refreshList () { |
| | | this.refreshTable() |
| | | }, |
| | | refreshList1 () { |
| | | this.refreshTable() |
| | | }, |
| | | refreshTable() { |
| | |
| | | }, |
| | | // 检验项目参数-删除 |
| | | delete (row) { |
| | | this.$modal.confirm('是否确认删除此数据项?').then(function() { |
| | | return delItemParameter(row.id); |
| | | this.$confirm('此操作将删除该数据, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | delItemParameter({id:row.id}).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('删除成功') |
| | | this.refreshTable(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }) |
| | | }, |
| | | // 检验对象-打开修改弹框 |
| | | editTestObjectForm (row) { |
| | |
| | | }, |
| | | // 检验项目参数-删除 |
| | | deleteTest (row) { |
| | | this.$modal.confirm('是否确认删除此数据项?').then(function() { |
| | | return delTestObject(row.id); |
| | | this.$confirm('此操作将删除该数据, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | delTestObject({id:row.id}).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('删除成功') |
| | | this.refreshTable(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }) |
| | | }, |
| | | // 产品维护 |
| | | upProduct(row) { |
| | | this.diaProduct = true |
| | | this.objectId = row.id |
| | | this.getProductList(row) |
| | | }, |
| | | getProductList (row) { |
| | |
| | | // 产品维护-新增-编辑 |
| | | editProduct (type, row) { |
| | | this.productEditDia = true |
| | | this.operationType = type |
| | | if (type === 'edit') { |
| | | this.productEditForm = row |
| | | } |
| | |
| | | submitProduct () { |
| | | this.$refs['productEditForm'].validate((valid) => { |
| | | if (valid) { |
| | | |
| | | this.productEditForm.objectId = this.objectId |
| | | if (this.operationType === 'add') { |
| | | addProduct(this.productEditForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('新增成功') |
| | | this.productEditDia = false |
| | | this.refreshTable(); |
| | | } |
| | | }) |
| | | } else { |
| | | upProduct(this.productEditForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('新增成功') |
| | | this.productEditDia = false |
| | | this.refreshTable(); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | // 产品维护-删除 |
| | | deleteProduct (row) { |
| | | this.$modal.confirm('是否确认删除此数据项?').then(function() { |
| | | return delProduct(row.id); |
| | | this.$confirm('此操作将删除该数据, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | delProduct({id:row.id}).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('删除成功') |
| | | this.refreshTable(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }) |
| | | }, |
| | | // 零件绑定 |
| | | bindPartFirst (row) { |