vue2-client 1.15.27 → 1.15.28

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,47 +1,211 @@
1
+ <template>
2
+ <a-card :bordered="false">
3
+ <x-form-table
4
+ title="我的工单"
5
+ ref="xFormTable"
6
+ :queryParamsName="queryParamsName"
7
+ :fixed-query-form="{
8
+ users_f_handler_id: currUser.id,
9
+ }"
10
+ @action="toDetail">
11
+ <template slot="button">
12
+ <a-button @click="addApply">
13
+ <a-icon type="plus"/>
14
+ 发起报建
15
+ </a-button>
16
+ </template>
17
+ </x-form-table>
18
+ <a-modal
19
+ v-model="applyAddFlag"
20
+ :footer="null"
21
+ :dialog-style="{ top: '5rem' }"
22
+ :z-index="1001"
23
+ title="发起报建"
24
+ :destroyOnClose="true">
25
+ <x-add-native-form ref="xForm" @onSubmit="applySubmit"/>
26
+ </a-modal>
27
+ <WorkflowDetail
28
+ ref="workFlow"
29
+ @success="success"
30
+ @nextClick="nextClick"
31
+ @x-form-item-emit-func="handleFormItemEvent"
32
+ >
33
+ </WorkflowDetail>
34
+ <address-select ref="addressSelect" @setAddress="setForm"></address-select>
35
+ <!-- 协议作废功能 -->
36
+ <a-modal
37
+ v-model="formState"
38
+ :dialog-style="{ top: '5rem' }"
39
+ :z-index="1001"
40
+ title="作废"
41
+ :destroyOnClose="true"
42
+ width="55vw">
43
+ <x-add-native-form
44
+ ref="xCancelForm"
45
+ @onSubmit="submit"
46
+ />
47
+ <template #footer>
48
+ <a-button key="back" @click="formState = false">取消</a-button>
49
+ <a-button key="submit" type="primary" :loading="submitLoading" @click="formSubmit">确认</a-button>
50
+ </template>
51
+ </a-modal>
52
+ </a-card>
53
+ </template>
54
+
1
55
  <script>
2
56
  import WorkflowDetail from '@vue2-client/pages/WorkflowDetail/WorkflowDetail.vue'
57
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
58
+ import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
59
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
60
+ import { mapState } from 'vuex'
61
+ import AddressSelect from '@vue2-client/pages/addressSelect/index.vue'
3
62
 
