diff --git a/src/views/firstLevelDoor/freightVehiclesPort/fleetFilingApplication/components/apply.vue b/src/views/firstLevelDoor/freightVehiclesPort/fleetFilingApplication/components/apply.vue index 09362cc..022b30d 100644 --- a/src/views/firstLevelDoor/freightVehiclesPort/fleetFilingApplication/components/apply.vue +++ b/src/views/firstLevelDoor/freightVehiclesPort/fleetFilingApplication/components/apply.vue @@ -2,32 +2,65 @@
- - - - -
- -
-
- - - - - -
-
+ + + 点击上传 + + 智能口门管理系统账号申请单 + + + + + 点击上传 + + 智能口门管理系统使用承诺书 + + + + + 点击上传 + + 营业执照 + + + + + 点击上传 + + 道路运输经营许可证 + + + + + 点击上传 + + 危险化学品经营许可证 +
@@ -52,6 +85,7 @@ export default { page: 1, limit: 10 }, + uploadUrl: config.httpurl + '/mkmj/management/fileUpload', config: config, areaList: [], // 省市县列表 placeList: [], @@ -93,7 +127,6 @@ export default { }, async created() { this.getList() - this.getUploadedFiles() }, methods: { // 搜索 @@ -115,6 +148,52 @@ export default { } this.getList() }, + beforeUpload(file) { + //文件格式限制 + const isJPG = file.type === 'image/jpeg'; + const isPNG = file.type === 'image/png'; + + if (!isJPG && !isPNG) { + this.$message.error('上传图片只能是 JPG 或 PNG 格式!'); + return false; + } + // 文件上传前的校验逻辑 + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.$message.error('上传文件大小不能超过 2MB!'); + } + return isLt2M; + }, + REQUISITION_FILESuccess(response, file) { + this.form.REQUISITION_FILE = response.uploadPath; + }, + REQUISITION_FILERemove(){ + this.form.REQUISITION_FILE = '' + }, + COMMITMENT_FILESuccess(response, file) { + this.form.COMMITMENT_FILE = response.uploadPath; + }, + COMMITMENT_FILERemove(){ + this.form.COMMITMENT_FILE = '' + }, + LICENSE_FILESuccess(response, file) { + this.form.LICENSE_FILE = response.uploadPath; + }, + LICENSE_FILERemove(){ + this.form.LICENSE_FILE = '' + }, + TRANSPORT_PERMIT_FILESuccess(response, file) { + this.form.TRANSPORT_PERMIT_FILE = response.uploadPath; + }, + TRANSPORT_PERMIT_FILERemove(){ + this.form.TRANSPORT_PERMIT_FILE = '' + }, + HAZARDOUS_CHEMICALS_FILESuccess(response, file) { + this.form.HAZARDOUS_CHEMICALS_FILE = response.uploadPath; + }, + HAZARDOUS_CHEMICALS_FILERemove() { + this.form.HAZARDOUS_CHEMICALS_FILE = '' + }, // 获取列表 getList() { this.listLoading = true @@ -125,8 +204,15 @@ export default { this.listLoading = false this.varList = data.carInfoList this.total = data.page.totalResult - this.hasButton() this.pd = data.pd + this.form.REQUISITION_FILE = data.motorcadeList[0].REQUISITION_FILE + this.form.COMMITMENT_FILE = data.motorcadeList[0].COMMITMENT_FILE + this.form.LICENSE_FILE = data.motorcadeList[0].LICENSE_FILE + this.form.TRANSPORT_PERMIT_FILE = data.motorcadeList[0].TRANSPORT_PERMIT_FILE + this.form.HAZARDOUS_CHEMICALS_FILE = data.motorcadeList[0].HAZARDOUS_CHEMICALS_FILE + console.log('------------------------') + console.log(this.form.REQUISITION_FILE) + this.hasButton() }).catch((e) => { this.listLoading = false }) @@ -139,82 +225,22 @@ export default { configItem.hideUpload = fileList.length >= 1; } }, - // 通用文件上传处理 - handleChange(file, fileList, prop) { - const types = ['image/jpeg', 'image/jpg', 'image/png']; - const isImage = types.includes(file.raw.type); - if (!isImage) { - this.$message.error('上传图片只能是 JPG、JPEG、PNG 格式!'); - fileList.pop(); - this.form[prop] = []; - return; - } - this.form[prop] = []; - this.form[prop].push(file); - const configItem = this.uploadConfig.find(item => item.prop === prop); - if (configItem) { - configItem.hideUpload = fileList.length >= 1; - } - }, - getUploadedFiles() { - try { - this.listLoading = true - requestFN( - '/mkmj/management/getUploadedFiles',{ - MOTORCADE_ID :this.form.MOTORCADE_ID - } - ).then((data) => { - console.log(data) - console.info(data) - this.urlfromdsfe = data.corpFilingApplicationEntity - console.info(this.urlfromdsfe) - if (this.urlfromdsfe) { - this.uploadConfig.forEach(item => { - if (this.urlfromdsfe[item.prop]) { - this.form[item.prop] = [{ - url: this.config.fileUrl + this.urlfromdsfe[item.prop], - name: this.urlfromdsfe[item.prop].split('/').pop() - }]; - } - }); - } - - this.listLoading = false; - }).catch((e) => { - this.listLoading = false - }) - - - - } catch (error) { - console.error('获取已上传文件失败', error); - } - }, confirm() { this.listLoading = true; - console.log(this.form); - const formData = new FormData(); - formData.append('CORPINFO_ID', this.form.CORPINFO_ID); - formData.append("MOTORCADE_ID",this.form.MOTORCADE_ID); - formData.append('REQUISITION_FILE', this.form.REQUISITION_FILE[0].raw); - formData.append('COMMITMENT_FILE', this.form.COMMITMENT_FILE[0].raw); - formData.append('LICENSE_FILE', this.form.LICENSE_FILE[0].raw); - formData.append('TRANSPORT_PERMIT_FILE', this.form.TRANSPORT_PERMIT_FILE[0].raw); - formData.append('HAZARDOUS_CHEMICALS_FILE', this.form.HAZARDOUS_CHEMICALS_FILE[0].raw); - - console.log(formData); // 打印 FormData 对象 - - upload( - '/mkmj/management/fleetFilingApply', - formData - ).then(response => { - console.log('上传成功', response); - this.listLoading = false; - this.goBack() - }).catch(error => { - console.error('上传失败', error); - this.listLoading = false; - }); + this.$refs.form.validate(valid => { + if (valid) { + requestFN( + '/mkmj/management/fleetFilingApply', + this.form + ).then((data) => { + console.log(data) + this.goBack() + this.listLoading = false + }).catch((e) => { + this.listLoading = false + }) + } + }) }, goBack() { this.$parent.activeName = 'List' diff --git a/src/views/firstLevelDoor/freightVehiclesPort/fleetFilingApplication/components/list.vue b/src/views/firstLevelDoor/freightVehiclesPort/fleetFilingApplication/components/list.vue index 4bae605..f213b37 100644 --- a/src/views/firstLevelDoor/freightVehiclesPort/fleetFilingApplication/components/list.vue +++ b/src/views/firstLevelDoor/freightVehiclesPort/fleetFilingApplication/components/list.vue @@ -70,8 +70,8 @@ - - + + @@ -130,9 +130,13 @@ export default{ methods: { getAuditType(IS_AUDIT){ if (IS_AUDIT === '1'){ + return '待审核' + }else if (IS_AUDIT === '2'){ return '审核通过' + }else if (IS_AUDIT === '0'){ + return '审核驳回' }else { - return '未审核' + return '待申请' } }, // 搜索 @@ -187,22 +191,27 @@ export default{ }, handleEdit(row){ this.form.MOTORCADE_ID = row.MOTORCADE_ID + this.form.ADD_MOTORCADE_NAME = row.MOTORCADE_NAME this.editLoading = true }, editMotorcade(){ - requestFN( - '/mkmj/management/motorcadeInfoManagement', - { - MOTORCADE_ID : this.form.MOTORCADE_ID, - MOTORCADE_NAME: this.form.ADD_MOTORCADE_NAME, - CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID + this.$refs.form.validate((valid) => { + if (valid) { + requestFN( + '/mkmj/management/motorcadeInfoManagement', + { + MOTORCADE_ID : this.form.MOTORCADE_ID, + MOTORCADE_NAME: this.form.ADD_MOTORCADE_NAME, + CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID + } + ).then((data) => { + this.editLoading = false + this.form.MOTORCADE_NAME = '' + this.getQuery() + }).catch((e) => { + this.editLoading = false + }) } - ).then((data) => { - this.editLoading = false - this.form.MOTORCADE_NAME = '' - this.getQuery() - }).catch((e) => { - this.editLoading = false }) }, handleDelete(row) { @@ -219,10 +228,22 @@ export default{ ).then((data) => { this.listLoading = false this.getList() + this.$message({ + type: 'success', + message: '删除成功!' + }) }).catch((e) => { this.listLoading = false + this.$message({ + type: 'error', + message: '删除失败!' + }) }) }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }) }) }, getAuditInfo(row) { diff --git a/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue b/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue index d277c75..c076774 100644 --- a/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue +++ b/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue @@ -116,10 +116,12 @@ 点击上传 + 驾驶证 @@ -127,10 +129,12 @@ 点击上传 + 绿本 @@ -138,10 +142,12 @@ 点击上传 + 环保随车清单 @@ -149,10 +155,12 @@ 点击上传 + 出厂合格证 @@ -160,10 +168,12 @@ 点击上传 + 环保信息截图