sale-client 3.6.545 → 3.6.546

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": "sale-client",
3
- "version": "3.6.545",
3
+ "version": "3.6.546",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/Util.js CHANGED
@@ -21,19 +21,19 @@ export function getAttendanceState (item, timeToWork, timeToGo) {
21
21
  }
22
22
  }
23
23
 
24
- //获取随机uuid
25
- export function generateUUID() {
24
+ // 获取随机uuid
25
+ export function generateUUID () {
26
26
  // 'x' 代表数字与大小写字母中的任意一个
27
- const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
28
- let uuid = '';
27
+ const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
28
+ let uuid = ''
29
29
  // 第一个字符是 '0'-'7' 之间的随机数字,用于版本标识
30
- uuid += chars.charAt(Math.floor(Math.random() * 8) + Math.floor(Math.random() * 8) % 8);
30
+ uuid += chars.charAt(Math.floor(Math.random() * 8) + Math.floor(Math.random() * 8) % 8)
31
31
  for (let i = 0; i < 31; i++) {
32
32
  // 随机选择字符
33
- uuid += chars.charAt(Math.random() * chars.length | 0);
33
+ uuid += chars.charAt(Math.random() * chars.length | 0)
34
34
  }
35
35
  // 修正长度和格式,以确保它看起来像是一个标准的UUID
36
- return uuid.substr(0, 8) + uuid.substr(8, 4) + uuid.substr(12, 4) + uuid.substr(16, 4) + uuid.substr(20, 12);
36
+ return uuid.substr(0, 8) + uuid.substr(8, 4) + uuid.substr(12, 4) + uuid.substr(16, 4) + uuid.substr(20, 12)
37
37
  }
38
38
 
39
39
  export function toStandardYearMonth () {
@@ -53,29 +53,29 @@ export function toStandardDateString () {
53
53
  let date = dt.getDate()
54
54
  return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
55
55
  }
56
- export function getLastDayOfMonth(dateString) {
56
+ export function getLastDayOfMonth (dateString) {
57
57
  // 解析输入日期字符串
58
- var parts = dateString.split('-');
59
- var year = parseInt(parts[0], 10);
60
- var month = parseInt(parts[1], 10);
58
+ var parts = dateString.split('-')
59
+ var year = parseInt(parts[0], 10)
60
+ var month = parseInt(parts[1], 10)
61
61
 
62
62
  // 创建一个日期对象,表示下个月的第一天
63
- var nextMonthFirstDay = new Date(year, month, 1);
63
+ var nextMonthFirstDay = new Date(year, month, 1)
64
64
 
65
65
  // 减去一天,得到本月的最后一天
66
- nextMonthFirstDay.setDate(nextMonthFirstDay.getDate() - 1);
66
+ nextMonthFirstDay.setDate(nextMonthFirstDay.getDate() - 1)
67
67
 
68
68
  // 获取年、月、日
69
- var lastDay = nextMonthFirstDay.getDate();
70
- var lastMonth = nextMonthFirstDay.getMonth() + 1; // 月份从0开始,需要加1
71
- var lastYear = nextMonthFirstDay.getFullYear();
69
+ var lastDay = nextMonthFirstDay.getDate()
70
+ var lastMonth = nextMonthFirstDay.getMonth() + 1 // 月份从0开始,需要加1
71
+ var lastYear = nextMonthFirstDay.getFullYear()
72
72
 
73
73
  // 格式化日期为 YYYY-MM-DD
74
74
  var formattedDate = lastYear + '-' +
75
75
  (lastMonth < 10 ? '0' + lastMonth : lastMonth) + '-' +
76
- (lastDay < 10 ? '0' + lastDay : lastDay);
76
+ (lastDay < 10 ? '0' + lastDay : lastDay)
77
77
 
78
- return formattedDate;
78
+ return formattedDate
79
79
  }
80
80
 
81
81
  export function toStartAndEndDateString () {
@@ -80,7 +80,7 @@
80
80
 
81
81
  <script>
82
82
  import { PagedList } from 'vue-client'
83
- import * as Util from "../../../../../Util";
83
+ import * as Util from '../../../../../Util'
84
84
 
85
85
  export default {
86
86
  data () {
@@ -247,9 +247,9 @@
247
247
 
248
248
  // 输入金额,换算气量
249
249
  let preamountGen = async function (self) {
250
- let calFee = ((self.model.f_preamount - 0)).toFixed(self.row.f_fee_decimal || 4)
250
+ let calFee = ((self.model.f_preamount - 0)).toFixed(self.row.f_fee_decimal || 2)
251
251
  if (self.model.f_payment == '赠气') {
252
- calFee = (self.model.f_preamount - 0).toFixed(self.row.f_fee_decimal || 4)
252
+ calFee = (self.model.f_preamount - 0).toFixed(self.row.f_fee_decimal || 2)
253
253
  }
254
254
  // 通过金额进行划价
255
255
  let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
@@ -258,19 +258,19 @@
258
258
  if (self.row.f_alias === 'QiaoSong') {
259
259
  self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
260
260
  } else {
261
- self.model.f_pregas = (getGas.data.gas - 0).toFixed(self.row.f_gas_decimal || 4)
261
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(self.row.f_gas_decimal || 2)
262
262
  }
263
263
  if (self.row.f_collection_type === '按金额') {
264
264
  self.dymoney = 0
265
265
  } else {
266
- let dymoney2 = await self.$CommonService.gasCalculate(self.model, (getGas.data.gas - 0).toFixed(self.row.f_gas_decimal || 4))
267
- self.dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney2.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 4)
266
+ let dymoney2 = await self.$CommonService.gasCalculate(self.model, (getGas.data.gas - 0).toFixed(self.row.f_gas_decimal || 2))
267
+ self.dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney2.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 2)
268
268
  }
269
269
  } else {
270
270
  // 如果不支持小数,将划价出的多余非整数气量进行划价为金额
271
271
  let tempnum = Math.floor(getGas.data.gas - 0)
272
- let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(self.row.f_fee_decimal || 4))
273
- self.dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney1.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 4)
272
+ let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(self.row.f_fee_decimal || 2))
273
+ self.dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney1.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 2)
274
274
  self.model.f_pregas = Math.floor(getGas.data.gas - 0)
275
275
  }