4
63
  export default {
5
- name: 'WorkFlowDemo',
6
- components: { WorkflowDetail },
7
- mounted () {
8
- this.$refs.workFlow.init({
9
- workflowId: '376'
10
- })
64
+ name: 'Apply',
65
+ components: {
66
+ XFormTable,
67
+ XAddNativeForm,
68
+ WorkflowDetail,
69
+ AddressSelect
70
+ },
71
+ provide () {
72
+ return {
73
+ generalFunction: {
74
+ setCancel: this.setCancel,
75
+ updateFormData: this.updateFormData,
76
+ }
77
+ }
78
+ },
79
+ data () {
80
+ return {
81
+ // 查询配置文件名
82
+ queryParamsName: 'ApplyProcessCRUD',
83
+ // 发起报建弹框控制
84
+ applyAddFlag: false,
85
+ formState: false,
86
+ submitLoading: false,
87
+ cancelRecord: {}
88
+ }
89
+ },
90
+ computed: {
91
+ ...mapState('account', { currUser: 'user' }),
11
92
  },
12
93
  methods: {
13
- /**
14
- * 流程详情页成功
15
- * @param note 备注信息
16
- * @param form 表单信息
17
- * @param workflowId
18
- */
19
- success ({ note, form, workflowId }) {
20
- console.log('success', note, form, workflowId)
21
- },
22
- /**
23
- * 流程详情页成功
24
- * @param note 备注信息
25
- * @param form 表单信息
26
- * @param workflowId 工作流id
27
- * @param fromStepId 起ID
28
- * @param toStepId 往ID
29
- * @param successStepId 完成步骤id
30
- * @param successStep 完成步骤名称
31
- * @param fromStep 起步骤名称
32
- * @param toStep 往步骤名称
33
- */
34
- nextClick ({ note, form, workflowId, fromStepId, toStepId, fromStep, toStep, successStepId, successStep }) {
35
- console.log('success', note, form, workflowId, fromStepId, toStepId, fromStep, toStep, successStepId, successStep)
94
+ addApply () {
95
+ console.log('打开了吗')
96
+ this.applyAddFlag = true
97
+ this.$nextTick(
98
+ () => {
99
+ getConfigByName('addApplyForm', 'af-apply', (res) => {
100
+ this.$refs.xForm.init({
101
+ businessType: '新增',
102
+ title: '发起报建',
103
+ ...res
104
+ })
105
+ })
106
+ }
107
+ )
108
+ },
109
+ applySubmit (formData) {
110
+ runLogic('addApply', formData).then(
111
+ res => {
112
+ this.$message.success('发起报建成功')
113
+ this.$refs.xFormTable.refreshTable(true)
114
+ this.applyAddFlag = false
115
+ }
116
+ ).catch(() => {
117
+ this.applyAddFlag = false
118
+ })
119
+ },
120
+ success () {
121
+ console.log('完工')
122
+ },
123
+ toDetail (record, id) {
124
+ this.$refs.workFlow.init({
125
+ workflowId: record.ab_f_workflow_id,
126
+ })
127
+ },
128
+ handleFormItemEvent (func, data, value) {
129
+ console.log('打印一下:', func, data, value)
130
+ if (func === 'selectAddress') {
131
+ this.$refs.addressSelect.setFormShow()
132
+ }
133
+ },
134
+ setForm (record) {
135
+ this.$refs.workFlow.setFormValue({ address: record.f_address, address_id: record.f_address_id })
136
+ },
137
+ nextClick ({ form, formStep, workflowId }) {
138
+ console.log('success', form, formStep, workflowId)
139
+ const data = {
140
+ workflowId,
141
+ form,
142
+ formStep
143
+ }
144
+ runLogic('applySubmitAfter', data, 'af-apply').then(
145
+ res => {
146
+ if (res) {
147
+ // this.$message.success('提交成功!')
148
+ this.$refs.xFormTable.refreshTable(true)
149
+ }
150
+ }
151
+ )
152
+ },
153
+ // 协议作废
154
+ setCancel (record) {
155
+ this.cancelRecord = record
156
+ this.formState = true
157
+ this.$nextTick(() => {
158
+ getConfigByName('setCancelForm', 'af-apply', (config) => {
159
+ if (this.$refs.xCancelForm) {
160
+ this.$refs.xCancelForm.init({
161
+ formItems: config.formJson,
162
+ title: '补充协议作废',
163
+ businessType: '修改',
164
+ showSubmitBtn: false,
165
+ ...config
166
+ })
167
+ if (this.$refs.xCancelForm) {
168
+ console.log(record)
169
+ // this.$refs.xCancelForm.setForm(recordData)
170
+ }
171
+ } else {
172
+ console.error('xCancelForm组件未加载完成')
173
+ // 延迟重试
174
+ setTimeout(() => {
175
+ this.setCancel(record)
176
+ }, 100)
177
+ }
178
+ })
179
+ })
180
+ },
181
+ async formSubmit () {
182
+ this.submitLoading = true
183
+ const formData = await this.$refs.xCancelForm.asyncSubmit()
184
+ try {
185
+ await this.submit(formData)
186
+ } catch (error) {
187
+ this.$message.error('表单验证失败,请检查填写内容')
188
+ } finally {
189
+ this.submitLoading = false
190
+ }
191
+ },
192
+ async submit (formData) {
193
+ const data = {
194
+ ...formData,
195
+ }
196
+ console.log('==formData', data)
197
+ await runLogic('暂时没有实现的logic', data, 'af-apply').then(() => {
198
+ this.$message.success('操作成功')
199
+ this.formState = false
200
+ })
201
+ },
202
+ updateFormData (workflowId) {
203
+ runLogic('queryAgreementAmount', { workflowId: workflowId }, 'af-apply').then((res) => {
204
+ console.log('>>>> res==', res)
205
+ this.$refs.workFlow.$refs.workflowHandle.$refs.xAddForm.setForm({ add_amount: 1200 })
206
+ })
207
+ console.log()
36
208
  }
37
209
  }
38
210
  }
39
211
  </script>
40
-
41
- <template>
42
- <WorkflowDetail ref="workFlow" @success="success" @nextClick="nextClick"></WorkflowDetail>
43
- </template>
44
-
45
- <style scoped lang="less">
46
-
47
- </style>
@@ -1,204 +1,132 @@
1
1
  <template>
2
2
  <a-card :bordered="false">
3
- <x-form-table
4
- title="我的工单"
5
- ref="xFormTable"
6
- :queryParamsName="queryParamsName"
7
- :fixed-query-form="{
8
- users_f_handler_id: currUser.id,
9
- }"
10
- @action="toDetail">
11
- <template slot="button">
12
- <a-button @click="addApply">
13
- <a-icon type="plus"/>
14
- 发起报建
15
- </a-button>
16
- </template>
17
- </x-form-table>
18
- <a-modal
19
- v-model="applyAddFlag"
20
- :footer="null"
21
- :dialog-style="{ top: '5rem' }"
22
- :z-index="1001"
23
- title="发起报建"
24
- :destroyOnClose="true">
25
- <x-add-native-form ref="xForm" @onSubmit="applySubmit"/>
26
- </a-modal>
27
- <WorkflowDetail
28
- ref="workFlow"
29
- @success="success"
30
- @nextClick="nextClick"
31
- @x-form-item-emit-func="handleFormItemEvent"
32
- >
33
- </WorkflowDetail>
34
- <address-select ref="addressSelect" @setAddress="setForm"></address-select>
35
- <!-- 协议作废功能 -->
36
- <a-modal
37
- v-model="formState"
38
- :dialog-style="{ top: '5rem' }"
39
- :z-index="1001"
40
- title="作废"
41
- :destroyOnClose="true"
42
- width="55vw">
43
- <x-add-native-form
44
- ref="xCancelForm"
45
- @onSubmit="submit"
46
- />
47
- <template #footer>
48
- <a-button key="back" @click="formState = false">取消</a-button>
49
- <a-button key="submit" type="primary" :loading="submitLoading" @click="formSubmit">确认</a-button>
50
- </template>
51
- </a-modal>
3
+ <a-tabs default-active-key="1">
4
+ <!-- 业务审核 Tab -->
5
+ <a-tab-pane key="1" tab="业务审核">
6
+ <x-form-table
7
+ title="业务审核"
8
+ :queryParamsName="queryParamsName"
9
+ :fixedAddForm="fixedAddForm"
10
+ :fixedQueryForm="fixedQueryForm"
11
+ @audit="audit"
12
+ serviceName="af-revenue"
13
+ ref="xFormTable">
14
+ </x-form-table>
15
+ <WorkflowDetail ref="workFlow" @success="confirmAudit" @nextClick="nextClick"></WorkflowDetail>
16
+ </a-tab-pane>
17
+
18
+ <!-- 我负责的 Tab -->
19
+ <a-tab-pane key="2" tab="我参与的">
20
+ <x-form-table
21
+ title="我参与的业务"
22
+ :queryParamsName="queryParamsName2"
23
+ :fixedQueryForm="fixedQueryForm2"
24
+ @check="check"
25
+ serviceName="af-revenue"
26
+ ref="xFormTable">
27
+ </x-form-table>
28
+ </a-tab-pane>
29
+ </a-tabs>
52
30
  </a-card>
53
31
  </template>
54
32
 
55
33
  <script>
34
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
56
35
  import WorkflowDetail from '@vue2-client/pages/WorkflowDetail/WorkflowDetail.vue'
57
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
58
36
  import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
59
- import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
37
+ import XDescriptions from '@vue2-client/base-client/components/common/XDescriptions/XDescriptions.vue'
60
38
  import { mapState } from 'vuex'
61
- import AddressSelect from '@vue2-client/pages/addressSelect/index.vue'
39
+ import { runLogic } from '@vue2-client/services/api/common'
62
40
 
63
41
  export default {
64
- name: 'Apply',
42
+ name: 'UnitManage',
65
43
  components: {
66
- XFormTable,
67
- XAddNativeForm,
68
- WorkflowDetail,
69
- AddressSelect
70
- },
71
- provide () {
72
- return {
73
- generalFunction: {
74
- setCancel: this.setCancel,
75
- }
76
- }
44
+ XFormTable, XDescriptions, XAddNativeForm, WorkflowDetail
77
45
  },
78
46
  data () {
79
47
  return {
80
- // 查询配置文件名
81
- queryParamsName: 'ApplyProcessCRUD',
82
- // 发起报建弹框控制
83
- applyAddFlag: false,
84
- formState: false,
85
- submitLoading: false,
86
- cancelRecord: {}
48
+ // 查询配置名称
49
+ queryParamsName: 'businessAuditCRUD',
50
+ queryParamsName2: 'participatedCRUD',
51
+ // 新增表单固定值
52
+ fixedAddForm: {},
53
+ fixedQueryForm: {},
54
+ fixedQueryForm2: {},
55
+ // 页面宽度
56
+ screenWidth: document.documentElement.clientWidth,
57
+ // 是否显示详情抽屉
58
+ detailVisible: false
87
59
  }
88
60
  },
89
- computed: {
90
- ...mapState('account', { currUser: 'user' }),
61
+ created () {
62
+ },
63
+ mounted () {
64
+ this.fixedQueryForm = {
65
+ ws_f_handler: this.currUser.name
66
+ }
67
+ this.fixedQueryForm2 = {
68
+ a_f_handler: this.currUser.name
69
+ }
91
70
  },
92
71
  methods: {
93
- addApply () {
94
- console.log('打开了吗')
95
- this.applyAddFlag = true
96
- this.$nextTick(
97
- () => {
98
- getConfigByName('addApplyForm', 'af-apply', (res) => {
99
- this.$refs.xForm.init({
100
- businessType: '新增',
101
- title: '发起报建',
102
- ...res
103
- })
104
- })
105
- }
106
- )
107
- },
108
- applySubmit (formData) {
109
- runLogic('addApply', formData).then(
110
- res => {
111
- this.$message.success('发起报建成功')
112
- this.$refs.xFormTable.refreshTable(true)
113
- this.applyAddFlag = false
114
- }
115
- ).catch(() => {
116
- this.applyAddFlag = false
117
- })
118
- },
119
- success () {
120
- console.log('完工')
121
- },
122
- toDetail (record, id) {
123
- this.$refs.workFlow.init({
124
- workflowId: record.ab_f_workflow_id,
125
- stepId: record.ws_f_step_id
126
- })
127
- },
128
- handleFormItemEvent (func, data, value) {
129
- console.log('打印一下:', func, data, value)
130
- if (func === 'selectAddress') {
131
- this.$refs.addressSelect.setFormShow()
132
- }
133
- },
134
- setForm (record) {
135
- this.$refs.workFlow.setFormValue({ address: record.f_address, address_id: record.f_address_id })
136
- },
137
72
  nextClick ({ form, formStep, workflowId }) {
138
73
  console.log('success', form, formStep, workflowId)
139
- const data = {
140
- workflowId,
141
- form,
142
- formStep
74
+ if (formStep === '管理员审核') {
75
+ const data = {
76
+ workflowId,
77
+ form
78
+ }
79
+ runLogic('auditFinish', { data: data }, 'af-revenue').then(
80
+ res => {
81
+ if (res) {
82
+ this.$message.success('审核完成!!!')
83
+ this.formModalVisible = false
84
+ this.$refs.xFormTable.refreshTable(true)
85
+ }
86
+ }
87
+ )
143
88
  }
144
- runLogic('applySubmitAfter', data, 'af-apply').then(
89
+ },
90
+ confirmAudit (param) {
91
+ runLogic('auditFinish', { data: param }, 'af-revenue').then(
145
92
  res => {
146
93
  if (res) {
147
- // this.$message.success('提交成功!')
94
+ this.$message.success('审核完成!!!')
95
+ this.formModalVisible = false
148
96
  this.$refs.xFormTable.refreshTable(true)
149
97
  }
150
98
  }
151
99
  )
152
100
  },
153
- // 协议作废
154
- setCancel (record) {
155
- this.cancelRecord = record
156
- this.formState = true
157
- this.$nextTick(() => {
158
- getConfigByName('setCancelForm', 'af-apply', (config) => {
159
- if (this.$refs.xCancelForm) {
160
- this.$refs.xCancelForm.init({
161
- formItems: config.formJson,
162
- title: '补充协议作废',
163
- businessType: '修改',
164
- showSubmitBtn: false,
165
- ...config
166
- })
167
- if (this.$refs.xCancelForm) {
168
- console.log(record)
169
- // this.$refs.xCancelForm.setForm(recordData)
170
- }
171
- } else {
172
- console.error('xCancelForm组件未加载完成')
173
- // 延迟重试
174
- setTimeout(() => {
175
- this.setCancel(record)
176
- }, 100)
177
- }
178
- })
101
+ audit (record, id, type) {
102
+ console.log(record, id, type)
103
+ console.log(this.$refs.workFlow)
104
+ this.detailVisible = true
105
+ this.$refs.workFlow.init({
106
+ workflowId: record.w_id
179
107
  })
180
108
  },
181
- async formSubmit () {
182
- this.submitLoading = true
183
- const formData = await this.$refs.xCancelForm.asyncSubmit()
184
- try {
185
- await this.submit(formData)
186
- } catch (error) {
187
- this.$message.error('表单验证失败,请检查填写内容')
188
- } finally {
189
- this.submitLoading = false
190
- }
191
- },
192
- async submit (formData) {
193
- const data = {
194
- ...formData,
195
- }
196
- console.log('==formData', data)
197
- await runLogic('暂时没有实现的logic', data, 'af-apply').then(() => {
198
- this.$message.success('操作成功')
199
- this.formState = false
109
+ check (record, id, type) {
110
+ console.log(record, id, type)
111
+ console.log(this.$refs.workFlow)
112
+ this.detailVisible = true
113
+ this.$refs.workFlow.init({
114
+ workflowId: record.a_id
200
115
  })
116
+ },
117
+ onClose () {
118
+ this.detailVisible = false
201
119
  }
202
- }
120
+ },
121
+ computed: {
122
+ ...mapState('account', { currUser: 'user' }),
123
+ ...mapState('setting', { isMobile: 'isMobile' })
124
+ },
203
125
  }
204
126
  </script>
127
+
128
+ <style scoped lang="less">
129
+ :deep(.ant-statistic-content-value) {
130
+ color: @primary-color;
131
+ }
132
+ </style>
@@ -1051,39 +1051,34 @@ export default {
1051
1051
  formCompletedDataPreview = JSON.parse(JSON.stringify(this.formCompletedData))
1052
1052
  // 使用字段定义中内容,将回显数据的列名,替换为定义的中文名
1053
1053
  // 调整逻辑:formData中只显示流程配置表单中定义过的显示列,多余冗余的存储列不进行页面展示
1054
- const formData = {}
1054
+ const formDataArr = []
1055
+ const dataObj = formCompletedDataPreview.data || {}
1055
1056
  const currentStepDefine = this.stepsDefine.find(item => item.id === stepId)
1056
1057
  const isKeyHandle = currentStepDefine?.properties?.form?.isKeyHandle || false
1057
- for (const key in formCompletedDataPreview.data) {
1058
- for (let i = 0; i < this.targetStepDefine.length; i++) {
1059
- const stepDefine = this.targetStepDefine[i]
1060
- // 兼容下旧代码,这里是否处理key根据表单配置中的isKeyHandle来决定,也有另一种情况如果处理完的key在表单中已经重复会将未处理的key直接存进去(新增表单的逻辑)
1061
- // 所以两种都判断下命中任意一个都算
1062
- if (key === this.getRealKey(stepDefine.model, isKeyHandle) || key === stepDefine.model) {
1063
- if (!['FilesId', 'Images'].includes(key)) {
1064
- // 读取字典值
1065
- if (stepDefine.formType === 'select' && stepDefine.selectType === 'key') {
1066
- for (const item of this.$appdata.getDictionaryList(stepDefine.selectKey)) {
1067
- if (item.value === formData[key]) {
1068
- formData[stepDefine.name] = item.label
1069
- break
1070
- }
1071
- }
1072
- } else {
1073
- formData[stepDefine.name] = formCompletedDataPreview.data[key]
1074
- }
1075
- }
1076
- // if (key !== stepDefine.name) {
1077
- // delete formData[key]
1078
- // }
1079
- break
1058
+ for (let i = 0; i < this.targetStepDefine.length; i++) {
1059
+ const stepDefine = this.targetStepDefine[i]
1060
+ const key = this.getRealKey(stepDefine.model, isKeyHandle)
1061
+ if (Object.prototype.hasOwnProperty.call(dataObj, key)) {
1062
+ let value = dataObj[key]
1063
+ // 字典值处理
1064
+ if (stepDefine.formType === 'select' && stepDefine.selectType === 'key') {
1065
+ const dictList = this.$appdata.getDictionaryList(stepDefine.selectKey)
1066
+ const dictItem = dictList.find(item => item.value === value)
1067
+ value = dictItem ? dictItem.label : value
1080
1068
  }
1069
+ formDataArr.push({ label: stepDefine.name, value })
1081
1070
  }
1082
1071
  }
1083
- if (Object.keys(formData).length > 0) {
1084
- formCompletedDataPreview.data = formData
1072
+ // 如果一个都没匹配上,兼容旧逻辑:把原对象转成数组
1073
+ if (formDataArr.length === 0 && dataObj && typeof dataObj === 'object') {
1074
+ for (const key in dataObj) {
1075
+ if (Object.prototype.hasOwnProperty.call(dataObj, key)) {
1076
+ formDataArr.push({ label: key, value: dataObj[key] })
1077
+ }
1078
+ }
1085
1079
  }
1086
- if (!Object.keys(formCompletedDataPreview.data).length) {
1080
+ formCompletedDataPreview.data = formDataArr.length > 0 ? formDataArr : null
1081
+ if (!formCompletedDataPreview.data) {
1087
1082
  formCompletedDataPreview.data = null
1088
1083
  }
1089
1084
  // 备注
@@ -11,12 +11,12 @@
11
11
  填写历史
12
12
  </p>
13
13
  <a-descriptions-item
14
- v-for="(value, key) in formCompletedDataPreview.data"
15
- :key="key"
16
- v-show="key !== '附件上传' && key !== '__expressionRs'"
14
+ v-for="(item, idx) in formCompletedDataPreview.data"
15
+ :key="item.label || idx"
16
+ v-show="item.label !== '附件上传' && item.label !== '__expressionRs'"
17
17
  >
18
- <span slot="label" style="color: #000">{{ key }}</span>
19
- <div style="white-space: pre-wrap">{{ value }}</div>
18
+ <span slot="label" style="color: #000">{{ item.label }}</span>
19
+ <div style="white-space: pre-wrap">{{ item.value }}</div>
20
20
  </a-descriptions-item>
21
21
  </a-descriptions>
22
22
  <a-descriptions