(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-07d8"],{"+nLn":function(t,e,a){"use strict";a.r(e);var o=a("FyfS"),i=a.n(o),r=a("dWSf"),n={name:"storage-setting-plate",components:{ImportDialog:a("U02A").a},mixins:[r.a],data:function(){return{dialogPicVisible:!1,dialogImageUrl:null,from:{storage_Id:0,storageName:null,plateType:null,codePrefix:null,generate:1},formLabelWidth:"120px",isDialogVisible:!1,dropDownplateType:[],dropDownStorage:[],dropDowncodePrefix:[{value:"ZZ",label:"ZZ"},{value:"TP",label:"TP"},{value:"PH",label:"PH"},{value:"ZC",label:"ZC"}],importConfig:{isShowDialog:!1,title:"母托盘批量导入",url:"/api/basicInfo/base/plate/importExcel",templateUrl:"/upload/template/母托盘导入模板.xlsx"}}},methods:{showBigPic:function(t){this.dialogPicVisible=!0,this.dialogImageUrl=this.common.showFirstImage(t.photo),this.dataList.reload()},onChange:function(t,e,a,o){var i=this;if("plateType"===a.options.prop){var r={name:this.editor.formData.plateType},n=this.dataList;this.common.ajax("/api/basicInfo/base/plate/getListType",r,function(t){i.common.showMsg(t),t.result&&(i.editor.changeValue("areaCode",t.data[0].areaCode),i.editor.changeValue("length",t.data[0].length),i.editor.changeValue("width",t.data[0].width),i.editor.changeValue("height",t.data[0].height),i.editor.changeValue("storage_Id",t.data[0].storage_Id),i.editor.changeValue("storageCode",t.data[0].storageCode),i.editor.changeValue("storageName",t.data[0].storageName))},n)}else"storageName"===a.options.prop?this.getAreaCode():"plateCode"===a.options.prop&&(this.masterData.plateTypeCode=this.masterData.plateCode.substr(0,8))},getAreaCode:function(){var t=this,e={name:this.editor.formData.storageName};this.common.ajax("/api/basicInfo/base/plate/getListStorage",e,function(e){if(e.result){var a=[];e.result&&(e.data.forEach(function(t){var e={value:t.areaCode,label:t.areaCode,areaCode:t.areaCode};a.push(e)}),t.editor.setDropdownData(1033,a))}},!0)},buttonClick:function(t){switch(t){case"plateOpen":return this.plateOpen(this.dataListSelections),!0;case"plateStop":return this.plateStop(this.dataListSelections),!0;case"createPlateCode":return this.createPlateCode(),!0;case"import":return this.importConfig.isShowDialog=!0,!0}},plateOpen:function(t){var e=this;if(t.length){var a=!0,o=!1,r=void 0;try{for(var n,s=i()(t);!(a=(n=s.next()).done);a=!0){var l=n.value;if(1===l.enable)return void this.$message.error("只有容器号【"+l.plateCode+"】的状态为不可用,才允许操作")}}catch(t){o=!0,r=t}finally{try{!a&&s.return&&s.return()}finally{if(o)throw r}}this.$confirm("确定要进行启用操作吗?","是否启用",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){!function(){var a={ids:t.map(function(t){return t.plate_Id})};e.common.ajax("/api/basicInfo/base/plate/plateOpen",a,function(t){e.common.showMsg(t),t.result&&e.dataList.reload()})}()}).catch(function(){e.$message.info("已取消")})}else this.$message.error("至少选择一项!")},plateStop:function(t){var e=this;if(t.length){var a=!0,o=!1,r=void 0;try{for(var n,s=i()(t);!(a=(n=s.next()).done);a=!0){var l=n.value;if(1!==l.enable)return void this.$message.error("只有容器号【"+l.plateCode+"】的状态为可用,才允许操作")}}catch(t){o=!0,r=t}finally{try{!a&&s.return&&s.return()}finally{if(o)throw r}}this.$confirm("确定要进行停止操作吗?","执行停止",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){!function(){var a={ids:t.map(function(t){return t.plate_Id})};e.common.ajax("/api/basicInfo/base/plate/plateStop",a,function(t){e.common.showMsg(t),t.result&&e.dataList.reload()})}()}).catch(function(){e.$message.info("已取消")})}else this.$message.error("至少选择一项!")},createPlateCode:function(){this.getStorage(),this.getPlateType(),this.isDialogVisible=!0},getStorage:function(){var t=this,e={where:"31"};this.common.ajax("/api/common/loadDropDown",e,function(a){t.common.showMsg(a),a.result&&a.data&&a.data["dropdown"+e.where]&&a.data["dropdown"+e.where].length>0&&(t.dropDownStorage=a.data["dropdown"+e.where])})},getPlateType:function(){var t=this,e={openNodeApi:!0,where:"723"};this.common.ajax("/api/common/loadDropDown",e,function(a){t.common.showMsg(a),a.result&&a.data&&a.data["dropdown"+e.where]&&a.data["dropdown"+e.where].length>0&&(t.dropDownplateType=a.data["dropdown"+e.where])})},getStorageId:function(t){this.from.storage_Id=t;var e=this.dropDownStorage.find(function(e){return e.storage_Id===t});this.from.storageName=e.storageName},createCode:function(){var t=this;if(0===this.from.storage_Id)return this.$message.error("请选择仓库名称!"),!1;if(!this.from.plateType)return this.$message.error("请选择容器类型!"),!1;if(!this.from.codePrefix)return this.$message.error("请选择容器前缀!"),!1;if(!this.from.generate||this.from.generate<1)return this.$message.error("生成数量最少为1!"),!1;var e=this.dataList,a={data:this.from};this.common.ajax("/api/basicInfo/base/plate/createPlantCode",a,function(a){a.result&&(t.isDialogVisible=!0,e.loadData())},!0)},onReset:function(){this.from={storage_Id:0,storageName:null,plateType:null,codePrefix:null,generate:1},this.dropDownplateType=[],this.dropDownStorage=[]},onLoadDataAfter:function(t){this.loadImage(t)},loadImage:function(t){var e=this;if(t.length){var a={};a.ids=t.map(function(t){return t.plate_Id});this.common.ajax("api/basicInfo/base/plate/getList",a,function(a){a.result&&a.data.forEach(function(a){var o=t.find(function(t){return Number(t.plate_Id)===Number(a.plate_Id)});if(o)if(a.photo)try{e.$set(o,"photo",JSON.parse(a.photo))}catch(t){e.$set(o,"photo",[])}else e.$set(o,"photo",[])})},!0)}}}},s=(a("4wV0"),a("KHd+")),l=Object(s.a)(n,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"container",staticClass:"page-list-container"},[a("yrt-data-list",{ref:t.dataListRef,attrs:{"editor-ref":t.editorRef,"data-options":t.dataOptions,fields:t.dataListOptions.fields,buttons:t.dataListOptions.buttons,"button-click":t.buttonClick,"data-list-selections":t.dataListSelections,"auth-nodes":t.authNodes},on:{"update:fields":function(e){return t.$set(t.dataListOptions,"fields",e)},"update:dataListSelections":function(e){t.dataListSelections=e},"update:data-list-selections":function(e){t.dataListSelections=e},"on-load-data-after":t.onLoadDataAfter},scopedSlots:t._u([{key:"common-column-slot",fn:function(e){var o=e.row,i=e.col;return[i.prop==t.dataOptions.linkColumn?[a("el-link",{attrs:{type:"primary"},nativeOn:{click:function(e){t.linkEditor(o[t.dataOptions.idField],o)}}},[["date","datetime"].indexOf(i.dataType)>=0&&i.formatter?[t._v("\n "+t._s(t.common.formatDate(o[i.prop],i.formatter))+"\n ")]:["byte","int32","int64","decimal","double"].indexOf(i.dataType)>=0&&i.formatter?[t._v("\n "+t._s(t.common.formatNumber(o[i.prop],i.formatter))+"\n ")]:[t._v("\n "+t._s(o[i.prop])+"\n ")]],2)]:["photo"].indexOf(i.prop)>=0?[a("img",{staticStyle:{height:"40px",width:"50px"},attrs:{src:t.common.showFirstImage(o.photo)},on:{click:function(e){return t.showBigPic(o)}}})]:i.dropdown_Id>0?[t._v("\n "+t._s(t.dataList.translateText(i.prop,o[i.prop],i.dropdown_Id))+"\n ")]:[["date","datetime"].indexOf(i.dataType)>=0&&i.formatter?[t._v("\n "+t._s(t.common.formatDate(o[i.prop],i.formatter))+"\n ")]:["byte","int32","int64","decimal","double"].indexOf(i.dataType)>=0&&i.formatter?[t._v("\n "+t._s(t.common.formatNumber(o[i.prop],i.formatter))+"\n ")]:[["date","datetime"].indexOf(i.dataType)>=0&&i.formatter?[t._v("\n "+t._s(t.common.formatDate(o[i.prop],i.formatter))+"\n ")]:["byte","int32","int64","decimal","double"].indexOf(i.dataType)>=0&&i.formatter?[t._v("\n "+t._s(t.common.formatNumber(o[i.prop],i.formatter))+"\n ")]:[t._v("\n "+t._s(o[i.prop])+"\n ")]]]]}}])}),t._v(" "),a("yrt-editor",t._b({ref:t.editorRef,attrs:{"data-list-ref":t.dataListRef,"data-options":t.dataOptions,action:t.editorOptions.action,visible:t.editorOptions.config.visible,"detail-button-click":t.detailButtonClick,"auth-nodes":t.authNodes},on:{"update:action":function(e){return t.$set(t.editorOptions,"action",e)},"update:visible":function(e){return t.$set(t.editorOptions.config,"visible",e)},"on-item-click":function(e,a,o,i,r){t.onChange(e,a,i,r,o)},"on-change":t.onChange}},"yrt-editor",t.editorOptions,!1)),t._v(" "),a("el-dialog",{attrs:{visible:t.dialogPicVisible,"append-to-body":!0},on:{"update:visible":function(e){t.dialogPicVisible=e}}},[a("div",{staticStyle:{width:"100%","text-align":"center"}},[a("img",{staticStyle:{"max-width":"100%"},attrs:{src:t.dialogImageUrl}}),t._v(" "),a("div")])]),t._v(" "),a("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],attrs:{visible:t.isDialogVisible,title:"生成容器号",width:"500px"},on:{"update:visible":function(e){t.isDialogVisible=e}}},[a("el-form",{attrs:{"label-width":t.formLabelWidth,model:t.from}},[a("el-form-item",{attrs:{label:"仓库名称"}},[a("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择仓库名称"},on:{change:t.getStorageId},model:{value:t.from.storageName,callback:function(e){t.$set(t.from,"storageName",e)},expression:"from.storageName"}},t._l(t.dropDownStorage,function(t,e){return a("el-option",{key:e,attrs:{label:t.storageName,value:t.storage_Id}})}),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"容器类型"}},[a("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择容器类型"},model:{value:t.from.plateType,callback:function(e){t.$set(t.from,"plateType",e)},expression:"from.plateType"}},t._l(t.dropDownplateType,function(t,e){return a("el-option",{key:e,attrs:{label:t.value,value:t.label}})}),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"编号前缀"}},[a("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择编号前缀"},model:{value:t.from.codePrefix,callback:function(e){t.$set(t.from,"codePrefix",e)},expression:"from.codePrefix"}},t._l(t.dropDowncodePrefix,function(t,e){return a("el-option",{key:e,attrs:{label:t.value,value:t.label}})}),1)],1),t._v(" "),a("el-form-item",{staticStyle:{width:"320px"},attrs:{label:"生成数量"}},[a("el-input",{attrs:{placeholder:"请输入内容"},model:{value:t.from.generate,callback:function(e){t.$set(t.from,"generate",e)},expression:"from.generate"}})],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.isDialogVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.createCode()}}},[t._v("确 定")])],1)],1),t._v(" "),a("import-dialog",{attrs:{visible:t.importConfig.isShowDialog,"import-config":t.importConfig},on:{"update:visible":function(e){return t.$set(t.importConfig,"isShowDialog",e)}}})],1)},[],!1,null,"b2c5884e",null);l.options.__file="plate.vue";e.default=l.exports},"11c6":function(t,e,a){},"4wV0":function(t,e,a){"use strict";var o=a("11c6");a.n(o).a},DNkW:function(t,e,a){var o=a("93I4"),i=Math.floor;t.exports=function(t){return!o(t)&&isFinite(t)&&i(t)===t}},"GW1+":function(t,e,a){"use strict";var o=a("mxV5"),i=a.n(o);e.a=function(t){return new i.a(t)}},h5AQ:function(t,e,a){a("hRZT"),t.exports=a("WEpk").Number.isInteger},hRZT:function(t,e,a){var o=a("Y7ZC");o(o.S,"Number",{isInteger:a("DNkW")})},ql3t:function(t,e,a){t.exports={default:a("h5AQ"),__esModule:!0}},yaWU:function(t,e,a){"use strict";a.d(e,"a",function(){return o});var o={bind:function(t,e,a){t.children[2].onscroll=function(e){var a=t.children[3];a&&a.classList.contains("el-table__footer-wrapper")&&(a.scrollLeft=e.target.scrollLeft)}},update:function(t,e,a){}}}}]);
|