{"version":3,"sources":["webpack:///./src/views/model/Admin/Agent/AgentAdd/AgentForm/AgentForm.vue?2e0e","webpack:///./src/views/model/Admin/Agent/AgentAdd/AgentForm/AgentForm.js","webpack:///./src/views/model/Admin/Agent/AgentAdd/AgentForm/AgentForm.js?48e9","webpack:///./src/views/model/Admin/Agent/AgentAdd/AgentForm/AgentForm.vue","webpack:///./src/views/model/Admin/Agent/AgentAdd/AgentForm/index.js","webpack:///./src/views/model/Admin/Agent/AgentAdd/AgentForm/index.scss","webpack:///./src/service/Agent/index.js"],"names":["name","data","form","agent_name","user_list","options","rules","validator","rule","val","res","length","trigger","required","methods","getUserList","keyword","$wPost","agent_id","leaderToggle","this","submit","$refs","validate","v","t","editSubmit","addSubmit","submitButton","updatedLoading","payload","HandleData","add","$wToast","success","$router","push","path","edit","replace","cancel","history","go","updateForm","cloneDeep","m","component","_vm","_h","$createElement","_c","_self","ref","staticClass","attrs","on","model","value","callback","$$v","$set","expression","scopedSlots","_u","key","fn","props","_v","_s","item","email","index","username","staticRenderFns","AgentForm","id","max_custom_num","Number","newPayload","userList","map","storage_cnt","expire_date","pay_money"],"mappings":"iHAAA,I,sECUe,GACbA,KAAM,YACNC,KAFa,WAGX,MAAO,CACLC,KAAM,CACJC,WAAY,GACZC,UAAW,IAEbC,QAAS,GACTC,MAAO,CACLH,WAAY,CAAC,CACXI,UADW,SACAC,EAAMC,EAAKC,GACR,KAARD,GACFC,EAAI,YAEFD,EAAIE,OAAS,IACfD,EAAI,gBAENA,KAEFE,QAAS,OACTC,UAASA,KAAC,EAKlBC,QAAS,CACDC,YADC,SACYC,GAAS,gKACP,EAAKC,OAAO,8BAA+B,CAC5DD,UACAE,SAAU,EAAKhB,KAAKgB,WAHI,OACpBjB,EADoB,OAK1B,EAAKI,QAAUJ,EALW,8CAO5BkB,aARO,SAQOT,GAEZU,KAAKlB,KAAKE,UAAYM,GAExBW,OAZO,WAYG,WACRD,KAAKE,MAAMpB,KAAKqB,UAASA,SAAAC,GACnBA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BAE/BE,G,iBAGT,WACE,IAAMA,EAAa,CACjB3E,WAAYiB,KAAKU,QAAQ3B,YAErB4E,EAAW3D,KAAKU,QAAQ1B,UAAU4E,KAAIA,SAAAxD,GAC1C,GAAIA,EAAEmD,GACJ,OAAOnD,EAAEmD,MAKb,OADAG,EAAW1E,UAAY2E,EAChBD,I,kBAGT,WACE,IAAMA,EAAa,CACjB3E,WAAYiB,KAAKU,QAAQ3B,WACzBwE,GAAIvD,KAAKU,QAAQZ,UAEb6D,EAAW3D,KAAKU,QAAQ1B,UAAU4E,KAAIA,SAAAxD,GAC1C,GAAIA,EAAEmD,GACJ,OAAOnD,EAAEmD,MAKb,OADAG,EAAW1E,UAAY2E,EAChBD,I,4BAGT,WAOE,MANmB,CACjBH,GAAIvD,KAAKU,QAAQ6C,GACjBM,YAAa7D,KAAKU,QAAQmD,YAC1BC,YAAa9D,KAAKU,QAAQoD,YAC1BC,UAA4C,IAAjCN,OAAOzD,KAAKU,QAAQqD,WAE1BL,K,MAII/C","file":"static/js/chunk-64b92c01.09cde6ef.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-form',{ref:\"form\",staticClass:\"w-form\",attrs:{\"model\":_vm.form,\"rules\":_vm.rules,\"label-width\":\"110px\"}},[_c('el-form-item',{staticClass:\"w-form--item w-form--item-valid\",attrs:{\"label\":\"代理商名称\",\"prop\":\"agent_name\"}},[_c('w-input-valid',{attrs:{\"placeholder\":\"请填写代理商名称\",\"minTextLength\":1,\"maxTextLength\":50},on:{\"input\":function (v) { _vm.form.agent_name = v }},model:{value:(_vm.form.agent_name),callback:function ($$v) {_vm.$set(_vm.form, \"agent_name\", $$v)},expression:\"form.agent_name\"}})],1),_c('el-form-item',{staticClass:\"w-form--item\",attrs:{\"label\":\"绑定平台运营\"}},[_c('w-select-list',{attrs:{\"customClass\":\"w-form--item--selectMul\",\"resultClass\":\"w-form--item--selectMul-result\",\"remoteMethod\":_vm.getUserList,\"options\":_vm.options,\"selected\":_vm.form.user_list},on:{\"toggle\":_vm.leaderToggle},scopedSlots:_vm._u([{key:\"select\",fn:function(props){return [_vm._v(\" \"+_vm._s(props.item.name)+\"(\"+_vm._s(props.item.email)+\") \")]}},{key:\"has\",fn:function(props){return [_vm._v(\" \"+_vm._s(props.index + 1)+\".\"+_vm._s(props.item.name)+\"(\"+_vm._s(props.item.email || props.item.username)+\") \")]}}])})],1),_c('el-form-item',[_c('w-button',{ref:\"submitButton\",staticClass:\"w-form--btn\",attrs:{\"subBtn\":\"\",\"type\":\"primary\"},on:{\"click\":_vm.submit}},[_vm._v(\"提交\")]),_c('w-button',{staticClass:\"w-form--btn\",on:{\"click\":_vm.cancel}},[_vm._v(\"取消\")])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/*\n * @Descripttion: *\n * @version: *\n * @Author: Fengshi\n * @Date: 2020-11-20 14:57:42\n * @LastEditors: Mingkit\n * @LastEditTime: 2021-01-06 14:50:16\n */\nimport HandleData from '@/service/Agent'\nimport { cloneDeep } from 'lodash'\nexport default {\n name: 'AgentForm',\n data () {\n return {\n form: {\n agent_name: '',\n user_list: []\n },\n options: [],\n rules: {\n agent_name: [{\n validator (rule, val, res) {\n if (val === '') {\n res('请填写代理商名称')\n }\n if (val.length > 50) {\n res('代理商名称不超过50个字')\n }\n res()\n },\n trigger: 'blur',\n required: true\n }]\n }\n }\n },\n methods: {\n async getUserList (keyword) {\n const data = await this.$wPost('/admin/agent/search_user.do', {\n keyword,\n agent_id: this.form.agent_id\n })\n this.options = data\n },\n leaderToggle (res) {\n console.log(res)\n this.form.user_list = res\n },\n submit () {\n this.$refs.form.validate(v => {\n if (v) {\n if (this.form.agent_id) {\n this.editSubmit()\n } else {\n this.addSubmit()\n }\n } else {\n this.$refs.submitButton.updatedLoading(false)\n }\n })\n },\n async addSubmit () {\n const payload = new HandleData(this.form).add()\n const data = await this.$wPost('/admin/agent/add.do', payload)\n if (data === true) {\n this.$wToast.success('新建成功')\n this.$router.push({ path: '/admin/agent' })\n }\n this.$refs.submitButton.updatedLoading(false)\n },\n async editSubmit () {\n const payload = new HandleData(this.form).edit()\n const data = await this.$wPost('/admin/agent/update.do', payload)\n if (data === true) {\n this.$wToast.success('修改成功')\n this.$router.replace({ path: `/admin/agent/detail/${this.form.agent_id}` })\n }\n this.$refs.submitButton.updatedLoading(false)\n },\n cancel () {\n history.go(-1)\n },\n updateForm (payload) {\n this.form = cloneDeep(payload)\n }\n }\n}\n","import mod from \"-!../../../../../../../node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../../../../../node_modules/_babel-loader@8.2.5@babel-loader/lib/index.js!../../../../../../../node_modules/_eslint-loader@2.2.1@eslint-loader/index.js??ref--14-0!./AgentForm.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../../node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../../../../../node_modules/_babel-loader@8.2.5@babel-loader/lib/index.js!../../../../../../../node_modules/_eslint-loader@2.2.1@eslint-loader/index.js??ref--14-0!./AgentForm.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./AgentForm.vue?vue&type=template&id=40e32b09&scoped=true&\"\nimport script from \"./AgentForm.js?vue&type=script&lang=js&\"\nexport * from \"./AgentForm.js?vue&type=script&lang=js&\"\nimport style0 from \"./index.scss?vue&type=style&index=0&id=40e32b09&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../node_modules/_vue-loader@15.9.8@vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"40e32b09\",\n null\n \n)\n\nexport default component.exports","/*\n * @Descripttion: *\n * @version: *\n * @Author: Fengshi\n * @Date: 2020-11-20 14:45:19\n * @LastEditors: Fengshi\n * @LastEditTime: 2020-11-20 14:46:03\n */\nimport AgentForm from './AgentForm.vue'\nexport default AgentForm\n","export * from \"-!../../../../../../../node_modules/_mini-css-extract-plugin@0.9.0@mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../../../node_modules/_css-loader@3.6.0@css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../node_modules/_postcss-loader@3.0.0@postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../../../node_modules/_sass-loader@10.2.1@sass-loader/dist/cjs.js??ref--9-oneOf-1-3!./index.scss?vue&type=style&index=0&id=40e32b09&lang=scss&scoped=true&\"","/*\n * @Descripttion: *\n * @version: *\n * @Author: Mingkit\n * @Date: 2020-11-22 14:40:06\n * @LastEditors: Mingkit\n * @LastEditTime: 2021-01-15 09:34:25\n */\nclass HandleData {\n constructor (payload) {\n this.payload = payload\n }\n\n agentMax () {\n const newPayload = {\n id: this.payload.agent_id,\n max_custom_num: Number(this.payload.max_custom_num)\n }\n return newPayload\n }\n\n add () {\n const newPayload = {\n agent_name: this.payload.agent_name\n }\n const userList = this.payload.user_list.map(v => {\n if (v.id) {\n return v.id\n }\n })\n\n newPayload.user_list = userList\n return newPayload\n }\n\n edit () {\n const newPayload = {\n agent_name: this.payload.agent_name,\n id: this.payload.agent_id\n }\n const userList = this.payload.user_list.map(v => {\n if (v.id) {\n return v.id\n }\n })\n\n newPayload.user_list = userList\n return newPayload\n }\n\n editAgentCombo () {\n const newPayload = {\n id: this.payload.id,\n storage_cnt: this.payload.storage_cnt,\n expire_date: this.payload.expire_date,\n pay_money: Number(this.payload.pay_money) * 100\n }\n return newPayload\n }\n}\n\nexport default HandleData\n"],"sourceRoot":""}