tft-fe/dist/js/3180.e1f2d9a6.js

1 line
17 KiB
JavaScript

"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[3180],{3180: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:{page:t.listQuery.current,limit:t.listQuery.size,total:t.total},on:{"update:page":function(e){return t.$set(t.listQuery,"current",e)},"update:limit":function(e){return t.$set(t.listQuery,"size",e)},pagination:function(e){return t.getList()}}}),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)},l=[],i=a(475),o=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:"选择抽检时间"},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)},s=[],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=[],c={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)}}},m=c,u=a(1001),p=(0,u.Z)(m,n,d,!1,null,null,null),f=p.exports,h=a(2334),b=a(381),g=a.n(b);const y=[{prop:"detectItem",label:"检验项目"},{prop:"detectPoint",label:"检测点"},{prop:"detectStandard",label:"检验标准"},{prop:"value",label:"实测值",subcomponent:f},{prop:"result",label:"抽检结果",subcomponent:f},{prop:"remark",label:"备注",subcomponent:f}];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,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=new Date},selectItem(){this.getStandard()},selectStandard(){this.form.detectItem&&this.getStandard()},getStandard(){(0,h.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"}),!1;let t=[];for(let e of this.tableData){let a={};a.detectStandardId=e.id,a.detectTime=g()(this.form.detectTime).format("yyyy-MM-DDTHH:mm:ss"),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,h.Af)(t).then((t=>{0===t.code&&(this.$message({message:"保存成功",type:"success"}),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,S=(0,u.Z)(C,o,s,!1,null,"617720a2",null),v=S.exports,D=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",{key:t.standardSettingNum,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)},k=[];const w=[{prop:"detectItem",label:"检验项目"},{prop:"detectPoint",label:"检测点",subcomponent:f},{prop:"detectStandard",label:"检验标准",subcomponent:f}],T=[{type:"delete",btnName:"编辑"}];var x={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"}]},standardSettingNum:0,tableProps:w,tableData:[],tableBtn:T,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(){(0,h.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){console.log(t),this.tableData.splice(t.data._pageIndex-1,1),this.standardSettingNum++},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"}),!1;for(let e of this.tableData)if(!e.detectItem||!e.detectPoint||!e.detectStandard)return this.$message({message:"表格中有数据空缺,请检查",type:"error"}),!1;for(let e of this.tableData)e.productSpec=this.form.model;(0,h.QI)(this.tableData).then((t=>{0===t.code&&(this.$message({message:"保存成功",type:"success"}),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"}),!1;let t={};t.detectItem=this.form.detectItem,t.detectPoint="",t.detectStandard="",this.tableData.push(t)}}},P=x,q=(0,u.Z)(P,D,k,!1,null,"fd8cce48",null),N=q.exports;const L=[{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 F={name:"ProcessSampling",components:{SamplingAdd:v,StandarSetting:N},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",defaultSelect:[],width:350},{type:"button",btnName:"查询",name:"search",color:"primary"},{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:L,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[4].defaultSelect=[g()().format("yyyy-MM-DD")+"T00:00:00",g()().format("yyyy-MM-DD")+"T23:59:59"],this.listQuery.startTime=g()().format("yyyy-MM-DD")+"T00:00:00",this.listQuery.endTime=g()().format("yyyy-MM-DD")+"T23:59:59",this.formConfig[0].defaultSelect=1,this.formConfig[1].type="input",this.formConfig[1].label="玻璃ID",this.getList()},methods:{getList(){(0,h.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"add":this.addOrEditTitle="抽检录入",this.centervisible=!0,this.$nextTick((()=>{this.$refs.samplingList.init()}));break;case"export":(0,h.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]),l=new FileReader;l.readAsDataURL(r),l.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="检验项目"),this.formConfig[4].defaultSelect=this.$refs.searchBarForm.formInline.timeVal}}},$=F,_=(0,u.Z)($,r,l,!1,null,null,null),Z=_.exports},2334:function(t,e,a){a.d(e,{Af:function(){return s},F0:function(){return f},G$:function(){return I},Jt:function(){return y},ON:function(){return d},QI:function(){return o},Qd:function(){return h},YU:function(){return p},dy:function(){return S},eT:function(){return m},gP:function(){return k},iF:function(){return c},jA:function(){return i},kT:function(){return D},nE:function(){return g},pS:function(){return n},pw:function(){return u},qn:function(){return w},r5:function(){return b},uX:function(){return v},v:function(){return l},vD:function(){return C}});var r=a(8859);function l(t){return(0,r.Z)({url:"/quality/processDetect/page",method:"post",data:t})}function i(t){return(0,r.Z)({url:"/quality/processDetect/list",method:"post",data:t})}function o(t){return(0,r.Z)({url:"/quality/processDetect/add",method:"post",formState:!0,data:t})}function s(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 c(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/getDetails",method:"post",data:t})}function m(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/listType",method:"post",data:t})}function u(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/export2",method:"post",responseType:"blob",data:t})}function p(t){return(0,r.Z)({url:"/quality/processCompleteInspetion/pageIIS",method:"post",data:t})}function f(t){return(0,r.Z)({url:"/quality/ProcessFull/queryPoint",method:"post",data:t})}function h(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/cornerData",method:"post",data:t})}function y(t){return(0,r.Z)({url:"/quality/ProcessFull/pointExport2",method:"post",responseType:"blob",data:t,timeout:6e4})}function I(t){return(0,r.Z)({url:"/quality/ProcessFull/pointExport",method:"post",responseType:"blob",data:t,timeout:6e4})}function C(t){return(0,r.Z)({url:"/quality/ProcessFull/confirm",method:"post",data:t})}function S(t){return(0,r.Z)({url:"/quality/ProcessFull/queryThickness",method:"post",data:t})}function v(t){return(0,r.Z)({url:"/quality/ProcessFull/drawThickness",method:"post",formState:!0,data:t})}function D(t){return(0,r.Z)({url:"/quality/productTrace/page",method:"post",data:t})}function k(t){return(0,r.Z)({url:"/quality/productTrace/pageProcess",method:"post",data:t})}function w(t){return(0,r.Z)({url:"/quality/productTrace/pageProcessParameter",method:"post",data:t})}}}]);