text: (function(t){function e(e){for(var r,n,l=e[0],s=e[1],c=e[2],p=0,d=[];p<l.length;p++)n=l[p],Object.prototype.hasOwnProperty.call(o,n)&&o[n]&&d.push(o[n][0]),o[n]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r]);u&&u(e);while(d.length)d.shift()();return i.push.apply(i,c||[]),a()}function a(){for(var t,e=0;e<i.length;e++){for(var a=i[e],r=!0,l=1;l<a.length;l++){var s=a[l];0!==o[s]&&(r=!1)}r&&(i.splice(e--,1),t=n(n.s=a[0]))}return t}var r={},o={app:0},i=[];function n(e){if(r[e])return r[e].exports;var a=r[e]={i:e,l:!1,exports:{}};return t[e].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=t,n.c=r,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(a,r,function(e){return t[e]}.bind(null,r));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],s=l.push.bind(l);l.push=e,l=l.slice();for(var c=0;c<l.length;c++)e(l[c]);var u=s;i.push([0,"chunk-vendors"]),a()})({0:function(t,e,a){t.exports=a("56d7")},"00e8":function(t,e,a){},"034f":function(t,e,a){"use strict";var r=a("64a9"),o=a.n(r);o.a},"04f5":function(t,e,a){"use strict";var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"loading"})},o=[],i={name:"loading"},n=i,l=(a("113b"),a("2877")),s=Object(l["a"])(n,r,o,!1,null,null,null);e["a"]=s.exports},"0e1b":function(t,e,a){},"0f49":function(t,e,a){},"113b":function(t,e,a){"use strict";var r=a("1fd4"),o=a.n(r);o.a},"113f":function(t,e,a){"use strict";var r=a("1e61"),o=a.n(r);o.a},1262:function(t,e,a){},"12c6":function(t,e,a){"use strict";var r=a("9489"),o=a.n(r);o.a},"14ca":function(t,e,a){"use strict";var r=a("4d55"),o=a.n(r);o.a},"1e61":function(t,e,a){},"1fd4":function(t,e,a){},2568:function(t,e,a){"use strict";var r=a("0e1b"),o=a.n(r);o.a},2795:function(t,e,a){"use strict";var r=a("0f49"),o=a.n(r);o.a},"2ded":function(t,e,a){"use strict";var r=a("cfb3"),o=a.n(r);o.a},"2ea6":function(t,e,a){},3013:function(t,e,a){},3774:function(t,e,a){},"3a04":function(t,e,a){},"3a14":function(t,e,a){},"3d5b":function(t,e,a){t.exports=a.p+"static/img/eastek.aa7257d1.png"},"41e9":function(t,e,a){"use strict";var r=a("e824"),o=a.n(r);o.a},"4d55":function(t,e,a){},5301:function(t,e,a){},"56d7":function(t,e,a){"use strict";a.r(e);a("6762"),a("2fdb"),a("cadf"),a("551c"),a("f751"),a("097d");var r=a("2b0e"),o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"app"}},[a("router-view")],1)},i=[],n={name:"App"},l=n,s=(a("034f"),a("2877")),c=Object(s["a"])(l,o,i,!1,null,null,null),u=c.exports,p=a("8c4f"),d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("transition",{attrs:{name:"fade"}},[t.isLoading?a("loading"):t._e()],1),a("div",{attrs:{id:"menu"}},[a("div",[a("el-badge",{directives:[{name:"show",rawName:"v-show",value:t.deter_check,expression:"deter_check"}],staticClass:"menu-badge",attrs:{value:t.num_check}},[a("el-tooltip",{attrs:{placement:"left",effect:"light"}},[a("div",{attrs:{slot:"content"},slot:"content"},[a("span",{staticStyle:{"font-weight":"bold","font-size":"15px"}},[t._v("審核資料")]),a("br"),t._v("有"+t._s(t.num_check)+"筆資料待審核")]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:t.deter_check,expression:"deter_check"}],staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-s-check"},on:{click:t.GoCheck}})],1)],1)],1),a("div",[a("el-badge",{staticClass:"menu-badge",attrs:{value:t.num_handle}},[a("el-tooltip",{attrs:{placement:"left",effect:"light"}},[a("div",{staticStyle:{"font-weight":"bold","font-size":"15px"},attrs:{slot:"content"},slot:"content"},[t._v("送出申請")]),a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-s-promotion"},on:{click:t.GoHandle}})],1)],1)],1),a("div",[a("el-tooltip",{attrs:{placement:"left",effect:"light"}},[a("div",{staticStyle:{"font-weight":"bold","font-size":"15px"},attrs:{slot:"content"},slot:"content"},[t._v("新增")]),a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-plus"},on:{click:t.GoAdd}})],1)],1),a("div",[a("el-tooltip",{attrs:{placement:"left",effect:"light"}},[a("div",{staticStyle:{"font-weight":"bold","font-size":"15px"},attrs:{slot:"content"},slot:"content"},[t._v("修改")]),a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-edit"},on:{click:t.GoEdit}})],1)],1),a("div",[a("el-tooltip",{attrs:{placement:"left",effect:"light"}},[a("div",{staticStyle:{"font-weight":"bold","font-size":"15px"},attrs:{slot:"content"},slot:"content"},[t._v("刪除")]),a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-delete"},on:{click:t.GoDelete}})],1)],1),a("div",[a("el-tooltip",{attrs:{placement:"left",effect:"light"}},[a("div",{staticStyle:{"font-weight":"bold","font-size":"15px"},attrs:{slot:"content"},slot:"content"},[t._v("多筆展延")]),a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-timer"},on:{click:t.Go_Edit_time}})],1)],1),a("div",[a("el-tooltip",{attrs:{placement:"left",effect:"light"}},[a("div",{staticStyle:{"font-weight":"bold","font-size":"15px"},attrs:{slot:"content"},slot:"content"},[t._v("資料下載")]),a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-download"},on:{click:t.click_download}})],1)],1)]),a("div",[a("el-header",{staticClass:"header"},[a("div",{staticStyle:{position:"absolute",left:"30px",top:"3px",cursor:"pointer"},on:{click:t.reload}},[t._v(" License Application Service")]),a("div",[a("el-button-group",{staticClass:"mode-switch"},[a("el-button",{attrs:{type:"warning"},on:{click:function(e){return t.mode_switch("product")}}},[t._v("產品")]),a("el-button",{staticStyle:{background:"#ebd1a0",color:"white","border-color":"#e6a23c"},attrs:{type:"warning"},on:{click:function(e){return t.mode_switch("KeyID")}}},[t._v("SN")])],1)],1),a("el-popover",{attrs:{trigger:"hover",width:"200",placement:"bottom","close-delay":t.delay_time}},[a("div",[a("span",[t._v("成員名稱: "+t._s(t.user[0]))])]),a("div",[a("span",[t._v("-----------------------------------------")])]),a("div",[a("span",[t._v("單頁筆數: "),a("span",[a("el-select",{staticStyle:{width:"80px"},attrs:{size:"small",placeholder:"請選擇"},on:{change:t.pagesize_change,"visible-change":t.select_change},model:{value:t.pagesize,callback:function(e){t.pagesize=e},expression:"pagesize"}},[a("el-option",{key:"10",attrs:{label:"10",value:"10"}}),a("el-option",{key:"20",attrs:{label:"20",value:"20"}}),a("el-option",{key:"50",attrs:{label:"50",value:"50"}}),a("el-option",{key:"100",attrs:{label:"100",value:"100"}})],1)],1)])]),a("div",[a("el-button",{attrs:{type:"primary",icon:"el-icon-setting"},on:{click:function(e){return t.$router.push({name:"admin",query:{}})}}},[t._v("後台管理")])],1),a("div",[a("el-button",{staticStyle:{background:"#F56C6C",color:"#FFFFFF",width:"117px"},attrs:{icon:"el-icon-switch-button"},on:{click:t.Logout}},[t._v("登出")])],1),a("el-button",{staticClass:"memeber_button",attrs:{slot:"reference",icon:"el-icon-s-custom"},slot:"reference"})],1)],1),a("div",{staticStyle:{position:"relative",top:"-30px","font-size":"20px"},attrs:{align:"right"}},[a("span",{staticStyle:{"background-color":"#ffb7b7"}},[t._v("紅色")]),t._v("代表過期、\n      "),a("span",{staticStyle:{"background-color":"#FFFF30"}},[t._v("黃色")]),t._v("代表一個月內過期\n      "),a("span",{staticStyle:{"margin-left":"60px"}},[t._v("Last update: "+t._s(t.update_time))])])],1),a("el-button",{directives:[{name:"show",rawName:"v-show",value:t.search_drawer_btn,expression:"search_drawer_btn"}],staticStyle:{position:"fixed",top:"80px",left:"-20px",padding:"15px","font-size":"20px"},attrs:{type:"warning",icon:"el-icon-search",circle:""},on:{click:t.drawer_open}}),a("el-drawer",{staticClass:"search-drawer",attrs:{title:"",visible:t.search_drawer,direction:"ltr",size:"340","show-close":!1,"modal-append-to-body":!1,modal:!1,"with-header":!1},on:{"update:visible":function(e){t.search_drawer=e},closed:function(e){t.search_drawer_btn=!0}}},[a("div",{staticClass:"search-box"},[a("div",{staticStyle:{left:"40px",bottom:"-10px",position:"relative"}},[a("el-button",{attrs:{type:"warning",icon:"el-icon-s-open"},on:{click:t.clear_filter}},[t._v("重置")]),a("el-button",{attrs:{type:"warning",icon:"el-icon-search"},on:{click:t.category_filter}},[t._v("搜尋")])],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("客戶")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"客戶",filterable:"",clearable:"","filter-method":t.customer_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.customer_enter(e)}},model:{value:t.customer_value,callback:function(e){t.customer_value=e},expression:"customer_value"}},t._l(t.customer_fliter,(function(t){return a("el-option",{attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("KeyID")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"KeyID",filterable:"",clearable:"","filter-method":t.KeyID_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.KeyID_enter(e)}},model:{value:t.KeyID_value,callback:function(e){t.KeyID_value=e},expression:"KeyID_value"}},t._l(t.KeyID_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("產品類別")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"產品類別",filterable:"",clearable:"","filter-method":t.category_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.category_enter(e)}},model:{value:t.category_value,callback:function(e){t.category_value=e},expression:"category_value"}},t._l(t.category_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("產品")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"產品",filterable:"",clearable:"","filter-method":t.product_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.product_enter(e)}},model:{value:t.product_value,callback:function(e){t.product_value=e},expression:"product_value"}},t._l(t.product_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("模組")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"模組",filterable:"",clearable:"","filter-method":t.module_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.module_enter(e)}},model:{value:t.module_value,callback:function(e){t.module_value=e},expression:"module_value"}},t._l(t.module_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("類型")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"類型",filterable:"",clearable:"","filter-method":t.type_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.type_enter(e)}},model:{value:t.type_value,callback:function(e){t.type_value=e},expression:"type_value"}},t._l(t.type_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("地區")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"地區",filterable:"",clearable:"","filter-method":t.region_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.region_enter(e)}},model:{value:t.region_value,callback:function(e){t.region_value=e},expression:"region_value"}},t._l(t.region_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("聯絡人")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"聯絡人",filterable:"",clearable:"","filter-method":t.contact_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.contact_enter(e)}},model:{value:t.contact_value,callback:function(e){t.contact_value=e},expression:"contact_value"}},t._l(t.contact_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-expiring"},[a("el-checkbox",{model:{value:t.expiring_check,callback:function(e){t.expiring_check=e},expression:"expiring_check"}},[a("el-input",{staticStyle:{width:"55px"},attrs:{placeholder:""},model:{value:t.expiring_days,callback:function(e){t.expiring_days=e},expression:"expiring_days"}}),a("span",{staticStyle:{"font-weight":"bold"}},[t._v("天內到期")])],1)],1),a("div",{staticClass:"search-box-expired"},[a("el-checkbox",{model:{value:t.expired_check,callback:function(e){t.expired_check=e},expression:"expired_check"}},[a("span",{staticStyle:{"font-weight":"bold"}},[t._v("已過期")])])],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("到期日")]),a("el-date-picker",{staticStyle:{width:"345px",height:"37px","margin-right":"25px","margin-top":"8px"},attrs:{"value-format":"yyyy-MM-dd",size:"mini",type:"daterange","range-separator":"_","start-placeholder":"開始日期","end-placeholder":"結束日期"},model:{value:t.expiration_value,callback:function(e){t.expiration_value=e},expression:"expiration_value"}})],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("更新日期")]),a("el-date-picker",{staticStyle:{width:"345px",height:"40px","margin-right":"25px","margin-top":"8px"},attrs:{"value-format":"yyyy-MM-dd",size:"mini",type:"daterange","range-separator":"_","start-placeholder":"開始日期","end-placeholder":"結束日期"},model:{value:t.issued_value,callback:function(e){t.issued_value=e},expression:"issued_value"}})],1)]),a("el-button",{staticStyle:{position:"fixed",top:"80px",left:"319px",padding:"15px","font-size":"20px"},attrs:{type:"warning",icon:"el-icon-search",circle:""},on:{click:t.drawer_close}})],1),a("div",{staticStyle:{display:"flex"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.search_drawer,expression:"search_drawer"}],staticStyle:{"flex-basis":"280px"}}),a("div",{staticStyle:{margin:"0px auto",width:"75%"},attrs:{id:"showtable"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.searched_data_num,expression:"searched_data_num"}],staticStyle:{color:"red","font-size":"20px","font-weight":"bold"}},[t._v("已搜尋到"+t._s(t.searched_data_num)+"筆資料")]),a("el-table",{ref:"showtable",attrs:{"row-class-name":t.tableRowColor,"row-style":{height:"0px"},"cell-style":{border:"solid 1px #EAEAEA"},"header-cell-class-name":t.selection_column_style,data:t.tableData.slice((t.currentPage-1)*t.pagesize,t.currentPage*t.pagesize),height:"650px",border:"","row-key":"info_id"},on:{"row-click":t.rowclick,"sort-change":t.sortChange,"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{align:"center",label:" ",width:"50"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n              "+t._s(50*(t.currentPage-1)+(e.row["index"]+1))+"\n            ")]}}])}),a("el-table-column",{attrs:{type:"selection",align:"center",width:"50","reserve-selection":!0}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"customer",label:"客戶"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"sn",label:"KeyID","min-width":"100"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"category",label:"產品類別","min-width":"100"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"product",label:"產品"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"module",label:"模組"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"issued",label:"更新日期","min-width":"100"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"expiration",label:"到期日","min-width":"100"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"count",label:"數量"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"type",label:"類型"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"region",label:"地區"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"contact_display",label:"聯絡人","min-width":"100"}}),a("el-table-column",{attrs:{align:"center",sortable:"custom",prop:"comment",label:"備註","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"",width:"50"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("i",{staticClass:"el-icon-arrow-right",staticStyle:{"font-size":"20px",cursor:"pointer","z-index":"200",position:"relative"},on:{click:function(a){return a.stopPropagation(),t.detail_form(e.row)}}})]}}])})],1),a("div",{staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":t.currentPage,"page-size":t.pagesize,layout:"prev, pager, next",total:t.tableData.length},on:{"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pagesize=e},"update:page-size":function(e){t.pagesize=e}}})],1)],1)]),a("el-dialog",{attrs:{visible:t.detail,width:"80%","append-to-body":"true"},on:{"update:visible":function(e){t.detail=e}}},[a("div",{staticStyle:{height:"580px"}},[a("div",{staticStyle:{"font-size":"25px"}},[t._v(t._s(t.form.form_customer)+"    "+t._s(t.form.form_KeyID)+"申請紀錄")]),a("el-table",{staticClass:"fold",staticStyle:{width:"100%"},attrs:{data:t.form.form_data.fold,"row-style":{height:"10px"},height:"500"}},[a("el-table-column",{attrs:{type:"expand"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-table",{staticClass:"expand",attrs:{data:t.form.form_data.expand[e.$index],border:"","cell-style":{height:"20px"}}},[a("el-table-column",{attrs:{prop:"申請類別",label:"申請類別",width:"100"},scopedSlots:t._u([{key:"default",fn:function(r){return["修改"==r.row["申請類別"]?a("span",[t._v(t._s(r.row["申請類別"]))]):t.form.form_data.expand[e.$index][0]["申請類別"]!=r.row["申請類別"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["申請類別"]))]):a("span",[t._v(t._s(r.row["申請類別"]))])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"產品類別",label:"產品類別"},scopedSlots:t._u([{key:"default",fn:function(r){return[t.form.form_data.expand[e.$index][0]["產品類別"]!=r.row["產品類別"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["產品類別"]))]):a("span",[t._v(t._s(r.row["產品類別"]))])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"產品",label:"產品"},scopedSlots:t._u([{key:"default",fn:function(r){return[t.form.form_data.expand[e.$index][0]["產品"]!=r.row["產品"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["產品"]))]):a("span",[t._v(t._s(r.row["產品"]))])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"模組/功能",label:"模組/功能"},scopedSlots:t._u([{key:"default",fn:function(r){return[t.form.form_data.expand[e.$index][0]["模組/功能"]!=r.row["模組/功能"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["模組/功能"]))]):a("span",[t._v(t._s(r.row["模組/功能"]))])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"版本",label:"版本"},scopedSlots:t._u([{key:"default",fn:function(r){return[t.form.form_data.expand[e.$index][0]["版本"]!=r.row["版本"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["版本"]))]):a("span",[t._v(t._s(r.row["版本"]))])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"數量",label:"數量",width:"100"},scopedSlots:t._u([{key:"default",fn:function(r){return[t.form.form_data.expand[e.$index][0]["數量"]!=r.row["數量"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["數量"]))]):a("span",[t._v(t._s(r.row["數量"]))])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"類型",label:"類型",width:"100"},scopedSlots:t._u([{key:"default",fn:function(r){return[t.form.form_data.expand[e.$index][0]["類型"]!=r.row["類型"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["類型"]))]):a("span",[t._v(t._s(r.row["類型"]))])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"聯絡人",label:"聯絡人"},scopedSlots:t._u([{key:"default",fn:function(r){return[t.form.form_data.expand[e.$index][0]["聯絡人"]!=r.row["聯絡人"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["聯絡人"]))]):a("span",[t._v(t._s(r.row["聯絡人"]))])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"使用期限",label:"使用期限",width:"120"},scopedSlots:t._u([{key:"default",fn:function(r){return[t.form.form_data.expand[e.$index][0]["使用期限"]!=r.row["使用期限"]?a("span",{staticStyle:{color:"red"}},[t._v(t._s(r.row["使用期限"]))]):a("span",[t._v(t._s(r.row["使用期限"]))])]}}],null,!0)})],1)]}}])}),a("el-table-column",{attrs:{label:"ID",prop:"ID"}}),a("el-table-column",{attrs:{label:"申請日期",prop:"申請日期"}}),a("el-table-column",{attrs:{label:"申請人",prop:"申請人"}}),a("el-table-column",{attrs:{label:"類型類別",prop:"類型類別"}}),a("el-table-column",{attrs:{label:"審核人",prop:"審核人"}})],1),a("div",{staticStyle:{"text-align":"right"}},[a("el-button",{attrs:{type:"primary",size:"small",round:"",plain:""},on:{click:t.click_apply_record}},[t._v("查看完整申請")])],1)],1)]),a("el-dialog",{attrs:{visible:t.apply_record_dialog,width:"75%","append-to-body":"true"},on:{"update:visible":function(e){t.apply_record_dialog=e}}},[a("div",{staticClass:"apply_record"},[a("div",{staticStyle:{"font-size":"25px","text-align":"center",color:"black"}},[t._v(t._s(t.form.form_KeyID)+"完整申請紀錄")]),a("el-table",{staticClass:"fold shadow_box",staticStyle:{width:"100%"},attrs:{data:t.form.apply_record,"row-style":{height:"10px"},height:"400"}},[a("el-table-column",{attrs:{type:"expand"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("el-table",{attrs:{data:t.row.data}},[a("el-table-column",{attrs:{prop:"operator",label:"操作","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"customer",label:"客戶","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"sn",label:"KeyID","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"product",label:"產品","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"module",label:"模組","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"version",label:"版本","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"type",label:"類型","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"count",label:"數量","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"expiration",label:"到期日期","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"region",label:"地區","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"comment",label:"備註","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"contact",label:"聯絡人"}})],1)]}}])}),a("el-table-column",{attrs:{label:"申請ID",prop:"id"}}),a("el-table-column",{attrs:{label:"申請日期",prop:"date"}}),a("el-table-column",{attrs:{label:"申請人",prop:"applicant"}}),a("el-table-column",{attrs:{label:"狀態",prop:"status"}}),a("el-table-column",{attrs:{label:"驗證時間",prop:"verify_time"}})],1)],1)]),a("el-dialog",{staticStyle:{"margin-top":"2vh"},attrs:{visible:t.multi_keyID_dialog,width:"55%","close-on-click-modal":!1},on:{"update:visible":function(e){t.multi_keyID_dialog=e}}},[a("div",{staticStyle:{"font-size":"25px","font-weight":"600",padding:"5px",top:"-20px",position:"relative"}},[t._v("多筆id"+t._s(t.multi_keyID_mode))]),a("div",{staticStyle:{"font-size":"20px","font-weight":"600",padding:"5px","text-align":"left"}},[t._v("notice:如果id下有多個產品會一併"+t._s(t.multi_keyID_mode))]),a("div",{staticStyle:{"font-size":"20px","font-weight":"600",padding:"5px","text-align":"left"}},[t._v("ex: 2000001;2000002;2000003")]),a("div",{staticStyle:{"font-size":"18px","font-weight":"600",padding:"5px",color:"red"}},[a("span",[t._v(t._s(t.error_message.digital_error))])]),a("div",{staticStyle:{"font-size":"18px","font-weight":"600",padding:"5px",color:"red"}},[a("span",[t._v(t._s(t.error_message.type_error))])]),a("div",{staticStyle:{"font-size":"18px","font-weight":"600",padding:"5px",color:"red"}},[a("span",[t._v(t._s(t.error_message.exist_error))])]),a("el-input",{staticStyle:{display:"none"},attrs:{type:"textarea"},model:{value:t.multi_keyID_text,callback:function(e){t.multi_keyID_text=e},expression:"multi_keyID_text"}}),a("textarea",{staticStyle:{width:"100%","font-size":"18px"},attrs:{id:"multi_keyID_textarea",rows:"15",cols:"110",placeholder:"只允許 7 碼數字，且使用;區隔"}}),a("el-button",{on:{click:function(e){t.multi_keyID_dialog=!1}}},[t._v("取消")]),a("el-button",{on:{click:t.multi_keyID_dialog_click}},[t._v("確定")])],1)],1)},_=[],f=a("be6f"),h=f["a"],m=(a("682f"),a("7c9b"),Object(s["a"])(h,d,_,!1,null,"a030aaf2",null)),g=m.exports,v=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{attrs:{id:"menu"}},[a("div",[a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-delete"},on:{click:t.GoDelete}})],1),a("div",[a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-timer"},on:{click:t.Go_Edit_time}})],1)]),a("div",[a("el-header",{staticStyle:{top:"-60px","text-align":"right","font-size":"20px",position:"relative","background-color":"#EBD1A0"}},[a("div",{staticStyle:{position:"absolute",left:"30px",top:"3px",cursor:"pointer"},on:{click:t.cancel}},[t._v("License Application Service")]),a("el-popover",{attrs:{trigger:"hover",width:"200",placement:"bottom","close-delay":t.delay_time}},[a("div",[a("span",[t._v("成員名稱: "+t._s(t.user[0]))])]),a("div",[a("span",[t._v("-----------------------------------------")])]),a("div",[a("el-button",{attrs:{type:"primary",icon:"el-icon-setting"},on:{click:function(e){return t.$router.push({name:"admin",query:{}})}}},[t._v("後台管理")])],1),a("div",[a("el-button",{staticStyle:{background:"#F56C6C",color:"#FFFFFF",width:"117px"},attrs:{icon:"el-icon-switch-button"},on:{click:t.Logout}},[t._v("登出")])],1),a("el-button",{staticClass:"memeber_button",attrs:{slot:"reference",icon:"el-icon-s-custom"},slot:"reference"})],1)],1)],1),a("div",{staticClass:"heading"},[t._v("修改")]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.warning,expression:"warning"}],staticStyle:{color:"red","font-size":"20px","font-weight":"bold"}},[t._v(t._s(t.warning_message))]),a("div",{staticStyle:{margin:"0 auto","z-index":"110",width:"90%"}},[a("el-table",{ref:"edittable",attrs:{"row-class-name":t.tableRowColor,data:t.tableData,"row-style":{height:"0px"},"cell-style":t.setCellColor,height:"650px"},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",align:"center",prop:"",label:"編輯",width:"50"}}),a("el-table-column",{attrs:{align:"center",width:"65px",label:" "},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n            "+t._s(e.$index+1)+"\n          ")]}}])}),a("el-table-column",{attrs:{align:"center",prop:"",label:"操作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-button",{attrs:{type:"warning",circle:"",icon:"el-icon-refresh-right",size:"mini"},on:{click:function(e){return t.restore(r,o)}}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"customer",label:"客戶"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"text",name:"customer",disabled:""},model:{value:r.customer,callback:function(e){t.$set(r,"customer",e)},expression:"row.customer"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"KeyID"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"text",name:"sn",disabled:""},model:{value:r.sn,callback:function(e){t.$set(r,"sn",e)},expression:"row.sn"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"product",label:"產品"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"text",name:"product",disabled:""},model:{value:r.product,callback:function(e){t.$set(r,"product",e)},expression:"row.product"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"module",label:"模組"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"text",name:"module",disabled:""},model:{value:r.module,callback:function(e){t.$set(r,"module",e)},expression:"row.module"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"version",label:"版本",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"text",name:"version"},model:{value:r.version,callback:function(e){t.$set(r,"version",e)},expression:"row.version"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"count",label:"數量",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-input",{attrs:{type:"number",name:"count"},on:{blur:function(e){return t.all_column_change(r,"count")}},model:{value:o.count,callback:function(e){t.$set(o,"count",e)},expression:"row.count"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"type",label:"類型",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-select",{on:{change:function(e){return t.type_change(r)}},model:{value:o.type,callback:function(e){t.$set(o,"type",e)},expression:"row.type"}},t._l(t.type_opt,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}},[a("el-tooltip",{attrs:{placement:"right"}},["測試"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("測試 - 借用給客戶(3個月)"),a("br"),t._v("審核單位: 產品 BU"),a("br"),t._v("申請新的 key 須填寫領用單，行政查詢用")]):t._e(),"出貨"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("出貨 - 尚未完全付完款項(6個月)"),a("br"),t._v("審核單位: 財會部"),a("br"),t._v("請提供訂單編號供行政查詢")]):t._e(),"正式"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("正式 - 付完全部款項(隔年1月31日)"),a("br"),t._v("審核單位: 財會部"),a("br"),t._v("請提供訂單編號供行政查詢"),a("br"),t._v("系統會自動延期一年")]):t._e(),"永久"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("台灣區需提供客戶切結書"),a("br"),t._v("目前試用電測付完尾款之客戶")]):t._e(),a("span",{staticStyle:{color:"#8492a6","font-size":"13px",padding:"10px"}},[t._v(t._s(e.value))])])],1)})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"region",label:"地區",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-select",{on:{change:function(e){return t.all_column_change(r,"region")}},model:{value:o.region,callback:function(e){t.$set(o,"region",e)},expression:"row.region"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"expiration",label:"使用期限",width:"145"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-date-picker",{staticStyle:{width:"140px"},attrs:{type:"date","value-format":"yyyy-MM-dd",name:"expiration"},on:{blur:function(e){return t.all_column_change(r,"expiration")}},model:{value:o.expiration,callback:function(e){t.$set(o,"expiration",e)},expression:"row.expiration"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"user",label:"負責人"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-autocomplete",{attrs:{"fetch-suggestions":t.querySearch_user,"popper-append-to-body":"false",placeholder:"僅限一位負責人"},on:{blur:function(e){return t.all_column_change(r,"user")}},model:{value:o.user,callback:function(e){t.$set(o,"user",e)},expression:"row.user"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"contact",label:"聯絡人",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-select",{staticClass:"contact-input",attrs:{filterable:"",clearable:"",multiple:"","filter-method":t.contact_fliterer,placeholder:"請輸入後按enter"},on:{change:function(e){t.contact_selection_change(e,r)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.contact_enter(r)}},model:{value:o.contact_display,callback:function(e){t.$set(o,"contact_display",e)},expression:"row.contact_display"}},t._l(t.contact_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"comment",label:"備註"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-input",{attrs:{type:"text",name:"comment"},on:{blur:function(e){return t.all_column_change(r,"comment")}},model:{value:o.comment,callback:function(e){t.$set(o,"comment",e)},expression:"row.comment"}})]}}])})],1)],1),a("el-button",{staticClass:"submit_button",attrs:{size:"medium",type:"warning"},on:{click:t.cancel}},[t._v("取消")]),a("el-button",{staticClass:"submit_button",attrs:{size:"medium",type:"warning"},on:{click:t.submit}},[t._v("修改")])],1)},y=[],b=(a("ac4d"),a("8a81"),a("1c4c"),a("6b54"),a("456d"),a("96cf"),a("1da1"));a("f400"),a("386d"),a("28a5"),a("7f7f"),a("ac6a"),a("5df3"),a("4f7f");function x(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=w(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function w(t,e){if(t){if("string"===typeof t)return S(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var k={name:"edit",data:function(){return{all_Data:{},tableData:[],origin_Data:[],checked_Data:[],user_opt:[],region_opt:[],caption_opt:[],product_opt:[],contact_opt:[],type_opt:[{label:"正式",value:"正式"},{label:"測試",value:"測試"},{label:"出貨",value:"出貨"},{label:"永久",value:"永久"}],deter_require:[],contact_fliter:[],contact_input:"",warning:!1,warning_message:""}},created:function(){this.user=JSON.parse(this.$route.query.user),this.all_Data=JSON.parse(this.$route.query.all_Data);var t,e=x(this.all_Data["product_data"]);try{for(e.s();!(t=e.n()).done;){var a=t.value;this.caption_opt.push({value:a["caption"],label:a["caption"]})}}catch(I){e.e(I)}finally{e.f()}var r,o=x(this.all_Data["region_data"]);try{for(o.s();!(r=o.n()).done;){var i=r.value;this.region_opt.push({value:i["name"],label:i["name"]})}}catch(I){o.e(I)}finally{o.f()}var n,l=x(this.all_Data["user_data"]);try{for(l.s();!(n=l.n()).done;){var s=n.value;s["email"].indexOf("@")>0&&this.contact_opt.push({value:s["email"],label:s["email"]})}}catch(I){l.e(I)}finally{l.f()}var c,u=new Set,p=x(this.all_Data["sn_data"]);try{for(p.s();!(c=p.n()).done;){var d,_=c.value,f=x(_["user"].split(","));try{for(f.s();!(d=f.n()).done;){var h=d.value;u.add(h)}}catch(I){f.e(I)}finally{f.f()}}}catch(I){p.e(I)}finally{p.f()}var m,g=x(u);try{for(g.s();!(m=g.n()).done;){var v=m.value;this.user_opt.push({value:v,label:v})}}catch(I){g.e(I)}finally{g.f()}this.contact_fliter=this.contact_opt;var y,b=0,w=[],S=x(JSON.parse(this.$route.query.checked_Data));try{for(S.s();!(y=S.n()).done;){var k=y.value;k=Object.assign(k,{operator:"修改",index:b}),""==k["contact_display"]?k["contact_display"]=[]:k["contact_display"]=k["contact"].split(";"),w.push(k),b++}}catch(I){S.e(I)}finally{S.f()}for(var D=0,O=w;D<O.length;D++){var $=O[D];$=Object.assign($,{color:0})}this.origin_Data=JSON.parse(JSON.stringify(w)),this.tableData=JSON.parse(JSON.stringify(w));var N,C=x(this.tableData);try{for(C.s();!(N=C.n()).done;){N.value;this.deter_require.push({count:!1,expiration:!1,user:!1,contact:!1})}}catch(I){C.e(I)}finally{C.f()}},methods:{all_column_change:function(t,e){if(this.tableData.length>1){if("count"==e&&this.origin_Data[t]["count"]!=this.tableData[t]["count"]){this.$notify.closeAll(),this.$notify({dangerouslyUseHTMLString:!0,message:'<span style="font-size:18px; color: #606266;"><i class="el-icon-info"></i>是否套用至下面全部資料?</span><button id="modiftNumber" style="font-size:18px; border-radius: 8px; background-color:#ffbe3f; border: none; cursor: pointer; margin:0px 10px; color:black;">確定</button>'});var a=this;document.getElementById("modiftNumber").addEventListener("click",(function(){for(var e=t+1;e<a.tableData.length;e++)a.tableData[e]["count"]=a.tableData[t]["count"];a.$notify.closeAll()}))}if("expiration"==e&&this.origin_Data[t]["expiration"]!=this.tableData[t]["expiration"]){this.$notify.closeAll(),this.$notify({dangerouslyUseHTMLString:!0,message:'<span style="font-size:18px; color: #606266;"><i class="el-icon-info"></i>是否套用至下面全部資料?</span><button id="modiftExpiration" style="font-size:18px; border-radius: 8px; background-color:#ffbe3f; border: none; cursor: pointer; margin:0px 10px; color:black;">確定</button>'});var r=this;document.getElementById("modiftExpiration").addEventListener("click",(function(){for(var e=t+1;e<r.tableData.length;e++)r.tableData[e]["expiration"]=r.tableData[t]["expiration"];r.$notify.closeAll()}))}if("user"==e&&this.origin_Data[t]["user"]!=this.tableData[t]["user"]){this.$notify.closeAll(),this.$notify({dangerouslyUseHTMLString:!0,message:'<span style="font-size:18px; color: #606266;"><i class="el-icon-info"></i>是否套用至下面全部資料?</span><button id="modiftUser" style="font-size:18px; border-radius: 8px; background-color:#ffbe3f; border: none; cursor: pointer; margin:0px 10px; color:black;">確定</button>'});var o=this;document.getElementById("modiftUser").addEventListener("click",(function(){for(var e=t+1;e<o.tableData.length;e++)o.tableData[e]["user"]=o.tableData[t]["user"];o.$notify.closeAll()}))}if("region"==e&&this.origin_Data[t]["region"]!=this.tableData[t]["region"]){this.$notify.closeAll(),this.$notify({dangerouslyUseHTMLString:!0,message:'<span style="font-size:18px; color: #606266;"><i class="el-icon-info"></i>是否套用至下面全部資料?</span><button id="modiftRegion" style="font-size:18px; border-radius: 8px; background-color:#ffbe3f; border: none; cursor: pointer; margin:0px 10px; color:black;">確定</button>'});var i=this;document.getElementById("modiftRegion").addEventListener("click",(function(){for(var e=t+1;e<i.tableData.length;e++)i.tableData[e]["region"]=i.tableData[t]["region"];i.$notify.closeAll()}))}if("contact"==e&&this.origin_Data[t]["contact"]!=this.tableData[t]["contact"]){this.$notify.closeAll(),this.$notify({dangerouslyUseHTMLString:!0,message:'<span style="font-size:18px; color: #606266;"><i class="el-icon-info"></i>是否套用至下面全部資料?</span><button id="modiftContact" style="font-size:18px; border-radius: 8px; background-color:#ffbe3f; border: none; cursor: pointer; margin:0px 10px; color:black;">確定</button>'});var n=this;document.getElementById("modiftContact").addEventListener("click",(function(){for(var e=t+1;e<n.tableData.length;e++)n.tableData[e]["contact"]=n.tableData[t]["contact"],n.contact_change(n.tableData[e]["contact"],e);n.$notify.closeAll()}))}if("comment"==e&&this.origin_Data[t]["comment"]!=this.tableData[t]["comment"]){this.$notify.closeAll(),this.$notify({dangerouslyUseHTMLString:!0,message:'<span style="font-size:18px; color: #606266;"><i class="el-icon-info"></i>是否套用至下面全部資料?</span><button id="modiftComment" style="font-size:18px; border-radius: 8px; background-color:#ffbe3f; border: none; cursor: pointer; margin:0px 10px; color:black;">確定</button>'});var l=this;document.getElementById("modiftComment").addEventListener("click",(function(){for(var e=t+1;e<l.tableData.length;e++)l.tableData[e]["comment"]=l.tableData[t]["comment"];l.$notify.closeAll()}))}}},Logout:function(){sessionStorage.clear(),this.$router.push("/login")},GoDelete:function(){if(0!=this.checked_Data.length&&void 0!=this.checked_Data[0]){var t,e=x(this.checked_Data);try{for(e.s();!(t=e.n()).done;){var a=t.value;for(var r in this.tableData)JSON.stringify(a)==JSON.stringify(this.tableData[r])&&(this.tableData.splice(r,1),this.origin_Data.splice(r,1),this.deter_require.splice(r,1))}}catch(o){e.e(o)}finally{e.f()}}else this.$message({message:"請選取欲刪除的資料",type:"warning"})},Go_Edit_time:function(){var t=this;0!=this.checked_Data.length&&void 0!=this.checked_Data[0]?this.$prompt("請輸入到期日","到期日修改",{confirmButtonText:"確定",cancelButtonText:"取消",inputType:"date",inputPattern:/\d.\d.\d/,inputErrorMessage:"輸入日期不合法!"}).then((function(e){var a,r=e.value,o=x(t.checked_Data);try{for(o.s();!(a=o.n()).done;){var i=a.value;for(var n in t.tableData)if(JSON.stringify(i)==JSON.stringify(t.tableData[n])){t.tableData[n]["expiration"]=r;break}}}catch(l){o.e(l)}finally{o.f()}t.$refs.edittable.clearSelection()})):this.$message({message:"請選取欲修改時間的資料",type:"warning"})},type_change:function(t){var e=new Date;if("正式"==this.tableData[t].type&&(e.setMonth(e.getMonth()+12),this.tableData[t].expiration=e.toISOString().slice(0,4)+"-01-31"),"測試"==this.tableData[t].type){var a=e.getMonth()+1;12==a?(e.setMonth(e.getMonth()+12),this.tableData[t].expiration=e.toISOString().slice(0,4)+"-03-31"):this.tableData[t].expiration=1==a||2==a?e.toISOString().slice(0,4)+"-03-31":3==a||4==a||5==a?e.toISOString().slice(0,4)+"-06-30":6==a||7==a||8==a?e.toISOString().slice(0,4)+"-09-30":9==a||10==a||11==a?e.toISOString().slice(0,4)+"-12-31":""}"出貨"==this.tableData[t].type&&(this.tableData[t].expiration=e.toISOString().slice(0,4)+"-12-31"),"永久"==this.tableData[t].type&&(this.tableData[t].expiration="2100-12-31")},test_edit_add:function(t,e){var a=!0;""==t["contact"]&&(this.deter_require[e]["contact"]=!0,a=!1);var r=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/;-1==t["user"].search(r)&&(this.deter_require[e]["user"]=!0,a=!1),null!=t["count"]&&""!=t["count"]||(this.deter_require[e]["count"]=!0,a=!1);var o=/^[0-9]*$/;o.test(t["count"])||(this.deter_require[e]["count"]=!0,a=!1),null!=t["expiration"]&&""!=t["expiration"]||(this.deter_require[e]["expiration"]=!0,a=!1);var i,n=new Map,l=x(this.all_Data["customer_data"]);try{for(l.s();!(i=l.n()).done;){var s=i.value;""!=s["site"]?n.set(s["customer_id"],s["name"]+"|"+s["site"]):n.set(s["customer_id"],s["name"])}}catch(c){l.e(c)}finally{l.f()}return a},contact_change:function(t,e){this.tableData[e].contact_display=t.split(";")},contact_selection_change:function(t,e){this.tableData[e].contact=t.join(";")},contact_fliterer:function(t){this.contact_input=t,this.contact_fliter=t?this.contact_opt.filter((function(e){if(String(e["label"]).split("@")[0].includes(t))return!0})):this.contact_opt},contact_enter:function(t){this.tableData[t]["contact_display"].push(this.contact_input),this.tableData[t]["contact"]=this.tableData[t]["contact_display"].join(";")},handleSelectionChange:function(t){this.checked_Data=JSON.parse(JSON.stringify(t))},submit:function(){var t=Object(b["a"])(regeneratorRuntime.mark((function t(){var e,a,r,o,i,n,l,s,c,u,p,d,_,f,h,m,g,v,y,b,w,S,k,D,O,$,N,C,I,J,E=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e=0,a=!0,r=x(this.deter_require);try{for(i=function(){var t=o.value;Object.keys(t).forEach((function(e){t[e]=!1}))},r.s();!(o=r.n()).done;)i()}catch(A){r.e(A)}finally{r.f()}this.warning=!1,this.warning_message="",n=x(this.tableData);try{for(n.s();!(l=n.n()).done;)s=l.value,c=!0,c=this.test_edit_add(s,e),0==c&&(a=!1),e+=1}catch(A){n.e(A)}finally{n.f()}if(a){t.next=12;break}return this.warning=!0,this.warning_message="請確認資料完整性",t.abrupt("return",!1);case 12:u={},p=[],d=x(this.tableData);try{for(d.s();!(_=d.n()).done;)f=_.value,f["sn"]in u?u[f["sn"]].includes(f["user"])||u[f["sn"]].push(f["user"]):u[f["sn"]]=[f["user"]]}catch(A){d.e(A)}finally{d.f()}for(h in u)u[h].length>=2&&p.push(h);if(!p.length){t.next=26;break}return t.next=20,this.$confirm("相同KeyID僅能對應至相同負責人","提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).catch((function(){}));case 20:m=0,g=x(this.tableData);try{for(g.s();!(v=g.n()).done;)y=v.value,p.includes(String(y["sn"]))&&(this.deter_require[m]["user"]=!0),m+=1}catch(A){g.e(A)}finally{g.f()}return this.warning=!0,this.warning_message="相同KeyID僅能對應至相同負責人",t.abrupt("return",!1);case 26:b=0,w={},S=[],k=x(this.tableData);try{for(k.s();!(D=k.n()).done;){O=D.value,$=x(this.all_Data["sn_data"]);try{for($.s();!(N=$.n()).done;)C=N.value,O["sn"]==C["sn"]&&O["user"]!=C["user"]&&(w[O["sn"]]={old_user:C["user"],new_user:O["user"]},S.push(b))}catch(A){$.e(A)}finally{$.f()}b+=1}}catch(A){k.e(A)}finally{k.f()}if(!Object.keys(w).length){t.next=37;break}for(J in I='<table style="border-collapse:collapse"  width="500px" border="1">                                    <tr>                                        <th width="100px">KeyID</th>                                        <th width="200px">原負責人</th>                                        <th width="200px">新負責人</th>                                    </tr>',w)I+="<tr><td>".concat(J,"</td><td>").concat(w[J]["old_user"],"</td><td>").concat(w[J]["new_user"],"</td> </tr>");return I+="</table>",t.next=37,this.$confirm(I,"負責人變更，是否繼續?",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0,dangerouslyUseHTMLString:!0,customClass:"product-conflict"}).then((function(){})).catch((function(){var t,e=x(S);try{for(e.s();!(t=e.n()).done;){var r=t.value;E.deter_require[r]["user"]=!0}}catch(A){e.e(A)}finally{e.f()}a=!1}));case 37:if(a){t.next=41;break}return this.warning=!0,this.warning_message="請檢查負責人",t.abrupt("return",!0);case 41:this.axios.post("/save_to_handle",{checked_Data:this.tableData,content:"none",user:this.user}).then((function(){E.$confirm("","下一步",{confirmButtonText:"送出申請",cancelButtonText:"返回主頁面",type:"warning",center:!0}).then((function(){E.$router.push({name:"handle"})})).catch((function(){E.$router.push({name:"Show_All"})}))}));case 42:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),cancel:function(){this.$router.push({name:"Show_All"})},restore:function(t,e){for(var a=0,r=Object.keys(this.origin_Data[t]);a<r.length;a++){var o=r[a];this.tableData[t][o]=this.origin_Data[t][o]}},datachange:function(){this.tableData=Object.assign([],this.tableData)},tableRowColor:function(t){t.row;var e=t.rowIndex;return 1==this.tableData[e]["color"]?"exceed-row":"success-row"},querySearch_contact:function(t,e){var a=t?this.contact_opt.filter(this.createFilter(t)):this.contact_opt;0!=a.length||t.includes("@")||(a.push({value:t+"@eastek.com.cn",label:t+"@eastek.com.cn"}),a.push({value:t+"@eastek.com.tw",label:t+"@eastek.com.tw"})),e(a)},querySearch_user:function(t,e){var a=t?this.user_opt.filter(this.createFilter(t)):this.user_opt;0!=a.length||t.includes("@")||(a.push({value:t+"@eastek.com.cn",label:t+"@eastek.com.cn"}),a.push({value:t+"@eastek.com.tw",label:t+"@eastek.com.tw"})),e(a)},createFilter:function(t){return function(e){return String(e.value).toLowerCase().split("@")[0].includes(String(t).toLowerCase())}},setCellColor:function(t){t.row,t.column;var e=t.rowIndex,a=t.columnIndex,r={8:"count",11:"expiration",12:"user",13:"contact"};return this.deter_require[e][r[a]]?"background: red;;border:solid 1px #EAEAEA":"border: solid 1px #EAEAEA"}}},D=k,O=(a("41e9"),a("113f"),Object(s["a"])(D,v,y,!1,null,"26a1002d",null)),$=O.exports,N=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("transition",{attrs:{name:"fade"}},[t.isLoading?a("loading"):t._e()],1),a("div",[a("el-dialog",{staticClass:"func_uid-dialog",attrs:{visible:t.drawer},on:{"update:visible":function(e){t.drawer=e}}},[a("span",{staticStyle:{"font-size":"20px","font-weight":"700",top:"-20px",position:"relative"}},[t._v("添加產品")]),a("div",{staticClass:"product_tree",staticStyle:{display:"flex"}},[a("div",{staticStyle:{width:"45%",margin:"0px auto"}},[a("span",{staticStyle:{"font-size":"20px","font-weight":"700"}},[t._v("產品/選項")]),a("el-tree",{ref:"tree",staticStyle:{"border-radius":"4px","overflow-y":"auto",height:"400px"},attrs:{data:t.tree_data,props:t.defaultProps,"node-key":"id","render-content":t.tag_for_tree,"show-checkbox":""},on:{check:t.handleCheckChange}})],1),a("div",{staticStyle:{width:"45%",margin:"0px auto"}},[a("span",{staticStyle:{"font-size":"18px","font-weight":"700"}},[t._v("已選擇("+t._s(t.tree_checked.length)+")")]),a("el-tree",{staticStyle:{"border-radius":"4px","overflow-y":"auto",height:"400px"},attrs:{data:t.tree_checked,props:t.defaultProps,"node-key":"id","render-content":t.tag_for_tree}})],1),a("el-dialog",{attrs:{title:"產品群組(新增)",visible:t.dialogVisible,width:"60%","append-to-body":!0},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-scrollbar",{staticStyle:{height:"350px"}},[a("el-tree",{ref:"product_group_tree",staticStyle:{position:"relative",left:"440px",width:"400px",height:"350px"},attrs:{data:t.productgroup_tree,props:t.defaultProps,accordion:"","node-key":"id","show-checkbox":""},on:{check:t.choose_product_group},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.node,o=e.data;return a("span",{staticClass:"custom-tree-node"},[a("span",[t._v(t._s(r.label))]),a("span",[a("el-button",{directives:[{name:"show",rawName:"v-show",value:0==t.deter_product_group(r)&&0==t.append_tree_lock&&1!=o["add"],expression:"deter_product_group(node)==false && append_tree_lock==false && data['add'] != true"}],attrs:{type:"text",size:"mini"},on:{click:function(){return t.append(r,o)}}},[t._v("\n                            加入此標籤\n                        ")]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1==o["add"],expression:"data['add'] == true"}],attrs:{type:"text",size:"mini"},on:{click:function(){return t.remove(r,o)}}},[t._v("\n                            重選標籤\n                        ")]),a("el-tag",{directives:[{name:"show",rawName:"v-show",value:"group"==t.deter_product_group(r),expression:"deter_product_group(node)=='group'"}],staticStyle:{"font-size":"14px",height:"22px"},attrs:{type:"success"}},[t._v("G")])],1)])}}])})],1),a("div",{staticStyle:{position:"absolute",top:"80px"}},[a("div",{staticStyle:{position:"relative"}},[t._v("名稱:"),a("el-input",{staticStyle:{width:"150px"},attrs:{placeholder:"請輸入群組名稱"},model:{value:t.product_dialog.caption,callback:function(e){t.$set(t.product_dialog,"caption",e)},expression:"product_dialog.caption"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("產品:"),a("el-select",{ref:"dialog_pro",staticClass:"none_delete_tag",staticStyle:{width:"300px"},attrs:{filterable:"",remote:"",multiple:"",placeholder:"請輸入產品群組"},on:{focus:function(e){return t.make_blur("1")}},model:{value:t.product_dialog.product_list,callback:function(e){t.$set(t.product_dialog,"product_list",e)},expression:"product_dialog.product_list"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("描述:"),a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入描述"},model:{value:t.product_dialog.description,callback:function(e){t.$set(t.product_dialog,"description",e)},expression:"product_dialog.description"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("備註:"),a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入備註"},model:{value:t.product_dialog.remarks,callback:function(e){t.$set(t.product_dialog,"remarks",e)},expression:"product_dialog.remarks"}})],1),a("span",[a("el-button",{staticStyle:{position:"relative",left:"30px"},attrs:{type:"danger",plain:""},on:{click:t.cancel_product_group}},[t._v("取消")]),a("el-button",{staticStyle:{position:"relative",left:"40px"},attrs:{type:"primary",plain:""},on:{click:t.store_product_group}},[t._v("確定")])],1)])],1)],1),a("el-button",{attrs:{type:"warning",size:"medium"},on:{click:t.cancel_drawer}},[t._v("取消")]),a("el-button",{attrs:{type:"warning",size:"medium"},on:{click:t.check_drawer}},[t._v("添加")])],1)],1),a("div",{attrs:{id:"menu"}},[a("div",[t.checked_Data.length>0?a("el-button",{staticClass:"OperatorButton",attrs:{type:"info",icon:"el-icon-plus",disabled:""}}):t._e()],1),a("div",[0==t.checked_Data.length?a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-plus"},on:{click:t.GoAdd}}):t._e()],1),a("div",[a("el-button",{staticClass:"OperatorButton",attrs:{type:"warning",icon:"el-icon-delete"},on:{click:t.GoDelete}})],1)]),a("el-dialog",{staticClass:"add_dialog",attrs:{visible:t.add_dialog,width:"80%","before-close":t.handleClose,"show-close":!1},on:{"update:visible":function(e){t.add_dialog=e}}},[a("el-form",{attrs:{model:t.sub_row,"label-width":"80px","label-position":"left"}},[a("el-form-item",[a("div",{staticStyle:{"text-align":"start"}},[a("el-col",{attrs:{span:2}},[t._v("客戶名")]),a("el-col",{attrs:{span:5}},[a("el-autocomplete",{staticStyle:{width:"95%",position:"relative",top:"-10px"},attrs:{size:"small","fetch-suggestions":t.querySearch_name,placeholder:"請輸入客戶"},model:{value:t.input.name,callback:function(e){t.$set(t.input,"name",e)},expression:"input.name"}})],1),a("el-col",{staticStyle:{"text-align":"center"},attrs:{span:3}},[t._v("客戶廠區(選填)")]),a("el-col",{attrs:{span:5}},[a("el-autocomplete",{staticStyle:{width:"95%",position:"relative",top:"-10px"},attrs:{size:"small","fetch-suggestions":t.querySearch_site,placeholder:"請輸入廠區"},model:{value:t.input.factory,callback:function(e){t.$set(t.input,"factory",e)},expression:"input.factory"}})],1),a("el-col",{staticStyle:{"text-align":"center"},attrs:{span:2}},[t._v("業務地區")]),a("el-col",{attrs:{span:5}},[a("el-select",{staticStyle:{width:"95%",position:"relative",top:"-10px"},attrs:{size:"small",placeholder:"業務地區"},model:{value:t.sub_row.region,callback:function(e){t.$set(t.sub_row,"region",e)},expression:"sub_row.region"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1)]),a("el-form-item",[a("div",{staticStyle:{"text-align":"start"}},[a("el-col",{attrs:{span:2}},[t._v("KeyID")]),a("div",{staticStyle:{display:"flex"}},[a("el-select",{staticStyle:{width:"645px",bottom:"7px"},attrs:{filterable:"",clearable:"",multiple:"","filter-method":t.sn_fliterer,placeholder:"請選擇KeyID或手動輸入後按Enter"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.subrow_sn_enter(e)}},model:{value:t.sub_row.sn_multi,callback:function(e){t.$set(t.sub_row,"sn_multi",e)},expression:"sub_row.sn_multi"}},t._l(t.sn_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),a("div",[a("el-popover",{ref:"KeyID_pop",attrs:{placement:"bottom",width:"343",trigger:"click","popper-class":"KeyID_popover"}},[a("div",{staticStyle:{"text-align":"center","font-size":"18px"}},[t._v("添加多筆KeyID")]),a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{margin:"10px"}},[t._v("區間")]),a("el-input",{staticStyle:{width:"140px"},model:{value:t.multi_KeyID_form.range_begin,callback:function(e){t.$set(t.multi_KeyID_form,"range_begin",t._n(e))},expression:"multi_KeyID_form.range_begin"}}),a("div",{staticStyle:{margin:"10px"}},[t._v("~")]),a("el-input",{staticStyle:{width:"140px"},model:{value:t.multi_KeyID_form.range_end,callback:function(e){t.$set(t.multi_KeyID_form,"range_end",t._n(e))},expression:"multi_KeyID_form.range_end"}})],1),a("div",{staticStyle:{dispaly:"flex","text-align":"end"}},[a("el-button",{attrs:{type:"warning"},on:{click:function(e){return t.$refs["KeyID_pop"].doClose()}}},[t._v("取消")]),a("el-button",{attrs:{type:"warning"},on:{click:t.add_multi_KeyID}},[t._v("添加")])],1),a("el-select",{staticStyle:{width:"380px"},attrs:{filterable:"",clearable:"",multiple:"","filter-method":t.sn_fliterer,placeholder:"請選擇KeyID或手動輸入後按Enter"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.subrow_sn_enter(e)}},model:{value:t.sub_row.sn_multi,callback:function(e){t.$set(t.sub_row,"sn_multi",e)},expression:"sub_row.sn_multi"}},t._l(t.sn_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),a("div",{staticStyle:{margin:"10px"}}),a("el-button",{staticStyle:{left:"-43px",position:"relative"},attrs:{slot:"reference",type:"warning"},slot:"reference"},[t._v("添加多筆")])],1)],1)],1)],1)]),a("el-form-item",[a("div",{staticStyle:{"text-align":"start"}},[a("el-col",{attrs:{span:2}},[t._v("產品名稱")]),a("div",{staticStyle:{display:"flex"}},[a("el-input",{staticStyle:{width:"580px",position:"relative",top:"-10px"},attrs:{placeholder:"請點選右邊「添加多筆」",readonly:""},model:{value:t.sub_row.func_uid,callback:function(e){t.$set(t.sub_row,"func_uid",e)},expression:"sub_row.func_uid"}}),a("el-button",{staticStyle:{left:"23px",position:"relative",height:"38px"},attrs:{type:"warning"},on:{click:function(e){return t.choose_func_uid()}}},[t._v("添加多筆")])],1)],1)]),a("el-form-item",[a("div",{staticStyle:{"text-align":"start"}},[a("el-col",{attrs:{span:2}},[t._v("類型")]),a("el-col",{attrs:{span:4}},[a("el-select",{staticStyle:{width:"95%",position:"relative",top:"-10px"},attrs:{size:"small",placeholder:"類型"},on:{change:t.subrow_type_change},model:{value:t.sub_row.type,callback:function(e){t.$set(t.sub_row,"type",e)},expression:"sub_row.type"}},t._l(t.type_opt,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}},[a("el-tooltip",{attrs:{placement:"right"}},["測試"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("測試 - 借用給客戶(3個月)"),a("br"),t._v("審核單位: 產品 BU"),a("br"),t._v("申請新的 key 須填寫領用單，行政查詢用")]):t._e(),"出貨"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("出貨 - 尚未完全付完款項(6個月)"),a("br"),t._v("審核單位: 財會部"),a("br"),t._v("請提供訂單編號供行政查詢")]):t._e(),"正式"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("正式 - 付完全部款項(隔年1月31日)"),a("br"),t._v("審核單位: 財會部"),a("br"),t._v("請提供訂單編號供行政查詢"),a("br"),t._v("系統會自動延期一年")]):t._e(),"永久"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("台灣區需提供客戶切結書"),a("br"),t._v("目前試用電測付完尾款之客戶")]):t._e(),a("span",{staticStyle:{color:"#8492a6","font-size":"13px",padding:"10px 55px"}},[t._v(t._s(e.value))])])],1)})),1)],1),a("el-col",{staticStyle:{"text-align":"center"},attrs:{span:2}},[t._v("到期日")]),a("el-col",{attrs:{span:4}},[a("el-date-picker",{staticStyle:{width:"95%",position:"relative",top:"-10px"},attrs:{type:"date","value-format":"yyyy-MM-dd",name:"expiration",placeholder:"請輸入到期日"},model:{value:t.sub_row.expiration,callback:function(e){t.$set(t.sub_row,"expiration",e)},expression:"sub_row.expiration"}})],1),a("el-col",{staticStyle:{"text-align":"center"},attrs:{span:2}},[t._v("數量")]),a("el-col",{attrs:{span:4}},[a("el-input",{staticStyle:{width:"95%",position:"relative",top:"-10px"},attrs:{placeholder:"請輸入數量"},model:{value:t.sub_row.count,callback:function(e){t.$set(t.sub_row,"count",t._n(e))},expression:"sub_row.count"}})],1),a("el-col",{staticStyle:{"text-align":"center"},attrs:{span:2}},[t._v("版本(選填)")]),a("el-col",{attrs:{span:4}},[a("el-input",{staticStyle:{width:"95%",position:"relative",top:"-10px"},attrs:{placeholder:"請輸入允許版本"},model:{value:t.sub_row.version,callback:function(e){t.$set(t.sub_row,"version",e)},expression:"sub_row.version"}})],1)],1)]),a("el-form-item",[a("div",{staticStyle:{"text-align":"start"}},[a("el-col",{attrs:{span:2}},[t._v("負責人")]),a("el-col",{attrs:{span:6}},[a("el-autocomplete",{staticStyle:{width:"223px",position:"relative",top:"-10px"},attrs:{"fetch-suggestions":t.querySearch_user,placeholder:"請輸入負責人"},model:{value:t.sub_row.user,callback:function(e){t.$set(t.sub_row,"user",e)},expression:"sub_row.user"}})],1)],1)]),a("el-form-item",[a("div",{staticStyle:{"text-align":"start"}},[a("el-col",{attrs:{span:2}},[t._v("聯絡人")]),a("div",{staticStyle:{display:"flex"}},[a("el-select",{staticStyle:{width:"647px",bottom:"7px"},attrs:{filterable:"",clearable:"",multiple:"","filter-method":t.contact_fliterer},on:{change:function(e){t.subrow_contact_selection_change(e)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.subrow_contact_enter(e)}},model:{value:t.multi_contact_form.search_contact,callback:function(e){t.$set(t.multi_contact_form,"search_contact",e)},expression:"multi_contact_form.search_contact"}},t._l(t.contact_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),a("div",[a("el-popover",{ref:"contact_pop",attrs:{placement:"bottom",trigger:"click","popper-class":"KeyID_popover"}},[a("div",{staticStyle:{"text-align":"center","font-size":"18px"}},[t._v("添加多筆聯絡人")]),a("div",{staticStyle:{display:"flex"}},[a("el-select",{staticClass:"contact-input",attrs:{filterable:"",clearable:"",multiple:"","filter-method":t.contact_fliterer},on:{change:function(e){t.subrow_contact_selection_change(e)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.subrow_contact_enter(e)}},model:{value:t.multi_contact_form.search_contact,callback:function(e){t.$set(t.multi_contact_form,"search_contact",e)},expression:"multi_contact_form.search_contact"}},t._l(t.contact_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-button",{staticStyle:{left:"-43px",position:"relative"},attrs:{slot:"reference",type:"warning"},slot:"reference"},[t._v("添加多筆")])],1)],1)],1)],1)]),a("el-form-item",[a("div",{staticStyle:{"text-align":"start"}},[a("el-col",{attrs:{span:2}},[t._v("備註(選填)")]),a("el-input",{staticStyle:{width:"582px",position:"relative",top:"-10px"},attrs:{placeholder:"請輸入備註"},model:{value:t.sub_row.comment,callback:function(e){t.$set(t.sub_row,"comment",e)},expression:"sub_row.comment"}})],1)])],1),a("div",{staticStyle:{position:"relative","text-align":"right"}},[a("el-button",{attrs:{type:"warning"},on:{click:t.close_add_dialog}},[t._v("取消")]),a("el-button",{attrs:{type:"warning"},on:{click:function(e){return t.subrow_add()}}},[t._v("添加")])],1)],1),a("div",[a("el-header",{staticStyle:{top:"-60px","text-align":"right","font-size":"20px",position:"relative","background-color":"#EBD1A0"}},[a("div",{staticStyle:{position:"absolute",left:"30px",top:"3px",cursor:"pointer"},on:{click:t.cancel}},[t._v("License Application Service")]),a("el-popover",{attrs:{trigger:"hover",width:"200",placement:"bottom","close-delay":t.delay_time}},[a("div",[a("span",[t._v("成員名稱: "+t._s(t.user[0]))])]),a("div",[a("span",[t._v("-----------------------------------------")])]),a("div",[a("el-button",{attrs:{type:"primary",icon:"el-icon-setting"},on:{click:function(e){return t.$router.push({name:"admin",query:{}})}}},[t._v("後台管理")])],1),a("div",[a("el-button",{staticStyle:{background:"#F56C6C",color:"#FFFFFF",width:"117px"},attrs:{icon:"el-icon-switch-button"},on:{click:t.Logout}},[t._v("登出")])],1),a("el-button",{staticClass:"memeber_button",attrs:{slot:"reference",icon:"el-icon-s-custom"},slot:"reference"})],1)],1)],1),a("div",{staticClass:"heading"},[t._v("增加")]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.warning,expression:"warning"}],staticStyle:{color:"red","font-size":"20px","font-weight":"bold"}},[t._v(t._s(t.warning_message))]),a("div",{staticStyle:{position:"relative",top:"0px",margin:"0 auto","z-index":"110",width:"90%"}},[a("el-table",{ref:"addtable",attrs:{data:t.tableData,"row-style":{background:"#FFF0D2"},"cell-style":t.setCellColor,height:"650px"},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",align:"center",prop:"",label:"編輯",width:"50"}}),a("el-table-column",{attrs:{align:"center",label:" ",width:"70"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n            "+t._s(e.$index+1)+"\n          ")]}}])}),a("el-table-column",{attrs:{align:"center",prop:"",label:"操作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-button",{attrs:{type:"warning",circle:"",icon:"el-icon-refresh-right",size:"mini"},on:{click:function(e){return t.restore(r,o)}}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"customer",label:"客戶"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"text",name:"customer"},model:{value:r.customer,callback:function(e){t.$set(r,"customer",e)},expression:"row.customer"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"KeyID"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"number",name:"sn"},model:{value:r.sn,callback:function(e){t.$set(r,"sn",e)},expression:"row.sn"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"func_uid",label:"產品",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-input",{staticClass:"func_uid",staticStyle:{width:"110px"},attrs:{type:"text",name:"product",readonly:""},model:{value:o.product,callback:function(e){t.$set(o,"product",e)},expression:"row.product"}}),a("el-popover",{ref:"funcuid_popover-"+r,attrs:{placement:"bottom",width:"260",trigger:"click"}},[a("el-tree",{ref:"funcuid_tree-"+r,staticStyle:{"border-radius":"4px","min-height":"290px","overflow-y":"auto","max-height":"400px"},attrs:{data:t.single_choice_tree,props:t.defaultProps,"node-key":"id","render-content":t.tag_for_tree,"check-on-click-node":"","show-checkbox":""},on:{check:function(e){return t.funcuid_click(r)}}}),a("el-button",{staticStyle:{"font-size":"15px"},attrs:{slot:"reference",type:"text",icon:"el-icon-edit-outline"},slot:"reference"})],1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"module",label:"模組"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{staticClass:"func_uid",attrs:{type:"text",name:"module",readonly:""},model:{value:r.module,callback:function(e){t.$set(r,"module",e)},expression:"row.module"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"version",label:"版本",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"text",name:"version"},model:{value:r.version,callback:function(e){t.$set(r,"version",e)},expression:"row.version"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"count",label:"數量",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"number",name:"count"},model:{value:r.count,callback:function(e){t.$set(r,"count",e)},expression:"row.count"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"type",label:"類型",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-select",{on:{change:function(e){return t.type_change(r)}},model:{value:o.type,callback:function(e){t.$set(o,"type",e)},expression:"row.type"}},t._l(t.type_opt,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}},[a("el-tooltip",{attrs:{placement:"right"}},["測試"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("測試 - 借用給客戶(3個月)"),a("br"),t._v("審核單位: 產品 BU"),a("br"),t._v("申請新的 key 須填寫領用單，行政查詢用")]):t._e(),"出貨"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("出貨 - 尚未完全付完款項(6個月)"),a("br"),t._v("審核單位: 財會部"),a("br"),t._v("請提供訂單編號供行政查詢")]):t._e(),"正式"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("正式 - 付完全部款項(隔年1月31日)"),a("br"),t._v("審核單位: 財會部"),a("br"),t._v("請提供訂單編號供行政查詢"),a("br"),t._v("系統會自動延期一年")]):t._e(),"永久"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("台灣區需提供客戶切結書"),a("br"),t._v("目前試用電測付完尾款之客戶")]):t._e(),a("span",{staticStyle:{color:"#8492a6","font-size":"13px",padding:"10px"}},[t._v(t._s(e.value))])])],1)})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"region",label:"地區",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-select",{model:{value:r.region,callback:function(e){t.$set(r,"region",e)},expression:"row.region"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"expiration",label:"使用期限",width:"145"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-date-picker",{staticStyle:{width:"135px"},attrs:{type:"date","value-format":"yyyy-MM-dd",name:"expiration"},model:{value:r.expiration,callback:function(e){t.$set(r,"expiration",e)},expression:"row.expiration"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"user",label:"負責人"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("div",{staticStyle:{display:"flex"}},[a("el-autocomplete",{attrs:{"fetch-suggestions":t.querySearch_user,"popper-append-to-body":"false",placeholder:"僅限一位負責人"},model:{value:r.user,callback:function(e){t.$set(r,"user",e)},expression:"row.user"}})],1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"contact",label:"聯絡人",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.$index,o=e.row;return[a("el-select",{staticClass:"contact-input",attrs:{filterable:"",clearable:"",multiple:"","filter-method":t.contact_fliterer,placeholder:"請輸入後按enter"},on:{change:function(e){t.contact_selection_change(e,r)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.contact_enter(r)}},model:{value:o.contact_display,callback:function(e){t.$set(o,"contact_display",e)},expression:"row.contact_display"}},t._l(t.contact_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"comment",label:"備註"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return[a("el-input",{attrs:{type:"text",name:"comment"},model:{value:r.comment,callback:function(e){t.$set(r,"comment",e)},expression:"row.comment"}})]}}])})],1)],1),a("el-button",{staticClass:"submit_button",attrs:{size:"medium",type:"warning"},on:{click:t.cancel}},[t._v("取消")]),a("el-button",{staticClass:"submit_button",attrs:{size:"medium",type:"warning"},on:{click:t.submit}},[t._v("添加")])],1)},C=[],I=(a("20d6"),a("a481"),a("04f5"));function J(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=E(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function E(t,e){if(t){if("string"===typeof t)return A(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?A(t,e):void 0}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var z={components:{Loading:I["a"]},name:"add",data:function(){return{product_groups_data:[],user:[],all_Data:{},info_data:[],origin_Data:[],tableData:[],productgroup_tree:[],customer_site_opt:[],user_opt:[],customer_name_opt:[],region_opt:[],func_uid_opt:[],sn_opt:[],contact_opt:[],type_opt:[{label:"正式",value:"正式"},{label:"測試",value:"測試"},{label:"出貨",value:"出貨"},{label:"永久",value:"永久"}],info_id:0,input:{name:"",factory:""},product_dialog:{caption:"",product_list:[],description:"",remarks:"",product_list_detail:[]},sub_row:{category:"",comment:"",contact:"",count:null,customer:"",expiration:"",func_uid:[],index:null,info:[],info_id:null,issued:"",operator:"",region:"",registration:"",sn:null,sn_multi:[],type:"",user:"",version:"",contact_display:[""],user_display:[""]},multi_KeyID_form:{range_begin:"",range_end:"",data:""},multi_contact_form:{search_contact:"",data:""},row_index:0,drawer:!1,tree_data:[],origin_tree_data:[],dialogVisible:!1,deter_require:[],append_tree_lock:!1,register_append_node:[],tree_node_count:0,caption_to_product:[],tree_map:new Map,optionSet:new Set,isLoading:!0,fight_data:[],add_dialog:!1,tree_checked:[],user_region:"",checked_Data:[],product_map:new Map,option_map:new Map,module_map:new Map,customer_map:new Map,sn_dict:{},contact_input:"",contact_fliter:[],sn_input:[],sn_fliter:[],warning:!1,warning_message:""}},created:function(){var t=this;this.axios.get("/get_product_groups_info_data",{headers:{"Content-Encoding":"gzip"}}).then((function(e){t.product_groups_data=JSON.parse(JSON.stringify(e.data))["product_groups"],t.info_data=JSON.parse(JSON.stringify(e.data))["info_data"],t.axios.get("/show_all",{headers:{"Content-Encoding":"gzip"},params:{user:JSON.stringify(JSON.parse(sessionStorage.getItem("user")))}}).then((function(e){t.user=JSON.parse(sessionStorage.getItem("user")),t.all_Data=JSON.parse(JSON.stringify(e.data)),t.product_map=new Map,t.option_map=new Map,t.module_map=new Map,t.sn_dict=JSON.parse(JSON.stringify(e.data))["sn_dict"];var a,r=J(t.all_Data["product_data"]);try{for(r.s();!(a=r.n()).done;){var o=a.value;t.product_map.set(o["product_name"],{category_id:o["category_id"],caption:o["caption"]})}}catch($e){r.e($e)}finally{r.f()}var i,n=J(t.all_Data["option_data"]);try{for(n.s();!(i=n.n()).done;){var l=i.value;t.option_map.set(l["option_name"],{category_id:t.product_map.get(l["product_name"])["category_id"],product_name:l["product_name"],caption:l["caption"]})}}catch($e){n.e($e)}finally{n.f()}var s,c=J(t.all_Data["module_data"]);try{for(c.s();!(s=c.n()).done;){var u=s.value;t.module_map.set(u["mod_uid"],u["caption"])}}catch($e){c.e($e)}finally{c.f()}t.info_id=t.info_data.length;var p,d=J(t.all_Data["sn_data"]);try{for(d.s();!(p=d.n()).done;){var _=p.value;t.sn_opt.push({value:_["sn"],label:_["sn"]})}}catch($e){d.e($e)}finally{d.f()}var f,h=new Set,m=J(t.all_Data["sn_data"]);try{for(m.s();!(f=m.n()).done;){var g,v=f.value,y=J(v["user"].split(","));try{for(y.s();!(g=y.n()).done;){var b=g.value;h.add(b)}}catch($e){y.e($e)}finally{y.f()}}}catch($e){m.e($e)}finally{m.f()}var x,w=J(h);try{for(w.s();!(x=w.n()).done;){var S=x.value;t.user_opt.push({value:S,label:S})}}catch($e){w.e($e)}finally{w.f()}var k,D=J(t.all_Data["region_data"]);try{for(D.s();!(k=D.n()).done;){var O=k.value;t.region_opt.push({value:O["name"],label:O["name"]})}}catch($e){D.e($e)}finally{D.f()}var $,N=J(t.all_Data["user_data"]);try{for(N.s();!($=N.n()).done;){var C=$.value;if(C["user"]==t.user[0]){var I,E=J(t.all_Data["region_data"]);try{for(E.s();!(I=E.n()).done;){var A=I.value;if(A["region_id"]==C["region"][1]){t.user_region=A["name"];break}}}catch($e){E.e($e)}finally{E.f()}}t.contact_opt.push({value:C["email"],label:C["email"]})}}catch($e){N.e($e)}finally{N.f()}var z,j=J(t.all_Data["customer_data"]);try{for(j.s();!(z=j.n()).done;){var T,M=z.value,K=0,B=0,P=J(t.customer_name_opt);try{for(P.s();!(T=P.n()).done;){var L=T.value;L["value"]==M["name"]&&(K=1)}}catch($e){P.e($e)}finally{P.f()}var q,F=J(t.customer_site_opt);try{for(F.s();!(q=F.n()).done;){var U=q.value;U["value"]==M["site"]&&(B=1)}}catch($e){F.e($e)}finally{F.f()}0==K&&t.customer_name_opt.push({value:M["name"],label:M["name"]}),0==B&&t.customer_site_opt.push({value:M["site"],label:M["site"]})}}catch($e){j.e($e)}finally{j.f()}t.contact_fliter=t.contact_opt,t.sn_fliter=t.sn_opt;var R=JSON.parse(t.$route.query.checked_Data);if(0!=R.length){var V,H=J(R);try{for(H.s();!(V=H.n()).done;){var W=V.value;W["contact_display"]=W["contact"].split(";")}}catch($e){H.e($e)}finally{H.f()}var G,Z=J(R);try{for(Z.s();!(G=Z.n()).done;){var Y=G.value;Y["info_id"]=t.info_id,Y=Object.assign(Y,{operator:"新增"}),t.info_id++}}catch($e){Z.e($e)}finally{Z.f()}t.origin_Data=JSON.parse(JSON.stringify(R)),t.tableData=JSON.parse(JSON.stringify(R))}var Q,X=new Set,tt=J(t.all_Data["product_data"]);try{for(tt.s();!(Q=tt.n()).done;){var et=Q.value;X.add(et["category_id"])}}catch($e){tt.e($e)}finally{tt.f()}var at,rt=J(X);try{for(rt.s();!(at=rt.n()).done;){var ot=at.value;t.tree_data.push({id:t.tree_node_count,label:ot,children:[]}),t.tree_node_count++}}catch($e){rt.e($e)}finally{rt.f()}var it,nt=J(t.all_Data["product_data"]);try{for(nt.s();!(it=nt.n()).done;)for(var lt=it.value,st=0;st<t.tree_data.length;st++)t.tree_data[st]["label"]==lt["category_id"]&&(t.tree_data[st]["children"].push({id:t.tree_node_count,label:lt["caption"],children:[],category:lt["category_id"]}),t.tree_node_count++)}catch($e){nt.e($e)}finally{nt.f()}for(var ct=0;ct<t.tree_data.length;ct++)for(var ut=0;ut<t.tree_data[ct]["children"].length;ut++){var pt,dt=J(t.all_Data["product_data"]);try{for(dt.s();!(pt=dt.n()).done;){var _t=pt.value;if(t.tree_data[ct]["children"][ut]["label"]==_t["caption"]){var ft,ht=J(t.all_Data["option_data"]);try{for(ht.s();!(ft=ht.n()).done;){var mt=ft.value;_t["product_name"]!=mt["product_name"]||mt["caption"].includes("Agent ID")||(t.tree_data[ct]["children"][ut]["children"].push({id:t.tree_node_count,label:mt["caption"],product_name:mt["product_name"],children:[],category:mt["product_name"]}),t.tree_node_count++)}}catch($e){ht.e($e)}finally{ht.f()}}}}catch($e){dt.e($e)}finally{dt.f()}}t.origin_tree_data=JSON.parse(JSON.stringify(t.tree_data));var gt,vt=J(X);try{for(vt.s();!(gt=vt.n()).done;){var yt=gt.value;t.caption_to_product.push({caption:yt,product:[]});var bt,xt=J(t.all_Data["product_data"]);try{for(xt.s();!(bt=xt.n()).done;){var wt=bt.value;wt["category_id"]==t.caption_to_product[t.caption_to_product.length-1]["caption"]&&t.caption_to_product[t.caption_to_product.length-1]["product"].push(wt["product_name"])}}catch($e){xt.e($e)}finally{xt.f()}}}catch($e){vt.e($e)}finally{vt.f()}var St,kt=J(t.all_Data["option_data"]);try{for(kt.s();!(St=kt.n()).done;){var Dt=St.value;t.optionSet.add(Dt["product_name"])}}catch($e){kt.e($e)}finally{kt.f()}var Ot,$t=J(t.optionSet);try{for($t.s();!(Ot=$t.n()).done;){var Nt=Ot.value;t.caption_to_product.push({caption:Nt,product:[]});var Ct,It=J(t.all_Data["option_data"]);try{for(It.s();!(Ct=It.n()).done;){var Jt=Ct.value;Jt["product_name"]==t.caption_to_product[t.caption_to_product.length-1]["caption"]&&t.caption_to_product[t.caption_to_product.length-1]["product"].push(Jt["option_name"])}}catch($e){It.e($e)}finally{It.f()}for(var Et=0;Et<t.caption_to_product.length-1;Et++)if(-1!=t.caption_to_product[Et]["product"].indexOf(t.caption_to_product[t.caption_to_product.length-1]["caption"])){t.caption_to_product[Et]["product"].splice(t.caption_to_product[Et]["product"].indexOf(t.caption_to_product[t.caption_to_product.length-1]["caption"]),1);var At,zt=J(t.caption_to_product[t.caption_to_product.length-1]["product"]);try{for(zt.s();!(At=zt.n()).done;){var jt=At.value;t.caption_to_product[Et]["product"].push(jt)}}catch($e){zt.e($e)}finally{zt.f()}}}}catch($e){$t.e($e)}finally{$t.f()}for(var Tt=0;Tt<t.caption_to_product.length;Tt++){var Mt,Kt=J(t.all_Data["product_data"]);try{for(Kt.s();!(Mt=Kt.n()).done;){var Bt=Mt.value;t.caption_to_product[Tt]["caption"]==Bt["product_name"]&&(t.caption_to_product[Tt]["caption"]=Bt["caption"])}}catch($e){Kt.e($e)}finally{Kt.f()}}var Pt,Lt=J(JSON.parse(JSON.stringify(t.tree_data)));try{for(Lt.s();!(Pt=Lt.n()).done;){var qt=Pt.value;if(0!=qt.children.length){t.tree_map.set(qt.label,qt);var Ft,Ut=J(qt.children);try{for(Ut.s();!(Ft=Ut.n()).done;){var Rt=Ft.value;0!=Rt.children.length&&t.tree_map.set(Rt.label,Rt)}}catch($e){Ut.e($e)}finally{Ut.f()}}}}catch($e){Lt.e($e)}finally{Lt.f()}var Vt,Ht=J(t.product_groups_data);try{for(Ht.s();!(Vt=Ht.n()).done;){var Wt,Gt=Vt.value,Zt=t.tree_data,Yt=J(JSON.parse(Gt.tag));try{for(Yt.s();!(Wt=Yt.n()).done;){var Qt=Wt.value;Zt=Zt[t.search_tree_index(Zt,Qt)]["children"]}}catch($e){Yt.e($e)}finally{Yt.f()}Zt.unshift({id:t.tree_node_count++,label:Gt["caption"],children:[]});var Xt,te=t.deter_group(t.caption_to_product,JSON.parse(Gt["product_list"])),ee=JSON.parse(Gt["product_list"]),ae=J(te);try{for(ae.s();!(Xt=ae.n()).done;){var re=Xt.value,oe=t.tree_node_adjust(t.tree_map.get(re),t.tree_node_count);Zt[0]["children"].push(oe[0]),t.tree_node_count=oe[1];var ie,ne=J(t.caption_to_product);try{for(ne.s();!(ie=ne.n()).done;){var le=ie.value;if(le["caption"]==re){var se,ce=J(le["product"]);try{for(ce.s();!(se=ce.n()).done;){var ue=se.value,pe=ee.indexOf(ue);-1!=pe&&ee.splice(pe,1)}}catch($e){ce.e($e)}finally{ce.f()}}}}catch($e){ne.e($e)}finally{ne.f()}}}catch($e){ae.e($e)}finally{ae.f()}var de,_e=J(ee);try{for(_e.s();!(de=_e.n()).done;){var fe,he=de.value,me=J(t.all_Data["option_data"]);try{for(me.s();!(fe=me.n()).done;){var ge=fe.value;ge["option_name"]==he&&Zt[0]["children"].push({id:t.tree_node_count,label:ge["caption"],product_name:ge["product_name"],children:[]})}}catch($e){me.e($e)}finally{me.f()}var ve,ye=J(t.all_Data["product_data"]);try{for(ye.s();!(ve=ye.n()).done;){var be=ve.value;be["product_name"]==he&&Zt[0]["children"].push({id:t.tree_node_count,label:be["caption"],children:[]})}}catch($e){ye.e($e)}finally{ye.f()}t.tree_node_count++}}catch($e){_e.e($e)}finally{_e.f()}}}catch($e){Ht.e($e)}finally{Ht.f()}t.productgroup_tree=JSON.parse(JSON.stringify(t.tree_data)),t.isLoading=!1,0==t.tableData.length&&t.GoAdd();var xe,we=J(t.tableData);try{for(we.s();!(xe=we.n()).done;){xe.value;t.deter_require.push({customer:!1,sn:!1,product:!1,count:!1,expiration:!1,user:!1,contact:!1})}}catch($e){we.e($e)}finally{we.f()}function Se(t){if(0!=t["children"].length){t["disabled"]=!0;var e,a=J(t["children"]);try{for(a.s();!(e=a.n()).done;){var r=e.value;Se(r)}}catch($e){a.e($e)}finally{a.f()}}}t.single_choice_tree=JSON.parse(JSON.stringify(t.tree_data));var ke,De=J(t.single_choice_tree);try{for(De.s();!(ke=De.n()).done;){var Oe=ke.value;Se(Oe)}}catch($e){De.e($e)}finally{De.f()}}))}))},watch:{input:{handler:function(t,e){""!=this.input.factory?this.sub_row.customer=this.input.name+"|"+this.input.factory:this.sub_row.customer=this.input.name},deep:!0},"sub_row.sn":{handler:function(t,e){var a,r=J(this.all_Data["sn_data"]);try{for(r.s();!(a=r.n()).done;){var o=a.value;this.sub_row["sn"]==o["sn"]&&(this.sub_row["user"]=o["user"])}}catch(i){r.e(i)}finally{r.f()}},deep:!0}},methods:{funcuid_click:function(t){var e=this,a=this.$refs["funcuid_tree-".concat(t)].getCheckedNodes();if(2==a.length){if(1==a[0].children.length){var r=a[1];void 0!=r["product_name"]?this.$confirm("將更改為產品:〈".concat(r["product_name"],"〉模組:〈").concat(r["label"],"〉"),"提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).then((function(){e.deter_require[t]["func_uid"]=!1,e.tableData[t].product=r["product_name"],e.tableData[t].module=r["label"];var a="";if(""==e.tableData[t].module){var o,i=J(e.product_map);try{for(i.s();!(o=i.n()).done;){var n=o.value;n[1]["caption"]==e.tableData[t].product&&(a=n[0])}}catch(u){i.e(u)}finally{i.f()}}else{var l,s=J(e.option_map);try{for(s.s();!(l=s.n()).done;){var c=l.value;c[1]["product_name"]==e.tableData[t].product&&c[1]["caption"]==e.tableData[t].module&&(a=c[0])}}catch(u){s.e(u)}finally{s.f()}}e.tableData[t].func_uid=a,e.tableData[t].category=e.product_map.get(a)["category_id"],e.$refs["funcuid_popover-".concat(t)].doClose(),e.$refs["funcuid_tree-".concat(t)].setCheckedKeys([])})).catch((function(){return e.$refs["funcuid_tree-".concat(t)].setCheckedKeys([]),!1})):this.$confirm("將更改為產品:〈".concat(r["label"],"〉"),"提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).then((function(){e.tableData[t].product=r["label"],e.tableData[t].module="";var a="";if(""==e.tableData[t].module){var o,i=J(e.product_map);try{for(i.s();!(o=i.n()).done;){var n=o.value;n[1]["caption"]==e.tableData[t].product&&(a=n[0])}}catch(u){i.e(u)}finally{i.f()}}else{var l,s=J(e.option_map);try{for(s.s();!(l=s.n()).done;){var c=l.value;c[1]["product_name"]==e.tableData[t].product&&c[1]["caption"]==e.tableData[t].module&&(a=c[0])}}catch(u){s.e(u)}finally{s.f()}}e.tableData[t].func_uid=a,e.tableData[t].category=e.product_map.get(a)["category_id"],e.$refs["funcuid_popover-".concat(t)].doClose(),e.$refs["funcuid_tree-".concat(t)].setCheckedKeys([]),e.deter_require[t]["func_uid"]=!1})).catch((function(){return e.$refs["funcuid_tree-".concat(t)].setCheckedKeys([]),!1}))}}else{if(1!=a.length)return void this.$refs["funcuid_tree-".concat(t)].setCheckedKeys([]);var o=a[0];void 0!=o["product_name"]?this.$confirm("將更改為產品:〈".concat(o["product_name"],"〉模組:〈").concat(o["label"],"〉"),"提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).then((function(){e.deter_require[t]["func_uid"]=!1,e.tableData[t].product=o["product_name"],e.tableData[t].module=o["label"];var a="";if(""==e.tableData[t].module){var r,i=J(e.product_map);try{for(i.s();!(r=i.n()).done;){var n=r.value;n[1]["caption"]==e.tableData[t].product&&(a=n[0])}}catch(u){i.e(u)}finally{i.f()}}else{var l,s=J(e.option_map);try{for(s.s();!(l=s.n()).done;){var c=l.value;c[1]["product_name"]==e.tableData[t].product&&c[1]["caption"]==e.tableData[t].module&&(a=c[0])}}catch(u){s.e(u)}finally{s.f()}}e.tableData[t].func_uid=a,e.tableData[t].category=e.product_map.get(a)["category_id"],e.$refs["funcuid_popover-".concat(t)].doClose(),e.$refs["funcuid_tree-".concat(t)].setCheckedKeys([])})).catch((function(){return e.$refs["funcuid_tree-".concat(t)].setCheckedKeys([]),!1})):this.$confirm("將更改為產品:〈".concat(o["label"],"〉"),"提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).then((function(){e.tableData[t].product=o["label"],e.tableData[t].module="";var a="";if(""==e.tableData[t].module){var r,i=J(e.product_map);try{for(i.s();!(r=i.n()).done;){var n=r.value;n[1]["caption"]==e.tableData[t].product&&(a=n[0])}}catch(u){i.e(u)}finally{i.f()}}else{var l,s=J(e.option_map);try{for(s.s();!(l=s.n()).done;){var c=l.value;c[1]["product_name"]==e.tableData[t].product&&c[1]["caption"]==e.tableData[t].module&&(a=c[0])}}catch(u){s.e(u)}finally{s.f()}}e.tableData[t].func_uid=a,e.tableData[t].category=e.product_map.get(a)["category_id"],e.$refs["funcuid_popover-".concat(t)].doClose(),e.$refs["funcuid_tree-".concat(t)].setCheckedKeys([]),e.deter_require[t]["func_uid"]=!1})).catch((function(){e.$refs["funcuid_tree-".concat(t)].setCheckedKeys([])}))}},restore:function(t,e){for(var a=0,r=Object.keys(this.origin_Data[t]);a<r.length;a++){var o=r[a];this.tableData[t][o]=this.origin_Data[t][o]}},handleSelectionChange:function(t){this.checked_Data=JSON.parse(JSON.stringify(t))},Logout:function(){sessionStorage.clear(),this.$router.push("/login")},GoDelete:function(){if(0!=this.checked_Data.length&&void 0!=this.checked_Data[0]){var t,e=J(this.checked_Data);try{for(e.s();!(t=e.n()).done;){var a=t.value;for(var r in this.tableData)JSON.stringify(a)==JSON.stringify(this.tableData[r])&&(this.tableData.splice(r,1),this.origin_Data.splice(r,1),this.deter_require.splice(r,1))}}catch(o){e.e(o)}finally{e.f()}}else this.$message({message:"請選取欲刪除的資料",type:"warning"})},GoAdd:function(){0==this.checked_Data.length&&(this.input.name="",this.input.factory="",this.sub_row["region"]=this.user_region,this.sub_row["sn"]="",this.sub_row["sn_multi"]=[],this.sub_row["func_uid"]="",this.sub_row["count"]=1,this.sub_row["version"]="",this.sub_row["user"]=this.user[2],this.sub_row["contact"]=this.user[2],this.sub_row["comment"]="",this.sub_row["type"]="測試",this.subrow_type_change(),this.multi_contact_form.search_contact=[this.user[2]]),this.add_dialog=!0},close_add_dialog:function(){this.add_dialog=!1,this.sub_row={category:"",comment:"",contact:"",count:null,customer:"",expiration:"",func_uid:[],index:null,info:[],info_id:null,issued:"",sn_multi:[],operator:"",region:"",registration:"",sn:null,type:"",user:"",version:"",contact_display:[""],user_display:[""]},this.input.name="",this.input.factory=""},subrow_contact_selection_change:function(t){this.sub_row.contact=t.join(";")},contact_selection_change:function(t,e){this.tableData[e].contact=t.join(";")},contact_change:function(t,e){this.tableData[e].contact_display=t.split(";")},contact_enter:function(t){this.tableData[t]["contact_display"].push(this.contact_input),this.tableData[t]["contact"]=this.tableData[t]["contact_display"].join(";")},subrow_contact_enter:function(){this.multi_contact_form.search_contact.push(this.contact_input),this.sub_row.contact=this.multi_contact_form.search_contact.join(";")},contact_fliterer:function(t){this.contact_input=t,this.contact_fliter=t?this.contact_opt.filter((function(e){if(String(e["label"]).split("@")[0].includes(t))return!0})):this.contact_opt},sn_fliterer:function(t){this.sn_input=t,this.sn_fliter=t?this.sn_opt.filter((function(e){if(String(e["label"]).includes(t))return!0})):this.sn_opt},subrow_sn_enter:function(){this.sub_row.sn_multi.push(this.sn_input)},add_multi_KeyID:function(){if(""==this.multi_KeyID_form.range_begin||""!=this.multi_KeyID_form.range_end)if(""!=this.multi_KeyID_form.range_begin||""==this.multi_KeyID_form.range_end)for(var t=this.multi_KeyID_form.range_begin;t<=this.multi_KeyID_form.range_end;t++)this.sub_row.sn_multi.push(t);else this.$message({message:"請輸入區間開始值",type:"warning"});else this.$message({message:"請輸入區間結束值",type:"warning"})},add_multi_contact:function(){this.sub_row["contact"]=this.multi_contact_form.data,this.$refs["contact_pop"].doClose()},type_change:function(t){var e=new Date;if("正式"==this.tableData[t].type&&(e.setMonth(e.getMonth()+12),this.tableData[t].expiration=e.toISOString().slice(0,4)+"-01-31"),"測試"==this.tableData[t].type){var a=e.getMonth()+1;12==a?(e.setMonth(e.getMonth()+12),this.tableData[t].expiration=e.toISOString().slice(0,4)+"-03-31"):this.tableData[t].expiration=1==a||2==a?e.toISOString().slice(0,4)+"-03-31":3==a||4==a||5==a?e.toISOString().slice(0,4)+"-06-30":6==a||7==a||8==a?e.toISOString().slice(0,4)+"-09-30":9==a||10==a||11==a?e.toISOString().slice(0,4)+"-12-31":""}"出貨"==this.tableData[t].type&&(this.tableData[t].expiration=e.toISOString().slice(0,4)+"-12-31"),"永久"==this.tableData[t].type&&(this.tableData[t].expiration="2100-12-31")},subrow_type_change:function(){var t=new Date;switch(this.sub_row.type){case"正式":t.setMonth(t.getMonth()+12),this.sub_row.expiration=t.toISOString().slice(0,4)+"-01-31";break;case"測試":var e=t.getMonth()+1;12==e?(t.setMonth(t.getMonth()+12),this.sub_row.expiration=t.toISOString().slice(0,4)+"-03-31"):this.sub_row.expiration=1==e||2==e?t.toISOString().slice(0,4)+"-03-31":3==e||4==e||5==e?t.toISOString().slice(0,4)+"-06-30":6==e||7==e||8==e?t.toISOString().slice(0,4)+"-09-30":9==e||10==e||11==e?t.toISOString().slice(0,4)+"-12-31":"";break;case"出貨":this.sub_row.expiration=t.toISOString().slice(0,4)+"-12-31";break;case"永久":this.sub_row.expiration="2100-12-31";break}},deter_group:function(t,e){var a,r=[],o=JSON.parse(JSON.stringify(e)),i=J(t);try{for(i.s();!(a=i.n()).done;){var n,l=a.value,s=0,c=J(l["product"]);try{for(c.s();!(n=c.n()).done;){var u=n.value;if(-1===o.indexOf(u)){s=1;break}}}catch(f){c.e(f)}finally{c.f()}if(0==s){r.push(l["caption"]);var p,d=J(l["product"]);try{for(d.s();!(p=d.n()).done;){var _=p.value;o.splice(o.indexOf(_),1)}}catch(f){d.e(f)}finally{d.f()}}}}catch(f){i.e(f)}finally{i.f()}return r},store_product_group:function(){var t=this;if(""!=this.product_dialog.caption&&0!=this.product_dialog.product_list.length){var e,a=[],r=J(this.product_dialog.product_list_detail);try{for(r.s();!(e=r.n()).done;){var o=e.value,i=0,n=o["label"].split("").reverse().join("").split("(");this.optionSet.has(n[0].replace(")",""))&&(o["label"]=o["label"].replace("("+n[0].replace(")","")+")",""));var l,s=J(this.all_Data["option_data"]);try{for(s.s();!(l=s.n()).done;){var c=l.value;if(o["label"]==c["caption"]&&o["category"]==c["product_name"]){a.push(c["option_name"]),i=1;break}}}catch(g){s.e(g)}finally{s.f()}if(0==i){var u,p=J(this.all_Data["product_data"]);try{for(p.s();!(u=p.n()).done;){var d=u.value;if(o["label"]==d["caption"]){a.push(d["product_name"]);break}}}catch(g){p.e(g)}finally{p.f()}}}}catch(g){r.e(g)}finally{r.f()}var _,f=J(this.product_groups_data);try{for(f.s();!(_=f.n()).done;){var h=_.value;if(h["caption"]==this.product_dialog.caption)return void this.$message.error("產品名稱重複，請更改");if(h.product_list==JSON.stringify(a))return void this.$message.error("群組內產品與其他群組完全重複")}}catch(g){f.e(g)}finally{f.f()}if(1==this.append_tree_lock){this.product_dialog.product_list=JSON.parse(JSON.stringify(a));var m=[];a=this.register_append_node[0];while(void 0!=a.label)m.unshift(a.label),a=a.parent;this.axios.post("/save_to_product_group",{caption:this.product_dialog.caption,product_list:JSON.stringify(this.product_dialog.product_list),tag:JSON.stringify(m),description:this.product_dialog.description,remarks:this.product_dialog.remarks}).then((function(e){t.axios.get("/get_product_groups_info_data",{}).then((function(e){t.product_groups_data=JSON.parse(JSON.stringify(e.data))["product_groups"],t.dialogVisible=!1,t.tree_data=JSON.parse(JSON.stringify(t.origin_tree_data));var a,r=J(t.product_groups_data);try{for(r.s();!(a=r.n()).done;){var o,i=a.value,n=t.tree_data,l=J(JSON.parse(i.tag));try{for(l.s();!(o=l.n()).done;){var s=o.value;n=n[t.search_tree_index(n,s)]["children"]}}catch(g){l.e(g)}finally{l.f()}n.unshift({id:t.tree_node_count++,label:i["caption"],children:[]});var c,u=t.deter_group(t.caption_to_product,JSON.parse(i["product_list"])),p=JSON.parse(i["product_list"]),d=J(u);try{for(d.s();!(c=d.n()).done;){var _=c.value,f=t.tree_node_adjust(t.tree_map.get(_),t.tree_node_count);n[0]["children"].push(f[0]),t.tree_node_count=f[1];var h,m=J(t.caption_to_product);try{for(m.s();!(h=m.n()).done;){var v=h.value;if(v["caption"]==_){var y,b=J(v["product"]);try{for(b.s();!(y=b.n()).done;){var x=y.value,w=p.indexOf(x);-1!=w&&p.splice(w,1)}}catch(g){b.e(g)}finally{b.f()}}}}catch(g){m.e(g)}finally{m.f()}}}catch(g){d.e(g)}finally{d.f()}var S,k=J(p);try{for(k.s();!(S=k.n()).done;){var D,O=S.value,$=J(t.all_Data["option_data"]);try{for($.s();!(D=$.n()).done;){var N=D.value;N["option_name"]==O&&n[0]["children"].push({id:t.tree_node_count,product_name:N["product_name"],label:N["caption"],children:[]})}}catch(g){$.e(g)}finally{$.f()}var C,I=J(t.all_Data["product_data"]);try{for(I.s();!(C=I.n()).done;){var E=C.value;E["product_name"]==O&&n[0]["children"].push({id:t.tree_node_count,label:E["caption"],children:[]})}}catch(g){I.e(g)}finally{I.f()}t.tree_node_count++}}catch(g){k.e(g)}finally{k.f()}}}catch(g){r.e(g)}finally{r.f()}t.productgroup_tree=JSON.parse(JSON.stringify(t.tree_data)),t.product_dialog.caption="",t.product_dialog.product_list=[],t.product_dialog.description="",t.product_dialog.remarks="",t.product_dialog.product_list_detail=[]}))}))}else this.$message.error("請選擇群組所在位置")}else this.$message.error("請將「產品群組」新增單，填寫完整")},choose_func_uid:function(){this.drawer=!0,this.product_group=[]},cancel_drawer:function(){var t=this;this.$nextTick((function(){t.$refs.tree.setCheckedKeys([])})),this.drawer=!1},check_drawer:function(){var t=this;this.sub_row.func_uid=[];var e,a=new Set,r=J(this.$refs.tree.getCheckedNodes());try{for(r.s();!(e=r.n()).done;){var o=e.value;0!=o["children"].length&&void 0!=o["children"]||(void 0!=o["product_name"]?a.add(o["label"]+"("+o["product_name"]+")"):a.add(o["label"]))}}catch(s){r.e(s)}finally{r.f()}var i,n=J(a);try{for(n.s();!(i=n.n()).done;){var l=i.value;this.sub_row.func_uid.push(l)}}catch(s){n.e(s)}finally{n.f()}this.$nextTick((function(){t.$refs.tree.setCheckedKeys([])})),this.drawer=!1},tree_node_adjust:function(t,e){var a=JSON.parse(JSON.stringify(t));a.id=e++;var r,o=J(a.children);try{for(o.s();!(r=o.n()).done;){var i=r.value;i.id=e++;var n,l=J(i.children);try{for(l.s();!(n=l.n()).done;){var s=n.value;s.id=e++}}catch(c){l.e(c)}finally{l.f()}}}catch(c){o.e(c)}finally{o.f()}return[a,e]},cancel_product_group:function(){var t=this;this.product_dialog.caption="",this.product_dialog.product_list=[],this.product_dialog.description="",this.product_dialog.remarks="",this.$nextTick((function(){t.$refs.product_group_tree.setCheckedKeys([])})),this.dialogVisible=!1},remove:function(t,e){this.append_tree_lock=!1;var a=t.parent,r=a.data.children||a.data,o=r.findIndex((function(t){return t.id===e.id}));r.splice(o,1),this.productgroup_tree=JSON.parse(JSON.stringify(this.tree_data)),this.register_append_node=[]},append:function(t,e){if(""!=this.product_dialog.caption){this.append_tree_lock=!0;var a={label:this.product_dialog.caption,children:[],disabled:!0,add:!0};e.children||this.$set(e,"children",[]),e.children.push(a),this.register_append_node=[t]}else this.$message.error("請填寫「群組名稱」，再選擇插入位置")},tag_for_tree:function(t,e){var a,r=e.node,o=(e.data,e.store,J(this.product_groups_data));try{for(o.s();!(a=o.n()).done;){var i=a.value;if(r.label==i["caption"])return t("div",[" ",t("span",[r.label])," ",t("el-tag",{style:"position:absolute;right:1px;font-size:14px;height:25px;",attrs:{type:"success"}},["G"])]);if(r.parent.label==i["caption"]&&0==r.data.children.length&&void 0!=r.data.product_name)return t("div",[" ",t("span",[r.label])," ",t("el-tag",{style:"position:absolute;right:1px;font-size:14px;height:25px;",attrs:{type:"info"}},[r.data.product_name])])}}catch(n){o.e(n)}finally{o.f()}return t("div",[" ",t("span",[r.label])])},deter_product_group:function(t){var e,a=J(this.product_groups_data);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(t.label==r["caption"])return"group"}}catch(l){a.e(l)}finally{a.f()}var o,i=J(this.product_groups_data);try{for(i.s();!(o=i.n()).done;){var n=o.value;if(t.parent.label==n["caption"])return"under_group"}}catch(l){i.e(l)}finally{i.f()}return!1},choose_product_group:function(t,e){var a,r=[],o=[],i=J(this.$refs.product_group_tree.getCheckedNodes());try{for(i.s();!(a=i.n()).done;){var n=a.value;0==n["children"].length&&(void 0!=n["product_name"]?(r.push(n["label"]+"("+n["product_name"]+")"),o.push({label:n["label"],category:n["category"]})):(r.push(n["label"]),o.push({label:n["label"],category:n["category"]})))}}catch(l){i.e(l)}finally{i.f()}this.product_dialog.product_list=r,this.product_dialog.product_list_detail=o},handleCheckChange:function(t,e){this.tree_checked=[];var a,r=J(this.$refs.tree.getCheckedNodes());try{for(r.s();!(a=r.n()).done;){var o=a.value;0!=o["children"].length&&void 0!=o["children"]||this.tree_checked.push(o)}}catch(i){r.e(i)}finally{r.f()}},search_tree_index:function(t,e){for(var a=0;a<t.length;a++)if(t[a]["label"]==e)return a;return-1},test_edit_add:function(t,e){var a=!0;""==t["customer"]&&(this.deter_require[e]["customer"]=!0,a=!1),null!=t["sn"]&&""!=t["sn"]||(this.deter_require[e]["sn"]=!0,a=!1),""==t["contact"]&&(this.deter_require[e]["contact"]=!0,a=!1),""==t["user"]&&(this.deter_require[e]["user"]=!0,a=!1);var r=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/;return-1==t["user"].search(r)?(this.$message({message:"請填寫有效信箱，且僅限一位負責人",type:"warning"}),this.deter_require[e]["user"]=!0,!1):(null!=t["count"]&&""!=t["count"]||(this.deter_require[e]["count"]=!0,a=!1),null!=t["expiration"]&&""!=t["expiration"]||(this.deter_require[e]["expiration"]=!0,a=!1),a)},subrow_test_edit_add:function(){if(null==this.input.name||""==this.input.name)return this.$message({message:"客戶不可為空",type:"warning"}),!1;if(null==this.sub_row["user"]||""==this.sub_row["user"])return this.$message({message:"負責人不可為空",type:"warning"}),!1;var t=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/;if(-1==this.sub_row["user"].search(t))return this.$message({message:"請填寫有效信箱，且僅限一位負責人",type:"warning"}),!1;if(0==this.sub_row["contact_display"].length)return this.$message({message:"聯絡人不可為空",type:"warning"}),!1;if(0==this.sub_row["contact"].length)return this.$message({message:"聯絡人不可為空",type:"warning"}),!1;var e,a=J(this.sub_row.sn_multi);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(null==r||""==r)return this.$message({message:"KeyID不可為空",type:"warning"}),!1;if(!/^[\d;]+$/.test(r))return this.$message({message:"KeyID只可包含數字",type:"warning"}),!1}}catch(o){a.e(o)}finally{a.f()}return null==this.sub_row["func_uid"]||""==this.sub_row["func_uid"]?(this.$message({message:"產品名稱不可為空",type:"warning"}),!1):null==this.sub_row["count"]||""==this.sub_row["count"]?(this.$message({message:"數量不可為空",type:"warning"}),!1):null==this.sub_row["expiration"]||""==this.sub_row["expiration"]?(this.$message({message:"到期日期不可為空",type:"warning"}),!1):null==this.sub_row["type"]||""==this.sub_row["type"]?(this.$message({message:"類型不可為空",type:"warning"}),!1):null!=this.sub_row["region"]&&""!=this.sub_row["region"]||(this.$message({message:"地區不可為空",type:"warning"}),!1)},submit:function(){var t=Object(b["a"])(regeneratorRuntime.mark((function t(){var e,a,r,o,i,n,l,s,c,u,p,d,_,f,h,m,g,v,y,b,x,w,S,k,D,O,$,N,C,I,E,A,z,j,T,M,K,B,P,L,q,F,U,R,V,H,W,G,Z,Y,Q,X,tt,et,at,rt,ot,it,nt,lt,st,ct,ut,pt,dt,_t,ft,ht,mt,gt=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.fight_data=[],e=0,a=!0,r=J(this.deter_require);try{for(i=function(){var t=o.value;Object.keys(t).forEach((function(e){t[e]=!1}))},r.s();!(o=r.n()).done;)i()}catch(vt){r.e(vt)}finally{r.f()}this.warning=!1,this.warning_message="",n=J(this.tableData);try{for(n.s();!(l=n.n()).done;)s=l.value,c=!0,c=this.test_edit_add(s,e),0==c&&(a=!1),e+=1}catch(vt){n.e(vt)}finally{n.f()}if(a){t.next=13;break}return this.warning=!0,this.warning_message="請確認資料完整性",t.abrupt("return",!1);case 13:u={},p=[],d=J(this.tableData);try{for(d.s();!(_=d.n()).done;)f=_.value,f["sn"]in u?u[f["sn"]].includes(f["customer"])||u[f["sn"]].push(f["customer"]):u[f["sn"]]=[f["customer"]]}catch(vt){d.e(vt)}finally{d.f()}for(h in u)u[h].length>=2&&p.push(h);if(!p.length){t.next=27;break}return t.next=21,this.$confirm("相同KeyID僅能對應至一組客戶","提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).catch((function(){}));case 21:m=0,g=J(this.tableData);try{for(g.s();!(v=g.n()).done;)y=v.value,p.includes(String(y["sn"]))&&(this.deter_require[m]["customer"]=!0),m+=1}catch(vt){g.e(vt)}finally{g.f()}return this.warning=!0,this.warning_message="相同KeyID僅能對應至一組客戶",t.abrupt("return",!1);case 27:b={},p=[],x=J(this.tableData);try{for(x.s();!(w=x.n()).done;)S=w.value,S["sn"]in b?b[S["sn"]].includes(S["user"])||b[S["sn"]].push(S["user"]):b[S["sn"]]=[S["user"]]}catch(vt){x.e(vt)}finally{x.f()}for(k in b)b[k].length>=2&&p.push(k);if(!p.length){t.next=41;break}return t.next=35,this.$confirm("相同KeyID僅能對應至相同負責人","提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).catch((function(){}));case 35:D=0,O=J(this.tableData);try{for(O.s();!($=O.n()).done;)N=$.value,p.includes(String(N["sn"]))&&(this.deter_require[D]["user"]=!0),D+=1}catch(vt){O.e(vt)}finally{O.f()}return this.warning=!0,this.warning_message="相同KeyID僅能對應至相同負責人",t.abrupt("return",!1);case 41:C=new Map,I=J(this.all_Data["customer_data"]);try{for(I.s();!(E=I.n()).done;)A=E.value,""!=A["site"]?C.set(A["customer_id"],A["name"]+"|"+A["site"]):C.set(A["customer_id"],A["name"])}catch(vt){I.e(vt)}finally{I.f()}z={},j=[],T={},M=[],e=0,K=J(this.tableData);try{for(K.s();!(B=K.n()).done;){P=B.value,L=J(this.all_Data["sn_data"]);try{for(L.s();!(q=L.n()).done;)F=q.value,P["sn"]==F["sn"]&&P["customer"]!=C.get(F["sn_id"])&&(z[P["sn"]]={old_customer:C.get(F["sn_id"]),new_customer:P["customer"]},j.push(e)),P["sn"]==F["sn"]&&P["customer"]==C.get(F["sn_id"])&&P["user"]!=F["user"]&&(T[P["sn"]]={old_user:F["user"],new_user:P["user"]},M.push(e))}catch(vt){L.e(vt)}finally{L.f()}e+=1}}catch(vt){K.e(vt)}finally{K.f()}if(!Object.keys(z).length){t.next=57;break}for(R in U='<table style="border-collapse:collapse"  width="500px" border="1">                                        <tr>                                            <th width="100px">KeyID</th>                                            <th width="200px">原客戶</th>                                            <th width="200px">新客戶</th>                                        </tr>',z)U+="<tr><td>".concat(R,"</td><td>").concat(z[R]["old_customer"],"</td><td>").concat(z[R]["new_customer"],"</td> </tr>");return U+="</table>",t.next=57,this.$confirm(U,"客戶變更，是否刪除原有連結後新增?",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0,dangerouslyUseHTMLString:!0,customClass:"product-conflict"}).then((function(){for(var t in z){var e,a=J(gt.info_data);try{for(a.s();!(e=a.n()).done;){var r=e.value;t==r["sn"]&&(delete r["info"],gt.fight_data.push(r))}}catch(vt){a.e(vt)}finally{a.f()}}})).catch((function(){var t,e=J(j);try{for(e.s();!(t=e.n()).done;){var r=t.value;gt.deter_require[r]["customer"]=!0}}catch(vt){e.e(vt)}finally{e.f()}gt.$set(gt.deter_require,gt.deter_require),a=!1}));case 57:if(a){t.next=61;break}return this.warning=!0,this.warning_message="請檢查客戶衝突",t.abrupt("return",!1);case 61:V=[],e=0,H=J(this.tableData);try{for(H.s();!(W=H.n()).done;){G=W.value,Z=J(this.all_Data["info_data"]);try{for(Z.s();!(Y=Z.n()).done;)Q=Y.value,G["type"]==this.module_map.get(Q["type"])&&G["sn"]==Q["sn"]&&G["func_uid"]==Q["func_uid"]&&G["version"]==Q["version"]&&V.push({customer:G["customer"],sn:G["sn"],func_uid:G["func_uid"],product:G["product"],module:G["module"],table_index:e})}catch(vt){Z.e(vt)}finally{Z.f()}e+=1}}catch(vt){H.e(vt)}finally{H.f()}if(!V.length){t.next=72;break}X='<table style="border-collapse:collapse"  width="500px" border="1">                                        <tr>                                            <th width="100px">客戶</th>                                            <th width="100px">KeyID</th>                                            <th width="200px">產品</th>                                            <th width="200px">模組</th>                                        </tr>',tt=J(V);try{for(tt.s();!(et=tt.n()).done;)at=et.value,X+="<tr><td>".concat(at["customer"],"</td><td>").concat(at["sn"],"</td><td>").concat(at["product"],"</td><td>").concat(at["module"],"</td> </tr>")}catch(vt){tt.e(vt)}finally{tt.f()}return X+="</table>",t.next=72,this.$confirm(X,"以下產品發生衝突，是否刪除原有資料後新增?",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0,dangerouslyUseHTMLString:!0,customClass:"product-conflict"}).then((function(){var t,e=J(V);try{for(e.s();!(t=e.n()).done;){var a,r=t.value,o=J(gt.info_data);try{for(o.s();!(a=o.n()).done;){var i=a.value;if(r["sn"]==i["sn"]&&r["func_uid"]==i["func_uid"]){delete i["info"],gt.fight_data.push(i);break}}}catch(vt){o.e(vt)}finally{o.f()}}}catch(vt){e.e(vt)}finally{e.f()}})).catch((function(){var t,e=J(V);try{for(e.s();!(t=e.n()).done;){var r=t.value,o=r["table_index"];gt.deter_require[o]["func_uid"]=!0,gt.$set(gt.deter_require,gt.deter_require)}}catch(vt){e.e(vt)}finally{e.f()}a=!1}));case 72:if(a){t.next=76;break}return this.warning=!0,this.warning_message="請檢查產品衝突",t.abrupt("return",!0);case 76:if(!Object.keys(T).length){t.next=82;break}for(ot in rt='<table style="border-collapse:collapse"  width="500px" border="1">                                        <tr>                                            <th width="100px">KeyID</th>                                            <th width="200px">原負責人</th>                                            <th width="200px">新負責人</th>                                        </tr>',T)rt+="<tr><td>".concat(ot,"</td><td>").concat(T[ot]["old_user"],"</td><td>").concat(T[ot]["new_user"],"</td> </tr>");return rt+="</table>",t.next=82,this.$confirm(rt,"負責人變更，是否繼續?",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0,dangerouslyUseHTMLString:!0,customClass:"product-conflict"}).then((function(){})).catch((function(){var t,e=J(M);try{for(e.s();!(t=e.n()).done;){var r=t.value;gt.deter_require[r]["user"]=!0}}catch(vt){e.e(vt)}finally{e.f()}a=!1}));case 82:if(a){t.next=86;break}return this.warning=!0,this.warning_message="請檢查負責人",t.abrupt("return",!0);case 86:if(0==this.fight_data.length){t.next=131;break}it=J(this.fight_data),t.prev=88,it.s();case 90:if((nt=it.n()).done){t.next=120;break}lt=nt.value,st="",ct="",ut="",void 0!=this.option_map.get(lt["func_uid"])?(st=this.option_map.get(lt["func_uid"])["caption"],ut=this.option_map.get(lt["func_uid"])["product_name"],ct=this.product_map.get(ut)["caption"]):void 0!=this.product_map.get(lt["func_uid"])?(st="",ct=this.product_map.get(lt["func_uid"])["caption"]):(ct=lt["func_uid"],st=""),void 0!=this.module_map.get(lt["type"])&&(lt["type"]=this.module_map.get(lt["type"])),lt=Object.assign(lt,{operator:"刪除",product:ct,module:st,region:"",user:this.sn_dict[lt["sn"]]["user"],customer:""}),pt=J(this.all_Data["region_data"]);try{for(pt.s();!(dt=pt.n()).done;)_t=dt.value,_t["region_id"]==this.sn_dict[lt["sn"]]["region"]&&(lt["region"]=_t["name"])}catch(vt){pt.e(vt)}finally{pt.f()}ft=J(this.all_Data["customer_data"]),t.prev=101,ft.s();case 103:if((ht=ft.n()).done){t.next=110;break}if(mt=ht.value,mt["customer_id"]!=this.sn_dict[lt["sn"]]["sn_id"]){t.next=108;break}return""==mt["site"]?lt["customer"]=mt["name"]:lt["customer"]=mt["name"]+" "+mt["site"],t.abrupt("break",110);case 108:t.next=103;break;case 110:t.next=115;break;case 112:t.prev=112,t.t0=t["catch"](101),ft.e(t.t0);case 115:return t.prev=115,ft.f(),t.finish(115);case 118:t.next=90;break;case 120:t.next=125;break;case 122:t.prev=122,t.t1=t["catch"](88),it.e(t.t1);case 125:return t.prev=125,it.f(),t.finish(125);case 128:this.axios.post("/save_to_handle",{checked_Data:this.fight_data,content:"資料庫衝突",user:this.user}).then((function(t){gt.axios.post("/save_to_handle",{checked_Data:gt.tableData,content:"none",user:gt.user}).then((function(){gt.$confirm("","下一步",{confirmButtonText:"送出申請",cancelButtonText:"返回主頁面",type:"warning",center:!0}).then((function(){gt.$router.push({name:"handle"})})).catch((function(){gt.$router.push({name:"Show_All"})}))}))})),t.next=132;break;case 131:this.axios.post("/save_to_handle",{checked_Data:this.tableData,content:"none",user:this.user}).then((function(){gt.$confirm("","下一步",{confirmButtonText:"送出申請",cancelButtonText:"返回主頁面",type:"warning",center:!0}).then((function(){gt.$router.push({name:"handle"})})).catch((function(){gt.$router.push({name:"Show_All"})}))}));case 132:case"end":return t.stop()}}),t,this,[[88,122,125,128],[101,112,115,118]])})));function e(){return t.apply(this,arguments)}return e}(),subrow_add:function(){if(this.sub_row["contact_display"].length>1)for(var t=0;t<this.sub_row["contact_display"].length;t++)""==this.sub_row["contact_display"][t]&&(this.sub_row["contact_display"].splice(t,1),t--);if(this.subrow_test_edit_add()){var e=new Date,a=e.toISOString().slice(0,10);this.sub_row.sn=String(this.sub_row.sn);var r,o=J(this.sub_row.sn_multi);try{for(o.s();!(r=o.n()).done;){var i,n=r.value,l=J(this.sub_row.func_uid);try{for(l.s();!(i=l.n()).done;){var s=i.value,c="",u="",p="",d="",_="";if(s.includes(")(")?(d=s.split(")(")[1].split(")")[0],u=s.split(")(")[0]+")",_=this.product_map.get(d)["category_id"],c=this.product_map.get(d)["caption"]):s.includes("(")?(d=s.split("(")[1].split(")")[0],u=s.split("(")[0],_=this.product_map.get(d)["category_id"],c=this.product_map.get(d)["caption"]):(c=s,u=""),""==u){var f,h=J(this.product_map);try{for(h.s();!(f=h.n()).done;){var m=f.value;m[1]["caption"]==c&&(p=m[0],_=m[1]["category_id"])}}catch(b){h.e(b)}finally{h.f()}}else{var g,v=J(this.option_map);try{for(v.s();!(g=v.n()).done;){var y=g.value;y[1]["product_name"]==d&&y[1]["caption"]==u&&(p=y[0])}}catch(b){v.e(b)}finally{v.f()}}this.tableData.push({info_id:this.info_id,category:_,comment:this.sub_row.comment,contact:this.sub_row.contact,count:this.sub_row.count,customer:this.sub_row.customer,expiration:this.sub_row.expiration,func_uid:p,info:this.sub_row.info,issued:a,region:this.sub_row.region,registration:this.sub_row.registration,sn:n,type:this.sub_row.type,product:c,module:u,user:this.sub_row.user,version:this.sub_row.version,operator:"新增",index:this.tableData.length,contact_display:this.sub_row.contact.split(";")}),this.origin_Data.push({info_id:this.info_id,category:_,comment:this.sub_row.comment,contact:this.sub_row.contact,count:this.sub_row.count,customer:this.sub_row.customer,expiration:this.sub_row.expiration,func_uid:p,info:this.sub_row.info,issued:a,region:this.sub_row.region,registration:this.sub_row.registration,sn:n,type:this.sub_row.type,product:c,module:u,user:this.sub_row.user,version:this.sub_row.version,operator:"新增",index:this.tableData.length,contact_display:this.sub_row.contact.split(";")}),this.info_id++,this.deter_require.push({customer:!1,sn:!1,func_uid:!1,count:!1,expiration:!1,user:!1,contact:!1})}}catch(b){l.e(b)}finally{l.f()}}}catch(b){o.e(b)}finally{o.f()}this.close_add_dialog()}},cancel:function(){this.$router.push({name:"Show_All"})},querySearch_sn:function(t,e){var a=t?this.sn_opt.filter(this.createFilter(t)):this.sn_opt;e(a)},querySearch_name:function(t,e){var a=t?this.customer_name_opt.filter(this.createFilter(t)):this.customer_name_opt;e(a)},querySearch_site:function(t,e){var a=t?this.customer_site_opt.filter(this.createFilter(t)):this.customer_site_opt;e(a)},querySearch_user:function(t,e){var a=t?this.user_opt.filter(this.createFilter(t)):this.user_opt;0!=a.length||t.includes("@")||(a.push({value:t+"@eastek.com.cn",label:t+"@eastek.com.cn"}),a.push({value:t+"@eastek.com.tw",label:t+"@eastek.com.tw"})),e(a)},querySearch_contact:function(t,e){var a=t?this.contact_opt.filter(this.createFilter(t)):this.contact_opt;0!=a.length||t.includes("@")||(a.push({value:t+"@eastek.com.cn",label:t+"@eastek.com.cn"}),a.push({value:t+"@eastek.com.tw",label:t+"@eastek.com.tw"})),e(a)},createFilter:function(t){return function(e){return String(e.value).toLowerCase().split("@")[0].includes(String(t).toLowerCase())}},make_blur:function(t){var e=this;"1"==t&&this.$nextTick((function(){e.$refs.dialog_pro.blur()})),"2"==t&&this.$nextTick((function(){e.$refs.sub_row_pro.blur()}))},setCellColor:function(t){t.row,t.column;var e=t.rowIndex,a=t.columnIndex,r={3:"customer",4:"sn",5:"func_uid",8:"count",11:"expiration",12:"user",13:"contact"};return this.deter_require[e][r[a]]?"background: red;border:solid 1px #EAEAEA":"border: solid 1px #EAEAEA"},handleClose:function(){}}},j=z,T=(a("14ca"),a("a94b"),Object(s["a"])(j,N,C,!1,null,"48f501a2",null)),M=T.exports,K=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("transition",{attrs:{name:"fade"}},[t.isLoading?a("loading"):t._e()],1),a("div",[a("el-header",{staticStyle:{top:"-60px","text-align":"right","font-size":"20px",position:"relative","background-color":"#EBD1A0"}},[a("div",{staticStyle:{position:"absolute",left:"30px",top:"3px",cursor:"pointer"},on:{click:t.cancel}},[t._v("License Application Service")]),a("el-popover",{attrs:{trigger:"hover",width:"200",placement:"bottom","close-delay":t.delay_time}},[a("div",[a("span",[t._v("成員名稱: "+t._s(t.user[0]))])]),a("div",[a("span",[t._v("-----------------------------------------")])]),a("div",[a("el-button",{attrs:{type:"primary",icon:"el-icon-setting"},on:{click:function(e){return t.$router.push({name:"admin",query:{}})}}},[t._v("後台管理")])],1),a("div",[a("el-button",{staticStyle:{background:"#F56C6C",color:"#FFFFFF",width:"117px"},attrs:{icon:"el-icon-switch-button"},on:{click:t.Logout}},[t._v("登出")])],1),a("el-button",{staticClass:"memeber_button",attrs:{slot:"reference",icon:"el-icon-s-custom"},slot:"reference"})],1)],1)],1),a("div",{staticClass:"heading"},[t._v("確認")]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.warning,expression:"warning"}],staticStyle:{color:"red","font-size":"20px","font-weight":"bold"}},[t._v(t._s(t.warning_message))]),a("div",{staticStyle:{position:"relative",top:"0px","z-index":"110",margin:"0px auto",width:"90%"}},[a("div",{staticStyle:{display:"flex",position:"relative"}},[a("el-table",{ref:"handletable",staticClass:"handletable",attrs:{data:t.tableData.slice(t.scroll_position,t.scroll_position+20),"row-style":{background:"#FFF0D2"},"cell-style":t.setCellColor,"row-key":t.row_key_id,height:"650px"}},[a("el-table-column",{attrs:{align:"center",width:"70",label:" "},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n                "+t._s(t.scroll_position+e.$index+1)+"\n              ")]}}])}),a("el-table-column",{attrs:{type:"",align:"center",prop:"",label:"編輯",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[a("el-row",[a("el-button",{staticStyle:{position:"relative",right:"5px"},attrs:{type:"danger",size:"mini",icon:"el-icon-delete",circle:""},on:{click:function(e){return t.deleterow(r,o)}}}),a("el-popover",{ref:"popover",attrs:{width:"1010px",trigger:"hover",placement:"top-start",offset:"200"}},[a("el-table",{attrs:{"cell-class-name":t.cell_color,data:t.compare_Data,"cell-style":{border:"solid 1px #EAEAEA"}}},[a("el-table-column",{attrs:{align:"center",width:"100px",prop:"customer",label:"客戶"}}),a("el-table-column",{attrs:{align:"center",width:"70px",prop:"sn",label:"KeyID"}}),a("el-table-column",{attrs:{align:"center",width:"100px",prop:"product",label:"產品"}}),a("el-table-column",{attrs:{align:"center",width:"100px",prop:"module",label:"模組"}}),a("el-table-column",{attrs:{align:"center",width:"70px",prop:"version",label:"版本"}}),a("el-table-column",{attrs:{align:"center",width:"70px",prop:"count",label:"數量"}}),a("el-table-column",{attrs:{align:"center",width:"70px",prop:"type",label:"類型"}}),a("el-table-column",{attrs:{align:"center",width:"70px",prop:"region",label:"地區"}}),a("el-table-column",{attrs:{align:"center",width:"130px",prop:"expiration",label:"使用期限"}}),a("el-table-column",{attrs:{align:"center",width:"150px",prop:"user",label:"負責人"}}),a("el-table-column",{attrs:{align:"center",width:"150px",prop:"contact",label:"聯絡人"}}),a("el-table-column",{attrs:{align:"center",width:"140px",prop:"comment",label:"備註"}})],1),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"修改"==r.operator,expression:"row.operator=='修改'"}],attrs:{slot:"reference",type:"info ",size:"mini",icon:"el-icon-view",circle:""},nativeOn:{mouseenter:function(e){return t.compare_row(r,o)}},slot:"reference"})],1)],1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"operator",label:"操作",width:"80"}}),a("el-table-column",{attrs:{align:"center",prop:"customer",label:"客戶"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("span",[t._v(t._s(r.customer))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"KeyID"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("span",[t._v(t._s(r.sn))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"product",label:"產品"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("span",[t._v(t._s(r.product))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"module",label:"模組"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("span",[t._v(t._s(r.module))])]}}])}),a("el-table-column",{attrs:{align:"center",prop:"version",label:"版本",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return["刪除"==r.operator||r.operator.includes("多筆")?a("span",[t._v(t._s(r.version))]):a("el-input",{attrs:{type:"text",name:"version"},model:{value:r.version,callback:function(e){t.$set(r,"version",e)},expression:"row.version"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"count",label:"數量",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return["刪除"==r.operator||r.operator.includes("多筆")?a("span",[t._v(t._s(r.count))]):a("el-input",{attrs:{type:"number",name:"count"},model:{value:r.count,callback:function(e){t.$set(r,"count",e)},expression:"row.count"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"type",label:"類型",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return["刪除"==r.operator||r.operator.includes("多筆")?a("span",[t._v(t._s(r.type))]):a("el-select",{on:{change:function(e){return t.type_change(o)}},model:{value:r.type,callback:function(e){t.$set(r,"type",e)},expression:"row.type"}},t._l(t.type_opt,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}},[a("el-tooltip",{attrs:{placement:"right"}},["測試"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("測試 - 借用給客戶(3個月)"),a("br"),t._v("審核單位: 產品 BU"),a("br"),t._v("申請新的 key 須填寫領用單，行政查詢用")]):t._e(),"出貨"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("出貨 - 尚未完全付完款項(6個月)"),a("br"),t._v("審核單位: 財會部"),a("br"),t._v("請提供訂單編號供行政查詢")]):t._e(),"正式"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("正式 - 付完全部款項(隔年1月31日)"),a("br"),t._v("審核單位: 財會部"),a("br"),t._v("請提供訂單編號供行政查詢"),a("br"),t._v("系統會自動延期一年")]):t._e(),"永久"==e.value?a("div",{attrs:{slot:"content"},slot:"content"},[t._v("台灣區需提供客戶切結書"),a("br"),t._v("目前試用電測付完尾款之客戶")]):t._e(),a("span",{staticStyle:{color:"#8492a6","font-size":"13px",padding:"10px"}},[t._v(t._s(e.value))])])],1)})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"region",label:"地區"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return["刪除"==r.operator||r.operator.includes("多筆")?a("span",[t._v(t._s(r.region))]):a("el-select",{model:{value:r.region,callback:function(e){t.$set(r,"region",e)},expression:"row.region"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"expiration",label:"使用期限",width:"145"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return["刪除"==r.operator||r.operator.includes("多筆")?a("span",[t._v(t._s(r.expiration))]):a("el-date-picker",{staticStyle:{width:"135px"},attrs:{"value-format":"yyyy-MM-dd",type:"date",name:"expiration"},model:{value:r.expiration,callback:function(e){t.$set(r,"expiration",e)},expression:"row.expiration"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"user",label:"負責人"},scopedSlots:t._u([{key:"default",fn:function(e){e.$index;var r=e.row;return["刪除"==r.operator||r.operator.includes("多筆")?a("span",[t._v(t._s(r.user))]):a("el-autocomplete",{attrs:{"fetch-suggestions":t.querySearch_user,"popper-append-to-body":"false",placeholder:"僅限一位負責人"},model:{value:r.user,callback:function(e){t.$set(r,"user",e)},expression:"row.user"}})]}}])}),a("el-table-column",{attrs:{align:"center",prop:"contact",label:"聯絡人",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return["刪除"==r.operator||r.operator.includes("多筆")?a("span",[t._v(t._s(r.contact))]):a("el-select",{staticClass:"contact-input",attrs:{filterable:"",clearable:"",multiple:"","filter-method":t.contact_fliterer,placeholder:"請輸入後按enter"},on:{change:function(e){t.contact_selection_change(e,o)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.contact_enter(o)}},model:{value:r.contact_display,callback:function(e){t.$set(r,"contact_display",e)},expression:"row.contact_display"}},t._l(t.contact_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"comment",label:"備註"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return["刪除"==r.operator?a("span",[t._v(t._s(r.comment))]):r.operator.includes("多筆")?a("i",{staticClass:"el-icon-tickets",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.open_detail(r)}}}):a("el-input",{attrs:{type:"text",name:"comment"},model:{value:r.comment,callback:function(e){t.$set(r,"comment",e)},expression:"row.comment"}})]}}])})],1),t.tableData.length>20?a("div",{staticStyle:{position:"absolute",right:"0px",width:"21px",height:"650px",background:"rgb(241,241,241)"}},[a("el-slider",{staticStyle:{left:"-8px",top:"60px"},attrs:{vertical:"",height:"579px",max:t.tableData.length,min:20,"show-tooltip":!1},on:{input:t.slider_input},model:{value:t.slider_position,callback:function(e){t.slider_position=e},expression:"slider_position"}})],1):t._e()],1),a("div",{staticStyle:{"text-align":"end"}},[a("div",{staticStyle:{display:"inline",top:"3px",position:"relative","font-size":"18px"}},[t._v("附件 :")]),a("el-button",{staticStyle:{"font-size":"20px","margin-right":"50px"},attrs:{type:"text"},on:{click:t.download}},[t._v("license-application.xlsx")]),a("el-button",{staticStyle:{width:"150px",height:"50px",display:"inline"},attrs:{size:"medium",type:"warning"},on:{click:t.cancel}},[t._v("取消申請")]),a("el-button",{staticStyle:{width:"150px",height:"50px",display:"inline"},attrs:{size:"medium",type:"warning"},on:{click:t.back}},[t._v("返回主頁")]),a("el-button",{staticStyle:{width:"150px",height:"50px",display:"inline"},attrs:{size:"medium",type:"warning"},on:{click:t.test_and_dialog}},[t._v("送出申請")])],1)]),a("el-dialog",{staticClass:"submit_dialog",attrs:{visible:t.detail_dialog,width:"1000px"},on:{"update:visible":function(e){t.detail_dialog=e}}},[a("span",{staticStyle:{"font-size":"20px"},attrs:{slot:"title"},slot:"title"},[t._v("\n        "+t._s(t.detail_customer)+" "+t._s(t.detail_sn)+" "+t._s(t.detail_type)+" 詳細資訊\n      ")]),a("el-table",{attrs:{data:t.detail_data,height:"650px"}},[a("el-table-column",{attrs:{align:"center",prop:"product",label:"產品"}}),a("el-table-column",{attrs:{align:"center",prop:"module",label:"模組"}}),a("el-table-column",{attrs:{align:"center",prop:"version",label:"版本"}}),a("el-table-column",{attrs:{align:"center",prop:"count",label:"數量"}}),a("el-table-column",{attrs:{align:"center",prop:"type",label:"類型"}}),a("el-table-column",{attrs:{align:"center",prop:"region",label:"地區"}}),a("el-table-column",{attrs:{align:"center",prop:"expiration",label:"使用期限"}})],1)],1),a("el-dialog",{staticClass:"submit_dialog",attrs:{visible:t.submit_dialog,width:"600px"},on:{"update:visible":function(e){t.submit_dialog=e}}},[a("el-form",{staticStyle:{top:"-30px",position:"relative"},attrs:{"label-width":"80px","label-position":"top"}},[a("el-form-item",{staticStyle:{"text-align":"start"}},[a("span",{staticStyle:{"font-weight":"bold","font-size":"25px"}},[t._v("申請人")]),a("br"),a("el-autocomplete",{attrs:{"fetch-suggestions":t.querySearch_user,placeholder:"請輸入申請人"},model:{value:t.user[0],callback:function(e){t.$set(t.user,0,e)},expression:"user[0]"}})],1),a("el-form-item",{staticStyle:{"text-align":"start"}},[a("span",{staticStyle:{"font-weight":"bold","font-size":"25px"}},[t._v("副本")]),a("br"),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-select",{staticStyle:{width:"620px"},attrs:{filterable:"",clearable:"",multiple:"","filter-method":t.cc_fliterer,"popper-class":"cc-opt",placeholder:"請選擇副本或手動輸入後按Enter"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.cc_enter(e)}},model:{value:t.cc,callback:function(e){t.cc=e},expression:"cc"}},t._l(t.cc_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1)],1),a("el-form-item",{staticStyle:{"text-align":"start"},attrs:{prop:"text"}},[a("span",{staticStyle:{"font-weight":"bold","font-size":"25px"}},[t._v("申請原因")]),a("br"),a("el-input",{attrs:{type:"textarea",autosize:{minRows:1,maxRows:3},name:"sender"},model:{value:t.text,callback:function(e){t.text=e},expression:"text"}})],1),a("el-form-item",{staticStyle:{"text-align":"start"}},[a("span",{staticStyle:{"font-weight":"bold","font-size":"25px"}},[t._v("夾帶附件")]),a("br"),a("el-upload",{staticClass:"avatar-uploader",attrs:{action:"111","http-request":t.customUpload,"on-remove":t.handleRemove,"on-exceed":t.handleExceed,"on-change":t.handleChange,"before-upload":t.handleUpload,accept:".png,.jpg,.docx,.xlsx,.xls,.pdf",multiple:"",limit:5,"file-list":t.fileList}},[a("el-button",{staticStyle:{position:"relative",top:"15px",left:"110px"},attrs:{size:"small",type:"warning",icon:"el-icon-plus"}}),a("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("Keypro申請單、正式&永久申請單、訂單等...")])],1)],1),a("el-button",{attrs:{type:"warning"},on:{click:function(e){t.submit_dialog=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"warning"},on:{click:t.submit}},[t._v("送出")])],1)],1)],1)},B=[];function P(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=L(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function L(t,e){if(t){if("string"===typeof t)return q(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?q(t,e):void 0}}function q(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var F={components:{Loading:I["a"]},name:"handle",data:function(){return{user:[],tableData:[],all_Data:[],nofilter_info_Data:[],info_data:[],compare_Data:[],compare_edit_Data:[],detail_dialog:!1,detail_data:[],cc:[],text:"",fileList:[],fileList_check:[],isLoading:!0,cc_opt:[],user_opt:[],region_opt:[],contact_opt:[],unuser_map:new Map,type_opt:[{label:"正式",value:"正式"},{label:"測試",value:"測試"},{label:"出貨",value:"出貨"},{label:"永久",value:"永久"}],submit_dialog:!1,deter_require:[],contact_fliter:[],contact_input:"",cc_fliter:[],cc_input:"",warning:!1,warning_message:"",detail_customer:"",detail_sn:"",detail_type:"",multi_expand_map:{},multi_delete_map:{},table:null,scroll_position:0,slider_position:0}},watch:{},created:function(){var t=this;this.axios.get("/get_product_groups_info_data",{headers:{"Content-Encoding":"gzip"}}).then((function(e){t.user=JSON.parse(sessionStorage.getItem("user")),t.info_data=JSON.parse(JSON.stringify(e.data))["info_data"];var a=new Map,r=new Map,o=new Map,i=JSON.parse(JSON.stringify(e.data))["sn_dict"];t.axios.get("/show_all",{headers:{"Content-Encoding":"gzip"},params:{user:JSON.stringify(JSON.parse(sessionStorage.getItem("user")))}}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data));var n,l=!1,s=P(t.all_Data["edit_data"]);try{for(s.s();!(n=s.n()).done;){var c=n.value;c["user"]==t.user[0]&&(l=!0)}}catch(Jt){s.e(Jt)}finally{s.f()}if(l){var u,p=P(t.all_Data["product_data"]);try{for(p.s();!(u=p.n()).done;){var d=u.value;a.set(d["product_name"],{category_id:d["category_id"],caption:d["caption"]})}}catch(Jt){p.e(Jt)}finally{p.f()}var _,f=P(t.all_Data["option_data"]);try{for(f.s();!(_=f.n()).done;){var h=_.value;r.set(h["option_name"],{category_id:a.get(h["product_name"])["category_id"],product_name:h["product_name"],caption:h["caption"]})}}catch(Jt){f.e(Jt)}finally{f.f()}t.all_Data["module_data"].forEach((function(t){return o.set(t["mod_uid"],t["caption"])}));var m,g=new Set,v=P(t.all_Data["sn_data"]);try{for(v.s();!(m=v.n()).done;){var y,b=m.value,x=P(b["user"].split(","));try{for(x.s();!(y=x.n()).done;){var w=y.value;-1!=w.indexOf("@")&&g.add(w)}}catch(Jt){x.e(Jt)}finally{x.f()}}}catch(Jt){v.e(Jt)}finally{v.f()}g.forEach((function(e){return t.cc_opt.push({value:e,label:e})})),t.cc_fliter=t.cc_opt;var S,k=new Set,D=P(t.all_Data["sn_data"]);try{for(D.s();!(S=D.n()).done;){var O,$=S.value,N=P($["user"].split(","));try{for(N.s();!(O=N.n()).done;){var C=O.value;k.add(C)}}catch(Jt){N.e(Jt)}finally{N.f()}}}catch(Jt){D.e(Jt)}finally{D.f()}var I,J=P(k);try{for(J.s();!(I=J.n()).done;){var E=I.value;t.user_opt.push({value:E,label:E})}}catch(Jt){J.e(Jt)}finally{J.f()}var A,z=P(t.all_Data["user_data"]);try{for(z.s();!(A=z.n()).done;){var j=A.value;j["email"].indexOf("@")>0&&t.contact_opt.push({value:j["email"],label:j["email"]})}}catch(Jt){z.e(Jt)}finally{z.f()}var T,M=P(t.all_Data["region_data"]);try{for(M.s();!(T=M.n()).done;){var K=T.value;t.region_opt.push({value:K["name"],label:K["name"]})}}catch(Jt){M.e(Jt)}finally{M.f()}var B,L=JSON.parse(JSON.stringify(t.info_data)),q={},F=P(t.all_Data["customer_data"]);try{for(F.s();!(B=F.n()).done;){var U=B.value;q[U["customer_id"]]={name:U["name"],site:U["site"]}}}catch(Jt){F.e(Jt)}finally{F.f()}var R,V={},H=P(t.all_Data["region_data"]);try{for(H.s();!(R=H.n()).done;){var W=R.value;V[W["region_id"]]={name:W["name"],description:W["description"]}}}catch(Jt){H.e(Jt)}finally{H.f()}var G,Z=0,Y=P(t.info_data);try{for(Y.s();!(G=Y.n()).done;){var Q=G.value;if(void 0!=i[Q["sn"]]){var X=q[i[Q["sn"]]["sn_id"]]["name"],tt=q[i[Q["sn"]]["sn_id"]]["site"];L[Z]=""!=tt?Object.assign(L[Z],{customer:X+"|"+tt,user:i[Q["sn"]]["user"],info:[i[Q["sn"]]["note1"],i[Q["sn"]]["note2"],i[Q["sn"]]["note3"],i[Q["sn"]]["note4"],i[Q["sn"]]["note5"]]}):Object.assign(L[Z],{customer:X,user:i[Q["sn"]]["user"],info:[i[Q["sn"]]["note1"],i[Q["sn"]]["note2"],i[Q["sn"]]["note3"],i[Q["sn"]]["note4"],i[Q["sn"]]["note5"]]}),isNaN(i[Q["sn"]]["region"])?L[Z]=Object.assign(L[Z],{region:i[Q["sn"]]["region"]}):""!=i[Q["sn"]]["region"]?L[Z]=Object.assign(L[Z],{region:V[parseInt(i[Q["sn"]]["region"],10)]["name"]}):L[Z]=Object.assign(L[Z],{region:""})}void 0!=r.get(Q["func_uid"])?(L[Z]=Object.assign(L[Z],{caption:r.get(Q["func_uid"])["category_id"]}),L[Z]["module"]=r.get(Q["func_uid"])["caption"],L[Z]["product"]=o.get(r.get(Q["func_uid"])["product_name"])):void 0!=a.get(Q["func_uid"])?(L[Z]=Object.assign(L[Z],{caption:a.get(Q["func_uid"])["category_id"]}),L[Z]["product"]=a.get(Q["func_uid"])["caption"],L[Z]["module"]=""):(L[Z]=Object.assign(L[Z],{caption:""}),L[Z]["product"]="",L[Z]["module"]=""),void 0!=o.get(Q["type"])&&(L[Z]["type"]=o.get(Q["type"])),Z++}}catch(Jt){Y.e(Jt)}finally{Y.f()}t.nofilter_info_Data=JSON.parse(JSON.stringify(L));var et=new Map;t.all_Data["user_data"].forEach((function(t){return et.set(t["email"],t["user"])})),t.all_Data["user_data"].forEach((function(e){return t.unuser_map.set(e["user"],e["email"])}));var at,rt=P(t.all_Data["edit_data"]);try{for(rt.s();!(at=rt.n()).done;){var ot=at.value;if(ot["user"]==t.user[0])var it=JSON.parse(ot["data"])}}catch(Jt){rt.e(Jt)}finally{rt.f()}var nt,lt=[],st=[],ct=P(it);try{for(ct.s();!(nt=ct.n()).done;){var ut=nt.value;"multiple_expand"==ut.operation_type?lt.push(ut):"multiple_delete"==ut.operation_type?st.push(ut):t.tableData.push(ut)}}catch(Jt){ct.e(Jt)}finally{ct.f()}for(var pt={},dt=0,_t=lt;dt<_t.length;dt++){var ft=_t[dt];ft["sn"]in pt?pt[ft["sn"]].push(ft):pt[ft["sn"]]=[ft]}for(var ht={},mt=0,gt=st;mt<gt.length;mt++){var vt=gt[mt];vt["sn"]in ht?ht[vt["sn"]].push(vt):ht[vt["sn"]]=[vt]}for(var yt in pt)t.tableData.push({operator:"多筆展延",customer:pt[yt][0].customer,sn:pt[yt][0].sn,count:pt[yt].length,user:pt[yt][0].user,contact:pt[yt][0].contact});for(var bt in ht)t.tableData.push({operator:"多筆刪除",customer:ht[bt][0].customer,sn:ht[bt][0].sn,count:ht[bt].length,user:ht[bt][0].user,contact:ht[bt][0].contact});t.multi_expand_map=pt,t.multi_delete_map=ht;var xt,wt=new Set,St=P(t.tableData);try{for(St.s();!(xt=St.n()).done;){var kt=xt.value;if(-1!=kt["contact"].indexOf(";")){var Dt,Ot=P(kt["contact"].split(";"));try{for(Ot.s();!(Dt=Ot.n()).done;){var $t=Dt.value;-1!=$t.indexOf("@")&&wt.add($t)}}catch(Jt){Ot.e(Jt)}finally{Ot.f()}}else-1!=kt["contact"].indexOf("@")&&wt.add(kt["contact"])}}catch(Jt){St.e(Jt)}finally{St.f()}var Nt,Ct=P(t.tableData);try{for(Ct.s();!(Nt=Ct.n()).done;){var It=Nt.value;t.deter_require.push({count:!1,expiration:!1,user:!1,contact:!1}),""==It["contact_display"]?It["contact_display"]=[]:It["contact_display"]=It["contact"].split(";")}}catch(Jt){Ct.e(Jt)}finally{Ct.f()}t.slider_position=t.tableData.length,t.isLoading=!1}else t.isLoading=!1}))}))},mounted:function(){var t=this;window.onbeforeunload=function(e){if("handle"==t.$route.name){var a,r=[],o=P(t.fileList);try{for(o.s();!(a=o.n()).done;){var i=a.value;r.push(i.name)}}catch(n){o.e(n)}finally{o.f()}t.axios.get("/F5_handle",{params:{upload_file_name:JSON.stringify(r)}})}else window.onbeforeunload=null},this.table=this.$refs.handletable.bodyWrapper;var e=navigator.userAgent,a=e.indexOf("Firefox")>-1,r=!1,o=!1,i=this;a?this.table.addEventListener("DOMMouseScroll",(function(t){var e=t.detail;o=e<0,r=e>0,o?i.scroll_position>0&&(i.scroll_position-=1):r&&i.scroll_position<i.tableData.length-20&&(i.scroll_position+=1),i.slider_position=i.tableData.length-i.scroll_position})):this.table.addEventListener("mousewheel",(function(t){var e=t.deltaY;o=e<0,r=e>0,o?i.scroll_position>0&&(i.scroll_position-=1):r&&i.scroll_position<i.tableData.length-20&&(i.scroll_position+=1),i.slider_position=i.tableData.length-i.scroll_position}))},methods:{cc_fliterer:function(t){this.cc_input=t,this.cc_fliter=t?this.cc_opt.filter((function(e){if(String(e["label"]).split("@")[0].includes(t))return!0})):this.cc_opt},contact_selection_change:function(t,e){this.tableData[e].contact=t.join(";")},contact_fliterer:function(t){this.contact_input=t,this.contact_fliter=t?this.contact_opt.filter((function(e){if(String(e["label"]).split("@")[0].includes(t))return!0})):this.contact_opt},cc_enter:function(){this.cc.push(this.cc_input)},contact_enter:function(t){this.tableData[t]["contact_display"].push(this.contact_input),this.tableData[t]["contact"]=this.tableData[t]["contact_display"].join(";")},type_change:function(t){var e=new Date;if("正式"==this.tableData[t].type&&(e.setMonth(e.getMonth()+12),this.tableData[t].expiration=e.toISOString().slice(0,4)+"-01-31"),"測試"==this.tableData[t].type){var a=e.getMonth()+1;12==a?(e.setMonth(e.getMonth()+12),this.tableData[t].expiration=e.toISOString().slice(0,4)+"-03-31"):this.tableData[t].expiration=1==a||2==a?e.toISOString().slice(0,4)+"-03-31":3==a||4==a||5==a?e.toISOString().slice(0,4)+"-06-30":6==a||7==a||8==a?e.toISOString().slice(0,4)+"-09-30":9==a||10==a||11==a?e.toISOString().slice(0,4)+"-12-31":""}"出貨"==this.tableData[t].type&&(this.tableData[t].expiration=e.toISOString().slice(0,4)+"-12-31"),"永久"==this.tableData[t].type&&(this.tableData[t].expiration="2100-12-31")},handleUpload:function(t){var e,a=0,r=P(this.fileList_check);try{for(r.s();!(e=r.n()).done;){var o=e.value;a+=o.size}}catch(n){r.e(n)}finally{r.f()}var i=a/1024/1024<20;if(!i)return this.$message.error("上傳總容量不得高於20MB!"),i},handleChange:function(t,e){this.fileList_check=e;var a,r=0,o=P(e);try{for(o.s();!(a=o.n()).done;){var i=a.value;r+=i.size}}catch(s){o.e(s)}finally{o.f()}var n=r/1024/1024<20;if(n){this.fileList=e;var l=new FormData;l.append("file",t.raw),l.append("name",t.name),l.append("type",t.raw.type);this.axios.create({withCredentials:!0});this.axios.post("/upload_on_local",l)}},customUpload:function(t){},handleExceed:function(t,e){this.$message.warning("限制上傳5個文件以下")},handleRemove:function(t,e){this.fileList=e,this.axios.get("/delete_upload_local",{params:{name:t.name}})},tranfer_xlsx:function(t){if(t){var e=window.URL.createObjectURL(new Blob([t])),a=document.createElement("a");a.style.display="none",a.href=e,a.setAttribute("download","license-application.xlsx"),document.body.appendChild(a),a.click()}},download:function(){var t=this;this.axios.get("/download",{params:{user:JSON.stringify(this.user)},responseType:"blob"}).then((function(e){t.tranfer_xlsx(e.data)}))},test_data:function(t,e){var a=!0;""==t["contact"]&&(this.deter_require[e]["contact"]=!0,a=!1),""==t["user"]&&(this.deter_require[e]["user"]=!0,a=!1),null!=t["count"]&&""!=t["count"]||(this.deter_require[e]["count"]=!0,a=!1);var r=/^[0-9]*$/;return r.test(t["count"])||(this.deter_require[e]["count"]=!0,a=!1),null!=t["expiration"]&&""!=t["expiration"]||(this.deter_require[e]["expiration"]=!0,a=!1),a},test_and_dialog:function(){var t=Object(b["a"])(regeneratorRuntime.mark((function t(){var e,a,r,o,i,n,l,s,c,u,p,d,_,f,h,m,g,v,y,b,x,w,S,k,D,O,$,N,C,I,J=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log("in test_and_dialog"),0!=this.tableData.length){t.next=4;break}return this.$alert("請送出至少一筆資料","提示",{center:!0,type:"warning"}),t.abrupt("return",!1);case 4:e=0,a=!0,r=P(this.deter_require);try{for(i=function(){var t=o.value;Object.keys(t).forEach((function(e){t[e]=!1}))},r.s();!(o=r.n()).done;)i()}catch(E){r.e(E)}finally{r.f()}this.warning=!1,this.warning_message="",n=P(this.tableData);try{for(n.s();!(l=n.n()).done;)s=l.value,c=!0,c=!("刪除"!=s["operator"]&&!s["operator"].includes("多筆"))||this.test_data(s,e),0==c&&(a=!1),e+=1}catch(E){n.e(E)}finally{n.f()}if(a){t.next=16;break}return this.warning=!0,this.warning_message="請確認資料完整性",t.abrupt("return",!1);case 16:u={},p=[],d=P(this.tableData),t.prev=19,d.s();case 21:if((_=d.n()).done){t.next=28;break}if(f=_.value,"刪除"!=f["operator"]&&!f["operator"].includes("多筆")){t.next=25;break}return t.abrupt("continue",26);case 25:f["sn"]in u?u[f["sn"]].includes(f["user"])||u[f["sn"]].push(f["user"]):u[f["sn"]]=[f["user"]];case 26:t.next=21;break;case 28:t.next=33;break;case 30:t.prev=30,t.t0=t["catch"](19),d.e(t.t0);case 33:return t.prev=33,d.f(),t.finish(33);case 36:for(h in u)u[h].length>=2&&p.push(h);if(!p.length){t.next=46;break}return t.next=40,this.$confirm("相同KeyID僅能對應至相同負責人","提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).catch((function(){}));case 40:m=0,g=P(this.tableData);try{for(g.s();!(v=g.n()).done;)y=v.value,"刪除"!=y["operator"]&&!y["operator"].includes("多筆")&&p.includes(String(y["sn"]))&&(this.deter_require[m]["user"]=!0),m+=1}catch(E){g.e(E)}finally{g.f()}return this.warning=!0,this.warning_message="相同KeyID僅能對應至相同負責人",t.abrupt("return",!1);case 46:b=0,x={},w=[],S=P(this.tableData);try{for(S.s();!(k=S.n()).done;){D=k.value,O=P(this.all_Data["sn_data"]);try{for(O.s();!($=O.n()).done;)N=$.value,D["sn"]==N["sn"]&&D["user"]!=N["user"]&&(x[D["sn"]]={old_user:N["user"],new_user:D["user"]},w.push(b))}catch(E){O.e(E)}finally{O.f()}b+=1}}catch(E){S.e(E)}finally{S.f()}if(!Object.keys(x).length){t.next=57;break}for(I in C='<table style="border-collapse:collapse"  width="500px" border="1">                                  <tr>                                      <th width="100px">KeyID</th>                                      <th width="200px">原負責人</th>                                      <th width="200px">新負責人</th>                                  </tr>',x)C+="<tr><td>".concat(I,"</td><td>").concat(x[I]["old_user"],"</td><td>").concat(x[I]["new_user"],"</td> </tr>");return C+="</table>",t.next=57,this.$confirm(C,"負責人變更，是否繼續?",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0,dangerouslyUseHTMLString:!0,customClass:"product-conflict"}).then((function(){})).catch((function(){var t,e=P(w);try{for(e.s();!(t=e.n()).done;){var r=t.value;J.deter_require[r]["user"]=!0}}catch(E){e.e(E)}finally{e.f()}a=!1}));case 57:if(a){t.next=61;break}return this.warning=!0,this.warning_message="請檢查負責人",t.abrupt("return",!0);case 61:this.tableData.forEach((function(t){var e,a=P(t["contact"].split(";"));try{for(a.s();!(e=a.n()).done;){var r=e.value;J.cc.includes(r)||J.cc.push(r)}}catch(E){a.e(E)}finally{a.f()}})),this.submit_dialog=!0;case 63:case"end":return t.stop()}}),t,this,[[19,30,33,36]])})));function e(){return t.apply(this,arguments)}return e}(),submit:function(){var t=this;this.$confirm("是否送出申請?","提示",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){for(var e=0;e<t.cc.length;e++)""==t.cc[e]&&(t.cc.splice(e,1),e--);if(0!=t.cc.length)for(var a in t.cc)if(-1==t.cc[a].indexOf("@"))return void t.$message({message:"副本請填入正確email格式",type:"error"});console.log("before upload_file_name");var r,o=[],i=P(t.fileList);try{for(i.s();!(r=i.n()).done;){var n=r.value;o.push(n.name)}}catch(l){i.e(l)}finally{i.f()}t.submit_dialog=!1,t.isLoading=!0,console.log("before /handle_send isLoading==True"),t.axios.post("/handle_send",{origin_data:t.nofilter_info_Data,edit_data:t.complete_tableData(),content:{user:t.user[0],cc:t.cc.join(";"),text:t.text,reply:""},upload_file_name:o,phase:"transfer_edit_to_application",my_application_id:0}).then((function(e){if(console.log("in /handle_send transfer_edit_to_application response"+JSON.stringify(e)),console.log("in /handle_send transfer_edit_to_application response.data"+JSON.stringify(e.data)),String(e.data).includes("error"))console.log(e.data),t.isLoading=!1,t.$message({showClose:!0,message:"資料庫操作失敗!",type:"error"});else{var a=e.data;t.axios.post("/handle_send",{origin_data:t.nofilter_info_Data,edit_data:t.complete_tableData(),content:{user:t.user[0],cc:t.cc.join(";"),text:t.text,reply:""},upload_file_name:o,phase:"verify_email",my_application_id:a}).then((function(e){console.log("in /handle_send verify_email response"+JSON.stringify(e)),console.log("in /handle_send verify_email response.data"+JSON.stringify(e.data)),"verify_email success"==e.data?t.axios.post("/handle_send",{origin_data:t.nofilter_info_Data,edit_data:t.complete_tableData(),content:{user:t.user[0],cc:t.cc.join(";"),text:t.text,reply:""},upload_file_name:o,phase:"comfirm_email",my_application_id:a}).then((function(e){console.log("in /handle_send comfirm_email response"+JSON.stringify(e)),console.log("in /handle_send comfirm_email response.data"+JSON.stringify(e.data)),"comfirm_email success"==e.data?(t.isLoading=!1,t.$message({showClose:!0,message:"郵件傳送成功!",type:"success"}),t.$router.push({name:"Show_All"})):(console.log(e.data),t.isLoading=!1,t.$message({showClose:!0,message:"申請確認信傳送失敗!",type:"error"}))})).catch((function(){console.log("no response error"),t.$message({showClose:!0,message:"郵件傳送失敗!",type:"error"})})):(console.log(e.data),t.isLoading=!1,t.$message({showClose:!0,message:"審核通知信傳送失敗!",type:"error"}))})).catch((function(){console.log("no response error"),t.isLoading=!1,t.$message({showClose:!0,message:"郵件傳送失敗!",type:"error"})}))}})).catch((function(){console.log("no response error"),t.isLoading=!1,t.$message({showClose:!0,message:"郵件傳送失敗!",type:"error"})}))})).catch((function(){t.$message({type:"info",message:"已取消送出申請"})}))},back:function(){var t,e=[],a=P(this.fileList);try{for(a.s();!(t=a.n()).done;){var r=t.value;e.push(r.name)}}catch(o){a.e(o)}finally{a.f()}this.axios.get("/handle_back_ShowAll",{params:{user:JSON.stringify(this.user),upload_file_name:JSON.stringify(e)}}),this.$router.push({name:"Show_All"})},cancel:function(){var t=this;this.$confirm("是否需要取消此次申請(申請資料將刪除)","提示",{confirmButtonText:"確定",cancelButtonText:"取消",showClose:!1,type:"warning",center:!0}).then((function(){t.axios.get("/handle_delete",{params:{Row:JSON.stringify([]),user:JSON.stringify(t.user)}}).then((function(e){e.data;t.back()}))})).catch((function(){}))},deleterow:function(t,e){this.deter_require.splice(e,1),this.tableData.splice(e,1),"多筆展延"==t.operator?delete this.multi_expand_map[t.sn]:"多筆刪除"==t.operator&&delete this.multi_delete_map[t.sn];var a=this;this.axios.post("/handle_delete",{Row:a.complete_tableData(),user:a.user}).then((function(t){t.data}))},cell_color:function(t){var e=t.row,a=t.column;t.rowIndex,t.columnIndex;return"客戶"==a.label&&e.customer!=this.compare_edit_Data[0].customer||"KeyID"==a.label&&e.sn!=this.compare_edit_Data[0].sn||"產品名稱"==a.label&&e.product!=this.compare_edit_Data[0].product||"版本"==a.label&&e.version!=this.compare_edit_Data[0].version||"類型"==a.label&&e.type!=this.compare_edit_Data[0].type||"數量"==a.label&&e.count!=this.compare_edit_Data[0].count||"使用期限"==a.label&&e.expiration!=this.compare_edit_Data[0].expiration||"地區"==a.label&&e.region!=this.compare_edit_Data[0].region||"備註"==a.label&&e.comment!=this.compare_edit_Data[0].comment||"聯絡人"==a.label&&e.contact!=this.compare_edit_Data[0].contact||"負責人"==a.label&&e.user!=this.compare_edit_Data[0].user?"warning-row":void 0},compare_row:function(t,e){this.compare_Data.length=0,this.compare_edit_Data.length=0;var a,r=P(this.nofilter_info_Data);try{for(r.s();!(a=r.n()).done;){var o=a.value;JSON.stringify(o["info_id"])==JSON.stringify(t["info_id"])&&(this.compare_Data.push(o),this.compare_edit_Data.push(t))}}catch(i){r.e(i)}finally{r.f()}},setCellColor:function(t){t.row,t.column;var e=t.rowIndex,a=t.columnIndex,r={8:"count",11:"expiration",12:"user",13:"contact"};return this.deter_require[e][r[a]]?"background: red;;border:solid 1px #EAEAEA":"border: solid 1px #EAEAEA"},querySearch_cc:function(t,e){var a=t?this.cc_opt.filter(this.createFilter(t)):this.cc_opt;0==a.length&&(t.includes("@")||(a.push({value:t+"@eastek.com.cn",label:t+"@eastek.com.cn"}),a.push({value:t+"@eastek.com.tw",label:t+"@eastek.com.tw"}))),e(a)},querySearch_user:function(t,e){var a=t?this.user_opt.filter(this.createFilter(t)):this.user_opt;0!=a.length||t.includes("@")||(a.push({value:t+"@eastek.com.cn",label:t+"@eastek.com.cn"}),a.push({value:t+"@eastek.com.tw",label:t+"@eastek.com.tw"})),e(a)},querySearch_contact:function(t,e){var a=t?this.contact_opt.filter(this.createFilter(t)):this.contact_opt;0!=a.length||t.includes("@")||(a.push({value:t+"@eastek.com.cn",label:t+"@eastek.com.cn"}),a.push({value:t+"@eastek.com.tw",label:t+"@eastek.com.tw"})),e(a)},createFilter:function(t){return function(e){return String(e.value).toLowerCase().split("@")[0].includes(String(t).toLowerCase())}},open_detail:function(t){"多筆展延"==t.operator&&(this.detail_data=this.multi_expand_map[t.sn]),"多筆刪除"==t.operator&&(this.detail_data=this.multi_delete_map[t.sn]),this.detail_customer=t.customer,this.detail_sn=t.sn,this.detail_type=t.operator,this.detail_dialog=!0},slider_input:function(t){this.scroll_position=this.tableData.length-t},complete_tableData:function(){var t,e=[],a=P(this.tableData);try{for(a.s();!(t=a.n()).done;){var r=t.value;r["operator"].includes("多筆")||e.push(r)}}catch(m){a.e(m)}finally{a.f()}for(var o=0,i=Object.keys(this.multi_expand_map);o<i.length;o++){var n,l=i[o],s=P(this.multi_expand_map[l]);try{for(s.s();!(n=s.n()).done;){var c=n.value;e.push(c)}}catch(m){s.e(m)}finally{s.f()}}for(var u=0,p=Object.keys(this.multi_delete_map);u<p.length;u++){var d,_=p[u],f=P(this.multi_delete_map[_]);try{for(f.s();!(d=f.n()).done;){var h=d.value;e.push(h)}}catch(m){f.e(m)}finally{f.f()}}return e}}},U=F,R=(a("2ded"),a("dad4"),Object(s["a"])(U,K,B,!1,null,"7a73e334",null)),V=R.exports,H=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("transition",{attrs:{name:"fade"}},[t.isLoading?a("loading"):t._e()],1),a("div",{staticStyle:{position:"absolute",right:"12%",top:"18px"}},[a("el-button",{staticStyle:{"margin-right":"25px","background-color":"#EAEAEA","border-color":"#EAEAEA",padding:"8px 11px","font-size":"18px"},attrs:{icon:"el-icon-s-home"},on:{click:function(e){return t.$router.push({name:"Show_All"})}}},[t._v("主頁面")]),a("el-link",{staticStyle:{"font-size":"18px"},attrs:{type:"success",icon:"el-icon-s-custom"},on:{click:function(e){return t.$router.push({name:"admin",query:{}})}}},[t._v(t._s(t.user[0]))])],1),a("el-tabs",{staticStyle:{width:"1300px",margin:"0px auto",height:"830px"},attrs:{type:"border-card"},model:{value:t.editableTabsValue,callback:function(e){t.editableTabsValue=e},expression:"editableTabsValue"}},[a("el-tab-pane",{attrs:{label:"待審核資料",name:"待審核資料"}},[a("span",{staticStyle:{display:"flex"},attrs:{slot:"label"},slot:"label"},[t._v("\n        待審核資料\n        "),a("div",{staticClass:"num-badge"},[t._v(t._s(t.app_Data_num))])]),a("div",{staticStyle:{width:"1280px",margin:"0 auto",top:"-33px",position:"relative"}},[a("div",{staticStyle:{position:"relative",top:"50px"},attrs:{align:"center"}},[a("el-table",{attrs:{data:t.app_Data,height:"650px"}},[a("el-table-column",{attrs:{type:"",align:"center",prop:"fake_id",label:"順序編號",width:"100"}}),a("el-table-column",{attrs:{type:"",align:"center",prop:"",label:"清除紀錄",width:"130"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[a("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete-solid",circle:""},nativeOn:{click:function(e){return t.clear_data(r)}}})]}}])}),a("el-table-column",{attrs:{align:"left",prop:"check",width:"55"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[a("el-checkbox",{attrs:{disabled:t.disabled_checkbox(r)},on:{change:function(e){return t.click_checkbox(t.check[o],o)}},model:{value:t.check[o],callback:function(e){t.$set(t.check,o,e)},expression:"check[$index]"}})]}}])}),a("el-table-column",{attrs:{type:"","header-align":"center",prop:"validator","render-header":t.label_for_validator,width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[t._v("\n        審核群組:\n        "),t._l(r.validator["verify_group"],(function(e,o){return[1==r.validator["verify_check"]["verify_group"][o]?a("span",{staticStyle:{color:"#67C23A"}},[t._v(t._s(e))]):t._e(),0==r.validator["verify_check"]["verify_group"][o]?a("span",{staticStyle:{color:"#FF7575"}},[t._v(t._s(e))]):t._e(),o+1!=r.validator["verify_group"].length?a("span",[t._v(",")]):t._e()]})),a("br"),t._v("審核人數:\n        "),r.validator["verify_check"]["verify_num"]>=r.validator["verify_num"]?a("span",{staticStyle:{color:"#67C23A"}},[t._v(t._s(r.validator["verify_num"]))]):t._e(),r.validator["verify_check"]["verify_num"]<r.validator["verify_num"]?a("span",{staticStyle:{color:"#FF7575"}},[t._v(t._s(r.validator["verify_num"]))]):t._e()]}}])}),a("el-table-column",{attrs:{type:"",align:"center",prop:"id",label:"申請編號",width:"100"}}),a("el-table-column",{attrs:{type:"",align:"center",prop:"verify_status",label:"審核狀態",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("span",{directives:[{name:"show",rawName:"v-show",value:1==r.verify_status,expression:"row.verify_status==1"}],staticStyle:{color:"#67C23A"}},[t._v("已審核")]),a("span",{directives:[{name:"show",rawName:"v-show",value:0==r.verify_status,expression:"row.verify_status==0"}],staticStyle:{color:"#FF7575"}},[t._v("尚未審核")])]}}])}),a("el-table-column",{attrs:{type:"",align:"center",prop:"applicant",label:"申請人",width:"100"}}),a("el-table-column",{attrs:{type:"",align:"center",prop:"date",label:"申請日期",width:"180"}}),a("el-table-column",{attrs:{type:"",align:"center",prop:"",label:"編輯",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.open_dialog(r,o)}}},[t._v("查看資料")]),a("el-dialog",{attrs:{width:"95%",title:"申請內容",visible:t.dialogTableVisible[o]},on:{"update:visible":function(e){return t.$set(t.dialogTableVisible,o,e)}}},[a("div",{staticStyle:{display:"flex","font-size":"18px"}},[a("div",{staticStyle:{width:"33%"}},[a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"40%","margin-right":"25px",bottom:"-3px",position:"relative"}},[t._v(" 申請人 :")]),a("div",{staticStyle:{"text-align":"start"}},[a("el-input",{staticClass:"input_no_border",staticStyle:{width:"150px"},attrs:{type:"textarea",autosize:{minRows:1,maxRows:1},name:"sender",readonly:""},model:{value:t.content["user"],callback:function(e){t.$set(t.content,"user",e)},expression:"content['user']"}})],1)]),a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"40%","margin-right":"25px",bottom:"-9px",position:"relative"}},[t._v(" 副本 :")]),a("div",{staticStyle:{"text-align":"start",width:"55%"}},[t._l(t.cc,(function(e,r){return[a("el-autocomplete",{attrs:{"fetch-suggestions":t.querySearch_cc,placeholder:"請輸入副本"},model:{value:t.cc[r],callback:function(e){t.$set(t.cc,r,e)},expression:"cc[index]"}}),a("el-button",{directives:[{name:"show",rawName:"v-show",value:0!=r,expression:"index != 0"}],attrs:{type:"text",icon:"el-icon-error"},on:{click:function(e){return t.remove_cc(r)}}})]})),a("el-button",{staticStyle:{"font-size":"15px"},attrs:{type:"text",icon:"el-icon-circle-plus"},on:{click:function(e){return t.add_cc()}}})],2)]),a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"40%","margin-right":"25px",bottom:"-9px",position:"relative"}},[t._v(" 附件下載 :")]),a("div",{staticStyle:{"text-align":"start"}},[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.download_check(r,o)}}},[t._v("license-application.xlsx")])],1)]),a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"40%","margin-right":"25px",bottom:"2px",position:"relative"}},[t._v(" 申請內文 :")]),a("div",{staticStyle:{"text-align":"start"}},[a("el-input",{staticStyle:{width:"250px"},attrs:{type:"textarea",autosize:{minRows:4,maxRows:4},name:"sender",readonly:"",disabled:!0},model:{value:t.content["text"],callback:function(e){t.$set(t.content,"text",e)},expression:"content['text']"}})],1)])]),a("div",{staticStyle:{width:"33%"}},[a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"20%","margin-right":"25px",bottom:"2px",position:"relative"}},[t._v(" 審核者回覆 :")]),a("div",{staticStyle:{"text-align":"start"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",autosize:{minRows:4,maxRows:4},name:"sender"},model:{value:t.content["reply"],callback:function(e){t.$set(t.content,"reply",e)},expression:"content['reply']"}})],1)])]),a("div",{staticStyle:{width:"33%",top:"-22px",position:"relative"}},[a("div",[t._v(" 申請紀錄統計(總共"+t._s(t.tableData.length)+"筆)")]),a("div",{staticStyle:{height:"180px",width:"auto",overflow:"auto",border:"1px solid #dcdfe6","border-radius":"4px",margin:"0px auto","text-align":"right"}},[a("p",{staticStyle:{"font-size":"20px",margin:"0px 50px"},domProps:{innerHTML:t._s(t.data_statistics_text)}})])])]),a("div",{staticStyle:{"text-align":"start"}},[a("el-button",{staticStyle:{"background-color":"#67C23A","border-color":"#67C23A",padding:"8px 11px",color:"#ffffff"},attrs:{icon:"el-icon-check"},on:{click:t.all_approve}}),a("el-button",{staticStyle:{"background-color":"#F56C6C","border-color":"#F56C6C",padding:"8px 11px",color:"#ffffff"},attrs:{icon:"el-icon-close"},on:{click:t.all_reject}}),a("el-button",{staticStyle:{"background-color":"#909399","border-color":"#909399",padding:"8px 11px",color:"#ffffff"},attrs:{icon:"el-icon-refresh-right"},on:{click:t.all_clear}})],1),a("div",[a("el-table",{attrs:{data:t.tableData,height:"400px"}},[a("el-table-column",{attrs:{align:"center",prop:"customer",label:"審核",width:"100px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[a("el-radio-group",{ref:"radio-"+o,attrs:{fill:"√"==t.radio[o]?"#67C23A":"#F56C6C",size:"mini"},on:{change:function(e){return t.verify_change(r,o)}},model:{value:t.radio[o],callback:function(e){t.$set(t.radio,o,e)},expression:"radio[$index]"}},[a("el-radio-button",{attrs:{label:"√"}}),a("el-radio-button",{attrs:{label:"×"}})],1)]}}],null,!0)}),a("el-table-column",{attrs:{type:"",align:"center",prop:"",label:"編輯",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[a("el-row",[t.showEdit[o]?a("el-button",{attrs:{type:"primary",size:"mini",icon:"el-icon-check",circle:""},nativeOn:{click:function(e){return t.handleCheck(o,r)}}}):t._e(),t.showEdit[o]?a("el-button",{staticStyle:{position:"relative",right:"5px"},attrs:{type:"danger",size:"mini",icon:"el-icon-close",circle:""},nativeOn:{click:function(e){return t.handelRestore(o,r)}}}):t._e(),t.showEdit[o]?t._e():a("el-button",{attrs:{type:"primary",size:"mini",icon:"el-icon-edit",circle:""},nativeOn:{click:function(e){return t.handleEdit(o,r)}}}),a("el-popover",{ref:"popover",attrs:{width:"950px",trigger:"hover",placement:"top-start",offset:"300"}},[a("el-table",{attrs:{"cell-class-name":t.cell_color,data:t.compare_Data}},[a("el-table-column",{attrs:{width:"100px",prop:"customer",label:"客戶"}}),a("el-table-column",{attrs:{width:"130px",prop:"issued",label:"更新日期"}}),a("el-table-column",{attrs:{width:"70px",prop:"sn",label:"KeyID"}}),a("el-table-column",{attrs:{width:"140px",prop:"func_uid",label:"產品名稱"}}),a("el-table-column",{attrs:{width:"70px",prop:"version",label:"版本"}}),a("el-table-column",{attrs:{width:"70px",prop:"type",label:"類型"}}),a("el-table-column",{attrs:{width:"70px",prop:"count",label:"數量"}}),a("el-table-column",{attrs:{width:"130px",prop:"expiration",label:"到期日期"}}),a("el-table-column",{attrs:{width:"70px",prop:"region",label:"地區"}}),a("el-table-column",{attrs:{width:"140px",prop:"comment",label:"備註"}}),a("el-table-column",{attrs:{width:"150px",prop:"contact",label:"聯絡人"}})],1),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"修改"==r.operator,expression:"row.operator=='修改'"}],attrs:{slot:"reference",type:"info ",size:"mini",icon:"el-icon-view",circle:""},nativeOn:{mouseenter:function(e){return t.compare_row(r,o)}},slot:"reference"})],1)],1)]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"operator",label:"操作",width:"100"}}),a("el-table-column",{attrs:{align:"center",prop:"customer",label:"客戶",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-autocomplete",{staticStyle:{width:"70px"},attrs:{size:"small",name:"customer","fetch-suggestions":t.querySearch_customer},model:{value:r.customer,callback:function(e){t.$set(r,"customer",e)},expression:"row.customer"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.customer))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"issued",label:"更新日期",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-date-picker",{staticStyle:{width:"135px"},attrs:{"value-format":"yyyy-MM-dd",type:"date",name:"issued"},model:{value:r.issued,callback:function(e){t.$set(r,"issued",e)},expression:"row.issued"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.issued))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"KeyID",width:"100px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-input",{staticStyle:{width:"90px"},attrs:{type:"text",name:"sn"},model:{value:r.sn,callback:function(e){t.$set(r,"sn",e)},expression:"row.sn"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.sn))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"product",label:"產品"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-autocomplete",{attrs:{size:"small",name:"func_uid","fetch-suggestions":t.querySearch_func_uid},model:{value:r.product,callback:function(e){t.$set(r,"product",e)},expression:"row.product"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.product))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"product",label:"模組"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("span",[t._v(t._s(r.module))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"version",label:"版本",width:"100px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-input",{staticStyle:{width:"70px"},attrs:{type:"text",name:"version"},model:{value:r.version,callback:function(e){t.$set(r,"version",e)},expression:"row.version"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.version))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"type",label:"類型",width:"110px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-autocomplete",{staticStyle:{width:"80px"},attrs:{size:"small",name:"type","fetch-suggestions":t.querySearch_type},model:{value:r.type,callback:function(e){t.$set(r,"type",e)},expression:"row.type"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.type))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"count",label:"數量",width:"100px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-input",{staticStyle:{width:"50px"},attrs:{type:"text",name:"count"},model:{value:r.count,callback:function(e){t.$set(r,"count",e)},expression:"row.count"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.count))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"expiration",label:"到期日期",width:"160px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-date-picker",{staticStyle:{width:"135px"},attrs:{"value-format":"yyyy-MM-dd",type:"date",name:"expiration"},model:{value:r.expiration,callback:function(e){t.$set(r,"expiration",e)},expression:"row.expiration"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.expiration))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"region",label:"地區",width:"110px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-autocomplete",{staticStyle:{width:"80px"},attrs:{size:"small",name:"region","fetch-suggestions":t.querySearch_region},model:{value:r.region,callback:function(e){t.$set(r,"region",e)},expression:"row.region"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.region))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"comment",label:"備註"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-input",{staticStyle:{width:"110px"},attrs:{type:"text",name:"comment"},model:{value:r.comment,callback:function(e){t.$set(r,"comment",e)},expression:"row.comment"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.comment))])]}}],null,!0)}),a("el-table-column",{attrs:{align:"center",prop:"contact",label:"聯絡人",width:10*t.max_contact_length+30},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[t.showEdit[o]?a("el-input",{staticStyle:{width:"170px"},attrs:{type:"text",name:"contact"},model:{value:r.contact,callback:function(e){t.$set(r,"contact",e)},expression:"row.contact"}}):t._e(),t.showEdit[o]?t._e():a("span",[t._v(t._s(r.contact))])]}}],null,!0)})],1)],1),a("div",[a("el-button",{staticStyle:{position:"relative",top:"5px",width:"150px",height:"50px"},attrs:{round:"true",size:"medium"},on:{click:function(e){return t.dialog_cancel(r,o)}}},[t._v("取消")]),a("el-button",{staticStyle:{position:"relative",top:"5px",width:"150px",height:"50px"},attrs:{round:"true",size:"medium"},on:{click:function(e){return t.dialog_check(r,o)}}},[t._v("確認")])],1)])]}}])})],1)],1)]),a("div",{staticStyle:{position:"relative",top:"50px"}},[a("el-button",{staticStyle:{position:"fixed",width:"150px",height:"50px",left:"47%"},attrs:{round:"true"},on:{click:function(e){return t.submit()}}},[t._v("送出")])],1)]),a("el-tab-pane",{attrs:{label:"使用者申請",name:"使用者申請"}},[a("span",{staticStyle:{display:"flex"},attrs:{slot:"label"},slot:"label"},[t._v("\n      使用者申請\n      "),a("div",{staticClass:"num-badge"},[t._v(t._s(t.new_user_num))])]),a("el-table",{attrs:{data:t.new_user_tableData}},[a("el-table-column",{attrs:{prop:"user",label:"使用者",align:"center"}}),a("el-table-column",{attrs:{prop:"password",label:"密碼",align:"center"}}),a("el-table-column",{attrs:{prop:"email",label:"信箱",align:"center"}}),a("el-table-column",{attrs:{prop:"region",label:"地區",align:"center"}}),a("el-table-column",{attrs:{prop:"record",label:"確認申請資訊",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-button",{attrs:{type:"primary",icon:"el-icon-s-claim",size:"small",circle:""},on:{click:function(e){return t.confirm(r)}}}),a("el-dialog",{attrs:{title:"申請資訊",visible:t.new_user_dialog},on:{"update:visible":function(e){t.new_user_dialog=e}}},[a("el-form",{attrs:{model:t.form}},[a("el-form-item",{staticClass:"user-apply-form",attrs:{prop:"user",label:"使用者"}},[a("el-input",{staticStyle:{width:"32%",display:"table",left:"60px"},attrs:{placeholder:"請輸入使用者名稱"},model:{value:t.form.user,callback:function(e){t.$set(t.form,"user",e)},expression:"form.user"}})],1),a("el-form-item",{staticClass:"user-apply-form",attrs:{prop:"password",label:"密碼"}},[a("el-input",{staticStyle:{width:"32%",display:"table",left:"60px"},attrs:{placeholder:"請輸入密碼"},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}})],1),a("el-form-item",{staticClass:"user-apply-form",attrs:{prop:"email",label:"信箱"}},[a("el-input",{staticStyle:{width:"32%",display:"table",left:"60px"},attrs:{placeholder:"請輸入信箱"},model:{value:t.form.email,callback:function(e){t.$set(t.form,"email",e)},expression:"form.email"}})],1),a("el-form-item",{staticClass:"user-apply-form",attrs:{prop:"groups",label:"群組(可多選)"}},[a("el-select",{staticStyle:{width:"35%",display:"table",left:"60px"},attrs:{multiple:"",placeholder:"請輸入群組"},model:{value:t.form.groups,callback:function(e){t.$set(t.form,"groups",e)},expression:"form.groups"}},t._l(t.groups_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{staticClass:"user-apply-form",attrs:{prop:"region",label:"區域"}},[a("el-select",{staticStyle:{width:"35%",display:"table",left:"60px"},attrs:{placeholder:"請輸入區域"},model:{value:t.form.myregion,callback:function(e){t.$set(t.form,"myregion",e)},expression:"form.myregion"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{staticClass:"user-apply-form",attrs:{prop:"description",label:"描述(選填)"}},[a("el-input",{staticStyle:{width:"32%",display:"table",left:"60px"},attrs:{placeholder:"請輸入描述"},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1)],1),a("div",{staticStyle:{"margin-right":"215px"},attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"warning",plain:""},on:{click:t.deny}},[t._v("否決")]),a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.new_user_dialog=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.new_user_submit}},[t._v("確定")])],1)],1)]}}])})],1)],1),a("el-tab-pane",{attrs:{label:"審核紀錄",name:"審核紀錄"}},[a("div",{staticStyle:{width:"1280px",margin:"0 auto",top:"-33px",position:"relative"}},[a("div",{staticStyle:{position:"relative",top:"50px"},attrs:{align:"center"}},[a("el-table",{attrs:{data:t.history_app_Data,height:"650px"}},[a("el-table-column",{attrs:{type:"",align:"center",prop:"id",label:"申請編號",sortable:""}}),a("el-table-column",{attrs:{type:"",align:"center",prop:"",label:"清除紀錄"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[a("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete-solid",circle:""},nativeOn:{click:function(e){return t.clear_data(r)}}})]}}])}),a("el-table-column",{attrs:{type:"",align:"center",prop:"status",label:"審核狀態"}}),a("el-table-column",{attrs:{type:"",align:"center",prop:"applicant",label:"申請人"}}),a("el-table-column",{attrs:{type:"",align:"center",prop:"verify_time",label:"審核日期"}}),a("el-table-column",{attrs:{type:"",align:"center",prop:"",label:"重新審核"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.open_dialog_history(r,o)}}},[t._v("查看資料")])]}}])})],1)],1),a("el-dialog",{attrs:{width:"95%",title:"申請內容",visible:t.history_dialog},on:{"update:visible":function(e){t.history_dialog=e}}},[a("div",{staticStyle:{display:"flex","font-size":"18px"}},[a("div",{staticStyle:{width:"33%"}},[a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"40%","margin-right":"25px",bottom:"-3px",position:"relative"}},[t._v(" 申請人 :")]),a("div",{staticStyle:{"text-align":"start"}},[a("el-input",{staticClass:"input_no_border",staticStyle:{width:"150px"},attrs:{type:"textarea",autosize:{minRows:1,maxRows:1},name:"sender",readonly:""},model:{value:t.history_content["user"],callback:function(e){t.$set(t.history_content,"user",e)},expression:"history_content['user']"}})],1)]),a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"40%","margin-right":"25px",bottom:"-9px",position:"relative"}},[t._v(" 副本 :")]),a("div",{staticStyle:{"text-align":"start",width:"55%"}},[t._l(t.history_cc,(function(e,r){return[a("el-autocomplete",{attrs:{"fetch-suggestions":t.querySearch_cc,placeholder:"請輸入副本"},model:{value:t.history_cc[r],callback:function(e){t.$set(t.history_cc,r,e)},expression:"history_cc[index]"}}),a("el-button",{directives:[{name:"show",rawName:"v-show",value:0!=r,expression:"index != 0"}],attrs:{type:"text",icon:"el-icon-error"},on:{click:function(e){return t.history_remove_cc(r)}}})]})),a("el-button",{staticStyle:{"font-size":"15px"},attrs:{type:"text",icon:"el-icon-circle-plus"},on:{click:function(e){return t.history_add_cc()}}})],2)]),a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"40%","margin-right":"25px",bottom:"-9px",position:"relative"}},[t._v(" 附件下載 :")]),a("div",{staticStyle:{"text-align":"start"}},[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.download_check(t.row,t.$index)}}},[t._v("license-application.xlsx")])],1)]),a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"40%","margin-right":"25px",bottom:"2px",position:"relative"}},[t._v(" 申請內文 :")]),a("div",{staticStyle:{"text-align":"start"}},[a("el-input",{staticStyle:{width:"250px"},attrs:{type:"textarea",autosize:{minRows:4,maxRows:4},name:"sender",readonly:"",disabled:!0},model:{value:t.history_content["text"],callback:function(e){t.$set(t.history_content,"text",e)},expression:"history_content['text']"}})],1)])]),a("div",{staticStyle:{width:"33%"}},[a("div",{staticStyle:{display:"flex"}},[a("div",{staticStyle:{"text-align":"end",width:"20%","margin-right":"25px",bottom:"2px",position:"relative"}},[t._v(" 審核者回覆 :")]),a("div",{staticStyle:{"text-align":"start"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",autosize:{minRows:4,maxRows:4},name:"sender"},model:{value:t.history_content["reply"],callback:function(e){t.$set(t.history_content,"reply",e)},expression:"history_content['reply']"}})],1)])]),a("div",{staticStyle:{width:"33%",top:"-22px",position:"relative"}},[a("div",[t._v(" 申請紀錄統計(總共"+t._s(t.history_tableData.length)+"筆)")]),a("div",{staticStyle:{height:"180px",width:"auto",overflow:"auto",border:"1px solid #dcdfe6","border-radius":"4px",margin:"0px auto","text-align":"right"}},[a("p",{staticStyle:{"font-size":"20px",margin:"0px 50px"},domProps:{innerHTML:t._s(t.his_data_statistics_text)}})])])]),a("div",{staticStyle:{"text-align":"start"}},[a("el-button",{staticStyle:{"background-color":"#67C23A","border-color":"#67C23A",padding:"8px 11px",color:"#ffffff"},attrs:{icon:"el-icon-check"},on:{click:t.history_all_approve}}),a("el-button",{staticStyle:{"background-color":"#F56C6C","border-color":"#F56C6C",padding:"8px 11px",color:"#ffffff"},attrs:{icon:"el-icon-close"},on:{click:t.history_all_reject}}),a("el-button",{staticStyle:{"background-color":"#909399","border-color":"#909399",padding:"8px 11px",color:"#ffffff"},attrs:{icon:"el-icon-refresh-right"},on:{click:t.history_all_clear}})],1),a("el-table",{attrs:{data:t.history_tableData,height:"400px"}},[a("el-table-column",{attrs:{align:"center",width:"120px",prop:"customer",label:"審核"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[a("el-radio-group",{attrs:{fill:"√"==r["verify"]?"#67C23A":"#F56C6C",size:"mini"},model:{value:r["verify"],callback:function(e){t.$set(r,"verify",e)},expression:"row['verify']"}},[a("el-radio-button",{attrs:{label:"√"}}),a("el-radio-button",{attrs:{label:"×"}})],1)]}}])}),a("el-table-column",{attrs:{width:"100px",prop:"operator",label:"操作"}}),a("el-table-column",{attrs:{align:"center",width:"140px",prop:"customer",label:"客戶"}}),a("el-table-column",{attrs:{align:"center",width:"165px",prop:"issued",label:"更新日期"}}),a("el-table-column",{attrs:{align:"center",width:"120px",prop:"sn",label:"KeyID"}}),a("el-table-column",{attrs:{align:"center",width:"210px",prop:"product",label:"產品"}}),a("el-table-column",{attrs:{align:"center",width:"210px",prop:"module",label:"模組"}}),a("el-table-column",{attrs:{align:"center",width:"100px",prop:"version",label:"版本"}}),a("el-table-column",{attrs:{align:"center",width:"110px",prop:"type",label:"類型"}}),a("el-table-column",{attrs:{align:"center",width:"80px",prop:"count",label:"數量"}}),a("el-table-column",{attrs:{align:"center",width:"165px",prop:"expiration",label:"到期日期"}}),a("el-table-column",{attrs:{align:"center",width:"110px",prop:"region",label:"地區"}}),a("el-table-column",{attrs:{align:"center",width:"140px",prop:"comment",label:"備註"}}),a("el-table-column",{attrs:{align:"center",prop:"contact",label:"聯絡人",width:10*t.his_max_contact_length+30}})],1),a("div",[a("el-button",{staticStyle:{position:"relative",top:"5px",width:"150px",height:"50px"},attrs:{round:"true",size:"medium"},on:{click:function(e){t.history_dialog=!1}}},[t._v("取消")]),a("el-button",{staticStyle:{position:"relative",top:"5px",width:"150px",height:"50px"},attrs:{round:"true",size:"medium"},on:{click:t.history_dialog_check}},[t._v("重新送出")])],1)],1)],1)])],1)],1)},W=[];a("6c7b"),a("55dd");function G(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=Z(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function Z(t,e){if(t){if("string"===typeof t)return Y(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Y(t,e):void 0}}function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var Q={components:{Loading:I["a"]},name:"check",data:function(){return{isLoading:!1,origin_tableData:[],tableData:[],all_Data:[],app_Data:[],app_Data_num:0,dialogTableVisible:[],showEdit:[],nofilter_info_Data:[],compare_Data:[],compare_edit_Data:[],radio:[],content:{},user:[],customer_opt:[],region_opt:[],func_uid_opt:[],type_opt:[{label:"正式",value:"正式"},{label:"測試",value:"測試"},{label:"出貨",value:"出貨"},{label:"永久",value:"永久"}],cc:[""],cc_opt:[],check:[],region_data:[],new_user_tableData:[],new_user_num:0,group_data:[],groups_opt:[],form:{id:0,user:"",password:"",email:"",groups:[],region:"",myregion:"",record:"",description:"",admin_mail:"",inspector:""},new_user_dialog:!1,editableTabsValue:"",history_app_Data:[],history_tableData:[],history_content:{},history_cc:[],history_origin_tableData:[],history_dialog:!1,history_row:[],data_statistics_text:"",his_data_statistics_text:"",max_contact_length:0,his_max_contact_length:0,multi_expand_map:{},multi_delete_map:{}}},created:function(){var t=this;this.isLoading=!0,this.axios.get("/check/"+this.$route.params.verifyname,{headers:{"Content-Encoding":"gzip"}}).then((function(e){t.user=JSON.parse(sessionStorage.getItem("user")),t.all_data=JSON.parse(JSON.stringify(e.data)),t.app_Data=JSON.parse(JSON.stringify(e.data["application_data"])),t.history_app_Data=JSON.parse(JSON.stringify(e.data["history_application_data"]));var a,r=G(t.app_Data);try{for(r.s();!(a=r.n()).done;){a.value;t.check.push(!1)}}catch(Nt){r.e(Nt)}finally{r.f()}var o,i=new Map,n=G(t.all_data["module_data"]);try{for(n.s();!(o=n.n()).done;){var l=o.value;t.func_uid_opt.push({value:l["caption"],label:l["caption"]}),i.set(l["mod_uid"],l["caption"])}}catch(Nt){n.e(Nt)}finally{n.f()}t.region_data=JSON.parse(JSON.stringify(t.all_data["region_data"]));var s,c=G(t.all_data["region_data"]);try{for(c.s();!(s=c.n()).done;){var u=s.value;t.region_opt.push({value:u["name"],label:u["name"]})}}catch(Nt){c.e(Nt)}finally{c.f()}var p,d=new Set,_=G(t.all_data["sn_data"]);try{for(_.s();!(p=_.n()).done;){var f,h=p.value,m=G(h["user"].split(","));try{for(m.s();!(f=m.n()).done;){var g=f.value;d.add(g)}}catch(Nt){m.e(Nt)}finally{m.f()}}}catch(Nt){_.e(Nt)}finally{_.f()}var v,y=G(d);try{for(y.s();!(v=y.n()).done;){var b=v.value;t.cc_opt.push({value:b,label:b})}}catch(Nt){y.e(Nt)}finally{y.f()}var x,w=G(t.all_data["customer_data"]);try{for(w.s();!(x=w.n()).done;){var S=x.value;t.customer_opt.push({value:S["name"]+"|"+S["site"],label:S["name"]+"|"+S["site"]})}}catch(Nt){w.e(Nt)}finally{w.f()}var k,D=1,O=G(t.app_Data);try{for(O.s();!(k=O.n()).done;){var $=k.value;$=Object.assign($,{fake_id:D,verify_status:1,check:!1}),D++}}catch(Nt){O.e(Nt)}finally{O.f()}var N,C=G(t.app_Data);try{for(C.s();!(N=C.n()).done;){var I=N.value,J=0;I["data"]=JSON.parse(I["data"]),I["validator"]=JSON.parse(I["validator"]);var E,A=G(I["data"]);try{for(A.s();!(E=A.n()).done;){var z=E.value;void 0==z.verify&&void 0==z.reason&&(z=Object.assign(z,{verify:"",reason:null}),J=1),""==z.verify&&(J=1)}}catch(Nt){A.e(Nt)}finally{A.f()}1==J&&(I["verify_status"]=0),I["data"]=JSON.stringify(I["data"])}}catch(Nt){C.e(Nt)}finally{C.f()}for(D=0;D<t.app_Data.length;D++)t.dialogTableVisible.push(!1);var j,T=JSON.parse(JSON.stringify(t.all_data["info_data"])),M=(D=0,e.data["sn_dict"]),K=new Map,B=new Map,P=G(e.data["product_data"]);try{for(P.s();!(j=P.n()).done;){var L=j.value;K.set(L["product_name"],{category_id:L["category_id"],caption:L["caption"]})}}catch(Nt){P.e(Nt)}finally{P.f()}var q,F=G(e.data["option_data"]);try{for(F.s();!(q=F.n()).done;){var U=q.value;B.set(U["option_name"],{category_id:K.get(U["product_name"])["category_id"],product_name:U["product_name"],caption:U["caption"]})}}catch(Nt){F.e(Nt)}finally{F.f()}var R,V={},H=G(t.all_data["customer_data"]);try{for(H.s();!(R=H.n()).done;){var W=R.value;V[W["customer_id"]]={name:W["name"],site:W["site"]}}}catch(Nt){H.e(Nt)}finally{H.f()}var Z,Y={},Q=G(t.all_data["region_data"]);try{for(Q.s();!(Z=Q.n()).done;){var X=Z.value;Y[X["region_id"]]={name:X["name"],description:X["description"]}}}catch(Nt){Q.e(Nt)}finally{Q.f()}D=0;var tt,et=G(t.all_data["info_data"]);try{for(et.s();!(tt=et.n()).done;){var at=tt.value;if(void 0!=M[at["sn"]]){var rt=V[M[at["sn"]]["sn_id"]]["name"],ot=V[M[at["sn"]]["sn_id"]]["site"];T[D]=""!=ot?Object.assign(T[D],{customer:rt+"|"+ot,user:M[at["sn"]]["user"],info:[M[at["sn"]]["note1"],M[at["sn"]]["note2"],M[at["sn"]]["note3"],M[at["sn"]]["note4"],M[at["sn"]]["note5"]]}):Object.assign(T[D],{customer:rt,user:M[at["sn"]]["user"],info:[M[at["sn"]]["note1"],M[at["sn"]]["note2"],M[at["sn"]]["note3"],M[at["sn"]]["note4"],M[at["sn"]]["note5"]]}),isNaN(M[at["sn"]]["region"])?T[D]=Object.assign(T[D],{region:M[at["sn"]]["region"]}):""!=M[at["sn"]]["region"]?T[D]=Object.assign(T[D],{region:Y[parseInt(M[at["sn"]]["region"],10)]["name"]}):T[D]=Object.assign(T[D],{region:""})}void 0!=B.get(at["func_uid"])?(T[D]=Object.assign(T[D],{caption:B.get(at["func_uid"])["category_id"]}),T[D]["module"]=B.get(at["func_uid"])["caption"],T[D]["product"]=i.get(B.get(at["func_uid"])["product_name"])):void 0!=K.get(at["func_uid"])?(T[D]=Object.assign(T[D],{caption:K.get(at["func_uid"])["category_id"]}),T[D]["product"]=K.get(at["func_uid"])["caption"],T[D]["module"]=""):(T[D]=Object.assign(T[D],{caption:""}),T[D]["product"]="",T[D]["module"]=""),void 0!=i.get(at["type"])&&(T[D]["type"]=i.get(at["type"])),D++}}catch(Nt){et.e(Nt)}finally{et.f()}t.nofilter_info_Data=JSON.parse(JSON.stringify(T));var it,nt=G(t.nofilter_info_Data);try{for(nt.s();!(it=nt.n()).done;){var lt=it.value;if(lt["contact"].split(",").length>1){lt["contact"]=lt["contact"].split(",");for(var st=0;st<lt["contact"].length;st++){var ct,ut=G(t.all_data["user_data"]);try{for(ut.s();!(ct=ut.n()).done;){var pt=ct.value;lt["contact"][st]==pt["email"]&&(lt["contact"][st]=pt["user"])}}catch(Nt){ut.e(Nt)}finally{ut.f()}}lt["contact"]=lt["contact"].join()}}}catch(Nt){nt.e(Nt)}finally{nt.f()}t.app_Data_num=t.app_Data.length,t.group_data=JSON.parse(JSON.stringify(t.all_data["group_data"]));var dt,_t=G(t.group_data);try{for(_t.s();!(dt=_t.n()).done;){var ft=dt.value;t.groups_opt.push({value:ft.caption,label:ft.caption})}}catch(Nt){_t.e(Nt)}finally{_t.f()}var ht,mt=G(t.all_data["user_data"]);try{for(mt.s();!(ht=mt.n()).done;){var gt,vt=ht.value,yt=G(vt["groups"]);try{for(yt.s();!(gt=yt.n()).done;){var bt=gt.value;"1"==bt&&(t.form.admin_mail+="".concat(vt["email"],";"))}}catch(Nt){yt.e(Nt)}finally{yt.f()}}}catch(Nt){mt.e(Nt)}finally{mt.f()}var xt,wt=G(t.all_data["user_data"]);try{for(wt.s();!(xt=wt.n()).done;){var St=xt.value;if("to be confirmed"==St["description"]){var kt=JSON.parse(St["record"]);t.new_user_tableData.push({id:St["user_id"],user:kt["user"],password:kt["password"],email:kt["email"],region:kt["region"]}),t.new_user_num+=1}}}catch(Nt){wt.e(Nt)}finally{wt.f()}var Dt,Ot=G(t.history_app_Data);try{for(Ot.s();!(Dt=Ot.n()).done;){var $t=Dt.value;$t["verify_time"]=$t["verify_time"].replaceAll('"',"")}}catch(Nt){Ot.e(Nt)}finally{Ot.f()}t.history_app_Data.sort((function(t,e){return""==t.verify_time?new Date(e.verify_time)-new Date("0001-01-01"):""==e.verify_time?new Date("0001-01-01")-new Date(t.verify_time):new Date(e.verify_time)-new Date(t.verify_time)})),"new_user"==t.$route.query.checked_mode?t.editableTabsValue="使用者申請":t.editableTabsValue="待審核資料",t.isLoading=!1}))},methods:{click_checkbox:function(t,e){this.$set(this.app_Data[e],"check",t)},cc_location:function(t,e){if("input"==e){var a=80+45*t;return"width:200px;position:absolute;right:200px;top:"+String(a)+"px"}if("button"==e){a=63+45*t;return"color:#F56C6C;font-size:15px;position:absolute;right:192px;top:"+String(a)+"px"}},add_cc:function(){this.cc.push("")},history_add_cc:function(){this.history_cc.push("")},remove_cc:function(t){this.cc.splice(t,1)},history_remove_cc:function(t){this.history_cc.splice(t,1)},tranfer_xlsx:function(t){if(t){var e=window.URL.createObjectURL(new Blob([t])),a=document.createElement("a");a.style.display="none",a.href=e,a.setAttribute("download","verify-application.xlsx"),document.body.appendChild(a),a.click()}},download_check:function(t,e){var a=this;this.axios({method:"post",url:"/download_check",data:{data:t},responseType:"blob"}).then((function(t){a.tranfer_xlsx(t.data)}))},clear_data:function(t){var e=this;this.$confirm("是否要清除申請?(不可復原)","提示",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){e.axios.post("/del_application",{rowid:t["id"]}).then((function(){e.$message({message:"刪除成功",type:"success"}),location.reload()}))})).catch((function(){e.$message({message:"取消刪除",type:"info"})}))},submit:function(){var t,e=this,a=[],r=G(this.app_Data);try{for(r.s();!(t=r.n()).done;){var o=t.value;1==o["check"]&&a.push(o)}}catch(i){r.e(i)}finally{r.f()}0!=a.length?this.$confirm("是否確定送出審核?","提示",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){e.isLoading=!0,e.axios.post("/check_verify",{verify_Data:a,user:e.user,status:""}).then((function(t){e.isLoading=!1,e.$message({type:"success",message:"審核成功!"}),e.axios.get("/check/"+e.user[0],{headers:{"Content-Encoding":"gzip"}}).then((function(t){var a=JSON.parse(JSON.stringify(t.data["application_data"]));a.length?location.reload():e.$router.push({name:"Show_All"})}))}))})).catch((function(){e.$message({type:"info",message:"已取消送出審核"})})):this.$message({message:"尚未勾選已審核資料",type:"error"})},verify_change:function(t,e){if(this.$set(this.tableData[e],"verify",this.radio[e]),"×"==this.radio[e]){var a=prompt("請輸入審核原因：\n");t.reason=a}},dialog_check:function(t,e){for(var a=this,r=0;r<this.showEdit.length;r++)if(1==this.showEdit[r])return void this.$message({message:"請先將確認修改資料√",type:"error"});this.app_Data[e]["verify_status"]=1,this.app_Data[e]["check"]=!0,this.$set(this.check,e,!0);var o,i=G(this.tableData);try{for(i.s();!(o=i.n()).done;){var n=o.value;""==n.verify&&(this.app_Data[e]["verify_status"]=0,this.app_Data[e]["check"]=!1,this.$set(this.check,e,!1))}}catch(l){i.e(l)}finally{i.f()}t["data"]=JSON.stringify(this.complete_tableData()),this.content["cc"]=this.cc.join(),t["content"]=JSON.stringify(this.content),this.$set(this.dialogTableVisible,e,!1),this.axios.post("/dialog_check",{check_data:this.app_Data[e],user:this.user}).then((function(t){a.$confirm("","提示",{confirmButtonText:"寄出審核結果",cancelButtonText:"返回審核主頁",showClose:!1,type:"warning",center:!0}).then((function(){a.isLoading=!0,a.axios.post("/check_verify",{verify_Data:[t.data],user:a.user,status:""}).then((function(t){a.isLoading=!1,a.$message({type:"success",message:"審核成功!"}),a.axios.get("/check/"+a.user[0],{headers:{"Content-Encoding":"gzip"}}).then((function(t){var e=JSON.parse(JSON.stringify(t.data["application_data"]));e.length?location.reload():a.$router.push({name:"Show_All"})}))}))})).catch((function(){location.reload()}))}))},history_dialog_check:function(){var t,e=this,a=G(this.history_tableData);try{for(a.s();!(t=a.n()).done;){var r=t.value;if("×"!=r["verify"]&&"√"!=r["verify"])return void this.$confirm("請先確認所有審核按鈕","提示",{showClose:!1,type:"warning",center:!0})}}catch(o){a.e(o)}finally{a.f()}this.history_row["data"]=JSON.stringify(this.history_tableData),this.history_content["cc"]=this.history_cc.join(),this.history_row["content"]=JSON.stringify(this.history_content),this.history_row["validator"]=JSON.parse(this.history_row["validator"]),this.axios.post("/dialog_check",{check_data:this.history_row,user:this.user}).then((function(t){e.isLoading=!0,e.axios.post("/check_verify",{verify_Data:[t.data],user:e.user,status:"resend"}).then((function(t){e.isLoading=!1,e.$message({type:"success",message:"審核成功!"}),location.reload()}))})).catch((function(){}))},open_dialog:function(t,e){var a=JSON.parse(t["data"]);this.content=JSON.parse(t["content"]),this.cc=this.content["cc"].split(","),this.showEdit.length=0,this.radio.length=0,this.max_contact_length=0;var r={};this.data_statistics_text="";var o,i=G(a);try{for(i.s();!(o=i.n()).done;){var n=o.value;void 0==r[n["customer"]]&&(r[n["customer"]]={id_list:[],data_num:0,add_num:0,mod_num:0,del_num:0}),r[n["customer"]]["data_num"]+=1,r[n["customer"]]["id_list"].includes(n["sn"])||r[n["customer"]]["id_list"].push(n["sn"]),"新增"==n["operator"]&&(r[n["customer"]]["add_num"]+=1),"修改"==n["operator"]&&(r[n["customer"]]["mod_num"]+=1),"刪除"==n["operator"]&&(r[n["customer"]]["del_num"]+=1)}}catch(A){i.e(A)}finally{i.f()}for(var l in r){var s=r[l]["id_list"].length,c=r[l]["data_num"],u=r[l]["add_num"],p=r[l]["mod_num"],d=r[l]["del_num"];this.data_statistics_text+="".concat(l," 申請 ").concat(s,"筆id, 共 ").concat(c,"筆資料(新增: ").concat(u,", 修改: ").concat(p,", 刪除 ").concat(d,") <br>")}var _,f=[],h=[],m=G(a);try{for(m.s();!(_=m.n()).done;){var g=_.value;"multiple_expand"==g.operation_type?f.push(g):"multiple_delete"==g.operation_type?h.push(g):this.tableData.push(g)}}catch(A){m.e(A)}finally{m.f()}for(var v={},y=0,b=f;y<b.length;y++){var x=b[y];x["sn"]in v?v[x["sn"]].push(x):v[x["sn"]]=[x]}for(var w={},S=0,k=h;S<k.length;S++){var D=k[S];D["sn"]in w?w[D["sn"]].push(D):w[D["sn"]]=[D]}for(var O in v)this.tableData.push({operator:"多筆展延",customer:v[O][0].customer,sn:v[O][0].sn,count:v[O].length,user:v[O][0].user,contact:v[O][0].contact,verify:"",reason:""});for(var $ in w)this.tableData.push({operator:"多筆刪除",customer:w[$][0].customer,sn:w[$][0].sn,count:w[$].length,user:w[$][0].user,contact:w[$][0].contact,verify:"",reason:""});this.multi_expand_map=v,this.multi_delete_map=w,this.origin_tableData=JSON.parse(JSON.stringify(this.tableData));for(var N=0;N<this.tableData.length;N++)this.showEdit.push(!1),this.radio.push("");var C,I=0,J=G(this.tableData);try{for(J.s();!(C=J.n()).done;){var E=C.value;this.radio[I]=E.verify,I++,E["contact"].length>this.max_contact_length&&(this.max_contact_length=E["contact"].length)}}catch(A){J.e(A)}finally{J.f()}this.dialogTableVisible[e]=!0},open_dialog_history:function(t,e){this.his_max_contact_length=0,this.history_tableData=JSON.parse(t["data"]),this.history_content=JSON.parse(t["content"]),this.history_cc=this.history_content["cc"].split(","),this.history_origin_tableData=JSON.parse(JSON.stringify(this.history_tableData)),this.history_row=t;var a={};this.his_data_statistics_text="";var r,o=G(this.history_tableData);try{for(o.s();!(r=o.n()).done;){var i=r.value;void 0==a[i["customer"]]&&(a[i["customer"]]={id_list:[],data_num:0,add_num:0,mod_num:0,del_num:0}),a[i["customer"]]["data_num"]+=1,a[i["customer"]]["id_list"].includes(i["sn"])||a[i["customer"]]["id_list"].push(i["sn"]),"新增"==i["operator"]&&(a[i["customer"]]["add_num"]+=1),"修改"==i["operator"]&&(a[i["customer"]]["mod_num"]+=1),"刪除"==i["operator"]&&(a[i["customer"]]["del_num"]+=1),i["contact"].length>this.his_max_contact_length&&(this.his_max_contact_length=i["contact"].length)}}catch(d){o.e(d)}finally{o.f()}for(var n in a){var l=a[n]["id_list"].length,s=a[n]["data_num"],c=a[n]["add_num"],u=a[n]["mod_num"],p=a[n]["del_num"];this.his_data_statistics_text+="".concat(n," 申請 ").concat(l,"筆id, 共 ").concat(s,"筆資料(新增: ").concat(c,", 修改: ").concat(u,", 刪除 ").concat(p,") <br>")}this.history_dialog=!0},dialog_cancel:function(t,e){this.$set(this.dialogTableVisible,e,!1),this.cc=[""]},handleEdit:function(t,e){this.$set(this.showEdit,t,!0)},handleCheck:function(t,e){var a,r=0,o=G(this.nofilter_info_Data);try{for(o.s();!(a=o.n()).done;){var i=a.value;if((this.tableData[t]["sn"]!=this.origin_tableData[t]["sn"]||this.tableData[t]["type"]!=this.origin_tableData[t]["type"]||this.tableData[t]["func_uid"]!=this.origin_tableData[t]["func_uid"])&&this.tableData[t]["sn"]==i["sn"]&&this.tableData[t]["type"]==i["type"]&&this.tableData[t]["func_uid"]==i["func_uid"]){var n="修改資料\nKeyID:"+this.tableData[t]["sn"]+"\n類型:"+this.tableData[t]["type"]+"\n產品名稱:"+this.tableData[t]["func_uid"]+"\n已有重複資料";this.$notify.error({title:"修改通知",message:n,duration:0}),this.tableData[t]=JSON.parse(JSON.stringify(this.origin_tableData[t])),this.$set(this.showEdit,t,!1),r=1}}}catch(l){o.e(l)}finally{o.f()}0==r&&(this.origin_tableData[t]=this.tableData[t],this.$set(this.showEdit,t,!1))},handelRestore:function(t,e){this.tableData[t]=JSON.parse(JSON.stringify(this.origin_tableData[t])),this.$set(this.showEdit,t,!1)},compare_row:function(t,e){var a,r=G(this.nofilter_info_Data);try{for(r.s();!(a=r.n()).done;){var o=a.value;JSON.stringify(o["info_id"])==JSON.stringify(t["info_id"])&&(this.$set(this.compare_Data,0,o),this.$set(this.compare_edit_Data,0,t))}}catch(i){r.e(i)}finally{r.f()}},cell_color:function(t){var e=t.row,a=t.column;t.rowIndex,t.columnIndex;return"客戶"==a.label&&e.customer!=this.compare_edit_Data[0].customer||"更新日期"==a.label&&e.issued!=this.compare_edit_Data[0].issued||"KeyID"==a.label&&e.sn!=this.compare_edit_Data[0].sn||"產品名稱"==a.label&&e.func_uid!=this.compare_edit_Data[0].func_uid||"版本"==a.label&&e.version!=this.compare_edit_Data[0].version||"類型"==a.label&&e.type!=this.compare_edit_Data[0].type||"數量"==a.label&&e.count!=this.compare_edit_Data[0].count||"到期日期"==a.label&&e.expiration!=this.compare_edit_Data[0].expiration||"地區"==a.label&&e.region!=this.compare_edit_Data[0].region||"備註"==a.label&&e.comment!=this.compare_edit_Data[0].comment||"聯絡人"==a.label&&e.contact!=this.compare_edit_Data[0].contact?"warning-row":void 0},querySearch_customer:function(t,e){var a=t?this.customer_opt.filter(this.createFilter(t)):this.customer_opt;e(a)},querySearch_func_uid:function(t,e){var a=t?this.func_uid_opt.filter(this.createFilter(t)):this.func_uid_opt;e(a)},querySearch_type:function(t,e){var a=t?this.type_opt.filter(this.createFilter(t)):this.type_opt;e(a)},querySearch_region:function(t,e){var a=t?this.region_opt.filter(this.createFilter(t)):this.region_opt;e(a)},querySearch_cc:function(t,e){var a=t?this.cc_opt.filter(this.createFilter(t)):this.cc_opt;0==a.length&&(a.push({value:t+"@eastek.com.cn",label:t+"@eastek.com.cn"}),a.push({value:t+"@eastek.com.tw",label:t+"@eastek.com.tw"})),e(a)},createFilter:function(t){return function(e){return 0===e.value.toLowerCase().indexOf(t.toLowerCase())}},label_for_validator:function(t,e){e.column;return t("span",["審核條件",t("br"),"(",t("span",{style:"color:black;background-color: #ffb7b7"},["紅色"]),"為缺少條件，",t("span",{style:"color:black;background-color:#67C23A"},["綠色"]),"為已滿足條件)"])},disabled_checkbox:function(t){return 0==t.verify_status||(-1==t.validator["verify_check"]["verify_group"].indexOf(!0)||t.validator["verify_check"]["verify_num"]<t.validator["verify_num"])},all_approve:function(){for(var t in this.radio.fill("√"),this.tableData.forEach((function(t){return t["verify"]="√"})),this.tableData)this.$refs["radio-".concat(t)].value="√",this.$refs["radio-".concat(t)].fill="#67C23A"},history_all_approve:function(){this.history_tableData.forEach((function(t){return t["verify"]="√"}))},all_reject:function(){var t=prompt("請輸入審核原因：\n");for(var e in this.radio.fill("×"),this.tableData.forEach((function(e){e["verify"]="×",e["reason"]=t})),this.tableData)this.$refs["radio-".concat(e)].value="×",this.$refs["radio-".concat(e)].fill="#F56C6C"},history_all_reject:function(){var t=prompt("請輸入審核原因：\n");this.history_tableData.forEach((function(e){e["verify"]="×",e["reason"]=t}))},all_clear:function(){for(var t in this.radio.fill(""),this.tableData.forEach((function(t){t["verify"]="",t["reason"]=""})),this.tableData)this.$refs["radio-".concat(t)].value="",this.$refs["radio-".concat(t)].fill="#fff"},history_all_clear:function(){this.history_tableData.forEach((function(t){t["verify"]="",t["reason"]=""}))},confirm:function(t){this.new_user_dialog=!0,this.form.id=t["id"],this.form.user=t["user"],this.form.password=t["password"],this.form.email=t["email"],this.form.region=t["region"],this.form.myregion=t["region"]},new_user_submit:function(){var t=this;if(this.form.inspector=this.user,""!=this.form.user&&""!=this.form.password&&""!=this.form.email)if(void 0!=this.form.email.split("@")[1]){if(this.form.groups=JSON.stringify(this.form.groups).replace('["',"").replace('"]',"").replace(/","/g,","),this.form.record="","[]"!=this.form.groups){this.form.groups=this.form.groups.split(",");for(var e=0;e<this.form.groups.length;e++){var a,r=G(this.group_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;this.form.groups[e]==o["caption"]&&(this.form.groups[e]=o["group_id"])}}catch(s){r.e(s)}finally{r.f()}}this.form.groups=JSON.stringify(this.form.groups)}else this.form.groups="";if(""!=this.form.myregion){var i,n=G(this.region_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;this.form.myregion==l["name"]&&(this.form.region=l["region_id"])}}catch(s){n.e(s)}finally{n.f()}this.form.region="["+JSON.stringify(this.form.region)+"]"}else this.form.region="";this.axios.post("/operator_user",{params:{form:JSON.stringify(this.form),operator:"edit"}}).then((function(e){t.axios.post("/send_signup_success_email",{origin_data:t.form}).then((function(e){"郵件傳送成功!"==e.data?(t.$message({type:"success",message:"已傳送帳號確認通知!"}),location.reload()):t.$message({type:"success",message:"帳號申請失敗!"})}))}))}else this.$message({message:"請填入正確email格式",type:"error"});else this.$message({message:"請填入群組名稱及群組類別及信箱",type:"error"})},deny:function(){var t=this;this.$confirm("否決此帳號申請?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.axios.get("/operator_user",{params:{user_name:JSON.stringify(t.form.user),operator:"delete"}}).then((function(t){location.reload()}))})).catch((function(){t.$message({type:"info",message:"已取消"})}))},complete_tableData:function(){var t,e=[],a=G(this.tableData);try{for(a.s();!(t=a.n()).done;){var r=t.value;if(console.log(this.multi_expand_map[r["sn"]]),"多筆延展"==r["operator"]){var o,i=G(this.multi_expand_map[r["sn"]]);try{for(i.s();!(o=i.n()).done;){var n=o.value;n=Object.assign(n,{verify:r["verify"],reason:r["reason"]}),e.push(n)}}catch(u){i.e(u)}finally{i.f()}}else if("多筆刪除"==r["operator"]){console.log(this.multi_delete_map[r["sn"]]);var l,s=G(this.multi_delete_map[r["sn"]]);try{for(s.s();!(l=s.n()).done;){var c=l.value;c=Object.assign(c,{verify:r["verify"],reason:r["reason"]}),e.push(c)}}catch(u){s.e(u)}finally{s.f()}}else e.push(r)}}catch(u){a.e(u)}finally{a.f()}return e}}},X=Q,tt=(a("12c6"),a("7d69"),Object(s["a"])(X,H,W,!1,null,"631516cc",null)),et=tt.exports,at=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticStyle:{"margin-top":"-50px"}},[r("img",{attrs:{src:a("3d5b")}}),r("br"),r("div",{staticClass:"title"},[t._v("Welcome to License Application Service")]),r("br"),r("el-card",{staticStyle:{margin:"0 auto",width:"500px"}},[r("div",{staticStyle:{margin:"0 auto",width:"400px","font-size":"20px"}},[r("br"),r("br"),r("div",{staticClass:"title"},[t._v("Log in to your account")]),r("br"),r("br"),r("div",{staticClass:"caption"},[t._v("Account")]),r("el-input",{staticClass:"input",attrs:{placeholder:"請輸入帳號(使用者名稱)"},model:{value:t.user[0],callback:function(e){t.$set(t.user,0,e)},expression:"user[0]"}}),r("br"),r("br"),r("div",{staticClass:"caption"},[t._v("Password")]),r("el-input",{staticClass:"input",attrs:{placeholder:"請輸入密碼","show-password":""},model:{value:t.user[1],callback:function(e){t.$set(t.user,1,e)},expression:"user[1]"}}),r("br"),r("br"),r("br"),r("el-button",{staticClass:"button",attrs:{plain:""},on:{click:t.login}},[t._v("Log in")]),r("br"),r("br"),r("button",{staticClass:"src",on:{click:t.signup}},[t._v(" Sign Up ")]),r("br"),t._v("\n          or"),r("br"),r("button",{staticClass:"src",on:{click:t.resetPassword}},[t._v("Forget Password")]),r("br")],1)])],1)},rt=[],ot={name:"login",data:function(){return{user:["","","",""]}},created:function(){this.$router.replace({query:""}).catch((function(){}))},mounted:function(){var t=this;document.onkeydown=function(e){if("login"==t.$route.name){var a=window.event.keyCode;13==a&&t.login()}}},methods:{login:function(){var t=this;this.axios.get("/login",{params:{user:JSON.stringify(this.user),mode:"login"}}).then((function(e){var a=e.data;"登入成功!"==a.msg?(t.user[2]=a.email,t.$message({message:a.msg,type:"success"}),sessionStorage.setItem("token","ImLogin"),sessionStorage.setItem("user",JSON.stringify(t.user)),sessionStorage.setItem("authority",JSON.stringify(a.authority)),sessionStorage.setItem("first_time_login","yes"),t.$router.push({name:"Show_All"})):(a.msg,t.$message({message:a.msg,type:"error"}))}))},signup:function(){this.$router.push({name:"signup"})},resetPassword:function(){this.$router.push({name:"resetPassword"})}}},it=ot,nt=(a("9ce0"),Object(s["a"])(it,at,rt,!1,null,null,null)),lt=nt.exports,st=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("Aside"),a("el-main",[a("div",{staticStyle:{display:"flex","margin-bottom":"20px",height:"265px"}},[a("div",{staticClass:"apply_num_box shadow_box"},[a("div",{staticStyle:{margin:"55px 20px","font-weight":"700","font-size":"20px"}},[t._v(t._s(t.this_month)+"月申請次數")]),a("div",{staticStyle:{"font-size":"30px"}},[t._v(t._s(t.apply_num))])]),a("div",{staticClass:"verifying_box"},[a("div",{staticStyle:{margin:"10px","font-weight":"700","font-size":"20px"}},[t._v("審核中資料")]),a("el-table",{staticClass:"shadow_box",attrs:{data:t.verifying_data,height:"200px"}},[a("el-table-column",{attrs:{type:"expand"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("el-table",{attrs:{data:t.row.data}},[a("el-table-column",{attrs:{prop:"operator",label:"操作"}}),a("el-table-column",{attrs:{prop:"customer",label:"客戶"}}),a("el-table-column",{attrs:{prop:"sn",label:"KeyID"}}),a("el-table-column",{attrs:{prop:"product",label:"產品"}}),a("el-table-column",{attrs:{prop:"module",label:"模組"}}),a("el-table-column",{attrs:{prop:"version",label:"版本"}}),a("el-table-column",{attrs:{prop:"type",label:"類型"}}),a("el-table-column",{attrs:{prop:"count",label:"數量"}}),a("el-table-column",{attrs:{prop:"expiration",label:"到期日期"}}),a("el-table-column",{attrs:{prop:"region",label:"地區"}}),a("el-table-column",{attrs:{prop:"comment",label:"備註"}}),a("el-table-column",{attrs:{prop:"contact",label:"聯絡人","show-overflow-tooltip":""}})],1)]}}])}),a("el-table-column",{attrs:{label:"申請ID",prop:"id"}}),a("el-table-column",{attrs:{label:"申請日期",prop:"date"}}),a("el-table-column",{attrs:{label:"申請人",prop:"applicant"}}),a("el-table-column",{attrs:{label:"狀態",prop:"status"}}),a("el-table-column",{attrs:{label:"驗證時間",prop:"verify_time"}})],1)],1)]),a("div",{staticClass:"expire_box"},[a("div",{staticStyle:{height:"40px"}},[a("span",{staticStyle:{"font-weight":"700","font-size":"20px",top:"7px",position:"relative"}},[t._v("即將過期的資料(聯絡人、負責人)")])]),a("el-table",{staticClass:"shadow_box",attrs:{data:t.expiring_data,height:"219px"}},[a("el-table-column",{attrs:{prop:"customer",label:"客戶"}}),a("el-table-column",{attrs:{prop:"sn",label:"KeyID"}}),a("el-table-column",{attrs:{prop:"product",label:"產品"}}),a("el-table-column",{attrs:{prop:"module",label:"模組"}}),a("el-table-column",{attrs:{prop:"version",label:"版本"}}),a("el-table-column",{attrs:{prop:"type",label:"類型"}}),a("el-table-column",{attrs:{prop:"count",label:"數量"}}),a("el-table-column",{attrs:{prop:"expiration",label:"到期日期"}}),a("el-table-column",{attrs:{prop:"region",label:"地區"}}),a("el-table-column",{attrs:{prop:"comment",label:"備註"}}),a("el-table-column",{attrs:{prop:"contact",label:"聯絡人","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"user",label:"負責人","show-overflow-tooltip":""}})],1)],1),a("div",{staticClass:"applied_box"},[a("div",{staticStyle:{height:"40px"}},[a("span",{staticStyle:{"font-weight":"700","font-size":"20px",position:"relative",top:"6px"}},[t._v("申請過的資料")])]),a("el-table",{staticClass:"shadow_box",attrs:{data:t.vaild_applied_data,height:"219px"}},[a("el-table-column",{attrs:{type:"expand"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("el-table",{attrs:{data:t.row.data}},[a("el-table-column",{attrs:{prop:"operator",label:"操作"}}),a("el-table-column",{attrs:{prop:"customer",label:"客戶"}}),a("el-table-column",{attrs:{prop:"sn",label:"KeyID"}}),a("el-table-column",{attrs:{prop:"product",label:"產品"}}),a("el-table-column",{attrs:{prop:"module",label:"模組"}}),a("el-table-column",{attrs:{prop:"version",label:"版本"}}),a("el-table-column",{attrs:{prop:"type",label:"類型"}}),a("el-table-column",{attrs:{prop:"count",label:"數量"}}),a("el-table-column",{attrs:{prop:"expiration",label:"到期日期"}}),a("el-table-column",{attrs:{prop:"region",label:"地區"}}),a("el-table-column",{attrs:{prop:"comment",label:"備註"}}),a("el-table-column",{attrs:{prop:"contact",label:"聯絡人","show-overflow-tooltip":""}})],1)]}}])}),a("el-table-column",{attrs:{label:"申請ID",prop:"id"}}),a("el-table-column",{attrs:{label:"申請日期",prop:"date"},scopedSlots:t._u([{key:"header",fn:function(e){return[a("el-popover",{ref:"popover",attrs:{title:"到期日",placement:"bottom",width:"350",trigger:"click"}},[a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",size:"mini",type:"daterange","range-separator":"-","start-placeholder":"開始日期","end-placeholder":"結束日期"},on:{change:t.expiration_filter},model:{value:t.expiration_value,callback:function(e){t.expiration_value=e},expression:"expiration_value"}}),a("el-button",{attrs:{slot:"reference",icon:"el-icon-search",circle:"",size:"mini"},on:{click:function(t){t.stopPropagation()}},slot:"reference"})],1),t._v("\n              申請日期\n              "),"7"==t.expiration_mode?a("el-button",{staticClass:"expiration_7",attrs:{circle:"",size:"mini"},on:{click:function(e){return e.stopPropagation(),t.expiration_filter_7(e)}}},[t._v("7")]):a("el-button",{staticStyle:{width:"30px"},attrs:{circle:"",size:"mini"},on:{click:function(e){return e.stopPropagation(),t.expiration_filter_7(e)}}},[t._v("7")]),a("el-button",{attrs:{circle:"",size:"mini"},on:{click:function(e){return e.stopPropagation(),t.expiration_filter_all(e)}}},[t._v("All")])]}}])}),a("el-table-column",{attrs:{label:"申請人",prop:"applicant"}}),a("el-table-column",{attrs:{label:"狀態",prop:"status"}}),a("el-table-column",{attrs:{label:"驗證時間",prop:"verify_time"}})],1)],1)])],1)],1)},ct=[],ut=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("el-aside",{attrs:{width:"210px",height:"700px"}},[a("el-menu",{staticClass:"el-menu-vertical-demo",attrs:{"default-active":t.$route.path,router:!0},on:{select:t.route}},[a("el-menu-item",{attrs:{index:"Show_All",align:"left"}},[a("i",{staticClass:"el-icon-back"}),a("span",{attrs:{slot:"title"},slot:"title"},[t._v("退回主畫面")])]),a("el-menu-item",{attrs:{align:"left",index:"admin"}},[a("i",{staticClass:"el-icon-menu"}),a("span",{attrs:{slot:"title"},slot:"title"},[t._v("後台首頁")])]),a("el-menu-item",{attrs:{index:"password",align:"left"}},[a("i",{staticClass:"el-icon-key"}),a("span",{attrs:{slot:"title"},slot:"title"},[t._v("更改密碼")])]),a("el-submenu",{directives:[{name:"show",rawName:"v-show",value:t.user_deter,expression:"user_deter"}],attrs:{index:"2",align:"left"}},[a("template",{slot:"title"},[a("i",{staticClass:"el-icon-user"}),a("span",{attrs:{slot:"title"},slot:"title"},[t._v("使用者")])]),a("el-menu-item-group",[a("el-menu-item",{attrs:{align:"left",index:"user"}},[t._v("使用者")]),a("el-menu-item",{attrs:{align:"left",index:"group"}},[t._v("群組")])],1)],2),a("el-submenu",{directives:[{name:"show",rawName:"v-show",value:t.product_deter,expression:"product_deter"}],attrs:{index:"3",align:"left"}},[a("template",{slot:"title"},[a("i",{staticClass:"el-icon-box"}),a("span",{attrs:{slot:"title"},slot:"title"},[t._v("產品")])]),a("el-menu-item",{attrs:{index:"product",align:"left"}},[t._v("產品")]),a("el-menu-item",{attrs:{index:"option",align:"left"}},[t._v("選項")]),a("el-menu-item",{attrs:{index:"product_group",align:"left"}},[t._v("產品群組")])],2),a("el-menu-item",{directives:[{name:"show",rawName:"v-show",value:t.region_deter,expression:"region_deter"}],attrs:{index:"region",align:"left"}},[a("i",{staticClass:"el-icon-map-location"}),a("span",{attrs:{slot:"title"},slot:"title"},[t._v("業務地區")])]),a("el-menu-item",{attrs:{index:"login",align:"left"}},[a("i",{staticClass:"el-icon-switch-button",staticStyle:{color:"#F56C6C"}}),a("span",{staticStyle:{color:"#F56C6C"},attrs:{slot:"title"},slot:"title"},[t._v("登出")])])],1)],1),a("el-link",{staticStyle:{position:"absolute",right:"80px",top:"32px"},attrs:{type:"success",icon:"el-icon-s-custom"}},[t._v(t._s(t.user[0]))])],1)],1)},pt=[];function dt(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=_t(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function _t(t,e){if(t){if("string"===typeof t)return ft(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?ft(t,e):void 0}}function ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var ht={data:function(){return{user:[],user_id:"",user_deter:!1,product_deter:!1,region_deter:!1}},created:function(){var t=this;this.user=JSON.parse(sessionStorage.getItem("user")),this.axios.get("/admin_user",{}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.user_data=JSON.parse(JSON.stringify(t.all_Data["user_data"]));var a,r=dt(t.user_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;o.user==t.user[0]&&(t.user_id=o.user_id)}}catch(_){r.e(_)}finally{r.f()}var i,n=new Set,l=dt(t.all_Data["group_data"]);try{for(l.s();!(i=l.n()).done;){var s=i.value;if(-1!=s.members.indexOf(String(t.user_id))&&""!=s.authority&&void 0!=JSON.parse(s.authority)["operator"]&&JSON.parse(s.authority)["operator"]!=[]){var c,u=dt(JSON.parse(s.authority)["operator"]);try{for(u.s();!(c=u.n()).done;){var p=c.value;n.add(p)}}catch(_){u.e(_)}finally{u.f()}}}}catch(_){l.e(_)}finally{l.f()}var d=[];n.has("使用者權限")&&(t.user_deter=!0,d.push("使用者權限")),n.has("產品權限")&&(t.product_deter=!0,d.push("產品權限")),n.has("區域權限")&&(t.region_deter=!0,d.push("區域權限")),n.has("下載權限")&&d.push("下載權限"),sessionStorage.setItem("authority",JSON.stringify(d))}))},methods:{route:function(t,e){"login"==t&&sessionStorage.clear()}}},mt=ht,gt=(a("2568"),Object(s["a"])(mt,ut,pt,!1,null,null,null)),vt=gt.exports;function yt(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=bt(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function bt(t,e){if(t){if("string"===typeof t)return xt(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?xt(t,e):void 0}}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var wt={components:{Aside:vt},data:function(){return{all_Data:[],user_data:[],user:[],this_month:1,apply_num:0,verifying_data:[],expiring_data:[],applied_data:[],default_applied_data:[],vaild_applied_data:[],expiration_value:[],expiration_mode:7}},created:function(){var t=this;this.axios.get("/admin_user",{params:{user:JSON.stringify(JSON.parse(sessionStorage.getItem("user")))}}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data));JSON.parse(JSON.stringify(t.all_Data["option_dict"])),JSON.parse(JSON.stringify(t.all_Data["product_dict"]));t.expiring_data=JSON.parse(JSON.stringify(t.all_Data["expiring_data"])),t.user=JSON.parse(sessionStorage.getItem("user"));var a=JSON.parse(JSON.stringify(t.all_Data["application_data"])),r=a.filter((function(e){return e["applicant"]==t.user[0]})),o=new Date;t.this_month=o.getMonth()+1;var i,n=yt(r);try{for(n.s();!(i=n.n()).done;){var l=i.value,s=l["date"].split("-")[0],c=l["date"].split("-")[1];"0"==c[0]&&(c=c[1]),s==o.getFullYear()&&c==o.getMonth()+1&&(t.apply_num+=1);var u,p=JSON.parse(l["data"]),d=yt(p);try{for(d.s();!(u=d.n()).done;){var _=u.value;void 0==_["product"]&&(_["product"]=_["func_uid"])}}catch(y){d.e(y)}finally{d.f()}l["verify_time"].length>0&&(l["verify_time"]=JSON.parse(l["verify_time"])),l["status"].includes("wait_for_verification")&&(l["verify_time"]=""),l["status"].includes("wait")&&t.verifying_data.push({id:l["id"],date:l["date"],applicant:l["applicant"],status:l["status"],verify_time:l["verify_time"],data:p}),t.applied_data.push({id:l["id"],date:l["date"],applicant:l["applicant"],status:l["status"],verify_time:l["verify_time"],data:p})}}catch(y){n.e(y)}finally{n.f()}var f,h=yt(t.applied_data);try{for(h.s();!(f=h.n()).done;){var m=f.value,g=new Date(m["date"]),v=(o=new Date,parseInt(Math.abs(g-o)/1e3/60/60/24));v<=7&&t.default_applied_data.push(m)}}catch(y){h.e(y)}finally{h.f()}t.vaild_applied_data=JSON.parse(JSON.stringify(t.default_applied_data))}))},methods:{expiration_filter:function(t){if(null==t)this.vaild_applied_data=this.default_applied_data,this.expiration_mode="7";else{var e=new Date(t[0]),a=new Date(t[1]);this.vaild_applied_data=[];var r,o=yt(this.applied_data);try{for(o.s();!(r=o.n()).done;){var i=r.value,n=new Date(i["date"].slice(0,10));(n.toDateString()==e.toDateString()&&n.toDateString()==a.toDateString()||n>=e&&n<=a)&&this.vaild_applied_data.push(i)}}catch(l){o.e(l)}finally{o.f()}this.expiration_mode=""}},expiration_filter_7:function(){this.vaild_applied_data=this.default_applied_data,this.expiration_value=[],this.expiration_mode="7"},expiration_filter_all:function(){this.vaild_applied_data=this.applied_data,this.expiration_value=[],this.expiration_mode="all"}}},St=wt,kt=(a("2795"),Object(s["a"])(St,st,ct,!1,null,null,null)),Dt=kt.exports,Ot=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("Aside"),a("el-container",[a("el-main",[a("div",{attrs:{align:"left"}},[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",plain:""},on:{click:function(e){t.form.id=0,t.form.user="",t.form.password="",t.form.email="",t.form.groups=[],t.form.region="",t.form.record="",t.form.description="",t.add_lock=!0}}},[t._v("新增")]),a("el-dialog",{attrs:{title:"使用者表單-新增",visible:t.add_lock},on:{"update:visible":function(e){t.add_lock=e}}},[a("el-form",{attrs:{model:t.form,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"user",label:"使用者",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入使用者名稱"},model:{value:t.form.user,callback:function(e){t.$set(t.form,"user",e)},expression:"form.user"}})],1),a("el-form-item",{attrs:{prop:"password",label:"密碼",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入密碼"},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}})],1),a("el-form-item",{attrs:{prop:"email",label:"信箱",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入信箱"},model:{value:t.form.email,callback:function(e){t.$set(t.form,"email",e)},expression:"form.email"}})],1),a("el-form-item",{attrs:{prop:"groups",label:"群組"}},[a("el-select",{attrs:{width:"400px",multiple:"",placeholder:"請輸入群組"},model:{value:t.form.groups,callback:function(e){t.$set(t.form,"groups",e)},expression:"form.groups"}},t._l(t.groups_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"region",label:"區域"}},[a("el-select",{attrs:{width:"400px",placeholder:"請輸入區域"},model:{value:t.form.region,callback:function(e){t.$set(t.form,"region",e)},expression:"form.region"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"description",label:"描述"}},[a("el-input",{staticStyle:{width:"600px"},attrs:{placeholder:"請輸入描述"},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.add_lock=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.add_user}},[t._v("確定")])],1)],1)],1),a("el-table",{attrs:{data:t.tableData}},[a("el-table-column",{attrs:{prop:"user",label:"使用者",width:"100"}}),a("el-table-column",{attrs:{prop:"password",label:"密碼",width:"100"}}),a("el-table-column",{attrs:{prop:"email",label:"信箱",width:"200"}}),a("el-table-column",{attrs:{prop:"groups",label:"群組",fit:""}}),a("el-table-column",{attrs:{prop:"region",label:"地區",width:"150"}}),a("el-table-column",{attrs:{prop:"description",label:"描述",width:"100"}}),a("el-table-column",{attrs:{prop:"description",label:"操作",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-button",{attrs:{type:"primary",icon:"el-icon-edit",size:"small",circle:""},on:{click:function(e){return t.edit_assign(r.user)}}}),a("el-dialog",{attrs:{title:"使用者表單-修改",visible:t.edit_lock},on:{"update:visible":function(e){t.edit_lock=e}}},[a("el-form",{attrs:{model:t.form,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"user",label:"使用者",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入使用者名稱"},model:{value:t.form.user,callback:function(e){t.$set(t.form,"user",e)},expression:"form.user"}})],1),a("el-form-item",{attrs:{prop:"password",label:"密碼",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入密碼"},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}})],1),a("el-form-item",{attrs:{prop:"email",label:"信箱",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入信箱"},model:{value:t.form.email,callback:function(e){t.$set(t.form,"email",e)},expression:"form.email"}})],1),a("el-form-item",{attrs:{prop:"groups",label:"群組"}},[a("el-select",{attrs:{width:"400px",multiple:"",placeholder:"請輸入群組"},model:{value:t.form.groups,callback:function(e){t.$set(t.form,"groups",e)},expression:"form.groups"}},t._l(t.groups_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"region",label:"區域"}},[a("el-select",{attrs:{width:"400px",placeholder:"請輸入區域"},model:{value:t.form.region,callback:function(e){t.$set(t.form,"region",e)},expression:"form.region"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"description",label:"描述"}},[a("el-input",{staticStyle:{width:"600px"},attrs:{placeholder:"請輸入描述"},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.edit_lock=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.edit_user}},[t._v("確定")])],1)],1),a("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"small",circle:""},on:{click:function(e){return t.delete_user(r.user)}}})]}}])})],1)],1)],1)],1)],1)},$t=[];function Nt(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=Ct(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function Ct(t,e){if(t){if("string"===typeof t)return It(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?It(t,e):void 0}}function It(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var Jt={components:{Aside:vt},data:function(){return{tableData:[],all_Data:[],user_data:[],group_data:[],groups_opt:[],region_opt:[],form:{id:0,user:"",password:"",email:"",groups:[],region:"",description:""},add_lock:!1,edit_lock:!1}},created:function(){var t=this;this.axios.get("/admin_user",{}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.user_data=JSON.parse(JSON.stringify(t.all_Data["user_data"])),t.group_data=JSON.parse(JSON.stringify(t.all_Data["group_data"])),t.region_data=JSON.parse(JSON.stringify(t.all_Data["region_data"])),t.tableData=JSON.parse(JSON.stringify(t.user_data));var a,r=JSON.parse(sessionStorage.getItem("user")),o=0,i=Nt(t.user_data);try{for(i.s();!(a=i.n()).done;){var n=a.value;n.user==r[0]&&(o=n.user_id)}}catch(I){i.e(I)}finally{i.f()}var l,s=new Set,c=Nt(t.all_Data["group_data"]);try{for(c.s();!(l=c.n()).done;){var u=l.value;if(-1!=u.members.indexOf(String(o))&&""!=u.authority&&void 0!=JSON.parse(u.authority)["operator"]&&JSON.parse(u.authority)["operator"]!=[]){var p,d=Nt(JSON.parse(u.authority)["operator"]);try{for(d.s();!(p=d.n()).done;){var _=p.value;s.add(_)}}catch(I){d.e(I)}finally{d.f()}}}}catch(I){c.e(I)}finally{c.f()}s.has("使用者權限")||t.$router.push({name:"admin"});var f,h=Nt(t.region_data);try{for(h.s();!(f=h.n()).done;){var m=f.value;t.region_opt.push({value:m.name,label:m.name})}}catch(I){h.e(I)}finally{h.f()}var g,v=Nt(t.group_data);try{for(v.s();!(g=v.n()).done;){var y=g.value;t.groups_opt.push({value:y.caption,label:y.caption})}}catch(I){v.e(I)}finally{v.f()}var b,x=Nt(t.tableData);try{for(x.s();!(b=x.n()).done;){var w=b.value;w["region"]=w["region"].replace("[","").replace("]","").split(",");for(var S=0;S<w["region"].length;S++)if(""!=w["region"][S]){var k,D=Nt(t.region_data);try{for(D.s();!(k=D.n()).done;){var O=k.value;O["region_id"]==parseInt(w["region"][S])&&(w["region"][S]=O["name"])}}catch(I){D.e(I)}finally{D.f()}}w["region"]=JSON.stringify(w["region"]),w["region"]=w["region"].replace('["',"").replace('"]',"").replace(/","/g,","),w["groups"]=w["groups"].replace("[","").replace("]","").split(",");for(S=0;S<w["groups"].length;S++)if(""!=w["groups"][S]){var $,N=Nt(t.group_data);try{for(N.s();!($=N.n()).done;){var C=$.value;C["group_id"]==parseInt(w["groups"][S])&&(w["groups"][S]=C["caption"])}}catch(I){N.e(I)}finally{N.f()}}w["groups"]=JSON.stringify(w["groups"]),w["groups"]=w["groups"].replace('["',"").replace('"]',"").replace(/","/g,",")}}catch(I){x.e(I)}finally{x.f()}}))},methods:{edit_assign:function(t){var e,a=Nt(this.tableData);try{for(a.s();!(e=a.n()).done;){var r=e.value;t==r["user"]&&(this.form.id=r["user_id"],this.form.user=r["user"],this.form.password=r["password"],this.form.email=r["email"],this.form.groups=r["groups"],this.form.region=r["region"],this.form.record=r["record"],this.form.description=r["description"],""!=this.form.groups&&(this.form.groups=JSON.parse(('["'+r["groups"]+'"]').replace(/,/g,'","'))))}}catch(o){a.e(o)}finally{a.f()}this.edit_lock=!0},add_user:function(){var t=this;if(""!=this.form.user&&""!=this.form.password&&""!=this.form.email)if(void 0!=this.form.email.split("@")[1]){var e,a=Nt(this.tableData);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(this.form.user==r["user"])return void this.$message({message:"使用者 "+this.form.user+" 重複",type:"error"})}}catch(p){a.e(p)}finally{a.f()}if(this.form.groups=JSON.stringify(this.form.groups).replace('["',"").replace('"]',"").replace(/","/g,","),"[]"!=this.form.groups){this.form.groups=this.form.groups.split(",");for(var o=0;o<this.form.groups.length;o++){var i,n=Nt(this.group_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;this.form.groups[o]==l["caption"]&&(this.form.groups[o]=l["group_id"])}}catch(p){n.e(p)}finally{n.f()}}this.form.groups=JSON.stringify(this.form.groups)}else this.form.groups="";if(""!=this.form.region){var s,c=Nt(this.region_data);try{for(c.s();!(s=c.n()).done;){var u=s.value;this.form.region==u["name"]&&(this.form.region=u["region_id"])}}catch(p){c.e(p)}finally{c.f()}this.form.region="["+JSON.stringify(this.form.region)+"]"}else this.form.region="";this.axios.get("/operator_user",{params:{form:JSON.stringify(this.form),operator:"add"}}).then((function(e){t.add_lock=!1,t.form.id=0,t.form.user="",t.form.password="",t.form.email="",t.form.groups=[],t.form.region="",t.form.record="",t.form.description="",location.reload()}))}else this.$message({message:"請填入正確email格式",type:"error"});else this.$message({message:"請填入群組名稱及群組類別及信箱",type:"error"})},edit_user:function(){var t=this;if(""!=this.form.user&&""!=this.form.password&&""!=this.form.email)if(void 0!=this.form.email.split("@")[1]){if(this.form.groups=JSON.stringify(this.form.groups).replace('["',"").replace('"]',"").replace(/","/g,","),"[]"!=this.form.groups){this.form.groups=this.form.groups.split(",");for(var e=0;e<this.form.groups.length;e++){var a,r=Nt(this.group_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;this.form.groups[e]==o["caption"]&&(this.form.groups[e]=o["group_id"])}}catch(s){r.e(s)}finally{r.f()}}this.form.groups=JSON.stringify(this.form.groups)}else this.form.groups="";if(""!=this.form.region){var i,n=Nt(this.region_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;this.form.region==l["name"]&&(this.form.region=l["region_id"])}}catch(s){n.e(s)}finally{n.f()}this.form.region="["+JSON.stringify(this.form.region)+"]"}else this.form.region="";console.log(this.form),this.axios.post("/operator_user",{params:{form:JSON.stringify(this.form),operator:"edit"}}).then((function(e){t.add_lock=!1,t.form.id=0,t.form.user="",t.form.password="",t.form.email="",t.form.groups=[],t.form.region="",t.form.record="",t.form.description="",location.reload()}))}else this.$message({message:"請填入正確email格式",type:"error"});else this.$message({message:"請填入使用者名稱及密碼及信箱",type:"error"})},delete_user:function(t){var e=this;this.$confirm("是否刪除「 "+t+" 」?","刪除",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){e.axios.get("/operator_user",{params:{user_name:JSON.stringify(t),operator:"delete"}}).then((function(t){location.reload()})),e.$message({type:"success",message:"删除成功!"})})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))}}},Et=Jt,At=Object(s["a"])(Et,Ot,$t,!1,null,null,null),zt=At.exports,jt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("Aside"),a("el-container",[a("el-main",[a("div",{attrs:{align:"left"}},[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",plain:""},on:{click:function(e){t.form.id=0,t.form.name="",t.form.caption="",t.form.authority="",t.form.description="",t.form.members="",t.form.members_arr=[],t.form.region_authority=[],t.form.product_authority=[],t.add_lock=!0}}},[t._v("新增")]),a("el-dialog",{attrs:{title:"群組表單-新增",visible:t.add_lock},on:{"update:visible":function(e){t.add_lock=e}}},[a("el-form",{attrs:{model:t.form,"label-width":"120px"}},[a("el-form-item",{attrs:{prop:"name",label:"群組名稱",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入群組名稱"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),a("el-form-item",{attrs:{prop:"caption",label:"群組類別",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入群組類別"},model:{value:t.form.caption,callback:function(e){t.$set(t.form,"caption",e)},expression:"form.caption"}})],1),a("el-form-item",{attrs:{prop:"region_authority",label:"區域權限"}},[a("el-select",{attrs:{width:"200px",multiple:"",placeholder:"請輸入區域權限"},model:{value:t.form.region_authority,callback:function(e){t.$set(t.form,"region_authority",e)},expression:"form.region_authority"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"product_authority",label:"產品權限"}},[a("el-select",{attrs:{width:"200px",multiple:"",placeholder:"請輸入產品權限"},model:{value:t.form.product_authority,callback:function(e){t.$set(t.form,"product_authority",e)},expression:"form.product_authority"}},t._l(t.product_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"operator_authority",label:"功能權限"}},[a("el-select",{attrs:{width:"200px",multiple:"",placeholder:"請輸入功能權限"},model:{value:t.form.operator_authority,callback:function(e){t.$set(t.form,"operator_authority",e)},expression:"form.operator_authority"}},t._l(t.operator_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"description",label:"描述"}},[a("el-input",{attrs:{width:"200px",placeholder:"請輸入描述"},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1),a("el-form-item",{attrs:{prop:"members",label:"成員"}},[a("el-select",{attrs:{width:"400px",multiple:"",placeholder:"請輸入成員"},model:{value:t.form.members_arr,callback:function(e){t.$set(t.form,"members_arr",e)},expression:"form.members_arr"}},t._l(t.user_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.add_lock=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.add_group}},[t._v("確定")])],1)],1)],1),a("el-table",{attrs:{data:t.tableData}},[a("el-table-column",{attrs:{align:"center",prop:"name",label:"id",width:"200"}}),a("el-table-column",{attrs:{align:"center",prop:"caption",label:"群組名稱",width:"100"}}),a("el-table-column",{attrs:{align:"center",prop:"authority",label:"權限",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,o=e.$index;return[a("el-popover",{ref:"popover",attrs:{placement:"bottom-start",title:"權限",trigger:"hover",placement:"top"}},[a("span",{staticStyle:{"font-size":"15px",color:"black"}},[t._v("區域權限:")]),a("span",[t._v(t._s(t.region_authority)),a("br")]),a("span",{staticStyle:{"font-size":"15px",color:"black"}},[t._v("產品權限:")]),a("span",[t._v(t._s(t.product_authority)),a("br")]),a("span",{staticStyle:{"font-size":"15px",color:"black"}},[t._v("功能權限:")]),a("span",[t._v(t._s(t.operator_authority)),a("br")]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:""!=r.authority,expression:"row.authority != ''"}],attrs:{slot:"reference",type:"info",icon:"el-icon-s-check",circle:""},nativeOn:{mouseenter:function(e){return t.authority_all(r,o)}},slot:"reference"})],1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"members",label:"成員",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-popover",{ref:"popover1",attrs:{placement:"top-start",title:"成員",trigger:"hover",placement:"top"}},[a("span",[t._v(t._s(r.members))]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:""!=r.members,expression:"row.members != ''"}],attrs:{slot:"reference",type:"info",icon:"el-icon-s-custom",circle:""},slot:"reference"})],1)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"description",label:"描述",width:"200"}}),a("el-table-column",{attrs:{align:"center",prop:"description",label:"操作",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-button",{attrs:{type:"primary",icon:"el-icon-edit",size:"small",circle:""},on:{click:function(e){return t.edit_assign(r.name)}}}),a("el-dialog",{attrs:{align:"left",title:"群組表單-修改",visible:t.edit_lock},on:{"update:visible":function(e){t.edit_lock=e}}},[a("el-form",{attrs:{model:t.form,"label-width":"120px"}},[a("el-form-item",{attrs:{prop:"name",label:"群組名稱(必填)",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入群組名稱"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),a("el-form-item",{attrs:{prop:"caption",label:"群組類別(必填)",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入群組類別"},model:{value:t.form.caption,callback:function(e){t.$set(t.form,"caption",e)},expression:"form.caption"}})],1),a("el-form-item",{attrs:{prop:"region_authority",label:"區域權限"}},[a("el-select",{attrs:{width:"200px",multiple:"",placeholder:"請輸入區域權限"},model:{value:t.form.region_authority,callback:function(e){t.$set(t.form,"region_authority",e)},expression:"form.region_authority"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"product_authority",label:"產品權限"}},[a("el-select",{attrs:{width:"200px",multiple:"",placeholder:"請輸入產品權限"},model:{value:t.form.product_authority,callback:function(e){t.$set(t.form,"product_authority",e)},expression:"form.product_authority"}},t._l(t.product_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"operator_authority",label:"功能權限"}},[a("el-select",{attrs:{width:"200px",multiple:"",placeholder:"請輸入功能權限"},model:{value:t.form.operator_authority,callback:function(e){t.$set(t.form,"operator_authority",e)},expression:"form.operator_authority"}},t._l(t.operator_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"description",label:"描述"}},[a("el-input",{attrs:{width:"200px",placeholder:"請輸入描述"},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1),a("el-form-item",{attrs:{prop:"members",label:"成員(可複選)"}},[a("el-select",{attrs:{width:"400px",multiple:"",placeholder:"請輸入"},model:{value:t.form.members_arr,callback:function(e){t.$set(t.form,"members_arr",e)},expression:"form.members_arr"}},t._l(t.user_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.edit_lock=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.edit_group}},[t._v("確定")])],1)],1),a("el-button",{attrs:{type:"danger",icon:"el-icon-delete",circle:"",size:"small"},on:{click:function(e){return t.delete_group(r.name)}}})]}}])})],1)],1)],1)],1)],1)},Tt=[];function Mt(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=Kt(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function Kt(t,e){if(t){if("string"===typeof t)return Bt(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Bt(t,e):void 0}}function Bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var Pt,Lt={components:{Aside:vt},data:function(){return{tableData:[],all_Data:[],user_data:[],group_data:[],region_authority:"",product_authority:"",operator_authority:"",add_lock:!1,edit_lock:!1,form:{id:0,name:"",caption:"",authority:"",region_authority:[],product_authority:[],operator_authority:[],description:"",members:"",members_arr:[]},user_opt:[],region_opt:[],product_opt:[],operator_opt:[{value:"下載權限",label:"下載權限"},{value:"使用者權限",label:"使用者權限"},{value:"產品權限",label:"產品權限"},{value:"區域權限",label:"區域權限"}]}},created:function(){var t=this;this.axios.get("/admin_user",{}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.user_data=JSON.parse(JSON.stringify(t.all_Data["user_data"])),t.group_data=JSON.parse(JSON.stringify(t.all_Data["group_data"])),t.region_data=JSON.parse(JSON.stringify(t.all_Data["region_data"])),t.product_data=JSON.parse(JSON.stringify(t.all_Data["product_data"])),t.tableData=JSON.parse(JSON.stringify(t.group_data));var a,r=JSON.parse(sessionStorage.getItem("user")),o=0,i=Mt(t.user_data);try{for(i.s();!(a=i.n()).done;){var n=a.value;n.user==r[0]&&(o=n.user_id)}}catch(z){i.e(z)}finally{i.f()}var l=new Set;console.log(t.all_Data["group_data"]);var s,c=Mt(t.all_Data["group_data"]);try{for(c.s();!(s=c.n()).done;){var u=s.value;if(-1!=u.members.indexOf(String(o))&&""!=u.authority&&void 0!=JSON.parse(u.authority)["operator"]&&JSON.parse(u.authority)["operator"]!=[]){var p,d=Mt(JSON.parse(u.authority)["operator"]);try{for(d.s();!(p=d.n()).done;){var _=p.value;l.add(_)}}catch(z){d.e(z)}finally{d.f()}}}}catch(z){c.e(z)}finally{c.f()}l.has("使用者權限")||t.$router.push({name:"admin"});var f,h=Mt(t.user_data);try{for(h.s();!(f=h.n()).done;){var m=f.value;t.user_opt.push({value:m.user,label:m.user})}}catch(z){h.e(z)}finally{h.f()}var g,v=Mt(t.region_data);try{for(v.s();!(g=v.n()).done;){var y=g.value;t.region_opt.push({value:y.name,label:y.name})}}catch(z){v.e(z)}finally{v.f()}var b,x=new Set,w=Mt(t.product_data);try{for(w.s();!(b=w.n()).done;){var S=b.value;x.add(S.category_id)}}catch(z){w.e(z)}finally{w.f()}var k,D=Mt(x);try{for(D.s();!(k=D.n()).done;){var O=k.value;t.product_opt.push({value:O,label:O})}}catch(z){D.e(z)}finally{D.f()}var $,N=Mt(t.tableData);try{for(N.s();!($=N.n()).done;){var C=$.value;C["members"]=C["members"].replace("[","").replace("]","").split(",");for(var I=0;I<C["members"].length;I++)if(""!=C["members"][I]){var J,E=Mt(t.user_data);try{for(E.s();!(J=E.n()).done;){var A=J.value;parseInt(C["members"][I])==A["user_id"]&&(C["members"][I]=A["user"])}}catch(z){E.e(z)}finally{E.f()}}C["members"]=JSON.stringify(C["members"]),C["members"]=C["members"].replace('["',"").replace('"]',"").replace(/","/g,",")}}catch(z){N.e(z)}finally{N.f()}}))},methods:{authority_all:function(t,e){this.region_authority="",this.product_authority="",this.operator_authority="";var a,r=Mt(JSON.parse(t.authority)["region"]);try{for(r.s();!(a=r.n()).done;){var o,i=a.value,n=Mt(this.region_data);try{for(n.s();!(o=n.n()).done;){var l=o.value;i==l["region_id"]&&(this.region_authority+=l["name"]+",")}}catch(f){n.e(f)}finally{n.f()}}}catch(f){r.e(f)}finally{r.f()}var s,c=Mt(JSON.parse(t.authority)["product"]);try{for(c.s();!(s=c.n()).done;){var u=s.value;this.product_authority+=u+","}}catch(f){c.e(f)}finally{c.f()}var p,d=Mt(JSON.parse(t.authority)["operator"]);try{for(d.s();!(p=d.n()).done;){var _=p.value;this.operator_authority+=_+","}}catch(f){d.e(f)}finally{d.f()}this.region_authority=this.region_authority.slice(0,this.region_authority.length-1),this.product_authority=this.product_authority.slice(0,this.product_authority.length-1),this.operator_authority=this.operator_authority.slice(0,this.operator_authority.length-1)},add_group:function(){var t=this;if(""!=this.form.name&&""!=this.form.caption){var e,a=Mt(this.tableData);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(this.form.name==r["name"])return void this.$message({message:"群組名稱 "+this.form.name+" 重複",type:"error"});if(this.form.name==r["name"])return void this.$message({message:"群組類別 "+this.form.caption+" 重複",type:"error"})}}catch(p){a.e(p)}finally{a.f()}if(0!=this.form.region_authority.length||0!=this.form.product_authority.length||this.form.operator_authority.length){this.form.authority='{"region":'+JSON.stringify(this.form.region_authority)+',"product":'+JSON.stringify(this.form.product_authority)+',"operator":'+JSON.stringify(this.form.operator_authority)+"}",this.form.authority=JSON.parse(this.form.authority);for(var o=0;o<this.form.authority["region"].length;o++){var i,n=Mt(this.region_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;this.form.authority["region"][o]==l["name"]&&(this.form.authority["region"][o]=l["region_id"])}}catch(p){n.e(p)}finally{n.f()}}this.form.authority=JSON.stringify(this.form.authority)}else this.form.authority="";if(this.form.members=JSON.stringify(this.form.members_arr).replace('["',"").replace('"]',"").replace(/","/g,","),"[]"!=this.form.members){this.form.members=this.form.members.split(",");for(o=0;o<this.form.members.length;o++){var s,c=Mt(this.user_data);try{for(c.s();!(s=c.n()).done;){var u=s.value;this.form.members[o]==u["user"]&&(this.form.members[o]=u["user_id"])}}catch(p){c.e(p)}finally{c.f()}}this.form.members=JSON.stringify(this.form.members)}else this.form.members="";this.axios.get("/operator_group",{params:{form:JSON.stringify(this.form),operator:"add"}}).then((function(e){t.add_lock=!1,t.form.name="",t.form.caption="",t.form.authority="",t.form.region_authority=[],t.form.product_authority=[],t.form.operator_authority=[],t.form.description="",t.form.members="",t.form.members_arr="",location.reload()}))}else this.$message({message:"請填入群組名稱及群組類別",type:"error"})},edit_assign:function(t){var e,a=Mt(this.tableData);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(t==r["name"]){if(console.log(r),this.form.id=r["group_id"],this.form.name=r["name"],this.form.caption=r["caption"],this.form.authority=r["authority"],""!=r["authority"]){this.form.region_authority=JSON.parse(r["authority"])["region"];for(var o=0;o<this.form.region_authority.length;o++){var i,n=Mt(this.region_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;this.form.region_authority[o]==l["region_id"]&&(this.form.region_authority[o]=l["name"])}}catch(s){n.e(s)}finally{n.f()}}this.form.product_authority=JSON.parse(r["authority"])["product"],this.form.operator_authority=JSON.parse(r["authority"])["operator"]}else this.form.region_authority=[],this.form.product_authority=[],this.form.operator_authority=[];this.form.description=r["description"],this.form.members=r["members"],""!=r["members"]?this.form.members_arr=JSON.parse(('["'+r["members"]+'"]').replace(/,/g,'","')):this.form.members_arr=[]}}}catch(s){a.e(s)}finally{a.f()}this.edit_lock=!0},edit_group:function(){var t=this;if(""!=this.form.name&&""!=this.form.caption){if(0!=this.form.region_authority.length||0!=this.form.product_authority.length){this.form.authority='{"region":'+JSON.stringify(this.form.region_authority)+',"product":'+JSON.stringify(this.form.product_authority)+',"operator":'+JSON.stringify(this.form.operator_authority)+"}",this.form.authority=JSON.parse(this.form.authority);for(var e=0;e<this.form.authority["region"].length;e++){var a,r=Mt(this.region_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;this.form.authority["region"][e]==o["name"]&&(this.form.authority["region"][e]=o["region_id"])}}catch(s){r.e(s)}finally{r.f()}}this.form.authority=JSON.stringify(this.form.authority)}else this.form.authority="";if(this.form.members=JSON.stringify(this.form.members_arr).replace('["',"").replace('"]',"").replace(/","/g,","),"[]"!=this.form.members){this.form.members=this.form.members.split(",");for(e=0;e<this.form.members.length;e++){var i,n=Mt(this.user_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;this.form.members[e]==l["user"]&&(this.form.members[e]=l["user_id"])}}catch(s){n.e(s)}finally{n.f()}}this.form.members=JSON.stringify(this.form.members)}else this.form.members="";this.axios.get("/operator_group",{params:{form:JSON.stringify(this.form),operator:"edit"}}).then((function(e){t.add_lock=!1,t.form.id=0,t.form.name="",t.form.caption="",t.form.authority="",t.form.prodcut_authority=[],t.form.region_authority=[],t.form.operator_authority=[],t.form.description="",t.form.members="",t.form.members_arr=[],location.reload()}))}else this.$message({message:"請填入群組名稱及群組類別",type:"error"})},delete_group:function(t){var e=this;this.$confirm("是否刪除「 "+t+" 」群組?","刪除",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){e.axios.get("/operator_group",{params:{group_name:JSON.stringify(t),operator:"delete"}}).then((function(t){location.reload()})),e.$message({type:"success",message:"删除成功!"})})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))}}},qt=Lt,Ft=Object(s["a"])(qt,jt,Tt,!1,null,null,null),Ut=Ft.exports,Rt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("Aside"),a("el-container",[a("el-main",[a("div",{staticStyle:{position:"relative",right:"500px"}},[a("div",[t._v("帳號:"),a("el-input",{staticStyle:{width:"200px"},attrs:{disabled:""},model:{value:t.user[0],callback:function(e){t.$set(t.user,0,e)},expression:"user[0]"}})],1),a("div",[t._v("密碼:"),a("el-input",{staticStyle:{width:"200px"},attrs:{disabled:!t.edit_lock},model:{value:t.user[1],callback:function(e){t.$set(t.user,1,e)},expression:"user[1]"}})],1),a("div",[a("el-button",{directives:[{name:"show",rawName:"v-show",value:0==t.edit_lock,expression:"edit_lock == false"}],attrs:{type:"primary",plain:""},on:{click:function(e){t.edit_lock=!0}}},[t._v("更改密碼")])],1),a("div",{staticStyle:{position:"relative",left:"20px"}},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:1==t.edit_lock,expression:"edit_lock == true"}],attrs:{type:"primary",plain:""},on:{click:function(e){t.edit_lock=!1}}},[t._v("取消")]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1==t.edit_lock,expression:"edit_lock == true"}],attrs:{type:"primary",plain:""},on:{click:t.check}},[t._v("確認")])],1)])])],1)],1)],1)},Vt=[],Ht={components:{Aside:vt},data:function(){return{user:[],edit_lock:!1}},created:function(){this.user=JSON.parse(sessionStorage.getItem("user"))},methods:{check:function(){var t=this;""!=this.user[1]?this.axios.get("/edit_password",{params:{user:JSON.stringify(this.user)}}).then((function(e){sessionStorage.setItem("user",JSON.stringify(t.user)),t.edit_lock=!1,t.$message({message:"密碼修改成功",type:"success"})})):this.$message({message:"密碼不得為空",type:"error"})}}},Wt=Ht,Gt=(a("cafe"),Object(s["a"])(Wt,Rt,Vt,!1,null,null,null)),Zt=Gt.exports,Yt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",[a("el-header",{staticClass:"header"},[a("div",{staticStyle:{position:"absolute",left:"30px",top:"3px",cursor:"pointer"},on:{click:t.reload}},[t._v(" License Application Service")]),a("div",[a("el-button-group",{staticClass:"mode-switch"},[a("el-button",{staticStyle:{background:"#ebd1a0",color:"white","border-color":"#e6a23c"},attrs:{type:"warning"},on:{click:function(e){return t.mode_switch("product")}}},[t._v("產品")]),a("el-button",{attrs:{type:"warning"},on:{click:function(e){return t.mode_switch("KeyID")}}},[t._v("SN")])],1)],1),a("el-popover",{attrs:{trigger:"hover",width:"200",placement:"bottom","close-delay":t.delay_time}},[a("div",[a("span",[t._v("成員名稱: "+t._s(t.user[0]))])]),a("div",[a("span",[t._v("-----------------------------------------")])]),a("div",[a("span",[t._v("單頁筆數:"),a("span",[a("el-select",{staticStyle:{width:"100px"},attrs:{size:"small"},on:{change:t.pagesize_change,"visible-change":t.select_change},model:{value:t.pagesize_display,callback:function(e){t.pagesize_display=e},expression:"pagesize_display"}},[a("el-option",{key:"10",attrs:{label:"10",value:"10"}}),a("el-option",{key:"50",attrs:{label:"50",value:"50"}}),a("el-option",{key:"all",attrs:{label:"all",value:"all"}})],1)],1)])]),a("div",[a("el-button",{attrs:{type:"primary",icon:"el-icon-setting"},on:{click:function(e){return t.$router.push({name:"admin",query:{}})}}},[t._v("後台管理")])],1),a("div",[a("el-button",{staticStyle:{background:"#F56C6C",color:"#FFFFFF",width:"117px"},attrs:{icon:"el-icon-switch-button"},on:{click:t.Logout}},[t._v("登出")])],1),a("el-button",{staticClass:"memeber_button",attrs:{slot:"reference",icon:"el-icon-s-custom"},slot:"reference"})],1)],1),a("div",{staticStyle:{position:"relative",top:"-30px","font-size":"20px"},attrs:{align:"right"}},[a("span",{staticStyle:{"background-color":"#ffb7b7"}},[t._v("紅色")]),t._v("代表過期、\n      "),a("span",{staticStyle:{"background-color":"#FFFF30"}},[t._v("黃色")]),t._v("代表一個月內過期\n      "),a("span",{staticStyle:{"margin-left":"60px"}},[t._v("Last update: "+t._s(t.update_time))])])],1),a("el-button",{directives:[{name:"show",rawName:"v-show",value:t.search_drawer_btn,expression:"search_drawer_btn"}],staticStyle:{position:"fixed",top:"80px",left:"-20px",padding:"15px","font-size":"20px"},attrs:{type:"warning",icon:"el-icon-search",circle:""},on:{click:t.drawer_open}}),a("el-drawer",{staticClass:"search-drawer",attrs:{title:"",visible:t.search_drawer,direction:"ltr",size:"340","show-close":!1,"modal-append-to-body":!1,modal:!1,"with-header":!1},on:{"update:visible":function(e){t.search_drawer=e},closed:function(e){t.search_drawer_btn=!0}}},[a("div",{staticClass:"search-box"},[a("div",{staticStyle:{left:"40px",bottom:"-10px",position:"relative"}},[a("el-button",{attrs:{type:"warning",icon:"el-icon-s-open"},on:{click:t.clear_filter}},[t._v("重置")]),a("el-button",{attrs:{type:"warning",icon:"el-icon-search"},on:{click:t.category_filter}},[t._v("搜尋")])],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("客戶")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"客戶",filterable:"",clearable:"","filter-method":t.customer_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.customer_enter(e)}},model:{value:t.customer_value,callback:function(e){t.customer_value=e},expression:"customer_value"}},t._l(t.customer_fliter,(function(t){return a("el-option",{attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("KeyID")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"KeyID",filterable:"",clearable:"","filter-method":t.KeyID_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.KeyID_enter(e)}},model:{value:t.KeyID_value,callback:function(e){t.KeyID_value=e},expression:"KeyID_value"}},t._l(t.KeyID_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("地區")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"地區",filterable:"",clearable:"","filter-method":t.region_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.region_enter(e)}},model:{value:t.region_value,callback:function(e){t.region_value=e},expression:"region_value"}},t._l(t.region_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("負責人")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"負責人",filterable:"",clearable:"","filter-method":t.user_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.user_enter(e)}},model:{value:t.user_value,callback:function(e){t.user_value=e},expression:"user_value"}},t._l(t.user_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("到期日")]),a("el-date-picker",{staticStyle:{width:"345px",height:"37px","margin-right":"25px","margin-top":"8px"},attrs:{"value-format":"yyyy-MM-dd",size:"mini",type:"daterange","range-separator":"_","start-placeholder":"開始日期","end-placeholder":"結束日期"},model:{value:t.expiration_value,callback:function(e){t.expiration_value=e},expression:"expiration_value"}})],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("備註1")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"備註1",filterable:"",clearable:"","filter-method":t.note1_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.note1_enter(e)}},model:{value:t.note1_value,callback:function(e){t.note1_value=e},expression:"note1_value"}},t._l(t.note1_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("備註2")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"備註2",filterable:"",clearable:"","filter-method":t.note2_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.note2_enter(e)}},model:{value:t.note2_value,callback:function(e){t.note2_value=e},expression:"note2_value"}},t._l(t.note2_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("備註3")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"備註3",filterable:"",clearable:"","filter-method":t.note3_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.note3_enter(e)}},model:{value:t.note3_value,callback:function(e){t.note3_value=e},expression:"note3_value"}},t._l(t.note3_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("備註4")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"備註4",filterable:"",clearable:"","filter-method":t.note3_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.note3_enter(e)}},model:{value:t.note4_value,callback:function(e){t.note4_value=e},expression:"note4_value"}},t._l(t.note3_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-item"},[a("div",{staticClass:"search-box-item-font"},[t._v("備註5")]),a("el-select",{staticStyle:{width:"400px"},attrs:{multiple:"",placeholder:"備註5",filterable:"",clearable:"","filter-method":t.note3_fliterer},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.note3_enter(e)}},model:{value:t.note3_value,callback:function(e){t.note3_value=e},expression:"note3_value"}},t._l(t.note3_fliter,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("div",{staticClass:"search-box-expiring"},[a("el-checkbox",{model:{value:t.expiring_check,callback:function(e){t.expiring_check=e},expression:"expiring_check"}},[a("el-input",{staticStyle:{width:"55px"},attrs:{placeholder:""},model:{value:t.expiring_days,callback:function(e){t.expiring_days=e},expression:"expiring_days"}}),a("span",{staticStyle:{"font-weight":"bold"}},[t._v("天內到期")])],1)],1),a("div",{staticClass:"search-box-expired"},[a("el-checkbox",{model:{value:t.expired_check,callback:function(e){t.expired_check=e},expression:"expired_check"}},[a("span",{staticStyle:{"font-weight":"bold"}},[t._v("已過期")])])],1)]),a("el-button",{staticStyle:{position:"fixed",top:"80px",left:"290px",padding:"15px","font-size":"20px"},attrs:{type:"warning",icon:"el-icon-search",circle:""},on:{click:t.drawer_close}})],1),a("div",{staticStyle:{display:"flex"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.search_drawer,expression:"search_drawer"}],staticStyle:{"flex-basis":"280px"}}),a("div",{staticStyle:{margin:"0px auto",width:"75%"},attrs:{id:"showtable"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.searched_data_num,expression:"searched_data_num"}],staticStyle:{color:"red","font-size":"20px","font-weight":"bold"}},[t._v("已搜尋到"+t._s(t.searched_data_num)+"筆資料")]),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.enter_loading,expression:"enter_loading"}],ref:"showtable",staticClass:"main-table",attrs:{"row-class-name":t.tableRowColor,"row-style":{height:"0px"},"cell-style":{border:"solid 1px #EAEAEA"},"header-cell-class-name":t.selection_column_style,data:t.tableData.slice((t.currentPage-1)*t.pagesize,t.currentPage*t.pagesize),height:"650px",border:""},on:{"sort-change":t.sortChange,"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{align:"center",prop:"customer",label:"客戶",sortable:"custom"}}),a("el-table-column",{attrs:{align:"center",prop:"sn",label:"KeyID",sortable:"custom"}}),a("el-table-column",{attrs:{align:"center",prop:"region",label:"區域",sortable:"custom"}}),a("el-table-column",{attrs:{align:"center",prop:"user",label:"負責人",sortable:"custom"}}),a("el-table-column",{attrs:{align:"center",prop:"expiration",label:"到期日",sortable:"custom","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",prop:"note1",label:"備註1",sortable:"custom","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",prop:"note2",label:"備註2",sortable:"custom","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",prop:"note3",label:"備註3",sortable:"custom","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",prop:"note4",label:"備註4",sortable:"custom","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",prop:"note5",label:"備註5",sortable:"custom","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"編輯備註",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("i",{staticClass:"el-icon-edit",staticStyle:{cursor:"pointer"},attrs:{size:"mini"},on:{click:function(a){a.stopPropagation(),t.form.current_edit_data=e.row,t.dialogFormVisible=!0}}})]}}])}),a("el-table-column",{attrs:{align:"center",width:"48px",label:""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("i",{staticClass:"el-icon-arrow-right",staticStyle:{"font-size":"20px",cursor:"pointer","z-index":"200",position:"relative"},on:{click:function(a){return a.stopPropagation(),t.detail_form(e.row)}}})]}}])})],1),a("div",{staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":t.currentPage,"page-size":t.pagesize,layout:"prev, pager, next",total:t.tableData.length},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pagesize=e},"update:page-size":function(e){t.pagesize=e}}})],1)],1)]),a("div",[a("el-dialog",{attrs:{visible:t.detail,width:"1500px",height:"750px"},on:{"update:visible":function(e){t.detail=e}}},[a("div",{staticClass:"apply_record_box"},[a("div",{staticStyle:{"font-size":"25px"}},[t._v(t._s(t.detailForm.keyID)+"申請紀錄")]),a("el-table",{staticClass:"fold shadow_box",staticStyle:{width:"100%"},attrs:{data:t.detailForm.apply_record,"row-style":{height:"10px"},height:"250"}},[a("el-table-column",{attrs:{type:"expand"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("el-table",{attrs:{data:t.row.data}},[a("el-table-column",{attrs:{prop:"operator",label:"操作","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"customer",label:"客戶","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"sn",label:"KeyID","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"product",label:"產品","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"module",label:"模組","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"version",label:"版本","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"type",label:"類型","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"count",label:"數量","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"expiration",label:"到期日期","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"region",label:"地區","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"comment",label:"備註","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"contact",label:"聯絡人","show-overflow-tooltip":""}})],1)]}}])}),a("el-table-column",{attrs:{label:"申請ID",prop:"id"}}),a("el-table-column",{attrs:{label:"申請日期",prop:"date"}}),a("el-table-column",{attrs:{label:"申請人",prop:"applicant"}}),a("el-table-column",{attrs:{label:"狀態",prop:"status"}}),a("el-table-column",{attrs:{label:"驗證時間",prop:"verify_time"}})],1)],1),a("div",{staticClass:"product_list_box"},[a("div",{staticStyle:{"font-size":"25px"}},[t._v(t._s(t.detailForm.keyID)+"產品清單")]),a("el-table",{staticClass:"fold shadow_box",staticStyle:{width:"100%"},attrs:{data:t.detailForm.product_list,"row-style":{height:"10px"},height:"250"}},[a("el-table-column",{attrs:{label:"客戶",prop:"customer","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"KeyID",prop:"sn","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"產品類別",prop:"category","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"產品",prop:"product","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"模組",prop:"module","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"版本",prop:"version","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"數量",prop:"count","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"類型",prop:"type","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"地區",prop:"region","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"聯絡人",prop:"contact","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"到期日",prop:"expiration","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"備註",prop:"comment","show-overflow-tooltip":""}})],1)],1)]),a("el-dialog",{attrs:{title:"修改備註",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[a("el-form",{attrs:{model:t.form}},[a("el-form-item",{attrs:{label:"備註1"}},[a("el-input",{attrs:{placeholder:t.form.current_edit_data.note1},model:{value:t.form.note1,callback:function(e){t.$set(t.form,"note1",e)},expression:"form.note1"}})],1),a("el-form-item",{attrs:{label:"備註2"}},[a("el-input",{attrs:{placeholder:t.form.current_edit_data.note2},model:{value:t.form.note2,callback:function(e){t.$set(t.form,"note2",e)},expression:"form.note2"}})],1),a("el-form-item",{attrs:{label:"備註3"}},[a("el-input",{attrs:{placeholder:t.form.current_edit_data.note3},model:{value:t.form.note3,callback:function(e){t.$set(t.form,"note3",e)},expression:"form.note3"}})],1),a("el-form-item",{attrs:{label:"備註4"}},[a("el-input",{attrs:{placeholder:t.form.current_edit_data.note4},model:{value:t.form.note4,callback:function(e){t.$set(t.form,"note4",e)},expression:"form.note4"}})],1),a("el-form-item",{attrs:{label:"備註5"}},[a("el-input",{attrs:{placeholder:t.form.current_edit_data.note5},model:{value:t.form.note5,callback:function(e){t.$set(t.form,"note5",e)},expression:"form.note5"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogFormVisible=!1,t.handleEdit()}}},[t._v("確 定")])],1)],1)],1)],1)},Qt=[],Xt=a("ade3");a("04ff"),a("c5f6"),a("7cdf");function te(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=ee(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function ee(t,e){if(t){if("string"===typeof t)return ae(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?ae(t,e):void 0}}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}function re(t,e,a){var r=[],o=0,i=0;while(o<t.length&&i<e.length)t[o][a]>e[i][a]?(r.push(t[o]),o++):(r.push(e[i]),i++);return r.concat(t.slice(o)).concat(e.slice(i))}function oe(t,e){if(1===t.length)return t;var a=t.length,r=Math.floor(a/2),o=t.slice(0,r),i=t.slice(r);return re(oe(o,e),oe(i,e),e)}var ie={name:"KeyID",data:function(){return{all_Data:{},user_setting:{},tableData:[],customer_data:[],region_data:[],origin_data:[],filter_Data:[],sort_Data:[],application_data:[],apply_record_map:{},info_data:[],product_list_map:{},user:[],checked_Data:[],mode:"KeyID",update_time:"",pagesize_display:"",pagesize:50,currentPage:1,select_out:!1,dialogFormVisible:!1,detail:!1,form:{current_edit_data:"",note1:"",note2:"",note3:"",note4:"",note5:""},detailForm:{keyID:"",apply_record:[],product_list:[]},customer_opt:[],customer_value:"",customer_fliter:[],customer_input:"",customer_dict:{},KeyID_opt:[],KeyID_value:"",KeyID_fliter:[],KeyID_input:"",region_opt:[],region_value:"",region_fliter:[],region_input:"",user_opt:[],user_value:"",user_fliter:[],user_input:"",expiration_opt:[],expiration_value:null,expiring_days:30,expiring_check:!1,expired_check:!1,note1_opt:[],note1_value:"",note1_fliter:[],note1_input:"",note2_opt:[],note2_value:"",note2_fliter:[],note2_input:"",note3_opt:[],note3_value:"",note3_fliter:[],note3_input:"",note4_opt:[],note4_value:"",note4_fliter:[],note4_input:"",note5_opt:[],note5_value:"",note5_fliter:[],note5_input:"",enter_loading:!0,search_drawer:!1,search_drawer_btn:!0,searched_data_num:0}},created:function(){var t=this;this.axios.get("/KeyID",{params:{user:JSON.stringify(JSON.parse(sessionStorage.getItem("user")))}}).then((function(e){t.user=JSON.parse(sessionStorage.getItem("user")),t.all_Data=JSON.parse(JSON.stringify(e.data)),t.user_setting=JSON.parse(JSON.stringify(t.all_Data["user_setting"])),t.customer_data=JSON.parse(JSON.stringify(t.all_Data["customer_data"])),t.region_data=JSON.parse(JSON.stringify(t.all_Data["region_data"])),t.tableData=JSON.parse(JSON.stringify(t.all_Data["sn_data"])),t.application_data=JSON.parse(JSON.stringify(t.all_Data["application_data"])),t.info_data=JSON.parse(JSON.stringify(t.all_Data["info_data"])),t.update_time=t.all_Data["update_time"];var a,r={},o=te(t.customer_data);try{for(o.s();!(a=o.n()).done;){var i=a.value;r[i["customer_id"]]=i["name"],""!=i["site"]&&(r[i["customer_id"]]+="(".concat(i["site"],")")),""!=i["site"]?t.customer_opt.push({value:i["name"]+"|"+i["site"],label:i["name"]+"|"+i["site"]}):t.customer_opt.push({value:i["name"],label:i["name"]}),t.customer_dict[i["customer_id"]]={name:i["name"],site:i["site"]}}}catch(q){o.e(q)}finally{o.f()}var n,l={},s=te(t.region_data);try{for(s.s();!(n=s.n()).done;){var c=n.value;l[c["region_id"]]=c["name"],t.region_opt.push({value:c["name"],label:c["name"]})}}catch(q){s.e(q)}finally{s.f()}var u,p=new Set,d=new Set,_=new Set,f=new Set,h=new Set,m=new Set,g=te(t.tableData);try{for(g.s();!(u=g.n()).done;){var v=u.value;v["customer"]=r[v["sn_id"]],v["region"]=l[v["region"]],t.KeyID_opt.push({value:v["sn"],label:v["sn"]}),""!=v["user"]&&p.add(v["user"]),""!=v["note1"]&&d.add(v["note1"]),""!=v["note2"]&&_.add(v["note2"]),""!=v["note3"]&&f.add(v["note3"]),""!=v["note4"]&&h.add(v["note4"]),""!=v["note5"]&&m.add(v["note5"])}}catch(q){g.e(q)}finally{g.f()}p.forEach((function(e){return t.user_opt.push({value:e,label:e})})),d.forEach((function(e){return t.note1_opt.push({value:e,label:e})})),_.forEach((function(e){return t.note2_opt.push({value:e,label:e})})),f.forEach((function(e){return t.note3_opt.push({value:e,label:e})})),h.forEach((function(e){return t.note4_opt.push({value:e,label:e})})),m.forEach((function(e){return t.note5_opt.push({value:e,label:e})})),t.customer_fliter=t.customer_opt,t.KeyID_fliter=t.KeyID_opt,t.region_fliter=t.region_opt,t.user_fliter=t.user_opt,t.note1_fliter=t.note1_opt,t.note2_fliter=t.note2_opt,t.note3_fliter=t.note3_opt,t.note4_fliter=t.note4_opt,t.note5_fliter=t.note5_opt;var y,b=te(t.application_data);try{for(b.s();!(y=b.n()).done;){var x,w=y.value,S=te(JSON.parse(w["data"]));try{for(S.s();!(x=S.n()).done;){var k=x.value;k["sn"]in t.apply_record_map?t.apply_record_map[k["sn"]].push({id:w["id"],date:w["date"],applicant:w["applicant"],status:w["status"],verify_time:w["verify_time"].replaceAll('"',""),operator:k["operator"],customer:k["customer"],sn:k["sn"],product:k["product"],module:k["module"],version:k["version"],type:k["type"],count:k["count"],expiration:k["expiration"],region:k["region"],comment:k["comment"],contact:k["contact"]}):t.apply_record_map[k["sn"]]=[{id:w["id"],date:w["date"],applicant:w["applicant"],status:w["status"],verify_time:w["verify_time"].replaceAll('"',""),operator:k["operator"],customer:k["customer"],sn:k["sn"],product:k["product"],module:k["module"],version:k["version"],type:k["type"],count:k["count"],expiration:k["expiration"],region:k["region"],comment:k["comment"],contact:k["contact"]}]}}catch(q){S.e(q)}finally{S.f()}}}catch(q){b.e(q)}finally{b.f()}var D,O=te(t.info_data);try{for(O.s();!(D=O.n()).done;){var $=D.value;$["sn"]in t.product_list_map?t.product_list_map[$["sn"]].push({sn:$["sn"],customer:$["customer"],category:$["category"],product:$["product"],module:$["module"],version:$["version"],count:$["count"],type:$["type"],region:$["region"],contact:$["contact"],expiration:$["expiration"],comment:$["comment"]}):t.product_list_map[$["sn"]]=[{sn:$["sn"],customer:$["customer"],category:$["category"],product:$["product"],module:$["module"],version:$["version"],count:$["count"],type:$["type"],region:$["region"],contact:$["contact"],expiration:$["expiration"],comment:$["comment"]}]}}catch(q){O.e(q)}finally{O.f()}var N,C=te(t.tableData);try{for(C.s();!(N=C.n()).done;){var I,J=N.value,E={},A=te(t.product_list_map[J["sn"]]);try{for(A.s();!(I=A.n()).done;){var z=I.value,j=new Date(z["expiration"]),T=new Date,M=864e5,K=parseInt(Math.abs(j-T)/M);E[K]=z["expiration"]}}catch(q){A.e(q)}finally{A.f()}var B=Object.keys(E).map((function(t){return t})),P=Math.min.apply(null,B);J=Object.assign(J,{expiration:E[P]})}}catch(q){C.e(q)}finally{C.f()}t.filter_Data=JSON.parse(JSON.stringify(t.tableData)),t.sort_Data=JSON.parse(JSON.stringify(t.tableData)),"all"==t.user_setting["pagesize"]?(t.pagesize=t.tableData.length,t.pagesize_display="all"):(t.pagesize=t.user_setting["pagesize"],t.pagesize_display=t.user_setting["pagesize"]);var L=JSON.parse(sessionStorage.getItem("sn_fliter"));L&&(L["customer_value"]&&(t.customer_value=L["customer_value"]),L["KeyID_value"]&&(t.KeyID_value=L["KeyID_value"]),L["region_value"]&&(t.region_value=L["region_value"]),L["user_value"]&&(t.user_value=L["user_value"]),L["expiration_value"]&&(t.expiration_value=L["expiration_value"]),L["note1_value"]&&(t.note1_value=L["note1_value"]),L["note2_value"]&&(t.note2_value=L["note2_value"]),L["note3_value"]&&(t.note3_value=L["note3_value"]),L["note4_value"]&&(t.note4_value=L["note4_value"]),L["note5_value"]&&(t.note5_value=L["note5_value"]),L["expiring_days"]&&(t.expiring_days=L["expiring_days"]),L["expiring_check"]&&(t.expiring_check=L["expiring_check"]),L["expired_check"]&&(t.expired_check=L["expired_check"]),void 0==L&&JSON.stringify(L)==JSON.stringify({})||t.category_filter()),t.search_drawer=!0,t.enter_loading=!1}))},methods:(Pt={select_change:function(){this.select_out=!this.select_out},mode_switch:function(t){var e,a=this;"product"==t&&(e="all"==a.pagesize_display?"all":parseInt(a.pagesize_display),a.axios.post("/save_to_user_setting",{source:"KeyID",user:a.user[0],mode:t,pagesize:e}).then((function(t){a.$router.push({name:"Show_All"})})))},pagesize_change:function(){var t=this;"all"==t.pagesize_display?(t.pagesize=t.tableData.length,t.axios.post("/save_to_user_setting",{source:"KeyID",user:t.user[0],mode:t.mode,pagesize:"all"})):(t.pagesize=parseInt(t.pagesize_display),t.axios.post("/save_to_user_setting",{source:"KeyID",user:t.user[0],mode:t.mode,pagesize:parseInt(t.pagesize)}))},Logout:function(){sessionStorage.clear(),this.$router.push("/login")},handleSelectionChange:function(t){this.checked_Data=JSON.parse(JSON.stringify(t))},handleEdit:function(){var t=this;if(""!=this.form.note1||""!=this.form.note2||""!=this.form.note3||""!=this.form.note4||""!=this.form.note5){var e=new Date,a=e.getHours().toString(),r=e.getMinutes().toString();a=a.length<2?"0"+a:a,r=r.length<2?"0"+r:r;var o="".concat(e.getFullYear(),"/").concat(e.getMonth()+1,"/").concat(e.getDate()," ").concat(a,":").concat(r),i=this.form.current_edit_data;i["record"]="".concat(o," (").concat(this.user[0],")"),""!=this.form.note1&&(i["note1"]=this.form.note1),""!=this.form.note2&&(i["note2"]=this.form.note2),""!=this.form.note3&&(i["note3"]=this.form.note3),""!=this.form.note4&&(i["note4"]=this.form.note4),""!=this.form.note5&&(i["note5"]=this.form.note5),this.axios.post("/save_to_sn",{newNotes:i}).then((function(e){t.form.note1="",t.form.note2="",t.form.note3="",t.form.note4="",t.form.note5=""}))}},detail_form:function(t){this.detailForm.keyID=t["sn"],this.detailForm.product_list=this.product_list_map[t["sn"]],this.detailForm.apply_record=[];var e={};if(void 0!=this.apply_record_map[t["sn"]]){var a,r=te(this.apply_record_map[t["sn"]]);try{for(r.s();!(a=r.n()).done;){var o=a.value;o["id"]in e?e[o["id"]].push({operator:o["operator"],customer:o["customer"],sn:o["sn"],product:o["product"],module:o["module"],version:o["version"],type:o["type"],count:o["count"],expiration:o["expiration"],region:o["region"],comment:o["comment"],contact:o["contact"]}):e[o["id"]]=[{operator:o["operator"],customer:o["customer"],sn:o["sn"],product:o["product"],module:o["module"],version:o["version"],type:o["type"],count:o["count"],expiration:o["expiration"],region:o["region"],comment:o["comment"],contact:o["contact"]}]}}catch(c){r.e(c)}finally{r.f()}var i,n=[],l=te(this.apply_record_map[t["sn"]]);try{for(l.s();!(i=l.n()).done;){var s=i.value;n.includes(s["id"])||(this.detailForm.apply_record.push({id:s["id"],date:s["date"],applicant:s["applicant"],status:s["status"],verify_time:s["verify_time"],data:e[s["id"]]}),n.push(s["id"]))}}catch(c){l.e(c)}finally{l.f()}}this.detail=!0},customer_enter:function(){this.customer_value.push(this.customer_input),this.category_filter()},customer_fliterer:function(t){t&&(this.customer_input=t,this.customer_fliter=this.customer_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},KeyID_fliterer:function(t){t&&(this.KeyID_input=t,this.KeyID_fliter=this.KeyID_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},region_fliterer:function(t){t&&(this.region_input=t,this.region_fliter=this.region_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},user_fliterer:function(t){t&&(this.user_input=t,this.user_fliter=this.user_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},note1_fliterer:function(t){t&&(this.note1_input=t,this.note1_fliter=this.note1_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},note2_fliterer:function(t){t&&(this.note2_input=t,this.note2_fliter=this.note2_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},note3_fliterer:function(t){t&&(this.note3_input=t,this.note3_fliter=this.note3_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},note4_fliterer:function(t){t&&(this.note4_input=t,this.note4_fliter=this.note4_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},note5_fliterer:function(t){t&&(this.note5_input=t,this.note5_fliter=this.note5_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},category_filter:function(){var t=this;if(this.expiring_check&&(!Number.isInteger(Number.parseInt(this.expiring_days))||Number.parseInt(this.expiring_days)<0))this.$alert("到期日請輸入正整數!","提示",{type:"warning",center:!0});else{this.customer_value,this.KeyID_value,this.region_value,this.user_value,this.expiration_value,this.note1_value,this.note2_value,this.note3_value,this.note4_value,this.note5_value,this.expiring_days,this.expiring_check,this.expired_check;for(var e in sessionStorage.setItem("sn_fliter",JSON.stringify({customer_value:this.customer_value,KeyID_value:this.KeyID_value,region_value:this.region_value,user_value:this.user_value,expiration_value:this.expiration_value,note1_value:this.note1_value,note2_value:this.note2_value,note3_value:this.note3_value,note4_value:this.note4_value,note5_value:this.note5_value,expiring_days:this.expiring_days,expiring_check:this.expiring_check,expired_check:this.expired_check})),this.KeyID_value)this.KeyID_value[e]=parseInt(this.KeyID_value[e]);var a=[],r=!1;if(this.customer_value.length||this.KeyID_value.length||this.region_value.length||this.user_value.length||null!=this.expiration_value||this.note1_value.length||this.note2_value.length||this.note3_value.length||this.note4_value.length||this.note5_value.length){var o={};o["customer"]=this.customer_value,o["sn"]=this.KeyID_value,o["region"]=this.region_value,o["user"]=this.user_value,o["note1"]=this.note1_value,o["note2"]=this.note2_value,o["note3"]=this.note3_value,o["note4"]=this.note4_value,o["note5"]=this.note5_value,a=n(this.filter_Data,o)}else a=this.filter_Data,r=!0;this.expiration_value&&(a=a.filter((function(e){return t.expiration_value[0]<=e["expiration"]&&e["expiration"]<=t.expiration_value[1]})));var i=864e5;this.expiring_check&&this.expired_check?a=a.filter((function(e){return t.expiring_days>=parseInt((new Date(e["expiration"])-new Date)/i,10)})):this.expiring_check?a=a.filter((function(e){return t.expiring_days>=parseInt((new Date(e["expiration"])-new Date)/i,10)&&0<=parseInt((new Date(e["expiration"])-new Date)/i,10)})):this.expired_check&&(a=a.filter((function(t){return 0>parseInt((new Date(t["expiration"])-new Date)/i,10)}))),this.sort_Data=JSON.parse(JSON.stringify(a)),this.tableData=this.sort_Data,this.searched_data_num=r?0:this.tableData.length}function n(t,e){var a=Object.keys(e);return t.filter((function(t){return a.every((function(a){if(e[a].includes(void 0)||e[a].includes(NaN)||e[a].includes(null))return!0;if(e[a].length){var r,o=te(e[a]);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(String(t[a]).includes(i))return!0}}catch(n){o.e(n)}finally{o.f()}return!1}return!0}))}))}},sortChange:function(t){var e=JSON.parse(JSON.stringify(this.sort_Data));if(0!=e.length){var a=oe(e,t.prop);"ascending"==t.order?this.tableData=a:"descending"==t.order?this.tableData=a.reverse():this.tableData=this.sort_Data}}},Object(Xt["a"])(Pt,"customer_enter",(function(){this.customer_value.push(this.customer_input)})),Object(Xt["a"])(Pt,"KeyID_enter",(function(){this.KeyID_value.push(this.KeyID_input)})),Object(Xt["a"])(Pt,"region_enter",(function(){this.region_value.push(this.region_input)})),Object(Xt["a"])(Pt,"user_enter",(function(){this.user_value.push(this.user_input)})),Object(Xt["a"])(Pt,"note1_enter",(function(){this.note1_value.push(this.note1_input)})),Object(Xt["a"])(Pt,"note2_enter",(function(){this.note2_value.push(this.note2_input)})),Object(Xt["a"])(Pt,"note3_enter",(function(){this.note3_value.push(this.note3_input)})),Object(Xt["a"])(Pt,"note4_enter",(function(){this.note4_value.push(this.note4_input)})),Object(Xt["a"])(Pt,"note5_enter",(function(){this.note5_value.push(this.note5_input)})),Object(Xt["a"])(Pt,"drawer_open",(function(){this.search_drawer=!0,this.search_drawer_btn=!1,document.getElementById("showtable").style.width="75%"})),Object(Xt["a"])(Pt,"drawer_close",(function(){this.search_drawer=!1,document.getElementById("showtable").style.width="85%"})),Object(Xt["a"])(Pt,"clear_filter",(function(){this.customer_value=[],this.KeyID_value=[],this.region_value=[],this.user_value=[],this.expiration_value=null,this.note1_value=[],this.note2_value=[],this.note3_value=[],this.note4_value=[],this.note5_value=[],this.expiring_check=!1,this.expired_check=!1,this.category_filter(),sessionStorage.setItem("sn_fliter",JSON.stringify({}))})),Object(Xt["a"])(Pt,"reload",(function(){location.reload()})),Object(Xt["a"])(Pt,"tableRowColor",(function(t){var e=t.row,a=t.rowIndex,r=a+(this.currentPage-1)*this.pagesize;e.index=a;var o=new Date;o.setHours(o.getHours());var i=o.toISOString().slice(0,10);o.setMonth(o.getMonth()+1);var n=o.toISOString().slice(0,10),l=this.tableData[r]["expiration"];return l<i?"exceed-row":l<n?"warning-row":"success-row"})),Object(Xt["a"])(Pt,"selection_column_style",(function(t){if(0==t.columnIndex)return"selection_style"})),Pt),computed:{delay_time:function(){return 1e4*this.select_out}}},ne=ie,le=(a("66ca"),a("7b04"),Object(s["a"])(ne,Yt,Qt,!1,null,"38b43ead",null)),se=le.exports,ce=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("Aside"),a("el-container",[a("el-main",[a("el-button",{staticStyle:{position:"relative",right:"590px"},attrs:{type:"primary",icon:"el-icon-plus",plain:""},on:{click:t.add_assign}},[t._v("新增")]),a("el-dialog",{attrs:{title:"產品群組-新增",visible:t.dialogVisible_add,width:"60%","append-to-body":!0,"show-close":!1},on:{"update:visible":function(e){t.dialogVisible_add=e}}},[a("el-scrollbar",{staticStyle:{height:"350px"}},[a("el-tree",{ref:"product_group_tree",staticStyle:{position:"relative",left:"440px",width:"400px",height:"350px"},attrs:{data:t.productgroup_tree,props:t.defaultProps,accordion:"","node-key":"id","show-checkbox":""},on:{check:t.choose_product_group},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.node,o=e.data;return a("span",{staticClass:"custom-tree-node"},[a("span",[t._v(t._s(r.label))]),a("span",[a("el-button",{directives:[{name:"show",rawName:"v-show",value:1!=o["add"]&&0==t.deter_exist_group,expression:"data['add'] != true && deter_exist_group==false"}],attrs:{size:"mini",type:"text",size:"mini"},on:{click:function(){return t.append(r,o)}}},[t._v("\n              加入此標籤\n          ")]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1==o["add"],expression:"data['add'] == true"}],attrs:{size:"mini",type:"text",size:"mini"},on:{click:function(){return t.remove(r,o)}}},[t._v("\n              重選標籤\n          ")]),a("el-tag",{directives:[{name:"show",rawName:"v-show",value:1==o["add"],expression:"data['add'] == true"}],staticStyle:{"font-size":"14px",height:"22px"},attrs:{type:"success"}},[t._v("G")])],1)])}}])})],1),a("div",{staticStyle:{position:"absolute",top:"80px"}},[a("div",{staticStyle:{position:"relative"}},[t._v("\n        群組名稱:\n        "),a("el-input",{staticStyle:{width:"150px"},attrs:{placeholder:"請輸入群組名稱"},model:{value:t.product_dialog.caption,callback:function(e){t.$set(t.product_dialog,"caption",e)},expression:"product_dialog.caption"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("\n        群組分類:\n        "),a("el-select",{ref:"dialog_pro_tag",staticClass:"none_delete_tag",staticStyle:{width:"300px"},attrs:{filterable:"",remote:"",multiple:"",placeholder:"請選擇分類"},on:{focus:function(e){return t.make_blur("0")}},model:{value:t.product_dialog.tag,callback:function(e){t.$set(t.product_dialog,"tag",e)},expression:"product_dialog.tag"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("\n        產品清單:\n        "),a("el-select",{ref:"dialog_pro_group",staticClass:"none_delete_tag",staticStyle:{width:"300px"},attrs:{filterable:"",remote:"",multiple:"",placeholder:"請勾選產品"},on:{focus:function(e){return t.make_blur("1")}},model:{value:t.product_dialog.product_list,callback:function(e){t.$set(t.product_dialog,"product_list",e)},expression:"product_dialog.product_list"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("\n        描述:\n        "),a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入描述"},model:{value:t.product_dialog.description,callback:function(e){t.$set(t.product_dialog,"description",e)},expression:"product_dialog.description"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("\n        備註:\n        "),a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入備註"},model:{value:t.product_dialog.remarks,callback:function(e){t.$set(t.product_dialog,"remarks",e)},expression:"product_dialog.remarks"}})],1),a("span",[a("el-button",{staticStyle:{position:"relative",left:"30px"},attrs:{type:"danger",plain:""},on:{click:function(e){return t.cancel_product_group("add")}}},[t._v("取消")]),a("el-button",{staticStyle:{position:"relative",left:"40px"},attrs:{type:"primary",plain:""},on:{click:function(e){return t.store_product_group("add")}}},[t._v("確定")])],1),a("div")])],1),a("el-table",{attrs:{data:t.tableData}},[a("el-table-column",{attrs:{align:"center",prop:"caption",label:"群組名稱",width:"150"}}),a("el-table-column",{attrs:{align:"center",prop:"tag",label:"群組分類",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return t._l(JSON.parse(r.tag),(function(e,o){return a("span",[t._v("\n            "+t._s(e)+"\n            "),o!=JSON.parse(r.tag).length-1?a("span",[t._v("→")]):t._e()])}))}}])}),a("el-table-column",{attrs:{align:"center",prop:"product_list",label:"產品清單",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-popover",{ref:"popover",attrs:{placement:"bottom-start",title:"產品清單",trigger:"hover",placement:"top"}},[t._l(JSON.parse(r.product_list),(function(e){return a("span",[t._v(t._s(e)),a("br")])})),a("el-button",{staticStyle:{"font-size":"20px"},attrs:{slot:"reference",type:"text",icon:"el-icon-box"},slot:"reference"})],2)]}}])}),a("el-table-column",{attrs:{align:"center",prop:"description",label:"描述",width:"200"}}),a("el-table-column",{attrs:{align:"center",prop:"remarks",label:"備註",width:"200"}}),a("el-table-column",{attrs:{align:"center",prop:"operator",label:"操作",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-button",{attrs:{type:"primary",icon:"el-icon-edit",size:"small",circle:""},on:{click:function(e){return t.edit_assign(r.caption)}}}),a("el-dialog",{attrs:{title:"產品群組-修改",visible:t.dialogVisible_edit,width:"60%","append-to-body":!0,"show-close":!1},on:{"update:visible":function(e){t.dialogVisible_edit=e}}},[a("el-scrollbar",{staticStyle:{height:"350px"}},[a("el-tree",{ref:"product_group_tree",staticStyle:{position:"relative",left:"440px",width:"400px",height:"350px"},attrs:{data:t.productgroup_tree,props:t.defaultProps,accordion:"","node-key":"id","show-checkbox":""},on:{check:t.choose_product_group},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.node,o=e.data;return a("span",{staticClass:"custom-tree-node"},[a("span",[t._v(t._s(r.label))]),a("span",[a("el-button",{directives:[{name:"show",rawName:"v-show",value:1!=o["add"]&&0==t.deter_exist_group,expression:"data['add'] != true && deter_exist_group==false"}],attrs:{size:"mini",type:"text",size:"mini"},on:{click:function(){return t.append(r,o)}}},[t._v("\n                      加入此標籤\n                  ")]),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1==o["add"],expression:"data['add'] == true"}],attrs:{size:"mini",type:"text",size:"mini"},on:{click:function(){return t.remove(r,o)}}},[t._v("\n                      重選標籤\n                  ")]),a("el-tag",{directives:[{name:"show",rawName:"v-show",value:1==o["add"],expression:"data['add'] == true"}],staticStyle:{"font-size":"14px",height:"22px"},attrs:{type:"success"}},[t._v("G")])],1)])}}],null,!0)})],1),a("div",{staticStyle:{position:"absolute",top:"80px"}},[a("div",{staticStyle:{position:"relative"}},[t._v("群組名稱:"),a("el-input",{staticStyle:{width:"150px"},attrs:{placeholder:"請輸入群組名稱"},model:{value:t.product_dialog.caption,callback:function(e){t.$set(t.product_dialog,"caption",e)},expression:"product_dialog.caption"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("群組分類:"),a("el-select",{ref:"dialog_pro_tag",staticClass:"none_delete_tag",staticStyle:{width:"300px"},attrs:{filterable:"",remote:"",multiple:"",placeholder:"請選擇分類"},on:{focus:function(e){return t.make_blur("0")}},model:{value:t.product_dialog.tag,callback:function(e){t.$set(t.product_dialog,"tag",e)},expression:"product_dialog.tag"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("產品清單:"),a("el-select",{ref:"dialog_pro_group",staticClass:"none_delete_tag",staticStyle:{width:"300px"},attrs:{filterable:"",remote:"",multiple:"",placeholder:"請勾選產品"},on:{focus:function(e){return t.make_blur("1")}},model:{value:t.product_dialog.product_list,callback:function(e){t.$set(t.product_dialog,"product_list",e)},expression:"product_dialog.product_list"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("描述:"),a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入描述"},model:{value:t.product_dialog.description,callback:function(e){t.$set(t.product_dialog,"description",e)},expression:"product_dialog.description"}})],1),a("div",{staticStyle:{position:"relative"}},[t._v("備註:"),a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入備註"},model:{value:t.product_dialog.remarks,callback:function(e){t.$set(t.product_dialog,"remarks",e)},expression:"product_dialog.remarks"}})],1),a("span",[a("el-button",{staticStyle:{position:"relative",left:"30px"},attrs:{type:"danger",plain:""},on:{click:function(e){return t.cancel_product_group("edit")}}},[t._v("取消")]),a("el-button",{staticStyle:{position:"relative",left:"40px"},attrs:{type:"primary",plain:""},on:{click:function(e){return t.store_product_group("edit")}}},[t._v("確定")])],1),a("div")])],1),a("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"small",circle:""},on:{click:function(e){return t.delete_product_group(r.caption)}}})]}}])})],1)],1)],1)],1)],1)},ue=[];function pe(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=de(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function de(t,e){if(t){if("string"===typeof t)return _e(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_e(t,e):void 0}}function _e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var fe={components:{Aside:vt},data:function(){return{tableData:[],all_Data:[],option_data:[],product_data:[],product_group_data:[],module_data:[],user_data:[],dialogVisible_edit:!1,dialogVisible_add:!1,product_dialog:{id:0,caption:"",tag:[],product_list:[],description:"",remarks:"",product_list_detail:[]},productgroup_tree:[],productgroup_tree_origin:[],tree_node_count:0,child_node_map:new Map,caption_map:new Map,module_map:new Map,deter_exist_group:!1}},created:function(){var t=this;this.axios.get("/admin_product_group",{}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.user_data=JSON.parse(JSON.stringify(t.all_Data["user_data"])),t.product_data=JSON.parse(JSON.stringify(t.all_Data["product_data"])),t.option_data=JSON.parse(JSON.stringify(t.all_Data["option_data"])),t.product_group_data=JSON.parse(JSON.stringify(t.all_Data["product_group_data"])),t.module_data=JSON.parse(JSON.stringify(t.all_Data["module_data"]));var a,r=pe(t.option_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;t.caption_map.set(o.option_name,{caption:o.caption,product_name:o.product_name})}}catch(U){r.e(U)}finally{r.f()}var i,n=pe(t.product_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;t.caption_map.set(l.product_name,{caption:l.caption})}}catch(U){n.e(U)}finally{n.f()}var s,c=pe(t.module_data);try{for(c.s();!(s=c.n()).done;){var u=s.value;t.module_map.set(u.mod_uid,{mod_uid:u.mod_uid,caption:u.caption})}}catch(U){c.e(U)}finally{c.f()}for(var p=[],d=0;d<t.product_group_data.length;d++){p=[];var _,f=pe(JSON.parse(t.product_group_data[d]["product_list"]));try{for(f.s();!(_=f.n()).done;){var h=_.value;t.caption_map.get(h)?void 0!=t.caption_map.get(h)["product_name"]?p.push(t.caption_map.get(h)["caption"]+"("+t.caption_map.get(h)["product_name"]+")"):p.push(t.caption_map.get(h)["caption"]):t.module_map.get(h)&&p.push(t.module_map.get(h)["caption"])}}catch(U){f.e(U)}finally{f.f()}t.product_group_data[d]["product_list"]=JSON.stringify(p)}t.tableData=JSON.parse(JSON.stringify(t.product_group_data)),console.log(t.all_Data);var m,g=new Set,v=pe(t.all_Data["product_data"]);try{for(v.s();!(m=v.n()).done;){var y=m.value;g.add(y["category_id"])}}catch(U){v.e(U)}finally{v.f()}var b,x=pe(g);try{for(x.s();!(b=x.n()).done;){var w=b.value;t.productgroup_tree.push({id:t.tree_node_count,label:w,children:[]}),t.tree_node_count++}}catch(U){x.e(U)}finally{x.f()}var S,k=pe(t.all_Data["product_data"]);try{for(k.s();!(S=k.n()).done;)for(var D=S.value,O=0;O<t.productgroup_tree.length;O++)t.productgroup_tree[O]["label"]==D["category_id"]&&(t.productgroup_tree[O]["children"].push({id:t.tree_node_count,label:D["caption"],children:[],category:D["category_id"]}),t.tree_node_count++)}catch(U){k.e(U)}finally{k.f()}for(var $=0;$<t.productgroup_tree.length;$++)for(var N=0;N<t.productgroup_tree[$]["children"].length;N++){var C,I=pe(t.all_Data["product_data"]);try{for(I.s();!(C=I.n()).done;){var J=C.value;if(t.productgroup_tree[$]["children"][N]["label"]==J["caption"]){var E,A=pe(t.all_Data["option_data"]);try{for(A.s();!(E=A.n()).done;){var z=E.value;J["product_name"]==z["product_name"]&&(t.productgroup_tree[$]["children"][N]["children"].push({id:t.tree_node_count,label:z["caption"],product_name:z["product_name"],children:[],category:z["product_name"]}),t.tree_node_count++)}}catch(U){A.e(U)}finally{A.f()}}}}catch(U){I.e(U)}finally{I.f()}}t.productgroup_tree_origin=JSON.parse(JSON.stringify(t.productgroup_tree));var j,T=pe(t.productgroup_tree);try{for(T.s();!(j=T.n()).done;){var M=j.value;if(0!=M["children"].length){var K,B=pe(M["children"]);try{for(B.s();!(K=B.n()).done;){var P=K.value;if(0!=P["children"].length){var L,q=pe(P["children"]);try{for(q.s();!(L=q.n()).done;){var F=L.value;0!=F["children"].length||(void 0!=F["product_name"]?t.child_node_map.set(F.label+"("+F["product_name"]+")",F.id):t.child_node_map.set(F.label,F.id))}}catch(U){q.e(U)}finally{q.f()}}else t.child_node_map.set(P.label,P.id)}}catch(U){B.e(U)}finally{B.f()}}else t.child_node_map.set(M.label,M.id)}}catch(U){T.e(U)}finally{T.f()}}))},methods:{choose_product_group:function(t,e){var a,r=[],o=[],i=pe(this.$refs.product_group_tree.getCheckedNodes());try{for(i.s();!(a=i.n()).done;){var n=a.value;0==n["children"].length&&(void 0!=n["product_name"]?(r.push(n["label"]+"("+n["product_name"]+")"),o.push({label:n["label"],category:n["category"]})):(r.push(n["label"]),o.push({label:n["label"],category:n["category"]})))}}catch(l){i.e(l)}finally{i.f()}this.product_dialog.product_list=r,this.product_dialog.product_list_detail=o,console.log(this.product_dialog.product_list_detail)},add_assign:function(){this.productgroup_tree=JSON.parse(JSON.stringify(this.productgroup_tree_origin)),this.dialogVisible_add=!0,this.product_dialog.id=0,this.product_dialog.caption="",this.product_dialog.tag=[],this.product_dialog.product_list=[],this.product_dialog.description="",this.product_dialog.remarks="",this.deter_exist_group=!1},edit_assign:function(t){var e=this;this.productgroup_tree=JSON.parse(JSON.stringify(this.productgroup_tree_origin));var a,r=pe(this.product_group_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;o["caption"]==t&&(this.product_dialog.id=o["group_id"],this.product_dialog.caption=o["caption"],this.product_dialog.tag=JSON.parse(o["tag"]),this.product_dialog.product_list=JSON.parse(o["product_list"]),this.product_dialog.description=o["description"],this.product_dialog.remarks=o["remarks"])}}catch(m){r.e(m)}finally{r.f()}this.dialogVisible_edit=!0,console.log(this.child_node_map);var i,n=[],l=pe(this.product_dialog.product_list);try{for(l.s();!(i=l.n()).done;){var s=i.value;n.push(this.child_node_map.get(s))}}catch(m){l.e(m)}finally{l.f()}this.$nextTick((function(){e.$refs.product_group_tree.setCheckedKeys(n)})),this.$nextTick((function(){var t,a=[],r=pe(e.$refs.product_group_tree.getCheckedNodes());try{for(r.s();!(t=r.n()).done;){var o=t.value;0==o["children"].length&&a.push({label:o["label"],category:o["category"]})}}catch(m){r.e(m)}finally{r.f()}e.product_dialog.product_list_detail=a}));var c,u=pe(this.product_group_data);try{for(u.s();!(c=u.n()).done;){var p=c.value;if(p["caption"]==t){var d,_=this.productgroup_tree,f=pe(JSON.parse(p.tag));try{for(f.s();!(d=f.n()).done;){var h=d.value;_=_[this.search_tree_index(_,h)]["children"]}}catch(m){f.e(m)}finally{f.f()}_.unshift({id:this.tree_node_count++,label:p["caption"],children:[],disabled:!0,add:!0}),this.deter_exist_group=!0}}}catch(m){u.e(m)}finally{u.f()}},store_product_group:function(t){var e,a=new Set,r=pe(this.all_Data["option_data"]);try{for(r.s();!(e=r.n()).done;){var o=e.value;a.add(o["product_name"])}}catch(b){r.e(b)}finally{r.f()}if(""!=this.product_dialog.caption&&0!=this.product_dialog.product_list.length){var i,n=[],l=pe(this.product_dialog.product_list_detail);try{for(l.s();!(i=l.n()).done;){var s=i.value,c=0,u=s["label"].split("").reverse().join("").split("(");a.has(u[0].replace(")",""))&&(s["label"]=s["label"].replace("("+u[0].replace(")","")+")",""));var p,d=pe(this.all_Data["option_data"]);try{for(d.s();!(p=d.n()).done;){var _=p.value;if(s["label"]==_["caption"]&&s["category"]==_["product_name"]){n.push(_["option_name"]),c=1;break}}}catch(b){d.e(b)}finally{d.f()}if(0==c){var f,h=pe(this.all_Data["product_data"]);try{for(h.s();!(f=h.n()).done;){var m=f.value;if(s["label"]==m["caption"]){n.push(m["product_name"]);break}}}catch(b){h.e(b)}finally{h.f()}}}}catch(b){l.e(b)}finally{l.f()}var g,v=pe(this.product_group_data);try{for(v.s();!(g=v.n()).done;){var y=g.value;if(y["caption"]==this.product_dialog.caption&&y["group_id"]!=this.product_dialog.id)return void this.$message.error("產品名稱重複，請更改");if(y.product_list==JSON.stringify(n)&&y["group_id"]!=this.product_dialog.id)return void this.$message.error("群組內產品與其他群組完全重複")}}catch(b){v.e(b)}finally{v.f()}0!=this.deter_exist_group?(this.product_dialog.product_list=JSON.parse(JSON.stringify(n)),"add"==t?this.axios({method:"post",url:"/operator_product_group",data:{product_dialog:JSON.stringify(this.product_dialog),operator:"add"}}).then((function(t){location.reload()})):"edit"==t&&this.axios({method:"post",url:"/operator_product_group",data:{product_dialog:JSON.stringify(this.product_dialog),operator:"edit"}}).then((function(t){location.reload()}))):this.$message.error("請選擇群組群組分類")}else this.$message.error("請將「產品群組」新增單，填寫完整")},cancel_product_group:function(t){var e=this;this.product_dialog.caption="",this.product_dialog.tag=[],this.product_dialog.product_list=[],this.product_dialog.description="",this.product_dialog.remarks="",this.product_dialog.product_list_detail=[],this.$nextTick((function(){e.$refs.product_group_tree.setCheckedKeys([])})),"edit"==t?this.dialogVisible_edit=!1:"add"==t&&(this.dialogVisible_add=!1)},append:function(t,e){if(""!=this.product_dialog.caption){this.deter_exist_group=!0;var a={label:this.product_dialog.caption,children:[],disabled:!0,add:!0};e.children||this.$set(e,"children",[]),e.children.unshift(a);var r=t;while(void 0!=r.label)this.product_dialog["tag"].unshift(r.label),r=r.parent}else this.$message.error("請填寫「群組名稱」，再選擇插入位置")},remove:function(t,e){this.deter_exist_group=!1,this.tree_node_count--,this.product_dialog["tag"]=[];var a=t.parent,r=a.data.children||a.data,o=r.findIndex((function(t){return t.id===e.id}));r.splice(o,1)},make_blur:function(t){var e=this;"0"==t&&this.$nextTick((function(){e.$refs.dialog_pro_tag.blur()})),"1"==t&&this.$nextTick((function(){e.$refs.dialog_pro_group.blur()})),"2"==t&&this.$nextTick((function(){e.$refs.sub_row_pro.blur()}))},delete_product_group:function(t){var e=this;this.$confirm("是否刪除「 "+t+" 」群組?","刪除",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){e.axios({method:"post",url:"/operator_product_group",data:{group_name:t,operator:"delete"}}).then((function(t){location.reload()})),e.$message({type:"success",message:"删除成功!"})})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},search_tree_index:function(t,e){for(var a=0;a<t.length;a++)if(t[a]["label"]==e)return a;return-1}}},he=fe,me=(a("9942"),Object(s["a"])(he,ce,ue,!1,null,null,null)),ge=me.exports,ve=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("Aside"),a("el-container",[a("el-main",[a("el-button",{staticStyle:{position:"relative",right:"590px"},attrs:{type:"primary",icon:"el-icon-plus",plain:""},on:{click:t.add_assign}},[t._v("新增")]),a("el-dialog",{attrs:{align:"left",title:"使用者表單-新增",visible:t.dialogVisible_add},on:{"update:visible":function(e){t.dialogVisible_add=e}}},[a("el-form",{attrs:{model:t.region_dialog,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"name",label:"地區",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入地區"},model:{value:t.region_dialog.name,callback:function(e){t.$set(t.region_dialog,"name",e)},expression:"region_dialog.name"}})],1),a("el-form-item",{attrs:{prop:"description",label:"描述"}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入描述"},model:{value:t.region_dialog.description,callback:function(e){t.$set(t.region_dialog,"description",e)},expression:"region_dialog.description"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.dialogVisible_add=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.add_region}},[t._v("確定")])],1)],1),a("el-table",{attrs:{data:t.tableData}},[a("el-table-column",{attrs:{align:"center",prop:"region_id",label:"編號",width:"150"}}),a("el-table-column",{attrs:{align:"center",prop:"name",label:"地區",width:"200"}}),a("el-table-column",{attrs:{align:"center",prop:"description",label:"描述",width:"300"}}),a("el-table-column",{attrs:{align:"center",prop:"operator",label:"操作",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-button",{attrs:{type:"primary",icon:"el-icon-edit",size:"small",circle:""},on:{click:function(e){return t.edit_assign(r)}}}),a("el-dialog",{attrs:{align:"left",title:"使用者表單-修改",visible:t.dialogVisible_edit},on:{"update:visible":function(e){t.dialogVisible_edit=e}}},[a("el-form",{attrs:{model:t.region_dialog,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"user",label:"編號"}},[a("span",[t._v(t._s(t.region_dialog.id))])]),a("el-form-item",{attrs:{prop:"name",label:"地區",required:""}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"請輸入地區"},model:{value:t.region_dialog.name,callback:function(e){t.$set(t.region_dialog,"name",e)},expression:"region_dialog.name"}})],1),a("el-form-item",{attrs:{prop:"description",label:"描述"}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入描述"},model:{value:t.region_dialog.description,callback:function(e){t.$set(t.region_dialog,"description",e)},expression:"region_dialog.description"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.dialogVisible_edit=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.edit_region}},[t._v("確定")])],1)],1),a("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"small",circle:""},on:{click:function(e){return t.delete_region(r)}}})]}}])})],1)],1)],1)],1)],1)},ye=[];function be(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=xe(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function xe(t,e){if(t){if("string"===typeof t)return we(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?we(t,e):void 0}}function we(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var Se={components:{Aside:vt},data:function(){return{tableData:[],all_Data:[],sn_data:[],customer_data:[],region_data:[],dialogVisible_edit:!1,dialogVisible_add:!1,region_dialog:{id:0,name:"",description:""}}},created:function(){var t=this;this.axios.get("/admin_region",{}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.customer_data=JSON.parse(JSON.stringify(t.all_Data["customer_data"])),t.region_data=JSON.parse(JSON.stringify(t.all_Data["region_data"])),t.sn_data=JSON.parse(JSON.stringify(t.all_Data["sn_data"])),t.tableData=JSON.parse(JSON.stringify(t.all_Data["region_data"]))}))},methods:{delete_region:function(t){var e=this;this.$confirm("是否刪除「 "+t["name"]+" 」地區?","刪除",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){var a,r=be(e.sn_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;if(o["region"]==t["region_id"])return e.$message({type:"error",message:"該地區已與Sn資料串聯，無法刪除，只可修改!"})}}catch(i){r.e(i)}finally{r.f()}e.axios.get("/operator_region",{params:{id:t["region_id"],operator:"delete"}}).then((function(t){location.reload()})),e.$message({type:"success",message:"删除成功!"})})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},edit_assign:function(t){this.dialogVisible_edit=!0,this.region_dialog.id=t["region_id"],this.region_dialog.name=t["name"],this.region_dialog.description=t["description"]},edit_region:function(){var t=this;if(""==this.region_dialog.name)return this.$message({message:"請填入區域名稱",type:"error"});var e,a=be(this.region_data);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(r.name==this.region_dialog.name)return void this.$message({message:"名稱與現有區域名稱重複",type:"error"})}}catch(o){a.e(o)}finally{a.f()}this.axios.get("/operator_region",{params:{region_dialog:JSON.stringify(this.region_dialog),operator:"edit"}}).then((function(e){t.dialogVisible_edit=!1,location.reload()}))},add_assign:function(){this.dialogVisible_add=!0,this.region_dialog.id=0,this.region_dialog.name="",this.region_dialog.description=""},add_region:function(){var t=this;if(""==this.region_dialog.name)return this.$message({message:"請填入區域名稱",type:"error"});var e,a=be(this.region_data);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(r.name==this.region_dialog.name)return void this.$message({message:"名稱與現有區域名稱重複",type:"error"})}}catch(o){a.e(o)}finally{a.f()}this.axios.get("/operator_region",{params:{region_dialog:JSON.stringify(this.region_dialog),operator:"add"}}).then((function(e){t.dialogVisible_add=!1,location.reload()}))}}},ke=Se,De=(a("cc6b"),Object(s["a"])(ke,ve,ye,!1,null,null,null)),Oe=De.exports,$e=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("Aside"),a("el-container",[a("el-main",[a("el-button",{staticStyle:{position:"relative",right:"480px"},attrs:{type:"primary",icon:"el-icon-plus",plain:""},on:{click:t.add_assign}},[t._v("新增")]),a("el-dialog",{attrs:{align:"left",title:"使用者表單-新增",visible:t.dialogVisible_add},on:{"update:visible":function(e){t.dialogVisible_add=e}}},[a("el-form",{attrs:{model:t.product_dialog,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"category_id",label:"產品類別",required:""}},[a("el-autocomplete",{attrs:{"fetch-suggestions":t.querySearch_category_id,placeholder:"請輸入產品類別"},model:{value:t.product_dialog.category_id,callback:function(e){t.$set(t.product_dialog,"category_id",e)},expression:"product_dialog.category_id"}})],1),a("el-form-item",{attrs:{prop:"product_name",label:"id",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入id"},model:{value:t.product_dialog.product_name,callback:function(e){t.$set(t.product_dialog,"product_name",e)},expression:"product_dialog.product_name"}})],1),a("el-form-item",{attrs:{prop:"caption",label:"產品名稱",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入名稱"},model:{value:t.product_dialog.caption,callback:function(e){t.$set(t.product_dialog,"caption",e)},expression:"product_dialog.caption"}})],1),a("el-form-item",{attrs:{prop:"remarks",label:"備註"}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入備註"},model:{value:t.product_dialog.remarks,callback:function(e){t.$set(t.product_dialog,"remarks",e)},expression:"product_dialog.remarks"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.dialogVisible_add=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.add_check}},[t._v("確定")])],1)],1),a("el-autocomplete",{staticStyle:{position:"relative",left:"400px"},attrs:{"fetch-suggestions":t.querySearch,placeholder:"請輸入名稱"},on:{input:t.category_filter},model:{value:t.sort_value,callback:function(e){t.sort_value=e},expression:"sort_value"}}),a("el-tabs",{staticStyle:{width:"95%"},attrs:{type:"card"},on:{"tab-click":t.tabClick},model:{value:t.TabsValue,callback:function(e){t.TabsValue=e},expression:"TabsValue"}},[t._l(t.Tabs,(function(t,e){return a("el-tab-pane",{key:t.name,attrs:{label:t.label,name:t.name}})})),a("el-table",{attrs:{data:t.tableData}},[a("el-table-column",{attrs:{prop:"category_id",label:"產品類別",width:"100"}}),a("el-table-column",{attrs:{prop:"product_name",label:"id",width:"250"}}),a("el-table-column",{attrs:{prop:"caption",label:"產品名稱",fit:""}}),a("el-table-column",{attrs:{prop:"remarks",label:"備註",width:"150"}}),a("el-table-column",{attrs:{prop:"description",label:"操作",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-button",{attrs:{type:"primary",icon:"el-icon-edit",size:"small",circle:""},on:{click:function(e){return t.edit_assign(r)}}}),a("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"small",circle:""},on:{click:function(e){return t.delete_product(r)}}}),void 0]}}])})],1)],2),a("el-dialog",{attrs:{align:"left",title:"使用者表單-修改",visible:t.dialogVisible_edit},on:{"update:visible":function(e){t.dialogVisible_edit=e}}},[a("el-form",{attrs:{model:t.product_dialog,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"category_id",label:"產品類別",required:""}},[a("el-autocomplete",{attrs:{"fetch-suggestions":t.querySearch_category_id,placeholder:"請輸入產品類別"},model:{value:t.product_dialog.category_id,callback:function(e){t.$set(t.product_dialog,"category_id",e)},expression:"product_dialog.category_id"}})],1),a("el-form-item",{attrs:{prop:"product_name",label:"id",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入id"},model:{value:t.product_dialog.product_name,callback:function(e){t.$set(t.product_dialog,"product_name",e)},expression:"product_dialog.product_name"}})],1),a("el-form-item",{attrs:{prop:"caption",label:"產品名稱",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入名稱"},model:{value:t.product_dialog.caption,callback:function(e){t.$set(t.product_dialog,"caption",e)},expression:"product_dialog.caption"}})],1),a("el-form-item",{attrs:{prop:"remarks",label:"備註"}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入備註"},model:{value:t.product_dialog.remarks,callback:function(e){t.$set(t.product_dialog,"remarks",e)},expression:"product_dialog.remarks"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.dialogVisible_edit=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:function(e){return t.edit_check()}}},[t._v("確定")])],1)],1)],1)],1)],1)],1)},Ne=[];function Ce(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=Ie(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function Ie(t,e){if(t){if("string"===typeof t)return Je(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Je(t,e):void 0}}function Je(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var Ee={components:{Aside:vt},data:function(){return{tableData:[],all_Data:[],product_data:[],option_data:[],origin_data:[],tab_data:[],info_data:[],TabsValue:"1",Tabs:[{label:"all",name:"1"},{label:"ezCAM",name:"2"},{label:"ezCAT",name:"3"},{label:"ezTool",name:"4"},{label:"Quote",name:"5"},{label:"ezPlan",name:"6"},{label:"ezDI",name:"7"},{label:"Other",name:"8"}],sort_value:"",caption_opt:[],dialogVisible_add:!1,product_dialog:{product_id:0,category_id:"",product_name:"",caption:"",remarks:""},dialogVisible_edit:!1,category_id_opt:[]}},created:function(){var t=this;this.axios.get("/admin_product",{headers:{"Content-Encoding":"gzip"}}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.product_data=JSON.parse(JSON.stringify(t.all_Data["product_data"])),t.option_data=JSON.parse(JSON.stringify(t.all_Data["option_data"])),t.info_data=JSON.parse(JSON.stringify(t.all_Data["info_data"])),t.tableData=JSON.parse(JSON.stringify(t.all_Data["product_data"])),t.origin_data=JSON.parse(JSON.stringify(t.tableData)),t.tab_data=JSON.parse(JSON.stringify(t.tableData));var a,r=Ce(t.tableData);try{for(r.s();!(a=r.n()).done;){var o=a.value;t.caption_opt.push({value:o["caption"],label:o["caption"]})}}catch(d){r.e(d)}finally{r.f()}var i,n=new Set,l=Ce(t.tableData);try{for(l.s();!(i=l.n()).done;){var s=i.value;n.add(s["category_id"])}}catch(d){l.e(d)}finally{l.f()}var c,u=Ce(n);try{for(u.s();!(c=u.n()).done;){var p=c.value;t.category_id_opt.push({value:p,label:p})}}catch(d){u.e(d)}finally{u.f()}}))},methods:{add_check:function(){var t=this;if(""!=this.product_dialog["category_id"]&&""!=this.product_dialog["product_name"]&&""!=this.product_dialog["caption"]){var e,a=Ce(this.product_data);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(r.product_id!=this.product_dialog.product_id&&r.caption==this.product_dialog.caption)return void this.$message({type:"error",message:"產品名稱與其他資料重複"});if(r.product_id!=this.product_dialog.product_id&&r.product_name==this.product_dialog.product_name)return void this.$message({type:"error",message:"id與其他資料重複"})}}catch(o){a.e(o)}finally{a.f()}this.$confirm("是否要新增{"+this.product_dialog["caption"]+"}產品","新增",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){t.axios.get("/operator_product",{params:{data:JSON.stringify(t.product_dialog),operator:"add"}}).then((function(e){location.reload(),t.$message({type:"success",message:"新增成功!"})}))})).catch((function(){t.$message({type:"info",message:"已取消新增"})}))}else this.$message({type:"error",message:"請填寫完整新增表單"})},add_assign:function(){this.dialogVisible_add=!0,this.product_dialog.product_id=0,this.product_dialog.category_id="",this.product_dialog.product_name="",this.product_dialog.caption="",this.product_dialog.remarks=""},edit_check:function(){var t=this;if(""!=this.product_dialog["category_id"]&&""!=this.product_dialog["product_name"]&&""!=this.product_dialog["caption"]){var e,a={},r=Ce(this.product_data);try{for(r.s();!(e=r.n()).done;){var o=e.value;a[o["product_id"]]={caption:o["caption"],category_id:o["category_id"],product_id:o["product_id"],product_name:o["product_name"],remarks:o["remarks"]}}}catch(s){r.e(s)}finally{r.f()}if(console.log(a),a[this.product_dialog.product_id]["category_id"]!=this.product_dialog.category_id||a[this.product_dialog.product_id]["product_name"]!=this.product_dialog.product_name||a[this.product_dialog.product_id]["caption"]!=this.product_dialog.caption||a[this.product_dialog.product_id]["remarks"]!=this.product_dialog.remarks){var i,n=Ce(this.product_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;if(l.product_id!=this.product_dialog.product_id&&l.caption==this.product_dialog.caption)return void this.$message({type:"error",message:"產品名稱與其他資料重複"});if(l.product_id!=this.product_dialog.product_id&&l.product_name==this.product_dialog.product_name)return void this.$message({type:"error",message:"id與其他資料重複"})}}catch(s){n.e(s)}finally{n.f()}a[this.product_dialog.product_id]["caption"]!=this.product_dialog.caption?this.$confirm(" 是否要將 {"+a[this.product_dialog.product_id]["caption"]+"} 改為 {"+this.product_dialog.caption+"}","修改",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){t.axios.get("/operator_product",{params:{data:JSON.stringify(t.product_dialog),operator:"edit"}}).then((function(e){location.reload(),t.$message({type:"success",message:"修改成功!"})}))})).catch((function(){t.$message({type:"info",message:"已取消修改"})})):this.axios.get("/operator_product",{params:{data:JSON.stringify(this.product_dialog),operator:"edit"}}).then((function(e){location.reload(),t.$message({type:"success",message:"修改成功!"})}))}else this.$message({type:"error",message:"未做任何修改，請修改後重新再試"})}else this.$message({type:"error",message:"請填寫完整新增表單"})},edit_assign:function(t){this.dialogVisible_edit=!0,this.product_dialog.product_id=t.product_id,this.product_dialog.category_id=t.category_id,this.product_dialog.product_name=t.product_name,this.product_dialog.caption=t.caption,this.product_dialog.remarks=t.remarks},delete_product:function(t){var e=this;this.$confirm("是否刪除「 "+t["caption"]+" 」?","刪除",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){var a,r=Ce(e.info_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;if(t["product_name"]==o["func_uid"])return void e.$message({type:"error",message:"當前資料還有此產品資料, 不允許刪除"})}}catch(s){r.e(s)}finally{r.f()}var i,n=Ce(e.option_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;if(t["product_name"]==l["product_name"])return void e.$message({type:"error",message:"此產品下尚有option功能, 不允許刪除"})}}catch(s){n.e(s)}finally{n.f()}e.axios.get("/operator_product",{params:{data:JSON.stringify(t),operator:"delete"}}).then((function(t){location.reload()})),e.$message({type:"success",message:"删除成功!"})})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},tabClick:function(t,e){if(this.sort_value="","all"==t.label)this.tableData=JSON.parse(JSON.stringify(this.origin_data)),this.tab_data=JSON.parse(JSON.stringify(this.origin_data));else if("Other"==t.label){this.tableData=JSON.parse(JSON.stringify(this.origin_data));var a,r=new Set,o=Ce(this.Tabs);try{for(o.s();!(a=o.n()).done;){var i=a.value;"Other"!=i["label"]&&r.add(i["label"])}}catch(s){o.e(s)}finally{o.f()}for(var n=0;n<this.tableData.length;n++)r.has(this.tableData[n]["category_id"])&&(this.tableData.splice(n,1),n--);this.tab_data=JSON.parse(JSON.stringify(this.origin_data))}else{this.tableData=JSON.parse(JSON.stringify(this.origin_data));for(var l=0;l<this.tableData.length;l++)this.tableData[l]["category_id"]!=t.label&&(this.tableData.splice(l,1),l--);this.tab_data=JSON.parse(JSON.stringify(this.tableData))}},category_filter:function(){if(this.tableData=JSON.parse(JSON.stringify(this.tab_data)),""!=this.sort_value)for(var t=0;t<this.tableData.length;t++)-1==this.tableData[t]["caption"].indexOf(this.sort_value)&&(this.tableData.splice(t,1),t--)},querySearch:function(t,e){var a=t?this.caption_opt.filter(this.createFilter(t)):this.caption_opt;e(a)},querySearch_category_id:function(t,e){var a=t?this.category_id_opt.filter(this.createFilter(t)):this.category_id_opt;e(a)},createFilter:function(t){return function(e){return-1!=String(e.value).toLowerCase().indexOf(String(t).toLowerCase())}}}},Ae=Ee,ze=Object(s["a"])(Ae,$e,Ne,!1,null,null,null),je=ze.exports,Te=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-container",[a("Aside"),a("el-container",[a("el-main",[a("el-button",{staticStyle:{position:"relative",right:"480px"},attrs:{type:"primary",icon:"el-icon-plus",plain:""},on:{click:t.add_assign}},[t._v("新增")]),a("el-dialog",{attrs:{align:"left",title:"使用者表單-新增",visible:t.dialogVisible_add},on:{"update:visible":function(e){t.dialogVisible_add=e}}},[a("el-form",{attrs:{model:t.option_dialog,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"product_name",label:"產品id",required:""}},[a("el-select",{attrs:{placeholder:"請選擇產品id"},model:{value:t.option_dialog.product_name,callback:function(e){t.$set(t.option_dialog,"product_name",e)},expression:"option_dialog.product_name"}},t._l(t.product_name_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"option_name",label:"選項id",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入選項id"},model:{value:t.option_dialog.option_name,callback:function(e){t.$set(t.option_dialog,"option_name",e)},expression:"option_dialog.option_name"}})],1),a("el-form-item",{attrs:{prop:"caption",label:"選項名稱",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入名稱"},model:{value:t.option_dialog.caption,callback:function(e){t.$set(t.option_dialog,"caption",e)},expression:"option_dialog.caption"}})],1),a("el-form-item",{attrs:{prop:"remarks",label:"備註"}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入備註"},model:{value:t.option_dialog.remarks,callback:function(e){t.$set(t.option_dialog,"remarks",e)},expression:"option_dialog.remarks"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.dialogVisible_add=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.add_check}},[t._v("確定")])],1)],1),a("el-autocomplete",{staticStyle:{position:"relative",left:"400px"},attrs:{"fetch-suggestions":t.querySearch,placeholder:"請輸入選項名稱"},on:{input:t.category_filter},model:{value:t.sort_value,callback:function(e){t.sort_value=e},expression:"sort_value"}}),a("el-tabs",{staticStyle:{width:"95%"},attrs:{type:"card"},on:{"tab-click":t.tabClick},model:{value:t.TabsValue,callback:function(e){t.TabsValue=e},expression:"TabsValue"}},[t._l(t.Tabs,(function(t,e){return a("el-tab-pane",{key:t.name,attrs:{label:t.label,name:t.name}})})),a("el-table",{attrs:{data:t.tableData}},[a("el-table-column",{attrs:{prop:"category_id",label:"選項類別",width:"100"}}),a("el-table-column",{attrs:{prop:"product_name",label:"產品id",width:"150"}}),a("el-table-column",{attrs:{prop:"option_name",label:"選項id",width:"250"}}),a("el-table-column",{attrs:{prop:"caption",label:"選項名稱",width:"200"}}),a("el-table-column",{attrs:{prop:"remarks",label:"備註",fit:""}}),a("el-table-column",{attrs:{prop:"description",label:"操作",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-button",{attrs:{type:"primary",icon:"el-icon-edit",size:"small",circle:""},on:{click:function(e){return t.edit_assign(r)}}}),a("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"small",circle:""},on:{click:function(e){return t.delete_option(r)}}}),void 0]}}])})],1)],2),a("el-dialog",{attrs:{align:"left",title:"使用者表單-修改",visible:t.dialogVisible_edit},on:{"update:visible":function(e){t.dialogVisible_edit=e}}},[a("el-form",{attrs:{model:t.option_dialog,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"category_id",label:"產品類別",required:""}},[a("span",[t._v(t._s(t.option_dialog.category_id))])]),a("el-form-item",{attrs:{prop:"product_name",label:"產品id",required:""}},[a("el-select",{attrs:{placeholder:"請選擇產品id"},model:{value:t.option_dialog.product_name,callback:function(e){t.$set(t.option_dialog,"product_name",e)},expression:"option_dialog.product_name"}},t._l(t.product_name_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"option_name",label:"選項id",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入選項id"},model:{value:t.option_dialog.option_name,callback:function(e){t.$set(t.option_dialog,"option_name",e)},expression:"option_dialog.option_name"}})],1),a("el-form-item",{attrs:{prop:"caption",label:"選項名稱",required:""}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入名稱"},model:{value:t.option_dialog.caption,callback:function(e){t.$set(t.option_dialog,"caption",e)},expression:"option_dialog.caption"}})],1),a("el-form-item",{attrs:{prop:"remarks",label:"備註"}},[a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"請輸入備註"},model:{value:t.option_dialog.remarks,callback:function(e){t.$set(t.option_dialog,"remarks",e)},expression:"option_dialog.remarks"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.dialogVisible_edit=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:function(e){return t.edit_check()}}},[t._v("確定")])],1)],1)],1)],1)],1)],1)},Me=[];function Ke(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=Be(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function Be(t,e){if(t){if("string"===typeof t)return Pe(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Pe(t,e):void 0}}function Pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var Le={components:{Aside:vt},data:function(){return{tableData:[],all_Data:[],product_data:[],option_data:[],origin_data:[],tab_data:[],info_data:[],TabsValue:"1",Tabs:[{label:"all",name:"1"},{label:"ezCAM",name:"2"},{label:"ezCAT",name:"3"},{label:"ezTool",name:"4"},{label:"Quote",name:"5"},{label:"ezPlan",name:"6"},{label:"ezDI",name:"7"},{label:"Other",name:"8"}],sort_value:"",caption_opt:[],dialogVisible_add:!1,option_dialog:{option_id:0,category_id:"",product_name:"",option_name:"",caption:"",remarks:""},dialogVisible_edit:!1,product_name_opt:[]}},created:function(){var t=this;this.axios.get("/admin_option",{headers:{"Content-Encoding":"gzip"}}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.product_data=JSON.parse(JSON.stringify(t.all_Data["product_data"])),t.option_data=JSON.parse(JSON.stringify(t.all_Data["option_data"])),t.info_data=JSON.parse(JSON.stringify(t.all_Data["info_data"])),t.tableData=JSON.parse(JSON.stringify(t.all_Data["option_data"])),t.origin_data=JSON.parse(JSON.stringify(t.tableData)),t.tab_data=JSON.parse(JSON.stringify(t.tableData));var a,r=new Set,o=Ke(t.tableData);try{for(o.s();!(a=o.n()).done;){var i=a.value;r.add(i["caption"])}}catch(d){o.e(d)}finally{o.f()}var n,l=Ke(r);try{for(l.s();!(n=l.n()).done;){var s=n.value;t.caption_opt.push({value:s,label:s})}}catch(d){l.e(d)}finally{l.f()}var c,u=Ke(t.product_data);try{for(u.s();!(c=u.n()).done;){var p=c.value;t.product_name_opt.push({value:p.product_name,label:p.product_name})}}catch(d){u.e(d)}finally{u.f()}}))},methods:{add_check:function(){var t=this;if(""!=this.option_dialog["option_name"]&&""!=this.option_dialog["product_name"]&&""!=this.option_dialog["caption"]){var e,a=Ke(this.option_data);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(r.option_id!=this.option_dialog.option_id&&r.caption==this.option_dialog.caption)return void this.$message({type:"error",message:"選項名稱與其他資料重複"});if(r.option_id!=this.option_dialog.option_id&&r.option_name==this.option_dialog.option_name)return void this.$message({type:"error",message:"選項id與其他資料重複"})}}catch(o){a.e(o)}finally{a.f()}this.$confirm("是否要新增{"+this.option_dialog["caption"]+"}產品","新增",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){t.axios.get("/operator_option",{params:{data:JSON.stringify(t.option_dialog),operator:"add"}}).then((function(e){location.reload(),t.$message({type:"success",message:"新增成功!"})}))})).catch((function(){t.$message({type:"info",message:"已取消新增"})}))}else this.$message({type:"error",message:"請填寫完整新增表單"})},add_assign:function(){this.dialogVisible_add=!0,this.option_dialog.option_id=0,this.option_dialog.category_id="",this.option_dialog.product_name="",this.option_dialog.option_name="",this.option_dialog.caption="",this.option_dialog.remarks=""},edit_check:function(){var t=this;if(""!=this.option_dialog["product_name"]&&""!=this.option_dialog["option_name"]&&""!=this.option_dialog["caption"]){var e,a={},r=Ke(this.option_data);try{for(r.s();!(e=r.n()).done;){var o=e.value;console.log(o),a[o["option_id"]]={caption:o["caption"],category_id:o["category_id"],option_id:o["option_id"],option_name:o["option_name"],product_name:o["product_name"],remarks:o["remarks"]}}}catch(s){r.e(s)}finally{r.f()}if(a[this.option_dialog.option_id]["product_name"]!=this.option_dialog.product_name||a[this.option_dialog.option_id]["option_name"]!=this.option_dialog.option_name||a[this.option_dialog.option_id]["caption"]!=this.option_dialog.caption||a[this.option_dialog.option_id]["remarks"]!=this.option_dialog.remarks){var i,n=Ke(this.option_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;if(l.option_id!=this.option_dialog.option_id&&l.caption==this.option_dialog.caption)return void this.$message({type:"error",message:"選項名稱與其他資料重複"});if(l.option_id!=this.option_dialog.option_id&&l.option_name==this.option_dialog.option_name)return void this.$message({type:"error",message:"選項id與其他資料重複"})}}catch(s){n.e(s)}finally{n.f()}a[this.option_dialog.option_id]["caption"]!=this.option_dialog.caption?this.$confirm(" 是否要將 {"+a[this.option_dialog.option_id]["caption"]+"} 改為 {"+this.option_dialog.caption+"}","修改",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){t.axios.get("/operator_option",{params:{data:JSON.stringify(t.option_dialog),operator:"edit"}}).then((function(e){location.reload(),t.$message({type:"success",message:"修改成功!"})}))})).catch((function(){t.$message({type:"info",message:"已取消修改"})})):this.axios.get("/operator_option",{params:{data:JSON.stringify(this.option_dialog),operator:"edit"}}).then((function(e){location.reload(),t.$message({type:"success",message:"修改成功!"})}))}else this.$message({type:"error",message:"未做任何修改，清修改後重新再試"})}else this.$message({type:"error",message:"請填寫完整新增表單"})},edit_assign:function(t){this.dialogVisible_edit=!0,this.option_dialog.option_id=t.option_id,this.option_dialog.category_id=t.category_id,this.option_dialog.product_name=t.product_name,this.option_dialog.option_name=t.option_name,this.option_dialog.caption=t.caption,this.option_dialog.remarks=t.remarks},delete_option:function(t){var e=this;this.$confirm("是否刪除「 "+t["caption"]+" 」?","刪除",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning"}).then((function(){var a,r=Ke(e.info_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;if(t["option_name"]==o["func_uid"])return void e.$message({type:"error",message:"當前資料還有此選項資料, 不允許刪除"})}}catch(i){r.e(i)}finally{r.f()}e.axios.get("/operator_option",{params:{data:JSON.stringify(t),operator:"delete"}}).then((function(t){location.reload()})),e.$message({type:"success",message:"删除成功!"})})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},tabClick:function(t,e){if(this.sort_value="","all"!=t.label){this.tableData=JSON.parse(JSON.stringify(this.origin_data));for(var a=0;a<this.tableData.length;a++)this.tableData[a]["category_id"]!=t.label&&(this.tableData.splice(a,1),a--);this.tab_data=JSON.parse(JSON.stringify(this.tableData))}else this.tableData=JSON.parse(JSON.stringify(this.origin_data)),this.tab_data=JSON.parse(JSON.stringify(this.origin_data))},category_filter:function(){if(this.tableData=JSON.parse(JSON.stringify(this.tab_data)),""!=this.sort_value)for(var t=0;t<this.tableData.length;t++)-1==this.tableData[t]["caption"].indexOf(this.sort_value)&&(this.tableData.splice(t,1),t--)},querySearch:function(t,e){var a=t?this.caption_opt.filter(this.createFilter(t)):this.caption_opt;e(a)},createFilter:function(t){return function(e){return-1!=String(e.value).toLowerCase().indexOf(String(t).toLowerCase())}}}},qe=Le,Fe=Object(s["a"])(qe,Te,Me,!1,null,null,null),Ue=Fe.exports,Re=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticStyle:{"margin-top":"-50px"}},[r("img",{attrs:{src:a("3d5b")}}),r("br"),r("div",{staticClass:"title"},[t._v("Welcome to License Application Service")]),r("br"),r("el-card",{staticStyle:{margin:"0 auto",width:"500px",position:"relative"}},[r("div",{staticStyle:{position:"absolute",right:"0",top:"0"}},[r("el-button",{attrs:{icon:"el-icon-close",circle:""},on:{click:t.exit}})],1),r("div",{staticStyle:{margin:"0 auto",width:"400px"}},[r("br"),r("br"),r("div",{staticClass:"title"},[t._v("Sign up")]),r("br"),r("br"),r("div",{staticClass:"caption"},[t._v("Account "),r("span",{staticStyle:{color:"red"}},[t._v("*")])]),r("el-input",{staticClass:"input",model:{value:t.form.user,callback:function(e){t.$set(t.form,"user",e)},expression:"form.user"}}),r("br"),r("br"),r("div",{staticClass:"caption"},[t._v("Email address "),r("span",{staticStyle:{color:"red"}},[t._v("*")])]),r("el-autocomplete",{staticClass:"suggestion",attrs:{"fetch-suggestions":t.querySearch_email},model:{value:t.form.email,callback:function(e){t.$set(t.form,"email",e)},expression:"form.email"}}),r("br"),r("br"),r("div",{staticClass:"caption"},[t._v("Password "),r("span",{staticStyle:{color:"red"}},[t._v("*")])]),r("el-input",{staticClass:"input",attrs:{"show-password":""},model:{value:t.form.mypassword,callback:function(e){t.$set(t.form,"mypassword",e)},expression:"form.mypassword"}}),r("br"),r("br"),r("div",{staticClass:"caption"},[t._v("Business area "),r("span",{staticStyle:{color:"red"}},[t._v("*")])]),r("el-select",{staticStyle:{width:"445px","border-color":"black"},model:{value:t.form.myregion,callback:function(e){t.$set(t.form,"myregion",e)},expression:"form.myregion"}},t._l(t.region_opt,(function(t){return r("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),r("br"),r("br"),r("br"),r("div",[r("el-button",{staticClass:"button",on:{click:t.signup}},[t._v("Create Account")]),r("br"),r("br")],1)],1)])],1)},Ve=[];function He(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=We(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function We(t,e){if(t){if("string"===typeof t)return Ge(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Ge(t,e):void 0}}function Ge(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var Ze={name:"signup",data:function(){return{all_Data:[],user_data:[],group_data:[],groups_opt:[],region_opt:[],form:{id:0,user:"",password:"",mypassword:"",email:"",groups:"",region:"",myregion:"",record:"",description:"",admin_mail:""},submit_status:!1}},created:function(){var t=this;this.axios.get("/admin_user",{}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.region_data=JSON.parse(JSON.stringify(t.all_Data["region_data"])),t.group_data=JSON.parse(JSON.stringify(t.all_Data["group_data"])),t.user_data=JSON.parse(JSON.stringify(t.all_Data["user_data"]));var a,r=He(t.region_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;t.region_opt.push({value:o.name,label:o.name})}}catch(p){r.e(p)}finally{r.f()}var i,n=He(t.user_data);try{for(n.s();!(i=n.n()).done;){var l,s=i.value,c=He(s["groups"]);try{for(c.s();!(l=c.n()).done;){var u=l.value;"1"==u&&(t.form.admin_mail+="".concat(s["email"],";"))}}catch(p){c.e(p)}finally{c.f()}}}catch(p){n.e(p)}finally{n.f()}}))},mounted:function(){var t=this;document.onkeydown=function(e){if("signup"==t.$route.name){var a=window.event.keyCode;13==a&&t.signup()}}},methods:{signup:function(){var t=this;if(1!=this.submit_status){if(this.submit_status=!0,""==this.form.user)return this.$message({message:"請填入使用者名稱",type:"error"}),void(this.submit_status=!1);if(""==this.form.mypassword)return this.$message({message:"請填入使用者密碼",type:"error"}),void(this.submit_status=!1);if(""==this.form.email)return this.$message({message:"請填入使用者信箱",type:"error"}),void(this.submit_status=!1);if(""==this.form.myregion)return this.$message({message:"請選擇使用者地區",type:"error"}),void(this.submit_status=!1);if(void 0==this.form.email.split("@")[1])return this.$message({message:"請填入正確email格式",type:"error"}),void(this.submit_status=!1);var e,a=He(this.user_data);try{for(a.s();!(e=a.n()).done;){var r=e.value;if(this.form.user==r["user"])return"to be confirmed"==r["description"]?this.$message({message:"使用者 "+this.form.user+" 等待審核中!",type:"error"}):this.$message({message:"使用者 "+this.form.user+" 已存在!",type:"error"}),void(this.submit_status=!1)}}catch(_){a.e(_)}finally{a.f()}var o,i=He(this.user_data);try{for(i.s();!(o=i.n()).done;){var n=o.value;if(this.form.email==n["email"])return"to be confirmed"==n["description"]?this.$message({message:"Email： "+this.form.email+" 等待審核中!",type:"error"}):this.$message({message:"Email： "+this.form.email+" 已存在!",type:"error"}),void(this.submit_status=!1)}}catch(_){i.e(_)}finally{i.f()}this.form.record=JSON.stringify({type:"new",user:this.form.user,email:this.form.email,password:this.form.mypassword,region:this.form.myregion}),this.form.description="to be confirmed",this.form.password=Date.now().toString(16).slice(-5);var l,s=He(this.group_data);try{for(s.s();!(l=s.n()).done;){var c=l.value;c["caption"]==this.form.myregion&&(this.form.groups=c["group_id"])}}catch(_){s.e(_)}finally{s.f()}this.form.groups="["+JSON.stringify(this.form.groups)+"]";var u,p=He(this.region_data);try{for(p.s();!(u=p.n()).done;){var d=u.value;this.form.myregion==d["name"]&&(this.form.region=d["region_id"])}}catch(_){p.e(_)}finally{p.f()}this.form.region="["+JSON.stringify(this.form.region)+"]",this.axios.post("/send_signup_email",{origin_data:this.form}).then((function(e){"郵件傳送成功!"==e.data?(t.$message({showClose:!0,message:"已傳送帳號申請通知!",type:"success"}),t.axios.get("/operator_user",{params:{form:JSON.stringify(t.form),operator:"add"}}),t.$router.push({name:"login"})):t.$message({showClose:!0,message:"帳號申請失敗!",type:"error"})})).catch((function(){t.$message({showClose:!0,message:"smtp失效!",type:"error"})}))}},exit:function(){this.$router.push({name:"login"})},querySearch_email:function(t,e){if(-1==t.indexOf("@"))var a=[{value:"".concat(t,"@eastek.com.tw"),label:"".concat(t,"@eastek.com.tw")},{value:"".concat(t,"@eastek.com.cn"),label:"".concat(t,"@eastek.com.cn")}];else{a=[];var r=t.split("@")[0],o=t.split("@")[1];-1!="@eastek.com.tw".indexOf(o)&&a.push({value:"".concat(r,"@eastek.com.tw"),label:"".concat(r,"@eastek.com.tw")}),-1!="@eastek.com.cn".indexOf(o)&&a.push({value:"".concat(r,"@eastek.com.cn"),label:"".concat(r,"@eastek.com.cn")})}e(a)}}},Ye=Ze,Qe=(a("7662"),Object(s["a"])(Ye,Re,Ve,!1,null,null,null)),Xe=Qe.exports,ta=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticStyle:{"margin-top":"-50px"}},[r("img",{attrs:{src:a("3d5b")}}),r("br"),r("div",{staticClass:"title"},[t._v("Welcome to License Application Service")]),r("br"),r("el-card",{staticStyle:{margin:"0 auto",width:"500px",position:"relative"}},[r("div",{staticStyle:{position:"absolute",right:"0",top:"0"}},[r("el-button",{attrs:{icon:"el-icon-close",circle:""},on:{click:t.exit}})],1),r("div",{staticStyle:{margin:"0 auto",width:"400px"}},[r("br"),r("br"),r("div",{staticClass:"title"},[t._v("Reset Password")]),r("br"),r("br"),r("div",{staticClass:"caption"},[t._v("Email address "),r("span",{staticStyle:{color:"red"}},[t._v("*")])]),r("el-autocomplete",{staticClass:"suggestion",attrs:{"fetch-suggestions":t.querySearch_email},model:{value:t.email,callback:function(e){t.email=e},expression:"email"}}),r("br"),r("br"),r("br"),r("br"),r("br"),r("div",[r("el-button",{staticClass:"button",on:{click:t.reset}},[t._v("Reset Password")]),r("br"),r("br")],1)],1)])],1)},ea=[],aa={name:"resetPassword",data:function(){return{email:""}},mounted:function(){var t=this;document.onkeydown=function(e){if("resetPassword"==t.$route.name){var a=window.event.keyCode;13==a&&t.reset()}}},methods:{reset:function(){var t=this;this.axios.get("/reset_password",{params:{email:JSON.stringify(this.email)}}).then((function(e){var a=e.data;"無此信箱!"==a.msg?t.$message({message:a.msg,type:"error"}):"找到信箱!"==a.msg&&(t.$alert("原密碼已改為隨機數字，若要變更請到後台管理更改<br>原帳號: ".concat(a.user,"<br>新密碼: ").concat(a.password),"密碼變更!",{dangerouslyUseHTMLString:!0,confirmButtonText:"確定"}),t.$router.push({name:"login"}))}))},exit:function(){this.$router.push({name:"login"})},querySearch_email:function(t,e){if(-1==t.indexOf("@"))var a=[{value:"".concat(t,"@eastek.com.tw"),label:"".concat(t,"@eastek.com.tw")},{value:"".concat(t,"@eastek.com.cn"),label:"".concat(t,"@eastek.com.cn")}];else{a=[];var r=t.split("@")[0],o=t.split("@")[1];-1!="@eastek.com.tw".indexOf(o)&&a.push({value:"".concat(r,"@eastek.com.tw"),label:"".concat(r,"@eastek.com.tw")}),-1!="@eastek.com.cn".indexOf(o)&&a.push({value:"".concat(r,"@eastek.com.cn"),label:"".concat(r,"@eastek.com.cn")})}e(a)}}},ra=aa,oa=(a("fb92"),Object(s["a"])(ra,ta,ea,!1,null,null,null)),ia=oa.exports,na=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-link",{staticStyle:{position:"relative",left:"280px",bottom:"50px"},attrs:{type:"success",icon:"el-icon-s-custom"}},[t._v(t._s(t.user))]),a("el-table",{staticStyle:{width:"60%",margin:"0 auto"},attrs:{data:t.tableData}},[a("el-table-column",{attrs:{prop:"user",label:"使用者","min-width":""}}),a("el-table-column",{attrs:{prop:"password",label:"密碼","min-width":""}}),a("el-table-column",{attrs:{prop:"email",label:"信箱","min-width":""}}),a("el-table-column",{attrs:{prop:"region",label:"地區","min-width":""}}),a("el-table-column",{attrs:{prop:"record",label:"確認申請資訊","min-width":""},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;e.$index;return[a("el-button",{attrs:{type:"primary",icon:"el-icon-s-claim",size:"small",circle:""},on:{click:function(e){return t.confirm(r)}}}),a("el-dialog",{attrs:{title:"申請資訊",visible:t.edit_lock},on:{"update:visible":function(e){t.edit_lock=e}}},[a("el-form",{attrs:{model:t.form,"label-width":"80px"}},[a("el-form-item",{attrs:{prop:"user",label:"使用者",required:""}},[a("el-input",{staticStyle:{width:"30%"},attrs:{placeholder:"請輸入使用者名稱"},model:{value:t.form.user,callback:function(e){t.$set(t.form,"user",e)},expression:"form.user"}})],1),a("el-form-item",{attrs:{prop:"password",label:"密碼",required:""}},[a("el-input",{staticStyle:{width:"30%"},attrs:{placeholder:"請輸入密碼"},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}})],1),a("el-form-item",{attrs:{prop:"email",label:"信箱",required:""}},[a("el-input",{staticStyle:{width:"30%"},attrs:{placeholder:"請輸入信箱"},model:{value:t.form.email,callback:function(e){t.$set(t.form,"email",e)},expression:"form.email"}})],1),a("el-form-item",{attrs:{prop:"groups",label:"群組"}},[a("el-select",{staticStyle:{width:"34%"},attrs:{multiple:"",placeholder:"請輸入群組"},model:{value:t.form.groups,callback:function(e){t.$set(t.form,"groups",e)},expression:"form.groups"}},t._l(t.groups_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"region",label:"區域"}},[a("el-select",{staticStyle:{width:"34%"},attrs:{placeholder:"請輸入區域"},model:{value:t.form.myregion,callback:function(e){t.$set(t.form,"myregion",e)},expression:"form.myregion"}},t._l(t.region_opt,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{prop:"description",label:"描述"}},[a("el-input",{staticStyle:{width:"50%"},attrs:{placeholder:"請輸入描述"},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"warning",plain:""},on:{click:t.deny}},[t._v("否決")]),a("el-button",{attrs:{type:"danger",plain:""},on:{click:function(e){t.edit_lock=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",plain:""},on:{click:t.submit}},[t._v("確定")])],1)],1)]}}])})],1)],1)},la=[];function sa(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=ca(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function ca(t,e){if(t){if("string"===typeof t)return ua(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?ua(t,e):void 0}}function ua(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var pa={components:{Aside:vt},data:function(){return{user:[],tableData:[],all_Data:[],user_data:[],region_data:[],region_opt:[],group_data:[],groups_opt:[],form:{id:0,user:"",password:"",email:"",groups:[],region:"",myregion:"",record:"",description:"",admin_mail:"",inspector:""},edit_lock:!1}},created:function(){var t=this;this.user=this.$route.params.verifyname,this.axios.get("/admin_user",{}).then((function(e){t.all_Data=JSON.parse(JSON.stringify(e.data)),t.group_data=JSON.parse(JSON.stringify(t.all_Data["group_data"])),t.region_data=JSON.parse(JSON.stringify(t.all_Data["region_data"])),t.user_data=JSON.parse(JSON.stringify(t.all_Data["user_data"]));var a,r=sa(t.user_data);try{for(r.s();!(a=r.n()).done;){var o=a.value,i=o["record"].indexOf('{"type":"new"');if(-1!=i){var n=JSON.parse(o["record"]);"new"==n["type"]&&t.tableData.push({id:o["user_id"],user:n["user"],password:n["password"],email:n["email"],region:n["region"]})}}}catch(y){r.e(y)}finally{r.f()}var l,s=sa(t.user_data);try{for(s.s();!(l=s.n()).done;){var c,u=l.value,p=sa(u["groups"]);try{for(p.s();!(c=p.n()).done;){var d=c.value;"1"==d&&(t.form.admin_mail+="".concat(u["email"],","))}}catch(y){p.e(y)}finally{p.f()}}}catch(y){s.e(y)}finally{s.f()}var _,f=sa(t.group_data);try{for(f.s();!(_=f.n()).done;){var h=_.value;t.groups_opt.push({value:h.caption,label:h.caption})}}catch(y){f.e(y)}finally{f.f()}var m,g=sa(t.region_data);try{for(g.s();!(m=g.n()).done;){var v=m.value;t.region_opt.push({value:v.name,label:v.name})}}catch(y){g.e(y)}finally{g.f()}}))},methods:{confirm:function(t){this.edit_lock=!0,this.form.id=t["id"],this.form.user=t["user"],this.form.password=t["password"],this.form.email=t["email"],this.form.region=t["region"],this.form.myregion=t["region"]},submit:function(){var t=this;if(this.form.inspector=this.user,""!=this.form.user&&""!=this.form.password&&""!=this.form.email)if(void 0!=this.form.email.split("@")[1]){if(this.form.groups=JSON.stringify(this.form.groups).replace('["',"").replace('"]',"").replace(/","/g,","),this.form.record="","[]"!=this.form.groups){this.form.groups=this.form.groups.split(",");for(var e=0;e<this.form.groups.length;e++){var a,r=sa(this.group_data);try{for(r.s();!(a=r.n()).done;){var o=a.value;this.form.groups[e]==o["caption"]&&(this.form.groups[e]=o["group_id"])}}catch(s){r.e(s)}finally{r.f()}}this.form.groups=JSON.stringify(this.form.groups)}else this.form.groups="";if(""!=this.form.myregion){var i,n=sa(this.region_data);try{for(n.s();!(i=n.n()).done;){var l=i.value;this.form.myregion==l["name"]&&(this.form.region=l["region_id"])}}catch(s){n.e(s)}finally{n.f()}this.form.region="["+JSON.stringify(this.form.region)+"]"}else this.form.region="";this.axios.post("/operator_user",{params:{form:JSON.stringify(this.form),operator:"edit"}}).then((function(e){t.axios.post("/send_signup_success_email",{origin_data:t.form}).then((function(e){"郵件傳送成功!"==e.data?(t.$message({type:"success",message:"已傳送帳號確認通知!"}),location.reload(),t.add_lock=!1,t.form.id=0,t.form.user="",t.form.password="",t.form.email="",t.form.groups=[],t.form.region="",t.form.record="",t.form.description="",t.form.admin_mail="",t.form.inspector=""):t.$message({type:"success",message:"帳號申請失敗!"})}))}))}else this.$message({message:"請填入正確email格式",type:"error"});else this.$message({message:"請填入群組名稱及群組類別及信箱",type:"error"})},deny:function(){var t=this;this.$confirm("否決此帳號申請?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.axios.get("/operator_user",{params:{user_name:JSON.stringify(t.form.user),operator:"delete"}}).then((function(t){location.reload()}))})).catch((function(){t.$message({type:"info",message:"已取消"})}))}}},da=pa,_a=(a("6600"),Object(s["a"])(da,na,la,!1,null,null,null)),fa=_a.exports;r["default"].use(p["a"]);var ha=new p["a"]({routes:[{path:"*",redirect:"/"},{path:"/login",name:"login",component:lt},{path:"/signup",name:"signup",component:Xe},{path:"/resetPassword",name:"resetPassword",component:ia},{path:"/",name:"Show_All",component:g},{path:"/keyid",name:"KeyID",component:se},{path:"/edit",name:"edit",component:$},{path:"/add",name:"add",component:M},{path:"/handle",name:"handle",component:V},{path:"/check/:verifyname",name:"check",component:et},{path:"/admin",name:"admin",component:Dt},{path:"/password",name:"password",component:Zt},{path:"/new_user/:verifyname",name:"new_user",component:fa},{path:"/user",name:"user",component:zt},{path:"/group",name:"group",component:Ut},{path:"/product",name:"product",component:je},{path:"/option",name:"option",component:Ue},{path:"/region",name:"region",component:Oe},{path:"/product_group",name:"product_group",component:ge}]}),ma=a("5c96"),ga=a.n(ma),va=(a("0fae"),a("bc3a")),ya=a.n(va),ba=a("a7fe"),xa=a.n(ba),wa=a("4328"),Sa=a.n(wa);r["default"].prototype.$qs=Sa.a,r["default"].config.productionTip=!1,r["default"].use(xa.a,ya.a),ya.a.defaults.baseURL="/api",r["default"].use(ga.a),r["default"].config.devtools=!0,ha.beforeEach((function(t,e,a){"/check/:verifyname"!=t.matched[0].path&&"/new_user/:verifyname"!=t.matched[0].path||(sessionStorage.setItem("token","ImLogin"),ya.a.get("/auto_login",{params:{user:t.params.verifyname}}).then((function(t){var e=t.data["user"],a=t.data["authority"];sessionStorage.setItem("user",JSON.stringify(e)),sessionStorage.setItem("authority",JSON.stringify(a))})));var r="ImLogin"==sessionStorage.getItem("token");if(r)if("/option"==t.path||"/product"==t.path||"/product_group"==t.path||"/user"==t.path||"/group"==t.path||"/region"==t.path){var o=JSON.parse(sessionStorage.getItem("authority"));"/region"==t.path?o.includes("區域權限")?a():(alert("無此權限"),a("/admin")):"/product"==t.path||"/product_group"==t.path||"/option"==t.path?o.includes("產品權限")?a():(alert("無此權限"),a("/admin")):"/user"!=t.path&&"/group"!=t.path||(o.includes("使用者權限")?a():(alert("無此權限"),a("/admin")))}else a();else"/signup"==t.path||"/resetPassword"==t.path?a():"/login"!==t.path?a("/login"):a()}));var ka=new r["default"]({router:ha,render:function(t){return t(u)}});ka.$mount("#app")},"64a9":function(t,e,a){},6600:function(t,e,a){"use strict";var r=a("5301"),o=a.n(r);o.a},"66ca":function(t,e,a){"use strict";var r=a("3774"),o=a.n(r);o.a},"682f":function(t,e,a){"use strict";var r=a("3013"),o=a.n(r);o.a},7662:function(t,e,a){"use strict";var r=a("eda6"),o=a.n(r);o.a},"7b04":function(t,e,a){"use strict";var r=a("1262"),o=a.n(r);o.a},"7c9b":function(t,e,a){"use strict";var r=a("3a04"),o=a.n(r);o.a},"7d69":function(t,e,a){"use strict";var r=a("3a14"),o=a.n(r);o.a},"8e8c":function(t,e,a){},"91a9":function(t,e,a){},9489:function(t,e,a){},"94d8":function(t,e,a){},9942:function(t,e,a){"use strict";var r=a("2ea6"),o=a.n(r);o.a},"9ce0":function(t,e,a){"use strict";var r=a("b377"),o=a.n(r);o.a},a94b:function(t,e,a){"use strict";var r=a("00e8"),o=a.n(r);o.a},b377:function(t,e,a){},baaf:function(t,e,a){},be6f:function(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es7_symbol_async_iterator__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("ac4d"),core_js_modules_es7_symbol_async_iterator__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es7_symbol_async_iterator__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("8a81"),core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es6_array_from__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("1c4c"),core_js_modules_es6_array_from__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es6_array_from__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("6b54"),core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("456d"),core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es6_number_parse_int__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("04ff"),core_js_modules_es6_number_parse_int__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es6_number_parse_int__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es6_number_is_integer__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("7cdf"),core_js_modules_es6_number_is_integer__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es6_number_is_integer__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("c5f6"),core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_7__),D_intern_project_license_web_vue_test_simple_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("ade3"),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("28a5"),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("55dd"),core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es6_map__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("f400"),core_js_modules_es6_map__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es6_map__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("ac6a"),core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es6_string_iterator__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("5df3"),core_js_modules_es6_string_iterator__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es6_string_iterator__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_es6_set__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("4f7f"),core_js_modules_es6_set__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es6_set__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("6762"),core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es6_string_includes__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("2fdb"),core_js_modules_es6_string_includes__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es6_string_includes__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("7f7f"),core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_17__),_assets_loading__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("04f5");function _createForOfIteratorHelper(t,e){var a;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||e&&t&&"number"===typeof t.length){a&&(t=a);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){a=t[Symbol.iterator]()},n:function(){var t=a.next();return n=t.done,t},e:function(t){l=!0,i=t},f:function(){try{n||null==a.return||a.return()}finally{if(l)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"===typeof t)return _arrayLikeToArray(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}function merge(t,e,a){var r=[],o=0,i=0;while(o<t.length&&i<e.length)t[o][a]>e[i][a]?(r.push(t[o]),o++):(r.push(e[i]),i++);return r.concat(t.slice(o)).concat(e.slice(i))}function ascending_order(t,e){if(1===t.length)return t;var a=t.length,r=Math.floor(a/2),o=t.slice(0,r),i=t.slice(r);return merge(ascending_order(o,e),ascending_order(i,e),e)}function toHalf(t){for(var e="",a=0,r=t.length;a<r;a++){var o=t[a].charCodeAt(0);o>=65280&&o<=65519&&(o=255&o+32),e+=String.fromCharCode(o)}return e}__webpack_exports__["a"]={components:{Loading:_assets_loading__WEBPACK_IMPORTED_MODULE_18__["a"]},name:"Show_All",data:function(){return{all_Data:{},tableData:[],origin_Data:[],filter_Data:[],sort_Data:[],checked_Data:[],application_data:[],currentPage:1,pagesize:10,user:[],TabsValue:"1",Tabs:[],customer_opt:[],customer_value:"",customer_fliter:[],customer_input:"",customer_dict:{},issued_opt:[],issued_value:null,KeyID_opt:[],KeyID_value:"",KeyID_fliter:[],KeyID_input:"",product_opt:[],product_value:"",product_fliter:[],product_input:"",contact_opt:[],contact_value:"",contact_fliter:[],contact_input:"",expiration_opt:[],expiration_value:null,count_opt:[],count_value:"",count_fliter:[],count_input:"",region_opt:[],region_value:"",region_fliter:[],region_input:"",type_opt:[],type_value:"",type_fliter:[],type_input:"",category_opt:[],category_value:"",category_fliter:[],category_input:"",module_opt:[],module_value:"",module_fliter:[],module_input:"",version_opt:[],version_value:"",version_fliter:[],version_input:"",expiring_days:30,expiring_check:!1,expired_check:!1,num_handle:0,num_check:0,all_checked:!1,mode:"產品",update_time:"",git_push_time:"",deter_download:!1,deter_check:!1,isLoading:!0,select_out:!1,detail:!1,search_drawer:!1,search_drawer_btn:!0,apply_record_dialog:!1,apply_record_map:{},download_format:"",download_data:[],keypro_application_time:"",official_application_time:"",license_time:"",form:{form_customer:"",form_KeyID:"",form_data:{fold:[],expand:[]},apply_record:[]},info_keyID:[],multi_keyID_dialog:!1,multi_keyID_text:"",multi_keyID_mode:"",error_message:{digital_error:"",type_error:"",exist_error:""},searched_data_num:0}},created:function(){var t=this;"yes"==sessionStorage.getItem("first_time_login")?this.axios.get("/get_editing_num",{params:{user:JSON.parse(sessionStorage.getItem("user"))[0]}}).then((function(e){sessionStorage.setItem("first_time_login","no"),0!=e.data?t.$confirm("尚有 ".concat(e.data," 筆資料未送出, 是否前往確認 ?"),"提示",{confirmButtonText:"是(前往查看)",cancelButtonText:"否(刪除申請資料)",type:"warning",center:!0,closeOnClickModal:!1,showClose:!1}).then((function(){t.$router.push({name:"handle"})})).catch((function(){t.axios.get("/handle_delete",{params:{Row:JSON.stringify([]),user:JSON.stringify(JSON.parse(sessionStorage.getItem("user")))}}).then((function(t){location.reload()}))})):location.reload()})):this.axios.get("/show_all",{headers:{"Content-Encoding":"gzip"},params:{user:JSON.stringify(JSON.parse(sessionStorage.getItem("user")))}}).then((function(e){void 0!=sessionStorage["authority"]&&JSON.parse(sessionStorage.getItem("authority")).includes("下載權限")&&(t.deter_download=!0),t.user=JSON.parse(sessionStorage.getItem("user")),t.all_Data=JSON.parse(JSON.stringify(e.data)),t.application_data=t.all_Data["application_data"],t.update_time=t.all_Data["update_time"],t.git_push_time=t.all_Data["git_push_time"],t.axios.get("/get_editing_num",{params:{user:t.user[0]}}).then((function(e){t.num_handle=e.data}));var a,r=_createForOfIteratorHelper(e.data["customer_data"]);try{for(r.s();!(a=r.n()).done;){var o=a.value;""!=o["site"]?t.customer_opt.push({value:o["name"]+"|"+o["site"],label:o["name"]+"|"+o["site"]}):t.customer_opt.push({value:o["name"],label:o["name"]}),t.customer_dict[o["customer_id"]]={name:o["name"],site:o["site"]}}}catch(Ot){r.e(Ot)}finally{r.f()}var i=[],n=new Set,l=new Set,s=new Set,c=new Set,u=new Set,p=new Map;e.data["module_data"].forEach((function(t){return p.set(t["mod_uid"],t["caption"])}));var d,_=_createForOfIteratorHelper(e.data["info_data"]);try{for(_.s();!(d=_.n()).done;){var f,h=d.value,m=h["contact"],g=m.split(","),v=_createForOfIteratorHelper(g);try{for(v.s();!(f=v.n()).done;){var y=f.value;l.add(y.split("@")[0])}}catch(Ot){v.e(Ot)}finally{v.f()}n.add(h["count"]),i.push(h["func_uid"]),s.add(h["issued"]),c.add(h["expiration"]),void 0!=p.get(h["type"])&&u.add(p.get(h["type"])),t.version_opt.map((function(t){return t.value})).indexOf(h["version"])<0&&t.version_opt.push({value:h["version"],label:h["version"]})}}catch(Ot){_.e(Ot)}finally{_.f()}l.forEach((function(e){return t.contact_opt.push({value:e,label:e})})),e.data["sn_data"].forEach((function(e){return t.KeyID_opt.push({value:e["sn"],label:e["sn"]})})),n.forEach((function(e){return t.count_opt.push({value:e,label:e})})),e.data["region_data"].forEach((function(e){return t.region_opt.push({value:e["name"],label:e["name"]})}));var b,x=new Set,w=new Set,S=_createForOfIteratorHelper(e.data["product_data"]);try{for(S.s();!(b=S.n()).done;){var k=b.value;i.includes(k["product_name"])&&x.add(k["caption"]),t.category_opt.map((function(t){return t.value})).indexOf(k["category_id"])<0&&t.category_opt.push({value:k["category_id"],label:k["category_id"]})}}catch(Ot){S.e(Ot)}finally{S.f()}var D,O=_createForOfIteratorHelper(e.data["option_data"]);try{for(O.s();!(D=O.n()).done;){var $=D.value;i.includes($["option_name"])&&x.add($["caption"]),w.add($["product_name"])}}catch(Ot){O.e(Ot)}finally{O.f()}s.forEach((function(e){return t.issued_opt.push({value:e,label:e})})),c.forEach((function(e){return t.expiration_opt.push({value:e,label:e})})),u.forEach((function(e){return t.type_opt.push({value:e,label:e})}));var N,C=JSON.parse(JSON.stringify(e.data.info_data)),I=e.data["sn_dict"],J=0,E=new Map,A=new Map,z=_createForOfIteratorHelper(e.data["product_data"]);try{for(z.s();!(N=z.n()).done;){var j=N.value;E.set(j["product_name"],{category_id:j["category_id"],caption:j["caption"]})}}catch(Ot){z.e(Ot)}finally{z.f()}var T,M=_createForOfIteratorHelper(e.data["option_data"]);try{for(M.s();!(T=M.n()).done;){var K=T.value;A.set(K["option_name"],{category_id:E.get(K["product_name"])["category_id"],product_name:K["product_name"],caption:K["caption"]})}}catch(Ot){M.e(Ot)}finally{M.f()}var B,P={},L=_createForOfIteratorHelper(e.data["region_data"]);try{for(L.s();!(B=L.n()).done;){var q=B.value;P[q["region_id"]]={name:q["name"],description:q["description"]}}}catch(Ot){L.e(Ot)}finally{L.f()}var F,U=_createForOfIteratorHelper(e.data["info_data"]);try{for(U.s();!(F=U.n()).done;){var R=F.value;if(void 0!=I[R["sn"]]&&(""!=t.customer_dict[I[R["sn"]]["sn_id"]]["site"]?C[J]=Object.assign(C[J],Object(D_intern_project_license_web_vue_test_simple_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_8__["a"])({customer:t.customer_dict[I[R["sn"]]["sn_id"]]["name"]+"|"+t.customer_dict[I[R["sn"]]["sn_id"]]["site"],user:I[R["sn"]]["user"],info:[I[R["sn"]]["note1"],I[R["sn"]]["note2"],I[R["sn"]]["note3"],I[R["sn"]]["note4"],I[R["sn"]]["note5"]],version:R["version"]},"info",R["info"])):C[J]=Object.assign(C[J],Object(D_intern_project_license_web_vue_test_simple_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_8__["a"])({customer:t.customer_dict[I[R["sn"]]["sn_id"]]["name"],user:I[R["sn"]]["user"],info:[I[R["sn"]]["note1"],I[R["sn"]]["note2"],I[R["sn"]]["note3"],I[R["sn"]]["note4"],I[R["sn"]]["note5"]],version:R["version"]},"info",R["info"])),isNaN(I[R["sn"]]["region"])?C[J]=Object.assign(C[J],{region:I[R["sn"]]["region"]}):""!=I[R["sn"]]["region"]?C[J]=Object.assign(C[J],{region:P[parseInt(I[R["sn"]]["region"],10)]["name"]}):C[J]=Object.assign(C[J],{region:""})),void 0!=A.get(R["func_uid"])){C[J]=Object.assign(C[J],{category:A.get(R["func_uid"])["category_id"],module:A.get(R["func_uid"])["caption"]});var V=A.get(R["func_uid"])["caption"];t.module_opt.map((function(t){return t.value})).indexOf(V)<0&&t.module_opt.push({value:V,label:V}),C[J]["product"]=A.get(R["func_uid"])["product_name"],void 0!=E.get(C[J]["product"])&&(C[J]["product"]=E.get(C[J]["product"])["caption"]);var H=C[J]["product"];t.product_opt.map((function(t){return t.value})).indexOf(H)<0&&t.product_opt.push({value:H,label:H})}else if(void 0!=E.get(R["func_uid"])){C[J]=Object.assign(C[J],{category:E.get(R["func_uid"])["category_id"],module:""}),C[J]["product"]=E.get(R["func_uid"])["caption"];var W=C[J]["product"];t.product_opt.map((function(t){return t.value})).indexOf(W)<0&&t.product_opt.push({value:W,label:W})}else C[J]=Object.assign(C[J],{category:"",module:""}),C[J]["product"]=R["func_uid"];void 0!=p.get(R["type"])&&(C[J]["type"]=p.get(R["type"])),J++,t.info_keyID.includes(R["sn"])||t.info_keyID.push(R["sn"])}}catch(Ot){U.e(Ot)}finally{U.f()}0!=C.length&&(C=ascending_order(C,"expiration"));var G=new Date;G.setHours(G.getHours());var Z=G.toISOString().slice(0,10);G.setMonth(G.getMonth()+1);var Y=G.toISOString().slice(0,10),Q=C.filter((function(t){return t["expiration"]<Y&&t["expiration"]>Z}));C=C.filter((function(t){return t["expiration"]>=Y||t["expiration"]<=Z}));var X,tt=_createForOfIteratorHelper(Q);try{for(tt.s();!(X=tt.n()).done;){var et=X.value;C.unshift(et)}}catch(Ot){tt.e(Ot)}finally{tt.f()}var at,rt=_createForOfIteratorHelper(C);try{for(rt.s();!(at=rt.n()).done;){var ot=at.value;ot=Object.assign(ot,{contact_display:ot["contact"]}),ot=Object.assign(ot,{user_display:ot["user"]})}}catch(Ot){rt.e(Ot)}finally{rt.f()}t.count_opt=t.count_opt.sort((function(t,e){return t.value>e.value?1:-1})),t.Tabs.push({label:"總表",name:"1"}),t.Tabs.push({label:"一個月內過期",name:"一個月內過期"});var it,nt=_createForOfIteratorHelper(t.category_opt);try{for(nt.s();!(it=nt.n()).done;){var lt=it.value;t.Tabs.push({label:lt.value,name:lt.value})}}catch(Ot){nt.e(Ot)}finally{nt.f()}t.Tabs.push({label:"已過期",name:"已過期"});var st=1413/t.Tabs.length;document.documentElement.style.setProperty("--tabwidth","".concat(st,"px")),t.axios.post("/get_file_update_time",{path:"public/static/keypro_application.docx"}).then((function(e){t.keypro_application_time=e.data})),t.axios.post("/get_file_update_time",{path:"public/static/official_application.xls"}).then((function(e){t.official_application_time=e.data})),t.axios.post("/get_file_update_time",{path:"public/static/license"}).then((function(e){t.license_time=e.data}));var ct,ut=_createForOfIteratorHelper(t.application_data);try{for(ut.s();!(ct=ut.n()).done;){var pt=ct.value;"wait_for_verification"==pt["status"]&&(t.num_check+=1)}}catch(Ot){ut.e(Ot)}finally{ut.f()}var dt,_t=_createForOfIteratorHelper(t.all_Data["user_data"]);try{for(_t.s();!(dt=_t.n()).done;){var ft=dt.value;"to be confirmed"==ft["description"]&&(t.num_check+=1)}}catch(Ot){_t.e(Ot)}finally{_t.f()}var ht,mt=_createForOfIteratorHelper(t.all_Data["user_data"]);try{for(mt.s();!(ht=mt.n()).done;){var gt=ht.value;if(gt["user"]==t.user[0]){(gt["groups"].includes(5)||gt["groups"].includes(6))&&(t.deter_check=!0);break}}}catch(Ot){mt.e(Ot)}finally{mt.f()}var vt,yt=_createForOfIteratorHelper(t.application_data);try{for(yt.s();!(vt=yt.n()).done;){var bt,xt=vt.value,wt=_createForOfIteratorHelper(JSON.parse(xt["data"]));try{for(wt.s();!(bt=wt.n()).done;){var St=bt.value;St["sn"]in t.apply_record_map?t.apply_record_map[St["sn"]].push({id:xt["id"],date:xt["date"],applicant:xt["applicant"],status:xt["status"],verify_time:xt["verify_time"].replaceAll('"',""),operator:St["operator"],customer:St["customer"],sn:St["sn"],product:St["product"],module:St["module"],version:St["version"],type:St["type"],count:St["count"],expiration:St["expiration"],region:St["region"],comment:St["comment"],contact:St["contact"]}):t.apply_record_map[St["sn"]]=[{id:xt["id"],date:xt["date"],applicant:xt["applicant"],status:xt["status"],verify_time:xt["verify_time"].replaceAll('"',""),operator:St["operator"],customer:St["customer"],sn:St["sn"],product:St["product"],module:St["module"],version:St["version"],type:St["type"],count:St["count"],expiration:St["expiration"],region:St["region"],comment:St["comment"],contact:St["contact"]}]}}catch(Ot){wt.e(Ot)}finally{wt.f()}}}catch(Ot){yt.e(Ot)}finally{yt.f()}t.origin_Data=C,t.tableData=C,t.filter_Data=C,t.sort_Data=C;var kt=JSON.parse(t.all_Data["user_data"].filter((function(e){return e["user"]==t.user[0]}))[0]["setting"]);"all"==kt["pagesize"]?t.pagesize=100:t.pagesize=kt["pagesize"],t.customer_fliter=t.customer_opt,t.KeyID_fliter=t.KeyID_opt,t.category_fliter=t.category_opt,t.product_fliter=t.product_opt,t.module_fliter=t.module_opt,t.version_fliter=t.version_opt,t.count_fliter=t.count_opt,t.type_fliter=t.type_opt,t.region_fliter=t.region_opt,t.contact_fliter=t.contact_opt;var Dt=JSON.parse(sessionStorage.getItem("fliter"));Dt&&(Dt["customer_value"]&&(t.customer_value=Dt["customer_value"]),Dt["KeyID_value"]&&(t.KeyID_value=Dt["KeyID_value"]),Dt["category_value"]&&(t.category_value=Dt["category_value"]),Dt["product_value"]&&(t.product_value=Dt["product_value"]),Dt["module_value"]&&(t.module_value=Dt["module_value"]),Dt["version_value"]&&(t.version_value=Dt["version_value"]),Dt["issued_value"]&&(t.issued_value=Dt["issued_value"]),Dt["count_value"]&&(t.count_value=Dt["count_value"]),Dt["type_value"]&&(t.type_value=Dt["type_value"]),Dt["region_value"]&&(t.region_value=Dt["region_value"]),Dt["contact_value"]&&(t.contact_value=Dt["contact_value"]),Dt["expiration_value"]&&(t.expiration_value=Dt["expiration_value"]),Dt["expiring_days"]&&(t.expiring_days=Dt["expiring_days"]),Dt["expiring_check"]&&(t.expiring_check=Dt["expiring_check"]),Dt["expired_check"]&&(t.expired_check=Dt["expired_check"]),void 0==Dt&&JSON.stringify(Dt)==JSON.stringify({})||t.category_filter()),"product"!=kt["mode"]&&t.$router.push({name:"KeyID"}),t.search_drawer=!0,t.isLoading=!1}))},methods:{click_apply_record:function(){this.form.apply_record=[];var t={},e=this.form.form_KeyID;if(void 0!=this.apply_record_map[e]){var a,r=_createForOfIteratorHelper(this.apply_record_map[e]);try{for(r.s();!(a=r.n()).done;){var o=a.value;o["id"]in t?t[o["id"]].push({operator:o["operator"],customer:o["customer"],sn:o["sn"],product:o["product"],module:o["module"],version:o["version"],type:o["type"],count:o["count"],expiration:o["expiration"],region:o["region"],comment:o["comment"],contact:o["contact"]}):t[o["id"]]=[{operator:o["operator"],customer:o["customer"],sn:o["sn"],product:o["product"],module:o["module"],version:o["version"],type:o["type"],count:o["count"],expiration:o["expiration"],region:o["region"],comment:o["comment"],contact:o["contact"]}]}}catch(c){r.e(c)}finally{r.f()}var i,n=[],l=_createForOfIteratorHelper(this.apply_record_map[e]);try{for(l.s();!(i=l.n()).done;){var s=i.value;n.includes(s["id"])||(this.form.apply_record.push({id:s["id"],date:s["date"],applicant:s["applicant"],status:s["status"],verify_time:s["verify_time"],data:t[s["id"]]}),n.push(s["id"]))}}catch(c){l.e(c)}finally{l.f()}}this.apply_record_dialog=!0},drawer_open:function(){this.search_drawer=!0,this.search_drawer_btn=!1,document.getElementById("showtable").style.width="75%"},drawer_close:function(){this.search_drawer=!1,document.getElementById("showtable").style.width="85%"},contact_enter:function(){this.contact_value.push(this.contact_input),this.contact_input=""},contact_fliterer:function(t){t&&(this.contact_input=t,this.contact_fliter=this.contact_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},region_enter:function(){this.region_value.push(this.region_input),this.region_input=""},region_fliterer:function(t){t&&(this.region_input=t,this.region_fliter=this.region_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},type_enter:function(){this.type_value.push(this.type_input),this.type_input=""},type_fliterer:function(t){t&&(this.type_input=t,this.type_fliter=this.type_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},count_enter:function(){this.count_value.push(this.count_input),this.count_input=""},count_fliterer:function(t){t&&(this.count_input=t,this.count_fliter=this.count_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},version_enter:function(){this.version_value.push(this.version_input),this.version_input=""},version_fliterer:function(t){t&&(this.version_input=t,this.version_fliter=this.version_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},module_enter:function(){this.module_value.push(this.module_input),this.module_input=""},module_fliterer:function(t){t&&(this.module_input=t,this.module_fliter=this.module_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},product_enter:function(){this.product_value.push(this.product_input),this.product_input=""},product_fliterer:function(t){t&&(this.product_input=t,this.product_fliter=this.product_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},category_enter:function(){this.category_value.push(this.category_input),this.category_input=""},category_fliterer:function(t){t&&(this.category_input=t,this.category_fliter=this.category_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},customer_enter:function(){this.customer_value.push(this.customer_input),this.customer_input=""},customer_fliterer:function(t){t&&(this.customer_input=t,this.customer_fliter=this.customer_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},KeyID_enter:function(){this.KeyID_value.push(this.KeyID_input),this.KeyID_input=""},KeyID_fliterer:function(t){t&&(this.KeyID_input=t,this.KeyID_fliter=this.KeyID_opt.filter((function(e){if(~String(e["label"]).indexOf(t))return!0})))},select_change:function(){this.select_out=!this.select_out},pagesize_change:function(){var t=this;"all"==t.pagesize?(t.pagesize=t.tableData.length,t.axios.post("/save_to_user_setting",{source:"product",user:t.user[0],mode:"product",pagesize:"all"})):t.axios.post("/save_to_user_setting",{source:"product",user:t.user[0],mode:"product",pagesize:parseInt(t.pagesize)})},mode_switch:function(t){var e=this;"KeyID"==t&&this.axios.post("/save_to_user_setting",{source:"product",user:e.user[0],mode:t,pagesize:e.pagesize}).then((function(t){e.$router.push({name:"KeyID"})}))},all_check:function(){1==this.all_checked?this.$refs.showtable.toggleAllSelection():this.$refs.showtable.clearSelection()},selection_column_style:function(t){if(0==t.columnIndex)return"selection_style"},Logout:function(){sessionStorage.clear(),this.$router.push("/login")},GoCheck:function(){this.$router.push({path:"/check/".concat(this.user[0])})},GoHandle:function(){this.$router.push({name:"handle"})},GoAdd:function(){this.checked_Data.forEach((function(t){return delete t["info"]})),this.$router.push({name:"add",query:{checked_Data:JSON.stringify(this.checked_Data)}})},GoEdit:function(){void 0!=this.checked_Data[0]?(delete this.all_Data["info_data"],this.checked_Data.forEach((function(t){return delete t["info"]})),this.$router.push({name:"edit",query:{user:JSON.stringify(this.user),checked_Data:JSON.stringify(this.checked_Data),all_Data:JSON.stringify(this.all_Data)}})):this.$alert("請選取欲修改的資料","",{center:!0,type:"warning"})},Go_Edit_time:function(){var t=this;void 0==this.checked_Data[0]?(this.multi_keyID_mode="展延",this.error_message.digital_error="",this.error_message.type_error="",this.error_message.exist_error="",this.multi_keyID_dialog=!0):this.$prompt("請輸入到期日","到期日修改",{confirmButtonText:"確定",cancelButtonText:"取消",inputType:"date",inputPattern:/\d.\d.\d/,inputErrorMessage:"輸入日期不合法!"}).then((function(e){var a,r=e.value,o=_createForOfIteratorHelper(t.checked_Data);try{for(o.s();!(a=o.n()).done;){var i=a.value;i=Object.assign(i,{operator:"修改"}),i=Object.assign(i,{expiration:r}),delete i["info"]}}catch(n){o.e(n)}finally{o.f()}t.axios.post("/save_to_handle",{checked_Data:t.checked_Data,content:"延展到期日",user:t.user}).then((function(){t.$confirm("","下一步",{confirmButtonText:"送出申請",cancelButtonText:"返回主頁面",type:"warning",center:!0}).then((function(){t.$router.push({name:"handle"})})).catch((function(){location.reload()}))}))})).catch((function(){t.$message({type:"info",message:"已取消修改"})}))},multi_keyID_dialog_click:function(){var t=this;if(this.multi_keyID_text=document.getElementById("multi_keyID_textarea").value,void 0!=this.multi_keyID_text&&null!=this.multi_keyID_text){this.multi_keyID_error_message="";var e=[],a=[],r=[],o=[];this.error_message.digital_error="",this.error_message.type_error="",this.error_message.exist_error="";var i=/^[0-9]*$/,n=toHalf(this.multi_keyID_text);if(0!=n.trim().length){var l,s=_createForOfIteratorHelper(n.split(";"));try{for(s.s();!(l=s.n()).done;){var c=l.value;""!=c.trim()&&(7!=c.trim().length?a.push(c.trim()):i.test(c.trim())?this.info_keyID.includes(Number(c.trim()))?e.push(c.trim()):o.push(c.trim()):r.push(c.trim()))}}catch(h){s.e(h)}finally{s.f()}if(a.length&&(this.error_message.digital_error="錯誤 - 只允許 7 碼數字：".concat(a.join("、"))),r.length&&(this.error_message.type_error="錯誤 - 只允許數字和 ;：".concat(r.join("、"))),o.length&&(this.error_message.exist_error="錯誤 - 以下id不存在：".concat(o.join("、"))),this.multi_keyID_text+=" ",this.multi_keyID_text=this.multi_keyID_text.substring(0,this.multi_keyID_text.length-1),!a.length&&!r.length&&!o.length)if("展延"==this.multi_keyID_mode)this.$prompt("請輸入到期日","到期日修改",{confirmButtonText:"確定",cancelButtonText:"取消",inputType:"date",inputPattern:/\d.\d.\d/,inputErrorMessage:"輸入日期不合法!"}).then((function(a){var r,o=a.value,i=[],n=_createForOfIteratorHelper(t.origin_Data);try{for(n.s();!(r=n.n()).done;){var l=r.value;if(e.includes(String(l["sn"]))){var s=JSON.parse(JSON.stringify(l));delete s["info"],s=Object.assign(s,{operator:"修改"}),s=Object.assign(s,{expiration:o}),s=Object.assign(s,{operation_type:"multiple_expand"}),i.push(s)}}}catch(h){n.e(h)}finally{n.f()}t.axios.post("/save_to_handle",{checked_Data:i,content:"延展到期日",user:t.user}).then((function(){t.$confirm("","下一步",{confirmButtonText:"送出申請",cancelButtonText:"返回主頁面",type:"warning",center:!0}).then((function(){t.$router.push({name:"handle"})})).catch((function(){location.reload()}))}))})).catch((function(){t.$message({type:"info",message:"已取消修改"})}));else if("刪除"==this.multi_keyID_mode){var u,p=[],d=_createForOfIteratorHelper(this.origin_Data);try{for(d.s();!(u=d.n()).done;){var _=u.value;if(e.includes(String(_["sn"]))){var f=JSON.parse(JSON.stringify(_));delete f["info"],f=Object.assign(f,{operator:"刪除"}),f=Object.assign(f,{operation_type:"multiple_delete"}),p.push(f)}}}catch(h){d.e(h)}finally{d.f()}this.axios.post("/save_to_handle",{checked_Data:p,content:"",user:this.user}).then((function(){t.$confirm("","下一步",{confirmButtonText:"送出申請",cancelButtonText:"返回主頁面",type:"warning",center:!0}).then((function(){t.$router.push({name:"handle"})})).catch((function(){location.reload()}))}))}}}},GoDownload:function(){var t,e=this,a=[],r=0,o=_createForOfIteratorHelper(this.download_data);try{for(o.s();!(t=o.n()).done;){var i=t.value;a.push(i),a[r]=Object.assign(a[r],{operator:"下載"}),r++}}catch(n){o.e(n)}finally{o.f()}"excel"==this.download_format?this.axios({method:"post",url:"/download_show",data:{format:"excel",user:this.user,data:a},responseType:"blob"}).then((function(t){e.tranfer_xlsx(t.data)})):"csv"==this.download_format?this.axios({method:"post",url:"/download_show",data:{format:"csv",user:this.user,data:a}}).then((function(t){e.tranfer_csv(t.data)})):"json"==this.download_format&&this.axios({method:"post",url:"/download_show",data:{format:"json",user:this.user,data:a}}).then((function(t){e.tranfer_json(t.data)}))},GoDelete:function(){var t=this;void 0==this.checked_Data[0]?(this.multi_keyID_mode="刪除",this.error_message.digital_error="",this.error_message.type_error="",this.error_message.exist_error="",this.multi_keyID_dialog=!0):this.$confirm("確定要刪除嗎?","提示",{confirmButtonText:"確定",cancelButtonText:"取消",type:"warning",center:!0}).then((function(){var e,a=_createForOfIteratorHelper(t.checked_Data);try{for(a.s();!(e=a.n()).done;){var r=e.value;r=Object.assign(r,{operator:"刪除"}),delete r["info"]}}catch(o){a.e(o)}finally{a.f()}t.axios.post("/save_to_handle",{checked_Data:t.checked_Data,content:"",user:t.user}).then((function(){t.$confirm("","下一步",{confirmButtonText:"送出申請",cancelButtonText:"返回主頁面",type:"warning",center:!0}).then((function(){t.$router.push({name:"handle"})})).catch((function(){location.reload()}))}))})).catch((function(){t.$message({type:"info",message:"已取消刪除"})}))},rowclick:function(t,e,a){""!=e["label"]&&this.$refs.showtable.toggleRowSelection(t)},handleSelectionChange:function(t){this.checked_Data=JSON.parse(JSON.stringify(t))},sortChange:function(t){var e=JSON.parse(JSON.stringify(this.sort_Data));if(0!=e.length){var a=ascending_order(e,t.prop);"ascending"==t.order?this.tableData=a:"descending"==t.order?this.tableData=a.reverse():this.tableData=this.sort_Data}},clear_filter:function(){this.customer_value=[],this.issued_value=null,this.KeyID_value=[],this.product_value=[],this.contact_value=[],this.expiration_value=null,this.count_value=[],this.region_value=[],this.type_value=[],this.category_value=[],this.module_value=[],this.version_value=[],this.expiring_check=!1,this.expired_check=!1,this.category_filter(),sessionStorage.setItem("fliter",JSON.stringify({}))},category_filter:function(){var t=this;if(this.expiring_check&&(!Number.isInteger(Number.parseInt(this.expiring_days))||Number.parseInt(this.expiring_days)<0))this.$alert("到期日請輸入正整數!","提示",{type:"warning",center:!0});else{for(var e in sessionStorage.setItem("fliter",JSON.stringify({customer_value:this.customer_value,KeyID_value:this.KeyID_value,category_value:this.category_value,product_value:this.product_value,module_value:this.module_value,version_value:this.version_value,count_value:this.count_value,type_value:this.type_value,region_value:this.region_value,contact_value:this.contact_value,expiring_days:this.expiring_days,expiring_check:this.expiring_check,expired_check:this.expired_check,expiration_value:this.expiration_value,issued_value:this.issued_value})),this.KeyID_value)this.KeyID_value[e]=parseInt(this.KeyID_value[e]);for(var a in this.count_value)this.count_value[a]=parseInt(this.count_value[a]);var r=[],o=!1;if(this.customer_value.length||this.KeyID_value.length||this.category_value.length||this.product_value.length||this.module_value.length||this.version_value.length||null!=this.issued_value||this.count_value.length||this.type_value.length||this.region_value.length||this.contact_value.length||null!=this.expiration_value){var i={};i["customer"]=this.customer_value,i["sn"]=this.KeyID_value,i["category"]=this.category_value,i["product"]=this.product_value,i["module"]=this.module_value,i["version"]=this.version_value,i["count"]=this.count_value,i["type"]=this.type_value,i["region"]=this.region_value,r=l(this.filter_Data,i),this.contact_value.length&&(r=s(r,this.contact_value))}else r=this.filter_Data,o=!0;null==this.expiration_value&&null==this.issued_value||(r=null==this.expiration_value?r.filter((function(e){return t.issued_value[0]<=e["issued"]&&e["issued"]<=t.issued_value[1]})):null==this.issued_value?r.filter((function(e){return t.expiration_value[0]<=e["expiration"]&&e["expiration"]<=t.expiration_value[1]})):r.filter((function(e){return t.issued_value[0]<=e["issued"]&&e["issued"]<=t.issued_value[1]&&t.expiration_value[0]<=e["expiration"]&&e["expiration"]<=t.expiration_value[1]})));var n=864e5;this.expiring_check&&this.expired_check?r=r.filter((function(e){return t.expiring_days>=parseInt((new Date(e["expiration"])-new Date)/n,10)})):this.expiring_check?r=r.filter((function(e){return t.expiring_days>=parseInt((new Date(e["expiration"])-new Date)/n,10)&&0<=parseInt((new Date(e["expiration"])-new Date)/n,10)})):this.expired_check&&(r=r.filter((function(t){return 0>parseInt((new Date(t["expiration"])-new Date)/n,10)}))),this.sort_Data=JSON.parse(JSON.stringify(r)),this.tableData=this.sort_Data,this.searched_data_num=o?0:this.tableData.length}function l(t,e){var a=Object.keys(e);return t.filter((function(t){return a.every((function(a){if(e[a].includes(void 0)||e[a].includes(NaN)||e[a].includes(null))return!0;if(e[a].length){var r,o=_createForOfIteratorHelper(e[a]);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(String(t[a]).includes(i))return!0}}catch(n){o.e(n)}finally{o.f()}return!1}return!0}))}))}function s(t,e){var a,r=[],o=_createForOfIteratorHelper(t);try{for(o.s();!(a=o.n()).done;){var i,n=a.value,l=_createForOfIteratorHelper(e);try{for(l.s();!(i=l.n()).done;){var s=i.value;if(~n["contact_display"].indexOf(s)){r.push(n);break}}}catch(c){l.e(c)}finally{l.f()}}}catch(c){o.e(c)}finally{o.f()}return r}},tabClick:function(t,e){if(this.currentPage=1,this.all_checked=!1,this.customer_value="",this.KeyID_value="",this.category_value="",this.product_value="",this.module_value="",this.version_value="",this.count_value="",this.type_value="",this.region_value="",this.contact_value="",this.issued_value=null,this.expiration_value=null,"總表"==t.label)this.tableData=this.origin_Data,this.filter_Data=this.origin_Data,this.sort_Data=this.origin_Data;else if("一個月內過期"==t.label){var a=new Date;a.setHours(a.getHours());var r=a.toISOString().slice(0,10);a.setMonth(a.getMonth()+1);var o=a.toISOString().slice(0,10);this.filter_Data=this.origin_Data.filter((function(t){return t["expiration"]<o})),this.filter_Data=this.filter_Data.filter((function(t){return t["expiration"]>r})),this.tableData=this.filter_Data,this.sort_Data=this.filter_Data}else if("已過期"==t.label){a=new Date;a.setHours(a.getHours());r=a.toISOString().slice(0,10);this.filter_Data=this.filter_Data.filter((function(t){return t["expiration"]<r})),this.tableData=this.filter_Data,this.sort_Data=this.filter_Data}else{this.filter_Data=this.origin_Data.filter((function(e){return e["category"]==t.label})),this.tableData=this.filter_Data,this.sort_Data=this.filter_Data}},tableRowColor:function(t){var e=t.row,a=t.rowIndex,r=a+(this.currentPage-1)*this.pagesize;e.index=a;var o=new Date;o.setHours(o.getHours());var i=o.toISOString().slice(0,10);o.setMonth(o.getMonth()+1);var n=o.toISOString().slice(0,10),l=this.tableData[r]["expiration"];return l<i?"exceed-row":l<n?"warning-row":"success-row"},handleCurrentChange:function(t){this.currentPage=t,this.all_checked=!1},tranfer_xlsx:function(t){if(t){var e=window.URL.createObjectURL(new Blob([t])),a=document.createElement("a");a.style.display="none",a.href=e,a.setAttribute("download","license-application.xlsx"),document.body.appendChild(a),a.click(),document.body.removeChild(a)}},tranfer_csv:function(t){if(t){var e=t.join("\n");e=new Blob(["\ufeff".concat(e)],{type:"data:text/csv;charset=utf-8,%EF%BB%BF"});var a=window.URL.createObjectURL(e),r=document.createElement("a");r.style.display="none",r.href=a,r.setAttribute("download","license-application.csv"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}},tranfer_json:function(t){if(t){var e=new Blob([JSON.stringify(t)],{type:"application/json"}),a=window.URL.createObjectURL(e),r=document.createElement("a");r.style.display="none",r.href=a,r.setAttribute("download","license-application.json"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}},detail_form:function detail_form(row){if(this.form.form_data.fold=[],this.form.form_data.expand=[],this.form.form_customer=row["customer"],this.form.form_KeyID=row["sn"],""!=row["info"]){var row_info=eval(row["info"]),_iterator29=_createForOfIteratorHelper(row_info),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var i=_step29.value;1==i.length?(this.form.form_data.fold.push(i[0]),this.form.form_data.expand.push(i)):2==i.length&&(this.form.form_data.fold.push(i[1]),this.form.form_data.expand.push(i))}}catch(err){_iterator29.e(err)}finally{_iterator29.f()}}this.detail=!0},click_download:function(){var t=this;this.download_data=this.checked_Data,this.checked_Data.length>0?this.$alert('<input type="radio" id="excel" name="downloadType" value="excel" checked><label for="excel" style="margin-right: 100px;">excel</label><input type="radio" id="csv" name="downloadType" value="csv"><label for="csv" style="margin-right: 100px;">csv</label><input type="radio" id="json" name="downloadType" value="json"><label for="json">json</label><br><br><br>-----------------------------------------------------------------------------------<br>其他文件<br><div style="position:relative; top:10px"><a href="/static/keypro_application.docx" download="keypro領用申請單.docx"><i class="el-icon-paperclip"></i>keypro領用申請單</a>'+'<span style="position:relative; right:-74px;">更新日期：'.concat(this.keypro_application_time,"</span></div>")+'<div style="position:relative; top:20px"><a href="/static/official_application.xls" download="申請永久正式key表格.xls"><i class="el-icon-paperclip"></i>申請永久正式key表格</a>'+'<span style="position:relative; right:-50px;">更新日期：'.concat(this.official_application_time,"</span></div>")+'<div style="position:relative; top:30px"><a href="/static/license" download="license"><i class="el-icon-paperclip"></i>license</a>'+'<span style="position:relative; right:-143px;">更新日期：'.concat(this.license_time,"</span></div>"),"請選擇下載格式",{dangerouslyUseHTMLString:!0,confirmButtonClass:"alert_class"}).then((function(e){document.getElementById("excel").checked?t.download_format="excel":document.getElementById("csv").checked?t.download_format="csv":document.getElementById("json").checked&&(t.download_format="json"),t.$message({type:"success",message:"開始下載"}),t.GoDownload()})).catch((function(){t.$message({type:"info",message:"取消下載"})})):this.$alert('<div style="position:relative; top:10px"><a href="/static/keypro_application.docx" download="keypro領用申請單.docx"><i class="el-icon-paperclip"></i>keypro領用申請單</a>'+'<span style="position:relative; right:-74px;">更新日期：'.concat(this.keypro_application_time,"</span></div>")+'<div style="position:relative; top:20px"><a href="/static/official_application.xls" download="申請永久正式key表格.xls"><i class="el-icon-paperclip"></i>申請永久正式key表格</a>'+'<span style="position:relative; right:-50px;">更新日期：'.concat(this.official_application_time,"</span></div>")+'<div style="position:relative; top:30px"><a href="/static/license" download="license"><i class="el-icon-paperclip"></i>license</a>'+'<span style="position:relative; right:-143px;">更新日期：'.concat(this.license_time,"</span></div><br>"),"其他文件",{dangerouslyUseHTMLString:!0})},reload:function(){location.reload()}},computed:{delay_time:function(){return 1e4*this.select_out}}}},cafe:function(t,e,a){"use strict";var r=a("8e8c"),o=a.n(r);o.a},cc6b:function(t,e,a){"use strict";var r=a("baaf"),o=a.n(r);o.a},cfb3:function(t,e,a){},dad4:function(t,e,a){"use strict";var r=a("91a9"),o=a.n(r);o.a},e824:function(t,e,a){},eda6:function(t,e,a){},fb92:function(t,e,a){"use strict";var r=a("94d8"),o=a.n(r);o.a}});
  //# sourceMappingURL=app.8ad79d42.js.map