middleground_H5/pages/logsError/show.vue

310 lines
7.5 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="taskContent">
<u--form
:model="model"
ref="uForm"
:labelAlign="'left'"
:labelStyle="{ fontSize: '28rpx' }"
labelPosition="top"
:style="{ marginTop: tarbarHeight }"
class="formBox"
>
<u-form-item
label="发送者应用"
prop="sendAppName"
ref="item1"
required
:borderBottom="true"
:labelWidth="'180rpx'"
>
<uni-easyinput
v-model="model.sendAppName"
:disabled="true"
:inputBorder="false"
:styles="{ disableColor: '#ffffff' }"
></uni-easyinput>
</u-form-item>
<u-form-item
label="接口名称"
prop="apiName"
ref="item1"
required
:borderBottom="true"
:labelWidth="'180rpx'"
>
<uni-easyinput
v-model="model.apiName"
:inputBorder="false"
:disabled="true"
:styles="{ disableColor: '#ffffff' }"
></uni-easyinput>
</u-form-item>
<u-form-item
label="源数据"
prop="sourceData"
ref="item1"
required
:borderBottom="true"
:labelWidth="'180rpx'"
>
<uni-easyinput
v-model="model.sourceData"
type="textarea"
autoHeight
:disabled="true"
:inputBorder="false"
:maxlength="-1"
:styles="{ disableColor: '#ffffff', paddingLeft: '10px' }"
></uni-easyinput>
</u-form-item>
<u-form-item
label="目标数据"
prop="targetData"
ref="item1"
required
:borderBottom="true"
:labelWidth="'180rpx'"
>
<uni-easyinput
v-model="model.targetData"
type="textarea"
autoHeight
:styles="{ disableColor: '#ffffff', paddingLeft: '10px' }"
:inputBorder="false"
:maxlength="-1"
:disabled="true"
></uni-easyinput>
</u-form-item>
<u-form-item
label="状态"
prop="status"
ref="item1"
:borderBottom="true"
:labelWidth="'180rpx'"
>
<u--text :lines="1" :text="textData(model.status)" :size="14" style="padding-left:10px;"></u--text>
<!-- <uni-easyinput
v-model="model.status"
:disabled="true"
:inputBorder="false"
:styles="{ disableColor: '#ffffff' }"
></uni-easyinput> -->
</u-form-item>
<u-form-item
label="错误状态"
prop="errorStatus"
ref="item1"
:borderBottom="true"
:labelWidth="'180rpx'"
:disabled="true"
>
<uni-easyinput
v-model="
model.errorStatus === '1' ? '需要重新发送' : '不需要重新发送'
"
:disabled="true"
:inputBorder="false"
:styles="{ disableColor: '#ffffff' }"
></uni-easyinput>
</u-form-item>
<u-form-item
label="返回信息"
prop="returnData"
ref="item1"
required
:borderBottom="true"
:labelWidth="'180rpx'"
:disabled="true"
>
<uni-easyinput
v-model="model.returnData"
type="textarea"
autoHeight
:inputBorder="false"
:disabled="true"
:styles="{ disableColor: '#ffffff' }"
></uni-easyinput>
</u-form-item>
</u--form>
<base-tarbar ref="baseTarbar" pageTitle="查看异常日志"></base-tarbar>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script>
import { authApi } from "@/api/login";
import baseTarbar from "@/components/baseTarbar/index.vue";
export default {
onLoad: function (option) {
//option为object类型会序列化上个页面传递的参数
if (Object.getOwnPropertyNames(option).length != 0) {
this.billID = option.billid;
}
},
components: {
baseTarbar,
},
data() {
return {
billID: "",
tarbarHeight: "0",
radiolist: [
{ id: "1", label: "待发送" },
{ id: "2", label: "发送中" },
{ id: "3", label: "发送成功" },
{ id: "4", label: "发送失败" },
],
errorRadiolist: [
{ id: "1", label: "需要重新发送" },
{ id: "2", label: "不需要重新发送" },
],
model: {},
};
},
computed: {
textData() {
return (item) => {
if (item == "1") {
return "待发送";
} else if (item == "2") {
return "发送中";
} else if (item == "3") {
return "发送成功";
} else if (item == "4") {
return "发送失败";
} else {
return null;
}
};
},
},
onReady() {
this.$refs.baseTarbar.currentEnvironment();
if (this.$refs.baseTarbar.isOther) {
this.tarbarHeight = "84rpx";
}
},
created() {
this.init();
},
methods: {
init() {
this.messageLogGetById(this.billID);
},
// 编辑详情
async messageLogGetById(id, row) {
let params = {
id: id,
// status: row.status,
};
let res = await authApi(
"sysMessageManageLogService",
"messageManage",
"thirdInterfacequeryEntity",
"",
params
);
if (res.status == "200") {
let res2 = await authApi(
"sysApplicationApiService",
"application",
"queryEntity",
"",
{ apiCode: res.attribute.receiveCode }
);
if (res2.status == "200") {
this.$set(res.attribute, "apiName", res2.attribute[0].apiName);
} else {
this.$set(res.attribute, "apiName", "未配置该接口");
}
this.$nextTick(() => {
this.model = {
...res.attribute,
};
});
}
},
async signSuccess() {
let params = {
id: this.billID,
status: "3",
};
let res = await authApi(
"sysMessageManageLogService",
"messageManage",
"updateEntity",
"",
params
);
if (res.status == "200") {
this.$vmNews("标记成功", "success");
this.$refs.uToast.show({
type: "success",
message: "标记成功",
});
setTimeout(() => {
uni.navigateBack();
}, 500);
}
},
async resend() {
let formData = new FormData();
formData.append("id", this.billID);
formData.append("sourceData", this.model.sourceData);
let res = await request({
url: "kangarooDataCenterV3/entranceController/externalCallInterfaceResend",
method: "post",
data: formData,
});
if (res.status == "200") {
this.handleDialogClose();
if (res.msg == "重推成功") {
this.$refs.uToast.show({
type: "success",
message: res.msg,
});
}
if (res.msg == "重推失败") {
this.$refs.uToast.show({
type: "error",
message: res.msg,
});
}
setTimeout(() => {
uni.navigateBack();
}, 500);
}
},
},
};
</script>
<style scoped>
.bottomPage {
width: 100%;
position: fixed;
bottom: 0;
padding: 20rpx 30rpx 30rpx 30rpx;
background-color: #fff;
margin-top: 15rpx;
display: flex;
border-top: 8rpx solid #f1f1f1;
}
.formBox {
padding: 10px 10px 100px 10px;
}
::v-deep .uni-easyinput__content-textarea {
padding-left: 10px !important;
}
::v-deep .uni-easyinput__content.is-disabled {
color: #333333 !important;
}
page {
height: 100vh;
background: #fff;
}
</style>