"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[640],{640:function(t,e,a){a.r(e),a.d(e,{default:function(){return Z}});var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"page-box"},[e("search-bar",{ref:"searchBarForm",attrs:{formConfigs:t.formConfig},on:{headBtnClick:t.buttonClick,"select-changed":t.selectType}}),e("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH}}),e("pagination",{attrs:{limit:t.listQuery.size,total:t.total}}),t.centervisible?e("sampling-add",{ref:"samplingList",on:{successSubmit:t.getList}}):t._e(),t.centervisible2?e("standar-setting",{ref:"standardList",on:{successSubmit:t.getList}}):t._e()],1)},s=[],l=a(475),i=function(){var t=this,e=t._self._c;return e("el-drawer",{staticClass:"samplingAdd",attrs:{title:"抽检录入",visible:t.visible,size:"70%"},on:{"update:visible":function(e){t.visible=e}}},[e("el-form",{ref:"form",staticClass:"form-box",attrs:{rules:t.rules,"label-width":"80px",model:t.form}},[e("el-row",{staticClass:"first-line",attrs:{gutter:20}},[e("el-col",{attrs:{span:8}},[e("el-form-item",{attrs:{label:"抽检人",prop:"detector"}},[e("el-input",{model:{value:t.form.detector,callback:function(e){t.$set(t.form,"detector",e)},expression:"form.detector"}})],1)],1),e("el-col",{attrs:{span:8}},[e("el-form-item",{attrs:{label:"玻璃ID",prop:"glassId"}},[e("el-input",{model:{value:t.form.glassId,callback:function(e){t.$set(t.form,"glassId",e)},expression:"form.glassId"}})],1)],1),e("el-col",{attrs:{span:8}},[e("el-form-item",{attrs:{label:"抽检时间",prop:"detectTime"}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:"选择抽检时间","value-format":"yyyy-MM-DDTHH:mm:ss"},model:{value:t.form.detectTime,callback:function(e){t.$set(t.form,"detectTime",e)},expression:"form.detectTime"}})],1)],1)],1),e("el-row",[e("el-col",{attrs:{span:24}},[e("div",{staticStyle:{display:"inline-block","margin-right":"10px"}},[e("el-form-item",{attrs:{label:"型号",prop:"model"}},[e("el-radio-group",{on:{change:t.selectStandard},model:{value:t.form.model,callback:function(e){t.$set(t.form,"model",e)},expression:"form.model"}},t._l(t.productModelVoList,(function(a){return e("el-radio-button",{key:a.dataCode,attrs:{label:a.dataName}},[t._v(t._s(a.dataName))])})),1)],1)],1),e("div",{staticStyle:{display:"inline-block"}},[e("el-form-item",{attrs:{label:"检验项目",prop:"detectItem"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"检验项目"},on:{change:t.selectItem},model:{value:t.form.detectItem,callback:function(e){t.$set(t.form,"detectItem",e)},expression:"form.detectItem"}},t._l(t.testItemList,(function(t){return e("el-option",{key:t.dataCode,attrs:{label:t.dataName,value:t.dataName}})})),1)],1)],1)])],1),e("el-row",[e("el-col",{staticStyle:{"margin-bottom":"20px"},attrs:{span:24}},[e("base-table",{attrs:{"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH,"highlight-current-row":""},on:{emitFun:t.inputChange}})],1)],1),e("el-row",{staticClass:"bottom"},[e("el-col",{staticStyle:{"text-align":"right"},attrs:{span:24}},[e("el-form-item",[e("el-button",{on:{click:t.closeForm}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("保存")])],1)],1)],1)],1)],1)},o=[],n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"tableInner"},[e("el-input",{on:{blur:t.changeInput},model:{value:t.list[t.itemProp],callback:function(e){t.$set(t.list,t.itemProp,e)},expression:"list[itemProp]"}})],1)},d=[],m={name:"InputArea",props:{injectData:{type:Object,default:()=>({})},itemProp:{type:String}},data(){return{list:this.injectData}},methods:{changeInput(){console.log(this.list),this.$emit("emitData",this.list)}}},c=m,u=a(1001),p=(0,u.Z)(c,n,d,!1,null,null,null),h=p.exports,f=a(2334),b=a(381),g=a.n(b);const y=[{prop:"detectItem",label:"检验项目"},{prop:"detectPoint",label:"检测点"},{prop:"detectStandard",label:"检验标准"},{prop:"value",label:"实测值",subcomponent:h},{prop:"result",label:"抽检结果",subcomponent:h},{prop:"remark",label:"备注",subcomponent:h}];var I={name:"SamplingAdd",data(){return{visible:!1,form:{model:"",detectItem:"",detector:"",glassId:"",detectTime:""},testItemList:JSON.parse(localStorage.getItem("publicList")).checkItemVoList,productModelVoList:JSON.parse(localStorage.getItem("publicList")).productModelVoList,rules:{model:[{required:!0,message:"请输入选择型号",trigger:"blur"}],detectItem:[{required:!0,message:"请选择检验项目",trigger:"change"}],detector:[{required:!0,message:"请输入抽检人",trigger:"blur"}],glassId:[{required:!0,message:"请选择玻璃ID",trigger:"change"}],detectTime:[{required:!0,message:"请选择抽检时间",trigger:"change"}]},tableProps:y,tableData:[],tableH:(0,l.NC)(250)}},methods:{init(){this.visible=!0,window.addEventListener("resize",(()=>{this.tableH=(0,l.NC)(250)})),this.form.model="G8.5",this.form.detectTime=g()().format("yyyy-MM-DDTHH:mm:ss")},selectItem(){this.getStandard()},selectStandard(){this.form.detectItem&&this.getStandard()},getStandard(){(0,f.jA)({productSpec:this.form.model,detectItem:this.form.detectItem}).then((t=>{console.log(t),0===t.code?this.tableData=t.data:this.tableData=[]}))},submitForm(){this.$refs["form"].validate((t=>{if(!t)return console.log("error submit!!"),!1;{if(0===this.tableData.length)return this.$message({message:"请先到标准设置中添加该检测项目的检测点",type:"error",duration:2e3}),!1;let t=[];for(let e of this.tableData){let a={};a.detectStandardId=e.id,a.detectTime=this.form.detectTime,a.detector=this.form.detector,a.glassId=this.form.glassId,a.remark=e.remark?e.remark:"",a.result=e.result?e.result:"",a.value=e.value?e.value:"",t.push(a)}(0,f.Af)(t).then((t=>{0===t.code&&(this.$message({message:"保存成功",type:"success",duration:1500,onClose:()=>{}}),this.$emit("successSubmit"),this.formClear(),this.visible=!1)}))}}))},closeForm(){this.formClear(),this.visible=!1},formClear(){this.$refs.form.resetFields(),this.tableData=[]},inputChange(t){this.tableData[t._pageIndex-1][t.prop]=t[t.prop]}}},C=I,v=(0,u.Z)(C,i,o,!1,null,"7b3115e1",null),S=v.exports,k=function(){var t=this,e=t._self._c;return e("el-drawer",{staticClass:"standardSetting",attrs:{title:"标准值设置",visible:t.visible,size:"70%"},on:{"update:visible":function(e){t.visible=e}}},[e("el-form",{ref:"form",staticClass:"form-box",attrs:{rules:t.rules,"label-width":"80px",model:t.form}},[e("el-row",[e("el-col",{attrs:{span:24}},[e("div",{staticStyle:{display:"inline-block","margin-right":"10px"}},[e("el-form-item",{attrs:{label:"型号",prop:"model"}},[e("el-radio-group",{on:{change:t.selectStandard},model:{value:t.form.model,callback:function(e){t.$set(t.form,"model",e)},expression:"form.model"}},t._l(t.productModelVoList,(function(a){return e("el-radio-button",{key:a.dataCode,attrs:{label:a.dataName}},[t._v(t._s(a.dataName))])})),1)],1)],1),e("div",{staticStyle:{display:"inline-block"}},[e("el-form-item",{attrs:{label:"检验项目",prop:"detectItem"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"检验项目"},on:{change:t.selectItem},model:{value:t.form.detectItem,callback:function(e){t.$set(t.form,"detectItem",e)},expression:"form.detectItem"}},t._l(t.testItemList,(function(t){return e("el-option",{key:t.dataCode,attrs:{label:t.dataName,value:t.dataName}})})),1)],1)],1)])],1),e("el-row",[e("el-col",{staticStyle:{"margin-bottom":"20px"},attrs:{span:24}},[e("base-table",{attrs:{"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH,"add-button-show":t.addButtonShow,"highlight-current-row":""},on:{emitFun:t.inputChange,emitButtonClick:t.addNew}},[t.tableBtn.length?e("method-btn",{attrs:{slot:"handleBtn",width:80,label:"操作","method-list":t.tableBtn},on:{clickBtn:t.handleClick},slot:"handleBtn"}):t._e()],1)],1)],1),e("el-row",{staticClass:"bottom"},[e("el-col",{staticStyle:{"text-align":"right"},attrs:{span:24}},[e("el-form-item",[e("el-button",{on:{click:t.closeForm}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("保存")])],1)],1)],1)],1)],1)},D=[];const w=[{prop:"detectItem",label:"检验项目",subcomponent:h},{prop:"detectPoint",label:"检测点",subcomponent:h},{prop:"detectStandard",label:"检验标准",subcomponent:h}],x=[{type:"delete",btnName:"编辑"}];var T={name:"StandarSetting",data(){return{visible:!1,form:{model:"",detectItem:""},testItemList:JSON.parse(localStorage.getItem("publicList")).checkItemVoList,productModelVoList:JSON.parse(localStorage.getItem("publicList")).productModelVoList,rules:{model:[{required:!0,message:"请输入选择型号",trigger:"blur"}],detectItem:[{required:!0,message:"请选择检验项目",trigger:"change"}]},tableProps:w,tableData:[],tableBtn:x,addButtonShow:"新增",tableH:(0,l.NC)(250)}},methods:{init(){this.visible=!0,window.addEventListener("resize",(()=>{this.tableH=(0,l.NC)(250)})),this.form.model="G8.5"},selectItem(){this.getStandard()},selectStandard(){this.form.detectItem&&this.getStandard()},getStandard(){(0,f.jA)({productSpec:this.form.model,detectItem:this.form.detectItem}).then((t=>{console.log(t),0===t.code?this.tableData=t.data:this.tableData=[]}))},handleClick(t){this.tableData.splice(t._pageIndex,1)},submitForm(){this.$refs["form"].validate((t=>{if(!t)return console.log("error submit!!"),!1;if(0===this.tableData.length)return this.$message({message:"请点击新增按钮添加标准值后再保存",type:"error",duration:1500}),!1;for(let e of this.tableData)if(!e.detectItem||!e.detectPoint||!e.detectStandard)return this.$message({message:"表格中有数据空缺,请检查",type:"error",duration:1500}),!1;for(let e of this.tableData)e.productSpec=this.form.model;(0,f.QI)(this.tableData).then((t=>{0===t.code&&(this.$message({message:"保存成功",type:"success",duration:1500,onClose:()=>{}}),this.$emit("successSubmit"),this.formClear(),this.visible=!1)}))}))},closeForm(){this.formClear(),this.visible=!1},formClear(){this.$refs.form.resetFields(),this.tableData=[]},inputChange(t){this.tableData[t._pageIndex-1][t.prop]=t[t.prop]},addNew(){if(!this.form.detectItem)return this.$message({message:"请先选择检验项目",type:"error",duration:1500}),!1;let t={};t.detectItem=this.form.detectItem,t.detectPoint="",t.detectStandard="",this.tableData.push(t)}}},L=T,N=(0,u.Z)(L,k,D,!1,null,"fbc9d82a",null),P=N.exports;const _=[{prop:"glassId",label:"玻璃ID",minWidth:100},{prop:"detectItem",label:"检验项目",minWidth:100},{prop:"detectPoint",label:"检测点",minWidth:100},{prop:"detectStandard",label:"检验标准",minWidth:100},{prop:"value",label:"实测值",minWidth:100},{prop:"result",label:"抽检结果",minWidth:100},{prop:"detector",label:"抽检人",minWidth:100},{prop:"detectTime",label:"抽检时间",filter:l.g6,minWidth:150},{prop:"remark",label:"备注",minWidth:150}];var F={name:"ProcessSampling",components:{SamplingAdd:S,StandarSetting:P},data(){return{formConfig:[{type:"select",label:"查询方式",selectOptions:[{id:1,name:"玻璃ID"},{id:2,name:"抽检人"},{id:3,name:"检验项目"}],param:"type",defaultSelect:"",onchange:!0,width:150},{type:"",label:"",placeholder:"玻璃ID",param:"glassId"},{type:"",label:"",placeholder:"抽检人",param:"detector",width:150},{type:"",label:"",selectOptions:JSON.parse(localStorage.getItem("publicList")).checkItemVoList,param:"detectItem",labelField:"dataName",valueField:"dataName",defaultSelect:"",width:150},{type:"datePicker",label:"抽检时间",dateType:"datetimerange",format:"yyyy-MM-dd HH:mm:ss",valueFormat:"yyyy-MM-ddTHH:mm:ss",rangeSeparator:"-",startPlaceholder:"开始时间",endPlaceholder:"结束时间",param:"timeVal",width:350},{type:"button",btnName:"查询",name:"search",color:"primary"},{type:"button",btnName:"重置",name:"reset"},{type:"separate"},{type:"button",btnName:"录入",name:"add",color:"primary",plain:!0},{type:"button",btnName:"导出",name:"export",color:"primary",plain:!0},{type:"button",btnName:"标准设置",name:"settings",color:"primary",plain:!0}],tableProps:_,tableData:[],tableH:(0,l.NC)(270),total:0,listQuery:{current:1,size:20,glassId:"",detector:"",detectItem:"",startTime:"",endTime:""},centervisible:!1,addOrEditTitle:"",standardSetting:"标准设置",centervisible2:!1}},mounted(){window.addEventListener("resize",(()=>{this.tableH=(0,l.NC)(270)})),this.formConfig[0].defaultSelect=1,this.formConfig[1].type="input",this.formConfig[1].label="玻璃ID",this.getList()},methods:{getList(){(0,f.v)({...this.listQuery}).then((t=>{console.log(t),0===t.code&&(this.tableData=t.data.records,this.total=t.data.total)}))},buttonClick(t){switch(t.btnName){case"search":this.listQuery.glassId=1===t.type?t.glassId:"",this.listQuery.detector=2===t.type?t.detector:"",this.listQuery.detectItem=3===t.type?t.detectItem:"",this.listQuery.startTime=t.timeVal?t.timeVal[0]:"",this.listQuery.endTime=t.timeVal?t.timeVal[1]:"",this.getList();break;case"reset":this.$refs.searchBarForm.resetForm(),this.listQuery.glassId="",this.listQuery.detector="",this.listQuery.detectItem="",this.listQuery.startTime="",this.listQuery.endTime="",this.$nextTick((()=>{this.getList()}));break;case"add":this.addOrEditTitle="抽检录入",this.centervisible=!0,this.$nextTick((()=>{this.$refs.samplingList.init()}));break;case"export":(0,f.pS)({...this.listQuery}).then((t=>{console.log(t);let e="";const a=t.headers["content-disposition"];a&&(e=decodeURIComponent(a.slice(a.indexOf("filename=")+9)));const r=new Blob([t.data]),s=new FileReader;s.readAsDataURL(r),s.onload=t=>{const a=document.createElement("a");a.download=e,a.href=t.target.result,document.body.appendChild(a),a.click(),document.body.removeChild(a)}}));break;default:this.centervisible2=!0,this.$nextTick((()=>{this.$refs.standardList.init()}))}},selectType(t){1===t.value?(this.formConfig[0].defaultSelect=1,this.formConfig[1].type="input",this.formConfig[1].label="玻璃ID",this.formConfig[2].type="",this.formConfig[2].label="",this.formConfig[3].type="",this.formConfig[3].label=""):2===t.value?(this.formConfig[0].defaultSelect=2,this.formConfig[1].type="",this.formConfig[1].label="",this.formConfig[2].type="input",this.formConfig[2].label="抽检人",this.formConfig[3].type="",this.formConfig[3].label=""):3===t.value&&(this.formConfig[0].defaultSelect=3,this.formConfig[1].type="",this.formConfig[1].label="",this.formConfig[2].type="",this.formConfig[2].label="",this.formConfig[3].type="select",this.formConfig[3].label="检验项目")}}},$=F,q=(0,u.Z)($,r,s,!1,null,null,null),Z=q.exports},2334:function(t,e,a){a.d(e,{Af:function(){return o},F0:function(){return h},ON:function(){return d},QI:function(){return i},Qd:function(){return f},YU:function(){return p},dy:function(){return y},eT:function(){return c},iF:function(){return m},jA:function(){return l},pS:function(){return n},pw:function(){return u},r5:function(){return b},uX:function(){return I},v:function(){return s},vD:function(){return g}});var r=a(8859);function s(t){return(0,r.Z)({url:"/quality/processDetect/page",method:"post",data:t})}function l(t){return(0,r.Z)({url:"/quality/processDetect/list",method:"post",data:t})}function i(t){return(0,r.Z)({url:"/quality/processDetect/add",method:"post",formState:!0,data:t})}function o(t){return(0,r.Z)({url:"/quality/processDetect/detectInput",method:"post",formState:!0,data:t})}function n(t){return(0,r.Z)({url:"/quality/processDetect/export",method:"post",responseType:"blob",data:t,timeout:6e4})}function d(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/page",method:"post",data:t})}function m(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/getDetails",method:"post",data:t})}function c(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/listType",method:"post",data:t})}function u(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/export",method:"post",responseType:"blob",data:t})}function p(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/pageIIS",method:"post",data:t})}function h(t){return(0,r.Z)({url:"/quality/ProcessFull/queryPoint",method:"post",data:t})}function f(t){return(0,r.Z)({url:"/quality/ProcessFull/drawPoint",method:"post",data:t})}function b(t){return(0,r.Z)({url:"/quality/ProcessFull/queryPointClear",method:"post",data:t})}function g(t){return(0,r.Z)({url:"/quality/ProcessFull/confirm",method:"post",data:t})}function y(t){return(0,r.Z)({url:"/quality/ProcessFull/queryThickness",method:"post",data:t})}function I(t){return(0,r.Z)({url:"/quality/ProcessFull/drawThickness",method:"post",formState:!0,data:t})}}}]);