|
@@ -13,10 +13,15 @@
|
|
|
<el-form :model="state.ruleForm" label-width="90px" ref="ruleFormRef">
|
|
|
<el-row :gutter="35">
|
|
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <el-form-item label="撤销说明" class="textarea" prop="opinion" :rules="[{ required: true, message: '请填写撤销说明', trigger: 'blur' }]">
|
|
|
+ <el-form-item
|
|
|
+ label="撤销说明"
|
|
|
+ class="textarea"
|
|
|
+ prop="revocationReason"
|
|
|
+ :rules="[{ required: true, message: '请填写撤销说明', trigger: 'blur' }]"
|
|
|
+ >
|
|
|
<common-advice
|
|
|
@chooseAdvice="chooseAdvice"
|
|
|
- v-model="state.ruleForm.opinion"
|
|
|
+ v-model="state.ruleForm.revocationReason"
|
|
|
placeholder="请填写撤销说明"
|
|
|
:loading="state.loading"
|
|
|
:commonEnum="commonEnum.OrderCirculation"
|
|
@@ -24,8 +29,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
|
|
|
- <el-form-item label="" prop="acceptSms" :rules="[{ required: false, message: '请选择发送撤销短信', trigger: 'change' }]">
|
|
|
- <el-checkbox v-model="state.ruleForm.acceptSms" label="发送撤销短信" />
|
|
|
+ <el-form-item label="" prop="isSendSms" :rules="[{ required: false, message: '请选择发送撤销短信', trigger: 'change' }]">
|
|
|
+ <el-checkbox v-model="state.ruleForm.isSendSms" label="发送撤销短信" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -41,9 +46,10 @@
|
|
|
|
|
|
<script setup lang="ts" name="orderRevokeDialog">
|
|
|
import { reactive, ref, defineAsyncComponent } from 'vue';
|
|
|
-import { ElMessageBox, FormInstance } from 'element-plus';
|
|
|
+import { ElMessageBox, ElNotification, FormInstance } from 'element-plus';
|
|
|
import { throttle } from '@/utils/tools';
|
|
|
import { commonEnum } from '@/utils/constants';
|
|
|
+import { orderRevoke } from '@/api/business/order';
|
|
|
|
|
|
// 引入组件
|
|
|
const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
|
|
@@ -54,20 +60,18 @@ const emit = defineEmits(['updateList']);
|
|
|
const state = reactive<any>({
|
|
|
dialogVisible: false,
|
|
|
ruleForm: {
|
|
|
- opinion: '', // 撤销原因
|
|
|
- acceptSms: false, // 是否发送短信
|
|
|
- workflowId: '', // 流程id
|
|
|
+ revocationReason: '', // 撤销原因
|
|
|
+ isSendSms: false, // 是否发送短信
|
|
|
},
|
|
|
orderDetail: {}, // 工单详情
|
|
|
loading: false, // 提交按钮loading
|
|
|
transform: 'translate(0px, 0px)', // 滚动条位置
|
|
|
});
|
|
|
const ruleFormRef = ref<RefType>();
|
|
|
+const ids = ref<EmptyArrayType>([]);
|
|
|
// 打开弹窗
|
|
|
const openDialog = async (val: any) => {
|
|
|
- // state.orderDetail = val;
|
|
|
- // state.ruleForm.workflowId = val.workflowId;
|
|
|
- console.log(val,'111')
|
|
|
+ ids.value = val;
|
|
|
state.dialogVisible = true;
|
|
|
state.loading = false;
|
|
|
};
|
|
@@ -81,7 +85,7 @@ const close = () => {
|
|
|
};
|
|
|
// 选中常用意见
|
|
|
const chooseAdvice = (item: any) => {
|
|
|
- state.ruleForm.opinion += item.content;
|
|
|
+ state.ruleForm.revocationReason += item.content;
|
|
|
};
|
|
|
// 设置抽屉
|
|
|
const dialogRef = ref<RefType>();
|
|
@@ -89,7 +93,6 @@ const mouseup = () => {
|
|
|
state.transform = dialogRef.value.dialogContentRef.$el.style.transform;
|
|
|
};
|
|
|
// 提交
|
|
|
-const annexListRef = ref<RefType>(); // 附件列表
|
|
|
const onSubmit = throttle((formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
|
formEl.validate((valid: boolean) => {
|
|
@@ -106,10 +109,15 @@ const onSubmit = throttle((formEl: FormInstance | undefined) => {
|
|
|
state.loading = true;
|
|
|
const request = {
|
|
|
...state.ruleForm,
|
|
|
- files: annexListRef.value?.fileList,
|
|
|
+ ids: ids.value,
|
|
|
};
|
|
|
- /*workflowCancel(request)
|
|
|
- .then(() => {
|
|
|
+ orderRevoke(request)
|
|
|
+ .then((res: any) => {
|
|
|
+ ElNotification({
|
|
|
+ title: '撤销完成',
|
|
|
+ message: `添加撤销成功${res.result.successNum}条,失败${res.result.errorNum}条`,
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
state.loading = false;
|
|
|
state.dialogVisible = false;
|
|
|
emit('updateList');
|
|
@@ -117,7 +125,7 @@ const onSubmit = throttle((formEl: FormInstance | undefined) => {
|
|
|
.catch(() => {
|
|
|
state.loading = false;
|
|
|
state.dialogVisible = false;
|
|
|
- });*/
|
|
|
+ });
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
});
|
|
@@ -128,4 +136,3 @@ defineExpose({
|
|
|
closeDialog,
|
|
|
});
|
|
|
</script>
|
|
|
-<style lang="scss" scoped></style>
|