生产管理接口联调

dev-scheduling
jinna 3 months ago
parent 33450c06d0
commit 5519ec49e8
  1. 52
      src/api/productionManagement/productionMonitoring.js
  2. 112
      src/views/productionManagement/components/closedDialog.vue
  3. 150
      src/views/productionManagement/components/productionMonitoringDialog.vue
  4. 125
      src/views/productionManagement/productionMonitoring.vue

@ -12,4 +12,54 @@ export const getList = (current, size, params) => {
});
};
//
// 调整优先级 /
export const updatePrioritye = data => {
return request({
url: '/blade-desk/workOrder/updatePrioritye',
method: 'post',
data: data,
});
};
// 分批
export const inBatches = data => {
return request({
url: '/blade-desk/workOrder/inBatches',
method: 'post',
data: data,
});
};
// 获取分批详情
export const batchesPrepare = woId => {
return request({
url: `/blade-desk/workOrder/batchesPrepare/${woId}`,
method: 'get',
});
};
// 获取转外协所需数据
export const getListProProcess = data => {
return request({
url: '/blade-desk/workOrder/listProProcess',
method: 'post',
data: data,
});
};
// 转外协 /
export const transferBill = data => {
return request({
url: '/blade-desk/workOrder/transferBill',
method: 'post',
data: data,
});
};
// 关闭 /
export const updateStatus = data => {
return request({
url: '/blade-desk/workOrder/updateStatus',
method: 'post',
data: data,
});
};

@ -1,45 +1,91 @@
<template>
<el-dialog title="关闭" append-to-body :modelValue="showClose" @close="closeDialog">
<el-form :model="closeForm" :rules="closeRules" label-width="100px">
<el-form-item label="备注" prop="memo">
<el-input type="textarea" placeholder="请输入备注" v-model="closeForm.memo"></el-input>
<el-dialog title="关闭" append-to-body :modelValue="showClose" @close="closeDialog" width="30%">
<!-- <el-form :model="closeForm" :rules="closeRules" label-width="70px" ref="form">
<el-form-item label="备注" prop="memo">
<el-input type="textarea" placeholder="请输入备注" v-model="closeForm.memo" :rows="4"></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="closeDialog"> </el-button>
</span>
</template>
</el-dialog>
</el-form> -->
<avue-form :option="option" v-model="closeForm" ref="form"></avue-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit()" :loading="loadingBtn"> </el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import { updateStatus } from '@/api/productionManagement/productionMonitoring';
export default {
props: {
showClose: {
type: Boolean,
default: false
},
props: {
showClose: {
type: Boolean,
default: false,
},
data() {
return {
closeForm: {},
closeRules: {
memo:[{required:true,message:'请输入备注',trigger:'blur'}],
}
}
itemData: {
type: Array,
default: [],
},
mounted() {
},
data() {
return {
loadingBtn: false,
closeForm: {},
closeRules: {
memo: [{ required: true, message: '请输入备注', trigger: 'blur' }],
},
option: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: '备注',
prop: 'memo',
type: 'textarea',
span: 24,
rows: 2,
rules: [
{
required: true,
message: '请输入',
trigger: 'blur',
},
],
},
],
},
};
},
mounted() {},
methods: {
//
closeDialog() {
this.$emit('closeDialog');
},
submit() {
this.$refs.form.validate((valid, done, msg) => {
if (valid) {
this.loadingBtn = true;
let query = {
idArr: this.itemData.map(item => item.woId),
status: 0,
memo: this.closeForm.memo,
};
updateStatus(query).then(res => {
this.$message.success('操作成功!');
this.loadingBtn = false;
this.$emit('closeDialog',true);
});
} else {
console.log('error submit!!');
return false;
}
});
},
methods: {
//
closeDialog() {
this.$emit('closeDialog');
},
}
}
},
};
</script>
<style></style>

@ -1,73 +1,97 @@
<template>
<el-dialog title="优先级调整" append-to-body :modelValue="openShow" width="30%" @close="closeDialog">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="当前优先级:">一级</el-form-item>
<el-form-item label="设置优先级:" prop="value1" required>
<el-select v-model="form.value1" placeholder="请选择" >
<el-option
label="一级"
:value="1">
</el-option>
<el-option
label="二级"
:value="2">
</el-option>
<el-option
label="三级"
:value="3">
</el-option>
</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>
<el-dialog
title="优先级调整"
append-to-body
:modelValue="openShow"
width="30%"
@close="closeDialog"
>
<!-- <el-form ref="form" :model="form" label-width="120px">
<el-form-item label="设置优先级:" prop="value1" required>
<el-select v-model="form.value1" placeholder="请选择">
<el-option label="一级" :value="1"> </el-option>
<el-option label="二级" :value="2"> </el-option>
<el-option label="三级" :value="3"> </el-option>
</el-select>
</el-form-item>
</el-form> -->
<avue-form :option="option" ref="form"></avue-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>
<script>
export default {
props: {
showDialog: {
type: Boolean,
default: false
},
props: {
showDialog: {
type: Boolean,
default: false,
},
data() {
return {
openShow:false,
form:{
value1:''
}
}
},
mounted(){
this.openShow = this.showDialog
},
data() {
return {
openShow: false,
form: {
value1: '',
},
option: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: '优先级',
prop: 'name',
type: 'select',
span:24,
dicUrl: '/blade-system/dict/dictionary?code=orderPriority',
props: {
label: 'dictValue',
value: 'dictKey',
},
rules: [
{
required: true,
message: '请选择',
trigger: 'blur',
},
],
},
],
},
};
},
mounted() {
this.openShow = this.showDialog;
},
methods: {
closeDialog() {
this.openShow = false;
this.$emit('closeDialog');
},
methods:{
closeDialog(){
this.openShow = false
this.$emit('closeDialog');
},
submit() {
if (!this.form.value1) {
this.$message.warning('请选择优先级');
return;
}
this.$emit('submitPriority', {
priority: this.form.value1
});
this.closeDialog();
submit() {
//msg
this.$refs.form.validate((valid, done, msg) => {
if (valid) {
this.$emit('submitPriority', this.form);
this.closeDialog();
} else {
console.log('error submit!!');
return false;
}
});
},
},
watch: {
showDialog(val) {
this.openShow = val;
},
watch:{
showDialog(val){
this.openShow = val
} }
}
},
};
</script>
<style lang="scss" scoped></style>

