apm意见反馈详情权限
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
47dd21ea7e
commit
3bb0250699
|
@ -52,7 +52,7 @@
|
|||
class="el-icon-warning-outline"
|
||||
style="color: #f56c6c; font-size: 24px"
|
||||
></i>
|
||||
<span>{{ $t("feedBack:imgfail:tip") }}</span>
|
||||
<span>{{ $t('feedBack:imgfail:tip') }}</span>
|
||||
</p>
|
||||
<!-- 问题反馈 -->
|
||||
<el-form-item
|
||||
|
@ -140,7 +140,7 @@
|
|||
<div slot="footer" v-if="type !== 'detail' || isImgfail">
|
||||
<!-- 取消 -->
|
||||
<el-button size="small" @click.stop="cancel">
|
||||
{{ $t("feedBack:button:cancel") }}
|
||||
{{ $t('feedBack:button:cancel') }}
|
||||
</el-button>
|
||||
<!-- 保存 -->
|
||||
<el-button
|
||||
|
@ -149,21 +149,21 @@
|
|||
@click.stop="save"
|
||||
:loading="loading"
|
||||
>
|
||||
{{ $t("feedBack:button:save") }}
|
||||
{{ $t('feedBack:button:save') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import uploadImage from "./uploadImage.vue";
|
||||
import uploadImage from './uploadImage.vue'
|
||||
import {
|
||||
addOrUpdateUserFeedBack,
|
||||
getUserFeedBackInfo,
|
||||
batchUpdateFeedBackState,
|
||||
} from "@/api/trials.js";
|
||||
} from '@/api/trials.js'
|
||||
export default {
|
||||
name: "FB",
|
||||
name: 'FB',
|
||||
components: { uploadImage },
|
||||
data() {
|
||||
return {
|
||||
|
@ -195,131 +195,131 @@ export default {
|
|||
QuestionType: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
QuestionDescription: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value.length < 5) {
|
||||
callback(
|
||||
new Error(this.$t("feedBack:ruleMessage:lengthLimitMin5"))
|
||||
);
|
||||
new Error(this.$t('feedBack:ruleMessage:lengthLimitMin5'))
|
||||
)
|
||||
}
|
||||
callback();
|
||||
callback()
|
||||
},
|
||||
trigger: "blur",
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
isUpload: false,
|
||||
};
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
level() {
|
||||
if (this.hasPermi(["role:dev", "role:admin"])) {
|
||||
return 9;
|
||||
if (this.hasPermi(['role:dev', 'role:admin'])) {
|
||||
return 9
|
||||
}
|
||||
if (this.hasPermi(["role:pm"])) {
|
||||
return 8;
|
||||
if (this.hasPermi(['role:pm', 'role:apm'])) {
|
||||
return 8
|
||||
}
|
||||
if (this.hasPermi(["role:ir", "role:crc"])) {
|
||||
return 7;
|
||||
if (this.hasPermi(['role:ir', 'role:crc'])) {
|
||||
return 7
|
||||
}
|
||||
return 0;
|
||||
return 0
|
||||
},
|
||||
QuestionTypeOptions() {
|
||||
if (this.level > 7) {
|
||||
return [
|
||||
...this.$d.FeedBackTypeToCRC.filter((item) => item.value > 0),
|
||||
...this.$d.FeedBackTypeToIR,
|
||||
];
|
||||
]
|
||||
}
|
||||
if (this.hasPermi(["role:ir"])) {
|
||||
return this.$d.FeedBackTypeToIR;
|
||||
if (this.hasPermi(['role:ir'])) {
|
||||
return this.$d.FeedBackTypeToIR
|
||||
}
|
||||
if (this.hasPermi(["role:crc"])) {
|
||||
return this.$d.FeedBackTypeToCRC;
|
||||
if (this.hasPermi(['role:crc'])) {
|
||||
return this.$d.FeedBackTypeToCRC
|
||||
}
|
||||
return [];
|
||||
return []
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
open(data) {
|
||||
let { type, trialId, Id, visitTaskId, SubjectVisitId } = data;
|
||||
this.type = type;
|
||||
this.trialId = trialId;
|
||||
this.Id = Id;
|
||||
this.visitTaskId = visitTaskId;
|
||||
this.SubjectVisitId = SubjectVisitId;
|
||||
let { type, trialId, Id, visitTaskId, SubjectVisitId } = data
|
||||
this.type = type
|
||||
this.trialId = trialId
|
||||
this.Id = Id
|
||||
this.visitTaskId = visitTaskId
|
||||
this.SubjectVisitId = SubjectVisitId
|
||||
if (visitTaskId) {
|
||||
this.isImgfail = true;
|
||||
this.isImgfail = true
|
||||
}
|
||||
this.setTypeOption();
|
||||
this.setTypeOption()
|
||||
if (!Id) {
|
||||
this.title = this.setTitle();
|
||||
this.title = this.setTitle()
|
||||
}
|
||||
if (Id || visitTaskId) {
|
||||
this.getInfo(Id, visitTaskId);
|
||||
this.getInfo(Id, visitTaskId)
|
||||
}
|
||||
this.visible = true;
|
||||
this.visible = true
|
||||
},
|
||||
cancel() {
|
||||
this.visible = false;
|
||||
this.$emit("closed");
|
||||
this.visible = false
|
||||
this.$emit('closed')
|
||||
},
|
||||
async save() {
|
||||
try {
|
||||
let validate = await this.$refs.feedBackForm.validate();
|
||||
if (!validate) return;
|
||||
let validate = await this.$refs.feedBackForm.validate()
|
||||
if (!validate) return
|
||||
if (this.trialId) {
|
||||
this.form.TrialId = this.trialId;
|
||||
this.form.TrialId = this.trialId
|
||||
}
|
||||
if (this.visitTaskId) {
|
||||
this.form.VisitTaskId = this.visitTaskId;
|
||||
this.form.VisitTaskId = this.visitTaskId
|
||||
}
|
||||
if (this.SubjectVisitId) {
|
||||
this.form.SubjectVisitId = this.SubjectVisitId;
|
||||
this.form.SubjectVisitId = this.SubjectVisitId
|
||||
}
|
||||
if (this.Id) {
|
||||
this.form.Id = this.Id;
|
||||
this.form.Id = this.Id
|
||||
}
|
||||
this.loading = true;
|
||||
let res = await addOrUpdateUserFeedBack(this.form);
|
||||
this.loading = false;
|
||||
this.loading = true
|
||||
let res = await addOrUpdateUserFeedBack(this.form)
|
||||
this.loading = false
|
||||
if (res.IsSuccess) {
|
||||
this.$emit("success");
|
||||
this.$message.success(this.$t("feedBack:save:success"));
|
||||
this.cancel();
|
||||
this.$emit('success')
|
||||
this.$message.success(this.$t('feedBack:save:success'))
|
||||
this.cancel()
|
||||
}
|
||||
} catch (err) {
|
||||
this.loading = false;
|
||||
console.log(err);
|
||||
this.loading = false
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
// 修改状态
|
||||
async changeState() {
|
||||
if (this.isImgfail) return;
|
||||
if (this.isImgfail) return
|
||||
try {
|
||||
let data = {
|
||||
IdList: [this.Id],
|
||||
State: this.form.State,
|
||||
};
|
||||
let res = await batchUpdateFeedBackState(data);
|
||||
}
|
||||
let res = await batchUpdateFeedBackState(data)
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success(this.$t("feedBack:changeState:success"));
|
||||
this.$emit("success");
|
||||
this.$message.success(this.$t('feedBack:changeState:success'))
|
||||
this.$emit('success')
|
||||
// this.cancel();
|
||||
this.getInfo(this.Id, this.visitTaskId);
|
||||
this.getInfo(this.Id, this.visitTaskId)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
// 获取反馈详情
|
||||
|
@ -328,56 +328,56 @@ export default {
|
|||
let data = {
|
||||
Id,
|
||||
visitTaskId,
|
||||
};
|
||||
let res = await getUserFeedBackInfo(data);
|
||||
}
|
||||
let res = await getUserFeedBackInfo(data)
|
||||
if (res.IsSuccess && res.Result) {
|
||||
this.form = res.Result;
|
||||
this.form = res.Result
|
||||
this.form.ScreenshotList = this.form.ScreenshotList || []
|
||||
this.Id = res.Result.Id;
|
||||
this.Id = res.Result.Id
|
||||
if (res.Result.State > 0) {
|
||||
this.isStateChange = false;
|
||||
this.isStateChange = false
|
||||
}
|
||||
if (res.Result.VisitTaskId) {
|
||||
this.visitTaskId = res.Result.VisitTaskId;
|
||||
this.visitTaskId = res.Result.VisitTaskId
|
||||
}
|
||||
if (res.Result.SubjectVisitId) {
|
||||
this.SubjectVisitId = res.Result.SubjectVisitId;
|
||||
this.SubjectVisitId = res.Result.SubjectVisitId
|
||||
}
|
||||
let code = this.$fd("UserType", res.Result.UserTypeEnum);
|
||||
this.title = this.setTitle(code, res.Result.FeedBackFullName);
|
||||
let code = this.$fd('UserType', res.Result.UserTypeEnum)
|
||||
this.title = this.setTitle(code, res.Result.FeedBackFullName)
|
||||
if (visitTaskId) {
|
||||
code = `${res.Result.SubjectCode}-${res.Result.SubjectVisitName}`;
|
||||
this.title = this.setTitle(code, res.Result.FeedBackFullName);
|
||||
code = `${res.Result.SubjectCode}-${res.Result.SubjectVisitName}`
|
||||
this.title = this.setTitle(code, res.Result.FeedBackFullName)
|
||||
}
|
||||
this.$refs.uploadImage.initFileList(res.Result.ScreenshotList);
|
||||
this.$refs.uploadImage.initFileList(res.Result.ScreenshotList)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
setTypeOption() {
|
||||
if (!this.trialId) return (this.options = []);
|
||||
if (this.hasPermi(["role:ir"]))
|
||||
return (this.option = this.$d.FeedBackTypeToIR);
|
||||
if (this.hasPermi(["role:crc"]))
|
||||
return (this.option = this.$d.FeedBackTypeToCRC);
|
||||
if (!this.trialId) return (this.options = [])
|
||||
if (this.hasPermi(['role:ir']))
|
||||
return (this.option = this.$d.FeedBackTypeToIR)
|
||||
if (this.hasPermi(['role:crc']))
|
||||
return (this.option = this.$d.FeedBackTypeToCRC)
|
||||
},
|
||||
setTitle(code, name) {
|
||||
if (this.hasPermi(["role:pm"]) && this.visitTaskId) {
|
||||
return `${this.$t("feedBack:form:title:pm2")}(${code}/${name})`;
|
||||
if (this.hasPermi(['role:pm']) && this.visitTaskId) {
|
||||
return `${this.$t('feedBack:form:title:pm2')}(${code}/${name})`
|
||||
}
|
||||
if (this.hasPermi(["role:pm", "role:dev", "role:admin"])) {
|
||||
return `${this.$t("feedBack:form:title:pm")}(${code},${name})`;
|
||||
if (this.hasPermi(['role:pm', 'role:dev', 'role:admin'])) {
|
||||
return `${this.$t('feedBack:form:title:pm')}(${code},${name})`
|
||||
}
|
||||
if (this.hasPermi(["role:ir", "role:crc"]) && this.type === "detail") {
|
||||
return `${this.$t("feedBack:form:detail:title")}`;
|
||||
if (this.hasPermi(['role:ir', 'role:crc']) && this.type === 'detail') {
|
||||
return `${this.$t('feedBack:form:detail:title')}`
|
||||
}
|
||||
if (this.hasPermi(["role:ir", "role:crc"])) {
|
||||
return `${this.$t("feedBack:form:title")}`;
|
||||
if (this.hasPermi(['role:ir', 'role:crc'])) {
|
||||
return `${this.$t('feedBack:form:title')}`
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.tip {
|
||||
|
|
|
@ -136,7 +136,6 @@ export default {
|
|||
uid: `${name[name.length - 1]}${index}`,
|
||||
});
|
||||
});
|
||||
console.log(this.fileList);
|
||||
}
|
||||
},
|
||||
async uploadFile(param) {
|
||||
|
|
Loading…
Reference in New Issue