diff --git a/pages/eight_assignments/break_ground/apply.vue b/pages/eight_assignments/break_ground/apply.vue index a527134..a75a300 100644 --- a/pages/eight_assignments/break_ground/apply.vue +++ b/pages/eight_assignments/break_ground/apply.vue @@ -114,7 +114,7 @@ export default { {name: '作业地点', key_name: 'WORK_PLACE', type: 0}, {name: '作业内容', key_name: 'JOB_CONTENT', type: 0}, {name: '作业内容、范围、方式', key_name: 'WORK_CONTENT', type: 0}, - {name: '作业内容、范围、方式简图', key_name: 'CONTENT_IMG_PATH', type: 1}, + {name: '作业内容、范围、方式简图', key_name: 'CONTENT_IMG_PATH', type: 1, oldUrl: ''}, {name: '关联的其他特殊作业及安全作业票编号', key_name: 'SPECIAL_WORK', type: 0}, {name: '风险辨识结果', key_name: 'RISK_IDENTIFICATION', type: 0}, {name: '申请人签字', key_name: 'SIGN', type: 5}, diff --git a/utils/submitHomeworkProcess.js b/utils/submitHomeworkProcess.js index f0d247c..9fb0566 100644 --- a/utils/submitHomeworkProcess.js +++ b/utils/submitHomeworkProcess.js @@ -28,7 +28,7 @@ const processFormData = async (formData, formItems) => { const currentItem = uni.$u.deepClone(formData[formItem.key_name]) const codeList = [] for (let j = 0; j < currentItem.length; j++) { - const {CODE} = await setTaskFile({formData: {type: 0}, name: 'files', filePath: currentItem[j].url}) + const {CODE} = await setTaskFile({formData: {type: currentItem[j].oldUrl}, name: 'files', filePath: currentItem[j].url}) codeList.push(CODE) } obj.ITEM_VALUE = '' @@ -52,7 +52,7 @@ const processFormData = async (formData, formItems) => { } if (formItem.type === 5) { if (typeof formData[formItem.key_name] === 'string') { - const {CODE} = await setTaskFile({formData: {type: 0}, name: 'files', filePath: formData[formItem.key_name]}) + const {CODE} = await setTaskFile({formData: {type: formData[formItem.key_name + 'oldUrl']}, name: 'files', filePath: formData[formItem.key_name]}) obj.ITEM_VALUE = CODE } else { throw Error('签字只支持字符串') @@ -269,6 +269,7 @@ export const getData = async (taskId) => { if (item.TYPE === 1) { form[item.ITEM_NAME] = item.list.map((item) => ({ url: filePath + item.ITEM_VALUE, + oldUrl: item.ITEM_VALUE })); } if (item.TYPE === 4) { @@ -283,6 +284,7 @@ export const getData = async (taskId) => { } if (item.TYPE === 5) { form[item.ITEM_NAME] = filePath + item.ITEM_VALUE; + form[item.ITEM_NAME + 'oldUrl'] = item.ITEM_VALUE; } }); return form;