{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/form_approverWork_flowpanel.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/form_approverWork_flowpanel.vue","mtime":1740130327256},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/babel-loader/lib/index.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport VueBetterScroll from \"vue2-better-scroll\";\nimport { Toast } from 'mint-ui';\nimport { Indicator } from \"mint-ui\";\nexport default {\n props: [\n \"act\", \n \"openParams\", \n \"buildFormData\", \n \"approvers\",\n \"newUserList\"\n ],\n components: { VueBetterScroll },\n watch: {\n newUserList() {\n this.newSelectData();\n },\n },\n data: function() {\n return {\n checkVal:[],\n value:'',\n selectRow:[],\n approverList:[],\n row_count:0,\n keyWord:'',\n\n // 这个配置可以开启滚动条,默认为 false。当设置为 true 或者是一个 Object 的时候,都会开启滚动条,默认是会 fade 的\n scrollbarObj: {\n fade: true\n },\n // 这个配置用于做下拉刷新功能,默认为 false。当设置为 true 或者是一个 Object 的时候,可以开启下拉刷新,可以配置顶部下拉的距离(threshold) 来决定刷新时机以及回弹停留的距离(stop)\n pullDownRefreshObj: {\n threshold: 90,\n stop: 40,\n txt: this.$t('noMoreData')\n \n },\n // 这个配置用于做上拉加载功能,默认为 false。当设置为 true 或者是一个 Object 的时候,可以开启上拉加载,可以配置离底部距离阈值(threshold)来决定开始加载的时机\n pullUpLoadObj: {\n threshold: 0,\n stop: 40,\n txt: {\n more: this.$t('loadMore'),\n noMore: this.$t('noMoreData')\n }\n },\n startY: 100, // 纵轴方向初始化位置\n scrollToX: 0,\n scrollToY: 0,\n scrollToTime: 700,\n items: [],\n pendingContentH:'',\n auditorsList:[],\n };\n },\n \n mounted() {\n this.getData();\n this.setOriginalApprover();\n this.$nextTick(function() {\n this.pendingContentH =\n document.documentElement.clientHeight -\n this.$refs.pendingwrapper.getBoundingClientRect().top-100;\n });\n },\n methods: {\n newSelectData() {\n let data = JSON.parse(JSON.stringify(this.newUserList));\n this.checkVal = [];\n this.auditorsList = data;\n data.forEach(el => {\n this.checkVal.push(el.id);\n });\n this.$forceUpdate() //重新渲染数据\n },\n handleSelectionChange(ev, item) {\n let val = this.checkVal;\n if(ev.target.checked && val.length > 0) {\n for(let i=0; i {\n if(items.nodes.length > 0) {\n items.nodes.forEach(item => {\n this.auditorsList = item.auditors;\n item.auditors.forEach(el => {\n this.checkVal.push(el.id);\n });\n });\n }\n });\n }\n },\n getData(){\n this.getApproverList().then((response) => {\n this.approverList = response.data.datas;\n this.row_count = response.data.rowCount;\n }).then(()=> {\n }); \n },\n\n getApproverList(keyWord) {\n return new Promise(resolve => { \n let lastPage = Math.floor(this.approverList.length / 10) + 1;\n let pageSize = 10;\n let keyword = keyWord?keyWord:'';\n this.$api.getSearch(encodeURIComponent(keyword), lastPage, pageSize, {\n onSucess: response => {\n let data = response.data;\n resolve(data);\n }\n })\n \n });\n },\n\n onPullingUp() {\n // 模拟上拉 加载更多数据\n if(this.approverList.length < this.row_count) {\n this.getApproverList(this.keyWord).then((response) => {\n this.approverList = this.approverList.concat(response.data.datas);\n this.$refs.scroll.forceUpdate(true);\n })\n }else {\n this.$refs.scroll.forceUpdate(false);\n }\n },\n\n search() {\n this.approverList = [];\n this.getApproverList(this.keyWord).then((response) => {\n this.approverList = response.data.datas;\n this.row_count = response.data.rowCount;\n if(this.approverList.length < response.data.rowCount) {\n this.$refs.scroll.forceUpdate(true);\n }else {\n this.$refs.scroll.forceUpdate(false);\n }\n })\n },\n\n onOK(){\n if(this.checkVal && this.checkVal.length > 0) {\n Indicator.open({\n text: this.$t('submitting'),\n spinnerType: \"fading-circle\"\n });\n let appId = this.$root.appid,\n docId = this.buildFormData.id;\n let flowData = {\n auditorList: this.checkVal,\n }\n this.$api.approversWorkflow(appId, docId, flowData, {\n onSucess: response => {\n Indicator.close();\n let status;\n if(response.data.errcode==0) {\n status = 'SUCCESS';\n this.$emit(\"closePopup\",status)\n Toast({\n message: response.data.data,\n iconClass: 'fa fa-check fa-2x'\n });\n }else if(response.data.errcode==4001){\n status = 'ERROR';\n this.$emit(\"closePopup\",status)\n Toast({\n message: response.data.errmsg,\n iconClass: 'fa fa-close fa-2x'\n });\n }\n }\n }) \n }else {\n status = 'ERROR';\n this.$emit(\"closePopup\",status)\n }\n },\n }\n};\n",null]}