质量模块优化

master
shaoyong 9 months ago
parent 8590485eac
commit c8e3de426b

@ -59,3 +59,22 @@ export function addSupplier(data) {
data: data data: data
}); });
} }
// 查询用户物料未关联列表
export function getProductLeftList(query) {
return request({
url: '/quality/qcGoalDistribute/getProductLeftList',
method: 'get',
params: query
});
}
// 查询用户物料已关联列表
export function getProductRightList(query) {
return request({
url: '/quality/qcGoalDistribute/getProductRightList',
method: 'get',
params: query
});
}

@ -88,6 +88,7 @@
<el-table-column label="收货数量" align="center" prop="quality" /> <el-table-column label="收货数量" align="center" prop="quality" />
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="供应商名称" align="center" prop="supplierName" width="240"/> <el-table-column label="供应商名称" align="center" prop="supplierName" width="240"/>
<el-table-column label="检测地点" align="center" prop="checkLoc"/>
<el-table-column label="检验时间" align="center" prop="checkTime" width="180"> <el-table-column label="检验时间" align="center" prop="checkTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>

@ -88,6 +88,7 @@
<el-table-column label="收货数量" align="center" prop="quality" /> <el-table-column label="收货数量" align="center" prop="quality" />
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="供应商名称" align="center" prop="supplierName" width="240"/> <el-table-column label="供应商名称" align="center" prop="supplierName" width="240"/>
<el-table-column label="检测地点" align="center" prop="checkLoc"/>
<el-table-column label="检验时间" align="center" prop="checkTime" width="180"> <el-table-column label="检验时间" align="center" prop="checkTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>

@ -11,18 +11,18 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="检验任务" prop="checkNo"> <el-form-item label="任务编号" prop="checkNo">
<el-input <el-input
v-model="queryParams.checkNo" v-model="queryParams.checkNo"
placeholder="请输入检测地点" placeholder="请输入任务编号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="产品编码" prop="materialCode"> <el-form-item label="产品名称" prop="materialName">
<el-input <el-input
v-model="queryParams.materialCode" v-model="queryParams.materialName"
placeholder="请输入产品编码" placeholder="请输入产品名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -100,6 +100,7 @@
<el-table-column label="收货数量" align="center" prop="quality" /> <el-table-column label="收货数量" align="center" prop="quality" />
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="产线名称" align="center" prop="supplierName" width="120"/> <el-table-column label="产线名称" align="center" prop="supplierName" width="120"/>
<el-table-column label="检测地点" align="center" prop="checkLoc"/>
<el-table-column label="检验时间" align="center" prop="checkTime" width="180"> <el-table-column label="检验时间" align="center" prop="checkTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>

@ -78,6 +78,7 @@
<el-table-column label="收货数量" align="center" prop="quality" /> <el-table-column label="收货数量" align="center" prop="quality" />
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="仓库名称" align="center" prop="supplierName" width="240"/> <el-table-column label="仓库名称" align="center" prop="supplierName" width="240"/>
<el-table-column label="检测地点" align="center" prop="checkLoc"/>
<el-table-column label="检验时间" align="center" prop="checkTime" width="180"> <el-table-column label="检验时间" align="center" prop="checkTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>

