检验报告显示优化

yangwl
shaoyong 10 months ago
parent 17a929ad9e
commit 9b7ce9dda5

@ -1,7 +1,7 @@
import request from '@/utils/request'
// 查询来料报告列表
export function listIncome(query) {
export function listInventory(query) {
return request({
url: '/quality/qcInventoryReport/list',
method: 'get',
@ -10,7 +10,7 @@ export function listIncome(query) {
}
// 查询来料报告详细
export function getIncome(recordId) {
export function getInventory(recordId) {
return request({
url: '/quality/qcInventoryReport/' + recordId,
method: 'get'
@ -18,7 +18,7 @@ export function getIncome(recordId) {
}
// 新增来料报告
export function addIncome(data) {
export function addInventory(data) {
return request({
url: '/quality/qcInventoryReport',
method: 'post',
@ -27,7 +27,7 @@ export function addIncome(data) {
}
// 修改来料报告
export function updateIncome(data) {
export function updateInventory(data) {
return request({
url: '/quality/qcInventoryReport',
method: 'put',
@ -36,7 +36,7 @@ export function updateIncome(data) {
}
// 删除来料报告
export function delIncome(recordId) {
export function delInventory(recordId) {
return request({
url: '/quality/qcInventoryReport/' + recordId,
method: 'delete'
@ -71,7 +71,7 @@ export function getQcListUser(query) {
}
//状态修改
export function changeIncomeStatus(recordId, status) {
export function changeInventoryStatus(recordId, status) {
const data = {
recordId,
status

@ -232,19 +232,25 @@
<el-col :span="24">
<!-- 检验项目明细 -->
<el-table v-loading="loading" :data="checkProjectList" >
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="检验项目" align="center" prop="ruleName" />
<el-table-column label="标准要求" align="center" prop="checkStandard" width="160"/>
<el-table-column label="抽检数" align="center" prop="sampleNum" />
<el-table-column label="单位" align="center" prop="unitCode" />
<el-table-column label="抽检数" align="center" prop="sampleNum" width="60"/>
<el-table-column label="单位" align="center" prop="unitCode" width="50"/>
<el-table-column label="测量结果" align="center" prop="actualValue" width="160"/>
<el-table-column label="判定" align="center" prop="status" >
<el-table-column label="判定" align="center" prop="status" width="70">
<template slot-scope="scope">
<dict-tag :options="dict.type.check_result" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="附件" align="center" prop="files" width="200">
<el-table-column label="不良类型" align="center" prop="defectCode" width="80">
<template slot-scope="scope">
<span v-if="scope.row.defectCode">{{ getCodeValue(scope.row.defectCode) }}</span>
</template>
</el-table-column>
<el-table-column label="不良数量" align="center" prop="defectQuality" width="80"/>
<el-table-column label="附件" align="center" prop="files" width="120">
<template slot-scope="scope">
<el-image v-for="(item,index) in scope.row.files" :key="index"
:src="item.fileAddress"
@ -299,6 +305,7 @@
<script>
import { listIncome, getIncome, delIncome, addIncome, updateIncome,getCkeckProjectList} from "@/api/quality/incomeReport";
import { getCheckTypes } from "@/api/quality/qcProduce";
import { getDefectTypeListByDefectType } from "@/api/quality/defectType.js";
import moment from 'moment';
export default {
name: "Income",
@ -337,6 +344,7 @@ export default {
incomeList: [],
//
checkProjectList: [],
defectList: [],
//
title: "",
//
@ -384,6 +392,7 @@ export default {
this.getDate();
this.getList();
this.getCheckTypes();
this.getDefectType();
},
methods: {
/****/
@ -559,6 +568,16 @@ export default {
properties: params.properties || null
})
},
getDefectType() {
const defectType = "material";
getDefectTypeListByDefectType(defectType).then(response => {
this.defectList = response.rows;
});
},
getCodeValue(defectCode) {
const foundDefect = this.defectList.find(defect => defect.defectCode === defectCode);
return foundDefect.defectSubclass;
}
}
};
</script>

@ -231,19 +231,25 @@
<el-col :span="24">
<!-- 检验项目明细 -->
<el-table v-loading="loading" :data="checkProjectList" >
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="检验项目" align="center" prop="ruleName" />
<el-table-column label="标准要求" align="center" prop="checkStandard" width="160"/>
<el-table-column label="抽检数" align="center" prop="sampleNum" />
<el-table-column label="单位" align="center" prop="unitCode" />
<el-table-column label="抽检数" align="center" prop="sampleNum" width="60"/>
<el-table-column label="单位" align="center" prop="unitCode" width="50"/>
<el-table-column label="实测结果" align="center" prop="actualValue" width="160"/>
<el-table-column label="判定" align="center" prop="status" >
<el-table-column label="判定" align="center" prop="status" width="70">
<template slot-scope="scope">
<dict-tag :options="dict.type.check_result" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="附件" align="center" prop="files" width="200">
</el-table-column>
<el-table-column label="不良类型" align="center" prop="defectCode" width="80">
<template slot-scope="scope">
<span v-if="scope.row.defectCode">{{ getCodeValue(scope.row.defectCode) }}</span>
</template>
</el-table-column>
<el-table-column label="不良数量" align="center" prop="defectQuality" width="80"/>
<el-table-column label="附件" align="center" prop="files" width="120">
<template slot-scope="scope">
<el-image v-for="(item,index) in scope.row.files" :key="index"
:src="item.fileAddress"
@ -296,8 +302,9 @@
</template>
<script>
import { listIncome, getIncome, delIncome, addIncome, updateIncome,getCkeckProjectList} from "@/api/quality/inventoryReport";
import { listInventory, getInventory, delInventory, addInventory, updateInventory,getCkeckProjectList} from "@/api/quality/inventoryReport";
import { getCheckTypes } from "@/api/quality/qcProduce";
import { getDefectTypeListByDefectType } from "@/api/quality/defectType.js";
import moment from 'moment';
export default {
name: "InventoryReport",
@ -336,6 +343,7 @@ export default {
incomeList: [],
//
checkProjectList: [],
defectList: [],
//
title: "",
//
@ -383,6 +391,7 @@ export default {
this.getDate();
this.getList();
this.getCheckTypes();
this.getDefectType();
},
methods: {
/****/
@ -415,8 +424,8 @@ export default {
this.queryParams.checkTimeStart = moment(this.queryParams.checkTimeArray[0]).format('YYYY-MM-DD HH:mm:ss');
this.queryParams.checkTimeEnd = moment(this.queryParams.checkTimeArray[1]).format('YYYY-MM-DD HH:mm:ss');
}
listIncome(this.queryParams).then(response => {
listInventory(this.queryParams).then(response => {
this.incomeList = response.rows;
this.total = response.total;
this.loading = false;
@ -489,7 +498,7 @@ export default {
this.reset();
const recordId = row.recordId || this.ids
this.queryParams.recordId = recordId;
getIncome(recordId).then(response => {
getInventory(recordId).then(response => {
this.form = response.data;
this.form.printable = 'printFrom'; //
this.form.ignore = ['no-print'];//
@ -503,13 +512,13 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.recordId != null) {
updateIncome(this.form).then(response => {
updateInventory(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addIncome(this.form).then(response => {
addInventory(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -522,7 +531,7 @@ export default {
handleDelete(row) {
const recordIds = row.recordId || this.ids;
this.$modal.confirm('是否确认删除库存检验编号为"' + recordIds + '"的数据项?').then(function() {
return delIncome(recordIds);
return delInventory(recordIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
@ -558,6 +567,16 @@ export default {
properties: params.properties || null
})
},
getDefectType() {
const defectType = "inventory";
getDefectTypeListByDefectType(defectType).then(response => {
this.defectList = response.rows;
});
},
getCodeValue(defectCode) {
const foundDefect = this.defectList.find(defect => defect.defectCode === defectCode);
return foundDefect.defectSubclass;
}
}
};
</script>

@ -208,19 +208,25 @@
<el-col :span="24">
<!-- 检验项目明细 -->
<el-table v-loading="loading" :data="checkProjectList" >
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="检验项目" align="center" prop="ruleName" />
<el-table-column label="标准要求" align="center" prop="checkStandard" width="160"/>
<el-table-column label="抽检数" align="center" prop="sampleNum" />
<el-table-column label="单位" align="center" prop="unitCode" />
<el-table-column label="抽检数" align="center" prop="sampleNum" width="60"/>
<el-table-column label="单位" align="center" prop="unitCode" width="50"/>
<el-table-column label="实测结果" align="center" prop="actualValue" width="160"/>
<el-table-column label="判定" align="center" prop="status" >
<el-table-column label="判定" align="center" prop="status" width="70">
<template slot-scope="scope">
<dict-tag :options="dict.type.check_result" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="附件" align="center" prop="files" width="200">
<el-table-column label="不良类型" align="center" prop="defectCode" width="80">
<template slot-scope="scope">
<span v-if="scope.row.defectCode">{{ getCodeValue(scope.row.defectCode) }}</span>
</template>
</el-table-column>
<el-table-column label="不良数量" align="center" prop="defectQuality" width="50"/>
<el-table-column label="附件" align="center" prop="files" width="120">
<template slot-scope="scope">
<el-image v-for="(item,index) in scope.row.files" :key="index"
:src="item.fileAddress"
@ -278,6 +284,7 @@
import { listProduct, getProduct, delProduct, addProduct, updateProduct,getWorkOrders} from "@/api/quality/productReport";
import { getCkeckProjectList} from "@/api/quality/incomeReport";
import { getCheckTypes } from "@/api/quality/qcProduce";
import { getDefectTypeListByDefectType } from "@/api/quality/defectType.js";
import moment from 'moment';
export default {
name: "Income",
@ -316,6 +323,7 @@ export default {
incomeList: [],
//
checkProjectList: [],
defectList: [],
//
title: "",
//
@ -363,6 +371,7 @@ export default {
this.getDate();
this.getList();
this.getCheckTypes();
this.getDefectType();
},
methods: {
/****/
@ -540,6 +549,16 @@ export default {
properties: params.properties || null
})
},
getDefectType() {
const defectType = "product";
getDefectTypeListByDefectType(defectType).then(response => {
this.defectList = response.rows;
});
},
getCodeValue(defectCode) {
const foundDefect = this.defectList.find(defect => defect.defectCode === defectCode);
return foundDefect.defectSubclass;
}
}
};
</script>

Loading…
Cancel
Save