|
|
@@ -14,8 +14,12 @@
|
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
|
:columns="columns"
|
|
|
- :initLoad="false"
|
|
|
- :datasource="datasource"
|
|
|
+ :datasource="
|
|
|
+ type == 'plan'
|
|
|
+ ? preReleaseList.filter((item) => item.preType != 6)
|
|
|
+ : preReleaseList
|
|
|
+ "
|
|
|
+ :needPage="false"
|
|
|
:selection.sync="selection"
|
|
|
row-key="id"
|
|
|
@columns-change="handleColumnChange"
|
|
|
@@ -23,7 +27,11 @@
|
|
|
:page-size="20"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-button type="primary" size="mini" @click="batchKittingComplete"
|
|
|
+ <el-button
|
|
|
+ v-if="type != 'order' && type != 'plan'"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="batchKittingComplete"
|
|
|
>批量齐套检查</el-button
|
|
|
>
|
|
|
</template>
|
|
|
@@ -36,18 +44,16 @@
|
|
|
<span v-if="row.statusStr == '缺料'" style="color: red">{{
|
|
|
row.statusStr
|
|
|
}}</span>
|
|
|
- <span v-else-if="row.statusStr == '不齐套'" style="color: orange">{{
|
|
|
- row.statusStr
|
|
|
- }}</span>
|
|
|
<span v-else style="color: green">{{ row.statusStr }}</span>
|
|
|
</template>
|
|
|
|
|
|
- <template v-slot:action="{ row, $index }">
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
- @click="kittingComplete(row, $index)"
|
|
|
+ @click="kittingComplete(row)"
|
|
|
>
|
|
|
+ <!-- v-if="type == 'plan' || row.preType == '6'" -->
|
|
|
齐套检查
|
|
|
</el-link>
|
|
|
|
|
|
@@ -55,7 +61,7 @@
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
@click="taskAssignment"
|
|
|
- v-if="row.statusStr == '缺料' && row.preType == '6'"
|
|
|
+ v-if="row.statusStr == '缺料' && type == 'plan' && row.preType == '5'"
|
|
|
>
|
|
|
任务派单
|
|
|
</el-link>
|
|
|
@@ -123,11 +129,22 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { completenessCheck, taskReleaseWork } from '@/api/productionPlan';
|
|
|
+ import {
|
|
|
+ completenessCheck,
|
|
|
+ taskReleaseWork,
|
|
|
+ updatePreRelease,
|
|
|
+ updatePreReleaseOrder
|
|
|
+ } from '@/api/productionPlan';
|
|
|
import { listOrganizations, getUserPage } from '@/api/system/organization';
|
|
|
import kittingComplete from './kittingComplete.vue';
|
|
|
export default {
|
|
|
components: { kittingComplete },
|
|
|
+ props: {
|
|
|
+ type: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
// 1主材料 2辅材料 3工装 4工艺文件 5NC代码 6人员
|
|
|
return {
|
|
|
@@ -135,6 +152,7 @@
|
|
|
cacheKeyUrl: 'checkProductionPreparationsKey',
|
|
|
selection: [],
|
|
|
planId: '',
|
|
|
+ preReleaseList: [],
|
|
|
typeList: [
|
|
|
{
|
|
|
value: 1,
|
|
|
@@ -181,7 +199,6 @@
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
- console.log(this.$store.state.user.info, '用户信息');
|
|
|
this.getGs();
|
|
|
},
|
|
|
|
|
|
@@ -216,17 +233,17 @@
|
|
|
align: 'center',
|
|
|
label: '状态'
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'approveDate',
|
|
|
- align: 'center',
|
|
|
- label: '校验时间'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'approveName',
|
|
|
- align: 'center',
|
|
|
- label: '校验人',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // prop: 'approveDate',
|
|
|
+ // align: 'center',
|
|
|
+ // label: '校验时间'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'approveName',
|
|
|
+ // align: 'center',
|
|
|
+ // label: '校验人',
|
|
|
+ // showOverflowTooltip: true
|
|
|
+ // },
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
|
@@ -241,21 +258,22 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- datasource({ page, where, limit }) {
|
|
|
- let pageNum = page;
|
|
|
- let size = limit;
|
|
|
- where.planId = this.planId;
|
|
|
- const res = completenessCheck({ ...where, pageNum, size });
|
|
|
-
|
|
|
- return res;
|
|
|
+ async completenessCheck(planId, apsWorkOrderId) {
|
|
|
+ const params = {
|
|
|
+ planId
|
|
|
+ };
|
|
|
+ if (apsWorkOrderId) {
|
|
|
+ params.apsWorkOrderId = apsWorkOrderId;
|
|
|
+ }
|
|
|
+ this.preReleaseList = await completenessCheck(params);
|
|
|
},
|
|
|
|
|
|
- reload(where) {
|
|
|
- this.$nextTick(() => {
|
|
|
- if (this.$refs.table && this.$refs.table.reload)
|
|
|
- this.$refs.table.reload({ page: 1, where: where });
|
|
|
- });
|
|
|
- },
|
|
|
+ // reload(where) {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // if (this.$refs.table && this.$refs.table.reload)
|
|
|
+ // this.$refs.table.reload({ page: 1, where: where });
|
|
|
+ // });
|
|
|
+ // },
|
|
|
|
|
|
async getGs() {
|
|
|
await listOrganizations().then((list) => {
|
|
|
@@ -275,63 +293,59 @@
|
|
|
open(item) {
|
|
|
this.visible = true;
|
|
|
this.itemData = item;
|
|
|
- this.planId = item.id;
|
|
|
-
|
|
|
- if (this.planId) {
|
|
|
- this.reload();
|
|
|
+ this.preReleaseList = [];
|
|
|
+ if (item.preRelease.length) {
|
|
|
+ this.preReleaseList = item.preRelease;
|
|
|
+ } else {
|
|
|
+ if (item.id && this.type == 'plan') {
|
|
|
+ this.completenessCheck(item.id);
|
|
|
+ } else if (this.type == 'order') {
|
|
|
+ this.completenessCheck(item.productionPlanId, item.id);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
|
handleColumnChange() {},
|
|
|
|
|
|
onClose() {
|
|
|
- this.planId = '';
|
|
|
this.visible = false;
|
|
|
},
|
|
|
|
|
|
handleClose() {
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
- kittingComplete(item, index) {
|
|
|
+ updatePreRelease(item) {
|
|
|
+ if (this.type == 'plan') {
|
|
|
+ updatePreRelease(item);
|
|
|
+ } else if (this.type == 'order') {
|
|
|
+ item.apsWorkOrderId = this.itemData.id;
|
|
|
+ updatePreReleaseOrder(item);
|
|
|
+ }
|
|
|
+ this.$emit('update');
|
|
|
+ },
|
|
|
+ kittingComplete(item) {
|
|
|
if (item.preType == '5' || item.preType == '6') {
|
|
|
this.$confirm('是否确认齐套?', '提示', {
|
|
|
confirmButtonText: '齐套',
|
|
|
cancelButtonText: '不齐套',
|
|
|
- type: 'warning'
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true
|
|
|
})
|
|
|
.then(() => {
|
|
|
- // approveDate: null;
|
|
|
- // approveId: '';
|
|
|
- // approveName: '';
|
|
|
- item.approveDate = this.getNowDate();
|
|
|
item.statusStr = '齐套';
|
|
|
- this.$forceUpdate();
|
|
|
+ this.updatePreRelease(item);
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- item.approveDate = this.getNowDate();
|
|
|
- item.statusStr = '不齐套';
|
|
|
- this.$forceUpdate();
|
|
|
+ .catch((action) => {
|
|
|
+ if (action == 'cancel') {
|
|
|
+ item.statusStr = '缺料';
|
|
|
+ this.updatePreRelease(item);
|
|
|
+ }
|
|
|
});
|
|
|
} else {
|
|
|
const list = [this.itemData];
|
|
|
this.$refs.kittingCompleteRef.open(list);
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- getNowDate() {
|
|
|
- const now = new Date();
|
|
|
- const year = now.getFullYear();
|
|
|
- const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
|
- const day = String(now.getDate()).padStart(2, '0');
|
|
|
- const hour = String(now.getHours()).padStart(2, '0');
|
|
|
- const minute = String(now.getMinutes()).padStart(2, '0');
|
|
|
- const second = String(now.getSeconds()).padStart(2, '0');
|
|
|
-
|
|
|
- const currentTime = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
|
|
-
|
|
|
- return currentTime;
|
|
|
- },
|
|
|
-
|
|
|
taskAssignment() {
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
@@ -385,7 +399,7 @@
|
|
|
|
|
|
await taskReleaseWork({
|
|
|
...this.form,
|
|
|
- productionPlanId: this.itemData.id,
|
|
|
+ productionPlanId: this.itemData.productionPlanId || this.itemData.id,
|
|
|
eventType: 1
|
|
|
})
|
|
|
.then(() => {
|
|
|
@@ -398,7 +412,7 @@
|
|
|
remake: ''
|
|
|
};
|
|
|
this.dialogVisible = false;
|
|
|
- this.reload();
|
|
|
+ // this.reload();
|
|
|
})
|
|
|
.catch(() => {
|
|
|
loading.close();
|