生产管理接口联调

dev-scheduling
zhangdi 3 months ago
parent c8f5dad79d
commit d439bbd2c3
  1. 197
      src/views/productionManagement/components/abnormalDialog.vue
  2. 204
      src/views/productionManagement/components/batchesDialog.vue
  3. 7330
      src/views/productionManagement/components/outsourceDialog.vue
  4. 130
      src/views/productionManagement/productionMonitoring.vue

@ -1,98 +1,137 @@
<template> <template>
<el-dialog title="异常申报" append-to-body :modelValue="showAbnormal" @close="closeDialog" class="dialog"> <el-dialog
title="异常申报"
<el-form :model="batchesForm" :rules="batchesRules" label-width="100px" class="form" ref="batchesFormRef"> append-to-body
<el-form-item class="icon-right"> :modelValue="showAbnormal"
<el-popover placement="right-start" :width="200" trigger="hover" append-to-body="false" @close="closeDialog"
content="需要重新排产订单会释放已排产资源,在人工处理异常后进行排产"> class="dialog"
<template #reference> width="30%"
<img src="@/assets/question_mark.png" alt="说明" class="img" /> >
</template> <el-form
</el-popover> :model="batchesForm"
</el-form-item> :rules="batchesRules"
<el-form-item label="异常描述" prop="memo"> label-width="100px"
<el-input type="textarea" placeholder="请输入异常描述" v-model="batchesForm.memo"></el-input> class="form"
</el-form-item> ref="batchesFormRef"
<el-form-item label="重新排产" prop="radio"> >
<el-radio-group v-model="batchesForm.radio"> <el-form-item class="icon-right">
<el-radio v-model="radio" label="1">需要</el-radio> <el-popover
<el-radio v-model="radio" label="2">不需要</el-radio> placement="right-start"
</el-radio-group> :width="200"
</el-form-item> trigger="hover"
<el-form-item label="当前工序" prop="currentProcess"> append-to-body="false"
<el-radio-group v-model="batchesForm.currentProcess"> content="需要重新排产订单会释放已排产资源,在人工处理异常后进行排产"
<el-radio v-model="radio" label="1">已完成</el-radio> >
<el-radio v-model="radio" label="2">未完成</el-radio> <template #reference>
</el-radio-group> <img src="@/assets/question_mark.png" alt="说明" class="img" />
</el-form-item> </template>
</el-form> </el-popover>
<template #footer> </el-form-item>
<span class="dialog-footer"> <el-form-item label="异常描述" prop="memo">
<el-button @click="closeDialog"> </el-button> <el-input
<el-button type="primary" @click="closeDialog"> </el-button> type="textarea"
</span> placeholder="请输入异常描述"
</template> v-model="batchesForm.memo"
</el-dialog> ></el-input>
</el-form-item>
<el-form-item label="重新排产" prop="radio">
<el-radio-group v-model="batchesForm.radio">
<el-radio v-model="radio" label="1">需要</el-radio>
<el-radio v-model="radio" label="2">不需要</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="当前工序" prop="currentProcess">
<el-radio-group v-model="batchesForm.currentProcess">
<el-radio v-model="radio" label="1">已完成</el-radio>
<el-radio v-model="radio" label="2">未完成</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit()"> </el-button>
</span>
</template>
</el-dialog>
</template> </template>
<script> <script>
import { inBatches } from '@/api/productionManagement/productionMonitoring';
export default { export default {
props: { props: {
showAbnormal: { showAbnormal: {
type: Boolean, type: Boolean,
default: false default: false,
},
}, },
data() { itemData: {
return { type: Array,
isOpen: false, default: () => [],
batchesForm: {},
batchesRules: {
memo: [{ required: true, message: '请输入异常描述', trigger: 'blur' }],
radio: [{ required: true, message: '请选择分批原因', trigger: 'blur' }],
currentProcess: [{ required: true, message: '请选择当前工序', trigger: 'blur' }],
}
}
}, },
mounted() { },
data() {
return {
isOpen: false,
batchesForm: {},
batchesRules: {
memo: [{ required: true, message: '请输入异常描述', trigger: 'blur' }],
radio: [{ required: true, message: '请选择分批原因', trigger: 'blur' }],
currentProcess: [{ required: true, message: '请选择当前工序', trigger: 'blur' }],
},
};
},
mounted() {},
methods: {
//
closeDialog() {
this.$emit('closeDialog');
this.$refs.batchesForm.resetFields();
this.$refs.batchesForm.clearValidate();
}, },
methods: { submit() {
// this.$refs.batchesForm.validate(valid => {
closeDialog() { if (valid) {
this.$emit('closeDialog'); // inBatches(this.batchesForm).then((res) => {
this.$refs.batchesForm.resetFields() // if (res.code == 200) {
this.$refs.batchesForm.clearValidate() // this.$message.success('');
}, // this.closeDialog();
} // }
} // });
} else {
console.log('error submit!!');
return false;
}
});
},
},
};
</script> </script>
<style scoped> <style scoped>
.icon-right { .icon-right {
position: relative !important; position: relative !important;
display: block !important; display: block !important;
text-align: left !important; text-align: left !important;
height: auto !important; height: auto !important;
overflow: visible !important; overflow: visible !important;
} }
.icon-right .img { .icon-right .img {
position: absolute !important; position: absolute !important;
right: 10px !important; right: 10px !important;
top: 50% !important; top: 50% !important;
transform: translateY(-50%) !important; transform: translateY(-50%) !important;
width: 20px !important; width: 20px !important;
height: 20px !important; height: 20px !important;
cursor: pointer; cursor: pointer;
display: inline-block !important; display: inline-block !important;
background: #fff; background: #fff;
} }
.icon-right .el-form-item__content { .icon-right .el-form-item__content {
margin-left: 0 !important; margin-left: 0 !important;
width: 100% !important; width: 100% !important;
text-align: left !important; text-align: left !important;
} }
</style>
</style>

