fix: mtask页面的bug修改

This commit is contained in:
caoqianming 2023-11-28 00:40:28 +08:00
parent 93a85eb192
commit c62188eaa7
7 changed files with 2336 additions and 1186 deletions

View File

@ -792,7 +792,7 @@ const routes = [
"name": "worktaskFlog",
"path": "/wpm/worktaskFlog",
"meta": {
"title": "生产部记录",
"title": "生产部记录",
"icon": "el-icon-cellphone",
"perms": ["wpm"],
"hidden":true

View File

@ -1,10 +1,18 @@
<template>
<el-container style="flex-direction: column">
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
<el-main
id="topContainer"
class="nopadding"
style="position: relative; margin-bottom: 10px"
>
<div class="right-panel btnsContainer">
<el-button type="primary" icon="el-icon-plus" @click="add">新增任务</el-button>
<el-button type="primary" icon="el-icon-plus" @click="add"
>新增任务</el-button
>
<!-- <el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务分解</el-button> -->
<el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务下达</el-button>
<el-button type="primary" @click="utaskDepuse" v-loading="isloading"
>任务下达</el-button
>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<!-- <el-tab-pane label="混料工序" name="8车间">
@ -71,13 +79,24 @@
</scTable>
</el-tab-pane> -->
<el-tab-pane label="成型7车间" name="7车间">
<scTable ref="table7" :apiObj="apiUtask" row-key="id" stripe :height="topHeight" :params="paramsUtask7"
@row-click="rowclick" @selection-change="handleSelectionChange">
<scTable
ref="table7"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask7"
@row-click="rowclick"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material_" show-overflow-tooltip>
<el-table-column label="任务编号" prop="number" width="120"> </el-table-column>
<el-table-column
label="产品名称"
prop="material_"
show-overflow-tooltip
>
<template #default="scope">
{{ scope.row.material_.name }}
</template>
@ -102,34 +121,46 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="number">
</el-table-column>
<el-table-column label="计划量" prop="count">
</el-table-column>
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column>
<el-table-column label="日均产量" prop="count_day">
</el-table-column>
<el-table-column label="计划开工时间" prop="start_date">
<el-table-column label="计划开工时间" prop="start_date" width="120">
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date">
</el-table-column>
<el-table-column label="完成产量" prop="count">
<el-table-column label="计划完工时间" prop="end_date" width="120">
</el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="完成率" prop="count">
<template #default="scope">
<span v-if="scope.row.count !=0">{{ (scope.row.count_ok/scope.row.count)*100 }}</span>
</template>
</el-table-column>
<el-table-column label="要求描述" prop="count">
</el-table-column>
<!-- <el-table-column label="要求描述"> </el-table-column> -->
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider direction="vertical" v-if="scope.row.state == 10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state == 10">
<el-divider
direction="vertical"
v-if="scope.row.state == 10"
></el-divider>
<el-link
type="primary"
@click="table_edit(scope.row)"
v-if="scope.row.state == 10"
>
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state == 10 || scope.row.state == 14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14">
<el-divider
direction="vertical"
v-if="scope.row.state == 10 || scope.row.state == 14"
></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14"
>
删除
</el-link>
</template>
@ -137,18 +168,37 @@
</scTable>
</el-tab-pane>
<el-tab-pane label="成型10车间" name="10车间">
<scTable ref="table10" :apiObj="apiUtask" row-key="id" stripe :height="topHeight" :params="paramsUtask10"
@row-click="rowclick" @selection-change="handleSelectionChange">
<scTable
ref="table10"
:apiObj="apiUtask"
row-key="id"
stripe
:height="topHeight"
:params="paramsUtask10"
@row-click="rowclick"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40" />
<el-table-column type="index" width="40" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<el-table-column label="任务编号" prop="number" width="120"> </el-table-column>
<el-table-column
label="产品名称"
prop="material"
show-overflow-tooltip
>
<template #default="scope">
{{ scope.row.material_.name }}
</template>
</el-table-column>
<el-table-column label="型号" prop="number">
<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="state">
<template #default="scope">
@ -160,37 +210,55 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="任务量" prop="number">
<el-table-column label="任务量" prop="count"> </el-table-column>
<el-table-column label="计划量" prop="count"> </el-table-column>
<el-table-column label="日均产量" prop="count_day"> </el-table-column>
<el-table-column label="计划开工时间" prop="start_date" width="120">
</el-table-column>
<el-table-column label="计划量" prop="count">
</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="end_date">
</el-table-column>
<el-table-column label="完成产量" prop="count">
<el-table-column label="计划完工时间" prop="end_date" width="120">
</el-table-column>
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
<el-table-column label="完成率" prop="count">
<template #default="scope">
<span v-if="scope.row.count !=0">{{ (scope.row.count_ok/scope.row.count)*100 }}</span>
</template>
</el-table-column>
<el-table-column label="要求描述" prop="count">
</el-table-column>
<el-table-column label="要求描述" prop="count"> </el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="scope">
<el-link type="primary" @click="table_show(scope.row)">
查看
</el-link>
<el-divider direction="vertical" v-if="scope.row.state == 10"></el-divider>
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state == 10">
<el-divider
direction="vertical"
v-if="scope.row.state == 10"
></el-divider>
<el-link
type="primary"
@click="table_edit(scope.row)"
v-if="scope.row.state == 10"
>
编辑
</el-link>
<el-divider direction="vertical" v-if="scope.row.state == 30 || scope.row.state == 20"></el-divider>
<el-link type="danger" @click="table_end(scope.row)"
v-if="scope.row.state == 30 || scope.row.state == 20">终止</el-link>
<el-divider direction="vertical" v-if="scope.row.state == 10 || scope.row.state == 14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14">
<el-divider
direction="vertical"
v-if="scope.row.state == 30 || scope.row.state == 20"
></el-divider>
<el-link
type="danger"
@click="table_end(scope.row)"
v-if="scope.row.state == 30 || scope.row.state == 20"
>终止</el-link
>
<el-divider
direction="vertical"
v-if="scope.row.state == 10 || scope.row.state == 14"
></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-if="scope.row.state == 10 || scope.row.state == 14"
>
删除
</el-link>
</template>
@ -199,27 +267,59 @@
</el-tab-pane>
</el-tabs>
</el-main>
<el-main class="nopadding" style="position: relative;">
<el-header style="justify-content: space-between;">
<el-main class="nopadding" style="position: relative">
<el-header style="justify-content: space-between">
<div class="left-panel">
<span style="font-size:14px ;">生产进度</span>
<span style="font-size: 14px">生产进度</span>
</div>
<div class="right-panel">
<el-date-picker v-model="query.date" type="daterange" range-separator="" start-placeholder="开始时间"
end-placeholder="结束时间" value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-date-picker
v-model="query.date"
type="daterange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="YYYY-MM-DD"
/>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"
>查询</el-button
>
</div>
</el-header>
<scTable ref="table2" :data="dataList" row-key="id" stripe :height="bottomHeight" :hideDo="hideDo" :params="query">
<scTable
ref="table2"
:data="dataList"
row-key="id"
stripe
:height="bottomHeight"
:hideDo="hideDo"
:params="query"
>
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number" width="100" fixed="left">
<el-table-column
label="任务编号"
prop="number"
width="100"
fixed="left"
>
</el-table-column>
<el-table-column label="产品名称" prop="material" width="100" show-overflow-tooltip fixed="left">
<el-table-column
label="产品名称"
prop="material"
width="100"
show-overflow-tooltip
fixed="left"
>
<template #default="scope">
{{ scope.row.material_.name }}
</template>
</el-table-column>
<el-table-column label="规格" prop="specification" width="100" fixed="left">
<el-table-column
label="规格"
prop="specification"
width="100"
fixed="left"
>
<template #default="scope">
{{ scope.row.material_.specification }}
</template>
@ -229,15 +329,35 @@
{{ scope.row.material_.model }}
</template>
</el-table-column>
<el-table-column label="计划量" prop="count" width="100" fixed="left">
<!-- <el-table-column label="计划量" prop="count" width="100" fixed="left">
</el-table-column>
<el-table-column label="日均产量" prop="count_day" width="100" fixed="left">
<el-table-column
label="日均产量"
prop="count_day"
width="100"
fixed="left"
>
</el-table-column>
<el-table-column label="计划开工时间" prop="start_date" width="100" fixed="left">
<el-table-column
label="计划开工时间"
prop="start_date"
width="100"
fixed="left"
>
</el-table-column>
<el-table-column label="计划完工时间" prop="end_date" width="100" fixed="left">
</el-table-column>
<el-table-column v-for="item in columList" :label="item.data" :key="item" width="100">
<el-table-column
label="计划完工时间"
prop="end_date"
width="100"
fixed="left"
>
</el-table-column> -->
<el-table-column
v-for="item in columList"
:label="item.data"
:key="item"
width="100"
>
<div :class="bindClass(item)">
<div v-if="activeName == '10车间'">{{ item.count1 }}</div>
<div>{{ item.count2 }}</div>
@ -247,23 +367,49 @@
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" :activeName="activeName" @success="handleSaveSuccess"
@closed="dialog.save = false"></save-dialog>
<el-drawer title="任务详情" v-model="visibleRecord" :size="800" destroy-on-close @closed="visibleRecord = false">
<div class="right-panel tabsHeader">
<el-date-picker v-model="paramsObj.start_date" type="date" value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleDetailQuery">查询</el-button>
</div>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:activeName="activeName"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-drawer
title="任务详情"
v-model="visibleRecord"
:size="800"
destroy-on-close
@closed="visibleRecord = false"
>
<el-container v-loading="isloading">
<el-main style="padding: 0 20px 20px 20px">
<scTable ref="drawer_table" :apiObj="apiObj" row-key="id" stripe :params="paramsObj">
<el-header>
<div class="left-panel">
<el-date-picker
placeholder="工作日期"
v-model="paramsObj.start_date"
type="date"
value-format="YYYY-MM-DD"
@change="handleMtaskQuery"
/>
</div>
</el-header>
<el-main>
<scTable
ref="drawer_table"
:apiObj="apiObj"
row-key="id"
stripe
:params="paramsObj"
>
<el-table-column type="index" width="50" />
<el-table-column label="工段" prop="mgroup_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="数量" prop="count">
<el-table-column
label="工段"
prop="mgroup_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="任务编号" prop="number"> </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" show-overflow-tooltip>
@ -294,22 +440,22 @@ export default {
save: false,
},
apiUtask: this.$API.pm.utask.list,
paramsUtask7: { belong_dept__name: '7车间' },
paramsUtask8: { belong_dept__name: '8车间' },
paramsUtask10: { belong_dept__name: '10车间' },
paramsUtask7: { belong_dept__name: "7车间" },
paramsUtask8: { belong_dept__name: "8车间" },
paramsUtask10: { belong_dept__name: "10车间" },
apiObj: null,
paramsObj: { utask: '' },
paramsObj: { utask: "" },
query: {
page: 1,
page_size: 20,
date: ''
date: "",
},
utaskId: '',
utaskId: "",
isloading: false,
visibleRecord: false,
tableHeight: null,
hideDo: true,
activeName: '7车间',
activeName: "7车间",
dataList: [
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
// {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:250, count03:300 },
@ -319,11 +465,11 @@ export default {
selection: [],
selectedIds: [],
state_: {
10: '创建中',
14: '已分解',
20: '已下达',
30: '生产中',
40: '已提交'
10: "创建中",
14: "已分解",
20: "已下达",
30: "生产中",
40: "已提交",
},
topHeight: null,
bottomHeight: null,
@ -336,24 +482,29 @@ export default {
let day = date.getDate();
let timeNow = date.getTime();
let timer = 1000 * 60 * 60 * 24 * 2;
let data2 = new Date(timeNow - timer);//2
let data2 = new Date(timeNow - timer); //2
let year2 = data2.getFullYear();
let month2 = data2.getMonth() + 1;
let day2 = data2.getDate();
let startDate = year2 + '-' + month2 + '-' + day2;
let endDate = year + '-' + month + '-' + day;
let startDate = year2 + "-" + month2 + "-" + day2;
let endDate = year + "-" + month + "-" + day;
this.query.date = [startDate, endDate];
let heights = document.getElementById('topContainer').clientHeight;
this.topHeight = (heights - 45) + 'px';
this.bottomHeight = (heights - 65) + 'px';
let heights = document.getElementById("topContainer").clientHeight;
this.topHeight = heights - 45 + "px";
this.bottomHeight = heights - 65 + "px";
},
methods: {
// Class
bindClass(item) {
let count = item.count;
let classInfo = { countBlock: true, redColor: false, greenColor: false, orangeColor: false };
let classInfo = {
countBlock: true,
redColor: false,
greenColor: false,
orangeColor: false,
};
let countok = 0;
if (this.activeName == '10车间') {
if (this.activeName == "10车间") {
countok = item.count3;
} else {
countok = item.count2;
@ -368,7 +519,7 @@ export default {
}
}
return classInfo
return classInfo;
},
//
add() {
@ -388,29 +539,39 @@ export default {
async table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pm.utask.delete.req(row.id).then((res) => {
})
.then(() => {
this.$API.pm.utask.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
this.$refs.table7.refresh();
return res;
}).catch((err) => {
})
.catch((err) => {
return err;
});
}).catch(() => { });
})
.catch(() => {});
},
//
table_end(row) {
this.$confirm(`确定终止该任务吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.pm.utask.stop.req(row.id).then((res) => {
})
.then(() => {
this.$API.pm.utask.stop
.req(row.id)
.then((res) => {
this.$message.success("操作成功");
this.$refs.table10.refresh();
return res;
}).catch((err) => {
})
.catch((err) => {
return err;
});
}).catch(() => { });
})
.catch(() => {});
},
//
handleSaveSuccess(data, mode) {
@ -428,14 +589,14 @@ export default {
let arr = [];
let startTimer = new Date(start).getTime();
let endTimer = new Date(end).getTime();
let oneTime = 1000 * 60 * 60 * 24;//1
let oneTime = 1000 * 60 * 60 * 24; //1
let tempTime = startTimer;
while (tempTime <= endTimer) {
let dates = new Date(tempTime);
let year = dates.getFullYear();
let month = dates.getMonth() + 1;
let day = dates.getDate();
let item = year + '-' + month + '-' + day;
let item = year + "-" + month + "-" + day;
arr.push(item);
tempTime = tempTime + oneTime;
}
@ -446,8 +607,8 @@ export default {
},
handleSelectionChange(selection) {
this.selectedIds = [];
selection.forEach(item => {
this.selectedIds.push(item.id)
selection.forEach((item) => {
this.selectedIds.push(item.id);
});
},
//
@ -456,48 +617,60 @@ export default {
if (that.selectedIds.length > 0) {
let ids = that.selectedIds;
that.isloading = true;
that.$API.pm.utask.scheduemtasks.req({ ids: ids }).then(res => {
that.$API.pm.utask.assgin.req({ ids: ids }).then(res => {
that.$message.success('下达任务成功');
that.$API.pm.utask.scheduemtasks
.req({ ids: ids })
.then((res) => {
that.$API.pm.utask.assgin
.req({ ids: ids })
.then((res) => {
that.$message.success("下达任务成功");
that.isloading = false;
that.$refs.table7.refresh();
// that.$refs.table8.refresh();
that.$refs.table10.refresh();
}).catch(() => {
that.isloading = false;
})
}).catch(() => {
.catch(() => {
that.isloading = false;
});
})
.catch(() => {
that.isloading = false;
});
} else {
this.$message.error('未选择任何任务')
this.$message.error("未选择任何任务");
}
},
utaskAssgin() {
let that = this;
if (that.selectedIds.length > 0) {
that.isloading = true;
that.$API.pm.utask.assgin.req({ ids: that.selectedIds }).then(res => {
that.$message.success('下达任务成功');
that.$API.pm.utask.assgin
.req({ ids: that.selectedIds })
.then((res) => {
that.$message.success("下达任务成功");
that.isloading = false;
that.$refs.table7.refresh();
// that.$refs.table8.refresh();
that.$refs.table10.refresh();
}).catch(() => {
that.isloading = false;
})
.catch(() => {
that.isloading = false;
});
} else {
this.$message.error('未选择任何任务')
this.$message.error("未选择任何任务");
}
},
//
table_show(row) {
this.utaskId = row.id;
this.paramsObj = {}
this.paramsObj.utask = row.id;
this.apiObj = this.$API.pm.mtask.list;
this.visibleRecord = true;
},
handleMtaskQuery() {
this.$refs.drawer_table.queryData(this.paramsObj)
} ,
handleClick() {
this.columList = [];
this.dataList = [];
@ -506,45 +679,46 @@ export default {
let that = this;
that.columList = [];
let utask = val.id;
that.dataList = [val]
this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then(res => {
let columList = []
res.forEach(item => {
that.dataList = [val];
this.$API.pm.mtask.list.req({ utask: utask, page: 0 }).then((res) => {
let columList = [];
res.forEach((item) => {
let obj = {};
obj.state = item.state
obj.count1 = 0; obj.count2 = 0; obj.count3 = 0;
obj.state = item.state;
obj.count1 = 0;
obj.count2 = 0;
obj.count3 = 0;
obj.count = item.count;
obj.data = item.start_date;
if (that.activeName == '7车间') {
if (that.activeName == "7车间") {
let rate = (item.count_ok / item.count) * 100;
obj.count2 = item.count_ok;//7count_ok
obj.count3 = rate + '%';//7
} else if (that.activeName == '10车间') {
obj.count2 = item.count_ok; //7count_ok
obj.count3 = rate + "%"; //7
} else if (that.activeName == "10车间") {
let mlogs = item.mlogs;
if (mlogs.length > 0) {
for (let i = 0; i < mlogs.length; i++) {
if (mlogs[i].shift_name == '白班') {
obj.count1 = mlogs[i].count_ok;//10
if (mlogs[i].shift_name == "白班") {
obj.count1 = mlogs[i].count_ok; //10
} else {
obj.count2 = mlogs[i].count_ok;//10
obj.count2 = mlogs[i].count_ok; //10
}
obj.count3 = obj.count1 + obj.count2;//10
obj.count3 = obj.count1 + obj.count2; //10
}
}
}
columList.push(obj);
})
this.columList = columList
console.log(columList)
})
});
this.columList = columList;
console.log(columList);
});
},
},
};
</script>
<style scoped>
.right-panel>*+* {
.right-panel > * + * {
margin-left: 10px;
}
@ -567,7 +741,7 @@ export default {
}
.el-main.nopadding {
padding: 0 20px 0 20px
padding: 0 20px 0 20px;
}
.btnsContainer {
@ -575,6 +749,6 @@ export default {
position: absolute;
right: 20px;
margin-top: 4px;
z-index: 100
z-index: 100;
}
</style>

View File

@ -110,12 +110,13 @@
</el-footer>
</el-dialog>
<el-drawer title="任务详情" v-model="visibleRecord" :size="800" destroy-on-close @closed="visibleRecord = false">
<div class="right-panel tabsHeader">
<el-date-picker v-model="paramsObj.start_date" type="date" value-format="YYYY-MM-DD" />
<el-button type="primary" icon="el-icon-search" @click="handleDetailQuery">查询</el-button>
</div>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-header>
<div class="left-panel">
<el-date-picker placeholder="工作日期" v-model="paramsObj.start_date" type="date" value-format="YYYY-MM-DD" @change="handleMtaskQuery"/>
</div>
</el-header>
<el-main>
<scTable ref="drawer_table" :apiObj="apiObj" row-key="id" stripe :params="paramsObj">
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number">
@ -372,9 +373,9 @@ export default {
this.apiObj = this.$API.pm.mtask.list;
this.visibleRecord = true;
},
handleDetailQuery() {
this.$refs.drawer_table.refresh();
},
handleMtaskQuery() {
this.$refs.drawer_table.queryData(this.paramsObj)
} ,
//
async table_del(row) {
let that = this;

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="粗加工6车间" name="first">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :height="topHeight" :params="query" hidePagination
@row-click="rowClick">
@row-click="rowClick" hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="任务编号" prop="number">
</el-table-column>
@ -17,13 +17,19 @@
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
</template>
</el-table-column>
<el-table-column label="产品型号" prop="number">
<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="number">
<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="count">
<el-table-column label="生产日期" prop="start_date">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
@ -51,19 +57,19 @@
<div>
<el-row :gutter="20">
<el-col :span="13" style="border-right: 1px solid #eeeeee;">
<div class="tableTitle">工序进度</div>
<div class="tableTitle">工序进度</div>
<scTable ref="tableprocess" row-key="id" stripe :hideDo="hideDo" :data="processList" :height="bottomHeight">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="start_date">
<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="number">
</el-table-column>
<el-table-column label="型号规格" prop="specification">
<!-- <el-table-column label="型号规格" prop="specification">
</el-table-column>
<el-table-column label="规格" prop="number">
</el-table-column>
</el-table-column> -->
<el-table-column label="计划数量" prop="count">
</el-table-column>
<el-table-column label="合格数量" prop="count_ok">
@ -91,7 +97,7 @@
<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 label="批次" prop="batch" show-overflow-tooltip>
</el-table-column>
<el-table-column label="数量" prop="count" width="80">
</el-table-column>

View File

@ -1,34 +1,29 @@
<template>
<el-container>
<el-card style="height:fit-content;padding-bottom:10px;">
<el-card header="任务信息">
<el-form label-width="100px">
<el-row>
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="产品名称:">{{ orderObj.number }}</el-form-item>
<el-form-item class="infoForm" label="任务编号:">{{ mtaskObj.number }}</el-form-item>
</el-col>
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="型号:">{{ orderObj.number }}</el-form-item>
<el-form-item class="infoForm" label="产品名称:"><span v-if="mtaskObj.material_out_">{{ mtaskObj.material_out_.name }}</span></el-form-item>
</el-col>
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="规格">{{ orderObj.number }}</el-form-item>
<el-form-item class="infoForm" label="规格型号:"><span v-if="mtaskObj.material_out_">{{ mtaskObj.material_out_.specification }} {{ mtaskObj.material_out_.model }}</span></el-form-item>
</el-col>
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="计划数量">{{ orderObj.count }}</el-form-item>
<el-form-item class="infoForm" label="计划数量:">{{ mtaskObj.count }}</el-form-item>
</el-col>
<el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="计划日期">{{ orderObj.start_date }}</el-form-item>
<el-form-item class="infoForm" label="计划日期:">{{ mtaskObj.start_date }}</el-form-item>
</el-col>
<el-button v-if="orderObj.state!==40" type="primary" @click="submit">提交</el-button>
<el-button v-if="mtaskObj.state!==40" type="primary" @click="submit">提交任务</el-button>
</el-row>
</el-form>
</el-card>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addRow" :disabled="orderObj.state==40">新增记录</el-button>
<div style="padding: 4px; background-color: white">
<el-button type="primary" icon="el-icon-plus" @click="addRow" :disabled="mtaskObj.state==40">新增记录</el-button>
</div>
<div class="right-panel"></div>
</el-header>
<el-main class="nopadding">
<sc-form-table ref="table" v-model="relatedList" hideAdd drag-sort placeholder="暂无数据">
<el-table-column prop="type" label="工序" min-width="100">
<template #default="scope">
@ -96,13 +91,11 @@
</template>
</el-table-column>
</sc-form-table>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:mtask="orderObj.id"
:date="orderObj.start_date"
:mtask="mtaskObj.id"
:date="mtaskObj.start_date"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
@ -120,7 +113,7 @@
save: false,
},
task:'',
orderObj:{},
mtaskObj:{},
apiObj: null,
query: {
page:0,
@ -148,7 +141,7 @@
getTask(){
let that = this;
that.$API.pm.mtask.item.req(that.mtask).then((res) => {
that.orderObj = res;
that.mtaskObj = res;
that.getFormList();
})
},
@ -185,7 +178,7 @@
},
getFormList(){
let that = this;
that.$API.pm.mtask.related.req(that.orderObj.id).then(res=>{
that.$API.pm.mtask.related.req(that.mtaskObj.id).then(res=>{
that.related = res;
let ids = [];
res.forEach(item=>{
@ -238,7 +231,7 @@
}else{
debugger;
let obj = row;
obj.handle_date = this.orderObj.start_date;
obj.handle_date = this.mtaskObj.start_date;
obj.count_real = obj.count_use;
this.$API.wpm.mlog.create.req(obj).then(res=>{
this.relatedList[index].isedit = false;
@ -251,7 +244,7 @@
let obj = {};
let ids = data.join(',')
obj.mtask__in = ids;
obj.handle_date = this.orderObj.start_date;
obj.handle_date = this.mtaskObj.start_date;
obj.mtask__mgroup__belong_dept__name = '6车间';
this.$API.wpm.mlog.list.req(obj).then(res=>{
let data = res.results;
@ -288,7 +281,7 @@
submit(){
let that = this;
that.$confirm(`确定删除吗?`, "提示", {type: "warning"}).then(() => {
that.$API.pm.mtask.submitSameDay.req(that.orderObj.id).then(re=>{
that.$API.pm.mtask.submitSameDay.req(that.mtaskObj.id).then(re=>{
that.$message.success("提交成功");
}).catch((err) => {
return err;

File diff suppressed because it is too large Load Diff