|
|
@@ -3,7 +3,7 @@
|
|
3
|
3
|
|
|
4
|
4
|
<el-form-item label="工单类别" prop="workordercate">
|
|
5
|
5
|
<el-cascader v-model="form.workordercate" :props="{ value: 'id', }" placeholder="请选择工单类型"
|
|
6
|
|
- :options="childrenTypes" filterable />
|
|
|
6
|
+ :options="childrenTypes" filterable @change="changeType"/>
|
|
7
|
7
|
</el-form-item>
|
|
8
|
8
|
<el-form-item label="责任科室" prop="complaintdept">
|
|
9
|
9
|
<el-tree-select style="width: 100%" v-model="form.complaintdept" filterable :data="deptData" check-strictly
|
|
|
@@ -12,15 +12,14 @@
|
|
12
|
12
|
</el-form-item>
|
|
13
|
13
|
<el-form-item label="责任人" prop="complaintuser">
|
|
14
|
14
|
<el-select v-model="form.complaintuser" filterable placeholder="请选择责任人" style="width: 214px;">
|
|
15
|
|
- <el-option v-for="item in userData" :key="item.userName" :label="item.nickName"
|
|
16
|
|
- :value="item.userName" />
|
|
|
15
|
+ <el-option v-for="item in userData" :key="item.userName" :label="item.nickName" :value="item.userName" />
|
|
17
|
16
|
</el-select>
|
|
18
|
17
|
</el-form-item>
|
|
19
|
|
- <el-form-item label="患者姓名" prop="caller">
|
|
20
|
|
- <el-input v-model="form.caller" placeholder="请输入患者姓名" />
|
|
|
18
|
+ <el-form-item :label="callerName" prop="caller">
|
|
|
19
|
+ <el-input v-model="form.caller" placeholder="请输入姓名" />
|
|
21
|
20
|
</el-form-item>
|
|
22
|
|
- <el-form-item label="患者电话" prop="callnum">
|
|
23
|
|
- <el-input v-model="form.callnum" placeholder="请输入患者电话" />
|
|
|
21
|
+ <el-form-item :label="callerPhone" prop="callnum">
|
|
|
22
|
+ <el-input v-model="form.callnum" placeholder="请输入电话" />
|
|
24
|
23
|
</el-form-item>
|
|
25
|
24
|
<el-form-item label="内容" prop="content">
|
|
26
|
25
|
<!-- complaintdept -->
|
|
|
@@ -63,8 +62,8 @@
|
|
63
|
62
|
</div>
|
|
64
|
63
|
</template>
|
|
65
|
64
|
|
|
66
|
|
-<script lang="ts" setup>
|
|
67
|
|
-import { reactive, ref, toRaw } from 'vue'
|
|
|
65
|
+<script setup>
|
|
|
66
|
+import { reactive, ref, toRaw, computed, watch, onMounted } from 'vue'
|
|
68
|
67
|
import useSelectStore from '@/store/commonSelect/common';
|
|
69
|
68
|
import { createPageData, editPageData, getPageListData } from '@/api/main/system/system';
|
|
70
|
69
|
import { getUnprefixNuber } from '@/utils';
|
|
|
@@ -74,6 +73,9 @@ import moment from 'moment';
|
|
74
|
73
|
import { initDb } from '@/utils/indexdb'
|
|
75
|
74
|
import { getInstance } from "@michaelray/indexdb";
|
|
76
|
75
|
|
|
|
76
|
+
|
|
|
77
|
+const callerName = ref('患者姓名')
|
|
|
78
|
+const callerPhone = ref('患者电话')
|
|
77
|
79
|
const childrenTypes = ref([]);
|
|
78
|
80
|
const deptData = ref([])
|
|
79
|
81
|
const userData = ref([])
|
|
|
@@ -97,11 +99,13 @@ watch(props, (nweProps) => {
|
|
97
|
99
|
onMounted(() => {
|
|
98
|
100
|
initMethod(props)
|
|
99
|
101
|
});
|
|
|
102
|
+
|
|
100
|
103
|
const stageState = computed(() => {
|
|
101
|
104
|
return useSocketStore().stageState
|
|
102
|
105
|
})
|
|
103
|
106
|
const stageFlag = ref(true)
|
|
104
|
107
|
function initMethod(props) {
|
|
|
108
|
+ userData.value = useSelectStore().userData;
|
|
105
|
109
|
if (props.orderInfo && props.orderInfo.type) {
|
|
106
|
110
|
getOrderType(props.orderInfo.type)
|
|
107
|
111
|
}
|
|
|
@@ -178,26 +182,40 @@ async function customerDetail(customerno) {
|
|
178
|
182
|
form.value.caller = resultData.data.name
|
|
179
|
183
|
}
|
|
180
|
184
|
}
|
|
|
185
|
+const changeType = (val) => {
|
|
|
186
|
+ console.log(val, 'changeType')
|
|
|
187
|
+ if (val.length && (val.indexOf(5010)!== -1)) {
|
|
|
188
|
+ callerName.value = '投诉人姓名'
|
|
|
189
|
+ callerPhone.value = '投诉人电话'
|
|
|
190
|
+ } else if(val.length && val.indexOf(4006)!== -1) {
|
|
|
191
|
+ callerName.value = '建议人姓名'
|
|
|
192
|
+ callerPhone.value = '建议人电话'
|
|
|
193
|
+ } else {
|
|
|
194
|
+ callerName.value = '患者姓名'
|
|
|
195
|
+ callerPhone.value = '患者电话'
|
|
|
196
|
+
|
|
|
197
|
+ }
|
|
|
198
|
+}
|
|
181
|
199
|
function deptChange(val) {
|
|
182
|
200
|
let deptId
|
|
183
|
201
|
if (val) {
|
|
184
|
202
|
deptId = val
|
|
185
|
|
- getUserList(deptId)
|
|
|
203
|
+ // getUserList(deptId)
|
|
186
|
204
|
} else {
|
|
187
|
205
|
deptId = ''
|
|
188
|
206
|
}
|
|
189
|
207
|
|
|
190
|
208
|
}
|
|
191
|
209
|
|
|
192
|
|
-function getUserList(deptId = 0) {
|
|
193
|
|
- const params = { deptId }
|
|
194
|
|
- getPageListData('/common/user', params).then((res) => {
|
|
195
|
|
- userData.value = res.data
|
|
196
|
|
- form.value.complaintuser = props.orderInfo.complaintuser
|
|
197
|
|
- })
|
|
198
|
|
-}
|
|
|
210
|
+// function getUserList(deptId = 0) {
|
|
|
211
|
+// const params = { deptId }
|
|
|
212
|
+// getPageListData('/common/user', params).then((res) => {
|
|
|
213
|
+// userData.value = res.data
|
|
|
214
|
+// form.value.complaintuser = props.orderInfo.complaintuser
|
|
|
215
|
+// })
|
|
|
216
|
+// }
|
|
199
|
217
|
// do not use same name with ref
|
|
200
|
|
-const form: any = ref({
|
|
|
218
|
+const form = ref({
|
|
201
|
219
|
firsttype: 1000,
|
|
202
|
220
|
workordercate: [], // 工单类型
|
|
203
|
221
|
callnum: '', // 患者电话
|
|
|
@@ -261,7 +279,7 @@ const onSubmit = (formEl) => {
|
|
261
|
279
|
formEl.validate((valid, fields) => {
|
|
262
|
280
|
if (valid) {
|
|
263
|
281
|
|
|
264
|
|
- const params: any = {
|
|
|
282
|
+ const params = {
|
|
265
|
283
|
...form.value,
|
|
266
|
284
|
};
|
|
267
|
285
|
|
|
|
@@ -312,10 +330,10 @@ function resetForm() {
|
|
312
|
330
|
orderRef.value.resetFields()
|
|
313
|
331
|
}
|
|
314
|
332
|
|
|
315
|
|
-const dealUsers: any = ref([]);
|
|
|
333
|
+const dealUsers = ref([]);
|
|
316
|
334
|
const dealDeptChange = async (val) => {
|
|
317
|
335
|
|
|
318
|
|
- const users = userData.value.filter((o: any) => {
|
|
|
336
|
+ const users = userData.value.filter((o) => {
|
|
319
|
337
|
return o.deptId === val;
|
|
320
|
338
|
});
|
|
321
|
339
|
if (users && users.length > 0) {
|