@ -1,110 +1,132 @@
<template> <template>
<el-dialog title="分批" append-to-body :modelValue="showBatches" @close="closeDialog" class="dialog"> <el-dialog
title="分批"
<el-form :model="batchesForm" :rules="batchesRules" label-width="100px" class="form" ref="batchesForm"> append-to-body
<el-form-item class="icon-right"> :modelValue="showBatches"
<el-popover placement="right-start" :width="200" trigger="hover" append-to-body="false"> @close="closeDialog"
<p>(1)返工:分批后剩余数量零件依据返工订单进行生产</p> class="dialog"
<p>(2)关闭:分批后自动关闭剩余数量零件的生产</p> width="25%"
<p>(3)其他:分批后剩余数量零件排产后进行生产</p> >
<template #reference> <el-form
<img src="@/assets/question_mark.png" alt="说明" class="img" /> :model="batchesForm"
</template> :rules="batchesRules"
</el-popover> label-width="100px"
</el-form-item> class="form"
<el-form-item label="分批数量" prop="makeQty"> ref="batchesForm"
<el-input placeholder="请输入分批数量" v-model="batchesForm.makeQty" type="number" >
oninput="value=value.replace(/[^\d]/g,'')"></el-input> <el-form-item class="icon-right">
</el-form-item> <el-popover placement="right-start" :width="200" trigger="hover" append-to-body="false">
<!-- <el-form-item label="车间订单号" prop="woCode"> <p>(1)返工分批后剩余数量零件依据返工订单进行生产</p>
<el-input disabled placeholder="请输入车间订单号" v-model="batchesForm.woCode"></el-input> <p>(2)关闭分批后自动关闭剩余数量零件的生产</p>
</el-form-item> <p>(3)其他分批后剩余数量零件排产后进行生产</p>
<el-form-item label="流程卡号" prop="cardNo"> <template #reference>
<el-input disabled placeholder="请输入流程卡号" v-model="batchesForm.cardNo"></el-input> <img src="@/assets/question_mark.png" alt="说明" class="img" />
</el-form-item> </template>
<el-form-item label="批次号" prop="batchNo"> </el-popover>
<el-input disabled placeholder="请输入批次号" v-model="batchesForm.batchNo"></el-input> </el-form-item>
</el-form-item> <el-form-item label="分批数量" prop="makeQty">
<el-form-item label="备注" prop="memo"> <!-- <el-input
<el-input type="textarea" placeholder="请输入备注" v-model="batchesForm.memo"></el-input> placeholder="请输入分批数量"
</el-form-item> --> v-model="batchesForm.makeQty"
<el-form-item label="分批原因" prop="reason"> type="number"
<el-select placeholder="请选择分批原因" v-model="batchesForm.reason"> oninput="value=value.replace(/[^\d]/g,'')"
<el-option value="1" label="返工"></el-option> ></el-input> -->
<el-option value="2" label="关闭"></el-option> <el-input-number
<el-option value="3" label="其他"></el-option> v-model="batchesForm.makeQty"
</el-select> controls-position="right"
</el-form-item> :min="1"
</el-form> ></el-input-number>
<template #footer> </el-form-item>
<span class="dialog-footer"> <el-form-item label="分批原因" prop="reason">
<el-button @click="closeDialog"> </el-button> <el-select placeholder="请选择分批原因" v-model="batchesForm.reason">
<el-button type="primary" @click="closeDialog"> </el-button> <el-option value="1" label="返工"></el-option>
</span> <el-option value="2" label="关闭"></el-option>
</template> <el-option value="3" label="其他"></el-option>
</el-dialog> </el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit()"> </el-button>
</span>
</template>
</el-dialog>
</template> </template>
<script> <script>
import { inBatches } from '@/api/productionManagement/productionMonitoring';
export default { export default {
props: { props: {
showBatches: { showBatches: {
type: Boolean, type: Boolean,
default: false default: false,
},
}, },
data() { itemData: {
return { type: Array,
isOpen: false, default: () => [],
batchesForm: {},
batchesRules: {
makeQty: [{ required: true, message: '请输入分批数量', trigger: 'blur' }],
reason: [{ required: true, message: '请选择分批原因', trigger: 'blur' }],
// woCode:[{required:true,message:'',trigger:'blur'}],
// cardNo:[{required:true,message:'',trigger:'blur'}],
// batchNo:[{required:true,message:'',trigger:'blur'}],
}
}
}, },
mounted() { },
data() {
return {
isOpen: false,
batchesForm: {},
batchesRules: {
makeQty: [{ required: true, message: '请输入分批数量', trigger: 'blur' }],
reason: [{ required: true, message: '请选择分批原因', trigger: 'blur' }],
},
};
},
mounted() {},
methods: {
//
closeDialog() {
this.$emit('closeDialog');
this.$refs.batchesForm.resetFields();
}, },
methods: { submit() {
// this.$refs.batchesForm.validate(valid => {
closeDialog() { if (valid) {
this.$emit('closeDialog') // inBatches(this.batchesForm).then((res) => {
this.$refs.batchesForm.resetFields() // if (res.code == 200) {
}, // this.$message.success('');
} // this.closeDialog();
} // }
// });
} else {
console.log('error submit!!');
return false;
}
});
},
},
};
</script> </script>
<style scoped> <style scoped>
.icon-right { .icon-right {
position: relative !important; position: relative !important;
display: block !important; display: block !important;
text-align: left !important; text-align: left !important;
height: auto !important; height: auto !important;
overflow: visible !important; overflow: visible !important;
} }
.icon-right .img { .icon-right .img {
position: absolute !important; position: absolute !important;
right: 10px !important; right: 10px !important;
top: 50% !important; top: 50% !important;
transform: translateY(-50%) !important; transform: translateY(-50%) !important;
width: 20px !important; width: 20px !important;
height: 20px !important; height: 20px !important;
cursor: pointer; cursor: pointer;
display: inline-block !important; display: inline-block !important;
background: #fff; background: #fff;
} }
.icon-right .el-form-item__content { .icon-right .el-form-item__content {
margin-left: 0 !important; margin-left: 0 !important;
width: 100% !important; width: 100% !important;
text-align: left !important; text-align: left !important;
} }
</style>
</style>

