sale-client 4.2.8 → 4.2.10

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.
@@ -1,124 +1,124 @@
1
- import Vue from 'vue'
2
- import {HttpResetClass} from 'vue-client'
3
- import GetSaleParam from './GetSaleParams'
4
-
5
- let loadParamGen = async function (f_filialeid) {
6
- let http = new HttpResetClass()
7
- if (GetSaleParam.gasbrands.length === 0 && GetSaleParam.prices.length === 0 && GetSaleParam.adjustables.length === 0) {
8
- let getParams = await http.load('POST', 'api/af-revenue/logic/getSaleInitData', {data: {f_orgid: f_filialeid || Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
9
- if (getParams.data) {
10
- LoadParams.organizeData(getParams.data)
11
- }
12
- } else {
13
- let validate = LoadParams.isReset(f_filialeid)
14
- console.log('验证是否需要重新加载', validate)
15
- if (validate) {
16
- GetSaleParam.gasbrands = []
17
- GetSaleParam.prices = []
18
- GetSaleParam.adjustables = []
19
- let getParams = await http.load('POST', 'api/af-revenue/logic/getSaleInitData', {data: {f_orgid: f_filialeid || Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
20
- if (getParams.data) {
21
- LoadParams.organizeData(getParams.data)
22
- }
23
- }
24
- }
25
- }
26
-
27
- let loadMeterBookGen = async function (f_filialeid) {
28
- let http = new HttpResetClass()
29
- if (GetSaleParam.meterbooks.length === 0) {
30
- let getMeterBooks = await http.load('POST', 'api/af-revenue/logic/sale_getMeterBooksData', {data: {f_orgid: f_filialeid || Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
31
- if (getMeterBooks.data) {
32
- LoadParams.organizeBooksData(getMeterBooks.data)
33
- }
34
- }
35
- }
36
-
37
- let LoadParams = {
38
-
39
- install (Vue, options) {
40
- // 给vue增添对话框显示方法
41
- Vue.LoadParams = Vue.prototype.$LoadParams = LoadParams
42
- },
43
-
44
- async loadParam () {
45
- await loadParamGen(null)
46
- },
47
- async loadParam (f_filialeid) {
48
- await loadParamGen(f_filialeid)
49
- },
50
-
51
- // 加载抄表册
52
- async loadMeterBook (f_filialeid) {
53
- await loadMeterBookGen(f_filialeid)
54
- },
55
-
56
- // 开启卡监听
57
- organizeData (fromSystem) {
58
- console.log('接受System中返回的参数进行组织', fromSystem)
59
- fromSystem.gasbrands.forEach((item, index) => {
60
- GetSaleParam.gasbrands[index] = {}
61
- GetSaleParam.gasbrands[index].label = item.f_meter_brand
62
- let gasmodel = []
63
- item.gasmodel.forEach((item, index) => {
64
- gasmodel[index] = {}
65
- gasmodel[index].label = item.f_meter_style + item.f_type
66
- gasmodel[index].value = item
67
- })
68
- item.gasmodel = gasmodel
69
- GetSaleParam.gasbrands[index].value = item
70
- })
71
-
72
- fromSystem.adjustable.forEach((item, index) => {
73
- GetSaleParam.adjustables[index] = {}
74
- GetSaleParam.adjustables[index].label = item.f_adjustable_name
75
- GetSaleParam.adjustables[index].value = item
76
- })
77
- GetSaleParam.prices = [...[], ...fromSystem.price]
78
- },
79
-
80
- organizeBooksData (fromSystem) {
81
- // 对抄表册按名称进行字母排序
82
- const sortedMeterbooks = fromSystem.meterbooks.sort((a, b) => {
83
- return a.f_book_name.localeCompare(b.f_book_name, 'zh-CN')
84
- })
85
- sortedMeterbooks.forEach((item, index) => {
86
- GetSaleParam.meterbooks[index] = {}
87
- GetSaleParam.meterbooks[index].label = item.f_book_name
88
- GetSaleParam.meterbooks[index].value = item.id
89
- })
90
-
91
- // 对抄表册编号单独进行字母排序
92
- const bookCodesData = fromSystem.meterbooks.filter(item => item.f_book_code)
93
- const sortedBookCodes = bookCodesData.sort((a, b) => {
94
- return a.f_book_code.localeCompare(b.f_book_code, 'zh-CN')
95
- })
96
-
97
- sortedBookCodes.forEach((item, index) => {
98
- GetSaleParam.bookcodes[index] = {}
99
- GetSaleParam.bookcodes[index].label = item.f_book_code
100
- GetSaleParam.bookcodes[index].value = item.id
101
- })
102
- },
103
-
104
- isReset (val) {
105
- if (GetSaleParam.gasbrands.length > 0) {
106
- if (GetSaleParam.gasbrands[0].value.f_using_orgid !== val) {
107
- return true
108
- }
109
- }
110
- if (GetSaleParam.prices.length > 0) {
111
- if (GetSaleParam.prices[0].f_filialeid !== val) {
112
- return true
113
- }
114
- }
115
- if (GetSaleParam.adjustables.length > 0) {
116
- if (GetSaleParam.adjustables[0].value.f_filialeid !== val) {
117
- return true
118
- }
119
- }
120
- }
121
-
122
- }
123
-
124
- export default LoadParams
1
+ import Vue from 'vue'
2
+ import {HttpResetClass} from 'vue-client'
3
+ import GetSaleParam from './GetSaleParams'
4
+
5
+ let loadParamGen = async function (f_filialeid) {
6
+ let http = new HttpResetClass()
7
+ if (GetSaleParam.gasbrands.length === 0 && GetSaleParam.prices.length === 0 && GetSaleParam.adjustables.length === 0) {
8
+ let getParams = await http.load('POST', 'api/af-revenue/logic/getSaleInitData', {data: {f_orgid: f_filialeid || Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
9
+ if (getParams.data) {
10
+ LoadParams.organizeData(getParams.data)
11
+ }
12
+ } else {
13
+ let validate = LoadParams.isReset(f_filialeid)
14
+ console.log('验证是否需要重新加载', validate)
15
+ if (validate) {
16
+ GetSaleParam.gasbrands = []
17
+ GetSaleParam.prices = []
18
+ GetSaleParam.adjustables = []
19
+ let getParams = await http.load('POST', 'api/af-revenue/logic/getSaleInitData', {data: {f_orgid: f_filialeid || Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
20
+ if (getParams.data) {
21
+ LoadParams.organizeData(getParams.data)
22
+ }
23
+ }
24
+ }
25
+ }
26
+
27
+ let loadMeterBookGen = async function (f_filialeid) {
28
+ let http = new HttpResetClass()
29
+ if (GetSaleParam.meterbooks.length === 0) {
30
+ let getMeterBooks = await http.load('POST', 'api/af-revenue/logic/sale_getMeterBooksData', {data: {f_orgid: f_filialeid || Vue.$login.f.orgid}}, {resolveMsg: null, rejectMsg: '获取营收参数出错!!!'})
31
+ if (getMeterBooks.data) {
32
+ LoadParams.organizeBooksData(getMeterBooks.data)
33
+ }
34
+ }
35
+ }
36
+
37
+ let LoadParams = {
38
+
39
+ install (Vue, options) {
40
+ // 给vue增添对话框显示方法
41
+ Vue.LoadParams = Vue.prototype.$LoadParams = LoadParams
42
+ },
43
+
44
+ async loadParam () {
45
+ await loadParamGen(null)
46
+ },
47
+ async loadParam (f_filialeid) {
48
+ await loadParamGen(f_filialeid)
49
+ },
50
+
51
+ // 加载抄表册
52
+ async loadMeterBook (f_filialeid) {
53
+ await loadMeterBookGen(f_filialeid)
54
+ },
55
+
56
+ // 开启卡监听
57
+ organizeData (fromSystem) {
58
+ console.log('接受System中返回的参数进行组织', fromSystem)
59
+ fromSystem.gasbrands.forEach((item, index) => {
60
+ GetSaleParam.gasbrands[index] = {}
61
+ GetSaleParam.gasbrands[index].label = item.f_meter_brand
62
+ let gasmodel = []
63
+ item.gasmodel.forEach((item, index) => {
64
+ gasmodel[index] = {}
65
+ gasmodel[index].label = item.f_meter_style + item.f_type
66
+ gasmodel[index].value = item
67
+ })
68
+ item.gasmodel = gasmodel
69
+ GetSaleParam.gasbrands[index].value = item
70
+ })
71
+
72
+ fromSystem.adjustable.forEach((item, index) => {
73
+ GetSaleParam.adjustables[index] = {}
74
+ GetSaleParam.adjustables[index].label = item.f_adjustable_name
75
+ GetSaleParam.adjustables[index].value = item
76
+ })
77
+ GetSaleParam.prices = [...[], ...fromSystem.price]
78
+ },
79
+
80
+ organizeBooksData (fromSystem) {
81
+ // 对抄表册按名称进行字母排序
82
+ const sortedMeterbooks = fromSystem.meterbooks.sort((a, b) => {
83
+ return a.f_book_name.localeCompare(b.f_book_name, 'zh-CN')
84
+ })
85
+ sortedMeterbooks.forEach((item, index) => {
86
+ GetSaleParam.meterbooks[index] = {}
87
+ GetSaleParam.meterbooks[index].label = item.f_book_name
88
+ GetSaleParam.meterbooks[index].value = item.id
89
+ })
90
+
91
+ // 对抄表册编号单独进行字母排序
92
+ const bookCodesData = fromSystem.meterbooks.filter(item => item.f_book_code)
93
+ const sortedBookCodes = bookCodesData.sort((a, b) => {
94
+ return a.f_book_code.localeCompare(b.f_book_code, 'zh-CN')
95
+ })
96
+
97
+ sortedBookCodes.forEach((item, index) => {
98
+ GetSaleParam.bookcodes[index] = {}
99
+ GetSaleParam.bookcodes[index].label = item.f_book_code
100
+ GetSaleParam.bookcodes[index].value = item.id
101
+ })
102
+ },
103
+
104
+ isReset (val) {
105
+ if (GetSaleParam.gasbrands.length > 0) {
106
+ if (GetSaleParam.gasbrands[0].value.f_using_orgid !== val) {
107
+ return true
108
+ }
109
+ }
110
+ if (GetSaleParam.prices.length > 0) {
111
+ if (GetSaleParam.prices[0].f_filialeid !== val) {
112
+ return true
113
+ }
114
+ }
115
+ if (GetSaleParam.adjustables.length > 0) {
116
+ if (GetSaleParam.adjustables[0].value.f_filialeid !== val) {
117
+ return true
118
+ }
119
+ }
120
+ }
121
+
122
+ }
123
+
124
+ export default LoadParams
@@ -743,8 +743,6 @@
743
743
  let reviewReason = reason !== undefined ? reason : this.reasonText
744
744
  let handplan = {
745
745
  id: id,
746
- f_oughtamount: 0,
747
- f_tablebase: 0,
748
746
  f_input_date: null,
749
747
  f_meter_state: '未抄表',
750
748
  f_audit_state: '审核不通过',
@@ -60,16 +60,16 @@
60
60
  </template>
61
61
  <script>
62
62
  import { HttpResetClass } from 'vue-client'
63
- import Vue from "vue";
63
+ import Vue from 'vue'
64
64
 
65
65
  export default {
66
- title: "附件",
67
- props: ['blodid', 'isremark', 'isusetype','takeimg','defname','isupload','fusetype','cols'],
68
- data() {
66
+ title: '附件',
67
+ props: ['blodid', 'isremark', 'isusetype', 'takeimg', 'defname', 'isupload', 'fusetype', 'cols'],
68
+ data () {
69
69
  return {
70
70
  isDelete: '1', // 删除按钮,可以进行控制(权限等)
71
71
  fileInfoData: [], // 数据库存储的文件记录对象数组
72
- headers: {'username': this.$login.f.name, 'blodid': '', 'fremarks': '','defname':'','fusetype':this.fusetype?this.fusetype:''}, // 调用rs/file/uploadFile 的参数
72
+ headers: {'username': this.$login.f.name, 'blodid': '', 'fremarks': '', 'defname': '', 'fusetype': this.fusetype ? this.fusetype : ''}, // 调用rs/file/uploadFile 的参数
73
73
  showUpload: false, // 上传模态框控制
74
74
  showhighmeter: false, // 高拍仪组件控制
75
75
  useType: '', // 使用类型
@@ -78,49 +78,47 @@ export default {
78
78
  },
79
79
  methods: {
80
80
  // 查询按钮事件
81
- delet(index, row) {
81
+ delet (index, row) {
82
82
  this.$resetdelete('api/af-revenue/entity/t_files', {id: row.id}, {resolveMsg: '删除成功', rejectMsg: '删除失败'}).then((res) => {
83
83
  this.fileInfoData.splice(index, 1)
84
84
  })
85
85
  },
86
- GetRequest() {
87
- var url = location.search;
88
- var theRequest = new Object();
89
- if (url.indexOf("?") != -1) {
90
- var str = url.substr(1);
91
- let strs = str.split("&");
86
+ GetRequest () {
87
+ var url = location.search
88
+ var theRequest = new Object()
89
+ if (url.indexOf('?') != -1) {
90
+ var str = url.substr(1)
91
+ let strs = str.split('&')
92
92
  for (var i = 0; i < strs.length; i++) {
93
- theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
93
+ theRequest[strs[i].split('=')[0]] = decodeURIComponent(strs[i].split('=')[1])
94
94
  }
95
95
  }
96
- return theRequest;
96
+ return theRequest
97
97
  },
98
- downloadfile(filepath){
99
-
100
- var link = document.createElement('a');
98
+ downloadfile (filepath) {
99
+ var link = document.createElement('a')
101
100
  // let pathName = "http://" + location.host + filepath;
102
- link.href = filepath;
103
- link.target='_blank'
104
- link.dispatchEvent(new MouseEvent('click'));
101
+ link.href = filepath
102
+ link.target = '_blank'
103
+ link.dispatchEvent(new MouseEvent('click'))
105
104
  },
106
- upload() {
107
-
108
- if(this.showhighmeter){
109
- console.log(this,'测试')
105
+ upload () {
106
+ if (this.showhighmeter) {
107
+ console.log(this, '测试')
110
108
  this.$refs.ltgao.closeVideo()
111
109
  }
112
110
  console.log('测试1')
113
111
  this.showhighmeter = !this.showhighmeter
114
112
  },
115
- async load(self) {
113
+ async load (self) {
116
114
  let condition = `f_blobid= '${self.headers.blodid}' `
117
- if(this.fusetype){
115
+ if (this.fusetype) {
118
116
  condition += ` and fusetype='${this.fusetype}'`
119
117
  }
120
118
  var http = new HttpResetClass()
121
119
  let data = {
122
120
  tablename: 't_files',
123
- condition: condition+` order by f_uploaddate desc `
121
+ condition: condition + ` order by f_uploaddate desc `
124
122
  }
125
123
  let getFile = await http.load('POST', 'api/af-revenue/sql/saleSingleTable', {data: data}, {
126
124
  warnMsg: null,
@@ -129,23 +127,22 @@ export default {
129
127
 
130
128
  for (var i = 0; i < getFile.data.length; i++) {
131
129
  // 如果使用类型包含导入字样,则是execl文件导入的,不做显示
132
- if(getFile.data[i].fusetype&&(getFile.data[i].fusetype.includes('execl导入'))){
133
- getFile.data.splice(i,1)
130
+ if (getFile.data[i].fusetype && (getFile.data[i].fusetype.includes('execl导入'))) {
131
+ getFile.data.splice(i, 1)
134
132
  i--
135
133
  continue
136
134
  }
137
135
  let temp = getFile.data[i].f_downloadpath
138
- let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
139
- getFile.data[i].f_downloadURL = location.protocol + "//" + location.host + "/" + URL
136
+ let URL = temp.substring(temp.lastIndexOf(':\\') + 2)
137
+ getFile.data[i].f_downloadURL = location.protocol + '//' + location.host + '/' + URL
140
138
  }
141
139
  self.fileInfoData = []
142
140
  self.fileInfoData = getFile.data
143
141
  },
144
142
  // 数据库时间格式化
145
- formatdate(val) {
146
- //20180914151603 : 2018-09-14 15:16:03
147
- if (val.length != 14)
148
- return
143
+ formatdate (val) {
144
+ // 20180914151603 : 2018-09-14 15:16:03
145
+ if (val.length != 14) { return }
149
146
  let year = val.substr(0, 4)
150
147
  let month = val.substr(4, 2)
151
148
  let day = val.substr(6, 2)
@@ -155,60 +152,60 @@ export default {
155
152
  return year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + second
156
153
  },
157
154
  // 打开文件上传对话框
158
- fileUpload() {
155
+ fileUpload () {
159
156
  this.showUpload = true
160
157
  },
161
158
  // 关闭文件上传对话框
162
- close() {
159
+ close () {
163
160
  this.showUpload = false
164
161
  // 将选的文件清空
165
162
  this.$refs.file.$el.querySelector('input').value = ''
166
163
  this.load(this)
167
164
  },
168
- convertBase64ToBlob(base64String) {
165
+ convertBase64ToBlob (base64String) {
169
166
  // 将base64解码
170
- var bytes = atob(base64String);
171
- //var bytes = base64;
172
- var bytesCode = new ArrayBuffer(bytes.length);
167
+ var bytes = atob(base64String)
168
+ // var bytes = base64;
169
+ var bytesCode = new ArrayBuffer(bytes.length)
173
170
  // 转换为类型化数组
174
- var byteArray = new Uint8Array(bytesCode);
171
+ var byteArray = new Uint8Array(bytesCode)
175
172
 
176
173
  // 将base64转换为ascii码
177
174
  for (var i = 0; i < bytes.length; i++) {
178
- byteArray[i] = bytes.charCodeAt(i);
175
+ byteArray[i] = bytes.charCodeAt(i)
179
176
  }
180
177
  // 生成Blob对象(文件对象)
181
- return new Blob([bytesCode], {type: 'image/jpeg'});
178
+ return new Blob([bytesCode], {type: 'image/jpeg'})
182
179
  },
183
- newPhoto(Imgbase64) {
180
+ newPhoto (Imgbase64) {
184
181
  let form = new FormData()
185
182
  let xhr = new XMLHttpRequest()
186
- let formDataBoundary = "----WebkitFormBoundary" + "GaoPaiYi";
183
+ let formDataBoundary = '----WebkitFormBoundary' + 'GaoPaiYi'
187
184
  form.append('Content-Type', 'multipart/form-data;boundary=' + formDataBoundary)
188
- form.append('file', this.convertBase64ToBlob(Imgbase64), "GaoPaiYi.jpg")
189
- xhr.open("POST", "rs/file/uploadFile")
185
+ form.append('file', this.convertBase64ToBlob(Imgbase64), 'GaoPaiYi.jpg')
186
+ xhr.open('POST', 'api/af-revenue/file/uploadFile')
190
187
 
191
188
  if (this.headers) {
192
189
  for (var header in this.headers) {
193
190
  xhr.setRequestHeader(header, encodeURIComponent(this.headers[header]))
194
191
  }
195
192
  }
196
- xhr.send(form)
197
193
  if (Vue.$login && Vue.$login.jwt) {
198
194
  xhr.setRequestHeader('Authorization', 'Bearer ' + Vue.$login.jwtNew)
199
195
  xhr.setRequestHeader('Token', Vue.$login.jwt)
200
196
  }
197
+ xhr.send(form)
201
198
  setTimeout(() => {
202
199
  this.load(this)
203
200
  }, 5000)
204
201
  },
205
- confirmIdCard (IdCardInfo){
206
- let param=IdCardInfo
207
- this.showhighmeter=false
208
- this.$dispatch('getidinfo',param)
202
+ confirmIdCard (IdCardInfo) {
203
+ let param = IdCardInfo
204
+ this.showhighmeter = false
205
+ this.$dispatch('getidinfo', param)
209
206
  }
210
207
  },
211
- ready() {
208
+ ready () {
212
209
  this.headers.blodid = this.blodid
213
210
  console.log('123222', this.blobid)
214
211
  if (this.blodid) {
@@ -216,29 +213,29 @@ export default {
216
213
  }
217
214
  },
218
215
  watch: {
219
- 'blodid'(val) {
216
+ 'blodid' (val) {
220
217
  if (val) {
221
218
  console.log('观察blodid', val)
222
219
  this.headers.blodid = this.blodid
223
220
  this.load(this)
224
221
  }
225
222
  },
226
- 'useType'() {
223
+ 'useType' () {
227
224
  this.headers.fusetype = this.useType[0] ? this.useType[0] : ''
228
225
  },
229
- 'defname'() {
230
- this.headers.defname=this.defname
226
+ 'defname' () {
227
+ this.headers.defname = this.defname
231
228
  }
232
229
  },
233
230
  computed: {
234
- foptions() {
231
+ foptions () {
235
232
  return this.$appdata.getParam('使用类型')
236
- },
233
+ }
237
234
  },
238
235
  events: {
239
236
  onFileUpload: function (file, res) {
240
- console.log("上传完毕")
241
- this.headers.fremarks=''
237
+ console.log('上传完毕')
238
+ this.headers.fremarks = ''
242
239
  this.close()
243
240
  }
244
241
  }
package/src/main.js CHANGED
@@ -2,7 +2,7 @@ import Vue from 'vue'
2
2
  import all from 'vue-client/src/all'
3
3
  import App from './App'
4
4
  import system from 'system-clients/src/system'
5
- import FilialeSale from './filiale/ronghao/sale'
5
+ import FilialeSale from './filiale/yuncheng/sale'
6
6
  import sale from './sale'
7
7
  import address from 'address-client/src/address'
8
8
  import ldap from 'ldap-clients/src/ldap'