manage-client 3.3.88 → 3.3.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "manage-client",
3
- "version": "3.3.88",
3
+ "version": "3.3.89",
4
4
  "description": "经营管控模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -46,7 +46,7 @@
46
46
  </div>
47
47
  <div class="col-sm-3 form-group" >
48
48
  <label class="font_normal_body" for="org">公&emsp;&emsp;司:</label>
49
- <right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%" v-ref:org></right-tree>
49
+ <manage-right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%" v-ref:org></manage-right-tree>
50
50
  </div>
51
51
  <div class="col-sm-3 form-group">
52
52
  <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
@@ -226,8 +226,8 @@ let getorg = async function (self) {
226
226
  console.log('---------------->', this.reportStyle)
227
227
  this.printTime = this.$login.toStandardTimeString()
228
228
  let orgcondition = '1=1'
229
- if (this.f_orgid[0]) {
230
- orgcondition += ` and f_orgid in ('${this.f_orgid}')`
229
+ if (this.f_orgid) {
230
+ orgcondition += ` and f_orgid in (${this.f_orgid})`
231
231
  }
232
232
  orgcondition += ' and ' + args.condition
233
233
  this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
  <div class="col-sm-3 form-group" >
30
30
  <label class="font_normal_body" for="org">公&emsp;&emsp;司:</label>
31
- <right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%" v-ref:org></right-tree>
31
+ <manage-right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%" v-ref:org></manage-right-tree>
32
32
  </div>
33
33
  <div class="col-sm-3 form-group">
34
34
  <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
@@ -217,22 +217,11 @@ import {DataModel, HttpResetClass} from 'vue-client'
217
217
  this.operatorname = this.userresid.filter(x => x.value ==val).map(x=>x.label).toString()
218
218
  console.log('dep',this.operatorname )
219
219
  },
220
- getParamStr (array) {
221
- let stringValue = ''
222
- for (let i = 0; i < array.length; i++) {
223
- if (i === array.length - 1) {
224
- stringValue = stringValue + "'" + array[i] + "'"
225
- } else {
226
- stringValue = stringValue + "'" + array[i] + "',"
227
- }
228
- }
229
- return stringValue
230
- },
231
220
  selfSearch (args) {
232
221
  this.printTime = this.$login.toStandardTimeString()
233
222
  let orgcondition = '1=1'
234
223
  if (this.f_orgid[0]) {
235
- orgcondition += ` and f_orgid in (${this.getParamStr(this.f_orgid)})`
224
+ orgcondition += ` and f_orgid in (${this.f_orgid})`
236
225
  }
237
226
 
238
227
  this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
@@ -28,26 +28,26 @@
28
28
  </div>
29
29
  <div class="col-sm-4">
30
30
  <label class="font_normal_body">&nbsp;&nbsp;&nbsp;公司&nbsp;&nbsp;&nbsp;</label>
31
- <right-tree @re-res="$parent.$parent.getRes"></right-tree>
31
+ <manage-right-tree @re-res="$parent.$parent.getRes"></manage-right-tree>
32
32
  </div>
33
33
  <div class="col-sm-4">
34
34
  <label class="font_normal_body">&nbsp;&nbsp;&nbsp;部门&nbsp;&nbsp;&nbsp;</label>
35
- <res-select restype='department'
35
+ <manage-res-select restype='department'
36
36
  is-mul="false"
37
37
  @res-select="$parent.$parent.getdep"
38
38
  :parentresid="$parent.$parent.depresid"
39
39
  :initresid='$parent.$parent.depid'>
40
- </res-select>
40
+ </manage-res-select>
41
41
 
42
42
  </div>
43
43
  <div class="col-sm-4">
44
44
  <label class="font_normal_body">&nbsp;&nbsp;&nbsp;人员&nbsp;&nbsp;&nbsp;</label>
45
- <res-select restype='user'
45
+ <manage-res-select restype='user'
46
46
  is-mul="false"
47
47
  @res-select="$parent.$parent.getuser"
48
48
  :parentresid="$parent.$parent.userresid"
49
49
  :initresid='$parent.$parent.operatorid'>
50
- </res-select>
50
+ </manage-res-select>
51
51
  </div>
52
52
  <div class="col-sm-4 form-group">
53
53
  <label class="font_normal_body">抄&ensp;表&ensp;员</label>
@@ -28,25 +28,25 @@
28
28
  </div>
29
29
  <div class="col-sm-4 form-group" >
30
30
  <label class="font_normal_body" for="org">公&emsp;&emsp;司:</label>
31
- <right-tree id="org" @re-res="$parent.$parent.getRes"></right-tree>
31
+ <manage-right-tree id="org" @re-res="$parent.$parent.getRes"></manage-right-tree>
32
32
  </div>
33
33
  <div class="col-sm-4 form-group">
34
34
  <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
35
- <res-select id="dep" restype='department'
35
+ <manage-res-select id="dep" restype='department'
36
36
  @res-select="$parent.$parent.getdep"
37
37
  :parentresid="$parent.$parent.depresid"
38
38
  :initresid='$parent.$parent.depid' >
39
- </res-select>
39
+ </manage-res-select>
40
40
 
41
41
  </div>
42
42
  <div class="col-sm-4 form-group">
43
43
  <label class="font_normal_body" for="oper">人&emsp;&emsp;员:</label>
44
- <res-select id="oper" restype='user'
44
+ <manage-res-select id="oper" restype='user'
45
45
  is-mul="false"
46
46
  @res-select="$parent.$parent.getuser"
47
47
  :parentresid="$parent.$parent.userresid"
48
48
  :initresid='$parent.$parent.operatorid'>
49
- </res-select>
49
+ </manage-res-select>
50
50
  </div>
51
51
  <div class="col-sm-4 form-group">
52
52
  <label class="font_normal_body">收费状态:</label>
@@ -201,13 +201,13 @@
201
201
  this.printTime = this.$login.toStandardTimeString()
202
202
  this.orgCondtionStr='1=1'
203
203
  if (this.f_orgid[0]) {
204
- this.orgCondtionStr += " and f_orgid in ('" + this.f_orgid + "')"
204
+ this.orgCondtionStr += ' and f_orgid in (' + this.f_orgid + ')'
205
205
  }
206
206
  if (this.f_depid[0]) {
207
- this.orgCondtionStr += " and f_depid in ('" + this.f_depid.toString() + "')"
207
+ this.orgCondtionStr += ' and f_depid in (' + this.f_depid.toString() + ')'
208
208
  }
209
209
  if(this.f_operatorid[0]) {
210
- this.orgCondtionStr += " and f_operatorid in ('" + this.f_operatorid + "')"
210
+ this.orgCondtionStr += ' and f_operatorid in (' + this.f_operatorid + ')'
211
211
  }
212
212
  this.$refs.paged.$refs.criteria.model.f_orgid = this.orgCondtionStr.replace('1=1','') + (this.f_state && this.f_state != '' ? " and f_state='" + this.f_state + "' " : '')
213
213
  this.$refs.paged.search(args)
@@ -28,26 +28,26 @@
28
28
  </div>
29
29
  <div class="col-sm-2 form-group" >
30
30
  <label class="font_normal_body" for="org">公&emsp;&emsp;司:</label>
31
- <right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%"></right-tree>
31
+ <manage-right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%"></manage-right-tree>
32
32
  </div>
33
33
  <div class="col-sm-2 form-group">
34
34
  <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
35
- <res-select id="dep" restype='department' style="width: 60%"
35
+ <manage-res-select id="dep" restype='department' style="width: 60%"
36
36
  is-mul="false"
37
37
  @res-select="$parent.$parent.getdep"
38
38
  :parentresid="$parent.$parent.depresid"
39
39
  :initresid='$parent.$parent.depid' >
40
- </res-select>
40
+ </manage-res-select>
41
41
 
42
42
  </div>
43
43
  <div class="col-sm-2 form-group">
44
44
  <label class="font_normal_body" for="oper">人&emsp;&emsp;员:</label>
45
- <res-select id="oper" restype='user' style="width: 60%"
45
+ <manage-res-select id="oper" restype='user' style="width: 60%"
46
46
  is-mul="false"
47
47
  @res-select="$parent.$parent.getuser"
48
48
  :parentresid="$parent.$parent.userresid"
49
49
  :initresid='$parent.$parent.operatorid'>
50
- </res-select>
50
+ </manage-res-select>
51
51
  </div>
52
52
  <div class="col-sm-2 form-group">
53
53
  <label class="font_normal_body">用气性质</label>
@@ -223,7 +223,7 @@
223
223
  this.printTime = this.$login.toStandardTimeString()
224
224
  this.orgCondtionStr='1=1'
225
225
  if (this.f_orgid[0]) {
226
- this.orgCondtionStr += ` and f_orgid in ('${this.f_orgid}')`
226
+ this.orgCondtionStr += ` and f_orgid in (${this.f_orgid})`
227
227
  }
228
228
  if (this.f_depid[0]) {
229
229
  this.orgCondtionStr += ` and f_depid = '${this.f_depid}'`
@@ -48,7 +48,7 @@
48
48
  </div>
49
49
  <div class="col-sm-3 form-group" >
50
50
  <label class="font_normal_body" for="org">公&emsp;&emsp;司:</label>
51
- <right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%" v-ref:org></right-tree>
51
+ <manage-right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%" v-ref:org></manage-right-tree>
52
52
  </div>
53
53
  <div class="col-sm-3 form-group">
54
54
  <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
@@ -233,7 +233,7 @@ let getorg = async function (self) {
233
233
  this.printTime = this.$login.toStandardTimeString()
234
234
  let orgcondition = '1=1'
235
235
  if (this.f_orgid[0]) {
236
- orgcondition += ` and f_orgid in ('${this.f_orgid}')`
236
+ orgcondition += ` and f_orgid in (${this.f_orgid})`
237
237
  }
238
238
  orgcondition += ' and ' + args.condition
239
239
  this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  <div class="col-sm-2">
28
28
  <label class="font_normal_body">&nbsp;&nbsp;&nbsp;公司&nbsp;&nbsp;&nbsp;</label>
29
- <right-tree @re-res="$parent.$parent.getRes"></right-tree>
29
+ <manage-right-tree @re-res="$parent.$parent.getRes"></manage-right-tree>
30
30
  </div>
31
31
 
32
32
  </div>
@@ -121,7 +121,7 @@
121
121
  this.$refs.paged.$refs.criteria.search()
122
122
  },
123
123
  selfSearch (args) {
124
- let orgcondition = `f_orgid in ('${this.f_orgid}')`
124
+ let orgcondition = `f_orgid in (${this.f_orgid})`
125
125
  this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
126
126
  this.$refs.paged.search(args)
127
127
  },
@@ -48,26 +48,26 @@
48
48
  </div>
49
49
  <div class="col-sm-3 form-group" >
50
50
  <label class="font_normal_body" for="org">公&emsp;&emsp;司:</label>
51
- <right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%"></right-tree>
51
+ <manage-right-tree id="org" @re-res="$parent.$parent.getRes" style="width: 60%"></manage-right-tree>
52
52
  </div>
53
53
  <div class="col-sm-3 form-group">
54
54
  <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
55
- <res-select id="dep" restype='department' style="width: 60%"
55
+ <manage-res-select id="dep" restype='department' style="width: 60%"
56
56
  is-mul="false"
57
57
  @res-select="$parent.$parent.getdep"
58
58
  :parentresid="$parent.$parent.depresid"
59
59
  :initresid='$parent.$parent.depid' >
60
- </res-select>
60
+ </manage-res-select>
61
61
 
62
62
  </div>
63
63
  <div class="col-sm-3 form-group">
64
64
  <label class="font_normal_body" for="oper">人&emsp;&emsp;员:</label>
65
- <res-select id="oper" restype='user' style="width: 60%"
65
+ <manage-res-select id="oper" restype='user' style="width: 60%"
66
66
  is-mul="false"
67
67
  @res-select="$parent.$parent.getuser"
68
68
  :parentresid="$parent.$parent.userresid"
69
69
  :initresid='$parent.$parent.operatorid'>
70
- </res-select>
70
+ </manage-res-select>
71
71
  </div>
72
72
  </div>
73
73
  <div class="span" style = "float:right;">
@@ -192,12 +192,12 @@
192
192
  },
193
193
  selfSearch (args) {
194
194
  this.printTime = this.$login.toStandardTimeString()
195
- let orgcondition = ' f_orgid in(' + this.f_orgid + ')'
195
+ let orgcondition = ` f_orgid in( ${this.f_orgid})`
196
196
  if (this.f_depid[0]) {
197
- orgcondition += ` and f_depid in ('${this.f_depid}')`
197
+ orgcondition += ` and f_depid in (${this.f_depid})`
198
198
  }
199
199
  if(this.f_operatorid[0]) {
200
- orgcondition += ` and f_operatorid in ('${this.f_operatorid}')`
200
+ orgcondition += ` and f_operatorid in (${this.f_operatorid})`
201
201
  }
202
202
  this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
203
203
  this.$refs.paged.search(args)
@@ -0,0 +1,155 @@
1
+ <template>
2
+ <v-select :options='resoptions' placeholder='请选择'
3
+ :value.sync="selectres"
4
+ :multiple="isMul"
5
+ search="true"
6
+ :disabled="mustselect"
7
+ :close-on-select="!isMul"
8
+ @change="resChange"
9
+ >
10
+ </v-select>
11
+ </template>
12
+ <script>
13
+ import {HttpResetClass} from 'vue-client'
14
+
15
+ export default {
16
+ title: '资源选择',
17
+ props: {
18
+
19
+ //资源类型
20
+ restype:'',
21
+ //资源数据
22
+ resObj:{},
23
+ isMul: {
24
+ type: Boolean,
25
+ default: true
26
+ },
27
+ //资源初始化数据
28
+ initresid: {
29
+ type: Array,
30
+ default() { return [] },
31
+ },
32
+ //父层id
33
+ parentresid: {
34
+ type: Array,
35
+ default() { return [] },
36
+ },
37
+ mustselect: {
38
+ type: Boolean,
39
+ default: false
40
+ },
41
+ },
42
+ data () {
43
+ return {
44
+ //资源数据
45
+ resObj:{},
46
+ //资源数据列表
47
+ resoptions:[],
48
+ //选中资源数据
49
+ selectres: [],
50
+ }
51
+ },
52
+ ready () {
53
+ //获取资源列表
54
+ this.getResList()
55
+ },
56
+ methods:{
57
+ //树形结构变成list
58
+ findById(val) {
59
+ if(val){
60
+ if(this.checkidres(val)){
61
+ this.treetoList(val,'')
62
+ }else if(val.children.length>0){
63
+ for (let value of val.children) {
64
+ this.findById(value)
65
+ }
66
+ }
67
+ }
68
+ },
69
+ //树形结构变成list
70
+ treetoList(val,parentname) {
71
+ for (let value of val.children) {
72
+ this.ergodicList(value,parentname)
73
+ }
74
+ },
75
+ //找到跟节点
76
+ ergodicList (val,parentname) {
77
+ if(val.children.length > 0 ){
78
+ parentname=parentname+val.name
79
+ this.treetoList(val,parentname)
80
+ }else {
81
+ //截取组织机构【组织机构】
82
+ if(this.restype=='organization'){
83
+ parentname=parentname.replace("组织机构","")
84
+ this.resoptions.push({label: val.name+' - '+parentname, value: `'${ val.id}'`})
85
+ }else{
86
+ this.resoptions.push({label: val.name, value: `'${ val.id}'`})
87
+ }
88
+ }
89
+ },
90
+ //检查id是否存在
91
+ checkidres(val){
92
+ let flag=false
93
+ //如果没传值得话 不过滤
94
+ if(this.parentresid.length==0&&this.restype=='organization'){
95
+ flag=true
96
+ }
97
+ this.parentresid.forEach((item) => {
98
+ if(item==val.id){
99
+ flag=true
100
+ }
101
+ })
102
+ return flag;
103
+ },
104
+ //资源改变
105
+ resChange(val){
106
+ let orgnames=[]
107
+ Object.keys(this.resoptions).forEach((key) => {
108
+ if(this.selectres.includes(this.resoptions[key].value))
109
+ orgnames.push(this.resoptions[key].label)
110
+ })
111
+ console.log('资源改变。。', val, orgnames)
112
+ this.$dispatch('res-select', this.selectres, orgnames)
113
+ },
114
+ //获取资源数据
115
+ async getResList() {
116
+
117
+ let http = new HttpResetClass()
118
+
119
+ let req = await http.load('POST', '/rs/search', {data: {
120
+ source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
121
+ userid: this.$login.f.id
122
+ }}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
123
+ this.resObj=req.data[0]
124
+ this.dealdata()
125
+ },
126
+ dealdata(){
127
+ this.resoptions=[]
128
+ this.findById(this.resObj);
129
+ //赋值资源数据
130
+ let arryselect=[]
131
+ this.resoptions.forEach((item) => {
132
+ if(this.initresid.length>0){
133
+ this.initresid.forEach((init) => {
134
+ if(item.value==init){
135
+ arryselect.push(item.value)
136
+ }
137
+ })
138
+ }
139
+ })
140
+ //赋值资源选中初始值
141
+ this.selectres=arryselect
142
+ }
143
+ },
144
+ watch: {
145
+ //监听初始化资源id
146
+ 'initresid.length'(){
147
+ this.dealdata()
148
+ },
149
+ //监听初始化资源id
150
+ 'parentresid'(){
151
+ this.dealdata()
152
+ },
153
+ },
154
+ }
155
+ </script>
@@ -0,0 +1,348 @@
1
+ <template>
2
+ <dropdown :model='model' class="auto" id="res-tree" v-if="!islist" v-el:dropdown :style="{width:width}">
3
+ <button type="button" class="btn btn-default dropdown-toggle select-style" data-toggle="dropdown" :disabled="mustselect">
4
+ <span class='btn-content' :style="{textOverflow:'ellipsis',overflow: 'hidden'}">{{ orgnames }}</span>
5
+ <span class="caret"></span>
6
+ </button>
7
+ <div class="dropdown-menu auto" style="width:auto;max-height: 500px;overflow: auto" >
8
+ <input type="text" placeholder="Search"
9
+ placeholder='请输入'
10
+ slot="dropdown-menu"
11
+ v-model="searchText"
12
+ class="form-control" autocomplete="off"
13
+ @keydown.enter="buluer(searchText)">
14
+ <tree :filter="strsign" :model='model' v-ref:tree :is-click="false" role="menu">
15
+ <span partial>
16
+ <span class="glyphicon glyphicon-chevron-down" v-show="row.open&&row.data.children.length>0" style="color:balck;"></span>
17
+ <span class="glyphicon glyphicon-chevron-right" v-show="!row.open&&row.data.children.length>0" style="color:balck;"></span>
18
+ <span class="RightTreeCanSelect" v-if="row.data.hasright" @click.stop="$parent.$parent.$parent.selectclick(row.data)">{{row.data.name}}</span>
19
+ <span class="RightTreeCanNotSelect" v-else>{{row.data.name}}</span>
20
+ <span class="glyphicon glyphicon-ok " v-if="$parent.$parent.$parent.isSelect(row.data.id)" style="color:balck;"></span>
21
+ </span>
22
+ </tree>
23
+ </div>
24
+
25
+ </dropdown>
26
+ <v-select v-if="islist"
27
+ placeholder='请选择'
28
+ :options='childrenOptions'
29
+ :disabled="mustselect"
30
+ @change="selectclick"
31
+ :value-single="true"
32
+ close-on-select></v-select>
33
+ </template>
34
+ <script>
35
+ import Vue from 'vue';
36
+ import co from 'co'
37
+ import { PagedList, HttpResetClass } from 'vue-client'
38
+ import * as ldapHelper from '../../../plugins/LdapHelper'
39
+ let saveGen = function * (self) {
40
+ //获取分公司树
41
+ let data = {
42
+ source: self.source,
43
+ userid: self.userid
44
+ }
45
+ // if(self.$treeorg==null || (self.$treeorg!=null&&self.$treeorg.length==0)){
46
+ let http = new HttpResetClass()
47
+ let ret = yield http.load('POST', `${self.Url}/rs/search`, data, {resolveMsg: null, rejectMsg: null})
48
+ // 去掉前面的两层节点
49
+ ret.data[0].children[0].children.forEach((item) => {
50
+ self.model.push(item)
51
+ })
52
+ Vue.$treeorg = Vue.prototype.$treeorg = self.model;
53
+ // }
54
+ //if(self.$treeorg!=null){
55
+ // self.model = self.$treeorg;
56
+ //}
57
+ // 给资源添加父关系
58
+ ldapHelper.procParent(self.model)
59
+ // 树转列
60
+ // if (self.islist) {
61
+ // self.treetoList(self.model)
62
+ // }
63
+ if(self.initresid.length>0){
64
+ if(self.initresid[0] == ''){
65
+ self.initresid[0] = self.$login.f.orgid;
66
+ }
67
+ }else{
68
+ self.initresid = [];
69
+ self.initresid[0] = self.$login.f.orgid;
70
+ }
71
+ if(self.initresid&&self.initresid.length>0){
72
+ self.isselect = false;
73
+ self.initTreetoList(self.model)
74
+ self.initregion(self.childrenOptions)
75
+ self.childrenOptions.forEach((item) => {
76
+ if(item.id == null && item.value !=null ){
77
+ item = item.value
78
+ }
79
+ if(item.id==self.initresid[0]){
80
+ //默认加载如果已选中的和传入参数相等会取消选择,这种操作不应该被允许
81
+ if(self.orgids==item.id){
82
+ self.initdataone(item);
83
+ return;
84
+ }
85
+ self.selectclick(item);
86
+ self.isselect = true;
87
+ return;
88
+ }
89
+ })
90
+ //如果没有找到公司,说明是选择的是大区
91
+ if(!self.isselect){
92
+ self.childrenregionOption.forEach((item) => {
93
+ if(item.id == null && item.value !=null ){
94
+ item = item.value;
95
+ }
96
+ if(item.id==self.initresid[0]){
97
+ //默认加载如果已选中的和传入参数相等会取消选择,这种操作不应该被允许
98
+ if(self.orgids==item.id){
99
+ self.initdataone(item);
100
+ return;
101
+ }
102
+ self.selectclick(item);
103
+ return;
104
+ }
105
+ })
106
+ }
107
+ }
108
+ //self.selectRes()
109
+ }
110
+ export default {
111
+ title: '资源树',
112
+ props: {
113
+ searchText:'',
114
+ strsign:'',
115
+ source: {
116
+ type: String,
117
+ require: true,
118
+ default:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`
119
+ },
120
+ //资源初始化数据
121
+ initresid: {
122
+ type: Array,
123
+ default() { return [] },
124
+ },
125
+ resid: {
126
+ },
127
+ islist: {
128
+ type: Boolean,
129
+ default: false
130
+ },
131
+ //是否有查看上级的权限
132
+ Url:{
133
+ type: String,
134
+ default:''
135
+ },
136
+ mustselect: {
137
+ type: Boolean,
138
+ default: false
139
+ },
140
+ width:{
141
+ type:String,
142
+ default:'60%'
143
+ }
144
+ },
145
+ data () {
146
+ return {
147
+ resobj:{res:this.$login.f.orgs, resids:this.$login.f.orgid},
148
+ userid: this.$login.f.id,
149
+ resname:[this.$login.f.orgs],
150
+ orgnames : "请选择",
151
+ //单选点击 返回所有子
152
+ orgids : null,
153
+ orgobj:null,
154
+ model: [
155
+
156
+ ],
157
+ childrenOptions: [],
158
+ childrenregionOption:[],
159
+ isselect: false
160
+ }
161
+ },
162
+ methods: {
163
+ selectRes () {
164
+ let newobj={
165
+ "res": [this.resname],
166
+ "resids": [this.orgids],
167
+ }
168
+ this.$emit('re-res', newobj)
169
+ },
170
+ //树形结构变成list
171
+ initTreetoList(val) {
172
+ for (let value of val) {
173
+ this.initErgodicList(value)
174
+ }
175
+ },
176
+ //找到跟节点
177
+ initErgodicList (val) {
178
+ if(val.children.length > 0){
179
+ this.childrenOptions.push(val)
180
+ this.treetoList(val.children)
181
+ }else{
182
+ this.childrenOptions.push(val)
183
+ }
184
+ },
185
+ initregion(val){
186
+ if(val ==null ) return;
187
+ val.forEach((item)=>{
188
+ if(item.name != null){
189
+ if(item.name.includes("公司")){
190
+ return;
191
+ }else{
192
+ this.initregion(item.children)
193
+ this.childrenregionOption.push({label:"",value:item})
194
+ //return item;
195
+ }
196
+ }else{
197
+ return;
198
+ }
199
+ })
200
+
201
+ },
202
+ async buluer (val) {
203
+ this.strsign=val
204
+ await new Promise(resolve => {
205
+ this.$nextTick(() => {
206
+ resolve()
207
+ })
208
+ })
209
+ },
210
+ //点击资源的方法
211
+ selectclick (row) {
212
+ if(this.orgids==row.id){
213
+ //取消点击
214
+ this.orgnames="请选择"
215
+ this.orgids=null
216
+ this.orgobj=null
217
+ let newobj={
218
+ "res": [],
219
+ "resids": [],
220
+ "orgobj": [],
221
+ }
222
+ this.$emit('re-res', newobj)
223
+ }else{
224
+ //点中点击
225
+ this.orgnames=row.name
226
+ this.orgids=row.id
227
+ this.orgobj=row
228
+ let objs=[]
229
+ let objids=[]
230
+ let objnames=[]
231
+ this.addResChild(row,objs)
232
+ objs.forEach((item) => {
233
+ objids.push(`'${item.id}'`)
234
+ objnames.push(item.name)
235
+ })
236
+ let newobj={
237
+ "res": objnames,
238
+ "resids": objids,
239
+ "orgobj": objs,
240
+ }
241
+ this.$emit('re-res', newobj)
242
+ }
243
+ },
244
+ initdataone(row){
245
+ //点中点击
246
+ this.orgnames=row.name
247
+ this.orgids=row.id
248
+ this.orgobj=row
249
+ let objs=[]
250
+ let objids=[]
251
+ let objnames=[]
252
+ this.addResChild(row,objs)
253
+ objs.forEach((item) => {
254
+ objids.push(`'${item.id}'`)
255
+ objnames.push(item.name)
256
+ })
257
+ let newobj={
258
+ "res": objnames,
259
+ "resids": objids,
260
+ "orgobj": objs,
261
+ }
262
+ this.$emit('re-res', newobj)
263
+ },
264
+ addResChild(val,objs){
265
+ objs.push(val)
266
+ if(val.children && val.children.length>0){
267
+ Object.keys(val.children).forEach((key) => {
268
+ this.addResChild(val.children[key],objs)
269
+ })
270
+ }
271
+ return objs
272
+ },
273
+ //检查是否显示对勾
274
+ isSelect(val) {
275
+ if(this.orgids==val){
276
+ return true
277
+ }else{
278
+ return false
279
+ }
280
+ },
281
+ //树形结构变成list
282
+ treetoList(val) {
283
+ for (let value of val) {
284
+ this.ergodicList(value)
285
+ }
286
+ },
287
+ //找到跟节点
288
+ ergodicList (val) {
289
+ val.children.length > 0 ? this.treetoList(val.children) : this.childrenOptions.push({label: val.name, value: val})
290
+ },
291
+ //处理显示默认值
292
+ dealResObj (val) {
293
+ try{
294
+ var arr=val.res.split(".")
295
+ //截取最后一个分公司名字
296
+ this.resname=arr[arr.length-1].toString()
297
+ this.orgnames=arr[arr.length-1].toString()
298
+ this.resid = val.resids
299
+ this.orgids = val.resids
300
+ }catch (e){
301
+ this.resname='请选择组织'
302
+ }
303
+ },
304
+ judgBoundary(){
305
+ //判断是否超出边界,超出移动
306
+ if(document.documentElement.offsetWidth< this.$els.dropdown.getBoundingClientRect().right){
307
+ this.left = document.documentElement.offsetWidth - this.$els.dropdown.getBoundingClientRect().right - 25
308
+ }
309
+ }
310
+ },
311
+ events: {
312
+
313
+ },
314
+ ready () {
315
+ this.dealResObj (this.resobj)
316
+ let gen = saveGen(this)
317
+ return co(gen)
318
+ },
319
+ watch: {
320
+ }
321
+ }
322
+ </script>
323
+ <style lang="less">
324
+ #res-tree {
325
+ .list-group-item {
326
+ background-color: #FFF;
327
+ color: #000;
328
+ padding: 5px 10px;
329
+ border:0px;
330
+ white-space: nowrap;
331
+ }
332
+ }
333
+ #res-tree .list-group {
334
+ width: auto;
335
+ min-width: 100%;
336
+ }
337
+ .hide-text-overflow{
338
+ overflow: hidden;
339
+ text-overflow: ellipsis
340
+ }
341
+ .select-style {
342
+ border: 0px;
343
+ /*border-bottom: 2px solid #C9CCCF;*/
344
+ border: 1px solid #93B2D3;
345
+ border-radius: 0px;
346
+ color: #555;
347
+ }
348
+ </style>
@@ -26,26 +26,26 @@
26
26
  </div>
27
27
  <div class="col-sm-4">
28
28
  <label class="font_normal_body">&nbsp;&nbsp;&nbsp;公司&nbsp;&nbsp;&nbsp; </label>
29
- <right-tree @re-res="$parent.$parent.getRes"></right-tree>
29
+ <manage-right-tree @re-res="$parent.$parent.getRes"></manage-right-tree>
30
30
  </div>
31
31
  <div class="col-sm-4">
32
32
  <label class="font_normal_body">&nbsp;&nbsp;&nbsp;部门&nbsp;&nbsp;&nbsp; </label>
33
- <res-select restype='department'
33
+ <manage-res-select restype='department'
34
34
  is-mul="false"
35
35
  @res-select="$parent.$parent.getdep"
36
36
  :parentresid="$parent.$parent.depresid"
37
37
  :initresid='$parent.$parent.depid'>
38
- </res-select>
38
+ </manage-res-select>
39
39
 
40
40
  </div>
41
41
  <div class="col-sm-4">
42
42
  <label class="font_normal_body">&nbsp;&nbsp;&nbsp;人员&nbsp;&nbsp;&nbsp; </label>
43
- <res-select restype='user'
43
+ <manage-res-select restype='user'
44
44
  is-mul="false"
45
45
  @res-select="$parent.$parent.getuser"
46
46
  :parentresid="$parent.$parent.userresid"
47
47
  :initresid='$parent.$parent.operatorid'>
48
- </res-select>
48
+ </manage-res-select>
49
49
  </div>
50
50
  <div class="col-sm-3 form-group">
51
51
  <label class="font_normal_body" for="oper1">格式一</label>
@@ -167,13 +167,13 @@ import {DataModel, HttpResetClass} from 'vue-client'
167
167
  this.printTime = this.$login.toStandardTimeString()
168
168
  let orgcondition = '1=1'
169
169
  if (this.f_orgid && this.f_orgid[0]) {
170
- orgcondition += ` and f_orgid in ('${this.f_orgid}')`
170
+ orgcondition += ` and f_orgid in (${this.f_orgid})`
171
171
  }
172
172
  if (this.f_depid && this.f_depid[0]) {
173
- orgcondition += ` and f_depid in ('${this.f_depid}')`
173
+ orgcondition += ` and f_depid in (${this.f_depid})`
174
174
  }
175
175
  if (this.f_operatorid && this.f_operatorid[0]) {
176
- orgcondition += ` and f_operatorid in ('${this.f_operatorid}')`
176
+ orgcondition += ` and f_operatorid in (${this.f_operatorid})`
177
177
  }
178
178
  this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
179
179
  if (this.reportStyle == '1') {
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  <div class="col-sm-2 form-group">
28
28
  <label class="font_normal_body">&nbsp;&nbsp;&nbsp;公司&nbsp;&nbsp;&nbsp; </label>
29
- <right-tree @re-res="$parent.$parent.getRes" style="width: 60%"></right-tree>
29
+ <manage-right-tree @re-res="$parent.$parent.getRes" style="width: 60%"></manage-right-tree>
30
30
  </div>
31
31
  <div class="col-sm-3 form-group">
32
32
  <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
@@ -189,7 +189,7 @@ export default {
189
189
  this.printTime = this.$login.toStandardTimeString()
190
190
  let orgcondition = ''
191
191
  if (this.f_orgid[0]) {
192
- orgcondition += ` and f_orgid in (${this.getParamStr(this.f_orgid)})`
192
+ orgcondition += ` and f_orgid in (${this.f_orgid})`
193
193
  }
194
194
  if(this.f_state && this.f_state[0]) {
195
195
  orgcondition += ` and f_state in('${this.f_state.toString().replace(/,/g,"','")}')`
@@ -201,17 +201,6 @@ export default {
201
201
  hidden() {
202
202
  this.criteriaShow = !this.criteriaShow
203
203
  },
204
- getParamStr (array) {
205
- let stringValue = ''
206
- for (let i = 0; i < array.length; i++) {
207
- if (i === array.length - 1) {
208
- stringValue = stringValue + "'" + array[i] + "'"
209
- } else {
210
- stringValue = stringValue + "'" + array[i] + "',"
211
- }
212
- }
213
- return stringValue
214
- },
215
204
  getRes (obj) {
216
205
  this.orgname = obj.res[0]
217
206
  this.f_orgid = obj.resids
@@ -0,0 +1,75 @@
1
+ /**
2
+ * 获得给定资源的名称全路径
3
+ * @param res: 资源
4
+ * @param name: 全路径字段
5
+ */
6
+ export function getFullName (res, name) {
7
+ let result = ''
8
+ while (res != null) {
9
+ if (result === '') {
10
+ result = res[name]
11
+ } else {
12
+ result = res[name] + '.' + result
13
+ }
14
+ res = res.parent
15
+ }
16
+ return result
17
+ }
18
+
19
+ /**
20
+ * 给拿到的资源添加父关系
21
+ * @param res
22
+ */
23
+ export function procParent (reses) {
24
+ for (let value of reses) {
25
+ procInnerParent(value)
26
+ }
27
+ }
28
+
29
+ // 给资源res的所有子,添加父关系
30
+ function procInnerParent (res) {
31
+ for (let value of res.children) {
32
+ value.parent = res
33
+ procInnerParent(value)
34
+ }
35
+ }
36
+
37
+ /**
38
+ * 从给定一批资源中,递归找到给定号码的资源
39
+ * @param model:给定的一批资源
40
+ * @param id:要查找的资源id串
41
+ */
42
+ export function find (model, id) {
43
+ // 返回最后一个id信息
44
+ let index = id.lastIndexOf('.')
45
+ if (index !== -1) {
46
+ id = id.substr(index + 1)
47
+ }
48
+
49
+ // 子中有,返回子里的
50
+ for (let value of model) {
51
+ let ret = getInnerResourceById(value, id)
52
+ if (ret) {
53
+ return ret
54
+ }
55
+ }
56
+
57
+ return null
58
+ }
59
+
60
+ // 根据id号取资源,自己不是,递归从子中找
61
+ function getInnerResourceById (res, id) {
62
+ if (res.id === id) {
63
+ return res
64
+ }
65
+
66
+ // 子中有,返回子里的
67
+ for (let value of res.children) {
68
+ let ret = getInnerResourceById(value, id)
69
+ if (ret) {
70
+ return ret
71
+ }
72
+ }
73
+
74
+ return null
75
+ }
package/src/saleManage.js CHANGED
@@ -65,6 +65,12 @@ export default function () {
65
65
  Vue.component('print-table-self', (resolve) => {
66
66
  require(['./components/sale/common/PrintTableSelf'], resolve)
67
67
  })
68
+ Vue.component('manage-res-select', (resolve) => {
69
+ require(['./components/sale/common/ResSelect'], resolve)
70
+ })
71
+ Vue.component('manage-right-tree', (resolve) => {
72
+ require(['./components/sale/common/RightTree'], resolve)
73
+ })
68
74
 
69
75
  // 统计查询
70
76
  Vue.component('tongji-manage', (resolve) => {