From 1b7ff2f053d04a5332aadf59820b567cae1df8d4 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 25 三月 2025 10:14:40 +0800
Subject: [PATCH] 原辅料下单1.报检类型增加2.检验项匹配
---
src/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue | 215 +++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 182 insertions(+), 33 deletions(-)
diff --git a/src/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue b/src/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue
index bf2716e..ed4a048 100644
--- a/src/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue
+++ b/src/views/structural/capabilityAndLaboratory/capabilityComponents/bindPartDialog.vue
@@ -1,22 +1,20 @@
<template>
<div>
<el-dialog title="闆朵欢缁戝畾" :visible.sync="isShow" width="800px" @close="$emit('closeBindPartDialog')">
- <lims-table :tableData="tableData" :column="column" height="460"
- :page="page" :tableLoading="tableLoading"></lims-table>
+ <lims-table :tableData="tableData" :column="column" height="460" :page="page" :tableLoading="tableLoading"
+ :key="1"></lims-table>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('closeBindPartDialog')">鍙� 娑�</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"
- :close-on-click-modal="false" >
+ :close-on-click-modal="false">
<div class="body" v-if="addBindPartDialog">
- <el-form label-position="right" label-width="80px"
- ref="bindPartData"
- :rules="bindPartDataRules"
- :model="bindPartData">
+ <el-form label-position="right" label-width="80px" ref="bindPartData" :rules="bindPartDataRules"
+ :model="bindPartData">
<el-form-item label="闆朵欢鍙凤細" prop="partNo">
- <el-input v-model="bindPartData.partNo" size="small"></el-input>
+ <el-input v-model="bindPartData.partNo" size="small" :disabled="dialogTitle == '淇敼闆朵欢缁戝畾'"></el-input>
</el-form-item>
<el-form-item label="棰滆壊锛�" prop="color">
<el-input v-model="bindPartData.color" size="small"></el-input>
@@ -24,12 +22,31 @@
<el-form-item label="鑹叉爣锛�" prop="colorCode">
<el-input v-model="bindPartData.colorCode" size="small"></el-input>
</el-form-item>
+ <el-form-item label="杩涘巶妫�楠岄」锛�" prop="inspectionItem"
+ v-if="currentObj.objectType == '鍘熻緟鏂�' || currentObj.objectType == '鍖呮潗'" label-width="100px">
+ <!-- <el-input v-model="bindPartData.inspectionItem" disabled placeholder="閫夋嫨妫�楠岄」" size="small">
+ <template slot="append">
+ <el-button slot="append" icon="el-icon-search" @click="openItems"></el-button>
+ </template>
+</el-input> -->
+ <el-select v-model="bindPartData.inspectionItem" multiple collapse-tags placeholder="璇烽�夋嫨" size="small">
+ <el-option v-for="item in itemList" :key="item.inspectionItem" :label="item.inspectionItem"
+ :value="item.inspectionItem">
+ </el-option>
+ </el-select>
+ </el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="closeBindPartDialog">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitBind" :loading="bindLoad">纭� 璁�</el-button>
+ <el-button type="primary" @click="submitBind">纭� 璁�</el-button>
</span>
+ </el-dialog>
+ <el-dialog title="淇敼璁板綍" :visible.sync="editItem" width="900px">
+ <div class="body" v-if="editItem">
+ <lims-table :tableData="editList" :column="editColumn" height="460px" :tableLoading="tableLoading0" :key="2"
+ :page="editPage" @pagination="editPagination"></lims-table>
+ </div>
</el-dialog>
</div>
</template>
@@ -38,16 +55,22 @@
import limsTable from "@/components/Table/lims-table.vue";
import {
addProductPart,
- addTestObjectPart, deleteProductPart, deleteTestObjectPart,
+ addTestObjectPart,
+ deleteProductPart,
+ deleteTestObjectPart,
selectByProductId,
- selectByTestObjectId, updateProductPart, updateTestObjectPart
+ selectByTestObjectId,
+ updateProductPart,
+ updateTestObjectPart,
+ inspectionItems,
+ productPartReview,
+ productPartLogList
} from "@/api/structural/structureTestObjectPart";
-import {delProduct} from "@/api/structural/capability";
export default {
name: "bindPartDialog",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {limsTable},
+ components: { limsTable },
props: {
bindPartDialog: {
type: Boolean,
@@ -57,10 +80,14 @@
type: Number,
default: () => null
},
- currentRow : { // 閫夋嫨鏈潯鏁版嵁鐨勪俊鎭�
+ currentRow: { // 閫夋嫨鏈潯鏁版嵁鐨勪俊鎭�
type: Object,
- default: () => {}
- }
+ default: () => { }
+ },
+ currentObj: {//褰撳墠瀵硅薄
+ type: Object,
+ default: () => { }
+ },
},
data() {
// 杩欓噷瀛樻斁鏁版嵁
@@ -71,9 +98,21 @@
tableData: [],
tableLoading: false,
column: [
- {label: '闆朵欢鍙�', prop: 'partNo'},
- {label: '棰滆壊', prop: 'color'},
- {label: '鑹叉爣', prop: 'colorCode'},
+ { label: '闆朵欢鍙�', prop: 'partNo' },
+ { label: '棰滆壊', prop: 'color' },
+ { label: '鑹叉爣', prop: 'colorCode' },
+ { label: '杩涘巶妫�楠岄」', prop: 'inspectionItem' },
+ {
+ label: '鐘舵��', prop: 'review',
+ dataType: "tag",
+ formatType: (params) => {
+ if (params == '寰呭鏍�') {
+ return 'danger'
+ } else {
+ return 'success'
+ }
+ },
+ },
{
dataType: 'action',
fixed: 'right',
@@ -93,13 +132,40 @@
this.delete(row);
},
},
+ {
+ name: '澶嶆牳',
+ type: 'text',
+ clickFun: (row) => {
+ this.$confirm("鏄惁澶嶆牳閫氳繃?", "澶嶆牳", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ productPartReview({ id: row.id }).then((res) => {
+ if (res.code == 200) {
+ this.$message.success("澶嶆牳閫氳繃");
+ this.getList();
+ }
+ });
+ })
+ .catch(() => { });
+ },
+ },
+ {
+ name: '璁板綍',
+ type: 'text',
+ clickFun: (row) => {
+ this.lookList(row);
+ },
+ },
]
}
],
page: {
- total:0,
- size:10,
- current:1,
+ total: 0,
+ size: 10,
+ current: 1,
layout: 'total, prev, pager, next'
},
bindPartComponent: {
@@ -135,6 +201,7 @@
partNo: '', // 闆朵欢鍙�
color: '', // 棰滆壊
colorCode: '', // 鑹叉爣
+ inspectionItem: [],//鍘熻緟鏂欒繘鍘傛楠屽璞″垪琛�
},
bindPartDataRules: {
partNo: [
@@ -143,19 +210,82 @@
},
bindLoad: false,
upIndex: 0,
+
addBindLoad: false,
+ itemList: [],//鍘熻緟鏂欒繘鍘傛楠屽璞″垪琛�
+ editItem: false,
+ editList: [],
+ editColumn: [
+ { label: '闆朵欢鍙�', prop: 'partNo' },
+ { label: '棰滆壊', prop: 'color' },
+ { label: '鑹叉爣', prop: 'colorCode' },
+ { label: '杩涘巶妫�楠岄」', prop: 'inspectionItem' },
+ {
+ label: '鐘舵��', prop: 'review',
+ dataType: "tag",
+ formatType: (params) => {
+ if (params == '寰呭鏍�') {
+ return 'danger'
+ } else {
+ return 'success'
+ }
+ },
+ },
+ { label: '淇敼鏃堕棿', prop: 'operTime' },
+ { label: '淇敼浜�', prop: 'operName' },
+ ],
+ editPage: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ tableLoading0: false,
+ currentPart: {},//褰撳墠闆朵欢
+ // mutilSelect: []
}
},
mounted() {
this.getList()
+ this.getItemList()
},
// 鏂规硶闆嗗悎
methods: {
+ getItemList() {
+ // this.tableLoading0 = true;
+ inspectionItems({
+ sample: this.currentObj.specimenName,
+ productName: this.type == 0 ? null : this.currentRow.name
+ }).then(res => {
+ this.itemList = res.data
+ // this.tableLoading0 = false;
+ })
+ },
+ // 淇敼璁板綍
+ lookList(row) {
+ this.currentPart = row;
+ this.editItem = true;
+ this.getEditList()
+ },
+ getEditList() {
+ this.tableLoading0 = true
+ productPartLogList({ id: this.currentPart.id, ...this.editPage }).then(res => {
+ this.tableLoading0 = false
+ if (res.code == 200) {
+ this.editList = res.data.records
+ this.editPage.total = res.data.total
+ }
+ })
+ },
+ editPagination() {
+ this.editPage.current = page;
+ this.editPage.size = limit;
+ this.getEditList();
+ },
getList() {
this.tableLoading = true
// 鏍规嵁绫诲瀷鍒ゆ柇鏄楠屽璞¢浂浠剁粦瀹氳繕鏄骇鍝佺淮鎶ら浂浠剁粦瀹�
if (this.type === 0) {
- selectByTestObjectId({testObjectId: this.currentRow.id}).then(res => {
+ selectByTestObjectId({ testObjectId: this.currentRow.id }).then(res => {
this.tableLoading = false
if (res.code === 200) {
this.tableData = res.data.records
@@ -165,7 +295,7 @@
this.tableLoading = false
})
} else {
- selectByProductId({productId: this.currentRow.id}).then(res => {
+ selectByProductId({ productId: this.currentRow.id }).then(res => {
this.tableLoading = false
if (res.code === 200) {
this.tableData = res.data.records
@@ -176,16 +306,19 @@
})
}
},
- addBindPart (type, row) {
+ addBindPart(type, row) {
this.addBindPartDialog = true
this.dialogTitle = type === 'add' ? '鏂板闆朵欢缁戝畾' : '淇敼闆朵欢缁戝畾'
this.operationType = type
if (type === 'edit') {
this.bindPartData = this.HaveJson(row)
+ this.bindPartData.inspectionItem = this.bindPartData.inspectionItem ? this.bindPartData.inspectionItem.split(',') : []
+ } else {
+ this.bindPartData = {}
}
},
// 鎻愪氦闆朵欢缁戝畾
- submitBind () {
+ submitBind() {
this.$refs['bindPartData'].validate((valid) => {
if (valid) {
// 鏍规嵁绫诲瀷鍒ゆ柇鏄楠屽璞¢浂浠剁粦瀹氳繕鏄骇鍝佺淮鎶ら浂浠剁粦瀹�
@@ -194,16 +327,21 @@
color: this.bindPartData.color,
colorCode: this.bindPartData.colorCode,
partNo: this.bindPartData.partNo,
- } : {
+ id: this.bindPartData.id,
+ inspectionItem: this.bindPartData.inspectionItem && this.bindPartData.inspectionItem.length > 0 ? this.bindPartData.inspectionItem.join(',') : ''
+ } : {
productId: this.currentRow.id,
color: this.bindPartData.color,
colorCode: this.bindPartData.colorCode,
partNo: this.bindPartData.partNo,
+ id: this.bindPartData.id,
+ inspectionItem: this.bindPartData.inspectionItem && this.bindPartData.inspectionItem.length > 0 ? this.bindPartData.inspectionItem.join(',') : ''
}
this.bindLoad = true
if (this.operationType === 'add') {
if (this.type === 0) {
addTestObjectPart(params).then(res => {
+ this.bindLoad = false
if (res.code === 200) {
this.resetForm('bindPartData')
this.addBindPartDialog = false
@@ -216,6 +354,7 @@
})
} else {
addProductPart(params).then(res => {
+ this.bindLoad = false
if (res.code === 200) {
this.resetForm('bindPartData')
this.addBindPartDialog = false
@@ -260,21 +399,21 @@
}
})
},
- delete (row) {
+ delete(row) {
this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
if (this.type === 0) {
- deleteTestObjectPart({id:row.id}).then(res => {
+ deleteTestObjectPart({ id: row.id }).then(res => {
if (res.code === 200) {
this.$message.success('鍒犻櫎鎴愬姛')
this.getList();
}
})
} else {
- deleteProductPart({id:row.id}).then(res => {
+ deleteProductPart({ id: row.id }).then(res => {
if (res.code === 200) {
this.$message.success('鍒犻櫎鎴愬姛')
this.getList();
@@ -288,13 +427,23 @@
});
})
},
- closeBindPartDialog () {
+ closeBindPartDialog() {
this.resetForm('bindPartData')
this.addBindPartDialog = false
},
+ // openItems() {
+ // this.mutilSelect = this.bindPartData.inspectionItem ? this.bindPartData.inspectionItem.split(',') : []
+ // this.$refs.itemTable.toggleRowSelection(this.mutilSelect)
+ // this.addBindItem = true;
+ // },
+ // submitBindItem() {
+ // this.bindPartData.inspectionItem = this.mutilSelect.join(',')
+ // },
+ // handleSelectionChange(val) {
+ // this.mutilSelect = val
+ // }
},
}
</script>
-<style scoped>
-</style>
+<style scoped></style>
--
Gitblit v1.9.3