operateList.js
6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
"use strict";
const common_vendor = require("../common/vendor.js");
const api_work = require("../api/work.js");
if (!Array) {
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
(_easycom_up_textarea2 + _easycom_up_modal2 + _easycom_up_input2 + _easycom_up_radio2 + _easycom_up_radio_group2)();
}
const _easycom_up_textarea = () => "../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_modal = () => "../uni_modules/uview-plus/components/u-modal/u-modal.js";
const _easycom_up_input = () => "../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_radio = () => "../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_up_radio_group = () => "../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
if (!Math) {
(_easycom_up_textarea + _easycom_up_modal + _easycom_up_input + _easycom_up_radio + _easycom_up_radio_group)();
}
const _sfc_main = {
__name: "operateList",
props: {
carInfo: {
type: Object,
require: true
}
},
emits: ["refreshList"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const deptOptions = common_vendor.ref([]);
const companyQueryParams = common_vendor.reactive({
deptName: void 0,
status: void 0
});
const deptId = common_vendor.ref(0);
const current = common_vendor.ref(9);
const showDefeat = common_vendor.ref(false);
const DefeatContent = common_vendor.ref("");
const showCompany = common_vendor.ref(false);
const handleSuccess = () => {
current.value = 0;
common_vendor.index.showModal({
title: "提示",
content: "是否通过",
success: function(res) {
if (res.confirm) {
api_work.disposeUser({ associationapprove: "0" }, props.carInfo.taskId).then((res2) => {
common_vendor.index.$u.toast("保单已通过");
emit("refreshList");
});
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
};
const handleReturn = () => {
current.value = 1;
common_vendor.index.showModal({
title: "提示",
content: "是否退回",
success: function(res) {
if (res.confirm) {
api_work.disposeUser({ associationapprove: "1" }, props.carInfo.taskId).then((res2) => {
common_vendor.index.$u.toast("保单已退回");
emit("refreshList");
});
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
};
const handleInvalid = () => {
current.value = 2;
showDefeat.value = true;
};
const handleUpdate = () => {
current.value = 3;
const id = props.carInfo.businessKey;
common_vendor.index.navigateTo({
url: `/pages/carDetail/carDetail?carInfoId=${id}&roleId=1`
});
};
const handleCirculation = () => {
current.value = 4;
getDeptList();
showCompany.value = true;
};
const getDeptList = () => {
api_work.listDept(companyQueryParams).then((response) => {
deptOptions.value = response.data.filter((item) => item.parentId === 100);
});
};
const sunmitDeprecated = () => {
const data = {
associationapprove: "2",
comment: DefeatContent.value
};
const taskId = props.carInfo.taskId;
api_work.disposeUser(data, taskId).then((res) => {
emit("refreshList");
common_vendor.index.$u.toast("保单已作废");
showDefeat.value = false;
});
};
const submitForm = () => {
const data = {
associationapprove: "0",
deptid: deptId.value.toString()
};
const taskId = props.carInfo.taskId;
api_work.disposeUser(data, taskId).then((res) => {
showCompany.value = false;
emit("refreshList");
common_vendor.index.$u.toast("保单已分配成功");
});
};
return (_ctx, _cache) => {
return {
a: current.value === 0 ? 1 : "",
b: common_vendor.o(handleSuccess),
c: current.value === 1 ? 1 : "",
d: common_vendor.o(handleReturn),
e: current.value === 2 ? 1 : "",
f: common_vendor.o(handleInvalid),
g: current.value === 3 ? 1 : "",
h: common_vendor.o(handleUpdate),
i: current.value === 4 ? 1 : "",
j: common_vendor.o(handleCirculation),
k: common_vendor.o(($event) => DefeatContent.value = $event),
l: common_vendor.p({
placeholder: "请输入内容",
modelValue: DefeatContent.value
}),
m: common_vendor.o(sunmitDeprecated),
n: common_vendor.o(($event) => showDefeat.value = false),
o: common_vendor.p({
show: showDefeat.value,
showCancelButton: true,
title: "填写作废回馈"
}),
p: common_vendor.o(($event) => companyQueryParams.deptName = $event),
q: common_vendor.p({
placeholder: "请输入承保公司名称",
prefixIcon: "search",
modelValue: companyQueryParams.deptName
}),
r: common_vendor.o(getDeptList),
s: common_vendor.f(deptOptions.value, (item, index, i0) => {
return {
a: index,
b: "3d588709-5-" + i0 + ",3d588709-4",
c: common_vendor.p({
label: item.deptName,
name: item.deptId
})
};
}),
t: common_vendor.o(($event) => deptId.value = $event),
v: common_vendor.p({
placement: "column",
modelValue: deptId.value
}),
w: common_vendor.o(submitForm),
x: common_vendor.o(($event) => showCompany.value = false),
y: common_vendor.o(($event) => showCompany.value = false),
z: common_vendor.p({
show: showCompany.value,
showCancelButton: true,
closeOnClickOverlay: true,
title: "选择分配项"
})
};
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3d588709"]]);
wx.createComponent(Component);