vue2-client 1.14.6 → 1.14.7

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": "vue2-client",
3
- "version": "1.14.6",
3
+ "version": "1.14.7",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,36 +1,107 @@
1
1
  <template>
2
- <a-drawer
3
- id="agencyManageDetail"
4
- title="用户详情信息"
5
- placement="right"
6
- :body-style="{padding:0}"
7
- :destroy-on-close="true"
8
- :z-index="200"
9
- width="85vw"
10
- :closable="false"
11
- :visible="userInfoDetailVisible"
12
- @close="onClose">
13
- <a-page-header v-if="userInfoDetailVisible && userInfo" :title="`用户编号:${ userInfo ? userInfo.f_userinfo_code : '' }`">
14
- <x-descriptions
15
- :title="null"
16
- :content="userInfo"
17
- serviceName="af-revenue"
18
- :getRealData="true"
19
- :column="4"
20
- config-name="User_Info_Desc_Config">
21
- <template #addonAfter>
22
- <div style="text-align: right">
23
- <a-statistic title="用户状态" :value="userInfo.f_user_state || 0"/>
24
- <a-statistic title="表具状态" :precision="0" :value="userInfo.f_table_state || 0"/>
25
- </div>
2
+ <div>
3
+ <a-drawer
4
+ id="agencyManageDetail"
5
+ title="用户详情信息"
6
+ placement="right"
7
+ :body-style="{padding:0}"
8
+ :destroy-on-close="true"
9
+ :z-index="200"
10
+ width="85vw"
11
+ :closable="false"
12
+ :visible="userInfoDetailVisible"
13
+ @close="onClose">
14
+ <a-page-header v-if="userInfoDetailVisible && userInfo" :title="`用户编号:${ userInfo ? userInfo.f_userinfo_code : '' }`">
15
+ <x-descriptions
16
+ :title="null"
17
+ :content="userInfo"
18
+ serviceName="af-revenue"
19
+ :getRealData="true"
20
+ :column="4"
21
+ config-name="User_Info_Desc_Config">
22
+ <template #addonAfter>
23
+ <div style="text-align: right">
24
+ <a-statistic title="用户状态" :value="userInfo.f_user_state || 0"/>
25
+ <a-statistic title="表具状态" :precision="0" :value="userInfo.f_table_state || 0"/>
26
+ </div>
27
+ </template>
28
+ </x-descriptions>
29
+ <user-info-detail-query-tabs :userInfo="userInfo"/>
30
+ <template #extra>
31
+ <a-button type="primary" v-if="userInfo.gb_f_meter_type.includes('物联网表')" @click="openUser">开户</a-button>
32
+ <a-button type="primary" v-if="userInfo.gb_f_meter_type.includes('物联网表')&&!(userInfo.u_f_user_state === '停用')" @click="valvecontrol">开关阀</a-button>
33
+ <a-button type="dashed" @click="refresh">刷新</a-button>
26
34
  </template>
27
- </x-descriptions>
28
- <user-info-detail-query-tabs :userInfo="userInfo"/>
29
- <template #extra>
30
- <a-button type="dashed" @click="refresh">刷新</a-button>
35
+ </a-page-header>
36
+ </a-drawer>
37
+ <!-- 阀控管理弹框 -->
38
+ <a-modal
39
+ title="阀控管理"
40
+ :visible="valve"
41
+ :closable="false"
42
+ :width="600"
43
+ :body-style="{ padding: '24px' }"
44
+ >
45
+ <!-- 阀控状态选择 -->
46
+ <div style="margin-bottom: 16px;">
47
+ <label style="display: block; font-size: 14px; color: #555; margin-bottom: 8px;">阀控状态</label>
48
+ <a-select
49
+ v-model="selectedOption"
50
+ style="width: 100%;"
51
+ placeholder="请选择"
52
+ >
53
+ <a-select-option v-for="item in networkValveOptions" :value="item" :key="item">
54
+ {{ item }}
55
+ </a-select-option>
56
+ </a-select>
57
+ </div>
58
+
59
+ <!-- 操作原因输入框 -->
60
+ <div style="margin-bottom: 16px;">
61
+ <label
62
+ style="display: block; font-size: 14px; color: #555; margin-bottom: 8px;"
63
+ :style="operateReason ? '' : 'color: #ff4d4f;'"
64
+ >
65
+ 操作原因
66
+ </label>
67
+ <a-textarea
68
+ v-model="operateReason"
69
+ placeholder="请填写操作原因"
70
+ :rows="2"
71
+ style="width: 100%;"
72
+ />
73
+ </div>
74
+
75
+ <!-- 底部按钮 -->
76
+ <template #footer>
77
+ <div style="display: flex; justify-content: space-between; align-items: center;">
78
+ <!-- 左侧关闭按钮 -->
79
+ <a-button type="danger" @click="closeValveModal" style="border-radius: 4px;">
80
+ 关闭
81
+ </a-button>
82
+ <!-- 右侧开阀和关阀按钮 -->
83
+ <div>
84
+ <a-button
85
+ type="primary"
86
+ :disabled="!operateReason"
87
+ @click="valveoperate(true, 1)"
88
+ style="border-radius: 4px; margin-right: 8px;"
89
+ >
90
+ 开阀
91
+ </a-button>
92
+ <a-button
93
+ type="primary"
94
+ :disabled="!operateReason"
95
+ @click="valveoperate(false, 1)"
96
+ style="border-radius: 4px;"
97
+ >
98
+ 关阀
99
+ </a-button>
100
+ </div>
101
+ </div>
31
102
  </template>
