From 419114813851e1e9cda6deb7bfb9bf56c45b02d8 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 31 八月 2023 11:25:47 +0800
Subject: [PATCH] modified: src/api/inspection/rawmaterial.js modified: src/views/inspectionManagement/reportForInspection/index.vue
---
src/views/inspectionManagement/reportForInspection/index.vue | 84 ++++++++++++++++++++++++++++++++++++------
src/api/inspection/rawmaterial.js | 18 +++++++++
2 files changed, 90 insertions(+), 12 deletions(-)
diff --git a/src/api/inspection/rawmaterial.js b/src/api/inspection/rawmaterial.js
index 2bbf039..d21c70b 100644
--- a/src/api/inspection/rawmaterial.js
+++ b/src/api/inspection/rawmaterial.js
@@ -77,4 +77,22 @@
method: 'get',
params
})
+}
+
+//鑾峰彇閫夋嫨鐨勭増鏈�
+export function getChooseVersion(params){
+ return request({
+ url: '/raw-material/chooseVer',
+ method: 'get',
+ params
+ })
+}
+
+//鑾峰彇閫夋嫨鐗堟湰涓嬬殑鏍囧噯搴撴暟鎹�
+export function lookProByVer(params){
+ return request({
+ url: '/raw-material/lookProByVer',
+ method: 'get',
+ params
+ })
}
\ No newline at end of file
diff --git a/src/views/inspectionManagement/reportForInspection/index.vue b/src/views/inspectionManagement/reportForInspection/index.vue
index c2cbe46..6dbbd6f 100644
--- a/src/views/inspectionManagement/reportForInspection/index.vue
+++ b/src/views/inspectionManagement/reportForInspection/index.vue
@@ -30,7 +30,7 @@
</div>
<el-dialog title="鏂板鍘熸潗鏂欐姤妫�" :visible.sync="addReportVisible" width="40%">
<el-form ref="addMaterialForm" :rules="insertRule" :model="insertData" :inline="true" label-position="right"
- label-width="80px">
+ label-width="100px">
<el-form-item label="鏉ユ枡鏃ユ湡:" prop="fromDate">
<el-date-picker v-model="insertData.fromDate" type="date" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
@@ -115,19 +115,30 @@
</div>
</div>
</div>
- <el-dialog title="閫夋嫨鏃ユ湡" :visible.sync="addReportDialog" width="30%">
+ <el-dialog title="閫夋嫨鏃ユ湡" :visible.sync="addReportDialog" width="60%">
<el-form :model="addInspectionForm" :rules="addInspectionFormRules" rule="addInspectionForm">
<el-form-item label="妫�楠屾棩鏈�" label-width="100px" prop="inspectionDate">
<el-date-picker v-model="addInspectionForm.inspectionDate" type="daterange" value-format="yyyy-MM-dd"
range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡">
</el-date-picker>
</el-form-item>
- <el-form-item label="鐗堟湰" label-width="100px" prop="version">
- <el-select v-model="addInspectionForm.version" placeholder="璇烽�夋嫨鐗堟湰">
- <el-option v-for="(item,index) in 5" :key="index" :value="item" :label="item"></el-option>
+ <el-form-item label="褰撳墠鐗堟湰" label-width="100px" prop="version">
+ <el-select @change="changeVersionFun" v-model="addInspectionForm.version" placeholder="璇烽�夋嫨鐗堟湰">
+ <el-option v-for="item in chooseVersion" :key="item.value" :label="item.label" :value="item.value" ></el-option>
</el-select>
</el-form-item>
</el-form>
+ <el-table
+ style="width:90%;margin-left:5%"
+ :data="standardLibraryData" row-key="id" border
+ default-expand-all ref="multipleTable"
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
+ <el-table-column type="index" width="50px" label="搴忓彿"></el-table-column>
+ <el-table-column label="椤圭洰鍚嶇О" prop="name" sortable></el-table-column>
+ <el-table-column prop="unit" label="鍗曚綅" sortable></el-table-column>
+ <el-table-column label="鏍囧噯鍊�" prop="required" sortable></el-table-column>
+ <el-table-column prop="internal" label="鍐呮帶鍊�" sortable></el-table-column>
+ </el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('addInspectionForm')">鍙� 娑�</el-button>
<el-button type="primary" @click="confirmBtn('addInspectionForm')">纭� 瀹�</el-button>
@@ -245,16 +256,20 @@
deleteMaterial,
addMaterial,
getMaterielName,
- getSpecification
+ getSpecification,
+ getChooseVersion,
+ lookProByVer
} from '@/api/inspection/rawmaterial'
export default {
data() {
return {
+ standardLibraryData:[],
+ chooseVersion: [],
userName: "",
devices: "",
addInspectionForm: {
- inspectionDate: ['2023-08-01', '2023-08-31'],
- version: 5
+ inspectionDate: [],
+ version: null
},
addInspectionFormRules: {
inspectionDate: [{
@@ -405,7 +420,7 @@
this.getRawMaterialList()
},
mounted() {
- this.getMaterielName()
+ this.getMaterielName();
},
methods: {
handleChange() {
@@ -454,6 +469,7 @@
},
handleSelectionChange(val) {
this.checkData = val;
+ console.log(val);
},
//鐢熸垚鎶ユ鍗曟寜閽�
addReportBtn() {
@@ -463,10 +479,55 @@
if (this.checkData.length > 1) {
this.$message.error("鏈�澶氶�夋嫨涓�鏉℃暟鎹�!");
} else {
+ let mcode = this.checkData[0].materialCoding;
+ let name = this.checkData[0].materialName;
+ let specifications = this.checkData[0].specificationsModels;
+ this.getChooseVersionFun(mcode,name,specifications);
+ console.log(this.standardLibraryData);
this.addReportDialog = true;
}
}
},
+ changeVersionFun(){
+ let mCode = this.checkData[0].materialCoding;
+ let name = this.checkData[0].materialName;
+ let specifications = this.checkData[0].specificationsModels;
+ let version = this.addInspectionForm.version;
+ this.getProByVersion(mCode,name,specifications,version);
+ },
+ //鑾峰彇鐗堟湰涓嬬殑鏍囧噯搴撴暟鎹�
+ async getProByVersion(mCode,name,specifications,version){
+ var vm = this;
+ await lookProByVer({
+ mcode : mCode,
+ name : name,
+ specifications : specifications,
+ version: version
+ }).then((res)=>{
+ console.log(res);
+ vm.standardLibraryData = res.data;
+ })
+
+ },
+ //鑾峰彇鐗堟湰鍒楄〃
+ async getChooseVersionFun(mCode,name,specifications){
+ var vm = this;
+ this.chooseVersion = [];
+ await getChooseVersion({
+ mcode : mCode,
+ name : name,
+ specifications : specifications
+ }).then((res)=>{
+ vm.getProByVersion(mCode,name,specifications,res.data[0])
+ for(let i=0;i<res.data.length;i++){
+ vm.chooseVersion.push({
+ value: res.data[i],
+ label: "V"+res.data[i]
+ });
+ }
+ vm.addInspectionForm.version = res.data[0];
+ });
+ },
//鐢熸垚鎶ユ鍗曠‘璁ゆ寜閽�
confirmBtn(formName) {
let dateArr = this.addInspectionForm.inspectionDate;
@@ -485,14 +546,14 @@
"supplier": val.supplierName,
"type": val.type,
"unit": val.unit,
- "version": val.version
+ "version": this.addInspectionForm.version
}
// this.createReport(obj);
this.addReportDialog = false;
this.initNewSelection();
this.showNewPage = true;
},
- //鐢熸垚鎶ヤ环鍗�
+ //鐢熸垚鎶ユ鍗�
async createReport(param) {
let res = await addInspect(param);
const res2 = await selectInspectsListById({
@@ -501,7 +562,6 @@
this.resultData = res2.data;
this.inspectionForm = res2.data;
this.inspectionItems = res2.data.insProducts;
-
},
// 鑾峰彇鍒嗛〉鍒楄〃鏁版嵁
async getRawMaterialList() {
--
Gitblit v1.9.3