tft-fe/dist/js/1487.2312df4b.js
2023-05-30 09:00:50 +08:00

1 line
11 KiB
JavaScript

"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[1487],{1487:function(t,e,a){a.r(e),a.d(e,{default:function(){return C}});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}}),e("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH}},[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),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()}}}),e("base-dialog",{attrs:{dialogTitle:t.addOrEditTitle,dialogVisible:t.centervisible,"before-close":t.handleCancel},on:{cancel:t.handleCancel,confirm:t.handleConfirm}},[e("account-add",{ref:"accountList",on:{successSubmit:t.successSubmit}})],1)],1)},i=[],n=a(475),o=function(){var t=this,e=t._self._c;return e("el-form",{ref:"form",attrs:{rules:t.rules,"label-width":"80px",model:t.form}},[e("el-form-item",{attrs:{label:"用户名",prop:"account"}},[e("el-input",{attrs:{placeholder:"只能输入字母或数字,不可输入汉字",disabled:t.isEdit},model:{value:t.form.account,callback:function(e){t.$set(t.form,"account",e)},expression:"form.account"}})],1),e("el-form-item",{attrs:{label:"密码",prop:"password"}},[e("el-input",{model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}})],1),e("el-form-item",{attrs:{label:"姓名",prop:"name"}},[e("el-input",{model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),e("el-form-item",{attrs:{label:"所属产线",prop:"proLineId"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"所属产线"},model:{value:t.form.proLineId,callback:function(e){t.$set(t.form,"proLineId",e)},expression:"form.proLineId"}},t._l(t.lineList,(function(t,a){return e("el-option",{key:a,attrs:{label:t.name,value:t.id}})})),1)],1),e("el-form-item",{attrs:{label:"角色",prop:"role"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"角色"},model:{value:t.form.role,callback:function(e){t.$set(t.form,"role",e)},expression:"form.role"}},t._l(t.roleList,(function(t,a){return e("el-option",{key:a,attrs:{label:t.dataName,value:t.dataName}})})),1)],1),e("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.isEdit,expression:"isEdit"}],attrs:{label:"状态",prop:"enabled"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"状态"},model:{value:t.form.enabled,callback:function(e){t.$set(t.form,"enabled",e)},expression:"form.enabled"}},t._l(t.stateList,(function(t,a){return e("el-option",{key:a,attrs:{label:t.dataName,value:t.dataCode}})})),1)],1)],1)},s=[],l=a(910),u={name:"AccountAdd",data(){return{form:{id:"",account:"",password:"123456",name:"",proLineId:"",role:"",enabled:1},isEdit:!1,lineList:JSON.parse(localStorage.getItem("publicList")).proLineVoList,roleList:JSON.parse(localStorage.getItem("publicList")).roleVoList,stateList:JSON.parse(localStorage.getItem("publicList")).enabledVoList,rules:{account:[{required:!0,message:"请输入用户名",trigger:"blur"},{min:3,max:18,message:"长度在 3 到 18 个字符",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}],name:[{required:!0,message:"请输入姓名",trigger:"blur"}],proLineId:[{required:!0,message:"请选择所属产线",trigger:"change"}],role:[{required:!0,message:"请选择角色",trigger:"change"}]}}},methods:{init(t){t?(this.isEdit=!0,this.form.id=t,(0,l.D0)({id:t}).then((t=>{0===t.code&&(this.form.account=t.data.account,this.form.password=t.data.password,this.form.name=t.data.name,this.form.proLineId=t.data.proLineId,this.form.role=t.data.role,this.form.enabled=t.data.enabled)}))):(this.isEdit=!1,this.form.id="")},submitForm(){this.$refs["form"].validate((t=>{if(!t)return!1;{let t=/^[\da-z]+$/i,e=new RegExp(t);e.test(this.form.account)?this.isEdit?(0,l.sU)({...this.form}).then((t=>{0===t.code&&(this.$message({message:"操作成功",type:"success",duration:1500}),this.$emit("successSubmit"))})):(0,l.jF)({...this.form}).then((t=>{0===t.code&&(this.$message({message:"操作成功",type:"success",duration:1500}),this.$emit("successSubmit"))})):this.$message({message:"用户名格式不正确应为数字或者字母,请检查",type:"error",duration:1500})}}))},formClear(){this.$refs.form.resetFields(),this.isEdit=!1}}},c=u,d=a(1001),m=(0,d.Z)(c,o,s,!1,null,null,null),p=m.exports,f=a(8027);const h=[{prop:"account",label:"用户名"},{prop:"name",label:"姓名"},{prop:"role",label:"角色"},{prop:"proLineName",label:"所属产线"},{prop:"enabled",label:"状态",width:120,subcomponent:f.Z}],b=[{type:"edit",btnName:"编辑"}];var g={name:"AccountConfig",components:{AccountAdd:p},data(){return{formConfig:[{type:"select",label:"产线",selectOptions:JSON.parse(localStorage.getItem("publicList")).proLineVoList,param:"proLineId",defaultSelect:"",width:120},{type:"select",label:"角色",selectOptions:JSON.parse(localStorage.getItem("publicList")).roleVoList,labelField:"dataName",valueField:"dataName",param:"role",defaultSelect:"",width:150},{type:"input",label:"用户名",placeholder:"用户名",param:"account"},{type:"input",label:"姓名",placeholder:"姓名",param:"name",width:150},{type:"select",label:"状态",selectOptions:JSON.parse(localStorage.getItem("publicList")).enabledVoList,labelField:"dataName",valueField:"dataCode",param:"enabled",defaultSelect:"",width:120},{type:"button",btnName:"查询",name:"search",color:"primary"},{type:"button",btnName:"重置",name:"reset"},{type:"separate"},{type:"button",btnName:"新增",name:"add",color:"success",plain:!0}],tableProps:h,tableData:[],tableBtn:b,tableH:(0,n.NC)(265),total:0,listQuery:{current:1,size:20},centervisible:!1,addOrEditTitle:""}},mounted(){window.addEventListener("resize",(()=>{this.tableH=(0,n.NC)(265)})),this.getList()},methods:{getList(){(0,l.Zs)({...this.listQuery}).then((t=>{0===t.code&&(this.total=t.data.total,this.tableData=t.data.records)}))},handleClick(t){this.addOrEditTitle="编辑",this.$nextTick((()=>{this.$refs.accountList.init(t.data.id)})),this.centervisible=!0},buttonClick(t){switch(t.btnName){case"search":this.listQuery.proLineId=t.proLineId,this.listQuery.role=t.role,this.listQuery.account=t.account,this.listQuery.name=t.name,this.listQuery.enabled=t.enabled,this.listQuery.current=1,this.getList();break;case"reset":this.$refs.searchBarForm.resetForm(),this.listQuery.proLineId="",this.listQuery.role="",this.listQuery.account="",this.listQuery.name="",this.listQuery.enabled=null,this.listQuery.current=1,this.getList();break;default:this.addOrEditTitle="新增",this.centervisible=!0,this.$nextTick((()=>{this.$refs.accountList.init()}))}},handleCancel(){this.$refs.accountList.formClear(),this.centervisible=!1,this.addOrEditTitle=""},handleConfirm(){this.$refs.accountList.submitForm()},successSubmit(){this.handleCancel(),this.getList()}}},L=g,y=(0,d.Z)(L,r,i,!1,null,null,null),C=y.exports},8027:function(t,e,a){a.d(e,{Z:function(){return u}});var r=function(){var t=this,e=t._self._c;return e("div",[e("el-tag",{attrs:{size:"medium",type:t.tagType}},[t._v(t._s(t.showName))])],1)},i=[],n={name:"statusTag",props:{injectData:{type:Object,default:()=>({})}},data(){return{tagType:"",showName:"",list:JSON.parse(localStorage.getItem("publicList")).enabledVoList}},mounted(){this.init()},methods:{init(){1===this.injectData.enabled?this.tagType="":this.tagType="warning",this.list&&this.list.map((t=>{t.dataCode===this.injectData.enabled&&(this.showName=t.dataName)}))}},watch:{injectData(t,e){e.enabled!==t.enabled&&this.init()}}},o=n,s=a(1001),l=(0,s.Z)(o,r,i,!1,null,null,null),u=l.exports},910:function(t,e,a){a.d(e,{$0:function(){return S},A0:function(){return N},D0:function(){return o},ER:function(){return x},Kl:function(){return v},ME:function(){return c},Or:function(){return g},P4:function(){return u},Py:function(){return d},Qj:function(){return Z},Sc:function(){return h},Sl:function(){return L},WZ:function(){return f},Wj:function(){return l},Zs:function(){return i},_:function(){return I},_1:function(){return y},ag:function(){return $},b8:function(){return b},dN:function(){return m},fZ:function(){return p},jF:function(){return n},oW:function(){return Q},qT:function(){return C},sU:function(){return s},tb:function(){return w},xf:function(){return k}});var r=a(8859);function i(t){return(0,r.Z)({url:"/basic/account/page",method:"post",data:t})}function n(t){return(0,r.Z)({url:"/basic/account/add",method:"post",data:t})}function o(t){return(0,r.Z)({url:"/basic/account/get",method:"post",data:t})}function s(t){return(0,r.Z)({url:"/basic/account/update",method:"post",data:t})}function l(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/page",method:"post",data:t})}function u(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/add",method:"post",data:t})}function c(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/get",method:"post",data:t})}function d(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/update",method:"post",data:t})}function m(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/getNameList",method:"post",data:t})}function p(t){return(0,r.Z)({url:"/basic/sparePartsConfiguration/getModelList",method:"post",data:t})}function f(t){return(0,r.Z)({url:"/basic/consumableConfiguration/page",method:"post",data:t})}function h(t){return(0,r.Z)({url:"/basic/consumableConfiguration/add",method:"post",data:t})}function b(t){return(0,r.Z)({url:"/basic/consumableConfiguration/get",method:"post",data:t})}function g(t){return(0,r.Z)({url:"/basic/consumableConfiguration/update",method:"post",data:t})}function L(t){return(0,r.Z)({url:"/basic/consumableConfiguration/getMaterialList",method:"post",data:t})}function y(t){return(0,r.Z)({url:"/basic/consumableConfiguration/materialList",method:"post",data:t})}function C(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/page",method:"post",data:t})}function Z(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/add",method:"post",data:t})}function w(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/get",method:"post",data:t})}function v(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/update",method:"post",data:t})}function N(t){return(0,r.Z)({url:"/basic/sideLibraryConfiguration/list",method:"post",data:t})}function S(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/page",method:"post",data:t})}function $(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/add",method:"post",data:t})}function k(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/get",method:"post",data:t})}function Q(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/update",method:"post",data:t})}function I(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/getUnitList",method:"post",formState:!0,data:t})}function x(t){return(0,r.Z)({url:"/basic/equipmentConfiguration/getEqCode",method:"post",data:t})}}}]);