32
- </a-page-header>
33
- </a-drawer>
103
+ </a-modal>
104
+ </div>
34
105
  </template>
35
106
 
36
107
  <script>
@@ -38,6 +109,7 @@ import XDescriptions from '@vue2-client/base-client/components/common/XDescripti
38
109
  import { mapState } from 'vuex'
39
110
  import { runLogic } from '@vue2-client/services/api/common'
40
111
  import userInfoDetailQueryTabs from '@vue2-client/pages/userInfoDetailManage/userInfoDetailQueryTabs'
112
+ import Vue from 'vue'
41
113
 
42
114
  export default {
43
115
  name: 'UserInfoDetailManage',
@@ -48,7 +120,18 @@ export default {
48
120
  data () {
49
121
  return {
50
122
  userInfo: undefined,
51
- userInfoDetailVisible: false
123
+ userInfoDetailVisible: false,
124
+ valve: false,
125
+ networkValveOptions: [
126
+ '手动',
127
+ '自动',
128
+ '1小时后自动',
129
+ '3小时后自动',
130
+ '6小时后自动',
131
+ '12小时后自动'
132
+ ],
133
+ selectedOption: '',
134
+ operateReason: '',
52
135
  }
53
136
  },
54
137
  methods: {
@@ -57,6 +140,33 @@ export default {
57
140
  this.userInfo = res
58
141
  })
59
142
  },
143
+ openUser () {
144
+ this.$confirm({
145
+ title: '开户确认',
146
+ content: '是否需要给用户进行开户?',
147
+ onOk: ()=> {
148
+ const data = {
149
+ f_userfiles_id: this.userInfo.f_userfiles_id
150
+ }
151
+ runLogic('StartUp', data, 'af-revenue').then(res => {
152
+ this.$message.success('开户成功')
153
+ })
154
+ }
155
+ })
156
+ },
157
+ // 阀控管理
158
+ valvecontrol () {
159
+ if (this.$login.r.includes('开关阀权限')) {
160
+ this.valve = true
161
+ } else {
162
+ this.$message.error('您没有【开关阀权限】,请联系管理员!!')
163
+ }
164
+ },
165
+ closeValveModal () {
166
+ this.valve = false
167
+ this.selectedOption = ''
168
+ this.operateReason = ''
169
+ },
60
170
  async init (user) {
61
171
  this.userInfo = user
62
172
  await this.refresh()
@@ -65,6 +175,77 @@ export default {
65
175
  onClose () {
66
176
  this.userInfoDetailVisible = false
67
177
  this.$emit('close')
178
+ },
179
+ // 开关阀操作
180
+ async valveoperate (oper, value) {
181
+ const msg = oper ? '开阀' : '关阀'
182
+ let delaySeconds = 0 // 初始化 delaySeconds 变量
183
+ const currentTime = new Date() // 获取当前时间
184
+ const adjustedTime = new Date(currentTime) // 创建一个新的 Date 对象用于计算延迟后的时间
185
+
186
+ const beijingTime = new Date(currentTime.getTime() + 8 * 60 * 60 * 1000)
187
+ const formattedBeijingTime = beijingTime.toISOString().slice(0, 19).replace('T', ' ')
188
+
189
+ const datas = {
190
+ instructType: '阀门控制',
191
+ instructTitle: `手动${msg}`,
192
+ condition: `t_userfiles.f_userfiles_id='${this.userInfo.f_userfiles_id}'`,
193
+ meterBrandName: this.userInfo.f_alias,
194
+ f_instruct_state: '待发送',
195
+ inputtor: Vue.$login.f.name,
196
+ inputtorid: Vue.$login.f.id,
197
+ reasonInfo: this.operateReason,
198
+ meternumberf: this.userInfo.f_meternumber,
199
+ contentData: { isOpen: oper ? 1 : 0 },
200
+ auto_adjust_option: this.selectedOption,
201
+ delaySeconds: delaySeconds,
202
+ executeDelayedOperation: true,
203
+ f_timestamp: formattedBeijingTime, // 使用北京时间
204
+ f_userfiles_id: this.userInfo.f_userfiles_id,
205
+ f_userinfo_id: this.userInfo.f_userinfo_id
206
+ }
207
+ console.log('看看datas', datas)
208
+ const _this = this
209
+ // 计算延迟时间
210
+ switch (_this.selectedOption) {
211
+ case '1小时后自动':
212
+ delaySeconds = 3600 // 1小时 = 3600秒
213
+ break
214
+ case '3小时后自动':
215
+ delaySeconds = 10800 // 3小时 = 10800秒
216
+ break
217
+ case '6小时后自动':
218
+ delaySeconds = 21600 // 6小时 = 21600秒
219
+ break
220
+ case '12小时后自动':
221
+ delaySeconds = 43200 // 12小时 = 43200秒
222
+ break
223
+ default:
224
+ delaySeconds = 0
225
+ }
226
+
227
+ adjustedTime.setSeconds(adjustedTime.getSeconds() + delaySeconds)
228
+ const adjustedBeijingTime = new Date(adjustedTime.getTime() + 8 * 60 * 60 * 1000)
229
+ const formattedAdjustedBeijingTime = adjustedBeijingTime.toISOString().slice(0, 19).replace('T', ' ')
230
+
231
+ // 更新 datas 对象
232
+ datas.delaySeconds = delaySeconds
233
+ datas.f_current_timestamp = formattedAdjustedBeijingTime // 使用延迟后的北京时间
234
+ runLogic('iot_saveInstruct', datas, 'af-revenue').then(res => {
235
+ _this.valve = false
236
+ _this.operateReason = ''
237
+ if (_this.selectedOption !== '手动') {
238
+ const msg = _this.selectedOption !== '自动' ? `阀控状态将在${_this.selectedOption}后自动调整为【自动】` : `阀控状态自动调整为 【自动】`
239
+ this.$message.success(msg)
240
+ runLogic('iot_processDelayedOperations',datas,'af-revenue').then(res => {
241
+ this.$emit('refresh')
242
+ console.log('延时操作逻辑已执行')
243
+ })
244
+ } else {
245
+ this.$emit('refresh')
246
+ }
247
+ this.$message.success('操作成功')
248
+ })
68
249
  }
69
250
  },
70
251
  created () {
@@ -1,81 +0,0 @@
1
- <template>
2
- <a-form :model="invoiceData" ref="invoiceForm" label-col="{ span: 4 }" wrapper-col="{ span: 14 }">
3
- <!-- 卖方信息 -->
4
- <a-form-item label="卖方信息">
5
- <a-input v-model="invoiceData.seller" placeholder="请输入卖方信息"></a-input>
6
- </a-form-item>
7
-
8
- <!-- 买方信息 -->
9
- <a-form-item label="买方信息">
10
- <a-input v-model="invoiceData.buyer" placeholder="请输入买方信息"></a-input>
11
- </a-form-item>
12
-
13
- <!-- 项目明细 -->
14
- <a-form-item label="项目明细">
15
- <div v-for="(item, index) in invoiceData.items" :key="index" class="item-row">
16
- <a-input v-model="item.name" placeholder="项目名称" style="width: 20%; margin-right: 10px;"></a-input>
17
- <a-input v-model="item.quantity" placeholder="数量" style="width: 15%; margin-right: 10px;"></a-input>
18
- <a-input v-model="item.price" placeholder="单价" style="width: 20%; margin-right: 10px;"></a-input>
19
- <a-input v-model="item.tax" placeholder="税额" style="width: 20%;"></a-input>
20
- </div>
21
- <a-button type="dashed" @click="addItem" style="margin-top: 10px;">添加项目</a-button>
22
- </a-form-item>
23
-
24
- <!-- 合计金额 -->
25
- <a-form-item label="合计金额">
26
- <a-input v-model="invoiceData.total" placeholder="合计金额"></a-input>
27
- </a-form-item>
28
-
29
- <!-- 备注 -->
30
- <a-form-item label="备注">
31
- <a-input v-model="invoiceData.remarks" placeholder="请输入备注"></a-input>
32
- </a-form-item>
33
- <!-- 操作按钮 -->
34
- <a-form-item wrapper-col="{ span: 14, offset: 4 }">
35
- <a-button type="primary" @click="submitInvoice">开票</a-button>
36
- <a-button style="margin-left: 8px;" @click="saveDraft">保存草稿</a-button>
37
- </a-form-item>
38
- </a-form>
39
- </template>
40
-
41
- <script>
42
- export default {
43
- name: 'InvoiceComponent',
44
- data () {
45
- return {
46
- // 发票数据模型
47
- invoiceData: {
48
- seller: '', // 卖方信息
49
- buyer: '', // 买方信息
50
- items: [ // 项目明细
51
- { name: '', quantity: '', price: '', tax: '' }
52
- ],
53
- total: '', // 合计金额
54
- remarks: '' // 备注
55
- }
56
- }
57
- },
58
- methods: {
59
- // 添加项目明细
60
- addItem () {
61
- this.invoiceData.items.push({ name: '', quantity: '', price: '', tax: '' })
62
- },
63
- // 提交发票
64
- submitInvoice () {
65
- console.log('开票数据: ', this.invoiceData)
66
- // 在此处执行发票提交的逻辑
67
- },
68
- // 保存草稿
69
- saveDraft () {
70
- console.log('保存草稿: ', this.invoiceData)
71
- // 在此处执行保存草稿的逻辑
72
- }
73
- }
74
- }
75
- </script>
76
-
77
- <style scoped>
78
- .item-row {
79
- margin-bottom: 10px;
80
- }
81
- </style>