From d7c4759b8c5c6fb766f3b9dac1bee5fec6026f5e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 17 二月 2025 09:53:19 +0800
Subject: [PATCH] 能力范围-厂家密度联调
---
src/components/capability/bindSupplierDensityDialog.vue | 172 ++++++++++++++++++++++++++++--------------
src/api/structural/structureTestObjectPart.js | 4
src/components/capability/bindPartDialog.vue | 2
src/views/structural/capabilityAndLaboratory/capability/index.vue | 2
src/api/structural/capability.js | 38 ++++++++
5 files changed, 153 insertions(+), 65 deletions(-)
diff --git a/src/api/structural/capability.js b/src/api/structural/capability.js
index 666a78b..edc0b50 100644
--- a/src/api/structural/capability.js
+++ b/src/api/structural/capability.js
@@ -4,7 +4,7 @@
export function selectItemParameterList(query) {
return request({
url: '/capacityScope/selectItemParameterList',
- method: 'post',
+ method: 'get',
params: query
})
}
@@ -12,7 +12,7 @@
export function selectTestObjectList(query) {
return request({
url: '/capacityScope/selectTestObjectList',
- method: 'post',
+ method: 'get',
params: query
})
}
@@ -75,7 +75,7 @@
export function selectProductListByObjectId(query) {
return request({
url: '/capacityScope/selectProductListByObjectId',
- method: 'post',
+ method: 'get',
params: query
})
}
@@ -117,3 +117,35 @@
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
+ })
+}
diff --git a/src/api/structural/structureTestObjectPart.js b/src/api/structural/structureTestObjectPart.js
index e97820f..25d0186 100644
--- a/src/api/structural/structureTestObjectPart.js
+++ b/src/api/structural/structureTestObjectPart.js
@@ -4,7 +4,7 @@
export function selectByTestObjectId(query) {
return request({
url: '/structureTestObjectPart/selectByTestObjectId',
- method: 'post',
+ method: 'get',
params: query
})
}
@@ -36,7 +36,7 @@
export function selectByProductId(query) {
return request({
url: '/productPart/selectByProductId',
- method: 'post',
+ method: 'get',
params: query
})
}
diff --git a/src/components/capability/bindPartDialog.vue b/src/components/capability/bindPartDialog.vue
index f524c4a..5fca2f6 100644
--- a/src/components/capability/bindPartDialog.vue
+++ b/src/components/capability/bindPartDialog.vue
@@ -99,7 +99,7 @@
page: {
total:0,
size:10,
- current:0
+ current:1
},
bindPartComponent: {
entity: {
diff --git a/src/components/capability/bindSupplierDensityDialog.vue b/src/components/capability/bindSupplierDensityDialog.vue
index b9afe36..5e835b6 100644
--- a/src/components/capability/bindSupplierDensityDialog.vue
+++ b/src/components/capability/bindSupplierDensityDialog.vue
@@ -1,20 +1,14 @@
<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"
@@ -40,12 +34,17 @@
</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,
@@ -59,40 +58,47 @@
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: '', // 瀵嗗害
@@ -108,51 +114,101 @@
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 => {
- this.bindLoad = false
- if (res.code === 200) {
- this.$refs['bindSupplierDensityData'].resetFields();
- this.addBindSupplierDensityDialog = false
- this.$message.success('鎿嶄綔鎴愬姛')
- this.$refs.bindPartComponent.selectList()
- }
- }).catch(err => {
- this.bindLoad = false
- console.log(err)
- })
+ if (this.operationType === 'add') {
+ addProductSupplierDensity(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 {
+ 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
diff --git a/src/views/structural/capabilityAndLaboratory/capability/index.vue b/src/views/structural/capabilityAndLaboratory/capability/index.vue
index 41918b9..e23cb5b 100644
--- a/src/views/structural/capabilityAndLaboratory/capability/index.vue
+++ b/src/views/structural/capabilityAndLaboratory/capability/index.vue
@@ -174,7 +174,7 @@
page: {
total:0,
size:10,
- current:0
+ current:1
},
testObjectTableData: [],
testObjectColumn: [
--
Gitblit v1.9.3