|
|
@@ -26,38 +26,31 @@
|
|
26
|
26
|
<el-form-item label="可催办次数">
|
|
27
|
27
|
<el-input-number v-model="ruleForm.F_CanUrgeCount" :step="1" :min="-1" />
|
|
28
|
28
|
</el-form-item>
|
|
29
|
|
- <el-form-item label="自动派单">
|
|
30
|
|
- <el-switch v-model="ruleForm.F_AutoTransfer" active-color="#13ce66" active-value="1" inactive-value="0" inactive-color="#ff4949"></el-switch>
|
|
|
29
|
+ <el-form-item label="自动派单">
|
|
|
30
|
+ <el-switch v-model="ruleForm.F_AutoTransfer" active-color="#13ce66" active-value="1" inactive-value="0"
|
|
|
31
|
+ inactive-color="#ff4949"></el-switch>
|
|
31
|
32
|
</el-form-item>
|
|
32
|
33
|
<el-form-item label="流转部门">
|
|
33
|
34
|
<el-row v-for="(item, index) in autolist" :key="index" style="margin-bottom: 10px;">
|
|
34
|
|
- <el-select v-model="item.autoyq" clearable placeholder="请选择院区" @change="(autoyq)=>changeyq(autoyq,index)" @clear="clearyq(autoyq,index)">
|
|
35
|
|
- <el-option label="全部" value="0"/>
|
|
36
|
|
- <el-option v-for="(itemval, index) in yqarr" :key="itemval.T_Woid" :label="itemval.T_Woname" :value="itemval.T_Woid.toString()"/>
|
|
|
35
|
+ <el-select v-model="item.autoyq" clearable placeholder="请选择院区" @change="(autoyq)=>changeyq(autoyq,index)"
|
|
|
36
|
+ @clear="clearyq(autoyq,index)">
|
|
|
37
|
+ <el-option label="全部" value="0" />
|
|
|
38
|
+ <el-option v-for="(itemval, index) in yqarr" :key="itemval.T_Woid" :label="itemval.T_Woname"
|
|
|
39
|
+ :value="itemval.T_Woid.toString()" />
|
|
37
|
40
|
</el-select>
|
|
38
|
|
- <el-cascader
|
|
39
|
|
- ref="cascader"
|
|
40
|
|
- :span="24"
|
|
41
|
|
- v-model="item.autodept"
|
|
42
|
|
- :options="orderData"
|
|
43
|
|
- :props="defaultProps"
|
|
44
|
|
- style="width: 30%;"
|
|
45
|
|
- placeholder="请选择科室"
|
|
46
|
|
- filterable
|
|
47
|
|
- clearable
|
|
48
|
|
- @change="(autodept)=>handleChangeDept(autodept,index)"/>
|
|
|
41
|
+ <el-cascader ref="cascader" :span="24" v-model="item.autodept" :options="orderData" :props="defaultProps"
|
|
|
42
|
+ style="width: 30%;" placeholder="请选择科室" filterable clearable
|
|
|
43
|
+ @change="(autodept)=>handleChangeDept(autodept,index)" />
|
|
49
|
44
|
<el-select v-model="item.autousercode" filterable clearable placeholder="请选择人员" style="width: 30%">
|
|
50
|
|
- <el-option v-for="itemper in autolist[index].personarr" :key="itemper.usercode" :label="itemper.username" :value="itemper.usercode" />
|
|
|
45
|
+ <el-option v-for="itemper in autolist[index].personarr" :key="itemper.usercode" :label="itemper.username"
|
|
|
46
|
+ :value="itemper.usercode" />
|
|
51
|
47
|
</el-select>
|
|
52
|
|
- <el-button v-if="index==0" type="primary" icon="el-icon-plus" circle @click="addItem()"/>
|
|
53
|
|
- <el-button v-if="index>0" type="primary" icon="el-icon-close" circle @click="removeItem(index)"/>
|
|
|
48
|
+ <el-button v-if="index==0" type="primary" icon="el-icon-plus" circle @click="addItem()" />
|
|
|
49
|
+ <el-button v-if="index>0" type="primary" icon="el-icon-close" circle @click="removeItem(index)" />
|
|
54
|
50
|
</el-row>
|
|
55
|
51
|
</el-form-item>
|
|
56
|
52
|
<el-form-item label="备注" prop="F_Remark">
|
|
57
|
|
- <el-input
|
|
58
|
|
- v-model="ruleForm.F_Remark"
|
|
59
|
|
- :autosize="{ minRows: 4, maxRows: 8 }"
|
|
60
|
|
- type="textarea"
|
|
|
53
|
+ <el-input v-model="ruleForm.F_Remark" :autosize="{ minRows: 4, maxRows: 8 }" type="textarea"
|
|
61
|
54
|
placeholder="请输入备注" />
|
|
62
|
55
|
</el-form-item>
|
|
63
|
56
|
<el-form-item label="排序" prop="F_Sort">
|
|
|
@@ -71,205 +64,223 @@
|
|
71
|
64
|
</div>
|
|
72
|
65
|
</template>
|
|
73
|
66
|
<script>
|
|
74
|
|
-import {
|
|
75
|
|
- GetYuanqu
|
|
76
|
|
-} from '@/api/telCall/report'
|
|
77
|
|
-import {
|
|
78
|
|
- GetUsersByDeptId
|
|
79
|
|
-} from '@/api/commonAPI'
|
|
80
|
|
-import {
|
|
81
|
|
- getDeptTree
|
|
82
|
|
-} from '@/api/systemSetup/roleSetting/userManage'
|
|
83
|
|
-import {
|
|
84
|
|
- getOrderType,
|
|
85
|
|
- addOrderType,
|
|
86
|
|
- editOrderType
|
|
87
|
|
-} from '@/api/systemSetup/roleSetting/orderTypeManage'
|
|
88
|
|
-import {
|
|
89
|
|
- validateSort
|
|
90
|
|
-} from '@/utils/validate'
|
|
91
|
|
-import {
|
|
92
|
|
- filterContent
|
|
93
|
|
-} from '@/utils'
|
|
94
|
|
-import selectDeptTree from '@/components/context/commonSelect/selectDeptTree.vue'
|
|
95
|
|
-const validateSortRule = (rule, value, callback) => {
|
|
96
|
|
- if (!validateSort(value)) {
|
|
97
|
|
- callback(new Error('请输入有效的排序编号(正整数、负整数、0)'))
|
|
98
|
|
- } else {
|
|
99
|
|
- callback()
|
|
|
67
|
+ import {
|
|
|
68
|
+ GetYuanqu
|
|
|
69
|
+ } from '@/api/telCall/report'
|
|
|
70
|
+ import {
|
|
|
71
|
+ GetUsersByDeptId
|
|
|
72
|
+ } from '@/api/commonAPI'
|
|
|
73
|
+ import {
|
|
|
74
|
+ getDeptTree
|
|
|
75
|
+ } from '@/api/systemSetup/roleSetting/userManage'
|
|
|
76
|
+ import {
|
|
|
77
|
+ getOrderType,
|
|
|
78
|
+ addOrderType,
|
|
|
79
|
+ editOrderType
|
|
|
80
|
+ } from '@/api/systemSetup/roleSetting/orderTypeManage'
|
|
|
81
|
+ import {
|
|
|
82
|
+ validateSort
|
|
|
83
|
+ } from '@/utils/validate'
|
|
|
84
|
+ import {
|
|
|
85
|
+ filterContent
|
|
|
86
|
+ } from '@/utils'
|
|
|
87
|
+ import selectDeptTree from '@/components/context/commonSelect/selectDeptTree.vue'
|
|
|
88
|
+ const validateSortRule = (rule, value, callback) => {
|
|
|
89
|
+ if (!validateSort(value)) {
|
|
|
90
|
+ callback(new Error('请输入有效的排序编号(正整数、负整数、0)'))
|
|
|
91
|
+ } else {
|
|
|
92
|
+ callback()
|
|
|
93
|
+ }
|
|
100
|
94
|
}
|
|
101
|
|
-}
|
|
102
|
95
|
|
|
103
|
|
-export default {
|
|
104
|
|
- name: 'AddOrEditOrderType',
|
|
105
|
|
- components: {
|
|
106
|
|
- selectDeptTree
|
|
107
|
|
- },
|
|
108
|
|
- props: {
|
|
109
|
|
- rowid: {
|
|
110
|
|
- type: String,
|
|
111
|
|
- default: ''
|
|
112
|
|
- },
|
|
113
|
|
- parentId: {
|
|
114
|
|
- type: String,
|
|
115
|
|
- default: ''
|
|
116
|
|
- },
|
|
117
|
|
- parentText: {
|
|
118
|
|
- type: String,
|
|
119
|
|
- default: ''
|
|
120
|
|
- },
|
|
121
|
|
- orderGrade: {
|
|
122
|
|
- type: Number,
|
|
123
|
|
- default: 0
|
|
|
96
|
+ export default {
|
|
|
97
|
+ name: 'AddOrEditOrderType',
|
|
|
98
|
+ components: {
|
|
|
99
|
+ selectDeptTree
|
|
124
|
100
|
},
|
|
125
|
|
- layerid: {
|
|
126
|
|
- type: String,
|
|
127
|
|
- default: ''
|
|
128
|
|
- }
|
|
129
|
|
- },
|
|
130
|
|
- data() {
|
|
131
|
|
- return {
|
|
132
|
|
- parentTexts: '',
|
|
133
|
|
- ruleForm: {
|
|
134
|
|
- F_ParentID: 0, // 父id
|
|
135
|
|
- F_GDId: '', // 工单类型id
|
|
136
|
|
- F_TypeId: 0, // 四大类id
|
|
137
|
|
- F_Name: '', // 工单类型名称
|
|
138
|
|
- F_TimeOut: 1,
|
|
139
|
|
- F_RepairTimeLimit: 1,
|
|
140
|
|
- F_Remark: '', // 工单类型备注
|
|
141
|
|
- F_Sort: '', // 排序
|
|
142
|
|
- F_Identification: '',
|
|
143
|
|
- F_CanReplayCount: 0,
|
|
144
|
|
- F_CanUrgeCount: -1,
|
|
145
|
|
- F_AutoTransfer: 0,
|
|
146
|
|
- autodept: []
|
|
147
|
|
- // F_AutoDept: '' // 流转部门
|
|
|
101
|
+ props: {
|
|
|
102
|
+ rowid: {
|
|
|
103
|
+ type: String,
|
|
|
104
|
+ default: ''
|
|
148
|
105
|
},
|
|
149
|
|
- autolist: [{
|
|
150
|
|
- autoyq: '',
|
|
151
|
|
- autodept: '',
|
|
152
|
|
- autousercode: '',
|
|
153
|
|
- personarr: []
|
|
154
|
|
- }],
|
|
155
|
|
- rules: {
|
|
156
|
|
- F_Name: [{
|
|
157
|
|
- required: true,
|
|
158
|
|
- message: '请选择工单类型',
|
|
159
|
|
- trigger: 'blur'
|
|
160
|
|
- }]
|
|
|
106
|
+ parentId: {
|
|
|
107
|
+ type: String,
|
|
|
108
|
+ default: ''
|
|
161
|
109
|
},
|
|
162
|
|
- defaultProps: {
|
|
163
|
|
- checkStrictly: true,
|
|
164
|
|
- children: 'children',
|
|
165
|
|
- label: 'text',
|
|
166
|
|
- value: 'id',
|
|
167
|
|
- emitPath: false
|
|
|
110
|
+ parentText: {
|
|
|
111
|
+ type: String,
|
|
|
112
|
+ default: ''
|
|
168
|
113
|
},
|
|
169
|
|
- orderData: [],
|
|
170
|
|
- deptidArr: [],
|
|
171
|
|
- yqarr: [],
|
|
172
|
|
- loading: false,
|
|
173
|
|
- yqdata:[]
|
|
174
|
|
- }
|
|
175
|
|
- },
|
|
176
|
|
- created() {
|
|
177
|
|
- this.parentTexts = this.parentText
|
|
178
|
|
- this.getHos()
|
|
179
|
|
- this.getTreeList()
|
|
180
|
|
- if (this.rowid) {
|
|
181
|
|
- this.ruleForm.F_GDId = this.rowid
|
|
182
|
|
- this.getDetail(this.rowid)
|
|
183
|
|
- }
|
|
184
|
|
- if (this.orderGrade) {
|
|
185
|
|
- this.ruleForm.F_TypeId = this.orderGrade
|
|
186
|
|
- }
|
|
187
|
|
- if (this.parentId) {
|
|
188
|
|
- this.ruleForm.F_ParentID = this.parentId
|
|
189
|
|
- }
|
|
190
|
|
- },
|
|
191
|
|
- methods: {
|
|
192
|
|
- addItem() {
|
|
193
|
|
- const params = {
|
|
194
|
|
- autoyq: '',
|
|
195
|
|
- autodept: '',
|
|
196
|
|
- autousercode: '',
|
|
197
|
|
- personarr: []
|
|
|
114
|
+ orderGrade: {
|
|
|
115
|
+ type: Number,
|
|
|
116
|
+ default: 0
|
|
|
117
|
+ },
|
|
|
118
|
+ layerid: {
|
|
|
119
|
+ type: String,
|
|
|
120
|
+ default: ''
|
|
198
|
121
|
}
|
|
199
|
|
- this.autolist.push(params)
|
|
200
|
|
- },
|
|
201
|
|
- removeItem(index) {
|
|
202
|
|
- this.autolist.splice(index, 1)
|
|
203
|
|
- },
|
|
204
|
|
- getHos() {
|
|
205
|
|
- const params = {}
|
|
206
|
|
- GetYuanqu(params).then((res) => {
|
|
207
|
|
- this.yqarr = res.data
|
|
208
|
|
- })
|
|
209
|
122
|
},
|
|
210
|
|
- getTreeList() {
|
|
211
|
|
- return new Promise((resolve) => {
|
|
212
|
|
- const params = {}
|
|
213
|
|
- getDeptTree(params).then((response) => {
|
|
214
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
215
|
|
- this.orderData = response.data
|
|
216
|
|
- }
|
|
217
|
|
- })
|
|
218
|
|
- resolve()
|
|
219
|
|
- })
|
|
|
123
|
+ data() {
|
|
|
124
|
+ return {
|
|
|
125
|
+ parentTexts: '',
|
|
|
126
|
+ ruleForm: {
|
|
|
127
|
+ F_ParentID: 0, // 父id
|
|
|
128
|
+ F_GDId: '', // 工单类型id
|
|
|
129
|
+ F_TypeId: 0, // 四大类id
|
|
|
130
|
+ F_Name: '', // 工单类型名称
|
|
|
131
|
+ F_TimeOut: 1,
|
|
|
132
|
+ F_RepairTimeLimit: 1,
|
|
|
133
|
+ F_Remark: '', // 工单类型备注
|
|
|
134
|
+ F_Sort: '', // 排序
|
|
|
135
|
+ F_Identification: '',
|
|
|
136
|
+ F_CanReplayCount: 0,
|
|
|
137
|
+ F_CanUrgeCount: -1,
|
|
|
138
|
+ F_AutoTransfer: 0,
|
|
|
139
|
+ autodept: []
|
|
|
140
|
+ // F_AutoDept: '' // 流转部门
|
|
|
141
|
+ },
|
|
|
142
|
+ autolist: [{
|
|
|
143
|
+ autoyq: '',
|
|
|
144
|
+ autodept: '',
|
|
|
145
|
+ autousercode: '',
|
|
|
146
|
+ personarr: []
|
|
|
147
|
+ }],
|
|
|
148
|
+ rules: {
|
|
|
149
|
+ F_Name: [{
|
|
|
150
|
+ required: true,
|
|
|
151
|
+ message: '请选择工单类型',
|
|
|
152
|
+ trigger: 'blur'
|
|
|
153
|
+ }]
|
|
|
154
|
+ },
|
|
|
155
|
+ defaultProps: {
|
|
|
156
|
+ checkStrictly: true,
|
|
|
157
|
+ children: 'children',
|
|
|
158
|
+ label: 'text',
|
|
|
159
|
+ value: 'id',
|
|
|
160
|
+ emitPath: false
|
|
|
161
|
+ },
|
|
|
162
|
+ orderData: [],
|
|
|
163
|
+ deptidArr: [],
|
|
|
164
|
+ yqarr: [],
|
|
|
165
|
+ loading: false,
|
|
|
166
|
+ yqdata: []
|
|
|
167
|
+ }
|
|
220
|
168
|
},
|
|
221
|
|
- changeyq(data, index) {
|
|
222
|
|
- console.log('changeyq',data, index)
|
|
223
|
|
- this.yqdata = []
|
|
224
|
|
- for (var i = 0; i < this.autolist.length - 1; i++) {
|
|
225
|
|
- this.yqdata.push(this.autolist[i].autoyq)
|
|
|
169
|
+ created() {
|
|
|
170
|
+ this.parentTexts = this.parentText
|
|
|
171
|
+ this.getHos()
|
|
|
172
|
+ this.getTreeList()
|
|
|
173
|
+ if (this.rowid) {
|
|
|
174
|
+ this.ruleForm.F_GDId = this.rowid
|
|
|
175
|
+ this.getDetail(this.rowid)
|
|
226
|
176
|
}
|
|
227
|
|
- if (this.yqdata.indexOf(data) >= 0) {
|
|
228
|
|
- this.$message.warning('该院区已存在,请重新选择院区')
|
|
229
|
|
- this.autolist[index].autoyq = ''
|
|
|
177
|
+ if (this.orderGrade) {
|
|
|
178
|
+ this.ruleForm.F_TypeId = this.orderGrade
|
|
230
|
179
|
}
|
|
231
|
|
- },
|
|
232
|
|
- clearyq(data, index){
|
|
233
|
|
- console.log('clearyq',data, index)
|
|
234
|
|
- this.yqdata[index].autoyq = ''
|
|
235
|
|
- },
|
|
236
|
|
- handleChangeDept(data, index) {
|
|
237
|
|
- this.autolist[index].personarr = []
|
|
238
|
|
- this.autolist[index].autousercode = ''
|
|
239
|
|
- this.getRepairman(data, index)
|
|
240
|
|
- this.$forceUpdate()
|
|
241
|
|
- },
|
|
242
|
|
- getRepairman(id, index) {
|
|
243
|
|
- const params = {
|
|
244
|
|
- deptid: id
|
|
|
180
|
+ if (this.parentId) {
|
|
|
181
|
+ this.ruleForm.F_ParentID = this.parentId
|
|
245
|
182
|
}
|
|
246
|
|
- GetUsersByDeptId(params).then((res) => {
|
|
247
|
|
- // this.autolist[index].personarr = res.rows
|
|
248
|
|
- this.$set(this.autolist[index], 'personarr', res.rows)
|
|
249
|
|
- })
|
|
250
|
183
|
},
|
|
251
|
|
- submitForm() {
|
|
252
|
|
- var autoarr = []
|
|
253
|
|
- if (this.autolist && this.autolist[0].autoyq && this.autolist[0].autodept) {
|
|
254
|
|
- this.autolist.find(item => {
|
|
255
|
|
- autoarr.push({
|
|
256
|
|
- autoyq: item.autoyq,
|
|
257
|
|
- autodept: item.autodept,
|
|
258
|
|
- autousercode: item.autousercode
|
|
|
184
|
+ methods: {
|
|
|
185
|
+ addItem() {
|
|
|
186
|
+ const params = {
|
|
|
187
|
+ autoyq: '',
|
|
|
188
|
+ autodept: '',
|
|
|
189
|
+ autousercode: '',
|
|
|
190
|
+ personarr: []
|
|
|
191
|
+ }
|
|
|
192
|
+ this.autolist.push(params)
|
|
|
193
|
+ },
|
|
|
194
|
+ removeItem(index) {
|
|
|
195
|
+ this.autolist.splice(index, 1)
|
|
|
196
|
+ },
|
|
|
197
|
+ getHos() {
|
|
|
198
|
+ const params = {}
|
|
|
199
|
+ GetYuanqu(params).then((res) => {
|
|
|
200
|
+ this.yqarr = res.data
|
|
|
201
|
+ })
|
|
|
202
|
+ },
|
|
|
203
|
+ getTreeList() {
|
|
|
204
|
+ return new Promise((resolve) => {
|
|
|
205
|
+ const params = {}
|
|
|
206
|
+ getDeptTree(params).then((response) => {
|
|
|
207
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
208
|
+ this.orderData = response.data
|
|
|
209
|
+ }
|
|
259
|
210
|
})
|
|
|
211
|
+ resolve()
|
|
260
|
212
|
})
|
|
261
|
|
- } else {
|
|
262
|
|
- autoarr = ''
|
|
263
|
|
- }
|
|
264
|
|
- console.log(autoarr)
|
|
265
|
|
- // return;
|
|
266
|
|
- this.$refs.ruleForm.validate((valid) => {
|
|
267
|
|
- if (valid) {
|
|
268
|
|
- this.loading = true
|
|
269
|
|
- this.ruleForm.autodept = autoarr
|
|
270
|
|
- // 添加
|
|
271
|
|
- if (!this.rowid) {
|
|
272
|
|
- addOrderType(this.ruleForm).then(response => {
|
|
|
213
|
+ },
|
|
|
214
|
+ changeyq(data, index) {
|
|
|
215
|
+ console.log('changeyq', data, index)
|
|
|
216
|
+ this.yqdata = []
|
|
|
217
|
+ for (var i = 0; i < this.autolist.length - 1; i++) {
|
|
|
218
|
+ this.yqdata.push(this.autolist[i].autoyq)
|
|
|
219
|
+ }
|
|
|
220
|
+ if (this.yqdata.indexOf(data) >= 0) {
|
|
|
221
|
+ this.$message.warning('该院区已存在,请重新选择院区')
|
|
|
222
|
+ this.autolist[index].autoyq = ''
|
|
|
223
|
+ }
|
|
|
224
|
+ },
|
|
|
225
|
+ clearyq(data, index) {
|
|
|
226
|
+ console.log('clearyq', data, index)
|
|
|
227
|
+ this.yqdata[index].autoyq = ''
|
|
|
228
|
+ },
|
|
|
229
|
+ handleChangeDept(data, index) {
|
|
|
230
|
+ this.autolist[index].personarr = []
|
|
|
231
|
+ this.autolist[index].autousercode = ''
|
|
|
232
|
+ this.getRepairman(data, index)
|
|
|
233
|
+ this.$forceUpdate()
|
|
|
234
|
+ },
|
|
|
235
|
+ getRepairman(id, index) {
|
|
|
236
|
+ const params = {
|
|
|
237
|
+ deptid: id
|
|
|
238
|
+ }
|
|
|
239
|
+ GetUsersByDeptId(params).then((res) => {
|
|
|
240
|
+ // this.autolist[index].personarr = res.rows
|
|
|
241
|
+ this.$set(this.autolist[index], 'personarr', res.rows)
|
|
|
242
|
+ })
|
|
|
243
|
+ },
|
|
|
244
|
+ submitForm() {
|
|
|
245
|
+ var autoarr = []
|
|
|
246
|
+ if (this.autolist && this.autolist[0].autoyq && this.autolist[0].autodept) {
|
|
|
247
|
+ this.autolist.find(item => {
|
|
|
248
|
+ autoarr.push({
|
|
|
249
|
+ autoyq: item.autoyq,
|
|
|
250
|
+ autodept: item.autodept,
|
|
|
251
|
+ autousercode: item.autousercode
|
|
|
252
|
+ })
|
|
|
253
|
+ })
|
|
|
254
|
+ } else {
|
|
|
255
|
+ autoarr = ''
|
|
|
256
|
+ }
|
|
|
257
|
+ console.log(autoarr)
|
|
|
258
|
+ // return;
|
|
|
259
|
+ this.$refs.ruleForm.validate((valid) => {
|
|
|
260
|
+ if (valid) {
|
|
|
261
|
+ this.loading = true
|
|
|
262
|
+ this.ruleForm.autodept = autoarr
|
|
|
263
|
+ // 添加
|
|
|
264
|
+ if (!this.rowid) {
|
|
|
265
|
+ addOrderType(this.ruleForm).then(response => {
|
|
|
266
|
+ this.loading = false
|
|
|
267
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
268
|
+ this.$parent.$layer.close(this.layerid)
|
|
|
269
|
+ if (this.orderGrade === 1) {
|
|
|
270
|
+ this.$parent.getList() // 重新加载父级数据
|
|
|
271
|
+ } else if (this.orderGrade >= 2) {
|
|
|
272
|
+ this.$parent.getTreeList()
|
|
|
273
|
+ }
|
|
|
274
|
+
|
|
|
275
|
+ this.$message.success('恭喜你,添加成功!')
|
|
|
276
|
+ }
|
|
|
277
|
+ }).catch(() => {
|
|
|
278
|
+ this.loading = false
|
|
|
279
|
+ })
|
|
|
280
|
+ return
|
|
|
281
|
+ }
|
|
|
282
|
+ // 编辑
|
|
|
283
|
+ editOrderType(this.ruleForm).then(response => {
|
|
273
|
284
|
this.loading = false
|
|
274
|
285
|
if (response.state.toLowerCase() === 'success') {
|
|
275
|
286
|
this.$parent.$layer.close(this.layerid)
|
|
|
@@ -278,75 +289,57 @@ export default {
|
|
278
|
289
|
} else if (this.orderGrade >= 2) {
|
|
279
|
290
|
this.$parent.getTreeList()
|
|
280
|
291
|
}
|
|
281
|
|
-
|
|
282
|
|
- this.$message.success('恭喜你,添加成功!')
|
|
|
292
|
+ this.$message.success('恭喜你,编辑成功!')
|
|
|
293
|
+ this.$parent.getList()
|
|
283
|
294
|
}
|
|
284
|
295
|
}).catch(() => {
|
|
285
|
296
|
this.loading = false
|
|
286
|
297
|
})
|
|
287
|
|
- return
|
|
|
298
|
+ } else {
|
|
|
299
|
+ this.$message.error('请输入有效的必填项信息!')
|
|
|
300
|
+ return false
|
|
288
|
301
|
}
|
|
289
|
|
- // 编辑
|
|
290
|
|
- editOrderType(this.ruleForm).then(response => {
|
|
291
|
|
- this.loading = false
|
|
292
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
293
|
|
- this.$parent.$layer.close(this.layerid)
|
|
294
|
|
- if (this.orderGrade === 1) {
|
|
295
|
|
- this.$parent.getList() // 重新加载父级数据
|
|
296
|
|
- } else if (this.orderGrade >= 2) {
|
|
297
|
|
- this.$parent.getTreeList()
|
|
|
302
|
+ })
|
|
|
303
|
+ },
|
|
|
304
|
+ resetForm() {
|
|
|
305
|
+ this.$refs.ruleForm.resetFields()
|
|
|
306
|
+ },
|
|
|
307
|
+ // 获取角色详情
|
|
|
308
|
+ getDetail(rid) {
|
|
|
309
|
+ getOrderType(rid).then(response => {
|
|
|
310
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
311
|
+ const res = response.data
|
|
|
312
|
+ const parTypeText = this.$store.getters.workTypeMap[parseInt(res.fid)].text
|
|
|
313
|
+ this.ruleForm.F_ParentID = res.fid // 父id
|
|
|
314
|
+ this.parentTexts = parTypeText || '暂无'
|
|
|
315
|
+ this.ruleForm.F_Name = res.name // 角色名称
|
|
|
316
|
+ this.ruleForm.F_Remark = res.remark // 角色编号
|
|
|
317
|
+ this.ruleForm.F_Sort = res.sort // 备注
|
|
|
318
|
+ this.ruleForm.F_TypeId = res.tid
|
|
|
319
|
+ this.ruleForm.F_TimeOut = res.cstime
|
|
|
320
|
+ this.ruleForm.F_RepairTimeLimit = res.fxtime
|
|
|
321
|
+ this.ruleForm.F_Identification = res.identification
|
|
|
322
|
+ this.ruleForm.F_CanReplayCount = res.canreplaycount
|
|
|
323
|
+ this.ruleForm.F_CanUrgeCount = res.canurgecount
|
|
|
324
|
+ this.ruleForm.F_AutoTransfer = !res.autotransfer ? '0' : '1';
|
|
|
325
|
+ if (res.autodept && JSON.parse(res.autodept)[0].autoyq) {
|
|
|
326
|
+ this.autolist = JSON.parse(res.autodept)
|
|
|
327
|
+ console.log(JSON.parse(res.autodept))
|
|
|
328
|
+ for (var i = 0; i < this.autolist.length; i++) {
|
|
|
329
|
+ this.getRepairman(this.autolist[i].autodept, i)
|
|
|
330
|
+ this.autolist[i].autousercode = this.autolist[i].autousercode
|
|
298
|
331
|
}
|
|
299
|
|
- this.$message.success('恭喜你,编辑成功!')
|
|
300
|
|
- this.$parent.getList()
|
|
301
|
|
- }
|
|
302
|
|
- }).catch(() => {
|
|
303
|
|
- this.loading = false
|
|
304
|
|
- })
|
|
305
|
|
- } else {
|
|
306
|
|
- this.$message.error('请输入有效的必填项信息!')
|
|
307
|
|
- return false
|
|
308
|
|
- }
|
|
309
|
|
- })
|
|
310
|
|
- },
|
|
311
|
|
- resetForm() {
|
|
312
|
|
- this.$refs.ruleForm.resetFields()
|
|
313
|
|
- },
|
|
314
|
|
- // 获取角色详情
|
|
315
|
|
- getDetail(rid) {
|
|
316
|
|
- getOrderType(rid).then(response => {
|
|
317
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
318
|
|
- const res = response.data
|
|
319
|
|
- const parTypeText = this.$store.getters.workTypeMap[parseInt(res.fid)].text
|
|
320
|
|
- this.ruleForm.F_ParentID = res.fid // 父id
|
|
321
|
|
- this.parentTexts = parTypeText || '暂无'
|
|
322
|
|
- this.ruleForm.F_Name = res.name // 角色名称
|
|
323
|
|
- this.ruleForm.F_Remark = res.remark // 角色编号
|
|
324
|
|
- this.ruleForm.F_Sort = res.sort // 备注
|
|
325
|
|
- this.ruleForm.F_TypeId = res.tid
|
|
326
|
|
- this.ruleForm.F_TimeOut = res.cstime
|
|
327
|
|
- this.ruleForm.F_RepairTimeLimit = res.fxtime
|
|
328
|
|
- this.ruleForm.F_Identification = res.identification
|
|
329
|
|
- this.ruleForm.F_CanReplayCount = res.canreplaycount
|
|
330
|
|
- this.ruleForm.F_CanUrgeCount = res.canurgecount
|
|
331
|
|
- this.ruleForm.F_AutoTransfer = !res.autotransfer ? '0' : '1';
|
|
332
|
|
- if (res.autodept && JSON.parse(res.autodept)[0].autoyq) {
|
|
333
|
|
- this.autolist = JSON.parse(res.autodept)
|
|
334
|
|
- console.log(JSON.parse(res.autodept))
|
|
335
|
|
- for (var i = 0; i < this.autolist.length; i++) {
|
|
336
|
|
- this.getRepairman(this.autolist[i].autodept, i)
|
|
337
|
|
- this.autolist[i].autousercode = this.autolist[i].autousercode
|
|
338
|
332
|
}
|
|
339
|
333
|
}
|
|
340
|
|
- }
|
|
341
|
|
- })
|
|
342
|
|
- },
|
|
343
|
|
- getDeptid(data) {
|
|
344
|
|
- // this.ruleForm.F_AutoDept = data[data.length - 1]
|
|
|
334
|
+ })
|
|
|
335
|
+ },
|
|
|
336
|
+ getDeptid(data) {
|
|
|
337
|
+ // this.ruleForm.F_AutoDept = data[data.length - 1]
|
|
|
338
|
+ }
|
|
345
|
339
|
}
|
|
346
|
340
|
}
|
|
347
|
|
-}
|
|
348
|
341
|
</script>
|
|
349
|
342
|
|
|
350
|
343
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
351
|
344
|
|
|
352
|
|
-</style>
|
|
|
345
|
+</style>
|