1 |
- {"version":3,"sources":["webpack:///src/views/oms/apply/reason.vue","webpack:///./src/api/returnReason.js","webpack:///./src/views/oms/apply/reason.vue?256d","webpack:///./src/views/oms/apply/reason.vue"],"names":["defaultListQuery","pageNum","pageSize","defaultReturnReason","name","sort","status","createTime","reason","data","list","total","multipleSelection","listLoading","listQuery","assign_default","operateType","operateOptions","label","value","dialogVisible","returnReason","operateReasonId","created","this","getList","filters","formatCreateTime","time","date","Date","Object","utils_date","methods","handleAdd","handleConfirm","_this","request","url","method","then","response","$message","message","type","duration","id","updateReason","handleUpdate","index","row","_this2","handleDelete","ids","push","deleteReason","handleSelectionChange","val","handleStatusChange","_this3","params","obj","join","handleBatchOperate","length","i","handleSizeChange","handleCurrentChange","_this4","_this5","$confirm","confirmButtonText","cancelButtonText","apply_reason","render","_vm","_h","$createElement","_c","_self","staticClass","attrs","shadow","_v","size","on","click","directives","rawName","expression","ref","staticStyle","width","border","selection-change","align","scopedSlots","_u","key","fn","scope","_s","active-value","inactive-value","change","$event","$index","model","callback","$$v","$set","_f","background","layout","current-page","page-size","page-sizes","size-change","current-change","update:currentPage","title","visible","update:visible","label-width","slot","staticRenderFns","Component","__webpack_require__","normalizeComponent","ssrContext","__webpack_exports__"],"mappings":"4KA6GA,IAAAA,GACAC,QAAA,EACAC,SAAA,GAEAC,GACAC,KAAA,KACAC,KAAA,EACAC,OAAA,EACAC,WAAA,MAEAC,GACAJ,KAAA,mBACAK,KAFA,WAGA,OACAC,KAAA,KACAC,MAAA,KACAC,qBACAC,aAAA,EACAC,UAAAC,OAAAf,GACAgB,YAAA,KACAC,iBAEAC,MAAA,KACAC,MAAA,IAGAC,eAAA,EACAC,aAAAN,OAAAZ,GACAmB,gBAAA,OAGAC,QArBA,WAsBAC,KAAAC,WAEAC,SACAC,iBADA,SACAC,GACA,IAAAC,EAAA,IAAAC,KAAAF,GACA,OAAAG,OAAAC,EAAA,EAAAD,CAAAF,EAAA,yBAGAI,SACAC,UADA,WAEAV,KAAAJ,e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AtD,aAAA,SAAAwF,IAA0CpB,WAAA,0BAAmC,OAAAd,EAAAQ,GAAA,KAAAL,EAAA,QAAiCE,YAAA,gBAAAC,OAAmC2C,KAAA,UAAgBA,KAAA,WAAe9C,EAAA,aAAkBO,IAAIC,MAAA,SAAAmB,GAAyB9B,EAAAvD,eAAA,MAA4BuD,EAAAQ,GAAA,SAAAR,EAAAQ,GAAA,KAAAL,EAAA,aAA8CG,OAAOrC,KAAA,WAAiByC,IAAKC,MAAAX,EAAAxC,iBAA2BwC,EAAAQ,GAAA,sBAE1+H0C,oBCCjB,IAcAC,EAdAC,EAAA,OAcAC,CACAxH,EACAiE,GATA,EAVA,SAAAwD,GACAF,EAAA,SAaA,kBAEA,MAUAG,EAAA,QAAAJ,EAAA","file":"static/js/32.4fad6cc0629674e654dd.js","sourcesContent":["<template> \r\n <div class=\"app-container\">\r\n <el-card class=\"operate-container\" shadow=\"never\">\r\n <i class=\"el-icon-tickets\"></i>\r\n <span>数据列表</span>\r\n <el-button\r\n size=\"mini\"\r\n @click=\"handleAdd\"\r\n class=\"btn-add\">添加\r\n </el-button>\r\n </el-card>\r\n <div class=\"table-container\">\r\n <el-table ref=\"returnReasonTable\"\r\n :data=\"list\"\r\n style=\"width: 100%;\"\r\n @selection-change=\"handleSelectionChange\"\r\n v-loading=\"listLoading\" border>\r\n <el-table-column type=\"selection\" width=\"60\" align=\"center\"></el-table-column>\r\n <el-table-column label=\"编号\" width=\"80\" align=\"center\">\r\n <template slot-scope=\"scope\">{{scope.row.id}}</template>\r\n </el-table-column>\r\n <el-table-column label=\"原因类型\" align=\"center\">\r\n <template slot-scope=\"scope\">{{scope.row.name}}</template>\r\n </el-table-column>\r\n <el-table-column label=\"排序\" width=\"100\" align=\"center\">\r\n <template slot-scope=\"scope\">{{scope.row.sort }}</template>\r\n </el-table-column>\r\n <el-table-column label=\"是否可用\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-switch\r\n v-model=\"scope.row.status\"\r\n @change=\"handleStatusChange(scope.$index,scope.row)\"\r\n :active-value=\"1\"\r\n :inactive-value=\"0\">\r\n </el-switch>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"添加时间\" width=\"180\" align=\"center\">\r\n <template slot-scope=\"scope\">{{scope.row.createTime | formatCreateTime}}</template>\r\n </el-table-column>\r\n <el-table-column label=\"操作\" width=\"160\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n <el-button\r\n size=\"mini\"\r\n @click=\"handleUpdate(scope.$index, scope.row)\">编辑</el-button>\r\n <el-button\r\n size=\"mini\"\r\n @click=\"handleDelete(scope.$index, scope.row)\">删除</el-button>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n </div>\r\n <!-- <div class=\"batch-operate-container\">\r\n <el-select\r\n size=\"small\"\r\n v-model=\"operateType\" placeholder=\"批量操作\">\r\n <el-option\r\n v-for=\"item in operateOptions\"\r\n :key=\"item.value\"\r\n :label=\"item.label\"\r\n :value=\"item.value\">\r\n </el-option>\r\n </el-select>\r\n <el-button\r\n style=\"margin-left: 20px\"\r\n class=\"search-button\"\r\n @click=\"handleBatchOperate\"\r\n type=\"primary\"\r\n size=\"small\">\r\n 确定\r\n </el-button>\r\n </div> -->\r\n <div class=\"pagination-container\">\r\n <el-pagination\r\n background\r\n @size-change=\"handleSizeChange\"\r\n @current-change=\"handleCurrentChange\"\r\n layout=\"total, sizes,prev, pager, next,jumper\"\r\n :current-page.sync=\"listQuery.pageNum\"\r\n :page-size=\"listQuery.pageSize\"\r\n :page-sizes=\"[5,10,15]\"\r\n :total=\"total\">\r\n </el-pagination>\r\n </div>\r\n <el-dialog\r\n title=\"添加退货原因\"\r\n :visible.sync=\"dialogVisible\" width=\"30%\">\r\n <el-form :model=\"returnReason\"\r\n ref=\"reasonForm\" label-width=\"150px\">\r\n <el-form-item label=\"原因类型:\">\r\n <el-input v-model=\"returnReason.name\" class=\"input-width\"></el-input>\r\n </el-form-item>\r\n <el-form-item label=\"排序:\">\r\n <el-input v-model=\"returnReason.sort\" class=\"input-width\"></el-input>\r\n </el-form-item>\r\n <el-form-item label=\"是否启用:\">\r\n <el-switch v-model=\"returnReason.status\" :active-value=\"1\" :inactive-value=\"0\"></el-switch>\r\n </el-form-item>\r\n </el-form>\r\n <span slot=\"footer\" class=\"dialog-footer\">\r\n <el-button @click=\"dialogVisible = false\">取 消</el-button>\r\n <el-button type=\"primary\" @click=\"handleConfirm\">确 定</el-button>\r\n </span>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n<script>\r\n import {formatDate} from '@/utils/date';\r\n import {fetchList,deleteReason,updateStatus,addReason,getReasonDetail,updateReason} from '@/api/returnReason';\r\n const defaultListQuery = {\r\n pageNum: 1,\r\n pageSize: 5\r\n };\r\n const defaultReturnReason = {\r\n name:null,\r\n sort:0,\r\n status:1,\r\n createTime:null\r\n };\r\n export default {\r\n name: 'returnReasonList',\r\n data() {\r\n return {\r\n list: null,\r\n total: null,\r\n multipleSelection: [],\r\n listLoading:true,\r\n listQuery:Object.assign({}, defaultListQuery),\r\n operateType:null,\r\n operateOptions: [\r\n {\r\n label: \"删除\",\r\n value: 1\r\n }\r\n ],\r\n dialogVisible:false,\r\n returnReason:Object.assign({},defaultReturnReason),\r\n operateReasonId:null\r\n }\r\n },\r\n created(){\r\n this.getList();\r\n },\r\n filters:{\r\n formatCreateTime(time) {\r\n let date = new Date(time);\r\n return formatDate(date, 'yyyy-MM-dd hh:mm:ss')\r\n }\r\n },\r\n methods: {\r\n handleAdd() {\r\n this.dialogVisible=true;\r\n this.operateReasonId=null;\r\n this.returnReason=Object.assign({},defaultReturnReason);\r\n },\r\n handleConfirm(){\r\n if(this.operateReasonId==null){\r\n //添加操作\r\n addReason(this.returnReason).then(response=>{\r\n this.dialogVisible=false;\r\n this.operateReasonId=null;\r\n this.$message({\r\n message: '添加成功!',\r\n type: 'success',\r\n duration:1000\r\n });\r\n this.getList();\r\n });\r\n }else{\r\n //编辑操作\r\n updateReason(this.operateReasonId,this.returnReason).then(response=>{\r\n this.dialogVisible=false;\r\n this.operateReasonId=null;\r\n this.$message({\r\n message: '修改成功!',\r\n type: 'success',\r\n duration:1000\r\n });\r\n this.getList();\r\n });\r\n }\r\n },\r\n handleUpdate(index, row){\r\n this.dialogVisible=true;\r\n this.operateReasonId=row.id;\r\n getReasonDetail(row.id).then(response=>{\r\n this.returnReason=response.data;\r\n });\r\n },\r\n handleDelete(index, row){\r\n let ids=[];\r\n ids.push(row.id);\r\n this.deleteReason(ids);\r\n },\r\n handleSelectionChange(val){\r\n this.multipleSelection = val;\r\n },\r\n handleStatusChange(index,row){\r\n let ids=[];\r\n ids.push(row.id);\r\n // let param = new URLSearchParams();\r\n // param.append(\"status\",row.status);\r\n // param.append(\"ids\",ids);\r\n let obj = {\r\n status:row.status,\r\n ids:ids.join(',')\r\n }\r\n updateStatus(obj).then(response=>{\r\n this.$message({\r\n message: '状态修改成功',\r\n type: 'success'\r\n });\r\n });\r\n },\r\n handleBatchOperate(){\r\n if(this.multipleSelection==null||this.multipleSelection.length<1){\r\n this.$message({\r\n message: '请选择要操作的条目',\r\n type: 'warning',\r\n duration: 1000\r\n });\r\n return;\r\n }\r\n if(this.operateType===1){\r\n let ids=[];\r\n for(let i=0;i<this.multipleSelection.length;i++){\r\n ids.push(this.multipleSelection[i].id);\r\n }\r\n this.deleteReason(ids);\r\n }\r\n },\r\n handleSizeChange(val){\r\n this.listQuery.pageNum = 1;\r\n this.listQuery.pageSize = val;\r\n this.getList();\r\n },\r\n handleCurrentChange(val){\r\n this.listQuery.pageNum = val;\r\n this.getList();\r\n },\r\n getList(){\r\n this.listLoading = true;\r\n fetchList(this.listQuery).then(response => {\r\n this.listLoading = false;\r\n this.list = response.data.list;\r\n this.total = response.data.total;\r\n });\r\n },\r\n deleteReason(ids){\r\n this.$confirm('是否要进行该删除操作?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n }).then(() => {\r\n // let params = new URLSearchParams();\r\n // params.append(\"ids\",ids);\r\n let obj = {\r\n ids:ids.join(',')\r\n }\r\n deleteReason(obj).then(response=>{\r\n this.$message({\r\n message: '删除成功!',\r\n type: 'success',\r\n duration: 1000\r\n });\r\n this.listQuery.pageNum=1;\r\n this.getList();\r\n });\r\n })\r\n },\r\n }\r\n }\r\n</script>\r\n<style scoped>\r\n .input-width {\r\n width: 80%;\r\n }\r\n</style>\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/views/oms/apply/reason.vue","import request from '@/utils/request'\r\nexport function fetchList(params) {\r\n return request({\r\n url:'/returnReason/list',\r\n method:'get',\r\n params:params\r\n })\r\n}\r\n\r\nexport function deleteReason(params) {\r\n return request({\r\n url:'/returnReason/delete',\r\n method:'post',\r\n params:params\r\n })\r\n}\r\n\r\nexport function updateStatus(params) {\r\n return request({\r\n url:'/returnReason/update/status',\r\n method:'post',\r\n params:params\r\n })\r\n}\r\n\r\nexport function addReason(data) {\r\n return request({\r\n url:'/returnReason/create',\r\n method:'post',\r\n data:data\r\n })\r\n}\r\n\r\nexport function getReasonDetail(id) {\r\n return request({\r\n url:'/returnReason/'+id,\r\n method:'get'\r\n })\r\n}\r\n\r\nexport function updateReason(id,data) {\r\n return request({\r\n url:'/returnReason/update/'+id,\r\n method:'post',\r\n data:data\r\n })\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/api/returnReason.js","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"app-container\"},[_c('el-card',{staticClass:\"operate-container\",attrs:{\"shadow\":\"never\"}},[_c('i',{staticClass:\"el-icon-tickets\"}),_vm._v(\" \"),_c('span',[_vm._v(\"数据列表\")]),_vm._v(\" \"),_c('el-button',{staticClass:\"btn-add\",attrs:{\"size\":\"mini\"},on:{\"click\":_vm.handleAdd}},[_vm._v(\"添加\\n \")])],1),_vm._v(\" \"),_c('div',{staticClass:\"table-container\"},[_c('el-table',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.listLoading),expression:\"listLoading\"}],ref:\"returnReasonTable\",staticStyle:{\"width\":\"100%\"},attrs:{\"data\":_vm.list,\"border\":\"\"},on:{\"selection-change\":_vm.handleSelectionChange}},[_c('el-table-column',{attrs:{\"type\":\"selection\",\"width\":\"60\",\"align\":\"center\"}}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"编号\",\"width\":\"80\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(scope.row.id))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"原因类型\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(scope.row.name))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"排序\",\"width\":\"100\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(scope.row.sort))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"是否可用\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_c('el-switch',{attrs:{\"active-value\":1,\"inactive-value\":0},on:{\"change\":function($event){_vm.handleStatusChange(scope.$index,scope.row)}},model:{value:(scope.row.status),callback:function ($$v) {_vm.$set(scope.row, \"status\", $$v)},expression:\"scope.row.status\"}})]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"添加时间\",\"width\":\"180\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(_vm._s(_vm._f(\"formatCreateTime\")(scope.row.createTime)))]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":\"操作\",\"width\":\"160\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_c('el-button',{attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.handleUpdate(scope.$index, scope.row)}}},[_vm._v(\"编辑\")]),_vm._v(\" \"),_c('el-button',{attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.handleDelete(scope.$index, scope.row)}}},[_vm._v(\"删除\")])]}}])})],1)],1),_vm._v(\" \"),_c('div',{staticClass:\"pagination-container\"},[_c('el-pagination',{attrs:{\"background\":\"\",\"layout\":\"total, sizes,prev, pager, next,jumper\",\"current-page\":_vm.listQuery.pageNum,\"page-size\":_vm.listQuery.pageSize,\"page-sizes\":[5,10,15],\"total\":_vm.total},on:{\"size-change\":_vm.handleSizeChange,\"current-change\":_vm.handleCurrentChange,\"update:currentPage\":function($event){_vm.$set(_vm.listQuery, \"pageNum\", $event)}}})],1),_vm._v(\" \"),_c('el-dialog',{attrs:{\"title\":\"添加退货原因\",\"visible\":_vm.dialogVisible,\"width\":\"30%\"},on:{\"update:visible\":function($event){_vm.dialogVisible=$event}}},[_c('el-form',{ref:\"reasonForm\",attrs:{\"model\":_vm.returnReason,\"label-width\":\"150px\"}},[_c('el-form-item',{attrs:{\"label\":\"原因类型:\"}},[_c('el-input',{staticClass:\"input-width\",model:{value:(_vm.returnReason.name),callback:function ($$v) {_vm.$set(_vm.returnReason, \"name\", $$v)},expression:\"returnReason.name\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":\"排序:\"}},[_c('el-input',{staticClass:\"input-width\",model:{value:(_vm.returnReason.sort),callback:function ($$v) {_vm.$set(_vm.returnReason, \"sort\", $$v)},expression:\"returnReason.sort\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":\"是否启用:\"}},[_c('el-switch',{attrs:{\"active-value\":1,\"inactive-value\":0},model:{value:(_vm.returnReason.status),callback:function ($$v) {_vm.$set(_vm.returnReason, \"status\", $$v)},expression:\"returnReason.status\"}})],1)],1),_vm._v(\" \"),_c('span',{staticClass:\"dialog-footer\",attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{on:{\"click\":function($event){_vm.dialogVisible = false}}},[_vm._v(\"取 消\")]),_vm._v(\" \"),_c('el-button',{attrs:{\"type\":\"primary\"},on:{\"click\":_vm.handleConfirm}},[_vm._v(\"确 定\")])],1)],1)],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-94f06d8e\",\"hasScoped\":true,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/oms/apply/reason.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-94f06d8e\\\",\\\"scoped\\\":true,\\\"hasInlineConfig\\\":false}!../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./reason.vue\")\n}\nvar normalizeComponent = require(\"!../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./reason.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./reason.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-94f06d8e\\\",\\\"hasScoped\\\":true,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./reason.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-94f06d8e\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/views/oms/apply/reason.vue\n// module id = null\n// module chunks = "],"sourceRoot":""}
|