生产执行改动
This commit is contained in:
parent
c0ea8b80a9
commit
700f04aa13
|
@ -5,9 +5,9 @@
|
|||
<el-header>
|
||||
<div class="'left-panel'">
|
||||
<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"
|
||||
v-auth="'utask.assgin'">任务分解并下达</el-button>
|
||||
v-auth="'utask.assgin'">任务分解并下达</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
@ -77,7 +77,7 @@
|
|||
</el-container>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<el-container>
|
||||
<!-- <el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<span style="font-size: 14px">生产进度</span>
|
||||
|
@ -112,8 +112,9 @@
|
|||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</el-container> -->
|
||||
<GanttComponent class="left-container" :tasks="tasks" :start_date="start_date">
|
||||
</GanttComponent>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false">
|
||||
|
@ -124,11 +125,13 @@
|
|||
<script>
|
||||
import saveDialog from "./utask_form.vue";
|
||||
import showDrawer from "./mtask_drawer.vue"
|
||||
import GanttComponent from '@/components/GanttComponent.vue';
|
||||
export default {
|
||||
name: 'utask_dept10',
|
||||
components: {
|
||||
saveDialog,
|
||||
showDrawer
|
||||
showDrawer,
|
||||
GanttComponent
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -139,6 +142,9 @@ export default {
|
|||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
tasks: {
|
||||
data: []
|
||||
},
|
||||
apiUtask: null,
|
||||
apiObj: null,
|
||||
visibleRecord: false,
|
||||
|
@ -153,6 +159,7 @@ export default {
|
|||
30: "生产中",
|
||||
40: "已提交",
|
||||
},
|
||||
start_date:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -160,16 +167,60 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
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) {
|
||||
this.currentDept = res[0]
|
||||
this.paramsUtask.belong_dept = this.currentDept.id
|
||||
this.apiUtask = this.$API.pm.utask.list
|
||||
that.currentDept = res[0]
|
||||
that.paramsUtask.belong_dept = that.currentDept.id
|
||||
that.apiUtask = that.$API.pm.utask.list;
|
||||
that.getGantt();
|
||||
} 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() {
|
||||
let that = this;
|
||||
if (that.selectedIds.length > 0) {
|
||||
|
@ -252,33 +303,33 @@ export default {
|
|||
this.$refs.showDrawer.open();
|
||||
});
|
||||
},
|
||||
rowclick(val) {
|
||||
let utask = val.id;
|
||||
this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
|
||||
let columList = [];
|
||||
res.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.id = item.id
|
||||
obj.state = item.state;
|
||||
obj.count_b = 0
|
||||
obj.count_y = 0
|
||||
item.mlogs.forEach((item2) => {
|
||||
if (item2.shift_name.indexOf('白班')) {
|
||||
obj.count_b = item2.count_ok
|
||||
}
|
||||
else if (item2.shift_name.indexOf('夜班')) {
|
||||
obj.count_y = item2.count_ok
|
||||
}
|
||||
})
|
||||
obj.count_ok = item.count_ok
|
||||
obj.count = item.count;
|
||||
obj.start_date = item.start_date;
|
||||
columList.push(obj);
|
||||
});
|
||||
this.mtaskList = columList
|
||||
this.utaskList = [val]
|
||||
});
|
||||
},
|
||||
// rowclick(val) {
|
||||
// let utask = val.id;
|
||||
// this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
|
||||
// let columList = [];
|
||||
// res.forEach((item) => {
|
||||
// let obj = {};
|
||||
// obj.id = item.id
|
||||
// obj.state = item.state;
|
||||
// obj.count_b = 0
|
||||
// obj.count_y = 0
|
||||
// item.mlogs.forEach((item2) => {
|
||||
// if (item2.shift_name.indexOf('白班')) {
|
||||
// obj.count_b = item2.count_ok
|
||||
// }
|
||||
// else if (item2.shift_name.indexOf('夜班')) {
|
||||
// obj.count_y = item2.count_ok
|
||||
// }
|
||||
// })
|
||||
// obj.count_ok = item.count_ok
|
||||
// obj.count = item.count;
|
||||
// obj.start_date = item.start_date;
|
||||
// columList.push(obj);
|
||||
// });
|
||||
// this.mtaskList = columList
|
||||
// this.utaskList = [val]
|
||||
// });
|
||||
// },
|
||||
handleSaveSuccess(data, mode) {
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</el-container>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<el-container>
|
||||
<!-- <el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<span style="font-size: 14px">生产进度</span>
|
||||
|
@ -111,8 +111,9 @@
|
|||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</el-container> -->
|
||||
<GanttComponent class="left-container" :tasks="tasks" :start_date="start_date">
|
||||
</GanttComponent>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<showDrawer ref="showDrawer" v-if="visibleDrawer" :utaskId="utaskId" @closed="visibleDrawer = false">
|
||||
|
@ -122,12 +123,14 @@
|
|||
</template>
|
||||
<script>
|
||||
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 {
|
||||
name: 'utask_dept7',
|
||||
components: {
|
||||
saveDialog,
|
||||
showDrawer
|
||||
showDrawer,
|
||||
GanttComponent
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -138,6 +141,9 @@ export default {
|
|||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
tasks: {
|
||||
data: []
|
||||
},
|
||||
apiUtask: null,
|
||||
apiObj: null,
|
||||
visibleRecord: false,
|
||||
|
@ -152,6 +158,7 @@ export default {
|
|||
30: "生产中",
|
||||
40: "已提交",
|
||||
},
|
||||
start_date:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -159,16 +166,60 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
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) {
|
||||
this.currentDept = res[0]
|
||||
this.paramsUtask.belong_dept = this.currentDept.id
|
||||
this.apiUtask = this.$API.pm.utask.list
|
||||
that.currentDept = res[0];
|
||||
that.paramsUtask.belong_dept = that.currentDept.id;
|
||||
that.apiUtask = that.$API.pm.utask.list;
|
||||
that.getGantt();
|
||||
} 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() {
|
||||
let that = this;
|
||||
if (that.selectedIds.length > 0) {
|
||||
|
@ -251,24 +302,24 @@ export default {
|
|||
this.$refs.showDrawer.open();
|
||||
});
|
||||
},
|
||||
rowclick(val) {
|
||||
let utask = val.id;
|
||||
this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
|
||||
let columList = [];
|
||||
res.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.id = item.id
|
||||
obj.state = item.state;
|
||||
obj.count_ok = item.count_ok
|
||||
obj.count = item.count;
|
||||
obj.start_date = item.start_date;
|
||||
obj.rate = ((item.count_ok / item.count) * 100).toFixed(0) + '%';
|
||||
columList.push(obj);
|
||||
});
|
||||
this.mtaskList = columList
|
||||
this.utaskList = [val]
|
||||
});
|
||||
},
|
||||
// rowclick(val) {
|
||||
// let utask = val.id;
|
||||
// this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
|
||||
// let columList = [];
|
||||
// res.forEach((item) => {
|
||||
// let obj = {};
|
||||
// obj.id = item.id
|
||||
// obj.state = item.state;
|
||||
// obj.count_ok = item.count_ok
|
||||
// obj.count = item.count;
|
||||
// obj.start_date = item.start_date;
|
||||
// obj.rate = ((item.count_ok / item.count) * 100).toFixed(0) + '%';
|
||||
// columList.push(obj);
|
||||
// });
|
||||
// this.mtaskList = columList
|
||||
// this.utaskList = [val]
|
||||
// });
|
||||
// },
|
||||
handleSaveSuccess(data, mode) {
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
|
|
|
@ -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>
|
||||
|
|
@ -53,7 +53,6 @@
|
|||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</el-aside>
|
||||
<el-main class="nopadding">
|
||||
<el-container>
|
||||
|
@ -89,8 +88,7 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo
|
||||
@row-click="rowClick">
|
||||
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo>
|
||||
<el-table-column label="班次" prop="shift_name"> </el-table-column>
|
||||
<el-table-column label="出管总数" prop="count_real">
|
||||
</el-table-column>
|
||||
|
@ -146,9 +144,7 @@
|
|||
</el-container>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</el-main>
|
||||
|
||||
</el-container>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
@ -196,7 +192,6 @@
|
|||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
||||
</el-aside>
|
||||
<el-main class="nopadding">
|
||||
<el-container>
|
||||
|
@ -236,12 +231,29 @@
|
|||
</el-main>
|
||||
</el-container>
|
||||
</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>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./worktask_form.vue";
|
||||
export default {
|
||||
components: {
|
||||
saveDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName:'10车间',
|
||||
mlogs:[],
|
||||
currentDept: {},
|
||||
currentMtask: {},
|
||||
apiMtask: null,
|
||||
|
@ -253,16 +265,24 @@ export default {
|
|||
30: "生产中",
|
||||
40: "已提交",
|
||||
},
|
||||
brothersList:[],
|
||||
apiObjHandover: null,
|
||||
paramsHandover: {},
|
||||
apiObjWm: null,
|
||||
dialogSave:false,
|
||||
paramsHandover: {},
|
||||
paramsWm: {},
|
||||
mtask:'',
|
||||
mgroup:'',
|
||||
material_out:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initDept()
|
||||
},
|
||||
methods: {
|
||||
tomio() {
|
||||
this.$router.push({ name: "mio" });
|
||||
},
|
||||
initDept() {
|
||||
this.$API.system.dept.list.req({ page: 0, name: '10车间' }).then(res => {
|
||||
if (res.length == 1) {
|
||||
|
@ -297,9 +317,26 @@ export default {
|
|||
})
|
||||
},
|
||||
mtaskClick(row) {
|
||||
this.currentMtask = row
|
||||
this.currentMtask = row;
|
||||
this.mtask = row.id;
|
||||
this.brothersList = row.material_out_.brothers;
|
||||
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) {
|
||||
this.$API.pm.mtask.submit.req(row.id).then(res => {
|
||||
this.$message.success('操作成功')
|
||||
|
|
|
@ -1,7 +1,344 @@
|
|||
<template>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<el-container>
|
||||
<el-aside style="width: 50%">
|
||||
<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>
|
||||
<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>
|
|
@ -43,13 +43,13 @@
|
|||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" fixed="right" width="60">
|
||||
<el-table-column label="操作" fixed="right" width="60">
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'mtask.submit'"
|
||||
v-if="scope.row.state != 40">提交
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
@ -88,8 +88,7 @@
|
|||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo
|
||||
@row-click="rowClick">
|
||||
<scTable ref="table_mlog" :data="mlogs" row-key="id" stripe hidePagination hideDo>
|
||||
<el-table-column label="锅号" prop="equipment_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="产品名称" prop="material_out_">
|
||||
|
@ -153,7 +152,6 @@
|
|||
</el-container>
|
||||
|
||||
</el-main>
|
||||
|
||||
</el-container>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
|
@ -241,12 +239,27 @@
|
|||
</el-main>
|
||||
</el-container>
|
||||
</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>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./worktask_form.vue";
|
||||
export default {
|
||||
components: {
|
||||
saveDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName:'7车间',
|
||||
currentDept: {},
|
||||
currentMtask: {},
|
||||
apiMtask: null,
|
||||
|
@ -258,16 +271,40 @@ export default {
|
|||
30: "生产中",
|
||||
40: "已提交",
|
||||
},
|
||||
dialogSave:false,
|
||||
apiObjHandover: null,
|
||||
paramsHandover: {},
|
||||
apiObjWm: null,
|
||||
paramsWm: {},
|
||||
mlogs:[],
|
||||
mtask:'',
|
||||
mgroup:'',
|
||||
material_out:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initDept()
|
||||
},
|
||||
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() {
|
||||
this.$API.system.dept.list.req({ page: 0, name: '7车间' }).then(res => {
|
||||
if (res.length == 1) {
|
||||
|
@ -302,7 +339,8 @@ export default {
|
|||
})
|
||||
},
|
||||
mtaskClick(row) {
|
||||
this.currentMtask = row
|
||||
this.currentMtask = row;
|
||||
this.mtask = row.id;
|
||||
this.getMlogs(row.id)
|
||||
},
|
||||
table_submit(row) {
|
||||
|
@ -315,7 +353,8 @@ export default {
|
|||
}).catch(err => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSaveSuccess(){},
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -153,8 +153,7 @@
|
|||
</el-footer>
|
||||
</el-dialog>
|
||||
<save-dialog v-if="dialogSave"
|
||||
ref="saveDialog" :mtask="mtask"
|
||||
:brothersList="brothersList"
|
||||
ref="saveDialog"
|
||||
:activeType="activeName"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialogSave = false">
|
||||
|
@ -179,8 +178,7 @@ export default {
|
|||
dialogSave:false,
|
||||
deptOptions: [],
|
||||
userList: [],
|
||||
userList2: [],
|
||||
mtask:'',
|
||||
userList2: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -207,7 +205,7 @@ export default {
|
|||
}).then(() => {
|
||||
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
|
@ -218,8 +216,8 @@ export default {
|
|||
this.$refs.table.refresh();
|
||||
},
|
||||
getDepts() {
|
||||
this.$API.system.dept.list.req({ page: 0, name__in: '7车间,10车间' }).then(res => {
|
||||
this.deptOptions = res
|
||||
this.$API.system.dept.list.req({ page: 0, name__in: '7车间,8车间,10车间' }).then(res => {
|
||||
this.deptOptions = res;
|
||||
})
|
||||
},
|
||||
getUserList2(val) {
|
||||
|
@ -273,20 +271,19 @@ export default {
|
|||
handover_delete(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
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(() => {
|
||||
this.$API.wpm.handover.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table2.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => { });
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,11 @@
|
|||
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="params">
|
||||
<el-table-column type="index" width="50" />
|
||||
<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 label="设备名" prop="equipment_name">
|
||||
</el-table-column>
|
||||
|
@ -59,9 +64,10 @@
|
|||
<el-table-column label="送料日期" prop="send_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="产物" prop="material" show-overflow-tooltip>
|
||||
<template #default="scope"><span v-if="scope.row.material_">{{
|
||||
scope.row.material_.name
|
||||
}}</span>
|
||||
<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="batch"> </el-table-column>
|
||||
|
@ -179,11 +185,22 @@
|
|||
<el-button type="primary" @click="submitHandover">提交</el-button>
|
||||
</el-footer>
|
||||
</el-dialog>
|
||||
<save-dialog v-if="dialogSave"
|
||||
ref="saveDialog"
|
||||
:activeType="activeName"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialogSave = false">
|
||||
</save-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./worktask_form.vue";
|
||||
export default {
|
||||
components: {
|
||||
saveDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName:'退火',
|
||||
currentMgroup: {},
|
||||
apiObj: null,
|
||||
params: {},
|
||||
|
@ -192,10 +209,11 @@ export default {
|
|||
apiObjWm: null,
|
||||
paramsWm: {},
|
||||
handoverForm: {},
|
||||
dialogSave:false,
|
||||
handoverVisible: false,
|
||||
deptOptions: [],
|
||||
userList: [],
|
||||
userList2: [],
|
||||
userList2: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -203,25 +221,39 @@ export default {
|
|||
this.getDepts()
|
||||
},
|
||||
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() {
|
||||
this.$router.push({ name: "mio" });
|
||||
},
|
||||
async table_del(row) {
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$API.wpm.mlog.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}).then(() => {
|
||||
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.table.refresh();
|
||||
return res;
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
handleSaveSuccess(){
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
getDepts() {
|
||||
this.$API.system.dept.list.req({ page: 0, name__in: '7车间,10车间' }).then(res => {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
placeholder="工段"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="getMaterial"
|
||||
@change="getRouteOptions"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mgroupOptions"
|
||||
|
@ -35,30 +35,22 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产物" prop="material">
|
||||
<el-form-item label="生产路线" prop="material_out">
|
||||
<el-select
|
||||
v-model="form.material_out"
|
||||
placeholder="产物"
|
||||
placeholder="生产路线"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in routeOptions"
|
||||
:key="item.material_out"
|
||||
:label="item.label"
|
||||
:value="item.material_out"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</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-form-item label="班次" prop="material">
|
||||
<el-select
|
||||
|
@ -91,7 +83,7 @@
|
|||
v-model="form.count_real"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="请输入数量"
|
||||
|
@ -105,7 +97,7 @@
|
|||
v-model="form.count_real_eweight"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="请输入重量"
|
||||
|
@ -155,13 +147,13 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="工段" prop="material">
|
||||
<el-form-item label="工段" prop="material">
|
||||
<el-select
|
||||
v-model="form.mgroup"
|
||||
placeholder="工段"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="getMaterial"
|
||||
@change="getRouteOptions"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mgroupOptions"
|
||||
|
@ -173,17 +165,17 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产物" prop="material">
|
||||
<el-form-item label="生产路线" prop="material_out">
|
||||
<el-select
|
||||
v-model="form.material_out"
|
||||
placeholder="产物"
|
||||
placeholder="生产路线"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
v-for="item in routeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:label="item.label"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
|
@ -195,7 +187,7 @@
|
|||
v-model="form.count_ok"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="请输入合格数"
|
||||
|
@ -218,11 +210,10 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="物料批次" prop="material_in">
|
||||
<el-select
|
||||
v-model="form.catch"
|
||||
v-model="form.batch"
|
||||
placeholder="物料批次"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="wmaterialInChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in wMaterialOptions"
|
||||
|
@ -233,6 +224,35 @@
|
|||
</el-select>
|
||||
</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="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>
|
||||
<div class="formTitle">不合格原因及数量:</div>
|
||||
<el-row>
|
||||
|
@ -242,7 +262,7 @@
|
|||
v-model="form.count_n_wq"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="椭圆/弯曲"
|
||||
|
@ -257,7 +277,7 @@
|
|||
v-model="form.count_n_tw"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="条纹"
|
||||
|
@ -272,7 +292,7 @@
|
|||
v-model="form.count_n_dl"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="断裂"
|
||||
|
@ -287,7 +307,7 @@
|
|||
v-model="form.count_n_pb"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="偏壁"
|
||||
|
@ -302,7 +322,7 @@
|
|||
v-model="form.count_n_dxt"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="大小头"
|
||||
|
@ -317,7 +337,7 @@
|
|||
v-model="form.count_n_jsqx"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="结石气绒"
|
||||
|
@ -339,6 +359,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="formTitle">检测统计:</div>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="检测数">
|
||||
|
@ -346,7 +367,7 @@
|
|||
v-model="form.count"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="请输入检测数"
|
||||
|
@ -360,7 +381,7 @@
|
|||
v-model="form.count"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="请输入检测合格数"
|
||||
|
@ -374,7 +395,7 @@
|
|||
v-model="form.count"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="请输入检测不合格数"
|
||||
|
@ -382,18 +403,6 @@
|
|||
</el-input-number>
|
||||
</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-col :md="12" :sm="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
|
@ -415,7 +424,7 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产品名称" prop="material">
|
||||
<el-form-item label="产品名称">
|
||||
<el-select
|
||||
v-model="form.material_out"
|
||||
placeholder="产品名称"
|
||||
|
@ -436,6 +445,23 @@
|
|||
<el-input v-model="form.batch" placeholder="批次号"></el-input>
|
||||
</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="锅号">
|
||||
<el-select
|
||||
|
@ -459,7 +485,7 @@
|
|||
v-model="form.index"
|
||||
controls-position="right"
|
||||
:min="1"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="第几锅"
|
||||
|
@ -476,7 +502,7 @@
|
|||
v-model="form.count_real"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="生产量"
|
||||
|
@ -491,7 +517,7 @@
|
|||
v-model="form.count_ok"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="合格量"
|
||||
|
@ -589,7 +615,7 @@
|
|||
v-model="form.count_n_zw"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="炸纹"
|
||||
|
@ -604,7 +630,7 @@
|
|||
v-model="form.count_n_tw"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="条纹"
|
||||
|
@ -619,7 +645,7 @@
|
|||
v-model="form.count_n_qp"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="气泡"
|
||||
|
@ -634,7 +660,7 @@
|
|||
v-model="form.count_n_wq"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="弯曲"
|
||||
|
@ -649,7 +675,7 @@
|
|||
v-model="form.count_n_qt"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="其他"
|
||||
|
@ -726,7 +752,7 @@
|
|||
v-model="form.count_real"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="出管总数"
|
||||
|
@ -798,7 +824,7 @@
|
|||
v-model="form.count_break"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="碎料"
|
||||
|
@ -841,7 +867,7 @@
|
|||
v-model="item.count_ok"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="合格数"
|
||||
|
@ -861,7 +887,7 @@
|
|||
v-model="form.count_n_wq"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="椭圆/弯曲"
|
||||
|
@ -876,7 +902,7 @@
|
|||
v-model="form.count_n_tw"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="条纹"
|
||||
|
@ -891,7 +917,7 @@
|
|||
v-model="form.count_n_dl"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="断裂"
|
||||
|
@ -906,7 +932,7 @@
|
|||
v-model="form.count_n_pb"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="偏壁"
|
||||
|
@ -921,7 +947,7 @@
|
|||
v-model="form.count_n_dxt"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="大小头"
|
||||
|
@ -936,7 +962,7 @@
|
|||
v-model="form.count_n_jsqx"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:step="1"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="结石气绒"
|
||||
|
@ -976,8 +1002,11 @@
|
|||
export default {
|
||||
emits: ["success", "closed"],
|
||||
props: {
|
||||
mgroup:{ type: String, default: "" },
|
||||
mtask: { type: String, default: "" },
|
||||
mgroupId: { type: String, default: "" },
|
||||
activeType: { type: String, default: "" },
|
||||
material_out: { type: String, default: "" },
|
||||
brothersList: { type: Array, default: () => [] },
|
||||
},
|
||||
data() {
|
||||
|
@ -992,6 +1021,8 @@ export default {
|
|||
},
|
||||
handle_user: [],
|
||||
form: {
|
||||
shift:'',
|
||||
batch:'',
|
||||
count_ok: 0,
|
||||
count_real: 0,
|
||||
count_n_zw: 0,
|
||||
|
@ -1013,12 +1044,16 @@ export default {
|
|||
equipmentOptions: [],
|
||||
wMaterialOptions: [],
|
||||
shiftOptions: [],
|
||||
routeOptions:[],
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
setFiltersVisible: false,
|
||||
handle_name: "",
|
||||
leader_name: "",
|
||||
count_n_all: null,
|
||||
rules:{
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -1031,10 +1066,13 @@ export default {
|
|||
this.getUserList();
|
||||
this.getEquipment();
|
||||
this.getShiftOptions();
|
||||
this.getWorkShopMaterial();
|
||||
let date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
this.form.material_out = this.material_out;
|
||||
this.form.mgroup = this.mgroup;
|
||||
this.form.handle_date = year + "-" + month + "-" + day;
|
||||
if (this.activeType == "10车间") {
|
||||
if (this.mode == "add") {
|
||||
|
@ -1050,9 +1088,22 @@ export default {
|
|||
this.mlogb = mlogb;
|
||||
}
|
||||
}
|
||||
this.getWorkShopMaterial();
|
||||
},
|
||||
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() {
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then((res) => {
|
||||
this.shiftOptions = res;
|
||||
|
@ -1137,10 +1188,11 @@ export default {
|
|||
// });
|
||||
// },
|
||||
getWorkShopMaterial() {
|
||||
let that = this;
|
||||
this.$API.wpm.wmaterial.list
|
||||
.req({ belong_dept__name: "8车间", page: 0 })
|
||||
.then((res) => {
|
||||
this.wMaterialOptions = res;
|
||||
that.wMaterialOptions = res;
|
||||
});
|
||||
},
|
||||
//显示
|
||||
|
@ -1277,6 +1329,7 @@ export default {
|
|||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
this.getMaterial(this.form.mgroup);
|
||||
this.getRouteOptions();
|
||||
if (this.activeType == "8车间") {
|
||||
if (this.form.handle_user.indexOf(",") > -1) {
|
||||
this.handle_user = this.form.handle_user.split(",");
|
||||
|
@ -1316,18 +1369,24 @@ export default {
|
|||
},
|
||||
//选择
|
||||
materialInChange(val) {
|
||||
let data = this.materialOptions.filter((item) => {
|
||||
return item.id == val;
|
||||
});
|
||||
this.form.batch = data[0].batch;
|
||||
for(let i=0;i<this.materialOptions.length;i++){
|
||||
if(this.materialOptions[i].id==val){
|
||||
this.form.material_out = data[0].material_out;
|
||||
}
|
||||
}
|
||||
},
|
||||
//选择
|
||||
wmaterialInChange(val) {
|
||||
let data = this.wmaterialOptions.filter((item) => {
|
||||
return item.id == val;
|
||||
});
|
||||
this.form.batch = data[0].batch;
|
||||
},
|
||||
// wmaterialInChange(val) {
|
||||
// console.log(this.form)
|
||||
// console.log(this.wmaterialOptions);
|
||||
// debugger;
|
||||
// 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>
|
||||
|
|
Loading…
Reference in New Issue