生产执行改动

This commit is contained in:
shijing 2023-12-06 17:41:10 +08:00
parent c0ea8b80a9
commit 700f04aa13
9 changed files with 1367 additions and 198 deletions

View File

@ -5,9 +5,9 @@
<el-header> <el-header>
<div class="'left-panel'"> <div class="'left-panel'">
<el-button type="primary" icon="el-icon-plus" @click="utaskCreate" <el-button type="primary" icon="el-icon-plus" @click="utaskCreate"
v-auth="'utask.create'">新增任务</el-button> v-auth="'utask.create'">新增任务</el-button>
<el-button type="primary" @click="utaskDepuse" v-loading="isLoading" <el-button type="primary" @click="utaskDepuse" v-loading="isLoading"
v-auth="'utask.assgin'">任务分解并下达</el-button> v-auth="'utask.assgin'">任务分解并下达</el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -77,7 +77,7 @@
</el-container> </el-container>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<el-container> <!-- <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<span style="font-size: 14px">生产进度</span> <span style="font-size: 14px">生产进度</span>
@ -112,8 +112,9 @@
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container> -->
<GanttComponent class="left-container" :tasks="tasks" :start_date="start_date">
</GanttComponent>
</el-main> </el-main>
</el-container> </el-container>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false"> <showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false">
@ -124,11 +125,13 @@
<script> <script>
import saveDialog from "./utask_form.vue"; import saveDialog from "./utask_form.vue";
import showDrawer from "./mtask_drawer.vue" import showDrawer from "./mtask_drawer.vue"
import GanttComponent from '@/components/GanttComponent.vue';
export default { export default {
name: 'utask_dept10', name: 'utask_dept10',
components: { components: {
saveDialog, saveDialog,
showDrawer showDrawer,
GanttComponent
}, },
data() { data() {
return { return {
@ -139,6 +142,9 @@ export default {
dialog: { dialog: {
save: false, save: false,
}, },
tasks: {
data: []
},
apiUtask: null, apiUtask: null,
apiObj: null, apiObj: null,
visibleRecord: false, visibleRecord: false,
@ -153,6 +159,7 @@ export default {
30: "生产中", 30: "生产中",
40: "已提交", 40: "已提交",
}, },
start_date:''
} }
}, },
mounted() { mounted() {
@ -160,16 +167,60 @@ export default {
}, },
methods: { methods: {
initDept() { initDept() {
this.$API.system.dept.list.req({ page: 0, name: '10车间' }).then(res => { let that = this;
that.$API.system.dept.list.req({ page: 0, name: '10车间' }).then(res => {
if (res.length == 1) { if (res.length == 1) {
this.currentDept = res[0] that.currentDept = res[0]
this.paramsUtask.belong_dept = this.currentDept.id that.paramsUtask.belong_dept = that.currentDept.id
this.apiUtask = this.$API.pm.utask.list that.apiUtask = that.$API.pm.utask.list;
that.getGantt();
} else { } else {
this.$message.error("未找到车间"); that.$message.error("未找到车间");
} }
}) })
}, },
getGantt(){
let that = this;
that.$API.pm.utask.list.req(that.paramsUtask).then(res=>{
let list = res.results;
let data = [];
list.forEach(item=>{
let start_date = item.start_date;
let end_date = item.end_date;
let objItem = {};
objItem.id = item.id;
objItem.type = 'utask';
objItem.number = item.number;
objItem.count = item.count;
objItem.text = item.number;
objItem.material_name = item.material_.name;
objItem.material_specification = item.material_.specification;
objItem.material_model = item.material_.model;
objItem.progress = item.count_real / item.count;;
objItem.count_ok = item.count_ok;
objItem.count_real = item.count_real;
objItem.count_notok = item.count_notok;
objItem.state = item.state;
objItem.start_date = start_date;
objItem.mgroup_name = item.mgroup_name;
objItem.open = true;
let oneDay = 24 * 60 * 60 * 1000; //
let firstDate = new Date(start_date);
let secondDate = new Date(end_date);
let timeDiff = Math.abs(secondDate.getTime()-firstDate.getTime());
let daysDiff = Math.ceil(timeDiff / oneDay);
objItem.duration = daysDiff+1;
data.push(objItem)
that.start_date = start_date;
console.log('objItemduration',objItem.duration)
})
that.tasks.data = data;
gantt.parse(that.tasks);
//
gantt.refreshData();
})
},
utaskDepuse() { utaskDepuse() {
let that = this; let that = this;
if (that.selectedIds.length > 0) { if (that.selectedIds.length > 0) {
@ -252,33 +303,33 @@ export default {
this.$refs.showDrawer.open(); this.$refs.showDrawer.open();
}); });
}, },
rowclick(val) { // rowclick(val) {
let utask = val.id; // let utask = val.id;
this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => { // this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
let columList = []; // let columList = [];
res.forEach((item) => { // res.forEach((item) => {
let obj = {}; // let obj = {};
obj.id = item.id // obj.id = item.id
obj.state = item.state; // obj.state = item.state;
obj.count_b = 0 // obj.count_b = 0
obj.count_y = 0 // obj.count_y = 0
item.mlogs.forEach((item2) => { // item.mlogs.forEach((item2) => {
if (item2.shift_name.indexOf('白班')) { // if (item2.shift_name.indexOf('')) {
obj.count_b = item2.count_ok // obj.count_b = item2.count_ok
} // }
else if (item2.shift_name.indexOf('夜班')) { // else if (item2.shift_name.indexOf('')) {
obj.count_y = item2.count_ok // obj.count_y = item2.count_ok
} // }
}) // })
obj.count_ok = item.count_ok // obj.count_ok = item.count_ok
obj.count = item.count; // obj.count = item.count;
obj.start_date = item.start_date; // obj.start_date = item.start_date;
columList.push(obj); // columList.push(obj);
}); // });
this.mtaskList = columList // this.mtaskList = columList
this.utaskList = [val] // this.utaskList = [val]
}); // });
}, // },
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },

View File

@ -77,7 +77,7 @@
</el-container> </el-container>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<el-container> <!-- <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<span style="font-size: 14px">生产进度</span> <span style="font-size: 14px">生产进度</span>
@ -111,8 +111,9 @@
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container> -->
<GanttComponent class="left-container" :tasks="tasks" :start_date="start_date">
</GanttComponent>
</el-main> </el-main>
</el-container> </el-container>
<showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false"> <showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false">
@ -122,12 +123,14 @@
</template> </template>
<script> <script>
import saveDialog from "./utask_form.vue"; import saveDialog from "./utask_form.vue";
import showDrawer from "./mtask_drawer.vue" import showDrawer from "./mtask_drawer.vue";
import GanttComponent from '@/components/GanttComponent.vue';
export default { export default {
name: 'utask_dept7', name: 'utask_dept7',
components: { components: {
saveDialog, saveDialog,
showDrawer showDrawer,
GanttComponent
}, },
data() { data() {
return { return {
@ -138,6 +141,9 @@ export default {
dialog: { dialog: {
save: false, save: false,
}, },
tasks: {
data: []
},
apiUtask: null, apiUtask: null,
apiObj: null, apiObj: null,
visibleRecord: false, visibleRecord: false,
@ -152,6 +158,7 @@ export default {
30: "生产中", 30: "生产中",
40: "已提交", 40: "已提交",
}, },
start_date:''
} }
}, },
mounted() { mounted() {
@ -159,16 +166,60 @@ export default {
}, },
methods: { methods: {
initDept() { initDept() {
this.$API.system.dept.list.req({ page: 0, name: '7车间' }).then(res => { let that = this;
that.$API.system.dept.list.req({ page: 0, name: '7车间' }).then(res => {
if (res.length == 1) { if (res.length == 1) {
this.currentDept = res[0] that.currentDept = res[0];
this.paramsUtask.belong_dept = this.currentDept.id that.paramsUtask.belong_dept = that.currentDept.id;
this.apiUtask = this.$API.pm.utask.list that.apiUtask = that.$API.pm.utask.list;
that.getGantt();
} else { } else {
this.$message.error("未找到车间"); that.$message.error("未找到车间");
} }
}) })
}, },
getGantt(){
let that = this;
that.$API.pm.utask.list.req(that.paramsUtask).then(res=>{
let list = res.results;
let data = [];
list.forEach(item=>{
let start_date = item.start_date;
let end_date = item.end_date;
let objItem = {};
objItem.id = item.id;
objItem.type = 'utask';
objItem.number = item.number;
objItem.count = item.count;
objItem.text = item.number;
objItem.material_name = item.material_.name;
objItem.material_specification = item.material_.specification;
objItem.material_model = item.material_.model;
objItem.progress = item.count_real / item.count;;
objItem.count_ok = item.count_ok;
objItem.count_real = item.count_real;
objItem.count_notok = item.count_notok;
objItem.state = item.state;
objItem.start_date = start_date;
objItem.mgroup_name = item.mgroup_name;
objItem.open = true;
let oneDay = 24 * 60 * 60 * 1000; //
let firstDate = new Date(start_date);
let secondDate = new Date(end_date);
let timeDiff = Math.abs(secondDate.getTime()-firstDate.getTime());
let daysDiff = Math.ceil(timeDiff / oneDay);
objItem.duration = daysDiff+1;
data.push(objItem)
that.start_date = start_date;
console.log('objItemduration',objItem.duration)
})
that.tasks.data = data;
gantt.parse(that.tasks);
//
gantt.refreshData();
})
},
utaskDepuse() { utaskDepuse() {
let that = this; let that = this;
if (that.selectedIds.length > 0) { if (that.selectedIds.length > 0) {
@ -251,24 +302,24 @@ export default {
this.$refs.showDrawer.open(); this.$refs.showDrawer.open();
}); });
}, },
rowclick(val) { // rowclick(val) {
let utask = val.id; // let utask = val.id;
this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => { // this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
let columList = []; // let columList = [];
res.forEach((item) => { // res.forEach((item) => {
let obj = {}; // let obj = {};
obj.id = item.id // obj.id = item.id
obj.state = item.state; // obj.state = item.state;
obj.count_ok = item.count_ok // obj.count_ok = item.count_ok
obj.count = item.count; // obj.count = item.count;
obj.start_date = item.start_date; // obj.start_date = item.start_date;
obj.rate = ((item.count_ok / item.count) * 100).toFixed(0) + '%'; // obj.rate = ((item.count_ok / item.count) * 100).toFixed(0) + '%';
columList.push(obj); // columList.push(obj);
}); // });
this.mtaskList = columList // this.mtaskList = columList
this.utaskList = [val] // this.utaskList = [val]
}); // });
}, // },
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },

View File

@ -0,0 +1,566 @@
<template>
<el-dialog
:title="titleMap[mode]"
v-model="visible"
width="1000px"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-width="120px"
>
<el-row>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="工段" prop="material">
<el-select
v-model="form.mgroup"
placeholder="工段"
clearable
style="width: 100%"
@change="getRouteOptions"
>
<el-option
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="生产路线" prop="material_out">
<el-select
v-model="form.material_out"
placeholder="生产路线"
clearable
style="width: 100%"
>
<el-option
v-for="item in routeOptions"
:key="item.id"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="产品编号">
<el-select
v-model="form.batch"
style="width: 100%">
<el-option
v-for="item in batchOptions"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
style="width: 100%">
<el-option
v-for="item in equipmentOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item prop="type" label="操作人">
<el-select
v-model="form.handle_user"
placeholder="操作人"
clearable
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="领用数量">
<el-input-number
v-model="form.count_use"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="请输入领用数量"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="加工数量">
<el-input-number
v-model="form.count_real"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="请输入加工数量"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="合格数">
<el-input-number
v-model="form.count_ok"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="请输入合格数"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班次" prop="material">
<el-select
v-model="form.shift"
placeholder="班次"
clearable
style="width: 100%"
>
<el-option
v-for="item in shiftOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="操作日期" prop="handle_date">
<el-date-picker
v-model="form.handle_date"
type="date"
placeholder="操作日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
<div class="formTitle">不合格原因及数量:</div>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="椭圆/弯曲">
<el-input-number
v-model="form.count_n_wq"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="椭圆/弯曲"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="炸纹">
<el-input-number
v-model="form.count_n_zw"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="炸纹"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="条纹">
<el-input-number
v-model="form.count_n_tw"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="条纹"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="气泡">
<el-input-number
v-model="form.count_n_qp"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="气泡"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="断裂">
<el-input-number
v-model="form.count_n_dl"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="断裂"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="偏壁">
<el-input-number
v-model="form.count_n_pb"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="偏壁"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="大小头">
<el-input-number
v-model="form.count_n_dxt"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="大小头"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="结石气绒">
<el-input-number
v-model="form.count_n_jsqx"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="结石气绒"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="其他">
<el-input-number
v-model="form.count_n_qt"
controls-position="right"
:min="0"
:step="1"
:step-strictly="true"
style="width: 100%"
placeholder="其他"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer>
<el-button type="primary" v-loading="isSaveing" @click="submit"
>确定</el-button
>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-dialog>
</template>
<script>
export default {
emits: ["success", "closed"],
props: {
mgroup:{ type: String, default: "" },
mtask: { type: String, default: "" },
mgroupId: { type: String, default: "" },
material_out: { type: String, default: "" },
},
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增记录",
edit: "编辑记录",
},
form: {
shift:'',
batch:'',
count_ok: 0,
count_real: 0,
count_use: 0,
count_notok: 0,
handle_date:'',
count_n_zw:'',
count_n_tw:'',
count_n_qp:'',
count_n_wq:'',
count_n_dl:'',
count_n_pb:'',
count_n_dxt:'',
count_n_jsqx:'',
count_n_qt:'',
handle_user:''
},
mlogb: [],
userList: [],
batchOptions:[],
mgroupOptions: [],
materialOptions: [],
equipmentOptions: [],
shiftOptions: [],
routeOptions:[],
visible: false,
isSaveing: false,
setFiltersVisible: false,
handle_name: "",
leader_name: "",
count_n_all: null,
rules:{
},
};
},
mounted() {
this.getBatchs();
this.getUserList();
this.getEquipment();
this.getShiftOptions();
// let date = new Date();
// let year = date.getFullYear();
// let month = date.getMonth() + 1;
// let day = date.getDate();
// this.form.handle_date = year + "-" + month + "-" + day;
this.form.material_out = this.material_out;
this.form.mgroup = this.mgroup;
},
methods: {
getRouteOptions() {
this.$API.mtm.route.list.req({ page: 0, mgroup: this.form.mgroup}).then(res => {
for (var i = 0; i < res.length; i++) {
if (res[i].material_in == null) {
res[i].material_in_name = ''
}
if (res[i].material_out == null) {
res[i].material_out_name = ''
}
res[i].label = res[i].material_in_name + '->' + res[i].material_out_name
}
this.routeOptions = res;
console.log(this.routeOptions);
debugger;
})
},
getShiftOptions() {
this.$API.mtm.shift.list.req({ page: 0 }).then((res) => {
this.shiftOptions = res;
});
},
getUserList() {
let that = this;
this.$API.system.user.list
.req({ belong_dept__name: '6车间', page: 0 })
.then((res) => {
that.userList = res;
});
},
//
getBatchs() {
let that = this;
this.$API.wpm.wmaterial.batchs
.req({ belong_dept_name: "6车间" })
.then((res) => {
that.batchOptions = res;
});
},
//
getEquipment() {
this.$API.em.equipment.list.req({ page: 0, type: 10 }).then((res) => {
this.equipmentOptions = res;
});
},
getMaterial(mgroupId) {
if (mgroupId != 0) {
this.$API.mtm.route.list
.req({ page: 0, mgroup: mgroupId })
.then((res) => {
let mOptions = [];
for (var i = 0; i < res.length; i++) {
mOptions.push({
id: res[i].material_out,
name: res[i].material_out_name,
material_in: res[i].material_in
});
}
this.materialOptions = mOptions;
});
} else {
let obj = {};
obj.page = 0;
obj.is_hidden = false;
this.$API.mtm.material.list.req(obj).then((res) => {
this.materialOptions = res;
});
}
},
//
// getMaterial(){
// let that = this;
// this.$API.wpm.wmaterial.list.req({belong_dept_name:'8',page:0}).then(res=>{
// that.materialOptions = res;
// });
// },
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
countNotOkSun() {
this.form.count_notok =
Number(this.form.count_n_zw) +
Number(this.form.count_n_tw) +
Number(this.form.count_n_qp) +
Number(this.form.count_n_wq) +
Number(this.form.count_n_dl) +
Number(this.form.count_n_pb) +
Number(this.form.count_n_dxt) +
Number(this.form.count_n_jsqx) +
Number(this.form.count_n_qt);
},
//
submit() {
console.log(this.form)
debugger;
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
this.form.mtask = this.mtask;
if (this.mode == "add") {
this.$API.wpm.mlog.create
.req(this.form)
.then((res) => {
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
})
.catch((err) => {
//
this.isSaveing = false;
return err;
});
} else if (this.mode == "edit") {
this.$API.wpm.mlog.update
.req(this.form.id, this.form)
.then((res) => {
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
})
.catch((err) => {
//
this.isSaveing = false;
return err;
});
}
}
});
},
//
setData(data) {
Object.assign(this.form, data);
this.getRouteOptions();
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
//
countChange() {
if (
this.form.count_real !== null &&
this.form.count_real !== "" &&
this.form.count_real !== 0
) {
if (
this.form.count_ok !== null &&
this.form.count_ok !== "" &&
this.form.count_ok !== 0
) {
this.form.rate =
(this.form.count_ok / this.form.count_real) * 100 + "%";
} else {
this.form.rate = null;
}
} else {
this.form.rate = null;
}
},
//
materialInChange(val) {
for(let i=0;i<this.materialOptions.length;i++){
if(this.materialOptions[i].id==val){
this.form.material_out = data[0].material_out;
}
}
},
},
};
</script>
<style scoped>
.formTitle {
margin-bottom: 10px;
font-weight: 600;
}
</style>