@ -20,7 +20,7 @@
<template #menu-left>
<el-button type="primary" @click="handlePrintTags">过程记录打印</el-button>
<el-button type="primary" @click="handlePrintTags">打印标签</el-button>
<el-button type="primary" @click="priorityFn">优先级调整</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> -->
@ -92,8 +92,6 @@
</el-dropdown-menu> -->
</el-dropdown>
</template>
</avue-crud>
<!-- 打印标签 -->
<el-dialog append-to-body v-model="printDialog" title="打印标签">
@ -128,7 +126,12 @@
<!-- 分批弹窗 -->
<batches-dialog :show-batches="showBatches" @closeDialog="closeDialog"></batches-dialog>
<!-- 关闭弹窗 -->
<closed-dialog :show-close="showClose" @closeDialog="closeDialog"></closed-dialog>
<closed-dialog
v-if="showClose"
:show-close="showClose"
@closeDialog="closeDialog"
:itemData="itemData"
></closed-dialog>
<!-- 退货弹窗 -->
<return-dialog :show-return="showReturn" @closeDialog="closeDialog"></return-dialog>
<!-- 调度标注 -->
@ -138,6 +141,7 @@
></scheduling-dialog>
<!-- 异常处理 -->
<abnormalDialog :show-abnormal="showAbnormal" @closeDialog="closeDialog"></abnormalDialog>
<!-- 优先级调整 -->
<productionMonitoringDialog
:showDialog="isPriorityOpen"
v-if="isPriorityOpen"
@ -157,7 +161,11 @@ import schedulingDialog from './components/schedulingDialog.vue';
import abnormalDialog from './components/abnormalDialog.vue';
import productionMonitoringDialog from './components/productionMonitoringDialog.vue';
import { getList } from '@/api/productionManagement/productionMonitoring';
import {
getList,
updatePrioritye,
updateStatus,
} from '@/api/productionManagement/productionMonitoring';
export default {
components: {
@ -272,42 +280,12 @@ export default {
search: true,
sortable: true,
overHidden: true,
width: 200,
dicData: [
{
value: 2,
label: '待生产',
},
{
value: 3,
label: '生产中',
},
{
value: 4,
label: '检验中',
},
{
value: 6,
label: '审理中',
},
{
value: 5,
label: '工艺变更',
},
{
value: 19,
label: '已返工',
},
{
value: 15,
label: '已完成',
},
{
value: 21,
label: '已作废',
},
],
width: 200, //order_status
dicUrl: '/blade-system/dict/dictionary?code=order_status',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '车间订单号',
@ -472,28 +450,11 @@ export default {
overHidden: true,
width: 200,
searchLabelWidth: 100,
dicData: [
{
value: 1,
label: '正常-白色',
},
{
value: 2,
label: '项目要求日期急件-橙色',
},
{
value: 3,
label: '合同急件-黄色',
},
{
value: 4,
label: '绩效零件-青色',
},
{
value: 5,
label: '调度标注急件-蓝色',
},
],
dicUrl: '/blade-system/dict/dictionary?code=orderPriority',
props: {
label: 'dictValue',
value: 'dictKey',
},
},
{
label: '需求部门',
@ -653,21 +614,32 @@ export default {
},
],
},
itemData: [], //
};
},
mounted() {},
methods: {
//
priorityFn(row) {
this.rowItem = row;
console.log(row.runStatus, 123);
this.itemData = [row];
this.isPriorityOpen = true;
},
priorityFnBatch() {
if (this.selectionList.length == 0) {
return this.$message.error('请先选择数据');
}
this.itemData = this.selectionList;
this.isPriorityOpen = true;
// console.log(runStatus,123)
},
handlePrioritySubmit(data) {
this.$message.success(
`优先级已调整为${data.priority === 1 ? '一级' : data.priority === 2 ? '二级' : '三级'}`
);
console.log('优先级调整', this.itemData);
// updatePrioritye().then(res=>{
// })
// this.$message.success(
// `${data.priority === 1 ? '' : data.priority === 2 ? '' : ''}`
// );
},
selectionChange(val) {
this.selectionList = val;
@ -705,9 +677,11 @@ export default {
this.showScheduling = true;
},
//
handleClose() {
handleClose(row) {
this.itemData = [row];
this.showClose = true;
},
//
handleSintering() {
this.$confirm('确定将此订单转到烧结中心吗?', '是否继续', {
@ -760,7 +734,7 @@ export default {
this.showAbnormal = true;
},
//
closeDialog() {
closeDialog(type) {
this.showDialog = false;
this.monitorDialog = false;
this.showBatches = false;
@ -769,6 +743,9 @@ export default {
this.showScheduling = false;
this.showAbnormal = false;
this.isPriorityOpen = false;
if (type) {
this.onLoad(this.page, this.query);
}
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
@ -799,7 +776,11 @@ export default {
},
onLoad(page, params = {}) {
// this.loading = true;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query, { yieldType: 1 })
).then(res => {
this.data = res.data.data.records;
// this.loading = false;
this.page.total = res.data.data.total;

Loading…
Cancel
Save