|
...
|
...
|
@@ -45,15 +45,15 @@ |
|
45
|
45
|
</view>
|
|
46
|
46
|
</view>
|
|
47
|
47
|
</scroll-view>
|
|
48
|
|
- <detail-buttons :buttons="buttons" @click="handleButtonClick" />
|
|
|
48
|
+ <detail-buttons :buttons="displayButtons" @click="handleButtonClick" />
|
|
49
|
49
|
</view>
|
|
50
|
50
|
</template>
|
|
51
|
51
|
|
|
52
|
52
|
<script>
|
|
53
|
|
- import {
|
|
54
|
|
- getDetailApi,
|
|
55
|
|
- statusOptions
|
|
56
|
|
- } from '@/api/devManage.js'
|
|
|
53
|
+ import {
|
|
|
54
|
+ getDetailApi,
|
|
|
55
|
+ cancelApi
|
|
|
56
|
+ } from '@/api/devManage.js'
|
|
57
|
57
|
import {
|
|
58
|
58
|
getDicName
|
|
59
|
59
|
} from '@/utils/dic.js'
|
|
...
|
...
|
@@ -67,62 +67,75 @@ |
|
67
|
67
|
components: {
|
|
68
|
68
|
DetailButtons
|
|
69
|
69
|
},
|
|
70
|
|
- data() {
|
|
71
|
|
- return {
|
|
72
|
|
- form: {
|
|
73
|
|
- workshop: {},
|
|
74
|
|
- office: {},
|
|
75
|
|
- customer: {},
|
|
76
|
|
- customerType: '',
|
|
77
|
|
- chargeUserId: '',
|
|
78
|
|
- chargeUserIdName: '',
|
|
79
|
|
- productVariety: {},
|
|
80
|
|
- monthlyUsage: '',
|
|
81
|
|
- targetQuantity: '',
|
|
82
|
|
- industry: '',
|
|
83
|
|
- mark: '',
|
|
84
|
|
- thickness: '',
|
|
85
|
|
- width: '',
|
|
86
|
|
- materialRequire: '',
|
|
87
|
|
- qualityRequire: '',
|
|
88
|
|
- peer: '',
|
|
89
|
|
- pricingMode: '',
|
|
90
|
|
- settleDays: '',
|
|
91
|
|
- createTime: '',
|
|
92
|
|
- status: ''
|
|
93
|
|
- },
|
|
94
|
|
- customerTypeOptions: [],
|
|
95
|
|
- buttons: [{
|
|
96
|
|
- text: '编辑',
|
|
97
|
|
- visible: true,
|
|
98
|
|
- variant: 'outline',
|
|
99
|
|
- event: 'edit',
|
|
100
|
|
- style: {
|
|
101
|
|
- color: 'red',
|
|
102
|
|
- border: '2rpx dashed #2979ff'
|
|
103
|
|
- }
|
|
104
|
|
- },
|
|
105
|
|
- {
|
|
106
|
|
- text: '审核详情',
|
|
107
|
|
- visible: true,
|
|
108
|
|
- variant: 'outline',
|
|
109
|
|
- event: 'auditDetail'
|
|
110
|
|
- },
|
|
111
|
|
- {
|
|
112
|
|
- text: '审核',
|
|
113
|
|
- visible: true,
|
|
114
|
|
- variant: 'danger',
|
|
115
|
|
- event: 'audit'
|
|
116
|
|
- },
|
|
117
|
|
- {
|
|
118
|
|
- text: '取消',
|
|
119
|
|
- visible: true,
|
|
120
|
|
- variant: 'outline',
|
|
121
|
|
- event: 'cancel'
|
|
122
|
|
- }
|
|
123
|
|
- ],
|
|
124
|
|
- }
|
|
125
|
|
- },
|
|
|
70
|
+ data() {
|
|
|
71
|
+ return {
|
|
|
72
|
+ form: {
|
|
|
73
|
+ workshop: {},
|
|
|
74
|
+ office: {},
|
|
|
75
|
+ customer: {},
|
|
|
76
|
+ customerType: '',
|
|
|
77
|
+ chargeUserId: '',
|
|
|
78
|
+ chargeUserIdName: '',
|
|
|
79
|
+ productVariety: {},
|
|
|
80
|
+ monthlyUsage: '',
|
|
|
81
|
+ targetQuantity: '',
|
|
|
82
|
+ industry: '',
|
|
|
83
|
+ mark: '',
|
|
|
84
|
+ thickness: '',
|
|
|
85
|
+ width: '',
|
|
|
86
|
+ materialRequire: '',
|
|
|
87
|
+ qualityRequire: '',
|
|
|
88
|
+ peer: '',
|
|
|
89
|
+ pricingMode: '',
|
|
|
90
|
+ settleDays: '',
|
|
|
91
|
+ createTime: '',
|
|
|
92
|
+ status: ''
|
|
|
93
|
+ },
|
|
|
94
|
+ customerTypeOptions: [],
|
|
|
95
|
+ todoType: '',
|
|
|
96
|
+ buttons: [{
|
|
|
97
|
+ text: '编辑',
|
|
|
98
|
+ visible: true,
|
|
|
99
|
+ variant: 'outline',
|
|
|
100
|
+ event: 'edit',
|
|
|
101
|
+ },
|
|
|
102
|
+ {
|
|
|
103
|
+ text: '审核详情',
|
|
|
104
|
+ visible: true,
|
|
|
105
|
+ variant: 'outline',
|
|
|
106
|
+ event: 'auditDetail'
|
|
|
107
|
+ },
|
|
|
108
|
+ {
|
|
|
109
|
+ text: '审核',
|
|
|
110
|
+ visible: true,
|
|
|
111
|
+ variant: 'primary',
|
|
|
112
|
+ event: 'audit'
|
|
|
113
|
+ },
|
|
|
114
|
+ {
|
|
|
115
|
+ text: '取消',
|
|
|
116
|
+ visible: true,
|
|
|
117
|
+ variant: 'outline',
|
|
|
118
|
+ event: 'cancel',
|
|
|
119
|
+ style: {
|
|
|
120
|
+ color: 'rgba(0,0,0,0.9)',
|
|
|
121
|
+ border: '1px solid #DCDCDC'
|
|
|
122
|
+ }
|
|
|
123
|
+ }
|
|
|
124
|
+ ],
|
|
|
125
|
+ }
|
|
|
126
|
+ },
|
|
|
127
|
+ computed: {
|
|
|
128
|
+ displayButtons() {
|
|
|
129
|
+ const s = Number(this.form && this.form.status || 0)
|
|
|
130
|
+ const t = this.todoType || ''
|
|
|
131
|
+ return [
|
|
|
132
|
+ { ...this.buttons[0], visible: (s === 3 && t === '') },
|
|
|
133
|
+ { ...this.buttons[1] },
|
|
|
134
|
+ { ...this.buttons[2], visible: (s === 1 && t === 'WAIT') },
|
|
|
135
|
+ { ...this.buttons[3], visible: (s === 3 && t === '') }
|
|
|
136
|
+ ]
|
|
|
137
|
+ }
|
|
|
138
|
+ },
|
|
126
|
139
|
created() {
|
|
127
|
140
|
this.loadCustomerTypeOptions()
|
|
128
|
141
|
},
|
|
...
|
...
|
@@ -132,10 +145,12 @@ |
|
132
|
145
|
onUnload() {
|
|
133
|
146
|
uni.$off('dev_manage_detail_reload', this.onReload)
|
|
134
|
147
|
},
|
|
135
|
|
- onLoad(query) {
|
|
136
|
|
- const id = (query && (query.id || query.code)) || ''
|
|
137
|
|
- if (id) this.loadDetail(id)
|
|
138
|
|
- },
|
|
|
148
|
+ onLoad(query) {
|
|
|
149
|
+ const id = (query && (query.id || query.code)) || ''
|
|
|
150
|
+ const t = (query && (query.todoType)) || ''
|
|
|
151
|
+ this.todoType = t
|
|
|
152
|
+ if (id) this.loadDetail(id)
|
|
|
153
|
+ },
|
|
139
|
154
|
methods: {
|
|
140
|
155
|
onReload(payload) {
|
|
141
|
156
|
const id = (payload && (payload.id || payload.code)) || this.form.id || this.form.code || ''
|
|
...
|
...
|
@@ -191,9 +206,28 @@ |
|
191
|
206
|
icon: 'none'
|
|
192
|
207
|
})
|
|
193
|
208
|
},
|
|
194
|
|
- onCancel() {
|
|
195
|
|
- uni.navigateBack()
|
|
196
|
|
- }
|
|
|
209
|
+ onCancel() {
|
|
|
210
|
+ const id = this.form && (this.form.id || this.form.code) || ''
|
|
|
211
|
+ if (!id) return
|
|
|
212
|
+ uni.showModal({
|
|
|
213
|
+ title: '系统提示',
|
|
|
214
|
+ content: '是否确定取消该流程?',
|
|
|
215
|
+ confirmText: '确定',
|
|
|
216
|
+ cancelText: '取消',
|
|
|
217
|
+ success: (res) => {
|
|
|
218
|
+ if (res && res.confirm) {
|
|
|
219
|
+ cancelApi(id).then(() => {
|
|
|
220
|
+ uni.showToast({ title: '已取消', icon: 'none' })
|
|
|
221
|
+ setTimeout(() => {
|
|
|
222
|
+ uni.redirectTo({ url: '/pages/dev_manage/index' })
|
|
|
223
|
+ }, 300)
|
|
|
224
|
+ }).catch(() => {
|
|
|
225
|
+ uni.showToast({ title: '取消失败', icon: 'none' })
|
|
|
226
|
+ })
|
|
|
227
|
+ }
|
|
|
228
|
+ }
|
|
|
229
|
+ })
|
|
|
230
|
+ }
|
|
197
|
231
|
}
|
|
198
|
232
|
}
|
|
199
|
233
|
</script>
|
...
|
...
|
|