49.7cc11e81.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[49],{"1d97":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("div",[t("transition",{attrs:{appear:"","enter-active-class":"animated fadeIn"}},[t("q-table",{staticClass:"my-sticky-header-column-table shadow-24",attrs:{data:e.table_list,"row-key":"id",separator:e.separator,loading:e.loading,filter:e.filter,columns:e.columns,"hide-bottom":"",pagination:e.pagination,"no-data-label":"No data","no-results-label":"No data you want","table-style":{height:e.height},flat:"",bordered:""},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"top",fn:function(){return[t("q-btn-group",{attrs:{push:""}},[t("q-btn",{attrs:{label:e.$t("new"),icon:"add"},on:{click:function(t){return e.newFormCheck()}}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("newtip"))+"\n ")])],1),t("q-btn",{attrs:{label:e.$t("refresh"),icon:"refresh"},on:{click:function(t){return e.reFresh()}}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("refreshtip"))+"\n ")])],1)],1),t("q-space")]},proxy:!0},{key:"body",fn:function(a){return[t("q-tr",{attrs:{props:a}},[a.row.id===e.editid?[t("q-td",{key:"department_code",attrs:{props:a}},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("warehouse.view_warehouse.warehouse_code"),autofocus:"",rules:[t=>t&&t.length>0||e.error0]},model:{value:e.editFormData.department_code,callback:function(t){e.$set(e.editFormData,"department_code",t)},expression:"editFormData.department_code"}})],1)]:a.row.id!==e.editid?[t("q-td",{key:"department_code",attrs:{props:a}},[e._v("\n "+e._s(a.row.department_code)+"\n ")])]:e._e(),a.row.id===e.editid?[t("q-td",{key:"department_name",attrs:{props:a}},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("warehouse.view_warehouse.department_name"),autofocus:"",rules:[t=>t&&t.length>0||e.error1]},model:{value:e.editFormData.department_name,callback:function(t){e.$set(e.editFormData,"department_name",t)},expression:"editFormData.department_name"}})],1)]:a.row.id!==e.editid?[t("q-td",{key:"department_name",attrs:{props:a}},[e._v("\n "+e._s(a.row.department_name)+"\n ")])]:a.row.id!==e.editid?[t("q-td",{key:"department_contact",attrs:{props:a}},[e._v("\n "+e._s(a.row.department_contact)+"\n ")])]:e._e(),a.row.id===e.editid?[t("q-td",{key:"department_contact",attrs:{props:a}},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("warehouse.view_warehouse.department_contact"),rules:[t=>t&&t.length>0||e.error4]},model:{value:e.editFormData.department_contact,callback:function(t){e.$set(e.editFormData,"department_contact",t)},expression:"editFormData.department_contact"}})],1)]:a.row.id!==e.editid?[t("q-td",{key:"department_contact",attrs:{props:a}},[e._v("\n "+e._s(a.row.department_contact)+"\n ")])]:e._e(),a.row.id===e.editid?[t("q-td",{key:"department_manager",attrs:{props:a}},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("warehouse.view_warehouse.department_manager"),rules:[t=>t&&t.length>0||e.error5]},model:{value:e.editFormData.department_manager,callback:function(t){e.$set(e.editFormData,"department_manager",t)},expression:"editFormData.department_manager"}})],1)]:a.row.id!==e.editid?[t("q-td",{key:"department_manager",attrs:{props:a}},[e._v("\n "+e._s(a.row.department_manager)+"\n ")])]:e._e(),t("q-td",{key:"creater",attrs:{props:a}},[e._v("\n "+e._s(a.row.creater)+"\n ")]),t("q-td",{key:"create_time",attrs:{props:a}},[e._v("\n "+e._s(a.row.create_time)+"\n ")]),t("q-td",{key:"update_time",attrs:{props:a}},[e._v("\n "+e._s(a.row.update_time)+"\n ")]),e.editMode?e.editMode?[a.row.id===e.editid?[t("q-td",{key:"action",staticStyle:{width:"100px"},attrs:{props:a}},[t("q-btn",{attrs:{round:"",flat:"",push:"",color:"secondary",icon:"check"},on:{click:function(t){return e.editDataSubmit()}}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("confirmedit"))+"\n ")])],1),t("q-btn",{attrs:{round:"",flat:"",push:"",color:"red",icon:"close"},on:{click:function(t){return e.editDataCancel()}}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("canceledit"))+"\n ")])],1)],1)]:a.row.id!==e.editid?void 0:e._e()]:e._e():[t("q-td",{key:"action",staticStyle:{width:"100px"},attrs:{props:a}},[t("q-btn",{attrs:{round:"",flat:"",push:"",color:"purple",icon:"edit"},on:{click:function(t){return e.editData(a.row)}}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("edit"))+"\n ")])],1),t("q-btn",{attrs:{round:"",flat:"",push:"",color:"dark",icon:"delete"},on:{click:function(t){return e.deleteData(a.row.id)}}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4",offset:[10,10],"content-style":"font-size: 12px"}},[e._v("\n "+e._s(e.$t("delete"))+"\n ")])],1)],1)]],2)]}}])})],1),[t("div",{directives:[{name:"show",rawName:"v-show",value:0!==e.max,expression:"max !== 0"}],staticClass:"q-pa-lg flex flex-center"},[t("div",[e._v(e._s(e.total)+" ")]),t("q-pagination",{attrs:{color:"black",max:e.max,"max-pages":6,"boundary-links":""},on:{click:function(t){return e.getList()}},model:{value:e.current,callback:function(t){e.current=t},expression:"current"}}),t("div",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.paginationIpt,expression:"paginationIpt"}],staticStyle:{width:"60px","text-align":"center"},domProps:{value:e.paginationIpt},on:{blur:e.changePageEnter,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.changePageEnter.apply(null,arguments)},input:function(t){t.target.composing||(e.paginationIpt=t.target.value)}}})])],1),t("div",{directives:[{name:"show",rawName:"v-show",value:0===e.max,expression:"max === 0"}],staticClass:"q-pa-lg flex flex-center"},[t("q-btn",{attrs:{flat:"",push:"",color:"dark",label:e.$t("no_data")}})],1)],t("q-dialog",{model:{value:e.newForm,callback:function(t){e.newForm=t},expression:"newForm"}},[t("q-card",{staticClass:"shadow-24"},[t("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders",staticStyle:{height:"50px"}},[t("div",[e._v(e._s(e.$t("newtip")))]),t("q-space"),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4"}},[e._v(e._s(e.$t("index.close")))])],1)],1),t("q-card-section",{staticClass:"scroll",staticStyle:{"max-height":"325px",width:"400px"}},[t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("warehouse.view_warehouse.department_code"),autofocus:"",rules:[t=>t&&t.length>0||e.error0]},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.newDataSubmit()}},model:{value:e.newFormData.department_code,callback:function(t){e.$set(e.newFormData,"department_code",t)},expression:"newFormData.department_code"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("warehouse.view_warehouse.department_name"),rules:[t=>t&&t.length>0||e.error1]},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.newDataSubmit()}},model:{value:e.newFormData.department_name,callback:function(t){e.$set(e.newFormData,"department_name",t)},expression:"newFormData.department_name"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("warehouse.view_warehouse.department_contact"),rules:[t=>t&&t.length>0||e.error4]},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.newDataSubmit()}},model:{value:e.newFormData.department_contact,callback:function(t){e.$set(e.newFormData,"department_contact",t)},expression:"newFormData.department_contact"}}),t("q-input",{attrs:{dense:"",outlined:"",square:"",label:e.$t("warehouse.view_warehouse.department_manager"),rules:[t=>t&&t.length>0||e.error5]},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.newDataSubmit()}},model:{value:e.newFormData.department_manager,callback:function(t){e.$set(e.newFormData,"department_manager",t)},expression:"newFormData.department_manager"}})],1),t("div",{staticStyle:{float:"right",padding:"15px 15px 15px 0"}},[t("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"white","text-color":"black"},on:{click:function(t){return e.newDataCancel()}}},[e._v(e._s(e.$t("cancel")))]),t("q-btn",{attrs:{color:"primary"},on:{click:function(t){return e.newDataSubmit()}}},[e._v(e._s(e.$t("submit")))])],1)],1)],1),t("q-dialog",{model:{value:e.deleteForm,callback:function(t){e.deleteForm=t},expression:"deleteForm"}},[t("q-card",{staticClass:"shadow-24"},[t("q-bar",{staticClass:"bg-light-blue-10 text-white rounded-borders",staticStyle:{height:"50px"}},[t("div",[e._v(e._s(e.$t("delete")))]),t("q-space"),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{dense:"",flat:"",icon:"close"}},[t("q-tooltip",{attrs:{"content-class":"bg-amber text-black shadow-4"}},[e._v(e._s(e.$t("index.close")))])],1)],1),t("q-card-section",{staticClass:"scroll",staticStyle:{"max-height":"325px",width:"400px"}},[e._v("\n "+e._s(e.$t("deletetip"))+"\n ")]),t("div",{staticStyle:{float:"right",padding:"15px 15px 15px 0"}},[t("q-btn",{staticStyle:{"margin-right":"25px"},attrs:{color:"white","text-color":"black"},on:{click:function(t){return e.deleteDataCancel()}}},[e._v(e._s(e.$t("cancel")))]),t("q-btn",{attrs:{color:"primary"},on:{click:function(t){return e.deleteDataSubmit()}}},[e._v(e._s(e.$t("submit")))])],1)],1)],1)],2)},r=[],o=a("3004"),i=a("18d6"),s=(a("bc3a"),{name:"Pagedepartment",data(){return{openid:"",login_name:"",authin:"0",pathname:"warehouse/department/",pathname_previous:"",pathname_next:"",separator:"cell",loading:!1,height:"",table_list:[],columns:[{name:"department_code",required:!0,label:this.$t("warehouse.view_warehouse.department_code"),align:"left",field:"department_code",sortable:!0},{name:"department_name",required:!0,label:this.$t("warehouse.view_warehouse.department_name"),align:"left",field:"department_name",sortable:!0},{name:"department_contact",label:this.$t("warehouse.view_warehouse.department_contact"),field:"department_contact",align:"center"},{name:"department_manager",label:this.$t("warehouse.view_warehouse.department_manager"),field:"department_manager",align:"center"},{name:"creater",label:this.$t("creater"),field:"creater",align:"center"},{name:"create_time",label:this.$t("createtime"),field:"create_time",align:"center",sortable:!0},{name:"update_time",label:this.$t("updatetime"),field:"update_time",align:"center",sortable:!0},{name:"action",label:this.$t("action"),align:"center"}],filter:"",pagination:{page:1,rowsPerPage:"30"},newForm:!1,newFormData:{department_code:"",department_name:"",department_contact:"",department_manager:"",creater:""},editid:0,editFormData:{},editMode:!1,deleteForm:!1,deleteid:0,publishForm:!1,publishdetail:"",square_measure:"",error0:this.$t("warehouse.view_warehouseset.error0"),error1:this.$t("warehouse.view_warehouseset.error1"),error2:this.$t("warehouse.view_warehouseset.error2"),error3:this.$t("warehouse.view_warehouseset.error3"),error4:this.$t("warehouse.view_warehouseset.error4"),error5:this.$t("warehouse.view_warehouseset.error5"),current:1,max:0,total:0,paginationIpt:1}},methods:{getList(){var e=this;i["a"].has("auth")&&Object(o["f"])(e.pathname+"?page="+e.current,{}).then((t=>{e.table_list=t.results,e.total=t.count,0===t.count||1===Math.ceil(t.count/30)?e.max=0:e.max=Math.ceil(t.count/30),e.pathname_previous=t.previous,e.pathname_next=t.next})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},changePageEnter(e){Number(this.paginationIpt)<1?(this.current=1,this.paginationIpt=1):Number(this.paginationIpt)>this.max?(this.current=this.max,this.paginationIpt=this.max):this.current=Number(this.paginationIpt),this.getList()},getListPrevious(){var e=this;i["a"].has("auth")&&Object(o["f"])(e.pathname_previous,{}).then((t=>{e.table_list=t.results,e.pathname_previous=t.previous,e.pathname_next=t.next})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},getListNext(){var e=this;i["a"].has("auth")&&Object(o["f"])(e.pathname_next,{}).then((t=>{e.table_list=t.results,e.pathname_previous=t.previous,e.pathname_next=t.next})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},reFresh(){var e=this;e.getList()},newFormCheck(){var e=this;e.newForm=!0},newDataSubmit(){var e=this,t=[];e.table_list.forEach((e=>{t.push(e.department_name)})),-1===t.indexOf(e.newFormData.department_name)&&0!==e.newFormData.department_name.length?(e.newFormData.creater=e.login_name,Object(o["i"])(e.pathname,e.newFormData).then((t=>{e.getList(),e.newDataCancel(),e.$q.notify({message:"Success Create",icon:"check",color:"green"})})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))):(e.newFormData.creater=e.login_name,Object(o["i"])(e.pathname,e.newFormData).then((t=>{e.getList(),e.newDataCancel(),e.$q.notify({message:"",icon:"close",color:"negative"})})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))),t=[]},newDataCancel(){var e=this;e.newForm=!1,e.newFormData={department_code:"",department_name:"",department_contact:"",department_manager:"",creater:""}},editData(e){var t=this;t.editMode=!0,t.editid=e.id,t.editFormData={department_code:e.department_code,department_name:e.department_name,department_contact:e.department_contact,department_manager:e.department_manager,creater:t.login_name}},editDataSubmit(){var e=this;Object(o["j"])(e.pathname+e.editid+"/",e.editFormData).then((t=>{e.editDataCancel(),e.getList(),e.$q.notify({message:"Success Edit Data",icon:"check",color:"green"})})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},editDataCancel(){var e=this;e.editMode=!1,e.editid=0,e.editFormData={department_code:"",department_name:"",department_contact:"",department_manager:"",creater:""}},deleteData(e){var t=this;t.deleteForm=!0,t.deleteid=e},deleteDataSubmit(){var e=this;Object(o["d"])(e.pathname+e.deleteid+"/").then((t=>{e.deleteDataCancel(),e.getList(),e.$q.notify({message:"Success Edit Data",icon:"check",color:"green"})})).catch((t=>{e.$q.notify({message:t.detail,icon:"close",color:"negative"})}))},deleteDataCancel(){var e=this;e.deleteForm=!1,e.deleteid=0}},created(){var e=this;i["a"].has("openid")?e.openid=i["a"].getItem("openid"):(e.openid="",i["a"].set("openid","")),i["a"].has("login_name")?e.login_name=i["a"].getItem("login_name"):(e.login_name="",i["a"].set("login_name","")),i["a"].has("auth")?(e.authin="1",e.getList()):e.authin="0"},mounted(){var e=this;e.$q.platform.is.electron?e.height=String(e.$q.screen.height-290)+"px":e.height=e.$q.screen.height-290+"px"},updated(){},destroyed(){}}),c=s,d=a("42e1"),l=a("71dd"),m=a("eaac"),p=a("e7a9"),u=a("9c40"),h=a("05c0"),_=a("2c91"),w=a("bd08"),g=a("db86"),b=a("27f9"),f=a("3b16"),v=a("24e8"),x=a("f09f"),k=a("d847"),q=a("a370"),y=a("7f67"),D=a("eebe"),$=a.n(D),F=Object(d["a"])(c,n,r,!1,null,null,null);"function"===typeof l["default"]&&Object(l["default"])(F);t["default"]=F.exports;$()(F,"components",{QTable:m["a"],QBtnGroup:p["a"],QBtn:u["a"],QTooltip:h["a"],QSpace:_["a"],QTr:w["a"],QTd:g["a"],QInput:b["a"],QPagination:f["a"],QDialog:v["a"],QCard:x["a"],QBar:k["a"],QCardSection:q["a"]}),$()(F,"directives",{ClosePopup:y["a"]})},"71dd":function(e,t,a){"use strict";var n=a("79378"),r=a.n(n);t["default"]=r.a},79378:function(e,t){}}]);