@ -1,6 +1,6 @@
<template> <template>
<el-dialog <el-dialog
title="分配供应商" :title="title"
:visible.sync="showFlag" :visible.sync="showFlag"
width="1000px" width="1000px"
append-to-body append-to-body
@ -11,7 +11,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-tabs type="border-card" v-if="belongGoalId != null"> <el-tabs type="border-card" v-if="belongGoalId != null">
<el-tab-pane label="分配供应商"> <el-tab-pane :label="title">
<div> <div>
<div class="query"> <div class="query">
<el-input <el-input
@ -124,7 +124,7 @@
</template> </template>
<script> <script>
import { getLeftList, getRightList, addSupplier } from "@/api/quality/qcGoalDistribute"; import { getLeftList, getRightList, addSupplier, getProductLeftList, getProductRightList } from "@/api/quality/qcGoalDistribute";
export default { export default {
name: "QcGoalDistriBute", name: "QcGoalDistriBute",
@ -145,6 +145,7 @@ export default {
total: 0, total: 0,
// //
title: "", title: "",
model: null,
// //
showFlag: false, showFlag: false,
// //
@ -170,7 +171,7 @@ export default {
//---------------------> //--------------------->
leftList: [], leftList: [],
rightList: [], rightList: [],
titles: ["未关联供应商", "已关联供应商"], titles: ["未分配", "已分配"],
// //
Ltotal: "", Ltotal: "",
LPageNum: "1", LPageNum: "1",
@ -221,14 +222,26 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
this.leftQueryParams.belongGoalId = this.belongGoalId; this.leftQueryParams.belongGoalId = this.belongGoalId;
getLeftList(this.leftQueryParams).then((response) => { if(this.model) {
this.LPages = Math.ceil(response.total / this.LPageSize); getLeftList(this.leftQueryParams).then((response) => {
this.leftList = response.rows; this.LPages = Math.ceil(response.total / this.LPageSize);
this.Ltotal = response.total; this.leftList = response.rows;
this.LPageNum = this.leftQueryParams.pageNum; this.Ltotal = response.total;
this.LNextPage = this.leftQueryParams.pageNum + 1; this.LPageNum = this.leftQueryParams.pageNum;
this.loading = false; this.LNextPage = this.leftQueryParams.pageNum + 1;
}); this.loading = false;
});
}else{
getProductLeftList(this.leftQueryParams).then((response) => {
this.LPages = Math.ceil(response.total / this.LPageSize);
this.leftList = response.rows;
this.Ltotal = response.total;
this.LPageNum = this.leftQueryParams.pageNum;
this.LNextPage = this.leftQueryParams.pageNum + 1;
this.loading = false;
});
}
}, },
/**左边上一页**/ /**左边上一页**/
leftPageNumChange() { leftPageNumChange() {
@ -249,23 +262,36 @@ export default {
getRightListFun() { getRightListFun() {
this.loading = true; this.loading = true;
this.rightQueryParams.belongGoalId = this.belongGoalId; this.rightQueryParams.belongGoalId = this.belongGoalId;
getRightList(this.rightQueryParams).then((response) => { if(this.model) {
this.RPages = Math.ceil(response.total / this.RPageSize); getRightList(this.rightQueryParams).then((response) => {
let dataright = []; this.RPages = Math.ceil(response.total / this.RPageSize);
for (let i in response.rows) { let dataright = [];
// 穿 for (let i in response.rows) {
dataright.push(response.rows[i].key); // 穿
} dataright.push(response.rows[i].key);
this.rightList = dataright; }
this.Rtotal = response.total; this.rightList = dataright;
this.RPageNum = this.rightQueryParams.pageNum; this.Rtotal = response.total;
this.RNextPage = this.rightQueryParams.pageNum + 1; this.RPageNum = this.rightQueryParams.pageNum;
this.loading = false; this.RNextPage = this.rightQueryParams.pageNum + 1;
}).catch((error) => { this.loading = false;
console.error('获取右侧列表数据失败:', error); });
this.loading = false; }else{
// getProductRightList(this.rightQueryParams).then((response) => {
}); this.RPages = Math.ceil(response.total / this.RPageSize);
let dataright = [];
for (let i in response.rows) {
// 穿
dataright.push(response.rows[i].key);
}
this.rightList = dataright;
this.Rtotal = response.total;
this.RPageNum = this.rightQueryParams.pageNum;
this.RNextPage = this.rightQueryParams.pageNum + 1;
this.loading = false;
});
}
}, },
/**右边上一页**/ /**右边上一页**/
rightPageNumChange() { rightPageNumChange() {

@ -132,12 +132,19 @@
v-hasPermi="['quality:qcProjectType:remove']" v-hasPermi="['quality:qcProjectType:remove']"
>删除</el-button> >删除</el-button>
<el-button <el-button
v-if="scope.row.goalType == 'yyyy' && scope.row.scope == '0'" v-if="scope.row.goalType == 'yyyy' && scope.row.scope == '0' && scope.row.typeCode == 'material'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-document-add" icon="el-icon-document-add"
@click="handleDistribution(scope.row)" @click="handleSupplier(scope.row)"
>分配</el-button> >分配供应商</el-button>
<el-button
v-if="scope.row.goalType == 'yyyy' && scope.row.scope == '0' && scope.row.typeCode != 'material'"
size="mini"
type="text"
icon="el-icon-document-add"
@click="handleProduct(scope.row)"
>分配产品</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -516,10 +523,20 @@ export default {
const checkTypeBody = this.checkTypes.find((item) => item.id === checkType); const checkTypeBody = this.checkTypes.find((item) => item.id === checkType);
return checkTypeBody ? checkTypeBody.checkName : ''; return checkTypeBody ? checkTypeBody.checkName : '';
}, },
handleDistribution(row) { handleSupplier(row) {
this.goalId = row.id;
this.$refs.itemDistribution.model = true;
this.$refs.itemDistribution.getRightListFun();
this.$refs.itemDistribution.getList();
this.$refs.itemDistribution.title = "分配供应商";
this.$refs.itemDistribution.showFlag = true;
},
handleProduct(row) {
this.goalId = row.id; this.goalId = row.id;
this.$refs.itemDistribution.model = false;
this.$refs.itemDistribution.getRightListFun(); this.$refs.itemDistribution.getRightListFun();
this.$refs.itemDistribution.getList(); this.$refs.itemDistribution.getList();
this.$refs.itemDistribution.title = "分配产品";
this.$refs.itemDistribution.showFlag = true; this.$refs.itemDistribution.showFlag = true;
}, },

Loading…
Cancel
Save