This commit is contained in:
朱菊兰 2024-07-18 11:17:04 +08:00
parent 0f70fe85c8
commit f043a6a0a2
10 changed files with 1727 additions and 1923 deletions

File diff suppressed because it is too large Load Diff

View File

@ -186,16 +186,16 @@ export default {
}, },
], ],
}, },
{ // {
prop: 'oee', // prop: 'oee',
label: 'OEE', // label: 'OEE',
filter: (val) => (val != null ? +val.toFixed(3) : '-'), // filter: (val) => (val != null ? +val.toFixed(3) : '-'),
}, // },
{ // {
prop: 'teep', // prop: 'teep',
label: 'TEEP', // label: 'TEEP',
filter: (val) => (val != null ? +val.toFixed(3) : '-'), // filter: (val) => (val != null ? +val.toFixed(3) : '-'),
}, // },
// { // {
// _action: 'view-trend', // _action: 'view-trend',
// label: '', // label: '',
@ -230,8 +230,9 @@ export default {
type: 'select', type: 'select',
label: '工单', label: '工单',
placeholder: '请选择工单', placeholder: '请选择工单',
param: 'workOrderId', param: 'workOrderId',
selectOptions: [], selectOptions: [],
filterable: true,
}, },
// { // {
// type: 'select', // type: 'select',
@ -252,20 +253,20 @@ export default {
// ], // ],
// index: 2, // index: 2,
// extraOptions: [ // extraOptions: [
{ {
// parent: 'dateFilterType', // parent: 'dateFilterType',
// //
type: 'datePicker', type: 'datePicker',
// label: '', label: '时间段',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
defaultTime: ['00:00:00', '00:00:00'], defaultTime: ['00:00:00', '00:00:00'],
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timerange', param: 'timerange',
}, },
// { // {
// parent: 'dateFilterType', // parent: 'dateFilterType',
// // // //
@ -285,16 +286,16 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
// { {
// type: 'separate', type: 'separate',
// }, },
// { {
// type: 'button', type: 'button',
// btnName: '', btnName: '导出',
// name: 'visualization', name: 'export',
// plain: true, plain: true,
// color: 'success', color: 'success',
// }, },
// { // {
// type: 'button', // type: 'button',
// btnName: 'OEE', // btnName: 'OEE',
@ -315,7 +316,7 @@ export default {
// //
queryParams: { queryParams: {
// lineId: null, // lineId: null,
workOrderId: null, workOrderId: null,
recordTime: [], recordTime: [],
}, },
// //
@ -324,20 +325,20 @@ export default {
}; };
}, },
created() { created() {
this.getWorkOrder() this.getWorkOrder();
// this.getLine(); // this.getLine();
this.getList(); this.getList();
}, },
methods: { methods: {
/** 准备工厂数据 */ /** 准备工厂数据 */
async getWorkOrder() { async getWorkOrder() {
console.log(1111); console.log(1111);
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/base/core-work-order/listbyfilter', url: '/base/core-work-order/listbyfilter',
method: 'get', method: 'get',
}); });
if (code == 0) { if (code == 0) {
console.log('1111', data); console.log('1111', data);
this.searchBarFormConfig[0].selectOptions = data.map((item) => { this.searchBarFormConfig[0].selectOptions = data.map((item) => {
return { return {
name: item.name, name: item.name,
@ -394,7 +395,7 @@ export default {
this.open = true; this.open = true;
} }
if (btnName == 'search') { if (btnName == 'search') {
this.queryParams.workOrderId = payload.workOrderId || null; this.queryParams.workOrderId = payload.workOrderId || null;
// this.queryParams.lineId = payload.lineId || null; // this.queryParams.lineId = payload.lineId || null;
if (0 == payload.dateFilterType) { if (0 == payload.dateFilterType) {
this.queryParams.recordTime = payload.timerange; this.queryParams.recordTime = payload.timerange;

View File

@ -6,16 +6,26 @@
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list"> :formConfigs="formConfig"
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> --> @clickBtn="handleClick" /> -->
</base-table> </base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <pagination
@pagination="getList" /> :limit.sync="listQuery.pageSize"
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> --> :page.sync="listQuery.pageNo"
</div> :total="listQuery.total"
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template> </template>
<script> <script>
@ -24,228 +34,236 @@
// import basicPage from '../mixins/basic-page'; // import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import { import {
getMaterialUseLogPage, getMaterialUseLogPage,
getWorkOrderList, getWorkOrderList,
exportEnergyPlcExcel exportEnergyPlcExcel,
} from '@/api/quality/materialTraceability'; } from '@/api/quality/materialTraceability';
const tableProps = [ const tableProps = [
{ {
prop: 'materialName', prop: 'materialName',
label: '物料名称' label: '物料名称',
}, },
{ {
prop: 'materialCode', prop: 'materialCode',
label: '物料编码' label: '物料编码',
}, },
{ {
prop: 'dateName', prop: 'dateName',
label: '物料批次' label: '物料批次',
}, },
{ {
prop: 'equipName', prop: 'equipName',
label: '使用设备' label: '使用设备',
}, },
{ {
prop: 'num', prop: 'num',
label: '使用数量' label: '使用数量',
}, },
{ {
prop: 'useTime', prop: 'useTime',
label: '使用时间', label: '使用时间',
filter: parseTime filter: parseTime,
}, },
{ {
prop: 'userName', prop: 'userName',
label: '操作人' label: '操作人',
}, },
{ {
prop: 'source', prop: 'source',
label: '数据来源', label: '数据来源',
filter: (val) => val == 1 ? '内部' : '外部' filter: (val) => (val == 1 ? '内部' : '外部'),
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注' label: '备注',
} },
]; ];
export default { export default {
// mixins: [basicPage], // mixins: [basicPage],
data() { data() {
return { return {
// urlOptions: { // urlOptions: {
// getDataListURL: getMaterialUseLogPage, // getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType, // // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel, // // exportURL: exportPackingExcel,
// }, // },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`) this.$auth.hasPermi(`base:packaging-print-log:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:packaging-print-log:delete`) this.$auth.hasPermi(`base:packaging-print-log:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v),
].filter((v) => v), list: [],
list: [], listQuery: {
listQuery: { pageSize: 10,
pageSize: 10, pageNo: 1,
pageNo: 1, total: 0,
total: 0, workOrderId: undefined,
workOrderId: undefined, startTime: undefined,
startTime: undefined, endTime: undefined,
endTime:undefined, },
}, formConfig: [
formConfig: [ {
{ type: 'select',
type: 'select', label: '工单',
label: '工单', selectOptions: [],
selectOptions: [], labelField: 'name',
labelField: 'name', valueField: 'id',
valueField: 'id', param: 'workOrderId',
param: 'workOrderId' },
}, {
{ type: 'datePicker',
type: 'datePicker', label: '时间段',
label: '时间段', dateType: 'daterange',
dateType: 'daterange', format: 'yyyy-MM-dd',
format: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd", rangeSeparator: '-',
rangeSeparator: '-', startPlaceholder: '开始时间',
startPlaceholder: '开始时间', endPlaceholder: '结束时间',
endPlaceholder: '结束时间', param: 'timeVal',
param: 'timeVal', defaultSelect: [],
defaultSelect: [], width: 250,
width: 250 },
}, {
{ type: 'button',
type: 'button', btnName: '查询',
btnName: '搜索', name: 'search',
name: 'search', color: 'primary',
color: 'primary', },
}, {
{ type: 'separate',
type: 'separate', },
}, // {
// { // type: 'separate',
// type: 'separate', // },
// }, // {
// { // type: 'button',
// type: 'button', // btnName: '',
// btnName: '', // name: 'reset',
// name: 'reset', // },
// }, // {
// { // type: 'separate',
// type: 'separate', // },
// }, // {
// { // type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '', // btnName: '',
// btnName: '', // name: 'add',
// name: 'add', // color: 'success',
// color: 'success', // plain: true,
// plain: true, // },
// }, // {
// { // type: 'separate',
// type: 'separate', // type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', // },
// }, {
{ type: this.$auth.hasPermi('monitoring:materiel-date-from:export')
type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '', ? 'button'
btnName: '导出', : '',
name: 'export', btnName: '导出',
color: 'warning', name: 'export',
}, plain: true,
], color: 'success',
}; },
}, ],
components: { };
// AddOrUpdate, },
}, components: {
created() { // AddOrUpdate,
this.getList() },
this.getDict() created() {
}, this.getList();
methods: { this.getDict();
getList() { },
getMaterialUseLogPage({ ...this.listQuery }).then(res => { methods: {
this.list = res.data || [] getList() {
this.listQuery.total = res.data.total || 0 getMaterialUseLogPage({ ...this.listQuery }).then((res) => {
}) this.list = res.data || [];
}, this.listQuery.total = res.data.total || 0;
getDict() { });
// },
// getCustomerList().then((response) => { getDict() {
// console.log(response); //
// this.customerList = response.data // getCustomerList().then((response) => {
// // this.listQuery.total = response.data.total; // console.log(response);
// }) // this.customerList = response.data
// getModelList().then((response) => { // // this.listQuery.total = response.data.total;
// console.log(response); // })
// this.modelList = response.data // getModelList().then((response) => {
// // this.listQuery.total = response.data.total; // console.log(response);
// }) // this.modelList = response.data
getWorkOrderList().then((response) => { // // this.listQuery.total = response.data.total;
// console.log(response); // })
this.formConfig[0].selectOptions = response.data.map((item) => { getWorkOrderList().then((response) => {
return { // console.log(response);
name: item.name, this.formConfig[0].selectOptions = response.data.map((item) => {
id: item.id return {
} name: item.name,
}) id: item.id,
console.log(this.formConfig[0].selectOptions); };
// this.listQuery.total = response.data.total; });
}) console.log(this.formConfig[0].selectOptions);
}, // this.listQuery.total = response.data.total;
handleExport() { });
// },
let params = { ...this.listQuery }; handleExport() {
params.pageNo = undefined; //
params.pageSize = undefined; let params = { ...this.listQuery };
this.$modal.confirm('是否确认导出所有数据项?').then(() => { params.pageNo = undefined;
this.exportLoading = true; params.pageSize = undefined;
return exportEnergyPlcExcel(params); this.$modal
}).then(response => { .confirm('是否确认导出所有数据项?')
this.$download.excel(response, '物料信息追溯 '); .then(() => {
this.exportLoading = false; this.exportLoading = true;
}).catch(() => { }); return exportEnergyPlcExcel(params);
}, })
buttonClick(val) { .then((response) => {
console.log(val) this.$download.excel(response, '物料信息追溯 ');
if (val.btnName === 'search') { this.exportLoading = false;
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined })
// this.queryParams.status = val.status .catch(() => {});
if (val.timeVal && val.timeVal.length != 0 ) { },
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00' buttonClick(val) {
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59' console.log(val);
} else { if (val.btnName === 'search') {
this.listQuery.startTime = undefined this.listQuery.workOrderId = val.workOrderId
this.listQuery.endTime = undefined ? val.workOrderId
} : undefined;
this.getList() // this.queryParams.status = val.status
} else { if (val.timeVal && val.timeVal.length != 0) {
this.handleExport() this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
// this.addOrEditTitle = '' this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
// this.centervisible = true } else {
// this.$nextTick(() => { this.listQuery.startTime = undefined;
// this.$refs.orderAdd.init() this.listQuery.endTime = undefined;
// }) }
} this.getList();
}, } else {
otherMethods(val) { this.handleExport();
this.addOrUpdateVisible = true; // this.addOrEditTitle = ''
this.addOrEditTitle = '详情'; // this.centervisible = true
this.$nextTick(() => { // this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true); // this.$refs.orderAdd.init()
}); // })
}, }
}, },
otherMethods(val) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
},
},
}; };
</script> </script>

View File

@ -6,16 +6,31 @@
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list"> :formConfigs="formConfig"
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" ref="searchBarForm"
@clickBtn="handleClick" /> @headBtnClick="buttonClick" />
</base-table> <base-table
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" :table-props="tableProps"
@pagination="getList" /> :page="listQuery.pageNo"
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> --> :limit="listQuery.pageSize"
</div> :table-data="list">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template> </template>
<script> <script>
@ -24,256 +39,264 @@
// import basicPage from '../mixins/basic-page'; // import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import { import {
getProcessTraceabilityPage, getProcessTraceabilityPage,
getWorkOrderList, getWorkOrderList,
getCoreProduct getCoreProduct,
// exportEnergyPlcExcel // exportEnergyPlcExcel
} from '@/api/quality/processTraceability'; } from '@/api/quality/processTraceability';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '工单名称' label: '工单名称',
}, },
{ {
prop: 'code', prop: 'code',
label: '工单编码' label: '工单编码',
}, },
{ {
prop: 'planProductName', prop: 'planProductName',
label: '产品名' label: '产品名',
}, },
{ {
prop: 'status', prop: 'status',
label: '状态', label: '状态',
filter: (val) => val == 1 ? '等待' : val == 2 ? '激活' : val == 3 ? '暂停' : val == 4 ? '完成' : '作废', filter: (val) =>
}, val == 1
{ ? '等待'
prop: 'startProduceTime', : val == 2
label: '开始生产时间', ? '激活'
filter: parseTime : val == 3
}, ? '暂停'
{ : val == 4
prop: 'finishProduceTime', ? '完成'
label: '结束生产时间', : '作废',
filter: parseTime },
}, {
{ prop: 'startProduceTime',
prop: 'actualQuantity', label: '开始生产时间',
label: '生产数量' filter: parseTime,
}, },
{ {
prop: 'planProductUnit', prop: 'finishProduceTime',
label: '单位', label: '结束生产时间',
filter: publicFormatter('unit_dict') filter: parseTime,
}, },
{ {
prop: 'processFlowName', prop: 'actualQuantity',
label: '工艺名称' label: '生产数量',
}, },
{ {
prop: 'yield', prop: 'planProductUnit',
label: '合格率' label: '单位',
} filter: publicFormatter('unit_dict'),
},
{
prop: 'processFlowName',
label: '工艺名称',
},
{
prop: 'yield',
label: '合格率',
},
]; ];
export default { export default {
// mixins: [basicPage], // mixins: [basicPage],
data() { data() {
return { return {
// urlOptions: { // urlOptions: {
// getDataListURL: getMaterialUseLogPage, // getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType, // // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel, // // exportURL: exportPackingExcel,
// }, // },
tableProps, tableProps,
tableBtn: [ tableBtn: [
// this.$auth.hasPermi(`base:packaging-print-log:update`) // this.$auth.hasPermi(`base:packaging-print-log:update`)
// ? { // ? {
// type: 'edit', // type: 'edit',
// btnName: '', // btnName: '',
// } // }
// : undefined, // : undefined,
{ {
type: 'processDetail', type: 'processDetail',
btnName: '查看工艺详情', btnName: '查看工艺详情',
}, },
].filter((v) => v),
list: [],
listQuery: {
pageSize: 10,
pageNo: 1,
// total: 0,
// orderName: '',
// startTime: undefined,
// endTime:undefined,
},
formConfig: [
{
type: 'select',
label: '工单名称',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'orderName',
filterable: true,
},
{
type: 'datePicker',
label: '工单开始时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
// AddOrUpdate,
},
created() {
this.getList();
this.getDict();
},
methods: {
getList() {
getProcessTraceabilityPage(this.listQuery).then((res) => {
this.list = res.data.list || [];
this.listQuery.total = res.data.total || 0;
});
},
handleClick(val) {
if (val.type === 'processDetail') {
console.log(val);
let specificationsData = '';
getCoreProduct(val.data.planProductId).then((res) => {
console.log(res);
].filter((v) => v), this.$router.push({
list: [], path: 'process-traceability-detail',
listQuery: { query: {
pageSize: 10, id: val.data.processFlowId,
pageNo: 1, orderId: val.data.id,
// total: 0, name: val.data.name,
// orderName: '', specifications: res.data.specifications,
// startTime: undefined, productName: val.data.planProductName,
// endTime:undefined, processFlowName: val.data.processFlowName,
}, // planProductId: val.data.planProductId
formConfig: [ // equipmentName,
{ },
type: 'select', });
label: '工单', });
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'orderName',
filterable: true,
},
{
type: 'datePicker',
label: '工单开始时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: 'separate',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
// AddOrUpdate,
},
created() {
this.getList()
this.getDict()
},
methods: {
getList() {
getProcessTraceabilityPage(this.listQuery).then(res => {
this.list = res.data.list || []
this.listQuery.total = res.data.total || 0
})
},
handleClick(val) {
if (val.type === "processDetail") {
console.log(val);
let specificationsData =''
getCoreProduct(val.data.planProductId).then((res) => {
console.log(res)
this.$router.push({ // this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
path: 'process-traceability-detail', }
query: { },
id: val.data.processFlowId, getDict() {
orderId: val.data.id, //
name: val.data.name, // getCustomerList().then((response) => {
specifications: res.data.specifications, // console.log(response);
productName: val.data.planProductName, // this.customerList = response.data
processFlowName: val.data.processFlowName, // // this.listQuery.total = response.data.total;
// planProductId: val.data.planProductId // })
// equipmentName, // getModelList().then((response) => {
}, // console.log(response);
}); // this.modelList = response.data
}) // // this.listQuery.total = response.data.total;
// })
// this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex) getWorkOrderList().then((response) => {
} // console.log(response);
}, this.formConfig[0].selectOptions = response.data.map((item) => {
getDict() { return {
// name: item.name,
// getCustomerList().then((response) => { id: item.name,
// console.log(response); };
// this.customerList = response.data });
// // this.listQuery.total = response.data.total; console.log(this.formConfig[0].selectOptions);
// }) // this.listQuery.total = response.data.total;
// getModelList().then((response) => { });
// console.log(response); },
// this.modelList = response.data // handleExport() {
// // this.listQuery.total = response.data.total; // //
// }) // let params = { ...this.listQuery };
getWorkOrderList().then((response) => { // params.pageNo = undefined;
// console.log(response); // params.pageSize = undefined;
this.formConfig[0].selectOptions = response.data.map((item) => { // this.$modal.confirm('?').then(() => {
return { // this.exportLoading = true;
name: item.name, // return exportEnergyPlcExcel(params);
id: item.name // }).then(response => {
} // this.$download.excel(response, ' ');
}) // this.exportLoading = false;
console.log(this.formConfig[0].selectOptions); // }).catch(() => { });
// this.listQuery.total = response.data.total; // },
}) buttonClick(val) {
}, console.log(val);
// handleExport() { if (val.btnName === 'search') {
// // this.listQuery.orderName = val.orderName ? val.orderName : undefined;
// let params = { ...this.listQuery }; // this.queryParams.status = val.status
// params.pageNo = undefined; if (val.timeVal && val.timeVal.length != 0) {
// params.pageSize = undefined; this.listQuery.startTime = val.timeVal[0] + ' 00:00:00';
// this.$modal.confirm('?').then(() => { this.listQuery.endTime = val.timeVal[1] + ' 23:59:59';
// this.exportLoading = true; } else {
// return exportEnergyPlcExcel(params); this.listQuery.startTime = undefined;
// }).then(response => { this.listQuery.endTime = undefined;
// this.$download.excel(response, ' '); }
// this.exportLoading = false; this.getList();
// }).catch(() => { }); } else {
// }, // this.handleExport()
buttonClick(val) { // this.addOrEditTitle = ''
console.log(val) // this.centervisible = true
if (val.btnName === 'search') { // this.$nextTick(() => {
this.listQuery.orderName = val.orderName ? val.orderName :undefined // this.$refs.orderAdd.init()
// this.queryParams.status = val.status // })
if (val.timeVal && val.timeVal.length != 0 ) { }
this.listQuery.startTime = val.timeVal[0] + ' 00:00:00' },
this.listQuery.endTime = val.timeVal[1] + ' 23:59:59' otherMethods(val) {
} else { this.addOrUpdateVisible = true;
this.listQuery.startTime = undefined this.addOrEditTitle = '详情';
this.listQuery.endTime = undefined this.$nextTick(() => {
} this.$refs.addOrUpdate.init(val.data.id, true);
this.getList() });
} else { },
// this.handleExport() },
// this.addOrEditTitle = ''
// this.centervisible = true
// this.$nextTick(() => {
// this.$refs.orderAdd.init()
// })
}
},
otherMethods(val) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id, true);
});
},
},
}; };
</script> </script>

View File

@ -6,16 +6,26 @@
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list"> :formConfigs="formConfig"
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> --> @clickBtn="handleClick" /> -->
</base-table> </base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <pagination
@pagination="getList" /> :limit.sync="listQuery.pageSize"
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> --> :page.sync="listQuery.pageNo"
</div> :total="listQuery.total"
@pagination="getList" />
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
</div>
</template> </template>
<script> <script>
@ -25,219 +35,221 @@
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import { import {
getRawMaterialPage, getRawMaterialPage,
getWorkOrderList, getWorkOrderList,
// exportEnergyPlcExcel // exportEnergyPlcExcel
} from '@/api/quality/rawMaterialTraceability'; } from '@/api/quality/rawMaterialTraceability';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime filter: parseTime,
}, width: 150,
{ },
prop: 'material', {
label: '原料名称', prop: 'material',
filter: publicFormatter('material') label: '原料名称',
}, filter: publicFormatter('material'),
{ },
prop: 'origin', {
label: '来源', prop: 'origin',
filter: (val)=>val == 1 ? '内部' : '外部' label: '来源',
}, filter: (val) => (val == 1 ? '内部' : '外部'),
{ },
prop: 'supplierId', {
label: '供应商' prop: 'supplierId',
}, label: '供应商',
{ },
prop: 'batch', {
label: '批次' prop: 'batch',
}, label: '批次',
{ },
prop: 'num', {
label: '数量' prop: 'num',
}, label: '数量',
{ },
prop: 'unit', {
label: '单位', prop: 'unit',
filter: publicFormatter('unit_dict') label: '单位',
} filter: publicFormatter('unit_dict'),
},
]; ];
export default { export default {
// mixins: [basicPage], // mixins: [basicPage],
data() { data() {
return { return {
// urlOptions: { // urlOptions: {
// getDataListURL: getMaterialUseLogPage, // getDataListURL: getMaterialUseLogPage,
// // deleteURL: deletePackingType, // // deleteURL: deletePackingType,
// // exportURL: exportPackingExcel, // // exportURL: exportPackingExcel,
// }, // },
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`) this.$auth.hasPermi(`base:packaging-print-log:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi(`base:packaging-print-log:delete`) this.$auth.hasPermi(`base:packaging-print-log:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v),
].filter((v) => v), list: [],
list: [], listQuery: {
listQuery: { pageSize: 10,
pageSize: 10, pageNo: 1,
pageNo: 1, total: 0,
total: 0, workOrderId: undefined,
workOrderId: undefined, startTime: undefined,
startTime: undefined, endTime: undefined,
endTime:undefined, },
}, formConfig: [
formConfig: [ {
{ type: 'select',
type: 'select', label: '工单',
label: '工单', selectOptions: [],
selectOptions: [], labelField: 'name',
labelField: 'name', valueField: 'id',
valueField: 'id', param: 'workOrderId',
param: 'workOrderId' },
}, // {
// { // type: 'datePicker',
// type: 'datePicker', // label: '',
// label: '', // dateType: 'daterange',
// dateType: 'daterange', // format: 'yyyy-MM-dd',
// format: 'yyyy-MM-dd', // valueFormat: "yyyy-MM-dd",
// valueFormat: "yyyy-MM-dd", // rangeSeparator: '-',
// rangeSeparator: '-', // startPlaceholder: '',
// startPlaceholder: '', // endPlaceholder: '',
// endPlaceholder: '', // param: 'timeVal',
// param: 'timeVal', // defaultSelect: [],
// defaultSelect: [], // width: 250
// width: 250 // },
// }, {
{ type: 'button',
type: 'button', btnName: '搜索',
btnName: '搜索', name: 'search',
name: 'search', color: 'primary',
color: 'primary', },
}, // {
// { // type: 'separate',
// type: 'separate', // },
// }, // {
// { // type: 'button',
// type: 'button', // btnName: '',
// btnName: '', // name: 'reset',
// name: 'reset', // },
// }, // {
// { // type: 'separate',
// type: 'separate', // },
// }, // {
// { // type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '', // btnName: '',
// btnName: '', // name: 'add',
// name: 'add', // color: 'success',
// color: 'success', // plain: true,
// plain: true, // },
// }, // {
// { // type: 'separate',
// type: 'separate', // type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '', // },
// }, // {
// { // type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '', // btnName: '',
// btnName: '', // name: 'export',
// name: 'export', // color: 'warning',
// color: 'warning', // },
// }, ],
], };
}; },
}, components: {
components: { // AddOrUpdate,
// AddOrUpdate, },
}, created() {
created() { this.getList();
this.getList() this.getDict();
this.getDict() },
}, methods: {
methods: { getList() {
getList() { getRawMaterialPage({ ...this.listQuery }).then((res) => {
getRawMaterialPage({ ...this.listQuery }).then(res => { this.list = res.data.records || [];
this.list = res.data.list || [] this.listQuery.total = res.data.total || 0;
this.listQuery.total = res.data.total || 0 });
}) },
}, getDict() {
getDict() { //
// // getCustomerList().then((response) => {
// getCustomerList().then((response) => { // console.log(response);
// console.log(response); // this.customerList = response.data
// this.customerList = response.data // // this.listQuery.total = response.data.total;
// // this.listQuery.total = response.data.total; // })
// }) // getModelList().then((response) => {
// getModelList().then((response) => { // console.log(response);
// console.log(response); // this.modelList = response.data
// this.modelList = response.data // // this.listQuery.total = response.data.total;
// // this.listQuery.total = response.data.total; // })
// }) getWorkOrderList().then((response) => {
getWorkOrderList().then((response) => { // console.log(response);
// console.log(response); this.formConfig[0].selectOptions = response.data.map((item) => {
this.formConfig[0].selectOptions = response.data.map((item) => { return {
return { name: item.name,
name: item.name, id: item.id,
id: item.id };
} });
}) console.log(this.formConfig[0].selectOptions);
console.log(this.formConfig[0].selectOptions); // this.listQuery.total = response.data.total;
// this.listQuery.total = response.data.total; });
}) },
}, // handleExport() {
// handleExport() { // //
// // // let params = { ...this.listQuery };
// let params = { ...this.listQuery }; // params.pageNo = undefined;
// params.pageNo = undefined; // params.pageSize = undefined;
// params.pageSize = undefined; // this.$modal.confirm('?').then(() => {
// this.$modal.confirm('?').then(() => { // this.exportLoading = true;
// this.exportLoading = true; // return exportEnergyPlcExcel(params);
// return exportEnergyPlcExcel(params); // }).then(response => {
// }).then(response => { // this.$download.excel(response, ' ');
// this.$download.excel(response, ' '); // this.exportLoading = false;
// this.exportLoading = false; // }).catch(() => { });
// }).catch(() => { }); // },
// }, buttonClick(val) {
buttonClick(val) { console.log(val);
console.log(val) if (val.btnName === 'search') {
if (val.btnName === 'search') { this.listQuery.workOrderId = val.workOrderId
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined ? val.workOrderId
// this.queryParams.status = val.status : undefined;
// if (val.timeVal && val.timeVal.length != 0 ) { // this.queryParams.status = val.status
// this.listQuery.startTime = val.timeVal[0] + ' 00:00:00' // if (val.timeVal && val.timeVal.length != 0 ) {
// this.listQuery.endTime = val.timeVal[1] + ' 23:59:59' // this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
// } else { // this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
// this.listQuery.startTime = undefined // } else {
// this.listQuery.endTime = undefined // this.listQuery.startTime = undefined
// } // this.listQuery.endTime = undefined
this.getList() // }
} else { this.getList();
// this.handleExport() } else {
// this.addOrEditTitle = '' // this.handleExport()
// this.centervisible = true // this.addOrEditTitle = ''
// this.$nextTick(() => { // this.centervisible = true
// this.$refs.orderAdd.init() // this.$nextTick(() => {
// }) // this.$refs.orderAdd.init()
} // })
}, }
otherMethods(val) { },
this.addOrUpdateVisible = true; otherMethods(val) {
this.addOrEditTitle = '详情'; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.addOrEditTitle = '详情';
this.$refs.addOrUpdate.init(val.data.id, true); this.$nextTick(() => {
}); this.$refs.addOrUpdate.init(val.data.id, true);
}, });
}, },
},
}; };
</script> </script>

View File

@ -6,81 +6,150 @@
--> -->
<template> <template>
<el-form ref="form" :model="innerDataForm" label-width="100px" v-loading="formLoading"> <el-form
<el-row :gutter="20"> ref="form"
<el-col :span="12"> :model="innerDataForm"
<el-form-item label="工单名称" prop="workOrderId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> label-width="100px"
<el-select v-model="innerDataForm.workOrderId" placeholder="请选择工单名称" filterable clearable> v-loading="formLoading">
<el-option v-for="opt in workOrderList" :key="opt.value" :label="opt.label" :value="opt.value" /> <el-row :gutter="20">
</el-select> <el-col :span="12">
</el-form-item> <el-form-item
</el-col> label="工单名称"
<el-col :span="12"> prop="workOrderId"
<el-form-item label="检测内容" prop="inspectionDetId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> <el-select
<el-select v-model="innerDataForm.inspectionDetId" placeholder="请选择检测内容" filterable clearable v-model="innerDataForm.workOrderId"
@change="handleInspectionDetChange"> placeholder="请选择工单名称"
<el-option v-for="opt in inspectionDetList" :key="opt.value" :label="opt.label" :value="opt.value" /> filterable
</el-select> clearable>
</el-form-item> <el-option
</el-col> v-for="opt in workOrderList"
</el-row> :key="opt.value"
<el-row :gutter="20"> :label="opt.label"
<el-col :span="12"> :value="opt.value" />
<el-form-item label="产线" prop="productionLineId" </el-select>
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> </el-form-item>
<el-select v-model="innerDataForm.productionLineId" placeholder="请选择产线" filterable clearable </el-col>
@change="handleProductlineChange"> <el-col :span="12">
<el-option v-for="opt in productionLineList" :key="opt.value" :label="opt.label" :value="opt.value" /> <el-form-item
</el-select> label="检测内容"
</el-form-item> prop="inspectionDetId"
</el-col> :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-col :span="12"> <el-select
<el-form-item label="工段" prop="sectionId" :rules="[{ required: false, message: '不能为空', trigger: 'blur' }]"> v-model="innerDataForm.inspectionDetId"
<el-select v-model="innerDataForm.sectionId" placeholder="请选择工段" clearable filterable placeholder="请选择检测内容"
@change="$emit('update', innerDataForm)"> filterable
<el-option v-for="opt in sectionList" :key="opt.value" :label="opt.label" :value="opt.value" /> clearable
</el-select> @change="handleInspectionDetChange">
</el-form-item> <el-option
</el-col> v-for="opt in inspectionDetList"
</el-row> :key="opt.value"
<el-row :gutter="20"> :label="opt.label"
<el-col :span="12"> :value="opt.value" />
<el-form-item label="检测人员" prop="checkPerson"> </el-select>
<el-input v-model="innerDataForm.checkPerson" clearable @change="$emit('update', innerDataForm)" </el-form-item>
placeholder="请输入检测人员" /> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="产线"
prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.productionLineId"
placeholder="请选择产线"
filterable
clearable
@change="handleProductlineChange">
<el-option
v-for="opt in productionLineList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="工段"
prop="sectionId"
:rules="[{ required: false, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="innerDataForm.sectionId"
placeholder="请选择工段"
clearable
filterable
@change="$emit('update', innerDataForm)">
<el-option
v-for="opt in sectionList"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="检测人" prop="checkPerson">
<el-input
v-model="innerDataForm.checkPerson"
clearable
@change="$emit('update', innerDataForm)"
placeholder="请输入检测人" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检测时间" prop="checkTime" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> <el-form-item
<el-date-picker v-model="innerDataForm.checkTime" type="datetime" placeholder="请选择检测时间" label="检测时间"
value-format="timestamp" @change="$emit('update', innerDataForm)"></el-date-picker> prop="checkTime"
</el-form-item> :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
</el-col> <el-date-picker
</el-row> v-model="innerDataForm.checkTime"
<el-row :gutter="20"> type="datetime"
<el-col :span="12"> placeholder="请选择检测时间"
<el-form-item label="来源" prop="source" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> value-format="timestamp"
<el-select v-model="innerDataForm.source" placeholder="请选择来源" filterable clearable @change="$emit('update', innerDataForm)"></el-date-picker>
@change="$emit('update', innerDataForm)"> </el-form-item>
<el-option v-for="opt in [ </el-col>
{ label: '手动', value: 1 }, </el-row>
{ label: '自动', value: 2 }, <el-row :gutter="20">
]" :key="opt.value" :label="opt.label" :value="opt.value" /> <el-col :span="12">
</el-select> <el-form-item
</el-form-item> label="来源"
</el-col> prop="source"
</el-row> :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-row :gutter="20"> <el-select
<el-col> v-model="innerDataForm.source"
<el-form-item label="备注" prop="remark"> placeholder="请选择来源"
<el-input v-model="innerDataForm.remark" @change="$emit('update', innerDataForm)" placeholder="请输入备注"> filterable
</el-input> clearable
</el-form-item> @change="$emit('update', innerDataForm)">
</el-col> <el-option
</el-row> v-for="opt in [
</el-form> { label: '手动', value: 1 },
{ label: '自动', value: 2 },
]"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="备注" prop="remark">
<el-input
v-model="innerDataForm.remark"
@change="$emit('update', innerDataForm)"
placeholder="请输入备注"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template> </template>
<script> <script>
@ -103,18 +172,20 @@ export default {
formLoading: true, formLoading: true,
inspectionDetList: [], inspectionDetList: [],
productionLineList: [], productionLineList: [],
sectionList: [], sectionList: [],
workOrderList:[], workOrderList: [],
innerDataForm: {}, innerDataForm: {},
cacheInspectionDetList: null, cacheInspectionDetList: null,
}; };
}, },
mounted() { mounted() {
Promise.all([this.getProductLineList(), this.getInspectionDetList(), this.getWorkOrderList()]).then( Promise.all([
() => { this.getProductLineList(),
this.formLoading = false; this.getInspectionDetList(),
} this.getWorkOrderList(),
); ]).then(() => {
this.formLoading = false;
});
}, },
watch: { watch: {
// 'innerDataForm.productionLineId': { // 'innerDataForm.productionLineId': {
@ -165,20 +236,20 @@ export default {
// 线 // 线
async getProductLineList() { async getProductLineList() {
const response = await this.$axios('/base/core-production-line/listAll'); const response = await this.$axios('/base/core-production-line/listAll');
this.productionLineList = response.data.map((item) => ({ this.productionLineList = response.data.map((item) => ({
label: item.name, label: item.name,
value: item.id, value: item.id,
})); }));
}, },
async getWorkOrderList() { async getWorkOrderList() {
const response = await this.$axios('base/core-work-order/listbyfilter'); const response = await this.$axios('base/core-work-order/listbyfilter');
this.workOrderList = response.data.map((item) => ({ this.workOrderList = response.data.map((item) => ({
label: item.name, label: item.name,
value: item.id, value: item.id,
})); }));
}, },
// //
async getInspectionDetList() { async getInspectionDetList() {

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:width="120" :width="80"
fixed="right" fixed="right"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
@ -66,94 +66,22 @@ export default {
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
rows: [
[
{
select: true,
label: '检测内容',
url: '/base/quality-inspection-det/listAll',
prop: 'inspectionDetId',
labelKey: 'content',
rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
bind: {
filterable: true,
},
},
{
select: true,
label: '来源',
prop: 'source',
value: 1, //
options: [
{ label: '手动', value: 1 },
{ label: '自动', value: 2 },
],
bind: {
filterable: true,
},
},
],
[
{
select: true,
label: '产线',
url: '/base/production-line/listAll',
prop: 'productionLineId',
bind: {
filterable: true,
},
rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
},
{
select: true,
label: '工段',
url: '/base/workshop-section/listAll', // url options
options: [], // options, options
prop: 'sectionId',
bind: {
filterable: true,
},
rules: [{ required: false, message: '不能为空', trigger: 'blur' }],
},
],
[
{
input: true,
label: '检测人员',
prop: 'checkPerson',
},
{
datetime: true,
label: '检测时间',
prop: 'checkTime',
rules: [{ required: true, message: '检测时间不能为空', trigger: 'blur' }],
bind: {
format: 'yyyy-MM-dd HH:mm:ss',
'value-format': 'timestamp',
// 'value-format': 'yyyy-MM-dd HH:mm:ss',
clearable: true,
},
},
],
[{ textarea: true, label: '描述', prop: 'explainText' }],
[{ input: true, label: '备注', prop: 'remark' }],
],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'select', type: 'select',
label: '工单名称', label: '工单名称',
placeholder: '请选择工单名称', placeholder: '请选择工单名称',
param: 'workOrderId', param: 'workOrderId',
selectOptions: [], selectOptions: [],
filterable:true filterable: true,
}, },
{ {
type: 'select', type: 'select',
label: '检测内容', label: '检测内容',
placeholder: '请输入检测内容', placeholder: '请输入检测内容',
selectOptions: [], selectOptions: [],
param: 'inspectionDetContent', param: 'inspectionDetContent',
filterable: true filterable: true,
}, },
{ {
type: 'datePicker', type: 'datePicker',
@ -179,9 +107,7 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi( type: this.$auth.hasPermi('base:quality-inspection-record:create')
'base:quality-inspection-record:create'
)
? 'button' ? 'button'
: '', : '',
btnName: '新增', btnName: '新增',
@ -197,7 +123,7 @@ export default {
btnName: '修改', btnName: '修改',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:quality-inspection-record:delete') this.$auth.hasPermi('base:quality-inspection-record:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
@ -211,12 +137,12 @@ export default {
fixed: true, fixed: true,
width: 180, width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ {
// width: 128, // width: 128,
prop: 'workOrderName', prop: 'workOrderName',
label: '工单名称', label: '工单名称',
}, },
{ {
// width: 128, // width: 128,
prop: 'inspectionDetContent', prop: 'inspectionDetContent',
@ -224,7 +150,7 @@ export default {
}, },
{ {
// width: 128, // width: 128,
prop: 'lineName', prop: 'productionLineName',
label: '产线', label: '产线',
}, },
{ {
@ -247,25 +173,25 @@ export default {
}, },
], ],
// keys, queryParams pageNo, pageSize key // keys, queryParams pageNo, pageSize key
searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'], searchBarKeys: ['workOrderId', 'inspectionDetContent', 'checkTime'],
form: { form: {
id: undefined, id: undefined,
inspectionDetId: undefined, inspectionDetId: undefined,
inspectionDetContent: undefined, inspectionDetContent: undefined,
productionLineId: undefined, productionLineId: undefined,
sectionId: undefined, sectionId: undefined,
checkPerson: undefined, checkPerson: undefined,
workOrderId:undefined, workOrderId: undefined,
checkTime: undefined, checkTime: undefined,
source: undefined, source: undefined,
explainText: undefined, workOrderId: undefined,
remark: undefined, remark: undefined,
}, },
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
workOrderId:null, workOrderId: null,
inspectionDetContent: null, inspectionDetContent: null,
checkTime: [], checkTime: [],
// productionLineId: null, // productionLineId: null,
@ -274,43 +200,20 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getProductLineList() this.getProductLineList();
}, },
watch: { watch: {
form: { form: {
handler: function (val) { handler: function (val) {
console.log('form change:', val); console.log('form change:', val);
}, },
deep: true deep: true,
} },
// 线
// 'form.productionLineId': {
// handler: function (val) {
// if (val == null) return;
// this.$axios('/base/workshop-section/listByParentId', {
// params: {
// id: val,
// },
// }).then((response) => {
// this.$set(
// this.rows[1][1], // this.rows
// 'options',
// response.data.map((item) => {
// return {
// label: item.name,
// value: item.id,
// };
// })
// );
// });
// },
// immediate: true,
// },
}, },
methods: { methods: {
/** 获取搜索栏的产线列表 */ /** 获取搜索栏的产线列表 */
getProductLineList() { getProductLineList() {
this.$axios('/base/core-work-order/listbyfilter').then((response) => { this.$axios('/base/core-work-order/listbyfilter').then((response) => {
this.searchBarFormConfig[0].selectOptions = response.data.map( this.searchBarFormConfig[0].selectOptions = response.data.map(
(item) => { (item) => {
return { return {
@ -319,17 +222,17 @@ export default {
}; };
} }
); );
}) });
this.$axios('/base/quality-inspection-det/listAll').then((response) => { this.$axios('/base/quality-inspection-det/listAll').then((response) => {
this.searchBarFormConfig[1].selectOptions = response.data.map( this.searchBarFormConfig[1].selectOptions = response.data.map(
(item) => { (item) => {
return { return {
name: item.content, name: item.content,
id: item.content, id: item.content,
}; };
} }
); );
}); });
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
@ -356,7 +259,7 @@ export default {
checkPerson: undefined, checkPerson: undefined,
checkTime: undefined, checkTime: undefined,
source: undefined, source: undefined,
explainText: undefined, workOrderId: undefined,
remark: undefined, remark: undefined,
productionLineId: undefined, productionLineId: undefined,
}; };
@ -376,7 +279,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = '添加质量检查信息记录表'; this.title = '新增';
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -384,13 +287,13 @@ export default {
const id = row.id; const id = row.id;
getQualityInspectionRecord(id).then((response) => { getQualityInspectionRecord(id).then((response) => {
/** 因为后端返回的时间是时间戳格式,需转换 */ /** 因为后端返回的时间是时间戳格式,需转换 */
const info = {} const info = {};
Object.keys(this.form).forEach(key => { Object.keys(this.form).forEach((key) => {
info[key] = response.data[key] info[key] = response.data[key];
}); });
this.form = info; this.form = info;
this.open = true; this.open = true;
this.title = '修改质量检查信息记录表'; this.title = '编辑';
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */

View File

@ -1,10 +1,3 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-21 14:11:18
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<el-form <el-form
:model="dataForm" :model="dataForm"
@ -18,7 +11,8 @@
<el-select <el-select
v-model="dataForm.workOrderId" v-model="dataForm.workOrderId"
placeholder="请选择工单号" placeholder="请选择工单号"
style="width: 100%"> style="width: 100%"
:disabled="showDetail">
<el-option <el-option
v-for="dict in workOrderList" v-for="dict in workOrderList"
:key="dict.id" :key="dict.id"
@ -28,11 +22,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="班组" prop="teamId"> <el-form-item label="班组" prop="teamId" :disabled="showDetail">
<el-select <el-select
v-model="dataForm.teamId" v-model="dataForm.teamId"
placeholder="请选择班组" placeholder="请选择班组"
style="width: 100%"> style="width: 100%"
:disabled="showDetail">
<el-option <el-option
v-for="dict in teamList" v-for="dict in teamList"
:key="dict.id" :key="dict.id"
@ -43,7 +38,10 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="数量" prop="num" style="width: 100%"> <el-form-item label="数量" prop="num" style="width: 100%">
<el-input v-model="dataForm.num" placeholder="请输入数量" /> <el-input
v-model="dataForm.num"
placeholder="请输入数量"
:disabled="showDetail" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -51,7 +49,8 @@
<el-select <el-select
v-model="dataForm.lineId" v-model="dataForm.lineId"
placeholder="请选择产线" placeholder="请选择产线"
style="width: 100%"> style="width: 100%"
:disabled="showDetail">
<el-option <el-option
v-for="dict in lineList" v-for="dict in lineList"
:key="dict.id" :key="dict.id"
@ -65,7 +64,8 @@
<el-select <el-select
v-model="dataForm.detId" v-model="dataForm.detId"
placeholder="请选择报废原因" placeholder="请选择报废原因"
style="width: 100%"> style="width: 100%"
:disabled="showDetail">
<el-option <el-option
v-for="dict in detList" v-for="dict in detList"
:key="dict.id" :key="dict.id"
@ -79,9 +79,11 @@
<el-date-picker <el-date-picker
v-model="dataForm.logTime" v-model="dataForm.logTime"
type="datetime" type="datetime"
label-format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%" style="width: 100%"
placeholder="选择日期"></el-date-picker> placeholder="选择日期"
:disabled="showDetail"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -89,7 +91,8 @@
<el-select <el-select
v-model="dataForm.source" v-model="dataForm.source"
placeholder="请选择来源" placeholder="请选择来源"
style="width: 100%"> style="width: 100%"
:disabled="showDetail">
<el-option <el-option
v-for="dict in sourceList" v-for="dict in sourceList"
:key="dict.id" :key="dict.id"
@ -100,13 +103,20 @@
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="描述" prop="description"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.description" placeholder="请输入描述" /> <el-input
v-model="dataForm.description"
placeholder="请输入描述"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
:disabled="showDetail" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" /> <el-input
v-model="dataForm.remark"
placeholder="备注"
:disabled="showDetail" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -114,7 +124,6 @@
</template> </template>
<script> <script>
import basicAdd from '../../core/mixins/basic-add';
import { import {
createQualityScrapLog, createQualityScrapLog,
updateQualityScrapLog, updateQualityScrapLog,
@ -124,22 +133,12 @@ import {
getDetList, getDetList,
getLineList, getLineList,
} from '@/api/base/qualityScrapLog'; } from '@/api/base/qualityScrapLog';
import { getList } from '@/api/base/qualityScrapType'; // import { getList } from '@/api/base/qualityScrapType';
// import { getMaterialList } from "@/api/base/material";
import moment from 'moment'; import moment from 'moment';
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
urlOptions: {
isGetCode: false,
// codeURL: getCode,
createURL: createQualityScrapLog,
updateURL: updateQualityScrapLog,
infoURL: getQualityScrapLog,
},
lineList: [], lineList: [],
typeList: [],
workOrderList: [], workOrderList: [],
detList: [], detList: [],
teamList: [], teamList: [],
@ -160,15 +159,12 @@ export default {
detId: undefined, detId: undefined,
workOrderId: null, workOrderId: null,
teamId: undefined, teamId: undefined,
num: undefined, num: null,
lineId: undefined, lineId: undefined,
description: undefined, description: undefined,
// description: undefined,
remark: undefined, remark: undefined,
}, },
// materialList: [],
dataRule: { dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
workOrderId: [ workOrderId: [
{ required: true, message: '工单号不能为空', trigger: 'change' }, { required: true, message: '工单号不能为空', trigger: 'change' },
], ],
@ -181,79 +177,93 @@ export default {
{ required: true, message: '报废时间不能为空', trigger: 'change' }, { required: true, message: '报废时间不能为空', trigger: 'change' },
], ],
}, },
showDetail: false,
}; };
}, },
mounted() { mounted() {
this.getDict(); this.getList();
console.log('我看看', this.dataForm);
this.getCurrentTime();
}, },
methods: { methods: {
getCurrentTime() { init(id, show) {
// new Date().Format("yyyy-MM-dd HH:mm:ss") this.showDetail = show ? true : false;
this.dataForm.logTime = new Date(); this.dataForm.id = id || undefined;
// this.dataForm.logTime = year + "-" + month + "-" + day; if (id) {
console.log(this.dataForm.logTime); //
getQualityScrapLog(id).then((res) => {
console.log(res);
this.dataForm = res.data;
this.dataForm.logTime = res.data.logTime || null;
console.log('==================');
});
} else {
this.dataForm.logTime = moment().format('yyyy-MM-DD hh:mm:ss');
}
}, },
async getDict() { //
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
updateQualityScrapLog(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createQualityScrapLog(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
});
},
getList() {
// //
const res = await getList();
this.typeList = res.data;
getWorkOrderList().then((res) => { getWorkOrderList().then((res) => {
console.log(res); console.log(res);
// console.log(response);
this.workOrderList = res.data.map((item) => { this.workOrderList = res.data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id,
}; };
}); });
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
}); });
getLineList().then((res) => { getLineList().then((res) => {
console.log(res); console.log(res);
// console.log(response);
this.lineList = res.data.map((item) => { this.lineList = res.data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id,
}; };
}); });
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
}); });
getDetList().then((res) => { getDetList().then((res) => {
console.log(res); console.log(res);
// console.log(response);
this.detList = res.data.map((item) => { this.detList = res.data.map((item) => {
return { return {
name: item.content, name: item.content,
id: item.id, id: item.id,
}; };
}); });
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
}); });
getTeamList().then((res) => { getTeamList().then((res) => {
console.log(res); console.log(res);
// console.log(response);
this.teamList = res.data.map((item) => { this.teamList = res.data.map((item) => {
return { return {
name: item.name, name: item.name,
id: item.id, id: item.id,
}; };
}); });
// console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total;
}); });
}, },
// setMaterialCode() { formClear() {
// const chooseM = this.materialList.filter(item => { this.$refs.dataForm.resetFields();
// return item.id === this.dataForm.materialId },
// })
// this.dataForm.materialCode = chooseM[0].code
// }
}, },
}; };
</script> </script>

View File

@ -1,284 +0,0 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-11-07 19:38:13
* @LastEditors: zhp
* @Description:
-->
<template>
<el-dialog
:visible.sync="dialogVisible"
width="50%"
:before-close="handleClose">
<small-title slot="title" :no-padding="true">
{{ '详情' }}
</small-title>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="auto">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="工单号" prop="workOrderId">
<el-select
v-model="dataForm.workOrderId"
placeholder="请选择工单号"
disabled>
<el-option
v-for="dict in workOrderList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班组" prop="teamId">
<el-select
v-model="dataForm.teamId"
placeholder="请选择班组"
disabled>
<el-option
v-for="dict in teamList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数量" prop="sum">
<el-input
v-model="dataForm.sum"
placeholder="请输入数量"
disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<el-select
v-model="dataForm.lineId"
placeholder="请选择产线"
disabled>
<el-option
v-for="dict in lineList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废原因" prop="detId">
<el-select
v-model="dataForm.detId"
placeholder="请选择报废原因"
disabled>
<el-option
v-for="dict in detList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker
v-model="dataForm.logTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
disabled
placeholder="选择日期"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="来源" prop="source">
<el-select
v-model="dataForm.source"
placeholder="请选择来源"
disabled>
<el-option
v-for="dict in sourceList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="描述" prop="description">
<el-input
v-model="dataForm.description"
placeholder="请输入描述"
disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注" disabled />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import basicAdd from '../../core/mixins/basic-add';
import {
createQualityScrapLog,
updateQualityScrapLog,
getQualityScrapLog,
getWorkOrderList,
getTeamList,
getDetList,
getLineList,
} from '@/api/base/qualityScrapLog';
import { getList } from '@/api/base/qualityScrapType';
import SmallTitle from './SmallTitle';
export default {
components: {
SmallTitle,
},
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: false,
// codeURL: getCode,
createURL: createQualityScrapLog,
updateURL: updateQualityScrapLog,
infoURL: getQualityScrapLog,
},
lineList: [],
typeList: [],
workOrderList: [],
detList: [],
teamList: [],
sourceList: [
{
id: 1,
name: '手动',
},
{
id: 2,
name: '自动',
},
],
dialogVisible: false,
dataForm: {
id: undefined,
logTime: undefined,
source: 1,
detId: undefined,
workOrderId: null,
teamId: undefined,
num: undefined,
lineId: undefined,
description: undefined,
// description: undefined,
remark: undefined,
},
// materialList: [],
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
workOrderId: [
{ required: true, message: '工单号不能为空', trigger: 'change' },
],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
detId: [
{ required: true, message: '报废原因不能为空', trigger: 'change' },
],
logTime: [
{ required: true, message: '报废时间不能为空', trigger: 'change' },
],
},
};
},
mounted() {
// this.getDict()
console.log('我看看', this.dataForm);
this.getCurrentTime();
},
methods: {
init() {
this.dialogVisible = true;
},
getCurrentTime() {
// new Date().Format("yyyy-MM-dd HH:mm:ss")
this.dataForm.logTime = new Date();
// this.dataForm.logTime = year + "-" + month + "-" + day;
console.log(this.dataForm.logTime);
},
// async getDict() {
// //
// const res = await getList()
// this.typeList = res.data
// getWorkOrderList().then((res) => {
// console.log(res);
// // console.log(response);
// this.workOrderList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// getLineList().then((res) => {
// console.log(res);
// // console.log(response);
// this.lineList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// getDetList().then((res) => {
// console.log(res);
// // console.log(response);
// this.workOrderList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// getTeamList().then((res) => {
// console.log(res);
// // console.log(response);
// this.teamList = res.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// // console.log(this.formConfig[0].selectOptions);
// // this.listQuery.total = response.data.total;
// })
// },
// setMaterialCode() {
// const chooseM = this.materialList.filter(item => {
// return item.id === this.dataForm.materialId
// })
// this.dataForm.materialCode = chooseM[0].code
// }
},
};
</script>

View File

@ -26,24 +26,32 @@
<base-dialog <base-dialog
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible" :dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="50%"> width="50%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>
<el-row slot="footer" type="flex" justify="end">
<el-col :span="12">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
{{ this.addOrEditTitle === '详情' ? '关闭' : '取消' }}
</el-button>
<el-button
v-show="this.addOrEditTitle !== '详情'"
type="primary"
size="small"
class="btnTextStyle"
@click="handleConfirm">
确定
</el-button>
</el-col>
</el-row>
</base-dialog> </base-dialog>
<detail-or-update
v-if="detailOrUpdateVisible"
ref="detailOrUpdate"
@refreshDataList="successSubmit" />
</div> </div>
</template> </template>
<script> <script>
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import DetailOrUpdate from './detail-or-updata';
import basicPage from '../../core/mixins/basic-page'; import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
@ -114,7 +122,6 @@ export default {
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableData: [], tableData: [],
detailOrUpdateVisible: false,
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
@ -152,11 +159,11 @@ export default {
plain: true, plain: true,
}, },
], ],
showDetail: false,
}; };
}, },
components: { components: {
AddOrUpdate, AddOrUpdate,
DetailOrUpdate,
}, },
created() { created() {
this.getDict(); this.getDict();
@ -164,10 +171,10 @@ export default {
methods: { methods: {
otherMethods(val) { otherMethods(val) {
if (val.type === 'detail') { if (val.type === 'detail') {
this.detailOrUpdateVisible = true; this.addOrEditTitle = '详情';
// this.addOrEditTitle = ""; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id, true); this.$refs.addOrUpdate.init(val.data.id, true);
}); });
} }
}, },