admin
2025-03-29 9cd0e111d7315074f5574558dab3cae087ff1f68
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8d418416"],{"0649":function(t,e,a){"use strict";a("4ec0")},"23b7":function(t,e,a){"use strict";a.d(e,"d",(function(){return r})),a.d(e,"c",(function(){return l})),a.d(e,"a",(function(){return n})),a.d(e,"e",(function(){return s})),a.d(e,"b",(function(){return i}));var o=a("b775");function r(t){return Object(o["a"])({url:"/bs/locationInfo/list",method:"get",params:t})}function l(t){return Object(o["a"])({url:"/bs/locationInfo/"+t,method:"get"})}function n(t){return Object(o["a"])({url:"/bs/locationInfo",method:"post",data:t})}function s(t){return Object(o["a"])({url:"/bs/locationInfo",method:"put",data:t})}function i(t){return Object(o["a"])({url:"/bs/locationInfo/"+t,method:"delete"})}},"4ec0":function(t,e,a){},e95b:function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("el-row",{attrs:{gutter:5}},[a("el-col",{attrs:{span:6}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"card-item"},[a("span",{staticClass:"label"},[t._v("工位编号:")]),a("el-select",{staticClass:"content-item",attrs:{placeholder:"请选择"},on:{change:t.handleLocationChange},model:{value:t.locationCode,callback:function(e){t.locationCode=e},expression:"locationCode"}},t._l(t.locationCodeOptions,(function(t){return a("el-option",{key:t.locationCode,attrs:{label:t.locationCode,value:t.locationCode}})})),1)],1)])],1),a("el-col",{attrs:{span:6}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"card-item"},[a("span",{staticClass:"label"},[t._v("样机编号:")]),a("span",{staticClass:"content-item"},[t._v(t._s(t.prototypeNumber))])])])],1),a("el-col",{attrs:{span:12}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"card-item"},[a("span",{staticClass:"label"},[t._v("物料编号:")]),a("el-input",{staticClass:"content-item",attrs:{placeholder:"请输入物料编号"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleMaterialCodeEnter(e)}},model:{value:t.materialCode,callback:function(e){t.materialCode=e},expression:"materialCode"}}),a("el-button",{attrs:{type:"primary"}},[t._v("主要按钮")]),a("el-button",{attrs:{type:"success"}},[t._v("成功按钮")])],1)])],1)],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-card",{staticClass:"box-card"},[a("el-table",{ref:"formulaTable",staticStyle:{width:"100%"},attrs:{data:t.sortedFormulaData,height:"350","row-class-name":t.tableRowClassName}},[a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:"工位编号",align:"center",prop:"locationCode"}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:"产品编号",align:"center",prop:"productCode"}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:"操作内容",align:"center",prop:"operationContent"}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:"物料编码",align:"center",prop:"materialCode"}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:"采集值",align:"center",prop:"collectData"}}),a("el-table-column",{attrs:{"show-overflow-tooltip":"",label:"结果",align:"center",prop:"results"}})],1)],1)],1)],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-card",{staticClass:"box-card"},[a("span",[t._v("缺陷记录:")]),a("el-input",{staticStyle:{width:"70%"},attrs:{placeholder:"请输入缺陷记录"},model:{value:t.defectInformation,callback:function(e){t.defectInformation=e},expression:"defectInformation"}})],1)],1)],1)],1)},r=[],l=(a("0643"),a("2382"),a("23b7")),n=a("f7ba"),s={name:"workstationOperation",data(){return{locationCode:"",prototypeNumber:"",materialCode:"",defectInformation:"",locationCodeOptions:[],formulaTableData:[],isFirstEnter:!0}},created(){this.initLocationOptions()},computed:{sortedFormulaData(){return[...this.formulaTableData].sort((t,e)=>"OK"===t.results&&"OK"!==e.results?-1:"OK"!==t.results&&"OK"===e.results?1:0)}},methods:{async initLocationOptions(){try{const t=await Object(l["d"])();this.locationCodeOptions=t.rows}catch(t){this.$message.error("获取工位列表失败")}},handleLocationChange(t){if(!t)return this.prototypeNumber="",this.materialCode="",void(this.formulaTableData=[]);this.isFirstEnter=!0,this.prototypeNumber="",this.materialCode="",this.formulaTableData=[]},async handleMaterialCodeEnter(){if(this.locationCode)if(this.isFirstEnter){this.prototypeNumber=this.materialCode,this.materialCode="",this.isFirstEnter=!1;try{const t=await Object(n["d"])({locationCode:this.locationCode,pageFlag:!0});console.log(t),this.formulaTableData=t.rows}catch(t){this.$message.error("获取配方数据失败")}}else try{const t=await Object(n["e"])({locationCode:this.locationCode,inputValue:this.materialCode});200===t.code?(this.formulaTableData=t.data,this.$message.success("更新成功"),this.materialCode="",this.$nextTick(()=>{const t=this.$refs.formulaTable,e=this.sortedFormulaData.filter(t=>"OK"===t.results).length,a=this.sortedFormulaData.length;if(e<a){const a=40,o=e*a-t.$el.clientHeight/2+a;t.bodyWrapper.scrollTop=Math.max(0,o)}})):this.$message.warning(t.msg)}catch(t){this.$message.error("更新失败")}else this.$message.warning("请先选择工位")},tableRowClassName({row:t}){return"OK"===t.results?"success-row":""}}},i=s,c=(a("0649"),a("2877")),u=Object(c["a"])(i,o,r,!1,null,"cb984862",null);e["default"]=u.exports},f7ba:function(t,e,a){"use strict";a.d(e,"d",(function(){return r})),a.d(e,"e",(function(){return l})),a.d(e,"c",(function(){return n})),a.d(e,"a",(function(){return s})),a.d(e,"f",(function(){return i})),a.d(e,"b",(function(){return c}));var o=a("b775");function r(t){return Object(o["a"])({url:"/formulaChildInfo/list",method:"get",params:t})}function l(t){return Object(o["a"])({url:"/formulaChildInfo/updateCollectData",method:"post",data:t})}function n(t){return Object(o["a"])({url:"/formulaChildInfo/"+t,method:"get"})}function s(t){return Object(o["a"])({url:"/formulaChildInfo",method:"post",data:t})}function i(t){return Object(o["a"])({url:"/formulaChildInfo",method:"put",data:t})}function c(t){return Object(o["a"])({url:"/formulaChildInfo/"+t,method:"delete"})}}}]);