Commit 8af81184 by yancanhua

fix:pc车俩检测编辑接口联调

1 parent 376e18e8
...@@ -112,4 +112,8 @@ export class DetectionController { ...@@ -112,4 +112,8 @@ export class DetectionController {
return axios.get('inspectionNode/' + params.id +'/children?taskId='+params.taskId); return axios.get('inspectionNode/' + params.id +'/children?taskId='+params.taskId);
} }
static inspectRecordSave(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/record/save', params);
}
} }
...@@ -11,11 +11,9 @@ ...@@ -11,11 +11,9 @@
{{ item.nodeName }} {{ item.nodeName }}
</div> </div>
</div> </div>
<div class="customizeFormBox"> <div class="customizeFormBox">
<CustomizeForm ref="customizeFormRef" /> <CustomizeForm ref="customizeFormRef" />
</div> </div>
</div> </div>
</template> </template>
...@@ -86,34 +84,59 @@ export default class DetectionOrderEdit extends PaginationComponent<Vehicle> { ...@@ -86,34 +84,59 @@ export default class DetectionOrderEdit extends PaginationComponent<Vehicle> {
const routeData = this.$route.query || {}; const routeData = this.$route.query || {};
DetectionController.inspectionNode(this.axios, { id: taskId, taskId: routeData.id }).then(response => { DetectionController.inspectionNode(this.axios, { id: taskId, taskId: routeData.id }).then(response => {
const nodeList = response?.data?.data || []; const nodeList = response?.data?.data || [];
if (taskId == 48) { const taskIdMap = {
this.inspectionNodeList = [{ 48: "车型信息",
id: 48, 60: "车身主图",
nodeName: "车型信息", 551: "工况视频"
childrenNodes: nodeList };
}]; if (taskIdMap[taskId]) {
} else if (taskId == 60) {
this.inspectionNodeList = [{ this.inspectionNodeList = [{
id: 60, id: taskId,
nodeName: "车身主图", nodeName: taskIdMap[taskId],
childrenNodes: nodeList
}];
} else if (taskId == 551) {
this.inspectionNodeList = [{
id: 551,
nodeName: "工况视频",
childrenNodes: nodeList childrenNodes: nodeList
}]; }];
} else { } else {
this.inspectionNodeList = nodeList; this.inspectionNodeList = nodeList;
} }
this.inspectionNodeList = this.inspectionNodeList.map(item => ({ ...item, childrenNodes: this.setDefaultData(item.childrenNodes || []) }));
this.$refs.customizeFormRef.init({ this.$refs.customizeFormRef.init({
customizeFormList: this.inspectionNodeList, customizeFormList: this.inspectionNodeList,
carTypeList: this.carTypeList, carTypeList: this.carTypeList,
activeNodeId: this.activeNodeId,
taskId: routeData.id,
}); });
}); });
} }
setDefaultData(list: any[] = []) {
const typeToKeyMap = {
text_input: 'valueText',
textarea_input: 'valueText',
number_input: 'valueText',
date_picker: 'valueText',
dropdown: 'valueKey',
radio_button_select: 'valueKey'
};
const defaultList = list.map(item => {
const inspectionValueList = item?.inspectionResultVO?.inspectionValueList || [];
let value = null;
if (inspectionValueList.length > 0) {
const key = typeToKeyMap[item.interactionType];
if (key) value = inspectionValueList[0][key] || '';
}
if (item.nodeName == '品牌') {
value = this.defaultData.carBrand || '';
}
if (item.nodeName == '车系') {
value = this.defaultData.carSeriesName || '';
}
return { ...item, resultStatus: item?.inspectionResultVO?.resultStatus == 3 ? true : false, value };
});
return defaultList;
}
handleNodeList(item: any) { handleNodeList(item: any) {
this.activeNodeId = item.id; this.activeNodeId = item.id;
this.getInspectionNodeData(this.activeNodeId); this.getInspectionNodeData(this.activeNodeId);
...@@ -122,10 +145,8 @@ export default class DetectionOrderEdit extends PaginationComponent<Vehicle> { ...@@ -122,10 +145,8 @@ export default class DetectionOrderEdit extends PaginationComponent<Vehicle> {
handleBack() { handleBack() {
this.$router.back(); this.$router.back();
} }
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
......
...@@ -31,6 +31,16 @@ export default class CustomizeFormButtonSelect extends Vue { ...@@ -31,6 +31,16 @@ export default class CustomizeFormButtonSelect extends Vue {
} }
} }
mounted() {
this.initData();
}
// 初始化数据
initData() {
this.pickerValue = this.item?.inspectionResultVO?.inspectionValueList?.filter(item => item.valueKey && item.interactionType == "button_select")?.map(item => item.valueKey) || [];
this.setupdate();
}
handleBut(item: { value: string }) { handleBut(item: { value: string }) {
if (item.value) { if (item.value) {
this.item.resultStatus = false; this.item.resultStatus = false;
......
...@@ -46,6 +46,16 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue { ...@@ -46,6 +46,16 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue {
} }
} }
mounted() {
this.initData();
}
// 初始化数据
initData() {
this.pickerValue = this.item?.inspectionResultVO?.inspectionValueList?.filter(item => item.valueText && item.interactionType == "image_upload")?.map(item => item.valueText) || [];
this.updateData();
}
getValidationRules() { getValidationRules() {
return JSON.parse(this.item.validationRules || "{}"); return JSON.parse(this.item.validationRules || "{}");
} }
...@@ -108,7 +118,7 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue { ...@@ -108,7 +118,7 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue {
.uploadPage { .uploadPage {
float: left; float: left;
width: calc(100% - 24px); width: calc(100% - 24px);
margin-left: 12px; margin-left: 6px;
} }
.uploadBox { .uploadBox {
...@@ -124,7 +134,6 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue { ...@@ -124,7 +134,6 @@ export default class CustomizeFormButtonSelectUploadFile extends Vue {
cursor: pointer; cursor: pointer;
} }
.plusBox { .plusBox {
float: left; float: left;
margin-top: 22px; margin-top: 22px;
......
...@@ -59,6 +59,17 @@ export default class CustomizeFormUploadFile extends Vue { ...@@ -59,6 +59,17 @@ export default class CustomizeFormUploadFile extends Vue {
videoVisible: boolean = false; videoVisible: boolean = false;
videoUrl: string = ""; videoUrl: string = "";
mounted() {
this.initData();
}
// 初始化数据
initData() {
this.pickerValue = this.item?.inspectionResultVO?.inspectionValueList?.filter(item => item.valueText)?.map(item => item.valueText) || [];
this.updateData();
}
getValidationRules() { getValidationRules() {
return JSON.parse(this.item.validationRules || "{}"); return JSON.parse(this.item.validationRules || "{}");
} }
...@@ -129,7 +140,7 @@ export default class CustomizeFormUploadFile extends Vue { ...@@ -129,7 +140,7 @@ export default class CustomizeFormUploadFile extends Vue {
.uploadPage { .uploadPage {
float: left; float: left;
width: calc(100% - 24px); width: calc(100% - 24px);
margin-left: 12px; margin-left: 6px;
} }
.uploadBox { .uploadBox {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!