276
276
  }
@@ -283,24 +283,24 @@
283
283
  self.model.f_collection = 0
284
284
  } else {
285
285
  self.model.f_collection = self.config.autoCollection ? self.model.f_totalcost : 0
286
- self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(self.row.f_fee_decimal || 4)
286
+ self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(self.row.f_fee_decimal || 2)
287
287
  }
288
- self.model.f_preamount = (calFee - (self.dymoney - 0)).toFixed(self.row.f_fee_decimal || 4)
288
+ self.model.f_preamount = (calFee - (self.dymoney - 0)).toFixed(self.row.f_fee_decimal || 2)
289
289
  self.calText(getGas.data.chargeprice)
290
290
  }
291
291
 
292
292
  // 输入气量,换算金额
293
293
  let pregasGen = async function (self) {
294
294
  if (self.row.f_isdecimal === '是') {
295
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(self.row.f_gas_decimal || 4)
295
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(self.row.f_gas_decimal || 2)
296
296
  } else {
297
297
  self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
298
298
  }
299
299
  if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
300
300
  self.model.f_meter_type = self.row.f_meter_type
301
301
  let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
302
- self.model.f_preamount = (getAmount.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 4)
303
- self.model.f_totalcost = ((self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(self.row.f_fee_decimal || 4))
302
+ self.model.f_preamount = (getAmount.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 2)
303
+ self.model.f_totalcost = ((self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(self.row.f_fee_decimal || 2))
304
304
  Object.assign(self.model, self.model, getAmount.data)
305
305
  self.model.chargeprice = getAmount.data.chargeprice
306
306
  if (self.model.f_payment == '赠气') {
@@ -301,6 +301,10 @@ export default {
301
301
  this.$refs.paged.$refs.cri.search()
302
302
  },
303
303
  async kp (row) {
304
+ console.log('>>> row --> ', row)
305
+ if (!!row.is_bill && row.is_bill === '是') {
306
+ return this.$showAlert('已结算的记录不能再次结算开票', 'warning', 3000)
307
+ }
304
308
  let HttpReset = new HttpResetClass()
305
309
  let _row = await HttpReset.load('POST', 'rs/sql/sale_getUser', {
306
310
  data: {
@@ -174,13 +174,13 @@ export default {
174
174
  for (let i = 0; i < this.devicesinfonew.length; i++) {
175
175
  if (this.devicesinfonew[i].f_devices_type == '报警器') {
176
176
  this.alarmExpireDate(i)
177
- } else if (this.devicesinfonew[i].f_devices_type == '切断阀') {
177
+ } else if (this.devicesinfonew[i].f_devices_type == '切断阀' || this.devicesinfonew[i].f_devices_type == '自闭阀') {
178
178
  this.expireDate(i)
179
179
  }
180
180
  }
181
181
  },
182
182
  expireDate (index) {
183
- if (this.devicesinfonew[index].f_devices_type == '切断阀') {
183
+ if (this.devicesinfonew[index].f_devices_type == '切断阀' || this.devicesinfonew[index].f_devices_type == '自闭阀') {
184
184
  if (this.devicesinfonew[index].f_input_date === '' || this.devicesinfonew[index].f_input_date === undefined) {
185
185
  } else {
186
186
  let b = new Date(this.devicesinfonew[index].f_input_date)
@@ -199,7 +199,7 @@ export default {
199
199
  if (this.devicesinfonew[index].f_firstcheck_date === '' || this.devicesinfonew[index].f_firstcheck_date === undefined || this.devicesinfonew[index].f_firstcheck_date === null) {
200
200
  } else {
201
201
  let b = new Date(this.devicesinfonew[index].f_firstcheck_date)
202
- let year = (b.getFullYear() - 0) + 3
202
+ let year = (b.getFullYear() - 0) + 5
203
203
  let year2 = (b.getFullYear() - 0) + 1
204
204
  let month = (b.getMonth() - 0) + 1
205
205
  var day = b.getDate()
@@ -235,7 +235,8 @@ export default {
235
235
  console.log('设备信息', this.devicesinfonew)
236
236
  this.devicesinfonew.push({
237
237
  f_devices_type: '调压器',
238
- f_input_date: this.$login.toStandardTimeString()
238
+ f_input_date: this.$login.toStandardTimeString(),
239
+ f_firstcheck_date: this.$login.toStandardTimeString()
239
240
  })
240
241
  }
241
242
  }
@@ -222,7 +222,7 @@
222
222
  }
223
223
  })
224
224
  this.$watch(() => device.f_devices_type, (newType) => {
225
- if (newType === '自闭阀' && device.f_input_date) {
225
+ if (device.f_input_date) {
226
226
  this.updateExpireDate(device)
227
227
  } else {
228
228
  device.f_expire_date = ''
@@ -68,7 +68,7 @@
68
68
  <script>
69
69
  import UserPaperInfoTest from './UserPaperInfoTest'
70
70
  import {HttpResetClass} from 'vue-client'
71
- import * as Util from '../../util'
71
+ import * as Util from '../../Util'
72
72
 
73
73
  let getFileGen = async function (self, data) {
74
74
  let http = new HttpResetClass()
@@ -0,0 +1,188 @@
1
+ <template>
2
+ <!--<div class="auto">-->
3
+ <validator name='v' @valid="onValid()" @invalid="onInvalid()">
4
+ <form novalidate class="form-horizontal">
5
+ <div class="row auto" >
6
+
7
+ <div class="col-sm-4 form-group" :class="[$v.metertype.required ? 'has-error' : '']">
8
+ <label for="f_meter_type" class="font_normal_body">新表类型</label>
9
+ <input type="text" class="input_search" style="width: 60%" v-show="false" v-model="$refs.metertype.selectedItems" v-validate:metertype='{required: true }'>
10
+ <v-select :value.sync="metermessage.f_meter_type"
11
+ v-model="metermessage.f_meter_type"
12
+ :options='meterType' placeholder='气表类型'
13
+ close-on-select v-ref:metertype style="width: 60%"></v-select>
14
+ </div>
15
+
16
+ <div class="col-sm-4 form-group" :class="[$v.brand.required ? 'has-error' : '']">
17
+ <label for="gasbrand" class="font_normal_body">新表品牌</label>
18
+ <input type="text" class="input_search" style="width:60%" v-show="false" v-model="$refs.brand.selectedItems" v-validate:brand='{required: true }'>
19
+ <v-select :value.sync="metermessage.gasbrand" :options='getMeterBrands(metermessage.f_meter_type)' @change='brandChange' placeholder='气表品牌' close-on-select
20
+ search v-model='metermessage.gasbrand' v-ref:brand></v-select>
21
+ </div>
22
+ <div class="col-sm-4 form-group" :class="[$v.model.required ? 'has-error' : '']">
23
+ <label for="gasmodel" class="font_normal_body">新表型号</label>
24
+ <input type="text" class="input_search" style="width:60%" v-show="false" v-model="$refs.model.selectedItems" v-validate:model='{required: true }'>
25
+ <v-select :value.sync="metermessage.gasmodel" :options='metermessage.gasbrand[0] ? metermessage.gasbrand[0].gasmodel : [] ' placeholder='气表型号' close-on-select
26
+ v-model='metermessage.gasmodel' :disabled= 'metermessage.gasbrand.length === 0 ' @change='modelChange' v-ref:model></v-select>
27
+ </div>
28
+
29
+ </div>
30
+ <div class="row auto" >
31
+ <div class="col-sm-4 form-group" :class="[$v.meternumber.required ? 'has-error' : '']">
32
+ <label for="f_meternumber" class="font_normal_body">新&ensp;表&ensp;号</label>
33
+ <input type="text" class="input_search" style="width:60%" class="input_search"
34
+ @blur="meternumberValidate()" v-model="metermessage.f_meternumber" v-validate:meternumber='{required: true }' placeholder='表号' >
35
+ </div>
36
+ <div class="col-sm-4 form-group" :class="[$v.f_metertitles.required ? 'has-error' : '']">
37
+ <label for="f_metertitles" class="font_normal_body">新表封号</label>
38
+ <input type="text" class="input_search" style="width:60%" class="input_search" v-model="metermessage.f_metertitles" placeholder='表封号'>
39
+ </div>
40
+ <div class="col-sm-4 form-group" :class="[$v.f_meter_base.required ? 'has-error' : '']" title="参数名称:【初始表底数最大值】">
41
+ <label for="f_meter_base" class="font_normal_body">新表底数</label>
42
+ <input type="text" class="input_search" style="width:60%" class="input_search" v-validate:f_meter_base='{required: true }' @blur='meterbase()' v-model="metermessage.f_meter_base" placeholder='表底数' >
43
+ </div>
44
+ </div>
45
+
46
+ </form>
47
+ </validator>
48
+ <!--</div>-->
49
+ </template>
50
+
51
+ <script>
52
+ import {HttpResetClass} from "vue-client";
53
+
54
+ /**
55
+ *公共组件
56
+ *获取气表信息
57
+ */
58
+ export default {
59
+ data () {
60
+ return {
61
+ isdecimal: '否',
62
+ imgsrc: '/images/mainicon/biaopan.png',
63
+ imgmeter: '/images/mainicon/addmeter.png',
64
+ f_meter_base_max: this.$appdata.getSingleValue('初始表底数最大值') ? this.$appdata.getSingleValue('初始表底数最大值') : 10000,
65
+ meterType: this.$appdata.getParam('气表类型')
66
+ }
67
+ },
68
+ props: ['f_userfiles_id', 'metermessage'],
69
+ methods: {
70
+ onValid () {
71
+ this.$dispatch('valid')
72
+ },
73
+ onInvalid () {
74
+ this.$dispatch('invalid')
75
+ },
76
+ brandChange (val) {
77
+ this.isdecimal = val.length > 0 ? val[0].f_isdecimal : '否'
78
+ this.meternumberValidate()
79
+ },
80
+ modelChange (val) {
81
+ this.$dispatch('gasmodel', this.metermessage.gasbrand)
82
+ },
83
+ resetValidate () {
84
+ this.$resetValidation()
85
+ },
86
+ meterbase () {
87
+ if (this.isdecimal === '是') {
88
+ this.metermessage.f_meter_base = (this.metermessage.f_meter_base - 0).toFixed(2)
89
+ } else {
90
+ this.metermessage.f_meter_base = (this.metermessage.f_meter_base - 0).toFixed(0)
91
+ }
92
+ if (this.metermessage.f_meter_base > this.f_meter_base_max) {
93
+ this.$showAlert(`新表底数可录入的最大值为: ${this.f_meter_base_max}, 请核实后重新录入!!!`, 'warning', 3000)
94
+ this.metermessage.f_meter_base = ''
95
+ }
96
+ },
97
+ getMeterBrands (meterType) {
98
+ let res = []
99
+ if (meterType.length > 0) {
100
+ this.meterbrands.forEach((item) => {
101
+ if (item.value.f_meter_type === meterType[0]) {
102
+ res.push(item)
103
+ }
104
+ })
105
+ }
106
+ return res
107
+ },
108
+ async meternumberValidate () {
109
+ let http1 = new HttpResetClass()
110
+ let res1 = await http1.load('POST', '/rs/sql/getBrandAndType', {data: {condition: ` mi.f_meternumber = '${this.metermessage.f_meternumber}'`}}, {resolveMsg: null, rejectMsg: '获取默认气表品牌型号失败!!'})
111
+ if (res1.data.length > 0) {
112
+
113
+
114
+ // 已经选择了气表 则不再替换
115
+ if (this.metermessage.f_meter_type <= 0 ){
116
+ this.metermessage.f_meter_type = [res1.data[0].f_meter_classify]
117
+ }
118
+ // 替换表号自带的气表品牌和型号
119
+ let meterbrands = this.meterbrands
120
+ for (let row of meterbrands) {
121
+ if (row.label == res1.data[0].f_meter_brand) {
122
+ // 已经选择了气表品牌则不再替换
123
+ if (this.metermessage.gasbrand.length <= 0) this.metermessage.gasbrand = [row.value]
124
+ // 替换气表型号
125
+ if (res1.data[0].f_meter_style) {
126
+ for (let model of row.value.gasmodel) {
127
+ if (model.label == res1.data[0].f_meter_style) {
128
+ // 已经选择了气表型号则不再替换
129
+ if (this.metermessage.gasmodel.length <= 0) this.metermessage.gasmodel = [model.value]
130
+ continue
131
+ }
132
+ }
133
+ }
134
+ continue
135
+ }
136
+ }
137
+ }
138
+ if (this.metermessage.f_meternumber && this.metermessage.gasbrand.length > 0) {
139
+ // 表号位数验证
140
+ let meternumberLen = this.metermessage.gasbrand[0].f_meternumber_len
141
+ if (meternumberLen) {
142
+ if (this.metermessage.f_meternumber.length != meternumberLen) {
143
+ this.metermessage.f_meternumber = ''
144
+ this.$showAlert(`表号位数不正确, 当前气表品牌表号位数是: ${meternumberLen}`, 'warning', 3000)
145
+ return
146
+ }
147
+ }
148
+ // 表计信息验证
149
+ if (this.metermessage.gasbrand[0].f_meterverification == '是') {
150
+ if (res1.data.length <= 0) {
151
+ this.$showAlert(`当前表号: ${this.metermessage.f_meternumber}在表计信息中无记录, 请核实!!!`, 'warning', 3000)
152
+ this.metermessage.f_meternumber = ''
153
+ return
154
+ }
155
+ }
156
+ if (this.metermessage.gasbrand[0].f_meter_type === '物联网表') {
157
+ let param = {
158
+ f_userfiles_id: this.f_userfiles_id,
159
+ f_meternumber: this.metermessage.f_meternumber,
160
+ f_gasbrand_id: this.metermessage.gasbrand[0].id
161
+ }
162
+
163
+ let res = await this.$resetpost('rs/logic/meternumberValidate', param, {
164
+ resolveMsg: null,
165
+ rejectMsg: '表号验证失败!!'
166
+ })
167
+ console.log('标号验证返回:', res)
168
+ if (res.data) {
169
+ this.metermessage.f_meternumber = ''
170
+ this.$showAlert('表号已存在!!', 'warning', 3000)
171
+ }
172
+ }
173
+ }
174
+ }
175
+ },
176
+ computed: {
177
+ usertypes () {
178
+ return this.$appdata.getParam('用户类型')
179
+ },
180
+ positions () {
181
+ return this.$appdata.getParam('安装位置')
182
+ },
183
+ meterbrands () {
184
+ return this.$GetSaleParam.getGasbrand()
185
+ }
186
+ }
187
+ }
188
+ </script>