View File

@ -53,7 +53,6 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
</el-aside> </el-aside>
<el-main class="nopadding"> <el-main class="nopadding">
<el-container> <el-container>
@ -89,8 +88,7 @@
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo <scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo>
@row-click="rowClick">
<el-table-column label="班次" prop="shift_name"> </el-table-column> <el-table-column label="班次" prop="shift_name"> </el-table-column>
<el-table-column label="出管总数" prop="count_real"> <el-table-column label="出管总数" prop="count_real">
</el-table-column> </el-table-column>
@ -146,9 +144,7 @@
</el-container> </el-container>
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
</el-container> </el-container>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -196,7 +192,6 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
</el-aside> </el-aside>
<el-main class="nopadding"> <el-main class="nopadding">
<el-container> <el-container>
@ -236,12 +231,29 @@
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
<save-dialog
v-if="dialogSave"
ref="saveDialog"
:mtask="mtask"
:mgroup="mgroup"
:material_out="material_out"
:brothersList="brothersList"
:activeType="activeName"
@success="handleSaveSuccess"
@closed="dialogSave = false"
></save-dialog>
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from "./worktask_form.vue";
export default { export default {
components: {
saveDialog,
},
data() { data() {
return { return {
activeName:'10车间',
mlogs:[],
currentDept: {}, currentDept: {},
currentMtask: {}, currentMtask: {},
apiMtask: null, apiMtask: null,
@ -253,16 +265,24 @@ export default {
30: "生产中", 30: "生产中",
40: "已提交", 40: "已提交",
}, },
brothersList:[],
apiObjHandover: null, apiObjHandover: null,
paramsHandover: {},
apiObjWm: null, apiObjWm: null,
dialogSave:false,
paramsHandover: {},
paramsWm: {}, paramsWm: {},
mtask:'',
mgroup:'',
material_out:''
} }
}, },
mounted() { mounted() {
this.initDept() this.initDept()
}, },
methods: { methods: {
tomio() {
this.$router.push({ name: "mio" });
},
initDept() { initDept() {
this.$API.system.dept.list.req({ page: 0, name: '10车间' }).then(res => { this.$API.system.dept.list.req({ page: 0, name: '10车间' }).then(res => {
if (res.length == 1) { if (res.length == 1) {
@ -297,9 +317,26 @@ export default {
}) })
}, },
mtaskClick(row) { mtaskClick(row) {
this.currentMtask = row this.currentMtask = row;
this.mtask = row.id;
this.brothersList = row.material_out_.brothers;
this.getMlogs(row.id) this.getMlogs(row.id)
}, },
addMlog(){
let that = this;
console.log(that.currentMtask);
debugger;
if (that.currentMtask && that.currentMtask.id) {
that.mgroup = that.currentMtask.mgroup;
that.material_out = that.currentMtask.material_out;
that.dialogSave = true;
that.$nextTick(() => {
that.$refs.saveDialog.open("add");
});
} else {
that.$message.warning("请选择任务");
}
},
table_submit(row) { table_submit(row) {
this.$API.pm.mtask.submit.req(row.id).then(res => { this.$API.pm.mtask.submit.req(row.id).then(res => {
this.$message.success('操作成功') this.$message.success('操作成功')

View File

@ -1,7 +1,344 @@
<template> <template>
<div> <el-container>
<el-aside style="width: 50%">
</div> <el-container>
<el-header style="height:50%; padding: 0">
<el-container>
<el-header>
<div class="left-panel">
<el-date-picker v-model="query.date" type="date" value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleQueryMtask">查询</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination
@row-click="rowClick" hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.specification }}</span>
</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.model }}</span>
</template>
</el-table-column>
<el-table-column label="计划数量" prop="count">
</el-table-column>
<el-table-column label="生产日期" prop="start_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-header>
<el-main class="nopadding">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">各工序进度</span>
</div>
</el-header>
<el-main>
<scTable ref="tableprocess" row-key="id" stripe :hideDo="hideDo" :data="processList" @row-click="itemClick">
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number" width="150">
</el-table-column>
<el-table-column label="日期" prop="start_date" width="120">
</el-table-column>
<el-table-column label="工序" prop="mgroup_name">
</el-table-column>
<el-table-column label="计划数量" prop="count">
</el-table-column>
<el-table-column label="合格数量" prop="count_ok">
</el-table-column>
<el-table-column label="操作人" prop="">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-aside>
<el-main class="nopadding">
<el-container>
<el-header style="height: 60%; padding: 0">
<el-container>
<el-header style="height: 20%; padding: 0">
<el-card style="width: 100%; height: 100%">
<template #header>
<div class="card-header">
<span>任务信息</span>
</div>
</template>
<el-descriptions>
<el-descriptions-item label="任务编号">{{ currentMtask.number }}</el-descriptions-item>
<el-descriptions-item label="产品名称">
<span v-if="currentMtask.material_out_">{{ currentMtask.material_out_.name}}</span>
</el-descriptions-item>
<el-descriptions-item label="规格型号">
<span v-if="currentMtask.material_out_">{{currentMtask.material_out_.specification}}</span>
</el-descriptions-item>
<el-descriptions-item label="计划数量">{{ currentMtask.count}}</el-descriptions-item>
<el-descriptions-item label="计划日期">{{ currentMtask.start_date}}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-header>
<el-main style="padding: 0;">
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addMlog"
v-if="currentMtask && currentMtask.state == 20">新增</el-button>
</div>
</el-header>
<el-main style="padding: 0;">
<scTable ref="mtaskMlogs" :apiObj="apiObjMlog" row-key="id" :params="paramsMlog" stripe
hidePagination hideDo>
<el-table-column label="工序" prop="mgroup_name"></el-table-column>
<el-table-column label="产品编号">
<template #default="scope">
<span v-if="scope.row.material_out_">{{scope.row.material_out_.number}}</span>
</template>
</el-table-column>
<el-table-column label="加工设备" prop="equipment_name"></el-table-column>
<el-table-column label="领用数量" prop="count_use"> </el-table-column>
<el-table-column label="加工数量" prop="count_real"> </el-table-column>
<el-table-column label="合格数量" prop="count_ok"></el-table-column>
<el-table-column label="不合格数量" align="center">
<el-table-column prop="count_notok" label="原因一"/>
<el-table-column prop="count_notok" label="原因二"/>
<el-table-column prop="count_notok" label="原因三"/>
</el-table-column>
<el-table-column label="操作人" prop="count_ok"></el-table-column>
<el-table-column label="操作" fixed="right" width="80">
<template #default="scope">
<el-button link type="primary" @click="table_edit(scope.row)">
编辑
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-header>
<el-main style="padding: 0;">
<el-container>
<el-main style="padding: 0;">
<el-container>
<el-header>
<div class="left-panel">
<span style="font-size: 14px">车间库存</span>
</div>
<div class="right-panel">
<el-button type="primary" @click="tomio" v-auth="'mio.do'">领料</el-button>
<el-button type="primary" @click="tomio" v-auth="'mio.do'">入库</el-button>
</div>
</el-header>
<el-main style="padding: 0;">
<scTable ref="table_wm" :apiObj="apiObjWm" row-key="id" :params="paramsWm" stripe
hidePagination hideDo>
<el-table-column label="物料名" prop="material">
<template #default="scope">
{{scope.row.material_.name}}
</template>
</el-table-column>
<el-table-column label="规格" prop="material">
<template #default="scope">
{{scope.row.material_.specification}}
</template>
</el-table-column>
<el-table-column label="型号" prop="material">
<template #default="scope">
{{scope.row.material_.model}}
</template>
</el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
</el-container>
</el-main>
<save-dialog
v-if="dialogSave"
ref="saveDialog"
:mtask="mtask"
:mgroup="mgroup"
:material_out="material_out"
@success="handleSaveSuccess"
@closed="dialogSave = false"
></save-dialog>
</el-container>
</template> </template>
<script> <script>
</script> import saveDialog from "./mlog6_form.vue";
export default {
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
},
apiObj:null,
query: {
page: 1,
page_size: 20,
belong_dept_name: '6车间',
date: '2023-10-24'
},
tableData: [],
selection: [],
processList: [],//
state_: {
10: '创建中',
20: '已下达',
30: '生产中',
40: '已提交',
},
hideDo: true,
currentMtask:{},
apiObjWm: this.$API.wpm.wmaterial.list,
apiObjMlog:null,
paramsMlog:{
mtask:''
},
paramsWm: {
belong_dept__name: '6车间'
},
dialogSave:false,
}
},
mounted() {
let NowDate = new Date();
this.query.date = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate();
this.apiObj = this.$API.pm.mtask.daylist;
},
methods: {
tomio() {
this.$router.push({ name: "mio" });
},
//
rowClick(row) {
let that = this;
this.$API.pm.mtask.list.req({ start_date: row.start_date, end_date: row.end_date, mgroup__belong_dept__name: '6车间', utask: row.utask }).then(res => {
that.processList = res.results;
})
},
//
itemClick(row){
this.currentMtask = row;
this.mgroup = row.mgroup;
this.mtask = row.id;
this.material_out = row.material_out_.id;
this.paramsMlog.mtask = this.mtask;
this.apiObjMlog = this.$API.wpm.mlog.list;
},
handleQueryMtask(){},
//
addMlog() {
let that = this;
if (that.currentMtask && that.currentMtask.id) {
that.mgroup = that.currentMtask.mgroup;
that.material_out = that.currentMtask.material_out;
that.dialogSave = true;
that.$nextTick(() => {
that.$refs.saveDialog.open("add");
});
} else {
that.$message.warning("请选择任务");
}
},
//
table_edit(row) {
this.dialogSave = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
table_show(row) {
this.$nextTick(() => {
this.$router.push({
name: "worktaskFlog",
query: { mtask: row.id }
});
});
},
//
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pm.mtask.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
//
handleSaveSuccess(data, mode) {
this.$refs.mtaskMlogs.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
}
}
</script>
<style scoped>
.tabsHeader {
display: inline-block;
position: absolute;
right: 20px;
margin-top: 4px;
z-index: 100
}
.right-panel>*+* {
margin-left: 10px;
}
.el-main.nopadding {
padding: 0 20px 0 20px
}
.tableTitle {
height: 40px;
line-height: 40px;
font-size: 14px;
box-sizing: border-box;
border-bottom: 1px solid #eeeeee;
}
</style>

View File

@ -43,13 +43,13 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="操作" fixed="right" width="60"> <el-table-column label="操作" fixed="right" width="60">
<template #default="scope"> <template #default="scope">
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'mtask.submit'" <el-link type="primary" @click="table_submit(scope.row)" v-auth="'mtask.submit'"
v-if="scope.row.state != 40">提交 v-if="scope.row.state != 40">提交
</el-link> </el-link>
</template> </template>
</el-table-column> --> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
@ -88,8 +88,7 @@
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo <scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo>
@row-click="rowClick">
<el-table-column label="锅号" prop="equipment_name"> <el-table-column label="锅号" prop="equipment_name">
</el-table-column> </el-table-column>
<el-table-column label="产品名称" prop="material_out_"> <el-table-column label="产品名称" prop="material_out_">
@ -153,7 +152,6 @@
</el-container> </el-container>
</el-main> </el-main>
</el-container> </el-container>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -241,12 +239,27 @@
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
<save-dialog
v-if="dialogSave"
ref="saveDialog"
:mtask="mtask"
:mgroup="mgroup"
:material_out="material_out"
:activeType="activeName"
@success="handleSaveSuccess"
@closed="dialogSave = false"
></save-dialog>
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from "./worktask_form.vue";
export default { export default {
components: {
saveDialog,
},
data() { data() {
return { return {
activeName:'7车间',
currentDept: {}, currentDept: {},
currentMtask: {}, currentMtask: {},
apiMtask: null, apiMtask: null,
@ -258,16 +271,40 @@ export default {
30: "生产中", 30: "生产中",
40: "已提交", 40: "已提交",
}, },
dialogSave:false,
apiObjHandover: null, apiObjHandover: null,
paramsHandover: {}, paramsHandover: {},
apiObjWm: null, apiObjWm: null,
paramsWm: {}, paramsWm: {},
mlogs:[],
mtask:'',
mgroup:'',
material_out:''
} }
}, },
mounted() { mounted() {
this.initDept() this.initDept()
}, },
methods: { methods: {
tomio() {
this.$router.push({ name: "mio" });
},
//
addMlog() {
let that = this;
console.log(that.currentMtask);
debugger;
if (that.currentMtask && that.currentMtask.id) {
that.mgroup = that.currentMtask.mgroup;
that.material_out = that.currentMtask.material_out;
that.dialogSave = true;
that.$nextTick(() => {
that.$refs.saveDialog.open("add");
});
} else {
that.$message.warning("请选择任务");
}
},
initDept() { initDept() {
this.$API.system.dept.list.req({ page: 0, name: '7车间' }).then(res => { this.$API.system.dept.list.req({ page: 0, name: '7车间' }).then(res => {
if (res.length == 1) { if (res.length == 1) {
@ -302,7 +339,8 @@ export default {
}) })
}, },
mtaskClick(row) { mtaskClick(row) {
this.currentMtask = row this.currentMtask = row;
this.mtask = row.id;
this.getMlogs(row.id) this.getMlogs(row.id)
}, },
table_submit(row) { table_submit(row) {
@ -315,7 +353,8 @@ export default {
}).catch(err => { }).catch(err => {
}) })
} },
handleSaveSuccess(){},
} }
} }
</script> </script>

View File

@ -153,8 +153,7 @@
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<save-dialog v-if="dialogSave" <save-dialog v-if="dialogSave"
ref="saveDialog" :mtask="mtask" ref="saveDialog"
:brothersList="brothersList"
:activeType="activeName" :activeType="activeName"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialogSave = false"> @closed="dialogSave = false">
@ -179,8 +178,7 @@ export default {
dialogSave:false, dialogSave:false,
deptOptions: [], deptOptions: [],
userList: [], userList: [],
userList2: [], userList2: []
mtask:'',
} }
}, },
mounted() { mounted() {
@ -207,7 +205,7 @@ export default {
}).then(() => { }).then(() => {
this.$API.wpm.mlog.delete.req(row.id).then((res) => { this.$API.wpm.mlog.delete.req(row.id).then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.refresh();
return res; return res;
}).catch((err) => { }).catch((err) => {
return err; return err;
@ -218,8 +216,8 @@ export default {
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
getDepts() { getDepts() {
this.$API.system.dept.list.req({ page: 0, name__in: '7车间,10车间' }).then(res => { this.$API.system.dept.list.req({ page: 0, name__in: '7车间,8车间,10车间' }).then(res => {
this.deptOptions = res this.deptOptions = res;
}) })
}, },
getUserList2(val) { getUserList2(val) {
@ -273,20 +271,19 @@ export default {
handover_delete(row) { handover_delete(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => {
this.$API.wpm.handover.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table2.refresh();
return res;
})
.catch((err) => {
return err;
});
}) })
.then(() => { .catch(() => { });
this.$API.wpm.handover.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table2.refresh();
return res;
})
.catch((err) => {
return err;
});
})
.catch(() => { });
}, },
} }
} }

View File

@ -11,6 +11,11 @@
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params"> <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params">
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="物料名" prop="material_out_name"> <el-table-column label="物料名" prop="material_out_name">
<template #default="scope">
<span v-if="scope.row.material_out_">
{{scope.row.material_out_.name}}
</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="设备名" prop="equipment_name"> <el-table-column label="设备名" prop="equipment_name">
</el-table-column> </el-table-column>
@ -59,9 +64,10 @@
<el-table-column label="送料日期" prop="send_date"> <el-table-column label="送料日期" prop="send_date">
</el-table-column> </el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip> <el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_">{{ <template #default="scope">
scope.row.material_.name <span v-if="scope.row.material_out_">
}}</span> {{scope.row.material_out_.name}}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次" prop="batch"> </el-table-column> <el-table-column label="批次" prop="batch"> </el-table-column>
@ -179,11 +185,22 @@
<el-button type="primary" @click="submitHandover">提交</el-button> <el-button type="primary" @click="submitHandover">提交</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<save-dialog v-if="dialogSave"
ref="saveDialog"
:activeType="activeName"
@success="handleSaveSuccess"
@closed="dialogSave = false">
</save-dialog>
</template> </template>
<script> <script>
import saveDialog from "./worktask_form.vue";
export default { export default {
components: {
saveDialog,
},
data() { data() {
return { return {
activeName:'退火',
currentMgroup: {}, currentMgroup: {},
apiObj: null, apiObj: null,
params: {}, params: {},
@ -192,10 +209,11 @@ export default {
apiObjWm: null, apiObjWm: null,
paramsWm: {}, paramsWm: {},
handoverForm: {}, handoverForm: {},
dialogSave:false,
handoverVisible: false, handoverVisible: false,
deptOptions: [], deptOptions: [],
userList: [], userList: [],
userList2: [], userList2: []
} }
}, },
mounted() { mounted() {
@ -203,25 +221,39 @@ export default {
this.getDepts() this.getDepts()
}, },
methods: { methods: {
add() {
this.dialogSave = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_edit(row) {
this.dialogSave = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
tomio() { tomio() {
this.$router.push({ name: "mio" }); this.$router.push({ name: "mio" });
}, },
async table_del(row) { async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", { this.$confirm(`确定删除吗?`, "提示", {
type: "warning", type: "warning",
}) }).then(() => {
.then(() => { this.$API.wpm.mlog.delete.req(row.id).then((res) => {
this.$API.wpm.mlog.delete this.$message.success("删除成功");
.req(row.id) this.$refs.table.refresh();
.then((res) => { return res;
this.$message.success("删除成功");
return res;
})
.catch((err) => {
return err;
});
}) })
.catch(() => { }); .catch((err) => {
return err;
});
})
.catch(() => { });
},
handleSaveSuccess(){
this.$refs.table.refresh();
}, },
getDepts() { getDepts() {
this.$API.system.dept.list.req({ page: 0, name__in: '7车间,10车间' }).then(res => { this.$API.system.dept.list.req({ page: 0, name__in: '7车间,10车间' }).then(res => {

View File

@ -23,7 +23,7 @@
placeholder="工段" placeholder="工段"
clearable clearable
style="width: 100%" style="width: 100%"
@change="getMaterial" @change="getRouteOptions"
> >
<el-option <el-option
v-for="item in mgroupOptions" v-for="item in mgroupOptions"
@ -35,30 +35,22 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="产物" prop="material"> <el-form-item label="生产路线" prop="material_out">
<el-select <el-select
v-model="form.material_out" v-model="form.material_out"
placeholder="产物" placeholder="生产路线"
clearable clearable
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in materialOptions" v-for="item in routeOptions"
:key="item.id" :key="item.material_out"
:label="item.name" :label="item.label"
:value="item.id" :value="item.material_out"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :md="12" :sm="24">
<el-form-item label="设备" prop="material">
<el-select v-model="form.equipment" placeholder="设备" clearable style="width:100%">
<el-option v-for="item in equipmentOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="班次" prop="material"> <el-form-item label="班次" prop="material">
<el-select <el-select
@ -91,7 +83,7 @@
v-model="form.count_real" v-model="form.count_real"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="请输入数量" placeholder="请输入数量"
@ -105,7 +97,7 @@
v-model="form.count_real_eweight" v-model="form.count_real_eweight"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="请输入重量" placeholder="请输入重量"
@ -155,13 +147,13 @@
> >
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="工段" prop="material"> <el-form-item label="工段" prop="material">
<el-select <el-select
v-model="form.mgroup" v-model="form.mgroup"
placeholder="工段" placeholder="工段"
clearable clearable
style="width: 100%" style="width: 100%"
@change="getMaterial" @change="getRouteOptions"
> >
<el-option <el-option
v-for="item in mgroupOptions" v-for="item in mgroupOptions"
@ -173,17 +165,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="产物" prop="material"> <el-form-item label="生产路线" prop="material_out">
<el-select <el-select
v-model="form.material_out" v-model="form.material_out"
placeholder="产物" placeholder="生产路线"
clearable clearable
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in materialOptions" v-for="item in routeOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.label"
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
@ -195,7 +187,7 @@
v-model="form.count_ok" v-model="form.count_ok"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="请输入合格数" placeholder="请输入合格数"
@ -218,11 +210,10 @@
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="物料批次" prop="material_in"> <el-form-item label="物料批次" prop="material_in">
<el-select <el-select
v-model="form.catch" v-model="form.batch"
placeholder="物料批次" placeholder="物料批次"
clearable clearable
style="width: 100%" style="width: 100%"
@change="wmaterialInChange"
> >
<el-option <el-option
v-for="item in wMaterialOptions" v-for="item in wMaterialOptions"
@ -233,6 +224,35 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班次" prop="material">
<el-select
v-model="form.shift"
placeholder="班次"
clearable
style="width: 100%"
>
<el-option
v-for="item in shiftOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="退火时间" prop="material">
<el-date-picker
v-model="form.handle_date"
type="date"
placeholder="退火时间"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row> </el-row>
<div class="formTitle">不合格原因及数量:</div> <div class="formTitle">不合格原因及数量:</div>
<el-row> <el-row>
@ -242,7 +262,7 @@
v-model="form.count_n_wq" v-model="form.count_n_wq"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="椭圆/弯曲" placeholder="椭圆/弯曲"
@ -257,7 +277,7 @@
v-model="form.count_n_tw" v-model="form.count_n_tw"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="条纹" placeholder="条纹"
@ -272,7 +292,7 @@
v-model="form.count_n_dl" v-model="form.count_n_dl"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="断裂" placeholder="断裂"
@ -287,7 +307,7 @@
v-model="form.count_n_pb" v-model="form.count_n_pb"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="偏壁" placeholder="偏壁"
@ -302,7 +322,7 @@
v-model="form.count_n_dxt" v-model="form.count_n_dxt"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="大小头" placeholder="大小头"
@ -317,7 +337,7 @@
v-model="form.count_n_jsqx" v-model="form.count_n_jsqx"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="结石气绒" placeholder="结石气绒"
@ -339,6 +359,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<div class="formTitle">检测统计:</div>
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="检测数"> <el-form-item label="检测数">
@ -346,7 +367,7 @@
v-model="form.count" v-model="form.count"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="请输入检测数" placeholder="请输入检测数"
@ -360,7 +381,7 @@
v-model="form.count" v-model="form.count"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="请输入检测合格数" placeholder="请输入检测合格数"
@ -374,7 +395,7 @@
v-model="form.count" v-model="form.count"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="请输入检测不合格数" placeholder="请输入检测不合格数"
@ -382,18 +403,6 @@
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24">
<el-form-item label="退火时间" prop="material">
<el-date-picker
v-model="form.handle_date"
type="date"
placeholder="退火时间"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="备注"> <el-form-item label="备注">
<el-input <el-input
@ -415,7 +424,7 @@
> >
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="产品名称" prop="material"> <el-form-item label="产品名称">
<el-select <el-select
v-model="form.material_out" v-model="form.material_out"
placeholder="产品名称" placeholder="产品名称"
@ -436,6 +445,23 @@
<el-input v-model="form.batch" placeholder="批次号"></el-input> <el-input v-model="form.batch" placeholder="批次号"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班次" prop="material">
<el-select
v-model="form.shift"
placeholder="班次"
clearable
style="width: 100%"
>
<el-option
v-for="item in shiftOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="锅号"> <el-form-item label="锅号">
<el-select <el-select
@ -459,7 +485,7 @@
v-model="form.index" v-model="form.index"
controls-position="right" controls-position="right"
:min="1" :min="1"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="第几锅" placeholder="第几锅"
@ -476,7 +502,7 @@
v-model="form.count_real" v-model="form.count_real"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="生产量" placeholder="生产量"
@ -491,7 +517,7 @@
v-model="form.count_ok" v-model="form.count_ok"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="合格量" placeholder="合格量"
@ -589,7 +615,7 @@
v-model="form.count_n_zw" v-model="form.count_n_zw"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="炸纹" placeholder="炸纹"
@ -604,7 +630,7 @@
v-model="form.count_n_tw" v-model="form.count_n_tw"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="条纹" placeholder="条纹"
@ -619,7 +645,7 @@
v-model="form.count_n_qp" v-model="form.count_n_qp"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="气泡" placeholder="气泡"
@ -634,7 +660,7 @@
v-model="form.count_n_wq" v-model="form.count_n_wq"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="弯曲" placeholder="弯曲"
@ -649,7 +675,7 @@
v-model="form.count_n_qt" v-model="form.count_n_qt"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="其他" placeholder="其他"
@ -726,7 +752,7 @@
v-model="form.count_real" v-model="form.count_real"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="出管总数" placeholder="出管总数"
@ -798,7 +824,7 @@
v-model="form.count_break" v-model="form.count_break"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="碎料" placeholder="碎料"
@ -841,7 +867,7 @@
v-model="item.count_ok" v-model="item.count_ok"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="合格数" placeholder="合格数"
@ -861,7 +887,7 @@
v-model="form.count_n_wq" v-model="form.count_n_wq"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="椭圆/弯曲" placeholder="椭圆/弯曲"
@ -876,7 +902,7 @@
v-model="form.count_n_tw" v-model="form.count_n_tw"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="条纹" placeholder="条纹"
@ -891,7 +917,7 @@
v-model="form.count_n_dl" v-model="form.count_n_dl"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="断裂" placeholder="断裂"
@ -906,7 +932,7 @@
v-model="form.count_n_pb" v-model="form.count_n_pb"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="偏壁" placeholder="偏壁"
@ -921,7 +947,7 @@
v-model="form.count_n_dxt" v-model="form.count_n_dxt"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="大小头" placeholder="大小头"
@ -936,7 +962,7 @@
v-model="form.count_n_jsqx" v-model="form.count_n_jsqx"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:step-strictly="true" :step-strictly="true"
style="width: 100%" style="width: 100%"
placeholder="结石气绒" placeholder="结石气绒"
@ -976,8 +1002,11 @@
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
props: { props: {
mgroup:{ type: String, default: "" },
mtask: { type: String, default: "" }, mtask: { type: String, default: "" },
mgroupId: { type: String, default: "" },
activeType: { type: String, default: "" }, activeType: { type: String, default: "" },
material_out: { type: String, default: "" },
brothersList: { type: Array, default: () => [] }, brothersList: { type: Array, default: () => [] },
}, },
data() { data() {
@ -992,6 +1021,8 @@ export default {
}, },
handle_user: [], handle_user: [],
form: { form: {
shift:'',
batch:'',
count_ok: 0, count_ok: 0,
count_real: 0, count_real: 0,
count_n_zw: 0, count_n_zw: 0,
@ -1013,12 +1044,16 @@ export default {
equipmentOptions: [], equipmentOptions: [],
wMaterialOptions: [], wMaterialOptions: [],
shiftOptions: [], shiftOptions: [],
routeOptions:[],
visible: false, visible: false,
isSaveing: false, isSaveing: false,
setFiltersVisible: false, setFiltersVisible: false,
handle_name: "", handle_name: "",
leader_name: "", leader_name: "",
count_n_all: null, count_n_all: null,
rules:{
},
}; };
}, },
mounted() { mounted() {
@ -1031,10 +1066,13 @@ export default {
this.getUserList(); this.getUserList();
this.getEquipment(); this.getEquipment();
this.getShiftOptions(); this.getShiftOptions();
this.getWorkShopMaterial();
let date = new Date(); let date = new Date();
let year = date.getFullYear(); let year = date.getFullYear();
let month = date.getMonth() + 1; let month = date.getMonth() + 1;
let day = date.getDate(); let day = date.getDate();
this.form.material_out = this.material_out;
this.form.mgroup = this.mgroup;
this.form.handle_date = year + "-" + month + "-" + day; this.form.handle_date = year + "-" + month + "-" + day;
if (this.activeType == "10车间") { if (this.activeType == "10车间") {
if (this.mode == "add") { if (this.mode == "add") {
@ -1050,9 +1088,22 @@ export default {
this.mlogb = mlogb; this.mlogb = mlogb;
} }
} }
this.getWorkShopMaterial();
}, },
methods: { methods: {
getRouteOptions() {
this.$API.mtm.route.list.req({ page: 0, mgroup: this.form.mgroup}).then(res => {
for (var i = 0; i < res.length; i++) {
if (res[i].material_in == null) {
res[i].material_in_name = ''
}
if (res[i].material_out == null) {
res[i].material_out_name = ''
}
res[i].label = res[i].material_in_name + '->' + res[i].material_out_name
}
this.routeOptions = res;
})
},
getShiftOptions() { getShiftOptions() {
this.$API.mtm.shift.list.req({ page: 0 }).then((res) => { this.$API.mtm.shift.list.req({ page: 0 }).then((res) => {
this.shiftOptions = res; this.shiftOptions = res;
@ -1137,10 +1188,11 @@ export default {
// }); // });
// }, // },
getWorkShopMaterial() { getWorkShopMaterial() {
let that = this;
this.$API.wpm.wmaterial.list this.$API.wpm.wmaterial.list
.req({ belong_dept__name: "8车间", page: 0 }) .req({ belong_dept__name: "8车间", page: 0 })
.then((res) => { .then((res) => {
this.wMaterialOptions = res; that.wMaterialOptions = res;
}); });
}, },
// //
@ -1277,6 +1329,7 @@ export default {
setData(data) { setData(data) {
Object.assign(this.form, data); Object.assign(this.form, data);
this.getMaterial(this.form.mgroup); this.getMaterial(this.form.mgroup);
this.getRouteOptions();
if (this.activeType == "8车间") { if (this.activeType == "8车间") {
if (this.form.handle_user.indexOf(",") > -1) { if (this.form.handle_user.indexOf(",") > -1) {
this.handle_user = this.form.handle_user.split(","); this.handle_user = this.form.handle_user.split(",");
@ -1316,18 +1369,24 @@ export default {
}, },
// //
materialInChange(val) { materialInChange(val) {
let data = this.materialOptions.filter((item) => { for(let i=0;i<this.materialOptions.length;i++){
return item.id == val; if(this.materialOptions[i].id==val){
}); this.form.material_out = data[0].material_out;
this.form.batch = data[0].batch; }
}
}, },
// //
wmaterialInChange(val) { // wmaterialInChange(val) {
let data = this.wmaterialOptions.filter((item) => { // console.log(this.form)
return item.id == val; // console.log(this.wmaterialOptions);
}); // debugger;
this.form.batch = data[0].batch; // for(let i=0;i<this.wmaterialOptions.length;i++){
}, // if(this.wmaterialOptions[i].id==val){
// this.form.batch = data[0].batch;
// }
// }
// console.log(this.form)
// },
}, },
}; };
</script> </script>