manage-client 4.1.131 → 4.1.133

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.
@@ -0,0 +1,270 @@
1
+ <template>
2
+ <div class="basic-main" style="height: 100%">
3
+ <criteria-paged :model="model" :pager='false' v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial >
6
+ <div class="row">
7
+ <div class="col-sm-2 form-group" >
8
+ <label class="font_normal_body" for="startDate">开始日期:</label>
9
+ <datepicker id="startDate" placeholder="开始日期" style="width: 60%"
10
+ v-model="model.startDate"
11
+ :value.sync="model.startDate"
12
+ :disabled-days-of-Week="[]"
13
+ :format="'yyyy-MM-dd HH:mm:ss'"
14
+ :show-reset-button="reset">
15
+ </datepicker>
16
+ </div>
17
+ <div class="col-sm-2 form-group" >
18
+ <label class="font_normal_body" for="endDate">结束日期:</label>
19
+ <datepicker id="endDate" placeholder="结束日期" style="width: 60%"
20
+ v-model="model.endDate"
21
+ :value.sync="model.endDate"
22
+ :disabled-days-of-Week="[]"
23
+ :format="'yyyy-MM-dd HH:mm:ss'"
24
+ :show-reset-button="reset">
25
+ </datepicker>
26
+ </div>
27
+ <div class="col-sm-2 form-group">
28
+ <label class="font_normal_body">&nbsp;&nbsp;&nbsp;公司&nbsp;&nbsp;&nbsp; </label>
29
+ <right-tree @re-res="$parent.$parent.getRes"></right-tree>
30
+ </div>
31
+ <div class="col-sm-2 form-group">
32
+ <label class="font_normal_body" for="dep" >部&emsp;&emsp;门:</label>
33
+ <res-select-filter restype='department'
34
+ @res-select="$parent.$parent.getdep"
35
+ :parentresid="$parent.$parent.depresid"
36
+ :initresid='$parent.$parent.depid'
37
+ :filter-ids="$parent.$parent.getAllowedDepIds()">
38
+ </res-select-filter>
39
+ </div>
40
+ <div class="col-sm-2 form-group">
41
+ <label class="font_normal_body" for="oper">人&emsp;&emsp;员:</label>
42
+ <res-select-filter restype='user'
43
+ @res-select="$parent.$parent.getuser"
44
+ :parentresid="$parent.$parent.userresid"
45
+ :initresid='$parent.$parent.operatorid'
46
+ :filter-ids="$parent.$parent.getAllowedUserIds()">
47
+ </res-select-filter>
48
+ </div>
49
+ </div>
50
+ <div class="span" style = "float:right;">
51
+ <button class="button_search" @click="$parent.$parent.searchData()">查询</button>
52
+ <report-print id='gasprice' top='3cm' left='0' width='100%' height='100%' :preview="true"></report-print>
53
+ <report-excel id='gasprice'></report-excel>
54
+ <div style="float: right" class="button_spacing" :class="{'button_shrink_top':$parent.$parent.criteriaShow,
55
+ 'button_shrink_bottom':!$parent.$parent.criteriaShow}" @click="$parent.$parent.hidden()"></div>
56
+ </div>
57
+ <div class="row" v-show="$parent.$parent.criteriaShow">
58
+ <div class="col-sm-2 form-group">
59
+ <label class="font_normal_body">气表类型</label>
60
+ <v-select :value.sync="model.f_meter_type" multiple
61
+ :options='$parent.$parent.metertypes' placeholder='请选择' v-model="model.f_meter_type"
62
+ condition="f_meter_classify in {}"
63
+ close-on-select></v-select>
64
+ </div>
65
+ <div class="col-sm-2 form-group">
66
+ <label class="font_normal_body">气表品牌</label>
67
+ <v-select :value.sync="model.f_meter_brand"
68
+ v-model="model.f_meter_brand"
69
+ :options='$parent.$parent.meterbrands' placeholder='请选择'
70
+ condition="f_meter_brand = '{}'"
71
+ close-on-select></v-select>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </criteria>
76
+ <div partial='list' v-el:handcollect id='gasprice' style="overflow-y: scroll">
77
+ <table class='tableprint' style="margin: 0px auto">
78
+ <thead>
79
+ <tr>
80
+ <th :colspan='$parent.tablen' style="font-weight: normal; text-align: left;">
81
+ <h3 style="text-align: center">气表售气量</h3>
82
+ </th>
83
+ </tr>
84
+ <tr>
85
+ <th :colspan='$parent.tablen' style="font-weight: normal; text-align: center;">
86
+ 时间区间:{{$refs.criteria.model.startDate}} - {{ $refs.criteria.model.endDate }}<br/>
87
+ 打印时间:{{{$parent.printTime}}}
88
+ </th>
89
+ </tr>
90
+ <tr>
91
+ <th :colspan='$parent.tablen' style="font-weight: normal; text-align: center;">
92
+ <div>
93
+ <span v-show="$parent.orgname.trim()!=''">公司:{{$parent.orgname}}</span>
94
+ </div>
95
+ </th>
96
+ </tr>
97
+ </thead>
98
+ <tr>
99
+ <td :colspan='$parent.tablen' style="border-style: none;">
100
+ {{{ model.data.replace(' ',' style="border-collapse:collapse; border:none;border: solid #000 2px;" ') }}}
101
+ </td>
102
+ </tr>
103
+ <tfoot>
104
+ <tr style="text-align: left">
105
+ <th :colspan='$parent.tablen/3'>财务审核:</th>
106
+ <th :colspan='$parent.tablen/3'>收款审核:</th>
107
+ <th :colspan='$parent.tablen/3'>收款员:</th>
108
+ </tr>
109
+ </tfoot>
110
+ </table>
111
+ </div>
112
+ </criteria-paged>
113
+ </div>
114
+ </template>
115
+
116
+ <script>
117
+ import {DataModel, HttpResetClass} from 'vue-client'
118
+ import ResSelectFilter from './ResSelectFilter.vue'
119
+ import co from 'co'
120
+
121
+ export default {
122
+ title: '气表售气量',
123
+ components: {
124
+ ResSelectFilter
125
+ },
126
+ props: ['data'],
127
+ data () {
128
+ return {
129
+ printTime: this.$login.toStandardTimeString(),
130
+ depresid: [],
131
+ userresid: [],
132
+ f_orgid: this.$login.f.orgid,
133
+ f_depid: this.$login.f.depids,
134
+ f_operatorid: this.$login.f.id,
135
+ operatorid: [],
136
+ depid: [],
137
+ tablen:0,
138
+ orgname: '',
139
+ depname: '',
140
+ operatorname: '',
141
+ orgCondtionStr: '1=1',
142
+ model: new DataModel('api/af-revenue/report/qibiao-shouqi', {startDate: 'this.model.startDate', endDate: 'this.model.endDate',
143
+ f_orgid: 'this.model.f_orgid'}),
144
+ reportStr: null,
145
+ criteriaShow: false,
146
+ // 下拉框
147
+ meterbrands: [],
148
+ show: false,
149
+ selectedOrgId: null,
150
+ selectedDepId: null,
151
+ allowedDepsByOrg: {
152
+ '3689': ['234624497607639042', '234624639551275010', '234625001985277954', '234624858028376066', '234625159867269122']
153
+ },
154
+ allowedUsersByDep: {
155
+ }
156
+ }
157
+ },
158
+ ready () {
159
+ this.$refs.paged.$refs.criteria.model.startDate = this.$login.toStandardDateString() + ' 00:00:00'
160
+ this.$refs.paged.$refs.criteria.model.endDate = this.$login.toStandardDateString() + ' 23:59:59'
161
+ console.log(this.$login.f)
162
+ // let brandArr = []
163
+ // this.$MagGetSaleParam.getGasbrand().forEach((item) => {
164
+ // let temp = {}
165
+ // temp.label = item.label
166
+ // temp.value = item.value.f_meter_brand
167
+ // brandArr.push(temp)
168
+ // })
169
+ // this.meterbrands = [{label: '全部', value: ''}, ...brandArr]
170
+ this.initParams()
171
+ },
172
+ methods: {
173
+ async initParams (condition) {
174
+ // 初始化气表品牌
175
+ let HttpReset = new HttpResetClass()
176
+ let yy=this.$refs.paged.$refs.criteria.model.f_meter_type
177
+ var data = await HttpReset.load('POST', 'api/af-revenue/sql/singleTable_Final', {
178
+ data: {
179
+ condition: '1=1 and f_orgid in(' + this.f_orgid + ')' + (condition==null ? '' : condition),
180
+ tablename: 't_gasbrand',
181
+ groupitem: 'f_meter_brand',
182
+ orderitem: 'f_meter_brand',
183
+ items: 'f_meter_brand'
184
+ }
185
+ }, {resolveMsg: null, rejectMsg: '获取气表品牌失败!'})
186
+ console.log('气表品牌-->',data)
187
+ let brandArr = [{label: '全部', value: ''}]
188
+ for (let row of data.data){
189
+ brandArr.push({label: row.f_meter_brand, value: row.f_meter_brand})
190
+ }
191
+ this.meterbrands = brandArr
192
+ },
193
+ searchData () {
194
+ this.$refs.paged.$refs.criteria.search()
195
+ },
196
+ selfSearch (args) {
197
+ this.printTime = this.$login.toStandardTimeString()
198
+ let orgcondition = '1=1'
199
+ if(this.f_orgid && this.f_orgid[0]) {
200
+ orgcondition += ` and f_orgid in ('${this.f_orgid}')`
201
+ }
202
+ if (this.f_depid && this.f_depid[0]) {
203
+ orgcondition += ` and f_depid in ('${this.f_depid}')`
204
+ }
205
+ if(this.f_operatorid && this.f_operatorid[0]) {
206
+ orgcondition += ` and f_operatorid in ('${this.f_operatorid}')`
207
+ }
208
+ this.$refs.paged.$refs.criteria.model.f_orgid = orgcondition
209
+ this.$refs.paged.search(args)
210
+ },
211
+ getRes (obj) {
212
+ this.orgname = obj.res[0]
213
+ this.f_orgid = obj.resids
214
+ this.depresid = obj.resids
215
+ this.initParams()
216
+ this.selectedOrgId = obj.resids[0]
217
+ this.depid = []
218
+ this.f_depid = []
219
+ this.userresid = []
220
+ this.f_operatorid = []
221
+ this.operatorname = ''
222
+ this.depname = ''
223
+ },
224
+ getdep (obj, val) {
225
+ this.depname = val[0]
226
+ // this.userresid = obj
227
+ this.f_depid = obj
228
+ this.selectedDepId = obj[0]
229
+ this.f_operatorid = []
230
+ this.operatorname = []
231
+ },
232
+ getAllowedDepIds() {
233
+ if (!this.selectedOrgId) return null
234
+ return this.allowedDepsByOrg[this.selectedOrgId] || null
235
+ },
236
+ getAllowedUserIds() {
237
+ if (!this.selectedDepId) return null
238
+ return this.allowedUsersByDep[this.selectedDepId] || null
239
+ },
240
+ getuser ( obj, val) {
241
+ this.operatorname = val[0]
242
+ this.f_operatorid = obj
243
+ },
244
+ show() {
245
+ this.criteriaShow = true
246
+ },
247
+ hidden() {
248
+ this.criteriaShow = !this.criteriaShow
249
+ },
250
+ close () {
251
+ this.show = false
252
+ }
253
+ },
254
+ watch: {
255
+ 'model.data' (val) {
256
+ this.tablen = val.split('</tr>').map(item => item.split('</td>').length-1).reduce((x, y) => x > y ? x : y)
257
+ }
258
+ },
259
+ computed: {
260
+ metertypes() {
261
+ return [{label: ' 全部 ', value: ''}, ...this.$appdata.getParam('气表类型')]
262
+ }
263
+ }
264
+ }
265
+ </script>
266
+ <style scoped>
267
+ .noborder{
268
+ border: none;
269
+ }
270
+ </style>
@@ -0,0 +1,187 @@
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
+ specialquery: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ //资源数据
27
+ resObj:{},
28
+ isMul: {
29
+ type: Boolean,
30
+ default: true
31
+ },
32
+ //资源初始化数据
33
+ initresid: {
34
+ type: Array,
35
+ default() { return [] },
36
+ },
37
+ //父层id
38
+ parentresid: {
39
+ type: Array,
40
+ default() { return [] },
41
+ },
42
+ mustselect: {
43
+ type: Boolean,
44
+ default: false
45
+ },
46
+ filterIds: {
47
+ type: Array,
48
+ default() { return null }
49
+ }
50
+ },
51
+ data () {
52
+ return {
53
+ //资源数据
54
+ resObj:{},
55
+ //资源数据列表
56
+ resoptions:[],
57
+ //选中资源数据
58
+ selectres: [],
59
+ }
60
+ },
61
+ ready () {
62
+ //获取资源列表
63
+ this.getResList()
64
+ },
65
+ methods:{
66
+ //树形结构变成list
67
+ findById(val) {
68
+ if(val){
69
+ if(this.checkidres(val)){
70
+ this.treetoList(val,'')
71
+ }else if(val.children.length>0){
72
+ for (let value of val.children) {
73
+ this.findById(value)
74
+ }
75
+ }
76
+ }
77
+ },
78
+ //树形结构变成list
79
+ treetoList(val,parentname) {
80
+ for (let value of val.children) {
81
+ this.ergodicList(value,parentname)
82
+ }
83
+ },
84
+ //找到跟节点
85
+ ergodicList (val,parentname) {
86
+ if(val.children.length > 0 ){
87
+ parentname=parentname+val.name
88
+ this.treetoList(val,parentname)
89
+ }else {
90
+ if(this.filterIds && !this.filterIds.includes(val.id)){
91
+ return
92
+ }
93
+ if(this.restype=='organization'){
94
+ parentname=parentname.replace("组织机构","")
95
+ this.resoptions.push({label: val.name+' - '+parentname, value: val.id})
96
+ }else{
97
+ if (this.specialquery && this.restype == 'department') {
98
+ if (val.f_dep_type === '营业厅') {
99
+ this.resoptions.push({label: val.name, value: val.id})
100
+ }
101
+ }else {
102
+ this.resoptions.push({label: val.name, value: val.id})
103
+ }
104
+ }
105
+ }
106
+ },
107
+ //检查id是否存在
108
+ checkidres(val){
109
+ let flag=false
110
+ //如果没传值得话 不过滤
111
+ if(this.parentresid.length==0&&this.restype=='organization'){
112
+ flag=true
113
+ }
114
+ this.parentresid.forEach((item) => {
115
+ if(item==val.id){
116
+ flag=true
117
+ }
118
+ })
119
+ return flag;
120
+ },
121
+ //资源改变
122
+ resChange(val){
123
+ let orgnames=[]
124
+ Object.keys(this.resoptions).forEach((key) => {
125
+ if(this.selectres.includes(this.resoptions[key].value))
126
+ orgnames.push(this.resoptions[key].label)
127
+ })
128
+ console.log('资源改变。。', val, orgnames)
129
+ this.$dispatch('res-select', this.selectres, orgnames)
130
+ },
131
+ //获取资源数据
132
+ async getResList() {
133
+
134
+ let http = new HttpResetClass()
135
+
136
+ let req = await http.load('POST', '/rs/search', {data: {
137
+ source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
138
+ userid: this.$login.f.id
139
+ }}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
140
+ this.resObj=req.data[0]
141
+ this.dealdata()
142
+ },
143
+ dealdata(){
144
+ this.resoptions=[]
145
+ this.findById(this.resObj);
146
+ //赋值资源数据
147
+ let arryselect=[]
148
+ this.resoptions.forEach((item) => {
149
+ if(this.initresid.length>0){
150
+ this.initresid.forEach((init) => {
151
+ if(item.value==init){
152
+ arryselect.push(item.value)
153
+ }
154
+ })
155
+ }
156
+ })
157
+ //赋值资源选中初始值
158
+ this.selectres=arryselect
159
+ }
160
+ },
161
+ watch: {
162
+ //监听初始化资源id
163
+ 'initresid.length'(){
164
+ this.dealdata()
165
+ },
166
+ //监听初始化资源id
167
+ 'parentresid'(){
168
+ this.dealdata()
169
+ },
170
+ 'filterIds'(newVal, oldVal) {
171
+ if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
172
+ return
173
+ }
174
+ this.dealdata()
175
+ },
176
+ initresid: {
177
+ handler(newVal, oldVal) {
178
+ // 避免重复触发
179
+ if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
180
+ return;
181
+ }
182
+ this.dealdata();
183
+ },
184
+ }
185
+ },
186
+ }
187
+ </script>