This commit is contained in:
shijing 2021-12-29 17:02:21 +08:00
parent 0ddff915b8
commit 3ce616de61
8 changed files with 225 additions and 44 deletions

View File

@ -19,7 +19,7 @@
@expand-change="handlerExpand" @expand-change="handlerExpand"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
> >
<el-table-column label="任务编号"> <el-table-column label="任务编号" width="150">
<template slot-scope="scope">{{ scope.row.name }}</template> <template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="产品名称"> <el-table-column label="产品名称">

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-row style="position: absolute;z-index: 2000;top: -38px;right: 150px;display: flex"> <el-row class="searchWrap">
<el-date-picker <el-date-picker
v-model="timeRange" v-model="timeRange"
type="monthrange" type="monthrange"
@ -36,7 +36,7 @@
</el-dropdown> </el-dropdown>
</div> </div>
</el-row> </el-row>
<div class="left" style=" width: 400px ;float: left;border-right: 1px solid #f7f7f7"> <div class="left leftTable">
<leftMenu <leftMenu
:list="list" :list="list"
ref="leftMenu" ref="leftMenu"
@ -376,7 +376,7 @@
this.windowWidth=document.body.clientWidth?document.body.clientWidth:document.documentElement.clientWidth; this.windowWidth=document.body.clientWidth?document.body.clientWidth:document.documentElement.clientWidth;
} }
let currentYear = new Date().getFullYear(); let currentYear = new Date().getFullYear();
this.timeRange = [currentYear+'-01',currentYear+'-12']; this.timeRange = [currentYear+'-01',(currentYear+1)+'-12'];
this.list = [...this.proList]; this.list = [...this.proList];
document.addEventListener("scroll", this.handleScroll); document.addEventListener("scroll", this.handleScroll);
this.list=[...this.list]; this.list=[...this.list];
@ -385,7 +385,6 @@
this.setStoneLine(); this.setStoneLine();
}, },
computed: { computed: {
computedList() { computedList() {
let arr = []; let arr = [];
this.list.forEach(item => { this.list.forEach(item => {
@ -1019,6 +1018,11 @@
} }
}, },
watch: { watch: {
proList() {
this.list=[...this.proList];
this.handlerCheckList(this.list);
// this.proList = this.proList;
},
currentDaySize(newValue, oldValue) { currentDaySize(newValue, oldValue) {
this.list.forEach(item => { this.list.forEach(item => {
item.left = (item.left / oldValue.value) * newValue.value; item.left = (item.left / oldValue.value) * newValue.value;
@ -1043,7 +1047,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.chart { .chart {
height: 280px; height: 300px;
user-select: none; user-select: none;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@ -1375,4 +1379,17 @@
} }
} }
} }
.leftTable{
width: 400px ;
float: left;
height: 300px;
border-right: 1px solid #f7f7f7;
}
.searchWrap{
position: absolute;
z-index: 2000;
top: -38px;
right: 150px;
display: flex
}
</style> </style>

View File

@ -146,7 +146,7 @@
<el-radio v-model="is_testok" :label="testokTrue">检查合格</el-radio> <el-radio v-model="is_testok" :label="testokTrue">检查合格</el-radio>
<el-radio v-model="is_testok" :label="testokFalse">检查不合格</el-radio> <el-radio v-model="is_testok" :label="testokFalse">检查不合格</el-radio>
</el-form-item> </el-form-item>
<div class="dialog-footer" style="text-align: right"> <div class="dialog-footer" style="text-align: right" v-show="!isDisabled">
<el-button @click="recordCancel"> </el-button> <el-button @click="recordCancel"> </el-button>
<el-button type="primary" @click="submitfield('1')">保存</el-button> <el-button type="primary" @click="submitfield('1')">保存</el-button>
<el-button type="warning" @click="submitfield('2')">提交</el-button> <el-button type="warning" @click="submitfield('2')">提交</el-button>
@ -182,6 +182,10 @@
hasPicture:{ hasPicture:{
type:Boolean, type:Boolean,
default:false default:false
},
isDisabled:{
type:Boolean,
default:false
} }
}, },
mounted() { mounted() {

View File

@ -786,6 +786,7 @@
fieldData(isSubmit){ fieldData(isSubmit){
let that = this; let that = this;
that.field = []; //检查项目 that.field = []; //检查项目
debugger;
let submit = isSubmit=='1'?false:true; let submit = isSubmit=='1'?false:true;
that.formData.forEach((item) => { that.formData.forEach((item) => {
let field_value = 0; let field_value = 0;
@ -801,12 +802,10 @@
is_hidden: item.is_hidden is_hidden: item.is_hidden
}); });
}); });
// that.testrecord.form = that.formID;//检查表
that.testrecord.record_data = that.field;//检查项列表 that.testrecord.record_data = that.field;//检查项列表
that.testrecord.is_testok = that.is_testok;//检查表检查结果 that.testrecord.is_testok = that.is_testok;//检查表检查结果
// that.testrecord.wproduct = that.wproductId;//半成品ID
// that.testrecord.is_submited = true;
that.testrecord.id = that.recordId; that.testrecord.id = that.recordId;
debugger;
if(submit){//提交 if(submit){//提交
this.$emit('recordSubmit',that.testrecord); this.$emit('recordSubmit',that.testrecord);
}else {//保存 }else {//保存

View File

@ -1,11 +1,40 @@
<template> <template>
<div class="dashboard-container"> <div class="dashboard-container">
<el-card>
<div class="cards">
<div class="cardFirstText">本月2</div>
<div class="cardSecondText">20</div>
<div>合同总数</div>
</div>
<div class="cards">
<div class="cardFirstText">本月20</div>
<div class="cardSecondText">20</div>
<div>生产订单总数</div>
</div>
<div class="cards">
<div class="cardFirstText">在制10</div>
<div class="cardSecondText">20</div>
<div>已排产生产任务</div>
</div>
<div class="cards">
<div class="cardFirstText">本月4</div>
<div class="cardSecondText">2</div>
<div>累计交付产品数</div>
</div>
<div class="cards">
<div class="cardFirstText">本月2</div>
<div class="cardSecondText">2</div>
<div>累计不合格产品数</div>
</div>
</el-card>
<el-card>
<el-badge :value="count.total_count" class="item" @click.native="gotoTicketPage"> <el-badge :value="count.total_count" class="item" @click.native="gotoTicketPage">
<el-icon class="el-icon-s-management" style="font-size: 70px;color: #d29898"></el-icon> <el-icon class="el-icon-s-management" style="font-size: 70px;color: #d29898"></el-icon>
</el-badge> </el-badge>
<div></div> <div></div>
<div class="dashboard-text">name: {{ name }}</div> <div class="dashboard-text">name: {{ name }}</div>
<div class="dashboard-text">perms: <span v-for="perm in perms" :key="perm">{{ perm }}</span></div> <div class="dashboard-text">perms: <span v-for="perm in perms" :key="perm">{{ perm }}</span></div>
</el-card>
</div> </div>
</template> </template>
@ -37,11 +66,32 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.dashboard { .dashboard {
&-container { &-container {
margin: 30px; margin: 5px 6px;
} }
&-text { &-text {
font-size: 30px; font-size: 30px;
line-height: 46px; line-height: 46px;
} }
} }
.cards{
width: 240px;
color: #ffffff;
background: #abccec;
text-align: center;
border-radius: 4px;
padding: 10px;
line-height: 30px;
float: left;
margin: 15px;
.cardFirstText{
text-align: left;
padding-left: 20px;
}
.cardSecondText{
font-size: 30px;
}
}
.cards:hover{
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
}
</style> </style>

View File

@ -35,6 +35,7 @@
stripe stripe
style="width: 100%" style="width: 100%"
height="300" height="300"
@row-click="tableRowClick"
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
@ -114,19 +115,11 @@
</div> </div>
</template> </template>
<script> <script>
import {getPlanGantt} from "@/api/srm";
import gantt from "@/components/Gantt/index"; import gantt from "@/components/Gantt/index";
import { getordertoplan } from "@/api/sam"; import { getProductionplanList} from "@/api/pm";
import {
createProductionplan,
getProductionplanList,
createsubplan,
} from "@/api/pm";
import { getMaterialList } from "@/api/mtm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorderplan = {};
export default { export default {
components: { Pagination, gantt }, components: { Pagination, gantt },
data() { data() {
@ -164,17 +157,20 @@ export default {
this.getplanList(); this.getplanList();
}, },
//生产计划列表 //生产计划列表
tableRowClick(row){
//列表
getplanList() {
let that = this; let that = this;
this.listLoading = true; getPlanGantt({}).then(res=>{
getProductionplanList(this.listQuery).then((response) => { if(res.code===200){
if (response.data) { let arr =[],list=[];
this.productionplanList = response.data; let li = res.data.results;
let list = response.data.results; li.forEach((item)=>{
let arr = []; if(item.id===row.id){
list.forEach((item) => { list.push(item)
}
});
debugger;
console.log(list);
list.forEach(item => {
if (!item.children || item.children.length < 1) { if (!item.children || item.children.length < 1) {
let startTime = new Date(item.start_date).getTime(); let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime(); let endTime = new Date(item.end_date).getTime();
@ -191,8 +187,84 @@ export default {
obj.productNum = item.product_.specification; obj.productNum = item.product_.specification;
obj.isShow = true; obj.isShow = true;
arr.push(obj); arr.push(obj);
} else if (item.children && item.children.length >= 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let temp =[];
let parentId = item.id;
let children = item.children;
children.forEach(child => {
let start = new Date(child.start_date).getTime();
let end = new Date(child.end_date).getTime();
let objChild = new Object();
objChild.name = child.number;
objChild.id = child.id;
objChild.top=50;
objChild.parentId=parentId;
objChild.startTime = start;
objChild.endTime = end;
objChild.planTime = [start,end];
objChild.per = child.count;
objChild.per1 = child.count_real;
objChild.type = 1;
objChild.productName = child.product_.name;
objChild.productNum = child.product_.specification;
objChild.isShow= true;
temp.push(objChild);
});
let obj=new Object();
obj.name=item.number;
obj.id=item.id;
obj.top=20;
obj.startTime=startTime;
obj.endTime=endTime;
obj.planTime = [startTime,endTime];
obj.per=item.count;
obj.per1=item.count_real;
obj.type=3;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
obj.children = temp;
obj.isShow= true;
arr.push(obj);
} }
that.proList = arr;
debugger; debugger;
console.log(arr)
});
}else{
that.$message.error(res.msg);
}
})
},
//列表
getplanList() {
let that = this;
this.listLoading = true;
getProductionplanList(this.listQuery).then((response) => {
if (response.data) {
this.productionplanList = response.data;
let list = response.data.results;
let arr = [];
list.forEach((item) => {
// if (!item.children || item.children.length < 1) {
let startTime = new Date(item.start_date).getTime();
let endTime = new Date(item.end_date).getTime();
let obj = new Object();
obj.name = item.number;
obj.id = item.id;
obj.top = 20;
obj.startTime = startTime;
obj.endTime = endTime;
obj.planTime = [startTime, endTime];
obj.per = item.count;
obj.type = 1;
obj.productName = item.product_.name;
obj.productNum = item.product_.specification;
obj.isShow = true;
arr.push(obj);
// }
that.proList = arr; that.proList = arr;
}); });
} }

View File

@ -377,6 +377,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<reviewForm <reviewForm
v-if="limitedReview"
:results="fieldList" :results="fieldList"
:originList="originList" :originList="originList"
:formID="recordform" :formID="recordform"
@ -397,11 +398,13 @@
@close="recordCancel" @close="recordCancel"
> >
<customForm <customForm
v-if="recordVisible"
:results="fieldList" :results="fieldList"
:hasPicture="hasPicture" :hasPicture="hasPicture"
:formID="recordform" :formID="recordform"
:wproduct="wproduct" :wproduct="wproduct"
:recordId="recordId" :recordId="recordId"
:isDisabled="isDisabled"
@recordSubmit="recordSubmit" @recordSubmit="recordSubmit"
@recordSave="recordSave" @recordSave="recordSave"
@recordCancel="recordCancel" @recordCancel="recordCancel"
@ -706,6 +709,7 @@
mutipID: [], mutipID: [],
wproduct: null, wproduct: null,
isPost: false, isPost: false,
isDisabled: false,
origin_test: null, origin_test: null,
hasPicture: false, hasPicture: false,
outerVisible: false, outerVisible: false,
@ -1008,6 +1012,7 @@
} }
that.fieldList = arr; that.fieldList = arr;
that.$nextTick(()=>{ that.$nextTick(()=>{
that.isDisabled = false;
that.recordVisible = true; that.recordVisible = true;
}); });
}) })
@ -1050,7 +1055,45 @@
}, },
//点击记录里的查看 //点击记录里的查看
handleRecordDetail(scope){ handleRecordDetail(scope){
let that = this;
that.recordVisible = false;
that.recordId = scope.row.id;
that.recordform = scope.row.form;
that.formName = scope.row.form_.name;
getrffieldList({form: this.recordform, page: 1, page_size: 100}).then((response) => {
if (response.data) {
that.hasPicture = false;
let fieldList = response.data.results;
that.fieldList = [...fieldList];
let arr = fieldList.filter(item => {
return item.field_type === 'draw'
});
if (arr.length > 0) {
that.hasPicture = true;
}
getTestRecordItem(scope.row.id).then((res) => {
let arr = [];
let fieldList = res.data.record_data;
for(let i=0;i<that.fieldList.length;i++){
let obj = that.fieldList[i];
obj.is_testok = null;
for(let j=0;j<fieldList.length;j++){
if(that.fieldList[i].field_key===fieldList[j].field_key){
obj.id = fieldList[j].id;
obj.is_testok = fieldList[j].is_testok;
obj.field_value = fieldList[j].field_value;
}
}
arr.push(obj)
}
that.fieldList = arr;
that.$nextTick(()=>{
that.isDisabled = true;
that.recordVisible = true;
});
})
}
});
}, },
//半产品复检 //半产品复检
handleReview() { handleReview() {
@ -1110,6 +1153,7 @@
that.hasPicture = true; that.hasPicture = true;
} }
that.$nextTick(()=>{ that.$nextTick(()=>{
that.isDisabled = false;
that.recordVisible = true; that.recordVisible = true;
}); });
}) })

View File

@ -32,12 +32,6 @@
<el-table-column align="center" label="操作" width="220px"> <el-table-column align="center" label="操作" width="220px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
@click="handleInspection(scope)"
>检验
</el-link
>
<el-link <el-link
v-if="checkPermission(['warehouse_update'])&&scope.row.test===null" v-if="checkPermission(['warehouse_update'])&&scope.row.test===null"
@click="handleInspection(scope)" @click="handleInspection(scope)"
@ -181,6 +175,7 @@
@close="recordCancel" @close="recordCancel"
> >
<customForm <customForm
v-if="innerVisible"
:results="fieldList" :results="fieldList"
:hasPicture="hasPicture" :hasPicture="hasPicture"
:formID="recordform" :formID="recordform"