tft-fe/dist/js/5091.57954fe0.js
2023-02-22 13:59:09 +08:00

1 line
15 KiB
JavaScript

"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[5091],{5091:function(t,e,a){a.r(e),a.d(e,{default:function(){return O}});var l=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=[],i=a(475),r=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,p=a(1001),u=(0,p.Z)(c,n,d,!1,null,null,null),h=u.exports,b=a(8859);function f(t){return(0,b.Z)({url:"/quality/processDetect/page",method:"post",data:t})}function g(t){return(0,b.Z)({url:"/quality/processDetect/list",method:"post",data:t})}function y(t){return(0,b.Z)({url:"/quality/processDetect/add",method:"post",formState:!0,data:t})}function I(t){return(0,b.Z)({url:"/quality/processDetect/detectInput",method:"post",formState:!0,data:t})}function v(t){return(0,b.Z)({url:"/quality/processDetect/export",method:"post",responseType:"blob",data:t,timeout:6e4})}var C=a(381),S=a.n(C);const k=[{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 D={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:k,tableData:[],tableH:(0,i.NC)(250)}},methods:{init(){this.visible=!0,window.addEventListener("resize",(()=>{this.tableH=(0,i.NC)(250)})),this.form.model="G8.5",this.form.detectTime=S()().format("yyyy-MM-DDTHH:mm:ss")},selectItem(){this.getStandard()},selectStandard(){this.form.detectItem&&this.getStandard()},getStandard(){g({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)}I(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]}}},w=D,x=(0,p.Z)(w,r,o,!1,null,"7b3115e1",null),L=x.exports,N=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)},T=[];const _=[{prop:"detectItem",label:"检验项目",subcomponent:h},{prop:"detectPoint",label:"检测点",subcomponent:h},{prop:"detectStandard",label:"检验标准",subcomponent:h}],$=[{type:"delete",btnName:"编辑"}];var F={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:_,tableData:[],tableBtn:$,addButtonShow:"新增",tableH:(0,i.NC)(250)}},methods:{init(){this.visible=!0,window.addEventListener("resize",(()=>{this.tableH=(0,i.NC)(250)})),this.form.model="G8.5"},selectItem(){this.getStandard()},selectStandard(){this.form.detectItem&&this.getStandard()},getStandard(){g({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;y(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)}}},P=F,H=(0,p.Z)(P,N,T,!1,null,"fbc9d82a",null),Q=H.exports;const M=[{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:i.g6,minWidth:150},{prop:"remark",label:"备注",minWidth:150}];var V={name:"ProcessSampling",components:{SamplingAdd:L,StandarSetting:Q},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:M,tableData:[],tableH:(0,i.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,i.NC)(270)})),this.formConfig[0].defaultSelect=1,this.formConfig[1].type="input",this.formConfig[1].label="玻璃ID",this.getList()},methods:{getList(){f({...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":v({...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 l=new Blob([t.data]),s=new FileReader;s.readAsDataURL(l),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="检验项目")}}},B=V,q=(0,p.Z)(B,l,s,!1,null,null,null),O=q.exports}}]);