var pfcomponent = { template:`
搜索 删除
取 消 确认入库
`, data(){ // 获取当前屏幕的分辨率 let screenW = window.screen.width; let screenH = window.innerHeight; console.log("screen width:",screenW); console.log("screen height:",screenH); return { tHeight:screenH-40-232, tableData: [], tableData1: [], currentPage: 1, pagesize:50, recordTotal:0, applicant_v:'', dialogVisible:false, multipleSelection: [], disabled:true, if_show_process:false, percent_len:0, interval:'', if_show_process1:false, update_visible:false, form: { id:'', p_id: '', process_name:'', process_t:'', }, rules: { p_id: [ { required: true, message: '产品编号不可为空', trigger: 'blur' } ], process_name: [ { required: true, message: '工序不可为空', trigger: 'blur' } ], process_t: [ { required: true, message: '工时不可为空', trigger: 'blur' } ], }, id:0, state:'', } }, mounted() { this.get_approve(); }, methods: { celldblclick_1(row, column, cell, event){ this.$data.tableData1 = JSON.parse(row.data); this.$data.id = row.id, this.$data.state=row.state, this.$data.update_visible=true; }, post_process(){ this.$data.update_visible = false; var _this = this; console.log(_this.$data.form); var objs; axios.post('/pp/approve_ok', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), id:_this.$data.id, data:_this.$data.tableData1, }) .then(function (response) { let r = response.data.r; let s = "" let errType = "" if (r == 0) { errType = "success" } else{ errType = "error" } if (r ==0) { s = "入库成功!"; } else{ s = "入库失败!"; } _this.$message({ message: s, type: errType, duration: 1500 }); //更新页面 _this.get_approve(); }) .catch(function (error) { console.log(error); }); }, update_process(row){ this.$data.form = { id:row.id, p_id: row.p_id, process_name:row.process_name, process_t:row.process_t }; this.$nextTick(() => { this.$refs['form_p'].clearValidate() }); this.$data.update_visible = true; }, input_change(value) { console.log(value); this.get_approve(); }, importDialog_close(done){ done(); }, handleSelectionChange(val) { console.log("已选择"); console.log(val); this.multipleSelection = val; }, del_approve(){ var _this = this; axios.post('/pp/del_approve', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), ids: _this.$data.multipleSelection, }) .then(function (response) { let r = response.data.r; let s = "" let errType = "" if (r == 0) { s = "删除成功!"; errType = "success" } else{ s = "删除失败!"; errType = "error" } _this.$message({ message: s, type: errType, duration: 1500 }); if (r ==0) { _this.get_approve();//更新页面 } }) .catch(function (error) { console.log(error); }); }, get_approve(){ document.getElementById("bt_search").blur(); var _this = this; var objs; axios.post('/pp/get_approve_m', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), index: this.$data.currentPage, count: this.$data.pagesize, applicant:this.$data.applicant_v, }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, handleSizeChange(val) { this.$data.pagesize = val; this.get_approve(); }, handleCurrentChange(val) { this.$data.currentPage = val; this.get_approve(); } } }