diff --git a/hb_client/src/api/wpm.js b/hb_client/src/api/wpm.js index 9f67cd4..5c585ca 100644 --- a/hb_client/src/api/wpm.js +++ b/hb_client/src/api/wpm.js @@ -283,13 +283,13 @@ export function createOutputs(data) { export function recordInit(id) { return request({ - url: `/wpm/operation_record/${id}/init/`, + url: `/wpm/operation_record/${id}/`, method: 'GET', }) } -//半产品复检 -export function wproductReview(data) { +//testInit +export function testInit(data) { return request({ url: '/wpm/wproduct/test_init/', method: 'post', diff --git a/hb_client/src/components/customForm/index.vue b/hb_client/src/components/customForm/index.vue index c161268..6231f8f 100644 --- a/hb_client/src/components/customForm/index.vue +++ b/hb_client/src/components/customForm/index.vue @@ -155,9 +155,9 @@ 检查不合格 @@ -188,21 +188,12 @@ type:Number, default:null }, - origin_test: { - type:Number, - default:null - }, hasPicture:{ type:Boolean, default:false - }, - recordItem:{ - type:Boolean, - default:false } }, mounted() { - debugger; let that = this; that.checkForm = {}; this.form = this.formID; @@ -214,7 +205,6 @@ that.formData.push(obj) }); that.formData=[...formData]; - debugger; for(let i=0;i { - if(!item.is_hidden){ - that.field.push({ - id: item.id, - field_value: that.checkForm[item.field_key], - is_testok: item.is_testok,//单项检查结果 - is_hidden: item.is_hidden - }); - } - }); - that.testrecord.record_data = that.field;//检查项列表 - that.testrecord.is_testok = that.is_testok;//检查表检查结果 - that.testrecord.id = that.recordId;//记录id - if(submit){//提交 - this.$emit('recordSubmit',that.testrecord); - }else {//保存 - this.$emit('recordSave',that.testrecord); + that.formData.forEach((item) => { + if(!item.is_hidden){ + that.field.push({ + id: item.id, + field_value: that.checkForm[item.field_key], + is_testok: item.is_testok,//单项检查结果 + is_hidden: item.is_hidden + }); } - }else{//第一次操作时 - that.formData.forEach((item) => { - if(!item.is_hidden){ - that.field.push({ - form_field: item.id, - field_value: that.checkForm[item.field_key], - is_testok: item.is_testok,//单项检查结果 - is_hidden: item.is_hidden - }); - } - }); - if(that.origin_test!==null){ - that.testrecord.origin_test = that.origin_test; - } - that.testrecord.record_data = that.field;//检查项列表 - that.testrecord.is_testok = that.is_testok;//检查表检查结果 - that.testrecord.form = that.formID;//检查表 - that.testrecord.wproduct = that.wproductId;//半成品ID - that.testrecord.is_submited = submit;//提交状态false保存 - this.$emit('formFunc',that.testrecord);//第一次保存或提交 + }); + that.testrecord.record_data = that.field;//检查项列表 + that.testrecord.is_testok = that.is_testok;//检查表检查结果 + that.testrecord.id = that.recordId;//记录id + if(submit){//提交 + this.$emit('recordSubmit',that.testrecord); + }else {//保存 + this.$emit('recordSave',that.testrecord); } }, + recordCancel(){ + this.$emit('recordCancel','') + }, } } diff --git a/hb_client/src/components/customForm/review.vue b/hb_client/src/components/customForm/review.vue index 63f94c3..78cadc0 100644 --- a/hb_client/src/components/customForm/review.vue +++ b/hb_client/src/components/customForm/review.vue @@ -9,7 +9,7 @@ @@ -40,7 +40,7 @@ 检查不合格 @@ -257,7 +259,7 @@ type:Number, default:0 }, - origintest: { + recordId: { type:Number, default:0 }, @@ -268,9 +270,9 @@ }, mounted() { let that = this; - this.form = this.formID; + that.form = this.formID; let formData=this.results; - this.origins=this.originList; + // that.origins=this.originList; that.wproductId=this.wproduct; that.origin_test=this.origintest; formData.forEach(item => { @@ -297,11 +299,11 @@ that.judgeList.push(obj) }); //原始表的数据 - for(let i=0;i { return item.field_type === 'draw'; @@ -331,10 +333,10 @@ checkForm:{}, originForm:{}, testrecord:{ - form:this.formID, + // form:this.formID, record_data:[], is_testok:true, - wproduct:null, + // wproduct:null, }, origin_test:null, canvas:null, @@ -361,7 +363,7 @@ } }, methods:{ - filterBlock(parent,rule){ + filterBlock(parent,rule,index,field_key){ // debugger; let that = this; if(parent!==''&&parent!==null&&parent!==undefined){ @@ -408,6 +410,12 @@ rea = true; } } + if(rea){ + that.formData[index].is_hidden = false; + }else{ + that.formData[index].is_hidden = true; + that.checkForm[field_key] = null; + } return rea; }else{ let temp =rule.match(reg)[0]; @@ -415,13 +423,21 @@ let a = rule.replace(key, 'yy'); a = a.replace(key, 'yy'); let yy = "'"+that.checkForm[key]+"'"; + if(eval(eval(a))){ + that.formData[index].is_hidden = false; + }else{ + that.formData[index].is_hidden = true; + that.checkForm[field_key] = null; + } return eval(eval(a)); - // return eval("'"+y+"'"+str); } }else{ + that.formData[index].is_hidden = true; + that.checkForm[field_key] = null; return false; } }else{ + that.formData[index].is_hidden = false; return true; } }, @@ -741,7 +757,7 @@ } }, //提交检查项目 - submitfield() { + submitfield(isSubmit) { let that = this; let drawArr = that.formData.filter(item=>{ return item.field_type==='draw'; @@ -765,24 +781,39 @@ } }); }else{ - that.fieldData(); + that.fieldData(isSubmit); } }, - fieldData(){ + fieldData(isSubmit){ let that = this; that.field = []; //检查项目 + let submit = isSubmit=='1'?false:true; that.formData.forEach((item) => { - that.field.push({ - form_field: item.id, - field_value: that.checkForm[item.field_key], - is_testok: item.is_testok//单项检查结果 - }); + if(!item.is_hidden){ + that.field.push({ + id: item.id, + field_value: that.checkForm[item.field_key], + is_testok: item.is_testok,//单项检查结果 + is_hidden: item.is_hidden + }); + } }); - that.testrecord.form = that.formID;//检查表 + // that.testrecord.form = that.formID;//检查表 that.testrecord.record_data = that.field;//检查项列表 that.testrecord.is_testok = that.is_testok;//检查表检查结果 - that.testrecord.wproduct = that.wproductId;//半成品ID - this.$emit('formFunc',that.testrecord); + // that.testrecord.wproduct = that.wproductId;//半成品ID + // that.testrecord.is_submited = true; + that.testrecord.id = that.recordId; + debugger; + if(submit){//提交 + this.$emit('recordSubmit',that.testrecord); + }else {//保存 + this.$emit('recordSave',that.testrecord); + } + + }, + recordCancel(){ + this.$emit('recordCancel','') }, } } diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index dab3c98..91006e6 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -183,8 +183,8 @@ export const asyncRoutes = [ path: 'gantt', name: 'gantt', component: () => import('@/views/pm/gantt'), - meta: { title: '甘特图', perms: ['vendor_manage'] }, - hidden: true + meta: { title: '甘特图', icon: 'example',perms: ['vendor_manage'] }, + // hidden: true } ] } diff --git a/hb_client/src/views/pm/components/slider.vue b/hb_client/src/views/pm/components/slider.vue index e8062cd..edd3982 100644 --- a/hb_client/src/views/pm/components/slider.vue +++ b/hb_client/src/views/pm/components/slider.vue @@ -2,7 +2,6 @@
-
-
- -
-
-
-
-
+
+
+
+ +
-
{{ item.year }}年{{ key }}月
-
+ class="rightLine" + :style="{ left: rightLineX + 'px' }" + ref="rightLine" + @mousedown="rightLineMousedown" + >
-
{{ fixdTopMonth }}
-
-
+
+
- +
-
-
- +
-
-
- - +
+ + {{this.currentDaySize.label}} - - - {{ item.label }} - - - -
- -
+ {{ item.label }} + + + +
+ +
-
- {{ currentProjectMsg.name }} + class="projectMsg" + > +
+ {{ currentProjectMsg.name }} +
+
+ 工作周期: + {{ currentProjectMsg.allTime }}天 +
+
+ 当前进度: + {{ currentProjectMsg.per }} +
+
+ 合格数量: + {{ currentProjectMsg.per1 }} +
+
+ 开始时间: + {{ currentProjectMsg.startTime }} +
+
+ 结束时间: + {{ currentProjectMsg.endTime }} +
-
- 工作周期: - {{ currentProjectMsg.allTime }}天 -
-
- 当前进度: - {{ currentProjectMsg.per }} -
-
- 合格数量: - {{ currentProjectMsg.per1 }} -
-
- 开始时间: - {{ currentProjectMsg.startTime }} -
-
- 结束时间: - {{ currentProjectMsg.endTime }} -
-
-
+
+
@@ -284,8 +288,8 @@ }, data() { return { - //当前项是否是子集 disable: true, + //当前项是否是子集 isChildren: false, dialogVal: false, //title @@ -375,33 +379,35 @@ let that = this; getPlanGantt({}).then(res=>{ if(res.code===200){ - debugger; + // debugger; let arr =[]; let list = res.data.results; list.forEach(item => { if (!item.children || item.children.length < 1) { - let startTime = new Date(item.startTime).getTime(); - let endTime = new Date(item.endDate).getTime(); + 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.per1=item.count_real; - obj.type=3; + obj.type=1; + obj.isShow= true; arr.push(obj); } else if (item.children && item.children.length >= 1) { let startTime = new Date(item.start_date).getTime(); - let endTime = new Date(item.start_date).getTime(); + let endTime = new Date(item.end_date).getTime(); debugger; let temp =[]; let parentId = item.id; let children = item.children; children.forEach(child => { - let start = new Date(item.start_date).getTime(); - let end = new Date(item.end_date).getTime(); + 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; @@ -409,6 +415,7 @@ 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; @@ -422,6 +429,7 @@ 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; @@ -430,7 +438,7 @@ arr.push(obj); } that.list = arr; - that.handlerCheckList(arr); + that.handlerCheckList(that.list); }); console.log(that.list); }else{ @@ -440,7 +448,7 @@ }, computed: { computedList() { - debugger; + // debugger; console.log(this.list); let arr = []; this.list.forEach(item => { @@ -485,7 +493,7 @@ //过滤导入的数据 handlerCheckList(list) { list.forEach((item, index) => { - item.planTime = []; + item.planTime = [item.startTime, item.endTime]; item.left = this.computedTimeWidth(item.startTime); item.widthMe = item.widthChild = this.computedTimeWidth(item.startTime, item.endTime) ; item.isShow = true; @@ -495,14 +503,11 @@ item.isexpand = true; if (item.children.length > 0) { item.children.forEach((k, i) => { - k.planTime = []; - k.top = item.top + i * 40 + 35; + k.planTime = [k.startTime, k.endTime]; + k.top = item.top + i * 40 + 40; k.isShow = true; k.left = this.computedTimeWidth(k.startTime); - k.widthMe = k.widthChild = this.computedTimeWidth( - k.startTime, - k.endTime - ); + k.widthMe = k.widthChild = this.computedTimeWidth(k.startTime,k.endTime,k); }); } } @@ -514,14 +519,11 @@ item.isexpand = true; if (item.children.length > 0) { item.children.forEach((z, o) => { - z.planTime = []; - z.top = item.top + o * 40; + z.planTime = [z.startTime, z.endTime]; + z.top = item.top + o * 40+40; z.isShow = true; z.left = this.computedTimeWidth(z.startTime); - z.widthMe = z.widthChild = this.computedTimeWidth( - z.startTime, - z.endTime - ); + z.widthMe = z.widthChild = this.computedTimeWidth(z.startTime, z.endTime,z); }); } } @@ -564,34 +566,17 @@ } this.resetTop(rowIndex, !expand, true); }, - //分组添加子集 - handleGroupAdd(row) { - this.$nextTick(() => { - this.$refs.dialogAdd.resetFields(); - }); - this.currentListIndex = this.list.findIndex(item => { - return item.id == row.id; - }); - this.dialogVal = true; - this.isChildren = true; - }, // 根据时间计算距离 computedTimeWidth(startTime, endTime) { - let start = new Date(startTime).getTime(); - let end = new Date(endTime).getTime(); - let left = - (Math.floor( - start - new Date(`${this.currentYear - 1}/01/01`).getTime() - ) / - (1000 * 60 * 60 * 24)) * - this.currentDaySize.value; - let width = - (Math.floor(end - start) / (1000 * 60 * 60 * 24)) * - this.currentDaySize.value + - this.currentDaySize.value; if (!endTime) { + let left = + (Math.floor( startTime - new Date(`${this.currentYear - 1}/01/01`).getTime() ) / + (1000 * 60 * 60 * 24)) *this.currentDaySize.value; return left; } else { + let width = (Math.floor(endTime - startTime) / (1000 * 60 * 60 * 24)) * this.currentDaySize.value + this.currentDaySize.value; + debugger; + console.log(width); return width; } }, @@ -704,9 +689,8 @@ behavior: "smooth" }); }, - //更改daySize + //更改daySize-----按天/按周/按月 handleSetDaySize(item) { - // console.log(item); this.currentDaySize = item; this.days.forEach((item, index) => { item.width = (index + 1) * this.currentDaySize.value; @@ -804,8 +788,7 @@ * @param {Boolean|String} time */ computedWithTime(width, time) { - let startTime = - (width / this.currentDaySize.value) * (1000 * 60 * 60 * 24) + + let startTime = (width / this.currentDaySize.value) * (1000 * 60 * 60 * 24) + new Date(`${this.currentYear - 1}/01/01`).getTime(); let s = new Date(startTime); if (time && time == true) { diff --git a/hb_client/src/views/wpm/need.vue b/hb_client/src/views/wpm/need.vue index 3e6f0a8..3664c2c 100644 --- a/hb_client/src/views/wpm/need.vue +++ b/hb_client/src/views/wpm/need.vue @@ -40,7 +40,7 @@ 检验记录 @@ -85,11 +85,22 @@ @@ -146,8 +157,12 @@ v-if="checkPermission(['warehouse_update'])" @click="handlePutin(scope)" >入库 - + + 检验记录 + @@ -194,8 +209,12 @@ v-if="checkPermission(['warehouse_update'])" @click="handleInspection(scope)" >检验 - + + 检验记录 + @@ -220,7 +239,7 @@ > - + + <!–复检检验表单–> - + --> - + + + + + @@ -314,8 +354,6 @@ :data="recordList" border height="400" - @close="pageRefresh" - @closed="pageRefresh" > @@ -387,7 +425,7 @@