{
const AppealAttachmentImgSuccess = val => {
console.log(val, '申诉图片上传成功');
};
+
+// 取消申诉
+const CancelappealFn = val => {
+ let data = {
+ id: val.row.id, //取消申诉ID
+ typesOf: '3', //申诉状态
+ workOrderId:val.row.workOrderId,//异常工单ID
+ };
+
+ $_Cancelappeal(data).then(res => {
+ console.log(res, '取消申诉返回值');
+ if (res.data.code == 200) {
+ appealFn(details.query);
+ ElMessage({
+ message: '取消申诉成功',
+ type: 'success',
+ });
+ }
+ });
+};
+
// 工单申诉按钮
const appeal = (val, state) => {
+ AppealAttachment.value=[];//清空图片
+ Appealselection.value='';//清空责任人
+ Reasonforappeal.value='',//清空申诉内容
console.log(state);
console.log(val.row, '申诉当前点击的按钮');
if (state == 'edit') {
// 当前是编辑申诉
-
+
details.selectionList.push(val.row);
AppealeditorState.value = true; //开启申诉编辑状态
- if(val.row) {
- selectList.value.push(val.row)
+ if (val.row) {
+ selectList.value.push(val.row);
}
- let data={
- id:val.row.id,
- }
- $_AppealDetails(data).then(res=>{
- console.log(res,'申诉编辑回显');
- Reasonforappeal.value = res.data.data.reason;//申诉原因
- setTimeout(()=>{
- console.log(res.data.data.peopleEntityList.map(item=>item.actualPersonId));
- console.log(warehouseData.value,'仓库数据');
- // Appealselection.value=
- dialogappeal.value = true; //展开申诉编辑
- },0)
-
- })
+ let data = {
+ id: val.row.id,
+ };
+ $_AppealDetails(data).then(res => {
+ console.log(res, '申诉编辑回显');
+ Reasonforappeal.value = res.data.data.reason; //申诉原因
+ setTimeout(() => {
+ console.log(res.data.data.peopleEntityList.map(item => item.actualPersonId));
+ console.log(warehouseData.value, '仓库数据');
+ if(res.data.data.peopleEntityList){
+ Appealselection.value= res.data.data.peopleEntityList.map(item => item.actualPersonId)
+ }
+ if(res.data.data.imagePath){
+ AppealAttachment.value.push({
+ url:res.data.data.imagePath,
+ })
+ }
+ dialogappeal.value = true; //展开申诉编辑
+ }, 0);
+ });
return;
}
if (!state) {
// 单条申诉
AppealeditorState.value = false; //开启申诉编辑状态
- if(val.row){
+ if (val.row) {
details.selectionList.push(val.row);
}
-
dialogappeal.value = true; //展开申诉弹窗
} else {
// 批量申诉
@@ -1532,59 +1563,82 @@ const Appealbutton = state => {
peopleEntityList: [], //参数一
imagePath: '', //申诉图片附件
};
- data.workOrderId = details.selectionList[0].id;
+ if(AppealeditorState.value){
+ data.workOrderId = details.selectionList[0].workOrderId;
+ }else{
+ data.workOrderId = details.selectionList[0].id;
+ }
data.reason = Reasonforappeal.value;
data.appealPeopleName = warehouseData.value
.filter(item => Appealselection.value.includes(item.value))
.map(item => item.label)
.join(','); //实际责任人名称
//如果为编辑状态追加ID字段
- console.log(AppealeditorState.value,'申诉状态');
+ console.log(AppealeditorState.value, '申诉状态');
if (AppealeditorState.value) {
data.id = details.selectionList[0].id;
}
- console.log(details.selectionList,'准备处理的数据');
- details.selectionList.forEach(item => {
- console.log(item, '已经选择的列表');
+ console.log(details.selectionList, '准备处理的数据');
+ //处理数据
+ Appealselection.value.forEach(item => {
+ console.log(item,'循环的值');
data['peopleEntityList'].push({
- workOrderId: item.id, //异常工单ID
- warehouseId: item.warehouseId == '/' ? '' : item.warehouseId,
+ workOrderId: details.selectionList[0].id, //异常工单ID
reason: Reasonforappeal.value, //申诉理由
claimant: userInfo.value.content.user_name, //申诉人
- actualPersonId: warehouseData.value
- .filter(item => Appealselection.value.includes(item.value))
- .map(item => item.value)
- .join(','), //实际责任人ID
- actualPersonName: warehouseData.value
- .filter(item => Appealselection.value.includes(item.value))
- .map(item => item.label)
- .join(','), //实际责任人名称
+ actualPersonId: warehouseData.value.find(res => res.value == item).value, //实际责任人ID
+ actualPersonName: warehouseData.value.find(res=> res.value == item).label, //实际责任人名称
});
});
if (AppealAttachment.value.length) {
- data.imagePath = AppealAttachment.value[0].response.data.link; //申诉图片
+ console.log(AppealAttachment.value,'图片');
+ if(AppealAttachment.value[0].response){
+ data.imagePath = AppealAttachment.value[0].response.data.link; //申诉图片
+ }else{
+ data.imagePath = AppealAttachment.value[0].url; //申诉图片
+ }
}
-
console.log(data, '处理好的值');
+
$_appealSubmit(data).then(res => {
+ if (res.data.code == 200) {
+ ElMessage({
+ message: res.data.msg,
+ type: 'success',
+ });
+ }
+ }).finally(res=>{
dialogappeal.value = false; //关闭申诉弹窗
loadingappeal.value = false; //关闭加载效果
- console.log(res, '申诉成功返回值');
+ console.log(res, '功返回值');
ProcessingPartyState.value = false; //关闭处理方
- data.workOrderStatus = 30;
- details.query.workOrderStatus = 30;
ArbitrationStatus.value = false; //不可以申请仲裁
- tabValue.value = 2;
AppealeditorState.value = false; //关闭编辑状态
appealData.value = {}; //清空当前行申诉数据
+ if(AppealStatusT.value){
+ Tableheaderswitching(AppealList); //切换表头
+ AppealList.forEach(item => {
+ //清空搜索记录
+ item.values = '';
+ });
+ appealFn(); // 获取申诉列表
+ }else{
+
+ data.workOrderStatus = 30;
+ details.query.workOrderStatus = 30;
+ tabValue.value = 2;
empty(); //清空搜索数据
IndexTable({ workOrderStatus: 30 });
- if (res.data.code == 200) {
- ElMessage({
+ }
+
+
+
+
+
+ ElMessage({
message: res.data.msg,
type: 'success',
});
- }
});
};
@@ -1903,6 +1957,7 @@ const settlementclaim = val => {
};
// 获取申诉列表
const appealFn = val => {
+
details.loadingObj.list = true; //开启动画加载
AppealStatus.value = true; //开启申诉列表状态
TimeoutStatus.value = false; //关闭 超时状态
@@ -1932,6 +1987,7 @@ const appealFn = val => {
// 申诉列表
const AppealTab = val => {
+
if (val == 0) {
AppealStatusT.value = false; //申诉列表关闭
Tableheaderswitching(columnList); //切换表头
@@ -1945,8 +2001,11 @@ const AppealTab = val => {
};
IndexTable(data);
} else {
+
AppealStatusT.value = true; //申诉列表开启
console.log(val, '切换申诉列表');
+ data.workOrderStatus = '';
+ console.log( data.workOrderStatus,'当前搜索状态');
Tableheaderswitching(AppealList); //切换表头
AppealList.forEach(item => {
//清空搜索记录
@@ -1954,6 +2013,10 @@ const AppealTab = val => {
});
appealFn(); // 获取申诉列表
}
+
+ AppealAttachment.value=[];//清空图片
+ Appealselection.value='';//清空责任人
+ Reasonforappeal.value='';//清空申诉内容
};
// 超时金额修改
const BtnModifyAmount = val => {