@ -20,76 +20,42 @@
<template #menu-left> <template #menu-left>
<el-button type="primary" @click="handlePrintTags">过程记录打印</el-button> <el-button type="primary" @click="handlePrintTags">过程记录打印</el-button>
<el-button type="primary" @click="handlePrintTags">打印标签</el-button> <el-button type="primary" @click="handlePrintTags">打印标签</el-button>
<el-button type="primary" @click="priorityFnBatch">优先级调整</el-button>
<!-- <el-button type="primary" icon="el-icon-printer" plain @click="handlePrint">打印</el-button>
<el-button type="primary" icon="el-icon-monitor" @click="handleOutsource(null, 'all')">批量外协</el-button> -->
<!-- <el-button type="success" icon="el-icon-download">导出</el-button> -->
</template> </template>
<template #menu-right> <template #menu-right>
<el-button type="success" plain @click="queryOrdersHandle('3,4,5,6')">在制品</el-button> <el-button type="primary" plain @click="queryOrdersHandle('3,4,5,6')">在制品</el-button>
<el-button type="warning" plain @click="queryOrdersHandle('3')">加工中</el-button> <el-button type="warning" plain @click="queryOrdersHandle('3')">加工中</el-button>
<el-button type="danger" plain @click="queryOrdersHandle('4')">检验中</el-button> <el-button type="danger" plain @click="queryOrdersHandle('4')">检验中</el-button>
<el-button type="success" plain @click="queryOrdersHandle('15')">已完工</el-button> <el-button type="success" plain @click="queryOrdersHandle('15')">已完工</el-button>
<el-button type="primary" @click="queryOrdersHandle('')">全部</el-button>
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button type="text" @click="clickProduction(scope.row)">生产监控</el-button> <el-button type="text" @click="clickProduction(scope.row)">生产监控</el-button>
<el-button type="text" @click="handleClose(scope.row)" v-show="scope.row.runStatus < 15" <el-button type="text" @click="priorityFn(scope.row)" v-if="scope.row.runStatus === 2"
>关闭</el-button >优先级调整</el-button
>
<el-button
type="text"
@click="handleBatches(scope.row)"
v-if="[2, 3, 4, 6].includes(scope.row.runStatus)"
>分批</el-button
>
<el-button
type="text"
@click="handleAbnormal(scope.row)"
v-if="scope.row.runStatus === 3 || scope.row.runStatus === 4"
>异常申报</el-button
>
<el-button
type="text"
@click="handleOutsource(scope.row)"
v-if="scope.row.runStatus <= 6 && scope.row.runStatus !== 5"
>转外协</el-button
> >
<!-- <el-button type="text">打印</el-button> -->
<el-dropdown <el-button type="text" @click="handleClose(scope.row)" v-if="scope.row.runStatus < 15"
@command="handleCommand" >关闭</el-button
style="margin-top: 4px; margin-left: 12px"
v-show="
scope.row.approvalStatus != 2 &&
scope.row.oemType === -1 &&
scope.row.runStatus < 15 &&
scope.row.runStatus !== 5
"
> >
<span class="el-dropdown-link" style="color: #284c89; cursor: pointer">
更多<i class="el-icon-arrow-down el-icon--right" />
</span>
<template #dropdown>
<el-dropdown-menu>
<!-- <el-dropdown-item @click="handleIssued(scope.row)"
v-show="scope.row.runStatus === 1">下达</el-dropdown-item> -->
<!-- 分批按钮状态2346显示 -->
<el-dropdown-item
@click="handleBatches(scope.row)"
v-if="[2, 3, 4, 6].includes(scope.row.runStatus)"
>分批</el-dropdown-item
>
<el-dropdown-item
@click="handleOutsource(scope.row)"
v-if="scope.row.runStatus <= 6 && scope.row.runStatus !== 5"
>外协</el-dropdown-item
>
<!-- <el-dropdown-item @click="handleReturn(scope.row)"
v-show="scope.row.runStatus === 2">退货</el-dropdown-item> -->
<!-- <el-dropdown-item @click="handleScheduling(scope.row)"
v-show="scope.row.runStatus < 15 && scope.row.priority != 5">调度标注</el-dropdown-item> -->
<!-- <el-dropdown-item @click="handleClose(scope.row)" v-show="scope.row.runStatus < 15">关闭</el-dropdown-item> -->
<!-- <el-dropdown-item @click="handleSintering(scope.row)"
v-show="scope.row.runStatus < 15">转烧结</el-dropdown-item> -->
<el-dropdown-item @click="priorityFn(scope.row)" v-if="scope.row.runStatus === 2"
>优先级调整</el-dropdown-item
>
<el-dropdown-item
@click="handleAbnormal(scope.row)"
v-if="scope.row.runStatus === 3 || scope.row.runStatus === 4"
>异常申报</el-dropdown-item
>
</el-dropdown-menu>
</template>
<!-- <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-show="scope.row.runStatus === 1"
:command="composeValue('send', scope.row)">下达</el-dropdown-item>
</el-dropdown-menu> -->
</el-dropdown>
</template> </template>
</avue-crud> </avue-crud>
<!-- 打印标签 --> <!-- 打印标签 -->
@ -112,8 +78,10 @@
</el-dialog> </el-dialog>
<!-- 转外协弹窗 --> <!-- 转外协弹窗 -->
<outsource-dialog <outsource-dialog
:show-dialog="showDialog" v-if="showOemDialog"
:show-dialog="showOemDialog"
:show-radio="showRadio" :show-radio="showRadio"
:itemData="itemData"
@closeDialog="closeDialog" @closeDialog="closeDialog"
></outsource-dialog> ></outsource-dialog>
<!-- 生产监控 --> <!-- 生产监控 -->
@ -123,24 +91,25 @@
@closeDialog="closeDialog" @closeDialog="closeDialog"
></production-dialog> ></production-dialog>
<!-- 分批弹窗 --> <!-- 分批弹窗 -->
<batches-dialog :show-batches="showBatches" @closeDialog="closeDialog"></batches-dialog> <batches-dialog
v-if="showBatches"
:show-batches="showBatches"
:itemData="itemData"
@closeDialog="closeDialog"
></batches-dialog>
<!-- 关闭弹窗 --> <!-- 关闭弹窗 -->
<closed-dialog <closed-dialog
v-if="showClose" v-if="showClose"
:show-close="showClose" :show-close="showClose"
@closeDialog="closeDialog" @closeDialog="closeDialog"
:itemData="itemData" :itemData="itemData"
></closed-dialog> ></closed-dialog>
<!-- 退货弹窗 -->
<return-dialog :show-return="showReturn" @closeDialog="closeDialog"></return-dialog>
<!-- 调度标注 -->
<scheduling-dialog
:show-scheduling="showScheduling"
@closeDialog="closeDialog"
></scheduling-dialog>
<!-- 异常处理 --> <!-- 异常处理 -->
<abnormalDialog :show-abnormal="showAbnormal" @closeDialog="closeDialog"></abnormalDialog> <abnormalDialog
v-if="showAbnormal"
:show-abnormal="showAbnormal"
@closeDialog="closeDialog"
></abnormalDialog>
<!-- 优先级调整 --> <!-- 优先级调整 -->
<productionMonitoringDialog <productionMonitoringDialog
:showDialog="isPriorityOpen" :showDialog="isPriorityOpen"
@ -161,9 +130,7 @@ import schedulingDialog from './components/schedulingDialog.vue';
import abnormalDialog from './components/abnormalDialog.vue'; import abnormalDialog from './components/abnormalDialog.vue';
import productionMonitoringDialog from './components/productionMonitoringDialog.vue'; import productionMonitoringDialog from './components/productionMonitoringDialog.vue';
import { import { getList } from '@/api/productionManagement/productionMonitoring';
getList,
} from '@/api/productionManagement/productionMonitoring';
export default { export default {
components: { components: {
@ -180,7 +147,7 @@ export default {
return { return {
isPriorityOpen: false, isPriorityOpen: false,
showAbnormal: false, showAbnormal: false,
showDialog: false, showOemDialog: true,
showRadio: true, showRadio: true,
monitorDialog: false, monitorDialog: false,
showBatches: false, showBatches: false,
@ -562,9 +529,13 @@ export default {
value: -1, value: -1,
label: '场内', label: '场内',
}, },
{
value: 1,
label: '整单',
},
{ {
value: 2, value: 2,
label: '外协', label: '协',
}, },
], ],
}, },
@ -648,10 +619,12 @@ export default {
if (this.selectionList.length == 0) { if (this.selectionList.length == 0) {
this.$message.error('请先选择数据'); this.$message.error('请先选择数据');
} else { } else {
this.showDialog = true; this.itemData = this.selectionList;
this.showOemDialog = true;
} }
} else { } else {
this.showDialog = true; this.itemData = [row];
this.showOemDialog = true;
} }
}, },
// 退 // 退
@ -667,7 +640,8 @@ export default {
}).then(() => {}); }).then(() => {});
}, },
// //
handleBatches() { handleBatches(row) {
this.itemData = [row];
this.showBatches = true; this.showBatches = true;
}, },
// //
@ -733,7 +707,7 @@ export default {
}, },
// //
closeDialog(type) { closeDialog(type) {
this.showDialog = false; this.showOemDialog = false;
this.monitorDialog = false; this.monitorDialog = false;
this.showBatches = false; this.showBatches = false;
this.showClose = false; this.showClose = false;

Loading…
Cancel
Save