| | |
| | | export function selectItemParameterList(query) { |
| | | return request({ |
| | | url: '/capacityScope/selectItemParameterList', |
| | | method: 'post', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | export function selectTestObjectList(query) { |
| | | return request({ |
| | | url: '/capacityScope/selectTestObjectList', |
| | | method: 'post', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | export function selectProductListByObjectId(query) { |
| | | return request({ |
| | | url: '/capacityScope/selectProductListByObjectId', |
| | | method: 'post', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | method: 'get', |
| | | }) |
| | | } |
| | | // 根据产品id查询厂家密度绑定 |
| | | export function selectSupplierDensityByProductId(query) { |
| | | return request({ |
| | | url: '/productSupplierDensity/selectSupplierDensityByProductId', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | // 新增产品厂家密度绑定 |
| | | export function addProductSupplierDensity(query) { |
| | | return request({ |
| | | url: '/productSupplierDensity/addProductSupplierDensity', |
| | | method: 'post', |
| | | data: query |
| | | }) |
| | | } |
| | | // 修改产品厂家密度绑定 |
| | | export function updateProductSupplierDensity(query) { |
| | | return request({ |
| | | url: '/productSupplierDensity/updateProductSupplierDensity', |
| | | method: 'post', |
| | | data: query |
| | | }) |
| | | } |
| | | // 修改产品厂家密度绑定 |
| | | export function deleteProductSupplierDensity(query) { |
| | | return request({ |
| | | url: '/productSupplierDensity/deleteProductSupplierDensity', |
| | | method: 'post', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | export function selectByTestObjectId(query) { |
| | | return request({ |
| | | url: '/structureTestObjectPart/selectByTestObjectId', |
| | | method: 'post', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | export function selectByProductId(query) { |
| | | return request({ |
| | | url: '/productPart/selectByProductId', |
| | | method: 'post', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | page: { |
| | | total:0, |
| | | size:10, |
| | | current:0 |
| | | current:1 |
| | | }, |
| | | bindPartComponent: { |
| | | entity: { |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog title="厂家密度绑定" :visible.sync="isShow" width="800px" @close="$emit('closeBindPartDialog')"> |
| | | <div class="body" v-if="isShow" style="height: 500px;overflow-y: auto;padding: 5px 0;"> |
| | | <!-- <ValueTable ref="bindPartComponent"--> |
| | | <!-- :url="searchUrl"--> |
| | | <!-- :upUrl="upUrl"--> |
| | | <!-- :delUrl="delUrl"--> |
| | | <!-- :componentData="bindPartComponent"--> |
| | | <!-- :key="upIndex"/>--> |
| | | </div> |
| | | <lims-table :tableData="tableData" :column="column" height="460" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="$emit('closeBindPartDialog')">取 消</el-button> |
| | | <el-button type="primary" @click="addBindPart" :loading="addBindLoad">新 增</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="新增厂家密度绑定" :visible.sync="addBindSupplierDensityDialog" width="400px" @close="closeBindPartDialog":close-on-click-modal="false" > |
| | | <el-dialog title="操作厂家密度绑定" :visible.sync="addBindSupplierDensityDialog" width="400px" @close="closeBindPartDialog":close-on-click-modal="false" > |
| | | <div class="body" v-if="addBindSupplierDensityDialog"> |
| | | <el-form label-position="right" label-width="80px" |
| | | ref="bindSupplierDensityData" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | // import ValueTable from "../../tool/value-table.vue"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | addProductSupplierDensity, |
| | | deleteProductSupplierDensity, |
| | | selectSupplierDensityByProductId, updateProductSupplierDensity |
| | | } from "@/api/structural/capability"; |
| | | |
| | | export default { |
| | | name: "bindSupplierDensityDialog", |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | | components: {}, |
| | | components: {limsTable}, |
| | | props: { |
| | | bindSupplierDensityDialog: { |
| | | type: Boolean, |
| | |
| | | data() { |
| | | // 这里存放数据 |
| | | return { |
| | | tableData: [], |
| | | column: [ |
| | | {label: '型号', prop: 'model'}, |
| | | {label: '厂家名称', prop: 'supplierName'}, |
| | | {label: '密度值', prop: 'densityValue'}, |
| | | { |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | | label: '操作', |
| | | width: '140px', |
| | | operation: [ |
| | | { |
| | | name: '编辑', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.editForm(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: '删除', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.delete(row); |
| | | }, |
| | | }, |
| | | ] |
| | | } |
| | | ], |
| | | page: { |
| | | total:0, |
| | | size:10, |
| | | current:1 |
| | | }, |
| | | tableLoading: false, |
| | | searchUrl: '', // 查询 |
| | | upUrl: '', // 编辑 |
| | | delUrl: '', // 删除 |
| | | isShow: this.bindSupplierDensityDialog, |
| | | bindPartComponent: { |
| | | entity: { |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | | } |
| | | }, |
| | | isPage: true, |
| | | isIndex: true, |
| | | showSelect: false, |
| | | select: true, |
| | | do: [{ |
| | | id: 'update', |
| | | font: '编辑', |
| | | type: 'text', |
| | | method: 'doDiy', |
| | | field: [] |
| | | }, { |
| | | id: 'delete', |
| | | font: '删除', |
| | | type: 'text', |
| | | method: 'doDiy' |
| | | }], |
| | | tagField: {}, |
| | | selectField: {}, |
| | | requiredAdd: ['supplierName', 'densityValue'], |
| | | requiredUp: ['supplierName', 'densityValue'], |
| | | }, |
| | | addBindSupplierDensityDialog: false, |
| | | bindSupplierDensityData: { |
| | | id: '', |
| | | model: '', // 型号 |
| | | supplierName: '', // 厂家 |
| | | densityValue: '', // 密度 |
| | |
| | | bindLoad: false, |
| | | upIndex: 0, |
| | | addBindLoad: false, |
| | | operationType: '' |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$set(this.bindPartComponent.entity, 'productId', this.currentRow.id) |
| | | this.getList() |
| | | }, |
| | | // 方法集合 |
| | | methods: { |
| | | getList () { |
| | | this.tableLoading = true |
| | | selectSupplierDensityByProductId({...this.page, productId: this.currentRow.id}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | addBindPart () { |
| | | this.addBindSupplierDensityDialog = true |
| | | this.operationType = 'add' |
| | | }, |
| | | // 提交零件绑定 |
| | | editForm (row) { |
| | | this.addBindSupplierDensityDialog = true |
| | | this.bindSupplierDensityData = this.HaveJson(row) |
| | | this.operationType = 'edit' |
| | | }, |
| | | // 提交厂家密度绑定 |
| | | submitBind () { |
| | | this.$refs['bindSupplierDensityData'].validate((valid) => { |
| | | if (valid) { |
| | | // 根据类型判断是检验对象零件绑定还是产品维护零件绑定 |
| | | const params = { |
| | | id: this.bindSupplierDensityData.id, |
| | | productId: this.currentRow.id, |
| | | model: this.bindSupplierDensityData.model, |
| | | supplierName: this.bindSupplierDensityData.supplierName, |
| | | densityValue: this.bindSupplierDensityData.densityValue, |
| | | } |
| | | this.bindLoad = true |
| | | const url = this.$api.productSupplierDensity.addProductSupplierDensity |
| | | this.$axios.post(url, params, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | if (this.operationType === 'add') { |
| | | addProductSupplierDensity(params).then(res => { |
| | | this.bindLoad = false |
| | | if (res.code === 200) { |
| | | this.$refs['bindSupplierDensityData'].resetFields(); |
| | | this.resetForm('bindSupplierDensityData') |
| | | this.addBindSupplierDensityDialog = false |
| | | this.$message.success('操作成功') |
| | | this.$refs.bindPartComponent.selectList() |
| | | this.$message.success('新增成功') |
| | | this.getList() |
| | | } |
| | | }).catch(err => { |
| | | this.bindLoad = false |
| | | console.log(err) |
| | | }) |
| | | } else { |
| | | updateProductSupplierDensity(params).then(res => { |
| | | this.bindLoad = false |
| | | if (res.code === 200) { |
| | | this.resetForm('bindSupplierDensityData') |
| | | this.addBindSupplierDensityDialog = 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(() => { |
| | | deleteProductSupplierDensity({id:row.id}).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success('删除成功') |
| | | this.getList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }) |
| | | }, |
| | | closeBindPartDialog () { |
| | | this.$refs['bindSupplierDensityData'].resetFields(); |
| | | this.addBindSupplierDensityDialog = false |
| | |
| | | page: { |
| | | total:0, |
| | | size:10, |
| | | current:0 |
| | | current:1 |
| | | }, |
| | | testObjectTableData: [], |
| | | testObjectColumn: [ |