| | |
| | | return request({ |
| | | url: '/structureTestObjectPart/addTestObjectPart', |
| | | method: 'post', |
| | | params: query |
| | | data: query |
| | | }) |
| | | } |
| | | // 检验对象修改产品零件 |
| | |
| | | return request({ |
| | | url: '/structureTestObjectPart/updateTestObjectPart', |
| | | method: 'post', |
| | | params: query |
| | | data: query |
| | | }) |
| | | } |
| | | // 检验对象删除产品零件 |
| | |
| | | // 根据产品id查询零件 |
| | | export function selectByProductId(query) { |
| | | return request({ |
| | | url: 'ctPart/selectByProductId', |
| | | url: '/productPart/selectByProductId', |
| | | method: 'post', |
| | | params: query |
| | | }) |
| | | } |
| | | // 新增产品零件 |
| | | export function addProductPart(query) { |
| | | return request({ |
| | | url: '/productPart/addProductPart', |
| | | method: 'post', |
| | | data: query |
| | | }) |
| | | } |
| | | // 修改产品零件 |
| | | export function updateProductPart(query) { |
| | | return request({ |
| | | url: '/productPart/updateProductPart', |
| | | method: 'post', |
| | | data: query |
| | | }) |
| | | } |
| | | // 删除产品零件 |
| | | export function deleteProductPart(query) { |
| | | return request({ |
| | | url: '/productPart/deleteProductPart', |
| | | method: 'post', |
| | | data: query |
| | | }) |
| | | } |
| | |
| | | <template v-for="(o, key) in item.operation"> |
| | | <el-button |
| | | v-if="o.type!='upload'" |
| | | size="mini" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :icon="o.icon | iconFn(scope.row)" |
| | | :plain="o.plain" :size="o.size" |
| | | :style="{ 'color': o.color }" |
| | | :icon="o.icon | iconFn(scope.row, o)" |
| | | :plain="o.plain" |
| | | :style="{ 'color': o.name === '删除' ? '#f56c6c' : o.color }" |
| | | :type="o.type | typeFn(scope.row)" |
| | | @click="o.clickFun(scope.row)"> |
| | | {{ o.name }} |
| | | </el-button> |
| | | <el-upload |
| | | action="#" |
| | | size="mini" |
| | | :on-change="(file, fileList)=>o.clickFun(scope.row,file, fileList)" |
| | | :multiple="o.multiple?o.multiple:false" |
| | | :limit="o.limit?o.limit:1" |
| | |
| | | let obj = this.HaveJson(this.editForm) |
| | | obj.method = JSON.stringify(obj.method) |
| | | obj.sample = JSON.stringify(obj.sample) |
| | | if (obj.radiusList !== null && obj.radiusList.length > 0) { |
| | | obj.radiusList = JSON.stringify(obj.radiusList) |
| | | } |
| | | obj.radiusList = JSON.stringify(obj.radiusList) |
| | | if(obj.id){ |
| | | // 修改 |
| | | upItemParameter(obj).then(res => { |
| | |
| | | } |
| | | this.$message.success('修改成功') |
| | | this.editFormDia = false |
| | | this.$emit('refreshTable') |
| | | this.$emit('refreshList') |
| | | }).catch(e => { |
| | | this.editLoad = false |
| | | }) |
| | |
| | | } |
| | | this.$message.success('添加成功') |
| | | this.editFormDia = false |
| | | this.$emit('refreshTable') |
| | | this.$emit('refreshList') |
| | | }).catch(e => { |
| | | this.editLoad = false |
| | | }) |
| | |
| | | // 关闭弹框 |
| | | closeDia () { |
| | | this.editFormDia = false |
| | | this.$refs.editForm.resetFields() |
| | | this.resetForm("editForm"); |
| | | }, |
| | | selectTestObjectByName() { |
| | | getItemTree().then(res => { |
| | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="$emit('closeBindPartDialog')">取 消</el-button> |
| | | <el-button type="primary" @click="addBindPart" :loading="addBindLoad">新 增</el-button> |
| | | <el-button type="primary" @click="addBindPart('add')" :loading="addBindLoad">新 增</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :title="dialogTitle" :visible.sync="addBindPartDialog" width="400px" @close="closeBindPartDialog" |
| | |
| | | <el-form-item label="零件号:" prop="partNo"> |
| | | <el-input v-model="bindPartData.partNo" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="颜色:"> |
| | | <el-form-item label="颜色:" prop="color"> |
| | | <el-input v-model="bindPartData.color" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="色标:"> |
| | | <el-form-item label="色标:" prop="colorCode"> |
| | | <el-input v-model="bindPartData.colorCode" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {selectByProductId, selectByTestObjectId} from "@/api/structural/structureTestObjectPart"; |
| | | import { |
| | | addProductPart, |
| | | addTestObjectPart, deleteProductPart, deleteTestObjectPart, |
| | | selectByProductId, |
| | | selectByTestObjectId, updateProductPart, updateTestObjectPart |
| | | } from "@/api/structural/structureTestObjectPart"; |
| | | import {delProduct} from "@/api/structural/capability"; |
| | | |
| | | export default { |
| | | name: "bindPartDialog", |
| | |
| | | return { |
| | | isShow: this.bindPartDialog, |
| | | dialogTitle: '新增零件绑定', |
| | | operationType: '', |
| | | tableData: [], |
| | | tableLoading: false, |
| | | column: [ |
| | |
| | | name: '编辑', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.editForm(row); |
| | | this.addBindPart('edit', row); |
| | | }, |
| | | }, |
| | | { |
| | |
| | | this.tableLoading = true |
| | | // 根据类型判断是检验对象零件绑定还是产品维护零件绑定 |
| | | if (this.type === 0) { |
| | | selectByTestObjectId(this.currentRow.id).then(res => { |
| | | selectByTestObjectId({id: this.currentRow.id}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200) { |
| | | this.tableData = res.data |
| | | this.page.total = res.total |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | }) |
| | | } else { |
| | | selectByProductId(this.currentRow.id).then(res => { |
| | | selectByProductId({id: this.currentRow.id}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200) { |
| | | this.tableData = res.data |
| | | this.page.total = res.total |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | }) |
| | | } |
| | | }, |
| | | addBindPart () { |
| | | addBindPart (type, row) { |
| | | this.addBindPartDialog = true |
| | | this.dialogTitle = type === 'add' ? '新增零件绑定' : '修改零件绑定' |
| | | this.operationType = type |
| | | if (type === 'edit') { |
| | | this.bindPartData = row |
| | | } |
| | | }, |
| | | // 提交零件绑定 |
| | | submitBind () { |
| | |
| | | partNo: this.bindPartData.partNo, |
| | | } |
| | | this.bindLoad = true |
| | | if (this.type === 0) { |
| | | |
| | | if (this.operationType === 'add') { |
| | | if (this.type === 0) { |
| | | addTestObjectPart(params).then(res => { |
| | | if (res.code === 200) { |
| | | this.resetForm('bindPartData') |
| | | this.addBindPartDialog = false |
| | | this.$message.success('新增成功') |
| | | this.getList() |
| | | } |
| | | }).catch(err => { |
| | | this.bindLoad = false |
| | | console.log(err) |
| | | }) |
| | | } else { |
| | | addProductPart(params).then(res => { |
| | | if (res.code === 200) { |
| | | this.resetForm('bindPartData') |
| | | this.addBindPartDialog = false |
| | | this.$message.success('新增成功') |
| | | this.getList() |
| | | } |
| | | }).catch(err => { |
| | | this.bindLoad = false |
| | | console.log(err) |
| | | }) |
| | | } |
| | | } else { |
| | | if (this.type === 0) { |
| | | updateTestObjectPart(params).then(res => { |
| | | if (res.code === 200) { |
| | | this.resetForm('bindPartData') |
| | | this.addBindPartDialog = false |
| | | this.$message.success('修改成功') |
| | | this.getList() |
| | | } |
| | | }).catch(err => { |
| | | this.bindLoad = false |
| | | console.log(err) |
| | | }) |
| | | } else { |
| | | updateProductPart(params).then(res => { |
| | | if (res.code === 200) { |
| | | this.resetForm('bindPartData') |
| | | this.addBindPartDialog = false |
| | | this.$message.success('修改成功') |
| | | this.getList() |
| | | } |
| | | }).catch(err => { |
| | | this.bindLoad = false |
| | | console.log(err) |
| | | }) |
| | | } |
| | | } |
| | | this.$axios.post(url, params, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | this.bindLoad = false |
| | | if (res.code === 200) { |
| | | this.$refs['bindPartData'].resetFields(); |
| | | this.addBindPartDialog = false |
| | | this.$message.success('操作成功') |
| | | this.getList() |
| | | } |
| | | }).catch(err => { |
| | | this.bindLoad = false |
| | | console.log(err) |
| | | }) |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | | } |
| | | }) |
| | | }, |
| | | delete (row) { |
| | | this.$confirm('此操作将删除该数据, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | if (this.type === 0) { |
| | | deleteTestObjectPart({id:row.id}).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('删除成功') |
| | | this.getList(); |
| | | } |
| | | }) |
| | | } else { |
| | | deleteProductPart({id:row.id}).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('删除成功') |
| | | this.getList(); |
| | | } |
| | | }) |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }) |
| | | }, |
| | | closeBindPartDialog () { |
| | | this.$refs['bindPartData'].resetFields(); |
| | | this.resetForm('bindPartData') |
| | | this.addBindPartDialog = false |
| | | }, |
| | | }, |
| | |
| | | <el-form ref="editForm" :model="editForm" :rules="editFormRules" label-width="120px" label-position="right"> |
| | | <el-form-item label="场所:" prop="laboratoryId"> |
| | | <el-select v-model="editForm.laboratoryId" clearable placeholder="请选择" size="small" style="width: 100%"> |
| | | <el-option v-for="item in laboratoryList" :key="item.label" :label="item.label" :value="item.label"></el-option> |
| | | <el-option v-for="item in laboratoryList" :key="item.value" :label="item.label" :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="检验对象:" prop="specimenName"> |
| | |
| | | editFormDia: false, |
| | | editLoad: false, |
| | | editForm: { |
| | | id: '', |
| | | laboratoryId: '', // 场所 |
| | | specimenName: '', // 检验对象 |
| | | specimenNameEn: '', // 检验对象EN |
| | |
| | | this.obtainItemParameterList() |
| | | this.editFormDia = true |
| | | if (type === 'add') { |
| | | this.$refs.editForm.resetFields() |
| | | this.resetForm("editForm"); |
| | | } else { |
| | | this.editForm = this.HaveJson(row) |
| | | this.editForm = {...row} |
| | | } |
| | | }, |
| | | // 提交编辑 |
| | |
| | | this.$refs.editForm.validate(valid => { |
| | | if (valid) { |
| | | this.editLoad = true |
| | | let obj = this.HaveJson(this.editForm) |
| | | if(obj.id){ |
| | | if(this.editForm.id){ |
| | | // 修改 |
| | | upTestObject(obj).then(res => { |
| | | upTestObject(this.editForm).then(res => { |
| | | this.editLoad = false |
| | | if (res.code === 201) { |
| | | if (res.code === 500) { |
| | | return |
| | | } |
| | | this.$message.success('修改成功') |
| | | this.closeDia() |
| | | this.$emit('refreshList') |
| | | }).catch(e => { |
| | | this.editLoad = false |
| | | this.editFormDia = false |
| | | }) |
| | | }else{ |
| | | // 新增 |
| | | addTestObject(obj).then(res => { |
| | | addTestObject(this.editForm).then(res => { |
| | | this.editLoad = false |
| | | if (res.code === 201) { |
| | | if (res.code === 500) { |
| | | return |
| | | } |
| | | this.$message.success('添加成功') |
| | | this.closeDia() |
| | | this.$emit('refreshList') |
| | | }).catch(e => { |
| | | this.editLoad = false |
| | | this.editFormDia = false |
| | | }) |
| | | } |
| | | } |
| | |
| | | // 关闭弹框 |
| | | closeDia () { |
| | | this.editFormDia = false |
| | | this.$refs.editForm.resetFields() |
| | | this.$parent.refreshTable('page') |
| | | this.resetForm("editForm"); |
| | | }, |
| | | // 获取场所下拉框的值 |
| | | obtainItemParameterList() { |
| | |
| | | <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) { |