|
@@ -499,8 +499,38 @@
|
|
|
style="margin-top: 20px"
|
|
style="margin-top: 20px"
|
|
|
></header-title>
|
|
></header-title>
|
|
|
|
|
|
|
|
|
|
+ <template
|
|
|
|
|
+ v-if="
|
|
|
|
|
+ form.itemType == 2 &&
|
|
|
|
|
+ form.recordRulesClassify == 10 &&
|
|
|
|
|
+ form.workOrderId &&
|
|
|
|
|
+ form.produceTaskId &&
|
|
|
|
|
+ form.ruleId &&
|
|
|
|
|
+ form.produceRoutingId
|
|
|
|
|
+ "
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-tabs v-model="statisticsType" type="card">
|
|
|
|
|
+ <el-tab-pane
|
|
|
|
|
+ v-for="i in statisticsTypeList"
|
|
|
|
|
+ :label="i.label"
|
|
|
|
|
+ :name="i.value"
|
|
|
|
|
+ :key="i.value"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ </el-tabs>
|
|
|
|
|
+ <statistics
|
|
|
|
|
+ ref="statisticsRef"
|
|
|
|
|
+ :details.sync="form.details"
|
|
|
|
|
+ :statisticsType="statisticsType"
|
|
|
|
|
+ :produceTaskId="form.produceTaskId"
|
|
|
|
|
+ :workOrderId="form.workOrderId"
|
|
|
|
|
+ :routingId="form.produceRoutingId"
|
|
|
|
|
+ :ruleId="form.ruleId"
|
|
|
|
|
+ ></statistics>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
<ele-pro-table
|
|
<ele-pro-table
|
|
|
- v-if="form.itemType == 2"
|
|
|
|
|
|
|
+ v-if="form.itemType == 2 && form.recordRulesClassify != 10"
|
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
|
ref="table"
|
|
ref="table"
|
|
|
row-key="id"
|
|
row-key="id"
|
|
@@ -610,65 +640,33 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-else v-slot:footer>
|
|
<template v-else v-slot:footer>
|
|
|
- <template
|
|
|
|
|
- v-if="
|
|
|
|
|
- ($hasPermission('mes:producetaskrulerecord:tempsu') ||
|
|
|
|
|
- $hasPermission('mes:producetaskrulerecord:tempsus')) &&
|
|
|
|
|
- form.executeMethod == '1'
|
|
|
|
|
- "
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="save"
|
|
|
|
|
+ :loading="butLoading"
|
|
|
|
|
+ :disabled="form.executeStatus == 2"
|
|
|
|
|
+ >保存</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button
|
|
|
|
|
- v-if="$hasPermission('mes:producetaskrulerecord:tempsu')"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="save"
|
|
|
|
|
- :loading="butLoading"
|
|
|
|
|
- :disabled="form.executeStatus != 0"
|
|
|
|
|
- >保存</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
|
|
|
- <el-button
|
|
|
|
|
- v-if="$hasPermission('mes:producetaskrulerecord:tempsus')"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="submit"
|
|
|
|
|
- :loading="butLoading"
|
|
|
|
|
- >执行</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </template>
|
|
|
|
|
- <template
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="submit('submit')"
|
|
|
|
|
+ :loading="butLoading"
|
|
|
|
|
+ :disabled="form.executeStatus == 2"
|
|
|
|
|
+ >报工</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+
|
|
|
|
|
+ <el-button
|
|
|
v-if="
|
|
v-if="
|
|
|
- ($hasPermission('mes:producetaskrecordrulesrecord:saveorupdate') ||
|
|
|
|
|
- $hasPermission('mes:producetaskrecordrulesrecord:sus')) &&
|
|
|
|
|
- form.executeMethod == '2'
|
|
|
|
|
|
|
+ $hasPermission('mes:producetaskrecordrulesrecord:res') &&
|
|
|
|
|
+ form.executeStatus == 2
|
|
|
"
|
|
"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="submit('submit-reset')"
|
|
|
|
|
+ :loading="butLoading"
|
|
|
|
|
+ >重新报工</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button
|
|
|
|
|
- v-if="$hasPermission('mes:producetaskrecordrulesrecord:saveorupdate')"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="save"
|
|
|
|
|
- :loading="butLoading"
|
|
|
|
|
- >保存</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button
|
|
|
|
|
- v-if="$hasPermission('mes:producetaskrecordrulesrecord:sus')"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="submit"
|
|
|
|
|
- :loading="butLoading"
|
|
|
|
|
- >执行</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </template>
|
|
|
|
|
-
|
|
|
|
|
- <template v-if="form.executeMethod == '3'">
|
|
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="save"
|
|
|
|
|
- :loading="butLoading"
|
|
|
|
|
- :disabled="form.executeStatus != 0"
|
|
|
|
|
- >保存</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button type="primary" @click="submit" :loading="butLoading"
|
|
|
|
|
- >执行</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+
|
|
|
<el-button @click="handleClose" :loading="butLoading">取 消</el-button>
|
|
<el-button @click="handleClose" :loading="butLoading">取 消</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -743,13 +741,15 @@
|
|
|
getById as producetaskrulerecordGetById,
|
|
getById as producetaskrulerecordGetById,
|
|
|
queryListByWorkOrderId,
|
|
queryListByWorkOrderId,
|
|
|
saveOrUpdate,
|
|
saveOrUpdate,
|
|
|
- saveOrUpdateAndSubmit
|
|
|
|
|
|
|
+ saveOrUpdateAndSubmit,
|
|
|
|
|
+ resetSubmit
|
|
|
} from '@/api/producetaskrecordrulesrecord/index.js';
|
|
} from '@/api/producetaskrecordrulesrecord/index.js';
|
|
|
import bpmDetail from '@/views/bpm/processInstance/detail.vue';
|
|
import bpmDetail from '@/views/bpm/processInstance/detail.vue';
|
|
|
import bpmTask from '@/components/bpmTask/bpmTask.vue';
|
|
import bpmTask from '@/components/bpmTask/bpmTask.vue';
|
|
|
import { getFactoryarea } from '@/api/aps/index';
|
|
import { getFactoryarea } from '@/api/aps/index';
|
|
|
import { getTeam } from '@/api/produce/job.js';
|
|
import { getTeam } from '@/api/produce/job.js';
|
|
|
import material from '@/views/produce/components/prenatalExamination/material.vue';
|
|
import material from '@/views/produce/components/prenatalExamination/material.vue';
|
|
|
|
|
+ import statistics from '@/views/produce/components/prenatalExamination/statistics.vue';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'editModal',
|
|
name: 'editModal',
|
|
@@ -767,7 +767,8 @@
|
|
|
toolModal,
|
|
toolModal,
|
|
|
bpmDetail,
|
|
bpmDetail,
|
|
|
bpmTask,
|
|
bpmTask,
|
|
|
- material
|
|
|
|
|
|
|
+ material,
|
|
|
|
|
+ statistics
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
|
// 1-产前准备,2-过程监测,3-产后检查
|
|
// 1-产前准备,2-过程监测,3-产后检查
|
|
@@ -1024,6 +1025,13 @@
|
|
|
{ label: '原材料', value: 1 },
|
|
{ label: '原材料', value: 1 },
|
|
|
{ label: '在制品', value: 2 },
|
|
{ label: '在制品', value: 2 },
|
|
|
{ label: 'BOM标准产出', value: 3 }
|
|
{ label: 'BOM标准产出', value: 3 }
|
|
|
|
|
+ ],
|
|
|
|
|
+ // 1-成品统计,2-物料统计,3-工序统计"
|
|
|
|
|
+ statisticsType: '1',
|
|
|
|
|
+ statisticsTypeList: [
|
|
|
|
|
+ { label: '成品统计', value: '1' },
|
|
|
|
|
+ { label: '物料统计', value: '2' },
|
|
|
|
|
+ { label: '工序统计', value: '3' }
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -1161,6 +1169,7 @@
|
|
|
console.log('data 详情', data);
|
|
console.log('data 详情', data);
|
|
|
this.$util.assignObject(this.form, data);
|
|
this.$util.assignObject(this.form, data);
|
|
|
this.form.details = this.form.details.map((i) => {
|
|
this.form.details = this.form.details.map((i) => {
|
|
|
|
|
+ i.checkUsersIds = i.checkUsers.map((j) => j.userId);
|
|
|
return {
|
|
return {
|
|
|
...i,
|
|
...i,
|
|
|
toolNames: i.tools.map((i) => i.toolName).join(',')
|
|
toolNames: i.tools.map((i) => i.toolName).join(',')
|
|
@@ -1212,6 +1221,7 @@
|
|
|
handleClose() {
|
|
handleClose() {
|
|
|
this.form = JSON.parse(JSON.stringify(this.formBaseData));
|
|
this.form = JSON.parse(JSON.stringify(this.formBaseData));
|
|
|
this.produceTaskList = [];
|
|
this.produceTaskList = [];
|
|
|
|
|
+ this.statisticsType = '1';
|
|
|
this.details = null;
|
|
this.details = null;
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$refs.formRef.clearValidate();
|
|
this.$refs.formRef.clearValidate();
|
|
@@ -1304,6 +1314,7 @@
|
|
|
this.form.specification = workOrder.specification;
|
|
this.form.specification = workOrder.specification;
|
|
|
this.form.formingNum = workOrder.formingNum;
|
|
this.form.formingNum = workOrder.formingNum;
|
|
|
this.form.brandNo = workOrder.brandNo;
|
|
this.form.brandNo = workOrder.brandNo;
|
|
|
|
|
+ this.form.produceRoutingId = workOrder.produceRoutingId;
|
|
|
this.getProductTaskList(workOrder.id);
|
|
this.getProductTaskList(workOrder.id);
|
|
|
} else {
|
|
} else {
|
|
|
this.workOrderInfo = null;
|
|
this.workOrderInfo = null;
|
|
@@ -1316,6 +1327,7 @@
|
|
|
this.form.specification = null;
|
|
this.form.specification = null;
|
|
|
this.form.formingNum = null;
|
|
this.form.formingNum = null;
|
|
|
this.form.brandNo = '';
|
|
this.form.brandNo = '';
|
|
|
|
|
+ this.form.produceRoutingId = '';
|
|
|
|
|
|
|
|
this.produceTaskList = [];
|
|
this.produceTaskList = [];
|
|
|
}
|
|
}
|
|
@@ -1361,7 +1373,7 @@
|
|
|
this.getListByWorkOrderId();
|
|
this.getListByWorkOrderId();
|
|
|
},
|
|
},
|
|
|
// 执行
|
|
// 执行
|
|
|
- submit() {
|
|
|
|
|
|
|
+ submit(type = '') {
|
|
|
this.$refs.formRef.validate(async (valid) => {
|
|
this.$refs.formRef.validate(async (valid) => {
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
return '';
|
|
return '';
|
|
@@ -1379,12 +1391,7 @@
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
} else if (this.form.executeMethod == 2) {
|
|
} else if (this.form.executeMethod == 2) {
|
|
|
- // 验证产出物数量;
|
|
|
|
|
- const valid = this.$refs.materialRef.validateOutputQuantities();
|
|
|
|
|
- if (!valid) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- this.releaseRulesSaveOrSubmit('submit');
|
|
|
|
|
|
|
+ this.releaseRulesSaveOrSubmit(type);
|
|
|
} else {
|
|
} else {
|
|
|
// 任务确认
|
|
// 任务确认
|
|
|
this.saveRuleRecord();
|
|
this.saveRuleRecord();
|
|
@@ -1441,7 +1448,11 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 报工需要验证 缓存不验证 排除 recordRulesClassify ==4 物料添加 的情况
|
|
// 报工需要验证 缓存不验证 排除 recordRulesClassify ==4 物料添加 的情况
|
|
|
- if (type == 'submit' && this.form.recordRulesClassify != '4') {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ type.includes('submit') &&
|
|
|
|
|
+ this.form.recordRulesClassify != '4' &&
|
|
|
|
|
+ this.form.recordRulesClassify != '10'
|
|
|
|
|
+ ) {
|
|
|
// 验证检查项目
|
|
// 验证检查项目
|
|
|
const detailRequired = this.form.details.some((i) => {
|
|
const detailRequired = this.form.details.some((i) => {
|
|
|
return (
|
|
return (
|
|
@@ -1458,6 +1469,22 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (this.$refs.materialRef) {
|
|
|
|
|
+ // 验证产出物数量;
|
|
|
|
|
+ const valid = this.$refs.materialRef.validateOutputQuantities();
|
|
|
|
|
+ if (!valid) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.$refs.statisticsRef && type != 'cache') {
|
|
|
|
|
+ // 验证统计项目
|
|
|
|
|
+ const valid = this.$refs.statisticsRef.validateStatisticsFilled();
|
|
|
|
|
+ if (!valid) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const body = JSON.parse(JSON.stringify(this.form));
|
|
const body = JSON.parse(JSON.stringify(this.form));
|
|
|
|
|
|
|
|
// 工时小时转毫秒
|
|
// 工时小时转毫秒
|
|
@@ -1470,6 +1497,9 @@
|
|
|
if (type == 'submit') {
|
|
if (type == 'submit') {
|
|
|
await saveOrUpdateAndSubmit(body);
|
|
await saveOrUpdateAndSubmit(body);
|
|
|
this.$message.success('报工成功!');
|
|
this.$message.success('报工成功!');
|
|
|
|
|
+ } else if (type == 'submit-reset') {
|
|
|
|
|
+ await resetSubmit(body);
|
|
|
|
|
+ this.$message.success('重新报工成功!');
|
|
|
} else {
|
|
} else {
|
|
|
const id = await saveOrUpdate(body);
|
|
const id = await saveOrUpdate(body);
|
|
|
this.form.id = id;
|
|
this.form.id = id;
|
|
@@ -1565,7 +1595,12 @@
|
|
|
row.toolNames = '';
|
|
row.toolNames = '';
|
|
|
},
|
|
},
|
|
|
async getListByWorkOrderId(type = '') {
|
|
async getListByWorkOrderId(type = '') {
|
|
|
- if (!this.form.produceTaskId || this.reportWorkType != 2) return;
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ !this.form.produceTaskId ||
|
|
|
|
|
+ this.reportWorkType != 2 ||
|
|
|
|
|
+ this.form.itemType != 2
|
|
|
|
|
+ )
|
|
|
|
|
+ return;
|
|
|
// 查询物料信息
|
|
// 查询物料信息
|
|
|
const materialObject = await queryListByWorkOrderId({
|
|
const materialObject = await queryListByWorkOrderId({
|
|
|
workOrderId: this.form.workOrderId,
|
|
workOrderId: this.form.workOrderId,
|
|
@@ -1576,10 +1611,10 @@
|
|
|
|
|
|
|
|
console.log('materialObject 物料信息', materialObject);
|
|
console.log('materialObject 物料信息', materialObject);
|
|
|
if (type == '') {
|
|
if (type == '') {
|
|
|
- this.addForm.outputDetails = materialObject.outputDetails;
|
|
|
|
|
- this.addForm.pickDetails = materialObject.pickDetails.map((i) => {
|
|
|
|
|
|
|
+ this.form.outputDetails = materialObject.outputDetails;
|
|
|
|
|
+ this.form.pickDetails = materialObject.pickDetails.map((i) => {
|
|
|
// 物料清单中如果存在则 selected 设置为 true
|
|
// 物料清单中如果存在则 selected 设置为 true
|
|
|
- const any = this.addForm.outputDetails.find(
|
|
|
|
|
|
|
+ const any = this.form.outputDetails.find(
|
|
|
(j) => j.categoryId === i.categoryId
|
|
(j) => j.categoryId === i.categoryId
|
|
|
);
|
|
);
|
|
|
if (any) {
|
|
if (any) {
|
|
@@ -1593,10 +1628,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (type == 'output') {
|
|
if (type == 'output') {
|
|
|
- this.addForm.outputDetails = materialObject.outputDetails;
|
|
|
|
|
- this.addForm.pickDetails = this.addForm.pickDetails.map((i) => {
|
|
|
|
|
|
|
+ this.form.outputDetails = materialObject.outputDetails;
|
|
|
|
|
+ this.form.pickDetails = this.form.pickDetails.map((i) => {
|
|
|
// 物料清单中如果存在则 selected 设置为 true
|
|
// 物料清单中如果存在则 selected 设置为 true
|
|
|
- const any = this.addForm.outputDetails.find(
|
|
|
|
|
|
|
+ const any = this.form.outputDetails.find(
|
|
|
(j) => j.categoryId === i.categoryId
|
|
(j) => j.categoryId === i.categoryId
|
|
|
);
|
|
);
|
|
|
if (any) {
|
|
if (any) {
|