diff --git a/hb_client/src/api/qm.js b/hb_client/src/api/qm.js index be4d101..32ddc26 100644 --- a/hb_client/src/api/qm.js +++ b/hb_client/src/api/qm.js @@ -57,4 +57,41 @@ export function deleteTestitem(id, data) { data }) } - +//检测记录 +export function getTestRecord(query) { + return request({ + url: '/qm/testrecord/', + method: 'get', + params: query + }) +} +//检测记录 +export function getTestRecordItem(id) { + return request({ + url: `/qm/testrecord/${id}/`, + method: 'get' + }) +} +//检测记录更改保存 +export function putTestRecordItem(id,data) { + return request({ + url: `/qm/testrecord/${id}/`, + method: 'put', + data + }) +} +//检测记录删除 +export function delTestRecordItem(id) { + return request({ + url: `/qm/testrecord/${id}/`, + method: 'delete' + }) +} +//检测记录提交 +export function subTestRecordItem(id,data) { + return request({ + url: `/qm/testrecord/${id}/submit/`, + method: 'post', + data + }) +} diff --git a/hb_client/src/api/srm.js b/hb_client/src/api/srm.js new file mode 100644 index 0000000..7e3a614 --- /dev/null +++ b/hb_client/src/api/srm.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' +//生产进度表 +export function getPlanGantt(data) { + return request({ + url: '/srm/gantt/plan/', + method: 'get', + params: data + }) +} diff --git a/hb_client/src/api/wpm.js b/hb_client/src/api/wpm.js index abc5bd7..9f67cd4 100644 --- a/hb_client/src/api/wpm.js +++ b/hb_client/src/api/wpm.js @@ -181,8 +181,8 @@ export function getrecordList(query) { //操作提交自定义表 export function createRecord(id, data) { return request({ - url: `/wpm/operation_record/${id}/submit/`, - method: 'post', + url: `/wpm/operation_record/${id}/`, + method: 'put', data }) } diff --git a/hb_client/src/components/customForm/index.vue b/hb_client/src/components/customForm/index.vue index 7bf1fa1..c161268 100644 --- a/hb_client/src/components/customForm/index.vue +++ b/hb_client/src/components/customForm/index.vue @@ -9,7 +9,7 @@
- + +
@@ -155,7 +156,8 @@ @@ -182,29 +184,49 @@ type:Number, default:0 }, + recordId: { + 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; let formData=this.results; that.wproductId=this.wproduct; formData.forEach(item => { let obj = new Object(); obj = item; - obj.is_testok = null;//是否合格 that.formData.push(obj) }); - that.formData=[...that.formData]; - + that.formData=[...formData]; + debugger; for(let i=0;i { return item.need_judge === true; @@ -217,9 +239,9 @@ let imag= this.formData.filter(item => { return item.field_type === 'draw'; }); - that.img = new Image(); + /* that.img = new Image(); that.img.crossOrigin = ''; - that.img = 'http://47.95.0.242:2222'+imag[0].draw_template; + that.img = 'http://47.95.0.242:2222'+imag[0].draw_template;*/ setTimeout(function(){ that.canvasInit(); },500); @@ -252,11 +274,12 @@ judgeList:[],//判定数组 is_testok:true, testokTrue:true, + is_save:false, testokFalse:false, } }, methods:{ - filterBlock(parent,rule){ + filterBlock(parent,rule,index,field_key){ // debugger; let that = this; if(parent!==''&&parent!==null&&parent!==undefined){ @@ -305,6 +328,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]; @@ -312,13 +341,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; } }, @@ -638,7 +675,7 @@ } }, //提交检查项目 - submitfield() { + submitfield(isSubmit) { let that = this; let drawArr = that.formData.filter(item=>{ return item.field_type==='draw'; @@ -657,29 +694,58 @@ if(res){ let key = drawArr[0].field_key; that.imgUrl=res.data.file; - that.checkForm[key] = that.imgUrl; - that.fieldData(); + that.checkForm[key] = res.data.file; + that.fieldData(isSubmit); } }); }else{ - that.fieldData(); + that.fieldData(isSubmit); } }, - fieldData(){ + fieldData(isSubmit){ let that = this; that.field = []; //检查项目 - that.formData.forEach((item) => { - that.field.push({ - form_field: item.id, - field_value: that.checkForm[item.field_key], - is_testok: item.is_testok//单项检查结果 + let submit = isSubmit=='1'?false:true; + if(that.recordItem){//有记录 + 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 + }); + } }); - }); - 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.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); + } + }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);//第一次保存或提交 + } }, } } diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index f5f751f..dab3c98 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -185,7 +185,7 @@ export const asyncRoutes = [ component: () => import('@/views/pm/gantt'), meta: { title: '甘特图', perms: ['vendor_manage'] }, hidden: true - }, + } ] } , diff --git a/hb_client/src/views/pm/components/leftMenu.vue b/hb_client/src/views/pm/components/leftMenu.vue index 4b66728..2167e1c 100644 --- a/hb_client/src/views/pm/components/leftMenu.vue +++ b/hb_client/src/views/pm/components/leftMenu.vue @@ -19,36 +19,13 @@ @expand-change="handlerExpand" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" > - - + + + + + - - - - -
@@ -83,70 +60,6 @@ export default { checkList: [], isShowHeaderBox: false, menuOpen: false, - headerList: { - name: true, - ower: true, - per: true, - type: true - }, - projectType: { - 1: "计划项目", - 2: "里程碑", - 3: "分组" - }, - menuLists: ["编辑", "里程碑", "分组", "删除"], - columns: [ - { - prop: "name", - label: "名称", - width: "200px", - resizable: false - }, - { - prop: "ower", - label: "负责人", - align: "center", - resizable: false - }, - { - prop: "per", - label: "进度", - align: "center", - resizable: false - }, - { - prop: "type", - label: "项目类型", - align: "center", - resizable: false - } - ], - columnsCopy: [ - { - prop: "name", - label: "名称", - width: "200px", - resizable: false - }, - { - prop: "ower", - label: "负责人", - align: "center", - resizable: false - }, - { - prop: "per", - label: "进度", - align: "center", - resizable: false - }, - { - prop: "type", - label: "项目类型", - align: "center", - resizable: false - } - ], //当前点击的row currentRow: {} }; @@ -166,123 +79,14 @@ export default { // console.log(row, expanded); this.$emit("handlerExpand", row, expand); }, - handlerSave() { - this.isShowHeaderBox = false; - let arr = []; - this.columnsCopy.forEach(item => { - if (this.headerList[item.prop] == true) { - arr.push(item); - } - }); - this.columns = arr; - }, maskClick() { this.isShowHeaderBox = false; this.menuOpen = false; this.currentRow = {}; }, - handlerRowClick(row, column) { - // console.log(column); - if (row.type != 3) { - this.$emit("handlerRowClick", row); - } + handlerRowClick(row) { + this.$emit("handlerRowClick", row); }, - handleRowMore(row, e) { - this.menuLists = ["编辑", "里程碑", "分组", "删除"]; - if (row.parentId) { - this.menuLists = ["编辑", "里程碑", "删除"]; - } - if (row.type == "1") { - this.menuLists[1] = "里程碑"; - } else if (row.type == "2") { - this.menuLists[1] = "计划项目"; - } else if (row.type == "3") { - this.menuLists = ["编辑", "添加任务", "删除分组"]; - } - this.menuOpen = true; - this.currentRow = row; - let s = this.$refs.menulist.style; - s.top = e.y - 10 - 40 + "px"; - s.left = e.x + 20 + "px"; - }, - handleShowHeaderCheckBox() { - this.isShowHeaderBox = !this.isShowHeaderBox; - }, - handleMenuClick(index, name) { - this.menuOpen = false; - if (index == 3) { - this.$confirm("此操作将永久删除该项目, 是否继续?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - center: true - }) - .then(() => { - this.$emit("handlerDel", this.currentRow); - }) - .catch(() => {}); - } else if (index == 1) { - if (this.currentRow.type == 3) { - console.log("添加任务"); - this.$emit("handleGroupAdd", this.currentRow); - return; - } - this.$confirm(`确定转为${this.menuLists[1]}?`, "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "info", - center: true - }) - .then(() => { - if (this.currentRow.type == "1") { - this.$emit("milestone", this.currentRow); - } else if (this.currentRow.type == "2") { - this.$emit("planProject", this.currentRow); - } - }) - .catch(() => {}); - } else if (index == 0) { - this.$emit("handlerEdit", this.currentRow); - } else if (index == 2) { - console.log(name); - if (this.currentRow.type == 3 && name == "删除分组") { - this.$confirm("此操作将永久删除该分组及其子项目, 是否继续?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - center: true - }) - .then(() => { - this.$emit("handlerDel", this.currentRow); - }) - .catch(() => {}); - return; - } - if (name == "删除") { - this.$confirm("此操作将永久删除该项目, 是否继续?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - center: true - }) - .then(() => { - this.$emit("handlerDel", this.currentRow); - }) - .catch(() => {}); - return; - } - this.$confirm(`确定转为分组?`, "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "info", - center: true - }) - .then(() => { - this.$emit("handlerGroup", this.currentRow); - }) - .catch(() => {}); - } - } }, mounted() { this.handlerWatchScroll(); diff --git a/hb_client/src/views/pm/components/slider.vue b/hb_client/src/views/pm/components/slider.vue index d4e0260..e8062cd 100644 --- a/hb_client/src/views/pm/components/slider.vue +++ b/hb_client/src/views/pm/components/slider.vue @@ -1,9 +1,22 @@ \ No newline at end of file + + diff --git a/hb_client/src/views/pm/gantt.vue b/hb_client/src/views/pm/gantt.vue index 4d36fcd..1caf17a 100644 --- a/hb_client/src/views/pm/gantt.vue +++ b/hb_client/src/views/pm/gantt.vue @@ -7,13 +7,8 @@ :BGScrollTop.sync="BGScrollTop" @TableScrollTop="TableScrollTop" @handlerRowClick="handlerRowClick" - @milestone="handlerMilestone" - @planProject="handlerPlanProject" @handlerGroup="handlerGroup" - @handlerEdit="handlerEdit" - @handleGroupAdd="handleGroupAdd" @handlerExpand="handlerExpand" - @handlerDel="handlerDel" >
-